diff --git a/gen/abusiveexperiencereport1-cli/Cargo.toml b/gen/abusiveexperiencereport1-cli/Cargo.toml index b25b9a380c..0b3ed8ef6c 100644 --- a/gen/abusiveexperiencereport1-cli/Cargo.toml +++ b/gen/abusiveexperiencereport1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-abusiveexperiencereport1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Abusive Experience Report (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/abusiveexperiencereport1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-abusiveexperiencereport1] path = "../abusiveexperiencereport1" -version = "1.0.12+20190624" +version = "1.0.13+20200405" diff --git a/gen/abusiveexperiencereport1-cli/README.md b/gen/abusiveexperiencereport1-cli/README.md index 3806caf875..e22feb946e 100644 --- a/gen/abusiveexperiencereport1-cli/README.md +++ b/gen/abusiveexperiencereport1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Abusive Experience Report* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Abusive Experience Report* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash abusiveexperiencereport1 [options] @@ -36,10 +36,6 @@ abusiveexperiencereport1 [options] abusiveexperiencereport1 --help Configuration: - [--scope ]... - Specify the authentication a method should be executed in. Each scope - requires the user to grant this application permission to use it. - If unset, it defaults to the shortest scope url for a particular method. --config-dir A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation. diff --git a/gen/abusiveexperiencereport1-cli/mkdocs.yml b/gen/abusiveexperiencereport1-cli/mkdocs.yml index f38ba1b999..0f48cd70c2 100644 --- a/gen/abusiveexperiencereport1-cli/mkdocs.yml +++ b/gen/abusiveexperiencereport1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Abusive Experience Report v1.0.12+20190624 +site_name: Abusive Experience Report v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-abusiveexperiencereport1-cli site_description: A complete library to interact with Abusive Experience Report (protocol v1) diff --git a/gen/abusiveexperiencereport1-cli/src/main.rs b/gen/abusiveexperiencereport1-cli/src/main.rs index c22982abbf..ff0f8a3207 100644 --- a/gen/abusiveexperiencereport1-cli/src/main.rs +++ b/gen/abusiveexperiencereport1-cli/src/main.rs @@ -75,9 +75,6 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -127,9 +124,6 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -264,19 +258,15 @@ fn main() { let arg_data = [ ("sites", "methods: 'get'", vec![ ("get", - Some(r##"Gets a summary of the abusive experience rating of a site."##), + Some(r##"Gets a site's Abusive Experience Report summary."##), "Details at http://byron.github.io/google-apis-rs/google_abusiveexperiencereport1_cli/sites_get", vec![ (Some(r##"name"##), None, - Some(r##"The required site name. This is the site property whose abusive - experiences have been reviewed, and it must be URL-encoded. For example, - sites/https%3A%2F%2Fwww.google.com. The server will return an error of - BAD_REQUEST if this field is not filled in. Note that if the site property - is not yet verified in Search Console, the reportUrl field - returned by the API will lead to the verification page, prompting the user - to go through that process before they can gain access to the Abusive - Experience Report."##), + Some(r##"Required. The name of the site whose summary to get, e.g. + `sites/http%3A%2F%2Fwww.google.com%2F`. + + Format: `sites/{site}`"##), Some(true), Some(false)), @@ -296,7 +286,7 @@ fn main() { ("violating-sites", "methods: 'list'", vec![ ("list", - Some(r##"Lists sites with Abusive Experience Report statuses of "Failing"."##), + Some(r##"Lists sites that are failing in the Abusive Experience Report."##), "Details at http://byron.github.io/google-apis-rs/google_abusiveexperiencereport1_cli/violating-sites_list", vec![ (Some(r##"v"##), @@ -317,14 +307,9 @@ fn main() { let mut app = App::new("abusiveexperiencereport1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200405") .about("Views Abusive Experience Report data, and gets a list of sites that have a significant number of abusive experiences.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_abusiveexperiencereport1_cli") - .arg(Arg::with_name("url") - .long("scope") - .help("Specify the authentication a method should be executed in. Each scope requires the user to grant this application permission to use it.If unset, it defaults to the shortest scope url for a particular method.") - .multiple(true) - .takes_value(true)) .arg(Arg::with_name("folder") .long("config-dir") .help("A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation.[default: ~/.google-service-cli") diff --git a/gen/abusiveexperiencereport1/Cargo.toml b/gen/abusiveexperiencereport1/Cargo.toml index b7047e8826..e59d616da2 100644 --- a/gen/abusiveexperiencereport1/Cargo.toml +++ b/gen/abusiveexperiencereport1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-abusiveexperiencereport1" -version = "1.0.12+20190624" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Abusive Experience Report (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/abusiveexperiencereport1" homepage = "https://developers.google.com/abusive-experience-report/" -documentation = "https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624" +documentation = "https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405" license = "MIT" keywords = ["abusiveexperiencerep", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/abusiveexperiencereport1/README.md b/gen/abusiveexperiencereport1/README.md index 63f713bfc0..79ed8231a4 100644 --- a/gen/abusiveexperiencereport1/README.md +++ b/gen/abusiveexperiencereport1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-abusiveexperiencereport1` library allows access to all features of the *Google Abusive Experience Report* service. -This documentation was generated from *Abusive Experience Report* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *abusiveexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Abusive Experience Report* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *abusiveexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Abusive Experience Report* *v1* API can be found at the [official documentation site](https://developers.google.com/abusive-experience-report/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/struct.AbusiveExperienceReport.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/struct.AbusiveExperienceReport.html) ... * sites - * [*get*](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/struct.SiteGetCall.html) + * [*get*](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/struct.SiteGetCall.html) * violating sites - * [*list*](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/struct.ViolatingSiteListCall.html) + * [*list*](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/struct.ViolatingSiteListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/struct.AbusiveExperienceReport.html)** +* **[Hub](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/struct.AbusiveExperienceReport.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.Part.html)** + * **[Parts](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -126,17 +126,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -146,29 +146,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-abusiveexperiencereport1/1.0.12+20190624/google_abusiveexperiencereport1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-abusiveexperiencereport1/1.0.13+20200405/google_abusiveexperiencereport1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/abusiveexperiencereport1/src/lib.rs b/gen/abusiveexperiencereport1/src/lib.rs index d0eab37b0f..9f07cb1685 100644 --- a/gen/abusiveexperiencereport1/src/lib.rs +++ b/gen/abusiveexperiencereport1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Abusive Experience Report* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *abusiveexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Abusive Experience Report* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *abusiveexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Abusive Experience Report* *v1* API can be found at the //! [official documentation site](https://developers.google.com/abusive-experience-report/). @@ -220,28 +220,6 @@ pub use cmn::*; // UTILITIES ### // ############ -/// Identifies the an OAuth2 authorization scope. -/// A scope is needed when requesting an -/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). -#[derive(PartialEq, Eq, Hash)] -pub enum Scope { - /// Test scope for access to the Zoo service - XapiZoo, -} - -impl AsRef for Scope { - fn as_ref(&self) -> &str { - match *self { - Scope::XapiZoo => "https://www.googleapis.com/auth/xapi.zoo", - } - } -} - -impl Default for Scope { - fn default() -> Scope { - Scope::XapiZoo - } -} @@ -319,7 +297,7 @@ impl<'a, C, A> AbusiveExperienceReport AbusiveExperienceReport { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://abusiveexperiencereport.googleapis.com/".to_string(), _root_url: "https://abusiveexperiencereport.googleapis.com/".to_string(), } @@ -333,7 +311,7 @@ impl<'a, C, A> AbusiveExperienceReport } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -375,22 +353,36 @@ pub struct SiteSummaryResponse { /// Whether the site is currently under review. #[serde(rename="underReview")] pub under_review: Option, - /// The date on which enforcement begins. + /// The time at which + /// [enforcement](https://support.google.com/webtools/answer/7538608) against + /// the site began or will begin. + /// + /// Not set when the + /// filter_status + /// is OFF. #[serde(rename="enforcementTime")] pub enforcement_time: Option, - /// The last time that the site changed status. + /// The time at which the site's status last changed. #[serde(rename="lastChangeTime")] pub last_change_time: Option, - /// The name of the site reviewed. + /// The name of the reviewed site, e.g. `google.com`. #[serde(rename="reviewedSite")] pub reviewed_site: Option, - /// The abusive experience enforcement status of the site. + /// The site's [enforcement + /// status](https://support.google.com/webtools/answer/7538608). #[serde(rename="filterStatus")] pub filter_status: Option, - /// The status of the site reviewed for the abusive experiences. + /// The site's Abusive Experience Report status. #[serde(rename="abusiveStatus")] pub abusive_status: Option, - /// A link that leads to a full abusive experience report. + /// A link to the full Abusive Experience Report for the site. + /// + /// Not set in + /// ViolatingSitesResponse. + /// + /// Note that you must complete the [Search Console verification + /// process](https://support.google.com/webmasters/answer/9008080) for the site + /// before you can access the full report. #[serde(rename="reportUrl")] pub report_url: Option, } @@ -409,7 +401,7 @@ impl ResponseResult for SiteSummaryResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ViolatingSitesResponse { - /// A list of summaries of violating sites. + /// The list of violating sites. #[serde(rename="violatingSites")] pub violating_sites: Option>, } @@ -463,24 +455,18 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a summary of the abusive experience rating of a site. + /// Gets a site's Abusive Experience Report summary. /// /// # Arguments /// - /// * `name` - The required site name. This is the site property whose abusive - /// experiences have been reviewed, and it must be URL-encoded. For example, - /// sites/https%3A%2F%2Fwww.google.com. The server will return an error of - /// BAD_REQUEST if this field is not filled in. Note that if the site property - /// is not yet verified in Search Console, the reportUrl field - /// returned by the API will lead to the verification page, prompting the user - /// to go through that process before they can gain access to the Abusive - /// Experience Report. + /// * `name` - Required. The name of the site whose summary to get, e.g. + /// `sites/http%3A%2F%2Fwww.google.com%2F`. + /// Format: `sites/{site}` pub fn get(&self, name: &str) -> SiteGetCall<'a, C, A> { SiteGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), - _scopes: Default::default(), _additional_params: Default::default(), } } @@ -529,12 +515,11 @@ impl<'a, C, A> ViolatingSiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists sites with Abusive Experience Report statuses of "Failing". + /// Lists sites that are failing in the Abusive Experience Report. pub fn list(&self) -> ViolatingSiteListCall<'a, C, A> { ViolatingSiteListCall { hub: self.hub, _delegate: Default::default(), - _scopes: Default::default(), _additional_params: Default::default(), } } @@ -548,7 +533,7 @@ impl<'a, C, A> ViolatingSiteMethods<'a, C, A> { // CallBuilders ### // ################# -/// Gets a summary of the abusive experience rating of a site. +/// Gets a site's Abusive Experience Report summary. /// /// A builder for the *get* method supported by a *site* resource. /// It is not used directly, but through a `SiteMethods` instance. @@ -586,7 +571,6 @@ pub struct SiteGetCall<'a, C, A> _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, - _scopes: BTreeMap } impl<'a, C, A> CallBuilder for SiteGetCall<'a, C, A> {} @@ -621,8 +605,17 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::XapiZoo.as_ref().to_string(), ()); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } } for &(find_this, param_name) in [("{+name}", "name")].iter() { @@ -655,24 +648,10 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(UserAgent(self.hub._user_agent.clone())); dlg.pre_request(); req.send() @@ -723,14 +702,10 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth } - /// The required site name. This is the site property whose abusive - /// experiences have been reviewed, and it must be URL-encoded. For example, - /// sites/https%3A%2F%2Fwww.google.com. The server will return an error of - /// BAD_REQUEST if this field is not filled in. Note that if the site property - /// is not yet verified in Search Console, the reportUrl field - /// returned by the API will lead to the verification page, prompting the user - /// to go through that process before they can gain access to the Abusive - /// Experience Report. + /// Required. The name of the site whose summary to get, e.g. + /// `sites/http%3A%2F%2Fwww.google.com%2F`. + /// + /// Format: `sites/{site}` /// /// Sets the *name* path property to the given value. /// @@ -777,33 +752,10 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth self } - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::XapiZoo`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } } -/// Lists sites with Abusive Experience Report statuses of "Failing". +/// Lists sites that are failing in the Abusive Experience Report. /// /// A builder for the *list* method supported by a *violatingSite* resource. /// It is not used directly, but through a `ViolatingSiteMethods` instance. @@ -840,7 +792,6 @@ pub struct ViolatingSiteListCall<'a, C, A> hub: &'a AbusiveExperienceReport, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, - _scopes: BTreeMap } impl<'a, C, A> CallBuilder for ViolatingSiteListCall<'a, C, A> {} @@ -873,8 +824,17 @@ impl<'a, C, A> ViolatingSiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/violatingSites"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::XapiZoo.as_ref().to_string(), ()); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } } @@ -883,24 +843,10 @@ impl<'a, C, A> ViolatingSiteListCall<'a, C, A> where C: BorrowMut loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(UserAgent(self.hub._user_agent.clone())); dlg.pre_request(); req.send() @@ -988,29 +934,6 @@ impl<'a, C, A> ViolatingSiteListCall<'a, C, A> where C: BorrowMut self } - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::XapiZoo`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ViolatingSiteListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } } diff --git a/gen/acceleratedmobilepageurl1-cli/Cargo.toml b/gen/acceleratedmobilepageurl1-cli/Cargo.toml index 961bc87838..6e3ff3386b 100644 --- a/gen/acceleratedmobilepageurl1-cli/Cargo.toml +++ b/gen/acceleratedmobilepageurl1-cli/Cargo.toml @@ -4,9 +4,9 @@ [package] name = "google-acceleratedmobilepageurl1-cli" -version = "1.0.12+20190619" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] -description = "A complete library to interact with acceleratedmobilepageurl (protocol v1)" +description = "A complete library to interact with Acceleratedmobilepageurl (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/acceleratedmobilepageurl1-cli" homepage = "https://developers.google.com/amp/cache/" documentation = "http://byron.github.io/google-apis-rs/google_acceleratedmobilepageurl1_cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-acceleratedmobilepageurl1] path = "../acceleratedmobilepageurl1" -version = "1.0.12+20190619" +version = "1.0.13+20200409" diff --git a/gen/acceleratedmobilepageurl1-cli/README.md b/gen/acceleratedmobilepageurl1-cli/README.md index d71b018946..785284b26f 100644 --- a/gen/acceleratedmobilepageurl1-cli/README.md +++ b/gen/acceleratedmobilepageurl1-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `acceleratedmobilepageurl1` command-line interface *(CLI)* allows to use most features of the *Google acceleratedmobilepageurl* service from the comfort of your terminal. +The `acceleratedmobilepageurl1` command-line interface *(CLI)* allows to use most features of the *Google Acceleratedmobilepageurl* service from the comfort of your terminal. By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. -Everything else about the *acceleratedmobilepageurl* API can be found at the +Everything else about the *Acceleratedmobilepageurl* API can be found at the [official documentation site](https://developers.google.com/amp/cache/). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *acceleratedmobilepageurl* API at revision *20190619*. The CLI is at version *1.0.12*. +This documentation was generated from the *Acceleratedmobilepageurl* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash acceleratedmobilepageurl1 [options] diff --git a/gen/acceleratedmobilepageurl1-cli/mkdocs.yml b/gen/acceleratedmobilepageurl1-cli/mkdocs.yml index 0964ded8a7..440dba5562 100644 --- a/gen/acceleratedmobilepageurl1-cli/mkdocs.yml +++ b/gen/acceleratedmobilepageurl1-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: acceleratedmobilepageurl v1.0.12+20190619 +site_name: Acceleratedmobilepageurl v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-acceleratedmobilepageurl1-cli -site_description: A complete library to interact with acceleratedmobilepageurl (protocol v1) +site_description: A complete library to interact with Acceleratedmobilepageurl (protocol v1) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/acceleratedmobilepageurl1-cli diff --git a/gen/acceleratedmobilepageurl1-cli/src/main.rs b/gen/acceleratedmobilepageurl1-cli/src/main.rs index a7a54c94da..5acef356b8 100644 --- a/gen/acceleratedmobilepageurl1-cli/src/main.rs +++ b/gen/acceleratedmobilepageurl1-cli/src/main.rs @@ -260,7 +260,7 @@ fn main() { let mut app = App::new("acceleratedmobilepageurl1") .author("Sebastian Thiel ") - .version("1.0.12+20190619") + .version("1.0.13+20200409") .about("Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s). ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_acceleratedmobilepageurl1_cli") diff --git a/gen/acceleratedmobilepageurl1/Cargo.toml b/gen/acceleratedmobilepageurl1/Cargo.toml index 0d112f7e79..9573039bc4 100644 --- a/gen/acceleratedmobilepageurl1/Cargo.toml +++ b/gen/acceleratedmobilepageurl1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-acceleratedmobilepageurl1" -version = "1.0.12+20190619" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] -description = "A complete library to interact with acceleratedmobilepageurl (protocol v1)" +description = "A complete library to interact with Acceleratedmobilepageurl (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/acceleratedmobilepageurl1" homepage = "https://developers.google.com/amp/cache/" -documentation = "https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619" +documentation = "https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409" license = "MIT" keywords = ["acceleratedmobilepag", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/acceleratedmobilepageurl1/README.md b/gen/acceleratedmobilepageurl1/README.md index 29313e615f..e4f66a8b06 100644 --- a/gen/acceleratedmobilepageurl1/README.md +++ b/gen/acceleratedmobilepageurl1/README.md @@ -3,18 +3,18 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-acceleratedmobilepageurl1` library allows access to all features of the *Google acceleratedmobilepageurl* service. +The `google-acceleratedmobilepageurl1` library allows access to all features of the *Google Acceleratedmobilepageurl* service. -This documentation was generated from *acceleratedmobilepageurl* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *acceleratedmobilepageurl:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Acceleratedmobilepageurl* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *acceleratedmobilepageurl:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. -Everything else about the *acceleratedmobilepageurl* *v1* API can be found at the +Everything else about the *Acceleratedmobilepageurl* *v1* API can be found at the [official documentation site](https://developers.google.com/amp/cache/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/struct.Acceleratedmobilepageurl.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/struct.Acceleratedmobilepageurl.html) ... -* [amp urls](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/struct.AmpUrl.html) - * [*batch get*](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/struct.AmpUrlBatchGetCall.html) +* [amp urls](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/struct.AmpUrl.html) + * [*batch get*](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/struct.AmpUrlBatchGetCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/struct.Acceleratedmobilepageurl.html)** +* **[Hub](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/struct.Acceleratedmobilepageurl.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.Part.html)** + * **[Parts](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-acceleratedmobilepageurl1/1.0.12+20190619/google_acceleratedmobilepageurl1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-acceleratedmobilepageurl1/1.0.13+20200409/google_acceleratedmobilepageurl1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/acceleratedmobilepageurl1/src/lib.rs b/gen/acceleratedmobilepageurl1/src/lib.rs index 3507948f5a..f79ba1217d 100644 --- a/gen/acceleratedmobilepageurl1/src/lib.rs +++ b/gen/acceleratedmobilepageurl1/src/lib.rs @@ -2,9 +2,9 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *acceleratedmobilepageurl* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *acceleratedmobilepageurl:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Acceleratedmobilepageurl* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *acceleratedmobilepageurl:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! -//! Everything else about the *acceleratedmobilepageurl* *v1* API can be found at the +//! Everything else about the *Acceleratedmobilepageurl* *v1* API can be found at the //! [official documentation site](https://developers.google.com/amp/cache/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/acceleratedmobilepageurl1). //! # Features @@ -307,7 +307,7 @@ impl<'a, C, A> Acceleratedmobilepageurl Acceleratedmobilepageurl { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://acceleratedmobilepageurl.googleapis.com/".to_string(), _root_url: "https://acceleratedmobilepageurl.googleapis.com/".to_string(), } @@ -318,7 +318,7 @@ impl<'a, C, A> Acceleratedmobilepageurl } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/accessapproval1_beta1-cli/Cargo.toml b/gen/accessapproval1_beta1-cli/Cargo.toml index bb4e129117..019d85946f 100644 --- a/gen/accessapproval1_beta1-cli/Cargo.toml +++ b/gen/accessapproval1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-accessapproval1_beta1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Access Approval (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/accessapproval1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-accessapproval1_beta1] path = "../accessapproval1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200409" diff --git a/gen/accessapproval1_beta1-cli/README.md b/gen/accessapproval1_beta1-cli/README.md index 6928573329..4c06bde708 100644 --- a/gen/accessapproval1_beta1-cli/README.md +++ b/gen/accessapproval1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Access Approval* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Access Approval* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash accessapproval1-beta1 [options] @@ -34,6 +34,7 @@ accessapproval1-beta1 [options] approval-requests-dismiss (-r )... [-p ]... [-o ] approval-requests-get [-p ]... [-o ] approval-requests-list [-p ]... [-o ] + delete-access-approval-settings [-p ]... [-o ] get-access-approval-settings [-p ]... [-o ] update-access-approval-settings (-r )... [-p ]... [-o ] organizations @@ -41,6 +42,7 @@ accessapproval1-beta1 [options] approval-requests-dismiss (-r )... [-p ]... [-o ] approval-requests-get [-p ]... [-o ] approval-requests-list [-p ]... [-o ] + delete-access-approval-settings [-p ]... [-o ] get-access-approval-settings [-p ]... [-o ] update-access-approval-settings (-r )... [-p ]... [-o ] projects @@ -48,6 +50,7 @@ accessapproval1-beta1 [options] approval-requests-dismiss (-r )... [-p ]... [-o ] approval-requests-get [-p ]... [-o ] approval-requests-list [-p ]... [-o ] + delete-access-approval-settings [-p ]... [-o ] get-access-approval-settings [-p ]... [-o ] update-access-approval-settings (-r )... [-p ]... [-o ] accessapproval1-beta1 --help diff --git a/gen/accessapproval1_beta1-cli/mkdocs.yml b/gen/accessapproval1_beta1-cli/mkdocs.yml index f85dea7e99..87074fc7b1 100644 --- a/gen/accessapproval1_beta1-cli/mkdocs.yml +++ b/gen/accessapproval1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Access Approval v1.0.12+20190628 +site_name: Access Approval v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-accessapproval1_beta1-cli site_description: A complete library to interact with Access Approval (protocol v1beta1) @@ -13,18 +13,21 @@ pages: - ['folders_approval-requests-dismiss.md', 'Folders', 'Approval Requests Dismiss'] - ['folders_approval-requests-get.md', 'Folders', 'Approval Requests Get'] - ['folders_approval-requests-list.md', 'Folders', 'Approval Requests List'] +- ['folders_delete-access-approval-settings.md', 'Folders', 'Delete Access Approval Settings'] - ['folders_get-access-approval-settings.md', 'Folders', 'Get Access Approval Settings'] - ['folders_update-access-approval-settings.md', 'Folders', 'Update Access Approval Settings'] - ['organizations_approval-requests-approve.md', 'Organizations', 'Approval Requests Approve'] - ['organizations_approval-requests-dismiss.md', 'Organizations', 'Approval Requests Dismiss'] - ['organizations_approval-requests-get.md', 'Organizations', 'Approval Requests Get'] - ['organizations_approval-requests-list.md', 'Organizations', 'Approval Requests List'] +- ['organizations_delete-access-approval-settings.md', 'Organizations', 'Delete Access Approval Settings'] - ['organizations_get-access-approval-settings.md', 'Organizations', 'Get Access Approval Settings'] - ['organizations_update-access-approval-settings.md', 'Organizations', 'Update Access Approval Settings'] - ['projects_approval-requests-approve.md', 'Projects', 'Approval Requests Approve'] - ['projects_approval-requests-dismiss.md', 'Projects', 'Approval Requests Dismiss'] - ['projects_approval-requests-get.md', 'Projects', 'Approval Requests Get'] - ['projects_approval-requests-list.md', 'Projects', 'Approval Requests List'] +- ['projects_delete-access-approval-settings.md', 'Projects', 'Delete Access Approval Settings'] - ['projects_get-access-approval-settings.md', 'Projects', 'Get Access Approval Settings'] - ['projects_update-access-approval-settings.md', 'Projects', 'Update Access Approval Settings'] diff --git a/gen/accessapproval1_beta1-cli/src/main.rs b/gen/accessapproval1_beta1-cli/src/main.rs index 8ec9dad350..46e63d1441 100644 --- a/gen/accessapproval1_beta1-cli/src/main.rs +++ b/gen/accessapproval1_beta1-cli/src/main.rs @@ -329,6 +329,58 @@ impl<'n> Engine<'n> { } } + fn _folders_delete_access_approval_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.folders().delete_access_approval_settings(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _folders_get_access_approval_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.folders().get_access_approval_settings(opt.value_of("name").unwrap_or("")); @@ -404,10 +456,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "enrolled-ancestor" => Some(("enrolledAncestor", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notification-emails" => Some(("notificationEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "notification-emails"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["enrolled-ancestor", "name", "notification-emails"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -421,6 +474,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -434,6 +490,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } @@ -750,6 +807,58 @@ impl<'n> Engine<'n> { } } + fn _organizations_delete_access_approval_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().delete_access_approval_settings(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _organizations_get_access_approval_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.organizations().get_access_approval_settings(opt.value_of("name").unwrap_or("")); @@ -825,10 +934,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "enrolled-ancestor" => Some(("enrolledAncestor", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notification-emails" => Some(("notificationEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "notification-emails"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["enrolled-ancestor", "name", "notification-emails"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -842,6 +952,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -855,6 +968,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } @@ -1171,6 +1285,58 @@ impl<'n> Engine<'n> { } } + fn _projects_delete_access_approval_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().delete_access_approval_settings(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_get_access_approval_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().get_access_approval_settings(opt.value_of("name").unwrap_or("")); @@ -1246,10 +1412,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "enrolled-ancestor" => Some(("enrolledAncestor", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notification-emails" => Some(("notificationEmails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "notification-emails"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["enrolled-ancestor", "name", "notification-emails"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1263,6 +1430,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1276,6 +1446,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); v } )); } } @@ -1328,6 +1499,9 @@ impl<'n> Engine<'n> { ("approval-requests-list", Some(opt)) => { call_result = self._folders_approval_requests_list(opt, dry_run, &mut err); }, + ("delete-access-approval-settings", Some(opt)) => { + call_result = self._folders_delete_access_approval_settings(opt, dry_run, &mut err); + }, ("get-access-approval-settings", Some(opt)) => { call_result = self._folders_get_access_approval_settings(opt, dry_run, &mut err); }, @@ -1354,6 +1528,9 @@ impl<'n> Engine<'n> { ("approval-requests-list", Some(opt)) => { call_result = self._organizations_approval_requests_list(opt, dry_run, &mut err); }, + ("delete-access-approval-settings", Some(opt)) => { + call_result = self._organizations_delete_access_approval_settings(opt, dry_run, &mut err); + }, ("get-access-approval-settings", Some(opt)) => { call_result = self._organizations_get_access_approval_settings(opt, dry_run, &mut err); }, @@ -1380,6 +1557,9 @@ impl<'n> Engine<'n> { ("approval-requests-list", Some(opt)) => { call_result = self._projects_approval_requests_list(opt, dry_run, &mut err); }, + ("delete-access-approval-settings", Some(opt)) => { + call_result = self._projects_delete_access_approval_settings(opt, dry_run, &mut err); + }, ("get-access-approval-settings", Some(opt)) => { call_result = self._projects_get_access_approval_settings(opt, dry_run, &mut err); }, @@ -1477,7 +1657,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("folders", "methods: 'approval-requests-approve', 'approval-requests-dismiss', 'approval-requests-get', 'approval-requests-list', 'get-access-approval-settings' and 'update-access-approval-settings'", vec![ + ("folders", "methods: 'approval-requests-approve', 'approval-requests-dismiss', 'approval-requests-get', 'approval-requests-list', 'delete-access-approval-settings', 'get-access-approval-settings' and 'update-access-approval-settings'", vec![ ("approval-requests-approve", Some(r##"Approves a request and returns the updated ApprovalRequest. @@ -1587,6 +1767,33 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete-access-approval-settings", + Some(r##"Deletes the settings associated with a project, folder, or organization. + This will have the effect of disabling Access Approval for the project, + folder, or organization, but only if all ancestors also have Access + Approval disabled. If Access Approval is enabled at a higher level of the + hierarchy, then Access Approval will still be enabled at this level as + the settings are inherited."##), + "Details at http://byron.github.io/google-apis-rs/google_accessapproval1_beta1_cli/folders_delete-access-approval-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Name of the AccessApprovalSettings to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1617,7 +1824,7 @@ fn main() { ]), ("update-access-approval-settings", Some(r##"Updates the settings associated with a project, folder, or organization. - Completely replaces the existing settings."##), + Settings to update are determined by the value of field_mask."##), "Details at http://byron.github.io/google-apis-rs/google_accessapproval1_beta1_cli/folders_update-access-approval-settings", vec![ (Some(r##"name"##), @@ -1651,7 +1858,7 @@ fn main() { ]), ]), - ("organizations", "methods: 'approval-requests-approve', 'approval-requests-dismiss', 'approval-requests-get', 'approval-requests-list', 'get-access-approval-settings' and 'update-access-approval-settings'", vec![ + ("organizations", "methods: 'approval-requests-approve', 'approval-requests-dismiss', 'approval-requests-get', 'approval-requests-list', 'delete-access-approval-settings', 'get-access-approval-settings' and 'update-access-approval-settings'", vec![ ("approval-requests-approve", Some(r##"Approves a request and returns the updated ApprovalRequest. @@ -1761,6 +1968,33 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete-access-approval-settings", + Some(r##"Deletes the settings associated with a project, folder, or organization. + This will have the effect of disabling Access Approval for the project, + folder, or organization, but only if all ancestors also have Access + Approval disabled. If Access Approval is enabled at a higher level of the + hierarchy, then Access Approval will still be enabled at this level as + the settings are inherited."##), + "Details at http://byron.github.io/google-apis-rs/google_accessapproval1_beta1_cli/organizations_delete-access-approval-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Name of the AccessApprovalSettings to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1791,7 +2025,7 @@ fn main() { ]), ("update-access-approval-settings", Some(r##"Updates the settings associated with a project, folder, or organization. - Completely replaces the existing settings."##), + Settings to update are determined by the value of field_mask."##), "Details at http://byron.github.io/google-apis-rs/google_accessapproval1_beta1_cli/organizations_update-access-approval-settings", vec![ (Some(r##"name"##), @@ -1825,7 +2059,7 @@ fn main() { ]), ]), - ("projects", "methods: 'approval-requests-approve', 'approval-requests-dismiss', 'approval-requests-get', 'approval-requests-list', 'get-access-approval-settings' and 'update-access-approval-settings'", vec![ + ("projects", "methods: 'approval-requests-approve', 'approval-requests-dismiss', 'approval-requests-get', 'approval-requests-list', 'delete-access-approval-settings', 'get-access-approval-settings' and 'update-access-approval-settings'", vec![ ("approval-requests-approve", Some(r##"Approves a request and returns the updated ApprovalRequest. @@ -1935,6 +2169,33 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete-access-approval-settings", + Some(r##"Deletes the settings associated with a project, folder, or organization. + This will have the effect of disabling Access Approval for the project, + folder, or organization, but only if all ancestors also have Access + Approval disabled. If Access Approval is enabled at a higher level of the + hierarchy, then Access Approval will still be enabled at this level as + the settings are inherited."##), + "Details at http://byron.github.io/google-apis-rs/google_accessapproval1_beta1_cli/projects_delete-access-approval-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Name of the AccessApprovalSettings to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1965,7 +2226,7 @@ fn main() { ]), ("update-access-approval-settings", Some(r##"Updates the settings associated with a project, folder, or organization. - Completely replaces the existing settings."##), + Settings to update are determined by the value of field_mask."##), "Details at http://byron.github.io/google-apis-rs/google_accessapproval1_beta1_cli/projects_update-access-approval-settings", vec![ (Some(r##"name"##), @@ -2003,7 +2264,7 @@ fn main() { let mut app = App::new("accessapproval1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200409") .about("An API for controlling access to data by Google personnel.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_accessapproval1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/accessapproval1_beta1/Cargo.toml b/gen/accessapproval1_beta1/Cargo.toml index dbd1e2f856..691fc71eb8 100644 --- a/gen/accessapproval1_beta1/Cargo.toml +++ b/gen/accessapproval1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-accessapproval1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Access Approval (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/accessapproval1_beta1" homepage = "https://cloud.google.com/access-approval/docs" -documentation = "https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628" +documentation = "https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409" license = "MIT" keywords = ["accessapproval", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/accessapproval1_beta1/README.md b/gen/accessapproval1_beta1/README.md index a91c0f7755..d4f3904b2f 100644 --- a/gen/accessapproval1_beta1/README.md +++ b/gen/accessapproval1_beta1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-accessapproval1_beta1` library allows access to all features of the *Google Access Approval* service. -This documentation was generated from *Access Approval* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *accessapproval:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Access Approval* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *accessapproval:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Access Approval* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/access-approval/docs). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.AccessApproval.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.AccessApproval.html) ... * folders - * [*approval requests approve*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.FolderApprovalRequestApproveCall.html), [*approval requests dismiss*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.FolderApprovalRequestDismisCall.html), [*approval requests get*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.FolderApprovalRequestGetCall.html), [*approval requests list*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.FolderApprovalRequestListCall.html), [*get access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.FolderGetAccessApprovalSettingCall.html) and [*update access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.FolderUpdateAccessApprovalSettingCall.html) + * [*approval requests approve*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.FolderApprovalRequestApproveCall.html), [*approval requests dismiss*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.FolderApprovalRequestDismisCall.html), [*approval requests get*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.FolderApprovalRequestGetCall.html), [*approval requests list*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.FolderApprovalRequestListCall.html), [*delete access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.FolderDeleteAccessApprovalSettingCall.html), [*get access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.FolderGetAccessApprovalSettingCall.html) and [*update access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.FolderUpdateAccessApprovalSettingCall.html) * organizations - * [*approval requests approve*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.OrganizationApprovalRequestApproveCall.html), [*approval requests dismiss*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.OrganizationApprovalRequestDismisCall.html), [*approval requests get*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.OrganizationApprovalRequestGetCall.html), [*approval requests list*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.OrganizationApprovalRequestListCall.html), [*get access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.OrganizationGetAccessApprovalSettingCall.html) and [*update access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.OrganizationUpdateAccessApprovalSettingCall.html) + * [*approval requests approve*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.OrganizationApprovalRequestApproveCall.html), [*approval requests dismiss*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.OrganizationApprovalRequestDismisCall.html), [*approval requests get*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.OrganizationApprovalRequestGetCall.html), [*approval requests list*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.OrganizationApprovalRequestListCall.html), [*delete access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.OrganizationDeleteAccessApprovalSettingCall.html), [*get access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.OrganizationGetAccessApprovalSettingCall.html) and [*update access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.OrganizationUpdateAccessApprovalSettingCall.html) * projects - * [*approval requests approve*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.ProjectApprovalRequestApproveCall.html), [*approval requests dismiss*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.ProjectApprovalRequestDismisCall.html), [*approval requests get*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.ProjectApprovalRequestGetCall.html), [*approval requests list*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.ProjectApprovalRequestListCall.html), [*get access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.ProjectGetAccessApprovalSettingCall.html) and [*update access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.ProjectUpdateAccessApprovalSettingCall.html) + * [*approval requests approve*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.ProjectApprovalRequestApproveCall.html), [*approval requests dismiss*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.ProjectApprovalRequestDismisCall.html), [*approval requests get*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.ProjectApprovalRequestGetCall.html), [*approval requests list*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.ProjectApprovalRequestListCall.html), [*delete access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.ProjectDeleteAccessApprovalSettingCall.html), [*get access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.ProjectGetAccessApprovalSettingCall.html) and [*update access approval settings*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.ProjectUpdateAccessApprovalSettingCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/struct.AccessApproval.html)** +* **[Hub](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/struct.AccessApproval.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -142,17 +142,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -162,29 +162,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-accessapproval1_beta1/1.0.12+20190628/google_accessapproval1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-accessapproval1_beta1/1.0.13+20200409/google_accessapproval1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/accessapproval1_beta1/src/lib.rs b/gen/accessapproval1_beta1/src/lib.rs index 4cc7268e6d..63b8095f95 100644 --- a/gen/accessapproval1_beta1/src/lib.rs +++ b/gen/accessapproval1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Access Approval* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *accessapproval:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Access Approval* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *accessapproval:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Access Approval* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/access-approval/docs). @@ -12,11 +12,11 @@ //! Handle the following *Resources* with ease from the central [hub](struct.AccessApproval.html) ... //! //! * folders -//! * [*approval requests approve*](struct.FolderApprovalRequestApproveCall.html), [*approval requests dismiss*](struct.FolderApprovalRequestDismisCall.html), [*approval requests get*](struct.FolderApprovalRequestGetCall.html), [*approval requests list*](struct.FolderApprovalRequestListCall.html), [*get access approval settings*](struct.FolderGetAccessApprovalSettingCall.html) and [*update access approval settings*](struct.FolderUpdateAccessApprovalSettingCall.html) +//! * [*approval requests approve*](struct.FolderApprovalRequestApproveCall.html), [*approval requests dismiss*](struct.FolderApprovalRequestDismisCall.html), [*approval requests get*](struct.FolderApprovalRequestGetCall.html), [*approval requests list*](struct.FolderApprovalRequestListCall.html), [*delete access approval settings*](struct.FolderDeleteAccessApprovalSettingCall.html), [*get access approval settings*](struct.FolderGetAccessApprovalSettingCall.html) and [*update access approval settings*](struct.FolderUpdateAccessApprovalSettingCall.html) //! * organizations -//! * [*approval requests approve*](struct.OrganizationApprovalRequestApproveCall.html), [*approval requests dismiss*](struct.OrganizationApprovalRequestDismisCall.html), [*approval requests get*](struct.OrganizationApprovalRequestGetCall.html), [*approval requests list*](struct.OrganizationApprovalRequestListCall.html), [*get access approval settings*](struct.OrganizationGetAccessApprovalSettingCall.html) and [*update access approval settings*](struct.OrganizationUpdateAccessApprovalSettingCall.html) +//! * [*approval requests approve*](struct.OrganizationApprovalRequestApproveCall.html), [*approval requests dismiss*](struct.OrganizationApprovalRequestDismisCall.html), [*approval requests get*](struct.OrganizationApprovalRequestGetCall.html), [*approval requests list*](struct.OrganizationApprovalRequestListCall.html), [*delete access approval settings*](struct.OrganizationDeleteAccessApprovalSettingCall.html), [*get access approval settings*](struct.OrganizationGetAccessApprovalSettingCall.html) and [*update access approval settings*](struct.OrganizationUpdateAccessApprovalSettingCall.html) //! * projects -//! * [*approval requests approve*](struct.ProjectApprovalRequestApproveCall.html), [*approval requests dismiss*](struct.ProjectApprovalRequestDismisCall.html), [*approval requests get*](struct.ProjectApprovalRequestGetCall.html), [*approval requests list*](struct.ProjectApprovalRequestListCall.html), [*get access approval settings*](struct.ProjectGetAccessApprovalSettingCall.html) and [*update access approval settings*](struct.ProjectUpdateAccessApprovalSettingCall.html) +//! * [*approval requests approve*](struct.ProjectApprovalRequestApproveCall.html), [*approval requests dismiss*](struct.ProjectApprovalRequestDismisCall.html), [*approval requests get*](struct.ProjectApprovalRequestGetCall.html), [*approval requests list*](struct.ProjectApprovalRequestListCall.html), [*delete access approval settings*](struct.ProjectDeleteAccessApprovalSettingCall.html), [*get access approval settings*](struct.ProjectGetAccessApprovalSettingCall.html) and [*update access approval settings*](struct.ProjectUpdateAccessApprovalSettingCall.html) //! //! //! @@ -341,7 +341,7 @@ impl<'a, C, A> AccessApproval AccessApproval { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://accessapproval.googleapis.com/".to_string(), _root_url: "https://accessapproval.googleapis.com/".to_string(), } @@ -358,7 +358,7 @@ impl<'a, C, A> AccessApproval } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -386,6 +386,62 @@ impl<'a, C, A> AccessApproval // ############ // SCHEMAS ### // ########## +/// A request for the customer to approve access to a resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [approval requests get projects](struct.ProjectApprovalRequestGetCall.html) (response) +/// * [approval requests approve organizations](struct.OrganizationApprovalRequestApproveCall.html) (response) +/// * [approval requests approve projects](struct.ProjectApprovalRequestApproveCall.html) (response) +/// * [approval requests approve folders](struct.FolderApprovalRequestApproveCall.html) (response) +/// * [approval requests get folders](struct.FolderApprovalRequestGetCall.html) (response) +/// * [approval requests get organizations](struct.OrganizationApprovalRequestGetCall.html) (response) +/// * [approval requests dismiss projects](struct.ProjectApprovalRequestDismisCall.html) (response) +/// * [approval requests dismiss organizations](struct.OrganizationApprovalRequestDismisCall.html) (response) +/// * [approval requests dismiss folders](struct.FolderApprovalRequestDismisCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApprovalRequest { + /// Properties related to the resource represented by requested_resource_name. + #[serde(rename="requestedResourceProperties")] + pub requested_resource_properties: Option, + /// The time at which approval was requested. + #[serde(rename="requestTime")] + pub request_time: Option, + /// The requested expiration for the approval. If the request is approved, + /// access will be granted from the time of approval until the expiration time. + #[serde(rename="requestedExpiration")] + pub requested_expiration: Option, + /// The resource name of the request. Format is + /// "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}". + pub name: Option, + /// The request was dismissed. + pub dismiss: Option, + /// The justification for which approval is being requested. + #[serde(rename="requestedReason")] + pub requested_reason: Option, + /// The resource for which approval is being requested. The format of the + /// resource name is defined at + /// https://cloud.google.com/apis/design/resource_names. The resource name here + /// may either be a "full" resource name (e.g. + /// "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative" + /// resource name (e.g. "shelves/shelf1/books/book2") as described in the + /// resource name specification. + #[serde(rename="requestedResourceName")] + pub requested_resource_name: Option, + /// Access was approved. + pub approve: Option, + /// The locations for which approval is being requested. + #[serde(rename="requestedLocations")] + pub requested_locations: Option, +} + +impl ResponseResult for ApprovalRequest {} + + /// A decision that has been made to dismiss an approval request. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -493,9 +549,17 @@ impl Part for ResourceProperties {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccessApprovalSettings { + /// Output only. This field is read only (not settable via + /// UpdateAccessAccessApprovalSettings method). If the field is true, that + /// indicates that at least one service is enrolled for Access Approval in one + /// or more ancestors of the Project or Folder (this field will always be + /// unset for the organization since organizations do not have ancestors). + #[serde(rename="enrolledAncestor")] + pub enrolled_ancestor: Option, /// A list of email addresses to which notifications relating to approval /// requests should be sent. Notifications relating to a resource will be sent - /// to all emails in the settings of ancestor resources of that resource. + /// to all emails in the settings of ancestor resources of that resource. A + /// maximum of 50 email addresses are allowed. #[serde(rename="notificationEmails")] pub notification_emails: Option>, /// The resource name of the settings. Format is one of: @@ -505,12 +569,41 @@ pub struct AccessApprovalSettings { ///
  • "organizations/{organization_id}/accessApprovalSettings"
  • ///
      pub name: Option, + /// A list of Google Cloud Services for which the given resource has Access + /// Approval enrolled. Access requests for the resource given by name against + /// any of these services contained here will be required to have explicit + /// approval. If name refers to an organization, enrollment can be done for + /// individual services. If name refers to a folder or project, enrollment can + /// only be done on an all or nothing basis. + /// + /// If a cloud_product is repeated in this list, the first entry will be + /// honored and all following entries will be discarded. A maximum of 10 + /// enrolled services will be enforced, to be expanded as the set of supported + /// services is expanded. + #[serde(rename="enrolledServices")] + pub enrolled_services: Option>, } impl RequestValue for AccessApprovalSettings {} impl ResponseResult for AccessApprovalSettings {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccessReason { + /// Type of access justification. + #[serde(rename="type")] + pub type_: Option, + /// More detail about certain reason types. See comments for each type above. + pub detail: Option, +} + +impl Part for AccessReason {} + + /// Response to listing of ApprovalRequest objects. /// /// # Activities @@ -552,76 +645,60 @@ pub struct ApproveDecision { impl Part for ApproveDecision {} -/// A request for the customer to approve access to a resource. +/// Represents the enrollment of a cloud resource into a specific service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnrolledService { + /// The product for which Access Approval will be enrolled. Allowed values are + /// listed below (case-sensitive): + ///
        + ///
      1. all
      2. + ///
      3. appengine.googleapis.com
      4. + ///
      5. bigquery.googleapis.com
      6. + ///
      7. bigtable.googleapis.com
      8. + ///
      9. cloudkms.googleapis.com
      10. + ///
      11. compute.googleapis.com
      12. + ///
      13. dataflow.googleapis.com
      14. + ///
      15. iam.googleapis.com
      16. + ///
      17. pubsub.googleapis.com
      18. + ///
      19. storage.googleapis.com
      20. + ///
          + #[serde(rename="cloudProduct")] + pub cloud_product: Option, + /// The enrollment level of the service. + #[serde(rename="enrollmentLevel")] + pub enrollment_level: Option, +} + +impl Part for EnrolledService {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [approval requests get projects](struct.ProjectApprovalRequestGetCall.html) (response) -/// * [approval requests approve organizations](struct.OrganizationApprovalRequestApproveCall.html) (response) -/// * [approval requests approve projects](struct.ProjectApprovalRequestApproveCall.html) (response) -/// * [approval requests approve folders](struct.FolderApprovalRequestApproveCall.html) (response) -/// * [approval requests get folders](struct.FolderApprovalRequestGetCall.html) (response) -/// * [approval requests get organizations](struct.OrganizationApprovalRequestGetCall.html) (response) -/// * [approval requests dismiss projects](struct.ProjectApprovalRequestDismisCall.html) (response) -/// * [approval requests dismiss organizations](struct.OrganizationApprovalRequestDismisCall.html) (response) -/// * [approval requests dismiss folders](struct.FolderApprovalRequestDismisCall.html) (response) -/// +/// * [delete access approval settings projects](struct.ProjectDeleteAccessApprovalSettingCall.html) (response) +/// * [delete access approval settings organizations](struct.OrganizationDeleteAccessApprovalSettingCall.html) (response) +/// * [delete access approval settings folders](struct.FolderDeleteAccessApprovalSettingCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApprovalRequest { - /// Properties related to the resource represented by requested_resource_name. - #[serde(rename="requestedResourceProperties")] - pub requested_resource_properties: Option, - /// The time at which approval was requested. - #[serde(rename="requestTime")] - pub request_time: Option, - /// The requested expiration for the approval. If the request is approved, - /// access will be granted from the time of approval until the expiration time. - #[serde(rename="requestedExpiration")] - pub requested_expiration: Option, - /// The resource name of the request. Format is - /// "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}". - pub name: Option, - /// The request was dismissed. - pub dismiss: Option, - /// The justification for which approval is being requested. - #[serde(rename="requestedReason")] - pub requested_reason: Option, - /// The resource for which approval is being requested. The format of the - /// resource name is defined at - /// https://cloud.google.com/apis/design/resource_names. The resource name here - /// may either be a "full" resource name (e.g. - /// "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative" - /// resource name (e.g. "shelves/shelf1/books/book2") as described in the - /// resource name specification. - #[serde(rename="requestedResourceName")] - pub requested_resource_name: Option, - /// Access was approved. - pub approve: Option, - /// The locations for which approval is being requested. - #[serde(rename="requestedLocations")] - pub requested_locations: Option, -} +pub struct Empty { _never_set: Option } -impl ResponseResult for ApprovalRequest {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccessReason { - /// Type of access justification. - #[serde(rename="type")] - pub type_: Option, - /// More detail about certain reason types. See comments for each type above. - pub detail: Option, -} - -impl Part for AccessReason {} +impl ResponseResult for Empty {} /// Request to approve an ApprovalRequest. @@ -674,7 +751,7 @@ impl RequestValue for ApproveApprovalRequestMessage {} /// ::default(), None); /// let mut hub = AccessApproval::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)` +/// // like `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `delete_access_approval_settings(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)` /// // to build up your call. /// let rb = hub.folders(); /// # } @@ -692,7 +769,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Updates the settings associated with a project, folder, or organization. - /// Completely replaces the existing settings. + /// Settings to update are determined by the value of field_mask. /// /// # Arguments /// @@ -708,6 +785,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { hub: self.hub, _request: request, _name: name.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -793,6 +871,28 @@ impl<'a, C, A> FolderMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the settings associated with a project, folder, or organization. + /// This will have the effect of disabling Access Approval for the project, + /// folder, or organization, but only if all ancestors also have Access + /// Approval disabled. If Access Approval is enabled at a higher level of the + /// hierarchy, then Access Approval will still be enabled at this level as + /// the settings are inherited. + /// + /// # Arguments + /// + /// * `name` - Name of the AccessApprovalSettings to delete. + pub fn delete_access_approval_settings(&self, name: &str) -> FolderDeleteAccessApprovalSettingCall<'a, C, A> { + FolderDeleteAccessApprovalSettingCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Dismisses a request. Returns the updated ApprovalRequest. @@ -848,7 +948,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AccessApproval::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)` +/// // like `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `delete_access_approval_settings(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)` /// // to build up your call. /// let rb = hub.organizations(); /// # } @@ -866,7 +966,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Updates the settings associated with a project, folder, or organization. - /// Completely replaces the existing settings. + /// Settings to update are determined by the value of field_mask. /// /// # Arguments /// @@ -882,6 +982,29 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { hub: self.hub, _request: request, _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the settings associated with a project, folder, or organization. + /// This will have the effect of disabling Access Approval for the project, + /// folder, or organization, but only if all ancestors also have Access + /// Approval disabled. If Access Approval is enabled at a higher level of the + /// hierarchy, then Access Approval will still be enabled at this level as + /// the settings are inherited. + /// + /// # Arguments + /// + /// * `name` - Name of the AccessApprovalSettings to delete. + pub fn delete_access_approval_settings(&self, name: &str) -> OrganizationDeleteAccessApprovalSettingCall<'a, C, A> { + OrganizationDeleteAccessApprovalSettingCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1022,7 +1145,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AccessApproval::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)` +/// // like `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `delete_access_approval_settings(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1116,10 +1239,32 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the settings associated with a project, folder, or organization. + /// This will have the effect of disabling Access Approval for the project, + /// folder, or organization, but only if all ancestors also have Access + /// Approval disabled. If Access Approval is enabled at a higher level of the + /// hierarchy, then Access Approval will still be enabled at this level as + /// the settings are inherited. + /// + /// # Arguments + /// + /// * `name` - Name of the AccessApprovalSettings to delete. + pub fn delete_access_approval_settings(&self, name: &str) -> ProjectDeleteAccessApprovalSettingCall<'a, C, A> { + ProjectDeleteAccessApprovalSettingCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the settings associated with a project, folder, or organization. - /// Completely replaces the existing settings. + /// Settings to update are determined by the value of field_mask. /// /// # Arguments /// @@ -1135,6 +1280,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { hub: self.hub, _request: request, _name: name.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1179,7 +1325,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // ################# /// Updates the settings associated with a project, folder, or organization. -/// Completely replaces the existing settings. +/// Settings to update are determined by the value of field_mask. /// /// A builder for the *updateAccessApprovalSettings* method supported by a *folder* resource. /// It is not used directly, but through a `FolderMethods` instance. @@ -1213,6 +1359,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.folders().update_access_approval_settings(req, "name") +/// .update_mask("et") /// .doit(); /// # } /// ``` @@ -1222,6 +1369,7 @@ pub struct FolderUpdateAccessApprovalSettingCall<'a, C, A> hub: &'a AccessApproval, _request: AccessApprovalSettings, _name: String, + _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -1244,9 +1392,12 @@ impl<'a, C, A> FolderUpdateAccessApprovalSettingCall<'a, C, A> where C: BorrowMu }; dlg.begin(MethodInfo { id: "accessapproval.folders.updateAccessApprovalSettings", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1400,6 +1551,16 @@ impl<'a, C, A> FolderUpdateAccessApprovalSettingCall<'a, C, A> where C: BorrowMu self._name = new_value.to_string(); self } + /// For the `FieldMask` definition, see + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// If this field is left unset, only the notification_emails field will be + /// updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> FolderUpdateAccessApprovalSettingCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -2271,9 +2432,9 @@ impl<'a, C, A> FolderApprovalRequestGetCall<'a, C, A> where C: BorrowMut FolderApprovalRequestListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AccessApproval::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.folders().delete_access_approval_settings("name") +/// .doit(); +/// # } +/// ``` +pub struct FolderDeleteAccessApprovalSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessApproval, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderDeleteAccessApprovalSettingCall<'a, C, A> {} + +impl<'a, C, A> FolderDeleteAccessApprovalSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accessapproval.folders.deleteAccessApprovalSettings", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the AccessApprovalSettings to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FolderDeleteAccessApprovalSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderDeleteAccessApprovalSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderDeleteAccessApprovalSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderDeleteAccessApprovalSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Dismisses a request. Returns the updated ApprovalRequest. /// /// NOTE: This does not deny access to the resource if another request has been @@ -2825,7 +3239,7 @@ impl<'a, C, A> FolderApprovalRequestDismisCall<'a, C, A> where C: BorrowMut FolderApprovalRequestDismisCall<'a, C, A> where C: BorrowMut hub: &'a AccessApproval, _request: AccessApprovalSettings, _name: String, + _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -2890,9 +3306,12 @@ impl<'a, C, A> OrganizationUpdateAccessApprovalSettingCall<'a, C, A> where C: Bo }; dlg.begin(MethodInfo { id: "accessapproval.organizations.updateAccessApprovalSettings", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3046,6 +3465,16 @@ impl<'a, C, A> OrganizationUpdateAccessApprovalSettingCall<'a, C, A> where C: Bo self._name = new_value.to_string(); self } + /// For the `FieldMask` definition, see + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// If this field is left unset, only the notification_emails field will be + /// updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationUpdateAccessApprovalSettingCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3109,6 +3538,259 @@ impl<'a, C, A> OrganizationUpdateAccessApprovalSettingCall<'a, C, A> where C: Bo } +/// Deletes the settings associated with a project, folder, or organization. +/// This will have the effect of disabling Access Approval for the project, +/// folder, or organization, but only if all ancestors also have Access +/// Approval disabled. If Access Approval is enabled at a higher level of the +/// hierarchy, then Access Approval will still be enabled at this level as +/// the settings are inherited. +/// +/// A builder for the *deleteAccessApprovalSettings* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accessapproval1_beta1 as accessapproval1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accessapproval1_beta1::AccessApproval; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessApproval::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().delete_access_approval_settings("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationDeleteAccessApprovalSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessApproval, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationDeleteAccessApprovalSettingCall<'a, C, A> {} + +impl<'a, C, A> OrganizationDeleteAccessApprovalSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accessapproval.organizations.deleteAccessApprovalSettings", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the AccessApprovalSettings to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationDeleteAccessApprovalSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationDeleteAccessApprovalSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationDeleteAccessApprovalSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationDeleteAccessApprovalSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Approves a request and returns the updated ApprovalRequest. /// /// Returns NOT_FOUND if the request does not exist. Returns @@ -3421,9 +4103,9 @@ impl<'a, C, A> OrganizationApprovalRequestApproveCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.organizations().approval_requests_list("parent") -/// .page_token("dolores") +/// .page_token("ea") /// .page_size(-61) -/// .filter("sadipscing") +/// .filter("justo") /// .doit(); /// # } /// ``` @@ -4500,8 +5182,8 @@ impl<'a, C, A> OrganizationApprovalRequestDismisCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().approval_requests_list("parent") -/// .page_token("justo") -/// .page_size(-34) +/// .page_token("ipsum") +/// .page_size(-5) /// .filter("et") /// .doit(); /// # } @@ -5543,8 +6225,261 @@ impl<'a, C, A> ProjectApprovalRequestApproveCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AccessApproval::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().delete_access_approval_settings("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDeleteAccessApprovalSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessApproval, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDeleteAccessApprovalSettingCall<'a, C, A> {} + +impl<'a, C, A> ProjectDeleteAccessApprovalSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accessapproval.projects.deleteAccessApprovalSettings", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the AccessApprovalSettings to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDeleteAccessApprovalSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDeleteAccessApprovalSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDeleteAccessApprovalSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDeleteAccessApprovalSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the settings associated with a project, folder, or organization. -/// Completely replaces the existing settings. +/// Settings to update are determined by the value of field_mask. /// /// A builder for the *updateAccessApprovalSettings* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -5578,6 +6513,7 @@ impl<'a, C, A> ProjectApprovalRequestApproveCall<'a, C, A> where C: BorrowMut hub: &'a AccessApproval, _request: AccessApprovalSettings, _name: String, + _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5609,9 +6546,12 @@ impl<'a, C, A> ProjectUpdateAccessApprovalSettingCall<'a, C, A> where C: BorrowM }; dlg.begin(MethodInfo { id: "accessapproval.projects.updateAccessApprovalSettings", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5765,6 +6705,16 @@ impl<'a, C, A> ProjectUpdateAccessApprovalSettingCall<'a, C, A> where C: BorrowM self._name = new_value.to_string(); self } + /// For the `FieldMask` definition, see + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// If this field is left unset, only the notification_emails field will be + /// updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectUpdateAccessApprovalSettingCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// diff --git a/gen/accesscontextmanager1-cli/Cargo.toml b/gen/accesscontextmanager1-cli/Cargo.toml index 1f33438746..57f8526a0a 100644 --- a/gen/accesscontextmanager1-cli/Cargo.toml +++ b/gen/accesscontextmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-accesscontextmanager1-cli" -version = "1.0.12+20190626" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Access Context Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/accesscontextmanager1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-accesscontextmanager1] path = "../accesscontextmanager1" -version = "1.0.12+20190626" +version = "1.0.13+20200405" diff --git a/gen/accesscontextmanager1-cli/README.md b/gen/accesscontextmanager1-cli/README.md index 19694cacca..f1947fee0b 100644 --- a/gen/accesscontextmanager1-cli/README.md +++ b/gen/accesscontextmanager1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Access Context Manager* API at revision *20190626*. The CLI is at version *1.0.12*. +This documentation was generated from the *Access Context Manager* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash accesscontextmanager1 [options] @@ -35,16 +35,19 @@ accesscontextmanager1 [options] access-levels-get [-p ]... [-o ] access-levels-list [-p ]... [-o ] access-levels-patch (-r )... [-p ]... [-o ] + access-levels-replace-all (-r )... [-p ]... [-o ] create (-r )... [-p ]... [-o ] delete [-p ]... [-o ] get [-p ]... [-o ] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] + service-perimeters-commit (-r )... [-p ]... [-o ] service-perimeters-create (-r )... [-p ]... [-o ] service-perimeters-delete [-p ]... [-o ] service-perimeters-get [-p ]... [-o ] service-perimeters-list [-p ]... [-o ] service-perimeters-patch (-r )... [-p ]... [-o ] + service-perimeters-replace-all (-r )... [-p ]... [-o ] operations cancel (-r )... [-p ]... [-o ] delete [-p ]... [-o ] diff --git a/gen/accesscontextmanager1-cli/mkdocs.yml b/gen/accesscontextmanager1-cli/mkdocs.yml index bf7dc4bffe..aec323234b 100644 --- a/gen/accesscontextmanager1-cli/mkdocs.yml +++ b/gen/accesscontextmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Access Context Manager v1.0.12+20190626 +site_name: Access Context Manager v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-accesscontextmanager1-cli site_description: A complete library to interact with Access Context Manager (protocol v1) @@ -14,16 +14,19 @@ pages: - ['access-policies_access-levels-get.md', 'Access Policies', 'Access Levels Get'] - ['access-policies_access-levels-list.md', 'Access Policies', 'Access Levels List'] - ['access-policies_access-levels-patch.md', 'Access Policies', 'Access Levels Patch'] +- ['access-policies_access-levels-replace-all.md', 'Access Policies', 'Access Levels Replace All'] - ['access-policies_create.md', 'Access Policies', 'Create'] - ['access-policies_delete.md', 'Access Policies', 'Delete'] - ['access-policies_get.md', 'Access Policies', 'Get'] - ['access-policies_list.md', 'Access Policies', 'List'] - ['access-policies_patch.md', 'Access Policies', 'Patch'] +- ['access-policies_service-perimeters-commit.md', 'Access Policies', 'Service Perimeters Commit'] - ['access-policies_service-perimeters-create.md', 'Access Policies', 'Service Perimeters Create'] - ['access-policies_service-perimeters-delete.md', 'Access Policies', 'Service Perimeters Delete'] - ['access-policies_service-perimeters-get.md', 'Access Policies', 'Service Perimeters Get'] - ['access-policies_service-perimeters-list.md', 'Access Policies', 'Service Perimeters List'] - ['access-policies_service-perimeters-patch.md', 'Access Policies', 'Service Perimeters Patch'] +- ['access-policies_service-perimeters-replace-all.md', 'Access Policies', 'Service Perimeters Replace All'] - ['operations_cancel.md', 'Operations', 'Cancel'] - ['operations_delete.md', 'Operations', 'Delete'] - ['operations_get.md', 'Operations', 'Get'] diff --git a/gen/accesscontextmanager1-cli/src/main.rs b/gen/accesscontextmanager1-cli/src/main.rs index bf8f05b06b..2205736bef 100644 --- a/gen/accesscontextmanager1-cli/src/main.rs +++ b/gen/accesscontextmanager1-cli/src/main.rs @@ -69,14 +69,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.title" => Some(("custom.expr.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.expression" => Some(("custom.expr.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.description" => Some(("custom.expr.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.location" => Some(("custom.expr.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "create-time", "description", "name", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "custom", "description", "expr", "expression", "location", "name", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -329,14 +331,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.title" => Some(("custom.expr.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.expression" => Some(("custom.expr.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.description" => Some(("custom.expr.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.location" => Some(("custom.expr.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "create-time", "description", "name", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "custom", "description", "expr", "expression", "location", "name", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -400,6 +404,91 @@ impl<'n> Engine<'n> { } } + fn _access_policies_access_levels_replace_all(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ReplaceAccessLevelsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.access_policies().access_levels_replace_all(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _access_policies_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -423,13 +512,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "name", "parent", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "name", "parent", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -678,13 +766,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "name", "parent", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "name", "parent", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -748,6 +835,91 @@ impl<'n> Engine<'n> { } } + fn _access_policies_service_perimeters_commit(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CommitServicePerimetersRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.access_policies().service_perimeters_commit(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _access_policies_service_perimeters_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -772,16 +944,22 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.restricted-services" => Some(("status.restrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "status.vpc-accessible-services.enable-restriction" => Some(("status.vpcAccessibleServices.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.vpc-accessible-services.allowed-services" => Some(("status.vpcAccessibleServices.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.resources" => Some(("status.resources", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.access-levels" => Some(("status.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "perimeter-type" => Some(("perimeterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "use-explicit-dry-run-spec" => Some(("useExplicitDryRunSpec", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spec.restricted-services" => Some(("spec.restrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.vpc-accessible-services.enable-restriction" => Some(("spec.vpcAccessibleServices.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spec.vpc-accessible-services.allowed-services" => Some(("spec.vpcAccessibleServices.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.resources" => Some(("spec.resources", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.access-levels" => Some(("spec.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "create-time", "description", "name", "perimeter-type", "resources", "restricted-services", "status", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "allowed-services", "description", "enable-restriction", "name", "perimeter-type", "resources", "restricted-services", "spec", "status", "title", "use-explicit-dry-run-spec", "vpc-accessible-services"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1028,16 +1206,22 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.restricted-services" => Some(("status.restrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "status.vpc-accessible-services.enable-restriction" => Some(("status.vpcAccessibleServices.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.vpc-accessible-services.allowed-services" => Some(("status.vpcAccessibleServices.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.resources" => Some(("status.resources", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.access-levels" => Some(("status.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "perimeter-type" => Some(("perimeterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "use-explicit-dry-run-spec" => Some(("useExplicitDryRunSpec", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spec.restricted-services" => Some(("spec.restrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.vpc-accessible-services.enable-restriction" => Some(("spec.vpcAccessibleServices.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spec.vpc-accessible-services.allowed-services" => Some(("spec.vpcAccessibleServices.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.resources" => Some(("spec.resources", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.access-levels" => Some(("spec.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "create-time", "description", "name", "perimeter-type", "resources", "restricted-services", "status", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "allowed-services", "description", "enable-restriction", "name", "perimeter-type", "resources", "restricted-services", "spec", "status", "title", "use-explicit-dry-run-spec", "vpc-accessible-services"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1101,6 +1285,91 @@ impl<'n> Engine<'n> { } } + fn _access_policies_service_perimeters_replace_all(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ReplaceServicePerimetersRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.access_policies().service_perimeters_replace_all(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1373,6 +1642,9 @@ impl<'n> Engine<'n> { ("access-levels-patch", Some(opt)) => { call_result = self._access_policies_access_levels_patch(opt, dry_run, &mut err); }, + ("access-levels-replace-all", Some(opt)) => { + call_result = self._access_policies_access_levels_replace_all(opt, dry_run, &mut err); + }, ("create", Some(opt)) => { call_result = self._access_policies_create(opt, dry_run, &mut err); }, @@ -1388,6 +1660,9 @@ impl<'n> Engine<'n> { ("patch", Some(opt)) => { call_result = self._access_policies_patch(opt, dry_run, &mut err); }, + ("service-perimeters-commit", Some(opt)) => { + call_result = self._access_policies_service_perimeters_commit(opt, dry_run, &mut err); + }, ("service-perimeters-create", Some(opt)) => { call_result = self._access_policies_service_perimeters_create(opt, dry_run, &mut err); }, @@ -1403,6 +1678,9 @@ impl<'n> Engine<'n> { ("service-perimeters-patch", Some(opt)) => { call_result = self._access_policies_service_perimeters_patch(opt, dry_run, &mut err); }, + ("service-perimeters-replace-all", Some(opt)) => { + call_result = self._access_policies_service_perimeters_replace_all(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("access-policies".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -1514,7 +1792,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("access-policies", "methods: 'access-levels-create', 'access-levels-delete', 'access-levels-get', 'access-levels-list', 'access-levels-patch', 'create', 'delete', 'get', 'list', 'patch', 'service-perimeters-create', 'service-perimeters-delete', 'service-perimeters-get', 'service-perimeters-list' and 'service-perimeters-patch'", vec![ + ("access-policies", "methods: 'access-levels-create', 'access-levels-delete', 'access-levels-get', 'access-levels-list', 'access-levels-patch', 'access-levels-replace-all', 'create', 'delete', 'get', 'list', 'patch', 'service-perimeters-commit', 'service-perimeters-create', 'service-perimeters-delete', 'service-perimeters-get', 'service-perimeters-list', 'service-perimeters-patch' and 'service-perimeters-replace-all'", vec![ ("access-levels-create", Some(r##"Create an Access Level. The longrunning operation from this RPC will have a successful status once the Access @@ -1642,7 +1920,50 @@ fn main() { None, Some(r##"Required. Resource name for the Access Level. The `short_name` component must begin with a letter and only include alphanumeric and '_'. Format: - `accessPolicies/{policy_id}/accessLevels/{short_name}`"##), + `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + of the `short_name` component is 50 characters."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("access-levels-replace-all", + Some(r##"Replace all existing Access Levels in an Access + Policy with + the Access Levels provided. This + is done atomically. The longrunning operation from this RPC will have a + successful status once all replacements have propagated to long-lasting + storage. Replacements containing errors will result in an error response + for the first error encountered. Replacement will be cancelled on error, + existing Access Levels will not be + affected. Operation.response field will contain + ReplaceAccessLevelsResponse. Removing Access Levels contained in existing + Service Perimeters will result in + error."##), + "Details at http://byron.github.io/google-apis-rs/google_accesscontextmanager1_cli/access-policies_access-levels-replace-all", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name for the access policy which owns these + Access Levels. + + Format: `accessPolicies/{policy_id}`"##), Some(true), Some(false)), @@ -1785,6 +2106,49 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-perimeters-commit", + Some(r##"Commit the dry-run spec for all the Service Perimeters in an + Access Policy. + A commit operation on a Service Perimeter involves copying its `spec` field + to that Service Perimeter's `status` field. Only Service Perimeters with + `use_explicit_dry_run_spec` field set to true are affected by a commit + operation. The longrunning operation from this RPC will have a successful + status once the dry-run specs for all the Service Perimeters have been + committed. If a commit fails, it will cause the longrunning operation to + return an error response and the entire commit operation will be cancelled. + When successful, Operation.response field will contain + CommitServicePerimetersResponse. The `dry_run` and the `spec` fields will + be cleared after a successful commit operation."##), + "Details at http://byron.github.io/google-apis-rs/google_accesscontextmanager1_cli/access-policies_service-perimeters-commit", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name for the parent Access Policy which owns all + Service Perimeters in scope for + the commit operation. + + Format: `accessPolicies/{policy_id}`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1792,7 +2156,7 @@ fn main() { Some(false)), ]), ("service-perimeters-create", - Some(r##"Create an Service Perimeter. The + Some(r##"Create a Service Perimeter. The longrunning operation from this RPC will have a successful status once the Service Perimeter has propagated to long-lasting storage. Service Perimeters containing @@ -1827,7 +2191,7 @@ fn main() { Some(false)), ]), ("service-perimeters-delete", - Some(r##"Delete an Service Perimeter by resource + Some(r##"Delete a Service Perimeter by resource name. The longrunning operation from this RPC will have a successful status once the Service Perimeter has been removed from long-lasting storage."##), @@ -1855,7 +2219,7 @@ fn main() { Some(false)), ]), ("service-perimeters-get", - Some(r##"Get an Service Perimeter by resource + Some(r##"Get a Service Perimeter by resource name."##), "Details at http://byron.github.io/google-apis-rs/google_accesscontextmanager1_cli/access-policies_service-perimeters-get", vec![ @@ -1907,7 +2271,7 @@ fn main() { Some(false)), ]), ("service-perimeters-patch", - Some(r##"Update an Service Perimeter. The + Some(r##"Update a Service Perimeter. The longrunning operation from this RPC will have a successful status once the changes to the Service Perimeter have propagated to long-lasting storage. Service Perimeter containing @@ -1934,6 +2298,46 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-perimeters-replace-all", + Some(r##"Replace all existing Service Perimeters in an + Access Policy + with the Service Perimeters provided. + This is done atomically. The longrunning operation from this + RPC will have a successful status once all replacements have propagated to + long-lasting storage. Replacements containing errors will result in an + error response for the first error encountered. Replacement will be + cancelled on error, existing Service Perimeters will not be + affected. Operation.response field will contain + ReplaceServicePerimetersResponse."##), + "Details at http://byron.github.io/google-apis-rs/google_accesscontextmanager1_cli/access-policies_service-perimeters-replace-all", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name for the access policy which owns these + Service Perimeters. + + Format: `accessPolicies/{policy_id}`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2066,7 +2470,7 @@ fn main() { let mut app = App::new("accesscontextmanager1") .author("Sebastian Thiel ") - .version("1.0.12+20190626") + .version("1.0.13+20200405") .about("An API for setting attribute based access control to requests to GCP services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_accesscontextmanager1_cli") .arg(Arg::with_name("url") diff --git a/gen/accesscontextmanager1/Cargo.toml b/gen/accesscontextmanager1/Cargo.toml index ff42f5ca15..c8a5c4e635 100644 --- a/gen/accesscontextmanager1/Cargo.toml +++ b/gen/accesscontextmanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-accesscontextmanager1" -version = "1.0.12+20190626" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Access Context Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/accesscontextmanager1" homepage = "https://cloud.google.com/access-context-manager/docs/reference/rest/" -documentation = "https://docs.rs/google-accesscontextmanager1/1.0.12+20190626" +documentation = "https://docs.rs/google-accesscontextmanager1/1.0.13+20200405" license = "MIT" keywords = ["accesscontextmanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/accesscontextmanager1/README.md b/gen/accesscontextmanager1/README.md index 146f825fc7..09d788648f 100644 --- a/gen/accesscontextmanager1/README.md +++ b/gen/accesscontextmanager1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-accesscontextmanager1` library allows access to all features of the *Google Access Context Manager* service. -This documentation was generated from *Access Context Manager* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *accesscontextmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Access Context Manager* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *accesscontextmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Access Context Manager* *v1* API can be found at the [official documentation site](https://cloud.google.com/access-context-manager/docs/reference/rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessContextManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessContextManager.html) ... -* [access policies](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicy.html) - * [*access levels create*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyAccessLevelCreateCall.html), [*access levels delete*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyAccessLevelDeleteCall.html), [*access levels get*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyAccessLevelGetCall.html), [*access levels list*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyAccessLevelListCall.html), [*access levels patch*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyAccessLevelPatchCall.html), [*create*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyCreateCall.html), [*delete*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyDeleteCall.html), [*get*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyGetCall.html), [*list*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyListCall.html), [*patch*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyPatchCall.html), [*service perimeters create*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterCreateCall.html), [*service perimeters delete*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterDeleteCall.html), [*service perimeters get*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterGetCall.html), [*service perimeters list*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterListCall.html) and [*service perimeters patch*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterPatchCall.html) -* [operations](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.OperationListCall.html) +* [access policies](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicy.html) + * [*access levels create*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyAccessLevelCreateCall.html), [*access levels delete*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyAccessLevelDeleteCall.html), [*access levels get*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyAccessLevelGetCall.html), [*access levels list*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyAccessLevelListCall.html), [*access levels patch*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyAccessLevelPatchCall.html), [*access levels replace all*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyAccessLevelReplaceAllCall.html), [*create*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyCreateCall.html), [*delete*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyDeleteCall.html), [*get*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyGetCall.html), [*list*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyListCall.html), [*patch*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyPatchCall.html), [*service perimeters commit*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterCommitCall.html), [*service perimeters create*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterCreateCall.html), [*service perimeters delete*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterDeleteCall.html), [*service perimeters get*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterGetCall.html), [*service perimeters list*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterListCall.html), [*service perimeters patch*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterPatchCall.html) and [*service perimeters replace all*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessPolicyServicePerimeterReplaceAllCall.html) +* [operations](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.OperationListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/struct.AccessContextManager.html)** +* **[Hub](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/struct.AccessContextManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -49,19 +49,22 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.access_policies().service_perimeters_replace_all(...).doit() let r = hub.operations().delete(...).doit() let r = hub.access_policies().access_levels_create(...).doit() let r = hub.operations().list(...).doit() +let r = hub.operations().get(...).doit() let r = hub.access_policies().service_perimeters_create(...).doit() -let r = hub.access_policies().service_perimeters_delete(...).doit() let r = hub.access_policies().access_levels_patch(...).doit() let r = hub.access_policies().create(...).doit() -let r = hub.access_policies().delete(...).doit() -let r = hub.operations().get(...).doit() -let r = hub.access_policies().service_perimeters_patch(...).doit() let r = hub.access_policies().patch(...).doit() let r = hub.access_policies().access_levels_delete(...).doit() +let r = hub.access_policies().service_perimeters_delete(...).doit() let r = hub.operations().cancel(...).doit() +let r = hub.access_policies().service_perimeters_patch(...).doit() +let r = hub.access_policies().delete(...).doit() +let r = hub.access_policies().access_levels_replace_all(...).doit() +let r = hub.access_policies().service_perimeters_commit(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -141,17 +144,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -161,29 +164,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-accesscontextmanager1/1.0.12+20190626/google_accesscontextmanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-accesscontextmanager1/1.0.13+20200405/google_accesscontextmanager1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/accesscontextmanager1/src/lib.rs b/gen/accesscontextmanager1/src/lib.rs index 7e73849667..95135525b2 100644 --- a/gen/accesscontextmanager1/src/lib.rs +++ b/gen/accesscontextmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Access Context Manager* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *accesscontextmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Access Context Manager* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *accesscontextmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Access Context Manager* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/access-context-manager/docs/reference/rest/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.AccessContextManager.html) ... //! //! * [access policies](struct.AccessPolicy.html) -//! * [*access levels create*](struct.AccessPolicyAccessLevelCreateCall.html), [*access levels delete*](struct.AccessPolicyAccessLevelDeleteCall.html), [*access levels get*](struct.AccessPolicyAccessLevelGetCall.html), [*access levels list*](struct.AccessPolicyAccessLevelListCall.html), [*access levels patch*](struct.AccessPolicyAccessLevelPatchCall.html), [*create*](struct.AccessPolicyCreateCall.html), [*delete*](struct.AccessPolicyDeleteCall.html), [*get*](struct.AccessPolicyGetCall.html), [*list*](struct.AccessPolicyListCall.html), [*patch*](struct.AccessPolicyPatchCall.html), [*service perimeters create*](struct.AccessPolicyServicePerimeterCreateCall.html), [*service perimeters delete*](struct.AccessPolicyServicePerimeterDeleteCall.html), [*service perimeters get*](struct.AccessPolicyServicePerimeterGetCall.html), [*service perimeters list*](struct.AccessPolicyServicePerimeterListCall.html) and [*service perimeters patch*](struct.AccessPolicyServicePerimeterPatchCall.html) +//! * [*access levels create*](struct.AccessPolicyAccessLevelCreateCall.html), [*access levels delete*](struct.AccessPolicyAccessLevelDeleteCall.html), [*access levels get*](struct.AccessPolicyAccessLevelGetCall.html), [*access levels list*](struct.AccessPolicyAccessLevelListCall.html), [*access levels patch*](struct.AccessPolicyAccessLevelPatchCall.html), [*access levels replace all*](struct.AccessPolicyAccessLevelReplaceAllCall.html), [*create*](struct.AccessPolicyCreateCall.html), [*delete*](struct.AccessPolicyDeleteCall.html), [*get*](struct.AccessPolicyGetCall.html), [*list*](struct.AccessPolicyListCall.html), [*patch*](struct.AccessPolicyPatchCall.html), [*service perimeters commit*](struct.AccessPolicyServicePerimeterCommitCall.html), [*service perimeters create*](struct.AccessPolicyServicePerimeterCreateCall.html), [*service perimeters delete*](struct.AccessPolicyServicePerimeterDeleteCall.html), [*service perimeters get*](struct.AccessPolicyServicePerimeterGetCall.html), [*service perimeters list*](struct.AccessPolicyServicePerimeterListCall.html), [*service perimeters patch*](struct.AccessPolicyServicePerimeterPatchCall.html) and [*service perimeters replace all*](struct.AccessPolicyServicePerimeterReplaceAllCall.html) //! * [operations](struct.Operation.html) //! * [*cancel*](struct.OperationCancelCall.html), [*delete*](struct.OperationDeleteCall.html), [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) //! @@ -49,19 +49,22 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.access_policies().service_perimeters_replace_all(...).doit() //! let r = hub.operations().delete(...).doit() //! let r = hub.access_policies().access_levels_create(...).doit() //! let r = hub.operations().list(...).doit() +//! let r = hub.operations().get(...).doit() //! let r = hub.access_policies().service_perimeters_create(...).doit() -//! let r = hub.access_policies().service_perimeters_delete(...).doit() //! let r = hub.access_policies().access_levels_patch(...).doit() //! let r = hub.access_policies().create(...).doit() -//! let r = hub.access_policies().delete(...).doit() -//! let r = hub.operations().get(...).doit() -//! let r = hub.access_policies().service_perimeters_patch(...).doit() //! let r = hub.access_policies().patch(...).doit() //! let r = hub.access_policies().access_levels_delete(...).doit() +//! let r = hub.access_policies().service_perimeters_delete(...).doit() //! let r = hub.operations().cancel(...).doit() +//! let r = hub.access_policies().service_perimeters_patch(...).doit() +//! let r = hub.access_policies().delete(...).doit() +//! let r = hub.access_policies().access_levels_replace_all(...).doit() +//! let r = hub.access_policies().service_perimeters_commit(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -337,7 +340,7 @@ impl<'a, C, A> AccessContextManager AccessContextManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://accesscontextmanager.googleapis.com/".to_string(), _root_url: "https://accesscontextmanager.googleapis.com/".to_string(), } @@ -351,7 +354,7 @@ impl<'a, C, A> AccessContextManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -379,34 +382,27 @@ impl<'a, C, A> AccessContextManager // ############ // SCHEMAS ### // ########## -/// `ServicePerimeterConfig` specifies a set of GCP resources that describe -/// specific Service Perimeter configuration. +/// A response to `ListAccessLevelsRequest`. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [access levels list access policies](struct.AccessPolicyAccessLevelListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ServicePerimeterConfig { - /// GCP services that are subject to the Service Perimeter restrictions. For - /// example, if `storage.googleapis.com` is specified, access to the storage - /// buckets inside the perimeter must meet the perimeter's access restrictions. - #[serde(rename="restrictedServices")] - pub restricted_services: Option>, - /// A list of GCP resources that are inside of the service perimeter. - /// Currently only projects are allowed. Format: `projects/{project_number}` - pub resources: Option>, - /// A list of `AccessLevel` resource names that allow resources within the - /// `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed - /// must be in the same policy as this `ServicePerimeter`. Referencing a - /// nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are - /// listed, resources within the perimeter can only be accessed via GCP calls - /// with request origins within the perimeter. Example: - /// `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. - /// For Service Perimeter Bridge, must be empty. +pub struct ListAccessLevelsResponse { + /// The pagination token to retrieve the next page of results. If the value is + /// empty, no further results remain. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of the Access Level instances. #[serde(rename="accessLevels")] - pub access_levels: Option>, + pub access_levels: Option>, } -impl Part for ServicePerimeterConfig {} +impl ResponseResult for ListAccessLevelsResponse {} /// `BasicLevel` is an `AccessLevel` using a set of recommended features. @@ -468,11 +464,101 @@ pub struct DevicePolicy { impl Part for DevicePolicy {} +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// ````text +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// ```` +/// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// Optional. Description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language + /// syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for Expr {} + + +/// A request to replace all existing Service Perimeters in an Access Policy +/// with the Service Perimeters provided. This is done atomically. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [service perimeters replace all access policies](struct.AccessPolicyServicePerimeterReplaceAllCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReplaceServicePerimetersRequest { + /// Optional. The etag for the version of the Access Policy that this + /// replace operation is to be performed on. If, at the time of replace, the + /// etag for the Access Policy stored in Access Context Manager is different + /// from the specified etag, then the replace operation will not be performed + /// and the call will fail. This field is not required. If etag is not + /// provided, the operation will be performed as if a valid etag is provided. + pub etag: Option, + /// Required. The desired Service Perimeters that should + /// replace all existing Service Perimeters in the + /// Access Policy. + #[serde(rename="servicePerimeters")] + pub service_perimeters: Option>, +} + +impl RequestValue for ReplaceServicePerimetersRequest {} + + /// `AccessPolicy` is a container for `AccessLevels` (which define the necessary -/// attributes to use GCP services) and `ServicePerimeters` (which define regions -/// of services able to freely pass data within a perimeter). An access policy is -/// globally visible within an organization, and the restrictions it specifies -/// apply to all projects within an organization. +/// attributes to use Google Cloud services) and `ServicePerimeters` (which +/// define regions of services able to freely pass data within a perimeter). An +/// access policy is globally visible within an organization, and the +/// restrictions it specifies apply to all projects within an organization. /// /// # Activities /// @@ -485,12 +571,11 @@ impl Part for DevicePolicy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccessPolicy { - /// Output only. Time the `AccessPolicy` was updated in UTC. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Output only. Time the `AccessPolicy` was created in UTC. - #[serde(rename="createTime")] - pub create_time: Option, + /// Output only. An opaque identifier for the current version of the + /// `AccessPolicy`. This will always be a strongly validated etag, meaning that + /// two Access Polices will be identical if and only if their etags are + /// identical. Clients should not expect this to be in any specific format. + pub etag: Option, /// Output only. Resource name of the `AccessPolicy`. Format: /// `accessPolicies/{policy_id}` pub name: Option, @@ -529,6 +614,26 @@ pub struct ListServicePerimetersResponse { impl ResponseResult for ListServicePerimetersResponse {} +/// Specifies how APIs are allowed to communicate within the Service +/// Perimeter. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpcAccessibleServices { + /// Whether to restrict API calls within the Service Perimeter to the list of + /// APIs specified in 'allowed_services'. + #[serde(rename="enableRestriction")] + pub enable_restriction: Option, + /// The list of APIs usable within the Service Perimeter. Must be empty + /// unless 'enable_restriction' is True. + #[serde(rename="allowedServices")] + pub allowed_services: Option>, +} + +impl Part for VpcAccessibleServices {} + + /// A response to `ListAccessPoliciesRequest`. /// /// # Activities @@ -552,27 +657,33 @@ pub struct ListAccessPoliciesResponse { impl ResponseResult for ListAccessPoliciesResponse {} -/// A response to `ListAccessLevelsRequest`. +/// A request to replace all existing Access Levels in an Access Policy with +/// the Access Levels provided. This is done atomically. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [access levels list access policies](struct.AccessPolicyAccessLevelListCall.html) (response) +/// * [access levels replace all access policies](struct.AccessPolicyAccessLevelReplaceAllCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListAccessLevelsResponse { - /// The pagination token to retrieve the next page of results. If the value is - /// empty, no further results remain. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of the Access Level instances. +pub struct ReplaceAccessLevelsRequest { + /// Optional. The etag for the version of the Access Policy that this + /// replace operation is to be performed on. If, at the time of replace, the + /// etag for the Access Policy stored in Access Context Manager is different + /// from the specified etag, then the replace operation will not be performed + /// and the call will fail. This field is not required. If etag is not + /// provided, the operation will be performed as if a valid etag is provided. + pub etag: Option, + /// Required. The desired Access Levels that should + /// replace all existing Access Levels in the + /// Access Policy. #[serde(rename="accessLevels")] pub access_levels: Option>, } -impl ResponseResult for ListAccessLevelsResponse {} +impl RequestValue for ReplaceAccessLevelsRequest {} /// A generic empty message that you can re-use to avoid defining duplicated @@ -647,15 +758,31 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// `ServicePerimeter` describes a set of GCP resources which can freely import -/// and export data amongst themselves, but not export outside of the +/// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +/// to represent the necessary conditions for the level to apply to a request. +/// See CEL spec at: https://github.com/google/cel-spec +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomLevel { + /// Required. A Cloud CEL expression evaluating to a boolean. + pub expr: Option, +} + +impl Part for CustomLevel {} + + +/// `ServicePerimeter` describes a set of Google Cloud resources which can freely +/// import and export data amongst themselves, but not export outside of the /// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` /// has a target outside of the `ServicePerimeter`, the request will be blocked. /// Otherwise the request is allowed. There are two types of Service Perimeter - -/// Regular and Bridge. Regular Service Perimeters cannot overlap, a single GCP -/// project can only belong to a single regular Service Perimeter. Service -/// Perimeter Bridges can contain only GCP projects as members, a single GCP -/// project may belong to multiple Service Perimeter Bridges. +/// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +/// Google Cloud project can only belong to a single regular Service Perimeter. +/// Service Perimeter Bridges can contain only Google Cloud projects as members, +/// a single Google Cloud project may belong to multiple Service Perimeter +/// Bridges. /// /// # Activities /// @@ -672,15 +799,23 @@ pub struct ServicePerimeter { /// restricted services and access levels that determine perimeter /// content and boundaries. pub status: Option, - /// Output only. Time the `ServicePerimeter` was updated in UTC. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Required. Resource name for the ServicePerimeter. The `short_name` - /// component must begin with a letter and only include alphanumeric and '_'. - /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` - pub name: Option, + /// Description of the `ServicePerimeter` and its use. Does not affect + /// behavior. + pub description: Option, /// Human readable title. Must be unique within the Policy. pub title: Option, + /// Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + /// exists for all Service Perimeters, and that spec is identical to the + /// status for those Service Perimeters. When this flag is set, it inhibits the + /// generation of the implicit spec, thereby allowing the user to explicitly + /// provide a configuration ("spec") to use in a dry-run version of the Service + /// Perimeter. This allows the user to test changes to the enforced config + /// ("status") without actually enforcing them. This testing is done through + /// analyzing the differences between currently enforced and suggested + /// restrictions. use_explicit_dry_run_spec must bet set to True if any of the + /// fields in the spec are set to non-default values. + #[serde(rename="useExplicitDryRunSpec")] + pub use_explicit_dry_run_spec: Option, /// Perimeter type indicator. A single project is /// allowed to be a member of single regular perimeter, but multiple service /// perimeter bridges. A project cannot be a included in a perimeter bridge @@ -689,12 +824,15 @@ pub struct ServicePerimeter { /// empty. #[serde(rename="perimeterType")] pub perimeter_type: Option, - /// Output only. Time the `ServicePerimeter` was created in UTC. - #[serde(rename="createTime")] - pub create_time: Option, - /// Description of the `ServicePerimeter` and its use. Does not affect - /// behavior. - pub description: Option, + /// Proposed (or dry run) ServicePerimeter configuration. This configuration + /// allows to specify and test ServicePerimeter configuration without enforcing + /// actual access restrictions. Only allowed to be set when the + /// "use_explicit_dry_run_spec" flag is set. + pub spec: Option, + /// Required. Resource name for the ServicePerimeter. The `short_name` + /// component must begin with a letter and only include alphanumeric and '_'. + /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + pub name: Option, } impl RequestValue for ServicePerimeter {} @@ -716,6 +854,30 @@ pub struct CancelOperationRequest { _never_set: Option } impl RequestValue for CancelOperationRequest {} +/// A request to commit dry-run specs in all Service Perimeters belonging to +/// an Access Policy. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [service perimeters commit access policies](struct.AccessPolicyServicePerimeterCommitCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitServicePerimetersRequest { + /// Optional. The etag for the version of the Access Policy that this + /// commit operation is to be performed on. If, at the time of commit, the + /// etag for the Access Policy stored in Access Context Manager is different + /// from the specified etag, then the commit operation will not be performed + /// and the call will fail. This field is not required. If etag is not + /// provided, the operation will be performed as if a valid etag is provided. + pub etag: Option, +} + +impl RequestValue for CommitServicePerimetersRequest {} + + /// This resource represents a long-running operation that is the result of a /// network API call. /// @@ -724,19 +886,22 @@ impl RequestValue for CancelOperationRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [service perimeters replace all access policies](struct.AccessPolicyServicePerimeterReplaceAllCall.html) (response) /// * [delete operations](struct.OperationDeleteCall.html) (none) /// * [access levels create access policies](struct.AccessPolicyAccessLevelCreateCall.html) (response) /// * [list operations](struct.OperationListCall.html) (none) +/// * [get operations](struct.OperationGetCall.html) (response) /// * [service perimeters create access policies](struct.AccessPolicyServicePerimeterCreateCall.html) (response) -/// * [service perimeters delete access policies](struct.AccessPolicyServicePerimeterDeleteCall.html) (response) /// * [access levels patch access policies](struct.AccessPolicyAccessLevelPatchCall.html) (response) /// * [create access policies](struct.AccessPolicyCreateCall.html) (response) -/// * [delete access policies](struct.AccessPolicyDeleteCall.html) (response) -/// * [get operations](struct.OperationGetCall.html) (response) -/// * [service perimeters patch access policies](struct.AccessPolicyServicePerimeterPatchCall.html) (response) /// * [patch access policies](struct.AccessPolicyPatchCall.html) (response) /// * [access levels delete access policies](struct.AccessPolicyAccessLevelDeleteCall.html) (response) +/// * [service perimeters delete access policies](struct.AccessPolicyServicePerimeterDeleteCall.html) (response) /// * [cancel operations](struct.OperationCancelCall.html) (none) +/// * [service perimeters patch access policies](struct.AccessPolicyServicePerimeterPatchCall.html) (response) +/// * [delete access policies](struct.AccessPolicyDeleteCall.html) (response) +/// * [access levels replace all access policies](struct.AccessPolicyAccessLevelReplaceAllCall.html) (response) +/// * [service perimeters commit access policies](struct.AccessPolicyServicePerimeterCommitCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Operation { @@ -770,8 +935,9 @@ impl Resource for Operation {} impl ResponseResult for Operation {} -/// An `AccessLevel` is a label that can be applied to requests to GCP services, -/// along with a list of requirements necessary for the label to be applied. +/// An `AccessLevel` is a label that can be applied to requests to Google Cloud +/// services, along with a list of requirements necessary for the label to be +/// applied. /// /// # Activities /// @@ -784,28 +950,59 @@ impl ResponseResult for Operation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccessLevel { - /// Output only. Time the `AccessLevel` was updated in UTC. - #[serde(rename="updateTime")] - pub update_time: Option, + /// A `BasicLevel` composed of `Conditions`. + pub basic: Option, + /// A `CustomLevel` written in the Common Expression Language. + pub custom: Option, + /// Description of the `AccessLevel` and its use. Does not affect behavior. + pub description: Option, /// Required. Resource name for the Access Level. The `short_name` component /// must begin with a letter and only include alphanumeric and '_'. Format: - /// `accessPolicies/{policy_id}/accessLevels/{short_name}` + /// `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + /// of the `short_name` component is 50 characters. pub name: Option, /// Human readable title. Must be unique within the Policy. pub title: Option, - /// A `BasicLevel` composed of `Conditions`. - pub basic: Option, - /// Output only. Time the `AccessLevel` was created in UTC. - #[serde(rename="createTime")] - pub create_time: Option, - /// Description of the `AccessLevel` and its use. Does not affect behavior. - pub description: Option, } impl RequestValue for AccessLevel {} impl ResponseResult for AccessLevel {} +/// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +/// describe specific Service Perimeter configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServicePerimeterConfig { + /// Google Cloud services that are subject to the Service Perimeter + /// restrictions. For example, if `storage.googleapis.com` is specified, access + /// to the storage buckets inside the perimeter must meet the perimeter's + /// access restrictions. + #[serde(rename="restrictedServices")] + pub restricted_services: Option>, + /// Configuration for APIs allowed within Perimeter. + #[serde(rename="vpcAccessibleServices")] + pub vpc_accessible_services: Option, + /// A list of Google Cloud resources that are inside of the service perimeter. + /// Currently only projects are allowed. Format: `projects/{project_number}` + pub resources: Option>, + /// A list of `AccessLevel` resource names that allow resources within the + /// `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + /// must be in the same policy as this `ServicePerimeter`. Referencing a + /// nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + /// listed, resources within the perimeter can only be accessed via Google + /// Cloud calls with request origins within the perimeter. Example: + /// `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + /// For Service Perimeter Bridge, must be empty. + #[serde(rename="accessLevels")] + pub access_levels: Option>, +} + +impl Part for ServicePerimeterConfig {} + + /// A condition necessary for an `AccessLevel` to be granted. The Condition is an /// AND over its fields. So a Condition is true if: 1) the request IP is from one /// of the listed subnetworks AND 2) the originating device complies with the @@ -867,7 +1064,7 @@ pub struct OsConstraint { pub os_type: Option, /// Only allows requests from devices with a verified Chrome OS. /// Verifications includes requirements that the device is enterprise-managed, - /// conformant to Dasher domain policies, and the caller has permission to call + /// conformant to domain policies, and the caller has permission to call /// the API targeted by the request. #[serde(rename="requireVerifiedChromeOs")] pub require_verified_chrome_os: Option, @@ -925,26 +1122,6 @@ impl<'a, C, A> MethodsBuilder for OperationMethods<'a, C, A> {} impl<'a, C, A> OperationMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Deletes a long-running operation. This method indicates that the client is - /// no longer interested in the operation result. It does not cancel the - /// operation. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource to be deleted. - pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { - OperationDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists operations that match the specified filter in the request. If the @@ -974,6 +1151,26 @@ impl<'a, C, A> OperationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { + OperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the latest state of a long-running operation. Clients can use this @@ -1048,7 +1245,7 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `access_levels_create(...)`, `access_levels_delete(...)`, `access_levels_get(...)`, `access_levels_list(...)`, `access_levels_patch(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `service_perimeters_create(...)`, `service_perimeters_delete(...)`, `service_perimeters_get(...)`, `service_perimeters_list(...)` and `service_perimeters_patch(...)` +/// // like `access_levels_create(...)`, `access_levels_delete(...)`, `access_levels_get(...)`, `access_levels_list(...)`, `access_levels_patch(...)`, `access_levels_replace_all(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `service_perimeters_commit(...)`, `service_perimeters_create(...)`, `service_perimeters_delete(...)`, `service_perimeters_get(...)`, `service_perimeters_list(...)`, `service_perimeters_patch(...)` and `service_perimeters_replace_all(...)` /// // to build up your call. /// let rb = hub.access_policies(); /// # } @@ -1065,21 +1262,23 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List all Access Levels for an access - /// policy. + /// Create a Service Perimeter. The + /// longrunning operation from this RPC will have a successful status once the + /// Service Perimeter has + /// propagated to long-lasting storage. Service Perimeters containing + /// errors will result in an error response for the first error encountered. /// /// # Arguments /// - /// * `parent` - Required. Resource name for the access policy to list Access Levels from. - /// Format: - /// `accessPolicies/{policy_id}` - pub fn access_levels_list(&self, parent: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { - AccessPolicyAccessLevelListCall { + /// * `request` - No description provided. + /// * `parent` - Required. Resource name for the access policy which owns this Service + /// Perimeter. + /// Format: `accessPolicies/{policy_id}` + pub fn service_perimeters_create(&self, request: ServicePerimeter, parent: &str) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> { + AccessPolicyServicePerimeterCreateCall { hub: self.hub, + _request: request, _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _access_level_format: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1113,20 +1312,46 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Create an Service Perimeter. The - /// longrunning operation from this RPC will have a successful status once the - /// Service Perimeter has - /// propagated to long-lasting storage. Service Perimeters containing - /// errors will result in an error response for the first error encountered. + /// Delete an AccessPolicy by resource + /// name. The longrunning Operation will have a successful status once the + /// AccessPolicy + /// has been removed from long-lasting storage. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name for the access policy to delete. + /// Format `accessPolicies/{policy_id}` + pub fn delete(&self, name: &str) -> AccessPolicyDeleteCall<'a, C, A> { + AccessPolicyDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Replace all existing Service Perimeters in an + /// Access Policy + /// with the Service Perimeters provided. + /// This is done atomically. The longrunning operation from this + /// RPC will have a successful status once all replacements have propagated to + /// long-lasting storage. Replacements containing errors will result in an + /// error response for the first error encountered. Replacement will be + /// cancelled on error, existing Service Perimeters will not be + /// affected. Operation.response field will contain + /// ReplaceServicePerimetersResponse. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. Resource name for the access policy which owns this Service - /// Perimeter. + /// * `parent` - Required. Resource name for the access policy which owns these + /// Service Perimeters. /// Format: `accessPolicies/{policy_id}` - pub fn service_perimeters_create(&self, request: ServicePerimeter, parent: &str) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> { - AccessPolicyServicePerimeterCreateCall { + pub fn service_perimeters_replace_all(&self, request: ReplaceServicePerimetersRequest, parent: &str) -> AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> { + AccessPolicyServicePerimeterReplaceAllCall { hub: self.hub, _request: request, _parent: parent.to_string(), @@ -1138,18 +1363,14 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Delete an Service Perimeter by resource - /// name. The longrunning operation from this RPC will have a successful status - /// once the Service Perimeter has been - /// removed from long-lasting storage. + /// Get an AccessPolicy by name. /// /// # Arguments /// - /// * `name` - Required. Resource name for the Service Perimeter. - /// Format: - /// `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` - pub fn service_perimeters_delete(&self, name: &str) -> AccessPolicyServicePerimeterDeleteCall<'a, C, A> { - AccessPolicyServicePerimeterDeleteCall { + /// * `name` - Required. Resource name for the access policy to get. + /// Format `accessPolicies/{policy_id}` + pub fn get(&self, name: &str) -> AccessPolicyGetCall<'a, C, A> { + AccessPolicyGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1158,32 +1379,6 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Update an Access Level. The longrunning - /// operation from this RPC will have a successful status once the changes to - /// the Access Level have propagated - /// to long-lasting storage. Access Levels containing - /// errors will result in an error response for the first error encountered. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Required. Resource name for the Access Level. The `short_name` component - /// must begin with a letter and only include alphanumeric and '_'. Format: - /// `accessPolicies/{policy_id}/accessLevels/{short_name}` - pub fn access_levels_patch(&self, request: AccessLevel, name: &str) -> AccessPolicyAccessLevelPatchCall<'a, C, A> { - AccessPolicyAccessLevelPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Create an `AccessPolicy`. Fails if this organization already has a @@ -1205,6 +1400,27 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Get an Access Level by resource + /// name. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name for the Access Level. + /// Format: + /// `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + pub fn access_levels_get(&self, name: &str) -> AccessPolicyAccessLevelGetCall<'a, C, A> { + AccessPolicyAccessLevelGetCall { + hub: self.hub, + _name: name.to_string(), + _access_level_format: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// List all Service Perimeters for an @@ -1229,56 +1445,20 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List all AccessPolicies under a - /// container. - pub fn list(&self) -> AccessPolicyListCall<'a, C, A> { - AccessPolicyListCall { - hub: self.hub, - _parent: Default::default(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Get an Access Level by resource - /// name. - /// - /// # Arguments - /// - /// * `name` - Required. Resource name for the Access Level. - /// Format: - /// `accessPolicies/{policy_id}/accessLevels/{access_level_id}` - pub fn access_levels_get(&self, name: &str) -> AccessPolicyAccessLevelGetCall<'a, C, A> { - AccessPolicyAccessLevelGetCall { - hub: self.hub, - _name: name.to_string(), - _access_level_format: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Update an AccessPolicy. The - /// longrunning Operation from this RPC will have a successful status once the - /// changes to the AccessPolicy have propagated - /// to long-lasting storage. Syntactic and basic semantic errors will be - /// returned in `metadata` as a BadRequest proto. + /// Update a Service Perimeter. The + /// longrunning operation from this RPC will have a successful status once the + /// changes to the Service Perimeter have + /// propagated to long-lasting storage. Service Perimeter containing + /// errors will result in an error response for the first error encountered. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Output only. Resource name of the `AccessPolicy`. Format: - /// `accessPolicies/{policy_id}` - pub fn patch(&self, request: AccessPolicy, name: &str) -> AccessPolicyPatchCall<'a, C, A> { - AccessPolicyPatchCall { + /// * `name` - Required. Resource name for the ServicePerimeter. The `short_name` + /// component must begin with a letter and only include alphanumeric and '_'. + /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + pub fn service_perimeters_patch(&self, request: ServicePerimeter, name: &str) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { + AccessPolicyServicePerimeterPatchCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -1313,14 +1493,147 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get an AccessPolicy by name. + /// List all Access Levels for an access + /// policy. /// /// # Arguments /// - /// * `name` - Required. Resource name for the access policy to get. - /// Format `accessPolicies/{policy_id}` - pub fn get(&self, name: &str) -> AccessPolicyGetCall<'a, C, A> { - AccessPolicyGetCall { + /// * `parent` - Required. Resource name for the access policy to list Access Levels from. + /// Format: + /// `accessPolicies/{policy_id}` + pub fn access_levels_list(&self, parent: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { + AccessPolicyAccessLevelListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _access_level_format: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List all AccessPolicies under a + /// container. + pub fn list(&self) -> AccessPolicyListCall<'a, C, A> { + AccessPolicyListCall { + hub: self.hub, + _parent: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update an AccessPolicy. The + /// longrunning Operation from this RPC will have a successful status once the + /// changes to the AccessPolicy have propagated + /// to long-lasting storage. Syntactic and basic semantic errors will be + /// returned in `metadata` as a BadRequest proto. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. Resource name of the `AccessPolicy`. Format: + /// `accessPolicies/{policy_id}` + pub fn patch(&self, request: AccessPolicy, name: &str) -> AccessPolicyPatchCall<'a, C, A> { + AccessPolicyPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Replace all existing Access Levels in an Access + /// Policy with + /// the Access Levels provided. This + /// is done atomically. The longrunning operation from this RPC will have a + /// successful status once all replacements have propagated to long-lasting + /// storage. Replacements containing errors will result in an error response + /// for the first error encountered. Replacement will be cancelled on error, + /// existing Access Levels will not be + /// affected. Operation.response field will contain + /// ReplaceAccessLevelsResponse. Removing Access Levels contained in existing + /// Service Perimeters will result in + /// error. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. Resource name for the access policy which owns these + /// Access Levels. + /// Format: `accessPolicies/{policy_id}` + pub fn access_levels_replace_all(&self, request: ReplaceAccessLevelsRequest, parent: &str) -> AccessPolicyAccessLevelReplaceAllCall<'a, C, A> { + AccessPolicyAccessLevelReplaceAllCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Commit the dry-run spec for all the Service Perimeters in an + /// Access Policy. + /// A commit operation on a Service Perimeter involves copying its `spec` field + /// to that Service Perimeter's `status` field. Only Service Perimeters with + /// `use_explicit_dry_run_spec` field set to true are affected by a commit + /// operation. The longrunning operation from this RPC will have a successful + /// status once the dry-run specs for all the Service Perimeters have been + /// committed. If a commit fails, it will cause the longrunning operation to + /// return an error response and the entire commit operation will be cancelled. + /// When successful, Operation.response field will contain + /// CommitServicePerimetersResponse. The `dry_run` and the `spec` fields will + /// be cleared after a successful commit operation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. Resource name for the parent Access Policy which owns all + /// Service Perimeters in scope for + /// the commit operation. + /// Format: `accessPolicies/{policy_id}` + pub fn service_perimeters_commit(&self, request: CommitServicePerimetersRequest, parent: &str) -> AccessPolicyServicePerimeterCommitCall<'a, C, A> { + AccessPolicyServicePerimeterCommitCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a Service Perimeter by resource + /// name. The longrunning operation from this RPC will have a successful status + /// once the Service Perimeter has been + /// removed from long-lasting storage. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name for the Service Perimeter. + /// Format: + /// `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` + pub fn service_perimeters_delete(&self, name: &str) -> AccessPolicyServicePerimeterDeleteCall<'a, C, A> { + AccessPolicyServicePerimeterDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1331,7 +1644,34 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get an Service Perimeter by resource + /// Update an Access Level. The longrunning + /// operation from this RPC will have a successful status once the changes to + /// the Access Level have propagated + /// to long-lasting storage. Access Levels containing + /// errors will result in an error response for the first error encountered. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name for the Access Level. The `short_name` component + /// must begin with a letter and only include alphanumeric and '_'. Format: + /// `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + /// of the `short_name` component is 50 characters. + pub fn access_levels_patch(&self, request: AccessLevel, name: &str) -> AccessPolicyAccessLevelPatchCall<'a, C, A> { + AccessPolicyAccessLevelPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get a Service Perimeter by resource /// name. /// /// # Arguments @@ -1348,53 +1688,6 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Delete an AccessPolicy by resource - /// name. The longrunning Operation will have a successful status once the - /// AccessPolicy - /// has been removed from long-lasting storage. - /// - /// # Arguments - /// - /// * `name` - Required. Resource name for the access policy to delete. - /// Format `accessPolicies/{policy_id}` - pub fn delete(&self, name: &str) -> AccessPolicyDeleteCall<'a, C, A> { - AccessPolicyDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Update an Service Perimeter. The - /// longrunning operation from this RPC will have a successful status once the - /// changes to the Service Perimeter have - /// propagated to long-lasting storage. Service Perimeter containing - /// errors will result in an error response for the first error encountered. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Required. Resource name for the ServicePerimeter. The `short_name` - /// component must begin with a letter and only include alphanumeric and '_'. - /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` - pub fn service_perimeters_patch(&self, request: ServicePerimeter, name: &str) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { - AccessPolicyServicePerimeterPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -1405,257 +1698,6 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { // CallBuilders ### // ################# -/// Deletes a long-running operation. This method indicates that the client is -/// no longer interested in the operation result. It does not cancel the -/// operation. If the server doesn't support this method, it returns -/// `google.rpc.Code.UNIMPLEMENTED`. -/// -/// A builder for the *delete* method supported by a *operation* resource. -/// It is not used directly, but through a `OperationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.operations().delete("name") -/// .doit(); -/// # } -/// ``` -pub struct OperationDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OperationDeleteCall<'a, C, A> {} - -impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.operations.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation resource to be deleted. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OperationDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OperationDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists operations that match the specified filter in the request. If the /// server doesn't support this method, it returns `UNIMPLEMENTED`. /// @@ -1693,9 +1735,9 @@ impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.operations().list("name") -/// .page_token("nonumy") -/// .page_size(-19) -/// .filter("gubergren") +/// .page_token("sea") +/// .page_size(-90) +/// .filter("dolores") /// .doit(); /// # } /// ``` @@ -1949,6 +1991,257 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: } +/// Deletes a long-running operation. This method indicates that the client is +/// no longer interested in the operation result. It does not cancel the +/// operation. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. +/// +/// A builder for the *delete* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.operations().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the latest state of a long-running operation. Clients can use this /// method to poll the operation result at intervals as recommended by the API /// service. @@ -2487,10 +2780,13 @@ impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, } -/// List all Access Levels for an access -/// policy. +/// Create a Service Perimeter. The +/// longrunning operation from this RPC will have a successful status once the +/// Service Perimeter has +/// propagated to long-lasting storage. Service Perimeters containing +/// errors will result in an error response for the first error encountered. /// -/// A builder for the *accessLevels.list* method supported by a *accessPolicy* resource. +/// A builder for the *servicePerimeters.create* method supported by a *accessPolicy* resource. /// It is not used directly, but through a `AccessPolicyMethods` instance. /// /// # Example @@ -2502,6 +2798,7 @@ impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// use accesscontextmanager1::ServicePerimeter; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -2512,36 +2809,36 @@ impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ServicePerimeter::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.access_policies().access_levels_list("parent") -/// .page_token("no") -/// .page_size(-21) -/// .access_level_format("justo") +/// let result = hub.access_policies().service_perimeters_create(req, "parent") /// .doit(); /// # } /// ``` -pub struct AccessPolicyAccessLevelListCall<'a, C, A> +pub struct AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AccessContextManager, + _request: ServicePerimeter, _parent: String, - _page_token: Option, - _page_size: Option, - _access_level_format: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AccessPolicyAccessLevelListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterCreateCall<'a, C, A> {} -impl<'a, C, A> AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListAccessLevelsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -2550,20 +2847,11 @@ impl<'a, C, A> AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.accessLevels.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._access_level_format { - params.push(("accessLevelFormat", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "accessLevelFormat"].iter() { + for &field in ["alt", "parent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2575,7 +2863,7 @@ impl<'a, C, A> AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut AccessPolicyServicePerimeterCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name for the access policy which owns this Service + /// Perimeter. /// - /// Format: - /// `accessPolicies/{policy_id}` + /// Format: `accessPolicies/{policy_id}` /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// Next page token for the next batch of Access Level instances. - /// Defaults to the first page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Number of Access Levels to include in - /// the list. Default 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AccessPolicyAccessLevelListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Whether to return `BasicLevels` in the Cloud Common Expression language, as - /// `CustomLevels`, rather than as `BasicLevels`. Defaults to returning - /// `AccessLevels` in the format they were defined. - /// - /// Sets the *access level format* query property to the given value. - pub fn access_level_format(mut self, new_value: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { - self._access_level_format = Some(new_value.to_string()); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyAccessLevelListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2747,7 +3034,7 @@ impl<'a, C, A> AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccessPolicyAccessLevelListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2767,7 +3054,7 @@ impl<'a, C, A> AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> AccessPolicyAccessLevelListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3065,13 +3352,12 @@ impl<'a, C, A> AccessPolicyAccessLevelCreateCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.access_policies().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name for the access policy to delete. + /// + /// Format `accessPolicies/{policy_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccessPolicyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Replace all existing Service Perimeters in an +/// Access Policy +/// with the Service Perimeters provided. +/// This is done atomically. The longrunning operation from this +/// RPC will have a successful status once all replacements have propagated to +/// long-lasting storage. Replacements containing errors will result in an +/// error response for the first error encountered. Replacement will be +/// cancelled on error, existing Service Perimeters will not be +/// affected. Operation.response field will contain +/// ReplaceServicePerimetersResponse. +/// +/// A builder for the *servicePerimeters.replaceAll* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// use accesscontextmanager1::ReplaceServicePerimetersRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -3097,29 +3642,29 @@ impl<'a, C, A> AccessPolicyAccessLevelCreateCall<'a, C, A> where C: BorrowMut +pub struct AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AccessContextManager, - _request: ServicePerimeter, + _request: ReplaceServicePerimetersRequest, _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> {} -impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -3132,7 +3677,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.create", + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.replaceAll", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -3148,7 +3693,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+parent}/servicePerimeters"; + let mut url = self.hub._base_url.clone() + "v1/{+parent}/servicePerimeters:replaceAll"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3271,12 +3816,12 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: ServicePerimeter) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> { + pub fn request(mut self, new_value: ReplaceServicePerimetersRequest) -> AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> { self._request = new_value; self } - /// Required. Resource name for the access policy which owns this Service - /// Perimeter. + /// Required. Resource name for the access policy which owns these + /// Service Perimeters. /// /// Format: `accessPolicies/{policy_id}` /// @@ -3284,7 +3829,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> { self._parent = new_value.to_string(); self } @@ -3294,7 +3839,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3319,7 +3864,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3339,7 +3884,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterReplaceAllCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3351,7 +3896,3030 @@ impl<'a, C, A> AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM } -/// Delete an Service Perimeter by resource +/// Get an AccessPolicy by name. +/// +/// A builder for the *get* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.access_policies().get("name") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyGetCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AccessPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name for the access policy to get. + /// + /// Format `accessPolicies/{policy_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccessPolicyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create an `AccessPolicy`. Fails if this organization already has a +/// `AccessPolicy`. The longrunning Operation will have a successful status +/// once the `AccessPolicy` has propagated to long-lasting storage. +/// Syntactic and basic semantic errors will be returned in `metadata` as a +/// BadRequest proto. +/// +/// A builder for the *create* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// use accesscontextmanager1::AccessPolicy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AccessPolicy::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.access_policies().create(req) +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _request: AccessPolicy, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyCreateCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/accessPolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AccessPolicy) -> AccessPolicyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get an Access Level by resource +/// name. +/// +/// A builder for the *accessLevels.get* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.access_policies().access_levels_get("name") +/// .access_level_format("diam") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyAccessLevelGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _name: String, + _access_level_format: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyAccessLevelGetCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyAccessLevelGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AccessLevel)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.accessLevels.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._access_level_format { + params.push(("accessLevelFormat", value.to_string())); + } + for &field in ["alt", "name", "accessLevelFormat"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name for the Access Level. + /// + /// Format: + /// `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccessPolicyAccessLevelGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Whether to return `BasicLevels` in the Cloud Common Expression + /// Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where + /// Access Levels + /// are returned as `BasicLevels` or `CustomLevels` based on how they were + /// created. If set to CEL, all Access Levels are returned as + /// `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent + /// `CustomLevels`. + /// + /// Sets the *access level format* query property to the given value. + pub fn access_level_format(mut self, new_value: &str) -> AccessPolicyAccessLevelGetCall<'a, C, A> { + self._access_level_format = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyAccessLevelGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyAccessLevelGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyAccessLevelGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List all Service Perimeters for an +/// access policy. +/// +/// A builder for the *servicePerimeters.list* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.access_policies().service_perimeters_list("parent") +/// .page_token("Lorem") +/// .page_size(-21) +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyServicePerimeterListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterListCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyServicePerimeterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListServicePerimetersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/servicePerimeters"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name for the access policy to list Service Perimeters from. + /// + /// Format: + /// `accessPolicies/{policy_id}` + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> AccessPolicyServicePerimeterListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Next page token for the next batch of Service Perimeter instances. + /// Defaults to the first page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccessPolicyServicePerimeterListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of Service Perimeters to include + /// in the list. Default 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AccessPolicyServicePerimeterListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update a Service Perimeter. The +/// longrunning operation from this RPC will have a successful status once the +/// changes to the Service Perimeter have +/// propagated to long-lasting storage. Service Perimeter containing +/// errors will result in an error response for the first error encountered. +/// +/// A builder for the *servicePerimeters.patch* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// use accesscontextmanager1::ServicePerimeter; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ServicePerimeter::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.access_policies().service_perimeters_patch(req, "name") +/// .update_mask("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyServicePerimeterPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _request: ServicePerimeter, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterPatchCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyServicePerimeterPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ServicePerimeter) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name for the ServicePerimeter. The `short_name` + /// component must begin with a letter and only include alphanumeric and '_'. + /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Mask to control which fields get updated. Must be non-empty. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete an Access Level by resource +/// name. The longrunning operation from this RPC will have a successful status +/// once the Access Level has been removed +/// from long-lasting storage. +/// +/// A builder for the *accessLevels.delete* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.access_policies().access_levels_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyAccessLevelDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyAccessLevelDeleteCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyAccessLevelDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.accessLevels.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name for the Access Level. + /// + /// Format: + /// `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List all Access Levels for an access +/// policy. +/// +/// A builder for the *accessLevels.list* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.access_policies().access_levels_list("parent") +/// .page_token("eos") +/// .page_size(-81) +/// .access_level_format("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyAccessLevelListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _parent: String, + _page_token: Option, + _page_size: Option, + _access_level_format: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyAccessLevelListCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyAccessLevelListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAccessLevelsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.accessLevels.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._access_level_format { + params.push(("accessLevelFormat", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "accessLevelFormat"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/accessLevels"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name for the access policy to list Access Levels from. + /// + /// Format: + /// `accessPolicies/{policy_id}` + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Next page token for the next batch of Access Level instances. + /// Defaults to the first page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of Access Levels to include in + /// the list. Default 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AccessPolicyAccessLevelListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Whether to return `BasicLevels` in the Cloud Common Expression language, as + /// `CustomLevels`, rather than as `BasicLevels`. Defaults to returning + /// `AccessLevels` in the format they were defined. + /// + /// Sets the *access level format* query property to the given value. + pub fn access_level_format(mut self, new_value: &str) -> AccessPolicyAccessLevelListCall<'a, C, A> { + self._access_level_format = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyAccessLevelListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyAccessLevelListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyAccessLevelListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List all AccessPolicies under a +/// container. +/// +/// A builder for the *list* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.access_policies().list() +/// .parent("dolor") +/// .page_token("eirmod") +/// .page_size(-43) +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _parent: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyListCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAccessPoliciesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + if let Some(value) = self._parent { + params.push(("parent", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/accessPolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name for the container to list AccessPolicy instances + /// from. + /// + /// Format: + /// `organizations/{org_id}` + /// + /// Sets the *parent* query property to the given value. + pub fn parent(mut self, new_value: &str) -> AccessPolicyListCall<'a, C, A> { + self._parent = Some(new_value.to_string()); + self + } + /// Next page token for the next batch of AccessPolicy instances. Defaults to + /// the first page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccessPolicyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of AccessPolicy instances to include in the list. Default 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AccessPolicyListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update an AccessPolicy. The +/// longrunning Operation from this RPC will have a successful status once the +/// changes to the AccessPolicy have propagated +/// to long-lasting storage. Syntactic and basic semantic errors will be +/// returned in `metadata` as a BadRequest proto. +/// +/// A builder for the *patch* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// use accesscontextmanager1::AccessPolicy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AccessPolicy::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.access_policies().patch(req, "name") +/// .update_mask("no") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _request: AccessPolicy, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyPatchCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AccessPolicy) -> AccessPolicyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. Resource name of the `AccessPolicy`. Format: + /// `accessPolicies/{policy_id}` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> AccessPolicyPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Mask to control which fields get updated. Must be non-empty. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> AccessPolicyPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Replace all existing Access Levels in an Access +/// Policy with +/// the Access Levels provided. This +/// is done atomically. The longrunning operation from this RPC will have a +/// successful status once all replacements have propagated to long-lasting +/// storage. Replacements containing errors will result in an error response +/// for the first error encountered. Replacement will be cancelled on error, +/// existing Access Levels will not be +/// affected. Operation.response field will contain +/// ReplaceAccessLevelsResponse. Removing Access Levels contained in existing +/// Service Perimeters will result in +/// error. +/// +/// A builder for the *accessLevels.replaceAll* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// use accesscontextmanager1::ReplaceAccessLevelsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ReplaceAccessLevelsRequest::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.access_policies().access_levels_replace_all(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyAccessLevelReplaceAllCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _request: ReplaceAccessLevelsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyAccessLevelReplaceAllCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyAccessLevelReplaceAllCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.accessLevels.replaceAll", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/accessLevels:replaceAll"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ReplaceAccessLevelsRequest) -> AccessPolicyAccessLevelReplaceAllCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name for the access policy which owns these + /// Access Levels. + /// + /// Format: `accessPolicies/{policy_id}` + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> AccessPolicyAccessLevelReplaceAllCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyAccessLevelReplaceAllCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyAccessLevelReplaceAllCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyAccessLevelReplaceAllCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Commit the dry-run spec for all the Service Perimeters in an +/// Access Policy. +/// A commit operation on a Service Perimeter involves copying its `spec` field +/// to that Service Perimeter's `status` field. Only Service Perimeters with +/// `use_explicit_dry_run_spec` field set to true are affected by a commit +/// operation. The longrunning operation from this RPC will have a successful +/// status once the dry-run specs for all the Service Perimeters have been +/// committed. If a commit fails, it will cause the longrunning operation to +/// return an error response and the entire commit operation will be cancelled. +/// When successful, Operation.response field will contain +/// CommitServicePerimetersResponse. The `dry_run` and the `spec` fields will +/// be cleared after a successful commit operation. +/// +/// A builder for the *servicePerimeters.commit* method supported by a *accessPolicy* resource. +/// It is not used directly, but through a `AccessPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; +/// use accesscontextmanager1::CommitServicePerimetersRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use accesscontextmanager1::AccessContextManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = CommitServicePerimetersRequest::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.access_policies().service_perimeters_commit(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct AccessPolicyServicePerimeterCommitCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AccessContextManager, + _request: CommitServicePerimetersRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterCommitCall<'a, C, A> {} + +impl<'a, C, A> AccessPolicyServicePerimeterCommitCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.commit", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/servicePerimeters:commit"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CommitServicePerimetersRequest) -> AccessPolicyServicePerimeterCommitCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name for the parent Access Policy which owns all + /// Service Perimeters in scope for + /// the commit operation. + /// + /// Format: `accessPolicies/{policy_id}` + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> AccessPolicyServicePerimeterCommitCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterCommitCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterCommitCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterCommitCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a Service Perimeter by resource /// name. The longrunning operation from this RPC will have a successful status /// once the Service Perimeter has been /// removed from long-lasting storage. @@ -3643,7 +7211,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterDeleteCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.access_policies().access_levels_patch(req, "name") -/// .update_mask("Lorem") +/// .update_mask("aliquyam") /// .doit(); /// # } /// ``` @@ -3822,7 +7390,8 @@ impl<'a, C, A> AccessPolicyAccessLevelPatchCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelPatchCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelPatchCall<'a, C, A> { @@ -3902,1854 +7471,7 @@ impl<'a, C, A> AccessPolicyAccessLevelPatchCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AccessPolicy::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.access_policies().create(req) -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _request: AccessPolicy, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyCreateCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - for &field in ["alt"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/accessPolicies"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AccessPolicy) -> AccessPolicyCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// List all Service Perimeters for an -/// access policy. -/// -/// A builder for the *servicePerimeters.list* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.access_policies().service_perimeters_list("parent") -/// .page_token("duo") -/// .page_size(-32) -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyServicePerimeterListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterListCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyServicePerimeterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListServicePerimetersResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+parent}/servicePerimeters"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. Resource name for the access policy to list Service Perimeters from. - /// - /// Format: - /// `accessPolicies/{policy_id}` - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> AccessPolicyServicePerimeterListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Next page token for the next batch of Service Perimeter instances. - /// Defaults to the first page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccessPolicyServicePerimeterListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Number of Service Perimeters to include - /// in the list. Default 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AccessPolicyServicePerimeterListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// List all AccessPolicies under a -/// container. -/// -/// A builder for the *list* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.access_policies().list() -/// .parent("sea") -/// .page_token("Lorem") -/// .page_size(-75) -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _parent: Option, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyListCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListAccessPoliciesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - if let Some(value) = self._parent { - params.push(("parent", value.to_string())); - } - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/accessPolicies"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. Resource name for the container to list AccessPolicy instances - /// from. - /// - /// Format: - /// `organizations/{org_id}` - /// - /// Sets the *parent* query property to the given value. - pub fn parent(mut self, new_value: &str) -> AccessPolicyListCall<'a, C, A> { - self._parent = Some(new_value.to_string()); - self - } - /// Next page token for the next batch of AccessPolicy instances. Defaults to - /// the first page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccessPolicyListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Number of AccessPolicy instances to include in the list. Default 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AccessPolicyListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Get an Access Level by resource -/// name. -/// -/// A builder for the *accessLevels.get* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.access_policies().access_levels_get("name") -/// .access_level_format("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyAccessLevelGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _name: String, - _access_level_format: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyAccessLevelGetCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyAccessLevelGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccessLevel)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.accessLevels.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._access_level_format { - params.push(("accessLevelFormat", value.to_string())); - } - for &field in ["alt", "name", "accessLevelFormat"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. Resource name for the Access Level. - /// - /// Format: - /// `accessPolicies/{policy_id}/accessLevels/{access_level_id}` - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccessPolicyAccessLevelGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Whether to return `BasicLevels` in the Cloud Common Expression - /// Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where - /// Access Levels - /// are returned as `BasicLevels` or `CustomLevels` based on how they were - /// created. If set to CEL, all Access Levels are returned as - /// `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent - /// `CustomLevels`. - /// - /// Sets the *access level format* query property to the given value. - pub fn access_level_format(mut self, new_value: &str) -> AccessPolicyAccessLevelGetCall<'a, C, A> { - self._access_level_format = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyAccessLevelGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyAccessLevelGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyAccessLevelGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Update an AccessPolicy. The -/// longrunning Operation from this RPC will have a successful status once the -/// changes to the AccessPolicy have propagated -/// to long-lasting storage. Syntactic and basic semantic errors will be -/// returned in `metadata` as a BadRequest proto. -/// -/// A builder for the *patch* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// use accesscontextmanager1::AccessPolicy; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AccessPolicy::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.access_policies().patch(req, "name") -/// .update_mask("eirmod") -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _request: AccessPolicy, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyPatchCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AccessPolicy) -> AccessPolicyPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Output only. Resource name of the `AccessPolicy`. Format: - /// `accessPolicies/{policy_id}` - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccessPolicyPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Required. Mask to control which fields get updated. Must be non-empty. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> AccessPolicyPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Delete an Access Level by resource -/// name. The longrunning operation from this RPC will have a successful status -/// once the Access Level has been removed -/// from long-lasting storage. -/// -/// A builder for the *accessLevels.delete* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.access_policies().access_levels_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyAccessLevelDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyAccessLevelDeleteCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyAccessLevelDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.accessLevels.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. Resource name for the Access Level. - /// - /// Format: - /// `accessPolicies/{policy_id}/accessLevels/{access_level_id}` - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyAccessLevelDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Get an AccessPolicy by name. -/// -/// A builder for the *get* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.access_policies().get("name") -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyGetCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccessPolicy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. Resource name for the access policy to get. - /// - /// Format `accessPolicies/{policy_id}` - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccessPolicyGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Get an Service Perimeter by resource +/// Get a Service Perimeter by resource /// name. /// /// A builder for the *servicePerimeters.get* method supported by a *accessPolicy* resource. @@ -6001,553 +7723,3 @@ impl<'a, C, A> AccessPolicyServicePerimeterGetCall<'a, C, A> where C: BorrowMut< } -/// Delete an AccessPolicy by resource -/// name. The longrunning Operation will have a successful status once the -/// AccessPolicy -/// has been removed from long-lasting storage. -/// -/// A builder for the *delete* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.access_policies().delete("name") -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyDeleteCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. Resource name for the access policy to delete. - /// - /// Format `accessPolicies/{policy_id}` - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccessPolicyDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Update an Service Perimeter. The -/// longrunning operation from this RPC will have a successful status once the -/// changes to the Service Perimeter have -/// propagated to long-lasting storage. Service Perimeter containing -/// errors will result in an error response for the first error encountered. -/// -/// A builder for the *servicePerimeters.patch* method supported by a *accessPolicy* resource. -/// It is not used directly, but through a `AccessPolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_accesscontextmanager1 as accesscontextmanager1; -/// use accesscontextmanager1::ServicePerimeter; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use accesscontextmanager1::AccessContextManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AccessContextManager::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ServicePerimeter::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.access_policies().service_perimeters_patch(req, "name") -/// .update_mask("dolore") -/// .doit(); -/// # } -/// ``` -pub struct AccessPolicyServicePerimeterPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AccessContextManager, - _request: ServicePerimeter, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccessPolicyServicePerimeterPatchCall<'a, C, A> {} - -impl<'a, C, A> AccessPolicyServicePerimeterPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "accesscontextmanager.accessPolicies.servicePerimeters.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ServicePerimeter) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. Resource name for the ServicePerimeter. The `short_name` - /// component must begin with a letter and only include alphanumeric and '_'. - /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Required. Mask to control which fields get updated. Must be non-empty. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccessPolicyServicePerimeterPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - diff --git a/gen/accesscontextmanager1_beta-cli/Cargo.toml b/gen/accesscontextmanager1_beta-cli/Cargo.toml index fabd111de3..8286d2bd58 100644 --- a/gen/accesscontextmanager1_beta-cli/Cargo.toml +++ b/gen/accesscontextmanager1_beta-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-accesscontextmanager1_beta-cli" -version = "1.0.12+20190626" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Access Context Manager (protocol v1beta)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/accesscontextmanager1_beta-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-accesscontextmanager1_beta] path = "../accesscontextmanager1_beta" -version = "1.0.12+20190626" +version = "1.0.13+20200405" diff --git a/gen/accesscontextmanager1_beta-cli/README.md b/gen/accesscontextmanager1_beta-cli/README.md index 53622ce4ad..cb40ee6257 100644 --- a/gen/accesscontextmanager1_beta-cli/README.md +++ b/gen/accesscontextmanager1_beta-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Access Context Manager* API at revision *20190626*. The CLI is at version *1.0.12*. +This documentation was generated from the *Access Context Manager* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash accesscontextmanager1-beta [options] diff --git a/gen/accesscontextmanager1_beta-cli/mkdocs.yml b/gen/accesscontextmanager1_beta-cli/mkdocs.yml index c561dcb48b..16cb2bda59 100644 --- a/gen/accesscontextmanager1_beta-cli/mkdocs.yml +++ b/gen/accesscontextmanager1_beta-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Access Context Manager v1.0.12+20190626 +site_name: Access Context Manager v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-accesscontextmanager1_beta-cli site_description: A complete library to interact with Access Context Manager (protocol v1beta) diff --git a/gen/accesscontextmanager1_beta-cli/src/main.rs b/gen/accesscontextmanager1_beta-cli/src/main.rs index e5511a6c8f..d8237bdc58 100644 --- a/gen/accesscontextmanager1_beta-cli/src/main.rs +++ b/gen/accesscontextmanager1_beta-cli/src/main.rs @@ -69,14 +69,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.title" => Some(("custom.expr.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.expression" => Some(("custom.expr.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.description" => Some(("custom.expr.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.location" => Some(("custom.expr.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "create-time", "description", "name", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "custom", "description", "expr", "expression", "location", "name", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -329,14 +331,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.title" => Some(("custom.expr.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.expression" => Some(("custom.expr.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.description" => Some(("custom.expr.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "custom.expr.location" => Some(("custom.expr.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic.combining-function" => Some(("basic.combiningFunction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "create-time", "description", "name", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic", "combining-function", "custom", "description", "expr", "expression", "location", "name", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -423,13 +427,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "name", "parent", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "parent", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -678,13 +680,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "name", "parent", "title", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "parent", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -771,24 +771,18 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "status.ingress-service-restriction.enable-restriction" => Some(("status.ingressServiceRestriction.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "status.ingress-service-restriction.allowed-services" => Some(("status.ingressServiceRestriction.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.bridge-service-restriction.enable-restriction" => Some(("status.bridgeServiceRestriction.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "status.bridge-service-restriction.allowed-services" => Some(("status.bridgeServiceRestriction.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.access-levels" => Some(("status.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.unrestricted-services" => Some(("status.unrestrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.vpc-service-restriction.enable-restriction" => Some(("status.vpcServiceRestriction.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "status.vpc-service-restriction.allowed-services" => Some(("status.vpcServiceRestriction.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.restricted-services" => Some(("status.restrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "status.vpc-accessible-services.enable-restriction" => Some(("status.vpcAccessibleServices.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.vpc-accessible-services.allowed-services" => Some(("status.vpcAccessibleServices.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "status.unrestricted-services" => Some(("status.unrestrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.resources" => Some(("status.resources", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.access-levels" => Some(("status.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "perimeter-type" => Some(("perimeterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "allowed-services", "bridge-service-restriction", "create-time", "description", "enable-restriction", "ingress-service-restriction", "name", "perimeter-type", "resources", "restricted-services", "status", "title", "unrestricted-services", "update-time", "vpc-service-restriction"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "allowed-services", "description", "enable-restriction", "name", "perimeter-type", "resources", "restricted-services", "status", "title", "unrestricted-services", "vpc-accessible-services"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1034,24 +1028,18 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "status.ingress-service-restriction.enable-restriction" => Some(("status.ingressServiceRestriction.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "status.ingress-service-restriction.allowed-services" => Some(("status.ingressServiceRestriction.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.bridge-service-restriction.enable-restriction" => Some(("status.bridgeServiceRestriction.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "status.bridge-service-restriction.allowed-services" => Some(("status.bridgeServiceRestriction.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.access-levels" => Some(("status.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.unrestricted-services" => Some(("status.unrestrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "status.vpc-service-restriction.enable-restriction" => Some(("status.vpcServiceRestriction.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "status.vpc-service-restriction.allowed-services" => Some(("status.vpcServiceRestriction.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.restricted-services" => Some(("status.restrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "status.vpc-accessible-services.enable-restriction" => Some(("status.vpcAccessibleServices.enableRestriction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.vpc-accessible-services.allowed-services" => Some(("status.vpcAccessibleServices.allowedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "status.unrestricted-services" => Some(("status.unrestrictedServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status.resources" => Some(("status.resources", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.access-levels" => Some(("status.accessLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "perimeter-type" => Some(("perimeterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "allowed-services", "bridge-service-restriction", "create-time", "description", "enable-restriction", "ingress-service-restriction", "name", "perimeter-type", "resources", "restricted-services", "status", "title", "unrestricted-services", "update-time", "vpc-service-restriction"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["access-levels", "allowed-services", "description", "enable-restriction", "name", "perimeter-type", "resources", "restricted-services", "status", "title", "unrestricted-services", "vpc-accessible-services"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1449,7 +1437,8 @@ fn main() { None, Some(r##"Required. Resource name for the Access Level. The `short_name` component must begin with a letter and only include alphanumeric and '_'. Format: - `accessPolicies/{policy_id}/accessLevels/{short_name}`"##), + `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + // of the `short_name` component is 50 characters."##), Some(true), Some(false)), @@ -1599,7 +1588,7 @@ fn main() { Some(false)), ]), ("service-perimeters-create", - Some(r##"Create an Service Perimeter. The + Some(r##"Create a Service Perimeter. The longrunning operation from this RPC will have a successful status once the Service Perimeter has propagated to long-lasting storage. Service Perimeters containing @@ -1634,7 +1623,7 @@ fn main() { Some(false)), ]), ("service-perimeters-delete", - Some(r##"Delete an Service Perimeter by resource + Some(r##"Delete a Service Perimeter by resource name. The longrunning operation from this RPC will have a successful status once the Service Perimeter has been removed from long-lasting storage."##), @@ -1662,7 +1651,7 @@ fn main() { Some(false)), ]), ("service-perimeters-get", - Some(r##"Get an Service Perimeter by resource + Some(r##"Get a Service Perimeter by resource name."##), "Details at http://byron.github.io/google-apis-rs/google_accesscontextmanager1_beta_cli/access-policies_service-perimeters-get", vec![ @@ -1714,7 +1703,7 @@ fn main() { Some(false)), ]), ("service-perimeters-patch", - Some(r##"Update an Service Perimeter. The + Some(r##"Update a Service Perimeter. The longrunning operation from this RPC will have a successful status once the changes to the Service Perimeter have propagated to long-lasting storage. Service Perimeter containing @@ -1780,7 +1769,7 @@ fn main() { let mut app = App::new("accesscontextmanager1-beta") .author("Sebastian Thiel ") - .version("1.0.12+20190626") + .version("1.0.13+20200405") .about("An API for setting attribute based access control to requests to GCP services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_accesscontextmanager1_beta_cli") .arg(Arg::with_name("url") diff --git a/gen/accesscontextmanager1_beta/Cargo.toml b/gen/accesscontextmanager1_beta/Cargo.toml index 985635428e..4e66bada4c 100644 --- a/gen/accesscontextmanager1_beta/Cargo.toml +++ b/gen/accesscontextmanager1_beta/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-accesscontextmanager1_beta" -version = "1.0.12+20190626" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Access Context Manager (protocol v1beta)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/accesscontextmanager1_beta" homepage = "https://cloud.google.com/access-context-manager/docs/reference/rest/" -documentation = "https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626" +documentation = "https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405" license = "MIT" keywords = ["accesscontextmanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/accesscontextmanager1_beta/README.md b/gen/accesscontextmanager1_beta/README.md index de3aa18cd5..6464f0a0b5 100644 --- a/gen/accesscontextmanager1_beta/README.md +++ b/gen/accesscontextmanager1_beta/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-accesscontextmanager1_beta` library allows access to all features of the *Google Access Context Manager* service. -This documentation was generated from *Access Context Manager* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *accesscontextmanager:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Access Context Manager* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *accesscontextmanager:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Access Context Manager* *v1_beta* API can be found at the [official documentation site](https://cloud.google.com/access-context-manager/docs/reference/rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessContextManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessContextManager.html) ... -* [access policies](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicy.html) - * [*access levels create*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelCreateCall.html), [*access levels delete*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelDeleteCall.html), [*access levels get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelGetCall.html), [*access levels list*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelListCall.html), [*access levels patch*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelPatchCall.html), [*create*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyCreateCall.html), [*delete*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyDeleteCall.html), [*get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyGetCall.html), [*list*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyListCall.html), [*patch*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyPatchCall.html), [*service perimeters create*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterCreateCall.html), [*service perimeters delete*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterDeleteCall.html), [*service perimeters get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterGetCall.html), [*service perimeters list*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterListCall.html) and [*service perimeters patch*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterPatchCall.html) -* [operations](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.Operation.html) - * [*get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.OperationGetCall.html) +* [access policies](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicy.html) + * [*access levels create*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelCreateCall.html), [*access levels delete*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelDeleteCall.html), [*access levels get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelGetCall.html), [*access levels list*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelListCall.html), [*access levels patch*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyAccessLevelPatchCall.html), [*create*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyCreateCall.html), [*delete*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyDeleteCall.html), [*get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyGetCall.html), [*list*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyListCall.html), [*patch*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyPatchCall.html), [*service perimeters create*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterCreateCall.html), [*service perimeters delete*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterDeleteCall.html), [*service perimeters get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterGetCall.html), [*service perimeters list*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterListCall.html) and [*service perimeters patch*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessPolicyServicePerimeterPatchCall.html) +* [operations](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.Operation.html) + * [*get*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.OperationGetCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/struct.AccessContextManager.html)** +* **[Hub](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/struct.AccessContextManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.Part.html)** + * **[Parts](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -142,17 +142,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -162,29 +162,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.RequestValue.html) and -[decodable](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.RequestValue.html) and +[decodable](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-accesscontextmanager1_beta/1.0.12+20190626/google_accesscontextmanager1_beta/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-accesscontextmanager1_beta/1.0.13+20200405/google_accesscontextmanager1_beta/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/accesscontextmanager1_beta/src/lib.rs b/gen/accesscontextmanager1_beta/src/lib.rs index 11dc7b8b2c..417aae74e6 100644 --- a/gen/accesscontextmanager1_beta/src/lib.rs +++ b/gen/accesscontextmanager1_beta/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Access Context Manager* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *accesscontextmanager:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Access Context Manager* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *accesscontextmanager:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Access Context Manager* *v1_beta* API can be found at the //! [official documentation site](https://cloud.google.com/access-context-manager/docs/reference/rest/). @@ -342,7 +342,7 @@ impl<'a, C, A> AccessContextManager AccessContextManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://accesscontextmanager.googleapis.com/".to_string(), _root_url: "https://accesscontextmanager.googleapis.com/".to_string(), } @@ -356,7 +356,7 @@ impl<'a, C, A> AccessContextManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -466,11 +466,72 @@ pub struct DevicePolicy { impl Part for DevicePolicy {} +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// ````text +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// ```` +/// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// Optional. Description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language + /// syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for Expr {} + + /// `AccessPolicy` is a container for `AccessLevels` (which define the necessary -/// attributes to use GCP services) and `ServicePerimeters` (which define regions -/// of services able to freely pass data within a perimeter). An access policy is -/// globally visible within an organization, and the restrictions it specifies -/// apply to all projects within an organization. +/// attributes to use Google Cloud services) and `ServicePerimeters` (which +/// define regions of services able to freely pass data within a perimeter). An +/// access policy is globally visible within an organization, and the +/// restrictions it specifies apply to all projects within an organization. /// /// # Activities /// @@ -483,12 +544,6 @@ impl Part for DevicePolicy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccessPolicy { - /// Output only. Time the `AccessPolicy` was updated in UTC. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Output only. Time the `AccessPolicy` was created in UTC. - #[serde(rename="createTime")] - pub create_time: Option, /// Output only. Resource name of the `AccessPolicy`. Format: /// `accessPolicies/{policy_id}` pub name: Option, @@ -527,6 +582,21 @@ pub struct ListServicePerimetersResponse { impl ResponseResult for ListServicePerimetersResponse {} +/// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +/// to represent the necessary conditions for the level to apply to a request. +/// See CEL spec at: https://github.com/google/cel-spec +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomLevel { + /// Required. A Cloud CEL expression evaluating to a boolean. + pub expr: Option, +} + +impl Part for CustomLevel {} + + /// A response to `ListAccessPoliciesRequest`. /// /// # Activities @@ -550,26 +620,6 @@ pub struct ListAccessPoliciesResponse { impl ResponseResult for ListAccessPoliciesResponse {} -/// Alpha. Specifies how APIs are allowed to communicate within the Service -/// Perimeter. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpcServiceRestriction { - /// Whether to restrict API calls within the Service Perimeter to the list of - /// APIs specified in 'allowed_services'. - #[serde(rename="enableRestriction")] - pub enable_restriction: Option, - /// The list of APIs usable within the Service Perimeter. Must be empty - /// unless 'enable_restriction' is True. - #[serde(rename="allowedServices")] - pub allowed_services: Option>, -} - -impl Part for VpcServiceRestriction {} - - /// The `Status` type defines a logical error model that is suitable for /// different programming environments, including REST APIs and RPC APIs. It is /// used by [gRPC](https://github.com/grpc). Each `Status` message contains @@ -596,55 +646,36 @@ pub struct Status { impl Part for Status {} -/// Alpha. Specifies how Access Levels are to be used for accessing the Service +/// Specifies how APIs are allowed to communicate within the Service /// Perimeter. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IngressServiceRestriction { - /// Whether to restrict the set of APIs callable outside the Service - /// Perimeter via Access Levels. +pub struct VpcAccessibleServices { + /// Whether to restrict API calls within the Service Perimeter to the list of + /// APIs specified in 'allowed_services'. #[serde(rename="enableRestriction")] pub enable_restriction: Option, - /// The list of APIs usable with a valid Access Level. Must be empty unless - /// 'enable_restriction' is True. - #[serde(rename="allowedServices")] - pub allowed_services: Option>, -} - -impl Part for IngressServiceRestriction {} - - -/// Alpha. Specifies which services are granted access via this Bridge Service -/// Perimeter. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BridgeServiceRestriction { - /// Whether to restrict the set of APIs callable through the Bridge Service - /// Perimeter. - #[serde(rename="enableRestriction")] - pub enable_restriction: Option, - /// The list of APIs usable through the Bridge Perimeter. Must be empty + /// The list of APIs usable within the Service Perimeter. Must be empty /// unless 'enable_restriction' is True. #[serde(rename="allowedServices")] pub allowed_services: Option>, } -impl Part for BridgeServiceRestriction {} +impl Part for VpcAccessibleServices {} -/// `ServicePerimeter` describes a set of GCP resources which can freely import -/// and export data amongst themselves, but not export outside of the +/// `ServicePerimeter` describes a set of Google Cloud resources which can freely +/// import and export data amongst themselves, but not export outside of the /// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` /// has a target outside of the `ServicePerimeter`, the request will be blocked. /// Otherwise the request is allowed. There are two types of Service Perimeter - -/// Regular and Bridge. Regular Service Perimeters cannot overlap, a single GCP -/// project can only belong to a single regular Service Perimeter. Service -/// Perimeter Bridges can contain only GCP projects as members, a single GCP -/// project may belong to multiple Service Perimeter Bridges. +/// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +/// Google Cloud project can only belong to a single regular Service Perimeter. +/// Service Perimeter Bridges can contain only Google Cloud projects as members, +/// a single Google Cloud project may belong to multiple Service Perimeter +/// Bridges. /// /// # Activities /// @@ -661,15 +692,6 @@ pub struct ServicePerimeter { /// restricted/unrestricted services and access levels that determine perimeter /// content and boundaries. pub status: Option, - /// Output only. Time the `ServicePerimeter` was updated in UTC. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Required. Resource name for the ServicePerimeter. The `short_name` - /// component must begin with a letter and only include alphanumeric and '_'. - /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` - pub name: Option, - /// Human readable title. Must be unique within the Policy. - pub title: Option, /// Perimeter type indicator. A single project is /// allowed to be a member of single regular perimeter, but multiple service /// perimeter bridges. A project cannot be a included in a perimeter bridge @@ -678,57 +700,53 @@ pub struct ServicePerimeter { /// empty. #[serde(rename="perimeterType")] pub perimeter_type: Option, - /// Output only. Time the `ServicePerimeter` was created in UTC. - #[serde(rename="createTime")] - pub create_time: Option, /// Description of the `ServicePerimeter` and its use. Does not affect /// behavior. pub description: Option, + /// Required. Resource name for the ServicePerimeter. The `short_name` + /// component must begin with a letter and only include alphanumeric and '_'. + /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + pub name: Option, + /// Human readable title. Must be unique within the Policy. + pub title: Option, } impl RequestValue for ServicePerimeter {} impl ResponseResult for ServicePerimeter {} -/// `ServicePerimeterConfig` specifies a set of GCP resources that describe -/// specific Service Perimeter configuration. +/// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +/// describe specific Service Perimeter configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ServicePerimeterConfig { - /// Alpha. Configuration for which services may be used with Access Levels. - #[serde(rename="ingressServiceRestriction")] - pub ingress_service_restriction: Option, - /// GCP services that are subject to the Service Perimeter restrictions. Must - /// contain a list of services. For example, if + /// Google Cloud services that are subject to the Service Perimeter + /// restrictions. Must contain a list of services. For example, if /// `storage.googleapis.com` is specified, access to the storage buckets /// inside the perimeter must meet the perimeter's access restrictions. #[serde(rename="restrictedServices")] pub restricted_services: Option>, - /// GCP services that are not subject to the Service Perimeter + /// Beta. Configuration for APIs allowed within Perimeter. + #[serde(rename="vpcAccessibleServices")] + pub vpc_accessible_services: Option, + /// A list of Google Cloud resources that are inside of the service perimeter. + /// Currently only projects are allowed. Format: `projects/{project_number}` + pub resources: Option>, + /// Google Cloud services that are not subject to the Service Perimeter /// restrictions. Deprecated. Must be set to a single wildcard "*". /// /// The wildcard means that unless explicitly specified by /// "restricted_services" list, any service is treated as unrestricted. #[serde(rename="unrestrictedServices")] pub unrestricted_services: Option>, - /// Alpha. Configuration for within Perimeter allowed APIs. - #[serde(rename="vpcServiceRestriction")] - pub vpc_service_restriction: Option, - /// A list of GCP resources that are inside of the service perimeter. - /// Currently only projects are allowed. Format: `projects/{project_number}` - pub resources: Option>, - /// Alpha. Configuration for what services are accessible via the Bridge - /// Perimeter. Must be empty for non-Bridge Perimeters. - #[serde(rename="bridgeServiceRestriction")] - pub bridge_service_restriction: Option, /// A list of `AccessLevel` resource names that allow resources within the /// `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed /// must be in the same policy as this `ServicePerimeter`. Referencing a /// nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are - /// listed, resources within the perimeter can only be accessed via GCP calls - /// with request origins within the perimeter. Example: + /// listed, resources within the perimeter can only be accessed via Google + /// Cloud calls with request origins within the perimeter. Example: /// `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. /// For Service Perimeter Bridge, must be empty. #[serde(rename="accessLevels")] @@ -789,8 +807,9 @@ impl Resource for Operation {} impl ResponseResult for Operation {} -/// An `AccessLevel` is a label that can be applied to requests to GCP services, -/// along with a list of requirements necessary for the label to be applied. +/// An `AccessLevel` is a label that can be applied to requests to Google Cloud +/// services, along with a list of requirements necessary for the label to be +/// applied. /// /// # Activities /// @@ -803,22 +822,19 @@ impl ResponseResult for Operation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccessLevel { - /// Output only. Time the `AccessLevel` was updated in UTC. - #[serde(rename="updateTime")] - pub update_time: Option, + /// A `BasicLevel` composed of `Conditions`. + pub basic: Option, + /// A `CustomLevel` written in the Common Expression Language. + pub custom: Option, + /// Description of the `AccessLevel` and its use. Does not affect behavior. + pub description: Option, /// Required. Resource name for the Access Level. The `short_name` component /// must begin with a letter and only include alphanumeric and '_'. Format: - /// `accessPolicies/{policy_id}/accessLevels/{short_name}` + /// `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + /// // of the `short_name` component is 50 characters. pub name: Option, /// Human readable title. Must be unique within the Policy. pub title: Option, - /// A `BasicLevel` composed of `Conditions`. - pub basic: Option, - /// Output only. Time the `AccessLevel` was created in UTC. - #[serde(rename="createTime")] - pub create_time: Option, - /// Description of the `AccessLevel` and its use. Does not affect behavior. - pub description: Option, } impl RequestValue for AccessLevel {} @@ -886,7 +902,7 @@ pub struct OsConstraint { pub os_type: Option, /// Only allows requests from devices with a verified Chrome OS. /// Verifications includes requirements that the device is enterprise-managed, - /// conformant to Dasher domain policies, and the caller has permission to call + /// conformant to domain policies, and the caller has permission to call /// the API targeted by the request. #[serde(rename="requireVerifiedChromeOs")] pub require_verified_chrome_os: Option, @@ -1055,7 +1071,7 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Create an Service Perimeter. The + /// Create a Service Perimeter. The /// longrunning operation from this RPC will have a successful status once the /// Service Perimeter has /// propagated to long-lasting storage. Service Perimeters containing @@ -1080,7 +1096,7 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Delete an Service Perimeter by resource + /// Delete a Service Perimeter by resource /// name. The longrunning operation from this RPC will have a successful status /// once the Service Perimeter has been /// removed from long-lasting storage. @@ -1113,7 +1129,8 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// * `request` - No description provided. /// * `name` - Required. Resource name for the Access Level. The `short_name` component /// must begin with a letter and only include alphanumeric and '_'. Format: - /// `accessPolicies/{policy_id}/accessLevels/{short_name}` + /// `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + /// // of the `short_name` component is 50 characters. pub fn access_levels_patch(&self, request: AccessLevel, name: &str) -> AccessPolicyAccessLevelPatchCall<'a, C, A> { AccessPolicyAccessLevelPatchCall { hub: self.hub, @@ -1273,7 +1290,7 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get an Service Perimeter by resource + /// Get a Service Perimeter by resource /// name. /// /// # Arguments @@ -1314,7 +1331,7 @@ impl<'a, C, A> AccessPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Update an Service Perimeter. The + /// Update a Service Perimeter. The /// longrunning operation from this RPC will have a successful status once the /// changes to the Service Perimeter have /// propagated to long-lasting storage. Service Perimeter containing @@ -2175,7 +2192,7 @@ impl<'a, C, A> AccessPolicyAccessLevelCreateCall<'a, C, A> where C: BorrowMut AccessPolicyServicePerimeterCreateCall<'a, C, A> where C: BorrowM } -/// Delete an Service Perimeter by resource +/// Delete a Service Perimeter by resource /// name. The longrunning operation from this RPC will have a successful status /// once the Service Perimeter has been /// removed from long-lasting storage. @@ -2932,7 +2949,8 @@ impl<'a, C, A> AccessPolicyAccessLevelPatchCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelPatchCall<'a, C, A> where C: BorrowMut AccessPolicyAccessLevelPatchCall<'a, C, A> { @@ -4859,7 +4877,7 @@ impl<'a, C, A> AccessPolicyServicePerimeterListCall<'a, C, A> where C: BorrowMut } -/// Get an Service Perimeter by resource +/// Get a Service Perimeter by resource /// name. /// /// A builder for the *servicePerimeters.get* method supported by a *accessPolicy* resource. @@ -5364,7 +5382,7 @@ impl<'a, C, A> AccessPolicyDeleteCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-adexchangebuyer1d3] path = "../adexchangebuyer1d3" -version = "1.0.12+20190614" +version = "1.0.13+20191204" diff --git a/gen/adexchangebuyer1d3-cli/README.md b/gen/adexchangebuyer1d3-cli/README.md index b8d9d0c608..65d282c1e1 100644 --- a/gen/adexchangebuyer1d3-cli/README.md +++ b/gen/adexchangebuyer1d3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Exchange Buyer* API at revision *20190614*. The CLI is at version *1.0.12*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20191204*. The CLI is at version *1.0.13*. ```bash adexchangebuyer1d3 [options] diff --git a/gen/adexchangebuyer1d3-cli/mkdocs.yml b/gen/adexchangebuyer1d3-cli/mkdocs.yml index dd34becbc1..61e5d7d66e 100644 --- a/gen/adexchangebuyer1d3-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v1.0.12+20190614 +site_name: Ad Exchange Buyer v1.0.13+20191204 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d3-cli site_description: A complete library to interact with Ad Exchange Buyer (protocol v1.3) diff --git a/gen/adexchangebuyer1d3-cli/src/main.rs b/gen/adexchangebuyer1d3-cli/src/main.rs index 58e917a57e..56015e8715 100644 --- a/gen/adexchangebuyer1d3-cli/src/main.rs +++ b/gen/adexchangebuyer1d3-cli/src/main.rs @@ -1206,13 +1206,14 @@ impl<'n> Engine<'n> { "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "maximum-qps" => Some(("maximumQps", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "verticals" => Some(("verticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "platforms" => Some(("platforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1220,7 +1221,7 @@ impl<'n> Engine<'n> { "is-active" => Some(("isActive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "supported-creative-attributes" => Some(("supportedCreativeAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "maximum-qps", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1362,13 +1363,14 @@ impl<'n> Engine<'n> { "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "maximum-qps" => Some(("maximumQps", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "verticals" => Some(("verticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "platforms" => Some(("platforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1376,7 +1378,7 @@ impl<'n> Engine<'n> { "is-active" => Some(("isActive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "supported-creative-attributes" => Some(("supportedCreativeAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "maximum-qps", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1466,13 +1468,14 @@ impl<'n> Engine<'n> { "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "maximum-qps" => Some(("maximumQps", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "verticals" => Some(("verticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "platforms" => Some(("platforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1480,7 +1483,7 @@ impl<'n> Engine<'n> { "is-active" => Some(("isActive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "supported-creative-attributes" => Some(("supportedCreativeAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "maximum-qps", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2305,7 +2308,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d3") .author("Sebastian Thiel ") - .version("1.0.12+20190614") + .version("1.0.13+20191204") .about("Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangebuyer1d3_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangebuyer1d3/Cargo.toml b/gen/adexchangebuyer1d3/Cargo.toml index c8c513e628..4ffae189e4 100644 --- a/gen/adexchangebuyer1d3/Cargo.toml +++ b/gen/adexchangebuyer1d3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangebuyer1d3" -version = "1.0.12+20190614" +version = "1.0.13+20191204" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3" homepage = "https://developers.google.com/ad-exchange/buyer-rest" -documentation = "https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614" +documentation = "https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204" license = "MIT" keywords = ["adexchangebuyer", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/adexchangebuyer1d3/README.md b/gen/adexchangebuyer1d3/README.md index c5ab60c808..1ea0913872 100644 --- a/gen/adexchangebuyer1d3/README.md +++ b/gen/adexchangebuyer1d3/README.md @@ -5,28 +5,28 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d3` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Ad Exchange Buyer* crate version *1.0.13+20191204*, where *20191204* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html) ... -* [accounts](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.Account.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.AccountUpdateCall.html) -* [billing info](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.BillingInfo.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.BillingInfoListCall.html) -* [budget](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.Budget.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.BudgetUpdateCall.html) -* [creatives](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.Creative.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.CreativeInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.CreativeListCall.html) -* [direct deals](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.DirectDeal.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.DirectDealGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.DirectDealListCall.html) -* [performance report](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PerformanceReport.html) - * [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PerformanceReportListCall.html) -* [pretargeting config](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PretargetingConfig.html) - * [*delete*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.PretargetingConfigUpdateCall.html) +* [accounts](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.Account.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.AccountUpdateCall.html) +* [billing info](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.BillingInfo.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.BillingInfoListCall.html) +* [budget](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.Budget.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.BudgetUpdateCall.html) +* [creatives](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.Creative.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.CreativeInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.CreativeListCall.html) +* [direct deals](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.DirectDeal.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.DirectDealGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.DirectDealListCall.html) +* [performance report](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PerformanceReport.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PerformanceReportListCall.html) +* [pretargeting config](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PretargetingConfig.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.PretargetingConfigUpdateCall.html) @@ -35,17 +35,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html)** +* **[Hub](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -145,17 +145,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -165,29 +165,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adexchangebuyer1d3/1.0.12+20190614/google_adexchangebuyer1d3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangebuyer1d3/1.0.13+20191204/google_adexchangebuyer1d3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangebuyer1d3/src/lib.rs b/gen/adexchangebuyer1d3/src/lib.rs index 8caa893038..ea6888a28a 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs +++ b/gen/adexchangebuyer1d3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.13+20191204*, where *20191204* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). @@ -344,7 +344,7 @@ impl<'a, C, A> AdExchangeBuyer AdExchangeBuyer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/adexchangebuyer/v1.3/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -373,7 +373,7 @@ impl<'a, C, A> AdExchangeBuyer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -639,10 +639,10 @@ impl ResponseResult for AccountsList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreativeAdTechnologyProviders { - /// no description provided + /// Whether the creative contains an unidentified ad technology provider. If true, a bid submitted for a European Economic Area (EEA) user with this creative is not compliant with the GDPR policies as mentioned in the "Third-party Ad Technology Vendors" section of Authorized Buyers Program Guidelines. #[serde(rename="hasUnidentifiedProvider")] pub has_unidentified_provider: Option, - /// no description provided + /// The detected ad technology provider IDs for this creative. See https://storage.googleapis.com/adx-rtb-dictionaries/providers.csv for mapping of provider ID to provided name, a privacy policy URL, and a list of domains which can be attributed to the provider. If this creative contains provider IDs that are outside of those listed in the `BidRequest.adslot.consented_providers_settings.consented_providers` field on the Authorized Buyers Real-Time Bidding protocol or the `BidRequest.user.ext.consented_providers_settings.consented_providers` field on the OpenRTB protocol, a bid submitted for a European Economic Area (EEA) user with this creative is not compliant with the GDPR policies as mentioned in the "Third-party Ad Technology Vendors" section of Authorized Buyers Program Guidelines. #[serde(rename="detectedProviderIds")] pub detected_provider_ids: Option>, } @@ -1040,6 +1040,9 @@ impl ResponseResult for BillingInfoList {} pub struct PretargetingConfig { /// The kind of the resource, i.e. "adexchangebuyer#pretargetingConfig". pub kind: Option, + /// The maximum QPS allocated to this pretargeting configuration, used for pretargeting-level QPS limits. By default, this is not set, which indicates that there is no QPS limit at the configuration level (a global or account-level limit may still be imposed). + #[serde(rename="maximumQps")] + pub maximum_qps: Option, /// Requests containing any of these vertical ids will match. pub verticals: Option>, /// Requests matching any of these platforms will match. Possible values are PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET. diff --git a/gen/adexchangebuyer1d4-cli/Cargo.toml b/gen/adexchangebuyer1d4-cli/Cargo.toml index 765358eea1..d0d21c2c14 100644 --- a/gen/adexchangebuyer1d4-cli/Cargo.toml +++ b/gen/adexchangebuyer1d4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d4-cli" -version = "1.0.12+20190614" +version = "1.0.13+20191204" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-adexchangebuyer1d4] path = "../adexchangebuyer1d4" -version = "1.0.12+20190614" +version = "1.0.13+20191204" diff --git a/gen/adexchangebuyer1d4-cli/README.md b/gen/adexchangebuyer1d4-cli/README.md index c8dbcce15c..8dc5a32e7b 100644 --- a/gen/adexchangebuyer1d4-cli/README.md +++ b/gen/adexchangebuyer1d4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Exchange Buyer* API at revision *20190614*. The CLI is at version *1.0.12*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20191204*. The CLI is at version *1.0.13*. ```bash adexchangebuyer1d4 [options] diff --git a/gen/adexchangebuyer1d4-cli/mkdocs.yml b/gen/adexchangebuyer1d4-cli/mkdocs.yml index e6373bd77d..75e5488961 100644 --- a/gen/adexchangebuyer1d4-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v1.0.12+20190614 +site_name: Ad Exchange Buyer v1.0.13+20191204 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d4-cli site_description: A complete library to interact with Ad Exchange Buyer (protocol v1.4) diff --git a/gen/adexchangebuyer1d4-cli/src/main.rs b/gen/adexchangebuyer1d4-cli/src/main.rs index f3a26d9c53..9286eddd23 100644 --- a/gen/adexchangebuyer1d4-cli/src/main.rs +++ b/gen/adexchangebuyer1d4-cli/src/main.rs @@ -1833,7 +1833,8 @@ impl<'n> Engine<'n> { "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maximum-qps" => Some(("maximumQps", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "excluded-user-lists" => Some(("excludedUserLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1844,9 +1845,9 @@ impl<'n> Engine<'n> { "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "maximum-qps", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1991,7 +1992,8 @@ impl<'n> Engine<'n> { "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maximum-qps" => Some(("maximumQps", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "excluded-user-lists" => Some(("excludedUserLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2002,9 +2004,9 @@ impl<'n> Engine<'n> { "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "maximum-qps", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2097,7 +2099,8 @@ impl<'n> Engine<'n> { "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maximum-qps" => Some(("maximumQps", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "excluded-user-lists" => Some(("excludedUserLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2108,9 +2111,9 @@ impl<'n> Engine<'n> { "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "maximum-qps", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4091,7 +4094,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d4") .author("Sebastian Thiel ") - .version("1.0.12+20190614") + .version("1.0.13+20191204") .about("Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangebuyer1d4_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangebuyer1d4/Cargo.toml b/gen/adexchangebuyer1d4/Cargo.toml index 8b7e74f023..8ba93d4fa4 100644 --- a/gen/adexchangebuyer1d4/Cargo.toml +++ b/gen/adexchangebuyer1d4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangebuyer1d4" -version = "1.0.12+20190614" +version = "1.0.13+20191204" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d4" homepage = "https://developers.google.com/ad-exchange/buyer-rest" -documentation = "https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614" +documentation = "https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204" license = "MIT" keywords = ["adexchangebuyer", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/adexchangebuyer1d4/README.md b/gen/adexchangebuyer1d4/README.md index 7dde19a7b9..1e189bc73e 100644 --- a/gen/adexchangebuyer1d4/README.md +++ b/gen/adexchangebuyer1d4/README.md @@ -5,38 +5,38 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d4` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Ad Exchange Buyer* crate version *1.0.13+20191204*, where *20191204* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Ad Exchange Buyer* *v1d4* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html) ... -* [accounts](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.Account.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.AccountUpdateCall.html) -* [billing info](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.BillingInfo.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.BillingInfoListCall.html) -* [budget](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.Budget.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.BudgetUpdateCall.html) -* [creatives](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.Creative.html) - * [*add deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.CreativeAddDealCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.CreativeListCall.html), [*list deals*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.CreativeListDealCall.html) and [*remove deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.CreativeRemoveDealCall.html) +* [accounts](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.Account.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.AccountUpdateCall.html) +* [billing info](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.BillingInfo.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.BillingInfoListCall.html) +* [budget](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.Budget.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.BudgetUpdateCall.html) +* [creatives](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.Creative.html) + * [*add deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.CreativeAddDealCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.CreativeListCall.html), [*list deals*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.CreativeListDealCall.html) and [*remove deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.CreativeRemoveDealCall.html) * marketplacedeals - * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.MarketplacedealDeleteCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.MarketplacedealInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.MarketplacedealListCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.MarketplacedealUpdateCall.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.MarketplacedealDeleteCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.MarketplacedealInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.MarketplacedealListCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.MarketplacedealUpdateCall.html) * marketplacenotes - * [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.MarketplacenoteInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.MarketplacenoteListCall.html) + * [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.MarketplacenoteInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.MarketplacenoteListCall.html) * marketplaceprivateauction - * [*updateproposal*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.MarketplaceprivateauctionUpdateproposalCall.html) -* [performance report](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PerformanceReport.html) - * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PerformanceReportListCall.html) -* [pretargeting config](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PretargetingConfig.html) - * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PretargetingConfigUpdateCall.html) -* [products](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.Product.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProductGetCall.html) and [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProductSearchCall.html) -* [proposals](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.Proposal.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProposalGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProposalInsertCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProposalPatchCall.html), [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProposalSearchCall.html), [*setupcomplete*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProposalSetupcompleteCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.ProposalUpdateCall.html) + * [*updateproposal*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.MarketplaceprivateauctionUpdateproposalCall.html) +* [performance report](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PerformanceReport.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PerformanceReportListCall.html) +* [pretargeting config](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PretargetingConfig.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PretargetingConfigUpdateCall.html) +* [products](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.Product.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProductGetCall.html) and [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProductSearchCall.html) +* [proposals](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.Proposal.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProposalGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProposalInsertCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProposalPatchCall.html), [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProposalSearchCall.html), [*setupcomplete*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProposalSetupcompleteCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.ProposalUpdateCall.html) * pubprofiles - * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.PubprofileListCall.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.PubprofileListCall.html) @@ -45,17 +45,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html)** +* **[Hub](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -157,17 +157,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -177,29 +177,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adexchangebuyer1d4/1.0.12+20190614/google_adexchangebuyer1d4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangebuyer1d4/1.0.13+20191204/google_adexchangebuyer1d4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangebuyer1d4/src/lib.rs b/gen/adexchangebuyer1d4/src/lib.rs index f1b11bbd4a..915c15cb78 100644 --- a/gen/adexchangebuyer1d4/src/lib.rs +++ b/gen/adexchangebuyer1d4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.13+20191204*, where *20191204* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Ad Exchange Buyer* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). @@ -356,7 +356,7 @@ impl<'a, C, A> AdExchangeBuyer AdExchangeBuyer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/adexchangebuyer/v1.4/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -400,7 +400,7 @@ impl<'a, C, A> AdExchangeBuyer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -2043,13 +2043,16 @@ pub struct PretargetingConfig { pub config_name: Option, /// The kind of the resource, i.e. "adexchangebuyer#pretargetingConfig". pub kind: Option, + /// The maximum QPS allocated to this pretargeting configuration, used for pretargeting-level QPS limits. By default, this is not set, which indicates that there is no QPS limit at the configuration level (a global or account-level limit may still be imposed). + #[serde(rename="maximumQps")] + pub maximum_qps: Option, /// Requests containing any of these vertical ids will match. pub verticals: Option>, /// Requests matching any of these platforms will match. Possible values are PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET. pub platforms: Option>, - /// List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO. - #[serde(rename="creativeType")] - pub creative_type: Option>, + /// The id for billing purposes, provided for reference. Leave this field blank for insert requests; the id will be generated automatically. + #[serde(rename="billingId")] + pub billing_id: Option, /// Requests containing any of these geo criteria ids will match. #[serde(rename="geoCriteriaIds")] pub geo_criteria_ids: Option>, @@ -2099,9 +2102,9 @@ pub struct PretargetingConfig { /// Requests containing any of these mobile device ids will match. Values are from mobile-devices.csv in the downloadable files section. #[serde(rename="mobileDevices")] pub mobile_devices: Option>, - /// The id for billing purposes, provided for reference. Leave this field blank for insert requests; the id will be generated automatically. - #[serde(rename="billingId")] - pub billing_id: Option, + /// List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO. + #[serde(rename="creativeType")] + pub creative_type: Option>, /// Requests containing any of these mobile carrier ids will match. Values are from mobile-carriers.csv in the downloadable files section. #[serde(rename="mobileCarriers")] pub mobile_carriers: Option>, @@ -2447,10 +2450,10 @@ impl Part for CreativeNativeAd {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreativeAdTechnologyProviders { - /// no description provided + /// Whether the creative contains an unidentified ad technology provider. If true, a bid submitted for a European Economic Area (EEA) user with this creative is not compliant with the GDPR policies as mentioned in the "Third-party Ad Technology Vendors" section of Authorized Buyers Program Guidelines. #[serde(rename="hasUnidentifiedProvider")] pub has_unidentified_provider: Option, - /// no description provided + /// The detected ad technology provider IDs for this creative. See https://storage.googleapis.com/adx-rtb-dictionaries/providers.csv for mapping of provider ID to provided name, a privacy policy URL, and a list of domains which can be attributed to the provider. If this creative contains provider IDs that are outside of those listed in the `BidRequest.adslot.consented_providers_settings.consented_providers` field on the Authorized Buyers Real-Time Bidding protocol or the `BidRequest.user.ext.consented_providers_settings.consented_providers` field on the OpenRTB protocol, a bid submitted for a European Economic Area (EEA) user with this creative is not compliant with the GDPR policies as mentioned in the "Third-party Ad Technology Vendors" section of Authorized Buyers Program Guidelines. #[serde(rename="detectedProviderIds")] pub detected_provider_ids: Option>, } @@ -2553,7 +2556,7 @@ impl Part for TargetingValue {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DealTerms { - /// Visibilty of the URL in bid requests. + /// Visibility of the URL in bid requests. #[serde(rename="brandingType")] pub branding_type: Option, /// Indicates that this ExternalDealId exists under at least two different AdxInventoryDeals. Currently, the only case that the same ExternalDealId will exist is programmatic cross sell case. diff --git a/gen/adexchangebuyer2_v2_beta1-cli/Cargo.toml b/gen/adexchangebuyer2_v2_beta1-cli/Cargo.toml index c7362d2b3c..be03450b6b 100644 --- a/gen/adexchangebuyer2_v2_beta1-cli/Cargo.toml +++ b/gen/adexchangebuyer2_v2_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer2_v2_beta1-cli" -version = "1.0.12+20190701" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdExchangeBuyerII (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer2_v2_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-adexchangebuyer2_v2_beta1] path = "../adexchangebuyer2_v2_beta1" -version = "1.0.12+20190701" +version = "1.0.13+20200409" diff --git a/gen/adexchangebuyer2_v2_beta1-cli/README.md b/gen/adexchangebuyer2_v2_beta1-cli/README.md index e5fc578eac..971ce19c5e 100644 --- a/gen/adexchangebuyer2_v2_beta1-cli/README.md +++ b/gen/adexchangebuyer2_v2_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *AdExchangeBuyerII* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *AdExchangeBuyerII* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash adexchangebuyer2-v2-beta1 [options] diff --git a/gen/adexchangebuyer2_v2_beta1-cli/mkdocs.yml b/gen/adexchangebuyer2_v2_beta1-cli/mkdocs.yml index a773ade1f1..b00f807ad7 100644 --- a/gen/adexchangebuyer2_v2_beta1-cli/mkdocs.yml +++ b/gen/adexchangebuyer2_v2_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdExchangeBuyerII v1.0.12+20190701 +site_name: AdExchangeBuyerII v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer2_v2_beta1-cli site_description: A complete library to interact with AdExchangeBuyerII (protocol v2beta1) diff --git a/gen/adexchangebuyer2_v2_beta1-cli/src/main.rs b/gen/adexchangebuyer2_v2_beta1-cli/src/main.rs index e2f96fab95..cb473f53ee 100644 --- a/gen/adexchangebuyer2_v2_beta1-cli/src/main.rs +++ b/gen/adexchangebuyer2_v2_beta1-cli/src/main.rs @@ -2845,6 +2845,7 @@ impl<'n> Engine<'n> { "time-series-granularity" => Some(("timeSeriesGranularity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creative-id" => Some(("creativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "relative-date-range.duration-days" => Some(("relativeDateRange.durationDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "relative-date-range.offset-days" => Some(("relativeDateRange.offsetDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "publisher-identifiers" => Some(("publisherIdentifiers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2862,7 +2863,7 @@ impl<'n> Engine<'n> { "realtime-time-range.start-timestamp" => Some(("realtimeTimeRange.startTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "seller-network-ids" => Some(("sellerNetworkIds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["absolute-date-range", "breakdown-dimensions", "creative-id", "day", "deal-id", "duration-days", "end-date", "environment", "formats", "month", "name", "offset-days", "platforms", "publisher-identifiers", "realtime-time-range", "relative-date-range", "seller-network-ids", "start-date", "start-timestamp", "time-series-granularity", "year"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["absolute-date-range", "breakdown-dimensions", "creative-id", "day", "deal-id", "duration-days", "end-date", "environment", "format", "formats", "month", "name", "offset-days", "platforms", "publisher-identifiers", "realtime-time-range", "relative-date-range", "seller-network-ids", "start-date", "start-timestamp", "time-series-granularity", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3707,6 +3708,7 @@ impl<'n> Engine<'n> { "time-series-granularity" => Some(("timeSeriesGranularity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creative-id" => Some(("creativeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "format" => Some(("format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "relative-date-range.duration-days" => Some(("relativeDateRange.durationDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "relative-date-range.offset-days" => Some(("relativeDateRange.offsetDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "publisher-identifiers" => Some(("publisherIdentifiers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -3724,7 +3726,7 @@ impl<'n> Engine<'n> { "realtime-time-range.start-timestamp" => Some(("realtimeTimeRange.startTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "seller-network-ids" => Some(("sellerNetworkIds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["absolute-date-range", "breakdown-dimensions", "creative-id", "day", "deal-id", "duration-days", "end-date", "environment", "formats", "month", "name", "offset-days", "platforms", "publisher-identifiers", "realtime-time-range", "relative-date-range", "seller-network-ids", "start-date", "start-timestamp", "time-series-granularity", "year"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["absolute-date-range", "breakdown-dimensions", "creative-id", "day", "deal-id", "duration-days", "end-date", "environment", "format", "formats", "month", "name", "offset-days", "platforms", "publisher-identifiers", "realtime-time-range", "relative-date-range", "seller-network-ids", "start-date", "start-timestamp", "time-series-granularity", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6743,7 +6745,7 @@ fn main() { let mut app = App::new("adexchangebuyer2-v2-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200409") .about("Accesses the latest features for managing Authorized Buyers accounts, Real-Time Bidding configurations and auction metrics, and Marketplace programmatic deals.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangebuyer2_v2_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangebuyer2_v2_beta1/Cargo.toml b/gen/adexchangebuyer2_v2_beta1/Cargo.toml index ce868fd36a..a9bb8a521c 100644 --- a/gen/adexchangebuyer2_v2_beta1/Cargo.toml +++ b/gen/adexchangebuyer2_v2_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangebuyer2_v2_beta1" -version = "1.0.12+20190701" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdExchangeBuyerII (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer2_v2_beta1" homepage = "https://developers.google.com/authorized-buyers/apis/reference/rest/" -documentation = "https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701" +documentation = "https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409" license = "MIT" keywords = ["adexchangebuyer2", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/adexchangebuyer2_v2_beta1/README.md b/gen/adexchangebuyer2_v2_beta1/README.md index d53868be28..9338bd560e 100644 --- a/gen/adexchangebuyer2_v2_beta1/README.md +++ b/gen/adexchangebuyer2_v2_beta1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-adexchangebuyer2_v2_beta1` library allows access to all features of the *Google AdExchangeBuyerII* service. -This documentation was generated from *AdExchangeBuyerII* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *adexchangebuyer2:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *AdExchangeBuyerII* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *adexchangebuyer2:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *AdExchangeBuyerII* *v2_beta1* API can be found at the [official documentation site](https://developers.google.com/authorized-buyers/apis/reference/rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AdExchangeBuyerII.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AdExchangeBuyerII.html) ... * accounts - * [*clients create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientCreateCall.html), [*clients get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientGetCall.html), [*clients invitations create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientInvitationCreateCall.html), [*clients invitations get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientInvitationGetCall.html), [*clients invitations list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientInvitationListCall.html), [*clients list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientListCall.html), [*clients update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientUpdateCall.html), [*clients users get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientUserGetCall.html), [*clients users list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientUserListCall.html), [*clients users update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountClientUserUpdateCall.html), [*creatives create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeCreateCall.html), [*creatives deal associations add*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeDealAssociationAddCall.html), [*creatives deal associations list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeDealAssociationListCall.html), [*creatives deal associations remove*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeDealAssociationRemoveCall.html), [*creatives get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeGetCall.html), [*creatives list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeListCall.html), [*creatives stop watching*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeStopWatchingCall.html), [*creatives update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeUpdateCall.html), [*creatives watch*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeWatchCall.html), [*finalized proposals list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountFinalizedProposalListCall.html), [*products get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProductGetCall.html), [*products list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProductListCall.html), [*proposals accept*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalAcceptCall.html), [*proposals add note*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalAddNoteCall.html), [*proposals cancel negotiation*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalCancelNegotiationCall.html), [*proposals complete setup*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalCompleteSetupCall.html), [*proposals create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalCreateCall.html), [*proposals get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalGetCall.html), [*proposals list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalListCall.html), [*proposals pause*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalPauseCall.html), [*proposals resume*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalResumeCall.html), [*proposals update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountProposalUpdateCall.html), [*publisher profiles get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountPublisherProfileGetCall.html) and [*publisher profiles list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AccountPublisherProfileListCall.html) + * [*clients create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientCreateCall.html), [*clients get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientGetCall.html), [*clients invitations create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientInvitationCreateCall.html), [*clients invitations get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientInvitationGetCall.html), [*clients invitations list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientInvitationListCall.html), [*clients list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientListCall.html), [*clients update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientUpdateCall.html), [*clients users get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientUserGetCall.html), [*clients users list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientUserListCall.html), [*clients users update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountClientUserUpdateCall.html), [*creatives create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeCreateCall.html), [*creatives deal associations add*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeDealAssociationAddCall.html), [*creatives deal associations list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeDealAssociationListCall.html), [*creatives deal associations remove*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeDealAssociationRemoveCall.html), [*creatives get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeGetCall.html), [*creatives list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeListCall.html), [*creatives stop watching*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeStopWatchingCall.html), [*creatives update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeUpdateCall.html), [*creatives watch*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountCreativeWatchCall.html), [*finalized proposals list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountFinalizedProposalListCall.html), [*products get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProductGetCall.html), [*products list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProductListCall.html), [*proposals accept*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalAcceptCall.html), [*proposals add note*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalAddNoteCall.html), [*proposals cancel negotiation*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalCancelNegotiationCall.html), [*proposals complete setup*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalCompleteSetupCall.html), [*proposals create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalCreateCall.html), [*proposals get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalGetCall.html), [*proposals list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalListCall.html), [*proposals pause*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalPauseCall.html), [*proposals resume*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalResumeCall.html), [*proposals update*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountProposalUpdateCall.html), [*publisher profiles get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountPublisherProfileGetCall.html) and [*publisher profiles list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AccountPublisherProfileListCall.html) * bidders - * [*accounts filter sets bid metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetBidMetricListCall.html), [*accounts filter sets bid response errors list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetBidResponseErrorListCall.html), [*accounts filter sets bid responses without bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetBidResponsesWithoutBidListCall.html), [*accounts filter sets create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetCreateCall.html), [*accounts filter sets delete*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetDeleteCall.html), [*accounts filter sets filtered bid requests list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidRequestListCall.html), [*accounts filter sets filtered bids creatives list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidCreativeListCall.html), [*accounts filter sets filtered bids details list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidDetailListCall.html), [*accounts filter sets filtered bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidListCall.html), [*accounts filter sets get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetGetCall.html), [*accounts filter sets impression metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetImpressionMetricListCall.html), [*accounts filter sets list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetListCall.html), [*accounts filter sets losing bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetLosingBidListCall.html), [*accounts filter sets non billable winning bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetNonBillableWinningBidListCall.html), [*filter sets bid metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetBidMetricListCall.html), [*filter sets bid response errors list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetBidResponseErrorListCall.html), [*filter sets bid responses without bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetBidResponsesWithoutBidListCall.html), [*filter sets create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetCreateCall.html), [*filter sets delete*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetDeleteCall.html), [*filter sets filtered bid requests list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidRequestListCall.html), [*filter sets filtered bids creatives list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidCreativeListCall.html), [*filter sets filtered bids details list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidDetailListCall.html), [*filter sets filtered bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidListCall.html), [*filter sets get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetGetCall.html), [*filter sets impression metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetImpressionMetricListCall.html), [*filter sets list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetListCall.html), [*filter sets losing bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetLosingBidListCall.html) and [*filter sets non billable winning bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetNonBillableWinningBidListCall.html) + * [*accounts filter sets bid metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetBidMetricListCall.html), [*accounts filter sets bid response errors list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetBidResponseErrorListCall.html), [*accounts filter sets bid responses without bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetBidResponsesWithoutBidListCall.html), [*accounts filter sets create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetCreateCall.html), [*accounts filter sets delete*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetDeleteCall.html), [*accounts filter sets filtered bid requests list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidRequestListCall.html), [*accounts filter sets filtered bids creatives list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidCreativeListCall.html), [*accounts filter sets filtered bids details list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidDetailListCall.html), [*accounts filter sets filtered bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetFilteredBidListCall.html), [*accounts filter sets get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetGetCall.html), [*accounts filter sets impression metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetImpressionMetricListCall.html), [*accounts filter sets list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetListCall.html), [*accounts filter sets losing bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetLosingBidListCall.html), [*accounts filter sets non billable winning bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderAccountFilterSetNonBillableWinningBidListCall.html), [*filter sets bid metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetBidMetricListCall.html), [*filter sets bid response errors list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetBidResponseErrorListCall.html), [*filter sets bid responses without bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetBidResponsesWithoutBidListCall.html), [*filter sets create*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetCreateCall.html), [*filter sets delete*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetDeleteCall.html), [*filter sets filtered bid requests list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidRequestListCall.html), [*filter sets filtered bids creatives list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidCreativeListCall.html), [*filter sets filtered bids details list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidDetailListCall.html), [*filter sets filtered bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetFilteredBidListCall.html), [*filter sets get*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetGetCall.html), [*filter sets impression metrics list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetImpressionMetricListCall.html), [*filter sets list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetListCall.html), [*filter sets losing bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetLosingBidListCall.html) and [*filter sets non billable winning bids list*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.BidderFilterSetNonBillableWinningBidListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/struct.AdExchangeBuyerII.html)** +* **[Hub](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/struct.AdExchangeBuyerII.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.12+20190701/google_adexchangebuyer2_v2_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangebuyer2_v2_beta1/1.0.13+20200409/google_adexchangebuyer2_v2_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangebuyer2_v2_beta1/src/lib.rs b/gen/adexchangebuyer2_v2_beta1/src/lib.rs index 0267c2ba35..45827d00af 100644 --- a/gen/adexchangebuyer2_v2_beta1/src/lib.rs +++ b/gen/adexchangebuyer2_v2_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdExchangeBuyerII* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *adexchangebuyer2:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *AdExchangeBuyerII* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *adexchangebuyer2:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *AdExchangeBuyerII* *v2_beta1* API can be found at the //! [official documentation site](https://developers.google.com/authorized-buyers/apis/reference/rest/). @@ -338,7 +338,7 @@ impl<'a, C, A> AdExchangeBuyerII AdExchangeBuyerII { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://adexchangebuyer.googleapis.com/".to_string(), _root_url: "https://adexchangebuyer.googleapis.com/".to_string(), } @@ -352,7 +352,7 @@ impl<'a, C, A> AdExchangeBuyerII } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -1667,6 +1667,8 @@ pub struct FilterSet { /// /// This field is required in create operations. pub name: Option, + /// Creative format bidded on or allowed to bid on, can be empty. + pub format: Option, /// For Authorized Buyers only. /// The list of IDs of the seller (publisher) networks on which to filter; /// may be empty. The filters represented by multiple seller network IDs are @@ -1711,9 +1713,10 @@ pub struct FilterSet { /// Interpreted relative to Pacific time zone. #[serde(rename="absoluteDateRange")] pub absolute_date_range: Option, - /// The list of formats on which to filter; may be empty. The filters - /// represented by multiple formats are ORed together (i.e., if non-empty, - /// results must match any one of the formats). + /// Creative formats bidded on or allowed to bid on, can be empty. Although + /// this field is a list, it can only be populated with a single item. A + /// HTTP 400 bad request error will be returned in the response if you specify + /// multiple items. pub formats: Option>, /// The ID of the creative on which to filter; optional. This field may be set /// only for a filter set that accesses account-level troubleshooting data, @@ -3170,7 +3173,7 @@ impl Part for OperatingSystemTargeting {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BidMetricsRow { - /// The number of bids that won an impression. + /// The number of bids that won the auction. #[serde(rename="impressionsWon")] pub impressions_won: Option, /// The values of all dimensions associated with metric values in this row. diff --git a/gen/adexchangeseller2-cli/Cargo.toml b/gen/adexchangeseller2-cli/Cargo.toml index 62b3f9e42b..c9ef450511 100644 --- a/gen/adexchangeseller2-cli/Cargo.toml +++ b/gen/adexchangeseller2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangeseller2-cli" -version = "1.0.12+20171101" +version = "1.0.13+20171101" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-adexchangeseller2] path = "../adexchangeseller2" -version = "1.0.12+20171101" +version = "1.0.13+20171101" diff --git a/gen/adexchangeseller2-cli/README.md b/gen/adexchangeseller2-cli/README.md index 74ab817937..6cec508581 100644 --- a/gen/adexchangeseller2-cli/README.md +++ b/gen/adexchangeseller2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Exchange Seller* API at revision *20171101*. The CLI is at version *1.0.12*. +This documentation was generated from the *Ad Exchange Seller* API at revision *20171101*. The CLI is at version *1.0.13*. ```bash adexchangeseller2 [options] diff --git a/gen/adexchangeseller2-cli/mkdocs.yml b/gen/adexchangeseller2-cli/mkdocs.yml index d8a7050eeb..3b196edcc0 100644 --- a/gen/adexchangeseller2-cli/mkdocs.yml +++ b/gen/adexchangeseller2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Seller v1.0.12+20171101 +site_name: Ad Exchange Seller v1.0.13+20171101 site_url: http://byron.github.io/google-apis-rs/google-adexchangeseller2-cli site_description: A complete library to interact with Ad Exchange Seller (protocol v2.0) diff --git a/gen/adexchangeseller2-cli/src/main.rs b/gen/adexchangeseller2-cli/src/main.rs index 60e34fc102..1d277cda6b 100644 --- a/gen/adexchangeseller2-cli/src/main.rs +++ b/gen/adexchangeseller2-cli/src/main.rs @@ -1348,7 +1348,7 @@ fn main() { let mut app = App::new("adexchangeseller2") .author("Sebastian Thiel ") - .version("1.0.12+20171101") + .version("1.0.13+20171101") .about("Accesses the inventory of Ad Exchange seller users and generates reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangeseller2_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangeseller2/Cargo.toml b/gen/adexchangeseller2/Cargo.toml index c02b08f978..60698addb8 100644 --- a/gen/adexchangeseller2/Cargo.toml +++ b/gen/adexchangeseller2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangeseller2" -version = "1.0.12+20171101" +version = "1.0.13+20171101" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Seller (protocol v2.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangeseller2" homepage = "https://developers.google.com/ad-exchange/seller-rest/" -documentation = "https://docs.rs/google-adexchangeseller2/1.0.12+20171101" +documentation = "https://docs.rs/google-adexchangeseller2/1.0.13+20171101" license = "MIT" keywords = ["adexchangeseller", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/adexchangeseller2/README.md b/gen/adexchangeseller2/README.md index 9c3ce4bb41..276bbb62d6 100644 --- a/gen/adexchangeseller2/README.md +++ b/gen/adexchangeseller2/README.md @@ -5,21 +5,21 @@ DO NOT EDIT ! --> The `google-adexchangeseller2` library allows access to all features of the *Google Ad Exchange Seller* service. -This documentation was generated from *Ad Exchange Seller* crate version *1.0.12+20171101*, where *20171101* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Ad Exchange Seller* crate version *1.0.13+20171101*, where *20171101* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Ad Exchange Seller* *v2* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AdExchangeSeller.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AdExchangeSeller.html) ... -* [accounts](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.Account.html) - * [*adclients list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountAdclientListCall.html), [*alerts list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountAlertListCall.html), [*customchannels get*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountListCall.html), [*metadata dimensions list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountMetadataDimensionListCall.html), [*metadata metrics list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountMetadataMetricListCall.html), [*preferreddeals get*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountPreferreddealGetCall.html), [*preferreddeals list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountPreferreddealListCall.html), [*reports generate*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountReportSavedListCall.html) and [*urlchannels list*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountUrlchannelListCall.html) +* [accounts](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.Account.html) + * [*adclients list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountAdclientListCall.html), [*alerts list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountAlertListCall.html), [*customchannels get*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountListCall.html), [*metadata dimensions list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountMetadataDimensionListCall.html), [*metadata metrics list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountMetadataMetricListCall.html), [*preferreddeals get*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountPreferreddealGetCall.html), [*preferreddeals list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountPreferreddealListCall.html), [*reports generate*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountReportSavedListCall.html) and [*urlchannels list*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountUrlchannelListCall.html) Download supported by ... -* [*reports generate accounts*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AccountReportGenerateCall.html) +* [*reports generate accounts*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AccountReportGenerateCall.html) @@ -27,17 +27,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/struct.AdExchangeSeller.html)** +* **[Hub](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/struct.AdExchangeSeller.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -148,17 +148,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -168,29 +168,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adexchangeseller2/1.0.12+20171101/google_adexchangeseller2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangeseller2/1.0.13+20171101/google_adexchangeseller2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangeseller2/src/lib.rs b/gen/adexchangeseller2/src/lib.rs index 5f18b38cf5..ae23179d8c 100644 --- a/gen/adexchangeseller2/src/lib.rs +++ b/gen/adexchangeseller2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Seller* crate version *1.0.12+20171101*, where *20171101* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Ad Exchange Seller* crate version *1.0.13+20171101*, where *20171101* is the exact revision of the *adexchangeseller:v2.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Ad Exchange Seller* *v2* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/seller-rest/). @@ -352,7 +352,7 @@ impl<'a, C, A> AdExchangeSeller AdExchangeSeller { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/adexchangeseller/v2.0/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -363,7 +363,7 @@ impl<'a, C, A> AdExchangeSeller } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/adexperiencereport1-cli/Cargo.toml b/gen/adexperiencereport1-cli/Cargo.toml index aeb09aa03b..0a3c6710d9 100644 --- a/gen/adexperiencereport1-cli/Cargo.toml +++ b/gen/adexperiencereport1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexperiencereport1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Experience Report (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexperiencereport1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-adexperiencereport1] path = "../adexperiencereport1" -version = "1.0.12+20190624" +version = "1.0.13+20200405" diff --git a/gen/adexperiencereport1-cli/README.md b/gen/adexperiencereport1-cli/README.md index f3080e2eb6..d0256091df 100644 --- a/gen/adexperiencereport1-cli/README.md +++ b/gen/adexperiencereport1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Experience Report* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Ad Experience Report* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash adexperiencereport1 [options] @@ -36,10 +36,6 @@ adexperiencereport1 [options] adexperiencereport1 --help Configuration: - [--scope ]... - Specify the authentication a method should be executed in. Each scope - requires the user to grant this application permission to use it. - If unset, it defaults to the shortest scope url for a particular method. --config-dir A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation. diff --git a/gen/adexperiencereport1-cli/mkdocs.yml b/gen/adexperiencereport1-cli/mkdocs.yml index 0192c37c32..d34bc60b2e 100644 --- a/gen/adexperiencereport1-cli/mkdocs.yml +++ b/gen/adexperiencereport1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Experience Report v1.0.12+20190624 +site_name: Ad Experience Report v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-adexperiencereport1-cli site_description: A complete library to interact with Ad Experience Report (protocol v1) diff --git a/gen/adexperiencereport1-cli/src/main.rs b/gen/adexperiencereport1-cli/src/main.rs index c6ea5f4ea1..4d73531ade 100644 --- a/gen/adexperiencereport1-cli/src/main.rs +++ b/gen/adexperiencereport1-cli/src/main.rs @@ -75,9 +75,6 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -127,9 +124,6 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -264,18 +258,15 @@ fn main() { let arg_data = [ ("sites", "methods: 'get'", vec![ ("get", - Some(r##"Gets a summary of the ad experience rating of a site."##), + Some(r##"Gets a site's Ad Experience Report summary."##), "Details at http://byron.github.io/google-apis-rs/google_adexperiencereport1_cli/sites_get", vec![ (Some(r##"name"##), None, - Some(r##"The required site name. It should be the site property whose ad experiences - may have been reviewed, and it should be URL-encoded. For example, - sites/https%3A%2F%2Fwww.google.com. The server will return an error of - BAD_REQUEST if this field is not filled in. Note that if the site property - is not yet verified in Search Console, the reportUrl field returned by the - API will lead to the verification page, prompting the user to go through - that process before they can gain access to the Ad Experience Report."##), + Some(r##"Required. The name of the site whose summary to get, e.g. + `sites/http%3A%2F%2Fwww.google.com%2F`. + + Format: `sites/{site}`"##), Some(true), Some(false)), @@ -295,7 +286,8 @@ fn main() { ("violating-sites", "methods: 'list'", vec![ ("list", - Some(r##"Lists sites with Ad Experience Report statuses of "Failing" or "Warning"."##), + Some(r##"Lists sites that are failing in the Ad Experience Report on at least one + platform."##), "Details at http://byron.github.io/google-apis-rs/google_adexperiencereport1_cli/violating-sites_list", vec![ (Some(r##"v"##), @@ -316,14 +308,9 @@ fn main() { let mut app = App::new("adexperiencereport1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200405") .about("Views Ad Experience Report data, and gets a list of sites that have a significant number of annoying ads.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexperiencereport1_cli") - .arg(Arg::with_name("url") - .long("scope") - .help("Specify the authentication a method should be executed in. Each scope requires the user to grant this application permission to use it.If unset, it defaults to the shortest scope url for a particular method.") - .multiple(true) - .takes_value(true)) .arg(Arg::with_name("folder") .long("config-dir") .help("A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation.[default: ~/.google-service-cli") diff --git a/gen/adexperiencereport1/Cargo.toml b/gen/adexperiencereport1/Cargo.toml index dc4f591d5b..dd67794662 100644 --- a/gen/adexperiencereport1/Cargo.toml +++ b/gen/adexperiencereport1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexperiencereport1" -version = "1.0.12+20190624" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Experience Report (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexperiencereport1" homepage = "https://developers.google.com/ad-experience-report/" -documentation = "https://docs.rs/google-adexperiencereport1/1.0.12+20190624" +documentation = "https://docs.rs/google-adexperiencereport1/1.0.13+20200405" license = "MIT" keywords = ["adexperiencereport", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/adexperiencereport1/README.md b/gen/adexperiencereport1/README.md index ca5a36e451..66a46061ac 100644 --- a/gen/adexperiencereport1/README.md +++ b/gen/adexperiencereport1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-adexperiencereport1` library allows access to all features of the *Google Ad Experience Report* service. -This documentation was generated from *Ad Experience Report* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *adexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Ad Experience Report* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *adexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Ad Experience Report* *v1* API can be found at the [official documentation site](https://developers.google.com/ad-experience-report/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/struct.AdExperienceReport.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/struct.AdExperienceReport.html) ... * sites - * [*get*](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/struct.SiteGetCall.html) + * [*get*](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/struct.SiteGetCall.html) * violating sites - * [*list*](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/struct.ViolatingSiteListCall.html) + * [*list*](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/struct.ViolatingSiteListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/struct.AdExperienceReport.html)** +* **[Hub](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/struct.AdExperienceReport.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -126,17 +126,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -146,29 +146,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adexperiencereport1/1.0.12+20190624/google_adexperiencereport1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexperiencereport1/1.0.13+20200405/google_adexperiencereport1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexperiencereport1/src/lib.rs b/gen/adexperiencereport1/src/lib.rs index 22e85f2169..bc52502328 100644 --- a/gen/adexperiencereport1/src/lib.rs +++ b/gen/adexperiencereport1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Experience Report* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *adexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Ad Experience Report* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *adexperiencereport:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Ad Experience Report* *v1* API can be found at the //! [official documentation site](https://developers.google.com/ad-experience-report/). @@ -220,28 +220,6 @@ pub use cmn::*; // UTILITIES ### // ############ -/// Identifies the an OAuth2 authorization scope. -/// A scope is needed when requesting an -/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). -#[derive(PartialEq, Eq, Hash)] -pub enum Scope { - /// Test scope for access to the Zoo service - XapiZoo, -} - -impl AsRef for Scope { - fn as_ref(&self) -> &str { - match *self { - Scope::XapiZoo => "https://www.googleapis.com/auth/xapi.zoo", - } - } -} - -impl Default for Scope { - fn default() -> Scope { - Scope::XapiZoo - } -} @@ -319,7 +297,7 @@ impl<'a, C, A> AdExperienceReport AdExperienceReport { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://adexperiencereport.googleapis.com/".to_string(), _root_url: "https://adexperiencereport.googleapis.com/".to_string(), } @@ -333,7 +311,7 @@ impl<'a, C, A> AdExperienceReport } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -361,30 +339,48 @@ impl<'a, C, A> AdExperienceReport // ############ // SCHEMAS ### // ########## -/// Summary of the ad experience rating of a site for a specific platform. +/// A site's Ad Experience Report summary on a single platform. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PlatformSummary { - /// Whether the site is currently under review. + /// Whether the site is currently under review on this platform. #[serde(rename="underReview")] pub under_review: Option, - /// The date on which ad filtering begins. + /// The time at which + /// [enforcement](https://support.google.com/webtools/answer/7308033) against + /// the site began or will begin on this platform. + /// + /// Not set when the + /// filter_status + /// is OFF. #[serde(rename="enforcementTime")] pub enforcement_time: Option, - /// The last time that the site changed status. + /// The time at which the site's status last changed on this platform. #[serde(rename="lastChangeTime")] pub last_change_time: Option, - /// The ad filtering status of the site. + /// The site's [enforcement + /// status](https://support.google.com/webtools/answer/7308033) on this + /// platform. #[serde(rename="filterStatus")] pub filter_status: Option, - /// The assigned regions for the site and platform. + /// The site's regions on this platform. + /// + /// No longer populated, because there is no longer any semantic difference + /// between sites in different regions. pub region: Option>, - /// A link that leads to a full ad experience report. + /// A link to the full Ad Experience Report for the site on this platform.. + /// + /// Not set in + /// ViolatingSitesResponse. + /// + /// Note that you must complete the [Search Console verification + /// process](https://support.google.com/webmasters/answer/9008080) for the site + /// before you can access the full report. #[serde(rename="reportUrl")] pub report_url: Option, - /// The status of the site reviewed for the Better Ads Standards. + /// The site's Ad Experience Report status on this platform. #[serde(rename="betterAdsStatus")] pub better_ads_status: Option, } @@ -403,13 +399,13 @@ impl Part for PlatformSummary {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SiteSummaryResponse { - /// Summary for the desktop review of the site. + /// The site's Ad Experience Report summary on desktop. #[serde(rename="desktopSummary")] pub desktop_summary: Option, - /// The name of the site reviewed. + /// The name of the reviewed site, e.g. `google.com`. #[serde(rename="reviewedSite")] pub reviewed_site: Option, - /// Summary for the mobile review of the site. + /// The site's Ad Experience Report summary on mobile. #[serde(rename="mobileSummary")] pub mobile_summary: Option, } @@ -428,7 +424,7 @@ impl ResponseResult for SiteSummaryResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ViolatingSitesResponse { - /// A list of summaries of violating sites. + /// The list of violating sites. #[serde(rename="violatingSites")] pub violating_sites: Option>, } @@ -482,23 +478,18 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a summary of the ad experience rating of a site. + /// Gets a site's Ad Experience Report summary. /// /// # Arguments /// - /// * `name` - The required site name. It should be the site property whose ad experiences - /// may have been reviewed, and it should be URL-encoded. For example, - /// sites/https%3A%2F%2Fwww.google.com. The server will return an error of - /// BAD_REQUEST if this field is not filled in. Note that if the site property - /// is not yet verified in Search Console, the reportUrl field returned by the - /// API will lead to the verification page, prompting the user to go through - /// that process before they can gain access to the Ad Experience Report. + /// * `name` - Required. The name of the site whose summary to get, e.g. + /// `sites/http%3A%2F%2Fwww.google.com%2F`. + /// Format: `sites/{site}` pub fn get(&self, name: &str) -> SiteGetCall<'a, C, A> { SiteGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), - _scopes: Default::default(), _additional_params: Default::default(), } } @@ -547,12 +538,12 @@ impl<'a, C, A> ViolatingSiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists sites with Ad Experience Report statuses of "Failing" or "Warning". + /// Lists sites that are failing in the Ad Experience Report on at least one + /// platform. pub fn list(&self) -> ViolatingSiteListCall<'a, C, A> { ViolatingSiteListCall { hub: self.hub, _delegate: Default::default(), - _scopes: Default::default(), _additional_params: Default::default(), } } @@ -566,7 +557,7 @@ impl<'a, C, A> ViolatingSiteMethods<'a, C, A> { // CallBuilders ### // ################# -/// Gets a summary of the ad experience rating of a site. +/// Gets a site's Ad Experience Report summary. /// /// A builder for the *get* method supported by a *site* resource. /// It is not used directly, but through a `SiteMethods` instance. @@ -604,7 +595,6 @@ pub struct SiteGetCall<'a, C, A> _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, - _scopes: BTreeMap } impl<'a, C, A> CallBuilder for SiteGetCall<'a, C, A> {} @@ -639,8 +629,17 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::XapiZoo.as_ref().to_string(), ()); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } } for &(find_this, param_name) in [("{+name}", "name")].iter() { @@ -673,24 +672,10 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(UserAgent(self.hub._user_agent.clone())); dlg.pre_request(); req.send() @@ -741,13 +726,10 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth } - /// The required site name. It should be the site property whose ad experiences - /// may have been reviewed, and it should be URL-encoded. For example, - /// sites/https%3A%2F%2Fwww.google.com. The server will return an error of - /// BAD_REQUEST if this field is not filled in. Note that if the site property - /// is not yet verified in Search Console, the reportUrl field returned by the - /// API will lead to the verification page, prompting the user to go through - /// that process before they can gain access to the Ad Experience Report. + /// Required. The name of the site whose summary to get, e.g. + /// `sites/http%3A%2F%2Fwww.google.com%2F`. + /// + /// Format: `sites/{site}` /// /// Sets the *name* path property to the given value. /// @@ -794,33 +776,11 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth self } - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::XapiZoo`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } } -/// Lists sites with Ad Experience Report statuses of "Failing" or "Warning". +/// Lists sites that are failing in the Ad Experience Report on at least one +/// platform. /// /// A builder for the *list* method supported by a *violatingSite* resource. /// It is not used directly, but through a `ViolatingSiteMethods` instance. @@ -857,7 +817,6 @@ pub struct ViolatingSiteListCall<'a, C, A> hub: &'a AdExperienceReport, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, - _scopes: BTreeMap } impl<'a, C, A> CallBuilder for ViolatingSiteListCall<'a, C, A> {} @@ -890,8 +849,17 @@ impl<'a, C, A> ViolatingSiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); let mut url = self.hub._base_url.clone() + "v1/violatingSites"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::XapiZoo.as_ref().to_string(), ()); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } } @@ -900,24 +868,10 @@ impl<'a, C, A> ViolatingSiteListCall<'a, C, A> where C: BorrowMut loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(UserAgent(self.hub._user_agent.clone())); dlg.pre_request(); req.send() @@ -1005,29 +959,6 @@ impl<'a, C, A> ViolatingSiteListCall<'a, C, A> where C: BorrowMut self } - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::XapiZoo`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ViolatingSiteListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } } diff --git a/gen/admin1_directory-cli/Cargo.toml b/gen/admin1_directory-cli/Cargo.toml index 0663aaa3cc..43c4c9111f 100644 --- a/gen/admin1_directory-cli/Cargo.toml +++ b/gen/admin1_directory-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-admin1_directory-cli" -version = "1.0.12+20190214" +version = "1.0.13+20200204" authors = ["Sebastian Thiel "] description = "A complete library to interact with directory (protocol directory_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-admin1_directory] path = "../admin1_directory" -version = "1.0.12+20190214" +version = "1.0.13+20200204" diff --git a/gen/admin1_directory-cli/README.md b/gen/admin1_directory-cli/README.md index f341fadd75..a008789ef0 100644 --- a/gen/admin1_directory-cli/README.md +++ b/gen/admin1_directory-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *directory* API at revision *20190214*. The CLI is at version *1.0.12*. +This documentation was generated from the *directory* API at revision *20200204*. The CLI is at version *1.0.13*. ```bash admin1-directory [options] @@ -94,9 +94,6 @@ admin1-directory [options] update ... (-r )... [-p ]... [-o ] privileges list [-p ]... [-o ] - resolved-app-access-settings - get-settings [-p ]... [-o ] - list-trusted-apps [-p ]... [-o ] resources buildings-delete [-p ]... buildings-get [-p ]... [-o ] diff --git a/gen/admin1_directory-cli/mkdocs.yml b/gen/admin1_directory-cli/mkdocs.yml index 3b555ee38c..e2b6bea6b9 100644 --- a/gen/admin1_directory-cli/mkdocs.yml +++ b/gen/admin1_directory-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: directory v1.0.12+20190214 +site_name: directory v1.0.13+20200204 site_url: http://byron.github.io/google-apis-rs/google-admin1_directory-cli site_description: A complete library to interact with directory (protocol directory_v1) @@ -62,8 +62,6 @@ pages: - ['orgunits_patch.md', 'Orgunits', 'Patch'] - ['orgunits_update.md', 'Orgunits', 'Update'] - ['privileges_list.md', 'Privileges', 'List'] -- ['resolved-app-access-settings_get-settings.md', 'Resolved App Access Settings', 'Get Settings'] -- ['resolved-app-access-settings_list-trusted-apps.md', 'Resolved App Access Settings', 'List Trusted Apps'] - ['resources_buildings-delete.md', 'Resources', 'Buildings Delete'] - ['resources_buildings-get.md', 'Resources', 'Buildings Get'] - ['resources_buildings-insert.md', 'Resources', 'Buildings Insert'] diff --git a/gen/admin1_directory-cli/src/main.rs b/gen/admin1_directory-cli/src/main.rs index c18fe11515..3df7dc22c2 100644 --- a/gen/admin1_directory-cli/src/main.rs +++ b/gen/admin1_directory-cli/src/main.rs @@ -597,6 +597,8 @@ impl<'n> Engine<'n> { "annotated-asset-id" => Some(("annotatedAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "firmware-version" => Some(("firmwareVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "system-ram-total" => Some(("systemRamTotal", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-update-expiration" => Some(("autoUpdateExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ethernet-mac-address0" => Some(("ethernetMacAddress0", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "boot-mode" => Some(("bootMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "org-unit-path" => Some(("orgUnitPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -608,10 +610,12 @@ impl<'n> Engine<'n> { "device-id" => Some(("deviceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "platform-version" => Some(("platformVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "os-version" => Some(("osVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dock-mac-address" => Some(("dockMacAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-enrollment-time" => Some(("lastEnrollmentTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serial-number" => Some(("serialNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manufacture-date" => Some(("manufactureDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "support-end-date" => Some(("supportEndDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tpm-version-info.spec-level" => Some(("tpmVersionInfo.specLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tpm-version-info.tpm-model" => Some(("tpmVersionInfo.tpmModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -621,7 +625,7 @@ impl<'n> Engine<'n> { "tpm-version-info.manufacturer" => Some(("tpmVersionInfo.manufacturer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "model" => Some(("model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["annotated-asset-id", "annotated-location", "annotated-user", "boot-mode", "device-id", "etag", "ethernet-mac-address", "family", "firmware-version", "kind", "last-enrollment-time", "last-sync", "mac-address", "manufacturer", "meid", "model", "notes", "order-number", "org-unit-path", "os-version", "platform-version", "serial-number", "spec-level", "status", "support-end-date", "system-ram-total", "tpm-model", "tpm-version-info", "vendor-specific", "will-auto-renew"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotated-asset-id", "annotated-location", "annotated-user", "auto-update-expiration", "boot-mode", "device-id", "dock-mac-address", "etag", "ethernet-mac-address", "ethernet-mac-address0", "family", "firmware-version", "kind", "last-enrollment-time", "last-sync", "mac-address", "manufacture-date", "manufacturer", "meid", "model", "notes", "order-number", "org-unit-path", "os-version", "platform-version", "serial-number", "spec-level", "status", "support-end-date", "system-ram-total", "tpm-model", "tpm-version-info", "vendor-specific", "will-auto-renew"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -715,6 +719,8 @@ impl<'n> Engine<'n> { "annotated-asset-id" => Some(("annotatedAssetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "firmware-version" => Some(("firmwareVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "system-ram-total" => Some(("systemRamTotal", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-update-expiration" => Some(("autoUpdateExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ethernet-mac-address0" => Some(("ethernetMacAddress0", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "boot-mode" => Some(("bootMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "org-unit-path" => Some(("orgUnitPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -726,10 +732,12 @@ impl<'n> Engine<'n> { "device-id" => Some(("deviceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "platform-version" => Some(("platformVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "os-version" => Some(("osVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dock-mac-address" => Some(("dockMacAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-enrollment-time" => Some(("lastEnrollmentTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serial-number" => Some(("serialNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manufacture-date" => Some(("manufactureDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "support-end-date" => Some(("supportEndDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tpm-version-info.spec-level" => Some(("tpmVersionInfo.specLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tpm-version-info.tpm-model" => Some(("tpmVersionInfo.tpmModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -739,7 +747,7 @@ impl<'n> Engine<'n> { "tpm-version-info.manufacturer" => Some(("tpmVersionInfo.manufacturer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "model" => Some(("model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["annotated-asset-id", "annotated-location", "annotated-user", "boot-mode", "device-id", "etag", "ethernet-mac-address", "family", "firmware-version", "kind", "last-enrollment-time", "last-sync", "mac-address", "manufacturer", "meid", "model", "notes", "order-number", "org-unit-path", "os-version", "platform-version", "serial-number", "spec-level", "status", "support-end-date", "system-ram-total", "tpm-model", "tpm-version-info", "vendor-specific", "will-auto-renew"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotated-asset-id", "annotated-location", "annotated-user", "auto-update-expiration", "boot-mode", "device-id", "dock-mac-address", "etag", "ethernet-mac-address", "ethernet-mac-address0", "family", "firmware-version", "kind", "last-enrollment-time", "last-sync", "mac-address", "manufacture-date", "manufacturer", "meid", "model", "notes", "order-number", "org-unit-path", "os-version", "platform-version", "serial-number", "spec-level", "status", "support-end-date", "system-ram-total", "tpm-model", "tpm-version-info", "vendor-specific", "will-auto-renew"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3742,104 +3750,6 @@ impl<'n> Engine<'n> { } } - fn _resolved_app_access_settings_get_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.resolved_app_access_settings().get_settings(); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _resolved_app_access_settings_list_trusted_apps(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.resolved_app_access_settings().list_trusted_apps(); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _resources_buildings_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.resources().buildings_delete(opt.value_of("customer").unwrap_or(""), opt.value_of("building-id").unwrap_or("")); @@ -6938,11 +6848,13 @@ impl<'n> Engine<'n> { "name.full-name" => Some(("name.fullName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name.given-name" => Some(("name.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name.family-name" => Some(("name.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recovery-phone" => Some(("recoveryPhone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "recovery-email" => Some(("recoveryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "archived", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "archived", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "recovery-email", "recovery-phone", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -7218,11 +7130,13 @@ impl<'n> Engine<'n> { "name.full-name" => Some(("name.fullName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name.given-name" => Some(("name.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name.family-name" => Some(("name.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recovery-phone" => Some(("recoveryPhone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "recovery-email" => Some(("recoveryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "archived", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "archived", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "recovery-email", "recovery-phone", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -7689,11 +7603,13 @@ impl<'n> Engine<'n> { "name.full-name" => Some(("name.fullName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name.given-name" => Some(("name.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name.family-name" => Some(("name.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recovery-phone" => Some(("recoveryPhone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "recovery-email" => Some(("recoveryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "archived", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "archived", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "recovery-email", "recovery-phone", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -8284,20 +8200,6 @@ impl<'n> Engine<'n> { } } }, - ("resolved-app-access-settings", Some(opt)) => { - match opt.subcommand() { - ("get-settings", Some(opt)) => { - call_result = self._resolved_app_access_settings_get_settings(opt, dry_run, &mut err); - }, - ("list-trusted-apps", Some(opt)) => { - call_result = self._resolved_app_access_settings_list_trusted_apps(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("resolved-app-access-settings".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("resources", Some(opt)) => { match opt.subcommand() { ("buildings-delete", Some(opt)) => { @@ -10016,41 +9918,6 @@ fn main() { ]), ]), - ("resolved-app-access-settings", "methods: 'get-settings' and 'list-trusted-apps'", vec![ - ("get-settings", - Some(r##"Retrieves resolved app access settings of the logged in user."##), - "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/resolved-app-access-settings_get-settings", - vec![ - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("list-trusted-apps", - Some(r##"Retrieves the list of apps trusted by the admin of the logged in user."##), - "Details at http://byron.github.io/google-apis-rs/google_admin1_directory_cli/resolved-app-access-settings_list-trusted-apps", - vec![ - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ]), - ("resources", "methods: 'buildings-delete', 'buildings-get', 'buildings-insert', 'buildings-list', 'buildings-patch', 'buildings-update', 'calendars-delete', 'calendars-get', 'calendars-insert', 'calendars-list', 'calendars-patch', 'calendars-update', 'features-delete', 'features-get', 'features-insert', 'features-list', 'features-patch', 'features-rename' and 'features-update'", vec![ ("buildings-delete", Some(r##"Deletes a building."##), @@ -11566,7 +11433,7 @@ fn main() { let mut app = App::new("admin1-directory") .author("Sebastian Thiel ") - .version("1.0.12+20190214") + .version("1.0.13+20200204") .about("Manages enterprise resources such as users and groups, administrative notifications, security features, and more.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_admin1_directory_cli") .arg(Arg::with_name("url") diff --git a/gen/admin1_directory/Cargo.toml b/gen/admin1_directory/Cargo.toml index 6813a626e9..8680167696 100644 --- a/gen/admin1_directory/Cargo.toml +++ b/gen/admin1_directory/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-admin1_directory" -version = "1.0.12+20190214" +version = "1.0.13+20200204" authors = ["Sebastian Thiel "] description = "A complete library to interact with directory (protocol directory_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_directory" homepage = "https://developers.google.com/admin-sdk/directory/" -documentation = "https://docs.rs/google-admin1_directory/1.0.12+20190214" +documentation = "https://docs.rs/google-admin1_directory/1.0.13+20200204" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/admin1_directory/README.md b/gen/admin1_directory/README.md index 8ef03667ec..f81acf5783 100644 --- a/gen/admin1_directory/README.md +++ b/gen/admin1_directory/README.md @@ -5,63 +5,61 @@ DO NOT EDIT ! --> The `google-admin1_directory` library allows access to all features of the *Google directory* service. -This documentation was generated from *directory* crate version *1.0.12+20190214*, where *20190214* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *directory* crate version *1.0.13+20200204*, where *20200204* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *directory* *v1_directory* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/directory/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Directory.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Directory.html) ... -* [asps](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Asp.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.AspDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.AspGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.AspListCall.html) -* [channels](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Channel.html) - * [*stop*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ChannelStopCall.html) +* [asps](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Asp.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.AspDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.AspGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.AspListCall.html) +* [channels](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ChannelStopCall.html) * chromeosdevices - * [*action*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ChromeosdeviceActionCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ChromeosdeviceGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ChromeosdeviceListCall.html), [*move devices to ou*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ChromeosdeviceMoveDevicesToOuCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ChromeosdevicePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ChromeosdeviceUpdateCall.html) -* [customers](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Customer.html) - * [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.CustomerGetCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.CustomerUpdateCall.html) + * [*action*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ChromeosdeviceActionCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ChromeosdeviceGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ChromeosdeviceListCall.html), [*move devices to ou*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ChromeosdeviceMoveDevicesToOuCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ChromeosdevicePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ChromeosdeviceUpdateCall.html) +* [customers](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Customer.html) + * [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.CustomerGetCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.CustomerUpdateCall.html) * domain aliases - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainAliaseDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainAliaseGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainAliaseInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainAliaseListCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainAliaseDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainAliaseGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainAliaseInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainAliaseListCall.html) * domains - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.DomainListCall.html) -* [groups](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Group.html) - * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupAliaseListCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupUpdateCall.html) -* [members](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Member.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MemberDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MemberGetCall.html), [*has member*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MemberHasMemberCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MemberInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MemberListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MemberPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MemberUpdateCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.DomainListCall.html) +* [groups](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Group.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupAliaseListCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupUpdateCall.html) +* [members](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Member.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MemberDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MemberGetCall.html), [*has member*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MemberHasMemberCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MemberInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MemberListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MemberPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MemberUpdateCall.html) * mobiledevices - * [*action*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MobiledeviceActionCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MobiledeviceDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MobiledeviceGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.MobiledeviceListCall.html) -* [notifications](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Notification.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.NotificationGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.NotificationListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.NotificationPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.NotificationUpdateCall.html) + * [*action*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MobiledeviceActionCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MobiledeviceDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MobiledeviceGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.MobiledeviceListCall.html) +* [notifications](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Notification.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.NotificationGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.NotificationListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.NotificationPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.NotificationUpdateCall.html) * orgunits - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.OrgunitDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.OrgunitGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.OrgunitInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.OrgunitListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.OrgunitPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.OrgunitUpdateCall.html) -* [privileges](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Privilege.html) - * [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.PrivilegeListCall.html) -* resolved app access settings - * [*get settings*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResolvedAppAccessSettingGetSettingCall.html) and [*list trusted apps*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResolvedAppAccessSettingListTrustedAppCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.OrgunitDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.OrgunitGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.OrgunitInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.OrgunitListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.OrgunitPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.OrgunitUpdateCall.html) +* [privileges](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Privilege.html) + * [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.PrivilegeListCall.html) * resources - * [*buildings delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceBuildingDeleteCall.html), [*buildings get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceBuildingGetCall.html), [*buildings insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceBuildingInsertCall.html), [*buildings list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceBuildingListCall.html), [*buildings patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceBuildingPatchCall.html), [*buildings update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceBuildingUpdateCall.html), [*calendars delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceCalendarDeleteCall.html), [*calendars get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceCalendarGetCall.html), [*calendars insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceCalendarInsertCall.html), [*calendars list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceCalendarListCall.html), [*calendars patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceCalendarPatchCall.html), [*calendars update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceCalendarUpdateCall.html), [*features delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceFeatureDeleteCall.html), [*features get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceFeatureGetCall.html), [*features insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceFeatureInsertCall.html), [*features list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceFeatureListCall.html), [*features patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceFeaturePatchCall.html), [*features rename*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceFeatureRenameCall.html) and [*features update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.ResourceFeatureUpdateCall.html) -* [role assignments](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleAssignment.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleAssignmentDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleAssignmentGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleAssignmentInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleAssignmentListCall.html) -* [roles](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Role.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RolePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.RoleUpdateCall.html) -* [schemas](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Schema.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.SchemaDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.SchemaGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.SchemaInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.SchemaListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.SchemaPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.SchemaUpdateCall.html) -* [tokens](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Token.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.TokenDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.TokenGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.TokenListCall.html) -* [users](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.User.html) - * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserAliaseListCall.html), [*aliases watch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserAliaseWatchCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserListCall.html), [*make admin*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserMakeAdminCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserPatchCall.html), [*photos delete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserPhotoDeleteCall.html), [*photos get*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserPhotoGetCall.html), [*photos patch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserPhotoPatchCall.html), [*photos update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserPhotoUpdateCall.html), [*undelete*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserUndeleteCall.html), [*update*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserUpdateCall.html) and [*watch*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserWatchCall.html) -* [verification codes](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.VerificationCode.html) - * [*generate*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.VerificationCodeGenerateCall.html), [*invalidate*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.VerificationCodeInvalidateCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.VerificationCodeListCall.html) + * [*buildings delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceBuildingDeleteCall.html), [*buildings get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceBuildingGetCall.html), [*buildings insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceBuildingInsertCall.html), [*buildings list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceBuildingListCall.html), [*buildings patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceBuildingPatchCall.html), [*buildings update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceBuildingUpdateCall.html), [*calendars delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceCalendarDeleteCall.html), [*calendars get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceCalendarGetCall.html), [*calendars insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceCalendarInsertCall.html), [*calendars list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceCalendarListCall.html), [*calendars patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceCalendarPatchCall.html), [*calendars update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceCalendarUpdateCall.html), [*features delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceFeatureDeleteCall.html), [*features get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceFeatureGetCall.html), [*features insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceFeatureInsertCall.html), [*features list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceFeatureListCall.html), [*features patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceFeaturePatchCall.html), [*features rename*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceFeatureRenameCall.html) and [*features update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.ResourceFeatureUpdateCall.html) +* [role assignments](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleAssignment.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleAssignmentDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleAssignmentGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleAssignmentInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleAssignmentListCall.html) +* [roles](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Role.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RolePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.RoleUpdateCall.html) +* [schemas](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Schema.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.SchemaDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.SchemaGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.SchemaInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.SchemaListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.SchemaPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.SchemaUpdateCall.html) +* [tokens](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Token.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.TokenDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.TokenGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.TokenListCall.html) +* [users](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.User.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserAliaseListCall.html), [*aliases watch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserAliaseWatchCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserListCall.html), [*make admin*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserMakeAdminCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserPatchCall.html), [*photos delete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserPhotoDeleteCall.html), [*photos get*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserPhotoGetCall.html), [*photos patch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserPhotoPatchCall.html), [*photos update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserPhotoUpdateCall.html), [*undelete*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserUndeleteCall.html), [*update*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserUpdateCall.html) and [*watch*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserWatchCall.html) +* [verification codes](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.VerificationCode.html) + * [*generate*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.VerificationCodeGenerateCall.html), [*invalidate*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.VerificationCodeInvalidateCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.VerificationCodeListCall.html) Subscription supported by ... -* [*list users*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserListCall.html) -* [*aliases watch users*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserAliaseWatchCall.html) -* [*watch users*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserWatchCall.html) -* [*aliases list users*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.UserAliaseListCall.html) -* [*aliases list groups*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.GroupAliaseListCall.html) +* [*list users*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserListCall.html) +* [*watch users*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserWatchCall.html) +* [*aliases watch users*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserAliaseWatchCall.html) +* [*aliases list users*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.UserAliaseListCall.html) +* [*aliases list groups*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.GroupAliaseListCall.html) @@ -69,17 +67,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/struct.Directory.html)** +* **[Hub](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/struct.Directory.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -204,17 +202,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -224,29 +222,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.RequestValue.html) and -[decodable](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-admin1_directory/1.0.12+20190214/google_admin1_directory/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_directory/1.0.13+20200204/google_admin1_directory/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/admin1_directory/src/lib.rs b/gen/admin1_directory/src/lib.rs index d07555c0cf..d5b8749d0a 100644 --- a/gen/admin1_directory/src/lib.rs +++ b/gen/admin1_directory/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *directory* crate version *1.0.12+20190214*, where *20190214* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *directory* crate version *1.0.13+20200204*, where *20200204* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *directory* *v1_directory* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/directory/). @@ -35,8 +35,6 @@ //! * [*delete*](struct.OrgunitDeleteCall.html), [*get*](struct.OrgunitGetCall.html), [*insert*](struct.OrgunitInsertCall.html), [*list*](struct.OrgunitListCall.html), [*patch*](struct.OrgunitPatchCall.html) and [*update*](struct.OrgunitUpdateCall.html) //! * [privileges](struct.Privilege.html) //! * [*list*](struct.PrivilegeListCall.html) -//! * resolved app access settings -//! * [*get settings*](struct.ResolvedAppAccessSettingGetSettingCall.html) and [*list trusted apps*](struct.ResolvedAppAccessSettingListTrustedAppCall.html) //! * resources //! * [*buildings delete*](struct.ResourceBuildingDeleteCall.html), [*buildings get*](struct.ResourceBuildingGetCall.html), [*buildings insert*](struct.ResourceBuildingInsertCall.html), [*buildings list*](struct.ResourceBuildingListCall.html), [*buildings patch*](struct.ResourceBuildingPatchCall.html), [*buildings update*](struct.ResourceBuildingUpdateCall.html), [*calendars delete*](struct.ResourceCalendarDeleteCall.html), [*calendars get*](struct.ResourceCalendarGetCall.html), [*calendars insert*](struct.ResourceCalendarInsertCall.html), [*calendars list*](struct.ResourceCalendarListCall.html), [*calendars patch*](struct.ResourceCalendarPatchCall.html), [*calendars update*](struct.ResourceCalendarUpdateCall.html), [*features delete*](struct.ResourceFeatureDeleteCall.html), [*features get*](struct.ResourceFeatureGetCall.html), [*features insert*](struct.ResourceFeatureInsertCall.html), [*features list*](struct.ResourceFeatureListCall.html), [*features patch*](struct.ResourceFeaturePatchCall.html), [*features rename*](struct.ResourceFeatureRenameCall.html) and [*features update*](struct.ResourceFeatureUpdateCall.html) //! * [role assignments](struct.RoleAssignment.html) @@ -56,8 +54,8 @@ //! Subscription supported by ... //! //! * [*list users*](struct.UserListCall.html) -//! * [*aliases watch users*](struct.UserAliaseWatchCall.html) //! * [*watch users*](struct.UserWatchCall.html) +//! * [*aliases watch users*](struct.UserAliaseWatchCall.html) //! * [*aliases list users*](struct.UserAliaseListCall.html) //! * [*aliases list groups*](struct.GroupAliaseListCall.html) //! @@ -312,8 +310,8 @@ pub enum Scope { /// Manage data access permissions for users on your domain DirectoryUserSecurity, - /// Manage delegated admin roles for your domain - DirectoryRolemanagement, + /// View and manage your data across Google Cloud Platform services + CloudPlatform, /// View groups on your domain DirectoryGroupReadonly, @@ -378,6 +376,9 @@ pub enum Scope { /// View user schemas on your domain DirectoryUserschemaReadonly, + /// Manage delegated admin roles for your domain + DirectoryRolemanagement, + /// View and manage organization units on your domain DirectoryOrgunit, @@ -391,7 +392,7 @@ impl AsRef for Scope { Scope::DirectoryUser => "https://www.googleapis.com/auth/admin.directory.user", Scope::DirectoryResourceCalendarReadonly => "https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly", Scope::DirectoryUserSecurity => "https://www.googleapis.com/auth/admin.directory.user.security", - Scope::DirectoryRolemanagement => "https://www.googleapis.com/auth/admin.directory.rolemanagement", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::DirectoryGroupReadonly => "https://www.googleapis.com/auth/admin.directory.group.readonly", Scope::DirectoryCustomer => "https://www.googleapis.com/auth/admin.directory.customer", Scope::DirectoryDomain => "https://www.googleapis.com/auth/admin.directory.domain", @@ -413,6 +414,7 @@ impl AsRef for Scope { Scope::DirectoryUserAliaReadonly => "https://www.googleapis.com/auth/admin.directory.user.alias.readonly", Scope::DirectoryGroup => "https://www.googleapis.com/auth/admin.directory.group", Scope::DirectoryUserschemaReadonly => "https://www.googleapis.com/auth/admin.directory.userschema.readonly", + Scope::DirectoryRolemanagement => "https://www.googleapis.com/auth/admin.directory.rolemanagement", Scope::DirectoryOrgunit => "https://www.googleapis.com/auth/admin.directory.orgunit", Scope::DirectoryRolemanagementReadonly => "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly", } @@ -519,7 +521,7 @@ impl<'a, C, A> Directory Directory { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/admin/directory/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -561,9 +563,6 @@ impl<'a, C, A> Directory pub fn privileges(&'a self) -> PrivilegeMethods<'a, C, A> { PrivilegeMethods { hub: &self } } - pub fn resolved_app_access_settings(&'a self) -> ResolvedAppAccessSettingMethods<'a, C, A> { - ResolvedAppAccessSettingMethods { hub: &self } - } pub fn resources(&'a self) -> ResourceMethods<'a, C, A> { ResourceMethods { hub: &self } } @@ -587,7 +586,7 @@ impl<'a, C, A> Directory } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -780,7 +779,7 @@ pub struct Member { /// Type of member (Immutable) #[serde(rename="type")] pub type_: Option, - /// Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) + /// The unique ID of the group member. A member id can be used as a member request URI's memberKey. Unique identifier of group (Read-only) Unique identifier of member (Read-only) pub id: Option, } @@ -789,6 +788,28 @@ impl Resource for Member {} impl ResponseResult for Member {} +/// JSON response template for List Schema operation in Directory API. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list schemas](struct.SchemaListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Schemas { + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// List of UserSchema objects. + pub schemas: Option>, +} + +impl ResponseResult for Schemas {} + + /// JSON template for role resource in Directory API. /// /// # Activities @@ -847,7 +868,7 @@ impl ResponseResult for Role {} pub struct Privilege { /// The type of the API resource. This is always admin#directory#privilege. pub kind: Option, - /// The obfuscated ID of the service this privilege is for. + /// The obfuscated ID of the service this privilege is for. This value is returned with Privileges.list(). #[serde(rename="serviceId")] pub service_id: Option, /// The name of the privilege. @@ -1134,6 +1155,9 @@ pub struct User { /// User's last login time. (Read-only) #[serde(rename="lastLoginTime")] pub last_login_time: Option, + /// CustomerId of User (Read-only) + #[serde(rename="customerId")] + pub customer_id: Option, /// OrgUnit of User #[serde(rename="orgUnitPath")] pub org_unit_path: Option, @@ -1186,9 +1210,12 @@ pub struct User { pub change_password_at_next_login: Option, /// no description provided pub ims: Option, - /// CustomerId of User (Read-only) - #[serde(rename="customerId")] - pub customer_id: Option, + /// Recovery email of the user. + #[serde(rename="recoveryEmail")] + pub recovery_email: Option, + /// Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: +16506661212. + #[serde(rename="recoveryPhone")] + pub recovery_phone: Option, } impl RequestValue for User {} @@ -1234,90 +1261,102 @@ impl ResponseResult for Groups {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChromeOsDevice { - /// List of recent device users, in descending order by last login time (Read-only) - #[serde(rename="recentUsers")] - pub recent_users: Option>, /// Chromebook Mac Address on wifi network interface (Read-only) #[serde(rename="macAddress")] pub mac_address: Option, - /// Chromebook serial number (Read-only) - #[serde(rename="serialNumber")] - pub serial_number: Option, /// Date and time the device was last synchronized with the policy settings in the G Suite administrator control panel (Read-only) #[serde(rename="lastSync")] pub last_sync: Option, /// Chromebook order number (Read-only) #[serde(rename="orderNumber")] pub order_number: Option, - /// Mobile Equipment identifier for the 3G mobile card in the Chromebook (Read-only) - pub meid: Option, /// Address or location of the device as noted by the administrator #[serde(rename="annotatedLocation")] pub annotated_location: Option, - /// User of the device - #[serde(rename="annotatedUser")] - pub annotated_user: Option, - /// Chromebook platform version (Read-only) - #[serde(rename="platformVersion")] - pub platform_version: Option, + /// Reports of disk space and other info about mounted/connected volumes. + #[serde(rename="diskVolumeReports")] + pub disk_volume_reports: Option>, /// List of active time ranges (Read-only) #[serde(rename="activeTimeRanges")] pub active_time_ranges: Option>, /// Reports of amounts of available RAM memory (Read-only) #[serde(rename="systemRamFreeReports")] pub system_ram_free_reports: Option>, - /// Reports of CPU utilization and temperature (Read-only) - #[serde(rename="cpuStatusReports")] - pub cpu_status_reports: Option>, - /// Chromebook Mac Address on ethernet network interface (Read-only) - #[serde(rename="ethernetMacAddress")] - pub ethernet_mac_address: Option, - /// Total RAM on the device [in bytes] (Read-only) - #[serde(rename="systemRamTotal")] - pub system_ram_total: Option, - /// Reports of disk space and other info about mounted/connected volumes. - #[serde(rename="diskVolumeReports")] - pub disk_volume_reports: Option>, - /// Chromebook Os Version (Read-only) - #[serde(rename="osVersion")] - pub os_version: Option, - /// Chromebook firmware version (Read-only) - #[serde(rename="firmwareVersion")] - pub firmware_version: Option, - /// Date and time the device was last enrolled (Read-only) - #[serde(rename="lastEnrollmentTime")] - pub last_enrollment_time: Option, - /// Kind of resource this is. - pub kind: Option, /// AssetId specified during enrollment or through later annotation #[serde(rename="annotatedAssetId")] pub annotated_asset_id: Option, - /// List of device files to download (Read-only) - #[serde(rename="deviceFiles")] - pub device_files: Option>, - /// Notes added by the administrator - pub notes: Option, - /// Will Chromebook auto renew after support end date (Read-only) - #[serde(rename="willAutoRenew")] - pub will_auto_renew: Option, + /// Chromebook firmware version (Read-only) + #[serde(rename="firmwareVersion")] + pub firmware_version: Option, + /// Total RAM on the device [in bytes] (Read-only) + #[serde(rename="systemRamTotal")] + pub system_ram_total: Option, + /// (Read-only) The timestamp after which the device will stop receiving Chrome updates or support + #[serde(rename="autoUpdateExpiration")] + pub auto_update_expiration: Option, + /// (Read-only) MAC address used by the Chromebook’s internal ethernet port, and for onboard network (ethernet) interface. The format is twelve (12) hexadecimal digits without any delimiter (uppercase letters). This is only relevant for some devices. + #[serde(rename="ethernetMacAddress0")] + pub ethernet_mac_address0: Option, /// Chromebook boot mode (Read-only) #[serde(rename="bootMode")] pub boot_mode: Option, /// ETag of the resource. pub etag: Option, - /// status of the device (Read-only) - pub status: Option, /// OrgUnit of the device #[serde(rename="orgUnitPath")] pub org_unit_path: Option, + /// List of recent device users, in descending order by last login time (Read-only) + #[serde(rename="recentUsers")] + pub recent_users: Option>, + /// Date and time the device was last enrolled (Read-only) + #[serde(rename="lastEnrollmentTime")] + pub last_enrollment_time: Option, + /// Chromebook Mac Address on ethernet network interface (Read-only) + #[serde(rename="ethernetMacAddress")] + pub ethernet_mac_address: Option, + /// Contains either the Mobile Equipment identifier (MEID) or the International Mobile Equipment Identity (IMEI) for the 3G mobile card in the Chromebook (Read-only) + pub meid: Option, + /// User of the device + #[serde(rename="annotatedUser")] + pub annotated_user: Option, + /// Reports of CPU utilization and temperature (Read-only) + #[serde(rename="cpuStatusReports")] + pub cpu_status_reports: Option>, + /// Chromebook platform version (Read-only) + #[serde(rename="platformVersion")] + pub platform_version: Option, + /// Chromebook Os Version (Read-only) + #[serde(rename="osVersion")] + pub os_version: Option, + /// (Read-only) Built-in MAC address for the docking station that the device connected to. Factory sets Media access control address (MAC address) assigned for use by a dock. Currently this is only supported on the Dell Arcada / Sarien devices and the Dell WD19 / WD19TB Docking Station. It is reserved specifically for MAC pass through device policy. The format is twelve (12) hexadecimal digits without any delimiter (uppercase letters). This is only relevant for Dell devices. + #[serde(rename="dockMacAddress")] + pub dock_mac_address: Option, + /// Will Chromebook auto renew after support end date (Read-only) + #[serde(rename="willAutoRenew")] + pub will_auto_renew: Option, + /// Kind of resource this is. + pub kind: Option, + /// List of device files to download (Read-only) + #[serde(rename="deviceFiles")] + pub device_files: Option>, + /// Notes added by the administrator + pub notes: Option, + /// Chromebook serial number (Read-only) + #[serde(rename="serialNumber")] + pub serial_number: Option, + /// (Read-only) The date the device was manufactured in yyyy-mm-dd format. + #[serde(rename="manufactureDate")] + pub manufacture_date: Option, + /// status of the device (Read-only) + pub status: Option, + /// Final date the device will be supported (Read-only) + #[serde(rename="supportEndDate")] + pub support_end_date: Option, /// Trusted Platform Module (TPM) (Read-only) #[serde(rename="tpmVersionInfo")] pub tpm_version_info: Option, /// Chromebook Model (Read-only) pub model: Option, - /// Final date the device will be supported (Read-only) - #[serde(rename="supportEndDate")] - pub support_end_date: Option, /// Unique identifier of Chrome OS Device (Read-only) #[serde(rename="deviceId")] pub device_id: Option, @@ -1328,28 +1367,32 @@ impl Resource for ChromeOsDevice {} impl ResponseResult for ChromeOsDevice {} -/// JSON template for Trusted App Ids Resource object in Directory API. +/// Trusted Platform Module (TPM) (Read-only) /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TrustedAppId { - /// Android package name. - #[serde(rename="androidPackageName")] - pub android_package_name: Option, - /// Identifies the resource as a trusted AppId. - pub kind: Option, - /// no description provided - pub etag: Option, - /// SHA1 signature of the app certificate. - #[serde(rename="certificateHashSHA1")] - pub certificate_hash_sha1: Option, - /// SHA256 signature of the app certificate. - #[serde(rename="certificateHashSHA256")] - pub certificate_hash_sha256: Option, +pub struct ChromeOsDeviceTpmVersionInfo { + /// TPM specification level. + #[serde(rename="specLevel")] + pub spec_level: Option, + /// TPM model number. + #[serde(rename="tpmModel")] + pub tpm_model: Option, + /// Vendor-specific information such as Vendor ID. + #[serde(rename="vendorSpecific")] + pub vendor_specific: Option, + /// TPM family. + pub family: Option, + /// TPM firmware version. + #[serde(rename="firmwareVersion")] + pub firmware_version: Option, + /// TPM manufacturer code. + pub manufacturer: Option, } -impl Part for TrustedAppId {} +impl NestedType for ChromeOsDeviceTpmVersionInfo {} +impl Part for ChromeOsDeviceTpmVersionInfo {} /// Disk volumes @@ -1533,29 +1576,29 @@ pub struct VerificationCodes { impl ResponseResult for VerificationCodes {} -/// JSON response template for List Mobile Devices operation in Directory API. +/// JSON response template for List Chrome OS Devices operation in Directory API. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list mobiledevices](struct.MobiledeviceListCall.html) (response) +/// * [list chromeosdevices](struct.ChromeosdeviceListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MobileDevices { +pub struct ChromeOsDevices { /// Token used to access next page of this result. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Kind of resource this is. - pub kind: Option, + /// List of Chrome OS Device objects. + pub chromeosdevices: Option>, /// ETag of the resource. pub etag: Option, - /// List of Mobile Device objects. - pub mobiledevices: Option>, + /// Kind of resource this is. + pub kind: Option, } -impl ResponseResult for MobileDevices {} +impl ResponseResult for ChromeOsDevices {} /// List of active time ranges (Read-only) @@ -1712,136 +1755,6 @@ pub struct BuildingAddress { impl Part for BuildingAddress {} -/// JSON template for token resource in Directory API. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list tokens](struct.TokenListCall.html) (none) -/// * [delete tokens](struct.TokenDeleteCall.html) (none) -/// * [get tokens](struct.TokenGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Token { - /// A list of authorization scopes the application is granted. - pub scopes: Option>, - /// The type of the API resource. This is always admin#directory#token. - pub kind: Option, - /// The Client ID of the application the token is issued to. - #[serde(rename="clientId")] - pub client_id: Option, - /// Whether the token is issued to an installed application. The value is true if the application is installed to a desktop or mobile device. - #[serde(rename="nativeApp")] - pub native_app: Option, - /// The displayable name of the application the token is issued to. - #[serde(rename="displayText")] - pub display_text: Option, - /// ETag of the resource. - pub etag: Option, - /// Whether the application is registered with Google. The value is true if the application has an anonymous Client ID. - pub anonymous: Option, - /// The unique ID of the user that issued the token. - #[serde(rename="userKey")] - pub user_key: Option, -} - -impl Resource for Token {} -impl ResponseResult for Token {} - - -/// JSON response template to list Domains in Directory API. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list domains](struct.DomainListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Domains2 { - /// List of domain objects. - pub domains: Option>, - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, -} - -impl ResponseResult for Domains2 {} - - -/// JSON template for Trusted Apps response object of a user in Directory API. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list trusted apps resolved app access settings](struct.ResolvedAppAccessSettingListTrustedAppCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TrustedApps { - /// no description provided - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Identifies the resource as trusted apps response. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// Trusted Apps list. - #[serde(rename="trustedApps")] - pub trusted_apps: Option>, -} - -impl ResponseResult for TrustedApps {} - - -/// JSON template for coordinates of a building in Directory API. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BuildingCoordinates { - /// Latitude in decimal degrees. - pub latitude: Option, - /// Longitude in decimal degrees. - pub longitude: Option, -} - -impl Part for BuildingCoordinates {} - - -/// Trusted Platform Module (TPM) (Read-only) -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChromeOsDeviceTpmVersionInfo { - /// TPM specification level. - #[serde(rename="specLevel")] - pub spec_level: Option, - /// TPM model number. - #[serde(rename="tpmModel")] - pub tpm_model: Option, - /// Vendor-specific information such as Vendor ID. - #[serde(rename="vendorSpecific")] - pub vendor_specific: Option, - /// TPM family. - pub family: Option, - /// TPM firmware version. - #[serde(rename="firmwareVersion")] - pub firmware_version: Option, - /// TPM manufacturer code. - pub manufacturer: Option, -} - -impl NestedType for ChromeOsDeviceTpmVersionInfo {} -impl Part for ChromeOsDeviceTpmVersionInfo {} - - /// JSON template for Mobile Device resource in Directory API. /// /// # Activities @@ -1965,6 +1878,43 @@ impl Resource for MobileDevice {} impl ResponseResult for MobileDevice {} +/// JSON response template to list Domains in Directory API. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list domains](struct.DomainListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Domains2 { + /// List of domain objects. + pub domains: Option>, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, +} + +impl ResponseResult for Domains2 {} + + +/// JSON template for coordinates of a building in Directory API. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BuildingCoordinates { + /// Latitude in decimal degrees. + pub latitude: Option, + /// Longitude in decimal degrees. + pub longitude: Option, +} + +impl Part for BuildingCoordinates {} + + /// List of device files to download (Read-only) /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1988,66 +1938,6 @@ impl NestedType for ChromeOsDeviceDeviceFiles {} impl Part for ChromeOsDeviceDeviceFiles {} -/// JSON response template for List Schema operation in Directory API. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list schemas](struct.SchemaListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Schemas { - /// Kind of resource this is. - pub kind: Option, - /// ETag of the resource. - pub etag: Option, - /// List of UserSchema objects. - pub schemas: Option>, -} - -impl ResponseResult for Schemas {} - - -/// JSON template for App Access Collections Resource object in Directory API. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get settings resolved app access settings](struct.ResolvedAppAccessSettingGetSettingCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppAccessCollections { - /// Identifies the resource as an app access collection. Value: admin#directory#appaccesscollection - pub kind: Option, - /// Boolean that indicates whether to trust domain owned apps. - #[serde(rename="trustDomainOwnedApps")] - pub trust_domain_owned_apps: Option, - /// Unique ID of app access collection. (Readonly) - #[serde(rename="resourceId")] - pub resource_id: Option, - /// Error message provided by the Admin that will be shown to the user when an app is blocked. - #[serde(rename="errorMessage")] - pub error_message: Option, - /// ETag of the resource. - pub etag: Option, - /// List of blocked api access buckets. - #[serde(rename="blockedApiAccessBuckets")] - pub blocked_api_access_buckets: Option>, - /// Resource name given by the customer while creating/updating. Should be unique under given customer. - #[serde(rename="resourceName")] - pub resource_name: Option, - /// Boolean to indicate whether to enforce app access settings on Android Drive or not. - #[serde(rename="enforceSettingsForAndroidDrive")] - pub enforce_settings_for_android_drive: Option, -} - -impl ResponseResult for AppAccessCollections {} - - /// JSON template for Has Member response in Directory API. /// /// # Activities @@ -2460,6 +2350,31 @@ impl NestedType for ChromeOsDeviceRecentUsers {} impl Part for ChromeOsDeviceRecentUsers {} +/// JSON response template for List Mobile Devices operation in Directory API. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list mobiledevices](struct.MobiledeviceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MobileDevices { + /// Token used to access next page of this result. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Kind of resource this is. + pub kind: Option, + /// ETag of the resource. + pub etag: Option, + /// List of Mobile Device objects. + pub mobiledevices: Option>, +} + +impl ResponseResult for MobileDevices {} + + /// JSON request template for renaming a feature. /// /// # Activities @@ -2595,7 +2510,7 @@ impl RequestValue for UserUndelete {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RoleRolePrivileges { - /// The obfuscated ID of the service this privilege is for. + /// The obfuscated ID of the service this privilege is for. This value is returned with Privileges.list(). #[serde(rename="serviceId")] pub service_id: Option, /// The name of the privilege. @@ -2685,29 +2600,43 @@ pub struct DomainAliases { impl ResponseResult for DomainAliases {} -/// JSON response template for List Chrome OS Devices operation in Directory API. +/// JSON template for token resource in Directory API. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list chromeosdevices](struct.ChromeosdeviceListCall.html) (response) +/// * [list tokens](struct.TokenListCall.html) (none) +/// * [delete tokens](struct.TokenDeleteCall.html) (none) +/// * [get tokens](struct.TokenGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChromeOsDevices { - /// Token used to access next page of this result. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of Chrome OS Device objects. - pub chromeosdevices: Option>, +pub struct Token { + /// A list of authorization scopes the application is granted. + pub scopes: Option>, + /// The type of the API resource. This is always admin#directory#token. + pub kind: Option, + /// The Client ID of the application the token is issued to. + #[serde(rename="clientId")] + pub client_id: Option, + /// Whether the token is issued to an installed application. The value is true if the application is installed to a desktop or mobile device. + #[serde(rename="nativeApp")] + pub native_app: Option, + /// The displayable name of the application the token is issued to. + #[serde(rename="displayText")] + pub display_text: Option, /// ETag of the resource. pub etag: Option, - /// Kind of resource this is. - pub kind: Option, + /// Whether the application is registered with Google. The value is true if the application has an anonymous Client ID. + pub anonymous: Option, + /// The unique ID of the user that issued the token. + #[serde(rename="userKey")] + pub user_key: Option, } -impl ResponseResult for ChromeOsDevices {} +impl Resource for Token {} +impl ResponseResult for Token {} /// JSON template for Org Unit resource in Directory API. @@ -3791,7 +3720,7 @@ impl<'a, C, A> PrivilegeMethods<'a, C, A> { -/// A builder providing access to all methods supported on *resolvedAppAccessSetting* resources. +/// A builder providing access to all methods supported on *channel* resources. /// It is not used directly, but through the `Directory` hub. /// /// # Example @@ -3815,39 +3744,34 @@ impl<'a, C, A> PrivilegeMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get_settings(...)` and `list_trusted_apps(...)` +/// // like `stop(...)` /// // to build up your call. -/// let rb = hub.resolved_app_access_settings(); +/// let rb = hub.channels(); /// # } /// ``` -pub struct ResolvedAppAccessSettingMethods<'a, C, A> +pub struct ChannelMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, } -impl<'a, C, A> MethodsBuilder for ResolvedAppAccessSettingMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for ChannelMethods<'a, C, A> {} -impl<'a, C, A> ResolvedAppAccessSettingMethods<'a, C, A> { +impl<'a, C, A> ChannelMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves resolved app access settings of the logged in user. - pub fn get_settings(&self) -> ResolvedAppAccessSettingGetSettingCall<'a, C, A> { - ResolvedAppAccessSettingGetSettingCall { - hub: self.hub, - _delegate: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: + /// Stop watching resources through this channel + /// + /// # Arguments /// - /// Retrieves the list of apps trusted by the admin of the logged in user. - pub fn list_trusted_apps(&self) -> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> { - ResolvedAppAccessSettingListTrustedAppCall { + /// * `request` - No description provided. + pub fn stop(&self, request: Channel) -> ChannelStopCall<'a, C, A> { + ChannelStopCall { hub: self.hub, + _request: request, _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -3980,65 +3904,6 @@ impl<'a, C, A> MobiledeviceMethods<'a, C, A> { -/// A builder providing access to all methods supported on *channel* resources. -/// It is not used directly, but through the `Directory` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_admin1_directory as admin1_directory; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use admin1_directory::Directory; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `stop(...)` -/// // to build up your call. -/// let rb = hub.channels(); -/// # } -/// ``` -pub struct ChannelMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, -} - -impl<'a, C, A> MethodsBuilder for ChannelMethods<'a, C, A> {} - -impl<'a, C, A> ChannelMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Stop watching resources through this channel - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn stop(&self, request: Channel) -> ChannelStopCall<'a, C, A> { - ChannelStopCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *token* resources. /// It is not used directly, but through the `Directory` hub. /// @@ -4880,24 +4745,6 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists the domain aliases of the customer. - /// - /// # Arguments - /// - /// * `customer` - Immutable ID of the G Suite account. - pub fn list(&self, customer: &str) -> DomainAliaseListCall<'a, C, A> { - DomainAliaseListCall { - hub: self.hub, - _customer: customer.to_string(), - _parent_domain_name: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves a domain alias of the customer. @@ -4917,6 +4764,24 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the domain aliases of the customer. + /// + /// # Arguments + /// + /// * `customer` - Immutable ID of the G Suite account. + pub fn list(&self, customer: &str) -> DomainAliaseListCall<'a, C, A> { + DomainAliaseListCall { + hub: self.hub, + _customer: customer.to_string(), + _parent_domain_name: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a Domain Alias of the customer. @@ -5634,6 +5499,26 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Watch for changes in user aliases list + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `userKey` - Email or immutable ID of the user + pub fn aliases_watch(&self, request: Channel, user_key: &str) -> UserAliaseWatchCall<'a, C, A> { + UserAliaseWatchCall { + hub: self.hub, + _request: request, + _user_key: user_key.to_string(), + _event: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Add a photo for the user @@ -5856,26 +5741,6 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Watch for changes in user aliases list - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `userKey` - Email or immutable ID of the user - pub fn aliases_watch(&self, request: Channel, user_key: &str) -> UserAliaseWatchCall<'a, C, A> { - UserAliaseWatchCall { - hub: self.hub, - _request: request, - _user_key: user_key.to_string(), - _event: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Delete user @@ -9413,7 +9278,7 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau } - /// Email or immutable Id of the user if only those groups are to be listed, the given user is a member of. If Id, it should match with id of user object + /// Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object. /// /// Sets the *user key* query property to the given value. pub fn user_key(mut self, new_value: &str) -> GroupListCall<'a, C, A> { @@ -9448,7 +9313,7 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau self._order_by = Some(new_value.to_string()); self } - /// Maximum number of results to return. Default is 200 + /// Maximum number of results to return. Max allowed value is 200. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> GroupListCall<'a, C, A> { @@ -14469,10 +14334,10 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves resolved app access settings of the logged in user. +/// Stop watching resources through this channel /// -/// A builder for the *GetSettings* method supported by a *resolvedAppAccessSetting* resource. -/// It is not used directly, but through a `ResolvedAppAccessSettingMethods` instance. +/// A builder for the *stop* method supported by a *channel* resource. +/// It is not used directly, but through a `ChannelMethods` instance. /// /// # Example /// @@ -14483,6 +14348,7 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Channel; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -14493,28 +14359,35 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Channel::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.resolved_app_access_settings().get_settings() +/// let result = hub.channels().stop(req) /// .doit(); /// # } /// ``` -pub struct ResolvedAppAccessSettingGetSettingCall<'a, C, A> +pub struct ChannelStopCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Directory, + _request: Channel, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ResolvedAppAccessSettingGetSettingCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ChannelStopCall<'a, C, A> {} -impl<'a, C, A> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AppAccessCollections)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -14522,10 +14395,10 @@ impl<'a, C, A> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: BorrowM Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "directory.resolvedAppAccessSettings.GetSettings", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "admin.channels.stop", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - for &field in ["alt"].iter() { + for &field in [].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14535,32 +14408,51 @@ impl<'a, C, A> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: BorrowM params.push((&name, value.clone())); } - params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "resolvedappaccesssettings"; - - let mut key = self.hub.auth.borrow_mut().api_key(); - if key.is_none() { - key = dlg.api_key(); - } - match key { - Some(value) => params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + let mut url = self.hub._base_url.clone() + "/admin/directory_v1/channels/stop"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -14591,17 +14483,7 @@ impl<'a, C, A> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: BorrowM Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -14611,13 +14493,22 @@ impl<'a, C, A> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: BorrowM } + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Channel) -> ChannelStopCall<'a, C, A> { + self._request = new_value; + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResolvedAppAccessSettingGetSettingCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ChannelStopCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -14638,190 +14529,35 @@ impl<'a, C, A> ResolvedAppAccessSettingGetSettingCall<'a, C, A> where C: BorrowM /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResolvedAppAccessSettingGetSettingCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ChannelStopCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self } -} - - -/// Retrieves the list of apps trusted by the admin of the logged in user. -/// -/// A builder for the *ListTrustedApps* method supported by a *resolvedAppAccessSetting* resource. -/// It is not used directly, but through a `ResolvedAppAccessSettingMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.resolved_app_access_settings().list_trusted_apps() -/// .doit(); -/// # } -/// ``` -pub struct ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, -} - -impl<'a, C, A> CallBuilder for ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> {} - -impl<'a, C, A> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TrustedApps)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ChannelStopCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, }; - dlg.begin(MethodInfo { id: "directory.resolvedAppAccessSettings.ListTrustedApps", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - for &field in ["alt"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "trustedapps"; - - let mut key = self.hub.auth.borrow_mut().api_key(); - if key.is_none() { - key = dlg.api_key(); - } - match key { - Some(value) => params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> { - self._delegate = Some(new_value); self } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResolvedAppAccessSettingListTrustedAppCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - } @@ -15335,7 +15071,7 @@ impl<'a, C, A> MobiledeviceListCall<'a, C, A> where C: BorrowMut, self._order_by = Some(new_value.to_string()); self } - /// Maximum number of results to return. Default is 100 + /// Maximum number of results to return. Max allowed value is 100. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> MobiledeviceListCall<'a, C, A> { @@ -15914,233 +15650,6 @@ impl<'a, C, A> MobiledeviceActionCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Channel::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.channels().stop(req) -/// .doit(); -/// # } -/// ``` -pub struct ChannelStopCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _request: Channel, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ChannelStopCall<'a, C, A> {} - -impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "admin.channels.stop", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "/admin/directory_v1/channels/stop"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Channel) -> ChannelStopCall<'a, C, A> { - self._request = new_value; - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ChannelStopCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ChannelStopCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryUser`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ChannelStopCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Get information about an access token issued by a user. /// /// A builder for the *get* method supported by a *token* resource. @@ -18184,7 +17693,7 @@ impl<'a, C, A> ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdeviceListCall<'a, C, A> { @@ -20952,7 +20461,7 @@ impl<'a, C, A> MemberListCall<'a, C, A> where C: BorrowMut, A: oa self._page_token = Some(new_value.to_string()); self } - /// Maximum number of results to return. Default is 200 + /// Maximum number of results to return. Max allowed value is 200. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> MemberListCall<'a, C, A> { @@ -23526,258 +23035,6 @@ impl<'a, C, A> DomainAliaseInsertCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.domain_aliases().list("customer") -/// .parent_domain_name("et") -/// .doit(); -/// # } -/// ``` -pub struct DomainAliaseListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _customer: String, - _parent_domain_name: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DomainAliaseListCall<'a, C, A> {} - -impl<'a, C, A> DomainAliaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DomainAliases)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "directory.domainAliases.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("customer", self._customer.to_string())); - if let Some(value) = self._parent_domain_name { - params.push(("parentDomainName", value.to_string())); - } - for &field in ["alt", "customer", "parentDomainName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{customer}", "customer")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["customer"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Immutable ID of the G Suite account. - /// - /// Sets the *customer* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn customer(mut self, new_value: &str) -> DomainAliaseListCall<'a, C, A> { - self._customer = new_value.to_string(); - self - } - /// Name of the parent domain for which domain aliases are to be fetched. - /// - /// Sets the *parent domain name* query property to the given value. - pub fn parent_domain_name(mut self, new_value: &str) -> DomainAliaseListCall<'a, C, A> { - self._parent_domain_name = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DomainAliaseListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DomainAliaseListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryDomainReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DomainAliaseListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves a domain alias of the customer. /// /// A builder for the *get* method supported by a *domainAliase* resource. @@ -24030,6 +23287,258 @@ impl<'a, C, A> DomainAliaseGetCall<'a, C, A> where C: BorrowMut, } +/// Lists the domain aliases of the customer. +/// +/// A builder for the *list* method supported by a *domainAliase* resource. +/// It is not used directly, but through a `DomainAliaseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.domain_aliases().list("customer") +/// .parent_domain_name("vero") +/// .doit(); +/// # } +/// ``` +pub struct DomainAliaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _customer: String, + _parent_domain_name: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DomainAliaseListCall<'a, C, A> {} + +impl<'a, C, A> DomainAliaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DomainAliases)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "directory.domainAliases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("customer", self._customer.to_string())); + if let Some(value) = self._parent_domain_name { + params.push(("parentDomainName", value.to_string())); + } + for &field in ["alt", "customer", "parentDomainName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{customer}", "customer")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["customer"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Immutable ID of the G Suite account. + /// + /// Sets the *customer* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn customer(mut self, new_value: &str) -> DomainAliaseListCall<'a, C, A> { + self._customer = new_value.to_string(); + self + } + /// Name of the parent domain for which domain aliases are to be fetched. + /// + /// Sets the *parent domain name* query property to the given value. + pub fn parent_domain_name(mut self, new_value: &str) -> DomainAliaseListCall<'a, C, A> { + self._parent_domain_name = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DomainAliaseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DomainAliaseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryDomainReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DomainAliaseListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a Domain Alias of the customer. /// /// A builder for the *delete* method supported by a *domainAliase* resource. @@ -31957,6 +31466,289 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa } +/// Watch for changes in user aliases list +/// +/// A builder for the *aliases.watch* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_admin1_directory as admin1_directory; +/// use admin1_directory::Channel; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use admin1_directory::Directory; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Channel::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.users().aliases_watch(req, "userKey") +/// .event("eos") +/// .doit(); +/// # } +/// ``` +pub struct UserAliaseWatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Directory, + _request: Channel, + _user_key: String, + _event: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserAliaseWatchCall<'a, C, A> {} + +impl<'a, C, A> UserAliaseWatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Channel)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "directory.users.aliases.watch", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("userKey", self._user_key.to_string())); + if let Some(value) = self._event { + params.push(("event", value.to_string())); + } + for &field in ["alt", "userKey", "event"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/watch"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userKey}", "userKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["userKey"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Channel) -> UserAliaseWatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Email or immutable ID of the user + /// + /// Sets the *user key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_key(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { + self._user_key = new_value.to_string(); + self + } + /// Event on which subscription is intended (if subscribing) + /// + /// Sets the *event* query property to the given value. + pub fn event(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { + self._event = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserAliaseWatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserAliaseWatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DirectoryUser`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserAliaseWatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Add a photo for the user /// /// A builder for the *photos.update* method supported by a *user* resource. @@ -32262,18 +32054,18 @@ impl<'a, C, A> UserPhotoUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().watch(req) -/// .view_type("eos") -/// .sort_order("justo") -/// .show_deleted("tempor") -/// .query("gubergren") +/// .view_type("tempor") +/// .sort_order("gubergren") +/// .show_deleted("dolore") +/// .query("amet.") /// .projection("dolore") -/// .page_token("amet.") -/// .order_by("dolore") -/// .max_results(-83) -/// .event("elitr") -/// .domain("magna") -/// .customer("ipsum") -/// .custom_field_mask("invidunt") +/// .page_token("magna") +/// .order_by("elitr") +/// .max_results(-82) +/// .event("ipsum") +/// .domain("invidunt") +/// .customer("accusam") +/// .custom_field_mask("labore") /// .doit(); /// # } /// ``` @@ -32481,7 +32273,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau self._sort_order = Some(new_value.to_string()); self } - /// If set to true retrieves the list of deleted users. Default is false + /// If set to true, retrieves the list of deleted users. (Default: false) /// /// Sets the *show deleted* query property to the given value. pub fn show_deleted(mut self, new_value: &str) -> UserWatchCall<'a, C, A> { @@ -32516,7 +32308,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau self._order_by = Some(new_value.to_string()); self } - /// Maximum number of results to return. Default is 100. Max allowed is 500 + /// Maximum number of results to return. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> UserWatchCall<'a, C, A> { @@ -33149,18 +32941,18 @@ impl<'a, C, A> UserPhotoGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().list() -/// .view_type("diam") -/// .sort_order("nonumy") -/// .show_deleted("sed") -/// .query("diam") -/// .projection("magna") +/// .view_type("sed") +/// .sort_order("diam") +/// .show_deleted("magna") +/// .query("dolor") +/// .projection("Lorem") /// .page_token("dolor") -/// .order_by("Lorem") -/// .max_results(-49) -/// .event("vero") -/// .domain("nonumy") -/// .customer("takimata") -/// .custom_field_mask("dolores") +/// .order_by("vero") +/// .max_results(-91) +/// .event("takimata") +/// .domain("dolores") +/// .customer("consetetur") +/// .custom_field_mask("erat") /// .doit(); /// # } /// ``` @@ -33343,7 +33135,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut self._sort_order = Some(new_value.to_string()); self } - /// If set to true retrieves the list of deleted users. Default is false + /// If set to true, retrieves the list of deleted users. (Default: false) /// /// Sets the *show deleted* query property to the given value. pub fn show_deleted(mut self, new_value: &str) -> UserListCall<'a, C, A> { @@ -33378,7 +33170,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut self._order_by = Some(new_value.to_string()); self } - /// Maximum number of results to return. Default is 100. Max allowed is 500 + /// Maximum number of results to return. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> UserListCall<'a, C, A> { @@ -33500,9 +33292,9 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().get("userKey") -/// .view_type("erat") -/// .projection("amet.") -/// .custom_field_mask("dolores") +/// .view_type("dolores") +/// .projection("dolores") +/// .custom_field_mask("et") /// .doit(); /// # } /// ``` @@ -34047,7 +33839,7 @@ impl<'a, C, A> UserAliaseInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().aliases_list("userKey") -/// .event("sed") +/// .event("aliquyam") /// .doit(); /// # } /// ``` @@ -35043,289 +34835,6 @@ impl<'a, C, A> UserAliaseDeleteCall<'a, C, A> where C: BorrowMut, } -/// Watch for changes in user aliases list -/// -/// A builder for the *aliases.watch* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_admin1_directory as admin1_directory; -/// use admin1_directory::Channel; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use admin1_directory::Directory; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Channel::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.users().aliases_watch(req, "userKey") -/// .event("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct UserAliaseWatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Directory, - _request: Channel, - _user_key: String, - _event: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserAliaseWatchCall<'a, C, A> {} - -impl<'a, C, A> UserAliaseWatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Channel)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "directory.users.aliases.watch", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("userKey", self._user_key.to_string())); - if let Some(value) = self._event { - params.push(("event", value.to_string())); - } - for &field in ["alt", "userKey", "event"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/watch"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{userKey}", "userKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["userKey"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Channel) -> UserAliaseWatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Email or immutable ID of the user - /// - /// Sets the *user key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_key(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { - self._user_key = new_value.to_string(); - self - } - /// Event on which subscription is intended (if subscribing) - /// - /// Sets the *event* query property to the given value. - pub fn event(mut self, new_value: &str) -> UserAliaseWatchCall<'a, C, A> { - self._event = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserAliaseWatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserAliaseWatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::DirectoryUser`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserAliaseWatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Delete user /// /// A builder for the *delete* method supported by a *user* resource. diff --git a/gen/admin1_reports-cli/Cargo.toml b/gen/admin1_reports-cli/Cargo.toml index 7215dfb8ba..c44197b353 100644 --- a/gen/admin1_reports-cli/Cargo.toml +++ b/gen/admin1_reports-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-admin1_reports-cli" -version = "1.0.12+20190521" +version = "1.0.13+20191014" authors = ["Sebastian Thiel "] description = "A complete library to interact with reports (protocol reports_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports-cli" -homepage = "https://developers.google.com/admin-sdk/reports/" +homepage = "/admin-sdk/reports/" documentation = "http://byron.github.io/google-apis-rs/google_admin1_reports_cli" license = "MIT" keywords = ["admin", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-admin1_reports] path = "../admin1_reports" -version = "1.0.12+20190521" +version = "1.0.13+20191014" diff --git a/gen/admin1_reports-cli/README.md b/gen/admin1_reports-cli/README.md index 10bc83acf3..a4894556e6 100644 --- a/gen/admin1_reports-cli/README.md +++ b/gen/admin1_reports-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *reports* API can be found at the -[official documentation site](https://developers.google.com/admin-sdk/reports/). +[official documentation site](/admin-sdk/reports/). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *reports* API at revision *20190521*. The CLI is at version *1.0.12*. +This documentation was generated from the *reports* API at revision *20191014*. The CLI is at version *1.0.13*. ```bash admin1-reports [options] diff --git a/gen/admin1_reports-cli/mkdocs.yml b/gen/admin1_reports-cli/mkdocs.yml index 77772e2dcc..06d5f6aac4 100644 --- a/gen/admin1_reports-cli/mkdocs.yml +++ b/gen/admin1_reports-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reports v1.0.12+20190521 +site_name: reports v1.0.13+20191014 site_url: http://byron.github.io/google-apis-rs/google-admin1_reports-cli site_description: A complete library to interact with reports (protocol reports_v1) diff --git a/gen/admin1_reports-cli/src/main.rs b/gen/admin1_reports-cli/src/main.rs index dea1400519..df45934a19 100644 --- a/gen/admin1_reports-cli/src/main.rs +++ b/gen/admin1_reports-cli/src/main.rs @@ -682,12 +682,12 @@ fn main() { let arg_data = [ ("activities", "methods: 'list' and 'watch'", vec![ ("list", - Some(r##"Retrieves a list of activities for a specific customer and application."##), + Some(r##"Retrieves a list of activities for a specific customer's account and application such as the Admin console application or the Google Drive application. For more information, see the guides for administrator and Google Drive activity reports. For more information about the activity report's parameters, see the activity parameters reference guides."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_reports_cli/activities_list", vec![ (Some(r##"user-key"##), None, - Some(r##"Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users."##), + Some(r##"Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address."##), Some(true), Some(false)), @@ -710,12 +710,12 @@ fn main() { Some(false)), ]), ("watch", - Some(r##"Push changes to activities"##), + Some(r##"Start receiving notifications for account activities. For more information, see Receiving Push Notifications."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_reports_cli/activities_watch", vec![ (Some(r##"user-key"##), None, - Some(r##"Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users."##), + Some(r##"Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address."##), Some(true), Some(false)), @@ -766,12 +766,12 @@ fn main() { ("customer-usage-reports", "methods: 'get'", vec![ ("get", - Some(r##"Retrieves a report which is a collection of properties / statistics for a specific customer."##), + Some(r##"Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information about the customer report's parameters, see the Customers Usage parameters reference guides."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_reports_cli/customer-usage-reports_get", vec![ (Some(r##"date"##), None, - Some(r##"Represents the date in yyyy-mm-dd format for which the data is to be fetched."##), + Some(r##"Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this."##), Some(true), Some(false)), @@ -791,24 +791,24 @@ fn main() { ("entity-usage-reports", "methods: 'get'", vec![ ("get", - Some(r##"Retrieves a report which is a collection of properties / statistics for a set of objects."##), + Some(r##"Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more information about the entities report's parameters, see the Entities Usage parameters reference guides."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_reports_cli/entity-usage-reports_get", vec![ (Some(r##"entity-type"##), None, - Some(r##"Type of object. Should be one of - gplus_communities."##), + Some(r##"Represents the type of entity for the report."##), Some(true), Some(false)), (Some(r##"entity-key"##), None, - Some(r##"Represents the key of object for which the data should be filtered."##), + Some(r##"Represents the key of the object to filter the data with."##), Some(true), Some(false)), (Some(r##"date"##), None, - Some(r##"Represents the date in yyyy-mm-dd format for which the data is to be fetched."##), + Some(r##"Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this."##), Some(true), Some(false)), @@ -828,18 +828,18 @@ fn main() { ("user-usage-report", "methods: 'get'", vec![ ("get", - Some(r##"Retrieves a report which is a collection of properties / statistics for a set of users."##), + Some(r##"Retrieves a report which is a collection of properties and statistics for a set of users with the account. For more information, see the User Usage Report guide. For more information about the user report's parameters, see the Users Usage parameters reference guides."##), "Details at http://byron.github.io/google-apis-rs/google_admin1_reports_cli/user-usage-report_get", vec![ (Some(r##"user-key"##), None, - Some(r##"Represents the profile id or the user email for which the data should be filtered."##), + Some(r##"Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address."##), Some(true), Some(false)), (Some(r##"date"##), None, - Some(r##"Represents the date in yyyy-mm-dd format for which the data is to be fetched."##), + Some(r##"Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this."##), Some(true), Some(false)), @@ -861,7 +861,7 @@ fn main() { let mut app = App::new("admin1-reports") .author("Sebastian Thiel ") - .version("1.0.12+20190521") + .version("1.0.13+20191014") .about("Fetches reports for the administrators of G Suite customers about the usage, collaboration, security, and risk for their users.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_admin1_reports_cli") .arg(Arg::with_name("url") diff --git a/gen/admin1_reports/Cargo.toml b/gen/admin1_reports/Cargo.toml index 3ec0938ef6..13824a2546 100644 --- a/gen/admin1_reports/Cargo.toml +++ b/gen/admin1_reports/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-admin1_reports" -version = "1.0.12+20190521" +version = "1.0.13+20191014" authors = ["Sebastian Thiel "] description = "A complete library to interact with reports (protocol reports_v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports" -homepage = "https://developers.google.com/admin-sdk/reports/" -documentation = "https://docs.rs/google-admin1_reports/1.0.12+20190521" +homepage = "/admin-sdk/reports/" +documentation = "https://docs.rs/google-admin1_reports/1.0.13+20191014" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/admin1_reports/README.md b/gen/admin1_reports/README.md index a7c263a72a..34cef29a33 100644 --- a/gen/admin1_reports/README.md +++ b/gen/admin1_reports/README.md @@ -5,30 +5,30 @@ DO NOT EDIT ! --> The `google-admin1_reports` library allows access to all features of the *Google reports* service. -This documentation was generated from *reports* crate version *1.0.12+20190521*, where *20190521* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *reports* crate version *1.0.13+20191014*, where *20191014* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *reports* *v1_reports* API can be found at the -[official documentation site](https://developers.google.com/admin-sdk/reports/). +[official documentation site](/admin-sdk/reports/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.Reports.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.Reports.html) ... -* [activities](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.Activity.html) - * [*list*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.ActivityListCall.html) and [*watch*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.ActivityWatchCall.html) -* [channels](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.Channel.html) - * [*stop*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.ChannelStopCall.html) +* [activities](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.Activity.html) + * [*list*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.ActivityListCall.html) and [*watch*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.ActivityWatchCall.html) +* [channels](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.ChannelStopCall.html) * customer usage reports - * [*get*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.CustomerUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.CustomerUsageReportGetCall.html) * entity usage reports - * [*get*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.EntityUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.EntityUsageReportGetCall.html) * user usage report - * [*get*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.UserUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.UserUsageReportGetCall.html) Subscription supported by ... -* [*list activities*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.ActivityListCall.html) -* [*watch activities*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.ActivityWatchCall.html) +* [*list activities*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.ActivityListCall.html) +* [*watch activities*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.ActivityWatchCall.html) @@ -36,17 +36,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/struct.Reports.html)** +* **[Hub](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/struct.Reports.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -145,17 +145,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -165,29 +165,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.RequestValue.html) and -[decodable](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-admin1_reports/1.0.12+20190521/google_admin1_reports/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_reports/1.0.13+20191014/google_admin1_reports/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/admin1_reports/src/lib.rs b/gen/admin1_reports/src/lib.rs index 5441bdf9d1..2b06b8607b 100644 --- a/gen/admin1_reports/src/lib.rs +++ b/gen/admin1_reports/src/lib.rs @@ -2,10 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reports* crate version *1.0.12+20190521*, where *20190521* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *reports* crate version *1.0.13+20191014*, where *20191014* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *reports* *v1_reports* API can be found at the -//! [official documentation site](https://developers.google.com/admin-sdk/reports/). +//! [official documentation site](/admin-sdk/reports/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/admin1_reports). //! # Features //! @@ -348,7 +348,7 @@ impl<'a, C, A> Reports Reports { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/admin/reports/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -371,7 +371,7 @@ impl<'a, C, A> Reports } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -399,13 +399,13 @@ impl<'a, C, A> Reports // ############ // SCHEMAS ### // ########## -/// Nested value of the parameter. +/// Nested parameter value pairs associated with this parameter. Complex value type for a parameter are returned as a list of parameter values. For example, the address parameter may have a value as [{parameter: [{name: city, value: abc}]}] /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityEventsParametersMessageValue { - /// Looping to get parameter values. + /// Parameter values pub parameter: Option>, } @@ -413,7 +413,7 @@ impl NestedType for ActivityEventsParametersMessageValue {} impl Part for ActivityEventsParametersMessageValue {} -/// Key-Value pairs to give detailed information on the warning. +/// Key-value pairs to give detailed information on the warning. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -435,13 +435,13 @@ impl Part for UsageReportsWarningsData {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UsageReport { - /// The date to which the record belongs. + /// The date of the report request. pub date: Option, - /// The kind of object. + /// The type of API resource. For a usage report, the value is admin#reports#usageReport. pub kind: Option, /// ETag of the resource. pub etag: Option, - /// Parameter value pairs for various applications. + /// Parameter value pairs for various applications. For the Customers usage report parameters and values, see the customer usage parameters reference. pub parameters: Option>, /// Information about the type of the item. pub entity: Option, @@ -456,16 +456,16 @@ impl Part for UsageReport {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityId { - /// Application name to which the event belongs. + /// Application name to which the event belongs. For possible values see the list of applications above in applicationName. #[serde(rename="applicationName")] pub application_name: Option, /// Unique qualifier if multiple events have the same time. #[serde(rename="uniqueQualifier")] pub unique_qualifier: Option, - /// Obfuscated customer ID of the source customer. + /// The unique identifier for a G suite account. #[serde(rename="customerId")] pub customer_id: Option, - /// Time of occurrence of the activity. + /// Time of occurrence of the activity. This is in UNIX epoch time in seconds. pub time: Option, } @@ -473,17 +473,19 @@ impl NestedType for ActivityId {} impl Part for ActivityId {} -/// Warnings if any. +/// Warnings, if any. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UsageReportsWarnings { - /// Human readable message for the warning. + /// The human readable messages for a warning are: + /// - Data is not available warning - Sorry, data for date yyyy-mm-dd for application "application name" is not available. + /// - Partial data is available warning - Data for date yyyy-mm-dd for application "application name" is not available right now, please try again after a few hours. pub message: Option, - /// Machine readable code / warning type. + /// Machine readable code or warning type. The warning code value is 200. pub code: Option, - /// Key-Value pairs to give detailed information on the warning. + /// Key-value pairs to give detailed information on the warning. pub data: Option>, } @@ -497,16 +499,16 @@ impl Part for UsageReportsWarnings {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Activity { - /// Kind of resource this is. + /// The type of API resource. For an activity report, the value is audit#activity. pub kind: Option, /// ETag of the entry. pub etag: Option, - /// Activity events. + /// Activity events in the report. pub events: Option>, - /// IP Address of the user doing the action. + /// IP address of the user doing the action. This is the Internet Protocol (IP) address of the user when logging into G Suite which may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. The API supports IPv4 and IPv6. #[serde(rename="ipAddress")] pub ip_address: Option, - /// Domain of source customer. + /// This is the domain that is affected by the report's event. For example domain of Admin console or the Drive application's document owner. #[serde(rename="ownerDomain")] pub owner_domain: Option, /// User doing the action. @@ -535,10 +537,10 @@ pub struct NestedParameter { pub multi_value: Option>, /// The name of the parameter. pub name: Option, - /// Multiple integral values of the parameter. + /// Multiple integer values of the parameter. #[serde(rename="multiIntValue")] pub multi_int_value: Option>, - /// Integral value of the parameter. + /// Integer value of the parameter. #[serde(rename="intValue")] pub int_value: Option, /// String value of the parameter. @@ -601,12 +603,12 @@ impl ResponseResult for Channel {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Activities { - /// Token for retrieving the next page + /// Token for retrieving the follow-on next page of the report. The nextPageToken value is used in the request's pageToken query string. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Each record in read response. + /// Each activity record in the response. pub items: Option>, - /// Kind of list response this is. + /// The type of API resource. For an activity report, the value is reports#activities. pub kind: Option, /// ETag of the resource. pub etag: Option, @@ -615,13 +617,13 @@ pub struct Activities { impl ResponseResult for Activities {} -/// Nested values of the parameter. +/// List of messageValue objects. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityEventsParametersMultiMessageValue { - /// Parameter value. + /// Parameter values pub parameter: Option>, } @@ -629,7 +631,7 @@ impl NestedType for ActivityEventsParametersMultiMessageValue {} impl Part for ActivityEventsParametersMultiMessageValue {} -/// Parameter value pairs for various applications. +/// Parameter value pairs for various applications. For the Customers usage report parameters and values, see the customer usage parameters reference. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -638,10 +640,10 @@ pub struct UsageReportParameters { /// Nested message value of the parameter. #[serde(rename="msgValue")] pub msg_value: Option>>, - /// RFC 3339 formatted value of the parameter. + /// The RFC 3339 formatted value of the parameter, for example 2010-10-28T10:26:35.000Z. #[serde(rename="datetimeValue")] pub datetime_value: Option, - /// The name of the parameter. + /// no description provided pub name: Option, /// String value of the parameter. #[serde(rename="stringValue")] @@ -649,7 +651,7 @@ pub struct UsageReportParameters { /// Boolean value of the parameter. #[serde(rename="boolValue")] pub bool_value: Option, - /// Integral value of the parameter. + /// Integer value of the parameter. #[serde(rename="intValue")] pub int_value: Option, } @@ -664,14 +666,14 @@ impl Part for UsageReportParameters {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityActor { - /// Obfuscated user id of the user. + /// The unique G Suite profile ID of the actor. May be absent if the actor is not a G Suite user. #[serde(rename="profileId")] pub profile_id: Option, - /// Email address of the user. + /// The primary email address of the actor. May be absent if there is no email address associated with the actor. pub email: Option, - /// For OAuth 2LO API requests, consumer_key of the requestor. + /// Only present when callerType is KEY. Can be the consumer_key of the requestor for OAuth 2LO API requests or an identifier for robot accounts. pub key: Option, - /// User or OAuth 2LO request. + /// The type of actor. #[serde(rename="callerType")] pub caller_type: Option, } @@ -680,7 +682,7 @@ impl NestedType for ActivityActor {} impl Part for ActivityActor {} -/// JSON template for a collection of usage reports. +/// There is no detailed description. /// /// # Activities /// @@ -693,24 +695,24 @@ impl Part for ActivityActor {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UsageReports { - /// Token for retrieving the next page + /// Token to specify next page. A report with multiple pages has a nextPageToken property in the response. For your follow-on requests getting all of the report's pages, enter the nextPageToken value in the pageToken query string. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// The kind of object. + /// The type of API resource. For a usage report, the value is admin#reports#usageReports. pub kind: Option, /// ETag of the resource. pub etag: Option, /// Various application parameter records. #[serde(rename="usageReports")] pub usage_reports: Option>, - /// Warnings if any. + /// Warnings, if any. pub warnings: Option>, } impl ResponseResult for UsageReports {} -/// Parameter value pairs for various applications. +/// Parameter value pairs for various applications. For more information about eventName parameters, see the list of event names for various applications above in applicationName. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -718,7 +720,7 @@ impl ResponseResult for UsageReports {} pub struct ActivityEventsParameters { /// The name of the parameter. pub name: Option, - /// Nested value of the parameter. + /// Nested parameter value pairs associated with this parameter. Complex value type for a parameter are returned as a list of parameter values. For example, the address parameter may have a value as [{parameter: [{name: city, value: abc}]}] #[serde(rename="messageValue")] pub message_value: Option, /// Boolean value of the parameter. @@ -726,16 +728,16 @@ pub struct ActivityEventsParameters { pub bool_value: Option, /// String value of the parameter. pub value: Option, - /// Integral value of the parameter. + /// Integer value of the parameter. #[serde(rename="intValue")] pub int_value: Option, - /// Multi-string value of the parameter. + /// String values of the parameter. #[serde(rename="multiValue")] pub multi_value: Option>, - /// Multi-int value of the parameter. + /// Integer values of the parameter. #[serde(rename="multiIntValue")] pub multi_int_value: Option>, - /// Nested values of the parameter. + /// List of messageValue objects. #[serde(rename="multiMessageValue")] pub multi_message_value: Option>, } @@ -744,18 +746,22 @@ impl NestedType for ActivityEventsParameters {} impl Part for ActivityEventsParameters {} -/// Activity events. +/// Activity events in the report. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ActivityEvents { - /// Type of event. + /// Type of event. The G Suite service or feature that an administrator changes is identified in the type property which identifies an event using the eventName property. For a full list of the API's type categories, see the list of event names for various applications above in applicationName. #[serde(rename="type")] pub type_: Option, - /// Name of event. + /// Name of the event. This is the specific name of the activity reported by the API. And each eventName is related to a specific G Suite service or feature which the API organizes into types of events. + /// For eventName request parameters in general: + /// - If no eventName is given, the report returns all possible instances of an eventName. + /// - When you request an eventName, the API's response returns all activities which contain that eventName. It is possible that the returned activities will have other eventName properties in addition to the one requested. + /// For more information about eventName properties, see the list of event names for various applications above in applicationName. pub name: Option, - /// Parameter value pairs for various applications. + /// Parameter value pairs for various applications. For more information about eventName parameters, see the list of event names for various applications above in applicationName. pub parameters: Option>, } @@ -769,19 +775,19 @@ impl Part for ActivityEvents {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UsageReportEntity { - /// Obfuscated user id for the record. + /// The user's immutable G Suite profile identifier. #[serde(rename="profileId")] pub profile_id: Option, - /// user's email. Only relevant if entity.type = "USER" + /// The user's email address. Only relevant if entity.type = "USER" #[serde(rename="userEmail")] pub user_email: Option, - /// The type of item, can be customer, user, or entity (aka. object). + /// The type of item. The value is customer. #[serde(rename="type")] pub type_: Option, /// Object key. Only relevant if entity.type = "OBJECT" Note: external-facing name of report is "Entities" rather than "Objects". #[serde(rename="entityId")] pub entity_id: Option, - /// Obfuscated customer id for the record. + /// The unique identifier of the customer's account. #[serde(rename="customerId")] pub customer_id: Option, } @@ -895,13 +901,13 @@ impl<'a, C, A> EntityUsageReportMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a report which is a collection of properties / statistics for a set of objects. + /// Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more information about the entities report's parameters, see the Entities Usage parameters reference guides. /// /// # Arguments /// - /// * `entityType` - Type of object. Should be one of - gplus_communities. - /// * `entityKey` - Represents the key of object for which the data should be filtered. - /// * `date` - Represents the date in yyyy-mm-dd format for which the data is to be fetched. + /// * `entityType` - Represents the type of entity for the report. + /// * `entityKey` - Represents the key of the object to filter the data with. + /// * `date` - Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this. pub fn get(&self, entity_type: &str, entity_key: &str, date: &str) -> EntityUsageReportGetCall<'a, C, A> { EntityUsageReportGetCall { hub: self.hub, @@ -963,11 +969,11 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a list of activities for a specific customer and application. + /// Retrieves a list of activities for a specific customer's account and application such as the Admin console application or the Google Drive application. For more information, see the guides for administrator and Google Drive activity reports. For more information about the activity report's parameters, see the activity parameters reference guides. /// /// # Arguments /// - /// * `userKey` - Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. + /// * `userKey` - Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. /// * `applicationName` - Application name for which the events are to be retrieved. pub fn list(&self, user_key: &str, application_name: &str) -> ActivityListCall<'a, C, A> { ActivityListCall { @@ -991,12 +997,12 @@ impl<'a, C, A> ActivityMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Push changes to activities + /// Start receiving notifications for account activities. For more information, see Receiving Push Notifications. /// /// # Arguments /// /// * `request` - No description provided. - /// * `userKey` - Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. + /// * `userKey` - Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. /// * `applicationName` - Application name for which the events are to be retrieved. pub fn watch(&self, request: Channel, user_key: &str, application_name: &str) -> ActivityWatchCall<'a, C, A> { ActivityWatchCall { @@ -1063,11 +1069,11 @@ impl<'a, C, A> CustomerUsageReportMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a report which is a collection of properties / statistics for a specific customer. + /// Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information about the customer report's parameters, see the Customers Usage parameters reference guides. /// /// # Arguments /// - /// * `date` - Represents the date in yyyy-mm-dd format for which the data is to be fetched. + /// * `date` - Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this. pub fn get(&self, date: &str) -> CustomerUsageReportGetCall<'a, C, A> { CustomerUsageReportGetCall { hub: self.hub, @@ -1125,12 +1131,12 @@ impl<'a, C, A> UserUsageReportMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a report which is a collection of properties / statistics for a set of users. + /// Retrieves a report which is a collection of properties and statistics for a set of users with the account. For more information, see the User Usage Report guide. For more information about the user report's parameters, see the Users Usage parameters reference guides. /// /// # Arguments /// - /// * `userKey` - Represents the profile id or the user email for which the data should be filtered. - /// * `date` - Represents the date in yyyy-mm-dd format for which the data is to be fetched. + /// * `userKey` - Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. + /// * `date` - Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this. pub fn get(&self, user_key: &str, date: &str) -> UserUsageReportGetCall<'a, C, A> { UserUsageReportGetCall { hub: self.hub, @@ -1384,7 +1390,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } -/// Retrieves a report which is a collection of properties / statistics for a set of objects. +/// Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more information about the entities report's parameters, see the Entities Usage parameters reference guides. /// /// A builder for the *get* method supported by a *entityUsageReport* resource. /// It is not used directly, but through a `EntityUsageReportMethods` instance. @@ -1584,7 +1590,7 @@ impl<'a, C, A> EntityUsageReportGetCall<'a, C, A> where C: BorrowMut EntityUsageReportGetCall<'a, C, A> where C: BorrowMut EntityUsageReportGetCall<'a, C, A> where C: BorrowMut EntityUsageReportGetCall<'a, C, A> where C: BorrowMut EntityUsageReportGetCall<'a, C, A> { self._parameters = Some(new_value.to_string()); self } - /// Token to specify next page. + /// Token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of results to return. Maximum allowed is 1000 + /// Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> EntityUsageReportGetCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Represents the set of filters including parameter operator value. + /// The filters query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The filters query string includes the name of the application whose usage is returned in the report. The application values for the Entities usage report include accounts, docs, and gmail. + /// Filters are in the form [application name]:[parameter name][relational operator][parameter value],.... + /// + /// In this example, the <> 'not equal to' operator is URL-encoded in the request's query string (%3C%3E): + /// GET https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01 ?parameters=gplus:community_name,gplus:num_total_members &filters=gplus:num_total_members>0 + /// + /// + /// The relational operators include: + /// - == - 'equal to'. + /// - <> - 'not equal to'. It is URL-encoded (%3C%3E). + /// - < - 'less than'. It is URL-encoded (%3C). + /// - <= - 'less than or equal to'. It is URL-encoded (%3C=). + /// - > - 'greater than'. It is URL-encoded (%3E). + /// - >= - 'greater than or equal to'. It is URL-encoded (%3E=). Filters can only be applied to numeric parameters. /// /// Sets the *filters* query property to the given value. pub fn filters(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { self._filters = Some(new_value.to_string()); self } - /// Represents the customer for which the data is to be fetched. + /// The unique ID of the customer to retrieve data for. /// /// Sets the *customer id* query property to the given value. pub fn customer_id(mut self, new_value: &str) -> EntityUsageReportGetCall<'a, C, A> { @@ -1708,7 +1732,7 @@ impl<'a, C, A> EntityUsageReportGetCall<'a, C, A> where C: BorrowMut ActivityListCall<'a, C, A> where C: BorrowMut, A: } - /// Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. + /// Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. /// /// Sets the *user key* path property to the given value. /// @@ -1946,63 +1970,84 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: self._application_name = new_value.to_string(); self } - /// Return events which occurred at or after this time. + /// Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until endTime. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. /// /// Sets the *start time* query property to the given value. pub fn start_time(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._start_time = Some(new_value.to_string()); self } - /// Token to specify next page. + /// The token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// the organizational unit's(OU) ID to filter activities from users belonging to a specific OU or one of its sub-OU(s) + /// ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results. /// /// Sets the *org unit id* query property to the given value. pub fn org_unit_id(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._org_unit_id = Some(new_value.to_string()); self } - /// Number of activity records to be shown in each page. + /// Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. The maxResults query string is optional in the request. The default value is 1000. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> ActivityListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... + /// The filters query string is a comma-separated list. The list is composed of event parameters that are manipulated by relational operators. Event parameters are in the form [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational operator][parameter2 value],... + /// These event parameters are associated with a specific eventName. An empty report is returned if the filtered request's parameter does not belong to the eventName. For more information about eventName parameters, see the list of event names for various applications above in applicationName. + /// + /// In the following Admin Activity example, the <> operator is URL-encoded in the request's query string (%3C%3E): + /// GET...&eventName=CHANGE_CALENDAR_SETTING &filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS + /// + /// In the following Drive example, the list can be a view or edit event's doc_id parameter with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational operator. In the first example, the report returns each edited document's doc_id. In the second example, the report returns each viewed document's doc_id that equals the value 12345 and does not return any viewed document's which have a doc_id value of 98765. The <> operator is URL-encoded in the request's query string (%3C%3E): + /// + /// GET...&eventName=edit&filters=doc_id GET...&eventName=view&filters=doc_id==12345,doc_id%3C%3E98765 + /// + /// The relational operators include: + /// - == - 'equal to'. + /// - <> - 'not equal to'. It is URL-encoded (%3C%3E). + /// - < - 'less than'. It is URL-encoded (%3C). + /// - <= - 'less than or equal to'. It is URL-encoded (%3C=). + /// - > - 'greater than'. It is URL-encoded (%3E). + /// - >= - 'greater than or equal to'. It is URL-encoded (%3E=). + /// Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. + /// In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. If no parameters are requested, all parameters are returned. /// /// Sets the *filters* query property to the given value. pub fn filters(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._filters = Some(new_value.to_string()); self } - /// Name of the event being queried. + /// The name of the event being queried by the API. Each eventName is related to a specific G Suite service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings type structure has all of the Calendar eventName activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings type and eventName parameters. For more information about eventName query strings and parameters, see the list of event names for various applications above in applicationName. /// /// Sets the *event name* query property to the given value. pub fn event_name(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._event_name = Some(new_value.to_string()); self } - /// Return events which occurred at or before this time. + /// Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: + /// - Date of the API's request for a report: When the API created and retrieved the report. + /// - Report's start time: The beginning of the timespan shown in the report. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. + /// - Report's end time: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the endTime is not specified, the report returns all activities from the startTime until the current time or the most recent 180 days if the startTime is more than 180 days in the past. /// /// Sets the *end time* query property to the given value. pub fn end_time(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._end_time = Some(new_value.to_string()); self } - /// Represents the customer for which the data is to be fetched. + /// The unique ID of the customer to retrieve data for. /// /// Sets the *customer id* query property to the given value. pub fn customer_id(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._customer_id = Some(new_value.to_string()); self } - /// IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. + /// The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions. /// /// Sets the *actor ip address* query property to the given value. pub fn actor_ip_address(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { @@ -2068,7 +2113,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: } -/// Push changes to activities +/// Start receiving notifications for account activities. For more information, see Receiving Push Notifications. /// /// A builder for the *watch* method supported by a *activity* resource. /// It is not used directly, but through a `ActivityMethods` instance. @@ -2317,7 +2362,7 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. + /// Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique G Suite profile ID or their primary email address. /// /// Sets the *user key* path property to the given value. /// @@ -2337,63 +2382,84 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: self._application_name = new_value.to_string(); self } - /// Return events which occurred at or after this time. + /// Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until endTime. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. /// /// Sets the *start time* query property to the given value. pub fn start_time(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { self._start_time = Some(new_value.to_string()); self } - /// Token to specify next page. + /// The token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// the organizational unit's(OU) ID to filter activities from users belonging to a specific OU or one of its sub-OU(s) + /// ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results. /// /// Sets the *org unit id* query property to the given value. pub fn org_unit_id(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { self._org_unit_id = Some(new_value.to_string()); self } - /// Number of activity records to be shown in each page. + /// Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. The maxResults query string is optional in the request. The default value is 1000. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> ActivityWatchCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... + /// The filters query string is a comma-separated list. The list is composed of event parameters that are manipulated by relational operators. Event parameters are in the form [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational operator][parameter2 value],... + /// These event parameters are associated with a specific eventName. An empty report is returned if the filtered request's parameter does not belong to the eventName. For more information about eventName parameters, see the list of event names for various applications above in applicationName. + /// + /// In the following Admin Activity example, the <> operator is URL-encoded in the request's query string (%3C%3E): + /// GET...&eventName=CHANGE_CALENDAR_SETTING &filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS + /// + /// In the following Drive example, the list can be a view or edit event's doc_id parameter with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational operator. In the first example, the report returns each edited document's doc_id. In the second example, the report returns each viewed document's doc_id that equals the value 12345 and does not return any viewed document's which have a doc_id value of 98765. The <> operator is URL-encoded in the request's query string (%3C%3E): + /// + /// GET...&eventName=edit&filters=doc_id GET...&eventName=view&filters=doc_id==12345,doc_id%3C%3E98765 + /// + /// The relational operators include: + /// - == - 'equal to'. + /// - <> - 'not equal to'. It is URL-encoded (%3C%3E). + /// - < - 'less than'. It is URL-encoded (%3C). + /// - <= - 'less than or equal to'. It is URL-encoded (%3C=). + /// - > - 'greater than'. It is URL-encoded (%3E). + /// - >= - 'greater than or equal to'. It is URL-encoded (%3E=). + /// Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. + /// In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. If no parameters are requested, all parameters are returned. /// /// Sets the *filters* query property to the given value. pub fn filters(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { self._filters = Some(new_value.to_string()); self } - /// Name of the event being queried. + /// The name of the event being queried by the API. Each eventName is related to a specific G Suite service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings type structure has all of the Calendar eventName activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings type and eventName parameters. For more information about eventName query strings and parameters, see the list of event names for various applications above in applicationName. /// /// Sets the *event name* query property to the given value. pub fn event_name(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { self._event_name = Some(new_value.to_string()); self } - /// Return events which occurred at or before this time. + /// Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: + /// - Date of the API's request for a report: When the API created and retrieved the report. + /// - Report's start time: The beginning of the timespan shown in the report. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. + /// - Report's end time: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the endTime is not specified, the report returns all activities from the startTime until the current time or the most recent 180 days if the startTime is more than 180 days in the past. /// /// Sets the *end time* query property to the given value. pub fn end_time(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { self._end_time = Some(new_value.to_string()); self } - /// Represents the customer for which the data is to be fetched. + /// The unique ID of the customer to retrieve data for. /// /// Sets the *customer id* query property to the given value. pub fn customer_id(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { self._customer_id = Some(new_value.to_string()); self } - /// IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. + /// The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions. /// /// Sets the *actor ip address* query property to the given value. pub fn actor_ip_address(mut self, new_value: &str) -> ActivityWatchCall<'a, C, A> { @@ -2459,7 +2525,7 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves a report which is a collection of properties / statistics for a specific customer. +/// Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information about the customer report's parameters, see the Customers Usage parameters reference guides. /// /// A builder for the *get* method supported by a *customerUsageReport* resource. /// It is not used directly, but through a `CustomerUsageReportMethods` instance. @@ -2645,7 +2711,7 @@ impl<'a, C, A> CustomerUsageReportGetCall<'a, C, A> where C: BorrowMut CustomerUsageReportGetCall<'a, C, A> where C: BorrowMut CustomerUsageReportGetCall<'a, C, A> { self._parameters = Some(new_value.to_string()); self } - /// Token to specify next page. + /// Token to specify next page. A report with multiple pages has a nextPageToken property in the response. For your follow-on requests getting all of the report's pages, enter the nextPageToken value in the pageToken query string. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> CustomerUsageReportGetCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Represents the customer for which the data is to be fetched. + /// The unique ID of the customer to retrieve data for. /// /// Sets the *customer id* query property to the given value. pub fn customer_id(mut self, new_value: &str) -> CustomerUsageReportGetCall<'a, C, A> { @@ -2735,7 +2806,7 @@ impl<'a, C, A> CustomerUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'a, C, A> { self._parameters = Some(new_value.to_string()); self } - /// Token to specify next page. + /// Token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> UserUsageReportGetCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// the organizational unit's ID to filter usage parameters from users belonging to a specific OU or one of its sub-OU(s). + /// ID of the organizational unit to report on. User activity will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results. /// /// Sets the *org unit id* query property to the given value. pub fn org_unit_id(mut self, new_value: &str) -> UserUsageReportGetCall<'a, C, A> { self._org_unit_id = Some(new_value.to_string()); self } - /// Maximum number of results to return. Maximum allowed is 1000 + /// Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. + /// The maxResults query string is optional. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> UserUsageReportGetCall<'a, C, A> { self._max_results = Some(new_value); self } - /// Represents the set of filters including parameter operator value. + /// The filters query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The filters query string includes the name of the application whose usage is returned in the report. The application values for the Users Usage Report include accounts, docs, and gmail. + /// Filters are in the form [application name]:[parameter name][relational operator][parameter value],.... + /// + /// In this example, the <> 'not equal to' operator is URL-encoded in the request's query string (%3C%3E): + /// GET https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03 ?parameters=accounts:last_login_time &filters=accounts:last_login_time>2010-10-28T10:26:35.000Z + /// + /// + /// The relational operators include: + /// - == - 'equal to'. + /// - <> - 'not equal to'. It is URL-encoded (%3C%3E). + /// - < - 'less than'. It is URL-encoded (%3C). + /// - <= - 'less than or equal to'. It is URL-encoded (%3C=). + /// - > - 'greater than'. It is URL-encoded (%3E). + /// - >= - 'greater than or equal to'. It is URL-encoded (%3E=). /// /// Sets the *filters* query property to the given value. pub fn filters(mut self, new_value: &str) -> UserUsageReportGetCall<'a, C, A> { self._filters = Some(new_value.to_string()); self } - /// Represents the customer for which the data is to be fetched. + /// The unique ID of the customer to retrieve data for. /// /// Sets the *customer id* query property to the given value. pub fn customer_id(mut self, new_value: &str) -> UserUsageReportGetCall<'a, C, A> { diff --git a/gen/adsense1d4-cli/Cargo.toml b/gen/adsense1d4-cli/Cargo.toml index bd3218a0ef..6d96fe8554 100644 --- a/gen/adsense1d4-cli/Cargo.toml +++ b/gen/adsense1d4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsense1d4-cli" -version = "1.0.12+20190703" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-adsense1d4] path = "../adsense1d4" -version = "1.0.12+20190703" +version = "1.0.13+20200407" diff --git a/gen/adsense1d4-cli/README.md b/gen/adsense1d4-cli/README.md index 51616d82e6..31ba10663e 100644 --- a/gen/adsense1d4-cli/README.md +++ b/gen/adsense1d4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *AdSense* API at revision *20190703*. The CLI is at version *1.0.12*. +This documentation was generated from the *AdSense* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash adsense1d4 [options] diff --git a/gen/adsense1d4-cli/mkdocs.yml b/gen/adsense1d4-cli/mkdocs.yml index 484c52b0d0..9f615c487d 100644 --- a/gen/adsense1d4-cli/mkdocs.yml +++ b/gen/adsense1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense v1.0.12+20190703 +site_name: AdSense v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-adsense1d4-cli site_description: A complete library to interact with AdSense (protocol v1.4) diff --git a/gen/adsense1d4-cli/src/main.rs b/gen/adsense1d4-cli/src/main.rs index 98d095b308..8726c4fac5 100644 --- a/gen/adsense1d4-cli/src/main.rs +++ b/gen/adsense1d4-cli/src/main.rs @@ -3564,7 +3564,7 @@ fn main() { let mut app = App::new("adsense1d4") .author("Sebastian Thiel ") - .version("1.0.12+20190703") + .version("1.0.13+20200407") .about("Accesses AdSense publishers' inventory and generates performance reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adsense1d4_cli") .arg(Arg::with_name("url") diff --git a/gen/adsense1d4/Cargo.toml b/gen/adsense1d4/Cargo.toml index d0c9acd084..5d531b2754 100644 --- a/gen/adsense1d4/Cargo.toml +++ b/gen/adsense1d4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsense1d4" -version = "1.0.12+20190703" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsense1d4" homepage = "https://developers.google.com/adsense/management/" -documentation = "https://docs.rs/google-adsense1d4/1.0.12+20190703" +documentation = "https://docs.rs/google-adsense1d4/1.0.13+20200407" license = "MIT" keywords = ["adsense", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/adsense1d4/README.md b/gen/adsense1d4/README.md index 145061ad7c..224354fc13 100644 --- a/gen/adsense1d4/README.md +++ b/gen/adsense1d4/README.md @@ -5,40 +5,40 @@ DO NOT EDIT ! --> The `google-adsense1d4` library allows access to all features of the *Google AdSense* service. -This documentation was generated from *AdSense* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *AdSense* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *AdSense* *v1d4* API can be found at the [official documentation site](https://developers.google.com/adsense/management/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AdSense.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AdSense.html) ... -* [accounts](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.Account.html) - * [*adclients get ad code*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAdclientGetAdCodeCall.html), [*adclients list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAdclientListCall.html), [*adunits customchannels list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAdunitCustomchannelListCall.html), [*adunits get*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAdunitGetAdCodeCall.html), [*adunits list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAdunitListCall.html), [*alerts delete*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAlertDeleteCall.html), [*alerts list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountAlertListCall.html), [*customchannels adunits list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountCustomchannelAdunitListCall.html), [*customchannels get*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountListCall.html), [*payments list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountPaymentListCall.html), [*reports generate*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountReportSavedListCall.html), [*savedadstyles get*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountSavedadstyleGetCall.html), [*savedadstyles list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountSavedadstyleListCall.html) and [*urlchannels list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountUrlchannelListCall.html) +* [accounts](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.Account.html) + * [*adclients get ad code*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAdclientGetAdCodeCall.html), [*adclients list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAdclientListCall.html), [*adunits customchannels list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAdunitCustomchannelListCall.html), [*adunits get*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAdunitGetAdCodeCall.html), [*adunits list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAdunitListCall.html), [*alerts delete*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAlertDeleteCall.html), [*alerts list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountAlertListCall.html), [*customchannels adunits list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountCustomchannelAdunitListCall.html), [*customchannels get*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountListCall.html), [*payments list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountPaymentListCall.html), [*reports generate*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountReportSavedListCall.html), [*savedadstyles get*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountSavedadstyleGetCall.html), [*savedadstyles list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountSavedadstyleListCall.html) and [*urlchannels list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountUrlchannelListCall.html) * adclients - * [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AdclientListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AdclientListCall.html) * adunits - * [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AdunitCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AdunitGetCall.html), [*get ad code*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AdunitGetAdCodeCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AdunitListCall.html) -* [alerts](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.Alert.html) - * [*delete*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AlertDeleteCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AlertListCall.html) + * [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AdunitCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AdunitGetCall.html), [*get ad code*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AdunitGetAdCodeCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AdunitListCall.html) +* [alerts](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.Alert.html) + * [*delete*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AlertDeleteCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AlertListCall.html) * customchannels - * [*adunits list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.CustomchannelAdunitListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.CustomchannelGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.CustomchannelListCall.html) -* [metadata](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.Metadata.html) - * [*dimensions list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.MetadataDimensionListCall.html) and [*metrics list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.MetadataMetricListCall.html) -* [payments](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.Payment.html) - * [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.PaymentListCall.html) + * [*adunits list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.CustomchannelAdunitListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.CustomchannelGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.CustomchannelListCall.html) +* [metadata](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.Metadata.html) + * [*dimensions list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.MetadataDimensionListCall.html) and [*metrics list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.MetadataMetricListCall.html) +* [payments](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.Payment.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.PaymentListCall.html) * reports - * [*generate*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.ReportGenerateCall.html), [*saved generate*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.ReportSavedGenerateCall.html) and [*saved list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.ReportSavedListCall.html) + * [*generate*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.ReportGenerateCall.html), [*saved generate*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.ReportSavedGenerateCall.html) and [*saved list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.ReportSavedListCall.html) * savedadstyles - * [*get*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.SavedadstyleGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.SavedadstyleListCall.html) + * [*get*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.SavedadstyleGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.SavedadstyleListCall.html) * urlchannels - * [*list*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.UrlchannelListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.UrlchannelListCall.html) Download supported by ... -* [*generate reports*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.ReportGenerateCall.html) -* [*reports generate accounts*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AccountReportGenerateCall.html) +* [*generate reports*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.ReportGenerateCall.html) +* [*reports generate accounts*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AccountReportGenerateCall.html) @@ -46,17 +46,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/struct.AdSense.html)** +* **[Hub](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/struct.AdSense.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -175,17 +175,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -195,29 +195,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adsense1d4/1.0.12+20190703/google_adsense1d4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsense1d4/1.0.13+20200407/google_adsense1d4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adsense1d4/src/lib.rs b/gen/adsense1d4/src/lib.rs index 188fc45cb0..54c4270d17 100644 --- a/gen/adsense1d4/src/lib.rs +++ b/gen/adsense1d4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *AdSense* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *AdSense* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/adsense/management/). @@ -381,7 +381,7 @@ impl<'a, C, A> AdSense AdSense { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/adsense/v1.4/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -419,7 +419,7 @@ impl<'a, C, A> AdSense } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/adsensehost4d1-cli/Cargo.toml b/gen/adsensehost4d1-cli/Cargo.toml index 13d2407037..bc2801a248 100644 --- a/gen/adsensehost4d1-cli/Cargo.toml +++ b/gen/adsensehost4d1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adsensehost4d1-cli" -version = "1.0.12+20190703" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense Host (protocol v4.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-adsensehost4d1] path = "../adsensehost4d1" -version = "1.0.12+20190703" +version = "1.0.13+20200407" diff --git a/gen/adsensehost4d1-cli/README.md b/gen/adsensehost4d1-cli/README.md index 0c526ab1f8..f0f1efed2e 100644 --- a/gen/adsensehost4d1-cli/README.md +++ b/gen/adsensehost4d1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *AdSense Host* API at revision *20190703*. The CLI is at version *1.0.12*. +This documentation was generated from the *AdSense Host* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash adsensehost4d1 [options] diff --git a/gen/adsensehost4d1-cli/mkdocs.yml b/gen/adsensehost4d1-cli/mkdocs.yml index dba969525e..ab11d37365 100644 --- a/gen/adsensehost4d1-cli/mkdocs.yml +++ b/gen/adsensehost4d1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense Host v1.0.12+20190703 +site_name: AdSense Host v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-adsensehost4d1-cli site_description: A complete library to interact with AdSense Host (protocol v4.1) diff --git a/gen/adsensehost4d1-cli/src/main.rs b/gen/adsensehost4d1-cli/src/main.rs index fb68d8db5a..08764bc0e4 100644 --- a/gen/adsensehost4d1-cli/src/main.rs +++ b/gen/adsensehost4d1-cli/src/main.rs @@ -1001,6 +1001,9 @@ impl<'n> Engine<'n> { "user-locale" => { call = call.user_locale(value.unwrap_or("")); }, + "callback-url" => { + call = call.callback_url(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1014,7 +1017,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["website-locale", "user-locale"].iter().map(|v|*v)); + v.extend(["website-locale", "user-locale", "callback-url"].iter().map(|v|*v)); v } )); } } @@ -2762,7 +2765,7 @@ fn main() { let mut app = App::new("adsensehost4d1") .author("Sebastian Thiel ") - .version("1.0.12+20190703") + .version("1.0.13+20200407") .about("Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adsensehost4d1_cli") .arg(Arg::with_name("url") diff --git a/gen/adsensehost4d1/Cargo.toml b/gen/adsensehost4d1/Cargo.toml index 503efc1841..e6f90ef644 100644 --- a/gen/adsensehost4d1/Cargo.toml +++ b/gen/adsensehost4d1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsensehost4d1" -version = "1.0.12+20190703" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with AdSense Host (protocol v4.1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adsensehost4d1" homepage = "https://developers.google.com/adsense/host/" -documentation = "https://docs.rs/google-adsensehost4d1/1.0.12+20190703" +documentation = "https://docs.rs/google-adsensehost4d1/1.0.13+20200407" license = "MIT" keywords = ["adsensehost", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/adsensehost4d1/README.md b/gen/adsensehost4d1/README.md index e4cd3fa55d..0f82a2f62f 100644 --- a/gen/adsensehost4d1/README.md +++ b/gen/adsensehost4d1/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-adsensehost4d1` library allows access to all features of the *Google AdSense Host* service. -This documentation was generated from *AdSense Host* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *AdSense Host* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *AdSense Host* *v4d1* API can be found at the [official documentation site](https://developers.google.com/adsense/host/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AdSenseHost.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AdSenseHost.html) ... -* [accounts](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.Account.html) - * [*adclients get*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdclientGetCall.html), [*adclients list*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdclientListCall.html), [*adunits delete*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdunitDeleteCall.html), [*adunits get*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdunitGetAdCodeCall.html), [*adunits insert*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdunitInsertCall.html), [*adunits list*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdunitListCall.html), [*adunits patch*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdunitPatchCall.html), [*adunits update*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountAdunitUpdateCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountListCall.html) and [*reports generate*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AccountReportGenerateCall.html) +* [accounts](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.Account.html) + * [*adclients get*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdclientGetCall.html), [*adclients list*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdclientListCall.html), [*adunits delete*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdunitDeleteCall.html), [*adunits get*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdunitGetAdCodeCall.html), [*adunits insert*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdunitInsertCall.html), [*adunits list*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdunitListCall.html), [*adunits patch*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdunitPatchCall.html), [*adunits update*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountAdunitUpdateCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountListCall.html) and [*reports generate*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AccountReportGenerateCall.html) * adclients - * [*get*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AdclientGetCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AdclientListCall.html) + * [*get*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AdclientGetCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AdclientListCall.html) * associationsessions - * [*start*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AssociationsessionStartCall.html) and [*verify*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AssociationsessionVerifyCall.html) + * [*start*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AssociationsessionStartCall.html) and [*verify*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AssociationsessionVerifyCall.html) * customchannels - * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.CustomchannelDeleteCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.CustomchannelGetCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.CustomchannelInsertCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.CustomchannelListCall.html), [*patch*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.CustomchannelPatchCall.html) and [*update*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.CustomchannelUpdateCall.html) -* [reports](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.Report.html) - * [*generate*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.ReportGenerateCall.html) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.CustomchannelDeleteCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.CustomchannelGetCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.CustomchannelInsertCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.CustomchannelListCall.html), [*patch*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.CustomchannelPatchCall.html) and [*update*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.CustomchannelUpdateCall.html) +* [reports](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.Report.html) + * [*generate*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.ReportGenerateCall.html) * urlchannels - * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.UrlchannelDeleteCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.UrlchannelInsertCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.UrlchannelListCall.html) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.UrlchannelDeleteCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.UrlchannelInsertCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.UrlchannelListCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/struct.AdSenseHost.html)** +* **[Hub](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/struct.AdSenseHost.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -152,17 +152,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -172,29 +172,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adsensehost4d1/1.0.12+20190703/google_adsensehost4d1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsensehost4d1/1.0.13+20200407/google_adsensehost4d1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adsensehost4d1/src/lib.rs b/gen/adsensehost4d1/src/lib.rs index 1ab4c1e2b4..09428a5a56 100644 --- a/gen/adsensehost4d1/src/lib.rs +++ b/gen/adsensehost4d1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AdSense Host* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *AdSense Host* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *AdSense Host* *v4d1* API can be found at the //! [official documentation site](https://developers.google.com/adsense/host/). @@ -352,7 +352,7 @@ impl<'a, C, A> AdSenseHost AdSenseHost { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/adsensehost/v4.1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -378,7 +378,7 @@ impl<'a, C, A> AdSenseHost } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -1162,6 +1162,7 @@ impl<'a, C, A> AssociationsessionMethods<'a, C, A> { _website_url: website_url.to_string(), _website_locale: Default::default(), _user_locale: Default::default(), + _callback_url: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3001,6 +3002,7 @@ impl<'a, C, A> AdclientGetCall<'a, C, A> where C: BorrowMut, A: o /// let result = hub.associationsessions().start("productCode", "websiteUrl") /// .website_locale("labore") /// .user_locale("eirmod") +/// .callback_url("dolore") /// .doit(); /// # } /// ``` @@ -3012,6 +3014,7 @@ pub struct AssociationsessionStartCall<'a, C, A> _website_url: String, _website_locale: Option, _user_locale: Option, + _callback_url: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3033,7 +3036,7 @@ impl<'a, C, A> AssociationsessionStartCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); if self._product_code.len() > 0 { for f in self._product_code.iter() { params.push(("productCode", f.to_string())); @@ -3046,7 +3049,10 @@ impl<'a, C, A> AssociationsessionStartCall<'a, C, A> where C: BorrowMut AssociationsessionStartCall<'a, C, A> where C: BorrowMut AssociationsessionStartCall<'a, C, A> { + self._callback_url = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3478,13 +3491,13 @@ impl<'a, C, A> AssociationsessionVerifyCall<'a, C, A> where C: BorrowMut ReportGenerateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().adunits_list("accountId", "adClientId") -/// .page_token("amet") -/// .max_results(78) +/// .page_token("et") +/// .max_results(56) /// .include_inactive(true) /// .doit(); /// # } @@ -4596,13 +4609,13 @@ impl<'a, C, A> AccountAdunitGetAdCodeCall<'a, C, A> where C: BorrowMut AccountAdunitDeleteCall<'a, C, A> where C: BorrowMut CustomchannelUpdateCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with AlertCenter (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/alertcenter1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-alertcenter1_beta1] path = "../alertcenter1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" diff --git a/gen/alertcenter1_beta1-cli/README.md b/gen/alertcenter1_beta1-cli/README.md index 2310778caa..4d5170abe8 100644 --- a/gen/alertcenter1_beta1-cli/README.md +++ b/gen/alertcenter1_beta1-cli/README.md @@ -25,15 +25,18 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *AlertCenter* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *AlertCenter* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash alertcenter1-beta1 [options] alerts + batch-delete (-r )... [-p ]... [-o ] + batch-undelete (-r )... [-p ]... [-o ] delete [-p ]... [-o ] feedback-create (-r )... [-p ]... [-o ] feedback-list [-p ]... [-o ] get [-p ]... [-o ] + get-metadata [-p ]... [-o ] list [-p ]... [-o ] undelete (-r )... [-p ]... [-o ] methods diff --git a/gen/alertcenter1_beta1-cli/mkdocs.yml b/gen/alertcenter1_beta1-cli/mkdocs.yml index 6bbfce4092..1ea234c360 100644 --- a/gen/alertcenter1_beta1-cli/mkdocs.yml +++ b/gen/alertcenter1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AlertCenter v1.0.12+20190628 +site_name: AlertCenter v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-alertcenter1_beta1-cli site_description: A complete library to interact with AlertCenter (protocol v1beta1) @@ -9,10 +9,13 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['alerts_batch-delete.md', 'Alerts', 'Batch Delete'] +- ['alerts_batch-undelete.md', 'Alerts', 'Batch Undelete'] - ['alerts_delete.md', 'Alerts', 'Delete'] - ['alerts_feedback-create.md', 'Alerts', 'Feedback Create'] - ['alerts_feedback-list.md', 'Alerts', 'Feedback List'] - ['alerts_get.md', 'Alerts', 'Get'] +- ['alerts_get-metadata.md', 'Alerts', 'Get Metadata'] - ['alerts_list.md', 'Alerts', 'List'] - ['alerts_undelete.md', 'Alerts', 'Undelete'] - ['methods_get-settings.md', 'Methods', 'Get Settings'] diff --git a/gen/alertcenter1_beta1-cli/src/main.rs b/gen/alertcenter1_beta1-cli/src/main.rs index 1475c9ea9d..05ed87b2bb 100644 --- a/gen/alertcenter1_beta1-cli/src/main.rs +++ b/gen/alertcenter1_beta1-cli/src/main.rs @@ -46,6 +46,178 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _alerts_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "alert-id" => Some(("alertId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alert-id", "customer-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchDeleteAlertsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.alerts().batch_delete(request); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _alerts_batch_undelete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "alert-id" => Some(("alertId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alert-id", "customer-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchUndeleteAlertsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.alerts().batch_undelete(request); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _alerts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.alerts().delete(opt.value_of("alert-id").unwrap_or("")); @@ -311,6 +483,62 @@ impl<'n> Engine<'n> { } } + fn _alerts_get_metadata(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.alerts().get_metadata(opt.value_of("alert-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "customer-id" => { + call = call.customer_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["customer-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _alerts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.alerts().list(); @@ -615,6 +843,12 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("alerts", Some(opt)) => { match opt.subcommand() { + ("batch-delete", Some(opt)) => { + call_result = self._alerts_batch_delete(opt, dry_run, &mut err); + }, + ("batch-undelete", Some(opt)) => { + call_result = self._alerts_batch_undelete(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._alerts_delete(opt, dry_run, &mut err); }, @@ -627,6 +861,9 @@ impl<'n> Engine<'n> { ("get", Some(opt)) => { call_result = self._alerts_get(opt, dry_run, &mut err); }, + ("get-metadata", Some(opt)) => { + call_result = self._alerts_get_metadata(opt, dry_run, &mut err); + }, ("list", Some(opt)) => { call_result = self._alerts_list(opt, dry_run, &mut err); }, @@ -738,7 +975,51 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("alerts", "methods: 'delete', 'feedback-create', 'feedback-list', 'get', 'list' and 'undelete'", vec![ + ("alerts", "methods: 'batch-delete', 'batch-undelete', 'delete', 'feedback-create', 'feedback-list', 'get', 'get-metadata', 'list' and 'undelete'", vec![ + ("batch-delete", + Some(r##"Performs batch delete operation on alerts."##), + "Details at http://byron.github.io/google-apis-rs/google_alertcenter1_beta1_cli/alerts_batch-delete", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("batch-undelete", + Some(r##"Performs batch undelete operation on alerts."##), + "Details at http://byron.github.io/google-apis-rs/google_alertcenter1_beta1_cli/alerts_batch-undelete", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("delete", Some(r##"Marks the specified alert for deletion. An alert that has been marked for deletion is removed from Alert Center after 30 days. @@ -767,7 +1048,9 @@ fn main() { ]), ("feedback-create", Some(r##"Creates new feedback for an alert. Attempting to create a feedback for - a non-existent alert returns `NOT_FOUND` error."##), + a non-existent alert returns `NOT_FOUND` error. Attempting to create a + feedback for an alert that is marked for deletion returns + `FAILED_PRECONDITION' error."##), "Details at http://byron.github.io/google-apis-rs/google_alertcenter1_beta1_cli/alerts_feedback-create", vec![ (Some(r##"alert-id"##), @@ -835,6 +1118,29 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-metadata", + Some(r##"Returns the metadata of an alert. Attempting to get metadata for + a non-existent alert returns `NOT_FOUND` error."##), + "Details at http://byron.github.io/google-apis-rs/google_alertcenter1_beta1_cli/alerts_get-metadata", + vec![ + (Some(r##"alert-id"##), + None, + Some(r##"Required. The identifier of the alert this metadata belongs to."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -936,7 +1242,7 @@ fn main() { let mut app = App::new("alertcenter1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200406") .about("Manages alerts on issues affecting your domain.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_alertcenter1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/alertcenter1_beta1/Cargo.toml b/gen/alertcenter1_beta1/Cargo.toml index 6945aaa93d..e671754d73 100644 --- a/gen/alertcenter1_beta1/Cargo.toml +++ b/gen/alertcenter1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-alertcenter1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with AlertCenter (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/alertcenter1_beta1" homepage = "https://developers.google.com/admin-sdk/alertcenter/" -documentation = "https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628" +documentation = "https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406" license = "MIT" keywords = ["alertcenter", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/alertcenter1_beta1/README.md b/gen/alertcenter1_beta1/README.md index 24f689138e..f238a5735b 100644 --- a/gen/alertcenter1_beta1/README.md +++ b/gen/alertcenter1_beta1/README.md @@ -5,21 +5,21 @@ DO NOT EDIT ! --> The `google-alertcenter1_beta1` library allows access to all features of the *Google AlertCenter* service. -This documentation was generated from *AlertCenter* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *alertcenter:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *AlertCenter* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *alertcenter:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *AlertCenter* *v1_beta1* API can be found at the [official documentation site](https://developers.google.com/admin-sdk/alertcenter/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertCenter.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertCenter.html) ... -* [alerts](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.Alert.html) - * [*delete*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertDeleteCall.html), [*feedback create*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertFeedbackCreateCall.html), [*feedback list*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertFeedbackListCall.html), [*get*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertGetCall.html), [*list*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertListCall.html) and [*undelete*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertUndeleteCall.html) +* [alerts](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.Alert.html) + * [*batch delete*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertBatchDeleteCall.html), [*batch undelete*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertBatchUndeleteCall.html), [*delete*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertDeleteCall.html), [*feedback create*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertFeedbackCreateCall.html), [*feedback list*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertFeedbackListCall.html), [*get*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertGetCall.html), [*get metadata*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertGetMetadataCall.html), [*list*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertListCall.html) and [*undelete*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertUndeleteCall.html) Other activities are ... -* [get settings](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.MethodGetSettingCall.html) -* [update settings](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.MethodUpdateSettingCall.html) +* [get settings](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.MethodGetSettingCall.html) +* [update settings](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.MethodUpdateSettingCall.html) @@ -27,17 +27,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/struct.AlertCenter.html)** +* **[Hub](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/struct.AlertCenter.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -52,9 +52,12 @@ Or specifically ... ```ignore let r = hub.alerts().delete(...).doit() +let r = hub.alerts().batch_undelete(...).doit() let r = hub.alerts().undelete(...).doit() let r = hub.alerts().get(...).doit() +let r = hub.alerts().batch_delete(...).doit() let r = hub.alerts().list(...).doit() +let r = hub.alerts().get_metadata(...).doit() let r = hub.alerts().feedback_list(...).doit() let r = hub.alerts().feedback_create(...).doit() ``` @@ -138,17 +141,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +161,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-alertcenter1_beta1/1.0.12+20190628/google_alertcenter1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-alertcenter1_beta1/1.0.13+20200406/google_alertcenter1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/alertcenter1_beta1/src/lib.rs b/gen/alertcenter1_beta1/src/lib.rs index 1733a48f1c..13d32966a9 100644 --- a/gen/alertcenter1_beta1/src/lib.rs +++ b/gen/alertcenter1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AlertCenter* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *alertcenter:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *AlertCenter* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *alertcenter:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *AlertCenter* *v1_beta1* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/alertcenter/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.AlertCenter.html) ... //! //! * [alerts](struct.Alert.html) -//! * [*delete*](struct.AlertDeleteCall.html), [*feedback create*](struct.AlertFeedbackCreateCall.html), [*feedback list*](struct.AlertFeedbackListCall.html), [*get*](struct.AlertGetCall.html), [*list*](struct.AlertListCall.html) and [*undelete*](struct.AlertUndeleteCall.html) +//! * [*batch delete*](struct.AlertBatchDeleteCall.html), [*batch undelete*](struct.AlertBatchUndeleteCall.html), [*delete*](struct.AlertDeleteCall.html), [*feedback create*](struct.AlertFeedbackCreateCall.html), [*feedback list*](struct.AlertFeedbackListCall.html), [*get*](struct.AlertGetCall.html), [*get metadata*](struct.AlertGetMetadataCall.html), [*list*](struct.AlertListCall.html) and [*undelete*](struct.AlertUndeleteCall.html) //! //! Other activities are ... //! @@ -52,9 +52,12 @@ //! //! ```ignore //! let r = hub.alerts().delete(...).doit() +//! let r = hub.alerts().batch_undelete(...).doit() //! let r = hub.alerts().undelete(...).doit() //! let r = hub.alerts().get(...).doit() +//! let r = hub.alerts().batch_delete(...).doit() //! let r = hub.alerts().list(...).doit() +//! let r = hub.alerts().get_metadata(...).doit() //! let r = hub.alerts().feedback_list(...).doit() //! let r = hub.alerts().feedback_create(...).doit() //! ``` @@ -336,7 +339,7 @@ impl<'a, C, A> AlertCenter AlertCenter { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://alertcenter.googleapis.com/".to_string(), _root_url: "https://alertcenter.googleapis.com/".to_string(), } @@ -350,7 +353,7 @@ impl<'a, C, A> AlertCenter } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -441,40 +444,6 @@ pub struct Notification { impl Part for Notification {} -/// A customer feedback about an alert. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [feedback create alerts](struct.AlertFeedbackCreateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AlertFeedback { - /// Output only. The unique identifier for the feedback. - #[serde(rename="feedbackId")] - pub feedback_id: Option, - /// Output only. The alert identifier. - #[serde(rename="alertId")] - pub alert_id: Option, - /// Output only. The unique identifier of the Google account of the customer. - #[serde(rename="customerId")] - pub customer_id: Option, - /// Required. The type of the feedback. - #[serde(rename="type")] - pub type_: Option, - /// Output only. The time this feedback was created. - #[serde(rename="createTime")] - pub create_time: Option, - /// Output only. The email of the user that provided the feedback. - pub email: Option, -} - -impl RequestValue for AlertFeedback {} -impl ResponseResult for AlertFeedback {} - - /// Response message for an alert feedback listing request. /// /// # Activities @@ -494,6 +463,61 @@ pub struct ListAlertFeedbackResponse { impl ResponseResult for ListAlertFeedbackResponse {} +/// An alert metadata. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get metadata alerts](struct.AlertGetMetadataCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AlertMetadata { + /// The current status of the alert. + /// The supported values are the following: + /// + /// * NOT_STARTED + /// * IN_PROGRESS + /// * CLOSED + pub status: Option, + /// The email address of the user assigned to the alert. + pub assignee: Option, + /// Output only. The time this metadata was last updated. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Optional. `etag` is used for optimistic concurrency control as a way to + /// help prevent simultaneous updates of an alert metadata from overwriting + /// each other. It is strongly suggested that systems make use of the `etag` in + /// the read-modify-write cycle to perform metatdata updates in order to avoid + /// race conditions: An `etag` is returned in the response which contains alert + /// metadata, and systems are expected to put that etag in the request to + /// update alert metadata to ensure that their change will be applied to the + /// same version of the alert metadata. + /// + /// If no `etag` is provided in the call to update alert metadata, then the + /// existing alert metadata is overwritten blindly. + pub etag: Option, + /// The severity value of the alert. Alert Center will set this field at alert + /// creation time, default's to an empty string when it could not be + /// determined. + /// The supported values for update actions on this field are the following: + /// + /// * HIGH + /// * MEDIUM + /// * LOW + pub severity: Option, + /// Output only. The alert identifier. + #[serde(rename="alertId")] + pub alert_id: Option, + /// Output only. The unique identifier of the Google account of the customer. + #[serde(rename="customerId")] + pub customer_id: Option, +} + +impl ResponseResult for AlertMetadata {} + + /// A generic empty message that you can re-use to avoid defining duplicated /// empty messages in your APIs. A typical example is to use it as the request /// or the response type of an API method. For instance: @@ -518,6 +542,54 @@ pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. It is +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. +/// +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// Response to batch delete operation on alerts. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch delete alerts](struct.AlertBatchDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchDeleteAlertsResponse { + /// The status details for each failed alert_id. + #[serde(rename="failedAlertStatus")] + pub failed_alert_status: Option>, + /// The successful list of alert IDs. + #[serde(rename="successAlertIds")] + pub success_alert_ids: Option>, +} + +impl ResponseResult for BatchDeleteAlertsResponse {} + + /// Customer-level settings. /// /// # Activities @@ -546,9 +618,12 @@ impl ResponseResult for Settings {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [delete alerts](struct.AlertDeleteCall.html) (none) +/// * [batch undelete alerts](struct.AlertBatchUndeleteCall.html) (none) /// * [undelete alerts](struct.AlertUndeleteCall.html) (response) /// * [get alerts](struct.AlertGetCall.html) (response) +/// * [batch delete alerts](struct.AlertBatchDeleteCall.html) (none) /// * [list alerts](struct.AlertListCall.html) (none) +/// * [get metadata alerts](struct.AlertGetMetadataCall.html) (none) /// * [feedback list alerts](struct.AlertFeedbackListCall.html) (none) /// * [feedback create alerts](struct.AlertFeedbackCreateCall.html) (none) /// @@ -565,6 +640,8 @@ pub struct Alert { /// Optional. The data associated with this alert, for example /// google.apps.alertcenter.type.DeviceCompromised. pub data: Option>, + /// Output only. The metadata associated with this alert. + pub metadata: Option, /// Output only. The time this alert was created. #[serde(rename="createTime")] pub create_time: Option, @@ -577,9 +654,20 @@ pub struct Alert { /// * Mobile device management /// * Gmail phishing /// * Domain wide takeout - /// * Government attack warning + /// * State sponsored attack /// * Google identity pub source: Option, + /// Optional. `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of an alert from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform alert updates in order to avoid race + /// conditions: An `etag` is returned in the response which contains alerts, + /// and systems are expected to put that etag in the request to update alert to + /// ensure that their change will be applied to the same version of the alert. + /// + /// If no `etag` is provided in the call to update alert, then the existing + /// alert is overwritten blindly. + pub etag: Option, /// Required. The time the event that caused this alert was started or /// detected. #[serde(rename="startTime")] @@ -630,6 +718,108 @@ pub struct UndeleteAlertRequest { impl RequestValue for UndeleteAlertRequest {} +/// A customer feedback about an alert. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [feedback create alerts](struct.AlertFeedbackCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AlertFeedback { + /// Output only. The unique identifier for the feedback. + #[serde(rename="feedbackId")] + pub feedback_id: Option, + /// Output only. The alert identifier. + #[serde(rename="alertId")] + pub alert_id: Option, + /// Output only. The unique identifier of the Google account of the customer. + #[serde(rename="customerId")] + pub customer_id: Option, + /// Required. The type of the feedback. + #[serde(rename="type")] + pub type_: Option, + /// Output only. The time this feedback was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The email of the user that provided the feedback. + pub email: Option, +} + +impl RequestValue for AlertFeedback {} +impl ResponseResult for AlertFeedback {} + + +/// A request to perform batch delete on alerts. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch delete alerts](struct.AlertBatchDeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchDeleteAlertsRequest { + /// Optional. The unique identifier of the G Suite organization account of the + /// customer the alerts are associated with. + #[serde(rename="customerId")] + pub customer_id: Option, + /// Required. list of alert IDs. + #[serde(rename="alertId")] + pub alert_id: Option>, +} + +impl RequestValue for BatchDeleteAlertsRequest {} + + +/// Response to batch undelete operation on alerts. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch undelete alerts](struct.AlertBatchUndeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUndeleteAlertsResponse { + /// The status details for each failed alert_id. + #[serde(rename="failedAlertStatus")] + pub failed_alert_status: Option>, + /// The successful list of alert IDs. + #[serde(rename="successAlertIds")] + pub success_alert_ids: Option>, +} + +impl ResponseResult for BatchUndeleteAlertsResponse {} + + +/// A request to perform batch undelete on alerts. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch undelete alerts](struct.AlertBatchUndeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchUndeleteAlertsRequest { + /// Optional. The unique identifier of the G Suite organization account of the + /// customer the alerts are associated with. + #[serde(rename="customerId")] + pub customer_id: Option, + /// Required. list of alert IDs. + #[serde(rename="alertId")] + pub alert_id: Option>, +} + +impl RequestValue for BatchUndeleteAlertsRequest {} + + // ################### // MethodBuilders ### @@ -659,7 +849,7 @@ impl RequestValue for UndeleteAlertRequest {} /// ::default(), None); /// let mut hub = AlertCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `feedback_create(...)`, `feedback_list(...)`, `get(...)`, `list(...)` and `undelete(...)` +/// // like `batch_delete(...)`, `batch_undelete(...)`, `delete(...)`, `feedback_create(...)`, `feedback_list(...)`, `get(...)`, `get_metadata(...)`, `list(...)` and `undelete(...)` /// // to build up your call. /// let rb = hub.alerts(); /// # } @@ -696,6 +886,23 @@ impl<'a, C, A> AlertMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Performs batch undelete operation on alerts. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn batch_undelete(&self, request: BatchUndeleteAlertsRequest) -> AlertBatchUndeleteCall<'a, C, A> { + AlertBatchUndeleteCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Restores, or "undeletes", an alert that was marked for deletion within the @@ -738,6 +945,23 @@ impl<'a, C, A> AlertMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Performs batch delete operation on alerts. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn batch_delete(&self, request: BatchDeleteAlertsRequest) -> AlertBatchDeleteCall<'a, C, A> { + AlertBatchDeleteCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists the alerts. @@ -755,6 +979,25 @@ impl<'a, C, A> AlertMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns the metadata of an alert. Attempting to get metadata for + /// a non-existent alert returns `NOT_FOUND` error. + /// + /// # Arguments + /// + /// * `alertId` - Required. The identifier of the alert this metadata belongs to. + pub fn get_metadata(&self, alert_id: &str) -> AlertGetMetadataCall<'a, C, A> { + AlertGetMetadataCall { + hub: self.hub, + _alert_id: alert_id.to_string(), + _customer_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists all the feedback for an alert. Attempting to list feedbacks for @@ -779,7 +1022,9 @@ impl<'a, C, A> AlertMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Creates new feedback for an alert. Attempting to create a feedback for - /// a non-existent alert returns `NOT_FOUND` error. + /// a non-existent alert returns `NOT_FOUND` error. Attempting to create a + /// feedback for an alert that is marked for deletion returns + /// `FAILED_PRECONDITION' error. /// /// # Arguments /// @@ -841,15 +1086,10 @@ impl<'a, C, A> MethodMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the customer-level settings. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn update_settings(&self, request: Settings) -> MethodUpdateSettingCall<'a, C, A> { - MethodUpdateSettingCall { + /// Returns customer-level settings. + pub fn get_settings(&self) -> MethodGetSettingCall<'a, C, A> { + MethodGetSettingCall { hub: self.hub, - _request: request, _customer_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -859,10 +1099,15 @@ impl<'a, C, A> MethodMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns customer-level settings. - pub fn get_settings(&self) -> MethodGetSettingCall<'a, C, A> { - MethodGetSettingCall { + /// Updates the customer-level settings. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn update_settings(&self, request: Settings) -> MethodUpdateSettingCall<'a, C, A> { + MethodUpdateSettingCall { hub: self.hub, + _request: request, _customer_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1141,6 +1386,248 @@ impl<'a, C, A> AlertDeleteCall<'a, C, A> where C: BorrowMut, A: o } +/// Performs batch undelete operation on alerts. +/// +/// A builder for the *batchUndelete* method supported by a *alert* resource. +/// It is not used directly, but through a `AlertMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_alertcenter1_beta1 as alertcenter1_beta1; +/// use alertcenter1_beta1::BatchUndeleteAlertsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use alertcenter1_beta1::AlertCenter; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AlertCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BatchUndeleteAlertsRequest::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.alerts().batch_undelete(req) +/// .doit(); +/// # } +/// ``` +pub struct AlertBatchUndeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AlertCenter, + _request: BatchUndeleteAlertsRequest, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AlertBatchUndeleteCall<'a, C, A> {} + +impl<'a, C, A> AlertBatchUndeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchUndeleteAlertsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "alertcenter.alerts.batchUndelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/alerts:batchUndelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::AppAlert.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BatchUndeleteAlertsRequest) -> AlertBatchUndeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AlertBatchUndeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AlertBatchUndeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::AppAlert`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AlertBatchUndeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Restores, or "undeletes", an alert that was marked for deletion within the /// past 30 days. Attempting to undelete an alert which was marked for deletion /// over 30 days ago (which has been removed from the Alert Center database) or @@ -1679,6 +2166,248 @@ impl<'a, C, A> AlertGetCall<'a, C, A> where C: BorrowMut, A: oaut } +/// Performs batch delete operation on alerts. +/// +/// A builder for the *batchDelete* method supported by a *alert* resource. +/// It is not used directly, but through a `AlertMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_alertcenter1_beta1 as alertcenter1_beta1; +/// use alertcenter1_beta1::BatchDeleteAlertsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use alertcenter1_beta1::AlertCenter; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AlertCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BatchDeleteAlertsRequest::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.alerts().batch_delete(req) +/// .doit(); +/// # } +/// ``` +pub struct AlertBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AlertCenter, + _request: BatchDeleteAlertsRequest, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AlertBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> AlertBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchDeleteAlertsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "alertcenter.alerts.batchDelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/alerts:batchDelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::AppAlert.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BatchDeleteAlertsRequest) -> AlertBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AlertBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AlertBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::AppAlert`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AlertBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the alerts. /// /// A builder for the *list* method supported by a *alert* resource. @@ -1965,6 +2694,265 @@ impl<'a, C, A> AlertListCall<'a, C, A> where C: BorrowMut, A: oau } +/// Returns the metadata of an alert. Attempting to get metadata for +/// a non-existent alert returns `NOT_FOUND` error. +/// +/// A builder for the *getMetadata* method supported by a *alert* resource. +/// It is not used directly, but through a `AlertMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_alertcenter1_beta1 as alertcenter1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use alertcenter1_beta1::AlertCenter; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AlertCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.alerts().get_metadata("alertId") +/// .customer_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct AlertGetMetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AlertCenter, + _alert_id: String, + _customer_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AlertGetMetadataCall<'a, C, A> {} + +impl<'a, C, A> AlertGetMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AlertMetadata)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "alertcenter.alerts.getMetadata", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("alertId", self._alert_id.to_string())); + if let Some(value) = self._customer_id { + params.push(("customerId", value.to_string())); + } + for &field in ["alt", "alertId", "customerId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/alerts/{alertId}/metadata"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::AppAlert.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{alertId}", "alertId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["alertId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The identifier of the alert this metadata belongs to. + /// + /// Sets the *alert id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn alert_id(mut self, new_value: &str) -> AlertGetMetadataCall<'a, C, A> { + self._alert_id = new_value.to_string(); + self + } + /// Optional. The unique identifier of the G Suite organization account of the + /// customer the alert metadata is associated with. + /// Inferred from the caller identity if not provided. + /// + /// Sets the *customer id* query property to the given value. + pub fn customer_id(mut self, new_value: &str) -> AlertGetMetadataCall<'a, C, A> { + self._customer_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AlertGetMetadataCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> AlertGetMetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::AppAlert`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AlertGetMetadataCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists all the feedback for an alert. Attempting to list feedbacks for /// a non-existent alert returns `NOT_FOUND` error. /// @@ -1994,8 +2982,8 @@ impl<'a, C, A> AlertListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.alerts().feedback_list("alertId") -/// .filter("ipsum") -/// .customer_id("Lorem") +/// .filter("et") +/// .customer_id("duo") /// .doit(); /// # } /// ``` @@ -2242,7 +3230,9 @@ impl<'a, C, A> AlertFeedbackListCall<'a, C, A> where C: BorrowMut /// Creates new feedback for an alert. Attempting to create a feedback for -/// a non-existent alert returns `NOT_FOUND` error. +/// a non-existent alert returns `NOT_FOUND` error. Attempting to create a +/// feedback for an alert that is marked for deletion returns +/// `FAILED_PRECONDITION' error. /// /// A builder for the *feedback.create* method supported by a *alert* resource. /// It is not used directly, but through a `AlertMethods` instance. @@ -2276,7 +3266,7 @@ impl<'a, C, A> AlertFeedbackListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.alerts().feedback_create(req, "alertId") -/// .customer_id("duo") +/// .customer_id("sea") /// .doit(); /// # } /// ``` @@ -2531,6 +3521,231 @@ impl<'a, C, A> AlertFeedbackCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AlertCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.methods().get_settings() +/// .customer_id("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct MethodGetSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AlertCenter, + _customer_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MethodGetSettingCall<'a, C, A> {} + +impl<'a, C, A> MethodGetSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Settings)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "alertcenter.getSettings", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + if let Some(value) = self._customer_id { + params.push(("customerId", value.to_string())); + } + for &field in ["alt", "customerId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/settings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::AppAlert.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Optional. The unique identifier of the G Suite organization account of the + /// customer the alert settings are associated with. + /// Inferred from the caller identity if not provided. + /// + /// Sets the *customer id* query property to the given value. + pub fn customer_id(mut self, new_value: &str) -> MethodGetSettingCall<'a, C, A> { + self._customer_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MethodGetSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodGetSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::AppAlert`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MethodGetSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the customer-level settings. /// /// A builder for the *updateSettings* method. @@ -2565,7 +3780,7 @@ impl<'a, C, A> AlertFeedbackCreateCall<'a, C, A> where C: BorrowMut MethodUpdateSettingCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AlertCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.methods().get_settings() -/// .customer_id("sea") -/// .doit(); -/// # } -/// ``` -pub struct MethodGetSettingCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AlertCenter, - _customer_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for MethodGetSettingCall<'a, C, A> {} - -impl<'a, C, A> MethodGetSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Settings)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "alertcenter.getSettings", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - if let Some(value) = self._customer_id { - params.push(("customerId", value.to_string())); - } - for &field in ["alt", "customerId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/settings"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::AppAlert.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Optional. The unique identifier of the G Suite organization account of the - /// customer the alert settings are associated with. - /// Inferred from the caller identity if not provided. - /// - /// Sets the *customer id* query property to the given value. - pub fn customer_id(mut self, new_value: &str) -> MethodGetSettingCall<'a, C, A> { - self._customer_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MethodGetSettingCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> MethodGetSettingCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::AppAlert`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> MethodGetSettingCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - diff --git a/gen/analytics3-cli/Cargo.toml b/gen/analytics3-cli/Cargo.toml index e5aa0ebff7..fe324ef0e9 100644 --- a/gen/analytics3-cli/Cargo.toml +++ b/gen/analytics3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analytics3-cli" -version = "1.0.12+20190604" +version = "1.0.13+20190807" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-analytics3] path = "../analytics3" -version = "1.0.12+20190604" +version = "1.0.13+20190807" diff --git a/gen/analytics3-cli/README.md b/gen/analytics3-cli/README.md index 477a13bf26..e8cebac0cd 100644 --- a/gen/analytics3-cli/README.md +++ b/gen/analytics3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *analytics* API at revision *20190604*. The CLI is at version *1.0.12*. +This documentation was generated from the *analytics* API at revision *20190807*. The CLI is at version *1.0.13*. ```bash analytics3 [options] diff --git a/gen/analytics3-cli/mkdocs.yml b/gen/analytics3-cli/mkdocs.yml index 333b76368b..0b8079298f 100644 --- a/gen/analytics3-cli/mkdocs.yml +++ b/gen/analytics3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: analytics v1.0.12+20190604 +site_name: analytics v1.0.13+20190807 site_url: http://byron.github.io/google-apis-rs/google-analytics3-cli site_description: A complete library to interact with analytics (protocol v3) diff --git a/gen/analytics3-cli/src/main.rs b/gen/analytics3-cli/src/main.rs index 301dcef3a9..6eeb2bdc17 100644 --- a/gen/analytics3-cli/src/main.rs +++ b/gen/analytics3-cli/src/main.rs @@ -6955,14 +6955,15 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "deletion-request-time" => Some(("deletionRequestTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deletion-request-time" => Some(("deletionRequestTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "web-property-id" => Some(("webPropertyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "firebase-project-id" => Some(("firebaseProjectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id.user-id" => Some(("id.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id.type" => Some(("id.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "web-property-id" => Some(("webPropertyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "property-id" => Some(("propertyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["deletion-request-time", "firebase-project-id", "id", "kind", "type", "user-id", "web-property-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["deletion-request-time", "firebase-project-id", "id", "kind", "property-id", "type", "user-id", "web-property-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -10383,7 +10384,7 @@ fn main() { let mut app = App::new("analytics3") .author("Sebastian Thiel ") - .version("1.0.12+20190604") + .version("1.0.13+20190807") .about("Views and manages your Google Analytics data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_analytics3_cli") .arg(Arg::with_name("url") diff --git a/gen/analytics3/Cargo.toml b/gen/analytics3/Cargo.toml index e5d8e49f76..7fd5e293b9 100644 --- a/gen/analytics3/Cargo.toml +++ b/gen/analytics3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-analytics3" -version = "1.0.12+20190604" +version = "1.0.13+20190807" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3" homepage = "https://developers.google.com/analytics/" -documentation = "https://docs.rs/google-analytics3/1.0.12+20190604" +documentation = "https://docs.rs/google-analytics3/1.0.13+20190807" license = "MIT" keywords = ["analytics", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/analytics3/README.md b/gen/analytics3/README.md index 2a7522c87c..5eb4bc4e3a 100644 --- a/gen/analytics3/README.md +++ b/gen/analytics3/README.md @@ -5,29 +5,29 @@ DO NOT EDIT ! --> The `google-analytics3` library allows access to all features of the *Google analytics* service. -This documentation was generated from *analytics* crate version *1.0.12+20190604*, where *20190604* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *analytics* crate version *1.0.13+20190807*, where *20190807* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *analytics* *v3* API can be found at the [official documentation site](https://developers.google.com/analytics/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.Analytics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.Analytics.html) ... * data - * [*ga get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.DataGaGetCall.html), [*mcf get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.DataMcfGetCall.html) and [*realtime get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.DataRealtimeGetCall.html) + * [*ga get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.DataGaGetCall.html), [*mcf get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.DataMcfGetCall.html) and [*realtime get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.DataRealtimeGetCall.html) * management - * [*account summaries list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementAccountSummaryListCall.html), [*account user links delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementAccountUserLinkListCall.html), [*account user links update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementAccountListCall.html), [*client id hash client id*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementClientIdHashClientIdCall.html), [*custom data sources list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementExperimentDeleteCall.html), [*experiments get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementExperimentGetCall.html), [*experiments insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementExperimentInsertCall.html), [*experiments list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementExperimentListCall.html), [*experiments patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementExperimentPatchCall.html), [*experiments update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementExperimentUpdateCall.html), [*filters delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementFilterDeleteCall.html), [*filters get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementFilterGetCall.html), [*filters insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementFilterInsertCall.html), [*filters list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementFilterListCall.html), [*filters patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementFilterPatchCall.html), [*filters update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementFilterUpdateCall.html), [*goals get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementGoalGetCall.html), [*goals insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementGoalInsertCall.html), [*goals list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementGoalListCall.html), [*goals patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementGoalPatchCall.html), [*goals update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileDeleteCall.html), [*profiles get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileGetCall.html), [*profiles insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileInsertCall.html), [*profiles list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileListCall.html), [*profiles patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfilePatchCall.html), [*profiles update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementProfileUpdateCall.html), [*remarketing audience delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementRemarketingAudienceDeleteCall.html), [*remarketing audience get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementSegmentListCall.html), [*unsampled reports delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUploadGetCall.html), [*uploads list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUploadListCall.html), [*uploads upload data*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyListCall.html), [*webproperties patch*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementWebpropertyUserLinkUpdateCall.html) + * [*account summaries list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementAccountSummaryListCall.html), [*account user links delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementAccountUserLinkListCall.html), [*account user links update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementAccountListCall.html), [*client id hash client id*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementClientIdHashClientIdCall.html), [*custom data sources list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementExperimentDeleteCall.html), [*experiments get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementExperimentGetCall.html), [*experiments insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementExperimentInsertCall.html), [*experiments list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementExperimentListCall.html), [*experiments patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementExperimentPatchCall.html), [*experiments update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementExperimentUpdateCall.html), [*filters delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementFilterDeleteCall.html), [*filters get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementFilterGetCall.html), [*filters insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementFilterInsertCall.html), [*filters list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementFilterListCall.html), [*filters patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementFilterPatchCall.html), [*filters update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementFilterUpdateCall.html), [*goals get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementGoalGetCall.html), [*goals insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementGoalInsertCall.html), [*goals list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementGoalListCall.html), [*goals patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementGoalPatchCall.html), [*goals update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileDeleteCall.html), [*profiles get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileGetCall.html), [*profiles insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileInsertCall.html), [*profiles list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileListCall.html), [*profiles patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfilePatchCall.html), [*profiles update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementProfileUpdateCall.html), [*remarketing audience delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementRemarketingAudienceDeleteCall.html), [*remarketing audience get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementSegmentListCall.html), [*unsampled reports delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUploadGetCall.html), [*uploads list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUploadListCall.html), [*uploads upload data*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyListCall.html), [*webproperties patch*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementWebpropertyUserLinkUpdateCall.html) * metadata - * [*columns list*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.MetadataColumnListCall.html) + * [*columns list*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.MetadataColumnListCall.html) * provisioning - * [*create account ticket*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ProvisioningCreateAccountTicketCall.html) and [*create account tree*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ProvisioningCreateAccountTreeCall.html) + * [*create account ticket*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ProvisioningCreateAccountTicketCall.html) and [*create account tree*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ProvisioningCreateAccountTreeCall.html) * user deletion - * [*user deletion request upsert*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.UserDeletionUserDeletionRequestUpsertCall.html) + * [*user deletion request upsert*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.UserDeletionUserDeletionRequestUpsertCall.html) Upload supported by ... -* [*uploads upload data management*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.ManagementUploadUploadDataCall.html) +* [*uploads upload data management*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.ManagementUploadUploadDataCall.html) @@ -35,17 +35,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/struct.Analytics.html)** +* **[Hub](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/struct.Analytics.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.Part.html)** + * **[Parts](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -147,17 +147,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -167,29 +167,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-analytics3/1.0.12+20190604/google_analytics3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-analytics3/1.0.13+20190807/google_analytics3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/analytics3/src/lib.rs b/gen/analytics3/src/lib.rs index e265324b75..f39cf12855 100644 --- a/gen/analytics3/src/lib.rs +++ b/gen/analytics3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *analytics* crate version *1.0.12+20190604*, where *20190604* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *analytics* crate version *1.0.13+20190807*, where *20190807* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *analytics* *v3* API can be found at the //! [official documentation site](https://developers.google.com/analytics/). @@ -370,7 +370,7 @@ impl<'a, C, A> Analytics Analytics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/analytics/v3/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -393,7 +393,7 @@ impl<'a, C, A> Analytics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -2066,14 +2066,17 @@ pub struct UserDeletionRequest { pub deletion_request_time: Option, /// Value is "analytics#userDeletionRequest". pub kind: Option, + /// Web property ID of the form UA-XXXXX-YY. + #[serde(rename="webPropertyId")] + pub web_property_id: Option, /// Firebase Project Id #[serde(rename="firebaseProjectId")] pub firebase_project_id: Option, /// User ID. pub id: Option, - /// Web property ID of the form UA-XXXXX-YY. - #[serde(rename="webPropertyId")] - pub web_property_id: Option, + /// Property ID + #[serde(rename="propertyId")] + pub property_id: Option, } impl RequestValue for UserDeletionRequest {} diff --git a/gen/analyticsreporting4-cli/Cargo.toml b/gen/analyticsreporting4-cli/Cargo.toml index ac6f685340..29c9f00b92 100644 --- a/gen/analyticsreporting4-cli/Cargo.toml +++ b/gen/analyticsreporting4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-analyticsreporting4-cli" -version = "1.0.12+20190625" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with AnalyticsReporting (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analyticsreporting4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-analyticsreporting4] path = "../analyticsreporting4" -version = "1.0.12+20190625" +version = "1.0.13+20200405" diff --git a/gen/analyticsreporting4-cli/README.md b/gen/analyticsreporting4-cli/README.md index a1d87373dc..c324507af0 100644 --- a/gen/analyticsreporting4-cli/README.md +++ b/gen/analyticsreporting4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *AnalyticsReporting* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *AnalyticsReporting* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash analyticsreporting4 [options] diff --git a/gen/analyticsreporting4-cli/mkdocs.yml b/gen/analyticsreporting4-cli/mkdocs.yml index 1f16afc9f5..14971aab4a 100644 --- a/gen/analyticsreporting4-cli/mkdocs.yml +++ b/gen/analyticsreporting4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AnalyticsReporting v1.0.12+20190625 +site_name: AnalyticsReporting v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-analyticsreporting4-cli site_description: A complete library to interact with AnalyticsReporting (protocol v4) diff --git a/gen/analyticsreporting4-cli/src/main.rs b/gen/analyticsreporting4-cli/src/main.rs index 7dcb9b6764..e4bdb8d031 100644 --- a/gen/analyticsreporting4-cli/src/main.rs +++ b/gen/analyticsreporting4-cli/src/main.rs @@ -389,7 +389,7 @@ fn main() { let mut app = App::new("analyticsreporting4") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200405") .about("Accesses Analytics report data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_analyticsreporting4_cli") .arg(Arg::with_name("url") diff --git a/gen/analyticsreporting4/Cargo.toml b/gen/analyticsreporting4/Cargo.toml index be39ca5b32..d2a811ee99 100644 --- a/gen/analyticsreporting4/Cargo.toml +++ b/gen/analyticsreporting4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-analyticsreporting4" -version = "1.0.12+20190625" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with AnalyticsReporting (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analyticsreporting4" homepage = "https://developers.google.com/analytics/devguides/reporting/core/v4/" -documentation = "https://docs.rs/google-analyticsreporting4/1.0.12+20190625" +documentation = "https://docs.rs/google-analyticsreporting4/1.0.13+20200405" license = "MIT" keywords = ["analyticsreporting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/analyticsreporting4/README.md b/gen/analyticsreporting4/README.md index 1c6fa8158a..b25f486b88 100644 --- a/gen/analyticsreporting4/README.md +++ b/gen/analyticsreporting4/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-analyticsreporting4` library allows access to all features of the *Google AnalyticsReporting* service. -This documentation was generated from *AnalyticsReporting* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *analyticsreporting:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *AnalyticsReporting* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *analyticsreporting:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *AnalyticsReporting* *v4* API can be found at the [official documentation site](https://developers.google.com/analytics/devguides/reporting/core/v4/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/struct.AnalyticsReporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/struct.AnalyticsReporting.html) ... -* [reports](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/struct.Report.html) - * [*batch get*](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/struct.ReportBatchGetCall.html) +* [reports](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/struct.Report.html) + * [*batch get*](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/struct.ReportBatchGetCall.html) * user activity - * [*search*](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/struct.UserActivitySearchCall.html) + * [*search*](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/struct.UserActivitySearchCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/struct.AnalyticsReporting.html)** +* **[Hub](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/struct.AnalyticsReporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.Part.html)** + * **[Parts](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-analyticsreporting4/1.0.12+20190625/google_analyticsreporting4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-analyticsreporting4/1.0.13+20200405/google_analyticsreporting4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/analyticsreporting4/src/lib.rs b/gen/analyticsreporting4/src/lib.rs index 15b3820156..57efd99a3e 100644 --- a/gen/analyticsreporting4/src/lib.rs +++ b/gen/analyticsreporting4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *AnalyticsReporting* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *analyticsreporting:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *AnalyticsReporting* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *analyticsreporting:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *AnalyticsReporting* *v4* API can be found at the //! [official documentation site](https://developers.google.com/analytics/devguides/reporting/core/v4/). @@ -335,7 +335,7 @@ impl<'a, C, A> AnalyticsReporting AnalyticsReporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://analyticsreporting.googleapis.com/".to_string(), _root_url: "https://analyticsreporting.googleapis.com/".to_string(), } @@ -349,7 +349,7 @@ impl<'a, C, A> AnalyticsReporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -487,13 +487,16 @@ pub struct GetReportsRequest { #[serde(rename="reportRequests")] pub report_requests: Option>, /// Enables - /// [resource based quotas](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4), + /// [resource based + /// quotas](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4), /// (defaults to `False`). If this field is set to `True` the /// per view (profile) quotas are governed by the computational /// cost of the request. Note that using cost based quotas will /// higher enable sampling rates. (10 Million for `SMALL`, /// 100M for `LARGE`. See the - /// [limits and quotas documentation](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4) for details. + /// [limits and quotas + /// documentation](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4) + /// for details. #[serde(rename="useResourceQuotas")] pub use_resource_quotas: Option, } @@ -595,7 +598,8 @@ pub struct ReportRequest { /// following expression selects `ga:browser` dimension which starts with /// Firefox; `ga:browser=~^Firefox`. For more information on dimensions /// and metric filters, see - /// [Filters reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters). + /// [Filters + /// reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters). #[serde(rename="filtersExpression")] pub filters_expression: Option, /// The Analytics @@ -639,7 +643,7 @@ pub struct ReportRequest { #[serde(rename="metricFilterClauses")] pub metric_filter_clauses: Option>, /// The dimensions requested. - /// Requests can have a total of 7 dimensions. + /// Requests can have a total of 9 dimensions. pub dimensions: Option>, /// The pivot definitions. Requests can have a maximum of 2 pivots. pub pivots: Option>, @@ -1269,7 +1273,8 @@ pub struct CohortGroup { /// - The cohort definition date ranges need not be aligned to the calendar /// week and month boundaries. /// - The `viewId` must be an - /// [app view ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) + /// [app view + /// ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) #[serde(rename="lifetimeValue")] pub lifetime_value: Option, } @@ -1400,7 +1405,12 @@ pub struct Activity { /// (defined by the View's Channel Groupings). #[serde(rename="channelGrouping")] pub channel_grouping: Option, - /// Timestamp of the activity. + /// Timestamp of the activity. If activities for a visit cross midnight and + /// occur in two separate dates, then two sessions (one per date) + /// share the session identifier. + /// For example, say session ID 113472 has activity within 2019-08-20, and + /// session ID 243742 has activity within 2019-08-25 and 2019-08-26. Session ID + /// 113472 is one session, and session ID 243742 is two sessions. #[serde(rename="activityTime")] pub activity_time: Option, /// This field contains all the details pertaining to an event and will be diff --git a/gen/androiddeviceprovisioning1-cli/Cargo.toml b/gen/androiddeviceprovisioning1-cli/Cargo.toml index a8e2ab43fb..7dc3a3e862 100644 --- a/gen/androiddeviceprovisioning1-cli/Cargo.toml +++ b/gen/androiddeviceprovisioning1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androiddeviceprovisioning1-cli" -version = "1.0.12+20190622" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Provisioning Partner (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androiddeviceprovisioning1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-androiddeviceprovisioning1] path = "../androiddeviceprovisioning1" -version = "1.0.12+20190622" +version = "1.0.13+20200408" diff --git a/gen/androiddeviceprovisioning1-cli/README.md b/gen/androiddeviceprovisioning1-cli/README.md index 23c2874bf0..4e2206223f 100644 --- a/gen/androiddeviceprovisioning1-cli/README.md +++ b/gen/androiddeviceprovisioning1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Android Provisioning Partner* API at revision *20190622*. The CLI is at version *1.0.12*. +This documentation was generated from the *Android Provisioning Partner* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash androiddeviceprovisioning1 [options] diff --git a/gen/androiddeviceprovisioning1-cli/mkdocs.yml b/gen/androiddeviceprovisioning1-cli/mkdocs.yml index 64c122dadc..8a506df765 100644 --- a/gen/androiddeviceprovisioning1-cli/mkdocs.yml +++ b/gen/androiddeviceprovisioning1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Provisioning Partner v1.0.12+20190622 +site_name: Android Provisioning Partner v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-androiddeviceprovisioning1-cli site_description: A complete library to interact with Android Provisioning Partner (protocol v1) diff --git a/gen/androiddeviceprovisioning1-cli/src/main.rs b/gen/androiddeviceprovisioning1-cli/src/main.rs index 3332d80255..0b8ef9d3ec 100644 --- a/gen/androiddeviceprovisioning1-cli/src/main.rs +++ b/gen/androiddeviceprovisioning1-cli/src/main.rs @@ -2787,7 +2787,7 @@ fn main() { let mut app = App::new("androiddeviceprovisioning1") .author("Sebastian Thiel ") - .version("1.0.12+20190622") + .version("1.0.13+20200408") .about("Automates Android zero-touch enrollment for device resellers, customers, and EMMs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androiddeviceprovisioning1_cli") .arg(Arg::with_name("folder") diff --git a/gen/androiddeviceprovisioning1/Cargo.toml b/gen/androiddeviceprovisioning1/Cargo.toml index 84ab3d028c..7a7aba933d 100644 --- a/gen/androiddeviceprovisioning1/Cargo.toml +++ b/gen/androiddeviceprovisioning1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androiddeviceprovisioning1" -version = "1.0.12+20190622" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Provisioning Partner (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androiddeviceprovisioning1" homepage = "https://developers.google.com/zero-touch/" -documentation = "https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622" +documentation = "https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408" license = "MIT" keywords = ["androiddeviceprovisi", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/androiddeviceprovisioning1/README.md b/gen/androiddeviceprovisioning1/README.md index 191bf68d09..8e8e8d4ce7 100644 --- a/gen/androiddeviceprovisioning1/README.md +++ b/gen/androiddeviceprovisioning1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-androiddeviceprovisioning1` library allows access to all features of the *Google Android Provisioning Partner* service. -This documentation was generated from *Android Provisioning Partner* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *androiddeviceprovisioning:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Android Provisioning Partner* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *androiddeviceprovisioning:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Android Provisioning Partner* *v1* API can be found at the [official documentation site](https://developers.google.com/zero-touch/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.AndroidProvisioningPartner.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.AndroidProvisioningPartner.html) ... * customers - * [*configurations create*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerConfigurationCreateCall.html), [*configurations delete*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerConfigurationDeleteCall.html), [*configurations get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerConfigurationGetCall.html), [*configurations list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerConfigurationListCall.html), [*configurations patch*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerConfigurationPatchCall.html), [*devices apply configuration*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerDeviceApplyConfigurationCall.html), [*devices get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerDeviceGetCall.html), [*devices list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerDeviceListCall.html), [*devices remove configuration*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerDeviceRemoveConfigurationCall.html), [*devices unclaim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerDeviceUnclaimCall.html), [*dpcs list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerDpcListCall.html) and [*list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.CustomerListCall.html) -* [operations](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.Operation.html) - * [*get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.OperationGetCall.html) + * [*configurations create*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerConfigurationCreateCall.html), [*configurations delete*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerConfigurationDeleteCall.html), [*configurations get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerConfigurationGetCall.html), [*configurations list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerConfigurationListCall.html), [*configurations patch*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerConfigurationPatchCall.html), [*devices apply configuration*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerDeviceApplyConfigurationCall.html), [*devices get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerDeviceGetCall.html), [*devices list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerDeviceListCall.html), [*devices remove configuration*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerDeviceRemoveConfigurationCall.html), [*devices unclaim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerDeviceUnclaimCall.html), [*dpcs list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerDpcListCall.html) and [*list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.CustomerListCall.html) +* [operations](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.Operation.html) + * [*get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.OperationGetCall.html) * partners - * [*customers create*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerCustomerCreateCall.html), [*customers list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerCustomerListCall.html), [*devices claim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimCall.html), [*devices claim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimAsyncCall.html), [*devices find by identifier*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByIdentifierCall.html), [*devices find by owner*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByOwnerCall.html), [*devices get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceGetCall.html), [*devices metadata*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceMetadataCall.html), [*devices unclaim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimCall.html), [*devices unclaim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimAsyncCall.html), [*devices update metadata async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerDeviceUpdateMetadataAsyncCall.html), [*vendors customers list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerVendorCustomerListCall.html) and [*vendors list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.PartnerVendorListCall.html) + * [*customers create*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerCustomerCreateCall.html), [*customers list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerCustomerListCall.html), [*devices claim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimCall.html), [*devices claim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceClaimAsyncCall.html), [*devices find by identifier*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByIdentifierCall.html), [*devices find by owner*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceFindByOwnerCall.html), [*devices get*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceGetCall.html), [*devices metadata*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceMetadataCall.html), [*devices unclaim*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimCall.html), [*devices unclaim async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceUnclaimAsyncCall.html), [*devices update metadata async*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerDeviceUpdateMetadataAsyncCall.html), [*vendors customers list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerVendorCustomerListCall.html) and [*vendors list*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.PartnerVendorListCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/struct.AndroidProvisioningPartner.html)** +* **[Hub](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/struct.AndroidProvisioningPartner.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.Part.html)** + * **[Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-androiddeviceprovisioning1/1.0.12+20190622/google_androiddeviceprovisioning1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androiddeviceprovisioning1/1.0.13+20200408/google_androiddeviceprovisioning1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/androiddeviceprovisioning1/src/lib.rs b/gen/androiddeviceprovisioning1/src/lib.rs index f3c961b2c0..7332575340 100644 --- a/gen/androiddeviceprovisioning1/src/lib.rs +++ b/gen/androiddeviceprovisioning1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Provisioning Partner* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *androiddeviceprovisioning:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Android Provisioning Partner* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *androiddeviceprovisioning:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Android Provisioning Partner* *v1* API can be found at the //! [official documentation site](https://developers.google.com/zero-touch/). @@ -315,7 +315,7 @@ impl<'a, C, A> AndroidProvisioningPartner AndroidProvisioningPartner { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://androiddeviceprovisioning.googleapis.com/".to_string(), _root_url: "https://androiddeviceprovisioning.googleapis.com/".to_string(), } @@ -332,7 +332,7 @@ impl<'a, C, A> AndroidProvisioningPartner } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -702,7 +702,7 @@ pub struct Company { /// delete, and edit your organization's portal users. #[serde(rename="ownerEmails")] pub owner_emails: Option>, - /// Input only. Optional. Email address of customer's users in the admin role. + /// Optional. Input only. Email address of customer's users in the admin role. /// Each email address must be associated with a Google Account. #[serde(rename="adminEmails")] pub admin_emails: Option>, @@ -916,7 +916,7 @@ impl ResponseResult for Configuration {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateDeviceMetadataRequest { - /// Required. The metdata to attach to the device. + /// Required. The metadata to attach to the device. #[serde(rename="deviceMetadata")] pub device_metadata: Option, } @@ -1106,7 +1106,7 @@ pub struct UpdateDeviceMetadataInBatchRequest { impl RequestValue for UpdateDeviceMetadataInBatchRequest {} -/// Identifies metdata updates to one device. +/// Identifies metadata updates to one device. /// /// This type is not used in any activity, and only used as *part* of another schema. /// diff --git a/gen/androidenterprise1-cli/Cargo.toml b/gen/androidenterprise1-cli/Cargo.toml index c954c5af97..cb387b7d39 100644 --- a/gen/androidenterprise1-cli/Cargo.toml +++ b/gen/androidenterprise1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidenterprise1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-androidenterprise1] path = "../androidenterprise1" -version = "1.0.12+20190624" +version = "1.0.13+20200325" diff --git a/gen/androidenterprise1-cli/README.md b/gen/androidenterprise1-cli/README.md index aee1453627..bb94462718 100644 --- a/gen/androidenterprise1-cli/README.md +++ b/gen/androidenterprise1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Android Enterprise* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Android Enterprise* API at revision *20200325*. The CLI is at version *1.0.13*. ```bash androidenterprise1 [options] @@ -34,7 +34,6 @@ androidenterprise1 [options] get [-p ]... [-o ] get-state [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] set-state (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] enterprises @@ -56,7 +55,6 @@ androidenterprise1 [options] delete [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] grouplicenses get [-p ]... [-o ] @@ -67,19 +65,16 @@ androidenterprise1 [options] delete [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] managedconfigurationsfordevice delete [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] managedconfigurationsforuser delete [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] managedconfigurationssettings list [-p ]... [-o ] @@ -102,14 +97,12 @@ androidenterprise1 [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] storelayoutpages delete [-p ]... get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] users delete [-p ]... @@ -119,7 +112,6 @@ androidenterprise1 [options] get-available-product-set [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] revoke-device-access [-p ]... revoke-token [-p ]... set-available-product-set (-r )... [-p ]... [-o ] @@ -129,7 +121,6 @@ androidenterprise1 [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] androidenterprise1 --help diff --git a/gen/androidenterprise1-cli/mkdocs.yml b/gen/androidenterprise1-cli/mkdocs.yml index f8a99dde39..0eadea5fbe 100644 --- a/gen/androidenterprise1-cli/mkdocs.yml +++ b/gen/androidenterprise1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Enterprise v1.0.12+20190624 +site_name: Android Enterprise v1.0.13+20200325 site_url: http://byron.github.io/google-apis-rs/google-androidenterprise1-cli site_description: A complete library to interact with Android Enterprise (protocol v1) @@ -13,7 +13,6 @@ pages: - ['devices_get.md', 'Devices', 'Get'] - ['devices_get-state.md', 'Devices', 'Get State'] - ['devices_list.md', 'Devices', 'List'] -- ['devices_patch.md', 'Devices', 'Patch'] - ['devices_set-state.md', 'Devices', 'Set State'] - ['devices_update.md', 'Devices', 'Update'] - ['enterprises_acknowledge-notification-set.md', 'Enterprises', 'Acknowledge Notification Set'] @@ -33,7 +32,6 @@ pages: - ['entitlements_delete.md', 'Entitlements', 'Delete'] - ['entitlements_get.md', 'Entitlements', 'Get'] - ['entitlements_list.md', 'Entitlements', 'List'] -- ['entitlements_patch.md', 'Entitlements', 'Patch'] - ['entitlements_update.md', 'Entitlements', 'Update'] - ['grouplicenses_get.md', 'Grouplicenses', 'Get'] - ['grouplicenses_list.md', 'Grouplicenses', 'List'] @@ -41,17 +39,14 @@ pages: - ['installs_delete.md', 'Installs', 'Delete'] - ['installs_get.md', 'Installs', 'Get'] - ['installs_list.md', 'Installs', 'List'] -- ['installs_patch.md', 'Installs', 'Patch'] - ['installs_update.md', 'Installs', 'Update'] - ['managedconfigurationsfordevice_delete.md', 'Managedconfigurationsfordevice', 'Delete'] - ['managedconfigurationsfordevice_get.md', 'Managedconfigurationsfordevice', 'Get'] - ['managedconfigurationsfordevice_list.md', 'Managedconfigurationsfordevice', 'List'] -- ['managedconfigurationsfordevice_patch.md', 'Managedconfigurationsfordevice', 'Patch'] - ['managedconfigurationsfordevice_update.md', 'Managedconfigurationsfordevice', 'Update'] - ['managedconfigurationsforuser_delete.md', 'Managedconfigurationsforuser', 'Delete'] - ['managedconfigurationsforuser_get.md', 'Managedconfigurationsforuser', 'Get'] - ['managedconfigurationsforuser_list.md', 'Managedconfigurationsforuser', 'List'] -- ['managedconfigurationsforuser_patch.md', 'Managedconfigurationsforuser', 'Patch'] - ['managedconfigurationsforuser_update.md', 'Managedconfigurationsforuser', 'Update'] - ['managedconfigurationssettings_list.md', 'Managedconfigurationssettings', 'List'] - ['permissions_get.md', 'Permissions', 'Get'] @@ -69,13 +64,11 @@ pages: - ['storelayoutclusters_get.md', 'Storelayoutclusters', 'Get'] - ['storelayoutclusters_insert.md', 'Storelayoutclusters', 'Insert'] - ['storelayoutclusters_list.md', 'Storelayoutclusters', 'List'] -- ['storelayoutclusters_patch.md', 'Storelayoutclusters', 'Patch'] - ['storelayoutclusters_update.md', 'Storelayoutclusters', 'Update'] - ['storelayoutpages_delete.md', 'Storelayoutpages', 'Delete'] - ['storelayoutpages_get.md', 'Storelayoutpages', 'Get'] - ['storelayoutpages_insert.md', 'Storelayoutpages', 'Insert'] - ['storelayoutpages_list.md', 'Storelayoutpages', 'List'] -- ['storelayoutpages_patch.md', 'Storelayoutpages', 'Patch'] - ['storelayoutpages_update.md', 'Storelayoutpages', 'Update'] - ['users_delete.md', 'Users', 'Delete'] - ['users_generate-authentication-token.md', 'Users', 'Generate Authentication Token'] @@ -84,7 +77,6 @@ pages: - ['users_get-available-product-set.md', 'Users', 'Get Available Product Set'] - ['users_insert.md', 'Users', 'Insert'] - ['users_list.md', 'Users', 'List'] -- ['users_patch.md', 'Users', 'Patch'] - ['users_revoke-device-access.md', 'Users', 'Revoke Device Access'] - ['users_revoke-token.md', 'Users', 'Revoke Token'] - ['users_set-available-product-set.md', 'Users', 'Set Available Product Set'] @@ -93,7 +85,6 @@ pages: - ['webapps_get.md', 'Webapps', 'Get'] - ['webapps_insert.md', 'Webapps', 'Insert'] - ['webapps_list.md', 'Webapps', 'List'] -- ['webapps_patch.md', 'Webapps', 'Patch'] - ['webapps_update.md', 'Webapps', 'Update'] theme: readthedocs diff --git a/gen/androidenterprise1-cli/src/main.rs b/gen/androidenterprise1-cli/src/main.rs index 34953c920d..32b31a9c5e 100644 --- a/gen/androidenterprise1-cli/src/main.rs +++ b/gen/androidenterprise1-cli/src/main.rs @@ -246,103 +246,6 @@ impl<'n> Engine<'n> { } } - fn _devices_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "policy.auto-update-policy" => Some(("policy.autoUpdatePolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "policy.maintenance-window.start-time-after-midnight-ms" => Some(("policy.maintenanceWindow.startTimeAfterMidnightMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "policy.maintenance-window.duration-ms" => Some(("policy.maintenanceWindow.durationMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "policy.device-report-policy" => Some(("policy.deviceReportPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "policy.product-availability-policy" => Some(("policy.productAvailabilityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "report.last-updated-timestamp-millis" => Some(("report.lastUpdatedTimestampMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "management-type" => Some(("managementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "android-id" => Some(("androidId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["android-id", "auto-update-policy", "device-report-policy", "duration-ms", "kind", "last-updated-timestamp-millis", "maintenance-window", "management-type", "policy", "product-availability-policy", "report", "start-time-after-midnight-ms"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Device = json::value::from_value(object).unwrap(); - let mut call = self.hub.devices().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or(""), opt.value_of("device-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "update-mask" => { - call = call.update_mask(value.unwrap_or("")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["update-mask"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _devices_set_state(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1555,97 +1458,6 @@ impl<'n> Engine<'n> { } } - fn _entitlements_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "reason" => Some(("reason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["kind", "product-id", "reason"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Entitlement = json::value::from_value(object).unwrap(); - let mut call = self.hub.entitlements().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or(""), opt.value_of("entitlement-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "install" => { - call = call.install(arg_from_str(value.unwrap_or("false"), err, "install", "boolean")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["install"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _entitlements_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2041,94 +1853,6 @@ impl<'n> Engine<'n> { } } - fn _installs_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "install-state" => Some(("installState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "version-code" => Some(("versionCode", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["install-state", "kind", "product-id", "version-code"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Install = json::value::from_value(object).unwrap(); - let mut call = self.hub.installs().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or(""), opt.value_of("device-id").unwrap_or(""), opt.value_of("install-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _installs_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2365,94 +2089,6 @@ impl<'n> Engine<'n> { } } - fn _managedconfigurationsfordevice_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "configuration-variables.kind" => Some(("configurationVariables.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "configuration-variables.mcm-id" => Some(("configurationVariables.mcmId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["configuration-variables", "kind", "mcm-id", "product-id"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::ManagedConfiguration = json::value::from_value(object).unwrap(); - let mut call = self.hub.managedconfigurationsfordevice().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or(""), opt.value_of("device-id").unwrap_or(""), opt.value_of("managed-configuration-for-device-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _managedconfigurationsfordevice_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2689,94 +2325,6 @@ impl<'n> Engine<'n> { } } - fn _managedconfigurationsforuser_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "configuration-variables.kind" => Some(("configurationVariables.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "configuration-variables.mcm-id" => Some(("configurationVariables.mcmId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["configuration-variables", "kind", "mcm-id", "product-id"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::ManagedConfiguration = json::value::from_value(object).unwrap(); - let mut call = self.hub.managedconfigurationsforuser().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or(""), opt.value_of("managed-configuration-for-user-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _managedconfigurationsforuser_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3805,94 +3353,6 @@ impl<'n> Engine<'n> { } } - fn _storelayoutclusters_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "order-in-page" => Some(("orderInPage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["id", "kind", "order-in-page", "product-id"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::StoreCluster = json::value::from_value(object).unwrap(); - let mut call = self.hub.storelayoutclusters().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("page-id").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _storelayoutclusters_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -4216,93 +3676,6 @@ impl<'n> Engine<'n> { } } - fn _storelayoutpages_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "link" => Some(("link", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["id", "kind", "link"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::StorePage = json::value::from_value(object).unwrap(); - let mut call = self.hub.storelayoutpages().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("page-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _storelayoutpages_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -4785,97 +4158,6 @@ impl<'n> Engine<'n> { } } - fn _users_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-identifier" => Some(("accountIdentifier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "management-type" => Some(("managementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary-email" => Some(("primaryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-type" => Some(("accountType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-identifier", "account-type", "display-name", "id", "kind", "management-type", "primary-email"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::User = json::value::from_value(object).unwrap(); - let mut call = self.hub.users().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _users_revoke_device_access(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.users().revoke_device_access(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or("")); @@ -5380,96 +4662,6 @@ impl<'n> Engine<'n> { } } - fn _webapps_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "display-mode" => Some(("displayMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "is-published" => Some(("isPublished", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "web-app-id" => Some(("webAppId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "version-code" => Some(("versionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "start-url" => Some(("startUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["display-mode", "is-published", "start-url", "title", "version-code", "web-app-id"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::WebApp = json::value::from_value(object).unwrap(); - let mut call = self.hub.webapps().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("web-app-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _webapps_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -5579,9 +4771,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._devices_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._devices_patch(opt, dry_run, &mut err); - }, ("set-state", Some(opt)) => { call_result = self._devices_set_state(opt, dry_run, &mut err); }, @@ -5655,9 +4844,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._entitlements_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._entitlements_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._entitlements_update(opt, dry_run, &mut err); }, @@ -5703,9 +4889,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._installs_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._installs_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._installs_update(opt, dry_run, &mut err); }, @@ -5726,9 +4909,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._managedconfigurationsfordevice_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._managedconfigurationsfordevice_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._managedconfigurationsfordevice_update(opt, dry_run, &mut err); }, @@ -5749,9 +4929,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._managedconfigurationsforuser_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._managedconfigurationsforuser_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._managedconfigurationsforuser_update(opt, dry_run, &mut err); }, @@ -5843,9 +5020,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._storelayoutclusters_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._storelayoutclusters_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._storelayoutclusters_update(opt, dry_run, &mut err); }, @@ -5869,9 +5043,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._storelayoutpages_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._storelayoutpages_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._storelayoutpages_update(opt, dry_run, &mut err); }, @@ -5904,9 +5075,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._users_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._users_patch(opt, dry_run, &mut err); - }, ("revoke-device-access", Some(opt)) => { call_result = self._users_revoke_device_access(opt, dry_run, &mut err); }, @@ -5939,9 +5107,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._webapps_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._webapps_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._webapps_update(opt, dry_run, &mut err); }, @@ -6033,7 +5198,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("devices", "methods: 'force-report-upload', 'get', 'get-state', 'list', 'patch', 'set-state' and 'update'", vec![ + ("devices", "methods: 'force-report-upload', 'get', 'get-state', 'list', 'set-state' and 'update'", vec![ ("force-report-upload", Some(r##"Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/devices_force-report-upload", @@ -6152,46 +5317,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates the device policy. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/devices_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the user."##), - Some(true), - Some(false)), - - (Some(r##"device-id"##), - None, - Some(r##"The ID of the device."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6589,7 +5714,7 @@ fn main() { ]), ]), - ("entitlements", "methods: 'delete', 'get', 'list', 'patch' and 'update'", vec![ + ("entitlements", "methods: 'delete', 'get', 'list' and 'update'", vec![ ("delete", Some(r##"Removes an entitlement to an app for a user."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/entitlements_delete", @@ -6674,46 +5799,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Adds or updates an entitlement to an app for a user. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/entitlements_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the user."##), - Some(true), - Some(false)), - - (Some(r##"entitlement-id"##), - None, - Some(r##"The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm"."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6846,7 +5931,7 @@ fn main() { ]), ]), - ("installs", "methods: 'delete', 'get', 'list', 'patch' and 'update'", vec![ + ("installs", "methods: 'delete', 'get', 'list' and 'update'", vec![ ("delete", Some(r##"Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/installs_delete", @@ -6949,52 +6034,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/installs_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the user."##), - Some(true), - Some(false)), - - (Some(r##"device-id"##), - None, - Some(r##"The Android ID of the device."##), - Some(true), - Some(false)), - - (Some(r##"install-id"##), - None, - Some(r##"The ID of the product represented by the install, e.g. "app:com.google.android.gm"."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7049,7 +6088,7 @@ fn main() { ]), ]), - ("managedconfigurationsfordevice", "methods: 'delete', 'get', 'list', 'patch' and 'update'", vec![ + ("managedconfigurationsfordevice", "methods: 'delete', 'get', 'list' and 'update'", vec![ ("delete", Some(r##"Removes a per-device managed configuration for an app for the specified device."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationsfordevice_delete", @@ -7152,52 +6191,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationsfordevice_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the user."##), - Some(true), - Some(false)), - - (Some(r##"device-id"##), - None, - Some(r##"The Android ID of the device."##), - Some(true), - Some(false)), - - (Some(r##"managed-configuration-for-device-id"##), - None, - Some(r##"The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm"."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7252,7 +6245,7 @@ fn main() { ]), ]), - ("managedconfigurationsforuser", "methods: 'delete', 'get', 'list', 'patch' and 'update'", vec![ + ("managedconfigurationsforuser", "methods: 'delete', 'get', 'list' and 'update'", vec![ ("delete", Some(r##"Removes a per-user managed configuration for an app for the specified user."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationsforuser_delete", @@ -7337,46 +6330,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationsforuser_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the user."##), - Some(true), - Some(false)), - - (Some(r##"managed-configuration-for-user-id"##), - None, - Some(r##"The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm"."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7427,7 +6380,7 @@ fn main() { ("managedconfigurationssettings", "methods: 'list'", vec![ ("list", - Some(r##"Lists all the managed configurations settings for the specified app. Only the ID and the name is set."##), + Some(r##"Lists all the managed configurations settings for the specified app."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/managedconfigurationssettings_list", vec![ (Some(r##"enterprise-id"##), @@ -7749,7 +6702,7 @@ fn main() { ]), ]), - ("storelayoutclusters", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("storelayoutclusters", "methods: 'delete', 'get', 'insert', 'list' and 'update'", vec![ ("delete", Some(r##"Deletes a cluster."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/storelayoutclusters_delete", @@ -7868,46 +6821,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates a cluster. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/storelayoutclusters_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"page-id"##), - None, - Some(r##"The ID of the page."##), - Some(true), - Some(false)), - - (Some(r##"cluster-id"##), - None, - Some(r##"The ID of the cluster."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7956,7 +6869,7 @@ fn main() { ]), ]), - ("storelayoutpages", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("storelayoutpages", "methods: 'delete', 'get', 'insert', 'list' and 'update'", vec![ ("delete", Some(r##"Deletes a store page."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/storelayoutpages_delete", @@ -8051,40 +6964,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates the content of a store page. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/storelayoutpages_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"page-id"##), - None, - Some(r##"The ID of the page."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -8127,7 +7006,7 @@ fn main() { ]), ]), - ("users", "methods: 'delete', 'generate-authentication-token', 'generate-token', 'get', 'get-available-product-set', 'insert', 'list', 'patch', 'revoke-device-access', 'revoke-token', 'set-available-product-set' and 'update'", vec![ + ("users", "methods: 'delete', 'generate-authentication-token', 'generate-token', 'get', 'get-available-product-set', 'insert', 'list', 'revoke-device-access', 'revoke-token', 'set-available-product-set' and 'update'", vec![ ("delete", Some(r##"Deleted an EMM-managed user."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/users_delete", @@ -8321,42 +7200,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates the details of an EMM-managed user. - - Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/users_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the user."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -8481,7 +7324,7 @@ fn main() { ]), ]), - ("webapps", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("webapps", "methods: 'delete', 'get', 'insert', 'list' and 'update'", vec![ ("delete", Some(r##"Deletes an existing web app."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/webapps_delete", @@ -8576,40 +7419,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates an existing web app. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/webapps_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"web-app-id"##), - None, - Some(r##"The ID of the web app."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -8656,7 +7465,7 @@ fn main() { let mut app = App::new("androidenterprise1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200325") .about("Manages the deployment of apps to Android for Work users.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli") .arg(Arg::with_name("url") diff --git a/gen/androidenterprise1/Cargo.toml b/gen/androidenterprise1/Cargo.toml index 611049cc31..6757a51868 100644 --- a/gen/androidenterprise1/Cargo.toml +++ b/gen/androidenterprise1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidenterprise1" -version = "1.0.12+20190624" +version = "1.0.13+20200325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1" homepage = "https://developers.google.com/android/work/play/emm-api" -documentation = "https://docs.rs/google-androidenterprise1/1.0.12+20190624" +documentation = "https://docs.rs/google-androidenterprise1/1.0.13+20200325" license = "MIT" keywords = ["androidenterprise", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/androidenterprise1/README.md b/gen/androidenterprise1/README.md index 14328f8a47..a1c0dcd39d 100644 --- a/gen/androidenterprise1/README.md +++ b/gen/androidenterprise1/README.md @@ -5,46 +5,46 @@ DO NOT EDIT ! --> The `google-androidenterprise1` library allows access to all features of the *Google Android Enterprise* service. -This documentation was generated from *Android Enterprise* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Android Enterprise* crate version *1.0.13+20200325*, where *20200325* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Android Enterprise* *v1* API can be found at the [official documentation site](https://developers.google.com/android/work/play/emm-api). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.AndroidEnterprise.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.AndroidEnterprise.html) ... -* [devices](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.Device.html) - * [*force report upload*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.DeviceForceReportUploadCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.DeviceGetCall.html), [*get state*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.DeviceGetStateCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.DeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.DevicePatchCall.html), [*set state*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.DeviceSetStateCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.DeviceUpdateCall.html) -* [enterprises](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.Enterprise.html) - * [*acknowledge notification set*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseCompleteSignupCall.html), [*create web token*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseCreateWebTokenCall.html), [*enroll*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseEnrollCall.html), [*generate signup url*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseGenerateSignupUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseGetCall.html), [*get service account*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseGetStoreLayoutCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseListCall.html), [*pull notification set*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseSetAccountCall.html), [*set store layout*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EnterpriseUnenrollCall.html) -* [entitlements](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.Entitlement.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EntitlementDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EntitlementGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EntitlementListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EntitlementPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.EntitlementUpdateCall.html) +* [devices](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.Device.html) + * [*force report upload*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.DeviceForceReportUploadCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.DeviceGetCall.html), [*get state*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.DeviceGetStateCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.DeviceListCall.html), [*set state*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.DeviceSetStateCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.DeviceUpdateCall.html) +* [enterprises](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.Enterprise.html) + * [*acknowledge notification set*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseCompleteSignupCall.html), [*create web token*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseCreateWebTokenCall.html), [*enroll*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseEnrollCall.html), [*generate signup url*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseGenerateSignupUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseGetCall.html), [*get service account*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseGetStoreLayoutCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseListCall.html), [*pull notification set*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseSetAccountCall.html), [*set store layout*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EnterpriseUnenrollCall.html) +* [entitlements](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.Entitlement.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EntitlementDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EntitlementGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EntitlementListCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.EntitlementUpdateCall.html) * grouplicenses - * [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.GrouplicenseGetCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.GrouplicenseListCall.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.GrouplicenseGetCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.GrouplicenseListCall.html) * grouplicenseusers - * [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.GrouplicenseuserListCall.html) -* [installs](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.Install.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.InstallDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.InstallGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.InstallListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.InstallPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.InstallUpdateCall.html) + * [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.GrouplicenseuserListCall.html) +* [installs](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.Install.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.InstallDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.InstallGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.InstallListCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.InstallUpdateCall.html) * managedconfigurationsfordevice - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsfordeviceUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsfordeviceListCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsfordeviceUpdateCall.html) * managedconfigurationsforuser - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsforuserGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsforuserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationsforuserUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsforuserGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsforuserListCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationsforuserUpdateCall.html) * managedconfigurationssettings - * [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ManagedconfigurationssettingListCall.html) -* [permissions](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.Permission.html) - * [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.PermissionGetCall.html) -* [products](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.Product.html) - * [*approve*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ProductGetPermissionCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ProductListCall.html) and [*unapprove*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ProductUnapproveCall.html) + * [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ManagedconfigurationssettingListCall.html) +* [permissions](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.Permission.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.PermissionGetCall.html) +* [products](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.Product.html) + * [*approve*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ProductGetPermissionCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ProductListCall.html) and [*unapprove*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ProductUnapproveCall.html) * serviceaccountkeys - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ServiceaccountkeyDeleteCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ServiceaccountkeyInsertCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.ServiceaccountkeyListCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ServiceaccountkeyDeleteCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ServiceaccountkeyInsertCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.ServiceaccountkeyListCall.html) * storelayoutclusters - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutclusterDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutclusterGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutclusterInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutclusterListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutclusterPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutclusterUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutclusterDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutclusterGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutclusterInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutclusterListCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutclusterUpdateCall.html) * storelayoutpages - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutpageDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutpageGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutpageInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutpageListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutpagePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.StorelayoutpageUpdateCall.html) -* [users](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.User.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserDeleteCall.html), [*generate authentication token*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserGetCall.html), [*get available product set*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserGetAvailableProductSetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserPatchCall.html), [*revoke device access*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserRevokeDeviceAccesCall.html), [*revoke token*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserRevokeTokenCall.html), [*set available product set*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserSetAvailableProductSetCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.UserUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutpageDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutpageGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutpageInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutpageListCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.StorelayoutpageUpdateCall.html) +* [users](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.User.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserDeleteCall.html), [*generate authentication token*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserGetCall.html), [*get available product set*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserGetAvailableProductSetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserListCall.html), [*revoke device access*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserRevokeDeviceAccesCall.html), [*revoke token*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserRevokeTokenCall.html), [*set available product set*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserSetAvailableProductSetCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.UserUpdateCall.html) * webapps - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.WebappDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.WebappGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.WebappInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.WebappListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.WebappPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.WebappUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.WebappDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.WebappGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.WebappInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.WebappListCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.WebappUpdateCall.html) @@ -53,17 +53,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/struct.AndroidEnterprise.html)** +* **[Hub](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/struct.AndroidEnterprise.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -168,17 +168,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -188,29 +188,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-androidenterprise1/1.0.12+20190624/google_androidenterprise1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidenterprise1/1.0.13+20200325/google_androidenterprise1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/androidenterprise1/src/lib.rs b/gen/androidenterprise1/src/lib.rs index 63c1ed6949..5709ed6ccb 100644 --- a/gen/androidenterprise1/src/lib.rs +++ b/gen/androidenterprise1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Enterprise* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Android Enterprise* crate version *1.0.13+20200325*, where *20200325* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Android Enterprise* *v1* API can be found at the //! [official documentation site](https://developers.google.com/android/work/play/emm-api). @@ -12,21 +12,21 @@ //! Handle the following *Resources* with ease from the central [hub](struct.AndroidEnterprise.html) ... //! //! * [devices](struct.Device.html) -//! * [*force report upload*](struct.DeviceForceReportUploadCall.html), [*get*](struct.DeviceGetCall.html), [*get state*](struct.DeviceGetStateCall.html), [*list*](struct.DeviceListCall.html), [*patch*](struct.DevicePatchCall.html), [*set state*](struct.DeviceSetStateCall.html) and [*update*](struct.DeviceUpdateCall.html) +//! * [*force report upload*](struct.DeviceForceReportUploadCall.html), [*get*](struct.DeviceGetCall.html), [*get state*](struct.DeviceGetStateCall.html), [*list*](struct.DeviceListCall.html), [*set state*](struct.DeviceSetStateCall.html) and [*update*](struct.DeviceUpdateCall.html) //! * [enterprises](struct.Enterprise.html) //! * [*acknowledge notification set*](struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](struct.EnterpriseCompleteSignupCall.html), [*create web token*](struct.EnterpriseCreateWebTokenCall.html), [*enroll*](struct.EnterpriseEnrollCall.html), [*generate signup url*](struct.EnterpriseGenerateSignupUrlCall.html), [*get*](struct.EnterpriseGetCall.html), [*get service account*](struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](struct.EnterpriseGetStoreLayoutCall.html), [*list*](struct.EnterpriseListCall.html), [*pull notification set*](struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](struct.EnterpriseSetAccountCall.html), [*set store layout*](struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](struct.EnterpriseUnenrollCall.html) //! * [entitlements](struct.Entitlement.html) -//! * [*delete*](struct.EntitlementDeleteCall.html), [*get*](struct.EntitlementGetCall.html), [*list*](struct.EntitlementListCall.html), [*patch*](struct.EntitlementPatchCall.html) and [*update*](struct.EntitlementUpdateCall.html) +//! * [*delete*](struct.EntitlementDeleteCall.html), [*get*](struct.EntitlementGetCall.html), [*list*](struct.EntitlementListCall.html) and [*update*](struct.EntitlementUpdateCall.html) //! * grouplicenses //! * [*get*](struct.GrouplicenseGetCall.html) and [*list*](struct.GrouplicenseListCall.html) //! * grouplicenseusers //! * [*list*](struct.GrouplicenseuserListCall.html) //! * [installs](struct.Install.html) -//! * [*delete*](struct.InstallDeleteCall.html), [*get*](struct.InstallGetCall.html), [*list*](struct.InstallListCall.html), [*patch*](struct.InstallPatchCall.html) and [*update*](struct.InstallUpdateCall.html) +//! * [*delete*](struct.InstallDeleteCall.html), [*get*](struct.InstallGetCall.html), [*list*](struct.InstallListCall.html) and [*update*](struct.InstallUpdateCall.html) //! * managedconfigurationsfordevice -//! * [*delete*](struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](struct.ManagedconfigurationsfordeviceUpdateCall.html) +//! * [*delete*](struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](struct.ManagedconfigurationsfordeviceListCall.html) and [*update*](struct.ManagedconfigurationsfordeviceUpdateCall.html) //! * managedconfigurationsforuser -//! * [*delete*](struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](struct.ManagedconfigurationsforuserGetCall.html), [*list*](struct.ManagedconfigurationsforuserListCall.html), [*patch*](struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](struct.ManagedconfigurationsforuserUpdateCall.html) +//! * [*delete*](struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](struct.ManagedconfigurationsforuserGetCall.html), [*list*](struct.ManagedconfigurationsforuserListCall.html) and [*update*](struct.ManagedconfigurationsforuserUpdateCall.html) //! * managedconfigurationssettings //! * [*list*](struct.ManagedconfigurationssettingListCall.html) //! * [permissions](struct.Permission.html) @@ -36,13 +36,13 @@ //! * serviceaccountkeys //! * [*delete*](struct.ServiceaccountkeyDeleteCall.html), [*insert*](struct.ServiceaccountkeyInsertCall.html) and [*list*](struct.ServiceaccountkeyListCall.html) //! * storelayoutclusters -//! * [*delete*](struct.StorelayoutclusterDeleteCall.html), [*get*](struct.StorelayoutclusterGetCall.html), [*insert*](struct.StorelayoutclusterInsertCall.html), [*list*](struct.StorelayoutclusterListCall.html), [*patch*](struct.StorelayoutclusterPatchCall.html) and [*update*](struct.StorelayoutclusterUpdateCall.html) +//! * [*delete*](struct.StorelayoutclusterDeleteCall.html), [*get*](struct.StorelayoutclusterGetCall.html), [*insert*](struct.StorelayoutclusterInsertCall.html), [*list*](struct.StorelayoutclusterListCall.html) and [*update*](struct.StorelayoutclusterUpdateCall.html) //! * storelayoutpages -//! * [*delete*](struct.StorelayoutpageDeleteCall.html), [*get*](struct.StorelayoutpageGetCall.html), [*insert*](struct.StorelayoutpageInsertCall.html), [*list*](struct.StorelayoutpageListCall.html), [*patch*](struct.StorelayoutpagePatchCall.html) and [*update*](struct.StorelayoutpageUpdateCall.html) +//! * [*delete*](struct.StorelayoutpageDeleteCall.html), [*get*](struct.StorelayoutpageGetCall.html), [*insert*](struct.StorelayoutpageInsertCall.html), [*list*](struct.StorelayoutpageListCall.html) and [*update*](struct.StorelayoutpageUpdateCall.html) //! * [users](struct.User.html) -//! * [*delete*](struct.UserDeleteCall.html), [*generate authentication token*](struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](struct.UserGenerateTokenCall.html), [*get*](struct.UserGetCall.html), [*get available product set*](struct.UserGetAvailableProductSetCall.html), [*insert*](struct.UserInsertCall.html), [*list*](struct.UserListCall.html), [*patch*](struct.UserPatchCall.html), [*revoke device access*](struct.UserRevokeDeviceAccesCall.html), [*revoke token*](struct.UserRevokeTokenCall.html), [*set available product set*](struct.UserSetAvailableProductSetCall.html) and [*update*](struct.UserUpdateCall.html) +//! * [*delete*](struct.UserDeleteCall.html), [*generate authentication token*](struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](struct.UserGenerateTokenCall.html), [*get*](struct.UserGetCall.html), [*get available product set*](struct.UserGetAvailableProductSetCall.html), [*insert*](struct.UserInsertCall.html), [*list*](struct.UserListCall.html), [*revoke device access*](struct.UserRevokeDeviceAccesCall.html), [*revoke token*](struct.UserRevokeTokenCall.html), [*set available product set*](struct.UserSetAvailableProductSetCall.html) and [*update*](struct.UserUpdateCall.html) //! * webapps -//! * [*delete*](struct.WebappDeleteCall.html), [*get*](struct.WebappGetCall.html), [*insert*](struct.WebappInsertCall.html), [*list*](struct.WebappListCall.html), [*patch*](struct.WebappPatchCall.html) and [*update*](struct.WebappUpdateCall.html) +//! * [*delete*](struct.WebappDeleteCall.html), [*get*](struct.WebappGetCall.html), [*insert*](struct.WebappInsertCall.html), [*list*](struct.WebappListCall.html) and [*update*](struct.WebappUpdateCall.html) //! //! //! @@ -362,7 +362,7 @@ impl<'a, C, A> AndroidEnterprise AndroidEnterprise { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/androidenterprise/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -418,7 +418,7 @@ impl<'a, C, A> AndroidEnterprise } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -489,11 +489,10 @@ impl Part for AppRestrictionsSchemaRestrictionRestrictionValue {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [patch installs](struct.InstallPatchCall.html) (request|response) /// * [list installs](struct.InstallListCall.html) (none) /// * [delete installs](struct.InstallDeleteCall.html) (none) -/// * [update installs](struct.InstallUpdateCall.html) (request|response) /// * [get installs](struct.InstallGetCall.html) (response) +/// * [update installs](struct.InstallUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Install { @@ -503,7 +502,7 @@ pub struct Install { /// The version of the installed product. Guaranteed to be set only if the install state is "installed". #[serde(rename="versionCode")] pub version_code: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#install". + /// no description provided pub kind: Option, /// The ID of the product that the install is for. For example, "app:com.google.android.gm". #[serde(rename="productId")] @@ -530,15 +529,14 @@ impl ResponseResult for Install {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [patch entitlements](struct.EntitlementPatchCall.html) (request|response) /// * [list entitlements](struct.EntitlementListCall.html) (none) /// * [delete entitlements](struct.EntitlementDeleteCall.html) (none) -/// * [update entitlements](struct.EntitlementUpdateCall.html) (request|response) /// * [get entitlements](struct.EntitlementGetCall.html) (response) +/// * [update entitlements](struct.EntitlementUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Entitlement { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlement". + /// no description provided pub kind: Option, /// The reason for the entitlement. For example, "free" for free apps. This property is temporary: it will be replaced by the acquisition kind field of group licenses. pub reason: Option, @@ -608,7 +606,7 @@ pub struct ProductSet { /// Additional list of product IDs making up the product set. Unlike the productID array, in this list It's possible to specify which tracks (alpha, beta, production) of a product are visible to the user. See ProductVisibility and its fields for more information. Specifying the same product ID both here and in the productId array is not allowed and it will result in an error. #[serde(rename="productVisibility")] pub product_visibility: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productSet". + /// no description provided pub kind: Option, /// The list of product IDs making up the set of products. #[serde(rename="productId")] @@ -657,9 +655,8 @@ impl Part for NewDeviceEvent {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [insert webapps](struct.WebappInsertCall.html) (request|response) -/// * [update webapps](struct.WebappUpdateCall.html) (request|response) -/// * [patch webapps](struct.WebappPatchCall.html) (request|response) /// * [get webapps](struct.WebappGetCall.html) (response) +/// * [update webapps](struct.WebappUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct WebApp { @@ -724,12 +721,12 @@ pub struct AdministratorWebTokenSpec { /// Options for displaying the Organize apps page. #[serde(rename="storeBuilder")] pub store_builder: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#administratorWebTokenSpec". + /// no description provided pub kind: Option, /// Options for displaying the managed Play Search apps page. #[serde(rename="playSearch")] pub play_search: Option, - /// The URI of the parent frame hosting the iframe. To prevent XSS, the iframe may not be hosted at other URIs. This URI must be https. + /// The URI of the parent frame hosting the iframe. To prevent XSS, the iframe may not be hosted at other URIs. This URI must be https. Use whitespaces to separate multiple parent URIs. pub parent: Option, /// Options for displaying the Private Apps page. #[serde(rename="privateApps")] @@ -759,7 +756,7 @@ impl RequestValue for AdministratorWebTokenSpec {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DeviceState { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#deviceState". + /// no description provided pub kind: Option, /// The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state. #[serde(rename="accountState")] @@ -776,16 +773,13 @@ impl ResponseResult for DeviceState {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ManagedConfigurationsSettings { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsSettings". + /// no description provided pub kind: Option, - /// The set of managed properties for this configuration. - #[serde(rename="managedProperty")] - pub managed_property: Option>, - /// The name of the managed configurations settings. - pub name: Option, /// The last updated time of the managed configuration settings in milliseconds since 1970-01-01T00:00:00Z. #[serde(rename="lastUpdatedTimestampMillis")] pub last_updated_timestamp_millis: Option, + /// The name of the managed configurations settings. + pub name: Option, /// The ID of the managed configurations settings. #[serde(rename="mcmId")] pub mcm_id: Option, @@ -968,7 +962,6 @@ impl Part for LocalizedText {} /// * [set state devices](struct.DeviceSetStateCall.html) (none) /// * [get devices](struct.DeviceGetCall.html) (response) /// * [get state devices](struct.DeviceGetStateCall.html) (none) -/// * [patch devices](struct.DevicePatchCall.html) (request|response) /// * [force report upload devices](struct.DeviceForceReportUploadCall.html) (none) /// * [list devices](struct.DeviceListCall.html) (none) /// @@ -978,7 +971,7 @@ pub struct Device { pub policy: Option, /// The device report updated with the latest app states. pub report: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device". + /// no description provided pub kind: Option, /// The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0". #[serde(rename="androidId")] @@ -1008,7 +1001,7 @@ pub struct VariableSet { /// The value of the placeholder, specific to the user. #[serde(rename="userValue")] pub user_value: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#variableSet". + /// no description provided pub kind: Option, /// The placeholder string; defined by EMM. pub placeholder: Option, @@ -1142,7 +1135,7 @@ impl ResponseResult for ManagedConfigurationsForDeviceListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct EnterpriseAccount { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterpriseAccount". + /// no description provided pub kind: Option, /// The email address of the service account. #[serde(rename="accountEmail")] @@ -1164,7 +1157,7 @@ impl ResponseResult for EnterpriseAccount {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ServiceAccount { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccount". + /// no description provided pub kind: Option, /// The account name of the service account, in the form of an email address. Assigned by the server. pub name: Option, @@ -1256,7 +1249,7 @@ pub struct StoreLayout { /// Not specifying a homepage is equivalent to setting the store layout type to "basic". #[serde(rename="homepageId")] pub homepage_id: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout". + /// no description provided pub kind: Option, /// The store layout type. By default, this value is set to "basic" if the homepageId field is not set, and to "custom" otherwise. If set to "basic", the layout will consist of all approved apps that have been whitelisted for the user. #[serde(rename="storeLayoutType")] @@ -1340,7 +1333,7 @@ pub struct Enterprise { pub primary_domain: Option, /// The unique ID for the enterprise. pub id: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise". + /// no description provided pub kind: Option, /// The name of the enterprise, for example, "Example, Inc". pub name: Option, @@ -1415,7 +1408,7 @@ impl Part for AppUpdateEvent {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AdministratorWebToken { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#administratorWebToken". + /// no description provided pub kind: Option, /// An opaque token to be passed to the Play front-end to generate an iframe. pub token: Option, @@ -1607,7 +1600,7 @@ impl Part for Policy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ConfigurationVariables { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#configurationVariables". + /// no description provided pub kind: Option, /// The variable set that is attributed to the user. #[serde(rename="variableSet")] @@ -1648,7 +1641,7 @@ impl Part for TrackInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AuthenticationToken { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#authenticationToken". + /// no description provided pub kind: Option, /// The authentication token to be passed to the device policy client on the device where it can be used to provision the account for which this token was generated. pub token: Option, @@ -1672,7 +1665,7 @@ pub struct AutoInstallPolicy { /// The priority of the install, as an unsigned integer. A lower number means higher priority. #[serde(rename="autoInstallPriority")] pub auto_install_priority: Option, - /// The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. + /// The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. You can set a minimum version code for at most 20 apps per device. #[serde(rename="minimumVersionCode")] pub minimum_version_code: Option, } @@ -1705,8 +1698,8 @@ pub struct Product { /// The countries which this app is available in. #[serde(rename="availableCountries")] pub available_countries: Option>, - /// The localized promotional description, if available. - pub description: Option, + /// Noteworthy features (if any) of this product. + pub features: Option>, /// A description of the recent changes made to the app. #[serde(rename="recentChanges")] pub recent_changes: Option, @@ -1725,14 +1718,17 @@ pub struct Product { /// A link to the (consumer) Google Play details page for the product. #[serde(rename="detailsUrl")] pub details_url: Option, + /// The approximate time (within 7 days) the app was last published, expressed in milliseconds since epoch. + #[serde(rename="lastUpdatedTimestampMillis")] + pub last_updated_timestamp_millis: Option, /// Whether this product is free, free with in-app purchases, or paid. If the pricing is unknown, this means the product is not generally available anymore (even though it might still be available to people who own it). #[serde(rename="productPricing")] pub product_pricing: Option, - /// A list of permissions required by the app. - pub permissions: Option>, + /// The localized promotional description, if available. + pub description: Option, /// The app category (e.g. RACING, SOCIAL, etc.) pub category: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". + /// no description provided pub kind: Option, /// How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted. #[serde(rename="distributionChannel")] @@ -1754,15 +1750,14 @@ pub struct Product { /// The name of the author of the product (for example, the app developer). #[serde(rename="authorName")] pub author_name: Option, - /// The approximate time (within 7 days) the app was last published, expressed in milliseconds since epoch. - #[serde(rename="lastUpdatedTimestampMillis")] - pub last_updated_timestamp_millis: Option, - /// The certificate used to sign this product. - #[serde(rename="signingCertificate")] - pub signing_certificate: Option, /// Deprecated. #[serde(rename="requiresContainerApp")] pub requires_container_app: Option, + /// The certificate used to sign this product. + #[serde(rename="signingCertificate")] + pub signing_certificate: Option, + /// A list of permissions required by the app. + pub permissions: Option>, /// A string of the form app:. For example, app:com.google.android.gm represents the Gmail app. #[serde(rename="productId")] pub product_id: Option, @@ -1790,7 +1785,7 @@ pub struct Permission { pub permission_id: Option, /// A longer description of the Permissions resource, giving more details of what it affects. pub description: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#permission". + /// no description provided pub kind: Option, /// The name of the permission. pub name: Option, @@ -1813,7 +1808,7 @@ impl ResponseResult for Permission {} pub struct NotificationSet { /// The notifications received, or empty if no notifications are present. pub notification: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#notificationSet". + /// no description provided pub kind: Option, /// The notification set ID, required to mark the notification as received with the Enterprises.AcknowledgeNotification API. This will be omitted if no notifications are present. #[serde(rename="notificationSetId")] @@ -1850,16 +1845,14 @@ impl ResponseResult for EntitlementsListResponse {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [patch managedconfigurationsforuser](struct.ManagedconfigurationsforuserPatchCall.html) (request|response) -/// * [get managedconfigurationsforuser](struct.ManagedconfigurationsforuserGetCall.html) (response) /// * [update managedconfigurationsforuser](struct.ManagedconfigurationsforuserUpdateCall.html) (request|response) -/// * [patch managedconfigurationsfordevice](struct.ManagedconfigurationsfordevicePatchCall.html) (request|response) +/// * [get managedconfigurationsforuser](struct.ManagedconfigurationsforuserGetCall.html) (response) /// * [get managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceGetCall.html) (response) /// * [update managedconfigurationsfordevice](struct.ManagedconfigurationsfordeviceUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ManagedConfiguration { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfiguration". + /// Deprecated. pub kind: Option, /// Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user. #[serde(rename="configurationVariables")] @@ -1902,7 +1895,7 @@ impl ResponseResult for GroupLicenseUsersListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ApprovalUrlInfo { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#approvalUrlInfo". + /// no description provided pub kind: Option, /// A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call. #[serde(rename="approvalUrl")] @@ -1947,7 +1940,7 @@ impl Part for KeyedAppState {} pub struct AppRestrictionsSchema { /// The set of restrictions that make up this schema. pub restrictions: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#appRestrictionsSchema". + /// Deprecated. pub kind: Option, } @@ -2063,7 +2056,7 @@ impl Part for AppVersion {} pub struct SignupInfo { /// A URL under which the Admin can sign up for an enterprise. The page pointed to cannot be rendered in an iframe. pub url: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#signupInfo". + /// Deprecated. pub kind: Option, /// An opaque token that will be required, along with the Enterprise Token, for obtaining the enterprise resource from CompleteSignup. #[serde(rename="completionToken")] @@ -2084,7 +2077,7 @@ impl ResponseResult for SignupInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UserToken { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#userToken". + /// no description provided pub kind: Option, /// The unique ID for the user. #[serde(rename="userId")] @@ -2164,12 +2157,11 @@ impl ResponseResult for GroupLicensesListResponse {} /// /// * [get storelayoutclusters](struct.StorelayoutclusterGetCall.html) (response) /// * [update storelayoutclusters](struct.StorelayoutclusterUpdateCall.html) (request|response) -/// * [patch storelayoutclusters](struct.StorelayoutclusterPatchCall.html) (request|response) /// * [insert storelayoutclusters](struct.StorelayoutclusterInsertCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct StoreCluster { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeCluster". + /// no description provided pub kind: Option, /// List of products in the order they are displayed in the cluster. There should not be duplicates within a cluster. #[serde(rename="productId")] @@ -2223,7 +2215,7 @@ pub struct ServiceAccountKey { /// Public key data for the credentials file. This is an X.509 cert. If you are using the googleCredentials key type, this is identical to the cert that can be retrieved by using the X.509 cert url inside of the credentials file. #[serde(rename="publicData")] pub public_data: Option, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccountKey". + /// no description provided pub kind: Option, /// The body of the private key credentials file, in string format. This is only populated when the ServiceAccountKey is created, and is not stored by Google. pub data: Option, @@ -2248,12 +2240,11 @@ impl ResponseResult for ServiceAccountKey {} /// /// * [get storelayoutpages](struct.StorelayoutpageGetCall.html) (response) /// * [update storelayoutpages](struct.StorelayoutpageUpdateCall.html) (request|response) -/// * [patch storelayoutpages](struct.StorelayoutpagePatchCall.html) (request|response) /// * [insert storelayoutpages](struct.StorelayoutpageInsertCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct StorePage { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storePage". + /// no description provided pub kind: Option, /// Ordered list of pages a user should be able to reach from this page. The list can't include this page. It is recommended that the basic pages are created first, before adding the links between pages. /// @@ -2302,7 +2293,7 @@ impl RequestValue for ProductsApproveRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductPermissions { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions". + /// no description provided pub kind: Option, /// The permissions required by the app. pub permission: Option>, @@ -2360,16 +2351,15 @@ impl Part for ManagedProperty {} /// * [generate authentication token users](struct.UserGenerateAuthenticationTokenCall.html) (none) /// * [list users](struct.UserListCall.html) (none) /// * [update users](struct.UserUpdateCall.html) (request|response) -/// * [patch users](struct.UserPatchCall.html) (request|response) +/// * [generate token users](struct.UserGenerateTokenCall.html) (none) /// * [set available product set users](struct.UserSetAvailableProductSetCall.html) (none) /// * [insert users](struct.UserInsertCall.html) (request|response) -/// * [generate token users](struct.UserGenerateTokenCall.html) (none) /// * [get available product set users](struct.UserGetAvailableProductSetCall.html) (none) /// * [get users](struct.UserGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct User { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user". + /// no description provided pub kind: Option, /// The name that will appear in user interfaces. Setting this property is optional when creating EMM-managed users. If you do set this property, use something generic about the organization (such as "Example, Inc.") or your name (as EMM). Not used for Google-managed user accounts. #[serde(rename="displayName")] @@ -2426,7 +2416,7 @@ impl Part for ProductApprovalEvent {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GroupLicense { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicense". + /// no description provided pub kind: Option, /// The number of purchased licenses (possibly in multiple purchases). If this field is omitted, then there is no limit on the number of licenses that can be provisioned (for example, if the acquisition kind is "free"). #[serde(rename="numPurchased")] @@ -2519,7 +2509,7 @@ impl<'a, C, A> ManagedconfigurationssettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all the managed configurations settings for the specified app. Only the ID and the name is set. + /// Lists all the managed configurations settings for the specified app. /// /// # Arguments /// @@ -2563,7 +2553,7 @@ impl<'a, C, A> ManagedconfigurationssettingMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.storelayoutpages(); /// # } @@ -2580,14 +2570,31 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a store page. + /// Retrieves the details of all pages in the store. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn list(&self, enterprise_id: &str) -> StorelayoutpageListCall<'a, C, A> { + StorelayoutpageListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves details of a store page. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. - pub fn delete(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageDeleteCall<'a, C, A> { - StorelayoutpageDeleteCall { + pub fn get(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageGetCall<'a, C, A> { + StorelayoutpageGetCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), @@ -2599,17 +2606,15 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the content of a store page. This method supports patch semantics. + /// Deletes a store page. /// /// # Arguments /// - /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. - pub fn patch(&self, request: StorePage, enterprise_id: &str, page_id: &str) -> StorelayoutpagePatchCall<'a, C, A> { - StorelayoutpagePatchCall { + pub fn delete(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageDeleteCall<'a, C, A> { + StorelayoutpageDeleteCall { hub: self.hub, - _request: request, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), _delegate: Default::default(), @@ -2637,25 +2642,6 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves details of a store page. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `pageId` - The ID of the page. - pub fn get(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageGetCall<'a, C, A> { - StorelayoutpageGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _page_id: page_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates the content of a store page. @@ -2676,23 +2662,6 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the details of all pages in the store. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn list(&self, enterprise_id: &str) -> StorelayoutpageListCall<'a, C, A> { - StorelayoutpageListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -2721,7 +2690,7 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `generate_authentication_token(...)`, `generate_token(...)`, `get(...)`, `get_available_product_set(...)`, `insert(...)`, `list(...)`, `patch(...)`, `revoke_device_access(...)`, `revoke_token(...)`, `set_available_product_set(...)` and `update(...)` +/// // like `delete(...)`, `generate_authentication_token(...)`, `generate_token(...)`, `get(...)`, `get_available_product_set(...)`, `insert(...)`, `list(...)`, `revoke_device_access(...)`, `revoke_token(...)`, `set_available_product_set(...)` and `update(...)` /// // to build up your call. /// let rb = hub.users(); /// # } @@ -2801,20 +2770,120 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the details of an EMM-managed user. + /// Deleted an EMM-managed user. /// - /// Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn delete(&self, enterprise_id: &str, user_id: &str) -> UserDeleteCall<'a, C, A> { + UserDeleteCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. + /// + /// You can provision a maximum of 10 devices per user. + /// + /// This call only works with EMM-managed accounts. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn generate_authentication_token(&self, enterprise_id: &str, user_id: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { + UserGenerateAuthenticationTokenCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `email` - The exact primary email address of the user to look up. + pub fn list(&self, enterprise_id: &str, email: &str) -> UserListCall<'a, C, A> { + UserListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _email: email.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new EMM-managed user. + /// + /// The Users resource passed in the body of the request should include an accountIdentifier and an accountType. + /// If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. /// /// # Arguments /// /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn patch(&self, request: User, enterprise_id: &str, user_id: &str) -> UserPatchCall<'a, C, A> { - UserPatchCall { + pub fn insert(&self, request: User, enterprise_id: &str) -> UserInsertCall<'a, C, A> { + UserInsertCall { hub: self.hub, _request: request, _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a user's details. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn get(&self, enterprise_id: &str, user_id: &str) -> UserGetCall<'a, C, A> { + UserGetCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. + /// + /// This call only works with Google managed accounts. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn generate_token(&self, enterprise_id: &str, user_id: &str) -> UserGenerateTokenCall<'a, C, A> { + UserGenerateTokenCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -2861,129 +2930,6 @@ impl<'a, C, A> UserMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a user's details. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn get(&self, enterprise_id: &str, user_id: &str) -> UserGetCall<'a, C, A> { - UserGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new EMM-managed user. - /// - /// The Users resource passed in the body of the request should include an accountIdentifier and an accountType. - /// If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - pub fn insert(&self, request: User, enterprise_id: &str) -> UserInsertCall<'a, C, A> { - UserInsertCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. - /// - /// This call only works with Google managed accounts. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn generate_token(&self, enterprise_id: &str, user_id: &str) -> UserGenerateTokenCall<'a, C, A> { - UserGenerateTokenCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deleted an EMM-managed user. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn delete(&self, enterprise_id: &str, user_id: &str) -> UserDeleteCall<'a, C, A> { - UserDeleteCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `email` - The exact primary email address of the user to look up. - pub fn list(&self, enterprise_id: &str, email: &str) -> UserListCall<'a, C, A> { - UserListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _email: email.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. - /// - /// You can provision a maximum of 10 devices per user. - /// - /// This call only works with EMM-managed accounts. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn generate_authentication_token(&self, enterprise_id: &str, user_id: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { - UserGenerateAuthenticationTokenCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -3012,7 +2958,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.installs(); /// # } @@ -3027,54 +2973,6 @@ impl<'a, C, A> MethodsBuilder for InstallMethods<'a, C, A> {} impl<'a, C, A> InstallMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The Android ID of the device. - /// * `installId` - The ID of the product represented by the install, e.g. "app:com.google.android.gm". - pub fn patch(&self, request: Install, enterprise_id: &str, user_id: &str, device_id: &str, install_id: &str) -> InstallPatchCall<'a, C, A> { - InstallPatchCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _install_id: install_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The Android ID of the device. - /// * `installId` - The ID of the product represented by the install, e.g. "app:com.google.android.gm". - pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, install_id: &str) -> InstallDeleteCall<'a, C, A> { - InstallDeleteCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _install_id: install_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves details of an installation of an app on a device. @@ -3119,6 +3017,29 @@ impl<'a, C, A> InstallMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The Android ID of the device. + /// * `installId` - The ID of the product represented by the install, e.g. "app:com.google.android.gm". + pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, install_id: &str) -> InstallDeleteCall<'a, C, A> { + InstallDeleteCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_id.to_string(), + _install_id: install_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. @@ -3171,7 +3092,7 @@ impl<'a, C, A> InstallMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.webapps(); /// # } @@ -3186,6 +3107,42 @@ impl<'a, C, A> MethodsBuilder for WebappMethods<'a, C, A> {} impl<'a, C, A> WebappMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Creates a new web app for the enterprise. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + pub fn insert(&self, request: WebApp, enterprise_id: &str) -> WebappInsertCall<'a, C, A> { + WebappInsertCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the details of all web apps for a given enterprise. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn list(&self, enterprise_id: &str) -> WebappListCall<'a, C, A> { + WebappListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets an existing web app. @@ -3244,63 +3201,6 @@ impl<'a, C, A> WebappMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Updates an existing web app. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `webAppId` - The ID of the web app. - pub fn patch(&self, request: WebApp, enterprise_id: &str, web_app_id: &str) -> WebappPatchCall<'a, C, A> { - WebappPatchCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _web_app_id: web_app_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the details of all web apps for a given enterprise. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn list(&self, enterprise_id: &str) -> WebappListCall<'a, C, A> { - WebappListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new web app for the enterprise. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - pub fn insert(&self, request: WebApp, enterprise_id: &str) -> WebappInsertCall<'a, C, A> { - WebappInsertCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -3329,7 +3229,7 @@ impl<'a, C, A> WebappMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.managedconfigurationsfordevice(); /// # } @@ -3344,6 +3244,29 @@ impl<'a, C, A> MethodsBuilder for ManagedconfigurationsfordeviceMethods<'a, C, A impl<'a, C, A> ManagedconfigurationsfordeviceMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Removes a per-device managed configuration for an app for the specified device. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The Android ID of the device. + /// * `managedConfigurationForDeviceId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + ManagedconfigurationsfordeviceDeleteCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_id.to_string(), + _managed_configuration_for_device_id: managed_configuration_for_device_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Adds or updates a per-device managed configuration for an app for the specified device. @@ -3369,31 +3292,6 @@ impl<'a, C, A> ManagedconfigurationsfordeviceMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The Android ID of the device. - /// * `managedConfigurationForDeviceId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - pub fn patch(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - ManagedconfigurationsfordevicePatchCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _managed_configuration_for_device_id: managed_configuration_for_device_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists all the per-device managed configurations for the specified device. Only the ID is set. @@ -3415,29 +3313,6 @@ impl<'a, C, A> ManagedconfigurationsfordeviceMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Removes a per-device managed configuration for an app for the specified device. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The Android ID of the device. - /// * `managedConfigurationForDeviceId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - ManagedconfigurationsfordeviceDeleteCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _managed_configuration_for_device_id: managed_configuration_for_device_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves details of a per-device managed configuration. @@ -3566,7 +3441,7 @@ impl<'a, C, A> GrouplicenseMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `force_report_upload(...)`, `get(...)`, `get_state(...)`, `list(...)`, `patch(...)`, `set_state(...)` and `update(...)` +/// // like `force_report_upload(...)`, `get(...)`, `get_state(...)`, `list(...)`, `set_state(...)` and `update(...)` /// // to build up your call. /// let rb = hub.devices(); /// # } @@ -3581,29 +3456,6 @@ impl<'a, C, A> MethodsBuilder for DeviceMethods<'a, C, A> {} impl<'a, C, A> DeviceMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The ID of the device. - pub fn set_state(&self, request: DeviceState, enterprise_id: &str, user_id: &str, device_id: &str) -> DeviceSetStateCall<'a, C, A> { - DeviceSetStateCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device. @@ -3627,7 +3479,7 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the device policy. This method supports patch semantics. + /// Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. /// /// # Arguments /// @@ -3635,35 +3487,13 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. /// * `deviceId` - The ID of the device. - pub fn patch(&self, request: Device, enterprise_id: &str, user_id: &str, device_id: &str) -> DevicePatchCall<'a, C, A> { - DevicePatchCall { + pub fn set_state(&self, request: DeviceState, enterprise_id: &str, user_id: &str, device_id: &str) -> DeviceSetStateCall<'a, C, A> { + DeviceSetStateCall { hub: self.hub, _request: request, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), _device_id: device_id.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the details of a device. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The ID of the device. - pub fn get(&self, enterprise_id: &str, user_id: &str, device_id: &str) -> DeviceGetCall<'a, C, A> { - DeviceGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3691,6 +3521,46 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the IDs of all of a user's devices. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn list(&self, enterprise_id: &str, user_id: &str) -> DeviceListCall<'a, C, A> { + DeviceListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the details of a device. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The ID of the device. + pub fn get(&self, enterprise_id: &str, user_id: &str, device_id: &str) -> DeviceGetCall<'a, C, A> { + DeviceGetCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the device policy @@ -3714,25 +3584,6 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the IDs of all of a user's devices. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn list(&self, enterprise_id: &str, user_id: &str) -> DeviceListCall<'a, C, A> { - DeviceListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -3776,6 +3627,89 @@ impl<'a, C, A> MethodsBuilder for EnterpriseMethods<'a, C, A> {} impl<'a, C, A> EnterpriseMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. + pub fn acknowledge_notification_set(&self) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { + EnterpriseAcknowledgeNotificationSetCall { + hub: self.hub, + _notification_set_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Unenrolls an enterprise from the calling EMM. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn unenroll(&self, enterprise_id: &str) -> EnterpriseUnenrollCall<'a, C, A> { + EnterpriseUnenrollCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + pub fn create_web_token(&self, request: AdministratorWebTokenSpec, enterprise_id: &str) -> EnterpriseCreateWebTokenCall<'a, C, A> { + EnterpriseCreateWebTokenCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn send_test_push_notification(&self, enterprise_id: &str) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { + EnterpriseSendTestPushNotificationCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. + /// + /// # Arguments + /// + /// * `domain` - The exact primary domain name of the enterprise to look up. + pub fn list(&self, domain: &str) -> EnterpriseListCall<'a, C, A> { + EnterpriseListCall { + hub: self.hub, + _domain: domain.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. @@ -3795,6 +3729,20 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. + pub fn complete_signup(&self) -> EnterpriseCompleteSignupCall<'a, C, A> { + EnterpriseCompleteSignupCall { + hub: self.hub, + _enterprise_token: Default::default(), + _completion_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. @@ -3848,61 +3796,6 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Sets the account that will be used to authenticate to the API as the enterprise. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - pub fn set_account(&self, request: EnterpriseAccount, enterprise_id: &str) -> EnterpriseSetAccountCall<'a, C, A> { - EnterpriseSetAccountCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - pub fn create_web_token(&self, request: AdministratorWebTokenSpec, enterprise_id: &str) -> EnterpriseCreateWebTokenCall<'a, C, A> { - EnterpriseCreateWebTokenCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. - /// - /// # Arguments - /// - /// * `domain` - The exact primary domain name of the enterprise to look up. - pub fn list(&self, domain: &str) -> EnterpriseListCall<'a, C, A> { - EnterpriseListCall { - hub: self.hub, - _domain: domain.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. @@ -3946,58 +3839,16 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. - pub fn complete_signup(&self) -> EnterpriseCompleteSignupCall<'a, C, A> { - EnterpriseCompleteSignupCall { - hub: self.hub, - _enterprise_token: Default::default(), - _completion_token: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. - pub fn acknowledge_notification_set(&self) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { - EnterpriseAcknowledgeNotificationSetCall { - hub: self.hub, - _notification_set_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Unenrolls an enterprise from the calling EMM. + /// Sets the account that will be used to authenticate to the API as the enterprise. /// /// # Arguments /// + /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. - pub fn unenroll(&self, enterprise_id: &str) -> EnterpriseUnenrollCall<'a, C, A> { - EnterpriseUnenrollCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn send_test_push_notification(&self, enterprise_id: &str) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { - EnterpriseSendTestPushNotificationCall { + pub fn set_account(&self, request: EnterpriseAccount, enterprise_id: &str) -> EnterpriseSetAccountCall<'a, C, A> { + EnterpriseSetAccountCall { hub: self.hub, + _request: request, _enterprise_id: enterprise_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -4045,7 +3896,7 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.storelayoutclusters(); /// # } @@ -4081,21 +3932,19 @@ impl<'a, C, A> StorelayoutclusterMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a cluster. This method supports patch semantics. + /// Inserts a new cluster in a page. /// /// # Arguments /// /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. - /// * `clusterId` - The ID of the cluster. - pub fn patch(&self, request: StoreCluster, enterprise_id: &str, page_id: &str, cluster_id: &str) -> StorelayoutclusterPatchCall<'a, C, A> { - StorelayoutclusterPatchCall { + pub fn insert(&self, request: StoreCluster, enterprise_id: &str, page_id: &str) -> StorelayoutclusterInsertCall<'a, C, A> { + StorelayoutclusterInsertCall { hub: self.hub, _request: request, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), - _cluster_id: cluster_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4127,15 +3976,15 @@ impl<'a, C, A> StorelayoutclusterMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves details of a cluster. + /// Deletes a cluster. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. /// * `clusterId` - The ID of the cluster. - pub fn get(&self, enterprise_id: &str, page_id: &str, cluster_id: &str) -> StorelayoutclusterGetCall<'a, C, A> { - StorelayoutclusterGetCall { + pub fn delete(&self, enterprise_id: &str, page_id: &str, cluster_id: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { + StorelayoutclusterDeleteCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), @@ -4148,36 +3997,15 @@ impl<'a, C, A> StorelayoutclusterMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Inserts a new cluster in a page. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `pageId` - The ID of the page. - pub fn insert(&self, request: StoreCluster, enterprise_id: &str, page_id: &str) -> StorelayoutclusterInsertCall<'a, C, A> { - StorelayoutclusterInsertCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _page_id: page_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes a cluster. + /// Retrieves details of a cluster. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. /// * `pageId` - The ID of the page. /// * `clusterId` - The ID of the cluster. - pub fn delete(&self, enterprise_id: &str, page_id: &str, cluster_id: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { - StorelayoutclusterDeleteCall { + pub fn get(&self, enterprise_id: &str, page_id: &str, cluster_id: &str) -> StorelayoutclusterGetCall<'a, C, A> { + StorelayoutclusterGetCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), @@ -4230,6 +4058,26 @@ impl<'a, C, A> MethodsBuilder for ProductMethods<'a, C, A> {} impl<'a, C, A> ProductMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Retrieves details of a product for display to an enterprise admin. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `productId` - The ID of the product, e.g. "app:com.google.android.gm". + pub fn get(&self, enterprise_id: &str, product_id: &str) -> ProductGetCall<'a, C, A> { + ProductGetCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _product_id: product_id.to_string(), + _language: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves the Android app permissions required by this app. @@ -4249,6 +4097,28 @@ impl<'a, C, A> ProductMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. + /// + /// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `productId` - The ID of the product. + pub fn generate_approval_url(&self, enterprise_id: &str, product_id: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + ProductGenerateApprovalUrlCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _product_id: product_id.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Unapproves the specified product (and the relevant app permissions, if any) @@ -4268,26 +4138,6 @@ impl<'a, C, A> ProductMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves details of a product for display to an enterprise admin. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `productId` - The ID of the product, e.g. "app:com.google.android.gm". - pub fn get(&self, enterprise_id: &str, product_id: &str) -> ProductGetCall<'a, C, A> { - ProductGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _product_id: product_id.to_string(), - _language: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. @@ -4352,28 +4202,6 @@ impl<'a, C, A> ProductMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. - /// - /// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `productId` - The ID of the product. - pub fn generate_approval_url(&self, enterprise_id: &str, product_id: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - ProductGenerateApprovalUrlCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _product_id: product_id.to_string(), - _language_code: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -4402,7 +4230,7 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.managedconfigurationsforuser(); /// # } @@ -4419,7 +4247,7 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. This method supports patch semantics. + /// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. /// /// # Arguments /// @@ -4427,8 +4255,8 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. /// * `managedConfigurationForUserId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - pub fn patch(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, managed_configuration_for_user_id: &str) -> ManagedconfigurationsforuserPatchCall<'a, C, A> { - ManagedconfigurationsforuserPatchCall { + pub fn update(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, managed_configuration_for_user_id: &str) -> ManagedconfigurationsforuserUpdateCall<'a, C, A> { + ManagedconfigurationsforuserUpdateCall { hub: self.hub, _request: request, _enterprise_id: enterprise_id.to_string(), @@ -4440,25 +4268,6 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists all the per-user managed configurations for the specified user. Only the ID is set. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn list(&self, enterprise_id: &str, user_id: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { - ManagedconfigurationsforuserListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Removes a per-user managed configuration for an app for the specified user. @@ -4482,21 +4291,17 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. + /// Lists all the per-user managed configurations for the specified user. Only the ID is set. /// /// # Arguments /// - /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. - /// * `managedConfigurationForUserId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - pub fn update(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, managed_configuration_for_user_id: &str) -> ManagedconfigurationsforuserUpdateCall<'a, C, A> { - ManagedconfigurationsforuserUpdateCall { + pub fn list(&self, enterprise_id: &str, user_id: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { + ManagedconfigurationsforuserListCall { hub: self.hub, - _request: request, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), - _managed_configuration_for_user_id: managed_configuration_for_user_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4612,7 +4417,7 @@ impl<'a, C, A> GrouplicenseuserMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.entitlements(); /// # } @@ -4627,25 +4432,6 @@ impl<'a, C, A> MethodsBuilder for EntitlementMethods<'a, C, A> {} impl<'a, C, A> EntitlementMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Lists all entitlements for the specified user. Only the ID is set. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn list(&self, enterprise_id: &str, user_id: &str) -> EntitlementListCall<'a, C, A> { - EntitlementListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Adds or updates an entitlement to an app for a user. @@ -4691,6 +4477,25 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all entitlements for the specified user. Only the ID is set. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn list(&self, enterprise_id: &str, user_id: &str) -> EntitlementListCall<'a, C, A> { + EntitlementListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Removes an entitlement to an app for a user. @@ -4711,30 +4516,6 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Adds or updates an entitlement to an app for a user. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `entitlementId` - The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - pub fn patch(&self, request: Entitlement, enterprise_id: &str, user_id: &str, entitlement_id: &str) -> EntitlementPatchCall<'a, C, A> { - EntitlementPatchCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _entitlement_id: entitlement_id.to_string(), - _install: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -4778,23 +4559,6 @@ impl<'a, C, A> MethodsBuilder for ServiceaccountkeyMethods<'a, C, A> {} impl<'a, C, A> ServiceaccountkeyMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn list(&self, enterprise_id: &str) -> ServiceaccountkeyListCall<'a, C, A> { - ServiceaccountkeyListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. @@ -4816,6 +4580,23 @@ impl<'a, C, A> ServiceaccountkeyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn list(&self, enterprise_id: &str) -> ServiceaccountkeyListCall<'a, C, A> { + ServiceaccountkeyListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. @@ -4904,7 +4685,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { // CallBuilders ### // ################# -/// Lists all the managed configurations settings for the specified app. Only the ID and the name is set. +/// Lists all the managed configurations settings for the specified app. /// /// A builder for the *list* method supported by a *managedconfigurationssetting* resource. /// It is not used directly, but through a `ManagedconfigurationssettingMethods` instance. @@ -5156,6 +4937,498 @@ impl<'a, C, A> ManagedconfigurationssettingListCall<'a, C, A> where C: BorrowMut } +/// Retrieves the details of all pages in the store. +/// +/// A builder for the *list* method supported by a *storelayoutpage* resource. +/// It is not used directly, but through a `StorelayoutpageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.storelayoutpages().list("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct StorelayoutpageListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for StorelayoutpageListCall<'a, C, A> {} + +impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, StoreLayoutPagesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutpageListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> StorelayoutpageListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> StorelayoutpageListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves details of a store page. +/// +/// A builder for the *get* method supported by a *storelayoutpage* resource. +/// It is not used directly, but through a `StorelayoutpageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.storelayoutpages().get("enterpriseId", "pageId") +/// .doit(); +/// # } +/// ``` +pub struct StorelayoutpageGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _page_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for StorelayoutpageGetCall<'a, C, A> {} + +impl<'a, C, A> StorelayoutpageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, StorePage)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("pageId", self._page_id.to_string())); + for &field in ["alt", "enterpriseId", "pageId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages/{pageId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["pageId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageGetCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the page. + /// + /// Sets the *page id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn page_id(mut self, new_value: &str) -> StorelayoutpageGetCall<'a, C, A> { + self._page_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutpageGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> StorelayoutpageGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> StorelayoutpageGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a store page. /// /// A builder for the *delete* method supported by a *storelayoutpage* resource. @@ -5397,289 +5670,6 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = StorePage::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.storelayoutpages().patch(req, "enterpriseId", "pageId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutpagePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: StorePage, - _enterprise_id: String, - _page_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutpagePatchCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StorePage)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("pageId", self._page_id.to_string())); - for &field in ["alt", "enterpriseId", "pageId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages/{pageId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["pageId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: StorePage) -> StorelayoutpagePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpagePatchCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the page. - /// - /// Sets the *page id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn page_id(mut self, new_value: &str) -> StorelayoutpagePatchCall<'a, C, A> { - self._page_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutpagePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutpagePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutpagePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Inserts a new store page. /// /// A builder for the *insert* method supported by a *storelayoutpage* resource. @@ -5951,258 +5941,6 @@ impl<'a, C, A> StorelayoutpageInsertCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.storelayoutpages().get("enterpriseId", "pageId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutpageGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _page_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutpageGetCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutpageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StorePage)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("pageId", self._page_id.to_string())); - for &field in ["alt", "enterpriseId", "pageId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages/{pageId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["pageId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageGetCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the page. - /// - /// Sets the *page id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn page_id(mut self, new_value: &str) -> StorelayoutpageGetCall<'a, C, A> { - self._page_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutpageGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutpageGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutpageGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates the content of a store page. /// /// A builder for the *update* method supported by a *storelayoutpage* resource. @@ -6486,246 +6224,6 @@ impl<'a, C, A> StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.storelayoutpages().list("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutpageListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutpageListCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StoreLayoutPagesListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutpageListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutpageListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutpageListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Revokes a previously generated token (activation code) for the user. /// /// A builder for the *revokeToken* method supported by a *user* resource. @@ -7495,11 +6993,761 @@ impl<'a, C, A> UserRevokeDeviceAccesCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.users().delete("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserDeleteCall<'a, C, A> {} + +impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.users.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserDeleteCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserDeleteCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. +/// +/// You can provision a maximum of 10 devices per user. +/// +/// This call only works with EMM-managed accounts. +/// +/// A builder for the *generateAuthenticationToken* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.users().generate_authentication_token("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserGenerateAuthenticationTokenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserGenerateAuthenticationTokenCall<'a, C, A> {} + +impl<'a, C, A> UserGenerateAuthenticationTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AuthenticationToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.users.generateAuthenticationToken", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/authenticationToken"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserGenerateAuthenticationTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. +/// +/// A builder for the *list* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.users().list("enterpriseId", "email") +/// .doit(); +/// # } +/// ``` +pub struct UserListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _email: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserListCall<'a, C, A> {} + +impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UsersListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.users.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("email", self._email.to_string())); + for &field in ["alt", "enterpriseId", "email"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The exact primary email address of the user to look up. + /// + /// Sets the *email* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn email(mut self, new_value: &str) -> UserListCall<'a, C, A> { + self._email = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new EMM-managed user. +/// +/// The Users resource passed in the body of the request should include an accountIdentifier and an accountType. +/// If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. +/// +/// A builder for the *insert* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. /// /// # Example @@ -7530,25 +7778,24 @@ impl<'a, C, A> UserRevokeDeviceAccesCall<'a, C, A> where C: BorrowMut +pub struct UserInsertCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, _request: User, _enterprise_id: String, - _user_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UserPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for UserInsertCall<'a, C, A> {} -impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -7560,12 +7807,11 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.users.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "androidenterprise.users.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { + for &field in ["alt", "enterpriseId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7577,12 +7823,12 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -7593,8 +7839,8 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -7636,7 +7882,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -7697,7 +7943,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: User) -> UserPatchCall<'a, C, A> { + pub fn request(mut self, new_value: User) -> UserInsertCall<'a, C, A> { self._request = new_value; self } @@ -7707,27 +7953,17 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserPatchCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> UserInsertCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserPatchCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserInsertCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7748,7 +7984,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UserInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -7768,7 +8004,513 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UserInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a user's details. +/// +/// A builder for the *get* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.users().get("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserGetCall<'a, C, A> {} + +impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.users.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. +/// +/// This call only works with Google managed accounts. +/// +/// A builder for the *generateToken* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.users().generate_token("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserGenerateTokenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserGenerateTokenCall<'a, C, A> {} + +impl<'a, C, A> UserGenerateTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UserToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.users.generateToken", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/token"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateTokenCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserGenerateTokenCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserGenerateTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserGenerateTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserGenerateTokenCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8315,2107 +9057,6 @@ impl<'a, C, A> UserGetAvailableProductSetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.users().get("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserGetCall<'a, C, A> {} - -impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.users.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new EMM-managed user. -/// -/// The Users resource passed in the body of the request should include an accountIdentifier and an accountType. -/// If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. -/// -/// A builder for the *insert* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::User; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = User::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.users().insert(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct UserInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: User, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserInsertCall<'a, C, A> {} - -impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.users.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: User) -> UserInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserInsertCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. -/// -/// This call only works with Google managed accounts. -/// -/// A builder for the *generateToken* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.users().generate_token("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserGenerateTokenCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserGenerateTokenCall<'a, C, A> {} - -impl<'a, C, A> UserGenerateTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, UserToken)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.users.generateToken", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/token"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateTokenCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserGenerateTokenCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserGenerateTokenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserGenerateTokenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserGenerateTokenCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deleted an EMM-managed user. -/// -/// A builder for the *delete* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.users().delete("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserDeleteCall<'a, C, A> {} - -impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.users.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserDeleteCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserDeleteCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. -/// -/// A builder for the *list* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.users().list("enterpriseId", "email") -/// .doit(); -/// # } -/// ``` -pub struct UserListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _email: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserListCall<'a, C, A> {} - -impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, UsersListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.users.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("email", self._email.to_string())); - for &field in ["alt", "enterpriseId", "email"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The exact primary email address of the user to look up. - /// - /// Sets the *email* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn email(mut self, new_value: &str) -> UserListCall<'a, C, A> { - self._email = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. -/// -/// You can provision a maximum of 10 devices per user. -/// -/// This call only works with EMM-managed accounts. -/// -/// A builder for the *generateAuthenticationToken* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.users().generate_authentication_token("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserGenerateAuthenticationTokenCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserGenerateAuthenticationTokenCall<'a, C, A> {} - -impl<'a, C, A> UserGenerateAuthenticationTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AuthenticationToken)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.users.generateAuthenticationToken", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/authenticationToken"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UserGenerateAuthenticationTokenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *install* resource. -/// It is not used directly, but through a `InstallMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::Install; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Install::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.installs().patch(req, "enterpriseId", "userId", "deviceId", "installId") -/// .doit(); -/// # } -/// ``` -pub struct InstallPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: Install, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _install_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstallPatchCall<'a, C, A> {} - -impl<'a, C, A> InstallPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Install)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.installs.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("deviceId", self._device_id.to_string())); - params.push(("installId", self._install_id.to_string())); - for &field in ["alt", "enterpriseId", "userId", "deviceId", "installId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId"), ("{installId}", "installId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(4); - for param_name in ["installId", "deviceId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Install) -> InstallPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> InstallPatchCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> InstallPatchCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android ID of the device. - /// - /// Sets the *device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn device_id(mut self, new_value: &str) -> InstallPatchCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The ID of the product represented by the install, e.g. "app:com.google.android.gm". - /// - /// Sets the *install id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn install_id(mut self, new_value: &str) -> InstallPatchCall<'a, C, A> { - self._install_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstallPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstallPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstallPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. -/// -/// A builder for the *delete* method supported by a *install* resource. -/// It is not used directly, but through a `InstallMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.installs().delete("enterpriseId", "userId", "deviceId", "installId") -/// .doit(); -/// # } -/// ``` -pub struct InstallDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _install_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstallDeleteCall<'a, C, A> {} - -impl<'a, C, A> InstallDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.installs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("deviceId", self._device_id.to_string())); - params.push(("installId", self._install_id.to_string())); - for &field in ["enterpriseId", "userId", "deviceId", "installId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId"), ("{installId}", "installId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(4); - for param_name in ["installId", "deviceId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android ID of the device. - /// - /// Sets the *device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn device_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The ID of the product represented by the install, e.g. "app:com.google.android.gm". - /// - /// Sets the *install id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn install_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { - self._install_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstallDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstallDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstallDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves details of an installation of an app on a device. /// /// A builder for the *get* method supported by a *install* resource. @@ -10956,6 +9597,271 @@ impl<'a, C, A> InstallListCall<'a, C, A> where C: BorrowMut, A: o } +/// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. +/// +/// A builder for the *delete* method supported by a *install* resource. +/// It is not used directly, but through a `InstallMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.installs().delete("enterpriseId", "userId", "deviceId", "installId") +/// .doit(); +/// # } +/// ``` +pub struct InstallDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _install_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstallDeleteCall<'a, C, A> {} + +impl<'a, C, A> InstallDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.installs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + params.push(("deviceId", self._device_id.to_string())); + params.push(("installId", self._install_id.to_string())); + for &field in ["enterpriseId", "userId", "deviceId", "installId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId"), ("{installId}", "installId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(4); + for param_name in ["installId", "deviceId", "userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The Android ID of the device. + /// + /// Sets the *device id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn device_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The ID of the product represented by the install, e.g. "app:com.google.android.gm". + /// + /// Sets the *install id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn install_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { + self._install_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstallDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstallDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstallDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. /// /// A builder for the *update* method supported by a *install* resource. @@ -11263,6 +10169,517 @@ impl<'a, C, A> InstallUpdateCall<'a, C, A> where C: BorrowMut, A: } +/// Creates a new web app for the enterprise. +/// +/// A builder for the *insert* method supported by a *webapp* resource. +/// It is not used directly, but through a `WebappMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// use androidenterprise1::WebApp; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = WebApp::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.webapps().insert(req, "enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct WebappInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: WebApp, + _enterprise_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for WebappInsertCall<'a, C, A> {} + +impl<'a, C, A> WebappInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, WebApp)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.webapps.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/webApps"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: WebApp) -> WebappInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> WebappInsertCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> WebappInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> WebappInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> WebappInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the details of all web apps for a given enterprise. +/// +/// A builder for the *list* method supported by a *webapp* resource. +/// It is not used directly, but through a `WebappMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.webapps().list("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct WebappListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for WebappListCall<'a, C, A> {} + +impl<'a, C, A> WebappListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, WebAppsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.webapps.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/webApps"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> WebappListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> WebappListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> WebappListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> WebappListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets an existing web app. /// /// A builder for the *get* method supported by a *webapp* resource. @@ -12039,10 +11456,10 @@ impl<'a, C, A> WebappUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Updates an existing web app. This method supports patch semantics. +/// Removes a per-device managed configuration for an app for the specified device. /// -/// A builder for the *patch* method supported by a *webapp* resource. -/// It is not used directly, but through a `WebappMethods` instance. +/// A builder for the *delete* method supported by a *managedconfigurationsfordevice* resource. +/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. /// /// # Example /// @@ -12053,7 +11470,6 @@ impl<'a, C, A> WebappUpdateCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::WebApp; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -12064,37 +11480,33 @@ impl<'a, C, A> WebappUpdateCall<'a, C, A> where C: BorrowMut, A: /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = WebApp::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.webapps().patch(req, "enterpriseId", "webAppId") +/// let result = hub.managedconfigurationsfordevice().delete("enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId") /// .doit(); /// # } /// ``` -pub struct WebappPatchCall<'a, C, A> +pub struct ManagedconfigurationsfordeviceDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, - _request: WebApp, _enterprise_id: String, - _web_app_id: String, + _user_id: String, + _device_id: String, + _managed_configuration_for_device_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for WebappPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceDeleteCall<'a, C, A> {} -impl<'a, C, A> WebappPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, WebApp)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -12102,12 +11514,14 @@ impl<'a, C, A> WebappPatchCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.webapps.patch", - http_method: hyper::method::Method::Patch }); + dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsfordevice.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("webAppId", self._web_app_id.to_string())); - for &field in ["alt", "enterpriseId", "webAppId"].iter() { + params.push(("userId", self._user_id.to_string())); + params.push(("deviceId", self._device_id.to_string())); + params.push(("managedConfigurationForDeviceId", self._managed_configuration_for_device_id.to_string())); + for &field in ["enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12117,14 +11531,13 @@ impl<'a, C, A> WebappPatchCall<'a, C, A> where C: BorrowMut, A: o params.push((&name, value.clone())); } - params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/webApps/{webAppId}"; + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{webAppId}", "webAppId")].iter() { + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId"), ("{managedConfigurationForDeviceId}", "managedConfigurationForDeviceId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -12135,282 +11548,8 @@ impl<'a, C, A> WebappPatchCall<'a, C, A> where C: BorrowMut, A: o url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["webAppId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: WebApp) -> WebappPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> WebappPatchCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the web app. - /// - /// Sets the *web app id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn web_app_id(mut self, new_value: &str) -> WebappPatchCall<'a, C, A> { - self._web_app_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> WebappPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> WebappPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> WebappPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the details of all web apps for a given enterprise. -/// -/// A builder for the *list* method supported by a *webapp* resource. -/// It is not used directly, but through a `WebappMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.webapps().list("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct WebappListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for WebappListCall<'a, C, A> {} - -impl<'a, C, A> WebappListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, WebAppsListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.webapps.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/webApps"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(4); + for param_name in ["managedConfigurationForDeviceId", "deviceId", "userId", "enterpriseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -12440,7 +11579,7 @@ impl<'a, C, A> WebappListCall<'a, C, A> where C: BorrowMut, A: oa let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -12473,17 +11612,7 @@ impl<'a, C, A> WebappListCall<'a, C, A> where C: BorrowMut, A: oa Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -12499,17 +11628,47 @@ impl<'a, C, A> WebappListCall<'a, C, A> where C: BorrowMut, A: oa /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> WebappListCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The Android ID of the device. + /// + /// Sets the *device id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + /// + /// Sets the *managed configuration for device id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn managed_configuration_for_device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + self._managed_configuration_for_device_id = new_value.to_string(); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> WebappListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12530,7 +11689,7 @@ impl<'a, C, A> WebappListCall<'a, C, A> where C: BorrowMut, A: oa /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> WebappListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -12550,278 +11709,7 @@ impl<'a, C, A> WebappListCall<'a, C, A> where C: BorrowMut, A: oa /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> WebappListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new web app for the enterprise. -/// -/// A builder for the *insert* method supported by a *webapp* resource. -/// It is not used directly, but through a `WebappMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::WebApp; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = WebApp::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.webapps().insert(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct WebappInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: WebApp, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for WebappInsertCall<'a, C, A> {} - -impl<'a, C, A> WebappInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, WebApp)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.webapps.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/webApps"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: WebApp) -> WebappInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> WebappInsertCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> WebappInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> WebappInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> WebappInsertCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13140,313 +12028,6 @@ impl<'a, C, A> ManagedconfigurationsfordeviceUpdateCall<'a, C, A> where C: Borro } -/// Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *managedconfigurationsfordevice* resource. -/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::ManagedConfiguration; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ManagedConfiguration::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.managedconfigurationsfordevice().patch(req, "enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsfordevicePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: ManagedConfiguration, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _managed_configuration_for_device_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsfordevicePatchCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsfordevicePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfiguration)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsfordevice.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("deviceId", self._device_id.to_string())); - params.push(("managedConfigurationForDeviceId", self._managed_configuration_for_device_id.to_string())); - for &field in ["alt", "enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId"), ("{managedConfigurationForDeviceId}", "managedConfigurationForDeviceId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(4); - for param_name in ["managedConfigurationForDeviceId", "deviceId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ManagedConfiguration) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android ID of the device. - /// - /// Sets the *device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn device_id(mut self, new_value: &str) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *managed configuration for device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn managed_configuration_for_device_id(mut self, new_value: &str) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - self._managed_configuration_for_device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists all the per-device managed configurations for the specified device. Only the ID is set. /// /// A builder for the *list* method supported by a *managedconfigurationsfordevice* resource. @@ -13711,271 +12292,6 @@ impl<'a, C, A> ManagedconfigurationsfordeviceListCall<'a, C, A> where C: BorrowM } -/// Removes a per-device managed configuration for an app for the specified device. -/// -/// A builder for the *delete* method supported by a *managedconfigurationsfordevice* resource. -/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.managedconfigurationsfordevice().delete("enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsfordeviceDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _managed_configuration_for_device_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceDeleteCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsfordevice.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("deviceId", self._device_id.to_string())); - params.push(("managedConfigurationForDeviceId", self._managed_configuration_for_device_id.to_string())); - for &field in ["enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId"), ("{managedConfigurationForDeviceId}", "managedConfigurationForDeviceId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(4); - for param_name in ["managedConfigurationForDeviceId", "deviceId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android ID of the device. - /// - /// Sets the *device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *managed configuration for device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn managed_configuration_for_device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._managed_configuration_for_device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves details of a per-device managed configuration. /// /// A builder for the *get* method supported by a *managedconfigurationsfordevice* resource. @@ -14744,6 +13060,259 @@ impl<'a, C, A> GrouplicenseListCall<'a, C, A> where C: BorrowMut, } +/// Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device. +/// +/// A builder for the *forceReportUpload* method supported by a *device* resource. +/// It is not used directly, but through a `DeviceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.devices().force_report_upload("enterpriseId", "userId", "deviceId") +/// .doit(); +/// # } +/// ``` +pub struct DeviceForceReportUploadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeviceForceReportUploadCall<'a, C, A> {} + +impl<'a, C, A> DeviceForceReportUploadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.devices.forceReportUpload", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + params.push(("deviceId", self._device_id.to_string())); + for &field in ["enterpriseId", "userId", "deviceId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["deviceId", "userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> DeviceForceReportUploadCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> DeviceForceReportUploadCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The ID of the device. + /// + /// Sets the *device id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn device_id(mut self, new_value: &str) -> DeviceForceReportUploadCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DeviceForceReportUploadCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeviceForceReportUploadCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DeviceForceReportUploadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. /// /// A builder for the *setState* method supported by a *device* resource. @@ -15039,9 +13608,9 @@ impl<'a, C, A> DeviceSetStateCall<'a, C, A> where C: BorrowMut, A } -/// Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device. +/// Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. /// -/// A builder for the *forceReportUpload* method supported by a *device* resource. +/// A builder for the *getState* method supported by a *device* resource. /// It is not used directly, but through a `DeviceMethods` instance. /// /// # Example @@ -15066,11 +13635,11 @@ impl<'a, C, A> DeviceSetStateCall<'a, C, A> where C: BorrowMut, A /// // 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.devices().force_report_upload("enterpriseId", "userId", "deviceId") +/// let result = hub.devices().get_state("enterpriseId", "userId", "deviceId") /// .doit(); /// # } /// ``` -pub struct DeviceForceReportUploadCall<'a, C, A> +pub struct DeviceGetStateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, @@ -15082,13 +13651,13 @@ pub struct DeviceForceReportUploadCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for DeviceForceReportUploadCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for DeviceGetStateCall<'a, C, A> {} -impl<'a, C, A> DeviceForceReportUploadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> DeviceGetStateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, DeviceState)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -15096,278 +13665,13 @@ impl<'a, C, A> DeviceForceReportUploadCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.devices.forceReportUpload", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "androidenterprise.devices.getState", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("enterpriseId", self._enterprise_id.to_string())); params.push(("userId", self._user_id.to_string())); params.push(("deviceId", self._device_id.to_string())); - for &field in ["enterpriseId", "userId", "deviceId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["deviceId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> DeviceForceReportUploadCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> DeviceForceReportUploadCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The ID of the device. - /// - /// Sets the *device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn device_id(mut self, new_value: &str) -> DeviceForceReportUploadCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DeviceForceReportUploadCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DeviceForceReportUploadCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DeviceForceReportUploadCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the device policy. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *device* resource. -/// It is not used directly, but through a `DeviceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::Device; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Device::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.devices().patch(req, "enterpriseId", "userId", "deviceId") -/// .update_mask("sed") -/// .doit(); -/// # } -/// ``` -pub struct DevicePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: Device, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DevicePatchCall<'a, C, A> {} - -impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Device)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.devices.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("deviceId", self._device_id.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "enterpriseId", "userId", "deviceId", "updateMask"].iter() { + for &field in ["alt", "enterpriseId", "userId", "deviceId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15379,7 +13683,7 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}"; + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15408,17 +13712,6 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o let url = hyper::Url::parse_with_params(&url, params).unwrap(); - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -15435,15 +13728,11 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o } }; let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -15494,22 +13783,13 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o } - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Device) -> DevicePatchCall<'a, C, A> { - self._request = new_value; - self - } /// The ID of the enterprise. /// /// Sets the *enterprise id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> DevicePatchCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> DeviceGetStateCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -15519,7 +13799,7 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> DevicePatchCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> DeviceGetStateCall<'a, C, A> { self._user_id = new_value.to_string(); self } @@ -15529,26 +13809,17 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn device_id(mut self, new_value: &str) -> DevicePatchCall<'a, C, A> { + pub fn device_id(mut self, new_value: &str) -> DeviceGetStateCall<'a, C, A> { self._device_id = new_value.to_string(); self } - /// Mask that identifies which fields to update. If not set, all modifiable fields will be modified. - /// - /// When set in a query parameter, this field should be specified as updateMask=,,... - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> DevicePatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DevicePatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DeviceGetStateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -15569,7 +13840,7 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DevicePatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> DeviceGetStateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -15589,7 +13860,259 @@ impl<'a, C, A> DevicePatchCall<'a, C, A> where C: BorrowMut, A: o /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DevicePatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> DeviceGetStateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the IDs of all of a user's devices. +/// +/// A builder for the *list* method supported by a *device* resource. +/// It is not used directly, but through a `DeviceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.devices().list("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct DeviceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeviceListCall<'a, C, A> {} + +impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DevicesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.devices.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> DeviceListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> DeviceListCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DeviceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeviceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DeviceListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -15865,270 +14388,6 @@ impl<'a, C, A> DeviceGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. -/// -/// A builder for the *getState* method supported by a *device* resource. -/// It is not used directly, but through a `DeviceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.devices().get_state("enterpriseId", "userId", "deviceId") -/// .doit(); -/// # } -/// ``` -pub struct DeviceGetStateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DeviceGetStateCall<'a, C, A> {} - -impl<'a, C, A> DeviceGetStateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DeviceState)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.devices.getState", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("deviceId", self._device_id.to_string())); - for &field in ["alt", "enterpriseId", "userId", "deviceId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{deviceId}", "deviceId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["deviceId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> DeviceGetStateCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> DeviceGetStateCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The ID of the device. - /// - /// Sets the *device id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn device_id(mut self, new_value: &str) -> DeviceGetStateCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DeviceGetStateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DeviceGetStateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DeviceGetStateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates the device policy /// /// A builder for the *update* method supported by a *device* resource. @@ -16163,7 +14422,7 @@ impl<'a, C, A> DeviceGetStateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.devices().update(req, "enterpriseId", "userId", "deviceId") -/// .update_mask("eos") +/// .update_mask("invidunt") /// .doit(); /// # } /// ``` @@ -16438,10 +14697,10 @@ impl<'a, C, A> DeviceUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves the IDs of all of a user's devices. +/// Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. /// -/// A builder for the *list* method supported by a *device* resource. -/// It is not used directly, but through a `DeviceMethods` instance. +/// A builder for the *acknowledgeNotificationSet* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. /// /// # Example /// @@ -16465,28 +14724,28 @@ impl<'a, C, A> DeviceUpdateCall<'a, C, A> where C: BorrowMut, A: /// // 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.devices().list("enterpriseId", "userId") +/// let result = hub.enterprises().acknowledge_notification_set() +/// .notification_set_id("ea") /// .doit(); /// # } /// ``` -pub struct DeviceListCall<'a, C, A> +pub struct EnterpriseAcknowledgeNotificationSetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, + _notification_set_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for DeviceListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for EnterpriseAcknowledgeNotificationSetCall<'a, C, A> {} -impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DevicesListResponse)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -16494,12 +14753,454 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.devices.list", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.acknowledgeNotificationSet", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); + if let Some(value) = self._notification_set_id { + params.push(("notificationSetId", value.to_string())); + } + for &field in ["notificationSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/acknowledgeNotificationSet"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. + /// + /// Sets the *notification set id* query property to the given value. + pub fn notification_set_id(mut self, new_value: &str) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { + self._notification_set_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Unenrolls an enterprise from the calling EMM. +/// +/// A builder for the *unenroll* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.enterprises().unenroll("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseUnenrollCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseUnenrollCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseUnenrollCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.unenroll", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/unenroll"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseUnenrollCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseUnenrollCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseUnenrollCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseUnenrollCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. +/// +/// A builder for the *createWebToken* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// use androidenterprise1::AdministratorWebTokenSpec; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AdministratorWebTokenSpec::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.enterprises().create_web_token(req, "enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseCreateWebTokenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: AdministratorWebTokenSpec, + _enterprise_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseCreateWebTokenCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseCreateWebTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AdministratorWebToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.createWebToken", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { + for &field in ["alt", "enterpriseId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16511,12 +15212,12 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices"; + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/createWebToken"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -16527,8 +15228,8 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -16540,6 +15241,489 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AdministratorWebTokenSpec) -> EnterpriseCreateWebTokenCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseCreateWebTokenCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseCreateWebTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseCreateWebTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseCreateWebTokenCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. +/// +/// A builder for the *sendTestPushNotification* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.enterprises().send_test_push_notification("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseSendTestPushNotificationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseSendTestPushNotificationCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesSendTestPushNotificationResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.sendTestPushNotification", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/sendTestPushNotification"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. +/// +/// A builder for the *list* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.enterprises().list("domain") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _domain: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseListCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("domain", self._domain.to_string())); + for &field in ["alt", "domain"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + loop { @@ -16611,24 +15795,14 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa } - /// The ID of the enterprise. + /// The exact primary domain name of the enterprise to look up. /// - /// Sets the *enterprise id* path property to the given value. + /// Sets the *domain* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> DeviceListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> DeviceListCall<'a, C, A> { - self._user_id = new_value.to_string(); + pub fn domain(mut self, new_value: &str) -> EnterpriseListCall<'a, C, A> { + self._domain = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -16637,7 +15811,7 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DeviceListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -16658,7 +15832,7 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DeviceListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> EnterpriseListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -16678,7 +15852,7 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DeviceListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> EnterpriseListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -16961,6 +16135,237 @@ impl<'a, C, A> EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.enterprises().complete_signup() +/// .enterprise_token("aliquyam") +/// .completion_token("sit") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseCompleteSignupCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_token: Option, + _completion_token: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseCompleteSignupCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Enterprise)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.completeSignup", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + if let Some(value) = self._enterprise_token { + params.push(("enterpriseToken", value.to_string())); + } + if let Some(value) = self._completion_token { + params.push(("completionToken", value.to_string())); + } + for &field in ["alt", "enterpriseToken", "completionToken"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/completeSignup"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The Enterprise token appended to the Callback URL. + /// + /// Sets the *enterprise token* query property to the given value. + pub fn enterprise_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { + self._enterprise_token = Some(new_value.to_string()); + self + } + /// The Completion token initially returned by GenerateSignupUrl. + /// + /// Sets the *completion token* query property to the given value. + pub fn completion_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { + self._completion_token = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseCompleteSignupCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseCompleteSignupCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseCompleteSignupCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. /// A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. /// Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. @@ -16993,7 +16398,7 @@ impl<'a, C, A> EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseGetCall<'a, C, A> where C: BorrowMut, A: } -/// Sets the account that will be used to authenticate to the API as the enterprise. -/// -/// A builder for the *setAccount* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::EnterpriseAccount; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = EnterpriseAccount::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.enterprises().set_account(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseSetAccountCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: EnterpriseAccount, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseSetAccountCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseSetAccountCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, EnterpriseAccount)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.setAccount", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/account"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: EnterpriseAccount) -> EnterpriseSetAccountCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseSetAccountCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseSetAccountCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseSetAccountCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseSetAccountCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. -/// -/// A builder for the *createWebToken* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::AdministratorWebTokenSpec; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AdministratorWebTokenSpec::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.enterprises().create_web_token(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseCreateWebTokenCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: AdministratorWebTokenSpec, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseCreateWebTokenCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseCreateWebTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AdministratorWebToken)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.createWebToken", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/createWebToken"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AdministratorWebTokenSpec) -> EnterpriseCreateWebTokenCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseCreateWebTokenCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseCreateWebTokenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseCreateWebTokenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseCreateWebTokenCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. -/// -/// A builder for the *list* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.enterprises().list("domain") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _domain: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseListCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("domain", self._domain.to_string())); - for &field in ["alt", "domain"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The exact primary domain name of the enterprise to look up. - /// - /// Sets the *domain* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn domain(mut self, new_value: &str) -> EnterpriseListCall<'a, C, A> { - self._domain = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. /// /// This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error. @@ -18472,7 +17116,7 @@ impl<'a, C, A> EnterpriseListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.enterprises().get_service_account("enterpriseId") -/// .key_type("est") +/// .key_type("ea") /// .doit(); /// # } /// ``` @@ -18936,9 +17580,9 @@ impl<'a, C, A> EnterpriseGetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseGetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseGetStoreLayoutCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = EnterpriseAccount::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.enterprises().complete_signup() -/// .enterprise_token("accusam") -/// .completion_token("clita") +/// let result = hub.enterprises().set_account(req, "enterpriseId") /// .doit(); /// # } /// ``` -pub struct EnterpriseCompleteSignupCall<'a, C, A> +pub struct EnterpriseSetAccountCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, - _enterprise_token: Option, - _completion_token: Option, + _request: EnterpriseAccount, + _enterprise_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for EnterpriseCompleteSignupCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for EnterpriseSetAccountCall<'a, C, A> {} -impl<'a, C, A> EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> EnterpriseSetAccountCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Enterprise)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, EnterpriseAccount)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -18994,674 +17642,9 @@ impl<'a, C, A> EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.completeSignup", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.setAccount", + http_method: hyper::method::Method::Put }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - if let Some(value) = self._enterprise_token { - params.push(("enterpriseToken", value.to_string())); - } - if let Some(value) = self._completion_token { - params.push(("completionToken", value.to_string())); - } - for &field in ["alt", "enterpriseToken", "completionToken"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/completeSignup"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The Enterprise token appended to the Callback URL. - /// - /// Sets the *enterprise token* query property to the given value. - pub fn enterprise_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { - self._enterprise_token = Some(new_value.to_string()); - self - } - /// The Completion token initially returned by GenerateSignupUrl. - /// - /// Sets the *completion token* query property to the given value. - pub fn completion_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { - self._completion_token = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseCompleteSignupCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseCompleteSignupCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseCompleteSignupCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. -/// -/// A builder for the *acknowledgeNotificationSet* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.enterprises().acknowledge_notification_set() -/// .notification_set_id("diam") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseAcknowledgeNotificationSetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _notification_set_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseAcknowledgeNotificationSetCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.acknowledgeNotificationSet", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - if let Some(value) = self._notification_set_id { - params.push(("notificationSetId", value.to_string())); - } - for &field in ["notificationSetId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/acknowledgeNotificationSet"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. - /// - /// Sets the *notification set id* query property to the given value. - pub fn notification_set_id(mut self, new_value: &str) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { - self._notification_set_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Unenrolls an enterprise from the calling EMM. -/// -/// A builder for the *unenroll* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.enterprises().unenroll("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseUnenrollCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseUnenrollCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseUnenrollCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.unenroll", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/unenroll"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseUnenrollCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseUnenrollCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseUnenrollCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseUnenrollCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. -/// -/// A builder for the *sendTestPushNotification* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.enterprises().send_test_push_notification("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseSendTestPushNotificationCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseSendTestPushNotificationCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesSendTestPushNotificationResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.sendTestPushNotification", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("enterpriseId", self._enterprise_id.to_string())); for &field in ["alt", "enterpriseId"].iter() { if self._additional_params.contains_key(field) { @@ -19675,7 +17658,7 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/sendTestPushNotification"; + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/account"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19704,6 +17687,17 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -19720,11 +17714,15 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -19775,13 +17773,22 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM } + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: EnterpriseAccount) -> EnterpriseSetAccountCall<'a, C, A> { + self._request = new_value; + self + } /// The ID of the enterprise. /// /// Sets the *enterprise id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseSetAccountCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -19791,7 +17798,7 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EnterpriseSetAccountCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -19812,7 +17819,7 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> EnterpriseSetAccountCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -19832,7 +17839,7 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> EnterpriseSetAccountCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -19872,7 +17879,7 @@ impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.enterprises().generate_signup_url() -/// .callback_url("clita") +/// .callback_url("eos") /// .doit(); /// # } /// ``` @@ -20316,9 +18323,9 @@ impl<'a, C, A> StorelayoutclusterListCall<'a, C, A> where C: BorrowMut StorelayoutclusterListCall<'a, C, A> where C: BorrowMut +pub struct StorelayoutclusterInsertCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, _request: StoreCluster, _enterprise_id: String, _page_id: String, - _cluster_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for StorelayoutclusterPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for StorelayoutclusterInsertCall<'a, C, A> {} -impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -20380,13 +18386,12 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutclusters.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutclusters.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("enterpriseId", self._enterprise_id.to_string())); params.push(("pageId", self._page_id.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["alt", "enterpriseId", "pageId", "clusterId"].iter() { + for &field in ["alt", "enterpriseId", "pageId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -20398,12 +18403,12 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -20414,8 +18419,8 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["clusterId", "pageId", "enterpriseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["pageId", "enterpriseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -20457,7 +18462,7 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut StorelayoutclusterPatchCall<'a, C, A> { + pub fn request(mut self, new_value: StoreCluster) -> StorelayoutclusterInsertCall<'a, C, A> { self._request = new_value; self } @@ -20528,7 +18533,7 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut StorelayoutclusterPatchCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutclusterInsertCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -20538,27 +18543,17 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut StorelayoutclusterPatchCall<'a, C, A> { + pub fn page_id(mut self, new_value: &str) -> StorelayoutclusterInsertCall<'a, C, A> { self._page_id = new_value.to_string(); self } - /// The ID of the cluster. - /// - /// Sets the *cluster id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn cluster_id(mut self, new_value: &str) -> StorelayoutclusterPatchCall<'a, C, A> { - self._cluster_id = new_value.to_string(); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutclusterPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutclusterInsertCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -20579,7 +18574,7 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> StorelayoutclusterPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> StorelayoutclusterInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -20599,7 +18594,7 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> StorelayoutclusterPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> StorelayoutclusterInsertCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -20906,6 +18901,259 @@ impl<'a, C, A> StorelayoutclusterUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.storelayoutclusters().delete("enterpriseId", "pageId", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct StorelayoutclusterDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _page_id: String, + _cluster_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for StorelayoutclusterDeleteCall<'a, C, A> {} + +impl<'a, C, A> StorelayoutclusterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutclusters.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("pageId", self._page_id.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["enterpriseId", "pageId", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "pageId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the page. + /// + /// Sets the *page id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn page_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { + self._page_id = new_value.to_string(); + self + } + /// The ID of the cluster. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutclusterDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> StorelayoutclusterDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> StorelayoutclusterDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves details of a cluster. /// /// A builder for the *get* method supported by a *storelayoutcluster* resource. @@ -21170,10 +19418,10 @@ impl<'a, C, A> StorelayoutclusterGetCall<'a, C, A> where C: BorrowMut StorelayoutclusterGetCall<'a, C, A> where C: BorrowMut StorelayoutclusterGetCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = StoreCluster::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.storelayoutclusters().insert(req, "enterpriseId", "pageId") +/// let result = hub.products().get("enterpriseId", "productId") +/// .language("justo") /// .doit(); /// # } /// ``` -pub struct StorelayoutclusterInsertCall<'a, C, A> +pub struct ProductGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, - _request: StoreCluster, _enterprise_id: String, - _page_id: String, + _product_id: String, + _language: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for StorelayoutclusterInsertCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProductGetCall<'a, C, A> {} -impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StoreCluster)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Product)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -21233,12 +19476,15 @@ impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutclusters.insert", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "androidenterprise.products.get", + http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("pageId", self._page_id.to_string())); - for &field in ["alt", "enterpriseId", "pageId"].iter() { + params.push(("productId", self._product_id.to_string())); + if let Some(value) = self._language { + params.push(("language", value.to_string())); + } + for &field in ["alt", "enterpriseId", "productId", "language"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -21250,12 +19496,12 @@ impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -21267,7 +19513,7 @@ impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["pageId", "enterpriseId"].iter() { + for param_name in ["productId", "enterpriseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -21279,17 +19525,6 @@ impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut StorelayoutclusterInsertCall<'a, C, A> { - self._request = new_value; - self - } /// The ID of the enterprise. /// /// Sets the *enterprise id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutclusterInsertCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } - /// The ID of the page. + /// The ID of the product, e.g. "app:com.google.android.gm". /// - /// Sets the *page id* path property to the given value. + /// Sets the *product id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn page_id(mut self, new_value: &str) -> StorelayoutclusterInsertCall<'a, C, A> { - self._page_id = new_value.to_string(); + pub fn product_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). + /// + /// Sets the *language* query property to the given value. + pub fn language(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { + self._language = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -21400,7 +19629,7 @@ impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut StorelayoutclusterInsertCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProductGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -21421,7 +19650,7 @@ impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> StorelayoutclusterInsertCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProductGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -21441,260 +19670,7 @@ impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> StorelayoutclusterInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a cluster. -/// -/// A builder for the *delete* method supported by a *storelayoutcluster* resource. -/// It is not used directly, but through a `StorelayoutclusterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.storelayoutclusters().delete("enterpriseId", "pageId", "clusterId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutclusterDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _page_id: String, - _cluster_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutclusterDeleteCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutclusterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutclusters.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("pageId", self._page_id.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["enterpriseId", "pageId", "clusterId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId"), ("{clusterId}", "clusterId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["clusterId", "pageId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the page. - /// - /// Sets the *page id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn page_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { - self._page_id = new_value.to_string(); - self - } - /// The ID of the cluster. - /// - /// Sets the *cluster id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn cluster_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { - self._cluster_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> StorelayoutclusterDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutclusterDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutclusterDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProductGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -21958,6 +19934,272 @@ impl<'a, C, A> ProductGetPermissionCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.products().generate_approval_url("enterpriseId", "productId") +/// .language_code("dolores") +/// .doit(); +/// # } +/// ``` +pub struct ProductGenerateApprovalUrlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _product_id: String, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProductGenerateApprovalUrlCall<'a, C, A> {} + +impl<'a, C, A> ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ProductsGenerateApprovalUrlResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.products.generateApprovalUrl", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("productId", self._product_id.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "enterpriseId", "productId", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["productId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the product. + /// + /// Sets the *product id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn product_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProductGenerateApprovalUrlCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProductGenerateApprovalUrlCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Unapproves the specified product (and the relevant app permissions, if any) /// /// A builder for the *unapprove* method supported by a *product* resource. @@ -22199,270 +20441,6 @@ impl<'a, C, A> ProductUnapproveCall<'a, C, A> where C: BorrowMut, } -/// Retrieves details of a product for display to an enterprise admin. -/// -/// A builder for the *get* method supported by a *product* resource. -/// It is not used directly, but through a `ProductMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.products().get("enterpriseId", "productId") -/// .language("et") -/// .doit(); -/// # } -/// ``` -pub struct ProductGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _product_id: String, - _language: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProductGetCall<'a, C, A> {} - -impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Product)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.products.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("productId", self._product_id.to_string())); - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - for &field in ["alt", "enterpriseId", "productId", "language"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["productId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the product, e.g. "app:com.google.android.gm". - /// - /// Sets the *product id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn product_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { - self._product_id = new_value.to_string(); - self - } - /// The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { - self._language = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProductGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProductGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProductGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. /// /// To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. @@ -22765,7 +20743,7 @@ impl<'a, C, A> ProductApproveCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.products().get_app_restrictions_schema("enterpriseId", "productId") -/// .language("nonumy") +/// .language("ea") /// .doit(); /// # } /// ``` @@ -23029,10 +21007,10 @@ impl<'a, C, A> ProductGetAppRestrictionsSchemaCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.products().list("enterpriseId") -/// .token("Lorem") -/// .query("Lorem") -/// .max_results(59) -/// .language("ut") +/// .token("dolor") +/// .query("diam") +/// .max_results(39) +/// .language("invidunt") /// .approved(true) /// .doit(); /// # } @@ -23301,1072 +21279,6 @@ impl<'a, C, A> ProductListCall<'a, C, A> where C: BorrowMut, A: o } -/// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. -/// -/// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. -/// -/// A builder for the *generateApprovalUrl* method supported by a *product* resource. -/// It is not used directly, but through a `ProductMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.products().generate_approval_url("enterpriseId", "productId") -/// .language_code("ut") -/// .doit(); -/// # } -/// ``` -pub struct ProductGenerateApprovalUrlCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _product_id: String, - _language_code: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProductGenerateApprovalUrlCall<'a, C, A> {} - -impl<'a, C, A> ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ProductsGenerateApprovalUrlResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.products.generateApprovalUrl", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("productId", self._product_id.to_string())); - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - for &field in ["alt", "enterpriseId", "productId", "languageCode"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["productId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the product. - /// - /// Sets the *product id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn product_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._product_id = new_value.to_string(); - self - } - /// The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProductGenerateApprovalUrlCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProductGenerateApprovalUrlCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *managedconfigurationsforuser* resource. -/// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::ManagedConfiguration; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ManagedConfiguration::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.managedconfigurationsforuser().patch(req, "enterpriseId", "userId", "managedConfigurationForUserId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsforuserPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: ManagedConfiguration, - _enterprise_id: String, - _user_id: String, - _managed_configuration_for_user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsforuserPatchCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsforuserPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfiguration)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsforuser.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("managedConfigurationForUserId", self._managed_configuration_for_user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId", "managedConfigurationForUserId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{managedConfigurationForUserId}", "managedConfigurationForUserId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["managedConfigurationForUserId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ManagedConfiguration) -> ManagedconfigurationsforuserPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsforuserPatchCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserPatchCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *managed configuration for user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn managed_configuration_for_user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserPatchCall<'a, C, A> { - self._managed_configuration_for_user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsforuserPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsforuserPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsforuserPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all the per-user managed configurations for the specified user. Only the ID is set. -/// -/// A builder for the *list* method supported by a *managedconfigurationsforuser* resource. -/// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.managedconfigurationsforuser().list("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsforuserListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsforuserListCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsforuserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfigurationsForUserListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsforuser.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsforuserListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsforuserListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsforuserListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Removes a per-user managed configuration for an app for the specified user. -/// -/// A builder for the *delete* method supported by a *managedconfigurationsforuser* resource. -/// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.managedconfigurationsforuser().delete("enterpriseId", "userId", "managedConfigurationForUserId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsforuserDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _managed_configuration_for_user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsforuserDeleteCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsforuserDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsforuser.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("managedConfigurationForUserId", self._managed_configuration_for_user_id.to_string())); - for &field in ["enterpriseId", "userId", "managedConfigurationForUserId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{managedConfigurationForUserId}", "managedConfigurationForUserId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["managedConfigurationForUserId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *managed configuration for user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn managed_configuration_for_user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { - self._managed_configuration_for_user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. /// /// A builder for the *update* method supported by a *managedconfigurationsforuser* resource. @@ -24662,6 +21574,511 @@ impl<'a, C, A> ManagedconfigurationsforuserUpdateCall<'a, C, A> where C: BorrowM } +/// Removes a per-user managed configuration for an app for the specified user. +/// +/// A builder for the *delete* method supported by a *managedconfigurationsforuser* resource. +/// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.managedconfigurationsforuser().delete("enterpriseId", "userId", "managedConfigurationForUserId") +/// .doit(); +/// # } +/// ``` +pub struct ManagedconfigurationsforuserDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _managed_configuration_for_user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManagedconfigurationsforuserDeleteCall<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationsforuserDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsforuser.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + params.push(("managedConfigurationForUserId", self._managed_configuration_for_user_id.to_string())); + for &field in ["enterpriseId", "userId", "managedConfigurationForUserId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{managedConfigurationForUserId}", "managedConfigurationForUserId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["managedConfigurationForUserId", "userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + /// + /// Sets the *managed configuration for user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn managed_configuration_for_user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { + self._managed_configuration_for_user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsforuserDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the per-user managed configurations for the specified user. Only the ID is set. +/// +/// A builder for the *list* method supported by a *managedconfigurationsforuser* resource. +/// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.managedconfigurationsforuser().list("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct ManagedconfigurationsforuserListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManagedconfigurationsforuserListCall<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationsforuserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfigurationsForUserListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.managedconfigurationsforuser.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ManagedconfigurationsforuserListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsforuserListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsforuserListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves details of a per-user managed configuration for an app for the specified user. /// /// A builder for the *get* method supported by a *managedconfigurationsforuser* resource. @@ -25178,258 +22595,6 @@ impl<'a, C, A> GrouplicenseuserListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.entitlements().list("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct EntitlementListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EntitlementListCall<'a, C, A> {} - -impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, EntitlementsListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.entitlements.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EntitlementListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EntitlementListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EntitlementListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Adds or updates an entitlement to an app for a user. /// /// A builder for the *update* method supported by a *entitlement* resource. @@ -25464,7 +22629,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.entitlements().update(req, "enterpriseId", "userId", "entitlementId") -/// .install(false) +/// .install(true) /// .doit(); /// # } /// ``` @@ -26001,6 +23166,258 @@ impl<'a, C, A> EntitlementGetCall<'a, C, A> where C: BorrowMut, A } +/// Lists all entitlements for the specified user. Only the ID is set. +/// +/// A builder for the *list* method supported by a *entitlement* resource. +/// It is not used directly, but through a `EntitlementMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.entitlements().list("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct EntitlementListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EntitlementListCall<'a, C, A> {} + +impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EntitlementsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.entitlements.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EntitlementListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EntitlementListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EntitlementListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Removes an entitlement to an app for a user. /// /// A builder for the *delete* method supported by a *entitlement* resource. @@ -26254,553 +23671,6 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut } -/// Adds or updates an entitlement to an app for a user. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *entitlement* resource. -/// It is not used directly, but through a `EntitlementMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::Entitlement; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Entitlement::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.entitlements().patch(req, "enterpriseId", "userId", "entitlementId") -/// .install(true) -/// .doit(); -/// # } -/// ``` -pub struct EntitlementPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: Entitlement, - _enterprise_id: String, - _user_id: String, - _entitlement_id: String, - _install: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EntitlementPatchCall<'a, C, A> {} - -impl<'a, C, A> EntitlementPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Entitlement)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.entitlements.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - params.push(("entitlementId", self._entitlement_id.to_string())); - if let Some(value) = self._install { - params.push(("install", value.to_string())); - } - for &field in ["alt", "enterpriseId", "userId", "entitlementId", "install"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{entitlementId}", "entitlementId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["entitlementId", "userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Entitlement) -> EntitlementPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EntitlementPatchCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the user. - /// - /// Sets the *user id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> EntitlementPatchCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *entitlement id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn entitlement_id(mut self, new_value: &str) -> EntitlementPatchCall<'a, C, A> { - self._entitlement_id = new_value.to_string(); - self - } - /// Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user. - /// - /// Sets the *install* query property to the given value. - pub fn install(mut self, new_value: bool) -> EntitlementPatchCall<'a, C, A> { - self._install = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> EntitlementPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EntitlementPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EntitlementPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. -/// -/// A builder for the *list* method supported by a *serviceaccountkey* resource. -/// It is not used directly, but through a `ServiceaccountkeyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.serviceaccountkeys().list("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct ServiceaccountkeyListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ServiceaccountkeyListCall<'a, C, A> {} - -impl<'a, C, A> ServiceaccountkeyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccountKeysListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.serviceaccountkeys.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/serviceAccountKeys"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ServiceaccountkeyListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceaccountkeyListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ServiceaccountkeyListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ServiceaccountkeyListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. /// /// Only the type of the key should be populated in the resource to be inserted. @@ -27074,6 +23944,246 @@ impl<'a, C, A> ServiceaccountkeyInsertCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.serviceaccountkeys().list("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct ServiceaccountkeyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceaccountkeyListCall<'a, C, A> {} + +impl<'a, C, A> ServiceaccountkeyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccountKeysListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.serviceaccountkeys.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/serviceAccountKeys"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> ServiceaccountkeyListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceaccountkeyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ServiceaccountkeyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceaccountkeyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. /// /// A builder for the *delete* method supported by a *serviceaccountkey* resource. @@ -27343,7 +24453,7 @@ impl<'a, C, A> ServiceaccountkeyDeleteCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Android Management (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidmanagement1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-androidmanagement1] path = "../androidmanagement1" -version = "1.0.12+20190624" +version = "1.0.13+20200330" diff --git a/gen/androidmanagement1-cli/README.md b/gen/androidmanagement1-cli/README.md index 0b7bf37b7f..74c209bf15 100644 --- a/gen/androidmanagement1-cli/README.md +++ b/gen/androidmanagement1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Android Management* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Android Management* API at revision *20200330*. The CLI is at version *1.0.13*. ```bash androidmanagement1 [options] diff --git a/gen/androidmanagement1-cli/mkdocs.yml b/gen/androidmanagement1-cli/mkdocs.yml index e31892cb49..bf2b53e110 100644 --- a/gen/androidmanagement1-cli/mkdocs.yml +++ b/gen/androidmanagement1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Management v1.0.12+20190624 +site_name: Android Management v1.0.13+20200330 site_url: http://byron.github.io/google-apis-rs/google-androidmanagement1-cli site_description: A complete library to interact with Android Management (protocol v1) diff --git a/gen/androidmanagement1-cli/src/main.rs b/gen/androidmanagement1-cli/src/main.rs index 0f42467d27..643d5b92ef 100644 --- a/gen/androidmanagement1-cli/src/main.rs +++ b/gen/androidmanagement1-cli/src/main.rs @@ -210,6 +210,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "wipe-reason-message" => { + call = call.wipe_reason_message(value.unwrap_or("")); + }, "wipe-data-flags" => { call = call.add_wipe_data_flags(value.unwrap_or("")); }, @@ -226,7 +229,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["wipe-data-flags"].iter().map(|v|*v)); + v.extend(["wipe-reason-message", "wipe-data-flags"].iter().map(|v|*v)); v } )); } } @@ -744,6 +747,7 @@ impl<'n> Engine<'n> { "hardware-info.model" => Some(("hardwareInfo.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "hardware-info.brand" => Some(("hardwareInfo.brand", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "hardware-info.manufacturer" => Some(("hardwareInfo.manufacturer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "security-posture.device-posture" => Some(("securityPosture.devicePosture", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network-info.imei" => Some(("networkInfo.imei", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network-info.network-operator-name" => Some(("networkInfo.networkOperatorName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network-info.meid" => Some(("networkInfo.meid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -762,7 +766,7 @@ impl<'n> Engine<'n> { "memory-info.total-ram" => Some(("memoryInfo.totalRam", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enrollment-time" => Some(("enrollmentTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-identifier", "adb-enabled", "android-build-number", "android-build-time", "android-device-policy-version-code", "android-device-policy-version-name", "android-version", "api-level", "applied-policy-name", "applied-policy-version", "applied-state", "battery-shutdown-temperatures", "battery-throttling-temperatures", "bootloader-version", "brand", "cpu-shutdown-temperatures", "cpu-throttling-temperatures", "default-message", "development-settings-enabled", "device-baseband-version", "device-build-signature", "device-kernel-version", "device-settings", "disabled-reason", "encryption-status", "enrollment-time", "enrollment-token-data", "enrollment-token-name", "gpu-shutdown-temperatures", "gpu-throttling-temperatures", "hardware", "hardware-info", "imei", "is-device-secure", "is-encrypted", "last-policy-compliance-report-time", "last-policy-sync-time", "last-status-report-time", "localized-messages", "management-mode", "manufacturer", "meid", "memory-info", "model", "name", "network-info", "network-operator-name", "policy-compliant", "policy-name", "previous-device-names", "primary-language-code", "security-patch-level", "serial-number", "skin-shutdown-temperatures", "skin-throttling-temperatures", "software-info", "state", "system-properties", "total-internal-storage", "total-ram", "unknown-sources-enabled", "user", "user-name", "verify-apps-enabled", "wifi-mac-address"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-identifier", "adb-enabled", "android-build-number", "android-build-time", "android-device-policy-version-code", "android-device-policy-version-name", "android-version", "api-level", "applied-policy-name", "applied-policy-version", "applied-state", "battery-shutdown-temperatures", "battery-throttling-temperatures", "bootloader-version", "brand", "cpu-shutdown-temperatures", "cpu-throttling-temperatures", "default-message", "development-settings-enabled", "device-baseband-version", "device-build-signature", "device-kernel-version", "device-posture", "device-settings", "disabled-reason", "encryption-status", "enrollment-time", "enrollment-token-data", "enrollment-token-name", "gpu-shutdown-temperatures", "gpu-throttling-temperatures", "hardware", "hardware-info", "imei", "is-device-secure", "is-encrypted", "last-policy-compliance-report-time", "last-policy-sync-time", "last-status-report-time", "localized-messages", "management-mode", "manufacturer", "meid", "memory-info", "model", "name", "network-info", "network-operator-name", "policy-compliant", "policy-name", "previous-device-names", "primary-language-code", "security-patch-level", "security-posture", "serial-number", "skin-shutdown-temperatures", "skin-throttling-temperatures", "software-info", "state", "system-properties", "total-internal-storage", "total-ram", "unknown-sources-enabled", "user", "user-name", "verify-apps-enabled", "wifi-mac-address"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1305,6 +1309,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "kiosk-customization.status-bar" => Some(("kioskCustomization.statusBar", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kiosk-customization.device-settings" => Some(("kioskCustomization.deviceSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kiosk-customization.system-navigation" => Some(("kioskCustomization.systemNavigation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kiosk-customization.power-button-actions" => Some(("kioskCustomization.powerButtonActions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kiosk-customization.system-error-warnings" => Some(("kioskCustomization.systemErrorWarnings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "data-roaming-disabled" => Some(("dataRoamingDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "network-reset-disabled" => Some(("networkResetDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1314,6 +1323,7 @@ impl<'n> Engine<'n> { "minimum-api-level" => Some(("minimumApiLevel", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "permitted-input-methods.package-names" => Some(("permittedInputMethods.packageNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "status-reporting-settings.network-info-enabled" => Some(("statusReportingSettings.networkInfoEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-reporting-settings.system-properties-enabled" => Some(("statusReportingSettings.systemPropertiesEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status-reporting-settings.memory-info-enabled" => Some(("statusReportingSettings.memoryInfoEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status-reporting-settings.hardware-status-enabled" => Some(("statusReportingSettings.hardwareStatusEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status-reporting-settings.device-settings-enabled" => Some(("statusReportingSettings.deviceSettingsEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1326,6 +1336,7 @@ impl<'n> Engine<'n> { "bluetooth-config-disabled" => Some(("bluetoothConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location-mode" => Some(("locationMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mobile-networks-config-disabled" => Some(("mobileNetworksConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "advanced-security-overrides.untrusted-apps-policy" => Some(("advancedSecurityOverrides.untrustedAppsPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "install-unknown-sources-allowed" => Some(("installUnknownSourcesAllowed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "block-applications-enabled" => Some(("blockApplicationsEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "remove-user-disabled" => Some(("removeUserDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1340,6 +1351,7 @@ impl<'n> Engine<'n> { "password-requirements.password-scope" => Some(("passwordRequirements.passwordScope", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "password-requirements.password-expiration-timeout" => Some(("passwordRequirements.passwordExpirationTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "password-requirements.maximum-failed-passwords-for-wipe" => Some(("passwordRequirements.maximumFailedPasswordsForWipe", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "password-requirements.require-password-unlock" => Some(("passwordRequirements.requirePasswordUnlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "password-requirements.password-minimum-symbols" => Some(("passwordRequirements.passwordMinimumSymbols", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "password-requirements.password-quality" => Some(("passwordRequirements.passwordQuality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "password-requirements.password-minimum-length" => Some(("passwordRequirements.passwordMinimumLength", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1394,6 +1406,7 @@ impl<'n> Engine<'n> { "stay-on-plugged-modes" => Some(("stayOnPluggedModes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "screen-capture-disabled" => Some(("screenCaptureDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "credentials-config-disabled" => Some(("credentialsConfigDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "permitted-accessibility-services.package-names" => Some(("permittedAccessibilityServices.packageNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "install-apps-disabled" => Some(("installAppsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "adjust-volume-disabled" => Some(("adjustVolumeDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "short-support-message.default-message" => Some(("shortSupportMessage.defaultMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1402,7 +1415,7 @@ impl<'n> Engine<'n> { "private-key-selection-enabled" => Some(("privateKeySelectionEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "create-windows-disabled" => Some(("createWindowsDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-types-with-management-disabled", "add-user-disabled", "adjust-volume-disabled", "always-on-vpn-package", "android-device-policy-tracks", "app-auto-update-policy", "application-reporting-settings", "application-reports-enabled", "auto-time-required", "block-applications-enabled", "bluetooth-config-disabled", "bluetooth-contact-sharing-disabled", "bluetooth-disabled", "camera-disabled", "cell-broadcasts-config-disabled", "create-windows-disabled", "credentials-config-disabled", "data-roaming-disabled", "debugging-features-allowed", "default-message", "default-permission-policy", "device-owner-lock-screen-info", "device-settings-enabled", "display-info-enabled", "encryption-policy", "end-minutes", "ensure-verify-apps-enabled", "excluded-hosts", "factory-reset-disabled", "frp-admin-emails", "fun-disabled", "hardware-status-enabled", "host", "include-removed-apps", "install-apps-disabled", "install-unknown-sources-allowed", "keyguard-disabled", "keyguard-disabled-features", "kiosk-custom-launcher-enabled", "localized-messages", "location-mode", "lockdown-enabled", "long-support-message", "maximum-failed-passwords-for-wipe", "maximum-time-to-lock", "memory-info-enabled", "minimum-api-level", "mobile-networks-config-disabled", "modify-accounts-disabled", "mount-physical-media-disabled", "name", "network-escape-hatch-enabled", "network-info-enabled", "network-reset-disabled", "outgoing-beam-disabled", "outgoing-calls-disabled", "pac-uri", "package-name", "package-names", "password-expiration-timeout", "password-history-length", "password-minimum-length", "password-minimum-letters", "password-minimum-lower-case", "password-minimum-non-letter", "password-minimum-numeric", "password-minimum-symbols", "password-minimum-upper-case", "password-quality", "password-requirements", "password-scope", "permitted-input-methods", "play-store-mode", "port", "power-management-events-enabled", "private-key-selection-enabled", "recommended-global-proxy", "remove-user-disabled", "safe-boot-disabled", "screen-capture-disabled", "set-user-icon-disabled", "set-wallpaper-disabled", "share-location-disabled", "short-support-message", "skip-first-use-hints-enabled", "sms-disabled", "software-info-enabled", "start-minutes", "status-bar-disabled", "status-reporting-settings", "stay-on-plugged-modes", "system-update", "tethering-config-disabled", "type", "uninstall-apps-disabled", "unmute-microphone-disabled", "usb-file-transfer-disabled", "usb-mass-storage-enabled", "version", "vpn-config-disabled", "wifi-config-disabled", "wifi-configs-lockdown-enabled"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-types-with-management-disabled", "add-user-disabled", "adjust-volume-disabled", "advanced-security-overrides", "always-on-vpn-package", "android-device-policy-tracks", "app-auto-update-policy", "application-reporting-settings", "application-reports-enabled", "auto-time-required", "block-applications-enabled", "bluetooth-config-disabled", "bluetooth-contact-sharing-disabled", "bluetooth-disabled", "camera-disabled", "cell-broadcasts-config-disabled", "create-windows-disabled", "credentials-config-disabled", "data-roaming-disabled", "debugging-features-allowed", "default-message", "default-permission-policy", "device-owner-lock-screen-info", "device-settings", "device-settings-enabled", "display-info-enabled", "encryption-policy", "end-minutes", "ensure-verify-apps-enabled", "excluded-hosts", "factory-reset-disabled", "frp-admin-emails", "fun-disabled", "hardware-status-enabled", "host", "include-removed-apps", "install-apps-disabled", "install-unknown-sources-allowed", "keyguard-disabled", "keyguard-disabled-features", "kiosk-custom-launcher-enabled", "kiosk-customization", "localized-messages", "location-mode", "lockdown-enabled", "long-support-message", "maximum-failed-passwords-for-wipe", "maximum-time-to-lock", "memory-info-enabled", "minimum-api-level", "mobile-networks-config-disabled", "modify-accounts-disabled", "mount-physical-media-disabled", "name", "network-escape-hatch-enabled", "network-info-enabled", "network-reset-disabled", "outgoing-beam-disabled", "outgoing-calls-disabled", "pac-uri", "package-name", "package-names", "password-expiration-timeout", "password-history-length", "password-minimum-length", "password-minimum-letters", "password-minimum-lower-case", "password-minimum-non-letter", "password-minimum-numeric", "password-minimum-symbols", "password-minimum-upper-case", "password-quality", "password-requirements", "password-scope", "permitted-accessibility-services", "permitted-input-methods", "play-store-mode", "port", "power-button-actions", "power-management-events-enabled", "private-key-selection-enabled", "recommended-global-proxy", "remove-user-disabled", "require-password-unlock", "safe-boot-disabled", "screen-capture-disabled", "set-user-icon-disabled", "set-wallpaper-disabled", "share-location-disabled", "short-support-message", "skip-first-use-hints-enabled", "sms-disabled", "software-info-enabled", "start-minutes", "status-bar", "status-bar-disabled", "status-reporting-settings", "stay-on-plugged-modes", "system-error-warnings", "system-navigation", "system-properties-enabled", "system-update", "tethering-config-disabled", "type", "uninstall-apps-disabled", "unmute-microphone-disabled", "untrusted-apps-policy", "usb-file-transfer-disabled", "usb-mass-storage-enabled", "version", "vpn-config-disabled", "wifi-config-disabled", "wifi-configs-lockdown-enabled"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1834,12 +1847,13 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "parent-frame-url" => Some(("parentFrameUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "parent-frame-url" => Some(("parentFrameUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enabled-features" => Some(("enabledFeatures", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "parent-frame-url", "permissions", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["enabled-features", "name", "parent-frame-url", "permissions", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2766,7 +2780,7 @@ fn main() { let mut app = App::new("androidmanagement1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200330") .about("The Android Management API provides remote enterprise management of Android devices and apps.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidmanagement1_cli") .arg(Arg::with_name("url") diff --git a/gen/androidmanagement1/Cargo.toml b/gen/androidmanagement1/Cargo.toml index ed85ea1f9d..6c24f9b357 100644 --- a/gen/androidmanagement1/Cargo.toml +++ b/gen/androidmanagement1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidmanagement1" -version = "1.0.12+20190624" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Management (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidmanagement1" homepage = "https://developers.google.com/android/management" -documentation = "https://docs.rs/google-androidmanagement1/1.0.12+20190624" +documentation = "https://docs.rs/google-androidmanagement1/1.0.13+20200330" license = "MIT" keywords = ["androidmanagement", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/androidmanagement1/README.md b/gen/androidmanagement1/README.md index 14e30d4aef..a485c0f10c 100644 --- a/gen/androidmanagement1/README.md +++ b/gen/androidmanagement1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-androidmanagement1` library allows access to all features of the *Google Android Management* service. -This documentation was generated from *Android Management* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Android Management* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Android Management* *v1* API can be found at the [official documentation site](https://developers.google.com/android/management). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.AndroidManagement.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.AndroidManagement.html) ... -* [enterprises](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.Enterprise.html) - * [*applications get*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseApplicationGetCall.html), [*create*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseCreateCall.html), [*devices delete*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceDeleteCall.html), [*devices get*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceGetCall.html), [*devices issue command*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceIssueCommandCall.html), [*devices list*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceListCall.html), [*devices operations cancel*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceOperationCancelCall.html), [*devices operations delete*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceOperationDeleteCall.html), [*devices operations get*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceOperationGetCall.html), [*devices operations list*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDeviceOperationListCall.html), [*devices patch*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseDevicePatchCall.html), [*enrollment tokens create*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseEnrollmentTokenCreateCall.html), [*enrollment tokens delete*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseEnrollmentTokenDeleteCall.html), [*get*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseGetCall.html), [*patch*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterprisePatchCall.html), [*policies delete*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterprisePolicyDeleteCall.html), [*policies get*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterprisePolicyGetCall.html), [*policies list*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterprisePolicyListCall.html), [*policies patch*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterprisePolicyPatchCall.html), [*web apps create*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseWebAppCreateCall.html), [*web apps delete*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseWebAppDeleteCall.html), [*web apps get*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseWebAppGetCall.html), [*web apps list*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseWebAppListCall.html), [*web apps patch*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseWebAppPatchCall.html) and [*web tokens create*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.EnterpriseWebTokenCreateCall.html) -* [signup urls](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.SignupUrl.html) - * [*create*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.SignupUrlCreateCall.html) +* [enterprises](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.Enterprise.html) + * [*applications get*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseApplicationGetCall.html), [*create*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseCreateCall.html), [*devices delete*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceDeleteCall.html), [*devices get*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceGetCall.html), [*devices issue command*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceIssueCommandCall.html), [*devices list*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceListCall.html), [*devices operations cancel*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceOperationCancelCall.html), [*devices operations delete*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceOperationDeleteCall.html), [*devices operations get*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceOperationGetCall.html), [*devices operations list*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDeviceOperationListCall.html), [*devices patch*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseDevicePatchCall.html), [*enrollment tokens create*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseEnrollmentTokenCreateCall.html), [*enrollment tokens delete*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseEnrollmentTokenDeleteCall.html), [*get*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseGetCall.html), [*patch*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterprisePatchCall.html), [*policies delete*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterprisePolicyDeleteCall.html), [*policies get*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterprisePolicyGetCall.html), [*policies list*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterprisePolicyListCall.html), [*policies patch*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterprisePolicyPatchCall.html), [*web apps create*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseWebAppCreateCall.html), [*web apps delete*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseWebAppDeleteCall.html), [*web apps get*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseWebAppGetCall.html), [*web apps list*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseWebAppListCall.html), [*web apps patch*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseWebAppPatchCall.html) and [*web tokens create*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.EnterpriseWebTokenCreateCall.html) +* [signup urls](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.SignupUrl.html) + * [*create*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.SignupUrlCreateCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/struct.AndroidManagement.html)** +* **[Hub](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/struct.AndroidManagement.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -159,17 +159,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -179,29 +179,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-androidmanagement1/1.0.12+20190624/google_androidmanagement1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidmanagement1/1.0.13+20200330/google_androidmanagement1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/androidmanagement1/src/lib.rs b/gen/androidmanagement1/src/lib.rs index 894b251835..1b2322619b 100644 --- a/gen/androidmanagement1/src/lib.rs +++ b/gen/androidmanagement1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Management* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Android Management* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *androidmanagement:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Android Management* *v1* API can be found at the //! [official documentation site](https://developers.google.com/android/management). @@ -361,7 +361,7 @@ impl<'a, C, A> AndroidManagement AndroidManagement { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://androidmanagement.googleapis.com/".to_string(), _root_url: "https://androidmanagement.googleapis.com/".to_string(), } @@ -375,7 +375,7 @@ impl<'a, C, A> AndroidManagement } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -403,69 +403,6 @@ impl<'a, C, A> AndroidManagement // ############ // SCHEMAS ### // ########## -/// Response to a request to list policies for a given enterprise. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [policies list enterprises](struct.EnterprisePolicyListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListPoliciesResponse { - /// If there are more results, a token to retrieve next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of policies. - pub policies: Option>, -} - -impl ResponseResult for ListPoliciesResponse {} - - -/// Information reported about an installed app. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApplicationReport { - /// The display name of the app. - #[serde(rename="displayName")] - pub display_name: Option, - /// The package name of the app that installed this app. - #[serde(rename="installerPackageName")] - pub installer_package_name: Option, - /// Package name of the app. - #[serde(rename="packageName")] - pub package_name: Option, - /// List of keyed app states reported by the app. - #[serde(rename="keyedAppStates")] - pub keyed_app_states: Option>, - /// The SHA-256 hash of the app's APK file, which can be used to verify the app hasn't been modified. Each byte of the hash value is represented as a two-digit hexadecimal number. - #[serde(rename="packageSha256Hash")] - pub package_sha256_hash: Option, - /// The SHA-1 hash of each android.content.pm.Signature (https://developer.android.com/reference/android/content/pm/Signature.html) associated with the app package. Each byte of each hash value is represented as a two-digit hexadecimal number. - #[serde(rename="signingKeyCertFingerprints")] - pub signing_key_cert_fingerprints: Option>, - /// The source of the package. - #[serde(rename="applicationSource")] - pub application_source: Option, - /// Application state. - pub state: Option, - /// The app version as displayed to the user. - #[serde(rename="versionName")] - pub version_name: Option, - /// The app version code, which can be used to determine whether one version is more recent than another. - #[serde(rename="versionCode")] - pub version_code: Option, - /// List of app events. The most recent 20 events are stored in the list. - pub events: Option>, -} - -impl Part for ApplicationReport {} - - /// Provides detail about non-compliance with a policy setting. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -495,402 +432,44 @@ pub struct NonComplianceDetail { impl Part for NonComplianceDetail {} -/// A compliance rule condition which is satisfied if there exists any matching NonComplianceDetail for the device. A NonComplianceDetail matches a NonComplianceDetailCondition if all the fields which are set within the NonComplianceDetailCondition match the corresponding NonComplianceDetail fields. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NonComplianceDetailCondition { - /// The package name of the app that's out of compliance. If not set, then this condition matches any package name. - #[serde(rename="packageName")] - pub package_name: Option, - /// The name of the policy setting. This is the JSON field name of a top-level Policy field. If not set, then this condition matches any setting name. - #[serde(rename="settingName")] - pub setting_name: Option, - /// The reason the device is not in compliance with the setting. If not set, then this condition matches any reason. - #[serde(rename="nonComplianceReason")] - pub non_compliance_reason: Option, -} - -impl Part for NonComplianceDetailCondition {} - - -/// Configuration for managing system updates -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SystemUpdate { - /// If the type is WINDOWED, the end of the maintenance window, measured as the number of minutes after midnight in device's local time. This value must be between 0 and 1439, inclusive. If this value is less than start_minutes, then the maintenance window spans midnight. If the maintenance window specified is smaller than 30 minutes, the actual window is extended to 30 minutes beyond the start time. - #[serde(rename="endMinutes")] - pub end_minutes: Option, - /// If the type is WINDOWED, the start of the maintenance window, measured as the number of minutes after midnight in the device's local time. This value must be between 0 and 1439, inclusive. - #[serde(rename="startMinutes")] - pub start_minutes: Option, - /// The type of system update to configure. - #[serde(rename="type")] - pub type_: Option, -} - -impl Part for SystemUpdate {} - - -/// An app-related event. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApplicationEvent { - /// App event type. - #[serde(rename="eventType")] - pub event_type: Option, - /// The creation time of the event. - #[serde(rename="createTime")] - pub create_time: Option, -} - -impl Part for ApplicationEvent {} - - -/// Hardware status. Temperatures may be compared to the temperature thresholds available in hardwareInfo to determine hardware health. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HardwareStatus { - /// Current battery temperatures in Celsius for each battery on the device. - #[serde(rename="batteryTemperatures")] - pub battery_temperatures: Option>, - /// Current device skin temperatures in Celsius. - #[serde(rename="skinTemperatures")] - pub skin_temperatures: Option>, - /// Current GPU temperatures in Celsius for each GPU on the device. - #[serde(rename="gpuTemperatures")] - pub gpu_temperatures: Option>, - /// Fan speeds in RPM for each fan on the device. Empty array means that there are no fans or fan speed is not supported on the system. - #[serde(rename="fanSpeeds")] - pub fan_speeds: Option>, - /// Current CPU temperatures in Celsius for each CPU on the device. - #[serde(rename="cpuTemperatures")] - pub cpu_temperatures: Option>, - /// The time the measurements were taken. - #[serde(rename="createTime")] - pub create_time: Option, - /// CPU usages in percentage for each core available on the device. Usage is 0 for each unplugged core. Empty array implies that CPU usage is not supported in the system. - #[serde(rename="cpuUsages")] - pub cpu_usages: Option>, -} - -impl Part for HardwareStatus {} - - -/// Information about an app. +/// An enrollment token. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [applications get enterprises](struct.EnterpriseApplicationGetCall.html) (response) +/// * [enrollment tokens create enterprises](struct.EnterpriseEnrollmentTokenCreateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Application { - /// The set of managed properties available to be pre-configured for the app. - #[serde(rename="managedProperties")] - pub managed_properties: Option>, - /// The permissions required by the app. - pub permissions: Option>, - /// The name of the app in the form enterprises/{enterpriseId}/applications/{package_name}. +pub struct EnrollmentToken { + /// Optional, arbitrary data associated with the enrollment token. This could contain, for example, the ID of an org unit the device is assigned to after enrollment. After a device enrolls with the token, this data will be exposed in the enrollment_token_data field of the Device resource. The data must be 1024 characters or less; otherwise, the creation request will fail. + #[serde(rename="additionalData")] + pub additional_data: Option, + /// The name of the enrollment token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. pub name: Option, - /// The title of the app. Localized. - pub title: Option, + /// Whether the enrollment token is for one time use only. If the flag is set to true, only one device can use it for registration. + #[serde(rename="oneTimeOnly")] + pub one_time_only: Option, + /// The name of the policy initially applied to the enrolled device, in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy_name for the device’s user is applied. If user_name is also not specified, enterprises/{enterpriseId}/policies/default is applied by default. When updating this field, you can specify only the policyId as long as the policyId doesn’t contain any slashes. The rest of the policy name will be inferred. + #[serde(rename="policyName")] + pub policy_name: Option, + /// The token value that's passed to the device and authorizes the device to enroll. This is a read-only field generated by the server. + pub value: Option, + /// The length of time the enrollment token is valid, ranging from 1 minute to 30 days. If not specified, the default duration is 1 hour. + pub duration: Option, + /// The user associated with this enrollment token. If it's specified when the enrollment token is created and the user does not exist, the user will be created. This field must not contain personally identifiable information. Only the account_identifier field needs to be set. + pub user: Option, + /// A JSON string whose UTF-8 representation can be used to generate a QR code to enroll a device with this enrollment token. To enroll a device using NFC, the NFC record must contain a serialized java.util.Properties representation of the properties in the JSON. + #[serde(rename="qrCode")] + pub qr_code: Option, + /// The expiration time of the token. This is a read-only field generated by the server. + #[serde(rename="expirationTimestamp")] + pub expiration_timestamp: Option, } -impl ResponseResult for Application {} - - -/// An enterprise signup URL. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [create signup urls](struct.SignupUrlCreateCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SignupUrl { - /// A URL where an enterprise admin can register their enterprise. The page can't be rendered in an iframe. - pub url: Option, - /// The name of the resource. Use this value in the signupUrl field when calling enterprises.create to complete the enterprise signup flow. - pub name: Option, -} - -impl Resource for SignupUrl {} -impl ResponseResult for SignupUrl {} - - -/// Information about device memory and storage. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MemoryInfo { - /// Total internal storage on device in bytes. - #[serde(rename="totalInternalStorage")] - pub total_internal_storage: Option, - /// Total RAM on device in bytes. - #[serde(rename="totalRam")] - pub total_ram: Option, -} - -impl Part for MemoryInfo {} - - -/// A policy resources represents a group settings that govern the behavior of a managed device and the apps installed on it. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [policies patch enterprises](struct.EnterprisePolicyPatchCall.html) (request|response) -/// * [policies get enterprises](struct.EnterprisePolicyGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Policy { - /// Rules declaring which mitigating actions to take when a device is not compliant with its policy. When the conditions for multiple rules are satisfied, all of the mitigating actions for the rules are taken. There is a maximum limit of 100 rules. Use policy enforcement rules instead. - #[serde(rename="complianceRules")] - pub compliance_rules: Option>, - /// Whether roaming data services are disabled. - #[serde(rename="dataRoamingDisabled")] - pub data_roaming_disabled: Option, - /// Whether resetting network settings is disabled. - #[serde(rename="networkResetDisabled")] - pub network_reset_disabled: Option, - /// Whether location sharing is disabled. - #[serde(rename="shareLocationDisabled")] - pub share_location_disabled: Option, - /// Default intent handler activities. - #[serde(rename="persistentPreferredActivities")] - pub persistent_preferred_activities: Option>, - /// If present, only the input methods provided by packages in this list are permitted. If this field is present, but the list is empty, then only system input methods are permitted. - #[serde(rename="permittedInputMethods")] - pub permitted_input_methods: Option, - /// Status reporting settings - #[serde(rename="statusReportingSettings")] - pub status_reporting_settings: Option, - /// Whether configuring bluetooth is disabled. - #[serde(rename="bluetoothConfigDisabled")] - pub bluetooth_config_disabled: Option, - /// The degree of location detection enabled. The user may change the value unless the user is otherwise blocked from accessing device settings. - #[serde(rename="locationMode")] - pub location_mode: Option, - /// Whether configuring mobile networks is disabled. - #[serde(rename="mobileNetworksConfigDisabled")] - pub mobile_networks_config_disabled: Option, - /// Whether the user is allowed to enable the "Unknown Sources" setting, which allows installation of apps from unknown sources. - #[serde(rename="installUnknownSourcesAllowed")] - pub install_unknown_sources_allowed: Option, - /// Whether applications other than the ones configured in applications are blocked from being installed. When set, applications that were installed under a previous policy but no longer appear in the policy are automatically uninstalled. - #[serde(rename="blockApplicationsEnabled")] - pub block_applications_enabled: Option, - /// A message displayed to the user in the device administators settings screen. - #[serde(rename="longSupportMessage")] - pub long_support_message: Option, - /// The app tracks for Android Device Policy the device can access. The device receives the latest version among all accessible tracks. If no tracks are specified, then the device only uses the production track. - #[serde(rename="androidDevicePolicyTracks")] - pub android_device_policy_tracks: Option>, - /// The device owner information to be shown on the lock screen. - #[serde(rename="deviceOwnerLockScreenInfo")] - pub device_owner_lock_screen_info: Option, - /// Whether bluetooth is disabled. Prefer this setting over bluetooth_config_disabled because bluetooth_config_disabled can be bypassed by the user. - #[serde(rename="bluetoothDisabled")] - pub bluetooth_disabled: Option, - /// Whether the status bar is disabled. This disables notifications, quick settings, and other screen overlays that allow escape from full-screen mode. - #[serde(rename="statusBarDisabled")] - pub status_bar_disabled: Option, - /// Rules for automatically choosing a private key and certificate to authenticate the device to a server. The rules are ordered by increasing precedence, so if an outgoing request matches more than one rule, the last rule defines which private key to use. - #[serde(rename="choosePrivateKeyRules")] - pub choose_private_key_rules: Option>, - /// This mode controls which apps are available to the user in the Play Store and the behavior on the device when apps are removed from the policy. - #[serde(rename="playStoreMode")] - pub play_store_mode: Option, - /// Whether transferring files over USB is disabled. - #[serde(rename="usbFileTransferDisabled")] - pub usb_file_transfer_disabled: Option, - /// Whether using NFC to beam data from apps is disabled. - #[serde(rename="outgoingBeamDisabled")] - pub outgoing_beam_disabled: Option, - /// Whether the user is allowed to have fun. Controls whether the Easter egg game in Settings is disabled. - #[serde(rename="funDisabled")] - pub fun_disabled: Option, - /// Configuration for an always-on VPN connection. Use with vpn_config_disabled to prevent modification of this setting. - #[serde(rename="alwaysOnVpnPackage")] - pub always_on_vpn_package: Option, - /// Disabled keyguard customizations, such as widgets. - #[serde(rename="keyguardDisabledFeatures")] - pub keyguard_disabled_features: Option>, - /// Whether configuring cell broadcast is disabled. - #[serde(rename="cellBroadcastsConfigDisabled")] - pub cell_broadcasts_config_disabled: Option, - /// Whether the keyguard is disabled. - #[serde(rename="keyguardDisabled")] - pub keyguard_disabled: Option, - /// The default permission policy for runtime permission requests. - #[serde(rename="defaultPermissionPolicy")] - pub default_permission_policy: Option, - /// Whether factory resetting from settings is disabled. - #[serde(rename="factoryResetDisabled")] - pub factory_reset_disabled: Option, - /// Password requirement policies. Different policies can be set for work profile or fully managed devices by setting the password_scope field in the policy. - #[serde(rename="passwordPolicies")] - pub password_policies: Option>, - /// Whether the network escape hatch is enabled. If a network connection can't be made at boot time, the escape hatch prompts the user to temporarily connect to a network in order to refresh the device policy. After applying policy, the temporary network will be forgotten and the device will continue booting. This prevents being unable to connect to a network if there is no suitable network in the last policy and the device boots into an app in lock task mode, or the user is otherwise unable to reach device settings. - #[serde(rename="networkEscapeHatchEnabled")] - pub network_escape_hatch_enabled: Option, - /// The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. - pub name: Option, - /// The app auto update policy, which controls when automatic app updates can be applied. - #[serde(rename="appAutoUpdatePolicy")] - pub app_auto_update_policy: Option, - /// Whether changing the user icon is disabled. - #[serde(rename="setUserIconDisabled")] - pub set_user_icon_disabled: Option, - /// The battery plugged in modes for which the device stays on. When using this setting, it is recommended to clear maximum_time_to_lock so that the device doesn't lock itself while it stays on. - #[serde(rename="stayOnPluggedModes")] - pub stay_on_plugged_modes: Option>, - /// Whether user installation of apps is disabled. - #[serde(rename="installAppsDisabled")] - pub install_apps_disabled: Option, - /// Whether adjusting the master volume is disabled. - #[serde(rename="adjustVolumeDisabled")] - pub adjust_volume_disabled: Option, - /// A message displayed to the user in the settings screen wherever functionality has been disabled by the admin. - #[serde(rename="shortSupportMessage")] - pub short_support_message: Option, - /// Whether app verification is force-enabled. - #[serde(rename="ensureVerifyAppsEnabled")] - pub ensure_verify_apps_enabled: Option, - /// Allows showing UI on a device for a user to choose a private key alias if there are no matching rules in ChoosePrivateKeyRules. For devices below Android P, setting this may leave enterprise keys vulnerable. - #[serde(rename="privateKeySelectionEnabled")] - pub private_key_selection_enabled: Option, - /// Rules that define the behavior when a particular policy can not be applied on device - #[serde(rename="policyEnforcementRules")] - pub policy_enforcement_rules: Option>, - /// Actions to take during the setup process. - #[serde(rename="setupActions")] - pub setup_actions: Option>, - /// Whether configuring tethering and portable hotspots is disabled. - #[serde(rename="tetheringConfigDisabled")] - pub tethering_config_disabled: Option, - /// Whether all cameras on the device are disabled. - #[serde(rename="cameraDisabled")] - pub camera_disabled: Option, - /// DEPRECATED - Use wifi_config_disabled. - #[serde(rename="wifiConfigsLockdownEnabled")] - pub wifi_configs_lockdown_enabled: Option, - /// Whether adding new users and profiles is disabled. - #[serde(rename="addUserDisabled")] - pub add_user_disabled: Option, - /// Whether the kiosk custom launcher is enabled. This replaces the home screen with a launcher that locks down the device to the apps installed via the applications setting. The apps appear on a single page in alphabetical order. It is recommended to also use status_bar_disabled to block access to device settings. - #[serde(rename="kioskCustomLauncherEnabled")] - pub kiosk_custom_launcher_enabled: Option, - /// Whether rebooting the device into safe boot is disabled. - #[serde(rename="safeBootDisabled")] - pub safe_boot_disabled: Option, - /// Whether removing other users is disabled. - #[serde(rename="removeUserDisabled")] - pub remove_user_disabled: Option, - /// Network configuration for the device. See configure networks for more information. - #[serde(rename="openNetworkConfiguration")] - pub open_network_configuration: Option>, - /// Account types that can't be managed by the user. - #[serde(rename="accountTypesWithManagementDisabled")] - pub account_types_with_management_disabled: Option>, - /// Email addresses of device administrators for factory reset protection. When the device is factory reset, it will require one of these admins to log in with the Google account email and password to unlock the device. If no admins are specified, the device won't provide factory reset protection. - #[serde(rename="frpAdminEmails")] - pub frp_admin_emails: Option>, - /// Password requirements. DEPRECATED - Use password_policies - #[serde(rename="passwordRequirements")] - pub password_requirements: Option, - /// Maximum time in milliseconds for user activity until the device locks. A value of 0 means there is no restriction. - #[serde(rename="maximumTimeToLock")] - pub maximum_time_to_lock: Option, - /// The version of the policy. This is a read-only field. The version is incremented each time the policy is updated. - pub version: Option, - /// Whether the user mounting physical external media is disabled. - #[serde(rename="mountPhysicalMediaDisabled")] - pub mount_physical_media_disabled: Option, - /// Whether configuring VPN is disabled. - #[serde(rename="vpnConfigDisabled")] - pub vpn_config_disabled: Option, - /// Whether adding or removing accounts is disabled. - #[serde(rename="modifyAccountsDisabled")] - pub modify_accounts_disabled: Option, - /// Whether changing the wallpaper is disabled. - #[serde(rename="setWallpaperDisabled")] - pub set_wallpaper_disabled: Option, - /// Flag to skip hints on the first use. Enterprise admin can enable the system recommendation for apps to skip their user tutorial and other introductory hints on first start-up. - #[serde(rename="skipFirstUseHintsEnabled")] - pub skip_first_use_hints_enabled: Option, - /// Whether encryption is enabled - #[serde(rename="encryptionPolicy")] - pub encryption_policy: Option, - /// Whether sending and receiving SMS messages is disabled. - #[serde(rename="smsDisabled")] - pub sms_disabled: Option, - /// The network-independent global HTTP proxy. Typically proxies should be configured per-network in open_network_configuration. However for unusual configurations like general internal filtering a global HTTP proxy may be useful. If the proxy is not accessible, network access may break. The global proxy is only a recommendation and some apps may ignore it. - #[serde(rename="recommendedGlobalProxy")] - pub recommended_global_proxy: Option, - /// Whether bluetooth contact sharing is disabled. - #[serde(rename="bluetoothContactSharingDisabled")] - pub bluetooth_contact_sharing_disabled: Option, - /// Whether configuring Wi-Fi access points is disabled. - #[serde(rename="wifiConfigDisabled")] - pub wifi_config_disabled: Option, - /// Whether USB storage is enabled. Deprecated. - #[serde(rename="usbMassStorageEnabled")] - pub usb_mass_storage_enabled: Option, - /// Policy applied to apps. - pub applications: Option>, - /// Whether the microphone is muted and adjusting microphone volume is disabled. - #[serde(rename="unmuteMicrophoneDisabled")] - pub unmute_microphone_disabled: Option, - /// Whether the user is allowed to enable debugging features. - #[serde(rename="debuggingFeaturesAllowed")] - pub debugging_features_allowed: Option, - /// Whether user uninstallation of applications is disabled. - #[serde(rename="uninstallAppsDisabled")] - pub uninstall_apps_disabled: Option, - /// The minimum allowed Android API level. - #[serde(rename="minimumApiLevel")] - pub minimum_api_level: Option, - /// Whether outgoing calls are disabled. - #[serde(rename="outgoingCallsDisabled")] - pub outgoing_calls_disabled: Option, - /// Whether auto time is required, which prevents the user from manually setting the date and time. - #[serde(rename="autoTimeRequired")] - pub auto_time_required: Option, - /// The system update policy, which controls how OS updates are applied. If the update type is WINDOWED, the update window will automatically apply to Play app updates as well. - #[serde(rename="systemUpdate")] - pub system_update: Option, - /// Whether screen capture is disabled. - #[serde(rename="screenCaptureDisabled")] - pub screen_capture_disabled: Option, - /// Whether configuring user credentials is disabled. - #[serde(rename="credentialsConfigDisabled")] - pub credentials_config_disabled: Option, - /// Explicit permission or group grants or denials for all apps. These values override the default_permission_policy. - #[serde(rename="permissionGrants")] - pub permission_grants: Option>, - /// Whether creating windows besides app windows is disabled. - #[serde(rename="createWindowsDisabled")] - pub create_windows_disabled: Option, -} - -impl RequestValue for Policy {} -impl ResponseResult for Policy {} +impl RequestValue for EnrollmentToken {} +impl ResponseResult for EnrollmentToken {} /// A web app. @@ -910,7 +489,7 @@ pub struct WebApp { pub name: Option, /// A list of icons for the web app. Must have at least one element. pub icons: Option>, - /// The current version of the app.

          Note that the version can automatically increase during the lifetime of the web app, while Google does internal housekeeping to keep the web app up-to-date. + /// The current version of the app.Note that the version can automatically increase during the lifetime of the web app, while Google does internal housekeeping to keep the web app up-to-date. #[serde(rename="versionCode")] pub version_code: Option, /// The title of the web app as displayed to the user (e.g., amongst a list of other applications, or as a label for an icon). @@ -1019,50 +598,30 @@ pub struct Status { impl Part for Status {} -/// Information about security related device settings on device. +/// Settings controlling the behavior of a device in kiosk mode. To enable kiosk mode, set kioskCustomLauncherEnabled to true or specify an app in the policy with installType KIOSK. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeviceSettings { - /// Whether ADB (https://developer.android.com/studio/command-line/adb.html) is enabled on the device. - #[serde(rename="adbEnabled")] - pub adb_enabled: Option, - /// Whether the storage encryption is enabled. - #[serde(rename="isEncrypted")] - pub is_encrypted: Option, - /// Whether developer mode is enabled on the device. - #[serde(rename="developmentSettingsEnabled")] - pub development_settings_enabled: Option, - /// Whether the device is secured with PIN/password. - #[serde(rename="isDeviceSecure")] - pub is_device_secure: Option, - /// Encryption status from DevicePolicyManager. - #[serde(rename="encryptionStatus")] - pub encryption_status: Option, - /// Whether installing apps from unknown sources is enabled. - #[serde(rename="unknownSourcesEnabled")] - pub unknown_sources_enabled: Option, - /// Whether Verify Apps (Google Play Protect (https://support.google.com/googleplay/answer/2812853)) is enabled on the device. - #[serde(rename="verifyAppsEnabled")] - pub verify_apps_enabled: Option, +pub struct KioskCustomization { + /// Specifies whether system info and notifications are disabled in kiosk mode. + #[serde(rename="statusBar")] + pub status_bar: Option, + /// Specifies whether the Settings app is allowed in kiosk mode. + #[serde(rename="deviceSettings")] + pub device_settings: Option, + /// Specifies which navigation features are enabled (e.g. Home, Overview buttons) in kiosk mode. + #[serde(rename="systemNavigation")] + pub system_navigation: Option, + /// Sets the behavior of a device in kiosk mode when a user presses and holds (long-presses) the Power button. + #[serde(rename="powerButtonActions")] + pub power_button_actions: Option, + /// Specifies whether system error dialogs for crashed or unresponsive apps are blocked in kiosk mode. When blocked, the system will force-stop the app as if the user chooses the "close app" option on the UI. + #[serde(rename="systemErrorWarnings")] + pub system_error_warnings: Option, } -impl Part for DeviceSettings {} - - -/// An action to block access to apps and data on a fully managed device or in a work profile. This action also triggers a device or work profile to displays a user-facing notification with information (where possible) on how to correct the compliance issue. Note: wipeAction must also be specified. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BlockAction { - /// Number of days the policy is non-compliant before the device or work profile is blocked. To block access immediately, set to 0. blockAfterDays must be less than wipeAfterDays. - #[serde(rename="blockAfterDays")] - pub block_after_days: Option, -} - -impl Part for BlockAction {} +impl Part for KioskCustomization {} /// A compliance rule condition which is satisfied if the Android Framework API level on the device doesn't meet a minimum requirement. There can only be one rule with this type of condition per policy. @@ -1119,83 +678,34 @@ impl Part for User {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Device { - /// Detailed information about the device hardware. - #[serde(rename="hardwareInfo")] - pub hardware_info: Option, /// The name of the policy currently applied to the device. #[serde(rename="appliedPolicyName")] pub applied_policy_name: Option, - /// Device network information. This information is only available if networkInfoEnabled is true in the device's policy. - #[serde(rename="networkInfo")] - pub network_info: Option, - /// If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field can be modified by a patch request. - #[serde(rename="disabledReason")] - pub disabled_reason: Option, - /// Events related to memory and storage measurements in chronological order. This information is only available if memoryInfoEnabled is true in the device's policy. - #[serde(rename="memoryEvents")] - pub memory_events: Option>, - /// Power management events on the device in chronological order. This information is only available if powerManagementEventsEnabled is true in the device's policy. - #[serde(rename="powerManagementEvents")] - pub power_management_events: Option>, - /// If the device was enrolled with an enrollment token, this field contains the name of the token. - #[serde(rename="enrollmentTokenName")] - pub enrollment_token_name: Option, /// Detailed information about displays on the device. This information is only available if displayInfoEnabled is true in the device's policy. pub displays: Option>, /// Details about policy settings that the device is not compliant with. #[serde(rename="nonComplianceDetails")] pub non_compliance_details: Option>, - /// Hardware status samples in chronological order. This information is only available if hardwareStatusEnabled is true in the device's policy. - #[serde(rename="hardwareStatusSamples")] - pub hardware_status_samples: Option>, /// The API level of the Android platform version running on the device. #[serde(rename="apiLevel")] pub api_level: Option, - /// The last time the device fetched its policy. - #[serde(rename="lastPolicySyncTime")] - pub last_policy_sync_time: Option, - /// The version of the policy currently applied to the device. - #[serde(rename="appliedPolicyVersion")] - pub applied_policy_version: Option, - /// The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}. - #[serde(rename="userName")] - pub user_name: Option, /// The name of the policy applied to the device, in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy_name for the device's user is applied. This field can be modified by a patch request. You can specify only the policyId when calling enterprises.devices.patch, as long as the policyId doesn’t contain any slashes. The rest of the policy name is inferred. #[serde(rename="policyName")] pub policy_name: Option, - /// The type of management mode Android Device Policy takes on the device. This influences which policy settings are supported. - #[serde(rename="managementMode")] - pub management_mode: Option, + /// If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field can be modified by a patch request. + #[serde(rename="disabledReason")] + pub disabled_reason: Option, /// If the device was enrolled with an enrollment token with additional data provided, this field contains that data. #[serde(rename="enrollmentTokenData")] pub enrollment_token_data: Option, - /// The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. - pub name: Option, - /// If the same physical device has been enrolled multiple times, this field contains its previous device names. The serial number is used as the unique identifier to determine if the same physical device has enrolled previously. The names are in chronological order. - #[serde(rename="previousDeviceNames")] - pub previous_device_names: Option>, - /// The user who owns the device. - pub user: Option, /// Detailed information about the device software. This information is only available if softwareInfoEnabled is true in the device's policy. #[serde(rename="softwareInfo")] pub software_info: Option, - /// The state currently applied to the device. - #[serde(rename="appliedState")] - pub applied_state: Option, /// Whether the device is compliant with its policy. #[serde(rename="policyCompliant")] pub policy_compliant: Option, - /// The time of device enrollment. - #[serde(rename="enrollmentTime")] - pub enrollment_time: Option, - /// Map of selected system properties name and value related to the device. - #[serde(rename="systemProperties")] - pub system_properties: Option>, /// The state to be applied to the device. This field can be modified by a patch request. Note that when calling enterprises.devices.patch, ACTIVE and DISABLED are the only allowable values. To enter the device into a DELETED state, call enterprises.devices.delete. pub state: Option, - /// Memory information. This information is only available if memoryInfoEnabled is true in the device's policy. - #[serde(rename="memoryInfo")] - pub memory_info: Option, /// Deprecated. #[serde(rename="lastPolicyComplianceReportTime")] pub last_policy_compliance_report_time: Option, @@ -1208,24 +718,79 @@ pub struct Device { /// The last time the device sent a status report. #[serde(rename="lastStatusReportTime")] pub last_status_report_time: Option, + /// Detailed information about the device hardware. + #[serde(rename="hardwareInfo")] + pub hardware_info: Option, + /// Device's security posture value that reflects how secure the device is. + #[serde(rename="securityPosture")] + pub security_posture: Option, + /// Device network information. This information is only available if networkInfoEnabled is true in the device's policy. + #[serde(rename="networkInfo")] + pub network_info: Option, + /// The type of management mode Android Device Policy takes on the device. This influences which policy settings are supported. + #[serde(rename="managementMode")] + pub management_mode: Option, + /// Events related to memory and storage measurements in chronological order. This information is only available if memoryInfoEnabled is true in the device's policy. + #[serde(rename="memoryEvents")] + pub memory_events: Option>, + /// Power management events on the device in chronological order. This information is only available if powerManagementEventsEnabled is true in the device's policy. + #[serde(rename="powerManagementEvents")] + pub power_management_events: Option>, + /// If the device was enrolled with an enrollment token, this field contains the name of the token. + #[serde(rename="enrollmentTokenName")] + pub enrollment_token_name: Option, + /// The user who owns the device. + pub user: Option, + /// Hardware status samples in chronological order. This information is only available if hardwareStatusEnabled is true in the device's policy. + #[serde(rename="hardwareStatusSamples")] + pub hardware_status_samples: Option>, + /// The version of the policy currently applied to the device. + #[serde(rename="appliedPolicyVersion")] + pub applied_policy_version: Option, + /// The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}. + #[serde(rename="userName")] + pub user_name: Option, + /// The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + pub name: Option, + /// If the same physical device has been enrolled multiple times, this field contains its previous device names. The serial number is used as the unique identifier to determine if the same physical device has enrolled previously. The names are in chronological order. + #[serde(rename="previousDeviceNames")] + pub previous_device_names: Option>, + /// The last time the device fetched its policy. + #[serde(rename="lastPolicySyncTime")] + pub last_policy_sync_time: Option, + /// The state currently applied to the device. + #[serde(rename="appliedState")] + pub applied_state: Option, + /// Map of selected system properties name and value related to the device. This information is only available if systemPropertiesEnabled is true in the device's policy. + #[serde(rename="systemProperties")] + pub system_properties: Option>, + /// Memory information. This information is only available if memoryInfoEnabled is true in the device's policy. + #[serde(rename="memoryInfo")] + pub memory_info: Option, + /// The time of device enrollment. + #[serde(rename="enrollmentTime")] + pub enrollment_time: Option, } impl RequestValue for Device {} impl ResponseResult for Device {} -/// Settings controlling the behavior of application reports. +/// Id to name association of a app track. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApplicationReportingSettings { - /// Whether removed apps are included in application reports. - #[serde(rename="includeRemovedApps")] - pub include_removed_apps: Option, +pub struct AppTrackInfo { + /// The track name associated with the trackId, set in the Play Console. The name is modifiable from Play Console. + #[serde(rename="trackAlias")] + pub track_alias: Option, + /// The unmodifiable unique track identifier, taken from the releaseTrackId in the URL of the Play Console page that displays the app’s track information. + #[serde(rename="trackId")] + pub track_id: Option, } -impl Part for ApplicationReportingSettings {} +impl Part for AppTrackInfo {} /// A resource containing sign in details for an enterprise. @@ -1248,69 +813,298 @@ pub struct SigninDetail { impl Part for SigninDetail {} -/// An enrollment token. +/// A rule that defines the actions to take if a device or work profile is not compliant with the policy specified in settingName. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PolicyEnforcementRule { + /// An action to reset a fully managed device or delete a work profile. Note: blockAction must also be specified. + #[serde(rename="wipeAction")] + pub wipe_action: Option, + /// An action to block access to apps and data on a fully managed device or in a work profile. This action also triggers a user-facing notification with information (where possible) on how to correct the compliance issue. Note: wipeAction must also be specified. + #[serde(rename="blockAction")] + pub block_action: Option, + /// The top-level policy to enforce. For example, applications or passwordPolicies. + #[serde(rename="settingName")] + pub setting_name: Option, +} + +impl Part for PolicyEnforcementRule {} + + +/// A list of package names. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PackageNameList { + /// A list of package names. + #[serde(rename="packageNames")] + pub package_names: Option>, +} + +impl Part for PackageNameList {} + + +/// A system freeze period. When a device’s clock is within the freeze period, all incoming system updates (including security patches) are blocked and won’t be installed. When a device is outside the freeze period, normal update behavior applies. Leap years are ignored in freeze period calculations, in particular: * If Feb. 29th is set as the start or end date of a freeze period, the freeze period will start or end on Feb. 28th instead. * When a device’s system clock reads Feb. 29th, it’s treated as Feb. 28th. * When calculating the number of days in a freeze period or the time between two freeze periods, Feb. 29th is ignored and not counted as a day. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FreezePeriod { + /// The start date (inclusive) of the freeze period. Note: year must not be set. For example, {"month": 1,"date": 30}. + #[serde(rename="startDate")] + pub start_date: Option, + /// The end date (inclusive) of the freeze period. Must be no later than 90 days from the start date. If the end date is earlier than the start date, the freeze period is considered wrapping year-end. Note: year must not be set. For example, {"month": 1,"date": 30}. + #[serde(rename="endDate")] + pub end_date: Option, +} + +impl Part for FreezePeriod {} + + +/// Information about device software. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SoftwareInfo { + /// An IETF BCP 47 language code for the primary locale on the device. + #[serde(rename="primaryLanguageCode")] + pub primary_language_code: Option, + /// Build time. + #[serde(rename="androidBuildTime")] + pub android_build_time: Option, + /// Android build ID string meant for displaying to the user. For example, shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. + #[serde(rename="androidBuildNumber")] + pub android_build_number: Option, + /// SHA-256 hash of android.content.pm.Signature (https://developer.android.com/reference/android/content/pm/Signature.html) associated with the system package, which can be used to verify that the system build hasn't been modified. + #[serde(rename="deviceBuildSignature")] + pub device_build_signature: Option, + /// The Android Device Policy app version code. + #[serde(rename="androidDevicePolicyVersionCode")] + pub android_device_policy_version_code: Option, + /// Security patch level, e.g. 2016-05-01. + #[serde(rename="securityPatchLevel")] + pub security_patch_level: Option, + /// The Android Device Policy app version as displayed to the user. + #[serde(rename="androidDevicePolicyVersionName")] + pub android_device_policy_version_name: Option, + /// Kernel version, for example, 2.6.32.9-g103d848. + #[serde(rename="deviceKernelVersion")] + pub device_kernel_version: Option, + /// The user-visible Android version string. For example, 6.0.1. + #[serde(rename="androidVersion")] + pub android_version: Option, + /// The system bootloader version number, e.g. 0.6.7. + #[serde(rename="bootloaderVersion")] + pub bootloader_version: Option, +} + +impl Part for SoftwareInfo {} + + +/// A rule declaring which mitigating actions to take when a device is not compliant with its policy. For every rule, there is always an implicit mitigating action to set policy_compliant to false for the Device resource, and display a message on the device indicating that the device is not compliant with its policy. Other mitigating actions may optionally be taken as well, depending on the field values in the rule. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ComplianceRule { + /// A condition which is satisfied if the Android Framework API level on the device doesn't meet a minimum requirement. + #[serde(rename="apiLevelCondition")] + pub api_level_condition: Option, + /// If set, the rule includes a mitigating action to disable apps specified in the list, but app data is preserved. + #[serde(rename="packageNamesToDisable")] + pub package_names_to_disable: Option>, + /// A condition which is satisfied if there exists any matching NonComplianceDetail for the device. + #[serde(rename="nonComplianceDetailCondition")] + pub non_compliance_detail_condition: Option, + /// If set to true, the rule includes a mitigating action to disable apps so that the device is effectively disabled, but app data is preserved. If the device is running an app in locked task mode, the app will be closed and a UI showing the reason for non-compliance will be displayed. + #[serde(rename="disableApps")] + pub disable_apps: Option, +} + +impl Part for ComplianceRule {} + + +/// An action executed during setup. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetupAction { + /// An action to launch an app. + #[serde(rename="launchApp")] + pub launch_app: Option, + /// Description of this action. + pub description: Option, + /// Title of this action. + pub title: Option, +} + +impl Part for SetupAction {} + + +/// The configuration applied to an enterprise. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [enrollment tokens create enterprises](struct.EnterpriseEnrollmentTokenCreateCall.html) (request|response) +/// * [policies list enterprises](struct.EnterprisePolicyListCall.html) (none) +/// * [web apps delete enterprises](struct.EnterpriseWebAppDeleteCall.html) (none) +/// * [policies patch enterprises](struct.EnterprisePolicyPatchCall.html) (none) +/// * [create enterprises](struct.EnterpriseCreateCall.html) (request|response) +/// * [web apps create enterprises](struct.EnterpriseWebAppCreateCall.html) (none) +/// * [enrollment tokens create enterprises](struct.EnterpriseEnrollmentTokenCreateCall.html) (none) +/// * [web apps list enterprises](struct.EnterpriseWebAppListCall.html) (none) +/// * [devices list enterprises](struct.EnterpriseDeviceListCall.html) (none) +/// * [policies delete enterprises](struct.EnterprisePolicyDeleteCall.html) (none) +/// * [devices operations cancel enterprises](struct.EnterpriseDeviceOperationCancelCall.html) (none) +/// * [devices operations delete enterprises](struct.EnterpriseDeviceOperationDeleteCall.html) (none) +/// * [devices operations get enterprises](struct.EnterpriseDeviceOperationGetCall.html) (none) +/// * [devices operations list enterprises](struct.EnterpriseDeviceOperationListCall.html) (none) +/// * [devices patch enterprises](struct.EnterpriseDevicePatchCall.html) (none) +/// * [patch enterprises](struct.EnterprisePatchCall.html) (request|response) +/// * [policies get enterprises](struct.EnterprisePolicyGetCall.html) (none) +/// * [web tokens create enterprises](struct.EnterpriseWebTokenCreateCall.html) (none) +/// * [web apps patch enterprises](struct.EnterpriseWebAppPatchCall.html) (none) +/// * [enrollment tokens delete enterprises](struct.EnterpriseEnrollmentTokenDeleteCall.html) (none) +/// * [devices issue command enterprises](struct.EnterpriseDeviceIssueCommandCall.html) (none) +/// * [devices delete enterprises](struct.EnterpriseDeviceDeleteCall.html) (none) +/// * [web apps get enterprises](struct.EnterpriseWebAppGetCall.html) (none) +/// * [devices get enterprises](struct.EnterpriseDeviceGetCall.html) (none) +/// * [get enterprises](struct.EnterpriseGetCall.html) (response) +/// * [applications get enterprises](struct.EnterpriseApplicationGetCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EnrollmentToken { - /// Optional, arbitrary data associated with the enrollment token. This could contain, for example, the ID of an org unit the device is assigned to after enrollment. After a device enrolls with the token, this data will be exposed in the enrollment_token_data field of the Device resource. The data must be 1024 characters or less; otherwise, the creation request will fail. - #[serde(rename="additionalData")] - pub additional_data: Option, - /// The name of the enrollment token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. +pub struct Enterprise { + /// Terms and conditions that must be accepted when provisioning a device for this enterprise. A page of terms is generated for each value in this list. + #[serde(rename="termsAndConditions")] + pub terms_and_conditions: Option>, + /// The name of the enterprise which is generated by the server during creation, in the form enterprises/{enterpriseId}. pub name: Option, - /// Whether the enrollment token is for one time use only. If the flag is set to true, only one device can use it for registration. - #[serde(rename="oneTimeOnly")] - pub one_time_only: Option, - /// The name of the policy initially applied to the enrolled device, in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy_name for the device’s user is applied. If user_name is also not specified, enterprises/{enterpriseId}/policies/default is applied by default. When updating this field, you can specify only the policyId as long as the policyId doesn’t contain any slashes. The rest of the policy name will be inferred. - #[serde(rename="policyName")] - pub policy_name: Option, - /// The token value that's passed to the device and authorizes the device to enroll. This is a read-only field generated by the server. - pub value: Option, - /// The length of time the enrollment token is valid, ranging from 1 minute to 30 days. If not specified, the default duration is 1 hour. - pub duration: Option, - /// The user associated with this enrollment token. If it's specified when the enrollment token is created and the user does not exist, the user will be created. This field must not contain personally identifiable information. Only the account_identifier field needs to be set. - pub user: Option, - /// A JSON string whose UTF-8 representation can be used to generate a QR code to enroll a device with this enrollment token. To enroll a device using NFC, the NFC record must contain a serialized java.util.Properties representation of the properties in the JSON. - #[serde(rename="qrCode")] - pub qr_code: Option, - /// The expiration time of the token. This is a read-only field generated by the server. - #[serde(rename="expirationTimestamp")] - pub expiration_timestamp: Option, + /// The types of Google Pub/Sub notifications enabled for the enterprise. + #[serde(rename="enabledNotificationTypes")] + pub enabled_notification_types: Option>, + /// An image displayed as a logo during device provisioning. Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp, image/vnd.wap.wbmp, image/x-adobe-dng. + pub logo: Option, + /// Sign-in details of the enterprise. + #[serde(rename="signinDetails")] + pub signin_details: Option>, + /// The name of the enterprise displayed to users. + #[serde(rename="enterpriseDisplayName")] + pub enterprise_display_name: Option, + /// A color in RGB format that indicates the predominant color to display in the device management app UI. The color components are stored as follows: (red << 16) | (green << 8) | blue, where the value of each component is between 0 and 255, inclusive. + #[serde(rename="primaryColor")] + pub primary_color: Option, + /// The topic that Cloud Pub/Sub notifications are published to, in the form projects/{project}/topics/{topic}. This field is only required if Pub/Sub notifications are enabled. + #[serde(rename="pubsubTopic")] + pub pubsub_topic: Option, + /// Deprecated and unused. + #[serde(rename="appAutoApprovalEnabled")] + pub app_auto_approval_enabled: Option, } -impl RequestValue for EnrollmentToken {} -impl ResponseResult for EnrollmentToken {} +impl RequestValue for Enterprise {} +impl Resource for Enterprise {} +impl ResponseResult for Enterprise {} -/// Keyed app state reported by the app. +/// A default activity for handling intents that match a particular intent filter. Note: To set up a kiosk, use InstallType to KIOSK rather than use persistent preferred activities. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct KeyedAppState { - /// The key for the app state. Acts as a point of reference for what the app is providing state for. For example, when providing managed configuration feedback, this key could be the managed configuration key. - pub key: Option, - /// The severity of the app state. - pub severity: Option, - /// The time the app state was most recently updated. - #[serde(rename="lastUpdateTime")] - pub last_update_time: Option, - /// Optionally, a free-form message string to explain the app state. If the state was triggered by a particular value (e.g. a managed configuration value), it should be included in the message. - pub message: Option, - /// Optionally, a machine-readable value to be read by the EMM. For example, setting values that the admin can choose to query against in the EMM console (e.g. “notify me if the battery_warning data < 10”). - pub data: Option, - /// The creation time of the app state on the device. - #[serde(rename="createTime")] - pub create_time: Option, +pub struct PersistentPreferredActivity { + /// The activity that should be the default intent handler. This should be an Android component name, e.g. com.android.enterprise.app/.MainActivity. Alternatively, the value may be the package name of an app, which causes Android Device Policy to choose an appropriate activity from the app to handle the intent. + #[serde(rename="receiverActivity")] + pub receiver_activity: Option, + /// The intent actions to match in the filter. If any actions are included in the filter, then an intent's action must be one of those values for it to match. If no actions are included, the intent action is ignored. + pub actions: Option>, + /// The intent categories to match in the filter. An intent includes the categories that it requires, all of which must be included in the filter in order to match. In other words, adding a category to the filter has no impact on matching unless that category is specified in the intent. + pub categories: Option>, } -impl Part for KeyedAppState {} +impl Part for PersistentPreferredActivity {} + + +/// Information about security related device settings on device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceSettings { + /// Whether ADB (https://developer.android.com/studio/command-line/adb.html) is enabled on the device. + #[serde(rename="adbEnabled")] + pub adb_enabled: Option, + /// Whether the storage encryption is enabled. + #[serde(rename="isEncrypted")] + pub is_encrypted: Option, + /// Whether developer mode is enabled on the device. + #[serde(rename="developmentSettingsEnabled")] + pub development_settings_enabled: Option, + /// Whether the device is secured with PIN/password. + #[serde(rename="isDeviceSecure")] + pub is_device_secure: Option, + /// Encryption status from DevicePolicyManager. + #[serde(rename="encryptionStatus")] + pub encryption_status: Option, + /// Whether installing apps from unknown sources is enabled. + #[serde(rename="unknownSourcesEnabled")] + pub unknown_sources_enabled: Option, + /// Whether Verify Apps (Google Play Protect (https://support.google.com/googleplay/answer/2812853)) is enabled on the device. + #[serde(rename="verifyAppsEnabled")] + pub verify_apps_enabled: Option, +} + +impl Part for DeviceSettings {} + + +/// Device display information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Display { + /// Refresh rate of the display in frames per second. + #[serde(rename="refreshRate")] + pub refresh_rate: Option, + /// Display width in pixels. + pub width: Option, + /// State of the display. + pub state: Option, + /// Name of the display. + pub name: Option, + /// Display density expressed as dots-per-inch. + pub density: Option, + /// Unique display id. + #[serde(rename="displayId")] + pub display_id: Option, + /// Display height in pixels. + pub height: Option, +} + +impl Part for Display {} + + +/// The managed configurations template for the app, saved from the managed configurations iframe. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedConfigurationTemplate { + /// Optional, a map containing configuration variables defined for the configuration. + #[serde(rename="configurationVariables")] + pub configuration_variables: Option>, + /// The ID of the managed configurations template. + #[serde(rename="templateId")] + pub template_id: Option, +} + +impl Part for ManagedConfigurationTemplate {} /// Information about device hardware. The fields related to temperature thresholds are only available if hardwareStatusEnabled is true in the device's policy. @@ -1362,46 +1156,158 @@ pub struct HardwareInfo { impl Part for HardwareInfo {} -/// A rule that defines the actions to take if a device or work profile is not compliant with the policy specified in settingName. +/// Hardware status. Temperatures may be compared to the temperature thresholds available in hardwareInfo to determine hardware health. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PolicyEnforcementRule { - /// An action to reset a fully managed device or delete a work profile. Note: blockAction must also be specified. - #[serde(rename="wipeAction")] - pub wipe_action: Option, - /// An action to block access to apps and data on a fully managed device or in a work profile. This action also triggers a user-facing notification with information (where possible) on how to correct the compliance issue. Note: wipeAction must also be specified. - #[serde(rename="blockAction")] - pub block_action: Option, - /// The top-level policy to enforce. For example, applications or passwordPolicies. - #[serde(rename="settingName")] - pub setting_name: Option, +pub struct HardwareStatus { + /// Current battery temperatures in Celsius for each battery on the device. + #[serde(rename="batteryTemperatures")] + pub battery_temperatures: Option>, + /// Current device skin temperatures in Celsius. + #[serde(rename="skinTemperatures")] + pub skin_temperatures: Option>, + /// Current GPU temperatures in Celsius for each GPU on the device. + #[serde(rename="gpuTemperatures")] + pub gpu_temperatures: Option>, + /// Fan speeds in RPM for each fan on the device. Empty array means that there are no fans or fan speed is not supported on the system. + #[serde(rename="fanSpeeds")] + pub fan_speeds: Option>, + /// Current CPU temperatures in Celsius for each CPU on the device. + #[serde(rename="cpuTemperatures")] + pub cpu_temperatures: Option>, + /// The time the measurements were taken. + #[serde(rename="createTime")] + pub create_time: Option, + /// CPU usages in percentage for each core available on the device. Usage is 0 for each unplugged core. Empty array implies that CPU usage is not supported in the system. + #[serde(rename="cpuUsages")] + pub cpu_usages: Option>, } -impl Part for PolicyEnforcementRule {} +impl Part for HardwareStatus {} -/// Response to a request to list web apps for a given enterprise. +/// The security posture of the device, as determined by the current device state and the policies applied. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPosture { + /// Device's security posture value. + #[serde(rename="devicePosture")] + pub device_posture: Option, + /// Additional details regarding the security posture of the device. + #[serde(rename="postureDetails")] + pub posture_details: Option>, +} + +impl Part for SecurityPosture {} + + +/// An enterprise signup URL. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [web apps list enterprises](struct.EnterpriseWebAppListCall.html) (response) +/// * [create signup urls](struct.SignupUrlCreateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListWebAppsResponse { - /// If there are more results, a token to retrieve next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of web apps. - #[serde(rename="webApps")] - pub web_apps: Option>, +pub struct SignupUrl { + /// A URL where an enterprise admin can register their enterprise. The page can't be rendered in an iframe. + pub url: Option, + /// The name of the resource. Use this value in the signupUrl field when calling enterprises.create to complete the enterprise signup flow. + pub name: Option, } -impl ResponseResult for ListWebAppsResponse {} +impl Resource for SignupUrl {} +impl ResponseResult for SignupUrl {} + + +/// A web token used to access the managed Google Play iframe. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [web tokens create enterprises](struct.EnterpriseWebTokenCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WebToken { + /// The features to enable. Use this if you want to control exactly which feature(s) will be activated; leave empty to allow all features.Restrictions / things to note:

          • If no features are listed here, all features are enabled — this is the default behavior where you give access to all features to your admins.
          • This must not contain any FEATURE_UNSPECIFIED values.
          • Repeated values are ignored
          + #[serde(rename="enabledFeatures")] + pub enabled_features: Option>, + /// The URL of the parent frame hosting the iframe with the embedded UI. To prevent XSS, the iframe may not be hosted at other URLs. The URL must use the https scheme. + #[serde(rename="parentFrameUrl")] + pub parent_frame_url: Option, + /// The name of the web token, which is generated by the server during creation in the form enterprises/{enterpriseId}/webTokens/{webTokenId}. + pub name: Option, + /// The token value which is used in the hosting page to generate the iframe with the embedded UI. This is a read-only field generated by the server. + pub value: Option, + /// Permissions available to an admin in the embedded UI. An admin must have all of these permissions in order to view the UI. This field is deprecated. + pub permissions: Option>, +} + +impl RequestValue for WebToken {} +impl ResponseResult for WebToken {} + + +/// Settings controlling the behavior of application reports. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApplicationReportingSettings { + /// Whether removed apps are included in application reports. + #[serde(rename="includeRemovedApps")] + pub include_removed_apps: Option, +} + +impl Part for ApplicationReportingSettings {} + + +/// Settings controlling the behavior of status reports. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StatusReportingSettings { + /// Whether network info reporting is enabled. + #[serde(rename="networkInfoEnabled")] + pub network_info_enabled: Option, + /// Whether system properties reporting is enabled. + #[serde(rename="systemPropertiesEnabled")] + pub system_properties_enabled: Option, + /// Whether memory reporting is enabled. + #[serde(rename="memoryInfoEnabled")] + pub memory_info_enabled: Option, + /// Whether hardware status reporting is enabled. Report data is not available for personally owned devices with work profiles. + #[serde(rename="hardwareStatusEnabled")] + pub hardware_status_enabled: Option, + /// Whether device settings reporting is enabled. + #[serde(rename="deviceSettingsEnabled")] + pub device_settings_enabled: Option, + /// Whether app reports are enabled. + #[serde(rename="applicationReportsEnabled")] + pub application_reports_enabled: Option, + /// Whether power management event reporting is enabled. Report data is not available for personally owned devices with work profiles. + #[serde(rename="powerManagementEventsEnabled")] + pub power_management_events_enabled: Option, + /// Application reporting settings. Only applicable if application_reports_enabled is true. + #[serde(rename="applicationReportingSettings")] + pub application_reporting_settings: Option, + /// Whether software info reporting is enabled. + #[serde(rename="softwareInfoEnabled")] + pub software_info_enabled: Option, + /// Whether displays reporting is enabled. Report data is not available for personally owned devices with work profiles. + #[serde(rename="displayInfoEnabled")] + pub display_info_enabled: Option, +} + +impl Part for StatusReportingSettings {} /// This resource represents a long-running operation that is the result of a network API call. @@ -1431,18 +1337,542 @@ pub struct Operation { impl ResponseResult for Operation {} -/// A list of package names. +/// Response to a request to list policies for a given enterprise. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [policies list enterprises](struct.EnterprisePolicyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListPoliciesResponse { + /// If there are more results, a token to retrieve next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of policies. + pub policies: Option>, +} + +impl ResponseResult for ListPoliciesResponse {} + + +/// Information reported about an installed app. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PackageNameList { - /// A list of package names. - #[serde(rename="packageNames")] - pub package_names: Option>, +pub struct ApplicationReport { + /// The display name of the app. + #[serde(rename="displayName")] + pub display_name: Option, + /// The package name of the app that installed this app. + #[serde(rename="installerPackageName")] + pub installer_package_name: Option, + /// Package name of the app. + #[serde(rename="packageName")] + pub package_name: Option, + /// List of keyed app states reported by the app. + #[serde(rename="keyedAppStates")] + pub keyed_app_states: Option>, + /// The SHA-256 hash of the app's APK file, which can be used to verify the app hasn't been modified. Each byte of the hash value is represented as a two-digit hexadecimal number. + #[serde(rename="packageSha256Hash")] + pub package_sha256_hash: Option, + /// The SHA-1 hash of each android.content.pm.Signature (https://developer.android.com/reference/android/content/pm/Signature.html) associated with the app package. Each byte of each hash value is represented as a two-digit hexadecimal number. + #[serde(rename="signingKeyCertFingerprints")] + pub signing_key_cert_fingerprints: Option>, + /// The source of the package. + #[serde(rename="applicationSource")] + pub application_source: Option, + /// Application state. + pub state: Option, + /// The app version as displayed to the user. + #[serde(rename="versionName")] + pub version_name: Option, + /// The app version code, which can be used to determine whether one version is more recent than another. + #[serde(rename="versionCode")] + pub version_code: Option, + /// List of app events. The most recent 20 events are stored in the list. + pub events: Option>, } -impl Part for PackageNameList {} +impl Part for ApplicationReport {} + + +/// A compliance rule condition which is satisfied if there exists any matching NonComplianceDetail for the device. A NonComplianceDetail matches a NonComplianceDetailCondition if all the fields which are set within the NonComplianceDetailCondition match the corresponding NonComplianceDetail fields. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NonComplianceDetailCondition { + /// The package name of the app that's out of compliance. If not set, then this condition matches any package name. + #[serde(rename="packageName")] + pub package_name: Option, + /// The name of the policy setting. This is the JSON field name of a top-level Policy field. If not set, then this condition matches any setting name. + #[serde(rename="settingName")] + pub setting_name: Option, + /// The reason the device is not in compliance with the setting. If not set, then this condition matches any reason. + #[serde(rename="nonComplianceReason")] + pub non_compliance_reason: Option, +} + +impl Part for NonComplianceDetailCondition {} + + +/// Configuration for managing system updates +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystemUpdate { + /// If the type is WINDOWED, the end of the maintenance window, measured as the number of minutes after midnight in device's local time. This value must be between 0 and 1439, inclusive. If this value is less than start_minutes, then the maintenance window spans midnight. If the maintenance window specified is smaller than 30 minutes, the actual window is extended to 30 minutes beyond the start time. + #[serde(rename="endMinutes")] + pub end_minutes: Option, + /// An annually repeating time period in which over-the-air (OTA) system updates are postponed to freeze the OS version running on a device. To prevent freezing the device indefinitely, each freeze period must be separated by at least 60 days. + #[serde(rename="freezePeriods")] + pub freeze_periods: Option>, + /// If the type is WINDOWED, the start of the maintenance window, measured as the number of minutes after midnight in the device's local time. This value must be between 0 and 1439, inclusive. + #[serde(rename="startMinutes")] + pub start_minutes: Option, + /// The type of system update to configure. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for SystemUpdate {} + + +/// An app-related event. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApplicationEvent { + /// App event type. + #[serde(rename="eventType")] + pub event_type: Option, + /// The creation time of the event. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl Part for ApplicationEvent {} + + +/// An event related to memory and storage measurements. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MemoryEvent { + /// Event type. + #[serde(rename="eventType")] + pub event_type: Option, + /// The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium. + #[serde(rename="byteCount")] + pub byte_count: Option, + /// The creation time of the event. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl Part for MemoryEvent {} + + +/// Information about an app. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [applications get enterprises](struct.EnterpriseApplicationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Application { + /// Application tracks visible to the enterprise. + #[serde(rename="appTracks")] + pub app_tracks: Option>, + /// The set of managed properties available to be pre-configured for the app. + #[serde(rename="managedProperties")] + pub managed_properties: Option>, + /// The permissions required by the app. + pub permissions: Option>, + /// The name of the app in the form enterprises/{enterpriseId}/applications/{package_name}. + pub name: Option, + /// The title of the app. Localized. + pub title: Option, +} + +impl ResponseResult for Application {} + + +/// Information about device memory and storage. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MemoryInfo { + /// Total internal storage on device in bytes. + #[serde(rename="totalInternalStorage")] + pub total_internal_storage: Option, + /// Total RAM on device in bytes. + #[serde(rename="totalRam")] + pub total_ram: Option, +} + +impl Part for MemoryInfo {} + + +/// A policy resource represents a group of settings that govern the behavior of a managed device and the apps installed on it. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [policies patch enterprises](struct.EnterprisePolicyPatchCall.html) (request|response) +/// * [policies get enterprises](struct.EnterprisePolicyGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Rules declaring which mitigating actions to take when a device is not compliant with its policy. When the conditions for multiple rules are satisfied, all of the mitigating actions for the rules are taken. There is a maximum limit of 100 rules. Use policy enforcement rules instead. + #[serde(rename="complianceRules")] + pub compliance_rules: Option>, + /// Whether roaming data services are disabled. + #[serde(rename="dataRoamingDisabled")] + pub data_roaming_disabled: Option, + /// Whether resetting network settings is disabled. + #[serde(rename="networkResetDisabled")] + pub network_reset_disabled: Option, + /// Whether location sharing is disabled. + #[serde(rename="shareLocationDisabled")] + pub share_location_disabled: Option, + /// Default intent handler activities. + #[serde(rename="persistentPreferredActivities")] + pub persistent_preferred_activities: Option>, + /// If present, only the input methods provided by packages in this list are permitted. If this field is present, but the list is empty, then only system input methods are permitted. + #[serde(rename="permittedInputMethods")] + pub permitted_input_methods: Option, + /// Status reporting settings + #[serde(rename="statusReportingSettings")] + pub status_reporting_settings: Option, + /// Whether configuring bluetooth is disabled. + #[serde(rename="bluetoothConfigDisabled")] + pub bluetooth_config_disabled: Option, + /// The degree of location detection enabled. The user may change the value unless the user is otherwise blocked from accessing device settings. + #[serde(rename="locationMode")] + pub location_mode: Option, + /// Whether configuring mobile networks is disabled. + #[serde(rename="mobileNetworksConfigDisabled")] + pub mobile_networks_config_disabled: Option, + /// Security policies set to the most secure values by default. To maintain the security posture of a device, we don't recommend overriding any of the default values. + #[serde(rename="advancedSecurityOverrides")] + pub advanced_security_overrides: Option, + /// Whether the user is allowed to enable the "Unknown Sources" setting, which allows installation of apps from unknown sources. + #[serde(rename="installUnknownSourcesAllowed")] + pub install_unknown_sources_allowed: Option, + /// Whether applications other than the ones configured in applications are blocked from being installed. When set, applications that were installed under a previous policy but no longer appear in the policy are automatically uninstalled. + #[serde(rename="blockApplicationsEnabled")] + pub block_applications_enabled: Option, + /// A message displayed to the user in the device administators settings screen. + #[serde(rename="longSupportMessage")] + pub long_support_message: Option, + /// The app tracks for Android Device Policy the device can access. The device receives the latest version among all accessible tracks. If no tracks are specified, then the device only uses the production track. + #[serde(rename="androidDevicePolicyTracks")] + pub android_device_policy_tracks: Option>, + /// The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. + pub name: Option, + /// The default permission policy for runtime permission requests. + #[serde(rename="defaultPermissionPolicy")] + pub default_permission_policy: Option, + /// Whether bluetooth is disabled. Prefer this setting over bluetooth_config_disabled because bluetooth_config_disabled can be bypassed by the user. + #[serde(rename="bluetoothDisabled")] + pub bluetooth_disabled: Option, + /// Whether the status bar is disabled. This disables notifications, quick settings, and other screen overlays that allow escape from full-screen mode. DEPRECATED. To disable the status bar on a kiosk device, use InstallType KIOSK or kioskCustomLauncherEnabled. + #[serde(rename="statusBarDisabled")] + pub status_bar_disabled: Option, + /// Rules for automatically choosing a private key and certificate to authenticate the device to a server. The rules are ordered by increasing precedence, so if an outgoing request matches more than one rule, the last rule defines which private key to use. + #[serde(rename="choosePrivateKeyRules")] + pub choose_private_key_rules: Option>, + /// This mode controls which apps are available to the user in the Play Store and the behavior on the device when apps are removed from the policy. + #[serde(rename="playStoreMode")] + pub play_store_mode: Option, + /// Whether transferring files over USB is disabled. + #[serde(rename="usbFileTransferDisabled")] + pub usb_file_transfer_disabled: Option, + /// Whether using NFC to beam data from apps is disabled. + #[serde(rename="outgoingBeamDisabled")] + pub outgoing_beam_disabled: Option, + /// Whether the user is allowed to have fun. Controls whether the Easter egg game in Settings is disabled. + #[serde(rename="funDisabled")] + pub fun_disabled: Option, + /// The device owner information to be shown on the lock screen. + #[serde(rename="deviceOwnerLockScreenInfo")] + pub device_owner_lock_screen_info: Option, + /// Configuration for an always-on VPN connection. Use with vpn_config_disabled to prevent modification of this setting. + #[serde(rename="alwaysOnVpnPackage")] + pub always_on_vpn_package: Option, + /// Disabled keyguard customizations, such as widgets. + #[serde(rename="keyguardDisabledFeatures")] + pub keyguard_disabled_features: Option>, + /// Whether configuring cell broadcast is disabled. + #[serde(rename="cellBroadcastsConfigDisabled")] + pub cell_broadcasts_config_disabled: Option, + /// Whether the keyguard is disabled. + #[serde(rename="keyguardDisabled")] + pub keyguard_disabled: Option, + /// Whether factory resetting from settings is disabled. + #[serde(rename="factoryResetDisabled")] + pub factory_reset_disabled: Option, + /// Password requirement policies. Different policies can be set for work profile or fully managed devices by setting the password_scope field in the policy. + #[serde(rename="passwordPolicies")] + pub password_policies: Option>, + /// Whether the network escape hatch is enabled. If a network connection can't be made at boot time, the escape hatch prompts the user to temporarily connect to a network in order to refresh the device policy. After applying policy, the temporary network will be forgotten and the device will continue booting. This prevents being unable to connect to a network if there is no suitable network in the last policy and the device boots into an app in lock task mode, or the user is otherwise unable to reach device settings. + #[serde(rename="networkEscapeHatchEnabled")] + pub network_escape_hatch_enabled: Option, + /// Whether auto time is required, which prevents the user from manually setting the date and time. + #[serde(rename="autoTimeRequired")] + pub auto_time_required: Option, + /// The app auto update policy, which controls when automatic app updates can be applied. + #[serde(rename="appAutoUpdatePolicy")] + pub app_auto_update_policy: Option, + /// Whether changing the user icon is disabled. + #[serde(rename="setUserIconDisabled")] + pub set_user_icon_disabled: Option, + /// The battery plugged in modes for which the device stays on. When using this setting, it is recommended to clear maximum_time_to_lock so that the device doesn't lock itself while it stays on. + #[serde(rename="stayOnPluggedModes")] + pub stay_on_plugged_modes: Option>, + /// Whether user installation of apps is disabled. + #[serde(rename="installAppsDisabled")] + pub install_apps_disabled: Option, + /// Whether adjusting the master volume is disabled. + #[serde(rename="adjustVolumeDisabled")] + pub adjust_volume_disabled: Option, + /// A message displayed to the user in the settings screen wherever functionality has been disabled by the admin. If the message is longer than 200 characters it may be truncated. + #[serde(rename="shortSupportMessage")] + pub short_support_message: Option, + /// Whether app verification is force-enabled. + #[serde(rename="ensureVerifyAppsEnabled")] + pub ensure_verify_apps_enabled: Option, + /// Allows showing UI on a device for a user to choose a private key alias if there are no matching rules in ChoosePrivateKeyRules. For devices below Android P, setting this may leave enterprise keys vulnerable. + #[serde(rename="privateKeySelectionEnabled")] + pub private_key_selection_enabled: Option, + /// Settings controlling the behavior of a device in kiosk mode. To enable kiosk mode, set kioskCustomLauncherEnabled to true or specify an app in the policy with installType KIOSK. + #[serde(rename="kioskCustomization")] + pub kiosk_customization: Option, + /// Rules that define the behavior when a particular policy can not be applied on device + #[serde(rename="policyEnforcementRules")] + pub policy_enforcement_rules: Option>, + /// Actions to take during the setup process. + #[serde(rename="setupActions")] + pub setup_actions: Option>, + /// Whether configuring tethering and portable hotspots is disabled. + #[serde(rename="tetheringConfigDisabled")] + pub tethering_config_disabled: Option, + /// Whether all cameras on the device are disabled. + #[serde(rename="cameraDisabled")] + pub camera_disabled: Option, + /// DEPRECATED - Use wifi_config_disabled. + #[serde(rename="wifiConfigsLockdownEnabled")] + pub wifi_configs_lockdown_enabled: Option, + /// Whether adding new users and profiles is disabled. + #[serde(rename="addUserDisabled")] + pub add_user_disabled: Option, + /// Whether the kiosk custom launcher is enabled. This replaces the home screen with a launcher that locks down the device to the apps installed via the applications setting. Apps appear on a single page in alphabetical order. Use kioskCustomization to further configure the kiosk device behavior. + #[serde(rename="kioskCustomLauncherEnabled")] + pub kiosk_custom_launcher_enabled: Option, + /// Whether rebooting the device into safe boot is disabled. + #[serde(rename="safeBootDisabled")] + pub safe_boot_disabled: Option, + /// Whether removing other users is disabled. + #[serde(rename="removeUserDisabled")] + pub remove_user_disabled: Option, + /// Network configuration for the device. See configure networks for more information. + #[serde(rename="openNetworkConfiguration")] + pub open_network_configuration: Option>, + /// Account types that can't be managed by the user. + #[serde(rename="accountTypesWithManagementDisabled")] + pub account_types_with_management_disabled: Option>, + /// Email addresses of device administrators for factory reset protection. When the device is factory reset, it will require one of these admins to log in with the Google account email and password to unlock the device. If no admins are specified, the device won't provide factory reset protection. + #[serde(rename="frpAdminEmails")] + pub frp_admin_emails: Option>, + /// Password requirements. The field password_requirements.require_password_unlock must not be set. DEPRECATED - Use password_policies. + #[serde(rename="passwordRequirements")] + pub password_requirements: Option, + /// Maximum time in milliseconds for user activity until the device locks. A value of 0 means there is no restriction. + #[serde(rename="maximumTimeToLock")] + pub maximum_time_to_lock: Option, + /// The version of the policy. This is a read-only field. The version is incremented each time the policy is updated. + pub version: Option, + /// Whether the user mounting physical external media is disabled. + #[serde(rename="mountPhysicalMediaDisabled")] + pub mount_physical_media_disabled: Option, + /// Whether configuring VPN is disabled. + #[serde(rename="vpnConfigDisabled")] + pub vpn_config_disabled: Option, + /// Whether adding or removing accounts is disabled. + #[serde(rename="modifyAccountsDisabled")] + pub modify_accounts_disabled: Option, + /// Whether changing the wallpaper is disabled. + #[serde(rename="setWallpaperDisabled")] + pub set_wallpaper_disabled: Option, + /// Flag to skip hints on the first use. Enterprise admin can enable the system recommendation for apps to skip their user tutorial and other introductory hints on first start-up. + #[serde(rename="skipFirstUseHintsEnabled")] + pub skip_first_use_hints_enabled: Option, + /// Whether encryption is enabled + #[serde(rename="encryptionPolicy")] + pub encryption_policy: Option, + /// Whether sending and receiving SMS messages is disabled. + #[serde(rename="smsDisabled")] + pub sms_disabled: Option, + /// The network-independent global HTTP proxy. Typically proxies should be configured per-network in open_network_configuration. However for unusual configurations like general internal filtering a global HTTP proxy may be useful. If the proxy is not accessible, network access may break. The global proxy is only a recommendation and some apps may ignore it. + #[serde(rename="recommendedGlobalProxy")] + pub recommended_global_proxy: Option, + /// Whether bluetooth contact sharing is disabled. + #[serde(rename="bluetoothContactSharingDisabled")] + pub bluetooth_contact_sharing_disabled: Option, + /// Whether configuring Wi-Fi access points is disabled. + #[serde(rename="wifiConfigDisabled")] + pub wifi_config_disabled: Option, + /// Whether USB storage is enabled. Deprecated. + #[serde(rename="usbMassStorageEnabled")] + pub usb_mass_storage_enabled: Option, + /// Policy applied to apps. + pub applications: Option>, + /// Whether the microphone is muted and adjusting microphone volume is disabled. + #[serde(rename="unmuteMicrophoneDisabled")] + pub unmute_microphone_disabled: Option, + /// Whether the user is allowed to enable debugging features. + #[serde(rename="debuggingFeaturesAllowed")] + pub debugging_features_allowed: Option, + /// Whether user uninstallation of applications is disabled. + #[serde(rename="uninstallAppsDisabled")] + pub uninstall_apps_disabled: Option, + /// The minimum allowed Android API level. + #[serde(rename="minimumApiLevel")] + pub minimum_api_level: Option, + /// Whether outgoing calls are disabled. + #[serde(rename="outgoingCallsDisabled")] + pub outgoing_calls_disabled: Option, + /// The system update policy, which controls how OS updates are applied. If the update type is WINDOWED, the update window will automatically apply to Play app updates as well. + #[serde(rename="systemUpdate")] + pub system_update: Option, + /// Whether screen capture is disabled. + #[serde(rename="screenCaptureDisabled")] + pub screen_capture_disabled: Option, + /// Whether configuring user credentials is disabled. + #[serde(rename="credentialsConfigDisabled")] + pub credentials_config_disabled: Option, + /// Specifies permitted accessibility services. If the field is not set, any accessibility service can be used. If the field is set, only the accessibility services in this list and the system's built-in accessibility service can be used. In particular, if the field is set to empty, only the system's built-in accessibility servicess can be used. + #[serde(rename="permittedAccessibilityServices")] + pub permitted_accessibility_services: Option, + /// Explicit permission or group grants or denials for all apps. These values override the default_permission_policy. + #[serde(rename="permissionGrants")] + pub permission_grants: Option>, + /// Whether creating windows besides app windows is disabled. + #[serde(rename="createWindowsDisabled")] + pub create_windows_disabled: Option, +} + +impl RequestValue for Policy {} +impl ResponseResult for Policy {} + + +/// An action to block access to apps and data on a fully managed device or in a work profile. This action also triggers a device or work profile to displays a user-facing notification with information (where possible) on how to correct the compliance issue. Note: wipeAction must also be specified. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BlockAction { + /// Number of days the policy is non-compliant before the device or work profile is blocked. To block access immediately, set to 0. blockAfterDays must be less than wipeAfterDays. + #[serde(rename="blockAfterDays")] + pub block_after_days: Option, +} + +impl Part for BlockAction {} + + +/// Additional details regarding the security posture of the device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PostureDetail { + /// Corresponding admin-facing advice to mitigate this security risk and improve the security posture of the device. + pub advice: Option>, + /// A specific security risk that negatively affects the security posture of the device. + #[serde(rename="securityRisk")] + pub security_risk: Option, +} + +impl Part for PostureDetail {} + + +/// A permission required by the app. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApplicationPermission { + /// An opaque string uniquely identifying the permission. Not localized. + #[serde(rename="permissionId")] + pub permission_id: Option, + /// A longer description of the permission, providing more detail on what it affects. Localized. + pub description: Option, + /// The name of the permission. Localized. + pub name: Option, +} + +impl Part for ApplicationPermission {} + + +/// Keyed app state reported by the app. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeyedAppState { + /// The key for the app state. Acts as a point of reference for what the app is providing state for. For example, when providing managed configuration feedback, this key could be the managed configuration key. + pub key: Option, + /// The severity of the app state. + pub severity: Option, + /// The time the app state was most recently updated. + #[serde(rename="lastUpdateTime")] + pub last_update_time: Option, + /// Optionally, a free-form message string to explain the app state. If the state was triggered by a particular value (e.g. a managed configuration value), it should be included in the message. + pub message: Option, + /// Optionally, a machine-readable value to be read by the EMM. For example, setting values that the admin can choose to query against in the EMM console (e.g. “notify me if the battery_warning data < 10”). + pub data: Option, + /// The creation time of the app state on the device. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl Part for KeyedAppState {} + + +/// Response to a request to list web apps for a given enterprise. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [web apps list enterprises](struct.EnterpriseWebAppListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListWebAppsResponse { + /// If there are more results, a token to retrieve next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of web apps. + #[serde(rename="webApps")] + pub web_apps: Option>, +} + +impl ResponseResult for ListWebAppsResponse {} /// Requirements for the password used to unlock a device. @@ -1460,6 +1890,9 @@ pub struct PasswordRequirements { /// Number of incorrect device-unlock passwords that can be entered before a device is wiped. A value of 0 means there is no restriction. #[serde(rename="maximumFailedPasswordsForWipe")] pub maximum_failed_passwords_for_wipe: Option, + /// The length of time after a device or work profile is unlocked using a strong form of authentication (password, PIN, pattern) that it can be unlocked using any other authentication method (e.g. fingerprint, trust agents, face). After the specified time period elapses, only strong forms of authentication can be used to unlock the device or work profile. + #[serde(rename="requirePasswordUnlock")] + pub require_password_unlock: Option, /// Minimum number of symbols required in the password. Only enforced when password_quality is COMPLEX. #[serde(rename="passwordMinimumSymbols")] pub password_minimum_symbols: Option, @@ -1492,29 +1925,6 @@ pub struct PasswordRequirements { impl Part for PasswordRequirements {} -/// A rule declaring which mitigating actions to take when a device is not compliant with its policy. For every rule, there is always an implicit mitigating action to set policy_compliant to false for the Device resource, and display a message on the device indicating that the device is not compliant with its policy. Other mitigating actions may optionally be taken as well, depending on the field values in the rule. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ComplianceRule { - /// A condition which is satisfied if the Android Framework API level on the device doesn't meet a minimum requirement. - #[serde(rename="apiLevelCondition")] - pub api_level_condition: Option, - /// If set, the rule includes a mitigating action to disable apps specified in the list, but app data is preserved. - #[serde(rename="packageNamesToDisable")] - pub package_names_to_disable: Option>, - /// A condition which is satisfied if there exists any matching NonComplianceDetail for the device. - #[serde(rename="nonComplianceDetailCondition")] - pub non_compliance_detail_condition: Option, - /// If set to true, the rule includes a mitigating action to disable apps so that the device is effectively disabled, but app data is preserved. If the device is running an app in locked task mode, the app will be closed and a UI showing the reason for non-compliance will be displayed. - #[serde(rename="disableApps")] - pub disable_apps: Option, -} - -impl Part for ComplianceRule {} - - /// Response to a request to list devices for a given enterprise. /// /// # Activities @@ -1589,109 +1999,6 @@ pub struct UserFacingMessage { impl Part for UserFacingMessage {} -/// An action executed during setup. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetupAction { - /// An action to launch an app. - #[serde(rename="launchApp")] - pub launch_app: Option, - /// Description of this action. - pub description: Option, - /// Title of this action. - pub title: Option, -} - -impl Part for SetupAction {} - - -/// The configuration applied to an enterprise. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [policies list enterprises](struct.EnterprisePolicyListCall.html) (none) -/// * [web apps delete enterprises](struct.EnterpriseWebAppDeleteCall.html) (none) -/// * [policies patch enterprises](struct.EnterprisePolicyPatchCall.html) (none) -/// * [create enterprises](struct.EnterpriseCreateCall.html) (request|response) -/// * [web apps create enterprises](struct.EnterpriseWebAppCreateCall.html) (none) -/// * [enrollment tokens create enterprises](struct.EnterpriseEnrollmentTokenCreateCall.html) (none) -/// * [web apps list enterprises](struct.EnterpriseWebAppListCall.html) (none) -/// * [devices list enterprises](struct.EnterpriseDeviceListCall.html) (none) -/// * [policies delete enterprises](struct.EnterprisePolicyDeleteCall.html) (none) -/// * [devices operations cancel enterprises](struct.EnterpriseDeviceOperationCancelCall.html) (none) -/// * [devices operations delete enterprises](struct.EnterpriseDeviceOperationDeleteCall.html) (none) -/// * [devices operations get enterprises](struct.EnterpriseDeviceOperationGetCall.html) (none) -/// * [devices operations list enterprises](struct.EnterpriseDeviceOperationListCall.html) (none) -/// * [devices patch enterprises](struct.EnterpriseDevicePatchCall.html) (none) -/// * [patch enterprises](struct.EnterprisePatchCall.html) (request|response) -/// * [policies get enterprises](struct.EnterprisePolicyGetCall.html) (none) -/// * [web tokens create enterprises](struct.EnterpriseWebTokenCreateCall.html) (none) -/// * [web apps patch enterprises](struct.EnterpriseWebAppPatchCall.html) (none) -/// * [enrollment tokens delete enterprises](struct.EnterpriseEnrollmentTokenDeleteCall.html) (none) -/// * [devices issue command enterprises](struct.EnterpriseDeviceIssueCommandCall.html) (none) -/// * [devices delete enterprises](struct.EnterpriseDeviceDeleteCall.html) (none) -/// * [web apps get enterprises](struct.EnterpriseWebAppGetCall.html) (none) -/// * [devices get enterprises](struct.EnterpriseDeviceGetCall.html) (none) -/// * [get enterprises](struct.EnterpriseGetCall.html) (response) -/// * [applications get enterprises](struct.EnterpriseApplicationGetCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Enterprise { - /// Terms and conditions that must be accepted when provisioning a device for this enterprise. A page of terms is generated for each value in this list. - #[serde(rename="termsAndConditions")] - pub terms_and_conditions: Option>, - /// The name of the enterprise which is generated by the server during creation, in the form enterprises/{enterpriseId}. - pub name: Option, - /// The types of Google Pub/Sub notifications enabled for the enterprise. - #[serde(rename="enabledNotificationTypes")] - pub enabled_notification_types: Option>, - /// An image displayed as a logo during device provisioning. Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp, image/vnd.wap.wbmp, image/x-adobe-dng. - pub logo: Option, - /// Sign-in details of the enterprise. Maximum of 1 SigninDetail is supported. - #[serde(rename="signinDetails")] - pub signin_details: Option>, - /// The name of the enterprise displayed to users. - #[serde(rename="enterpriseDisplayName")] - pub enterprise_display_name: Option, - /// A color in RGB format that indicates the predominant color to display in the device management app UI. The color components are stored as follows: (red << 16) | (green << 8) | blue, where the value of each component is between 0 and 255, inclusive. - #[serde(rename="primaryColor")] - pub primary_color: Option, - /// The topic that Cloud Pub/Sub notifications are published to, in the form projects/{project}/topics/{topic}. This field is only required if Pub/Sub notifications are enabled. - #[serde(rename="pubsubTopic")] - pub pubsub_topic: Option, - /// Deprecated and unused. - #[serde(rename="appAutoApprovalEnabled")] - pub app_auto_approval_enabled: Option, -} - -impl RequestValue for Enterprise {} -impl Resource for Enterprise {} -impl ResponseResult for Enterprise {} - - -/// A default activity for handling intents that match a particular intent filter. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PersistentPreferredActivity { - /// The activity that should be the default intent handler. This should be an Android component name, e.g. com.android.enterprise.app/.MainActivity. Alternatively, the value may be the package name of an app, which causes Android Device Policy to choose an appropriate activity from the app to handle the intent. - #[serde(rename="receiverActivity")] - pub receiver_activity: Option, - /// The intent actions to match in the filter. If any actions are included in the filter, then an intent's action must be one of those values for it to match. If no actions are included, the intent action is ignored. - pub actions: Option>, - /// The intent categories to match in the filter. An intent includes the categories that it requires, all of which must be included in the filter in order to match. In other words, adding a category to the filter has no impact on matching unless that category is specified in the intent. - pub categories: Option>, -} - -impl Part for PersistentPreferredActivity {} - - /// An action to launch an app. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1706,31 +2013,19 @@ pub struct LaunchAppAction { impl Part for LaunchAppAction {} -/// Device display information. +/// A terms and conditions page to be accepted during provisioning. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Display { - /// Refresh rate of the display in frames per second. - #[serde(rename="refreshRate")] - pub refresh_rate: Option, - /// Display width in pixels. - pub width: Option, - /// State of the display. - pub state: Option, - /// Name of the display. - pub name: Option, - /// Display density expressed as dots-per-inch. - pub density: Option, - /// Unique display id. - #[serde(rename="displayId")] - pub display_id: Option, - /// Display height in pixels. - pub height: Option, +pub struct TermsAndConditions { + /// A well-formatted HTML string. It will be parsed on the client with android.text.Html#fromHtml. + pub content: Option, + /// A short header which appears above the HTML content. + pub header: Option, } -impl Part for Display {} +impl Part for TermsAndConditions {} /// The response message for Operations.ListOperations. @@ -1754,58 +2049,6 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// A terms and conditions page to be accepted during provisioning. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TermsAndConditions { - /// A well-formatted HTML string. It will be parsed on the client with android.text.Html#fromHtml. - pub content: Option, - /// A short header which appears above the HTML content. - pub header: Option, -} - -impl Part for TermsAndConditions {} - - -/// An event related to memory and storage measurements. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MemoryEvent { - /// Event type. - #[serde(rename="eventType")] - pub event_type: Option, - /// The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium. - #[serde(rename="byteCount")] - pub byte_count: Option, - /// The creation time of the event. - #[serde(rename="createTime")] - pub create_time: Option, -} - -impl Part for MemoryEvent {} - - -/// The managed configurations template for the app, saved from the managed configurations iframe. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedConfigurationTemplate { - /// Optional, a map containing configuration variables defined for the configuration. - #[serde(rename="configurationVariables")] - pub configuration_variables: Option>, - /// The ID of the managed configurations template. - #[serde(rename="templateId")] - pub template_id: Option, -} - -impl Part for ManagedConfigurationTemplate {} - - /// A power management event. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1826,30 +2069,42 @@ pub struct PowerManagementEvent { impl Part for PowerManagementEvent {} -/// A web token used to access the managed Google Play iframe. +/// An action to reset a fully managed device or delete a work profile. Note: blockAction must also be specified. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [web tokens create enterprises](struct.EnterpriseWebTokenCreateCall.html) (request|response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct WebToken { - /// The URL of the parent frame hosting the iframe with the embedded UI. To prevent XSS, the iframe may not be hosted at other URLs. The URL must use the https scheme. - #[serde(rename="parentFrameUrl")] - pub parent_frame_url: Option, - /// The name of the web token, which is generated by the server during creation in the form enterprises/{enterpriseId}/webTokens/{webTokenId}. - pub name: Option, - /// The token value which is used in the hosting page to generate the iframe with the embedded UI. This is a read-only field generated by the server. - pub value: Option, - /// Permissions available to an admin in the embedded UI. An admin must have all of these permissions in order to view the UI. - pub permissions: Option>, +pub struct WipeAction { + /// Number of days the policy is non-compliant before the device or work profile is wiped. wipeAfterDays must be greater than blockAfterDays. + #[serde(rename="wipeAfterDays")] + pub wipe_after_days: Option, + /// Whether the factory-reset protection data is preserved on the device. This setting doesn’t apply to work profiles. + #[serde(rename="preserveFrp")] + pub preserve_frp: Option, } -impl RequestValue for WebToken {} -impl ResponseResult for WebToken {} +impl Part for WipeAction {} + + +/// Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent: +/// A full date, with non-zero year, month and day values +/// A month and day value, with a zero year, e.g. an anniversary +/// A year on its own, with zero month and day values +/// A year and month value, with a zero day, e.g. a credit card expiration dateRelated types are google.type.TimeOfDay and google.protobuf.Timestamp. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Date { + /// Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day. + pub month: Option, + /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant. + pub day: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year. + pub year: Option, +} + +impl Part for Date {} /// Policy for an individual app. @@ -1861,7 +2116,7 @@ pub struct ApplicationPolicy { /// The managed configurations template for the app, saved from the managed configurations iframe. This field is ignored if managed_configuration is set. #[serde(rename="managedConfigurationTemplate")] pub managed_configuration_template: Option, - /// Whether the app is allowed to lock itself in full-screen mode. + /// Whether the app is allowed to lock itself in full-screen mode. DEPRECATED. Use InstallType KIOSK or kioskCustomLauncherEnabled to to configure a dedicated device. #[serde(rename="lockTaskAllowed")] pub lock_task_allowed: Option, /// The package name of the app. For example, com.google.android.youtube for the YouTube app. @@ -1878,6 +2133,9 @@ pub struct ApplicationPolicy { /// The minimum version of the app that runs on the device. If set, the device attempts to update the app to at least this version code. If the app is not up-to-date, the device will contain a NonComplianceDetail with non_compliance_reason set to APP_NOT_UPDATED. The app must already be published to Google Play with a version code greater than or equal to this value. At most 20 apps may specify a minimum version code per policy. #[serde(rename="minimumVersionCode")] pub minimum_version_code: Option, + /// List of the app’s track IDs that a device belonging to the enterprise can access. If the list contains multiple track IDs, devices receive the latest version among all accessible tracks. If the list contains no track IDs, devices only have access to the app’s production track. More details about each track are available in AppTrackInfo. + #[serde(rename="accessibleTrackIds")] + pub accessible_track_ids: Option>, /// The scopes delegated to the app from Android Device Policy. #[serde(rename="delegatedScopes")] pub delegated_scopes: Option>, @@ -1937,79 +2195,6 @@ pub struct ManagedProperty { impl Part for ManagedProperty {} -/// A permission required by the app. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApplicationPermission { - /// An opaque string uniquely identifying the permission. Not localized. - #[serde(rename="permissionId")] - pub permission_id: Option, - /// A longer description of the permission, providing more detail on what it affects. Localized. - pub description: Option, - /// The name of the permission. Localized. - pub name: Option, -} - -impl Part for ApplicationPermission {} - - -/// An action to reset a fully managed device or delete a work profile. Note: blockAction must also be specified. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct WipeAction { - /// Number of days the policy is non-compliant before the device or work profile is wiped. wipeAfterDays must be greater than blockAfterDays. - #[serde(rename="wipeAfterDays")] - pub wipe_after_days: Option, - /// Whether the factory-reset protection data is preserved on the device. This setting doesn’t apply to work profiles. - #[serde(rename="preserveFrp")] - pub preserve_frp: Option, -} - -impl Part for WipeAction {} - - -/// Settings controlling the behavior of status reports. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StatusReportingSettings { - /// Whether network info reporting is enabled. - #[serde(rename="networkInfoEnabled")] - pub network_info_enabled: Option, - /// Whether memory reporting is enabled. - #[serde(rename="memoryInfoEnabled")] - pub memory_info_enabled: Option, - /// Whether hardware status reporting is enabled. - #[serde(rename="hardwareStatusEnabled")] - pub hardware_status_enabled: Option, - /// Whether device settings reporting is enabled. - #[serde(rename="deviceSettingsEnabled")] - pub device_settings_enabled: Option, - /// Whether app reports are enabled. - #[serde(rename="applicationReportsEnabled")] - pub application_reports_enabled: Option, - /// Whether power management event reporting is enabled. - #[serde(rename="powerManagementEventsEnabled")] - pub power_management_events_enabled: Option, - /// Application reporting settings. Only applicable if application_reports_enabled is true. - #[serde(rename="applicationReportingSettings")] - pub application_reporting_settings: Option, - /// Whether software info reporting is enabled. - #[serde(rename="softwareInfoEnabled")] - pub software_info_enabled: Option, - /// Whether displays reporting is enabled. - #[serde(rename="displayInfoEnabled")] - pub display_info_enabled: Option, -} - -impl Part for StatusReportingSettings {} - - /// Data hosted at an external location. The data is to be downloaded by Android Device Policy and verified against the hash. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2026,47 +2211,6 @@ pub struct ExternalData { impl Part for ExternalData {} -/// Information about device software. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SoftwareInfo { - /// An IETF BCP 47 language code for the primary locale on the device. - #[serde(rename="primaryLanguageCode")] - pub primary_language_code: Option, - /// Build time. - #[serde(rename="androidBuildTime")] - pub android_build_time: Option, - /// Android build ID string meant for displaying to the user. For example, shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. - #[serde(rename="androidBuildNumber")] - pub android_build_number: Option, - /// SHA-256 hash of android.content.pm.Signature (https://developer.android.com/reference/android/content/pm/Signature.html) associated with the system package, which can be used to verify that the system build hasn't been modified. - #[serde(rename="deviceBuildSignature")] - pub device_build_signature: Option, - /// The Android Device Policy app version code. - #[serde(rename="androidDevicePolicyVersionCode")] - pub android_device_policy_version_code: Option, - /// Security patch level, e.g. 2016-05-01. - #[serde(rename="securityPatchLevel")] - pub security_patch_level: Option, - /// The Android Device Policy app version as displayed to the user. - #[serde(rename="androidDevicePolicyVersionName")] - pub android_device_policy_version_name: Option, - /// Kernel version, for example, 2.6.32.9-g103d848. - #[serde(rename="deviceKernelVersion")] - pub device_kernel_version: Option, - /// The user-visible Android version string. For example, 6.0.1. - #[serde(rename="androidVersion")] - pub android_version: Option, - /// The system bootloader version number, e.g. 0.6.7. - #[serde(rename="bootloaderVersion")] - pub bootloader_version: Option, -} - -impl Part for SoftwareInfo {} - - /// Configuration info for an HTTP proxy. For a direct proxy, set the host, port, and excluded_hosts fields. For a PAC script proxy, set the pac_uri field. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2088,6 +2232,20 @@ pub struct ProxyInfo { impl Part for ProxyInfo {} +/// Security policies set to the most secure values by default. To maintain the security posture of a device, we don't recommend overriding any of the default values. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdvancedSecurityOverrides { + /// The policy for untrusted apps (apps from unknown sources) enforced on the device. Replaces install_unknown_sources_allowed (deprecated). + #[serde(rename="untrustedAppsPolicy")] + pub untrusted_apps_policy: Option, +} + +impl Part for AdvancedSecurityOverrides {} + + /// A rule for automatically choosing a private key and certificate to authenticate the device to a server. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2591,6 +2749,7 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { EnterpriseDeviceDeleteCall { hub: self.hub, _name: name.to_string(), + _wipe_reason_message: Default::default(), _wipe_data_flags: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -8333,7 +8492,8 @@ impl<'a, C, A> EnterpriseDeviceIssueCommandCall<'a, C, A> where C: BorrowMut hub: &'a AndroidManagement, _name: String, + _wipe_reason_message: Option, _wipe_data_flags: Vec, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -8365,14 +8526,17 @@ impl<'a, C, A> EnterpriseDeviceDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(4 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); + if let Some(value) = self._wipe_reason_message { + params.push(("wipeReasonMessage", value.to_string())); + } if self._wipe_data_flags.len() > 0 { for f in self._wipe_data_flags.iter() { params.push(("wipeDataFlags", f.to_string())); } } - for &field in ["alt", "name", "wipeDataFlags"].iter() { + for &field in ["alt", "name", "wipeReasonMessage", "wipeDataFlags"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8497,6 +8661,13 @@ impl<'a, C, A> EnterpriseDeviceDeleteCall<'a, C, A> where C: BorrowMut EnterpriseDeviceDeleteCall<'a, C, A> { + self._wipe_reason_message = Some(new_value.to_string()); + self + } /// Optional flags that control the device wiping behavior. /// /// Append the given value to the *wipe data flags* query property. @@ -9340,7 +9511,7 @@ impl<'a, C, A> EnterpriseGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.enterprises().applications_get("name") -/// .language_code("eirmod") +/// .language_code("sanctus") /// .doit(); /// # } /// ``` diff --git a/gen/androidpublisher2-cli/Cargo.toml b/gen/androidpublisher2-cli/Cargo.toml index 481843d6cc..eba4cdb8ae 100644 --- a/gen/androidpublisher2-cli/Cargo.toml +++ b/gen/androidpublisher2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher2-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-androidpublisher2] path = "../androidpublisher2" -version = "1.0.12+20190702" +version = "1.0.13+20200331" diff --git a/gen/androidpublisher2-cli/README.md b/gen/androidpublisher2-cli/README.md index 0105c2e148..c567373e74 100644 --- a/gen/androidpublisher2-cli/README.md +++ b/gen/androidpublisher2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Android Publisher* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Android Publisher* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash androidpublisher2 [options] diff --git a/gen/androidpublisher2-cli/mkdocs.yml b/gen/androidpublisher2-cli/mkdocs.yml index 0de14d13aa..fc0aa91721 100644 --- a/gen/androidpublisher2-cli/mkdocs.yml +++ b/gen/androidpublisher2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Publisher v1.0.12+20190702 +site_name: Android Publisher v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-androidpublisher2-cli site_description: A complete library to interact with Android Publisher (protocol v2) diff --git a/gen/androidpublisher2-cli/src/main.rs b/gen/androidpublisher2-cli/src/main.rs index 4fe0945bbb..d8f714dd9a 100644 --- a/gen/androidpublisher2-cli/src/main.rs +++ b/gen/androidpublisher2-cli/src/main.rs @@ -2187,9 +2187,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "google-groups" => Some(("googleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "google-plus-communities" => Some(("googlePlusCommunities", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["google-groups", "google-plus-communities"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["google-groups"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2273,9 +2272,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "google-groups" => Some(("googleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "google-plus-communities" => Some(("googlePlusCommunities", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["google-groups", "google-plus-communities"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["google-groups"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2788,10 +2786,6 @@ impl<'n> Engine<'n> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription-period" => Some(("subscriptionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "grace-period" => Some(("gracePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "season.start.day" => Some(("season.start.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.start.month" => Some(("season.start.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.day" => Some(("season.end.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.month" => Some(("season.end.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "package-name" => Some(("packageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-period" => Some(("trialPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "purchase-type" => Some(("purchaseType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2799,7 +2793,7 @@ impl<'n> Engine<'n> { "default-price.currency" => Some(("defaultPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-price.price-micros" => Some(("defaultPrice.priceMicros", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "day", "default-language", "default-price", "end", "grace-period", "month", "package-name", "price-micros", "purchase-type", "season", "sku", "start", "status", "subscription-period", "trial-period"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "default-language", "default-price", "grace-period", "package-name", "price-micros", "purchase-type", "sku", "status", "subscription-period", "trial-period"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2952,10 +2946,6 @@ impl<'n> Engine<'n> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription-period" => Some(("subscriptionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "grace-period" => Some(("gracePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "season.start.day" => Some(("season.start.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.start.month" => Some(("season.start.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.day" => Some(("season.end.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.month" => Some(("season.end.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "package-name" => Some(("packageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-period" => Some(("trialPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "purchase-type" => Some(("purchaseType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2963,7 +2953,7 @@ impl<'n> Engine<'n> { "default-price.currency" => Some(("defaultPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-price.price-micros" => Some(("defaultPrice.priceMicros", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "day", "default-language", "default-price", "end", "grace-period", "month", "package-name", "price-micros", "purchase-type", "season", "sku", "start", "status", "subscription-period", "trial-period"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "default-language", "default-price", "grace-period", "package-name", "price-micros", "purchase-type", "sku", "status", "subscription-period", "trial-period"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3054,10 +3044,6 @@ impl<'n> Engine<'n> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription-period" => Some(("subscriptionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "grace-period" => Some(("gracePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "season.start.day" => Some(("season.start.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.start.month" => Some(("season.start.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.day" => Some(("season.end.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.month" => Some(("season.end.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "package-name" => Some(("packageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-period" => Some(("trialPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "purchase-type" => Some(("purchaseType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3065,7 +3051,7 @@ impl<'n> Engine<'n> { "default-price.currency" => Some(("defaultPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-price.price-micros" => Some(("defaultPrice.priceMicros", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "day", "default-language", "default-price", "end", "grace-period", "month", "package-name", "price-micros", "purchase-type", "season", "sku", "start", "status", "subscription-period", "trial-period"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "default-language", "default-price", "grace-period", "package-name", "price-micros", "purchase-type", "sku", "status", "subscription-period", "trial-period"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6036,7 +6022,7 @@ fn main() { let mut app = App::new("androidpublisher2") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200331") .about("Accesses Android application developers' Google Play accounts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidpublisher2_cli") .arg(Arg::with_name("url") diff --git a/gen/androidpublisher2/Cargo.toml b/gen/androidpublisher2/Cargo.toml index 13643e74b9..5af1c648d5 100644 --- a/gen/androidpublisher2/Cargo.toml +++ b/gen/androidpublisher2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidpublisher2" -version = "1.0.12+20190702" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher2" homepage = "https://developers.google.com/android-publisher" -documentation = "https://docs.rs/google-androidpublisher2/1.0.12+20190702" +documentation = "https://docs.rs/google-androidpublisher2/1.0.13+20200331" license = "MIT" keywords = ["androidpublisher", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/androidpublisher2/README.md b/gen/androidpublisher2/README.md index 3c2ccaa573..748ee2bce9 100644 --- a/gen/androidpublisher2/README.md +++ b/gen/androidpublisher2/README.md @@ -5,33 +5,33 @@ DO NOT EDIT ! --> The `google-androidpublisher2` library allows access to all features of the *Google Android Publisher* service. -This documentation was generated from *Android Publisher* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Android Publisher* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Android Publisher* *v2* API can be found at the [official documentation site](https://developers.google.com/android-publisher). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.AndroidPublisher.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.AndroidPublisher.html) ... * edits - * [*apklistings delete*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApkUploadCall.html), [*bundles list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditBundleListCall.html), [*bundles upload*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditBundleUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditValidateCall.html) + * [*apklistings delete*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApkUploadCall.html), [*bundles list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditBundleListCall.html), [*bundles upload*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditBundleUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditValidateCall.html) * inappproducts - * [*delete*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.InappproductUpdateCall.html) + * [*delete*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.InappproductUpdateCall.html) * orders - * [*refund*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.OrderRefundCall.html) + * [*refund*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.OrderRefundCall.html) * purchases - * [*products get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.PurchaseProductGetCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.PurchaseVoidedpurchaseListCall.html) -* [reviews](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.Review.html) - * [*get*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.ReviewReplyCall.html) + * [*products get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.PurchaseProductGetCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.PurchaseVoidedpurchaseListCall.html) +* [reviews](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.Review.html) + * [*get*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.ReviewReplyCall.html) Upload supported by ... -* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html) -* [*images upload edits*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditImageUploadCall.html) -* [*apks upload edits*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditApkUploadCall.html) -* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditExpansionfileUploadCall.html) -* [*bundles upload edits*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.EditBundleUploadCall.html) +* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html) +* [*images upload edits*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditImageUploadCall.html) +* [*apks upload edits*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditApkUploadCall.html) +* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditExpansionfileUploadCall.html) +* [*bundles upload edits*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.EditBundleUploadCall.html) @@ -39,17 +39,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/struct.AndroidPublisher.html)** +* **[Hub](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/struct.AndroidPublisher.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -150,17 +150,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -170,29 +170,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-androidpublisher2/1.0.12+20190702/google_androidpublisher2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidpublisher2/1.0.13+20200331/google_androidpublisher2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/androidpublisher2/src/lib.rs b/gen/androidpublisher2/src/lib.rs index 249a8102cd..15095997e4 100644 --- a/gen/androidpublisher2/src/lib.rs +++ b/gen/androidpublisher2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Publisher* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Android Publisher* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Android Publisher* *v2* API can be found at the //! [official documentation site](https://developers.google.com/android-publisher). @@ -350,7 +350,7 @@ impl<'a, C, A> AndroidPublisher AndroidPublisher { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/androidpublisher/v2/applications/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -373,7 +373,7 @@ impl<'a, C, A> AndroidPublisher } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -440,26 +440,6 @@ pub struct SubscriptionPurchasesDeferRequest { impl RequestValue for SubscriptionPurchasesDeferRequest {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [apks list edits](struct.EditApkListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApksListResponse { - /// no description provided - pub apks: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apksListResponse". - pub kind: Option, -} - -impl ResponseResult for ApksListResponse {} - - /// There is no detailed description. /// /// # Activities @@ -532,11 +512,9 @@ pub struct InAppProduct { /// Subscription period, specified in ISO 8601 format. Acceptable values are "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), and "P1Y" (one year). #[serde(rename="subscriptionPeriod")] pub subscription_period: Option, - /// Grace period of the subscription, specified in ISO 8601 format. It will allow developers to give their subscribers a grace period when the payment for the new recurrence period is declined. Acceptable values = "P3D" (three days) and "P7D" (seven days) + /// Grace period of the subscription, specified in ISO 8601 format. It will allow developers to give their subscribers a grace period when the payment for the new recurrence period is declined. Acceptable values = "P3D" (three days), "P7D" (seven days), "P14D" (fourteen days), and "P30D" (thirty days) #[serde(rename="gracePeriod")] pub grace_period: Option, - /// Definition of a season for a seasonal subscription. Can be defined only for yearly subscriptions. - pub season: Option, /// The package name of the parent app. #[serde(rename="packageName")] pub package_name: Option, @@ -709,21 +687,6 @@ pub struct DeviceMetadata { impl Part for DeviceMetadata {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MonthDay { - /// Day of a month, value in [1, 31] range. Valid range depends on the specified month. - pub day: Option, - /// Month of a year. e.g. 1 = JAN, 2 = FEB etc. - pub month: Option, -} - -impl Part for MonthDay {} - - /// A ProductPurchase resource indicates the status of a user's inapp product purchase. /// /// # Activities @@ -829,16 +792,14 @@ impl ResponseResult for ReviewsReplyResponse {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Season { - /// Optionally present list of prorations for the season. Each proration is a one-off discounted entry into a subscription. Each proration contains the first date on which the discount is available and the new pricing information. - pub prorations: Option>, - /// Inclusive end date of the recurrence period. - pub end: Option, - /// Inclusive start date of the recurrence period. - pub start: Option, +pub struct Timestamp { + /// no description provided + pub nanos: Option, + /// no description provided + pub seconds: Option, } -impl Part for Season {} +impl Part for Timestamp {} /// There is no detailed description. @@ -1245,9 +1206,6 @@ pub struct Testers { /// A list of all Google Groups, as email addresses, that define testers for this track. #[serde(rename="googleGroups")] pub google_groups: Option>, - /// A list of all Google+ Communities, as URLs, that define testers for this track. - #[serde(rename="googlePlusCommunities")] - pub google_plus_communities: Option>, } impl RequestValue for Testers {} @@ -1265,7 +1223,7 @@ pub struct VoidedPurchase { /// The time at which the purchase was canceled/refunded/charged-back, in milliseconds since the epoch (Jan 1, 1970). #[serde(rename="voidedTimeMillis")] pub voided_time_millis: Option, - /// The token that was generated when a purchase was made. This uniquely identifies a purchase. + /// The token which uniquely identifies a one-time purchase or subscription. To uniquely identify subscription renewals use order_id (available starting from version 3 of the API). #[serde(rename="purchaseToken")] pub purchase_token: Option, /// The time at which the purchase was made, in milliseconds since the epoch (Jan 1, 1970). @@ -1400,7 +1358,8 @@ pub struct SubscriptionPurchase { #[serde(rename="priceChange")] pub price_change: Option, /// The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: - /// - Test (i.e. purchased from a license testing account) + /// - Test (i.e. purchased from a license testing account) + /// - Promo (i.e. purchased using a promo code) #[serde(rename="purchaseType")] pub purchase_type: Option, /// ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". @@ -1447,39 +1406,6 @@ pub struct DeobfuscationFilesUploadResponse { impl ResponseResult for DeobfuscationFilesUploadResponse {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Image { - /// A URL that will serve a preview of the image. - pub url: Option, - /// A sha1 hash of the image that was uploaded. - pub sha1: Option, - /// A unique id representing this image. - pub id: Option, -} - -impl Part for Image {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Prorate { - /// Defines the first day on which the price takes effect. - pub start: Option, - /// Default price cannot be zero and must be less than the full subscription price. Default price is always in the developer's Checkout merchant currency. Targeted countries have their prices set automatically based on the default_price. - #[serde(rename="defaultPrice")] - pub default_price: Option, -} - -impl Part for Prorate {} - - /// Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. /// /// # Activities @@ -1505,6 +1431,26 @@ impl RequestValue for AppEdit {} impl ResponseResult for AppEdit {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [apks list edits](struct.EditApkListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApksListResponse { + /// no description provided + pub apks: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apksListResponse". + pub kind: Option, +} + +impl ResponseResult for ApksListResponse {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1613,14 +1559,18 @@ impl ResponseResult for Track {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Timestamp { - /// no description provided - pub nanos: Option, - /// no description provided - pub seconds: Option, +pub struct Image { + /// A URL that will serve a preview of the image. + pub url: Option, + /// A sha256 hash of the image that was uploaded. + pub sha256: Option, + /// A unique id representing this image. + pub id: Option, + /// A sha1 hash of the image that was uploaded. + pub sha1: Option, } -impl Part for Timestamp {} +impl Part for Image {} /// There is no detailed description. @@ -4955,7 +4905,7 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { @@ -4974,7 +4924,7 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { diff --git a/gen/androidpublisher3-cli/Cargo.toml b/gen/androidpublisher3-cli/Cargo.toml index 30544d2eb2..57780c006b 100644 --- a/gen/androidpublisher3-cli/Cargo.toml +++ b/gen/androidpublisher3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-androidpublisher3-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-androidpublisher3] path = "../androidpublisher3" -version = "1.0.12+20190702" +version = "1.0.13+20200331" diff --git a/gen/androidpublisher3-cli/README.md b/gen/androidpublisher3-cli/README.md index d52f64b7a2..ce45885688 100644 --- a/gen/androidpublisher3-cli/README.md +++ b/gen/androidpublisher3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Android Publisher* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Android Publisher* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash androidpublisher3 [options] @@ -91,6 +91,11 @@ androidpublisher3 [options] get [-p ]... [-o ] list [-p ]... [-o ] reply (-r )... [-p ]... [-o ] + systemapks + variants-create (-r )... [-p ]... [-o ] + variants-download [-p ]... [-o ] + variants-get [-p ]... [-o ] + variants-list [-p ]... [-o ] androidpublisher3 --help Configuration: diff --git a/gen/androidpublisher3-cli/mkdocs.yml b/gen/androidpublisher3-cli/mkdocs.yml index 105dadc4e6..9f3b7ca44b 100644 --- a/gen/androidpublisher3-cli/mkdocs.yml +++ b/gen/androidpublisher3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Publisher v1.0.12+20190702 +site_name: Android Publisher v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-androidpublisher3-cli site_description: A complete library to interact with Android Publisher (protocol v3) @@ -65,6 +65,10 @@ pages: - ['reviews_get.md', 'Reviews', 'Get'] - ['reviews_list.md', 'Reviews', 'List'] - ['reviews_reply.md', 'Reviews', 'Reply'] +- ['systemapks_variants-create.md', 'Systemapks', 'Variants Create'] +- ['systemapks_variants-download.md', 'Systemapks', 'Variants Download'] +- ['systemapks_variants-get.md', 'Systemapks', 'Variants Get'] +- ['systemapks_variants-list.md', 'Systemapks', 'Variants List'] theme: readthedocs diff --git a/gen/androidpublisher3-cli/src/main.rs b/gen/androidpublisher3-cli/src/main.rs index fc809d1f13..5a5cd00892 100644 --- a/gen/androidpublisher3-cli/src/main.rs +++ b/gen/androidpublisher3-cli/src/main.rs @@ -1817,9 +1817,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "google-groups" => Some(("googleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "google-plus-communities" => Some(("googlePlusCommunities", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "auto-enrolled-android-groups" => Some(("autoEnrolledAndroidGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "auto-enrolled-google-groups" => Some(("autoEnrolledGoogleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "excluded-google-groups" => Some(("excludedGoogleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["google-groups", "google-plus-communities"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-enrolled-android-groups", "auto-enrolled-google-groups", "excluded-google-groups", "google-groups"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1903,9 +1905,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "google-groups" => Some(("googleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "google-plus-communities" => Some(("googlePlusCommunities", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "auto-enrolled-android-groups" => Some(("autoEnrolledAndroidGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "auto-enrolled-google-groups" => Some(("autoEnrolledGoogleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "excluded-google-groups" => Some(("excludedGoogleGroups", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["google-groups", "google-plus-communities"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-enrolled-android-groups", "auto-enrolled-google-groups", "excluded-google-groups", "google-groups"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2414,10 +2418,6 @@ impl<'n> Engine<'n> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription-period" => Some(("subscriptionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "grace-period" => Some(("gracePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "season.start.day" => Some(("season.start.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.start.month" => Some(("season.start.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.day" => Some(("season.end.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.month" => Some(("season.end.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "package-name" => Some(("packageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-period" => Some(("trialPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "purchase-type" => Some(("purchaseType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2425,7 +2425,7 @@ impl<'n> Engine<'n> { "default-price.currency" => Some(("defaultPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-price.price-micros" => Some(("defaultPrice.priceMicros", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "day", "default-language", "default-price", "end", "grace-period", "month", "package-name", "price-micros", "purchase-type", "season", "sku", "start", "status", "subscription-period", "trial-period"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "default-language", "default-price", "grace-period", "package-name", "price-micros", "purchase-type", "sku", "status", "subscription-period", "trial-period"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2578,10 +2578,6 @@ impl<'n> Engine<'n> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription-period" => Some(("subscriptionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "grace-period" => Some(("gracePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "season.start.day" => Some(("season.start.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.start.month" => Some(("season.start.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.day" => Some(("season.end.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.month" => Some(("season.end.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "package-name" => Some(("packageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-period" => Some(("trialPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "purchase-type" => Some(("purchaseType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2589,7 +2585,7 @@ impl<'n> Engine<'n> { "default-price.currency" => Some(("defaultPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-price.price-micros" => Some(("defaultPrice.priceMicros", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "day", "default-language", "default-price", "end", "grace-period", "month", "package-name", "price-micros", "purchase-type", "season", "sku", "start", "status", "subscription-period", "trial-period"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "default-language", "default-price", "grace-period", "package-name", "price-micros", "purchase-type", "sku", "status", "subscription-period", "trial-period"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2680,10 +2676,6 @@ impl<'n> Engine<'n> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription-period" => Some(("subscriptionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "grace-period" => Some(("gracePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "season.start.day" => Some(("season.start.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.start.month" => Some(("season.start.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.day" => Some(("season.end.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "season.end.month" => Some(("season.end.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "package-name" => Some(("packageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trial-period" => Some(("trialPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "purchase-type" => Some(("purchaseType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2691,7 +2683,7 @@ impl<'n> Engine<'n> { "default-price.currency" => Some(("defaultPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-price.price-micros" => Some(("defaultPrice.priceMicros", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "day", "default-language", "default-price", "end", "grace-period", "month", "package-name", "price-micros", "purchase-type", "season", "sku", "start", "status", "subscription-period", "trial-period"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["currency", "default-language", "default-price", "grace-period", "package-name", "price-micros", "purchase-type", "sku", "status", "subscription-period", "trial-period"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3397,6 +3389,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "type" => { + call = call.type_(arg_from_str(value.unwrap_or("-0"), err, "type", "integer")); + }, "token" => { call = call.token(value.unwrap_or("")); }, @@ -3425,7 +3420,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["token", "end-time", "max-results", "start-index", "start-time"].iter().map(|v|*v)); + v.extend(["start-index", "max-results", "token", "start-time", "end-time", "type"].iter().map(|v|*v)); v } )); } } @@ -3665,6 +3660,256 @@ impl<'n> Engine<'n> { } } + fn _systemapks_variants_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "device-spec.screen-density" => Some(("deviceSpec.screenDensity", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "device-spec.supported-abis" => Some(("deviceSpec.supportedAbis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "device-spec.supported-locales" => Some(("deviceSpec.supportedLocales", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["device-spec", "screen-density", "supported-abis", "supported-locales"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SystemApkVariantsCreateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.systemapks().variants_create(request, opt.value_of("package-name").unwrap_or(""), opt.value_of("version-code").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _systemapks_variants_download(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let variant_id: u32 = arg_from_str(&opt.value_of("variant-id").unwrap_or(""), err, "", "integer"); + let mut download_mode = false; + let mut call = self.hub.systemapks().variants_download(opt.value_of("package-name").unwrap_or(""), opt.value_of("version-code").unwrap_or(""), variant_id); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + if key == "alt" && value.unwrap_or("unset") == "media" { + download_mode = true; + } + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok(mut response) => { + if !download_mode { + } else { + io::copy(&mut response, &mut ostream).unwrap(); + ostream.flush().unwrap(); + } + Ok(()) + } + } + } + } + + fn _systemapks_variants_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let variant_id: u32 = arg_from_str(&opt.value_of("variant-id").unwrap_or(""), err, "", "integer"); + let mut call = self.hub.systemapks().variants_get(opt.value_of("package-name").unwrap_or(""), opt.value_of("version-code").unwrap_or(""), variant_id); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _systemapks_variants_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.systemapks().variants_list(opt.value_of("package-name").unwrap_or(""), opt.value_of("version-code").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); @@ -3886,6 +4131,26 @@ impl<'n> Engine<'n> { } } }, + ("systemapks", Some(opt)) => { + match opt.subcommand() { + ("variants-create", Some(opt)) => { + call_result = self._systemapks_variants_create(opt, dry_run, &mut err); + }, + ("variants-download", Some(opt)) => { + call_result = self._systemapks_variants_download(opt, dry_run, &mut err); + }, + ("variants-get", Some(opt)) => { + call_result = self._systemapks_variants_get(opt, dry_run, &mut err); + }, + ("variants-list", Some(opt)) => { + call_result = self._systemapks_variants_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("systemapks".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -5825,11 +6090,144 @@ fn main() { ]), ]), + ("systemapks", "methods: 'variants-create', 'variants-download', 'variants-get' and 'variants-list'", vec![ + ("variants-create", + Some(r##"Creates a new variant of APK which is suitable for inclusion in a system image."##), + "Details at http://byron.github.io/google-apis-rs/google_androidpublisher3_cli/systemapks_variants-create", + vec![ + (Some(r##"package-name"##), + None, + Some(r##"Unique identifier for the Android app; for example, "com.spiffygame"."##), + Some(true), + Some(false)), + + (Some(r##"version-code"##), + None, + Some(r##"The version code of the App Bundle."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("variants-download", + Some(r##"Download a previously created APK which is suitable for inclusion in a system image."##), + "Details at http://byron.github.io/google-apis-rs/google_androidpublisher3_cli/systemapks_variants-download", + vec![ + (Some(r##"package-name"##), + None, + Some(r##"Unique identifier for the Android app; for example, "com.spiffygame"."##), + Some(true), + Some(false)), + + (Some(r##"version-code"##), + None, + Some(r##"The version code of the App Bundle."##), + Some(true), + Some(false)), + + (Some(r##"variant-id"##), + None, + None, + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("variants-get", + Some(r##"Returns a previously created system APK variant."##), + "Details at http://byron.github.io/google-apis-rs/google_androidpublisher3_cli/systemapks_variants-get", + vec![ + (Some(r##"package-name"##), + None, + Some(r##"Unique identifier for the Android app; for example, "com.spiffygame"."##), + Some(true), + Some(false)), + + (Some(r##"version-code"##), + None, + Some(r##"The version code of the App Bundle."##), + Some(true), + Some(false)), + + (Some(r##"variant-id"##), + None, + Some(r##"Unique identifier for this variant."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("variants-list", + Some(r##"Returns the list of previously created system APK variants."##), + "Details at http://byron.github.io/google-apis-rs/google_androidpublisher3_cli/systemapks_variants-list", + vec![ + (Some(r##"package-name"##), + None, + Some(r##"Unique identifier for the Android app; for example, "com.spiffygame"."##), + Some(true), + Some(false)), + + (Some(r##"version-code"##), + None, + Some(r##"The version code of the App Bundle."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ]; let mut app = App::new("androidpublisher3") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200331") .about("Accesses Android application developers' Google Play accounts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_androidpublisher3_cli") .arg(Arg::with_name("url") diff --git a/gen/androidpublisher3/Cargo.toml b/gen/androidpublisher3/Cargo.toml index 117a999423..a7d6d572a7 100644 --- a/gen/androidpublisher3/Cargo.toml +++ b/gen/androidpublisher3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidpublisher3" -version = "1.0.12+20190702" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Android Publisher (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidpublisher3" homepage = "https://developers.google.com/android-publisher" -documentation = "https://docs.rs/google-androidpublisher3/1.0.12+20190702" +documentation = "https://docs.rs/google-androidpublisher3/1.0.13+20200331" license = "MIT" keywords = ["androidpublisher", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/androidpublisher3/README.md b/gen/androidpublisher3/README.md index bae5f4c8c5..cfebd5f354 100644 --- a/gen/androidpublisher3/README.md +++ b/gen/androidpublisher3/README.md @@ -5,37 +5,43 @@ DO NOT EDIT ! --> The `google-androidpublisher3` library allows access to all features of the *Google Android Publisher* service. -This documentation was generated from *Android Publisher* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *androidpublisher:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Android Publisher* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *androidpublisher:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Android Publisher* *v3* API can be found at the [official documentation site](https://developers.google.com/android-publisher). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.AndroidPublisher.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.AndroidPublisher.html) ... * edits - * [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditApkUploadCall.html), [*bundles list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditBundleListCall.html), [*bundles upload*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditBundleUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditValidateCall.html) + * [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditApkUploadCall.html), [*bundles list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditBundleListCall.html), [*bundles upload*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditBundleUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditValidateCall.html) * inappproducts - * [*delete*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InappproductUpdateCall.html) + * [*delete*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InappproductUpdateCall.html) * internalappsharingartifacts - * [*uploadapk*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InternalappsharingartifactUploadapkCall.html) and [*uploadbundle*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InternalappsharingartifactUploadbundleCall.html) + * [*uploadapk*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InternalappsharingartifactUploadapkCall.html) and [*uploadbundle*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InternalappsharingartifactUploadbundleCall.html) * orders - * [*refund*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.OrderRefundCall.html) + * [*refund*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.OrderRefundCall.html) * purchases - * [*products acknowledge*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseProductAcknowledgeCall.html), [*products get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseProductGetCall.html), [*subscriptions acknowledge*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseSubscriptionAcknowledgeCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.PurchaseVoidedpurchaseListCall.html) -* [reviews](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.Review.html) - * [*get*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.ReviewReplyCall.html) + * [*products acknowledge*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseProductAcknowledgeCall.html), [*products get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseProductGetCall.html), [*subscriptions acknowledge*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseSubscriptionAcknowledgeCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.PurchaseVoidedpurchaseListCall.html) +* [reviews](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.Review.html) + * [*get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.ReviewReplyCall.html) +* systemapks + * [*variants create*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.SystemapkVariantCreateCall.html), [*variants download*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.SystemapkVariantDownloadCall.html), [*variants get*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.SystemapkVariantGetCall.html) and [*variants list*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.SystemapkVariantListCall.html) Upload supported by ... -* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditDeobfuscationfileUploadCall.html) -* [*images upload edits*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditImageUploadCall.html) -* [*uploadbundle internalappsharingartifacts*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InternalappsharingartifactUploadbundleCall.html) -* [*apks upload edits*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditApkUploadCall.html) -* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditExpansionfileUploadCall.html) -* [*bundles upload edits*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.EditBundleUploadCall.html) -* [*uploadapk internalappsharingartifacts*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.InternalappsharingartifactUploadapkCall.html) +* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditDeobfuscationfileUploadCall.html) +* [*images upload edits*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditImageUploadCall.html) +* [*apks upload edits*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditApkUploadCall.html) +* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditExpansionfileUploadCall.html) +* [*bundles upload edits*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.EditBundleUploadCall.html) +* [*uploadapk internalappsharingartifacts*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InternalappsharingartifactUploadapkCall.html) +* [*uploadbundle internalappsharingartifacts*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.InternalappsharingartifactUploadbundleCall.html) + +Download supported by ... + +* [*variants download systemapks*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.SystemapkVariantDownloadCall.html) @@ -43,17 +49,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/struct.AndroidPublisher.html)** +* **[Hub](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/struct.AndroidPublisher.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -154,17 +160,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -174,29 +180,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-androidpublisher3/1.0.12+20190702/google_androidpublisher3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidpublisher3/1.0.13+20200331/google_androidpublisher3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/androidpublisher3/src/lib.rs b/gen/androidpublisher3/src/lib.rs index 4707733955..9592a9c9b7 100644 --- a/gen/androidpublisher3/src/lib.rs +++ b/gen/androidpublisher3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Android Publisher* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *androidpublisher:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Android Publisher* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *androidpublisher:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Android Publisher* *v3* API can be found at the //! [official documentation site](https://developers.google.com/android-publisher). @@ -23,17 +23,23 @@ //! * [*products acknowledge*](struct.PurchaseProductAcknowledgeCall.html), [*products get*](struct.PurchaseProductGetCall.html), [*subscriptions acknowledge*](struct.PurchaseSubscriptionAcknowledgeCall.html), [*subscriptions cancel*](struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](struct.PurchaseVoidedpurchaseListCall.html) //! * [reviews](struct.Review.html) //! * [*get*](struct.ReviewGetCall.html), [*list*](struct.ReviewListCall.html) and [*reply*](struct.ReviewReplyCall.html) +//! * systemapks +//! * [*variants create*](struct.SystemapkVariantCreateCall.html), [*variants download*](struct.SystemapkVariantDownloadCall.html), [*variants get*](struct.SystemapkVariantGetCall.html) and [*variants list*](struct.SystemapkVariantListCall.html) //! //! //! Upload supported by ... //! //! * [*deobfuscationfiles upload edits*](struct.EditDeobfuscationfileUploadCall.html) //! * [*images upload edits*](struct.EditImageUploadCall.html) -//! * [*uploadbundle internalappsharingartifacts*](struct.InternalappsharingartifactUploadbundleCall.html) //! * [*apks upload edits*](struct.EditApkUploadCall.html) //! * [*expansionfiles upload edits*](struct.EditExpansionfileUploadCall.html) //! * [*bundles upload edits*](struct.EditBundleUploadCall.html) //! * [*uploadapk internalappsharingartifacts*](struct.InternalappsharingartifactUploadapkCall.html) +//! * [*uploadbundle internalappsharingartifacts*](struct.InternalappsharingartifactUploadbundleCall.html) +//! +//! Download supported by ... +//! +//! * [*variants download systemapks*](struct.SystemapkVariantDownloadCall.html) //! //! //! @@ -354,7 +360,7 @@ impl<'a, C, A> AndroidPublisher AndroidPublisher { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/androidpublisher/v3/applications/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -378,9 +384,12 @@ impl<'a, C, A> AndroidPublisher pub fn reviews(&'a self) -> ReviewMethods<'a, C, A> { ReviewMethods { hub: &self } } + pub fn systemapks(&'a self) -> SystemapkMethods<'a, C, A> { + SystemapkMethods { hub: &self } + } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -428,25 +437,6 @@ pub struct BundlesListResponse { impl ResponseResult for BundlesListResponse {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [subscriptions defer purchases](struct.PurchaseSubscriptionDeferCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubscriptionPurchasesDeferRequest { - /// The information about the new desired expiry time for the subscription. - #[serde(rename="deferralInfo")] - pub deferral_info: Option, -} - -impl RequestValue for SubscriptionPurchasesDeferRequest {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -455,9 +445,9 @@ impl RequestValue for SubscriptionPurchasesDeferRequest {} pub struct TrackRelease { /// The desired status of this release. pub status: Option, - /// Fraction of users who are eligible to receive the release. 0 < fraction < 1. To be set, release status must be "inProgress" or "halted". - #[serde(rename="userFraction")] - pub user_fraction: Option, + /// no description provided + #[serde(rename="pinnedVersions")] + pub pinned_versions: Option>, /// The release name, used to identify this release in the Play Console UI. Not required to be unique. This is optional, if not set it will be generated from the version_name in the APKs. pub name: Option, /// A list of all version codes of APKs that will be exposed to the users of this track when this release is rolled out. Note that this list should contain all versions you wish to be active, including those you wish to retain from previous releases. @@ -467,33 +457,26 @@ pub struct TrackRelease { #[serde(rename="releaseNotes")] pub release_notes: Option>, /// no description provided + pub controls: Option>, + /// no description provided #[serde(rename="countryTargeting")] pub country_targeting: Option, + /// Fraction of users who are eligible to receive the release. 0 < fraction < 1. To be set, release status must be "inProgress" or "halted". + #[serde(rename="userFraction")] + pub user_fraction: Option, + /// no description provided + #[serde(rename="rollbackEnabled")] + pub rollback_enabled: Option, + /// In-app update priority of the release. All newly added APKs in the release will be considered at this priority. in_app_update_priority can take values between [0, 5]. 5 is the highest priority. Default priority is 0. See https://developer.android.com/guide/playcore/in-app-updates. + #[serde(rename="inAppUpdatePriority")] + pub in_app_update_priority: Option, + /// no description provided + pub sampling: Option, } impl Part for TrackRelease {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [apks list edits](struct.EditApkListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApksListResponse { - /// no description provided - pub apks: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apksListResponse". - pub kind: Option, -} - -impl ResponseResult for ApksListResponse {} - - /// There is no detailed description. /// /// # Activities @@ -521,82 +504,6 @@ impl Resource for Review {} impl ResponseResult for Review {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list reviews](struct.ReviewListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReviewsListResponse { - /// no description provided - pub reviews: Option>, - /// no description provided - #[serde(rename="tokenPagination")] - pub token_pagination: Option, - /// no description provided - #[serde(rename="pageInfo")] - pub page_info: Option, -} - -impl ResponseResult for ReviewsListResponse {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [patch inappproducts](struct.InappproductPatchCall.html) (request|response) -/// * [insert inappproducts](struct.InappproductInsertCall.html) (request|response) -/// * [get inappproducts](struct.InappproductGetCall.html) (response) -/// * [update inappproducts](struct.InappproductUpdateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InAppProduct { - /// The stock-keeping-unit (SKU) of the product, unique within an app. - pub sku: Option, - /// no description provided - pub status: Option, - /// Subscription period, specified in ISO 8601 format. Acceptable values are "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), and "P1Y" (one year). - #[serde(rename="subscriptionPeriod")] - pub subscription_period: Option, - /// Grace period of the subscription, specified in ISO 8601 format. It will allow developers to give their subscribers a grace period when the payment for the new recurrence period is declined. Acceptable values = "P3D" (three days) and "P7D" (seven days) - #[serde(rename="gracePeriod")] - pub grace_period: Option, - /// Definition of a season for a seasonal subscription. Can be defined only for yearly subscriptions. - pub season: Option, - /// The package name of the parent app. - #[serde(rename="packageName")] - pub package_name: Option, - /// List of localized title and description data. - pub listings: Option>, - /// Trial period, specified in ISO 8601 format. Acceptable values are anything between "P7D" (seven days) and "P999D" (999 days). Seasonal subscriptions cannot have a trial period. - #[serde(rename="trialPeriod")] - pub trial_period: Option, - /// Purchase type enum value. Unmodifiable after creation. - #[serde(rename="purchaseType")] - pub purchase_type: Option, - /// The default language of the localized data, as defined by BCP 47. e.g. "en-US", "en-GB". - #[serde(rename="defaultLanguage")] - pub default_language: Option, - /// Prices per buyer region. None of these prices should be zero. In-app products can never be free. - pub prices: Option>, - /// Default price cannot be zero. In-app products can never be free. Default price is always in the developer's Checkout merchant currency. - #[serde(rename="defaultPrice")] - pub default_price: Option, -} - -impl RequestValue for InAppProduct {} -impl Resource for InAppProduct {} -impl ResponseResult for InAppProduct {} - - /// There is no detailed description. /// /// # Activities @@ -682,24 +589,6 @@ impl RequestValue for Listing {} impl ResponseResult for Listing {} -/// Contains the price change information for a subscription that can be used to control the user journey for the price change in the app. This can be in the form of seeking confirmation from the user or tailoring the experience for a successful conversion. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubscriptionPriceChange { - /// The current state of the price change. Possible values are: - /// - Outstanding: State for a pending price change waiting for the user to agree. In this state, you can optionally seek confirmation from the user using the In-App API. - /// - Accepted: State for an accepted price change that the subscription will renew with unless it's canceled. The price change takes effect on a future date when the subscription renews. Note that the change might not occur when the subscription is renewed next. - pub state: Option, - /// The new price the subscription will renew with if the price change is accepted by the user. - #[serde(rename="newPrice")] - pub new_price: Option, -} - -impl Part for SubscriptionPriceChange {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -743,21 +632,6 @@ pub struct DeviceMetadata { impl Part for DeviceMetadata {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MonthDay { - /// Day of a month, value in [1, 31] range. Valid range depends on the specified month. - pub day: Option, - /// Month of a year. e.g. 1 = JAN, 2 = FEB etc. - pub month: Option, -} - -impl Part for MonthDay {} - - /// A ProductPurchase resource indicates the status of a user's inapp product purchase. /// /// # Activities @@ -774,6 +648,9 @@ pub struct ProductPurchase { pub order_id: Option, /// This kind represents an inappPurchase object in the androidpublisher service. pub kind: Option, + /// The purchase token generated to identify this purchase. + #[serde(rename="purchaseToken")] + pub purchase_token: Option, /// The consumption state of the inapp product. Possible values are: /// - Yet to be consumed /// - Consumed @@ -788,6 +665,9 @@ pub struct ProductPurchase { /// A developer-specified string that contains supplemental information about an order. #[serde(rename="developerPayload")] pub developer_payload: Option, + /// The inapp product SKU. + #[serde(rename="productId")] + pub product_id: Option, /// The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). #[serde(rename="purchaseTimeMillis")] pub purchase_time_millis: Option, @@ -802,53 +682,127 @@ pub struct ProductPurchase { /// - Acknowledged #[serde(rename="acknowledgementState")] pub acknowledgement_state: Option, + /// The quantity associated with the purchase of the inapp product. + pub quantity: Option, } impl ResponseResult for ProductPurchase {} -/// There is no detailed description. +/// A SubscriptionPurchase resource indicates the status of a user's subscription purchase. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [images deleteall edits](struct.EditImageDeleteallCall.html) (response) +/// * [subscriptions get purchases](struct.PurchaseSubscriptionGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ImagesDeleteAllResponse { - /// no description provided - pub deleted: Option>, +pub struct SubscriptionPurchase { + /// The order id of the latest recurring order associated with the purchase of the subscription. + #[serde(rename="orderId")] + pub order_id: Option, + /// User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow. + #[serde(rename="externalAccountId")] + pub external_account_id: Option, + /// The type of promotion applied on this purchase. This field is only set if a promotion is applied when the subscription was purchased. Possible values are: + /// - One time code + /// - Vanity code + #[serde(rename="promotionType")] + pub promotion_type: Option, + /// ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. + #[serde(rename="countryCode")] + pub country_code: Option, + /// A developer-specified string that contains supplemental information about an order. + #[serde(rename="developerPayload")] + pub developer_payload: Option, + /// The family name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. + #[serde(rename="familyName")] + pub family_name: Option, + /// Whether the subscription will automatically be renewed when it reaches its current expiry time. + #[serde(rename="autoRenewing")] + pub auto_renewing: Option, + /// The payment state of the subscription. Possible values are: + /// - Payment pending + /// - Payment received + /// - Free trial + /// - Pending deferred upgrade/downgrade + #[serde(rename="paymentState")] + pub payment_state: Option, + /// The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. + #[serde(rename="emailAddress")] + pub email_address: Option, + /// The reason why a subscription was canceled or is not auto-renewing. Possible values are: + /// - User canceled the subscription + /// - Subscription was canceled by the system, for example because of a billing problem + /// - Subscription was replaced with a new subscription + /// - Subscription was canceled by the developer + #[serde(rename="cancelReason")] + pub cancel_reason: Option, + /// The profile name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. + #[serde(rename="profileName")] + pub profile_name: Option, + /// Time at which the subscription was granted, in milliseconds since the Epoch. + #[serde(rename="startTimeMillis")] + pub start_time_millis: Option, + /// The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0. + #[serde(rename="userCancellationTimeMillis")] + pub user_cancellation_time_millis: Option, + /// Price of the subscription, not including tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000. + #[serde(rename="priceAmountMicros")] + pub price_amount_micros: Option, + /// This kind represents a subscriptionPurchase object in the androidpublisher service. + pub kind: Option, + /// The acknowledgement state of the subscription product. Possible values are: + /// - Yet to be acknowledged + /// - Acknowledged + #[serde(rename="acknowledgementState")] + pub acknowledgement_state: Option, + /// Introductory price information of the subscription. This is only present when the subscription was purchased with an introductory price. + /// + /// This field does not indicate the subscription is currently in introductory price period. + #[serde(rename="introductoryPriceInfo")] + pub introductory_price_info: Option, + /// The latest price change information available. This is present only when there is an upcoming price change for the subscription yet to be applied. + /// + /// Once the subscription renews with the new price or the subscription is canceled, no price change information will be returned. + #[serde(rename="priceChange")] + pub price_change: Option, + /// The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: + /// - Test (i.e. purchased from a license testing account) + /// - Promo (i.e. purchased using a promo code) + #[serde(rename="purchaseType")] + pub purchase_type: Option, + /// ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". + #[serde(rename="priceCurrencyCode")] + pub price_currency_code: Option, + /// Time at which the subscription will be automatically resumed, in milliseconds since the Epoch. Only present if the user has requested to pause the subscription. + #[serde(rename="autoResumeTimeMillis")] + pub auto_resume_time_millis: Option, + /// Time at which the subscription will expire, in milliseconds since the Epoch. + #[serde(rename="expiryTimeMillis")] + pub expiry_time_millis: Option, + /// Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey). + #[serde(rename="cancelSurveyResult")] + pub cancel_survey_result: Option, + /// The Google profile id of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. + #[serde(rename="profileId")] + pub profile_id: Option, + /// The purchase token of the originating purchase if this subscription is one of the following: + /// - Re-signup of a canceled but non-lapsed subscription + /// - Upgrade/downgrade from a previous subscription For example, suppose a user originally signs up and you receive purchase token X, then the user cancels and goes through the resignup flow (before their subscription lapses) and you receive purchase token Y, and finally the user upgrades their subscription and you receive purchase token Z. If you call this API with purchase token Z, this field will be set to Y. If you call this API with purchase token Y, this field will be set to X. If you call this API with purchase token X, this field will not be set. + #[serde(rename="linkedPurchaseToken")] + pub linked_purchase_token: Option, + /// The given name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. + #[serde(rename="givenName")] + pub given_name: Option, + /// The promotion code applied on this purchase. This field is only set if a vanity code promotion is applied when the subscription was purchased. + #[serde(rename="promotionCode")] + pub promotion_code: Option, } -impl ResponseResult for ImagesDeleteAllResponse {} - - -/// An artifact resource which gets created when uploading an APK or Android App Bundle through internal app sharing. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [uploadapk internalappsharingartifacts](struct.InternalappsharingartifactUploadapkCall.html) (response) -/// * [uploadbundle internalappsharingartifacts](struct.InternalappsharingartifactUploadbundleCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InternalAppSharingArtifact { - /// The download URL generated for the uploaded artifact. Users that are authorized to download can follow the link to the Play Store app to install it. - #[serde(rename="downloadUrl")] - pub download_url: Option, - /// The SHA-256 hash of the artifact represented as a lowercase hexadecimal number, matching the output of the sha256sum command. - pub sha256: Option, - /// The SHA256 fingerprint of the certificate used to signed the generated artifact. - #[serde(rename="certificateFingerprint")] - pub certificate_fingerprint: Option, -} - -impl Resource for InternalAppSharingArtifact {} -impl ResponseResult for InternalAppSharingArtifact {} +impl ResponseResult for SubscriptionPurchase {} /// There is no detailed description. @@ -856,16 +810,14 @@ impl ResponseResult for InternalAppSharingArtifact {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Season { - /// Optionally present list of prorations for the season. Each proration is a one-off discounted entry into a subscription. Each proration contains the first date on which the discount is available and the new pricing information. - pub prorations: Option>, - /// Inclusive end date of the recurrence period. - pub end: Option, - /// Inclusive start date of the recurrence period. - pub start: Option, +pub struct Timestamp { + /// no description provided + pub nanos: Option, + /// no description provided + pub seconds: Option, } -impl Part for Season {} +impl Part for Timestamp {} /// There is no detailed description. @@ -873,14 +825,16 @@ impl Part for Season {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InAppProductListing { +pub struct TrackReleasePinPinTargetingDevicePin { /// no description provided - pub description: Option, + pub device: Option, /// no description provided - pub title: Option, + pub brand: Option, + /// no description provided + pub product: Option, } -impl Part for InAppProductListing {} +impl Part for TrackReleasePinPinTargetingDevicePin {} /// There is no detailed description. @@ -902,20 +856,6 @@ pub struct ReviewsReplyRequest { impl RequestValue for ReviewsReplyRequest {} -/// Represents a deobfuscation file. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeobfuscationFile { - /// The type of the deobfuscation file. - #[serde(rename="symbolType")] - pub symbol_type: Option, -} - -impl Part for DeobfuscationFile {} - - /// There is no detailed description. /// /// # Activities @@ -1076,6 +1016,25 @@ pub struct LocalizedText { impl Part for LocalizedText {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [variants create systemapks](struct.SystemapkVariantCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystemApkVariantsCreateRequest { + /// no description provided + #[serde(rename="deviceSpec")] + pub device_spec: Option, +} + +impl RequestValue for SystemApkVariantsCreateRequest {} + + /// A permission used by this APK. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1092,6 +1051,21 @@ pub struct ExternallyHostedApkUsesPermission { impl Part for ExternallyHostedApkUsesPermission {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InAppProductListing { + /// no description provided + pub description: Option, + /// no description provided + pub title: Option, +} + +impl Part for InAppProductListing {} + + /// There is no detailed description. /// /// # Activities @@ -1150,55 +1124,6 @@ pub struct SubscriptionPurchasesDeferResponse { impl ResponseResult for SubscriptionPurchasesDeferResponse {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list inappproducts](struct.InappproductListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InappproductsListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#inappproductsListResponse". - pub kind: Option, - /// no description provided - #[serde(rename="tokenPagination")] - pub token_pagination: Option, - /// no description provided - #[serde(rename="pageInfo")] - pub page_info: Option, - /// no description provided - pub inappproduct: Option>, -} - -impl ResponseResult for InappproductsListResponse {} - - -/// Contains the introductory price information for a subscription. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IntroductoryPriceInfo { - /// Introductory price period, specified in ISO 8601 format. Common values are (but not limited to) "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), and "P1Y" (one year). - #[serde(rename="introductoryPricePeriod")] - pub introductory_price_period: Option, - /// ISO 4217 currency code for the introductory subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". - #[serde(rename="introductoryPriceCurrencyCode")] - pub introductory_price_currency_code: Option, - /// Introductory price of the subscription, not including tax. The currency is the same as price_currency_code. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000. - #[serde(rename="introductoryPriceAmountMicros")] - pub introductory_price_amount_micros: Option, - /// The number of billing period to offer introductory pricing. - #[serde(rename="introductoryPriceCycles")] - pub introductory_price_cycles: Option, -} - -impl Part for IntroductoryPriceInfo {} - - /// Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey). /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1283,6 +1208,559 @@ pub struct TokenPagination { impl Part for TokenPagination {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [testers get edits](struct.EditTesterGetCall.html) (response) +/// * [testers patch edits](struct.EditTesterPatchCall.html) (request|response) +/// * [testers update edits](struct.EditTesterUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Testers { + /// A list of all Google Groups, as email addresses, that define testers for this track. + #[serde(rename="googleGroups")] + pub google_groups: Option>, + /// no description provided + #[serde(rename="autoEnrolledAndroidGroups")] + pub auto_enrolled_android_groups: Option>, + /// no description provided + #[serde(rename="autoEnrolledGoogleGroups")] + pub auto_enrolled_google_groups: Option>, + /// no description provided + #[serde(rename="excludedGoogleGroups")] + pub excluded_google_groups: Option>, +} + +impl RequestValue for Testers {} +impl ResponseResult for Testers {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [expansionfiles get edits](struct.EditExpansionfileGetCall.html) (response) +/// * [expansionfiles patch edits](struct.EditExpansionfilePatchCall.html) (request|response) +/// * [expansionfiles update edits](struct.EditExpansionfileUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExpansionFile { + /// If set this APK's Expansion File references another APK's Expansion File. The file_size field will not be set. + #[serde(rename="referencesVersion")] + pub references_version: Option, + /// If set this field indicates that this APK has an Expansion File uploaded to it: this APK does not reference another APK's Expansion File. The field's value is the size of the uploaded Expansion File in bytes. + #[serde(rename="fileSize")] + pub file_size: Option, +} + +impl RequestValue for ExpansionFile {} +impl ResponseResult for ExpansionFile {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Control { + /// no description provided + #[serde(rename="stratifiedSamplings")] + pub stratified_samplings: Option>, + /// no description provided + #[serde(rename="modRanges")] + pub mod_ranges: Option>, + /// no description provided + #[serde(rename="versionCodes")] + pub version_codes: Option>, +} + +impl Part for Control {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [apks addexternallyhosted edits](struct.EditApkAddexternallyhostedCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApksAddExternallyHostedResponse { + /// The definition of the externally-hosted APK and where it is located. + #[serde(rename="externallyHostedApk")] + pub externally_hosted_apk: Option, +} + +impl ResponseResult for ApksAddExternallyHostedResponse {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [deobfuscationfiles upload edits](struct.EditDeobfuscationfileUploadCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeobfuscationFilesUploadResponse { + /// no description provided + #[serde(rename="deobfuscationFile")] + pub deobfuscation_file: Option, +} + +impl ResponseResult for DeobfuscationFilesUploadResponse {} + + +/// Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert edits](struct.EditInsertCall.html) (request|response) +/// * [commit edits](struct.EditCommitCall.html) (response) +/// * [validate edits](struct.EditValidateCall.html) (response) +/// * [get edits](struct.EditGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEdit { + /// The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). + #[serde(rename="expiryTimeSeconds")] + pub expiry_time_seconds: Option, + /// The ID of the edit that can be used in subsequent API calls. + pub id: Option, +} + +impl RequestValue for AppEdit {} +impl ResponseResult for AppEdit {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Sampling { + /// no description provided + #[serde(rename="stratifiedSamplings")] + pub stratified_samplings: Option>, + /// no description provided + pub modulus: Option, + /// no description provided + #[serde(rename="modRanges")] + pub mod_ranges: Option>, + /// no description provided + pub salt: Option, + /// no description provided + #[serde(rename="useAndroidId")] + pub use_android_id: Option, +} + +impl Part for Sampling {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReviewReplyResult { + /// The reply text that was applied. + #[serde(rename="replyText")] + pub reply_text: Option, + /// The time at which the reply took effect. + #[serde(rename="lastEdited")] + pub last_edited: Option, +} + +impl Part for ReviewReplyResult {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [apks addexternallyhosted edits](struct.EditApkAddexternallyhostedCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApksAddExternallyHostedRequest { + /// The definition of the externally-hosted APK and where it is located. + #[serde(rename="externallyHostedApk")] + pub externally_hosted_apk: Option, +} + +impl RequestValue for ApksAddExternallyHostedRequest {} + + +/// Represents the binary payload of an APK. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApkBinary { + /// A sha256 hash of the APK payload, encoded as a hex string and matching the output of the sha256sum command. + pub sha256: Option, + /// A sha1 hash of the APK payload, encoded as a hex string and matching the output of the sha1sum command. + pub sha1: Option, +} + +impl Part for ApkBinary {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [listings list edits](struct.EditListingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListingsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#listingsListResponse". + pub kind: Option, + /// no description provided + pub listings: Option>, +} + +impl ResponseResult for ListingsListResponse {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ModRange { + /// no description provided + pub start: Option, + /// no description provided + pub end: Option, +} + +impl Part for ModRange {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list reviews](struct.ReviewListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReviewsListResponse { + /// no description provided + pub reviews: Option>, + /// no description provided + #[serde(rename="tokenPagination")] + pub token_pagination: Option, + /// no description provided + #[serde(rename="pageInfo")] + pub page_info: Option, +} + +impl ResponseResult for ReviewsListResponse {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch inappproducts](struct.InappproductPatchCall.html) (request|response) +/// * [insert inappproducts](struct.InappproductInsertCall.html) (request|response) +/// * [get inappproducts](struct.InappproductGetCall.html) (response) +/// * [update inappproducts](struct.InappproductUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InAppProduct { + /// The stock-keeping-unit (SKU) of the product, unique within an app. + pub sku: Option, + /// no description provided + pub status: Option, + /// Subscription period, specified in ISO 8601 format. Acceptable values are "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), and "P1Y" (one year). + #[serde(rename="subscriptionPeriod")] + pub subscription_period: Option, + /// Grace period of the subscription, specified in ISO 8601 format. It will allow developers to give their subscribers a grace period when the payment for the new recurrence period is declined. Acceptable values = "P3D" (three days), "P7D" (seven days), "P14D" (fourteen days), and "P30D" (thirty days) + #[serde(rename="gracePeriod")] + pub grace_period: Option, + /// The package name of the parent app. + #[serde(rename="packageName")] + pub package_name: Option, + /// List of localized title and description data. + pub listings: Option>, + /// Trial period, specified in ISO 8601 format. Acceptable values are anything between "P7D" (seven days) and "P999D" (999 days). Seasonal subscriptions cannot have a trial period. + #[serde(rename="trialPeriod")] + pub trial_period: Option, + /// Purchase type enum value. Unmodifiable after creation. + #[serde(rename="purchaseType")] + pub purchase_type: Option, + /// The default language of the localized data, as defined by BCP 47. e.g. "en-US", "en-GB". + #[serde(rename="defaultLanguage")] + pub default_language: Option, + /// Prices per buyer region. None of these prices should be zero. In-app products can never be free. + pub prices: Option>, + /// Default price cannot be zero. In-app products can never be free. Default price is always in the developer's Checkout merchant currency. + #[serde(rename="defaultPrice")] + pub default_price: Option, +} + +impl RequestValue for InAppProduct {} +impl Resource for InAppProduct {} +impl ResponseResult for InAppProduct {} + + +/// Contains the price change information for a subscription that can be used to control the user journey for the price change in the app. This can be in the form of seeking confirmation from the user or tailoring the experience for a successful conversion. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubscriptionPriceChange { + /// The current state of the price change. Possible values are: + /// - Outstanding: State for a pending price change waiting for the user to agree. In this state, you can optionally seek confirmation from the user using the In-App API. + /// - Accepted: State for an accepted price change that the subscription will renew with unless it's canceled. The price change takes effect on a future date when the subscription renews. Note that the change might not occur when the subscription is renewed next. + pub state: Option, + /// The new price the subscription will renew with if the price change is accepted by the user. + #[serde(rename="newPrice")] + pub new_price: Option, +} + +impl Part for SubscriptionPriceChange {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StratifiedSampling { + /// no description provided + #[serde(rename="modRanges")] + pub mod_ranges: Option>, + /// no description provided + pub stratum: Option, +} + +impl Part for StratifiedSampling {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [images deleteall edits](struct.EditImageDeleteallCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImagesDeleteAllResponse { + /// no description provided + pub deleted: Option>, +} + +impl ResponseResult for ImagesDeleteAllResponse {} + + +/// An artifact resource which gets created when uploading an APK or Android App Bundle through internal app sharing. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [uploadapk internalappsharingartifacts](struct.InternalappsharingartifactUploadapkCall.html) (response) +/// * [uploadbundle internalappsharingartifacts](struct.InternalappsharingartifactUploadbundleCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InternalAppSharingArtifact { + /// The download URL generated for the uploaded artifact. Users that are authorized to download can follow the link to the Play Store app to install it. + #[serde(rename="downloadUrl")] + pub download_url: Option, + /// The SHA-256 hash of the artifact represented as a lowercase hexadecimal number, matching the output of the sha256sum command. + pub sha256: Option, + /// The SHA256 fingerprint of the certificate used to signed the generated artifact. + #[serde(rename="certificateFingerprint")] + pub certificate_fingerprint: Option, +} + +impl Resource for InternalAppSharingArtifact {} +impl ResponseResult for InternalAppSharingArtifact {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Price { + /// 3 letter Currency code, as defined by ISO 4217. + pub currency: Option, + /// The price in millionths of the currency base unit represented as a string. + #[serde(rename="priceMicros")] + pub price_micros: Option, +} + +impl Part for Price {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [subscriptions defer purchases](struct.PurchaseSubscriptionDeferCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubscriptionPurchasesDeferRequest { + /// The information about the new desired expiry time for the subscription. + #[serde(rename="deferralInfo")] + pub deferral_info: Option, +} + +impl RequestValue for SubscriptionPurchasesDeferRequest {} + + +/// Represents the variant of a generated system APK from an uploaded App Bundle. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [variants create systemapks](struct.SystemapkVariantCreateCall.html) (response) +/// * [variants get systemapks](struct.SystemapkVariantGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Variant { + /// no description provided + #[serde(rename="deviceSpec")] + pub device_spec: Option, + /// no description provided + #[serde(rename="variantId")] + pub variant_id: Option, +} + +impl ResponseResult for Variant {} + + +/// Represents a deobfuscation file. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeobfuscationFile { + /// The type of the deobfuscation file. + #[serde(rename="symbolType")] + pub symbol_type: Option, +} + +impl Part for DeobfuscationFile {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [variants list systemapks](struct.SystemapkVariantListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystemApkVariantsListResponse { + /// no description provided + pub variants: Option>, +} + +impl ResponseResult for SystemApkVariantsListResponse {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Stratum { + /// no description provided + pub brand: Option, +} + +impl Part for Stratum {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list inappproducts](struct.InappproductListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InappproductsListResponse { + /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#inappproductsListResponse". + pub kind: Option, + /// no description provided + #[serde(rename="tokenPagination")] + pub token_pagination: Option, + /// no description provided + #[serde(rename="pageInfo")] + pub page_info: Option, + /// no description provided + pub inappproduct: Option>, +} + +impl ResponseResult for InappproductsListResponse {} + + +/// Contains the introductory price information for a subscription. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntroductoryPriceInfo { + /// Introductory price period, specified in ISO 8601 format. Common values are (but not limited to) "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), and "P1Y" (one year). + #[serde(rename="introductoryPricePeriod")] + pub introductory_price_period: Option, + /// ISO 4217 currency code for the introductory subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". + #[serde(rename="introductoryPriceCurrencyCode")] + pub introductory_price_currency_code: Option, + /// Introductory price of the subscription, not including tax. The currency is the same as price_currency_code. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000. + #[serde(rename="introductoryPriceAmountMicros")] + pub introductory_price_amount_micros: Option, + /// The number of billing period to offer introductory pricing. + #[serde(rename="introductoryPriceCycles")] + pub introductory_price_cycles: Option, +} + +impl Part for IntroductoryPriceInfo {} + + /// There is no detailed description. /// /// # Activities @@ -1326,27 +1804,18 @@ impl Part for DeveloperComment {} /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [testers get edits](struct.EditTesterGetCall.html) (response) -/// * [testers patch edits](struct.EditTesterPatchCall.html) (request|response) -/// * [testers update edits](struct.EditTesterUpdateCall.html) (request|response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Testers { - /// A list of all Google Groups, as email addresses, that define testers for this track. - #[serde(rename="googleGroups")] - pub google_groups: Option>, - /// A list of all Google+ Communities, as URLs, that define testers for this track. - #[serde(rename="googlePlusCommunities")] - pub google_plus_communities: Option>, +pub struct TrackReleasePin { + /// no description provided + pub targetings: Option>, + /// no description provided + #[serde(rename="versionCodes")] + pub version_codes: Option>, } -impl RequestValue for Testers {} -impl ResponseResult for Testers {} +impl Part for TrackReleasePin {} /// A VoidedPurchase resource indicates a purchase that was either canceled/refunded/charged-back. @@ -1355,14 +1824,34 @@ impl ResponseResult for Testers {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VoidedPurchase { + /// The order id which uniquely identifies a one-time purchase, subscription purchase, or subscription renewal. + #[serde(rename="orderId")] + pub order_id: Option, /// This kind represents a voided purchase object in the androidpublisher service. pub kind: Option, /// The time at which the purchase was canceled/refunded/charged-back, in milliseconds since the epoch (Jan 1, 1970). #[serde(rename="voidedTimeMillis")] pub voided_time_millis: Option, - /// The token that was generated when a purchase was made. This uniquely identifies a purchase. + /// The token which uniquely identifies a one-time purchase or subscription. To uniquely identify subscription renewals use order_id (available starting from version 3 of the API). #[serde(rename="purchaseToken")] pub purchase_token: Option, + /// The initiator of voided purchase, possible values are: + /// - User + /// - Developer + /// - Google + #[serde(rename="voidedSource")] + pub voided_source: Option, + /// The reason why the purchase was voided, possible values are: + /// - Other + /// - Remorse + /// - Not_received + /// - Defective + /// - Accidental_purchase + /// - Fraud + /// - Friendly_fraud + /// - Chargeback + #[serde(rename="voidedReason")] + pub voided_reason: Option, /// The time at which the purchase was made, in milliseconds since the epoch (Jan 1, 1970). #[serde(rename="purchaseTimeMillis")] pub purchase_time_millis: Option, @@ -1371,50 +1860,6 @@ pub struct VoidedPurchase { impl Part for VoidedPurchase {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [expansionfiles get edits](struct.EditExpansionfileGetCall.html) (response) -/// * [expansionfiles patch edits](struct.EditExpansionfilePatchCall.html) (request|response) -/// * [expansionfiles update edits](struct.EditExpansionfileUpdateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ExpansionFile { - /// If set this APK's Expansion File references another APK's Expansion File. The file_size field will not be set. - #[serde(rename="referencesVersion")] - pub references_version: Option, - /// If set this field indicates that this APK has an Expansion File uploaded to it: this APK does not reference another APK's Expansion File. The field's value is the size of the uploaded Expansion File in bytes. - #[serde(rename="fileSize")] - pub file_size: Option, -} - -impl RequestValue for ExpansionFile {} -impl ResponseResult for ExpansionFile {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [apks addexternallyhosted edits](struct.EditApkAddexternallyhostedCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApksAddExternallyHostedResponse { - /// The definition of the externally-hosted APK and where it is located. - #[serde(rename="externallyHostedApk")] - pub externally_hosted_apk: Option, -} - -impl ResponseResult for ApksAddExternallyHostedResponse {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1432,127 +1877,24 @@ pub struct Comment { impl Part for Comment {} -/// A SubscriptionPurchase resource indicates the status of a user's subscription purchase. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [subscriptions get purchases](struct.PurchaseSubscriptionGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubscriptionPurchase { - /// The order id of the latest recurring order associated with the purchase of the subscription. - #[serde(rename="orderId")] - pub order_id: Option, - /// ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. - #[serde(rename="countryCode")] - pub country_code: Option, - /// A developer-specified string that contains supplemental information about an order. - #[serde(rename="developerPayload")] - pub developer_payload: Option, - /// The family name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. - #[serde(rename="familyName")] - pub family_name: Option, - /// Whether the subscription will automatically be renewed when it reaches its current expiry time. - #[serde(rename="autoRenewing")] - pub auto_renewing: Option, - /// The payment state of the subscription. Possible values are: - /// - Payment pending - /// - Payment received - /// - Free trial - /// - Pending deferred upgrade/downgrade - #[serde(rename="paymentState")] - pub payment_state: Option, - /// The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. - #[serde(rename="emailAddress")] - pub email_address: Option, - /// The reason why a subscription was canceled or is not auto-renewing. Possible values are: - /// - User canceled the subscription - /// - Subscription was canceled by the system, for example because of a billing problem - /// - Subscription was replaced with a new subscription - /// - Subscription was canceled by the developer - #[serde(rename="cancelReason")] - pub cancel_reason: Option, - /// The profile name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. - #[serde(rename="profileName")] - pub profile_name: Option, - /// Time at which the subscription was granted, in milliseconds since the Epoch. - #[serde(rename="startTimeMillis")] - pub start_time_millis: Option, - /// The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0. - #[serde(rename="userCancellationTimeMillis")] - pub user_cancellation_time_millis: Option, - /// Price of the subscription, not including tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000. - #[serde(rename="priceAmountMicros")] - pub price_amount_micros: Option, - /// This kind represents a subscriptionPurchase object in the androidpublisher service. - pub kind: Option, - /// The acknowledgement state of the subscription product. Possible values are: - /// - Yet to be acknowledged - /// - Acknowledged - #[serde(rename="acknowledgementState")] - pub acknowledgement_state: Option, - /// Introductory price information of the subscription. This is only present when the subscription was purchased with an introductory price. - /// - /// This field does not indicate the subscription is currently in introductory price period. - #[serde(rename="introductoryPriceInfo")] - pub introductory_price_info: Option, - /// The latest price change information available. This is present only when there is an upcoming price change for the subscription yet to be applied. - /// - /// Once the subscription renews with the new price or the subscription is canceled, no price change information will be returned. - #[serde(rename="priceChange")] - pub price_change: Option, - /// The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: - /// - Test (i.e. purchased from a license testing account) - #[serde(rename="purchaseType")] - pub purchase_type: Option, - /// ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". - #[serde(rename="priceCurrencyCode")] - pub price_currency_code: Option, - /// Time at which the subscription will be automatically resumed, in milliseconds since the Epoch. Only present if the user has requested to pause the subscription. - #[serde(rename="autoResumeTimeMillis")] - pub auto_resume_time_millis: Option, - /// Time at which the subscription will expire, in milliseconds since the Epoch. - #[serde(rename="expiryTimeMillis")] - pub expiry_time_millis: Option, - /// Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey). - #[serde(rename="cancelSurveyResult")] - pub cancel_survey_result: Option, - /// The Google profile id of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. - #[serde(rename="profileId")] - pub profile_id: Option, - /// The purchase token of the originating purchase if this subscription is one of the following: - /// - Re-signup of a canceled but non-lapsed subscription - /// - Upgrade/downgrade from a previous subscription For example, suppose a user originally signs up and you receive purchase token X, then the user cancels and goes through the resignup flow (before their subscription lapses) and you receive purchase token Y, and finally the user upgrades their subscription and you receive purchase token Z. If you call this API with purchase token Z, this field will be set to Y. If you call this API with purchase token Y, this field will be set to X. If you call this API with purchase token X, this field will not be set. - #[serde(rename="linkedPurchaseToken")] - pub linked_purchase_token: Option, - /// The given name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. - #[serde(rename="givenName")] - pub given_name: Option, -} - -impl ResponseResult for SubscriptionPurchase {} - - /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [deobfuscationfiles upload edits](struct.EditDeobfuscationfileUploadCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeobfuscationFilesUploadResponse { +pub struct DeviceSpec { /// no description provided - #[serde(rename="deobfuscationFile")] - pub deobfuscation_file: Option, + #[serde(rename="screenDensity")] + pub screen_density: Option, + /// no description provided + #[serde(rename="supportedAbis")] + pub supported_abis: Option>, + /// no description provided + #[serde(rename="supportedLocales")] + pub supported_locales: Option>, } -impl ResponseResult for DeobfuscationFilesUploadResponse {} +impl Part for DeviceSpec {} /// There is no detailed description. @@ -1563,10 +1905,12 @@ impl ResponseResult for DeobfuscationFilesUploadResponse {} pub struct Image { /// A URL that will serve a preview of the image. pub url: Option, - /// A sha1 hash of the image that was uploaded. - pub sha1: Option, + /// A sha256 hash of the image that was uploaded. + pub sha256: Option, /// A unique id representing this image. pub id: Option, + /// A sha1 hash of the image that was uploaded. + pub sha1: Option, } impl Part for Image {} @@ -1574,63 +1918,22 @@ impl Part for Image {} /// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Prorate { - /// Defines the first day on which the price takes effect. - pub start: Option, - /// Default price cannot be zero and must be less than the full subscription price. Default price is always in the developer's Checkout merchant currency. Targeted countries have their prices set automatically based on the default_price. - #[serde(rename="defaultPrice")] - pub default_price: Option, -} - -impl Part for Prorate {} - - -/// Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation. -/// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [insert edits](struct.EditInsertCall.html) (request|response) -/// * [commit edits](struct.EditCommitCall.html) (response) -/// * [validate edits](struct.EditValidateCall.html) (response) -/// * [get edits](struct.EditGetCall.html) (response) +/// * [apks list edits](struct.EditApkListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppEdit { - /// The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). - #[serde(rename="expiryTimeSeconds")] - pub expiry_time_seconds: Option, - /// The ID of the edit that can be used in subsequent API calls. - pub id: Option, +pub struct ApksListResponse { + /// no description provided + pub apks: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apksListResponse". + pub kind: Option, } -impl RequestValue for AppEdit {} -impl ResponseResult for AppEdit {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PageInfo { - /// no description provided - #[serde(rename="resultPerPage")] - pub result_per_page: Option, - /// no description provided - #[serde(rename="startIndex")] - pub start_index: Option, - /// no description provided - #[serde(rename="totalResults")] - pub total_results: Option, -} - -impl Part for PageInfo {} +impl ResponseResult for ApksListResponse {} /// There is no detailed description. @@ -1667,28 +1970,14 @@ pub struct Apk { pub version_code: Option, /// Information about the binary payload of this APK. pub binary: Option, + /// no description provided + #[serde(rename="testBinary")] + pub test_binary: Option, } impl ResponseResult for Apk {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReviewReplyResult { - /// The reply text that was applied. - #[serde(rename="replyText")] - pub reply_text: Option, - /// The time at which the reply took effect. - #[serde(rename="lastEdited")] - pub last_edited: Option, -} - -impl Part for ReviewReplyResult {} - - /// There is no detailed description. /// /// # Activities @@ -1712,40 +2001,6 @@ impl RequestValue for Track {} impl ResponseResult for Track {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Timestamp { - /// no description provided - pub nanos: Option, - /// no description provided - pub seconds: Option, -} - -impl Part for Timestamp {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [apks addexternallyhosted edits](struct.EditApkAddexternallyhostedCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApksAddExternallyHostedRequest { - /// The definition of the externally-hosted APK and where it is located. - #[serde(rename="externallyHostedApk")] - pub externally_hosted_apk: Option, -} - -impl RequestValue for ApksAddExternallyHostedRequest {} - - /// There is no detailed description. /// /// # Activities @@ -1764,55 +2019,46 @@ pub struct ReviewsReplyResponse { impl ResponseResult for ReviewsReplyResponse {} -/// Represents the binary payload of an APK. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApkBinary { - /// A sha256 hash of the APK payload, encoded as a hex string and matching the output of the sha256sum command. - pub sha256: Option, - /// A sha1 hash of the APK payload, encoded as a hex string and matching the output of the sha1sum command. - pub sha1: Option, -} - -impl Part for ApkBinary {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Price { - /// 3 letter Currency code, as defined by ISO 4217. - pub currency: Option, - /// The price in millionths of the currency base unit represented as a string. - #[serde(rename="priceMicros")] - pub price_micros: Option, -} - -impl Part for Price {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [listings list edits](struct.EditListingListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListingsListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidpublisher#listingsListResponse". - pub kind: Option, +pub struct TrackReleasePinPinTargeting { /// no description provided - pub listings: Option>, + #[serde(rename="countryCodes")] + pub country_codes: Option>, + /// no description provided + #[serde(rename="phoneskyVersions")] + pub phonesky_versions: Option>, + /// no description provided + #[serde(rename="sdkVersions")] + pub sdk_versions: Option>, + /// no description provided + pub devices: Option>, } -impl ResponseResult for ListingsListResponse {} +impl Part for TrackReleasePinPinTargeting {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PageInfo { + /// no description provided + #[serde(rename="resultPerPage")] + pub result_per_page: Option, + /// no description provided + #[serde(rename="startIndex")] + pub start_index: Option, + /// no description provided + #[serde(rename="totalResults")] + pub total_results: Option, +} + +impl Part for PageInfo {} @@ -1933,6 +2179,7 @@ impl<'a, C, A> PurchaseMethods<'a, C, A> { PurchaseVoidedpurchaseListCall { hub: self.hub, _package_name: package_name.to_string(), + _type_: Default::default(), _token: Default::default(), _start_time: Default::default(), _start_index: Default::default(), @@ -2058,6 +2305,130 @@ impl<'a, C, A> PurchaseMethods<'a, C, A> { +/// A builder providing access to all methods supported on *systemapk* resources. +/// It is not used directly, but through the `AndroidPublisher` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_androidpublisher3 as androidpublisher3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use androidpublisher3::AndroidPublisher; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `variants_create(...)`, `variants_download(...)`, `variants_get(...)` and `variants_list(...)` +/// // to build up your call. +/// let rb = hub.systemapks(); +/// # } +/// ``` +pub struct SystemapkMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, +} + +impl<'a, C, A> MethodsBuilder for SystemapkMethods<'a, C, A> {} + +impl<'a, C, A> SystemapkMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates a new variant of APK which is suitable for inclusion in a system image. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `packageName` - Unique identifier for the Android app; for example, "com.spiffygame". + /// * `versionCode` - The version code of the App Bundle. + pub fn variants_create(&self, request: SystemApkVariantsCreateRequest, package_name: &str, version_code: &str) -> SystemapkVariantCreateCall<'a, C, A> { + SystemapkVariantCreateCall { + hub: self.hub, + _request: request, + _package_name: package_name.to_string(), + _version_code: version_code.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of previously created system APK variants. + /// + /// # Arguments + /// + /// * `packageName` - Unique identifier for the Android app; for example, "com.spiffygame". + /// * `versionCode` - The version code of the App Bundle. + pub fn variants_list(&self, package_name: &str, version_code: &str) -> SystemapkVariantListCall<'a, C, A> { + SystemapkVariantListCall { + hub: self.hub, + _package_name: package_name.to_string(), + _version_code: version_code.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Download a previously created APK which is suitable for inclusion in a system image. + /// + /// # Arguments + /// + /// * `packageName` - Unique identifier for the Android app; for example, "com.spiffygame". + /// * `versionCode` - The version code of the App Bundle. + /// * `variantId` - No description provided. + pub fn variants_download(&self, package_name: &str, version_code: &str, variant_id: u32) -> SystemapkVariantDownloadCall<'a, C, A> { + SystemapkVariantDownloadCall { + hub: self.hub, + _package_name: package_name.to_string(), + _version_code: version_code.to_string(), + _variant_id: variant_id, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns a previously created system APK variant. + /// + /// # Arguments + /// + /// * `packageName` - Unique identifier for the Android app; for example, "com.spiffygame". + /// * `versionCode` - The version code of the App Bundle. + /// * `variantId` - Unique identifier for this variant. + pub fn variants_get(&self, package_name: &str, version_code: &str, variant_id: u32) -> SystemapkVariantGetCall<'a, C, A> { + SystemapkVariantGetCall { + hub: self.hub, + _package_name: package_name.to_string(), + _version_code: version_code.to_string(), + _variant_id: variant_id, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *review* resources. /// It is not used directly, but through the `AndroidPublisher` hub. /// @@ -3199,13 +3570,13 @@ impl<'a, C, A> InternalappsharingartifactMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. + /// Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. /// /// # Arguments /// /// * `packageName` - Unique identifier for the Android app; for example, "com.spiffygame". - pub fn uploadbundle(&self, package_name: &str) -> InternalappsharingartifactUploadbundleCall<'a, C, A> { - InternalappsharingartifactUploadbundleCall { + pub fn uploadapk(&self, package_name: &str) -> InternalappsharingartifactUploadapkCall<'a, C, A> { + InternalappsharingartifactUploadapkCall { hub: self.hub, _package_name: package_name.to_string(), _delegate: Default::default(), @@ -3216,13 +3587,13 @@ impl<'a, C, A> InternalappsharingartifactMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. + /// Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. /// /// # Arguments /// /// * `packageName` - Unique identifier for the Android app; for example, "com.spiffygame". - pub fn uploadapk(&self, package_name: &str) -> InternalappsharingartifactUploadapkCall<'a, C, A> { - InternalappsharingartifactUploadapkCall { + pub fn uploadbundle(&self, package_name: &str) -> InternalappsharingartifactUploadbundleCall<'a, C, A> { + InternalappsharingartifactUploadbundleCall { hub: self.hub, _package_name: package_name.to_string(), _delegate: Default::default(), @@ -4049,10 +4420,11 @@ impl<'a, C, A> PurchaseSubscriptionGetCall<'a, C, A> where C: BorrowMut hub: &'a AndroidPublisher, _package_name: String, + _type_: Option, _token: Option, _start_time: Option, _start_index: Option, @@ -4088,8 +4461,11 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(8 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); params.push(("packageName", self._package_name.to_string())); + if let Some(value) = self._type_ { + params.push(("type", value.to_string())); + } if let Some(value) = self._token { params.push(("token", value.to_string())); } @@ -4105,7 +4481,7 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { + self._type_ = Some(new_value); + self + } /// /// Sets the *token* query property to the given value. pub fn token(mut self, new_value: &str) -> PurchaseVoidedpurchaseListCall<'a, C, A> { self._token = Some(new_value.to_string()); self } - /// The time, in milliseconds since the Epoch, of the oldest voided in-app product purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + /// The time, in milliseconds since the Epoch, of the oldest voided purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. /// /// Sets the *start time* query property to the given value. pub fn start_time(mut self, new_value: &str) -> PurchaseVoidedpurchaseListCall<'a, C, A> { @@ -4252,7 +4637,7 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { @@ -5687,6 +6072,1060 @@ impl<'a, C, A> PurchaseSubscriptionDeferCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SystemApkVariantsCreateRequest::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.systemapks().variants_create(req, "packageName", "versionCode") +/// .doit(); +/// # } +/// ``` +pub struct SystemapkVariantCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, + _request: SystemApkVariantsCreateRequest, + _package_name: String, + _version_code: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SystemapkVariantCreateCall<'a, C, A> {} + +impl<'a, C, A> SystemapkVariantCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Variant)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidpublisher.systemapks.variants.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("packageName", self._package_name.to_string())); + params.push(("versionCode", self._version_code.to_string())); + for &field in ["alt", "packageName", "versionCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{packageName}/systemApks/{versionCode}/variants"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{packageName}", "packageName"), ("{versionCode}", "versionCode")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["versionCode", "packageName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SystemApkVariantsCreateRequest) -> SystemapkVariantCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Unique identifier for the Android app; for example, "com.spiffygame". + /// + /// Sets the *package name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn package_name(mut self, new_value: &str) -> SystemapkVariantCreateCall<'a, C, A> { + self._package_name = new_value.to_string(); + self + } + /// The version code of the App Bundle. + /// + /// Sets the *version code* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn version_code(mut self, new_value: &str) -> SystemapkVariantCreateCall<'a, C, A> { + self._version_code = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SystemapkVariantCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SystemapkVariantCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SystemapkVariantCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of previously created system APK variants. +/// +/// A builder for the *variants.list* method supported by a *systemapk* resource. +/// It is not used directly, but through a `SystemapkMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidpublisher3 as androidpublisher3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidpublisher3::AndroidPublisher; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.systemapks().variants_list("packageName", "versionCode") +/// .doit(); +/// # } +/// ``` +pub struct SystemapkVariantListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, + _package_name: String, + _version_code: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SystemapkVariantListCall<'a, C, A> {} + +impl<'a, C, A> SystemapkVariantListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SystemApkVariantsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidpublisher.systemapks.variants.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("packageName", self._package_name.to_string())); + params.push(("versionCode", self._version_code.to_string())); + for &field in ["alt", "packageName", "versionCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{packageName}/systemApks/{versionCode}/variants"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{packageName}", "packageName"), ("{versionCode}", "versionCode")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["versionCode", "packageName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Unique identifier for the Android app; for example, "com.spiffygame". + /// + /// Sets the *package name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn package_name(mut self, new_value: &str) -> SystemapkVariantListCall<'a, C, A> { + self._package_name = new_value.to_string(); + self + } + /// The version code of the App Bundle. + /// + /// Sets the *version code* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn version_code(mut self, new_value: &str) -> SystemapkVariantListCall<'a, C, A> { + self._version_code = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SystemapkVariantListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SystemapkVariantListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SystemapkVariantListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Download a previously created APK which is suitable for inclusion in a system image. +/// +/// This method supports **media download**. To enable it, adjust the builder like this: +/// `.param("alt", "media")`. +/// +/// A builder for the *variants.download* method supported by a *systemapk* resource. +/// It is not used directly, but through a `SystemapkMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidpublisher3 as androidpublisher3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidpublisher3::AndroidPublisher; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.systemapks().variants_download("packageName", "versionCode", 28) +/// .doit(); +/// # } +/// ``` +pub struct SystemapkVariantDownloadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, + _package_name: String, + _version_code: String, + _variant_id: u32, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SystemapkVariantDownloadCall<'a, C, A> {} + +impl<'a, C, A> SystemapkVariantDownloadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidpublisher.systemapks.variants.download", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("packageName", self._package_name.to_string())); + params.push(("versionCode", self._version_code.to_string())); + params.push(("variantId", self._variant_id.to_string())); + for &field in ["packageName", "versionCode", "variantId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "{packageName}/systemApks/{versionCode}/variants/{variantId}:download"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{packageName}", "packageName"), ("{versionCode}", "versionCode"), ("{variantId}", "variantId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["variantId", "versionCode", "packageName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Unique identifier for the Android app; for example, "com.spiffygame". + /// + /// Sets the *package name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn package_name(mut self, new_value: &str) -> SystemapkVariantDownloadCall<'a, C, A> { + self._package_name = new_value.to_string(); + self + } + /// The version code of the App Bundle. + /// + /// Sets the *version code* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn version_code(mut self, new_value: &str) -> SystemapkVariantDownloadCall<'a, C, A> { + self._version_code = new_value.to_string(); + self + } + /// + /// Sets the *variant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_id(mut self, new_value: u32) -> SystemapkVariantDownloadCall<'a, C, A> { + self._variant_id = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SystemapkVariantDownloadCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SystemapkVariantDownloadCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SystemapkVariantDownloadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns a previously created system APK variant. +/// +/// A builder for the *variants.get* method supported by a *systemapk* resource. +/// It is not used directly, but through a `SystemapkMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidpublisher3 as androidpublisher3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidpublisher3::AndroidPublisher; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.systemapks().variants_get("packageName", "versionCode", 80) +/// .doit(); +/// # } +/// ``` +pub struct SystemapkVariantGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, + _package_name: String, + _version_code: String, + _variant_id: u32, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SystemapkVariantGetCall<'a, C, A> {} + +impl<'a, C, A> SystemapkVariantGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Variant)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidpublisher.systemapks.variants.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("packageName", self._package_name.to_string())); + params.push(("versionCode", self._version_code.to_string())); + params.push(("variantId", self._variant_id.to_string())); + for &field in ["alt", "packageName", "versionCode", "variantId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{packageName}/systemApks/{versionCode}/variants/{variantId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{packageName}", "packageName"), ("{versionCode}", "versionCode"), ("{variantId}", "variantId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["variantId", "versionCode", "packageName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Unique identifier for the Android app; for example, "com.spiffygame". + /// + /// Sets the *package name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn package_name(mut self, new_value: &str) -> SystemapkVariantGetCall<'a, C, A> { + self._package_name = new_value.to_string(); + self + } + /// The version code of the App Bundle. + /// + /// Sets the *version code* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn version_code(mut self, new_value: &str) -> SystemapkVariantGetCall<'a, C, A> { + self._version_code = new_value.to_string(); + self + } + /// Unique identifier for this variant. + /// + /// Sets the *variant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn variant_id(mut self, new_value: u32) -> SystemapkVariantGetCall<'a, C, A> { + self._variant_id = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SystemapkVariantGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SystemapkVariantGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SystemapkVariantGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Reply to a single review, or update an existing reply. /// /// A builder for the *reply* method supported by a *review* resource. @@ -5997,7 +7436,7 @@ impl<'a, C, A> ReviewReplyCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.reviews().get("packageName", "reviewId") -/// .translation_language("dolore") +/// .translation_language("et") /// .doit(); /// # } /// ``` @@ -6259,10 +7698,10 @@ impl<'a, C, A> ReviewGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.reviews().list("packageName") -/// .translation_language("aliquyam") -/// .token("accusam") -/// .start_index(45) -/// .max_results(92) +/// .translation_language("et") +/// .token("consetetur") +/// .start_index(65) +/// .max_results(85) /// .doit(); /// # } /// ``` @@ -6543,7 +7982,7 @@ impl<'a, C, A> ReviewListCall<'a, C, A> where C: BorrowMut, A: oa /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.edits().deobfuscationfiles_upload("packageName", "editId", -21, "deobfuscationFileType") +/// let result = hub.edits().deobfuscationfiles_upload("packageName", "editId", -48, "deobfuscationFileType") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -7316,7 +8755,7 @@ impl<'a, C, A> EditImageUploadCall<'a, C, A> where C: BorrowMut, /// // 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.edits().expansionfiles_update(req, "packageName", "editId", -16, "expansionFileType") +/// let result = hub.edits().expansionfiles_update(req, "packageName", "editId", -20, "expansionFileType") /// .doit(); /// # } /// ``` @@ -8945,7 +10384,7 @@ impl<'a, C, A> EditTrackGetCall<'a, C, A> where C: BorrowMut, A: /// // 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.edits().expansionfiles_patch(req, "packageName", "editId", -66, "expansionFileType") +/// let result = hub.edits().expansionfiles_patch(req, "packageName", "editId", -17, "expansionFileType") /// .doit(); /// # } /// ``` @@ -12003,7 +13442,7 @@ impl<'a, C, A> EditDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.edits().expansionfiles_upload("packageName", "editId", -85, "expansionFileType") +/// let result = hub.edits().expansionfiles_upload("packageName", "editId", -69, "expansionFileType") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -14222,7 +15661,7 @@ impl<'a, C, A> EditValidateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.edits().bundles_upload("packageName", "editId") -/// .ack_bundle_installation_warning(true) +/// .ack_bundle_installation_warning(false) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -14888,7 +16327,7 @@ impl<'a, C, A> EditListingUpdateCall<'a, C, A> where C: BorrowMut /// // 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.edits().expansionfiles_get("packageName", "editId", -87, "expansionFileType") +/// let result = hub.edits().expansionfiles_get("packageName", "editId", -41, "expansionFileType") /// .doit(); /// # } /// ``` @@ -16569,7 +18008,7 @@ impl<'a, C, A> EditTesterUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.inappproducts().update(req, "packageName", "sku") -/// .auto_convert_missing_prices(false) +/// .auto_convert_missing_prices(true) /// .doit(); /// # } /// ``` @@ -16858,9 +18297,9 @@ impl<'a, C, A> InappproductUpdateCall<'a, C, A> where C: BorrowMut InappproductPatchCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.orders().refund("packageName", "orderId") -/// .revoke(false) +/// .revoke(true) /// .doit(); /// # } /// ``` @@ -18426,355 +19865,6 @@ impl<'a, C, A> OrderRefundCall<'a, C, A> where C: BorrowMut, A: o } -/// Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. -/// -/// A builder for the *uploadbundle* method supported by a *internalappsharingartifact* resource. -/// It is not used directly, but through a `InternalappsharingartifactMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidpublisher3 as androidpublisher3; -/// use std::fs; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidpublisher3::AndroidPublisher; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `upload_resumable(...)`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.internalappsharingartifacts().uploadbundle("packageName") -/// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); -/// # } -/// ``` -pub struct InternalappsharingartifactUploadbundleCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidPublisher, - _package_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InternalappsharingartifactUploadbundleCall<'a, C, A> {} - -impl<'a, C, A> InternalappsharingartifactUploadbundleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - fn doit(mut self, mut reader: RS, reader_mime_type: mime::Mime, protocol: &'static str) -> Result<(hyper::client::Response, InternalAppSharingArtifact)> - where RS: ReadSeek { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidpublisher.internalappsharingartifacts.uploadbundle", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("packageName", self._package_name.to_string())); - for &field in ["alt", "packageName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let (mut url, upload_type) = - if protocol == "simple" { - (self.hub._root_url.clone() + "upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", "multipart") - } else if protocol == "resumable" { - (self.hub._root_url.clone() + "resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", "resumable") - } else { - unreachable!() - }; - params.push(("uploadType", upload_type.to_string())); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{packageName}", "packageName")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["packageName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - let mut should_ask_dlg_for_url = false; - let mut upload_url_from_server; - let mut upload_url: Option = None; - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - if should_ask_dlg_for_url && (upload_url = dlg.upload_url()) == () && upload_url.is_some() { - should_ask_dlg_for_url = false; - upload_url_from_server = false; - let url = upload_url.as_ref().and_then(|s| Some(hyper::Url::parse(s).unwrap())).unwrap(); - hyper::client::Response::new(url, Box::new(cmn::DummyNetworkStream)).and_then(|mut res| { - res.status = hyper::status::StatusCode::Ok; - res.headers.set(Location(upload_url.as_ref().unwrap().clone())); - Ok(res) - }) - } else { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - if protocol == "simple" { - let size = reader.seek(io::SeekFrom::End(0)).unwrap(); - reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 2147483648 { - return Err(Error::UploadSizeLimitExceeded(size, 2147483648)) - } - req = req.header(ContentType(reader_mime_type.clone())) - .header(ContentLength(size)) - .body(&mut reader); - } - upload_url_from_server = true; - if protocol == "resumable" { - req = req.header(cmn::XUploadContentType(reader_mime_type.clone())); - } - - dlg.pre_request(); - req.send() - } - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - if protocol == "resumable" { - let size = reader.seek(io::SeekFrom::End(0)).unwrap(); - reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 2147483648 { - return Err(Error::UploadSizeLimitExceeded(size, 2147483648)) - } - let mut client = &mut *self.hub.client.borrow_mut(); - let upload_result = { - let url_str = &res.headers.get::().expect("Location header is part of protocol").0; - if upload_url_from_server { - dlg.store_upload_url(Some(url_str)); - } - - cmn::ResumableUploadHelper { - client: &mut client.borrow_mut(), - delegate: dlg, - start_at: if upload_url_from_server { Some(0) } else { None }, - auth: &mut *self.hub.auth.borrow_mut(), - user_agent: &self.hub._user_agent, - auth_header: auth_header.clone(), - url: url_str, - reader: &mut reader, - media_type: reader_mime_type.clone(), - content_length: size - }.upload() - }; - match upload_result { - None => { - dlg.finished(false); - return Err(Error::Cancelled) - } - Some(Err(err)) => { - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Some(Ok(upload_result)) => { - res = upload_result; - if !res.status.is_success() { - dlg.store_upload_url(None); - dlg.finished(false); - return Err(Error::Failure(res)) - } - } - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - /// Upload media all at once. - /// If the upload fails for whichever reason, all progress is lost. - /// - /// * *max size*: 2GB - /// * *multipart*: yes - /// * *valid mime types*: 'application/octet-stream' - pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, InternalAppSharingArtifact)> - where RS: ReadSeek { - self.doit(stream, mime_type, "simple") - } - /// Upload media in a resumable fashion. - /// Even if the upload fails or is interrupted, it can be resumed for a - /// certain amount of time as the server maintains state temporarily. - /// - /// The delegate will be asked for an `upload_url()`, and if not provided, will be asked to store an upload URL - /// that was provided by the server, using `store_upload_url(...)`. The upload will be done in chunks, the delegate - /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using - /// `cancel_chunk_upload(...)`. - /// - /// * *max size*: 2GB - /// * *multipart*: yes - /// * *valid mime types*: 'application/octet-stream' - pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, InternalAppSharingArtifact)> - where RS: ReadSeek { - self.doit(resumeable_stream, mime_type, "resumable") - } - - /// Unique identifier for the Android app; for example, "com.spiffygame". - /// - /// Sets the *package name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn package_name(mut self, new_value: &str) -> InternalappsharingartifactUploadbundleCall<'a, C, A> { - self._package_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InternalappsharingartifactUploadbundleCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InternalappsharingartifactUploadbundleCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InternalappsharingartifactUploadbundleCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. /// /// A builder for the *uploadapk* method supported by a *internalappsharingartifact* resource. @@ -19124,3 +20214,352 @@ impl<'a, C, A> InternalappsharingartifactUploadapkCall<'a, C, A> where C: Borrow } +/// Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java. +/// +/// A builder for the *uploadbundle* method supported by a *internalappsharingartifact* resource. +/// It is not used directly, but through a `InternalappsharingartifactMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidpublisher3 as androidpublisher3; +/// use std::fs; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidpublisher3::AndroidPublisher; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = AndroidPublisher::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `upload_resumable(...)`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.internalappsharingartifacts().uploadbundle("packageName") +/// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +/// # } +/// ``` +pub struct InternalappsharingartifactUploadbundleCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidPublisher, + _package_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InternalappsharingartifactUploadbundleCall<'a, C, A> {} + +impl<'a, C, A> InternalappsharingartifactUploadbundleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + fn doit(mut self, mut reader: RS, reader_mime_type: mime::Mime, protocol: &'static str) -> Result<(hyper::client::Response, InternalAppSharingArtifact)> + where RS: ReadSeek { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidpublisher.internalappsharingartifacts.uploadbundle", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("packageName", self._package_name.to_string())); + for &field in ["alt", "packageName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let (mut url, upload_type) = + if protocol == "simple" { + (self.hub._root_url.clone() + "upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", "multipart") + } else if protocol == "resumable" { + (self.hub._root_url.clone() + "resumable/upload/androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle", "resumable") + } else { + unreachable!() + }; + params.push(("uploadType", upload_type.to_string())); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{packageName}", "packageName")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["packageName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + let mut should_ask_dlg_for_url = false; + let mut upload_url_from_server; + let mut upload_url: Option = None; + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + if should_ask_dlg_for_url && (upload_url = dlg.upload_url()) == () && upload_url.is_some() { + should_ask_dlg_for_url = false; + upload_url_from_server = false; + let url = upload_url.as_ref().and_then(|s| Some(hyper::Url::parse(s).unwrap())).unwrap(); + hyper::client::Response::new(url, Box::new(cmn::DummyNetworkStream)).and_then(|mut res| { + res.status = hyper::status::StatusCode::Ok; + res.headers.set(Location(upload_url.as_ref().unwrap().clone())); + Ok(res) + }) + } else { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + if protocol == "simple" { + let size = reader.seek(io::SeekFrom::End(0)).unwrap(); + reader.seek(io::SeekFrom::Start(0)).unwrap(); + if size > 2147483648 { + return Err(Error::UploadSizeLimitExceeded(size, 2147483648)) + } + req = req.header(ContentType(reader_mime_type.clone())) + .header(ContentLength(size)) + .body(&mut reader); + } + upload_url_from_server = true; + if protocol == "resumable" { + req = req.header(cmn::XUploadContentType(reader_mime_type.clone())); + } + + dlg.pre_request(); + req.send() + } + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + if protocol == "resumable" { + let size = reader.seek(io::SeekFrom::End(0)).unwrap(); + reader.seek(io::SeekFrom::Start(0)).unwrap(); + if size > 2147483648 { + return Err(Error::UploadSizeLimitExceeded(size, 2147483648)) + } + let mut client = &mut *self.hub.client.borrow_mut(); + let upload_result = { + let url_str = &res.headers.get::().expect("Location header is part of protocol").0; + if upload_url_from_server { + dlg.store_upload_url(Some(url_str)); + } + + cmn::ResumableUploadHelper { + client: &mut client.borrow_mut(), + delegate: dlg, + start_at: if upload_url_from_server { Some(0) } else { None }, + auth: &mut *self.hub.auth.borrow_mut(), + user_agent: &self.hub._user_agent, + auth_header: auth_header.clone(), + url: url_str, + reader: &mut reader, + media_type: reader_mime_type.clone(), + content_length: size + }.upload() + }; + match upload_result { + None => { + dlg.finished(false); + return Err(Error::Cancelled) + } + Some(Err(err)) => { + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Some(Ok(upload_result)) => { + res = upload_result; + if !res.status.is_success() { + dlg.store_upload_url(None); + dlg.finished(false); + return Err(Error::Failure(res)) + } + } + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + /// Upload media all at once. + /// If the upload fails for whichever reason, all progress is lost. + /// + /// * *max size*: 2GB + /// * *multipart*: yes + /// * *valid mime types*: 'application/octet-stream' + pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, InternalAppSharingArtifact)> + where RS: ReadSeek { + self.doit(stream, mime_type, "simple") + } + /// Upload media in a resumable fashion. + /// Even if the upload fails or is interrupted, it can be resumed for a + /// certain amount of time as the server maintains state temporarily. + /// + /// The delegate will be asked for an `upload_url()`, and if not provided, will be asked to store an upload URL + /// that was provided by the server, using `store_upload_url(...)`. The upload will be done in chunks, the delegate + /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using + /// `cancel_chunk_upload(...)`. + /// + /// * *max size*: 2GB + /// * *multipart*: yes + /// * *valid mime types*: 'application/octet-stream' + pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, InternalAppSharingArtifact)> + where RS: ReadSeek { + self.doit(resumeable_stream, mime_type, "resumable") + } + + /// Unique identifier for the Android app; for example, "com.spiffygame". + /// + /// Sets the *package name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn package_name(mut self, new_value: &str) -> InternalappsharingartifactUploadbundleCall<'a, C, A> { + self._package_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InternalappsharingartifactUploadbundleCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InternalappsharingartifactUploadbundleCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InternalappsharingartifactUploadbundleCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/appengine1-cli/Cargo.toml b/gen/appengine1-cli/Cargo.toml index 9821d0da2d..5ee2f73a72 100644 --- a/gen/appengine1-cli/Cargo.toml +++ b/gen/appengine1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appengine1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-appengine1] path = "../appengine1" -version = "1.0.12+20190624" +version = "1.0.13+20200403" diff --git a/gen/appengine1-cli/README.md b/gen/appengine1-cli/README.md index be1dbd1ff9..a41f253618 100644 --- a/gen/appengine1-cli/README.md +++ b/gen/appengine1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appengine* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *appengine* API at revision *20200403*. The CLI is at version *1.0.13*. ```bash appengine1 [options] diff --git a/gen/appengine1-cli/mkdocs.yml b/gen/appengine1-cli/mkdocs.yml index 24acd8da18..a00eaf9c35 100644 --- a/gen/appengine1-cli/mkdocs.yml +++ b/gen/appengine1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.12+20190624 +site_name: appengine v1.0.13+20200403 site_url: http://byron.github.io/google-apis-rs/google-appengine1-cli site_description: A complete library to interact with appengine (protocol v1) diff --git a/gen/appengine1-cli/src/main.rs b/gen/appengine1-cli/src/main.rs index dbcd9022b5..e6def5556d 100644 --- a/gen/appengine1-cli/src/main.rs +++ b/gen/appengine1-cli/src/main.rs @@ -3998,7 +3998,7 @@ fn main() { Some(false)), ]), ("services-versions-instances-delete", - Some(r##"Stops a running instance."##), + Some(r##"Stops a running instance.The instance might be automatically recreated based on the scaling settings of the version. For more information, see "How Instances are Managed" (standard environment (https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | flexible environment (https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).To ensure that instances are not re-created and avoid getting billed, you can stop all instances within the target version by changing the serving status of the version to STOPPED with the apps.services.versions.patch (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) method."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_services-versions-instances-delete", vec![ (Some(r##"apps-id"##), @@ -4198,7 +4198,7 @@ fn main() { let mut app = App::new("appengine1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200403") .about("Provisions and manages developers' App Engine applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appengine1_cli") .arg(Arg::with_name("url") diff --git a/gen/appengine1/Cargo.toml b/gen/appengine1/Cargo.toml index 723310a935..7421da43b3 100644 --- a/gen/appengine1/Cargo.toml +++ b/gen/appengine1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1" -version = "1.0.12+20190624" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1" homepage = "https://cloud.google.com/appengine/docs/admin-api/" -documentation = "https://docs.rs/google-appengine1/1.0.12+20190624" +documentation = "https://docs.rs/google-appengine1/1.0.13+20200403" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/appengine1/README.md b/gen/appengine1/README.md index e6bf46b1d4..c20486f715 100644 --- a/gen/appengine1/README.md +++ b/gen/appengine1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appengine1` library allows access to all features of the *Google appengine* service. -This documentation was generated from *appengine* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *appengine* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *appengine* *v1* API can be found at the [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.Appengine.html) ... * apps - * [*authorized certificates create*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppAuthorizedCertificateCreateCall.html), [*authorized certificates delete*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppAuthorizedCertificateDeleteCall.html), [*authorized certificates get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppAuthorizedCertificateGetCall.html), [*authorized certificates list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppAuthorizedCertificateListCall.html), [*authorized certificates patch*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppAuthorizedCertificatePatchCall.html), [*authorized domains list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppAuthorizedDomainListCall.html), [*create*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppCreateCall.html), [*domain mappings create*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppDomainMappingCreateCall.html), [*domain mappings delete*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppDomainMappingDeleteCall.html), [*domain mappings get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppDomainMappingGetCall.html), [*domain mappings list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppDomainMappingListCall.html), [*domain mappings patch*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppDomainMappingPatchCall.html), [*firewall ingress rules batch update*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppFirewallIngressRuleBatchUpdateCall.html), [*firewall ingress rules create*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppFirewallIngressRuleCreateCall.html), [*firewall ingress rules delete*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppFirewallIngressRuleDeleteCall.html), [*firewall ingress rules get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppFirewallIngressRuleGetCall.html), [*firewall ingress rules list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppFirewallIngressRuleListCall.html), [*firewall ingress rules patch*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppFirewallIngressRulePatchCall.html), [*get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppPatchCall.html), [*repair*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppRepairCall.html), [*services delete*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.AppServiceVersionPatchCall.html) + * [*authorized certificates create*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppAuthorizedCertificateCreateCall.html), [*authorized certificates delete*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppAuthorizedCertificateDeleteCall.html), [*authorized certificates get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppAuthorizedCertificateGetCall.html), [*authorized certificates list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppAuthorizedCertificateListCall.html), [*authorized certificates patch*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppAuthorizedCertificatePatchCall.html), [*authorized domains list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppAuthorizedDomainListCall.html), [*create*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppCreateCall.html), [*domain mappings create*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppDomainMappingCreateCall.html), [*domain mappings delete*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppDomainMappingDeleteCall.html), [*domain mappings get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppDomainMappingGetCall.html), [*domain mappings list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppDomainMappingListCall.html), [*domain mappings patch*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppDomainMappingPatchCall.html), [*firewall ingress rules batch update*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppFirewallIngressRuleBatchUpdateCall.html), [*firewall ingress rules create*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppFirewallIngressRuleCreateCall.html), [*firewall ingress rules delete*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppFirewallIngressRuleDeleteCall.html), [*firewall ingress rules get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppFirewallIngressRuleGetCall.html), [*firewall ingress rules list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppFirewallIngressRuleListCall.html), [*firewall ingress rules patch*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppFirewallIngressRulePatchCall.html), [*get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppPatchCall.html), [*repair*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppRepairCall.html), [*services delete*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.AppServiceVersionPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/struct.Appengine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -143,17 +143,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -163,29 +163,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-appengine1/1.0.12+20190624/google_appengine1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1/1.0.13+20200403/google_appengine1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appengine1/src/lib.rs b/gen/appengine1/src/lib.rs index 2a5b2b2960..79b44d79d1 100644 --- a/gen/appengine1/src/lib.rs +++ b/gen/appengine1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *appengine* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *appengine* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *appengine* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -350,7 +350,7 @@ impl<'a, C, A> Appengine Appengine { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://appengine.googleapis.com/".to_string(), _root_url: "https://appengine.googleapis.com/".to_string(), } @@ -361,7 +361,7 @@ impl<'a, C, A> Appengine } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -2271,7 +2271,7 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Stops a running instance. + /// Stops a running instance.The instance might be automatically recreated based on the scaling settings of the version. For more information, see "How Instances are Managed" (standard environment (https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) | flexible environment (https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).To ensure that instances are not re-created and avoid getting billed, you can stop all instances within the target version by changing the serving status of the version to STOPPED with the apps.services.versions.patch (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch) method. /// /// # Arguments /// @@ -7165,7 +7165,7 @@ impl<'a, C, A> AppAuthorizedCertificateListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with appengine (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-appengine1_beta4] path = "../appengine1_beta4" -version = "1.0.12+20181005" +version = "1.0.13+20181005" diff --git a/gen/appengine1_beta4-cli/README.md b/gen/appengine1_beta4-cli/README.md index 050c1d712f..e18ef3c433 100644 --- a/gen/appengine1_beta4-cli/README.md +++ b/gen/appengine1_beta4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appengine* API at revision *20181005*. The CLI is at version *1.0.12*. +This documentation was generated from the *appengine* API at revision *20181005*. The CLI is at version *1.0.13*. ```bash appengine1-beta4 [options] diff --git a/gen/appengine1_beta4-cli/mkdocs.yml b/gen/appengine1_beta4-cli/mkdocs.yml index 5e16cbd089..251457d3a8 100644 --- a/gen/appengine1_beta4-cli/mkdocs.yml +++ b/gen/appengine1_beta4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.12+20181005 +site_name: appengine v1.0.13+20181005 site_url: http://byron.github.io/google-apis-rs/google-appengine1_beta4-cli site_description: A complete library to interact with appengine (protocol v1beta4) diff --git a/gen/appengine1_beta4-cli/src/main.rs b/gen/appengine1_beta4-cli/src/main.rs index fc44ce6558..b0ef86e07e 100644 --- a/gen/appengine1_beta4-cli/src/main.rs +++ b/gen/appengine1_beta4-cli/src/main.rs @@ -2285,7 +2285,7 @@ fn main() { let mut app = App::new("appengine1-beta4") .author("Sebastian Thiel ") - .version("1.0.12+20181005") + .version("1.0.13+20181005") .about("The App Engine Admin API enables developers to provision and manage their App Engine applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appengine1_beta4_cli") .arg(Arg::with_name("url") diff --git a/gen/appengine1_beta4/Cargo.toml b/gen/appengine1_beta4/Cargo.toml index 24c766b63e..787ba8625b 100644 --- a/gen/appengine1_beta4/Cargo.toml +++ b/gen/appengine1_beta4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1_beta4" -version = "1.0.12+20181005" +version = "1.0.13+20181005" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta4" homepage = "https://cloud.google.com/appengine/docs/admin-api/" -documentation = "https://docs.rs/google-appengine1_beta4/1.0.12+20181005" +documentation = "https://docs.rs/google-appengine1_beta4/1.0.13+20181005" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/appengine1_beta4/README.md b/gen/appengine1_beta4/README.md index c4a9471c1d..03aab4f57f 100644 --- a/gen/appengine1_beta4/README.md +++ b/gen/appengine1_beta4/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appengine1_beta4` library allows access to all features of the *Google appengine* service. -This documentation was generated from *appengine* crate version *1.0.12+20181005*, where *20181005* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *appengine* crate version *1.0.13+20181005*, where *20181005* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *appengine* *v1_beta4* API can be found at the [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppLocationListCall.html), [*modules delete*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleDeleteCall.html), [*modules get*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleGetCall.html), [*modules list*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleListCall.html), [*modules patch*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModulePatchCall.html), [*modules versions create*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionCreateCall.html), [*modules versions delete*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionDeleteCall.html), [*modules versions get*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionGetCall.html), [*modules versions instances debug*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceDebugCall.html), [*modules versions instances delete*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceDeleteCall.html), [*modules versions instances get*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceGetCall.html), [*modules versions instances list*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceListCall.html), [*modules versions list*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionListCall.html), [*modules versions patch*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppModuleVersionPatchCall.html), [*operations get*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppOperationListCall.html) and [*patch*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.AppPatchCall.html) + * [*create*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppLocationListCall.html), [*modules delete*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleDeleteCall.html), [*modules get*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleGetCall.html), [*modules list*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleListCall.html), [*modules patch*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModulePatchCall.html), [*modules versions create*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionCreateCall.html), [*modules versions delete*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionDeleteCall.html), [*modules versions get*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionGetCall.html), [*modules versions instances debug*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceDebugCall.html), [*modules versions instances delete*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceDeleteCall.html), [*modules versions instances get*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceGetCall.html), [*modules versions instances list*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionInstanceListCall.html), [*modules versions list*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionListCall.html), [*modules versions patch*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppModuleVersionPatchCall.html), [*operations get*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppOperationListCall.html) and [*patch*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.AppPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/struct.Appengine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -141,17 +141,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -161,29 +161,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-appengine1_beta4/1.0.12+20181005/google_appengine1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta4/1.0.13+20181005/google_appengine1_beta4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appengine1_beta4/src/lib.rs b/gen/appengine1_beta4/src/lib.rs index b205f85af1..3715e0582d 100644 --- a/gen/appengine1_beta4/src/lib.rs +++ b/gen/appengine1_beta4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *appengine* crate version *1.0.12+20181005*, where *20181005* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *appengine* crate version *1.0.13+20181005*, where *20181005* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *appengine* *v1_beta4* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -350,7 +350,7 @@ impl<'a, C, A> Appengine Appengine { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://appengine.googleapis.com/".to_string(), _root_url: "https://appengine.googleapis.com/".to_string(), } @@ -361,7 +361,7 @@ impl<'a, C, A> Appengine } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/appengine1_beta5-cli/Cargo.toml b/gen/appengine1_beta5-cli/Cargo.toml index 6447720e84..f087660177 100644 --- a/gen/appengine1_beta5-cli/Cargo.toml +++ b/gen/appengine1_beta5-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appengine1_beta5-cli" -version = "1.0.12+20181005" +version = "1.0.13+20181005" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1beta5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta5-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-appengine1_beta5] path = "../appengine1_beta5" -version = "1.0.12+20181005" +version = "1.0.13+20181005" diff --git a/gen/appengine1_beta5-cli/README.md b/gen/appengine1_beta5-cli/README.md index acabd7fff3..9d11a33494 100644 --- a/gen/appengine1_beta5-cli/README.md +++ b/gen/appengine1_beta5-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appengine* API at revision *20181005*. The CLI is at version *1.0.12*. +This documentation was generated from the *appengine* API at revision *20181005*. The CLI is at version *1.0.13*. ```bash appengine1-beta5 [options] diff --git a/gen/appengine1_beta5-cli/mkdocs.yml b/gen/appengine1_beta5-cli/mkdocs.yml index b60a9090e4..9d781ddf4d 100644 --- a/gen/appengine1_beta5-cli/mkdocs.yml +++ b/gen/appengine1_beta5-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.12+20181005 +site_name: appengine v1.0.13+20181005 site_url: http://byron.github.io/google-apis-rs/google-appengine1_beta5-cli site_description: A complete library to interact with appengine (protocol v1beta5) diff --git a/gen/appengine1_beta5-cli/src/main.rs b/gen/appengine1_beta5-cli/src/main.rs index 78b6871156..cbc07f40c8 100644 --- a/gen/appengine1_beta5-cli/src/main.rs +++ b/gen/appengine1_beta5-cli/src/main.rs @@ -2289,7 +2289,7 @@ fn main() { let mut app = App::new("appengine1-beta5") .author("Sebastian Thiel ") - .version("1.0.12+20181005") + .version("1.0.13+20181005") .about("The App Engine Admin API enables developers to provision and manage their App Engine applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appengine1_beta5_cli") .arg(Arg::with_name("url") diff --git a/gen/appengine1_beta5/Cargo.toml b/gen/appengine1_beta5/Cargo.toml index b3b26899da..44811eebc7 100644 --- a/gen/appengine1_beta5/Cargo.toml +++ b/gen/appengine1_beta5/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1_beta5" -version = "1.0.12+20181005" +version = "1.0.13+20181005" authors = ["Sebastian Thiel "] description = "A complete library to interact with appengine (protocol v1beta5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta5" homepage = "https://cloud.google.com/appengine/docs/admin-api/" -documentation = "https://docs.rs/google-appengine1_beta5/1.0.12+20181005" +documentation = "https://docs.rs/google-appengine1_beta5/1.0.13+20181005" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/appengine1_beta5/README.md b/gen/appengine1_beta5/README.md index 06e176a0aa..64b72e181f 100644 --- a/gen/appengine1_beta5/README.md +++ b/gen/appengine1_beta5/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appengine1_beta5` library allows access to all features of the *Google appengine* service. -This documentation was generated from *appengine* crate version *1.0.12+20181005*, where *20181005* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *appengine* crate version *1.0.13+20181005*, where *20181005* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *appengine* *v1_beta5* API can be found at the [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppPatchCall.html), [*services delete*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.AppServiceVersionPatchCall.html) + * [*create*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppPatchCall.html), [*services delete*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.AppServiceVersionPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/struct.Appengine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-appengine1_beta5/1.0.12+20181005/google_appengine1_beta5/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta5/1.0.13+20181005/google_appengine1_beta5/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appengine1_beta5/src/lib.rs b/gen/appengine1_beta5/src/lib.rs index daeacda54b..30288c4a98 100644 --- a/gen/appengine1_beta5/src/lib.rs +++ b/gen/appengine1_beta5/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *appengine* crate version *1.0.12+20181005*, where *20181005* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *appengine* crate version *1.0.13+20181005*, where *20181005* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *appengine* *v1_beta5* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -346,7 +346,7 @@ impl<'a, C, A> Appengine Appengine { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://appengine.googleapis.com/".to_string(), _root_url: "https://appengine.googleapis.com/".to_string(), } @@ -357,7 +357,7 @@ impl<'a, C, A> Appengine } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/appsactivity1-cli/Cargo.toml b/gen/appsactivity1-cli/Cargo.toml index 4723954530..bc090fcdbd 100644 --- a/gen/appsactivity1-cli/Cargo.toml +++ b/gen/appsactivity1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appsactivity1-cli" -version = "1.0.12+20190701" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-appsactivity1] path = "../appsactivity1" -version = "1.0.12+20190701" +version = "1.0.13+20200405" diff --git a/gen/appsactivity1-cli/README.md b/gen/appsactivity1-cli/README.md index b0c6ef4b8a..922e746b13 100644 --- a/gen/appsactivity1-cli/README.md +++ b/gen/appsactivity1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *appsactivity* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *appsactivity* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash appsactivity1 [options] diff --git a/gen/appsactivity1-cli/mkdocs.yml b/gen/appsactivity1-cli/mkdocs.yml index c7e5ab1c0c..514ebe5033 100644 --- a/gen/appsactivity1-cli/mkdocs.yml +++ b/gen/appsactivity1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appsactivity v1.0.12+20190701 +site_name: appsactivity v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-appsactivity1-cli site_description: A complete library to interact with appsactivity (protocol v1) diff --git a/gen/appsactivity1-cli/src/main.rs b/gen/appsactivity1-cli/src/main.rs index e84e551b2e..f116f5e4f0 100644 --- a/gen/appsactivity1-cli/src/main.rs +++ b/gen/appsactivity1-cli/src/main.rs @@ -241,7 +241,7 @@ fn main() { let mut app = App::new("appsactivity1") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200405") .about("Provides a historical view of activity.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appsactivity1_cli") .arg(Arg::with_name("url") diff --git a/gen/appsactivity1/Cargo.toml b/gen/appsactivity1/Cargo.toml index f15801d527..dfedaf4edb 100644 --- a/gen/appsactivity1/Cargo.toml +++ b/gen/appsactivity1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appsactivity1" -version = "1.0.12+20190701" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1" homepage = "https://developers.google.com/google-apps/activity/" -documentation = "https://docs.rs/google-appsactivity1/1.0.12+20190701" +documentation = "https://docs.rs/google-appsactivity1/1.0.13+20200405" license = "MIT" keywords = ["appsactivity", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/appsactivity1/README.md b/gen/appsactivity1/README.md index 1f988d7ad4..0cc6d18791 100644 --- a/gen/appsactivity1/README.md +++ b/gen/appsactivity1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appsactivity1` library allows access to all features of the *Google appsactivity* service. -This documentation was generated from *appsactivity* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *appsactivity* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *appsactivity* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/activity/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/struct.Appsactivity.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/struct.Appsactivity.html) ... -* [activities](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/struct.Activity.html) - * [*list*](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/struct.ActivityListCall.html) +* [activities](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/struct.Activity.html) + * [*list*](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/struct.ActivityListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/struct.Appsactivity.html)** +* **[Hub](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/struct.Appsactivity.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-appsactivity1/1.0.12+20190701/google_appsactivity1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appsactivity1/1.0.13+20200405/google_appsactivity1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appsactivity1/src/lib.rs b/gen/appsactivity1/src/lib.rs index fcc5b80f02..4569391a00 100644 --- a/gen/appsactivity1/src/lib.rs +++ b/gen/appsactivity1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *appsactivity* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *appsactivity* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *appsactivity* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/activity/). @@ -331,7 +331,7 @@ impl<'a, C, A> Appsactivity Appsactivity { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/appsactivity/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -342,7 +342,7 @@ impl<'a, C, A> Appsactivity } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/appstate1-cli/Cargo.toml b/gen/appstate1-cli/Cargo.toml index e682e17ab1..632f7931b7 100644 --- a/gen/appstate1-cli/Cargo.toml +++ b/gen/appstate1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-appstate1-cli" -version = "1.0.12+20190627" +version = "1.0.13+20190627" authors = ["Sebastian Thiel "] description = "A complete library to interact with App State (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-appstate1] path = "../appstate1" -version = "1.0.12+20190627" +version = "1.0.13+20190627" diff --git a/gen/appstate1-cli/README.md b/gen/appstate1-cli/README.md index 6580191e45..8e47f0341f 100644 --- a/gen/appstate1-cli/README.md +++ b/gen/appstate1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *App State* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *App State* API at revision *20190627*. The CLI is at version *1.0.13*. ```bash appstate1 [options] diff --git a/gen/appstate1-cli/mkdocs.yml b/gen/appstate1-cli/mkdocs.yml index bb93d8e494..e8c04f6a3d 100644 --- a/gen/appstate1-cli/mkdocs.yml +++ b/gen/appstate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: App State v1.0.12+20190627 +site_name: App State v1.0.13+20190627 site_url: http://byron.github.io/google-apis-rs/google-appstate1-cli site_description: A complete library to interact with App State (protocol v1) diff --git a/gen/appstate1-cli/src/main.rs b/gen/appstate1-cli/src/main.rs index c1fb37e4ad..9b9746518c 100644 --- a/gen/appstate1-cli/src/main.rs +++ b/gen/appstate1-cli/src/main.rs @@ -569,7 +569,7 @@ fn main() { let mut app = App::new("appstate1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20190627") .about("The Google App State API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_appstate1_cli") .arg(Arg::with_name("url") diff --git a/gen/appstate1/Cargo.toml b/gen/appstate1/Cargo.toml index 77156ddc21..7e6b4bd1a1 100644 --- a/gen/appstate1/Cargo.toml +++ b/gen/appstate1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appstate1" -version = "1.0.12+20190627" +version = "1.0.13+20190627" authors = ["Sebastian Thiel "] description = "A complete library to interact with App State (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appstate1" homepage = "https://developers.google.com/games/services/web/api/states" -documentation = "https://docs.rs/google-appstate1/1.0.12+20190627" +documentation = "https://docs.rs/google-appstate1/1.0.13+20190627" license = "MIT" keywords = ["appstate", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/appstate1/README.md b/gen/appstate1/README.md index eebdb052ce..aa9d4e95eb 100644 --- a/gen/appstate1/README.md +++ b/gen/appstate1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-appstate1` library allows access to all features of the *Google App State* service. -This documentation was generated from *App State* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *App State* crate version *1.0.13+20190627*, where *20190627* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *App State* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/web/api/states). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/struct.AppState.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/struct.AppState.html) ... * states - * [*clear*](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/struct.StateClearCall.html), [*delete*](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/struct.StateDeleteCall.html), [*get*](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/struct.StateGetCall.html), [*list*](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/struct.StateListCall.html) and [*update*](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/struct.StateUpdateCall.html) + * [*clear*](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/struct.StateClearCall.html), [*delete*](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/struct.StateDeleteCall.html), [*get*](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/struct.StateGetCall.html), [*list*](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/struct.StateListCall.html) and [*update*](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/struct.StateUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/struct.AppState.html)** +* **[Hub](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/struct.AppState.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-appstate1/1.0.12+20190627/google_appstate1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appstate1/1.0.13+20190627/google_appstate1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/appstate1/src/lib.rs b/gen/appstate1/src/lib.rs index e6cd23c0b0..a94dbf4bb4 100644 --- a/gen/appstate1/src/lib.rs +++ b/gen/appstate1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *App State* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *App State* crate version *1.0.13+20190627*, where *20190627* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *App State* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/web/api/states). @@ -332,7 +332,7 @@ impl<'a, C, A> AppState AppState { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/appstate/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -343,7 +343,7 @@ impl<'a, C, A> AppState } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/autoscaler1_beta2-cli/Cargo.toml b/gen/autoscaler1_beta2-cli/Cargo.toml index 91fc2a9fe0..d002a892ad 100644 --- a/gen/autoscaler1_beta2-cli/Cargo.toml +++ b/gen/autoscaler1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-autoscaler1_beta2-cli" -version = "1.0.12+20150629" +version = "1.0.13+20150629" authors = ["Sebastian Thiel "] description = "A complete library to interact with autoscaler (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-autoscaler1_beta2] path = "../autoscaler1_beta2" -version = "1.0.12+20150629" +version = "1.0.13+20150629" diff --git a/gen/autoscaler1_beta2-cli/README.md b/gen/autoscaler1_beta2-cli/README.md index 14fd622406..f7a4d6f0b5 100644 --- a/gen/autoscaler1_beta2-cli/README.md +++ b/gen/autoscaler1_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *autoscaler* API at revision *20150629*. The CLI is at version *1.0.12*. +This documentation was generated from the *autoscaler* API at revision *20150629*. The CLI is at version *1.0.13*. ```bash autoscaler1-beta2 [options] diff --git a/gen/autoscaler1_beta2-cli/mkdocs.yml b/gen/autoscaler1_beta2-cli/mkdocs.yml index 7b48f45f56..18875d72c2 100644 --- a/gen/autoscaler1_beta2-cli/mkdocs.yml +++ b/gen/autoscaler1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: autoscaler v1.0.12+20150629 +site_name: autoscaler v1.0.13+20150629 site_url: http://byron.github.io/google-apis-rs/google-autoscaler1_beta2-cli site_description: A complete library to interact with autoscaler (protocol v1beta2) diff --git a/gen/autoscaler1_beta2-cli/src/main.rs b/gen/autoscaler1_beta2-cli/src/main.rs index 726e7b164b..681521eb73 100644 --- a/gen/autoscaler1_beta2-cli/src/main.rs +++ b/gen/autoscaler1_beta2-cli/src/main.rs @@ -1196,7 +1196,7 @@ fn main() { let mut app = App::new("autoscaler1-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20150629") + .version("1.0.13+20150629") .about("The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_autoscaler1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/autoscaler1_beta2/Cargo.toml b/gen/autoscaler1_beta2/Cargo.toml index b6eab44259..a495e00222 100644 --- a/gen/autoscaler1_beta2/Cargo.toml +++ b/gen/autoscaler1_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-autoscaler1_beta2" -version = "1.0.12+20150629" +version = "1.0.13+20150629" authors = ["Sebastian Thiel "] description = "A complete library to interact with autoscaler (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/autoscaler1_beta2" homepage = "http://developers.google.com/compute/docs/autoscaler" -documentation = "https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629" +documentation = "https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629" license = "MIT" keywords = ["autoscaler", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/autoscaler1_beta2/README.md b/gen/autoscaler1_beta2/README.md index b7d7da0aa5..1aa50927ab 100644 --- a/gen/autoscaler1_beta2/README.md +++ b/gen/autoscaler1_beta2/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-autoscaler1_beta2` library allows access to all features of the *Google autoscaler* service. -This documentation was generated from *autoscaler* crate version *1.0.12+20150629*, where *20150629* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *autoscaler* crate version *1.0.13+20150629*, where *20150629* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *autoscaler* *v1_beta2* API can be found at the [official documentation site](http://developers.google.com/compute/docs/autoscaler). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerHub.html) ... -* [autoscalers](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.Autoscaler.html) - * [*delete*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerDeleteCall.html), [*get*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerGetCall.html), [*insert*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerInsertCall.html), [*list*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerListCall.html), [*patch*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerPatchCall.html) and [*update*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerUpdateCall.html) +* [autoscalers](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.Autoscaler.html) + * [*delete*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerDeleteCall.html), [*get*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerGetCall.html), [*insert*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerInsertCall.html), [*list*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerListCall.html), [*patch*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerPatchCall.html) and [*update*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerUpdateCall.html) * zone operations - * [*delete*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.ZoneOperationDeleteCall.html), [*get*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.ZoneOperationListCall.html) -* [zones](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.Zone.html) - * [*list*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.ZoneListCall.html) + * [*delete*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.ZoneOperationDeleteCall.html), [*get*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.ZoneOperationListCall.html) +* [zones](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.Zone.html) + * [*list*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.ZoneListCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/struct.AutoscalerHub.html)** +* **[Hub](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/struct.AutoscalerHub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-autoscaler1_beta2/1.0.12+20150629/google_autoscaler1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-autoscaler1_beta2/1.0.13+20150629/google_autoscaler1_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/autoscaler1_beta2/src/lib.rs b/gen/autoscaler1_beta2/src/lib.rs index 780856b7d2..c6923482d0 100644 --- a/gen/autoscaler1_beta2/src/lib.rs +++ b/gen/autoscaler1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *autoscaler* crate version *1.0.12+20150629*, where *20150629* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *autoscaler* crate version *1.0.13+20150629*, where *20150629* is the exact revision of the *autoscaler:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *autoscaler* *v1_beta2* API can be found at the //! [official documentation site](http://developers.google.com/compute/docs/autoscaler). @@ -336,7 +336,7 @@ impl<'a, C, A> AutoscalerHub AutoscalerHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/autoscaler/v1beta2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -353,7 +353,7 @@ impl<'a, C, A> AutoscalerHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/bigquery2-cli/Cargo.toml b/gen/bigquery2-cli/Cargo.toml index 9a913e6d4a..53a24b5cb0 100644 --- a/gen/bigquery2-cli/Cargo.toml +++ b/gen/bigquery2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquery2-cli" -version = "1.0.12+20190630" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with bigquery (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-bigquery2] path = "../bigquery2" -version = "1.0.12+20190630" +version = "1.0.13+20200330" diff --git a/gen/bigquery2-cli/README.md b/gen/bigquery2-cli/README.md index 3ac84bc573..3a15577f52 100644 --- a/gen/bigquery2-cli/README.md +++ b/gen/bigquery2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *bigquery* API at revision *20190630*. The CLI is at version *1.0.12*. +This documentation was generated from the *bigquery* API at revision *20200330*. The CLI is at version *1.0.13*. ```bash bigquery2 [options] diff --git a/gen/bigquery2-cli/mkdocs.yml b/gen/bigquery2-cli/mkdocs.yml index bbb984a2e8..bfed686ca5 100644 --- a/gen/bigquery2-cli/mkdocs.yml +++ b/gen/bigquery2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: bigquery v1.0.12+20190630 +site_name: bigquery v1.0.13+20200330 site_url: http://byron.github.io/google-apis-rs/google-bigquery2-cli site_description: A complete library to interact with bigquery (protocol v2) diff --git a/gen/bigquery2-cli/src/main.rs b/gen/bigquery2-cli/src/main.rs index 74c7e29ffb..a2715ac13e 100644 --- a/gen/bigquery2-cli/src/main.rs +++ b/gen/bigquery2-cli/src/main.rs @@ -724,18 +724,24 @@ impl<'n> Engine<'n> { "statistics.load.output-bytes" => Some(("statistics.load.outputBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.parent-job-id" => Some(("statistics.parentJobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.start-time" => Some(("statistics.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "statistics.total-slot-ms" => Some(("statistics.totalSlotMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.row-level-security-statistics.row-level-security-applied" => Some(("statistics.rowLevelSecurityStatistics.rowLevelSecurityApplied", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "statistics.completion-ratio" => Some(("statistics.completionRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "statistics.reservation-id" => Some(("statistics.reservation_id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.total-slot-ms" => Some(("statistics.totalSlotMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.creation-time" => Some(("statistics.creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.total-bytes-processed" => Some(("statistics.totalBytesProcessed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.script-statistics.evaluation-kind" => Some(("statistics.scriptStatistics.evaluationKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.quota-deferments" => Some(("statistics.quotaDeferments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "statistics.num-child-jobs" => Some(("statistics.numChildJobs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "statistics.query.total-slot-ms" => Some(("statistics.query.totalSlotMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.ddl-target-row-access-policy.project-id" => Some(("statistics.query.ddlTargetRowAccessPolicy.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.ddl-target-row-access-policy.table-id" => Some(("statistics.query.ddlTargetRowAccessPolicy.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.ddl-target-row-access-policy.policy-id" => Some(("statistics.query.ddlTargetRowAccessPolicy.policyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.ddl-target-row-access-policy.dataset-id" => Some(("statistics.query.ddlTargetRowAccessPolicy.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.estimated-bytes-processed" => Some(("statistics.query.estimatedBytesProcessed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.model-training-expected-total-iteration" => Some(("statistics.query.modelTrainingExpectedTotalIteration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.statement-type" => Some(("statistics.query.statementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.total-bytes-billed" => Some(("statistics.query.totalBytesBilled", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.total-slot-ms" => Some(("statistics.query.totalSlotMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.total-partitions-processed" => Some(("statistics.query.totalPartitionsProcessed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.total-bytes-processed" => Some(("statistics.query.totalBytesProcessed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.total-bytes-processed-accuracy" => Some(("statistics.query.totalBytesProcessedAccuracy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -751,6 +757,7 @@ impl<'n> Engine<'n> { "statistics.query.ddl-target-table.project-id" => Some(("statistics.query.ddlTargetTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.ddl-target-table.table-id" => Some(("statistics.query.ddlTargetTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.query.ddl-target-table.dataset-id" => Some(("statistics.query.ddlTargetTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "statistics.query.ddl-affected-row-access-policy-count" => Some(("statistics.query.ddlAffectedRowAccessPolicyCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "statistics.query.num-dml-affected-rows" => Some(("statistics.query.numDmlAffectedRows", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.end-time" => Some(("statistics.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.extract.destination-uri-file-counts" => Some(("statistics.extract.destinationUriFileCounts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -839,10 +846,14 @@ impl<'n> Engine<'n> { "configuration.copy.source-table.table-id" => Some(("configuration.copy.sourceTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.copy.source-table.dataset-id" => Some(("configuration.copy.sourceTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.extract.destination-uri" => Some(("configuration.extract.destinationUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.extract.use-avro-logical-types" => Some(("configuration.extract.useAvroLogicalTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "configuration.extract.compression" => Some(("configuration.extract.compression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.extract.field-delimiter" => Some(("configuration.extract.fieldDelimiter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.extract.destination-format" => Some(("configuration.extract.destinationFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.extract.print-header" => Some(("configuration.extract.printHeader", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "configuration.extract.source-model.project-id" => Some(("configuration.extract.sourceModel.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.extract.source-model.dataset-id" => Some(("configuration.extract.sourceModel.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "configuration.extract.source-model.model-id" => Some(("configuration.extract.sourceModel.modelId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.extract.destination-uris" => Some(("configuration.extract.destinationUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "configuration.extract.source-table.project-id" => Some(("configuration.extract.sourceTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "configuration.extract.source-table.table-id" => Some(("configuration.extract.sourceTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -851,7 +862,7 @@ impl<'n> Engine<'n> { "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-large-results", "allow-quoted-newlines", "autodetect", "bad-records", "billing-tier", "cache-hit", "clustering", "completion-ratio", "compression", "configuration", "copy", "create-disposition", "creation-time", "current-iteration", "dataset-id", "ddl-operation-performed", "ddl-target-routine", "ddl-target-table", "debug-info", "default-dataset", "description", "destination-encryption-configuration", "destination-format", "destination-table", "destination-table-properties", "destination-uri", "destination-uri-file-counts", "destination-uris", "dry-run", "encoding", "end", "end-time", "error-result", "estimated-bytes-processed", "etag", "expected-total-iterations", "expiration-ms", "extract", "field", "field-delimiter", "fields", "flatten-results", "friendly-name", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "input-bytes", "input-file-bytes", "input-files", "interval", "job-id", "job-reference", "job-timeout-ms", "job-type", "kind", "kms-key-name", "labels", "load", "location", "max-bad-records", "maximum-billing-tier", "maximum-bytes-billed", "message", "mode", "model-training", "model-training-current-iteration", "model-training-expected-total-iteration", "null-marker", "num-child-jobs", "num-dml-affected-rows", "output-bytes", "output-rows", "parameter-mode", "parent-job-id", "preserve-nulls", "print-header", "priority", "project-id", "projection-fields", "query", "quota-deferments", "quote", "range", "range-partitioning", "reason", "require-partition-filter", "reservation-id", "routine-id", "schema-inline", "schema-inline-format", "schema-update-options", "self-link", "skip-leading-rows", "source-format", "source-table", "source-uri-prefix", "source-uris", "start", "start-time", "state", "statement-type", "statistics", "status", "table-id", "time-partitioning", "total-bytes-billed", "total-bytes-processed", "total-bytes-processed-accuracy", "total-partitions-processed", "total-slot-ms", "type", "use-avro-logical-types", "use-legacy-sql", "use-query-cache", "user-email", "write-disposition"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-large-results", "allow-quoted-newlines", "autodetect", "bad-records", "billing-tier", "cache-hit", "clustering", "completion-ratio", "compression", "configuration", "copy", "create-disposition", "creation-time", "current-iteration", "dataset-id", "ddl-affected-row-access-policy-count", "ddl-operation-performed", "ddl-target-routine", "ddl-target-row-access-policy", "ddl-target-table", "debug-info", "default-dataset", "description", "destination-encryption-configuration", "destination-format", "destination-table", "destination-table-properties", "destination-uri", "destination-uri-file-counts", "destination-uris", "dry-run", "encoding", "end", "end-time", "error-result", "estimated-bytes-processed", "etag", "evaluation-kind", "expected-total-iterations", "expiration-ms", "extract", "field", "field-delimiter", "fields", "flatten-results", "friendly-name", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "input-bytes", "input-file-bytes", "input-files", "interval", "job-id", "job-reference", "job-timeout-ms", "job-type", "kind", "kms-key-name", "labels", "load", "location", "max-bad-records", "maximum-billing-tier", "maximum-bytes-billed", "message", "mode", "model-id", "model-training", "model-training-current-iteration", "model-training-expected-total-iteration", "null-marker", "num-child-jobs", "num-dml-affected-rows", "output-bytes", "output-rows", "parameter-mode", "parent-job-id", "policy-id", "preserve-nulls", "print-header", "priority", "project-id", "projection-fields", "query", "quota-deferments", "quote", "range", "range-partitioning", "reason", "require-partition-filter", "reservation-id", "routine-id", "row-level-security-applied", "row-level-security-statistics", "schema-inline", "schema-inline-format", "schema-update-options", "script-statistics", "self-link", "skip-leading-rows", "source-format", "source-model", "source-table", "source-uri-prefix", "source-uris", "start", "start-time", "state", "statement-type", "statistics", "status", "table-id", "time-partitioning", "total-bytes-billed", "total-bytes-processed", "total-bytes-processed-accuracy", "total-partitions-processed", "total-slot-ms", "type", "use-avro-logical-types", "use-legacy-sql", "use-query-cache", "user-email", "write-disposition"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -927,6 +938,9 @@ impl<'n> Engine<'n> { "projection" => { call = call.projection(value.unwrap_or("")); }, + "parent-job-id" => { + call = call.parent_job_id(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -955,7 +969,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["projection", "state-filter", "all-users", "max-results", "page-token", "min-creation-time", "max-creation-time"].iter().map(|v|*v)); + v.extend(["parent-job-id", "projection", "state-filter", "all-users", "max-results", "page-token", "min-creation-time", "max-creation-time"].iter().map(|v|*v)); v } )); } } @@ -1270,13 +1284,14 @@ impl<'n> Engine<'n> { "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "model-type" => Some(("modelType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encryption-configuration.kms-key-name" => Some(("encryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "friendly-name" => Some(("friendlyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time" => Some(("expirationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "etag", "expiration-time", "friendly-name", "labels", "last-modified-time", "location", "model-id", "model-reference", "model-type", "project-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "description", "encryption-configuration", "etag", "expiration-time", "friendly-name", "kms-key-name", "labels", "last-modified-time", "location", "model-id", "model-reference", "model-type", "project-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1497,8 +1512,8 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { - "field-mask" => { - call = call.field_mask(value.unwrap_or("")); + "read-mask" => { + call = call.read_mask(value.unwrap_or("")); }, _ => { let mut found = false; @@ -1513,7 +1528,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["field-mask"].iter().map(|v|*v)); + v.extend(["read-mask"].iter().map(|v|*v)); v } )); } } @@ -1571,6 +1586,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "routine-type" => Some(("routineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language" => Some(("language", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "imported-libraries" => Some(("importedLibraries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1582,7 +1598,7 @@ impl<'n> Engine<'n> { "return-type.type-kind" => Some(("returnType.typeKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "definition-body", "etag", "imported-libraries", "language", "last-modified-time", "project-id", "return-type", "routine-id", "routine-reference", "routine-type", "type-kind"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "definition-body", "description", "etag", "imported-libraries", "language", "last-modified-time", "project-id", "return-type", "routine-id", "routine-reference", "routine-type", "type-kind"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1648,12 +1664,18 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "read-mask" => { + call = call.read_mask(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1667,7 +1689,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "max-results"].iter().map(|v|*v)); + v.extend(["filter", "page-token", "read-mask", "max-results"].iter().map(|v|*v)); v } )); } } @@ -1725,6 +1747,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "routine-type" => Some(("routineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language" => Some(("language", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "imported-libraries" => Some(("importedLibraries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1736,7 +1759,7 @@ impl<'n> Engine<'n> { "return-type.type-kind" => Some(("returnType.typeKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modified-time" => Some(("lastModifiedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "definition-body", "etag", "imported-libraries", "language", "last-modified-time", "project-id", "return-type", "routine-id", "routine-reference", "routine-type", "type-kind"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "dataset-id", "definition-body", "description", "etag", "imported-libraries", "language", "last-modified-time", "project-id", "return-type", "routine-id", "routine-reference", "routine-type", "type-kind"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2075,6 +2098,8 @@ impl<'n> Engine<'n> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "materialized-view.last-refresh-time" => Some(("materializedView.lastRefreshTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "materialized-view.enable-refresh" => Some(("materializedView.enableRefresh", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "materialized-view.refresh-interval-ms" => Some(("materializedView.refreshIntervalMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "materialized-view.query" => Some(("materializedView.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.field" => Some(("timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.type" => Some(("timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2132,7 +2157,7 @@ impl<'n> Engine<'n> { "view.query" => Some(("view.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "view.use-legacy-sql" => Some(("view.useLegacySql", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "clustering", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "encryption-configuration", "end", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "fields", "friendly-name", "google-sheets-options", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "interval", "kind", "kms-key-name", "labels", "last-modified-time", "last-refresh-time", "location", "loss-type", "materialized-view", "max-bad-records", "mode", "model", "model-options", "model-type", "num-bytes", "num-long-term-bytes", "num-physical-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "range", "range-partitioning", "read-rowkey-as-string", "require-partition-filter", "self-link", "skip-leading-rows", "source-format", "source-uri-prefix", "source-uris", "start", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "clustering", "compression", "creation-time", "csv-options", "dataset-id", "description", "enable-refresh", "encoding", "encryption-configuration", "end", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "fields", "friendly-name", "google-sheets-options", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "interval", "kind", "kms-key-name", "labels", "last-modified-time", "last-refresh-time", "location", "loss-type", "materialized-view", "max-bad-records", "mode", "model", "model-options", "model-type", "num-bytes", "num-long-term-bytes", "num-physical-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "range", "range-partitioning", "read-rowkey-as-string", "refresh-interval-ms", "require-partition-filter", "self-link", "skip-leading-rows", "source-format", "source-uri-prefix", "source-uris", "start", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2277,6 +2302,8 @@ impl<'n> Engine<'n> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "materialized-view.last-refresh-time" => Some(("materializedView.lastRefreshTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "materialized-view.enable-refresh" => Some(("materializedView.enableRefresh", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "materialized-view.refresh-interval-ms" => Some(("materializedView.refreshIntervalMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "materialized-view.query" => Some(("materializedView.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.field" => Some(("timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.type" => Some(("timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2334,7 +2361,7 @@ impl<'n> Engine<'n> { "view.query" => Some(("view.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "view.use-legacy-sql" => Some(("view.useLegacySql", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "clustering", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "encryption-configuration", "end", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "fields", "friendly-name", "google-sheets-options", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "interval", "kind", "kms-key-name", "labels", "last-modified-time", "last-refresh-time", "location", "loss-type", "materialized-view", "max-bad-records", "mode", "model", "model-options", "model-type", "num-bytes", "num-long-term-bytes", "num-physical-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "range", "range-partitioning", "read-rowkey-as-string", "require-partition-filter", "self-link", "skip-leading-rows", "source-format", "source-uri-prefix", "source-uris", "start", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "clustering", "compression", "creation-time", "csv-options", "dataset-id", "description", "enable-refresh", "encoding", "encryption-configuration", "end", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "fields", "friendly-name", "google-sheets-options", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "interval", "kind", "kms-key-name", "labels", "last-modified-time", "last-refresh-time", "location", "loss-type", "materialized-view", "max-bad-records", "mode", "model", "model-options", "model-type", "num-bytes", "num-long-term-bytes", "num-physical-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "range", "range-partitioning", "read-rowkey-as-string", "refresh-interval-ms", "require-partition-filter", "self-link", "skip-leading-rows", "source-format", "source-uri-prefix", "source-uris", "start", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2420,6 +2447,8 @@ impl<'n> Engine<'n> { "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "materialized-view.last-refresh-time" => Some(("materializedView.lastRefreshTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "materialized-view.enable-refresh" => Some(("materializedView.enableRefresh", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "materialized-view.refresh-interval-ms" => Some(("materializedView.refreshIntervalMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "materialized-view.query" => Some(("materializedView.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.field" => Some(("timePartitioning.field", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-partitioning.type" => Some(("timePartitioning.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2477,7 +2506,7 @@ impl<'n> Engine<'n> { "view.query" => Some(("view.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "view.use-legacy-sql" => Some(("view.useLegacySql", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "clustering", "compression", "creation-time", "csv-options", "dataset-id", "description", "encoding", "encryption-configuration", "end", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "fields", "friendly-name", "google-sheets-options", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "interval", "kind", "kms-key-name", "labels", "last-modified-time", "last-refresh-time", "location", "loss-type", "materialized-view", "max-bad-records", "mode", "model", "model-options", "model-type", "num-bytes", "num-long-term-bytes", "num-physical-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "range", "range-partitioning", "read-rowkey-as-string", "require-partition-filter", "self-link", "skip-leading-rows", "source-format", "source-uri-prefix", "source-uris", "start", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-jagged-rows", "allow-quoted-newlines", "autodetect", "bigtable-options", "clustering", "compression", "creation-time", "csv-options", "dataset-id", "description", "enable-refresh", "encoding", "encryption-configuration", "end", "estimated-bytes", "estimated-rows", "etag", "expiration-ms", "expiration-time", "external-data-configuration", "field", "field-delimiter", "fields", "friendly-name", "google-sheets-options", "hive-partitioning-mode", "hive-partitioning-options", "id", "ignore-unknown-values", "ignore-unspecified-column-families", "interval", "kind", "kms-key-name", "labels", "last-modified-time", "last-refresh-time", "location", "loss-type", "materialized-view", "max-bad-records", "mode", "model", "model-options", "model-type", "num-bytes", "num-long-term-bytes", "num-physical-bytes", "num-rows", "oldest-entry-time", "project-id", "query", "quote", "range", "range-partitioning", "read-rowkey-as-string", "refresh-interval-ms", "require-partition-filter", "self-link", "skip-leading-rows", "source-format", "source-uri-prefix", "source-uris", "start", "streaming-buffer", "table-id", "table-reference", "time-partitioning", "type", "use-legacy-sql", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3123,19 +3152,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the model to delete."##), + Some(r##"Required. Project ID of the model to delete."##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the model to delete."##), + Some(r##"Required. Dataset ID of the model to delete."##), Some(true), Some(false)), (Some(r##"model-id"##), None, - Some(r##"Model ID of the model to delete."##), + Some(r##"Required. Model ID of the model to delete."##), Some(true), Some(false)), @@ -3151,19 +3180,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the requested model."##), + Some(r##"Required. Project ID of the requested model."##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the requested model."##), + Some(r##"Required. Dataset ID of the requested model."##), Some(true), Some(false)), (Some(r##"model-id"##), None, - Some(r##"Model ID of the requested model."##), + Some(r##"Required. Model ID of the requested model."##), Some(true), Some(false)), @@ -3186,13 +3215,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the models to list."##), + Some(r##"Required. Project ID of the models to list."##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the models to list."##), + Some(r##"Required. Dataset ID of the models to list."##), Some(true), Some(false)), @@ -3214,19 +3243,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the model to patch."##), + Some(r##"Required. Project ID of the model to patch."##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the model to patch."##), + Some(r##"Required. Dataset ID of the model to patch."##), Some(true), Some(false)), (Some(r##"model-id"##), None, - Some(r##"Model ID of the model to patch."##), + Some(r##"Required. Model ID of the model to patch."##), Some(true), Some(false)), @@ -3298,19 +3327,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the routine to delete"##), + Some(r##"Required. Project ID of the routine to delete"##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the routine to delete"##), + Some(r##"Required. Dataset ID of the routine to delete"##), Some(true), Some(false)), (Some(r##"routine-id"##), None, - Some(r##"Routine ID of the routine to delete"##), + Some(r##"Required. Routine ID of the routine to delete"##), Some(true), Some(false)), @@ -3326,19 +3355,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the requested routine"##), + Some(r##"Required. Project ID of the requested routine"##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the requested routine"##), + Some(r##"Required. Dataset ID of the requested routine"##), Some(true), Some(false)), (Some(r##"routine-id"##), None, - Some(r##"Routine ID of the requested routine"##), + Some(r##"Required. Routine ID of the requested routine"##), Some(true), Some(false)), @@ -3360,13 +3389,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the new routine"##), + Some(r##"Required. Project ID of the new routine"##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the new routine"##), + Some(r##"Required. Dataset ID of the new routine"##), Some(true), Some(false)), @@ -3395,13 +3424,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the routines to list"##), + Some(r##"Required. Project ID of the routines to list"##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the routines to list"##), + Some(r##"Required. Dataset ID of the routines to list"##), Some(true), Some(false)), @@ -3424,19 +3453,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID of the routine to update"##), + Some(r##"Required. Project ID of the routine to update"##), Some(true), Some(false)), (Some(r##"dataset-id"##), None, - Some(r##"Dataset ID of the routine to update"##), + Some(r##"Required. Dataset ID of the routine to update"##), Some(true), Some(false)), (Some(r##"routine-id"##), None, - Some(r##"Routine ID of the routine to update"##), + Some(r##"Required. Routine ID of the routine to update"##), Some(true), Some(false)), @@ -3748,7 +3777,7 @@ fn main() { let mut app = App::new("bigquery2") .author("Sebastian Thiel ") - .version("1.0.12+20190630") + .version("1.0.13+20200330") .about("A data platform for customers to create, manage, share and query data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_bigquery2_cli") .arg(Arg::with_name("url") diff --git a/gen/bigquery2/Cargo.toml b/gen/bigquery2/Cargo.toml index 341d387c42..32381700be 100644 --- a/gen/bigquery2/Cargo.toml +++ b/gen/bigquery2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-bigquery2" -version = "1.0.12+20190630" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with bigquery (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquery2" homepage = "https://cloud.google.com/bigquery/" -documentation = "https://docs.rs/google-bigquery2/1.0.12+20190630" +documentation = "https://docs.rs/google-bigquery2/1.0.13+20200330" license = "MIT" keywords = ["bigquery", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/bigquery2/README.md b/gen/bigquery2/README.md index 571a172184..1047a82a0e 100644 --- a/gen/bigquery2/README.md +++ b/gen/bigquery2/README.md @@ -5,33 +5,33 @@ DO NOT EDIT ! --> The `google-bigquery2` library allows access to all features of the *Google bigquery* service. -This documentation was generated from *bigquery* crate version *1.0.12+20190630*, where *20190630* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *bigquery* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *bigquery* *v2* API can be found at the [official documentation site](https://cloud.google.com/bigquery/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.Bigquery.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.Bigquery.html) ... -* [datasets](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.Dataset.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.DatasetGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.DatasetInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.DatasetUpdateCall.html) -* [jobs](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.Job.html) - * [*cancel*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.JobCancelCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.JobGetCall.html), [*get query results*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.JobInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.JobListCall.html) and [*query*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.JobQueryCall.html) -* [models](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.Model.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.ModelDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.ModelGetCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.ModelListCall.html) and [*patch*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.ModelPatchCall.html) +* [datasets](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.Dataset.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.DatasetGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.DatasetInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.DatasetUpdateCall.html) +* [jobs](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.Job.html) + * [*cancel*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.JobCancelCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.JobGetCall.html), [*get query results*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.JobInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.JobListCall.html) and [*query*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.JobQueryCall.html) +* [models](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.Model.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.ModelDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.ModelGetCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.ModelListCall.html) and [*patch*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.ModelPatchCall.html) * projects - * [*get service account*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.ProjectGetServiceAccountCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.ProjectListCall.html) -* [routines](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.Routine.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.RoutineDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.RoutineGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.RoutineInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.RoutineListCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.RoutineUpdateCall.html) + * [*get service account*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.ProjectGetServiceAccountCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.ProjectListCall.html) +* [routines](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.Routine.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.RoutineDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.RoutineGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.RoutineInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.RoutineListCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.RoutineUpdateCall.html) * tabledata - * [*insert all*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TabledataInsertAllCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TabledataListCall.html) -* [tables](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.Table.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TableGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TableListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TablePatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.TableUpdateCall.html) + * [*insert all*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TabledataInsertAllCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TabledataListCall.html) +* [tables](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.Table.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TableGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TableListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TablePatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.TableUpdateCall.html) Upload supported by ... -* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.JobInsertCall.html) +* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.JobInsertCall.html) @@ -39,17 +39,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/struct.Bigquery.html)** +* **[Hub](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/struct.Bigquery.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.Part.html)** + * **[Parts](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -151,17 +151,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -171,29 +171,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-bigquery2/1.0.12+20190630/google_bigquery2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-bigquery2/1.0.13+20200330/google_bigquery2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/bigquery2/src/lib.rs b/gen/bigquery2/src/lib.rs index 1e62cdbe92..dc40169e8c 100644 --- a/gen/bigquery2/src/lib.rs +++ b/gen/bigquery2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *bigquery* crate version *1.0.12+20190630*, where *20190630* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *bigquery* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *bigquery* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/bigquery/). @@ -270,6 +270,9 @@ pub enum Scope { /// View and manage your data in Google BigQuery Full, + + /// View your data in Google BigQuery + Readonly, } impl AsRef for Scope { @@ -282,13 +285,14 @@ impl AsRef for Scope { Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::Insertdata => "https://www.googleapis.com/auth/bigquery.insertdata", Scope::Full => "https://www.googleapis.com/auth/bigquery", + Scope::Readonly => "https://www.googleapis.com/auth/bigquery.readonly", } } } impl Default for Scope { fn default() -> Scope { - Scope::Full + Scope::Readonly } } @@ -374,7 +378,7 @@ impl<'a, C, A> Bigquery Bigquery { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://bigquery.googleapis.com/bigquery/v2/".to_string(), _root_url: "https://bigquery.googleapis.com/".to_string(), } @@ -403,7 +407,7 @@ impl<'a, C, A> Bigquery } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -474,8 +478,14 @@ pub struct MaterializedViewDefinition { /// [Output-only] [TrustedTester] The time when this materialized view was last modified, in milliseconds since the epoch. #[serde(rename="lastRefreshTime")] pub last_refresh_time: Option, + /// [Optional] [TrustedTester] Enable automatic refresh of the materialized view when the base table is updated. The default value is "true". + #[serde(rename="enableRefresh")] + pub enable_refresh: Option, /// [Required] A query whose result is persisted. pub query: Option, + /// [Optional] [TrustedTester] The maximum frequency at which this materialized view will be refreshed. The default value is "1800000" (30 minutes). + #[serde(rename="refreshIntervalMs")] + pub refresh_interval_ms: Option, } impl Part for MaterializedViewDefinition {} @@ -487,15 +497,18 @@ impl Part for MaterializedViewDefinition {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobStatistics2 { + /// [Output-only] Total bytes billed for the job. + #[serde(rename="totalBytesBilled")] + pub total_bytes_billed: Option, /// [Output-only, Beta] Information about create model query job progress. #[serde(rename="modelTraining")] pub model_training: Option, - /// [Output-only] Slot-milliseconds for the job. - #[serde(rename="totalSlotMs")] - pub total_slot_ms: Option, + /// [Output-only] [Preview] The DDL target row access policy. Present only for CREATE/DROP ROW ACCESS POLICY queries. + #[serde(rename="ddlTargetRowAccessPolicy")] + pub ddl_target_row_access_policy: Option, /// [Output-only] [Beta] Describes a timeline of job execution. pub timeline: Option>, - /// The type of query statement, if valid. Possible values (new values might be added in the future): "SELECT": SELECT query. "INSERT": INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "UPDATE": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "DELETE": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "MERGE": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "ALTER_TABLE": ALTER TABLE query. "ALTER_VIEW": ALTER VIEW query. "CREATE_FUNCTION": CREATE FUNCTION query. "CREATE_MODEL": CREATE [OR REPLACE] MODEL ... AS SELECT ... . "CREATE_PROCEDURE": CREATE PROCEDURE query. "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT ... . "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... . "DROP_FUNCTION" : DROP FUNCTION query. "DROP_PROCEDURE": DROP PROCEDURE query. "DROP_TABLE": DROP TABLE query. "DROP_VIEW": DROP VIEW query. + /// The type of query statement, if valid. Possible values (new values might be added in the future): "SELECT": SELECT query. "INSERT": INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "UPDATE": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "DELETE": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "MERGE": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "ALTER_TABLE": ALTER TABLE query. "ALTER_VIEW": ALTER VIEW query. "ASSERT": ASSERT condition AS 'description'. "CREATE_FUNCTION": CREATE FUNCTION query. "CREATE_MODEL": CREATE [OR REPLACE] MODEL ... AS SELECT ... . "CREATE_PROCEDURE": CREATE PROCEDURE query. "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT ... . "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... . "DROP_FUNCTION" : DROP FUNCTION query. "DROP_PROCEDURE": DROP PROCEDURE query. "DROP_TABLE": DROP TABLE query. "DROP_VIEW": DROP VIEW query. #[serde(rename="statementType")] pub statement_type: Option, /// [Output-only] Job resource usage breakdown by reservation. @@ -516,9 +529,12 @@ pub struct JobStatistics2 { /// [Output-only, Beta] Deprecated; do not use. #[serde(rename="modelTrainingCurrentIteration")] pub model_training_current_iteration: Option, - /// The DDL target table. Present only for CREATE/DROP TABLE/VIEW queries. + /// [Output-only] The DDL target table. Present only for CREATE/DROP TABLE/VIEW and DROP ALL ROW ACCESS POLICIES queries. #[serde(rename="ddlTargetTable")] pub ddl_target_table: Option, + /// [Output-only] Billing tier for the job. + #[serde(rename="billingTier")] + pub billing_tier: Option, /// [Output-only, Beta] Deprecated; do not use. #[serde(rename="modelTrainingExpectedTotalIteration")] pub model_training_expected_total_iteration: Option, @@ -531,9 +547,12 @@ pub struct JobStatistics2 { /// [Output-only] Whether the query result was fetched from the query cache. #[serde(rename="cacheHit")] pub cache_hit: Option, - /// [Output-only] Total bytes billed for the job. - #[serde(rename="totalBytesBilled")] - pub total_bytes_billed: Option, + /// [Output-only] Referenced routines (persistent user-defined functions and stored procedures) for the job. + #[serde(rename="referencedRoutines")] + pub referenced_routines: Option>, + /// [Output-only] Slot-milliseconds for the job. + #[serde(rename="totalSlotMs")] + pub total_slot_ms: Option, /// The DDL target routine. Present only for CREATE/DROP FUNCTION/PROCEDURE queries. #[serde(rename="ddlTargetRoutine")] pub ddl_target_routine: Option, @@ -543,9 +562,9 @@ pub struct JobStatistics2 { /// [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. #[serde(rename="numDmlAffectedRows")] pub num_dml_affected_rows: Option, - /// [Output-only] Billing tier for the job. - #[serde(rename="billingTier")] - pub billing_tier: Option, + /// [Output-only] [Preview] The number of row access policies affected by a DDL statement. Present only for DROP ALL ROW ACCESS POLICIES queries. + #[serde(rename="ddlAffectedRowAccessPolicyCount")] + pub ddl_affected_row_access_policy_count: Option, /// [Output-only] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list. #[serde(rename="referencedTables")] pub referenced_tables: Option>, @@ -711,6 +730,9 @@ pub struct QueryRequest { pub timeout_ms: Option, /// The resource type of the request. pub kind: Option, + /// Connection properties. + #[serde(rename="connectionProperties")] + pub connection_properties: Option>, /// [Optional] If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false. #[serde(rename="dryRun")] pub dry_run: Option, @@ -772,6 +794,8 @@ pub struct ClusteringMetrics { /// Mean of squared distances between each sample to its cluster centroid. #[serde(rename="meanSquaredDistance")] pub mean_squared_distance: Option, + /// [Beta] Information for all clusters. + pub clusters: Option>, /// Davies-Bouldin index. #[serde(rename="daviesBouldinIndex")] pub davies_bouldin_index: Option, @@ -806,11 +830,14 @@ impl Part for BigtableOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct IterationResult { + /// no description provided + #[serde(rename="arimaResult")] + pub arima_result: Option, /// Index of the iteration, 0 based. pub index: Option, - /// Learn rate used for this iteration. - #[serde(rename="learnRate")] - pub learn_rate: Option, + /// Information about top clusters for clustering models. + #[serde(rename="clusterInfos")] + pub cluster_infos: Option>, /// Loss computed on the training data at the end of iteration. #[serde(rename="trainingLoss")] pub training_loss: Option, @@ -820,9 +847,9 @@ pub struct IterationResult { /// Time taken to run the iteration in milliseconds. #[serde(rename="durationMs")] pub duration_ms: Option, - /// [Beta] Information about top clusters for clustering models. - #[serde(rename="clusterInfos")] - pub cluster_infos: Option>, + /// Learn rate used for this iteration. + #[serde(rename="learnRate")] + pub learn_rate: Option, } impl Part for IterationResult {} @@ -920,6 +947,9 @@ pub struct ExplainQueryStage { /// Milliseconds the average shard spent waiting to be scheduled. #[serde(rename="waitMsAvg")] pub wait_ms_avg: Option, + /// Slot-milliseconds used by the stage. + #[serde(rename="slotMs")] + pub slot_ms: Option, /// Milliseconds the average shard spent on writing output. #[serde(rename="writeMsAvg")] pub write_ms_avg: Option, @@ -1106,6 +1136,24 @@ impl NestedType for TableFieldSchemaCategories {} impl Part for TableFieldSchemaCategories {} +/// ARIMA model fitting metrics. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ArimaFittingMetrics { + /// variance. + pub variance: Option, + /// log-likelihood + #[serde(rename="logLikelihood")] + pub log_likelihood: Option, + /// AIC + pub aic: Option, +} + +impl Part for ArimaFittingMetrics {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1135,6 +1183,31 @@ pub struct JobConfigurationTableCopy { impl Part for JobConfigurationTableCopy {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list jobs](struct.JobListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct JobList { + /// A token to request the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The resource type of the response. + pub kind: Option, + /// A hash of this page of results. + pub etag: Option, + /// List of jobs that were requested. + pub jobs: Option>, +} + +impl ResponseResult for JobList {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1144,21 +1217,27 @@ pub struct JobConfigurationExtract { /// [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written. #[serde(rename="destinationUri")] pub destination_uri: Option, - /// [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or repeated fields cannot be exported as CSV. + /// [Optional] If destinationFormat is set to "AVRO", this flag indicates whether to enable extracting applicable column types (such as TIMESTAMP) to their corresponding AVRO logical types (timestamp-micros), instead of only using their raw types (avro-long). Not applicable when extracting models. + #[serde(rename="useAvroLogicalTypes")] + pub use_avro_logical_types: Option, + /// [Optional] The compression type to use for exported files. Possible values include GZIP, DEFLATE, SNAPPY, and NONE. The default value is NONE. DEFLATE and SNAPPY are only supported for Avro. Not applicable when extracting models. + pub compression: Option, + /// [Optional] Delimiter to use between fields in the exported data. Default is ','. Not applicable when extracting models. + #[serde(rename="fieldDelimiter")] + pub field_delimiter: Option, + /// [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON or AVRO for tables and ML_TF_SAVED_MODEL or ML_XGBOOST_BOOSTER for models. The default value for tables is CSV. Tables with nested or repeated fields cannot be exported as CSV. The default value for models is ML_TF_SAVED_MODEL. #[serde(rename="destinationFormat")] pub destination_format: Option, - /// [Optional] The compression type to use for exported files. Possible values include GZIP, DEFLATE, SNAPPY, and NONE. The default value is NONE. DEFLATE and SNAPPY are only supported for Avro. - pub compression: Option, + /// [Optional] Whether to print out a header row in the results. Default is true. Not applicable when extracting models. + #[serde(rename="printHeader")] + pub print_header: Option, + /// A reference to the model being exported. + #[serde(rename="sourceModel")] + pub source_model: Option, /// [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written. #[serde(rename="destinationUris")] pub destination_uris: Option>, - /// [Optional] Whether to print out a header row in the results. Default is true. - #[serde(rename="printHeader")] - pub print_header: Option, - /// [Optional] Delimiter to use between fields in the exported data. Default is ',' - #[serde(rename="fieldDelimiter")] - pub field_delimiter: Option, - /// [Required] A reference to the table being exported. + /// A reference to the table being exported. #[serde(rename="sourceTable")] pub source_table: Option, } @@ -1166,7 +1245,8 @@ pub struct JobConfigurationExtract { impl Part for JobConfigurationExtract {} -/// Evaluation metrics for regression models. +/// Evaluation metrics for regression and explicit feedback type matrix +/// factorization models. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1264,6 +1344,68 @@ pub struct BqmlIterationResult { impl Part for BqmlIterationResult {} +/// [Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BqmlTrainingRunTrainingOptions { + /// no description provided + #[serde(rename="learnRateStrategy")] + pub learn_rate_strategy: Option, + /// no description provided + #[serde(rename="l1Reg")] + pub l1_reg: Option, + /// no description provided + #[serde(rename="lineSearchInitLearnRate")] + pub line_search_init_learn_rate: Option, + /// no description provided + #[serde(rename="warmStart")] + pub warm_start: Option, + /// no description provided + #[serde(rename="maxIteration")] + pub max_iteration: Option, + /// no description provided + #[serde(rename="learnRate")] + pub learn_rate: Option, + /// no description provided + #[serde(rename="earlyStop")] + pub early_stop: Option, + /// no description provided + #[serde(rename="minRelProgress")] + pub min_rel_progress: Option, + /// no description provided + #[serde(rename="l2Reg")] + pub l2_reg: Option, +} + +impl NestedType for BqmlTrainingRunTrainingOptions {} +impl Part for BqmlTrainingRunTrainingOptions {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RowAccessPolicyReference { + /// [Required] The ID of the project containing this row access policy. + #[serde(rename="projectId")] + pub project_id: Option, + /// [Required] The ID of the table containing this row access policy. + #[serde(rename="tableId")] + pub table_id: Option, + /// [Required] The ID of the row access policy. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters. + #[serde(rename="policyId")] + pub policy_id: Option, + /// [Required] The ID of the dataset containing this row access policy. + #[serde(rename="datasetId")] + pub dataset_id: Option, +} + +impl Part for RowAccessPolicyReference {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1273,7 +1415,7 @@ pub struct CsvOptions { /// [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. #[serde(rename="allowJaggedRows")] pub allow_jagged_rows: Option, - /// [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped. + /// [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped. When autodetect is on, the behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema. #[serde(rename="skipLeadingRows")] pub skip_leading_rows: Option, /// [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (','). @@ -1291,21 +1433,38 @@ pub struct CsvOptions { impl Part for CsvOptions {} -/// [Output-only] Job resource usage breakdown by reservation. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobStatistics2ReservationUsage { - /// [Output-only] Reservation name or "unreserved" for on-demand resources usage. - pub name: Option, - /// [Output-only] Slot-milliseconds the job spent in the given reservation. - #[serde(rename="slotMs")] - pub slot_ms: Option, +pub struct TableFieldSchemaPolicyTags { + /// A list of category resource names. For example, "projects/1/location/eu/taxonomies/2/policyTags/3". At most 1 policy tag is allowed. + pub names: Option>, } -impl NestedType for JobStatistics2ReservationUsage {} -impl Part for JobStatistics2ReservationUsage {} +impl NestedType for TableFieldSchemaPolicyTags {} +impl Part for TableFieldSchemaPolicyTags {} + + +/// Arima coefficients. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ArimaCoefficients { + /// Moving-average coefficients, an array of double. + #[serde(rename="movingAverageCoefficients")] + pub moving_average_coefficients: Option>, + /// Auto-regressive coefficients, an array of double. + #[serde(rename="autoRegressiveCoefficients")] + pub auto_regressive_coefficients: Option>, + /// Intercept coefficient, just a double not an array. + #[serde(rename="interceptCoefficient")] + pub intercept_coefficient: Option, +} + +impl Part for ArimaCoefficients {} /// There is no detailed description. @@ -1421,6 +1580,81 @@ pub struct StandardSqlDataType { impl Part for StandardSqlDataType {} +/// Arima model information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ArimaModelInfo { + /// Arima coefficients. + #[serde(rename="arimaCoefficients")] + pub arima_coefficients: Option, + /// Arima fitting metrics. + #[serde(rename="arimaFittingMetrics")] + pub arima_fitting_metrics: Option, + /// Non-seasonal order. + #[serde(rename="nonSeasonalOrder")] + pub non_seasonal_order: Option, +} + +impl Part for ArimaModelInfo {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct JobStatistics { + /// [Output-only] Statistics for a load job. + pub load: Option, + /// [Output-only] Number of child jobs executed. + #[serde(rename="numChildJobs")] + pub num_child_jobs: Option, + /// [Output-only] [Preview] Statistics for row-level security. Present only for query and extract jobs. + #[serde(rename="rowLevelSecurityStatistics")] + pub row_level_security_statistics: Option, + /// [TrustedTester] [Output-only] Job progress (0.0 -> 1.0) for LOAD and EXTRACT jobs. + #[serde(rename="completionRatio")] + pub completion_ratio: Option, + /// [Output-only] Job resource usage breakdown by reservation. + #[serde(rename="reservationUsage")] + pub reservation_usage: Option>, + /// [Output-only] [Deprecated] Use the bytes processed in the query statistics instead. + #[serde(rename="totalBytesProcessed")] + pub total_bytes_processed: Option, + /// [Output-only] Quotas which delayed this job's start time. + #[serde(rename="quotaDeferments")] + pub quota_deferments: Option>, + /// [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE. + #[serde(rename="startTime")] + pub start_time: Option, + /// [Output-only] Statistics for a query job. + pub query: Option, + /// [Output-only] Statistics for an extract job. + pub extract: Option, + /// [Output-only] If this is a child job, the id of the parent. + #[serde(rename="parentJobId")] + pub parent_job_id: Option, + /// [Output-only] Name of the primary reservation assigned to this job. Note that this could be different than reservations reported in the reservation usage field if parent reservations were used to execute this job. + pub reservation_id: Option, + /// [Output-only] Slot-milliseconds for the job. + #[serde(rename="totalSlotMs")] + pub total_slot_ms: Option, + /// [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs. + #[serde(rename="creationTime")] + pub creation_time: Option, + /// [Output-only] Statistics for a child job of a script. + #[serde(rename="scriptStatistics")] + pub script_statistics: Option, + /// [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state. + #[serde(rename="endTime")] + pub end_time: Option, +} + +impl Part for JobStatistics {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1487,48 +1721,110 @@ impl RequestValue for TableDataInsertAllRequest {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobStatistics { - /// [Output-only] Statistics for a load job. - pub load: Option, - /// [Output-only] If this is a child job, the id of the parent. - #[serde(rename="parentJobId")] - pub parent_job_id: Option, - /// [Output-only] Number of child jobs executed. - #[serde(rename="numChildJobs")] - pub num_child_jobs: Option, - /// [Output-only] Slot-milliseconds for the job. - #[serde(rename="totalSlotMs")] - pub total_slot_ms: Option, - /// [TrustedTester] [Output-only] Job progress (0.0 -> 1.0) for LOAD and EXTRACT jobs. - #[serde(rename="completionRatio")] - pub completion_ratio: Option, - /// [Output-only] Statistics for an extract job. - pub extract: Option, - /// [Output-only] Job resource usage breakdown by reservation. - #[serde(rename="reservationUsage")] - pub reservation_usage: Option>, - /// [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs. - #[serde(rename="creationTime")] - pub creation_time: Option, - /// [Output-only] [Deprecated] Use the bytes processed in the query statistics instead. - #[serde(rename="totalBytesProcessed")] - pub total_bytes_processed: Option, - /// [Output-only] Quotas which delayed this job's start time. - #[serde(rename="quotaDeferments")] - pub quota_deferments: Option>, - /// [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE. - #[serde(rename="startTime")] - pub start_time: Option, - /// [Output-only] Statistics for a query job. - pub query: Option, - /// [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state. - #[serde(rename="endTime")] - pub end_time: Option, - /// [Output-only] Name of the primary reservation assigned to this job. Note that this could be different than reservations reported in the reservation usage field if parent reservations were used to execute this job. - pub reservation_id: Option, +pub struct JobConfigurationQuery { + /// [Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if this is set to false. For standard SQL queries, this flag is ignored and results are never flattened. + #[serde(rename="flattenResults")] + pub flatten_results: Option, + /// Custom encryption configuration (e.g., Cloud KMS keys). + #[serde(rename="destinationEncryptionConfiguration")] + pub destination_encryption_configuration: Option, + /// [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true. + #[serde(rename="useQueryCache")] + pub use_query_cache: Option, + /// Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. + #[serde(rename="parameterMode")] + pub parameter_mode: Option, + /// Query parameters for standard SQL queries. + #[serde(rename="queryParameters")] + pub query_parameters: Option>, + /// [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. This property must be set for large results that exceed the maximum response size. + #[serde(rename="destinationTable")] + pub destination_table: Option, + /// Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false. + #[serde(rename="useLegacySql")] + pub use_legacy_sql: Option, + /// [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL. + pub query: Option, + /// Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified. + #[serde(rename="timePartitioning")] + pub time_partitioning: Option, + /// Connection properties. + #[serde(rename="connectionProperties")] + pub connection_properties: Option>, + /// [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default. + #[serde(rename="maximumBytesBilled")] + pub maximum_bytes_billed: Option, + /// Describes user-defined function resources used in the query. + #[serde(rename="userDefinedFunctionResources")] + pub user_defined_function_resources: Option>, + /// [Beta] Clustering specification for the destination table. Must be specified with time-based partitioning, data in the table will be first partitioned and subsequently clustered. + pub clustering: Option, + /// [Deprecated] This property is deprecated. + #[serde(rename="preserveNulls")] + pub preserve_nulls: Option, + /// [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default. + #[serde(rename="maximumBillingTier")] + pub maximum_billing_tier: Option, + /// [Optional] Specifies the default dataset to use for unqualified table names in the query. Note that this does not alter behavior of unqualified dataset names. + #[serde(rename="defaultDataset")] + pub default_dataset: Option, + /// [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified. + #[serde(rename="rangePartitioning")] + pub range_partitioning: Option, + /// Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable. + #[serde(rename="schemaUpdateOptions")] + pub schema_update_options: Option>, + /// [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE. + pub priority: Option, + /// [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema from the query result. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion. + #[serde(rename="writeDisposition")] + pub write_disposition: Option, + /// [Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. However, you must still set destinationTable when result size exceeds the allowed maximum response size. + #[serde(rename="allowLargeResults")] + pub allow_large_results: Option, + /// [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + #[serde(rename="createDisposition")] + pub create_disposition: Option, + /// [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. + #[serde(rename="tableDefinitions")] + pub table_definitions: Option>, } -impl Part for JobStatistics {} +impl Part for JobConfigurationQuery {} + + +/// Representative value of a categorical feature. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CategoricalValue { + /// Counts of all categories for the categorical feature. If there are + /// more than ten categories, we return top ten (by count) and return + /// one more CategoryCount with category "_OTHER_" and count as + /// aggregate counts of remaining categories. + #[serde(rename="categoryCounts")] + pub category_counts: Option>, +} + +impl Part for CategoricalValue {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ScriptStatistics { + /// [Output-only] Whether this child job was a statement or expression. + #[serde(rename="evaluationKind")] + pub evaluation_kind: Option, + /// Stack trace showing the line/column/procedure name of each frame on the stack at the point where the current evaluation happened. The leaf frame is first, the primary script is last. Never empty. + #[serde(rename="stackFrames")] + pub stack_frames: Option>, +} + +impl Part for ScriptStatistics {} /// List of jobs that were requested. @@ -1619,68 +1915,23 @@ pub struct TableReference { impl Part for TableReference {} -/// [Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run. +/// Message containing the information about one cluster. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BqmlTrainingRunTrainingOptions { - /// no description provided - #[serde(rename="learnRateStrategy")] - pub learn_rate_strategy: Option, - /// no description provided - #[serde(rename="l1Reg")] - pub l1_reg: Option, - /// no description provided - #[serde(rename="lineSearchInitLearnRate")] - pub line_search_init_learn_rate: Option, - /// no description provided - #[serde(rename="warmStart")] - pub warm_start: Option, - /// no description provided - #[serde(rename="maxIteration")] - pub max_iteration: Option, - /// no description provided - #[serde(rename="learnRate")] - pub learn_rate: Option, - /// no description provided - #[serde(rename="earlyStop")] - pub early_stop: Option, - /// no description provided - #[serde(rename="minRelProgress")] - pub min_rel_progress: Option, - /// no description provided - #[serde(rename="l2Reg")] - pub l2_reg: Option, +pub struct Cluster { + /// Count of training data rows that were assigned to this cluster. + pub count: Option, + /// Centroid id. + #[serde(rename="centroidId")] + pub centroid_id: Option, + /// Values of highly variant features for this cluster. + #[serde(rename="featureValues")] + pub feature_values: Option>, } -impl NestedType for BqmlTrainingRunTrainingOptions {} -impl Part for BqmlTrainingRunTrainingOptions {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list jobs](struct.JobListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobList { - /// A token to request the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The resource type of the response. - pub kind: Option, - /// A hash of this page of results. - pub etag: Option, - /// List of jobs that were requested. - pub jobs: Option>, -} - -impl ResponseResult for JobList {} +impl Part for Cluster {} /// There is no detailed description. @@ -1798,7 +2049,7 @@ impl NestedType for TableDataInsertAllResponseInsertErrors {} impl Part for TableDataInsertAllResponseInsertErrors {} -/// Id path of a model. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1810,9 +2061,7 @@ pub struct ModelReference { /// [Required] The ID of the dataset containing this model. #[serde(rename="datasetId")] pub dataset_id: Option, - /// [Required] The ID of the model. The ID must contain only - /// letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum - /// length is 1,024 characters. + /// [Required] The ID of the model. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters. #[serde(rename="modelId")] pub model_id: Option, } @@ -1820,6 +2069,27 @@ pub struct ModelReference { impl Part for ModelReference {} +/// Representative value of a single feature within the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FeatureValue { + /// The feature column name. + #[serde(rename="featureColumn")] + pub feature_column: Option, + /// The numerical feature value. This is the centroid value for this + /// feature. + #[serde(rename="numericalValue")] + pub numerical_value: Option, + /// The categorical feature value. + #[serde(rename="categoricalValue")] + pub categorical_value: Option, +} + +impl Part for FeatureValue {} + + /// There is no detailed description. /// /// # Activities @@ -1834,9 +2104,10 @@ pub struct ListRoutinesResponse { /// A token to request the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Routines in the requested dataset. Only the following fields are populated: + /// Routines in the requested dataset. Unless read_mask is set in the request, + /// only the following fields are populated: /// etag, project_id, dataset_id, routine_id, routine_type, creation_time, - /// last_modified_time, language. + /// last_modified_time, and language. pub routines: Option>, } @@ -1902,6 +2173,9 @@ pub struct TableFieldSchema { pub fields: Option>, /// [Optional] The field description. The maximum length is 1,024 characters. pub description: Option, + /// no description provided + #[serde(rename="policyTags")] + pub policy_tags: Option, /// [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD). #[serde(rename="type")] pub type_: Option, @@ -1982,7 +2256,7 @@ pub struct JobConfigurationLoad { /// [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_APPEND. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion. #[serde(rename="writeDisposition")] pub write_disposition: Option, - /// [Optional, Trusted Tester] If hive partitioning is enabled, which mode to use. Two modes are supported: - AUTO: automatically infer partition key name(s) and type(s). - STRINGS: automatic infer partition key name(s). All types are strings. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error. + /// [Optional, Trusted Tester] Deprecated, do not use. Please set hivePartitioningOptions instead. #[serde(rename="hivePartitioningMode")] pub hive_partitioning_mode: Option, /// [Optional, Trusted Tester] Options to configure hive partitioning support. @@ -2019,9 +2293,11 @@ impl Part for JobConfigurationLoad {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Routine { - /// Required. + /// Required. The type of routine. #[serde(rename="routineType")] pub routine_type: Option, + /// Optional. [Experimental] The description of the routine if defined. + pub description: Option, /// Optional. Defaults to "SQL". pub language: Option, /// Output only. The time when this routine was created, in milliseconds since @@ -2216,10 +2492,15 @@ impl Part for QueryParameterType {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct EvaluationMetrics { - /// [Beta] Populated for clustering models. + /// Populated for clustering models. #[serde(rename="clusteringMetrics")] pub clustering_metrics: Option, - /// Populated for regression models. + /// [Alpha] Populated for implicit feedback type matrix factorization + /// models. + #[serde(rename="rankingMetrics")] + pub ranking_metrics: Option, + /// Populated for regression models and explicit feedback type matrix + /// factorization models. #[serde(rename="regressionMetrics")] pub regression_metrics: Option, /// Populated for binary classification/classifier models. @@ -2254,6 +2535,20 @@ pub struct ClusterInfo { impl Part for ClusterInfo {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RowLevelSecurityStatistics { + /// [Output-only] [Preview] Whether any accessed data was protected by row access policies. + #[serde(rename="rowLevelSecurityApplied")] + pub row_level_security_applied: Option, +} + +impl Part for RowLevelSecurityStatistics {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2284,11 +2579,14 @@ pub struct TableListTables { pub clustering: Option, /// The resource type. pub kind: Option, - /// The labels associated with this table. You can use these to organize and group your tables. - pub labels: Option>, /// The time when this table was created, in milliseconds since the epoch. #[serde(rename="creationTime")] pub creation_time: Option, + /// The labels associated with this table. You can use these to organize and group your tables. + pub labels: Option>, + /// The range partitioning specification for this table, if configured. + #[serde(rename="rangePartitioning")] + pub range_partitioning: Option, /// An opaque ID of the table pub id: Option, /// The user-friendly name for this table. @@ -2337,6 +2635,42 @@ pub struct TrainingOptions { /// Optimization strategy for training linear regression models. #[serde(rename="optimizationStrategy")] pub optimization_strategy: Option, + /// Item column specified for matrix factorization models. + #[serde(rename="itemColumn")] + pub item_column: Option, + /// User column specified for matrix factorization models. + #[serde(rename="userColumn")] + pub user_column: Option, + /// Num factors specified for matrix factorization models. + #[serde(rename="numFactors")] + pub num_factors: Option, + /// Name of input label columns in training data. + #[serde(rename="inputLabelColumns")] + pub input_label_columns: Option>, + /// Batch size for dnn models. + #[serde(rename="batchSize")] + pub batch_size: Option, + /// Distance type for clustering models. + #[serde(rename="distanceType")] + pub distance_type: Option, + /// The column used to provide the initial centroids for kmeans algorithm + /// when kmeans_initialization_method is CUSTOM. + #[serde(rename="kmeansInitializationColumn")] + pub kmeans_initialization_column: Option, + /// L2 regularization coefficient. + #[serde(rename="l2Regularization")] + pub l2_regularization: Option, + /// Number of clusters for clustering models. + #[serde(rename="numClusters")] + pub num_clusters: Option, + /// When early_stop is true, stops training when accuracy improvement is + /// less than 'min_relative_progress'. Used only for iterative training + /// algorithms. + #[serde(rename="minRelativeProgress")] + pub min_relative_progress: Option, + /// L1 regularization coefficient. + #[serde(rename="l1Regularization")] + pub l1_regularization: Option, /// The maximum number of iterations in training. Used only for iterative /// training algorithms. #[serde(rename="maxIterations")] @@ -2362,18 +2696,24 @@ pub struct TrainingOptions { /// https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties #[serde(rename="dataSplitColumn")] pub data_split_column: Option, - /// [Beta] Number of clusters for clustering models. - #[serde(rename="numClusters")] - pub num_clusters: Option, + /// Dropout probability for dnn models. + pub dropout: Option, /// Whether to train a model from the last checkpoint. #[serde(rename="warmStart")] pub warm_start: Option, - /// Name of input label columns in training data. - #[serde(rename="inputLabelColumns")] - pub input_label_columns: Option>, - /// Type of loss function used during training run. - #[serde(rename="lossType")] - pub loss_type: Option, + /// Hidden units for dnn models. + #[serde(rename="hiddenUnits")] + pub hidden_units: Option>, + /// Maximum depth of a tree for boosted tree models. + #[serde(rename="maxTreeDepth")] + pub max_tree_depth: Option, + /// Feedback type that specifies which algorithm to run for matrix + /// factorization. + #[serde(rename="feedbackType")] + pub feedback_type: Option, + /// The method used to initialize the centroids for kmeans algorithm. + #[serde(rename="kmeansInitializationMethod")] + pub kmeans_initialization_method: Option, /// The strategy to determine learn rate for the current iteration. #[serde(rename="learnRateStrategy")] pub learn_rate_strategy: Option, @@ -2386,31 +2726,30 @@ pub struct TrainingOptions { /// The data split type for training and evaluation, e.g. RANDOM. #[serde(rename="dataSplitMethod")] pub data_split_method: Option, - /// [Beta] Distance type for clustering models. - #[serde(rename="distanceType")] - pub distance_type: Option, + /// Subsample fraction of the training data to grow tree to prevent + /// overfitting for boosted tree models. + pub subsample: Option, /// Weights associated with each label class, for rebalancing the /// training data. Only applicable for classification models. #[serde(rename="labelClassWeights")] pub label_class_weights: Option>, - /// L1 regularization coefficient. - #[serde(rename="l1Regularization")] - pub l1_regularization: Option, - /// L2 regularization coefficient. - #[serde(rename="l2Regularization")] - pub l2_regularization: Option, + /// Learning rate in training. Used only for iterative training algorithms. + #[serde(rename="learnRate")] + pub learn_rate: Option, /// [Beta] Google Cloud Storage URI from which the model was imported. Only /// applicable for imported models. #[serde(rename="modelUri")] pub model_uri: Option, - /// When early_stop is true, stops training when accuracy improvement is - /// less than 'min_relative_progress'. Used only for iterative training - /// algorithms. - #[serde(rename="minRelativeProgress")] - pub min_relative_progress: Option, - /// Learning rate in training. Used only for iterative training algorithms. - #[serde(rename="learnRate")] - pub learn_rate: Option, + /// Hyperparameter for matrix factoration when implicit feedback type is + /// specified. + #[serde(rename="walsAlpha")] + pub wals_alpha: Option, + /// Minimum split loss for boosted tree models. + #[serde(rename="minSplitLoss")] + pub min_split_loss: Option, + /// Type of loss function used during training run. + #[serde(rename="lossType")] + pub loss_type: Option, } impl Part for TrainingOptions {} @@ -2526,6 +2865,43 @@ pub struct BigQueryModelTraining { impl Part for BigQueryModelTraining {} +/// (Auto-)arima fitting result. Wrap everything in ArimaResult for easier +/// refactoring if we want to use model-specific iteration results. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ArimaResult { + /// This message is repeated because there are multiple arima models + /// fitted in auto-arima. For non-auto-arima model, its size is one. + #[serde(rename="arimaModelInfo")] + pub arima_model_info: Option>, + /// Seasonal periods. Repeated because multiple periods are supported for + /// one time series. + #[serde(rename="seasonalPeriods")] + pub seasonal_periods: Option>, +} + +impl Part for ArimaResult {} + + +/// [Output-only] Job resource usage breakdown by reservation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct JobStatistics2ReservationUsage { + /// [Output-only] Reservation name or "unreserved" for on-demand resources usage. + pub name: Option, + /// [Output-only] Slot-milliseconds the job spent in the given reservation. + #[serde(rename="slotMs")] + pub slot_ms: Option, +} + +impl NestedType for JobStatistics2ReservationUsage {} +impl Part for JobStatistics2ReservationUsage {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2561,7 +2937,7 @@ pub struct ExternalDataConfiguration { /// Additional properties to set if sourceFormat is set to CSV. #[serde(rename="csvOptions")] pub csv_options: Option, - /// [Optional, Trusted Tester] If hive partitioning is enabled, which mode to use. Two modes are supported: - AUTO: automatically infer partition key name(s) and type(s). - STRINGS: automatic infer partition key name(s). All types are strings. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error. Note: this setting is in the process of being deprecated in favor of hivePartitioningOptions. + /// [Optional, Trusted Tester] Deprecated, do not use. Please set hivePartitioningOptions instead. #[serde(rename="hivePartitioningMode")] pub hive_partitioning_mode: Option, /// Try to detect schema and format options automatically. Any option specified explicitly will be honored. @@ -2594,6 +2970,37 @@ pub struct ExternalDataConfiguration { impl Part for ExternalDataConfiguration {} +/// Evaluation metrics used by weighted-ALS models specified by +/// feedback_type=implicit. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RankingMetrics { + /// Calculates a precision per user for all the items by ranking them and + /// then averages all the precisions across all the users. + #[serde(rename="meanAveragePrecision")] + pub mean_average_precision: Option, + /// Similar to the mean squared error computed in regression and explicit + /// recommendation models except instead of computing the rating directly, + /// the output from evaluate is computed against a preference which is 1 or 0 + /// depending on if the rating exists or not. + #[serde(rename="meanSquaredError")] + pub mean_squared_error: Option, + /// Determines the goodness of a ranking by computing the percentile rank + /// from the predicted confidence and dividing it by the original rank. + #[serde(rename="averageRank")] + pub average_rank: Option, + /// A metric to determine the goodness of a ranking calculated from the + /// predicted confidence by comparing it to an ideal rank measured by the + /// original ratings. + #[serde(rename="normalizedDiscountedCumulativeGain")] + pub normalized_discounted_cumulative_gain: Option, +} + +impl Part for RankingMetrics {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2627,34 +3034,16 @@ pub struct JobStatus { impl Part for JobStatus {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BqmlTrainingRun { - /// [Output-only, Beta] Different state applicable for a training run. IN PROGRESS: Training run is in progress. FAILED: Training run ended due to a non-retryable failure. SUCCEEDED: Training run successfully completed. CANCELLED: Training run cancelled by the user. - pub state: Option, - /// [Output-only, Beta] List of each iteration results. - #[serde(rename="iterationResults")] - pub iteration_results: Option>, - /// [Output-only, Beta] Training run start time in milliseconds since the epoch. - #[serde(rename="startTime")] - pub start_time: Option, - /// [Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run. - #[serde(rename="trainingOptions")] - pub training_options: Option, -} - -impl Part for BqmlTrainingRun {} - - /// Information about a single training query run for the model. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TrainingRun { + /// Data split result of the training run. Only set when the input data is + /// actually split. + #[serde(rename="dataSplitResult")] + pub data_split_result: Option, /// The evaluation metrics over training/eval data that were computed at the /// end of training. #[serde(rename="evaluationMetrics")] @@ -2723,14 +3112,14 @@ impl Part for JobReference {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Model { - /// [Optional] The labels associated with this model. You can use these to - /// organize and group your models. Label keys and values can be no longer + /// The labels associated with this model. You can use these to organize + /// and group your models. Label keys and values can be no longer /// than 63 characters, can only contain lowercase letters, numeric /// characters, underscores and dashes. International characters are allowed. /// Label values are optional. Label keys must start with a letter and each /// label in the list must have a different key. pub labels: Option>, - /// [Optional] A user-friendly description of this model. + /// Optional. A user-friendly description of this model. pub description: Option, /// Required. Unique identifier for this model. #[serde(rename="modelReference")] @@ -2742,15 +3131,19 @@ pub struct Model { /// The output of the model will have a "predicted_" prefix to these columns. #[serde(rename="labelColumns")] pub label_columns: Option>, - /// Output only. The time when this model was created, in millisecs since the - /// epoch. + /// Output only. The time when this model was created, in millisecs since the epoch. #[serde(rename="creationTime")] pub creation_time: Option, /// Output only. Type of the model resource. #[serde(rename="modelType")] pub model_type: Option, - /// Output only. Information for all training runs in increasing order of - /// start_time. + /// Custom encryption configuration (e.g., Cloud KMS keys). This shows the + /// encryption configuration of the model data while stored in BigQuery + /// storage. This field can be used with PatchModel to update encryption key + /// for an already encrypted model. + #[serde(rename="encryptionConfiguration")] + pub encryption_configuration: Option, + /// Output only. Information for all training runs in increasing order of start_time. #[serde(rename="trainingRuns")] pub training_runs: Option>, /// Output only. A hash of this resource. @@ -2758,18 +3151,17 @@ pub struct Model { /// Output only. The geographic location where the model resides. This value /// is inherited from the dataset. pub location: Option, - /// [Optional] A descriptive name for this model. + /// Optional. A descriptive name for this model. #[serde(rename="friendlyName")] pub friendly_name: Option, - /// [Optional] The time when this model expires, in milliseconds since the - /// epoch. If not present, the model will persist indefinitely. Expired models + /// Optional. The time when this model expires, in milliseconds since the epoch. + /// If not present, the model will persist indefinitely. Expired models /// will be deleted and their storage reclaimed. The defaultTableExpirationMs /// property of the encapsulating dataset can be used to set a default /// expirationTime on newly created models. #[serde(rename="expirationTime")] pub expiration_time: Option, - /// Output only. The time when this model was last modified, in millisecs - /// since the epoch. + /// Output only. The time when this model was last modified, in millisecs since the epoch. #[serde(rename="lastModifiedTime")] pub last_modified_time: Option, } @@ -2856,73 +3248,21 @@ impl ResponseResult for ListModelsResponse {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobConfigurationQuery { - /// [Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if this is set to false. For standard SQL queries, this flag is ignored and results are never flattened. - #[serde(rename="flattenResults")] - pub flatten_results: Option, - /// Custom encryption configuration (e.g., Cloud KMS keys). - #[serde(rename="destinationEncryptionConfiguration")] - pub destination_encryption_configuration: Option, - /// [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true. - #[serde(rename="useQueryCache")] - pub use_query_cache: Option, - /// Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. - #[serde(rename="parameterMode")] - pub parameter_mode: Option, - /// Query parameters for standard SQL queries. - #[serde(rename="queryParameters")] - pub query_parameters: Option>, - /// [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. This property must be set for large results that exceed the maximum response size. - #[serde(rename="destinationTable")] - pub destination_table: Option, - /// Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false. - #[serde(rename="useLegacySql")] - pub use_legacy_sql: Option, - /// [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL. - pub query: Option, - /// Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified. - #[serde(rename="timePartitioning")] - pub time_partitioning: Option, - /// [Deprecated] This property is deprecated. - #[serde(rename="preserveNulls")] - pub preserve_nulls: Option, - /// [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default. - #[serde(rename="maximumBytesBilled")] - pub maximum_bytes_billed: Option, - /// Describes user-defined function resources used in the query. - #[serde(rename="userDefinedFunctionResources")] - pub user_defined_function_resources: Option>, - /// [Beta] Clustering specification for the destination table. Must be specified with time-based partitioning, data in the table will be first partitioned and subsequently clustered. - pub clustering: Option, - /// [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default. - #[serde(rename="maximumBillingTier")] - pub maximum_billing_tier: Option, - /// [Optional] Specifies the default dataset to use for unqualified table names in the query. Note that this does not alter behavior of unqualified dataset names. - #[serde(rename="defaultDataset")] - pub default_dataset: Option, - /// [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified. - #[serde(rename="rangePartitioning")] - pub range_partitioning: Option, - /// Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable. - #[serde(rename="schemaUpdateOptions")] - pub schema_update_options: Option>, - /// [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE. - pub priority: Option, - /// [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema from the query result. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion. - #[serde(rename="writeDisposition")] - pub write_disposition: Option, - /// [Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. However, you must still set destinationTable when result size exceeds the allowed maximum response size. - #[serde(rename="allowLargeResults")] - pub allow_large_results: Option, - /// [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. - #[serde(rename="createDisposition")] - pub create_disposition: Option, - /// [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. - #[serde(rename="tableDefinitions")] - pub table_definitions: Option>, +pub struct BqmlTrainingRun { + /// [Output-only, Beta] Different state applicable for a training run. IN PROGRESS: Training run is in progress. FAILED: Training run ended due to a non-retryable failure. SUCCEEDED: Training run successfully completed. CANCELLED: Training run cancelled by the user. + pub state: Option, + /// [Output-only, Beta] List of each iteration results. + #[serde(rename="iterationResults")] + pub iteration_results: Option>, + /// [Output-only, Beta] Training run start time in milliseconds since the epoch. + #[serde(rename="startTime")] + pub start_time: Option, + /// [Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run. + #[serde(rename="trainingOptions")] + pub training_options: Option, } -impl Part for JobConfigurationQuery {} +impl Part for BqmlTrainingRun {} /// There is no detailed description. @@ -2985,6 +3325,23 @@ pub struct JobConfiguration { impl Part for JobConfiguration {} +/// Arima order, can be used for both non-seasonal and seasonal parts. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ArimaOrder { + /// Order of the moving-average part. + pub q: Option, + /// Order of the autoregressive part. + pub p: Option, + /// Order of the differencing part. + pub d: Option, +} + +impl Part for ArimaOrder {} + + /// Represents a single JSON object. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3010,8 +3367,7 @@ pub struct Argument { /// Optional. Specifies whether the argument is input or output. /// Can be set for procedures only. pub mode: Option, - /// Optional. The name of this argument. Can be absent for function return - /// argument. + /// Optional. The name of this argument. Can be absent for function return argument. pub name: Option, } @@ -3079,6 +3435,68 @@ impl Resource for Dataset {} impl ResponseResult for Dataset {} +/// Represents the count of a single category within the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CategoryCount { + /// The name of category. + pub category: Option, + /// The count of training samples matching the category within the + /// cluster. + pub count: Option, +} + +impl Part for CategoryCount {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ScriptStackFrame { + /// [Output-only] One-based start column. + #[serde(rename="startColumn")] + pub start_column: Option, + /// [Output-only] One-based start line. + #[serde(rename="startLine")] + pub start_line: Option, + /// [Output-only] One-based end column. + #[serde(rename="endColumn")] + pub end_column: Option, + /// [Output-only] Text of the current statement/expression. + pub text: Option, + /// [Output-only] One-based end line. + #[serde(rename="endLine")] + pub end_line: Option, + /// [Output-only] Name of the active procedure, empty if in a top-level script. + #[serde(rename="procedureId")] + pub procedure_id: Option, +} + +impl Part for ScriptStackFrame {} + + +/// Data split result. This contains references to the training and evaluation +/// data tables that were used to train the model. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataSplitResult { + /// Table reference of the training data after split. + #[serde(rename="trainingTable")] + pub training_table: Option, + /// Table reference of the evaluation data after split. + #[serde(rename="evaluationTable")] + pub evaluation_table: Option, +} + +impl Part for DataSplitResult {} + + /// There is no detailed description. /// /// # Activities @@ -3116,7 +3534,7 @@ pub struct Table { /// Time-based partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified. #[serde(rename="timePartitioning")] pub time_partitioning: Option, - /// [Beta] [Optional] If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified. + /// [Optional] If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified. #[serde(rename="requirePartitionFilter")] pub require_partition_filter: Option, /// [Output-only] The time when this table was last modified, in milliseconds since the epoch. @@ -3278,7 +3696,7 @@ pub struct GoogleSheetsOptions { /// [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema. #[serde(rename="skipLeadingRows")] pub skip_leading_rows: Option, - /// [Beta] [Optional] Range of a sheet to query from. Only used when non-empty. Typical format: sheet_name!top_left_cell_id:bottom_right_cell_id For example: sheet1!A1:B20 + /// [Optional] Range of a sheet to query from. Only used when non-empty. Typical format: sheet_name!top_left_cell_id:bottom_right_cell_id For example: sheet1!A1:B20 pub range: Option, } @@ -3772,6 +4190,7 @@ impl<'a, C, A> JobMethods<'a, C, A> { _project_id: project_id.to_string(), _state_filter: Default::default(), _projection: Default::default(), + _parent_job_id: Default::default(), _page_token: Default::default(), _min_creation_time: Default::default(), _max_results: Default::default(), @@ -3855,9 +4274,9 @@ impl<'a, C, A> ModelMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - Project ID of the model to delete. - /// * `datasetId` - Dataset ID of the model to delete. - /// * `modelId` - Model ID of the model to delete. + /// * `projectId` - Required. Project ID of the model to delete. + /// * `datasetId` - Required. Dataset ID of the model to delete. + /// * `modelId` - Required. Model ID of the model to delete. pub fn delete(&self, project_id: &str, dataset_id: &str, model_id: &str) -> ModelDeleteCall<'a, C, A> { ModelDeleteCall { hub: self.hub, @@ -3877,8 +4296,8 @@ impl<'a, C, A> ModelMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - Project ID of the models to list. - /// * `datasetId` - Dataset ID of the models to list. + /// * `projectId` - Required. Project ID of the models to list. + /// * `datasetId` - Required. Dataset ID of the models to list. pub fn list(&self, project_id: &str, dataset_id: &str) -> ModelListCall<'a, C, A> { ModelListCall { hub: self.hub, @@ -3899,9 +4318,9 @@ impl<'a, C, A> ModelMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - Project ID of the model to patch. - /// * `datasetId` - Dataset ID of the model to patch. - /// * `modelId` - Model ID of the model to patch. + /// * `projectId` - Required. Project ID of the model to patch. + /// * `datasetId` - Required. Dataset ID of the model to patch. + /// * `modelId` - Required. Model ID of the model to patch. pub fn patch(&self, request: Model, project_id: &str, dataset_id: &str, model_id: &str) -> ModelPatchCall<'a, C, A> { ModelPatchCall { hub: self.hub, @@ -3921,9 +4340,9 @@ impl<'a, C, A> ModelMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - Project ID of the requested model. - /// * `datasetId` - Dataset ID of the requested model. - /// * `modelId` - Model ID of the requested model. + /// * `projectId` - Required. Project ID of the requested model. + /// * `datasetId` - Required. Dataset ID of the requested model. + /// * `modelId` - Required. Model ID of the requested model. pub fn get(&self, project_id: &str, dataset_id: &str, model_id: &str) -> ModelGetCall<'a, C, A> { ModelGetCall { hub: self.hub, @@ -3986,9 +4405,9 @@ impl<'a, C, A> RoutineMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - Project ID of the routine to update - /// * `datasetId` - Dataset ID of the routine to update - /// * `routineId` - Routine ID of the routine to update + /// * `projectId` - Required. Project ID of the routine to update + /// * `datasetId` - Required. Dataset ID of the routine to update + /// * `routineId` - Required. Routine ID of the routine to update pub fn update(&self, request: Routine, project_id: &str, dataset_id: &str, routine_id: &str) -> RoutineUpdateCall<'a, C, A> { RoutineUpdateCall { hub: self.hub, @@ -4009,15 +4428,17 @@ impl<'a, C, A> RoutineMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - Project ID of the routines to list - /// * `datasetId` - Dataset ID of the routines to list + /// * `projectId` - Required. Project ID of the routines to list + /// * `datasetId` - Required. Dataset ID of the routines to list pub fn list(&self, project_id: &str, dataset_id: &str) -> RoutineListCall<'a, C, A> { RoutineListCall { hub: self.hub, _project_id: project_id.to_string(), _dataset_id: dataset_id.to_string(), + _read_mask: Default::default(), _page_token: Default::default(), _max_results: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4031,8 +4452,8 @@ impl<'a, C, A> RoutineMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - Project ID of the new routine - /// * `datasetId` - Dataset ID of the new routine + /// * `projectId` - Required. Project ID of the new routine + /// * `datasetId` - Required. Dataset ID of the new routine pub fn insert(&self, request: Routine, project_id: &str, dataset_id: &str) -> RoutineInsertCall<'a, C, A> { RoutineInsertCall { hub: self.hub, @@ -4051,9 +4472,9 @@ impl<'a, C, A> RoutineMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - Project ID of the routine to delete - /// * `datasetId` - Dataset ID of the routine to delete - /// * `routineId` - Routine ID of the routine to delete + /// * `projectId` - Required. Project ID of the routine to delete + /// * `datasetId` - Required. Dataset ID of the routine to delete + /// * `routineId` - Required. Routine ID of the routine to delete pub fn delete(&self, project_id: &str, dataset_id: &str, routine_id: &str) -> RoutineDeleteCall<'a, C, A> { RoutineDeleteCall { hub: self.hub, @@ -4072,16 +4493,16 @@ impl<'a, C, A> RoutineMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - Project ID of the requested routine - /// * `datasetId` - Dataset ID of the requested routine - /// * `routineId` - Routine ID of the requested routine + /// * `projectId` - Required. Project ID of the requested routine + /// * `datasetId` - Required. Dataset ID of the requested routine + /// * `routineId` - Required. Routine ID of the requested routine pub fn get(&self, project_id: &str, dataset_id: &str, routine_id: &str) -> RoutineGetCall<'a, C, A> { RoutineGetCall { hub: self.hub, _project_id: project_id.to_string(), _dataset_id: dataset_id.to_string(), _routine_id: routine_id.to_string(), - _field_mask: Default::default(), + _read_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4342,7 +4763,7 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].iter() { @@ -4513,7 +4934,7 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -5211,7 +5632,7 @@ impl<'a, C, A> TableListCall<'a, C, A> where C: BorrowMut, A: oau let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { @@ -5379,7 +5800,7 @@ impl<'a, C, A> TableListCall<'a, C, A> where C: BorrowMut, A: oau /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -6031,7 +6452,7 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId")].iter() { @@ -6203,7 +6624,7 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -6301,7 +6722,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId")].iter() { @@ -6455,7 +6876,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -7648,7 +8069,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs/{jobId}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId"), ("{jobId}", "jobId")].iter() { @@ -7809,7 +8230,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -8778,10 +9199,11 @@ impl<'a, C, A> JobInsertCall<'a, C, A> where C: BorrowMut, A: oau /// let result = hub.jobs().list("projectId") /// .add_state_filter("eirmod") /// .projection("sanctus") -/// .page_token("et") -/// .min_creation_time("amet") -/// .max_results(78) -/// .max_creation_time("consetetur") +/// .parent_job_id("et") +/// .page_token("amet") +/// .min_creation_time("et") +/// .max_results(56) +/// .max_creation_time("ut") /// .all_users(true) /// .doit(); /// # } @@ -8793,6 +9215,7 @@ pub struct JobListCall<'a, C, A> _project_id: String, _state_filter: Vec, _projection: Option, + _parent_job_id: Option, _page_token: Option, _min_creation_time: Option, _max_results: Option, @@ -8819,7 +9242,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth }; dlg.begin(MethodInfo { id: "bigquery.jobs.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(11 + self._additional_params.len()); params.push(("projectId", self._project_id.to_string())); if self._state_filter.len() > 0 { for f in self._state_filter.iter() { @@ -8829,6 +9252,9 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth if let Some(value) = self._projection { params.push(("projection", value.to_string())); } + if let Some(value) = self._parent_job_id { + params.push(("parentJobId", value.to_string())); + } if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -8844,7 +9270,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth if let Some(value) = self._all_users { params.push(("allUsers", value.to_string())); } - for &field in ["alt", "projectId", "stateFilter", "projection", "pageToken", "minCreationTime", "maxResults", "maxCreationTime", "allUsers"].iter() { + for &field in ["alt", "projectId", "stateFilter", "projection", "parentJobId", "pageToken", "minCreationTime", "maxResults", "maxCreationTime", "allUsers"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8858,7 +9284,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId")].iter() { @@ -8981,6 +9407,13 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth self._projection = Some(new_value.to_string()); self } + /// If set, retrieves only jobs whose parent is this job. Otherwise, retrieves only jobs which have no parent + /// + /// Sets the *parent job id* query property to the given value. + pub fn parent_job_id(mut self, new_value: &str) -> JobListCall<'a, C, A> { + self._parent_job_id = Some(new_value.to_string()); + self + } /// Page token, returned by a previous call, to request the next page of results /// /// Sets the *page token* query property to the given value. @@ -9052,7 +9485,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -9103,11 +9536,11 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.jobs().get_query_results("projectId", "jobId") -/// .timeout_ms(98) +/// .timeout_ms(53) /// .start_index("dolor") -/// .page_token("dolor") -/// .max_results(78) -/// .location("consetetur") +/// .page_token("et") +/// .max_results(5) +/// .location("amet.") /// .doit(); /// # } /// ``` @@ -9175,7 +9608,7 @@ impl<'a, C, A> JobGetQueryResultCall<'a, C, A> where C: BorrowMut let mut url = self.hub._base_url.clone() + "projects/{projectId}/queries/{jobId}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId"), ("{jobId}", "jobId")].iter() { @@ -9364,7 +9797,7 @@ impl<'a, C, A> JobGetQueryResultCall<'a, C, A> where C: BorrowMut /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -9555,7 +9988,7 @@ impl<'a, C, A> ModelDeleteCall<'a, C, A> where C: BorrowMut, A: o } - /// Project ID of the model to delete. + /// Required. Project ID of the model to delete. /// /// Sets the *project id* path property to the given value. /// @@ -9565,7 +9998,7 @@ impl<'a, C, A> ModelDeleteCall<'a, C, A> where C: BorrowMut, A: o self._project_id = new_value.to_string(); self } - /// Dataset ID of the model to delete. + /// Required. Dataset ID of the model to delete. /// /// Sets the *dataset id* path property to the given value. /// @@ -9575,7 +10008,7 @@ impl<'a, C, A> ModelDeleteCall<'a, C, A> where C: BorrowMut, A: o self._dataset_id = new_value.to_string(); self } - /// Model ID of the model to delete. + /// Required. Model ID of the model to delete. /// /// Sets the *model id* path property to the given value. /// @@ -9673,8 +10106,8 @@ impl<'a, C, A> ModelDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.models().list("projectId", "datasetId") -/// .page_token("sit") -/// .max_results(75) +/// .page_token("vero") +/// .max_results(73) /// .doit(); /// # } /// ``` @@ -9731,7 +10164,7 @@ impl<'a, C, A> ModelListCall<'a, C, A> where C: BorrowMut, A: oau let mut url = self.hub._base_url.clone() + "projects/{+projectId}/datasets/{+datasetId}/models"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+projectId}", "projectId"), ("{+datasetId}", "datasetId")].iter() { @@ -9832,7 +10265,7 @@ impl<'a, C, A> ModelListCall<'a, C, A> where C: BorrowMut, A: oau } - /// Project ID of the models to list. + /// Required. Project ID of the models to list. /// /// Sets the *project id* path property to the given value. /// @@ -9842,7 +10275,7 @@ impl<'a, C, A> ModelListCall<'a, C, A> where C: BorrowMut, A: oau self._project_id = new_value.to_string(); self } - /// Dataset ID of the models to list. + /// Required. Dataset ID of the models to list. /// /// Sets the *dataset id* path property to the given value. /// @@ -9904,7 +10337,7 @@ impl<'a, C, A> ModelListCall<'a, C, A> where C: BorrowMut, A: oau /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -10137,7 +10570,7 @@ impl<'a, C, A> ModelPatchCall<'a, C, A> where C: BorrowMut, A: oa self._request = new_value; self } - /// Project ID of the model to patch. + /// Required. Project ID of the model to patch. /// /// Sets the *project id* path property to the given value. /// @@ -10147,7 +10580,7 @@ impl<'a, C, A> ModelPatchCall<'a, C, A> where C: BorrowMut, A: oa self._project_id = new_value.to_string(); self } - /// Dataset ID of the model to patch. + /// Required. Dataset ID of the model to patch. /// /// Sets the *dataset id* path property to the given value. /// @@ -10157,7 +10590,7 @@ impl<'a, C, A> ModelPatchCall<'a, C, A> where C: BorrowMut, A: oa self._dataset_id = new_value.to_string(); self } - /// Model ID of the model to patch. + /// Required. Model ID of the model to patch. /// /// Sets the *model id* path property to the given value. /// @@ -10304,7 +10737,7 @@ impl<'a, C, A> ModelGetCall<'a, C, A> where C: BorrowMut, A: oaut let mut url = self.hub._base_url.clone() + "projects/{+projectId}/datasets/{+datasetId}/models/{+modelId}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+projectId}", "projectId"), ("{+datasetId}", "datasetId"), ("{+modelId}", "modelId")].iter() { @@ -10405,7 +10838,7 @@ impl<'a, C, A> ModelGetCall<'a, C, A> where C: BorrowMut, A: oaut } - /// Project ID of the requested model. + /// Required. Project ID of the requested model. /// /// Sets the *project id* path property to the given value. /// @@ -10415,7 +10848,7 @@ impl<'a, C, A> ModelGetCall<'a, C, A> where C: BorrowMut, A: oaut self._project_id = new_value.to_string(); self } - /// Dataset ID of the requested model. + /// Required. Dataset ID of the requested model. /// /// Sets the *dataset id* path property to the given value. /// @@ -10425,7 +10858,7 @@ impl<'a, C, A> ModelGetCall<'a, C, A> where C: BorrowMut, A: oaut self._dataset_id = new_value.to_string(); self } - /// Model ID of the requested model. + /// Required. Model ID of the requested model. /// /// Sets the *model id* path property to the given value. /// @@ -10471,7 +10904,7 @@ impl<'a, C, A> ModelGetCall<'a, C, A> where C: BorrowMut, A: oaut /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -10705,7 +11138,7 @@ impl<'a, C, A> RoutineUpdateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Project ID of the routine to update + /// Required. Project ID of the routine to update /// /// Sets the *project id* path property to the given value. /// @@ -10715,7 +11148,7 @@ impl<'a, C, A> RoutineUpdateCall<'a, C, A> where C: BorrowMut, A: self._project_id = new_value.to_string(); self } - /// Dataset ID of the routine to update + /// Required. Dataset ID of the routine to update /// /// Sets the *dataset id* path property to the given value. /// @@ -10725,7 +11158,7 @@ impl<'a, C, A> RoutineUpdateCall<'a, C, A> where C: BorrowMut, A: self._dataset_id = new_value.to_string(); self } - /// Routine ID of the routine to update + /// Required. Routine ID of the routine to update /// /// Sets the *routine id* path property to the given value. /// @@ -10823,8 +11256,10 @@ impl<'a, C, A> RoutineUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.routines().list("projectId", "datasetId") -/// .page_token("Lorem") -/// .max_results(84) +/// .read_mask("et") +/// .page_token("clita") +/// .max_results(56) +/// .filter("takimata") /// .doit(); /// # } /// ``` @@ -10834,8 +11269,10 @@ pub struct RoutineListCall<'a, C, A> hub: &'a Bigquery, _project_id: String, _dataset_id: String, + _read_mask: Option, _page_token: Option, _max_results: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -10858,16 +11295,22 @@ impl<'a, C, A> RoutineListCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "bigquery.routines.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("projectId", self._project_id.to_string())); params.push(("datasetId", self._dataset_id.to_string())); + if let Some(value) = self._read_mask { + params.push(("readMask", value.to_string())); + } if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } - for &field in ["alt", "projectId", "datasetId", "pageToken", "maxResults"].iter() { + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "projectId", "datasetId", "readMask", "pageToken", "maxResults", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10881,7 +11324,7 @@ impl<'a, C, A> RoutineListCall<'a, C, A> where C: BorrowMut, A: o let mut url = self.hub._base_url.clone() + "projects/{+projectId}/datasets/{+datasetId}/routines"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+projectId}", "projectId"), ("{+datasetId}", "datasetId")].iter() { @@ -10982,7 +11425,7 @@ impl<'a, C, A> RoutineListCall<'a, C, A> where C: BorrowMut, A: o } - /// Project ID of the routines to list + /// Required. Project ID of the routines to list /// /// Sets the *project id* path property to the given value. /// @@ -10992,7 +11435,7 @@ impl<'a, C, A> RoutineListCall<'a, C, A> where C: BorrowMut, A: o self._project_id = new_value.to_string(); self } - /// Dataset ID of the routines to list + /// Required. Dataset ID of the routines to list /// /// Sets the *dataset id* path property to the given value. /// @@ -11002,6 +11445,17 @@ impl<'a, C, A> RoutineListCall<'a, C, A> where C: BorrowMut, A: o self._dataset_id = new_value.to_string(); self } + /// If set, then only the Routine fields in the field mask, as well as + /// project_id, dataset_id and routine_id, are returned in the response. + /// If unset, then the following Routine fields are returned: + /// etag, project_id, dataset_id, routine_id, routine_type, creation_time, + /// last_modified_time, and language. + /// + /// Sets the *read mask* query property to the given value. + pub fn read_mask(mut self, new_value: &str) -> RoutineListCall<'a, C, A> { + self._read_mask = Some(new_value.to_string()); + self + } /// Page token, returned by a previous call, to request the next page of /// results /// @@ -11018,6 +11472,16 @@ impl<'a, C, A> RoutineListCall<'a, C, A> where C: BorrowMut, A: o self._max_results = Some(new_value); self } + /// If set, then only the Routines matching this filter are returned. + /// The current supported form is either "routine_type:" or + /// "routineType:", where is a RoutineType enum. + /// Example: "routineType:SCALAR_FUNCTION". + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RoutineListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -11054,7 +11518,7 @@ impl<'a, C, A> RoutineListCall<'a, C, A> where C: BorrowMut, A: o /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -11285,7 +11749,7 @@ impl<'a, C, A> RoutineInsertCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Project ID of the new routine + /// Required. Project ID of the new routine /// /// Sets the *project id* path property to the given value. /// @@ -11295,7 +11759,7 @@ impl<'a, C, A> RoutineInsertCall<'a, C, A> where C: BorrowMut, A: self._project_id = new_value.to_string(); self } - /// Dataset ID of the new routine + /// Required. Dataset ID of the new routine /// /// Sets the *dataset id* path property to the given value. /// @@ -11532,7 +11996,7 @@ impl<'a, C, A> RoutineDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// Project ID of the routine to delete + /// Required. Project ID of the routine to delete /// /// Sets the *project id* path property to the given value. /// @@ -11542,7 +12006,7 @@ impl<'a, C, A> RoutineDeleteCall<'a, C, A> where C: BorrowMut, A: self._project_id = new_value.to_string(); self } - /// Dataset ID of the routine to delete + /// Required. Dataset ID of the routine to delete /// /// Sets the *dataset id* path property to the given value. /// @@ -11552,7 +12016,7 @@ impl<'a, C, A> RoutineDeleteCall<'a, C, A> where C: BorrowMut, A: self._dataset_id = new_value.to_string(); self } - /// Routine ID of the routine to delete + /// Required. Routine ID of the routine to delete /// /// Sets the *routine id* path property to the given value. /// @@ -11649,7 +12113,7 @@ impl<'a, C, A> RoutineDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.routines().get("projectId", "datasetId", "routineId") -/// .field_mask("labore") +/// .read_mask("sadipscing") /// .doit(); /// # } /// ``` @@ -11660,7 +12124,7 @@ pub struct RoutineGetCall<'a, C, A> _project_id: String, _dataset_id: String, _routine_id: String, - _field_mask: Option, + _read_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -11687,10 +12151,10 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("projectId", self._project_id.to_string())); params.push(("datasetId", self._dataset_id.to_string())); params.push(("routineId", self._routine_id.to_string())); - if let Some(value) = self._field_mask { - params.push(("fieldMask", value.to_string())); + if let Some(value) = self._read_mask { + params.push(("readMask", value.to_string())); } - for &field in ["alt", "projectId", "datasetId", "routineId", "fieldMask"].iter() { + for &field in ["alt", "projectId", "datasetId", "routineId", "readMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11704,7 +12168,7 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa let mut url = self.hub._base_url.clone() + "projects/{+projectId}/datasets/{+datasetId}/routines/{+routineId}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+projectId}", "projectId"), ("{+datasetId}", "datasetId"), ("{+routineId}", "routineId")].iter() { @@ -11805,7 +12269,7 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa } - /// Project ID of the requested routine + /// Required. Project ID of the requested routine /// /// Sets the *project id* path property to the given value. /// @@ -11815,7 +12279,7 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa self._project_id = new_value.to_string(); self } - /// Dataset ID of the requested routine + /// Required. Dataset ID of the requested routine /// /// Sets the *dataset id* path property to the given value. /// @@ -11825,7 +12289,7 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa self._dataset_id = new_value.to_string(); self } - /// Routine ID of the requested routine + /// Required. Routine ID of the requested routine /// /// Sets the *routine id* path property to the given value. /// @@ -11838,9 +12302,9 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa /// If set, only the Routine fields in the field mask are returned in the /// response. If unset, all Routine fields are returned. /// - /// Sets the *field mask* query property to the given value. - pub fn field_mask(mut self, new_value: &str) -> RoutineGetCall<'a, C, A> { - self._field_mask = Some(new_value.to_string()); + /// Sets the *read mask* query property to the given value. + pub fn read_mask(mut self, new_value: &str) -> RoutineGetCall<'a, C, A> { + self._read_mask = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -11879,7 +12343,7 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -11930,10 +12394,10 @@ impl<'a, C, A> RoutineGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.tabledata().list("projectId", "datasetId", "tableId") -/// .start_index("rebum.") -/// .selected_fields("dolore") -/// .page_token("nonumy") -/// .max_results(72) +/// .start_index("sed") +/// .selected_fields("aliquyam") +/// .page_token("sit") +/// .max_results(61) /// .doit(); /// # } /// ``` @@ -11999,7 +12463,7 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{projectId}", "projectId"), ("{datasetId}", "datasetId"), ("{tableId}", "tableId")].iter() { @@ -12191,7 +12655,7 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -12582,7 +13046,7 @@ impl<'a, C, A> ProjectGetServiceAccountCall<'a, C, A> where C: BorrowMut ProjectGetServiceAccountCall<'a, C, A> where C: BorrowMut ProjectGetServiceAccountCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o let mut url = self.hub._base_url.clone() + "projects"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12957,7 +13421,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. diff --git a/gen/bigquerydatatransfer1-cli/Cargo.toml b/gen/bigquerydatatransfer1-cli/Cargo.toml index 589ce1655d..363ade98d6 100644 --- a/gen/bigquerydatatransfer1-cli/Cargo.toml +++ b/gen/bigquerydatatransfer1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-bigquerydatatransfer1-cli" -version = "1.0.12+20190629" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with BigQuery Data Transfer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquerydatatransfer1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-bigquerydatatransfer1] path = "../bigquerydatatransfer1" -version = "1.0.12+20190629" +version = "1.0.13+20200326" diff --git a/gen/bigquerydatatransfer1-cli/README.md b/gen/bigquerydatatransfer1-cli/README.md index b818a763e9..0d6848e6d8 100644 --- a/gen/bigquerydatatransfer1-cli/README.md +++ b/gen/bigquerydatatransfer1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *BigQuery Data Transfer* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *BigQuery Data Transfer* API at revision *20200326*. The CLI is at version *1.0.13*. ```bash bigquerydatatransfer1 [options] diff --git a/gen/bigquerydatatransfer1-cli/mkdocs.yml b/gen/bigquerydatatransfer1-cli/mkdocs.yml index e78be1fc65..1f2822e30f 100644 --- a/gen/bigquerydatatransfer1-cli/mkdocs.yml +++ b/gen/bigquerydatatransfer1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: BigQuery Data Transfer v1.0.12+20190629 +site_name: BigQuery Data Transfer v1.0.13+20200326 site_url: http://byron.github.io/google-apis-rs/google-bigquerydatatransfer1-cli site_description: A complete library to interact with BigQuery Data Transfer (protocol v1) diff --git a/gen/bigquerydatatransfer1-cli/src/main.rs b/gen/bigquerydatatransfer1-cli/src/main.rs index a84d62a059..8da6094b68 100644 --- a/gen/bigquerydatatransfer1-cli/src/main.rs +++ b/gen/bigquerydatatransfer1-cli/src/main.rs @@ -578,18 +578,20 @@ impl<'n> Engine<'n> { "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification-pubsub-topic" => Some(("notificationPubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.disable-auto-scheduling" => Some(("scheduleOptions.disableAutoScheduling", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "schedule-options.end-time" => Some(("scheduleOptions.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.start-time" => Some(("scheduleOptions.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "email-preferences.enable-failure-email" => Some(("emailPreferences.enableFailureEmail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "end-time", "name", "next-run-time", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "email-preferences", "enable-failure-email", "end-time", "name", "next-run-time", "notification-pubsub-topic", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -606,6 +608,9 @@ impl<'n> Engine<'n> { "version-info" => { call = call.version_info(value.unwrap_or("")); }, + "service-account-name" => { + call = call.service_account_name(value.unwrap_or("")); + }, "authorization-code" => { call = call.authorization_code(value.unwrap_or("")); }, @@ -622,7 +627,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["authorization-code", "version-info"].iter().map(|v|*v)); + v.extend(["authorization-code", "version-info", "service-account-name"].iter().map(|v|*v)); v } )); } } @@ -850,18 +855,20 @@ impl<'n> Engine<'n> { "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification-pubsub-topic" => Some(("notificationPubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.disable-auto-scheduling" => Some(("scheduleOptions.disableAutoScheduling", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "schedule-options.end-time" => Some(("scheduleOptions.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.start-time" => Some(("scheduleOptions.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "email-preferences.enable-failure-email" => Some(("emailPreferences.enableFailureEmail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "end-time", "name", "next-run-time", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "email-preferences", "enable-failure-email", "end-time", "name", "next-run-time", "notification-pubsub-topic", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -881,6 +888,9 @@ impl<'n> Engine<'n> { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, + "service-account-name" => { + call = call.service_account_name(value.unwrap_or("")); + }, "authorization-code" => { call = call.authorization_code(value.unwrap_or("")); }, @@ -897,7 +907,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["authorization-code", "version-info", "update-mask"].iter().map(|v|*v)); + v.extend(["authorization-code", "version-info", "update-mask", "service-account-name"].iter().map(|v|*v)); v } )); } } @@ -1363,18 +1373,20 @@ impl<'n> Engine<'n> { "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification-pubsub-topic" => Some(("notificationPubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.disable-auto-scheduling" => Some(("scheduleOptions.disableAutoScheduling", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "schedule-options.end-time" => Some(("scheduleOptions.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.start-time" => Some(("scheduleOptions.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "email-preferences.enable-failure-email" => Some(("emailPreferences.enableFailureEmail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "end-time", "name", "next-run-time", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "email-preferences", "enable-failure-email", "end-time", "name", "next-run-time", "notification-pubsub-topic", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1391,6 +1403,9 @@ impl<'n> Engine<'n> { "version-info" => { call = call.version_info(value.unwrap_or("")); }, + "service-account-name" => { + call = call.service_account_name(value.unwrap_or("")); + }, "authorization-code" => { call = call.authorization_code(value.unwrap_or("")); }, @@ -1407,7 +1422,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["authorization-code", "version-info"].iter().map(|v|*v)); + v.extend(["authorization-code", "version-info", "service-account-name"].iter().map(|v|*v)); v } )); } } @@ -1635,18 +1650,20 @@ impl<'n> Engine<'n> { "destination-dataset-id" => Some(("destinationDatasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification-pubsub-topic" => Some(("notificationPubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule" => Some(("schedule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-region" => Some(("datasetRegion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.disable-auto-scheduling" => Some(("scheduleOptions.disableAutoScheduling", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "schedule-options.end-time" => Some(("scheduleOptions.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-options.start-time" => Some(("scheduleOptions.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "data-source-id" => Some(("dataSourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "email-preferences.enable-failure-email" => Some(("emailPreferences.enableFailureEmail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "next-run-time" => Some(("nextRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "end-time", "name", "next-run-time", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["data-refresh-window-days", "data-source-id", "dataset-region", "destination-dataset-id", "disable-auto-scheduling", "disabled", "display-name", "email-preferences", "enable-failure-email", "end-time", "name", "next-run-time", "notification-pubsub-topic", "schedule", "schedule-options", "start-time", "state", "update-time", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1666,6 +1683,9 @@ impl<'n> Engine<'n> { "update-mask" => { call = call.update_mask(value.unwrap_or("")); }, + "service-account-name" => { + call = call.service_account_name(value.unwrap_or("")); + }, "authorization-code" => { call = call.authorization_code(value.unwrap_or("")); }, @@ -1682,7 +1702,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["authorization-code", "version-info", "update-mask"].iter().map(|v|*v)); + v.extend(["authorization-code", "version-info", "update-mask", "service-account-name"].iter().map(|v|*v)); v } )); } } @@ -2320,8 +2340,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The data source in the form: - `projects/{project_id}/dataSources/{data_source_id}`"##), + Some(r##"Required. The data source in the form: + `projects/{project_id}/dataSources/{data_source_id}` or + `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`."##), Some(true), Some(false)), @@ -2350,8 +2371,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/dataSources/{data_source_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/dataSources/{data_source_id}` or + `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`"##), Some(true), Some(false)), @@ -2374,8 +2396,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The BigQuery project id for which data sources should be returned. - Must be in the form: `projects/{project_id}`"##), + Some(r##"Required. The BigQuery project id for which data sources should be returned. + Must be in the form: `projects/{project_id}` or + `projects/{project_id}/locations/{location_id}"##), Some(true), Some(false)), @@ -2402,8 +2425,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The data source in the form: - `projects/{project_id}/dataSources/{data_source_id}`"##), + Some(r##"Required. The data source in the form: + `projects/{project_id}/dataSources/{data_source_id}` or + `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`."##), Some(true), Some(false)), @@ -2432,8 +2456,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/dataSources/{data_source_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/dataSources/{data_source_id}` or + `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`"##), Some(true), Some(false)), @@ -2456,8 +2481,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The BigQuery project id for which data sources should be returned. - Must be in the form: `projects/{project_id}`"##), + Some(r##"Required. The BigQuery project id for which data sources should be returned. + Must be in the form: `projects/{project_id}` or + `projects/{project_id}/locations/{location_id}"##), Some(true), Some(false)), @@ -2523,10 +2549,10 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The BigQuery project id where the transfer configuration should be created. - Must be in the format projects/{project_id}/locations/{location_id} - If specified location and location of the destination bigquery dataset - do not match - the request will fail."##), + Some(r##"Required. The BigQuery project id where the transfer configuration should be created. + Must be in the format projects/{project_id}/locations/{location_id} or + projects/{project_id}. If specified location and location of the + destination bigquery dataset do not match - the request will fail."##), Some(true), Some(false)), @@ -2555,8 +2581,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`"##), Some(true), Some(false)), @@ -2578,8 +2605,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`"##), Some(true), Some(false)), @@ -2601,8 +2629,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The BigQuery project id for which data sources - should be returned: `projects/{project_id}`."##), + Some(r##"Required. The BigQuery project id for which data sources + should be returned: `projects/{project_id}` or + `projects/{project_id}/locations/{location_id}`"##), Some(true), Some(false)), @@ -2659,8 +2688,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`"##), Some(true), Some(false)), @@ -2682,8 +2712,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`"##), Some(true), Some(false)), @@ -2705,9 +2736,10 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Name of transfer configuration for which transfer runs should be retrieved. + Some(r##"Required. Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: - `projects/{project_id}/transferConfigs/{config_id}`."##), + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`."##), Some(true), Some(false)), @@ -2729,8 +2761,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Transfer run name in the form: - `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`."##), + Some(r##"Required. Transfer run name in the form: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`"##), Some(true), Some(false)), @@ -2756,8 +2789,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Transfer configuration name in the form: - `projects/{project_id}/transferConfigs/{config_id}`."##), + Some(r##"Required. Transfer configuration name in the form: + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`."##), Some(true), Some(false)), @@ -2789,7 +2823,8 @@ fn main() { (Some(r##"parent"##), None, Some(r##"Transfer configuration name in the form: - `projects/{project_id}/transferConfigs/{config_id}`."##), + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`."##), Some(true), Some(false)), @@ -2817,10 +2852,10 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The BigQuery project id where the transfer configuration should be created. - Must be in the format projects/{project_id}/locations/{location_id} - If specified location and location of the destination bigquery dataset - do not match - the request will fail."##), + Some(r##"Required. The BigQuery project id where the transfer configuration should be created. + Must be in the format projects/{project_id}/locations/{location_id} or + projects/{project_id}. If specified location and location of the + destination bigquery dataset do not match - the request will fail."##), Some(true), Some(false)), @@ -2849,8 +2884,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`"##), Some(true), Some(false)), @@ -2872,8 +2908,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`"##), Some(true), Some(false)), @@ -2895,8 +2932,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The BigQuery project id for which data sources - should be returned: `projects/{project_id}`."##), + Some(r##"Required. The BigQuery project id for which data sources + should be returned: `projects/{project_id}` or + `projects/{project_id}/locations/{location_id}`"##), Some(true), Some(false)), @@ -2953,8 +2991,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`"##), Some(true), Some(false)), @@ -2976,8 +3015,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The field will contain name of the resource requested, for example: - `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`"##), + Some(r##"Required. The field will contain name of the resource requested, for example: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`"##), Some(true), Some(false)), @@ -2999,9 +3039,10 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Name of transfer configuration for which transfer runs should be retrieved. + Some(r##"Required. Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: - `projects/{project_id}/transferConfigs/{config_id}`."##), + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`."##), Some(true), Some(false)), @@ -3023,8 +3064,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Transfer run name in the form: - `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`."##), + Some(r##"Required. Transfer run name in the form: + `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`"##), Some(true), Some(false)), @@ -3050,8 +3092,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Transfer configuration name in the form: - `projects/{project_id}/transferConfigs/{config_id}`."##), + Some(r##"Required. Transfer configuration name in the form: + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`."##), Some(true), Some(false)), @@ -3083,7 +3126,8 @@ fn main() { (Some(r##"parent"##), None, Some(r##"Transfer configuration name in the form: - `projects/{project_id}/transferConfigs/{config_id}`."##), + `projects/{project_id}/transferConfigs/{config_id}` or + `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`."##), Some(true), Some(false)), @@ -3111,7 +3155,7 @@ fn main() { let mut app = App::new("bigquerydatatransfer1") .author("Sebastian Thiel ") - .version("1.0.12+20190629") + .version("1.0.13+20200326") .about("Schedule queries or transfer external data from SaaS applications to Google BigQuery on a regular basis.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_bigquerydatatransfer1_cli") .arg(Arg::with_name("url") diff --git a/gen/bigquerydatatransfer1/Cargo.toml b/gen/bigquerydatatransfer1/Cargo.toml index 342acbd728..795588fe84 100644 --- a/gen/bigquerydatatransfer1/Cargo.toml +++ b/gen/bigquerydatatransfer1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-bigquerydatatransfer1" -version = "1.0.12+20190629" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with BigQuery Data Transfer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigquerydatatransfer1" homepage = "https://cloud.google.com/bigquery/" -documentation = "https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629" +documentation = "https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326" license = "MIT" keywords = ["bigquerydatatransfer", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/bigquerydatatransfer1/README.md b/gen/bigquerydatatransfer1/README.md index 160c916f6c..cc3d888fae 100644 --- a/gen/bigquerydatatransfer1/README.md +++ b/gen/bigquerydatatransfer1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-bigquerydatatransfer1` library allows access to all features of the *Google BigQuery Data Transfer* service. -This documentation was generated from *BigQuery Data Transfer* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *bigquerydatatransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *BigQuery Data Transfer* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *bigquerydatatransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *BigQuery Data Transfer* *v1* API can be found at the [official documentation site](https://cloud.google.com/bigquery/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.BigQueryDataTransfer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.BigQueryDataTransfer.html) ... * projects - * [*data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectDataSourceCheckValidCredCall.html), [*data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectDataSourceListCall.html), [*locations data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceCheckValidCredCall.html), [*locations data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceGetCall.html), [*locations data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceListCall.html), [*locations get*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationListCall.html), [*locations transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigCreateCall.html), [*locations transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigDeleteCall.html), [*locations transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigGetCall.html), [*locations transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigListCall.html), [*locations transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigPatchCall.html), [*locations transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunDeleteCall.html), [*locations transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunGetCall.html), [*locations transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunListCall.html), [*locations transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunTransferLogListCall.html), [*locations transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigScheduleRunCall.html), [*locations transfer configs start manual runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigStartManualRunCall.html), [*transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigCreateCall.html), [*transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigDeleteCall.html), [*transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigGetCall.html), [*transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigListCall.html), [*transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigPatchCall.html), [*transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunDeleteCall.html), [*transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunGetCall.html), [*transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunListCall.html), [*transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunTransferLogListCall.html), [*transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigScheduleRunCall.html) and [*transfer configs start manual runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.ProjectTransferConfigStartManualRunCall.html) + * [*data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectDataSourceCheckValidCredCall.html), [*data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectDataSourceListCall.html), [*locations data sources check valid creds*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceCheckValidCredCall.html), [*locations data sources get*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceGetCall.html), [*locations data sources list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationDataSourceListCall.html), [*locations get*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationListCall.html), [*locations transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigCreateCall.html), [*locations transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigDeleteCall.html), [*locations transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigGetCall.html), [*locations transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigListCall.html), [*locations transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigPatchCall.html), [*locations transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunDeleteCall.html), [*locations transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunGetCall.html), [*locations transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunListCall.html), [*locations transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigRunTransferLogListCall.html), [*locations transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigScheduleRunCall.html), [*locations transfer configs start manual runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectLocationTransferConfigStartManualRunCall.html), [*transfer configs create*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigCreateCall.html), [*transfer configs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigDeleteCall.html), [*transfer configs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigGetCall.html), [*transfer configs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigListCall.html), [*transfer configs patch*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigPatchCall.html), [*transfer configs runs delete*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunDeleteCall.html), [*transfer configs runs get*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunGetCall.html), [*transfer configs runs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunListCall.html), [*transfer configs runs transfer logs list*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigRunTransferLogListCall.html), [*transfer configs schedule runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigScheduleRunCall.html) and [*transfer configs start manual runs*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.ProjectTransferConfigStartManualRunCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/struct.BigQueryDataTransfer.html)** +* **[Hub](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/struct.BigQueryDataTransfer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.Part.html)** + * **[Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -115,7 +115,8 @@ let mut req = TransferConfig::default(); let result = hub.projects().transfer_configs_patch(req, "name") .version_info("sit") .update_mask("Stet") - .authorization_code("sed") + .service_account_name("sed") + .authorization_code("et") .doit(); match result { @@ -138,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-bigquerydatatransfer1/1.0.12+20190629/google_bigquerydatatransfer1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-bigquerydatatransfer1/1.0.13+20200326/google_bigquerydatatransfer1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/bigquerydatatransfer1/src/lib.rs b/gen/bigquerydatatransfer1/src/lib.rs index b571cb62f9..119f52738d 100644 --- a/gen/bigquerydatatransfer1/src/lib.rs +++ b/gen/bigquerydatatransfer1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *BigQuery Data Transfer* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *bigquerydatatransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *BigQuery Data Transfer* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *bigquerydatatransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *BigQuery Data Transfer* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/bigquery/). @@ -114,9 +114,10 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.projects().transfer_configs_patch(req, "name") -//! .version_info("dolores") -//! .update_mask("kasd") -//! .authorization_code("accusam") +//! .version_info("kasd") +//! .update_mask("accusam") +//! .service_account_name("takimata") +//! .authorization_code("justo") //! .doit(); //! //! match result { @@ -237,6 +238,9 @@ pub use cmn::*; /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { + /// View your data in Google BigQuery + BigqueryReadonly, + /// View and manage your data across Google Cloud Platform services CloudPlatform, @@ -250,6 +254,7 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { + Scope::BigqueryReadonly => "https://www.googleapis.com/auth/bigquery.readonly", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::Bigquery => "https://www.googleapis.com/auth/bigquery", Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", @@ -259,7 +264,7 @@ impl AsRef for Scope { impl Default for Scope { fn default() -> Scope { - Scope::Bigquery + Scope::BigqueryReadonly } } @@ -308,9 +313,10 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().transfer_configs_patch(req, "name") -/// .version_info("justo") -/// .update_mask("amet.") -/// .authorization_code("erat") +/// .version_info("erat") +/// .update_mask("labore") +/// .service_account_name("sea") +/// .authorization_code("nonumy") /// .doit(); /// /// match result { @@ -348,7 +354,7 @@ impl<'a, C, A> BigQueryDataTransfer BigQueryDataTransfer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://bigquerydatatransfer.googleapis.com/".to_string(), _root_url: "https://bigquerydatatransfer.googleapis.com/".to_string(), } @@ -359,7 +365,7 @@ impl<'a, C, A> BigQueryDataTransfer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -580,6 +586,21 @@ pub struct Location { impl ResponseResult for Location {} +/// Represents preferences for sending email notifications for transfer run +/// events. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EmailPreferences { + /// If true, email notifications will be sent on transfer run failures. + #[serde(rename="enableFailureEmail")] + pub enable_failure_email: Option, +} + +impl Part for EmailPreferences {} + + /// A request to determine whether the user has valid credentials. This method /// is used to limit the number of OAuth popups in the user interface. The /// user id is inferred from the API call context. @@ -738,17 +759,14 @@ pub struct TransferConfig { /// The BigQuery target dataset id. #[serde(rename="destinationDatasetId")] pub destination_dataset_id: Option, - /// User specified display name for the data transfer. - #[serde(rename="displayName")] - pub display_name: Option, - /// The resource name of the transfer config. - /// Transfer config names have the form of - /// `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. - /// The name is automatically generated based on the config_id specified in - /// CreateTransferConfigRequest along with project_id and region. If config_id - /// is not provided, usually a uuid, even though it is not guaranteed or - /// required, will be generated for config_id. - pub name: Option, + /// Email notifications will be sent according to these preferences + /// to the email address of the user who owns this transfer config. + #[serde(rename="emailPreferences")] + pub email_preferences: Option, + /// Pub/Sub topic where notifications will be sent after transfer runs + /// associated with this transfer config finish. + #[serde(rename="notificationPubsubTopic")] + pub notification_pubsub_topic: Option, /// Data transfer schedule. /// If the data source does not support a custom schedule, this should be /// empty. If it is empty, the default value for the data source will be @@ -762,28 +780,39 @@ pub struct TransferConfig { /// https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format /// NOTE: the granularity should be at least 8 hours, or less frequent. pub schedule: Option, - /// Output only. Region in which BigQuery dataset is located. - #[serde(rename="datasetRegion")] - pub dataset_region: Option, /// Deprecated. Unique ID of the user on whose behalf transfer is done. #[serde(rename="userId")] pub user_id: Option, + /// Is this config disabled. When set to true, no runs are scheduled + /// for a given transfer. + pub disabled: Option, + /// Data source id. Cannot be changed once data transfer is created. + #[serde(rename="dataSourceId")] + pub data_source_id: Option, + /// User specified display name for the data transfer. + #[serde(rename="displayName")] + pub display_name: Option, + /// The resource name of the transfer config. + /// Transfer config names have the form of + /// `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. + /// The name is automatically generated based on the config_id specified in + /// CreateTransferConfigRequest along with project_id and region. If config_id + /// is not provided, usually a uuid, even though it is not guaranteed or + /// required, will be generated for config_id. + pub name: Option, + /// Output only. Region in which BigQuery dataset is located. + #[serde(rename="datasetRegion")] + pub dataset_region: Option, /// Options customizing the data transfer schedule. #[serde(rename="scheduleOptions")] pub schedule_options: Option, /// Output only. State of the most recently updated transfer run. pub state: Option, - /// Data source id. Cannot be changed once data transfer is created. - #[serde(rename="dataSourceId")] - pub data_source_id: Option, - /// Is this config disabled. When set to true, no runs are scheduled - /// for a given transfer. - pub disabled: Option, + /// Data transfer specific parameters. + pub params: Option>, /// Output only. Next time when data transfer will run. #[serde(rename="nextRunTime")] pub next_run_time: Option, - /// Data transfer specific parameters. - pub params: Option>, } impl RequestValue for TransferConfig {} @@ -969,6 +998,11 @@ impl ResponseResult for DataSource {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferRun { + /// Output only. Email notifications will be sent according to these + /// preferences to the email address of the user who owns the transfer config + /// this run was derived from. + #[serde(rename="emailPreferences")] + pub email_preferences: Option, /// Output only. Last time the data transfer run state was updated. #[serde(rename="updateTime")] pub update_time: Option, @@ -980,6 +1014,10 @@ pub struct TransferRun { /// `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. /// The name is ignored when creating a transfer run. pub name: Option, + /// Output only. Pub/Sub topic where a notification will be sent after this + /// transfer run finishes + #[serde(rename="notificationPubsubTopic")] + pub notification_pubsub_topic: Option, /// Output only. Describes the schedule of this transfer run if it was /// created as part of a regular schedule. For batch transfer runs that are /// scheduled manually, this is empty. @@ -997,15 +1035,15 @@ pub struct TransferRun { /// Status of the transfer run. #[serde(rename="errorStatus")] pub error_status: Option, - /// Output only. Data transfer specific parameters. - pub params: Option>, + /// Output only. Data source id. + #[serde(rename="dataSourceId")] + pub data_source_id: Option, /// Output only. Time when transfer run was started. /// Parameter ignored by server for input requests. #[serde(rename="startTime")] pub start_time: Option, - /// Output only. Data source id. - #[serde(rename="dataSourceId")] - pub data_source_id: Option, + /// Output only. Data transfer specific parameters. + pub params: Option>, /// For batch transfer runs, specifies the date and time of the data should be /// ingested. #[serde(rename="runTime")] @@ -1057,11 +1095,11 @@ impl ResponseResult for ListTransferRunsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ScheduleTransferRunsRequest { - /// End time of the range of transfer runs. For example, + /// Required. End time of the range of transfer runs. For example, /// `"2017-05-30T00:00:00+00:00"`. #[serde(rename="endTime")] pub end_time: Option, - /// Start time of the range of transfer runs. For example, + /// Required. Start time of the range of transfer runs. For example, /// `"2017-05-25T00:00:00+00:00"`. #[serde(rename="startTime")] pub start_time: Option, @@ -1140,8 +1178,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` pub fn transfer_configs_runs_get(&self, name: &str) -> ProjectTransferConfigRunGetCall<'a, C, A> { ProjectTransferConfigRunGetCall { hub: self.hub, @@ -1176,8 +1215,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` pub fn locations_transfer_configs_delete(&self, name: &str) -> ProjectLocationTransferConfigDeleteCall<'a, C, A> { ProjectLocationTransferConfigDeleteCall { hub: self.hub, @@ -1195,8 +1235,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/dataSources/{data_source_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/dataSources/{data_source_id}` or + /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` pub fn data_sources_get(&self, name: &str) -> ProjectDataSourceGetCall<'a, C, A> { ProjectDataSourceGetCall { hub: self.hub, @@ -1214,16 +1255,17 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The BigQuery project id where the transfer configuration should be created. - /// Must be in the format projects/{project_id}/locations/{location_id} - /// If specified location and location of the destination bigquery dataset - /// do not match - the request will fail. + /// * `parent` - Required. The BigQuery project id where the transfer configuration should be created. + /// Must be in the format projects/{project_id}/locations/{location_id} or + /// projects/{project_id}. If specified location and location of the + /// destination bigquery dataset do not match - the request will fail. pub fn locations_transfer_configs_create(&self, request: TransferConfig, parent: &str) -> ProjectLocationTransferConfigCreateCall<'a, C, A> { ProjectLocationTransferConfigCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), _version_info: Default::default(), + _service_account_name: Default::default(), _authorization_code: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1237,8 +1279,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Transfer run name in the form: - /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + /// * `parent` - Required. Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` pub fn transfer_configs_runs_transfer_logs_list(&self, parent: &str) -> ProjectTransferConfigRunTransferLogListCall<'a, C, A> { ProjectTransferConfigRunTransferLogListCall { hub: self.hub, @@ -1258,9 +1301,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Name of transfer configuration for which transfer runs should be retrieved. + /// * `parent` - Required. Name of transfer configuration for which transfer runs should be retrieved. /// Format of transfer configuration resource name is: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. pub fn locations_transfer_configs_runs_list(&self, parent: &str) -> ProjectLocationTransferConfigRunListCall<'a, C, A> { ProjectLocationTransferConfigRunListCall { hub: self.hub, @@ -1286,7 +1330,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `parent` - Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. pub fn transfer_configs_start_manual_runs(&self, request: StartManualTransferRunsRequest, parent: &str) -> ProjectTransferConfigStartManualRunCall<'a, C, A> { ProjectTransferConfigStartManualRunCall { hub: self.hub, @@ -1305,8 +1350,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/dataSources/{data_source_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/dataSources/{data_source_id}` or + /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` pub fn locations_data_sources_get(&self, name: &str) -> ProjectLocationDataSourceGetCall<'a, C, A> { ProjectLocationDataSourceGetCall { hub: self.hub, @@ -1323,8 +1369,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` pub fn locations_transfer_configs_runs_get(&self, name: &str) -> ProjectLocationTransferConfigRunGetCall<'a, C, A> { ProjectLocationTransferConfigRunGetCall { hub: self.hub, @@ -1341,8 +1388,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` pub fn locations_transfer_configs_runs_delete(&self, name: &str) -> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> { ProjectLocationTransferConfigRunDeleteCall { hub: self.hub, @@ -1364,8 +1412,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// * `parent` - Required. Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. pub fn locations_transfer_configs_schedule_runs(&self, request: ScheduleTransferRunsRequest, parent: &str) -> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> { ProjectLocationTransferConfigScheduleRunCall { hub: self.hub, @@ -1383,8 +1432,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` pub fn transfer_configs_runs_delete(&self, name: &str) -> ProjectTransferConfigRunDeleteCall<'a, C, A> { ProjectTransferConfigRunDeleteCall { hub: self.hub, @@ -1402,8 +1452,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The BigQuery project id for which data sources should be returned. - /// Must be in the form: `projects/{project_id}` + /// * `parent` - Required. The BigQuery project id for which data sources should be returned. + /// Must be in the form: `projects/{project_id}` or + /// `projects/{project_id}/locations/{location_id} pub fn data_sources_list(&self, parent: &str) -> ProjectDataSourceListCall<'a, C, A> { ProjectDataSourceListCall { hub: self.hub, @@ -1438,6 +1489,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _name: name.to_string(), _version_info: Default::default(), _update_mask: Default::default(), + _service_account_name: Default::default(), _authorization_code: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1452,16 +1504,17 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The BigQuery project id where the transfer configuration should be created. - /// Must be in the format projects/{project_id}/locations/{location_id} - /// If specified location and location of the destination bigquery dataset - /// do not match - the request will fail. + /// * `parent` - Required. The BigQuery project id where the transfer configuration should be created. + /// Must be in the format projects/{project_id}/locations/{location_id} or + /// projects/{project_id}. If specified location and location of the + /// destination bigquery dataset do not match - the request will fail. pub fn transfer_configs_create(&self, request: TransferConfig, parent: &str) -> ProjectTransferConfigCreateCall<'a, C, A> { ProjectTransferConfigCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), _version_info: Default::default(), + _service_account_name: Default::default(), _authorization_code: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1481,8 +1534,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The data source in the form: - /// `projects/{project_id}/dataSources/{data_source_id}` + /// * `name` - Required. The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` or + /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. pub fn locations_data_sources_check_valid_creds(&self, request: CheckValidCredsRequest, name: &str) -> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> { ProjectLocationDataSourceCheckValidCredCall { hub: self.hub, @@ -1500,8 +1554,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` pub fn transfer_configs_get(&self, name: &str) -> ProjectTransferConfigGetCall<'a, C, A> { ProjectTransferConfigGetCall { hub: self.hub, @@ -1519,8 +1574,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The BigQuery project id for which data sources should be returned. - /// Must be in the form: `projects/{project_id}` + /// * `parent` - Required. The BigQuery project id for which data sources should be returned. + /// Must be in the form: `projects/{project_id}` or + /// `projects/{project_id}/locations/{location_id} pub fn locations_data_sources_list(&self, parent: &str) -> ProjectLocationDataSourceListCall<'a, C, A> { ProjectLocationDataSourceListCall { hub: self.hub, @@ -1539,8 +1595,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` pub fn locations_transfer_configs_get(&self, name: &str) -> ProjectLocationTransferConfigGetCall<'a, C, A> { ProjectLocationTransferConfigGetCall { hub: self.hub, @@ -1562,7 +1619,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `parent` - Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. pub fn locations_transfer_configs_start_manual_runs(&self, request: StartManualTransferRunsRequest, parent: &str) -> ProjectLocationTransferConfigStartManualRunCall<'a, C, A> { ProjectLocationTransferConfigStartManualRunCall { hub: self.hub, @@ -1580,8 +1638,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The BigQuery project id for which data sources - /// should be returned: `projects/{project_id}`. + /// * `parent` - Required. The BigQuery project id for which data sources + /// should be returned: `projects/{project_id}` or + /// `projects/{project_id}/locations/{location_id}` pub fn transfer_configs_list(&self, parent: &str) -> ProjectTransferConfigListCall<'a, C, A> { ProjectTransferConfigListCall { hub: self.hub, @@ -1617,6 +1676,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _name: name.to_string(), _version_info: Default::default(), _update_mask: Default::default(), + _service_account_name: Default::default(), _authorization_code: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1636,8 +1696,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The data source in the form: - /// `projects/{project_id}/dataSources/{data_source_id}` + /// * `name` - Required. The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` or + /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. pub fn data_sources_check_valid_creds(&self, request: CheckValidCredsRequest, name: &str) -> ProjectDataSourceCheckValidCredCall<'a, C, A> { ProjectDataSourceCheckValidCredCall { hub: self.hub, @@ -1660,8 +1721,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// * `parent` - Required. Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. pub fn transfer_configs_schedule_runs(&self, request: ScheduleTransferRunsRequest, parent: &str) -> ProjectTransferConfigScheduleRunCall<'a, C, A> { ProjectTransferConfigScheduleRunCall { hub: self.hub, @@ -1699,9 +1761,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Name of transfer configuration for which transfer runs should be retrieved. + /// * `parent` - Required. Name of transfer configuration for which transfer runs should be retrieved. /// Format of transfer configuration resource name is: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. pub fn transfer_configs_runs_list(&self, parent: &str) -> ProjectTransferConfigRunListCall<'a, C, A> { ProjectTransferConfigRunListCall { hub: self.hub, @@ -1722,8 +1785,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The BigQuery project id for which data sources - /// should be returned: `projects/{project_id}`. + /// * `parent` - Required. The BigQuery project id for which data sources + /// should be returned: `projects/{project_id}` or + /// `projects/{project_id}/locations/{location_id}` pub fn locations_transfer_configs_list(&self, parent: &str) -> ProjectLocationTransferConfigListCall<'a, C, A> { ProjectLocationTransferConfigListCall { hub: self.hub, @@ -1743,8 +1807,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Transfer run name in the form: - /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + /// * `parent` - Required. Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` pub fn locations_transfer_configs_runs_transfer_logs_list(&self, parent: &str) -> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> { ProjectLocationTransferConfigRunTransferLogListCall { hub: self.hub, @@ -1765,8 +1830,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}` + /// * `name` - Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` pub fn transfer_configs_delete(&self, name: &str) -> ProjectTransferConfigDeleteCall<'a, C, A> { ProjectTransferConfigDeleteCall { hub: self.hub, @@ -1860,7 +1926,7 @@ impl<'a, C, A> ProjectTransferConfigRunGetCall<'a, C, A> where C: BorrowMut ProjectTransferConfigRunGetCall<'a, C, A> where C: BorrowMut ProjectTransferConfigRunGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationTransferConfigDeleteCall<'a, C, A> where C: Borrow } - /// The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}` + /// Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` /// /// Sets the *name* path property to the given value. /// @@ -2608,7 +2676,7 @@ impl<'a, C, A> ProjectDataSourceGetCall<'a, C, A> where C: BorrowMut ProjectDataSourceGetCall<'a, C, A> where C: BorrowMut ProjectDataSourceGetCall<'a, C, A> where C: BorrowMut ProjectDataSourceGetCall<'a, C, A> where C: BorrowMut _request: TransferConfig, _parent: String, _version_info: Option, + _service_account_name: Option, _authorization_code: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -2852,15 +2923,18 @@ impl<'a, C, A> ProjectLocationTransferConfigCreateCall<'a, C, A> where C: Borrow }; dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.create", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); if let Some(value) = self._version_info { params.push(("versionInfo", value.to_string())); } + if let Some(value) = self._service_account_name { + params.push(("serviceAccountName", value.to_string())); + } if let Some(value) = self._authorization_code { params.push(("authorizationCode", value.to_string())); } - for &field in ["alt", "parent", "versionInfo", "authorizationCode"].iter() { + for &field in ["alt", "parent", "versionInfo", "serviceAccountName", "authorizationCode"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2999,10 +3073,10 @@ impl<'a, C, A> ProjectLocationTransferConfigCreateCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// The BigQuery project id where the transfer configuration should be created. - /// Must be in the format projects/{project_id}/locations/{location_id} - /// If specified location and location of the destination bigquery dataset - /// do not match - the request will fail. + /// Required. The BigQuery project id where the transfer configuration should be created. + /// Must be in the format projects/{project_id}/locations/{location_id} or + /// projects/{project_id}. If specified location and location of the + /// destination bigquery dataset do not match - the request will fail. /// /// Sets the *parent* path property to the given value. /// @@ -3024,6 +3098,16 @@ impl<'a, C, A> ProjectLocationTransferConfigCreateCall<'a, C, A> where C: Borrow self._version_info = Some(new_value.to_string()); self } + /// Optional service account name. If this field is set, transfer config will + /// be created with this service account credentials. It requires that + /// requesting user calling this API has permissions to act as this service + /// account. + /// + /// Sets the *service account name* query property to the given value. + pub fn service_account_name(mut self, new_value: &str) -> ProjectLocationTransferConfigCreateCall<'a, C, A> { + self._service_account_name = Some(new_value.to_string()); + self + } /// Optional OAuth2 authorization code to use with this transfer configuration. /// This is required if new credentials are needed, as indicated by /// `CheckValidCreds`. @@ -3137,9 +3221,9 @@ impl<'a, C, A> ProjectLocationTransferConfigCreateCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().transfer_configs_runs_transfer_logs_list("parent") -/// .page_token("no") -/// .page_size(-21) -/// .add_message_types("justo") +/// .page_token("et") +/// .page_size(-41) +/// .add_message_types("ipsum") /// .doit(); /// # } /// ``` @@ -3200,7 +3284,7 @@ impl<'a, C, A> ProjectTransferConfigRunTransferLogListCall<'a, C, A> where C: Bo let mut url = self.hub._base_url.clone() + "v1/{+parent}/transferLogs"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + self._scopes.insert(Scope::BigqueryReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+parent}", "parent")].iter() { @@ -3301,8 +3385,9 @@ impl<'a, C, A> ProjectTransferConfigRunTransferLogListCall<'a, C, A> where C: Bo } - /// Transfer run name in the form: - /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + /// Required. Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` /// /// Sets the *parent* path property to the given value. /// @@ -3379,7 +3464,7 @@ impl<'a, C, A> ProjectTransferConfigRunTransferLogListCall<'a, C, A> where C: Bo /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Bigquery`. + /// `Scope::BigqueryReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -3431,9 +3516,9 @@ impl<'a, C, A> ProjectTransferConfigRunTransferLogListCall<'a, C, A> where C: Bo /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_transfer_configs_runs_list("parent") /// .add_states("et") -/// .run_attempt("diam") -/// .page_token("ipsum") -/// .page_size(-5) +/// .run_attempt("duo") +/// .page_token("aliquyam") +/// .page_size(-9) /// .doit(); /// # } /// ``` @@ -3498,7 +3583,7 @@ impl<'a, C, A> ProjectLocationTransferConfigRunListCall<'a, C, A> where C: Borro let mut url = self.hub._base_url.clone() + "v1/{+parent}/runs"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + self._scopes.insert(Scope::BigqueryReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+parent}", "parent")].iter() { @@ -3599,9 +3684,10 @@ impl<'a, C, A> ProjectLocationTransferConfigRunListCall<'a, C, A> where C: Borro } - /// Name of transfer configuration for which transfer runs should be retrieved. + /// Required. Name of transfer configuration for which transfer runs should be retrieved. /// Format of transfer configuration resource name is: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -3684,7 +3770,7 @@ impl<'a, C, A> ProjectLocationTransferConfigRunListCall<'a, C, A> where C: Borro /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Bigquery`. + /// `Scope::BigqueryReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -3917,7 +4003,8 @@ impl<'a, C, A> ProjectTransferConfigStartManualRunCall<'a, C, A> where C: Borrow self } /// Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -4065,7 +4152,7 @@ impl<'a, C, A> ProjectLocationDataSourceGetCall<'a, C, A> where C: BorrowMut ProjectLocationDataSourceGetCall<'a, C, A> where C: BorrowMut ProjectLocationDataSourceGetCall<'a, C, A> where C: BorrowMut ProjectLocationTransferConfigRunGetCall<'a, C, A> where C: Borrow let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + self._scopes.insert(Scope::BigqueryReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+name}", "name")].iter() { @@ -4415,8 +4503,9 @@ impl<'a, C, A> ProjectLocationTransferConfigRunGetCall<'a, C, A> where C: Borrow } - /// The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` /// /// Sets the *name* path property to the given value. /// @@ -4466,7 +4555,7 @@ impl<'a, C, A> ProjectLocationTransferConfigRunGetCall<'a, C, A> where C: Borrow /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Bigquery`. + /// `Scope::BigqueryReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -4664,8 +4753,9 @@ impl<'a, C, A> ProjectLocationTransferConfigRunDeleteCall<'a, C, A> where C: Bor } - /// The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + /// Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` /// /// Sets the *name* path property to the given value. /// @@ -4948,8 +5038,9 @@ impl<'a, C, A> ProjectLocationTransferConfigScheduleRunCall<'a, C, A> where C: B self._request = new_value; self } - /// Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// Required. Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -5197,8 +5288,9 @@ impl<'a, C, A> ProjectTransferConfigRunDeleteCall<'a, C, A> where C: BorrowMut ProjectTransferConfigRunDeleteCall<'a, C, A> where C: BorrowMut ProjectDataSourceListCall<'a, C, A> where C: BorrowMut ProjectDataSourceListCall<'a, C, A> where C: BorrowMut ProjectDataSourceListCall<'a, C, A> where C: BorrowMut ProjectDataSourceListCall<'a, C, A> where C: BorrowMut _name: String, _version_info: Option, _update_mask: Option, + _service_account_name: Option, _authorization_code: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -5621,7 +5716,7 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM }; dlg.begin(MethodInfo { id: "bigquerydatatransfer.projects.locations.transferConfigs.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("name", self._name.to_string())); if let Some(value) = self._version_info { params.push(("versionInfo", value.to_string())); @@ -5629,10 +5724,13 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM if let Some(value) = self._update_mask { params.push(("updateMask", value.to_string())); } + if let Some(value) = self._service_account_name { + params.push(("serviceAccountName", value.to_string())); + } if let Some(value) = self._authorization_code { params.push(("authorizationCode", value.to_string())); } - for &field in ["alt", "name", "versionInfo", "updateMask", "authorizationCode"].iter() { + for &field in ["alt", "name", "versionInfo", "updateMask", "serviceAccountName", "authorizationCode"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5799,13 +5897,24 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM self._version_info = Some(new_value.to_string()); self } - /// Required list of fields to be updated in this request. + /// Required. Required list of fields to be updated in this request. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> ProjectLocationTransferConfigPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } + /// Optional service account name. If this field is set and + /// "service_account_name" is set in update_mask, transfer config will be + /// updated to use this service account credentials. It requires that + /// requesting user calling this API has permissions to act as this service + /// account. + /// + /// Sets the *service account name* query property to the given value. + pub fn service_account_name(mut self, new_value: &str) -> ProjectLocationTransferConfigPatchCall<'a, C, A> { + self._service_account_name = Some(new_value.to_string()); + self + } /// Optional OAuth2 authorization code to use with this transfer configuration. /// If it is provided, the transfer configuration will be associated with the /// authorizing user. @@ -5925,8 +6034,9 @@ impl<'a, C, A> ProjectLocationTransferConfigPatchCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().transfer_configs_create(req, "parent") -/// .version_info("eirmod") -/// .authorization_code("dolore") +/// .version_info("Lorem") +/// .service_account_name("sea") +/// .authorization_code("et") /// .doit(); /// # } /// ``` @@ -5937,6 +6047,7 @@ pub struct ProjectTransferConfigCreateCall<'a, C, A> _request: TransferConfig, _parent: String, _version_info: Option, + _service_account_name: Option, _authorization_code: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -5960,15 +6071,18 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); if let Some(value) = self._version_info { params.push(("versionInfo", value.to_string())); } + if let Some(value) = self._service_account_name { + params.push(("serviceAccountName", value.to_string())); + } if let Some(value) = self._authorization_code { params.push(("authorizationCode", value.to_string())); } - for &field in ["alt", "parent", "versionInfo", "authorizationCode"].iter() { + for &field in ["alt", "parent", "versionInfo", "serviceAccountName", "authorizationCode"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6107,10 +6221,10 @@ impl<'a, C, A> ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut ProjectTransferConfigCreateCall<'a, C, A> where C: BorrowMut ProjectTransferConfigCreateCall<'a, C, A> { + self._service_account_name = Some(new_value.to_string()); + self + } /// Optional OAuth2 authorization code to use with this transfer configuration. /// This is required if new credentials are needed, as indicated by /// `CheckValidCreds`. @@ -6428,8 +6552,9 @@ impl<'a, C, A> ProjectLocationDataSourceCheckValidCredCall<'a, C, A> where C: Bo self._request = new_value; self } - /// The data source in the form: - /// `projects/{project_id}/dataSources/{data_source_id}` + /// Required. The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` or + /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. /// /// Sets the *name* path property to the given value. /// @@ -6576,7 +6701,7 @@ impl<'a, C, A> ProjectTransferConfigGetCall<'a, C, A> where C: BorrowMut ProjectTransferConfigGetCall<'a, C, A> where C: BorrowMut ProjectTransferConfigGetCall<'a, C, A> where C: BorrowMut ProjectTransferConfigGetCall<'a, C, A> where C: BorrowMut ProjectLocationDataSourceListCall<'a, C, A> where C: BorrowMut ProjectLocationDataSourceListCall<'a, C, A> where C: BorrowMut ProjectLocationDataSourceListCall<'a, C, A> where C: BorrowMut ProjectLocationTransferConfigGetCall<'a, C, A> where C: BorrowMut let mut url = self.hub._base_url.clone() + "v1/{+name}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + self._scopes.insert(Scope::BigqueryReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+name}", "name")].iter() { @@ -7204,8 +7331,9 @@ impl<'a, C, A> ProjectLocationTransferConfigGetCall<'a, C, A> where C: BorrowMut } - /// The field will contain name of the resource requested, for example: - /// `projects/{project_id}/transferConfigs/{config_id}` + /// Required. The field will contain name of the resource requested, for example: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` /// /// Sets the *name* path property to the given value. /// @@ -7255,7 +7383,7 @@ impl<'a, C, A> ProjectLocationTransferConfigGetCall<'a, C, A> where C: BorrowMut /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Bigquery`. + /// `Scope::BigqueryReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -7488,7 +7616,8 @@ impl<'a, C, A> ProjectLocationTransferConfigStartManualRunCall<'a, C, A> where C self } /// Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -7589,9 +7718,9 @@ impl<'a, C, A> ProjectLocationTransferConfigStartManualRunCall<'a, C, A> where C /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().transfer_configs_list("parent") -/// .page_token("eirmod") -/// .page_size(-58) -/// .add_data_source_ids("et") +/// .page_token("ut") +/// .page_size(-16) +/// .add_data_source_ids("sed") /// .doit(); /// # } /// ``` @@ -7652,7 +7781,7 @@ impl<'a, C, A> ProjectTransferConfigListCall<'a, C, A> where C: BorrowMut ProjectTransferConfigListCall<'a, C, A> where C: BorrowMut ProjectTransferConfigListCall<'a, C, A> where C: BorrowMut ProjectTransferConfigListCall<'a, C, A> where C: BorrowMut _name: String, _version_info: Option, _update_mask: Option, + _service_account_name: Option, _authorization_code: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -7925,7 +8057,7 @@ impl<'a, C, A> ProjectTransferConfigPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("name", self._name.to_string())); if let Some(value) = self._version_info { params.push(("versionInfo", value.to_string())); @@ -7933,10 +8065,13 @@ impl<'a, C, A> ProjectTransferConfigPatchCall<'a, C, A> where C: BorrowMut ProjectTransferConfigPatchCall<'a, C, A> where C: BorrowMut ProjectTransferConfigPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } + /// Optional service account name. If this field is set and + /// "service_account_name" is set in update_mask, transfer config will be + /// updated to use this service account credentials. It requires that + /// requesting user calling this API has permissions to act as this service + /// account. + /// + /// Sets the *service account name* query property to the given value. + pub fn service_account_name(mut self, new_value: &str) -> ProjectTransferConfigPatchCall<'a, C, A> { + self._service_account_name = Some(new_value.to_string()); + self + } /// Optional OAuth2 authorization code to use with this transfer configuration. /// If it is provided, the transfer configuration will be associated with the /// authorizing user. @@ -8406,8 +8552,9 @@ impl<'a, C, A> ProjectDataSourceCheckValidCredCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The data source in the form: - /// `projects/{project_id}/dataSources/{data_source_id}` + /// Required. The data source in the form: + /// `projects/{project_id}/dataSources/{data_source_id}` or + /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. /// /// Sets the *name* path property to the given value. /// @@ -8690,8 +8837,9 @@ impl<'a, C, A> ProjectTransferConfigScheduleRunCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// Transfer configuration name in the form: - /// `projects/{project_id}/transferConfigs/{config_id}`. + /// Required. Transfer configuration name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -8792,9 +8940,9 @@ impl<'a, C, A> ProjectTransferConfigScheduleRunCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_list("name") -/// .page_token("dolor") -/// .page_size(-48) -/// .filter("et") +/// .page_token("gubergren") +/// .page_size(-20) +/// .filter("sit") /// .doit(); /// # } /// ``` @@ -8853,7 +9001,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectTransferConfigRunListCall<'a, C, A> where C: BorrowMut ProjectTransferConfigRunListCall<'a, C, A> where C: BorrowMut ProjectTransferConfigRunListCall<'a, C, A> where C: BorrowMut ProjectTransferConfigRunListCall<'a, C, A> where C: BorrowMut ProjectLocationTransferConfigListCall<'a, C, A> where C: BorrowMu let mut url = self.hub._base_url.clone() + "v1/{+parent}/transferConfigs"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + self._scopes.insert(Scope::BigqueryReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+parent}", "parent")].iter() { @@ -9545,8 +9694,9 @@ impl<'a, C, A> ProjectLocationTransferConfigListCall<'a, C, A> where C: BorrowMu } - /// The BigQuery project id for which data sources - /// should be returned: `projects/{project_id}`. + /// Required. The BigQuery project id for which data sources + /// should be returned: `projects/{project_id}` or + /// `projects/{project_id}/locations/{location_id}` /// /// Sets the *parent* path property to the given value. /// @@ -9622,7 +9772,7 @@ impl<'a, C, A> ProjectLocationTransferConfigListCall<'a, C, A> where C: BorrowMu /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Bigquery`. + /// `Scope::BigqueryReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -9673,9 +9823,9 @@ impl<'a, C, A> ProjectLocationTransferConfigListCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_transfer_configs_runs_transfer_logs_list("parent") -/// .page_token("consetetur") -/// .page_size(-44) -/// .add_message_types("vero") +/// .page_token("duo") +/// .page_size(-82) +/// .add_message_types("Lorem") /// .doit(); /// # } /// ``` @@ -9736,7 +9886,7 @@ impl<'a, C, A> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> whe let mut url = self.hub._base_url.clone() + "v1/{+parent}/transferLogs"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); + self._scopes.insert(Scope::BigqueryReadonly.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+parent}", "parent")].iter() { @@ -9837,8 +9987,9 @@ impl<'a, C, A> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> whe } - /// Transfer run name in the form: - /// `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + /// Required. Transfer run name in the form: + /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` /// /// Sets the *parent* path property to the given value. /// @@ -9915,7 +10066,7 @@ impl<'a, C, A> ProjectLocationTransferConfigRunTransferLogListCall<'a, C, A> whe /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Bigquery`. + /// `Scope::BigqueryReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -10114,8 +10265,9 @@ impl<'a, C, A> ProjectTransferConfigDeleteCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Bigtable Admin (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigtableadmin2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-bigtableadmin2] path = "../bigtableadmin2" -version = "1.0.12+20190506" +version = "1.0.13+20200211" diff --git a/gen/bigtableadmin2-cli/README.md b/gen/bigtableadmin2-cli/README.md index 2152da41b2..b69ad542f2 100644 --- a/gen/bigtableadmin2-cli/README.md +++ b/gen/bigtableadmin2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Bigtable Admin* API at revision *20190506*. The CLI is at version *1.0.12*. +This documentation was generated from the *Bigtable Admin* API at revision *20200211*. The CLI is at version *1.0.13*. ```bash bigtableadmin2 [options] @@ -40,6 +40,9 @@ bigtableadmin2 [options] instances-app-profiles-get [-p ]... [-o ] instances-app-profiles-list [-p ]... [-o ] instances-app-profiles-patch (-r )... [-p ]... [-o ] + instances-clusters-backups-get-iam-policy (-r )... [-p ]... [-o ] + instances-clusters-backups-set-iam-policy (-r )... [-p ]... [-o ] + instances-clusters-backups-test-iam-permissions (-r )... [-p ]... [-o ] instances-clusters-create (-r )... [-p ]... [-o ] instances-clusters-delete [-p ]... [-o ] instances-clusters-get [-p ]... [-o ] diff --git a/gen/bigtableadmin2-cli/mkdocs.yml b/gen/bigtableadmin2-cli/mkdocs.yml index d30260d6b4..48e4f42e57 100644 --- a/gen/bigtableadmin2-cli/mkdocs.yml +++ b/gen/bigtableadmin2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Bigtable Admin v1.0.12+20190506 +site_name: Bigtable Admin v1.0.13+20200211 site_url: http://byron.github.io/google-apis-rs/google-bigtableadmin2-cli site_description: A complete library to interact with Bigtable Admin (protocol v2) @@ -18,6 +18,9 @@ pages: - ['projects_instances-app-profiles-get.md', 'Projects', 'Instances App Profiles Get'] - ['projects_instances-app-profiles-list.md', 'Projects', 'Instances App Profiles List'] - ['projects_instances-app-profiles-patch.md', 'Projects', 'Instances App Profiles Patch'] +- ['projects_instances-clusters-backups-get-iam-policy.md', 'Projects', 'Instances Clusters Backups Get Iam Policy'] +- ['projects_instances-clusters-backups-set-iam-policy.md', 'Projects', 'Instances Clusters Backups Set Iam Policy'] +- ['projects_instances-clusters-backups-test-iam-permissions.md', 'Projects', 'Instances Clusters Backups Test Iam Permissions'] - ['projects_instances-clusters-create.md', 'Projects', 'Instances Clusters Create'] - ['projects_instances-clusters-delete.md', 'Projects', 'Instances Clusters Delete'] - ['projects_instances-clusters-get.md', 'Projects', 'Instances Clusters Get'] diff --git a/gen/bigtableadmin2-cli/src/main.rs b/gen/bigtableadmin2-cli/src/main.rs index 3dfc87ddad..8f8dc41d46 100644 --- a/gen/bigtableadmin2-cli/src/main.rs +++ b/gen/bigtableadmin2-cli/src/main.rs @@ -623,6 +623,263 @@ impl<'n> Engine<'n> { } } + fn _projects_instances_clusters_backups_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_clusters_backups_get_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_clusters_backups_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_clusters_backups_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_clusters_backups_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_clusters_backups_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_instances_clusters_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1183,8 +1440,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1953,8 +2211,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2662,6 +2921,15 @@ impl<'n> Engine<'n> { ("instances-app-profiles-patch", Some(opt)) => { call_result = self._projects_instances_app_profiles_patch(opt, dry_run, &mut err); }, + ("instances-clusters-backups-get-iam-policy", Some(opt)) => { + call_result = self._projects_instances_clusters_backups_get_iam_policy(opt, dry_run, &mut err); + }, + ("instances-clusters-backups-set-iam-policy", Some(opt)) => { + call_result = self._projects_instances_clusters_backups_set_iam_policy(opt, dry_run, &mut err); + }, + ("instances-clusters-backups-test-iam-permissions", Some(opt)) => { + call_result = self._projects_instances_clusters_backups_test_iam_permissions(opt, dry_run, &mut err); + }, ("instances-clusters-create", Some(opt)) => { call_result = self._projects_instances_clusters_create(opt, dry_run, &mut err); }, @@ -2948,16 +3216,16 @@ fn main() { ]), ]), - ("projects", "methods: 'instances-app-profiles-create', 'instances-app-profiles-delete', 'instances-app-profiles-get', 'instances-app-profiles-list', 'instances-app-profiles-patch', 'instances-clusters-create', 'instances-clusters-delete', 'instances-clusters-get', 'instances-clusters-list', 'instances-clusters-update', 'instances-create', 'instances-delete', 'instances-get', 'instances-get-iam-policy', 'instances-list', 'instances-partial-update-instance', 'instances-set-iam-policy', 'instances-tables-check-consistency', 'instances-tables-create', 'instances-tables-delete', 'instances-tables-drop-row-range', 'instances-tables-generate-consistency-token', 'instances-tables-get', 'instances-tables-get-iam-policy', 'instances-tables-list', 'instances-tables-modify-column-families', 'instances-tables-set-iam-policy', 'instances-tables-test-iam-permissions', 'instances-test-iam-permissions', 'instances-update', 'locations-get' and 'locations-list'", vec![ + ("projects", "methods: 'instances-app-profiles-create', 'instances-app-profiles-delete', 'instances-app-profiles-get', 'instances-app-profiles-list', 'instances-app-profiles-patch', 'instances-clusters-backups-get-iam-policy', 'instances-clusters-backups-set-iam-policy', 'instances-clusters-backups-test-iam-permissions', 'instances-clusters-create', 'instances-clusters-delete', 'instances-clusters-get', 'instances-clusters-list', 'instances-clusters-update', 'instances-create', 'instances-delete', 'instances-get', 'instances-get-iam-policy', 'instances-list', 'instances-partial-update-instance', 'instances-set-iam-policy', 'instances-tables-check-consistency', 'instances-tables-create', 'instances-tables-delete', 'instances-tables-drop-row-range', 'instances-tables-generate-consistency-token', 'instances-tables-get', 'instances-tables-get-iam-policy', 'instances-tables-list', 'instances-tables-modify-column-families', 'instances-tables-set-iam-policy', 'instances-tables-test-iam-permissions', 'instances-test-iam-permissions', 'instances-update', 'locations-get' and 'locations-list'", vec![ ("instances-app-profiles-create", Some(r##"Creates an app profile within an instance."##), "Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-app-profiles-create", vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the instance in which to create the new app profile. + Some(r##"Required. The unique name of the instance in which to create the new app profile. Values are of the form - `projects//instances/`."##), + `projects/{project}/instances/{instance}`."##), Some(true), Some(false)), @@ -2985,8 +3253,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the app profile to be deleted. Values are of the form - `projects//instances//appProfiles/`."##), + Some(r##"Required. The unique name of the app profile to be deleted. Values are of the form + `projects/{project}/instances/{instance}/appProfiles/{app_profile}`."##), Some(true), Some(false)), @@ -3008,8 +3276,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the requested app profile. Values are of the form - `projects//instances//appProfiles/`."##), + Some(r##"Required. The unique name of the requested app profile. Values are of the form + `projects/{project}/instances/{instance}/appProfiles/{app_profile}`."##), Some(true), Some(false)), @@ -3031,10 +3299,10 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the instance for which a list of app profiles is + Some(r##"Required. The unique name of the instance for which a list of app profiles is requested. Values are of the form - `projects//instances/`. - Use ` = '-'` to list AppProfiles for all Instances in a project, + `projects/{project}/instances/{instance}`. + Use `{instance} = '-'` to list AppProfiles for all Instances in a project, e.g., `projects/myproject/instances/-`."##), Some(true), Some(false)), @@ -3075,6 +3343,96 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-clusters-backups-get-iam-policy", + Some(r##"Gets the access control policy for a Table or Backup resource. + Returns an empty policy if the resource exists but does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-clusters-backups-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-clusters-backups-set-iam-policy", + Some(r##"Sets the access control policy on a Table or Backup resource. + Replaces any existing policy."##), + "Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-clusters-backups-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-clusters-backups-test-iam-permissions", + Some(r##"Returns permissions that the caller has on the specified table resource."##), + "Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-clusters-backups-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3087,9 +3445,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the instance in which to create the new cluster. + Some(r##"Required. The unique name of the instance in which to create the new cluster. Values are of the form - `projects//instances/`."##), + `projects/{project}/instances/{instance}`."##), Some(true), Some(false)), @@ -3117,8 +3475,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the cluster to be deleted. Values are of the form - `projects//instances//clusters/`."##), + Some(r##"Required. The unique name of the cluster to be deleted. Values are of the form + `projects/{project}/instances/{instance}/clusters/{cluster}`."##), Some(true), Some(false)), @@ -3140,8 +3498,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the requested cluster. Values are of the form - `projects//instances//clusters/`."##), + Some(r##"Required. The unique name of the requested cluster. Values are of the form + `projects/{project}/instances/{instance}/clusters/{cluster}`."##), Some(true), Some(false)), @@ -3163,9 +3521,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the instance for which a list of clusters is requested. - Values are of the form `projects//instances/`. - Use ` = '-'` to list Clusters for all Instances in a project, + Some(r##"Required. The unique name of the instance for which a list of clusters is requested. + Values are of the form `projects/{project}/instances/{instance}`. + Use `{instance} = '-'` to list Clusters for all Instances in a project, e.g., `projects/myproject/instances/-`."##), Some(true), Some(false)), @@ -3188,9 +3546,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"(`OutputOnly`) + Some(r##"Required. (`OutputOnly`) The unique name of the cluster. Values are of the form - `projects//instances//clusters/a-z*`."##), + `projects/{project}/instances/{instance}/clusters/a-z*`."##), Some(true), Some(false)), @@ -3218,8 +3576,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the project in which to create the new instance. - Values are of the form `projects/`."##), + Some(r##"Required. The unique name of the project in which to create the new instance. + Values are of the form `projects/{project}`."##), Some(true), Some(false)), @@ -3247,8 +3605,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the instance to be deleted. - Values are of the form `projects//instances/`."##), + Some(r##"Required. The unique name of the instance to be deleted. + Values are of the form `projects/{project}/instances/{instance}`."##), Some(true), Some(false)), @@ -3270,8 +3628,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the requested instance. Values are of the form - `projects//instances/`."##), + Some(r##"Required. The unique name of the requested instance. Values are of the form + `projects/{project}/instances/{instance}`."##), Some(true), Some(false)), @@ -3323,8 +3681,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the project for which a list of instances is requested. - Values are of the form `projects/`."##), + Some(r##"Required. The unique name of the project for which a list of instances is requested. + Values are of the form `projects/{project}`."##), Some(true), Some(false)), @@ -3347,9 +3705,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"(`OutputOnly`) + Some(r##"Required. (`OutputOnly`) The unique name of the instance. Values are of the form - `projects//instances/a-z+[a-z0-9]`."##), + `projects/{project}/instances/a-z+[a-z0-9]`."##), Some(true), Some(false)), @@ -3409,9 +3767,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the Table for which to check replication consistency. + Some(r##"Required. The unique name of the Table for which to check replication consistency. Values are of the form - `projects//instances//tables/`."##), + `projects/{project}/instances/{instance}/tables/{table}`."##), Some(true), Some(false)), @@ -3441,8 +3799,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the instance in which to create the table. - Values are of the form `projects//instances/`."##), + Some(r##"Required. The unique name of the instance in which to create the table. + Values are of the form `projects/{project}/instances/{instance}`."##), Some(true), Some(false)), @@ -3470,9 +3828,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the table to be deleted. + Some(r##"Required. The unique name of the table to be deleted. Values are of the form - `projects//instances//tables/
          `."##), + `projects/{project}/instances/{instance}/tables/{table}`."##), Some(true), Some(false)), @@ -3496,9 +3854,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the table on which to drop a range of rows. + Some(r##"Required. The unique name of the table on which to drop a range of rows. Values are of the form - `projects//instances//tables/
          `."##), + `projects/{project}/instances/{instance}/tables/{table}`."##), Some(true), Some(false)), @@ -3529,9 +3887,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the Table for which to create a consistency token. + Some(r##"Required. The unique name of the Table for which to create a consistency token. Values are of the form - `projects//instances//tables/
          `."##), + `projects/{project}/instances/{instance}/tables/{table}`."##), Some(true), Some(false)), @@ -3559,9 +3917,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the requested table. + Some(r##"Required. The unique name of the requested table. Values are of the form - `projects//instances//tables/
          `."##), + `projects/{project}/instances/{instance}/tables/{table}`."##), Some(true), Some(false)), @@ -3578,8 +3936,9 @@ fn main() { Some(false)), ]), ("instances-tables-get-iam-policy", - Some(r##"Gets the access control policy for an instance resource. Returns an empty - policy if an table exists but does not have a policy set."##), + Some(r##"Gets the access control policy for a Table or Backup resource. + Returns an empty policy if the resource exists but does not have a policy + set."##), "Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-get-iam-policy", vec![ (Some(r##"resource"##), @@ -3613,8 +3972,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique name of the instance for which tables should be listed. - Values are of the form `projects//instances/`."##), + Some(r##"Required. The unique name of the instance for which tables should be listed. + Values are of the form `projects/{project}/instances/{instance}`."##), Some(true), Some(false)), @@ -3639,9 +3998,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique name of the table whose families should be modified. + Some(r##"Required. The unique name of the table whose families should be modified. Values are of the form - `projects//instances//tables/
          `."##), + `projects/{project}/instances/{instance}/tables/{table}`."##), Some(true), Some(false)), @@ -3664,8 +4023,8 @@ fn main() { Some(false)), ]), ("instances-tables-set-iam-policy", - Some(r##"Sets the access control policy on a table resource. Replaces any existing - policy."##), + Some(r##"Sets the access control policy on a Table or Backup resource. + Replaces any existing policy."##), "Details at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli/projects_instances-tables-set-iam-policy", vec![ (Some(r##"resource"##), @@ -3759,9 +4118,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"(`OutputOnly`) + Some(r##"Required. (`OutputOnly`) The unique name of the instance. Values are of the form - `projects//instances/a-z+[a-z0-9]`."##), + `projects/{project}/instances/a-z+[a-z0-9]`."##), Some(true), Some(false)), @@ -3833,7 +4192,7 @@ fn main() { let mut app = App::new("bigtableadmin2") .author("Sebastian Thiel ") - .version("1.0.12+20190506") + .version("1.0.13+20200211") .about("Administer your Cloud Bigtable tables and instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_bigtableadmin2_cli") .arg(Arg::with_name("url") diff --git a/gen/bigtableadmin2/Cargo.toml b/gen/bigtableadmin2/Cargo.toml index 05080a7cad..bfb7c013a0 100644 --- a/gen/bigtableadmin2/Cargo.toml +++ b/gen/bigtableadmin2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-bigtableadmin2" -version = "1.0.12+20190506" +version = "1.0.13+20200211" authors = ["Sebastian Thiel "] description = "A complete library to interact with Bigtable Admin (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/bigtableadmin2" homepage = "https://cloud.google.com/bigtable/" -documentation = "https://docs.rs/google-bigtableadmin2/1.0.12+20190506" +documentation = "https://docs.rs/google-bigtableadmin2/1.0.13+20200211" license = "MIT" keywords = ["bigtableadmin", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/bigtableadmin2/README.md b/gen/bigtableadmin2/README.md index 8be0c592f4..ade74a32ef 100644 --- a/gen/bigtableadmin2/README.md +++ b/gen/bigtableadmin2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-bigtableadmin2` library allows access to all features of the *Google Bigtable Admin* service. -This documentation was generated from *Bigtable Admin* crate version *1.0.12+20190506*, where *20190506* is the exact revision of the *bigtableadmin:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Bigtable Admin* crate version *1.0.13+20200211*, where *20200211* is the exact revision of the *bigtableadmin:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Bigtable Admin* *v2* API can be found at the [official documentation site](https://cloud.google.com/bigtable/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.BigtableAdmin.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.BigtableAdmin.html) ... -* [operations](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.Operation.html) - * [*cancel*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.OperationGetCall.html) and [*projects operations list*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.OperationProjectOperationListCall.html) +* [operations](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.Operation.html) + * [*cancel*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.OperationGetCall.html) and [*projects operations list*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.OperationProjectOperationListCall.html) * projects - * [*instances app profiles create*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceAppProfileCreateCall.html), [*instances app profiles delete*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceAppProfileDeleteCall.html), [*instances app profiles get*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceAppProfileGetCall.html), [*instances app profiles list*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceAppProfileListCall.html), [*instances app profiles patch*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceAppProfilePatchCall.html), [*instances clusters create*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceClusterCreateCall.html), [*instances clusters delete*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceClusterDeleteCall.html), [*instances clusters get*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceClusterGetCall.html), [*instances clusters list*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceClusterListCall.html), [*instances clusters update*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceClusterUpdateCall.html), [*instances create*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceCreateCall.html), [*instances delete*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceDeleteCall.html), [*instances get*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceGetCall.html), [*instances get iam policy*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceListCall.html), [*instances partial update instance*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstancePartialUpdateInstanceCall.html), [*instances set iam policy*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceSetIamPolicyCall.html), [*instances tables check consistency*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableCheckConsistencyCall.html), [*instances tables create*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableCreateCall.html), [*instances tables delete*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableDeleteCall.html), [*instances tables drop row range*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableDropRowRangeCall.html), [*instances tables generate consistency token*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableGenerateConsistencyTokenCall.html), [*instances tables get*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableGetCall.html), [*instances tables get iam policy*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableGetIamPolicyCall.html), [*instances tables list*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableListCall.html), [*instances tables modify column families*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableModifyColumnFamilyCall.html), [*instances tables set iam policy*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableSetIamPolicyCall.html), [*instances tables test iam permissions*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTableTestIamPermissionCall.html), [*instances test iam permissions*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceTestIamPermissionCall.html), [*instances update*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectInstanceUpdateCall.html), [*locations get*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectLocationGetCall.html) and [*locations list*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.ProjectLocationListCall.html) + * [*instances app profiles create*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceAppProfileCreateCall.html), [*instances app profiles delete*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceAppProfileDeleteCall.html), [*instances app profiles get*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceAppProfileGetCall.html), [*instances app profiles list*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceAppProfileListCall.html), [*instances app profiles patch*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceAppProfilePatchCall.html), [*instances clusters backups get iam policy*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterBackupGetIamPolicyCall.html), [*instances clusters backups set iam policy*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterBackupSetIamPolicyCall.html), [*instances clusters backups test iam permissions*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterBackupTestIamPermissionCall.html), [*instances clusters create*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterCreateCall.html), [*instances clusters delete*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterDeleteCall.html), [*instances clusters get*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterGetCall.html), [*instances clusters list*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterListCall.html), [*instances clusters update*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceClusterUpdateCall.html), [*instances create*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceCreateCall.html), [*instances delete*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceDeleteCall.html), [*instances get*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceGetCall.html), [*instances get iam policy*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceListCall.html), [*instances partial update instance*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstancePartialUpdateInstanceCall.html), [*instances set iam policy*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceSetIamPolicyCall.html), [*instances tables check consistency*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableCheckConsistencyCall.html), [*instances tables create*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableCreateCall.html), [*instances tables delete*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableDeleteCall.html), [*instances tables drop row range*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableDropRowRangeCall.html), [*instances tables generate consistency token*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableGenerateConsistencyTokenCall.html), [*instances tables get*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableGetCall.html), [*instances tables get iam policy*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableGetIamPolicyCall.html), [*instances tables list*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableListCall.html), [*instances tables modify column families*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableModifyColumnFamilyCall.html), [*instances tables set iam policy*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableSetIamPolicyCall.html), [*instances tables test iam permissions*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTableTestIamPermissionCall.html), [*instances test iam permissions*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceTestIamPermissionCall.html), [*instances update*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectInstanceUpdateCall.html), [*locations get*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectLocationGetCall.html) and [*locations list*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.ProjectLocationListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/struct.BigtableAdmin.html)** +* **[Hub](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/struct.BigtableAdmin.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.Part.html)** + * **[Parts](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-bigtableadmin2/1.0.12+20190506/google_bigtableadmin2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-bigtableadmin2/1.0.13+20200211/google_bigtableadmin2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/bigtableadmin2/src/lib.rs b/gen/bigtableadmin2/src/lib.rs index d67b57d8f1..e7a47235d5 100644 --- a/gen/bigtableadmin2/src/lib.rs +++ b/gen/bigtableadmin2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Bigtable Admin* crate version *1.0.12+20190506*, where *20190506* is the exact revision of the *bigtableadmin:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Bigtable Admin* crate version *1.0.13+20200211*, where *20200211* is the exact revision of the *bigtableadmin:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Bigtable Admin* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/bigtable/). @@ -14,7 +14,7 @@ //! * [operations](struct.Operation.html) //! * [*cancel*](struct.OperationCancelCall.html), [*delete*](struct.OperationDeleteCall.html), [*get*](struct.OperationGetCall.html) and [*projects operations list*](struct.OperationProjectOperationListCall.html) //! * projects -//! * [*instances app profiles create*](struct.ProjectInstanceAppProfileCreateCall.html), [*instances app profiles delete*](struct.ProjectInstanceAppProfileDeleteCall.html), [*instances app profiles get*](struct.ProjectInstanceAppProfileGetCall.html), [*instances app profiles list*](struct.ProjectInstanceAppProfileListCall.html), [*instances app profiles patch*](struct.ProjectInstanceAppProfilePatchCall.html), [*instances clusters create*](struct.ProjectInstanceClusterCreateCall.html), [*instances clusters delete*](struct.ProjectInstanceClusterDeleteCall.html), [*instances clusters get*](struct.ProjectInstanceClusterGetCall.html), [*instances clusters list*](struct.ProjectInstanceClusterListCall.html), [*instances clusters update*](struct.ProjectInstanceClusterUpdateCall.html), [*instances create*](struct.ProjectInstanceCreateCall.html), [*instances delete*](struct.ProjectInstanceDeleteCall.html), [*instances get*](struct.ProjectInstanceGetCall.html), [*instances get iam policy*](struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](struct.ProjectInstanceListCall.html), [*instances partial update instance*](struct.ProjectInstancePartialUpdateInstanceCall.html), [*instances set iam policy*](struct.ProjectInstanceSetIamPolicyCall.html), [*instances tables check consistency*](struct.ProjectInstanceTableCheckConsistencyCall.html), [*instances tables create*](struct.ProjectInstanceTableCreateCall.html), [*instances tables delete*](struct.ProjectInstanceTableDeleteCall.html), [*instances tables drop row range*](struct.ProjectInstanceTableDropRowRangeCall.html), [*instances tables generate consistency token*](struct.ProjectInstanceTableGenerateConsistencyTokenCall.html), [*instances tables get*](struct.ProjectInstanceTableGetCall.html), [*instances tables get iam policy*](struct.ProjectInstanceTableGetIamPolicyCall.html), [*instances tables list*](struct.ProjectInstanceTableListCall.html), [*instances tables modify column families*](struct.ProjectInstanceTableModifyColumnFamilyCall.html), [*instances tables set iam policy*](struct.ProjectInstanceTableSetIamPolicyCall.html), [*instances tables test iam permissions*](struct.ProjectInstanceTableTestIamPermissionCall.html), [*instances test iam permissions*](struct.ProjectInstanceTestIamPermissionCall.html), [*instances update*](struct.ProjectInstanceUpdateCall.html), [*locations get*](struct.ProjectLocationGetCall.html) and [*locations list*](struct.ProjectLocationListCall.html) +//! * [*instances app profiles create*](struct.ProjectInstanceAppProfileCreateCall.html), [*instances app profiles delete*](struct.ProjectInstanceAppProfileDeleteCall.html), [*instances app profiles get*](struct.ProjectInstanceAppProfileGetCall.html), [*instances app profiles list*](struct.ProjectInstanceAppProfileListCall.html), [*instances app profiles patch*](struct.ProjectInstanceAppProfilePatchCall.html), [*instances clusters backups get iam policy*](struct.ProjectInstanceClusterBackupGetIamPolicyCall.html), [*instances clusters backups set iam policy*](struct.ProjectInstanceClusterBackupSetIamPolicyCall.html), [*instances clusters backups test iam permissions*](struct.ProjectInstanceClusterBackupTestIamPermissionCall.html), [*instances clusters create*](struct.ProjectInstanceClusterCreateCall.html), [*instances clusters delete*](struct.ProjectInstanceClusterDeleteCall.html), [*instances clusters get*](struct.ProjectInstanceClusterGetCall.html), [*instances clusters list*](struct.ProjectInstanceClusterListCall.html), [*instances clusters update*](struct.ProjectInstanceClusterUpdateCall.html), [*instances create*](struct.ProjectInstanceCreateCall.html), [*instances delete*](struct.ProjectInstanceDeleteCall.html), [*instances get*](struct.ProjectInstanceGetCall.html), [*instances get iam policy*](struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](struct.ProjectInstanceListCall.html), [*instances partial update instance*](struct.ProjectInstancePartialUpdateInstanceCall.html), [*instances set iam policy*](struct.ProjectInstanceSetIamPolicyCall.html), [*instances tables check consistency*](struct.ProjectInstanceTableCheckConsistencyCall.html), [*instances tables create*](struct.ProjectInstanceTableCreateCall.html), [*instances tables delete*](struct.ProjectInstanceTableDeleteCall.html), [*instances tables drop row range*](struct.ProjectInstanceTableDropRowRangeCall.html), [*instances tables generate consistency token*](struct.ProjectInstanceTableGenerateConsistencyTokenCall.html), [*instances tables get*](struct.ProjectInstanceTableGetCall.html), [*instances tables get iam policy*](struct.ProjectInstanceTableGetIamPolicyCall.html), [*instances tables list*](struct.ProjectInstanceTableListCall.html), [*instances tables modify column families*](struct.ProjectInstanceTableModifyColumnFamilyCall.html), [*instances tables set iam policy*](struct.ProjectInstanceTableSetIamPolicyCall.html), [*instances tables test iam permissions*](struct.ProjectInstanceTableTestIamPermissionCall.html), [*instances test iam permissions*](struct.ProjectInstanceTestIamPermissionCall.html), [*instances update*](struct.ProjectInstanceUpdateCall.html), [*locations get*](struct.ProjectLocationGetCall.html) and [*locations list*](struct.ProjectLocationListCall.html) //! //! //! @@ -365,7 +365,7 @@ impl<'a, C, A> BigtableAdmin BigtableAdmin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://bigtableadmin.googleapis.com/".to_string(), _root_url: "https://bigtableadmin.googleapis.com/".to_string(), } @@ -379,7 +379,7 @@ impl<'a, C, A> BigtableAdmin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -419,7 +419,7 @@ impl<'a, C, A> BigtableAdmin /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CheckConsistencyRequest { - /// The token created using GenerateConsistencyToken for the Table. + /// Required. The token created using GenerateConsistencyToken for the Table. #[serde(rename="consistencyToken")] pub consistency_token: Option, } @@ -465,6 +465,7 @@ impl ResponseResult for ListInstancesResponse {} /// /// * [instances tables set iam policy projects](struct.ProjectInstanceTableSetIamPolicyCall.html) (request) /// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.html) (request) +/// * [instances clusters backups set iam policy projects](struct.ProjectInstanceClusterBackupSetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetIamPolicyRequest { @@ -522,7 +523,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -531,6 +532,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -582,7 +603,7 @@ impl RequestValue for DropRowRangeRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Instance { - /// The descriptive name for this instance as it appears in UIs. + /// Required. The descriptive name for this instance as it appears in UIs. /// Can be changed at any time, but should be kept globally unique /// to avoid confusion. #[serde(rename="displayName")] @@ -590,7 +611,7 @@ pub struct Instance { /// (`OutputOnly`) /// The current state of the instance. pub state: Option, - /// Labels are a flexible and lightweight mechanism for organizing cloud + /// Required. Labels are a flexible and lightweight mechanism for organizing cloud /// resources into groups that reflect a customer's organizational needs and /// deployment strategies. They can be used to filter resources and aggregate /// metrics. @@ -602,12 +623,12 @@ pub struct Instance { /// * No more than 64 labels can be associated with a given resource. /// * Keys and values must both be under 128 bytes. pub labels: Option>, - /// The type of the instance. Defaults to `PRODUCTION`. + /// Required. The type of the instance. Defaults to `PRODUCTION`. #[serde(rename="type")] pub type_: Option, - /// (`OutputOnly`) + /// Required. (`OutputOnly`) /// The unique name of the instance. Values are of the form - /// `projects//instances/a-z+[a-z0-9]`. + /// `projects/{project}/instances/a-z+[a-z0-9]`. pub name: Option, } @@ -761,10 +782,11 @@ pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} -/// Read/write requests may be routed to any cluster in the instance, and will -/// fail over to another cluster in the event of transient errors or delays. -/// Choosing this option sacrifices read-your-writes consistency to improve -/// availability. +/// Read/write requests are routed to the nearest cluster in the instance, and +/// will fail over to the nearest cluster that is available in the event of +/// transient errors or delays. Clusters in a region are considered +/// equidistant. Choosing this option sacrifices read-your-writes consistency +/// to improve availability. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -776,58 +798,14 @@ impl Part for MultiClusterRoutingUseAny {} /// The `Status` type defines a logical error model that is suitable for /// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](https://github.com/grpc). The error model is designed to be: +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. /// -/// * Simple to use and understand for most users -/// * Flexible enough to meet unexpected needs -/// -/// # Overview -/// -/// The `Status` message contains three pieces of data: error code, error -/// message, and error details. The error code should be an enum value of -/// google.rpc.Code, but it may accept additional error codes if needed. The -/// error message should be a developer-facing English message that helps -/// developers *understand* and *resolve* the error. If a localized user-facing -/// error message is needed, put the localized message in the error details or -/// localize it in the client. The optional error details may contain arbitrary -/// information about the error. There is a predefined set of error detail types -/// in the package `google.rpc` that can be used for common error conditions. -/// -/// # Language mapping -/// -/// The `Status` message is the logical representation of the error model, but it -/// is not necessarily the actual wire format. When the `Status` message is -/// exposed in different client libraries and different wire protocols, it can be -/// mapped differently. For example, it will likely be mapped to some exceptions -/// in Java, but more likely mapped to some error codes in C. -/// -/// # Other uses -/// -/// The error model and the `Status` message can be used in a variety of -/// environments, either with or without APIs, to provide a -/// consistent developer experience across different environments. -/// -/// Example uses of this error model include: -/// -/// * Partial errors. If a service needs to return partial errors to the client, -/// it may embed the `Status` in the normal response to indicate the partial -/// errors. -/// -/// * Workflow errors. A typical workflow has multiple steps. Each step may -/// have a `Status` message for error reporting. -/// -/// * Batch operations. If a client uses batch request and batch response, the -/// `Status` message should be used directly inside batch response, one for -/// each error sub-response. -/// -/// * Asynchronous operations. If an API call embeds asynchronous operation -/// results in its response, the status of those operations should be -/// represented directly using the `Status` message. -/// -/// * Logging. If some API errors are stored in logs, the message `Status` could -/// be used directly after any stripping needed for security/privacy reasons. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Status { /// A developer-facing error message, which should be in English. Any @@ -844,37 +822,50 @@ pub struct Status { impl Part for Status {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -882,25 +873,33 @@ impl Part for Status {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [instances tables set iam policy projects](struct.ProjectInstanceTableSetIamPolicyCall.html) (response) -/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (response) +/// * [instances clusters backups get iam policy projects](struct.ProjectInstanceClusterBackupGetIamPolicyCall.html) (response) /// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.html) (response) +/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (response) +/// * [instances tables set iam policy projects](struct.ProjectInstanceTableSetIamPolicyCall.html) (response) /// * [instances tables get iam policy projects](struct.ProjectInstanceTableGetIamPolicyCall.html) (response) +/// * [instances clusters backups set iam policy projects](struct.ProjectInstanceClusterBackupSetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { /// Specifies cloud audit logging configuration for this policy. @@ -914,13 +913,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -947,7 +969,7 @@ pub struct Cluster { /// parent instance's tables, unless explicitly overridden. #[serde(rename="defaultStorageType")] pub default_storage_type: Option, - /// The number of nodes allocated to this cluster. More nodes enable higher + /// Required. The number of nodes allocated to this cluster. More nodes enable higher /// throughput and more consistent performance. #[serde(rename="serveNodes")] pub serve_nodes: Option, @@ -955,11 +977,11 @@ pub struct Cluster { /// The location where this cluster's nodes and storage reside. For best /// performance, clients should be located as close as possible to this /// cluster. Currently only zones are supported, so values should be of the - /// form `projects//locations/`. + /// form `projects/{project}/locations/{zone}`. pub location: Option, - /// (`OutputOnly`) + /// Required. (`OutputOnly`) /// The unique name of the cluster. Values are of the form - /// `projects//instances//clusters/a-z*`. + /// `projects/{project}/instances/{instance}/clusters/a-z*`. pub name: Option, /// (`OutputOnly`) /// The current state of the cluster. @@ -982,7 +1004,7 @@ impl ResponseResult for Cluster {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyColumnFamiliesRequest { - /// Modifications to be atomically applied to the specified table's families. + /// Required. Modifications to be atomically applied to the specified table's families. /// Entries are applied in order, meaning that earlier modifications can be /// masked by later ones (in the case of repeated updates to the same family, /// for example). @@ -1026,21 +1048,21 @@ impl Part for GcRule {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateInstanceRequest { - /// The ID to be used when referring to the new instance within its project, + /// Required. The ID to be used when referring to the new instance within its project, /// e.g., just `myinstance` rather than /// `projects/myproject/instances/myinstance`. #[serde(rename="instanceId")] pub instance_id: Option, - /// The clusters to be created within the instance, mapped by desired + /// Required. The clusters to be created within the instance, mapped by desired /// cluster ID, e.g., just `mycluster` rather than /// `projects/myproject/instances/myinstance/clusters/mycluster`. /// Fields marked `OutputOnly` must be left blank. - /// Currently, at most two clusters can be specified. + /// Currently, at most four clusters can be specified. pub clusters: Option>, - /// The unique name of the project in which to create the new instance. - /// Values are of the form `projects/`. + /// Required. The unique name of the project in which to create the new instance. + /// Values are of the form `projects/{project}`. pub parent: Option, - /// The instance to create. + /// Required. The instance to create. /// Fields marked `OutputOnly` must be left blank. pub instance: Option, } @@ -1070,7 +1092,7 @@ impl Part for Intersection {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1081,7 +1103,7 @@ impl Part for Intersection {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1106,11 +1128,16 @@ impl Part for AuditLogConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [instances clusters backups get iam policy projects](struct.ProjectInstanceClusterBackupGetIamPolicyCall.html) (request) /// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (request) /// * [instances tables get iam policy projects](struct.ProjectInstanceTableGetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} impl RequestValue for GetIamPolicyRequest {} @@ -1122,6 +1149,7 @@ impl RequestValue for GetIamPolicyRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [instances clusters backups test iam permissions projects](struct.ProjectInstanceClusterBackupTestIamPermissionCall.html) (request) /// * [instances test iam permissions projects](struct.ProjectInstanceTestIamPermissionCall.html) (request) /// * [instances tables test iam permissions projects](struct.ProjectInstanceTableTestIamPermissionCall.html) (request) /// @@ -1137,30 +1165,59 @@ pub struct TestIamPermissionsRequest { impl RequestValue for TestIamPermissionsRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1204,6 +1261,7 @@ impl ResponseResult for ListClustersResponse {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [instances clusters backups test iam permissions projects](struct.ProjectInstanceClusterBackupTestIamPermissionCall.html) (response) /// * [instances test iam permissions projects](struct.ProjectInstanceTestIamPermissionCall.html) (response) /// * [instances tables test iam permissions projects](struct.ProjectInstanceTableTestIamPermissionCall.html) (response) /// @@ -1272,7 +1330,7 @@ impl ResponseResult for ListAppProfilesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateTableRequest { - /// The Table to create. + /// Required. The Table to create. pub table: Option
          , /// The optional list of row keys that will be used to initially split the /// table into several tablets (tablets are similar to HBase regions). @@ -1292,8 +1350,9 @@ pub struct CreateTableRequest { /// * Tablet 5 `[other, ) => {"other", "zz"}.` #[serde(rename="initialSplits")] pub initial_splits: Option>, - /// The name by which the new table should be referred to within the parent - /// instance, e.g., `foobar` rather than `/tables/foobar`. + /// Required. The name by which the new table should be referred to within the parent + /// instance, e.g., `foobar` rather than `{parent}/tables/foobar`. + /// Maximum 50 characters. #[serde(rename="tableId")] pub table_id: Option, } @@ -1336,7 +1395,7 @@ impl ResponseResult for ListOperationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AppProfile { - /// Use a multi-cluster routing policy that may pick any cluster. + /// Use a multi-cluster routing policy. #[serde(rename="multiClusterRoutingUseAny")] pub multi_cluster_routing_use_any: Option, /// Strongly validated etag for optimistic concurrency control. Preserve the @@ -1383,8 +1442,29 @@ pub struct CheckConsistencyResponse { impl ResponseResult for CheckConsistencyResponse {} +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + /// Unconditionally routes all read/write requests to a specific cluster. -/// This option preserves read-your-writes consistency, but does not improve +/// This option preserves read-your-writes consistency but does not improve /// availability. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1410,8 +1490,7 @@ impl Part for SingleClusterRouting {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClusterState { - /// Output only. - /// The state of replication for the table in this cluster. + /// Output only. The state of replication for the table in this cluster. #[serde(rename="replicationState")] pub replication_state: Option, } @@ -1440,7 +1519,7 @@ impl Part for ClusterState {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1452,7 +1531,7 @@ impl Part for ClusterState {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1460,7 +1539,7 @@ impl Part for ClusterState {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1469,9 +1548,9 @@ impl Part for ClusterState {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1518,8 +1597,7 @@ impl RequestValue for GenerateConsistencyTokenRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Table { - /// Output only. - /// Map from cluster ID to per-cluster table state. + /// Output only. Map from cluster ID to per-cluster table state. /// If it could not be determined whether or not the table has data in a /// particular cluster (for example, if its zone is unavailable), then /// there will be an entry for the cluster with UNKNOWN `replication_status`. @@ -1531,8 +1609,7 @@ pub struct Table { /// Views: `SCHEMA_VIEW`, `FULL` #[serde(rename="columnFamilies")] pub column_families: Option>, - /// Output only. - /// The unique name of the table. Values are of the form + /// Output only. The unique name of the table. Values are of the form /// `projects//instances//tables/_a-zA-Z0-9*`. /// Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` pub name: Option, @@ -1584,7 +1661,7 @@ pub struct Operation { pub response: Option>, /// The server-assigned name, which is only unique within the same service that /// originally returns it. If you use the default HTTP mapping, the - /// `name` should have the format of `operations/some/unique/name`. + /// `name` should be a resource name ending with `operations/{unique_id}`. pub name: Option, /// Service-specific metadata associated with the operation. It typically /// contains progress information and common metadata such as create time. @@ -1786,7 +1863,7 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// ::default(), None); /// let mut hub = BigtableAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `instances_app_profiles_create(...)`, `instances_app_profiles_delete(...)`, `instances_app_profiles_get(...)`, `instances_app_profiles_list(...)`, `instances_app_profiles_patch(...)`, `instances_clusters_create(...)`, `instances_clusters_delete(...)`, `instances_clusters_get(...)`, `instances_clusters_list(...)`, `instances_clusters_update(...)`, `instances_create(...)`, `instances_delete(...)`, `instances_get(...)`, `instances_get_iam_policy(...)`, `instances_list(...)`, `instances_partial_update_instance(...)`, `instances_set_iam_policy(...)`, `instances_tables_check_consistency(...)`, `instances_tables_create(...)`, `instances_tables_delete(...)`, `instances_tables_drop_row_range(...)`, `instances_tables_generate_consistency_token(...)`, `instances_tables_get(...)`, `instances_tables_get_iam_policy(...)`, `instances_tables_list(...)`, `instances_tables_modify_column_families(...)`, `instances_tables_set_iam_policy(...)`, `instances_tables_test_iam_permissions(...)`, `instances_test_iam_permissions(...)`, `instances_update(...)`, `locations_get(...)` and `locations_list(...)` +/// // like `instances_app_profiles_create(...)`, `instances_app_profiles_delete(...)`, `instances_app_profiles_get(...)`, `instances_app_profiles_list(...)`, `instances_app_profiles_patch(...)`, `instances_clusters_backups_get_iam_policy(...)`, `instances_clusters_backups_set_iam_policy(...)`, `instances_clusters_backups_test_iam_permissions(...)`, `instances_clusters_create(...)`, `instances_clusters_delete(...)`, `instances_clusters_get(...)`, `instances_clusters_list(...)`, `instances_clusters_update(...)`, `instances_create(...)`, `instances_delete(...)`, `instances_get(...)`, `instances_get_iam_policy(...)`, `instances_list(...)`, `instances_partial_update_instance(...)`, `instances_set_iam_policy(...)`, `instances_tables_check_consistency(...)`, `instances_tables_create(...)`, `instances_tables_delete(...)`, `instances_tables_drop_row_range(...)`, `instances_tables_generate_consistency_token(...)`, `instances_tables_get(...)`, `instances_tables_get_iam_policy(...)`, `instances_tables_list(...)`, `instances_tables_modify_column_families(...)`, `instances_tables_set_iam_policy(...)`, `instances_tables_test_iam_permissions(...)`, `instances_test_iam_permissions(...)`, `instances_update(...)`, `locations_get(...)` and `locations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1811,9 +1888,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The unique name of the Table for which to create a consistency token. + /// * `name` - Required. The unique name of the Table for which to create a consistency token. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. pub fn instances_tables_generate_consistency_token(&self, request: GenerateConsistencyTokenRequest, name: &str) -> ProjectInstanceTableGenerateConsistencyTokenCall<'a, C, A> { ProjectInstanceTableGenerateConsistencyTokenCall { hub: self.hub, @@ -1851,9 +1928,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The unique name of the table on which to drop a range of rows. + /// * `name` - Required. The unique name of the table on which to drop a range of rows. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. pub fn instances_tables_drop_row_range(&self, request: DropRowRangeRequest, name: &str) -> ProjectInstanceTableDropRowRangeCall<'a, C, A> { ProjectInstanceTableDropRowRangeCall { hub: self.hub, @@ -1871,8 +1948,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the app profile to be deleted. Values are of the form - /// `projects//instances//appProfiles/`. + /// * `name` - Required. The unique name of the app profile to be deleted. Values are of the form + /// `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. pub fn instances_app_profiles_delete(&self, name: &str) -> ProjectInstanceAppProfileDeleteCall<'a, C, A> { ProjectInstanceAppProfileDeleteCall { hub: self.hub, @@ -1884,6 +1961,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists information about clusters in an instance. + /// + /// # Arguments + /// + /// * `parent` - Required. The unique name of the instance for which a list of clusters is requested. + /// Values are of the form `projects/{project}/instances/{instance}`. + /// Use `{instance} = '-'` to list Clusters for all Instances in a project, + /// e.g., `projects/myproject/instances/-`. + pub fn instances_clusters_list(&self, parent: &str) -> ProjectInstanceClusterListCall<'a, C, A> { + ProjectInstanceClusterListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Create an instance within a project. @@ -1891,8 +1989,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The unique name of the project in which to create the new instance. - /// Values are of the form `projects/`. + /// * `parent` - Required. The unique name of the project in which to create the new instance. + /// Values are of the form `projects/{project}`. pub fn instances_create(&self, request: CreateInstanceRequest, parent: &str) -> ProjectInstanceCreateCall<'a, C, A> { ProjectInstanceCreateCall { hub: self.hub, @@ -1911,9 +2009,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The unique name of the instance in which to create the new cluster. + /// * `parent` - Required. The unique name of the instance in which to create the new cluster. /// Values are of the form - /// `projects//instances/`. + /// `projects/{project}/instances/{instance}`. pub fn instances_clusters_create(&self, request: Cluster, parent: &str) -> ProjectInstanceClusterCreateCall<'a, C, A> { ProjectInstanceClusterCreateCall { hub: self.hub, @@ -1932,9 +2030,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the requested table. + /// * `name` - Required. The unique name of the requested table. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. pub fn instances_tables_get(&self, name: &str) -> ProjectInstanceTableGetCall<'a, C, A> { ProjectInstanceTableGetCall { hub: self.hub, @@ -1975,10 +2073,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The unique name of the instance for which a list of app profiles is + /// * `parent` - Required. The unique name of the instance for which a list of app profiles is /// requested. Values are of the form - /// `projects//instances/`. - /// Use ` = '-'` to list AppProfiles for all Instances in a project, + /// `projects/{project}/instances/{instance}`. + /// Use `{instance} = '-'` to list AppProfiles for all Instances in a project, /// e.g., `projects/myproject/instances/-`. pub fn instances_app_profiles_list(&self, parent: &str) -> ProjectInstanceAppProfileListCall<'a, C, A> { ProjectInstanceAppProfileListCall { @@ -1999,9 +2097,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - (`OutputOnly`) + /// * `name` - Required. (`OutputOnly`) /// The unique name of the cluster. Values are of the form - /// `projects//instances//clusters/a-z*`. + /// `projects/{project}/instances/{instance}/clusters/a-z*`. pub fn instances_clusters_update(&self, request: Cluster, name: &str) -> ProjectInstanceClusterUpdateCall<'a, C, A> { ProjectInstanceClusterUpdateCall { hub: self.hub, @@ -2013,6 +2111,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that the caller has on the specified table resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn instances_clusters_backups_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> { + ProjectInstanceClusterBackupTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the access control policy on an instance resource. Replaces any @@ -2043,9 +2161,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The unique name of the Table for which to check replication consistency. + /// * `name` - Required. The unique name of the Table for which to check replication consistency. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. pub fn instances_tables_check_consistency(&self, request: CheckConsistencyRequest, name: &str) -> ProjectInstanceTableCheckConsistencyCall<'a, C, A> { ProjectInstanceTableCheckConsistencyCall { hub: self.hub, @@ -2100,8 +2218,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the access control policy for an instance resource. Returns an empty - /// policy if an table exists but does not have a policy set. + /// Gets the access control policy for a Table or Backup resource. + /// Returns an empty policy if the resource exists but does not have a policy + /// set. /// /// # Arguments /// @@ -2125,8 +2244,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the requested app profile. Values are of the form - /// `projects//instances//appProfiles/`. + /// * `name` - Required. The unique name of the requested app profile. Values are of the form + /// `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. pub fn instances_app_profiles_get(&self, name: &str) -> ProjectInstanceAppProfileGetCall<'a, C, A> { ProjectInstanceAppProfileGetCall { hub: self.hub, @@ -2143,8 +2262,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the instance to be deleted. - /// Values are of the form `projects//instances/`. + /// * `name` - Required. The unique name of the instance to be deleted. + /// Values are of the form `projects/{project}/instances/{instance}`. pub fn instances_delete(&self, name: &str) -> ProjectInstanceDeleteCall<'a, C, A> { ProjectInstanceDeleteCall { hub: self.hub, @@ -2157,19 +2276,20 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists information about clusters in an instance. + /// Gets the access control policy for a Table or Backup resource. + /// Returns an empty policy if the resource exists but does not have a policy + /// set. /// /// # Arguments /// - /// * `parent` - The unique name of the instance for which a list of clusters is requested. - /// Values are of the form `projects//instances/`. - /// Use ` = '-'` to list Clusters for all Instances in a project, - /// e.g., `projects/myproject/instances/-`. - pub fn instances_clusters_list(&self, parent: &str) -> ProjectInstanceClusterListCall<'a, C, A> { - ProjectInstanceClusterListCall { + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn instances_clusters_backups_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> { + ProjectInstanceClusterBackupGetIamPolicyCall { hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), + _request: request, + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2185,8 +2305,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The unique name of the instance in which to create the table. - /// Values are of the form `projects//instances/`. + /// * `parent` - Required. The unique name of the instance in which to create the table. + /// Values are of the form `projects/{project}/instances/{instance}`. pub fn instances_tables_create(&self, request: CreateTableRequest, parent: &str) -> ProjectInstanceTableCreateCall<'a, C, A> { ProjectInstanceTableCreateCall { hub: self.hub, @@ -2204,8 +2324,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The unique name of the instance for which tables should be listed. - /// Values are of the form `projects//instances/`. + /// * `parent` - Required. The unique name of the instance for which tables should be listed. + /// Values are of the form `projects/{project}/instances/{instance}`. pub fn instances_tables_list(&self, parent: &str) -> ProjectInstanceTableListCall<'a, C, A> { ProjectInstanceTableListCall { hub: self.hub, @@ -2225,8 +2345,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the requested cluster. Values are of the form - /// `projects//instances//clusters/`. + /// * `name` - Required. The unique name of the requested cluster. Values are of the form + /// `projects/{project}/instances/{instance}/clusters/{cluster}`. pub fn instances_clusters_get(&self, name: &str) -> ProjectInstanceClusterGetCall<'a, C, A> { ProjectInstanceClusterGetCall { hub: self.hub, @@ -2245,9 +2365,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - (`OutputOnly`) + /// * `name` - Required. (`OutputOnly`) /// The unique name of the instance. Values are of the form - /// `projects//instances/a-z+[a-z0-9]`. + /// `projects/{project}/instances/a-z+[a-z0-9]`. pub fn instances_partial_update_instance(&self, request: Instance, name: &str) -> ProjectInstancePartialUpdateInstanceCall<'a, C, A> { ProjectInstancePartialUpdateInstanceCall { hub: self.hub, @@ -2266,8 +2386,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the requested instance. Values are of the form - /// `projects//instances/`. + /// * `name` - Required. The unique name of the requested instance. Values are of the form + /// `projects/{project}/instances/{instance}`. pub fn instances_get(&self, name: &str) -> ProjectInstanceGetCall<'a, C, A> { ProjectInstanceGetCall { hub: self.hub, @@ -2287,9 +2407,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - (`OutputOnly`) + /// * `name` - Required. (`OutputOnly`) /// The unique name of the instance. Values are of the form - /// `projects//instances/a-z+[a-z0-9]`. + /// `projects/{project}/instances/a-z+[a-z0-9]`. pub fn instances_update(&self, request: Instance, name: &str) -> ProjectInstanceUpdateCall<'a, C, A> { ProjectInstanceUpdateCall { hub: self.hub, @@ -2307,8 +2427,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The unique name of the project for which a list of instances is requested. - /// Values are of the form `projects/`. + /// * `parent` - Required. The unique name of the project for which a list of instances is requested. + /// Values are of the form `projects/{project}`. pub fn instances_list(&self, parent: &str) -> ProjectInstanceListCall<'a, C, A> { ProjectInstanceListCall { hub: self.hub, @@ -2327,9 +2447,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The unique name of the instance in which to create the new app profile. + /// * `parent` - Required. The unique name of the instance in which to create the new app profile. /// Values are of the form - /// `projects//instances/`. + /// `projects/{project}/instances/{instance}`. pub fn instances_app_profiles_create(&self, request: AppProfile, parent: &str) -> ProjectInstanceAppProfileCreateCall<'a, C, A> { ProjectInstanceAppProfileCreateCall { hub: self.hub, @@ -2353,9 +2473,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The unique name of the table whose families should be modified. + /// * `name` - Required. The unique name of the table whose families should be modified. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. pub fn instances_tables_modify_column_families(&self, request: ModifyColumnFamiliesRequest, name: &str) -> ProjectInstanceTableModifyColumnFamilyCall<'a, C, A> { ProjectInstanceTableModifyColumnFamilyCall { hub: self.hub, @@ -2369,8 +2489,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on a table resource. Replaces any existing - /// policy. + /// Sets the access control policy on a Table or Backup resource. + /// Replaces any existing policy. /// /// # Arguments /// @@ -2394,8 +2514,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the cluster to be deleted. Values are of the form - /// `projects//instances//clusters/`. + /// * `name` - Required. The unique name of the cluster to be deleted. Values are of the form + /// `projects/{project}/instances/{instance}/clusters/{cluster}`. pub fn instances_clusters_delete(&self, name: &str) -> ProjectInstanceClusterDeleteCall<'a, C, A> { ProjectInstanceClusterDeleteCall { hub: self.hub, @@ -2432,9 +2552,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique name of the table to be deleted. + /// * `name` - Required. The unique name of the table to be deleted. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. pub fn instances_tables_delete(&self, name: &str) -> ProjectInstanceTableDeleteCall<'a, C, A> { ProjectInstanceTableDeleteCall { hub: self.hub, @@ -2445,6 +2565,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on a Table or Backup resource. + /// Replaces any existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn instances_clusters_backups_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> { + ProjectInstanceClusterBackupSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns permissions that the caller has on the specified table resource. @@ -3734,9 +3875,9 @@ impl<'a, C, A> ProjectInstanceTableGenerateConsistencyTokenCall<'a, C, A> where self._request = new_value; self } - /// The unique name of the Table for which to create a consistency token. + /// Required. The unique name of the Table for which to create a consistency token. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. /// /// Sets the *name* path property to the given value. /// @@ -4265,9 +4406,9 @@ impl<'a, C, A> ProjectInstanceTableDropRowRangeCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The unique name of the table on which to drop a range of rows. + /// Required. The unique name of the table on which to drop a range of rows. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. /// /// Sets the *name* path property to the given value. /// @@ -4520,8 +4661,8 @@ impl<'a, C, A> ProjectInstanceAppProfileDeleteCall<'a, C, A> where C: BorrowMut< } - /// The unique name of the app profile to be deleted. Values are of the form - /// `projects//instances//appProfiles/`. + /// Required. The unique name of the app profile to be deleted. Values are of the form + /// `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. /// /// Sets the *name* path property to the given value. /// @@ -4531,7 +4672,7 @@ impl<'a, C, A> ProjectInstanceAppProfileDeleteCall<'a, C, A> where C: BorrowMut< self._name = new_value.to_string(); self } - /// If true, ignore safety checks when deleting the app profile. + /// Required. If true, ignore safety checks when deleting the app profile. /// /// Sets the *ignore warnings* query property to the given value. pub fn ignore_warnings(mut self, new_value: bool) -> ProjectInstanceAppProfileDeleteCall<'a, C, A> { @@ -4601,6 +4742,269 @@ impl<'a, C, A> ProjectInstanceAppProfileDeleteCall<'a, C, A> where C: BorrowMut< } +/// Lists information about clusters in an instance. +/// +/// A builder for the *instances.clusters.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_bigtableadmin2 as bigtableadmin2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use bigtableadmin2::BigtableAdmin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = BigtableAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_clusters_list("parent") +/// .page_token("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceClusterListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigtableAdmin, + _parent: String, + _page_token: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceClusterListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListClustersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigtableadmin.projects.instances.clusters.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + for &field in ["alt", "parent", "pageToken"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/clusters"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The unique name of the instance for which a list of clusters is requested. + /// Values are of the form `projects/{project}/instances/{instance}`. + /// Use `{instance} = '-'` to list Clusters for all Instances in a project, + /// e.g., `projects/myproject/instances/-`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// DEPRECATED: This field is unused and ignored. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceClusterListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceClusterListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceClusterListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::BigtableAdmin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceClusterListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Create an instance within a project. /// /// A builder for the *instances.create* method supported by a *project* resource. @@ -4807,8 +5211,8 @@ impl<'a, C, A> ProjectInstanceCreateCall<'a, C, A> where C: BorrowMut`. + /// Required. The unique name of the project in which to create the new instance. + /// Values are of the form `projects/{project}`. /// /// Sets the *parent* path property to the given value. /// @@ -4915,7 +5319,7 @@ impl<'a, C, A> ProjectInstanceCreateCall<'a, C, A> where C: BorrowMut ProjectInstanceClusterCreateCall<'a, C, A> where C: BorrowMut/instances/`. + /// `projects/{project}/instances/{instance}`. /// /// Sets the *parent* path property to the given value. /// @@ -5104,7 +5508,7 @@ impl<'a, C, A> ProjectInstanceClusterCreateCall<'a, C, A> where C: BorrowMut ProjectInstanceClusterCreateCall<'a, C, A> where C: BorrowMut ProjectInstanceTableGetCall<'a, C, A> where C: BorrowMut/instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. /// /// Sets the *name* path property to the given value. /// @@ -5473,8 +5877,8 @@ impl<'a, C, A> ProjectInstanceTableGetCall<'a, C, A> where C: BorrowMut ProjectInstanceAppProfilePatchCall<'a, C, A> where C: BorrowMut ProjectInstanceAppProfilePatchCall<'a, C, A> where C: BorrowMut ProjectInstanceAppProfileListCall<'a, C, A> where C: BorrowMut/instances/`. - /// Use ` = '-'` to list AppProfiles for all Instances in a project, + /// `projects/{project}/instances/{instance}`. + /// Use `{instance} = '-'` to list AppProfiles for all Instances in a project, /// e.g., `projects/myproject/instances/-`. /// /// Sets the *parent* path property to the given value. @@ -5952,7 +6356,14 @@ impl<'a, C, A> ProjectInstanceAppProfileListCall<'a, C, A> where C: BorrowMut ProjectInstanceAppProfileListCall<'a, C, A> { @@ -6228,9 +6639,9 @@ impl<'a, C, A> ProjectInstanceClusterUpdateCall<'a, C, A> where C: BorrowMut/instances//clusters/a-z*`. + /// `projects/{project}/instances/{instance}/clusters/a-z*`. /// /// Sets the *name* path property to the given value. /// @@ -6303,6 +6714,286 @@ impl<'a, C, A> ProjectInstanceClusterUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = BigtableAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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().instances_clusters_backups_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigtableAdmin, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+resource}:testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::BigtableAdmin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceClusterBackupTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the access control policy on an instance resource. Replaces any /// existing policy. /// @@ -6792,9 +7483,9 @@ impl<'a, C, A> ProjectInstanceTableCheckConsistencyCall<'a, C, A> where C: Borro self._request = new_value; self } - /// The unique name of the Table for which to check replication consistency. + /// Required. The unique name of the Table for which to check replication consistency. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. /// /// Sets the *name* path property to the given value. /// @@ -6895,9 +7586,9 @@ impl<'a, C, A> ProjectInstanceTableCheckConsistencyCall<'a, C, A> where C: Borro /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_list("name") -/// .page_token("amet") -/// .page_size(-60) -/// .filter("labore") +/// .page_token("eirmod") +/// .page_size(-33) +/// .filter("invidunt") /// .doit(); /// # } /// ``` @@ -7432,8 +8123,9 @@ impl<'a, C, A> ProjectInstanceGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectInstanceAppProfileGetCall<'a, C, A> where C: BorrowMut/instances//appProfiles/`. + /// Required. The unique name of the requested app profile. Values are of the form + /// `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. /// /// Sets the *name* path property to the given value. /// @@ -8137,8 +8829,8 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut/instances/`. + /// Required. The unique name of the instance to be deleted. + /// Values are of the form `projects/{project}/instances/{instance}`. /// /// Sets the *name* path property to the given value. /// @@ -8211,9 +8903,11 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = BigtableAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GetIamPolicyRequest::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().instances_clusters_list("parent") -/// .page_token("Lorem") +/// let result = hub.projects().instances_clusters_backups_get_iam_policy(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectInstanceClusterListCall<'a, C, A> +pub struct ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a BigtableAdmin, - _parent: String, - _page_token: Option, + _request: GetIamPolicyRequest, + _resource: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstanceClusterListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListClustersResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -8269,14 +8968,11 @@ impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "bigtableadmin.projects.instances.clusters.list", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.getIamPolicy", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - for &field in ["alt", "parent", "pageToken"].iter() { + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8288,12 +8984,12 @@ impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["resource"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8320,6 +9016,17 @@ impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut/instances/`. - /// Use ` = '-'` to list Clusters for all Instances in a project, - /// e.g., `projects/myproject/instances/-`. /// - /// Sets the *parent* path property to the given value. + /// Sets the *request* property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectInstanceClusterListCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> { + self._request = new_value; self } - /// DEPRECATED: This field is unused and ignored. + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectInstanceClusterListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -8417,7 +9128,7 @@ impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut ProjectInstanceClusterListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8442,7 +9153,7 @@ impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceClusterListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8462,7 +9173,7 @@ impl<'a, C, A> ProjectInstanceClusterListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInstanceClusterListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceClusterBackupGetIamPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8682,8 +9393,8 @@ impl<'a, C, A> ProjectInstanceTableCreateCall<'a, C, A> where C: BorrowMut/instances/`. + /// Required. The unique name of the instance in which to create the table. + /// Values are of the form `projects/{project}/instances/{instance}`. /// /// Sets the *parent* path property to the given value. /// @@ -8784,9 +9495,9 @@ impl<'a, C, A> ProjectInstanceTableCreateCall<'a, C, A> where C: BorrowMut ProjectInstanceTableListCall<'a, C, A> where C: BorrowMut/instances/`. + /// Required. The unique name of the instance for which tables should be listed. + /// Values are of the form `projects/{project}/instances/{instance}`. /// /// Sets the *parent* path property to the given value. /// @@ -8958,7 +9669,7 @@ impl<'a, C, A> ProjectInstanceTableListCall<'a, C, A> where C: BorrowMut ProjectInstanceTableListCall<'a, C, A> { @@ -9225,8 +9936,8 @@ impl<'a, C, A> ProjectInstanceClusterGetCall<'a, C, A> where C: BorrowMut/instances//clusters/`. + /// Required. The unique name of the requested cluster. Values are of the form + /// `projects/{project}/instances/{instance}/clusters/{cluster}`. /// /// Sets the *name* path property to the given value. /// @@ -9334,7 +10045,7 @@ impl<'a, C, A> ProjectInstanceClusterGetCall<'a, C, A> where C: BorrowMut ProjectInstancePartialUpdateInstanceCall<'a, C, A> where C: Borro self._request = new_value; self } - /// (`OutputOnly`) + /// Required. (`OutputOnly`) /// The unique name of the instance. Values are of the form - /// `projects//instances/a-z+[a-z0-9]`. + /// `projects/{project}/instances/a-z+[a-z0-9]`. /// /// Sets the *name* path property to the given value. /// @@ -9523,7 +10234,7 @@ impl<'a, C, A> ProjectInstancePartialUpdateInstanceCall<'a, C, A> where C: Borro self._name = new_value.to_string(); self } - /// The subset of Instance fields which should be replaced. + /// Required. The subset of Instance fields which should be replaced. /// Must be explicitly set. /// /// Sets the *update mask* query property to the given value. @@ -9769,8 +10480,8 @@ impl<'a, C, A> ProjectInstanceGetCall<'a, C, A> where C: BorrowMut/instances/`. + /// Required. The unique name of the requested instance. Values are of the form + /// `projects/{project}/instances/{instance}`. /// /// Sets the *name* path property to the given value. /// @@ -10051,9 +10762,9 @@ impl<'a, C, A> ProjectInstanceUpdateCall<'a, C, A> where C: BorrowMut/instances/a-z+[a-z0-9]`. + /// `projects/{project}/instances/a-z+[a-z0-9]`. /// /// Sets the *name* path property to the given value. /// @@ -10154,7 +10865,7 @@ impl<'a, C, A> ProjectInstanceUpdateCall<'a, C, A> where C: BorrowMut ProjectInstanceListCall<'a, C, A> where C: BorrowMut`. + /// Required. The unique name of the project for which a list of instances is requested. + /// Values are of the form `projects/{project}`. /// /// Sets the *parent* path property to the given value. /// @@ -10422,7 +11133,7 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut ProjectInstanceAppProfileCreateCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The unique name of the instance in which to create the new app profile. + /// Required. The unique name of the instance in which to create the new app profile. /// Values are of the form - /// `projects//instances/`. + /// `projects/{project}/instances/{instance}`. /// /// Sets the *parent* path property to the given value. /// @@ -10622,7 +11333,7 @@ impl<'a, C, A> ProjectInstanceAppProfileCreateCall<'a, C, A> where C: BorrowMut< self._ignore_warnings = Some(new_value); self } - /// The ID to be used when referring to the new app profile within its + /// Required. The ID to be used when referring to the new app profile within its /// instance, e.g., just `myprofile` rather than /// `projects/myproject/instances/myinstance/appProfiles/myprofile`. /// @@ -10903,9 +11614,9 @@ impl<'a, C, A> ProjectInstanceTableModifyColumnFamilyCall<'a, C, A> where C: Bor self._request = new_value; self } - /// The unique name of the table whose families should be modified. + /// Required. The unique name of the table whose families should be modified. /// Values are of the form - /// `projects//instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. /// /// Sets the *name* path property to the given value. /// @@ -10978,8 +11689,8 @@ impl<'a, C, A> ProjectInstanceTableModifyColumnFamilyCall<'a, C, A> where C: Bor } -/// Sets the access control policy on a table resource. Replaces any existing -/// policy. +/// Sets the access control policy on a Table or Backup resource. +/// Replaces any existing policy. /// /// A builder for the *instances.tables.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -11434,8 +12145,8 @@ impl<'a, C, A> ProjectInstanceClusterDeleteCall<'a, C, A> where C: BorrowMut/instances//clusters/`. + /// Required. The unique name of the cluster to be deleted. Values are of the form + /// `projects/{project}/instances/{instance}/clusters/{cluster}`. /// /// Sets the *name* path property to the given value. /// @@ -11963,9 +12674,9 @@ impl<'a, C, A> ProjectInstanceTableDeleteCall<'a, C, A> where C: BorrowMut/instances//tables/
          `. + /// `projects/{project}/instances/{instance}/tables/{table}`. /// /// Sets the *name* path property to the given value. /// @@ -12038,6 +12749,287 @@ impl<'a, C, A> ProjectInstanceTableDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = BigtableAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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().instances_clusters_backups_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a BigtableAdmin, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "bigtableadmin.projects.instances.clusters.backups.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+resource}:setIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::BigtableAdmin.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::BigtableAdmin`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceClusterBackupSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns permissions that the caller has on the specified table resource. /// /// A builder for the *instances.tables.testIamPermissions* method supported by a *project* resource. diff --git a/gen/binaryauthorization1_beta1-cli/Cargo.toml b/gen/binaryauthorization1_beta1-cli/Cargo.toml index 5f103cd53d..e473d02624 100644 --- a/gen/binaryauthorization1_beta1-cli/Cargo.toml +++ b/gen/binaryauthorization1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-binaryauthorization1_beta1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200327" authors = ["Sebastian Thiel "] description = "A complete library to interact with Binary Authorization (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/binaryauthorization1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-binaryauthorization1_beta1] path = "../binaryauthorization1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200327" diff --git a/gen/binaryauthorization1_beta1-cli/README.md b/gen/binaryauthorization1_beta1-cli/README.md index a18f927e1a..aa3e9548e6 100644 --- a/gen/binaryauthorization1_beta1-cli/README.md +++ b/gen/binaryauthorization1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Binary Authorization* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Binary Authorization* API at revision *20200327*. The CLI is at version *1.0.13*. ```bash binaryauthorization1-beta1 [options] diff --git a/gen/binaryauthorization1_beta1-cli/mkdocs.yml b/gen/binaryauthorization1_beta1-cli/mkdocs.yml index 75141519da..ff46d6e5a2 100644 --- a/gen/binaryauthorization1_beta1-cli/mkdocs.yml +++ b/gen/binaryauthorization1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Binary Authorization v1.0.12+20190628 +site_name: Binary Authorization v1.0.13+20200327 site_url: http://byron.github.io/google-apis-rs/google-binaryauthorization1_beta1-cli site_description: A complete library to interact with Binary Authorization (protocol v1beta1) diff --git a/gen/binaryauthorization1_beta1-cli/src/main.rs b/gen/binaryauthorization1_beta1-cli/src/main.rs index 83ddbdc311..9295b5eb6e 100644 --- a/gen/binaryauthorization1_beta1-cli/src/main.rs +++ b/gen/binaryauthorization1_beta1-cli/src/main.rs @@ -1256,7 +1256,9 @@ fn main() { ]), ("attestors-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_binaryauthorization1_beta1_cli/projects_attestors-set-iam-policy", vec![ (Some(r##"resource"##), @@ -1405,7 +1407,9 @@ fn main() { ]), ("policy-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_binaryauthorization1_beta1_cli/projects_policy-set-iam-policy", vec![ (Some(r##"resource"##), @@ -1507,7 +1511,7 @@ fn main() { let mut app = App::new("binaryauthorization1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200327") .about("The management interface for Binary Authorization, a system providing policy control for images deployed to Kubernetes Engine clusters. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_binaryauthorization1_beta1_cli") diff --git a/gen/binaryauthorization1_beta1/Cargo.toml b/gen/binaryauthorization1_beta1/Cargo.toml index a345f374f4..bc51867f36 100644 --- a/gen/binaryauthorization1_beta1/Cargo.toml +++ b/gen/binaryauthorization1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-binaryauthorization1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200327" authors = ["Sebastian Thiel "] description = "A complete library to interact with Binary Authorization (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/binaryauthorization1_beta1" homepage = "https://cloud.google.com/binary-authorization/" -documentation = "https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628" +documentation = "https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327" license = "MIT" keywords = ["binaryauthorization", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/binaryauthorization1_beta1/README.md b/gen/binaryauthorization1_beta1/README.md index 063b5858da..7d24a9a650 100644 --- a/gen/binaryauthorization1_beta1/README.md +++ b/gen/binaryauthorization1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-binaryauthorization1_beta1` library allows access to all features of the *Google Binary Authorization* service. -This documentation was generated from *Binary Authorization* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *binaryauthorization:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Binary Authorization* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *binaryauthorization:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Binary Authorization* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/binary-authorization/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.BinaryAuthorization.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.BinaryAuthorization.html) ... * projects - * [*attestors create*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorCreateCall.html), [*attestors delete*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorDeleteCall.html), [*attestors get*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorGetCall.html), [*attestors get iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorGetIamPolicyCall.html), [*attestors list*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorListCall.html), [*attestors set iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorSetIamPolicyCall.html), [*attestors test iam permissions*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorTestIamPermissionCall.html), [*attestors update*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectAttestorUpdateCall.html), [*get policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectGetPolicyCall.html), [*policy get iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectPolicyGetIamPolicyCall.html), [*policy set iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectPolicySetIamPolicyCall.html), [*policy test iam permissions*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectPolicyTestIamPermissionCall.html) and [*update policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.ProjectUpdatePolicyCall.html) + * [*attestors create*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorCreateCall.html), [*attestors delete*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorDeleteCall.html), [*attestors get*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorGetCall.html), [*attestors get iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorGetIamPolicyCall.html), [*attestors list*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorListCall.html), [*attestors set iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorSetIamPolicyCall.html), [*attestors test iam permissions*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorTestIamPermissionCall.html), [*attestors update*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectAttestorUpdateCall.html), [*get policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectGetPolicyCall.html), [*policy get iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectPolicyGetIamPolicyCall.html), [*policy set iam policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectPolicySetIamPolicyCall.html), [*policy test iam permissions*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectPolicyTestIamPermissionCall.html) and [*update policy*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.ProjectUpdatePolicyCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/struct.BinaryAuthorization.html)** +* **[Hub](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/struct.BinaryAuthorization.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-binaryauthorization1_beta1/1.0.12+20190628/google_binaryauthorization1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-binaryauthorization1_beta1/1.0.13+20200327/google_binaryauthorization1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/binaryauthorization1_beta1/src/lib.rs b/gen/binaryauthorization1_beta1/src/lib.rs index 127dade2e9..89292e6028 100644 --- a/gen/binaryauthorization1_beta1/src/lib.rs +++ b/gen/binaryauthorization1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Binary Authorization* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *binaryauthorization:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Binary Authorization* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *binaryauthorization:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Binary Authorization* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/binary-authorization/). @@ -332,7 +332,7 @@ impl<'a, C, A> BinaryAuthorization BinaryAuthorization { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://binaryauthorization.googleapis.com/".to_string(), _root_url: "https://binaryauthorization.googleapis.com/".to_string(), } @@ -343,7 +343,7 @@ impl<'a, C, A> BinaryAuthorization } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -471,30 +471,59 @@ pub struct AdmissionRule { impl Part for AdmissionRule {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -527,7 +556,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -536,6 +565,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -547,37 +596,50 @@ pub struct Binding { impl Part for Binding {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -585,15 +647,21 @@ impl Part for Binding {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -606,8 +674,9 @@ impl Part for Binding {} /// * [attestors get iam policy projects](struct.ProjectAttestorGetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct IamPolicy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -617,10 +686,32 @@ pub struct IamPolicy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -949,6 +1040,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -1128,6 +1221,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -1498,6 +1593,8 @@ impl<'a, C, A> ProjectAttestorListCall<'a, C, A> where C: BorrowMut ProjectPolicyGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectPolicyGetIamPolicyCall<'a, C, A> { @@ -3322,9 +3423,13 @@ impl<'a, C, A> ProjectAttestorGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectAttestorGetIamPolicyCall<'a, C, A> { @@ -3680,6 +3785,8 @@ impl<'a, C, A> ProjectUpdatePolicyCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-books1] path = "../books1" -version = "1.0.12+20181212" +version = "1.0.13+20200310" diff --git a/gen/books1-cli/README.md b/gen/books1-cli/README.md index c4a959fb60..e6bd47546b 100644 --- a/gen/books1-cli/README.md +++ b/gen/books1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *books* API at revision *20181212*. The CLI is at version *1.0.12*. +This documentation was generated from the *books* API at revision *20200310*. The CLI is at version *1.0.13*. ```bash books1 [options] diff --git a/gen/books1-cli/mkdocs.yml b/gen/books1-cli/mkdocs.yml index 4e8c805d1f..fffa076be6 100644 --- a/gen/books1-cli/mkdocs.yml +++ b/gen/books1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: books v1.0.12+20181212 +site_name: books v1.0.13+20200310 site_url: http://byron.github.io/google-apis-rs/google-books1-cli site_description: A complete library to interact with books (protocol v1) diff --git a/gen/books1-cli/src/main.rs b/gen/books1-cli/src/main.rs index 3d207539ac..8813725d5d 100644 --- a/gen/books1-cli/src/main.rs +++ b/gen/books1-cli/src/main.rs @@ -4928,7 +4928,7 @@ fn main() { let mut app = App::new("books1") .author("Sebastian Thiel ") - .version("1.0.12+20181212") + .version("1.0.13+20200310") .about("Searches for books and manages your Google Books library.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_books1_cli") .arg(Arg::with_name("url") diff --git a/gen/books1/Cargo.toml b/gen/books1/Cargo.toml index aaf5631222..60a5340bfb 100644 --- a/gen/books1/Cargo.toml +++ b/gen/books1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-books1" -version = "1.0.12+20181212" +version = "1.0.13+20200310" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1" homepage = "https://developers.google.com/books/docs/v1/getting_started" -documentation = "https://docs.rs/google-books1/1.0.12+20181212" +documentation = "https://docs.rs/google-books1/1.0.13+20200310" license = "MIT" keywords = ["books", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/books1/README.md b/gen/books1/README.md index 37693f4130..a0564b2f6b 100644 --- a/gen/books1/README.md +++ b/gen/books1/README.md @@ -5,40 +5,40 @@ DO NOT EDIT ! --> The `google-books1` library allows access to all features of the *Google books* service. -This documentation was generated from *books* crate version *1.0.12+20181212*, where *20181212* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *books* crate version *1.0.13+20200310*, where *20200310* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *books* *v1* API can be found at the [official documentation site](https://developers.google.com/books/docs/v1/getting_started). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.Books.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.Books.html) ... * bookshelves - * [*get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.BookshelveGetCall.html), [*list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.BookshelveListCall.html) and [*volumes list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.BookshelveVolumeListCall.html) + * [*get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.BookshelveGetCall.html), [*list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.BookshelveListCall.html) and [*volumes list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.BookshelveVolumeListCall.html) * cloudloading - * [*add book*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.CloudloadingAddBookCall.html), [*delete book*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.CloudloadingDeleteBookCall.html) and [*update book*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.CloudloadingUpdateBookCall.html) + * [*add book*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.CloudloadingAddBookCall.html), [*delete book*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.CloudloadingDeleteBookCall.html) and [*update book*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.CloudloadingUpdateBookCall.html) * dictionary - * [*list offline metadata*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.DictionaryListOfflineMetadataCall.html) + * [*list offline metadata*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.DictionaryListOfflineMetadataCall.html) * familysharing - * [*get family info*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.FamilysharingGetFamilyInfoCall.html), [*share*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.FamilysharingShareCall.html) and [*unshare*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.FamilysharingUnshareCall.html) + * [*get family info*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.FamilysharingGetFamilyInfoCall.html), [*share*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.FamilysharingShareCall.html) and [*unshare*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.FamilysharingUnshareCall.html) * layers - * [*annotation data get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.LayerAnnotationDataGetCall.html), [*annotation data list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.LayerAnnotationDataListCall.html), [*get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.LayerGetCall.html), [*list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.LayerListCall.html), [*volume annotations get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.LayerVolumeAnnotationGetCall.html) and [*volume annotations list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.LayerVolumeAnnotationListCall.html) + * [*annotation data get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.LayerAnnotationDataGetCall.html), [*annotation data list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.LayerAnnotationDataListCall.html), [*get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.LayerGetCall.html), [*list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.LayerListCall.html), [*volume annotations get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.LayerVolumeAnnotationGetCall.html) and [*volume annotations list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.LayerVolumeAnnotationListCall.html) * myconfig - * [*get user settings*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MyconfigGetUserSettingCall.html), [*release download access*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MyconfigReleaseDownloadAccesCall.html), [*request access*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MyconfigRequestAccesCall.html), [*sync volume licenses*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MyconfigSyncVolumeLicenseCall.html) and [*update user settings*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MyconfigUpdateUserSettingCall.html) + * [*get user settings*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MyconfigGetUserSettingCall.html), [*release download access*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MyconfigReleaseDownloadAccesCall.html), [*request access*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MyconfigRequestAccesCall.html), [*sync volume licenses*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MyconfigSyncVolumeLicenseCall.html) and [*update user settings*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MyconfigUpdateUserSettingCall.html) * mylibrary - * [*annotations delete*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryAnnotationDeleteCall.html), [*annotations insert*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryAnnotationInsertCall.html), [*annotations list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryAnnotationListCall.html), [*annotations summary*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryAnnotationSummaryCall.html), [*annotations update*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryAnnotationUpdateCall.html), [*bookshelves add volume*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryBookshelveAddVolumeCall.html), [*bookshelves clear volumes*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryBookshelveClearVolumeCall.html), [*bookshelves get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryBookshelveGetCall.html), [*bookshelves list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryBookshelveListCall.html), [*bookshelves move volume*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryBookshelveMoveVolumeCall.html), [*bookshelves remove volume*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryBookshelveRemoveVolumeCall.html), [*bookshelves volumes list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryBookshelveVolumeListCall.html), [*readingpositions get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryReadingpositionGetCall.html) and [*readingpositions set position*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.MylibraryReadingpositionSetPositionCall.html) -* [notification](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.Notification.html) - * [*get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.NotificationGetCall.html) + * [*annotations delete*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryAnnotationDeleteCall.html), [*annotations insert*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryAnnotationInsertCall.html), [*annotations list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryAnnotationListCall.html), [*annotations summary*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryAnnotationSummaryCall.html), [*annotations update*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryAnnotationUpdateCall.html), [*bookshelves add volume*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryBookshelveAddVolumeCall.html), [*bookshelves clear volumes*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryBookshelveClearVolumeCall.html), [*bookshelves get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryBookshelveGetCall.html), [*bookshelves list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryBookshelveListCall.html), [*bookshelves move volume*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryBookshelveMoveVolumeCall.html), [*bookshelves remove volume*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryBookshelveRemoveVolumeCall.html), [*bookshelves volumes list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryBookshelveVolumeListCall.html), [*readingpositions get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryReadingpositionGetCall.html) and [*readingpositions set position*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.MylibraryReadingpositionSetPositionCall.html) +* [notification](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.Notification.html) + * [*get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.NotificationGetCall.html) * onboarding - * [*list categories*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.OnboardingListCategoryCall.html) and [*list category volumes*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.OnboardingListCategoryVolumeCall.html) + * [*list categories*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.OnboardingListCategoryCall.html) and [*list category volumes*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.OnboardingListCategoryVolumeCall.html) * personalizedstream - * [*get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.PersonalizedstreamGetCall.html) + * [*get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.PersonalizedstreamGetCall.html) * promooffer - * [*accept*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.PromoofferAcceptCall.html), [*dismiss*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.PromoofferDismisCall.html) and [*get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.PromoofferGetCall.html) + * [*accept*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.PromoofferAcceptCall.html), [*dismiss*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.PromoofferDismisCall.html) and [*get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.PromoofferGetCall.html) * series - * [*get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.SeryGetCall.html) and [*membership get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.SeryMembershipGetCall.html) -* [volumes](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.Volume.html) - * [*associated list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.VolumeAssociatedListCall.html), [*get*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.VolumeGetCall.html), [*list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.VolumeListCall.html), [*mybooks list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.VolumeMybookListCall.html), [*recommended list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.VolumeRecommendedListCall.html), [*recommended rate*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.VolumeRecommendedRateCall.html) and [*useruploaded list*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.VolumeUseruploadedListCall.html) + * [*get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.SeryGetCall.html) and [*membership get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.SeryMembershipGetCall.html) +* [volumes](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.Volume.html) + * [*associated list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.VolumeAssociatedListCall.html), [*get*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.VolumeGetCall.html), [*list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.VolumeListCall.html), [*mybooks list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.VolumeMybookListCall.html), [*recommended list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.VolumeRecommendedListCall.html), [*recommended rate*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.VolumeRecommendedRateCall.html) and [*useruploaded list*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.VolumeUseruploadedListCall.html) @@ -47,17 +47,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-books1/1.0.12+20181212/google_books1/struct.Books.html)** +* **[Hub](https://docs.rs/google-books1/1.0.13+20200310/google_books1/struct.Books.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.Part.html)** + * **[Parts](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -168,17 +168,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-books1/1.0.12+20181212/google_books1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-books1/1.0.13+20200310/google_books1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-books1/1.0.12+20181212/google_books1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-books1/1.0.13+20200310/google_books1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -188,29 +188,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-books1/1.0.12+20181212/google_books1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-books1/1.0.13+20200310/google_books1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/books1/src/lib.rs b/gen/books1/src/lib.rs index 08467acbc0..e4b1d12f1a 100644 --- a/gen/books1/src/lib.rs +++ b/gen/books1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *books* crate version *1.0.12+20181212*, where *20181212* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *books* crate version *1.0.13+20200310*, where *20200310* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *books* *v1* API can be found at the //! [official documentation site](https://developers.google.com/books/docs/v1/getting_started). @@ -374,7 +374,7 @@ impl<'a, C, A> Books Books { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/books/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -421,7 +421,7 @@ impl<'a, C, A> Books } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -795,22 +795,21 @@ pub struct Notification { impl ResponseResult for Notification {} -/// User settings in sub-objects, each for different purposes. +/// The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In LITE projection.) /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UsersettingsNotesExport { - /// no description provided - #[serde(rename="isEnabled")] - pub is_enabled: Option, - /// no description provided - #[serde(rename="folderName")] - pub folder_name: Option, +pub struct VolumeSaleInfoRetailPrice { + /// Amount in the currency listed below. (In LITE projection.) + pub amount: Option, + /// An ISO 4217, three-letter currency code. (In LITE projection.) + #[serde(rename="currencyCode")] + pub currency_code: Option, } -impl NestedType for UsersettingsNotesExport {} -impl Part for UsersettingsNotesExport {} +impl NestedType for VolumeSaleInfoRetailPrice {} +impl Part for VolumeSaleInfoRetailPrice {} /// There is no detailed description. @@ -1573,6 +1572,30 @@ pub struct Category { impl ResponseResult for Category {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SeriesSeriesSeriesSubscriptionReleaseInfo { + /// Cancellation date of the series subscription (or when it ends). + #[serde(rename="cancellationTimestampUs")] + pub cancellation_timestamp_us: Option, + /// Release information for the last release. + #[serde(rename="currentReleaseInfo")] + pub current_release_info: Option, + /// series subscription type. + #[serde(rename="seriesSubscriptionType")] + pub series_subscription_type: Option, + /// Release information for the next release. + #[serde(rename="nextReleaseInfo")] + pub next_release_info: Option, +} + +impl NestedType for SeriesSeriesSeriesSubscriptionReleaseInfo {} +impl Part for SeriesSeriesSeriesSubscriptionReleaseInfo {} + + /// A list of onboarding categories. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2003,21 +2026,22 @@ impl NestedType for AnnotationLayerSummary {} impl Part for AnnotationLayerSummary {} -/// The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In LITE projection.) +/// User settings in sub-objects, each for different purposes. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VolumeSaleInfoRetailPrice { - /// Amount in the currency listed below. (In LITE projection.) - pub amount: Option, - /// An ISO 4217, three-letter currency code. (In LITE projection.) - #[serde(rename="currencyCode")] - pub currency_code: Option, +pub struct UsersettingsNotesExport { + /// no description provided + #[serde(rename="isEnabled")] + pub is_enabled: Option, + /// no description provided + #[serde(rename="folderName")] + pub folder_name: Option, } -impl NestedType for VolumeSaleInfoRetailPrice {} -impl Part for VolumeSaleInfoRetailPrice {} +impl NestedType for UsersettingsNotesExport {} +impl Part for UsersettingsNotesExport {} /// Offer list (=undiscounted) price in Micros. @@ -2361,6 +2385,29 @@ impl NestedType for VolumeUserInfo {} impl Part for VolumeUserInfo {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BooksSubscriptionReleaseInfo { + /// Currency code of the amount. + #[serde(rename="currencyCode")] + pub currency_code: Option, + /// The release date. + #[serde(rename="releaseTimestampUs")] + pub release_timestamp_us: Option, + /// Amount in micros of the specified currency code. + #[serde(rename="amountInMicros")] + pub amount_in_micros: Option, + /// The release number of this issue/volume/book. + #[serde(rename="releaseNumber")] + pub release_number: Option, +} + +impl Part for BooksSubscriptionReleaseInfo {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2388,13 +2435,28 @@ pub struct SeriesSeries { #[serde(rename="bannerImageUrl")] pub banner_image_url: Option, /// no description provided + pub title: Option, + /// no description provided #[serde(rename="imageUrl")] pub image_url: Option, /// no description provided + #[serde(rename="seriesFormatType")] + pub series_format_type: Option, + /// no description provided + #[serde(rename="isComplete")] + pub is_complete: Option, + /// no description provided + #[serde(rename="subscriptionId")] + pub subscription_id: Option, + /// no description provided + #[serde(rename="eligibleForSubscription")] + pub eligible_for_subscription: Option, + /// no description provided #[serde(rename="seriesType")] pub series_type: Option, /// no description provided - pub title: Option, + #[serde(rename="seriesSubscriptionReleaseInfo")] + pub series_subscription_release_info: Option, } impl NestedType for SeriesSeries {} diff --git a/gen/calendar3-cli/Cargo.toml b/gen/calendar3-cli/Cargo.toml index 1a28b5d01d..ada04b9b5c 100644 --- a/gen/calendar3-cli/Cargo.toml +++ b/gen/calendar3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-calendar3-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-calendar3] path = "../calendar3" -version = "1.0.12+20190702" +version = "1.0.13+20200405" diff --git a/gen/calendar3-cli/README.md b/gen/calendar3-cli/README.md index 863db74173..64db08cb3b 100644 --- a/gen/calendar3-cli/README.md +++ b/gen/calendar3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *calendar* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *calendar* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash calendar3 [options] diff --git a/gen/calendar3-cli/mkdocs.yml b/gen/calendar3-cli/mkdocs.yml index 2b82b88564..cf95b66774 100644 --- a/gen/calendar3-cli/mkdocs.yml +++ b/gen/calendar3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: calendar v1.0.12+20190702 +site_name: calendar v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-calendar3-cli site_description: A complete library to interact with calendar (protocol v3) diff --git a/gen/calendar3-cli/src/main.rs b/gen/calendar3-cli/src/main.rs index f210a28a1e..3f49dd51f9 100644 --- a/gen/calendar3-cli/src/main.rs +++ b/gen/calendar3-cli/src/main.rs @@ -4474,7 +4474,7 @@ fn main() { let mut app = App::new("calendar3") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200405") .about("Manipulates events and other calendar data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_calendar3_cli") .arg(Arg::with_name("url") diff --git a/gen/calendar3/Cargo.toml b/gen/calendar3/Cargo.toml index f262e5e3a6..5681f0ed00 100644 --- a/gen/calendar3/Cargo.toml +++ b/gen/calendar3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-calendar3" -version = "1.0.12+20190702" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3" homepage = "https://developers.google.com/google-apps/calendar/firstapp" -documentation = "https://docs.rs/google-calendar3/1.0.12+20190702" +documentation = "https://docs.rs/google-calendar3/1.0.13+20200405" license = "MIT" keywords = ["calendar", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/calendar3/README.md b/gen/calendar3/README.md index ff8ca5b557..e5b92db794 100644 --- a/gen/calendar3/README.md +++ b/gen/calendar3/README.md @@ -5,43 +5,43 @@ DO NOT EDIT ! --> The `google-calendar3` library allows access to all features of the *Google calendar* service. -This documentation was generated from *calendar* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *calendar* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *calendar* *v3* API can be found at the [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarHub.html) ... -* [acl](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.Acl.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclWatchCall.html) -* [calendar list](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarList.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListWatchCall.html) -* [calendars](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.Calendar.html) - * [*clear*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarClearCall.html), [*delete*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarInsertCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarPatchCall.html) and [*update*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarUpdateCall.html) -* [channels](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.Channel.html) - * [*stop*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.ChannelStopCall.html) +* [acl](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.Acl.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclWatchCall.html) +* [calendar list](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarList.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListWatchCall.html) +* [calendars](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.Calendar.html) + * [*clear*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarClearCall.html), [*delete*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarInsertCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarPatchCall.html) and [*update*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarUpdateCall.html) +* [channels](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.Channel.html) + * [*stop*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.ChannelStopCall.html) * colors - * [*get*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.ColorGetCall.html) -* [events](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.Event.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventGetCall.html), [*import*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventImportCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventInsertCall.html), [*instances*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventInstanceCall.html), [*list*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventListCall.html), [*move*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventMoveCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventPatchCall.html), [*quick add*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventQuickAddCall.html), [*update*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventWatchCall.html) + * [*get*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.ColorGetCall.html) +* [events](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.Event.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventGetCall.html), [*import*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventImportCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventInsertCall.html), [*instances*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventInstanceCall.html), [*list*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventListCall.html), [*move*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventMoveCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventPatchCall.html), [*quick add*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventQuickAddCall.html), [*update*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventWatchCall.html) * freebusy - * [*query*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.FreebusyQueryCall.html) -* [settings](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.Setting.html) - * [*get*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.SettingGetCall.html), [*list*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.SettingListCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.SettingWatchCall.html) + * [*query*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.FreebusyQueryCall.html) +* [settings](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.Setting.html) + * [*get*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.SettingGetCall.html), [*list*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.SettingListCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.SettingWatchCall.html) Subscription supported by ... -* [*list settings*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.SettingListCall.html) -* [*list events*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventListCall.html) -* [*list calendar list*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListListCall.html) -* [*watch events*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventWatchCall.html) -* [*instances events*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.EventInstanceCall.html) -* [*watch settings*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.SettingWatchCall.html) -* [*watch acl*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclWatchCall.html) -* [*list acl*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.AclListCall.html) -* [*watch calendar list*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarListWatchCall.html) +* [*list settings*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.SettingListCall.html) +* [*list events*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventListCall.html) +* [*list calendar list*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListListCall.html) +* [*watch events*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventWatchCall.html) +* [*instances events*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.EventInstanceCall.html) +* [*watch settings*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.SettingWatchCall.html) +* [*watch acl*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclWatchCall.html) +* [*list acl*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.AclListCall.html) +* [*watch calendar list*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarListWatchCall.html) @@ -49,17 +49,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/struct.CalendarHub.html)** +* **[Hub](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/struct.CalendarHub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.Part.html)** + * **[Parts](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -183,17 +183,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -203,29 +203,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-calendar3/1.0.12+20190702/google_calendar3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-calendar3/1.0.13+20200405/google_calendar3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/calendar3/src/lib.rs b/gen/calendar3/src/lib.rs index bf67f29282..703dab9073 100644 --- a/gen/calendar3/src/lib.rs +++ b/gen/calendar3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *calendar* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *calendar* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *calendar* *v3* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). @@ -415,7 +415,7 @@ impl<'a, C, A> CalendarHub CalendarHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/calendar/v3/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -447,7 +447,7 @@ impl<'a, C, A> CalendarHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -630,6 +630,7 @@ pub struct ConferenceSolutionKey { /// - "eventHangout" for Hangouts for consumers (http://hangouts.google.com) /// - "eventNamedHangout" for classic Hangouts for G Suite users (http://hangouts.google.com) /// - "hangoutsMeet" for Hangouts Meet (http://meet.google.com) + /// - "addOn" for 3P conference providers #[serde(rename="type")] pub type_: Option, } @@ -944,8 +945,6 @@ pub struct EventReminder { pub minutes: Option, /// The method used by this reminder. Possible values are: /// - "email" - Reminders are sent via email. - /// - "sms" - Deprecated. Once this feature is shutdown, the API will no longer return reminders using this method. Any newly added SMS reminders will be ignored. See Google Calendar SMS notifications to be removed for more information. - /// Reminders are sent via SMS. These are only available for G Suite customers. Requests to set SMS reminders for other account types are ignored. /// - "popup" - Reminders are sent via a UI popup. /// Required when adding a reminder. pub method: Option, @@ -984,10 +983,8 @@ pub struct CalendarNotification { /// Required when adding a notification. #[serde(rename="type")] pub type_: Option, - /// The method used to deliver the notification. Possible values are: - /// - "email" - Notifications are sent via email. - /// - "sms" - Deprecated. Once this feature is shutdown, the API will no longer return notifications using this method. Any newly added SMS notifications will be ignored. See Google Calendar SMS notifications to be removed for more information. - /// Notifications are sent via SMS. This value is read-only and is ignored on inserts and updates. SMS notifications are only available for G Suite customers. + /// The method used to deliver the notification. The possible value is: + /// - "email" - Notifications are sent via email. /// Required when adding a notification. pub method: Option, } @@ -1029,7 +1026,8 @@ pub struct ConferenceData { /// Values for solution types: /// - "eventHangout": unset. /// - "eventNamedHangout": the name of the Hangout. - /// - "hangoutsMeet": the 10-letter meeting code, for example "aaa-bbbb-ccc". Optional. + /// - "hangoutsMeet": the 10-letter meeting code, for example "aaa-bbbb-ccc". + /// - "addOn": defined by 3P conference provider. Optional. #[serde(rename="conferenceId")] pub conference_id: Option, } @@ -1598,7 +1596,7 @@ pub struct Event { pub status: Option, /// Last modification time of the event (as a RFC3339 timestamp). Read-only. pub updated: Option, - /// Description of the event. Optional. + /// Description of the event. Can contain HTML. Optional. pub description: Option, /// Event unique identifier as defined in RFC5545. It is used to uniquely identify events accross calendaring systems and must be supplied when importing events via the import method. /// Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs. @@ -1651,7 +1649,7 @@ pub struct Event { /// - "opaque" - Default value. The event does block time on the calendar. This is equivalent to setting Show me as to Busy in the Calendar UI. /// - "transparent" - The event does not block time on the calendar. This is equivalent to setting Show me as to Available in the Calendar UI. pub transparency: Option, - /// Whether this is a private event copy where changes are not shared with other copies on other calendars. Optional. Immutable. The default is False. + /// If set to True, Event propagation is disabled. Note that it is not the same thing as Private event properties. Optional. Immutable. The default is False. #[serde(rename="privateCopy")] pub private_copy: Option, /// The conference-related information, such as details of a Hangouts Meet conference. To create new conference details use the createRequest field. To persist your changes, remember to set the conferenceDataVersion request parameter to 1 for all event modification requests. @@ -10741,7 +10739,7 @@ impl<'a, C, A> EventInstanceCall<'a, C, A> where C: BorrowMut, A: self._max_attendees = Some(new_value); self } - /// Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + /// Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). /// /// Sets the *always include email* query property to the given value. pub fn always_include_email(mut self, new_value: bool) -> EventInstanceCall<'a, C, A> { @@ -11029,7 +11027,7 @@ impl<'a, C, A> EventGetCall<'a, C, A> where C: BorrowMut, A: oaut self._max_attendees = Some(new_value); self } - /// Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + /// Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). /// /// Sets the *always include email* query property to the given value. pub fn always_include_email(mut self, new_value: bool) -> EventGetCall<'a, C, A> { @@ -11492,7 +11490,7 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau self._i_cal_uid = Some(new_value.to_string()); self } - /// Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + /// Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). /// /// Sets the *always include email* query property to the given value. pub fn always_include_email(mut self, new_value: bool) -> EventListCall<'a, C, A> { @@ -11849,7 +11847,7 @@ impl<'a, C, A> EventPatchCall<'a, C, A> where C: BorrowMut, A: oa self._conference_data_version = Some(new_value); self } - /// Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + /// Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). /// /// Sets the *always include email* query property to the given value. pub fn always_include_email(mut self, new_value: bool) -> EventPatchCall<'a, C, A> { @@ -12496,7 +12494,7 @@ impl<'a, C, A> EventUpdateCall<'a, C, A> where C: BorrowMut, A: o self._conference_data_version = Some(new_value); self } - /// Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + /// Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). /// /// Sets the *always include email* query property to the given value. pub fn always_include_email(mut self, new_value: bool) -> EventUpdateCall<'a, C, A> { @@ -12990,7 +12988,7 @@ impl<'a, C, A> EventWatchCall<'a, C, A> where C: BorrowMut, A: oa self._i_cal_uid = Some(new_value.to_string()); self } - /// Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + /// Deprecated and ignored. A value will always be returned in the email field for the organizer, creator and attendees, even if no real email address is available (i.e. a generated, non-working value will be provided). /// /// Sets the *always include email* query property to the given value. pub fn always_include_email(mut self, new_value: bool) -> EventWatchCall<'a, C, A> { diff --git a/gen/chat1-cli/Cargo.toml b/gen/chat1-cli/Cargo.toml index 6b047a8738..23a30198b0 100644 --- a/gen/chat1-cli/Cargo.toml +++ b/gen/chat1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-chat1-cli" -version = "1.0.12+20190622" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Hangouts Chat (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/chat1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-chat1] path = "../chat1" -version = "1.0.12+20190622" +version = "1.0.13+20200405" diff --git a/gen/chat1-cli/README.md b/gen/chat1-cli/README.md index 22d666b045..c05129cde5 100644 --- a/gen/chat1-cli/README.md +++ b/gen/chat1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Hangouts Chat* API at revision *20190622*. The CLI is at version *1.0.12*. +This documentation was generated from the *Hangouts Chat* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash chat1 [options] diff --git a/gen/chat1-cli/mkdocs.yml b/gen/chat1-cli/mkdocs.yml index 1198df7e20..64e19f0c79 100644 --- a/gen/chat1-cli/mkdocs.yml +++ b/gen/chat1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Hangouts Chat v1.0.12+20190622 +site_name: Hangouts Chat v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-chat1-cli site_description: A complete library to interact with Hangouts Chat (protocol v1) diff --git a/gen/chat1-cli/src/main.rs b/gen/chat1-cli/src/main.rs index 3ae905f615..884f571b00 100644 --- a/gen/chat1-cli/src/main.rs +++ b/gen/chat1-cli/src/main.rs @@ -292,10 +292,11 @@ impl<'n> Engine<'n> { "preview-text" => Some(("previewText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sender.type" => Some(("sender.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sender.domain-id" => Some(("sender.domainId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sender.display-name" => Some(("sender.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sender.name" => Some(("sender.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["action-response", "argument-text", "create-time", "display-name", "fallback-text", "name", "preview-text", "sender", "space", "text", "thread", "type", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["action-response", "argument-text", "create-time", "display-name", "domain-id", "fallback-text", "name", "preview-text", "sender", "space", "text", "thread", "type", "url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -490,10 +491,11 @@ impl<'n> Engine<'n> { "preview-text" => Some(("previewText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sender.type" => Some(("sender.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sender.domain-id" => Some(("sender.domainId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sender.display-name" => Some(("sender.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sender.name" => Some(("sender.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["action-response", "argument-text", "create-time", "display-name", "fallback-text", "name", "preview-text", "sender", "space", "text", "thread", "type", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["action-response", "argument-text", "create-time", "display-name", "domain-id", "fallback-text", "name", "preview-text", "sender", "space", "text", "thread", "type", "url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -882,7 +884,7 @@ fn main() { let mut app = App::new("chat1") .author("Sebastian Thiel ") - .version("1.0.12+20190622") + .version("1.0.13+20200405") .about("Enables bots to fetch information and perform actions in Hangouts Chat.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_chat1_cli") .arg(Arg::with_name("folder") diff --git a/gen/chat1/Cargo.toml b/gen/chat1/Cargo.toml index 49fcf9be82..8aa58da6cf 100644 --- a/gen/chat1/Cargo.toml +++ b/gen/chat1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-chat1" -version = "1.0.12+20190622" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Hangouts Chat (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/chat1" homepage = "https://developers.google.com/hangouts/chat" -documentation = "https://docs.rs/google-chat1/1.0.12+20190622" +documentation = "https://docs.rs/google-chat1/1.0.13+20200405" license = "MIT" keywords = ["chat", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/chat1/README.md b/gen/chat1/README.md index ec48764fb4..b8cd58fef4 100644 --- a/gen/chat1/README.md +++ b/gen/chat1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-chat1` library allows access to all features of the *Google Hangouts Chat* service. -This documentation was generated from *Hangouts Chat* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *chat:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Hangouts Chat* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *chat:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Hangouts Chat* *v1* API can be found at the [official documentation site](https://developers.google.com/hangouts/chat). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.HangoutsChat.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.HangoutsChat.html) ... -* [spaces](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.Space.html) - * [*get*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceGetCall.html), [*list*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceListCall.html), [*members get*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceMemberGetCall.html), [*members list*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceMemberListCall.html), [*messages create*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceMessageCreateCall.html), [*messages delete*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceMessageDeleteCall.html), [*messages get*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceMessageGetCall.html) and [*messages update*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.SpaceMessageUpdateCall.html) +* [spaces](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.Space.html) + * [*get*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceGetCall.html), [*list*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceListCall.html), [*members get*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceMemberGetCall.html), [*members list*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceMemberListCall.html), [*messages create*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceMessageCreateCall.html), [*messages delete*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceMessageDeleteCall.html), [*messages get*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceMessageGetCall.html) and [*messages update*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.SpaceMessageUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/struct.HangoutsChat.html)** +* **[Hub](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/struct.HangoutsChat.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.Part.html)** + * **[Parts](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-chat1/1.0.12+20190622/google_chat1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-chat1/1.0.13+20200405/google_chat1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/chat1/src/lib.rs b/gen/chat1/src/lib.rs index 291c673b48..28cee61912 100644 --- a/gen/chat1/src/lib.rs +++ b/gen/chat1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Hangouts Chat* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *chat:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Hangouts Chat* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *chat:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Hangouts Chat* *v1* API can be found at the //! [official documentation site](https://developers.google.com/hangouts/chat). @@ -316,7 +316,7 @@ impl<'a, C, A> HangoutsChat HangoutsChat { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://chat.googleapis.com/".to_string(), _root_url: "https://chat.googleapis.com/".to_string(), } @@ -327,7 +327,7 @@ impl<'a, C, A> HangoutsChat } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -493,8 +493,10 @@ impl Part for TextParagraph {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FormAction { - /// Apps Script function to invoke when the containing element is - /// clicked/activated. + /// The method name is used to identify which part of the form triggered the + /// form submission. This information is echoed back to the bot as part of + /// the card click event. The same method name can be used for several + /// elements that trigger a common behavior if desired. #[serde(rename="actionMethodName")] pub action_method_name: Option, /// List of action parameters. @@ -650,7 +652,10 @@ impl Part for ImageButton {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Image { - /// The aspect ratio of this image (width/height). + /// The aspect ratio of this image (width/height). This field allows clients + /// to reserve the right height for the image while waiting for it to load. + /// It's not meant to override the native aspect ratio of the image. + /// If unset, the server fills it by prefetching the image. #[serde(rename="aspectRatio")] pub aspect_ratio: Option, /// The URL of the image. @@ -939,6 +944,9 @@ pub struct User { /// The user's display name. #[serde(rename="displayName")] pub display_name: Option, + /// Obfuscated domain information. + #[serde(rename="domainId")] + pub domain_id: Option, /// User type. #[serde(rename="type")] pub type_: Option, @@ -2014,9 +2022,12 @@ impl<'a, C, A> SpaceMessageUpdateCall<'a, C, A> where C: BorrowMut SpaceMessageUpdateCall<'a, C, A> { diff --git a/gen/classroom1-cli/Cargo.toml b/gen/classroom1-cli/Cargo.toml index d328976801..ba9b66d265 100644 --- a/gen/classroom1-cli/Cargo.toml +++ b/gen/classroom1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-classroom1-cli" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with classroom (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/classroom1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-classroom1] path = "../classroom1" -version = "1.0.12+20190701" +version = "1.0.13+20200408" diff --git a/gen/classroom1-cli/README.md b/gen/classroom1-cli/README.md index 2974916f01..9fea5431e2 100644 --- a/gen/classroom1-cli/README.md +++ b/gen/classroom1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *classroom* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *classroom* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash classroom1 [options] diff --git a/gen/classroom1-cli/mkdocs.yml b/gen/classroom1-cli/mkdocs.yml index 8c10edae15..ec016fb1f4 100644 --- a/gen/classroom1-cli/mkdocs.yml +++ b/gen/classroom1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: classroom v1.0.12+20190701 +site_name: classroom v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-classroom1-cli site_description: A complete library to interact with classroom (protocol v1) diff --git a/gen/classroom1-cli/src/main.rs b/gen/classroom1-cli/src/main.rs index 0fbe0ea67b..0562a9977a 100644 --- a/gen/classroom1-cli/src/main.rs +++ b/gen/classroom1-cli/src/main.rs @@ -6660,7 +6660,7 @@ fn main() { let mut app = App::new("classroom1") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200408") .about("Manages classes, rosters, and invitations in Google Classroom.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_classroom1_cli") .arg(Arg::with_name("url") diff --git a/gen/classroom1/Cargo.toml b/gen/classroom1/Cargo.toml index fad798114a..c6b9059491 100644 --- a/gen/classroom1/Cargo.toml +++ b/gen/classroom1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-classroom1" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with classroom (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/classroom1" homepage = "https://developers.google.com/classroom/" -documentation = "https://docs.rs/google-classroom1/1.0.12+20190701" +documentation = "https://docs.rs/google-classroom1/1.0.13+20200408" license = "MIT" keywords = ["classroom", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/classroom1/README.md b/gen/classroom1/README.md index 18b16e4c0e..15a5a0fb5d 100644 --- a/gen/classroom1/README.md +++ b/gen/classroom1/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-classroom1` library allows access to all features of the *Google classroom* service. -This documentation was generated from *classroom* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *classroom* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *classroom* *v1* API can be found at the [official documentation site](https://developers.google.com/classroom/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.Classroom.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.Classroom.html) ... -* [courses](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.Course.html) - * [*aliases create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAliaseCreateCall.html), [*aliases delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAliaseDeleteCall.html), [*aliases list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAliaseListCall.html), [*announcements create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAnnouncementCreateCall.html), [*announcements delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAnnouncementDeleteCall.html), [*announcements get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAnnouncementGetCall.html), [*announcements list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAnnouncementListCall.html), [*announcements modify assignees*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAnnouncementModifyAssigneeCall.html), [*announcements patch*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseAnnouncementPatchCall.html), [*course work create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkCreateCall.html), [*course work delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkDeleteCall.html), [*course work get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkGetCall.html), [*course work list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkListCall.html), [*course work modify assignees*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkModifyAssigneeCall.html), [*course work patch*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseGetCall.html), [*list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseListCall.html), [*patch*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CoursePatchCall.html), [*students create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseStudentCreateCall.html), [*students delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseStudentDeleteCall.html), [*students get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseStudentGetCall.html), [*students list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseStudentListCall.html), [*teachers create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTeacherCreateCall.html), [*teachers delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTeacherDeleteCall.html), [*teachers get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTeacherGetCall.html), [*teachers list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTeacherListCall.html), [*topics create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTopicCreateCall.html), [*topics delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTopicDeleteCall.html), [*topics get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTopicGetCall.html), [*topics list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTopicListCall.html), [*topics patch*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseTopicPatchCall.html) and [*update*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.CourseUpdateCall.html) -* [invitations](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.Invitation.html) - * [*accept*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.InvitationAcceptCall.html), [*create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.InvitationCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.InvitationDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.InvitationGetCall.html) and [*list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.InvitationListCall.html) -* [registrations](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.Registration.html) - * [*create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.RegistrationCreateCall.html) and [*delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.RegistrationDeleteCall.html) -* [user profiles](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfile.html) - * [*get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGetCall.html), [*guardian invitations create*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGuardianDeleteCall.html), [*guardians get*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGuardianGetCall.html) and [*guardians list*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.UserProfileGuardianListCall.html) +* [courses](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.Course.html) + * [*aliases create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAliaseCreateCall.html), [*aliases delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAliaseDeleteCall.html), [*aliases list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAliaseListCall.html), [*announcements create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAnnouncementCreateCall.html), [*announcements delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAnnouncementDeleteCall.html), [*announcements get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAnnouncementGetCall.html), [*announcements list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAnnouncementListCall.html), [*announcements modify assignees*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAnnouncementModifyAssigneeCall.html), [*announcements patch*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseAnnouncementPatchCall.html), [*course work create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkCreateCall.html), [*course work delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkDeleteCall.html), [*course work get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkGetCall.html), [*course work list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkListCall.html), [*course work modify assignees*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkModifyAssigneeCall.html), [*course work patch*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseGetCall.html), [*list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseListCall.html), [*patch*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CoursePatchCall.html), [*students create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseStudentCreateCall.html), [*students delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseStudentDeleteCall.html), [*students get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseStudentGetCall.html), [*students list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseStudentListCall.html), [*teachers create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTeacherCreateCall.html), [*teachers delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTeacherDeleteCall.html), [*teachers get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTeacherGetCall.html), [*teachers list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTeacherListCall.html), [*topics create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTopicCreateCall.html), [*topics delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTopicDeleteCall.html), [*topics get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTopicGetCall.html), [*topics list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTopicListCall.html), [*topics patch*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseTopicPatchCall.html) and [*update*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.CourseUpdateCall.html) +* [invitations](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.Invitation.html) + * [*accept*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.InvitationAcceptCall.html), [*create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.InvitationCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.InvitationDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.InvitationGetCall.html) and [*list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.InvitationListCall.html) +* [registrations](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.Registration.html) + * [*create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.RegistrationCreateCall.html) and [*delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.RegistrationDeleteCall.html) +* [user profiles](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfile.html) + * [*get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGetCall.html), [*guardian invitations create*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGuardianDeleteCall.html), [*guardians get*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGuardianGetCall.html) and [*guardians list*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.UserProfileGuardianListCall.html) @@ -29,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/struct.Classroom.html)** +* **[Hub](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/struct.Classroom.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.Part.html)** + * **[Parts](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -175,17 +175,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -195,29 +195,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-classroom1/1.0.12+20190701/google_classroom1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-classroom1/1.0.13+20200408/google_classroom1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/classroom1/src/lib.rs b/gen/classroom1/src/lib.rs index b0ad608e30..d57cc8785a 100644 --- a/gen/classroom1/src/lib.rs +++ b/gen/classroom1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *classroom* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *classroom* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *classroom* *v1* API can be found at the //! [official documentation site](https://developers.google.com/classroom/). @@ -449,7 +449,7 @@ impl<'a, C, A> Classroom Classroom { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://classroom.googleapis.com/".to_string(), _root_url: "https://classroom.googleapis.com/".to_string(), } @@ -469,7 +469,7 @@ impl<'a, C, A> Classroom } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -558,7 +558,7 @@ pub struct Announcement { /// Identifiers of students with access to the announcement. /// This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. /// If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students - /// specified in this field will be able to see the announcement. + /// specified in this field can see the announcement. #[serde(rename="individualStudentsOptions")] pub individual_students_options: Option, /// Classroom-assigned identifier of this announcement, unique per course. @@ -597,11 +597,11 @@ impl Part for CloudPubsubTopic {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyIndividualStudentsOptions { - /// Ids of students to be added as having access to this + /// IDs of students to be added as having access to this /// coursework/announcement. #[serde(rename="addStudentIds")] pub add_student_ids: Option>, - /// Ids of students to be removed from having access to this + /// IDs of students to be removed from having access to this /// coursework/announcement. #[serde(rename="removeStudentIds")] pub remove_student_ids: Option>, @@ -790,7 +790,7 @@ pub struct UserProfile { pub photo_url: Option, /// Represents whether a G Suite for Education user's domain administrator has /// explicitly verified them as being a teacher. If the user is not a member of - /// a G Suite for Education domain, than this field will always be false. + /// a G Suite for Education domain, than this field is always false. /// /// Read-only #[serde(rename="verifiedTeacher")] @@ -839,7 +839,7 @@ pub struct AssignmentSubmission { /// /// Some attachment metadata is only populated if the requesting user has /// permission to access it. Identifier and alternate_link fields are always - /// available, but others (e.g. title) may not be. + /// available, but others (for example, title) may not be. pub attachments: Option>, } @@ -1091,8 +1091,8 @@ impl RequestValue for TurnInStudentSubmissionRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Material { - /// Link material. On creation, will be upgraded to a more appropriate type - /// if possible, and this will be reflected in the response. + /// Link material. On creation, this is upgraded to a more appropriate type + /// if possible, and this is reflected in the response. pub link: Option, /// Google Drive file material. #[serde(rename="driveFile")] @@ -1667,7 +1667,7 @@ impl Part for IndividualStudentsOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyAnnouncementAssigneesRequest { - /// Mode of the announcement describing whether it will be accessible by all + /// Mode of the announcement describing whether it is accessible by all /// students or specified individual students. #[serde(rename="assigneeMode")] pub assignee_mode: Option, @@ -1796,7 +1796,7 @@ pub struct CourseWork { /// Whether this course work item is associated with the Developer Console /// project making the request. /// - /// See google.classroom.Work.CreateCourseWork for more + /// See CreateCourseWork for more /// details. /// /// Read-only. @@ -1858,7 +1858,7 @@ pub struct CourseWork { /// Identifiers of students with access to the coursework. /// This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. /// If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students - /// specified in this field will be assigned the coursework. + /// specified in this field are assigned the coursework. #[serde(rename="individualStudentsOptions")] pub individual_students_options: Option, /// Optional time of day, in UTC, that submissions for this course work @@ -1923,8 +1923,8 @@ pub struct StudentSubmission { #[serde(rename="courseWorkType")] pub course_work_type: Option, /// Optional grade. If unset, no grade was set. - /// This value must be non-negative. Decimal (i.e. non-integer) values are - /// allowed, but will be rounded to two decimal places. + /// This value must be non-negative. Decimal (that is, non-integer) values are + /// allowed, but are rounded to two decimal places. /// /// This may be modified only by course teachers. #[serde(rename="assignedGrade")] @@ -1932,7 +1932,7 @@ pub struct StudentSubmission { /// Whether this student submission is associated with the Developer Console /// project making the request. /// - /// See google.classroom.Work.CreateCourseWork for more + /// See CreateCourseWork for more /// details. /// /// Read-only. @@ -1944,8 +1944,8 @@ pub struct StudentSubmission { /// Read-only. pub id: Option, /// Optional pending grade. If unset, no grade was set. - /// This value must be non-negative. Decimal (i.e. non-integer) values are - /// allowed, but will be rounded to two decimal places. + /// This value must be non-negative. Decimal (that is, non-integer) values are + /// allowed, but are rounded to two decimal places. /// /// This is only visible to and modifiable by course teachers. #[serde(rename="draftGrade")] @@ -1985,7 +1985,7 @@ pub struct StudentSubmission { /// Submission content when course_work_type is ASSIGNMENT. /// /// Students can modify this content using - /// google.classroom.Work.ModifyAttachments. + /// ModifyAttachments. #[serde(rename="assignmentSubmission")] pub assignment_submission: Option, } @@ -2096,8 +2096,8 @@ pub struct Topic { #[serde(rename="updateTime")] pub update_time: Option, /// The name of the topic, generated by the user. - /// Leading and trailing whitespaces, if any, will be trimmed. Also, multiple - /// consecutive whitespaces will be collapsed into one inside the name. The + /// Leading and trailing whitespaces, if any, are trimmed. Also, multiple + /// consecutive whitespaces are collapsed into one inside the name. The /// result must be a non-empty string. Topic names are case sensitive, and must /// be no longer than 100 characters. pub name: Option, @@ -2240,7 +2240,7 @@ impl Part for GlobalPermission {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct StateHistory { - /// The teacher or student who made the change + /// The teacher or student who made the change. #[serde(rename="actorUserId")] pub actor_user_id: Option, /// The workflow pipeline stage. @@ -10845,7 +10845,7 @@ impl<'a, C, A> CourseTopicPatchCall<'a, C, A> where C: BorrowMut, /// fields are specified. If a field supports empty values, it can be cleared /// by specifying it in the update mask and not in the Topic object. If a /// field that does not support empty values is included in the update mask and - /// not set in the Topic object, an `INVALID_ARGUMENT` error will be + /// not set in the Topic object, an `INVALID_ARGUMENT` error is /// returned. /// /// The following fields may be specified: @@ -11165,7 +11165,7 @@ impl<'a, C, A> CourseAnnouncementPatchCall<'a, C, A> where C: BorrowMut CourseCourseWorkPatchCall<'a, C, A> where C: BorrowMut UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM self } /// Mask that identifies which fields on the course to update. - /// This field is required to do an update. The update will fail if invalid + /// This field is required to do an update. The update fails if invalid /// fields are specified. The following fields are valid: /// /// * `state` @@ -18562,8 +18562,8 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu self._student_id = new_value.to_string(); self } - /// If specified, only results with the specified `state` values will be - /// returned. Otherwise, results with a `state` of `PENDING` will be returned. + /// If specified, only results with the specified `state` values are + /// returned. Otherwise, results with a `state` of `PENDING` are returned. /// /// Append the given value to the *states* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -18573,11 +18573,11 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu } /// nextPageToken /// value returned from a previous - /// list call, - /// indicating that the subsequent page of results should be returned. + /// list + /// call, indicating that the subsequent page of results should be returned. /// - /// The list request - /// must be otherwise identical to the one that resulted in this token. + /// The list + /// request must be otherwise identical to the one that resulted in this token. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> UserProfileGuardianInvitationListCall<'a, C, A> { @@ -18595,7 +18595,7 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu self } /// If specified, only results with the specified `invited_email_address` - /// will be returned. + /// are returned. /// /// Sets the *invited email address* query property to the given value. pub fn invited_email_address(mut self, new_value: &str) -> UserProfileGuardianInvitationListCall<'a, C, A> { diff --git a/gen/cloudasset1-cli/Cargo.toml b/gen/cloudasset1-cli/Cargo.toml index 9da281e601..0038c14d1b 100644 --- a/gen/cloudasset1-cli/Cargo.toml +++ b/gen/cloudasset1-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-cloudasset1-cli" -version = "1.0.12+20190625" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Asset (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudasset1-cli" -homepage = "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory" +homepage = "https://cloud.google.com/asset-inventory/docs/quickstart" documentation = "http://byron.github.io/google-apis-rs/google_cloudasset1_cli" license = "MIT" keywords = ["cloudasset", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudasset1] path = "../cloudasset1" -version = "1.0.12+20190625" +version = "1.0.13+20200403" diff --git a/gen/cloudasset1-cli/README.md b/gen/cloudasset1-cli/README.md index 01868bf36f..96f0a34fc6 100644 --- a/gen/cloudasset1-cli/README.md +++ b/gen/cloudasset1-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *Cloud Asset* API can be found at the -[official documentation site](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory). +[official documentation site](https://cloud.google.com/asset-inventory/docs/quickstart). # Installation and Source Code @@ -25,10 +25,16 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Asset* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Asset* API at revision *20200403*. The CLI is at version *1.0.13*. ```bash cloudasset1 [options] + feeds + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] methods batch-get-assets-history [-p ]... [-o ] export-assets (-r )... [-p ]... [-o ] diff --git a/gen/cloudasset1-cli/mkdocs.yml b/gen/cloudasset1-cli/mkdocs.yml index ce6be52507..e225371e6d 100644 --- a/gen/cloudasset1-cli/mkdocs.yml +++ b/gen/cloudasset1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Asset v1.0.12+20190625 +site_name: Cloud Asset v1.0.13+20200403 site_url: http://byron.github.io/google-apis-rs/google-cloudasset1-cli site_description: A complete library to interact with Cloud Asset (protocol v1) @@ -9,6 +9,11 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['feeds_create.md', 'Feeds', 'Create'] +- ['feeds_delete.md', 'Feeds', 'Delete'] +- ['feeds_get.md', 'Feeds', 'Get'] +- ['feeds_list.md', 'Feeds', 'List'] +- ['feeds_patch.md', 'Feeds', 'Patch'] - ['methods_batch-get-assets-history.md', 'Methods', 'Batch Get Assets History'] - ['methods_export-assets.md', 'Methods', 'Export Assets'] - ['operations_get.md', 'Operations', 'Get'] diff --git a/gen/cloudasset1-cli/src/main.rs b/gen/cloudasset1-cli/src/main.rs index 7df509a5d4..256be1e58f 100644 --- a/gen/cloudasset1-cli/src/main.rs +++ b/gen/cloudasset1-cli/src/main.rs @@ -46,6 +46,342 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _feeds_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "feed.asset-types" => Some(("feed.assetTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "feed.asset-names" => Some(("feed.assetNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "feed.content-type" => Some(("feed.contentType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feed.name" => Some(("feed.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feed.feed-output-config.pubsub-destination.topic" => Some(("feed.feedOutputConfig.pubsubDestination.topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feed-id" => Some(("feedId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["asset-names", "asset-types", "content-type", "feed", "feed-id", "feed-output-config", "name", "pubsub-destination", "topic"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CreateFeedRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.feeds().create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _feeds_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.feeds().delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _feeds_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.feeds().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _feeds_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.feeds().list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _feeds_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "feed.asset-types" => Some(("feed.assetTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "feed.asset-names" => Some(("feed.assetNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "feed.content-type" => Some(("feed.contentType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feed.name" => Some(("feed.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "feed.feed-output-config.pubsub-destination.topic" => Some(("feed.feedOutputConfig.pubsubDestination.topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["asset-names", "asset-types", "content-type", "feed", "feed-output-config", "name", "pubsub-destination", "topic", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpdateFeedRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.feeds().patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _methods_batch_get_assets_history(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.methods().batch_get_assets_history(opt.value_of("parent").unwrap_or("")); @@ -137,10 +473,13 @@ impl<'n> Engine<'n> { "asset-types" => Some(("assetTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "read-time" => Some(("readTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-type" => Some(("contentType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-config.bigquery-destination.table" => Some(("outputConfig.bigqueryDestination.table", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-config.bigquery-destination.force" => Some(("outputConfig.bigqueryDestination.force", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "output-config.bigquery-destination.dataset" => Some(("outputConfig.bigqueryDestination.dataset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-config.gcs-destination.uri-prefix" => Some(("outputConfig.gcsDestination.uriPrefix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "output-config.gcs-destination.uri" => Some(("outputConfig.gcsDestination.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["asset-types", "content-type", "gcs-destination", "output-config", "read-time", "uri", "uri-prefix"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["asset-types", "bigquery-destination", "content-type", "dataset", "force", "gcs-destination", "output-config", "read-time", "table", "uri", "uri-prefix"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -257,6 +596,29 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("feeds", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._feeds_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._feeds_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._feeds_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._feeds_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._feeds_patch(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("feeds".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("methods", Some(opt)) => { match opt.subcommand() { ("batch-get-assets-history", Some(opt)) => { @@ -367,6 +729,150 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ + ("feeds", "methods: 'create', 'delete', 'get', 'list' and 'patch'", vec![ + ("create", + Some(r##"Creates a feed in a parent project/folder/organization to listen to its + asset updates."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudasset1_cli/feeds_create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the project/folder/organization where this feed + should be created in. It can only be an organization number (such as + "organizations/123"), a folder number (such as "folders/123"), a project ID + (such as "projects/my-project-id")", or a project number (such as + "projects/12345")."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes an asset feed."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudasset1_cli/feeds_delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the feed and it must be in the format of: + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Gets details about an asset feed."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudasset1_cli/feeds_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the Feed and it must be in the format of: + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Lists all asset feeds in a parent project/folder/organization."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudasset1_cli/feeds_list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent project/folder/organization whose feeds are to be + listed. It can only be using project/folder/organization number (such as + "folders/12345")", or a project ID (such as "projects/my-project-id")."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates an asset feed configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudasset1_cli/feeds_patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The format will be + projects/{project_number}/feeds/{client-assigned_feed_identifier} or + folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + + The client-assigned feed identifier must be unique within the parent + project/folder/organization."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("methods", "methods: 'batch-get-assets-history' and 'export-assets'", vec![ ("batch-get-assets-history", Some(r##"Batch gets the update history of assets that overlap a time window. @@ -465,7 +971,7 @@ fn main() { let mut app = App::new("cloudasset1") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200403") .about("The cloud asset API manages the history and inventory of cloud resources.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudasset1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudasset1/Cargo.toml b/gen/cloudasset1/Cargo.toml index 84adf786be..fd8f2f5431 100644 --- a/gen/cloudasset1/Cargo.toml +++ b/gen/cloudasset1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudasset1" -version = "1.0.12+20190625" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Asset (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudasset1" -homepage = "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory" -documentation = "https://docs.rs/google-cloudasset1/1.0.12+20190625" +homepage = "https://cloud.google.com/asset-inventory/docs/quickstart" +documentation = "https://docs.rs/google-cloudasset1/1.0.13+20200403" license = "MIT" keywords = ["cloudasset", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudasset1/README.md b/gen/cloudasset1/README.md index a276257ed0..0817758636 100644 --- a/gen/cloudasset1/README.md +++ b/gen/cloudasset1/README.md @@ -5,21 +5,23 @@ DO NOT EDIT ! --> The `google-cloudasset1` library allows access to all features of the *Google Cloud Asset* service. -This documentation was generated from *Cloud Asset* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *cloudasset:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Asset* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *cloudasset:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Asset* *v1* API can be found at the -[official documentation site](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory). +[official documentation site](https://cloud.google.com/asset-inventory/docs/quickstart). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/struct.CloudAsset.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.CloudAsset.html) ... -* [operations](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/struct.Operation.html) - * [*get*](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/struct.OperationGetCall.html) +* [feeds](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.Feed.html) + * [*create*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.FeedCreateCall.html), [*delete*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.FeedDeleteCall.html), [*get*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.FeedGetCall.html), [*list*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.FeedListCall.html) and [*patch*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.FeedPatchCall.html) +* [operations](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.OperationGetCall.html) Other activities are ... -* [batch get assets history](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/struct.MethodBatchGetAssetsHistoryCall.html) -* [export assets](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/struct.MethodExportAssetCall.html) +* [batch get assets history](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.MethodBatchGetAssetsHistoryCall.html) +* [export assets](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.MethodExportAssetCall.html) @@ -27,17 +29,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/struct.CloudAsset.html)** +* **[Hub](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/struct.CloudAsset.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -51,8 +53,11 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.methods().export_assets(...).doit() -let r = hub.operations().get(...).doit() +let r = hub.feeds().create(...).doit() +let r = hub.feeds().get(...).doit() +let r = hub.feeds().list(...).doit() +let r = hub.feeds().delete(...).doit() +let r = hub.feeds().patch(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -86,7 +91,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_cloudasset1 as cloudasset1; -use cloudasset1::ExportAssetsRequest; +use cloudasset1::CreateFeedRequest; use cloudasset1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -107,12 +112,12 @@ let mut hub = CloudAsset::new(hyper::Client::with_connector(hyper::net::HttpsCon // 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 = ExportAssetsRequest::default(); +let mut req = CreateFeedRequest::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.methods().export_assets(req, "parent") +let result = hub.feeds().create(req, "parent") .doit(); match result { @@ -135,17 +140,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +160,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudasset1/1.0.12+20190625/google_cloudasset1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudasset1/1.0.13+20200403/google_cloudasset1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudasset1/src/lib.rs b/gen/cloudasset1/src/lib.rs index 2bdfde02d0..4860b68f3b 100644 --- a/gen/cloudasset1/src/lib.rs +++ b/gen/cloudasset1/src/lib.rs @@ -2,15 +2,17 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Asset* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *cloudasset:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Asset* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *cloudasset:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Asset* *v1* API can be found at the -//! [official documentation site](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory). +//! [official documentation site](https://cloud.google.com/asset-inventory/docs/quickstart). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudasset1). //! # Features //! //! Handle the following *Resources* with ease from the central [hub](struct.CloudAsset.html) ... //! +//! * [feeds](struct.Feed.html) +//! * [*create*](struct.FeedCreateCall.html), [*delete*](struct.FeedDeleteCall.html), [*get*](struct.FeedGetCall.html), [*list*](struct.FeedListCall.html) and [*patch*](struct.FeedPatchCall.html) //! * [operations](struct.Operation.html) //! * [*get*](struct.OperationGetCall.html) //! @@ -51,8 +53,11 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.methods().export_assets(...).doit() -//! let r = hub.operations().get(...).doit() +//! let r = hub.feeds().create(...).doit() +//! let r = hub.feeds().get(...).doit() +//! let r = hub.feeds().list(...).doit() +//! let r = hub.feeds().delete(...).doit() +//! let r = hub.feeds().patch(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -86,7 +91,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_cloudasset1 as cloudasset1; -//! use cloudasset1::ExportAssetsRequest; +//! use cloudasset1::CreateFeedRequest; //! use cloudasset1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -108,12 +113,12 @@ //! // 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 = ExportAssetsRequest::default(); +//! let mut req = CreateFeedRequest::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.methods().export_assets(req, "parent") +//! let result = hub.feeds().create(req, "parent") //! .doit(); //! //! match result { @@ -269,7 +274,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_cloudasset1 as cloudasset1; -/// use cloudasset1::ExportAssetsRequest; +/// use cloudasset1::CreateFeedRequest; /// use cloudasset1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -291,12 +296,12 @@ impl Default for Scope { /// // 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 = ExportAssetsRequest::default(); +/// let mut req = CreateFeedRequest::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.methods().export_assets(req, "parent") +/// let result = hub.feeds().create(req, "parent") /// .doit(); /// /// match result { @@ -334,12 +339,15 @@ impl<'a, C, A> CloudAsset CloudAsset { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudasset.googleapis.com/".to_string(), _root_url: "https://cloudasset.googleapis.com/".to_string(), } } + pub fn feeds(&'a self) -> FeedMethods<'a, C, A> { + FeedMethods { hub: &self } + } pub fn methods(&'a self) -> MethodMethods<'a, C, A> { MethodMethods { hub: &self } } @@ -348,7 +356,7 @@ impl<'a, C, A> CloudAsset } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -376,42 +384,18 @@ impl<'a, C, A> CloudAsset // ############ // SCHEMAS ### // ########## -/// Provides the configuration for logging a type of permissions. -/// Example: -/// -/// ````text -/// { -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// "exempted_members": [ -/// "user:foo@gmail.com" -/// ] -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// } -/// ] -/// } -/// ```` -/// -/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// Output configuration for asset feed destination. /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of - /// permission. - /// Follows the same format of Binding.members. - #[serde(rename="exemptedMembers")] - pub exempted_members: Option>, - /// The log type that this config enables. - #[serde(rename="logType")] - pub log_type: Option, +pub struct FeedOutputConfig { + /// Destination on Pub/Sub. + #[serde(rename="pubsubDestination")] + pub pubsub_destination: Option, } -impl Part for AuditLogConfig {} +impl Part for FeedOutputConfig {} /// Ignores policies set above this resource and restores the @@ -435,53 +419,6 @@ pub struct GoogleCloudOrgpolicyV1RestoreDefault { _never_set: Option } impl Part for GoogleCloudOrgpolicyV1RestoreDefault {} -/// Representation of a cloud resource. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourceType { - /// The API version. Example: "v1". - pub version: Option, - /// The REST URL for accessing the resource. An HTTP GET operation using this - /// URL returns the resource itself. - /// Example: - /// `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - /// It will be left unspecified for resources without a REST API. - #[serde(rename="resourceUrl")] - pub resource_url: Option, - /// The full name of the immediate parent of this resource. See - /// [Resource - /// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - /// for more information. - /// - /// For GCP assets, it is the parent resource defined in the [Cloud IAM policy - /// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - /// For example: - /// `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. - /// - /// For third-party assets, it is up to the users to define. - pub parent: Option, - /// The URL of the discovery document containing the resource's JSON schema. - /// For example: - /// `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. - /// It will be left unspecified for resources without a discovery-based API, - /// such as Cloud Bigtable. - #[serde(rename="discoveryDocumentUri")] - pub discovery_document_uri: Option, - /// The content of the resource, in which some sensitive fields are scrubbed - /// away and may not be present. - pub data: Option>, - /// The JSON schema name listed in the discovery document. - /// Example: "Project". It will be left unspecified for resources (such as - /// Cloud Bigtable) without a discovery-based API. - #[serde(rename="discoveryName")] - pub discovery_name: Option, -} - -impl Part for ResourceType {} - - /// Export asset request. /// /// # Activities @@ -496,7 +433,7 @@ pub struct ExportAssetsRequest { /// A list of asset types of which to take a snapshot for. For example: /// "compute.googleapis.com/Disk". If specified, only matching assets will be /// returned. See [Introduction to Cloud Asset - /// Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + /// Inventory](https://cloud.google.com/asset-inventory/docs/overview) /// for all supported asset types. #[serde(rename="assetTypes")] pub asset_types: Option>, @@ -509,10 +446,10 @@ pub struct ExportAssetsRequest { #[serde(rename="outputConfig")] pub output_config: Option, /// Timestamp to take an asset snapshot. This can only be set to a timestamp - /// between 2018-10-02 UTC (inclusive) and the current time. If not specified, - /// the current time will be used. Due to delays in resource data collection - /// and indexing, there is a volatile window during which running the same - /// query may get different results. + /// between the current time and the current time minus 35 days (inclusive). + /// If not specified, the current time will be used. Due to delays in resource + /// data collection and indexing, there is a volatile window during which + /// running the same query may get different results. #[serde(rename="readTime")] pub read_time: Option, } @@ -520,133 +457,199 @@ pub struct ExportAssetsRequest { impl RequestValue for ExportAssetsRequest {} -/// Represents an expression text. Example: -/// -/// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" -/// ```` -/// -/// This type is not used in any activity, and only used as *part* of another schema. -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Expr { - /// An optional description of the expression. This is a longer text which - /// describes the expression, e.g. when hovered over it in a UI. - pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. - pub expression: Option, - /// An optional string indicating the location of the expression for error - /// reporting, e.g. a file name and a position in the file. - pub location: Option, - /// An optional title for the expression, i.e. a short string describing - /// its purpose. This can be used e.g. in UIs which allow to enter the - /// expression. - pub title: Option, -} - -impl Part for Expr {} - - -/// Temporal asset. In addition to the asset, the temporal asset includes the -/// status of the asset and valid from and to time of it. +/// A time window specified by its "start_time" and "end_time". /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TemporalAsset { - /// If the asset is deleted or not. - pub deleted: Option, - /// The time window when the asset data and state was observed. - pub window: Option, - /// Asset. - pub asset: Option, +pub struct TimeWindow { + /// End time of the time window (inclusive). If not specified, the current + /// timestamp is used instead. + #[serde(rename="endTime")] + pub end_time: Option, + /// Start time of the time window (exclusive). + #[serde(rename="startTime")] + pub start_time: Option, } -impl Part for TemporalAsset {} +impl Part for TimeWindow {} -/// Cloud asset. This includes all Google Cloud Platform resources, -/// Cloud IAM policies, and other non-GCP assets. +/// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +/// to represent the necessary conditions for the level to apply to a request. +/// See CEL spec at: https://github.com/google/cel-spec +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1CustomLevel { + /// Required. A Cloud CEL expression evaluating to a boolean. + pub expr: Option, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1CustomLevel {} + + +/// A condition necessary for an `AccessLevel` to be granted. The Condition is an +/// AND over its fields. So a Condition is true if: 1) the request IP is from one +/// of the listed subnetworks AND 2) the originating device complies with the +/// listed device policy AND 3) all listed access levels are granted AND 4) the +/// request was sent at a time allowed by the DateTimeRestriction. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1Condition { + /// A list of other access levels defined in the same `Policy`, referenced by + /// resource name. Referencing an `AccessLevel` which does not exist is an + /// error. All access levels listed must be granted for the Condition + /// to be true. Example: + /// "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` + #[serde(rename="requiredAccessLevels")] + pub required_access_levels: Option>, + /// The request must originate from one of the provided countries/regions. + /// Must be valid ISO 3166-1 alpha-2 codes. + pub regions: Option>, + /// The request must be made by one of the provided user or service + /// accounts. Groups are not supported. + /// Syntax: + /// `user:{emailid}` + /// `serviceAccount:{emailid}` + /// If not specified, a request may come from any user. + pub members: Option>, + /// Device specific restrictions, all restrictions must hold for the + /// Condition to be true. If not specified, all devices are allowed. + #[serde(rename="devicePolicy")] + pub device_policy: Option, + /// Whether to negate the Condition. If true, the Condition becomes a NAND over + /// its non-empty fields, each field must be false for the Condition overall to + /// be satisfied. Defaults to false. + pub negate: Option, + /// CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for + /// a CIDR IP address block, the specified IP address portion must be properly + /// truncated (i.e. all the host bits must be zero) or the input is considered + /// malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is + /// not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas + /// "2001:db8::1/32" is not. The originating IP of a request must be in one of + /// the listed subnets in order for this Condition to be true. If empty, all IP + /// addresses are allowed. + #[serde(rename="ipSubnetworks")] + pub ip_subnetworks: Option>, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1Condition {} + + +/// An asset in Google Cloud. An asset can be any resource in the Google Cloud +/// [resource +/// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +/// a resource outside the Google Cloud resource hierarchy (such as Google +/// Kubernetes Engine clusters and objects), or a Cloud IAM policy. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Asset { - /// Representation of the actual Cloud IAM policy set on a cloud resource. For - /// each resource, there must be at most one Cloud IAM policy set on it. - #[serde(rename="iamPolicy")] - pub iam_policy: Option, - /// Type of the asset. Example: "compute.googleapis.com/Disk". + /// The type of the asset. For example: "compute.googleapis.com/Disk" + /// + /// See [Supported asset + /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + /// for more information. #[serde(rename="assetType")] pub asset_type: Option, - /// Representation of the resource. + /// The ancestry path of an asset in Google Cloud [resource + /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + /// represented as a list of relative resource names. An ancestry path starts + /// with the closest ancestor in the hierarchy and ends at root. If the asset + /// is a project, folder, or organization, the ancestry path starts from the + /// asset itself. + /// + /// For example: `["projects/123456789", "folders/5432", "organizations/1234"]` + pub ancestors: Option>, + /// A representation of the resource. pub resource: Option, /// The full name of the asset. For example: - /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + /// "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1" + /// /// See [Resource - /// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + /// names](https://cloud.google.com/apis/design/resource_names#full_resource_name) /// for more information. pub name: Option, - /// Representation of the Cloud Organization Policy set on an asset. For each - /// asset, there could be multiple Organization policies with different - /// constraints. + /// A representation of an [organization + /// policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + /// There can be more than one organization policy with different constraints + /// set on a given resource. #[serde(rename="orgPolicy")] pub org_policy: Option>, + /// no description provided + #[serde(rename="accessPolicy")] + pub access_policy: Option, + /// no description provided + #[serde(rename="servicePerimeter")] + pub service_perimeter: Option, + /// A representation of the Cloud IAM policy set on a Google Cloud resource. + /// There can be a maximum of one Cloud IAM policy set on any given resource. + /// In addition, Cloud IAM policies inherit their granted access scope from any + /// policies set on parent resources in the resource hierarchy. Therefore, the + /// effectively policy is the union of both the policy set on this resource + /// and each policy set on all of the resource's ancestry resource levels in + /// the hierarchy. See + /// [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for + /// more information. + #[serde(rename="iamPolicy")] + pub iam_policy: Option, + /// no description provided + #[serde(rename="accessLevel")] + pub access_level: Option, } impl Part for Asset {} -/// Output configuration for export assets destination. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OutputConfig { - /// Destination on Cloud Storage. - #[serde(rename="gcsDestination")] - pub gcs_destination: Option, -} - -impl Part for OutputConfig {} - - -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. -/// -/// **JSON Example** +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -654,15 +657,21 @@ impl Part for OutputConfig {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -678,161 +687,64 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } impl Part for Policy {} -/// Used in `policy_type` to specify how `list_policy` behaves at this -/// resource. +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: /// -/// `ListPolicy` can define specific values and subtrees of Cloud Resource -/// Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that -/// are allowed or denied by setting the `allowed_values` and `denied_values` -/// fields. This is achieved by using the `under:` and optional `is:` prefixes. -/// The `under:` prefix is used to denote resource subtree values. -/// The `is:` prefix is used to denote specific values, and is required only -/// if the value contains a ":". Values prefixed with "is:" are treated the -/// same as values with no prefix. -/// Ancestry subtrees must be in one of the following formats: -/// - “projects/”, e.g. “projects/tokyo-rain-123” -/// - “folders/”, e.g. “folders/1234” -/// - “organizations/”, e.g. “organizations/1234” -/// The `supports_under` field of the associated `Constraint` defines whether -/// ancestry prefixes can be used. You can set `allowed_values` and -/// `denied_values` in the same `Policy` if `all_values` is -/// `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all -/// values. If `all_values` is set to either `ALLOW` or `DENY`, -/// `allowed_values` and `denied_values` must be unset. +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete feeds](struct.FeedDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudOrgpolicyV1ListPolicy { - /// The policy all_values state. - #[serde(rename="allValues")] - pub all_values: Option, - /// List of values allowed at this resource. Can only be set if `all_values` - /// is set to `ALL_VALUES_UNSPECIFIED`. - #[serde(rename="allowedValues")] - pub allowed_values: Option>, - /// Determines the inheritance behavior for this `Policy`. - /// - /// By default, a `ListPolicy` set at a resource supercedes any `Policy` set - /// anywhere up the resource hierarchy. However, if `inherit_from_parent` is - /// set to `true`, then the values from the effective `Policy` of the parent - /// resource are inherited, meaning the values set in this `Policy` are - /// added to the values inherited up the hierarchy. - /// - /// Setting `Policy` hierarchies that inherit both allowed values and denied - /// values isn't recommended in most circumstances to keep the configuration - /// simple and understandable. However, it is possible to set a `Policy` with - /// `allowed_values` set that inherits a `Policy` with `denied_values` set. - /// In this case, the values that are allowed must be in `allowed_values` and - /// not present in `denied_values`. - /// - /// For example, suppose you have a `Constraint` - /// `constraints/serviceuser.services`, which has a `constraint_type` of - /// `list_constraint`, and with `constraint_default` set to `ALLOW`. - /// Suppose that at the Organization level, a `Policy` is applied that - /// restricts the allowed API activations to {`E1`, `E2`}. Then, if a - /// `Policy` is applied to a project below the Organization that has - /// `inherit_from_parent` set to `false` and field all_values set to DENY, - /// then an attempt to activate any API will be denied. - /// - /// The following examples demonstrate different possible layerings for - /// `projects/bar` parented by `organizations/foo`: - /// - /// Example 1 (no inherited values): - /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values:”E2”} - /// `projects/bar` has `inherit_from_parent` `false` and values: - /// {allowed_values: "E3" allowed_values: "E4"} - /// The accepted values at `organizations/foo` are `E1`, `E2`. - /// The accepted values at `projects/bar` are `E3`, and `E4`. - /// - /// Example 2 (inherited values): - /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values:”E2”} - /// `projects/bar` has a `Policy` with values: - /// {value: “E3” value: ”E4” inherit_from_parent: true} - /// The accepted values at `organizations/foo` are `E1`, `E2`. - /// The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. - /// - /// Example 3 (inheriting both allowed and denied values): - /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: "E1" allowed_values: "E2"} - /// `projects/bar` has a `Policy` with: - /// {denied_values: "E1"} - /// The accepted values at `organizations/foo` are `E1`, `E2`. - /// The value accepted at `projects/bar` is `E2`. - /// - /// Example 4 (RestoreDefault): - /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values:”E2”} - /// `projects/bar` has a `Policy` with values: - /// {RestoreDefault: {}} - /// The accepted values at `organizations/foo` are `E1`, `E2`. - /// The accepted values at `projects/bar` are either all or none depending on - /// the value of `constraint_default` (if `ALLOW`, all; if - /// `DENY`, none). - /// - /// Example 5 (no policy inherits parent policy): - /// `organizations/foo` has no `Policy` set. - /// `projects/bar` has no `Policy` set. - /// The accepted values at both levels are either all or none depending on - /// the value of `constraint_default` (if `ALLOW`, all; if - /// `DENY`, none). - /// - /// Example 6 (ListConstraint allowing all): - /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values: ”E2”} - /// `projects/bar` has a `Policy` with: - /// {all: ALLOW} - /// The accepted values at `organizations/foo` are `E1`, E2`. Any value is accepted at `projects/bar`. - /// - /// Example 7 (ListConstraint allowing none): - /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values: ”E2”} - /// `projects/bar` has a `Policy` with: - /// {all: DENY} - /// The accepted values at `organizations/foo` are `E1`, E2`. No value is accepted at `projects/bar`. - /// - /// Example 10 (allowed and denied subtrees of Resource Manager hierarchy): - /// Given the following resource hierarchy - /// O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, - /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: "under:organizations/O1"} - /// `projects/bar` has a `Policy` with: - /// {allowed_values: "under:projects/P3"} - /// {denied_values: "under:folders/F2"} - /// The accepted values at `organizations/foo` are `organizations/O1`, - /// `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, - /// `projects/P3`. - /// The accepted values at `projects/bar` are `organizations/O1`, - /// `folders/F1`, `projects/P1`. - #[serde(rename="inheritFromParent")] - pub inherit_from_parent: Option, - /// Optional. The Google Cloud Console will try to default to a configuration - /// that matches the value specified in this `Policy`. If `suggested_value` - /// is not set, it will inherit the value specified higher in the hierarchy, - /// unless `inherit_from_parent` is `false`. - #[serde(rename="suggestedValue")] - pub suggested_value: Option, - /// List of values denied at this resource. Can only be set if `all_values` - /// is set to `ALL_VALUES_UNSPECIFIED`. - #[serde(rename="deniedValues")] - pub denied_values: Option>, -} +pub struct Empty { _never_set: Option } -impl Part for GoogleCloudOrgpolicyV1ListPolicy {} +impl ResponseResult for Empty {} /// The `Status` type defines a logical error model that is suitable for @@ -861,6 +773,60 @@ pub struct Status { impl Part for Status {} +/// A BigQuery destination. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BigQueryDestination { + /// Required. The BigQuery table to which the snapshot result should be + /// written. If this table does not exist, a new table with the given name + /// will be created. + pub table: Option, + /// If the destination table already exists and this flag is `TRUE`, the + /// table will be overwritten by the contents of assets snapshot. If the flag + /// is `FALSE` or unset and the destination table already exists, the export + /// call returns an INVALID_ARGUMEMT error. + pub force: Option, + /// Required. The BigQuery dataset in format + /// "projects/projectId/datasets/datasetId", to which the snapshot result + /// should be exported. If this dataset does not exist, the export call returns + /// an INVALID_ARGUMENT error. + pub dataset: Option, +} + +impl Part for BigQueryDestination {} + + +/// `AccessPolicy` is a container for `AccessLevels` (which define the necessary +/// attributes to use Google Cloud services) and `ServicePerimeters` (which +/// define regions of services able to freely pass data within a perimeter). An +/// access policy is globally visible within an organization, and the +/// restrictions it specifies apply to all projects within an organization. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1AccessPolicy { + /// Output only. An opaque identifier for the current version of the + /// `AccessPolicy`. This will always be a strongly validated etag, meaning that + /// two Access Polices will be identical if and only if their etags are + /// identical. Clients should not expect this to be in any specific format. + pub etag: Option, + /// Output only. Resource name of the `AccessPolicy`. Format: + /// `accessPolicies/{policy_id}` + pub name: Option, + /// Required. The parent of this `AccessPolicy` in the Cloud Resource + /// Hierarchy. Currently immutable once created. Format: + /// `organizations/{organization_id}` + pub parent: Option, + /// Required. Human readable title. Does not affect behavior. + pub title: Option, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1AccessPolicy {} + + /// Used in `policy_type` to specify how `boolean_policy` will behave at this /// resource. /// @@ -919,6 +885,690 @@ pub struct GoogleCloudOrgpolicyV1BooleanPolicy { impl Part for GoogleCloudOrgpolicyV1BooleanPolicy {} +/// A restriction on the OS type and version of devices making requests. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1OsConstraint { + /// Required. The allowed OS type. + #[serde(rename="osType")] + pub os_type: Option, + /// Only allows requests from devices with a verified Chrome OS. + /// Verifications includes requirements that the device is enterprise-managed, + /// conformant to domain policies, and the caller has permission to call + /// the API targeted by the request. + #[serde(rename="requireVerifiedChromeOs")] + pub require_verified_chrome_os: Option, + /// The minimum allowed OS version. If not set, any version of this OS + /// satisfies the constraint. Format: `"major.minor.patch"`. + /// Examples: `"10.5.301"`, `"9.2.1"`. + #[serde(rename="minimumVersion")] + pub minimum_version: Option, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1OsConstraint {} + + +/// Output configuration for export assets destination. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OutputConfig { + /// Destination on BigQuery. The output table stores the fields in asset + /// proto as columns in BigQuery. The resource/iam_policy field is converted + /// to a record with each field to a column, except metadata to a single JSON + /// string. + #[serde(rename="bigqueryDestination")] + pub bigquery_destination: Option, + /// Destination on Cloud Storage. + #[serde(rename="gcsDestination")] + pub gcs_destination: Option, +} + +impl Part for OutputConfig {} + + +/// Create asset feed request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create feeds](struct.FeedCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateFeedRequest { + /// Required. The feed details. The field `name` must be empty and it will be generated + /// in the format of: + /// projects/project_number/feeds/feed_id + /// folders/folder_number/feeds/feed_id + /// organizations/organization_number/feeds/feed_id + pub feed: Option, + /// Required. This is the client-assigned asset feed identifier and it needs to + /// be unique under a specific parent project/folder/organization. + #[serde(rename="feedId")] + pub feed_id: Option, +} + +impl RequestValue for CreateFeedRequest {} + + +/// A Cloud Storage location. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GcsDestination { + /// The uri prefix of all generated Cloud Storage objects. For example: + /// "gs://bucket_name/object_name_prefix". Each object uri is in format: + /// "gs://bucket_name/object_name_prefix// and only + /// contains assets for that type. starts from 0. For example: + /// "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + /// the first shard of output objects containing all + /// compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + /// returned if file with the same name "gs://bucket_name/object_name_prefix" + /// already exists. + #[serde(rename="uriPrefix")] + pub uri_prefix: Option, + /// The uri of the Cloud Storage object. It's the same uri that is used by + /// gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + /// Editing Object + /// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + /// for more information. + pub uri: Option, +} + +impl Part for GcsDestination {} + + +/// `ServicePerimeter` describes a set of Google Cloud resources which can freely +/// import and export data amongst themselves, but not export outside of the +/// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` +/// has a target outside of the `ServicePerimeter`, the request will be blocked. +/// Otherwise the request is allowed. There are two types of Service Perimeter - +/// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +/// Google Cloud project can only belong to a single regular Service Perimeter. +/// Service Perimeter Bridges can contain only Google Cloud projects as members, +/// a single Google Cloud project may belong to multiple Service Perimeter +/// Bridges. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1ServicePerimeter { + /// Current ServicePerimeter configuration. Specifies sets of resources, + /// restricted services and access levels that determine perimeter + /// content and boundaries. + pub status: Option, + /// Description of the `ServicePerimeter` and its use. Does not affect + /// behavior. + pub description: Option, + /// Human readable title. Must be unique within the Policy. + pub title: Option, + /// Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + /// exists for all Service Perimeters, and that spec is identical to the + /// status for those Service Perimeters. When this flag is set, it inhibits the + /// generation of the implicit spec, thereby allowing the user to explicitly + /// provide a configuration ("spec") to use in a dry-run version of the Service + /// Perimeter. This allows the user to test changes to the enforced config + /// ("status") without actually enforcing them. This testing is done through + /// analyzing the differences between currently enforced and suggested + /// restrictions. use_explicit_dry_run_spec must bet set to True if any of the + /// fields in the spec are set to non-default values. + #[serde(rename="useExplicitDryRunSpec")] + pub use_explicit_dry_run_spec: Option, + /// Perimeter type indicator. A single project is + /// allowed to be a member of single regular perimeter, but multiple service + /// perimeter bridges. A project cannot be a included in a perimeter bridge + /// without being included in regular perimeter. For perimeter bridges, + /// the restricted service list as well as access level lists must be + /// empty. + #[serde(rename="perimeterType")] + pub perimeter_type: Option, + /// Proposed (or dry run) ServicePerimeter configuration. This configuration + /// allows to specify and test ServicePerimeter configuration without enforcing + /// actual access restrictions. Only allowed to be set when the + /// "use_explicit_dry_run_spec" flag is set. + pub spec: Option, + /// Required. Resource name for the ServicePerimeter. The `short_name` + /// component must begin with a letter and only include alphanumeric and '_'. + /// Format: `accessPolicies/{policy_id}/servicePerimeters/{short_name}` + pub name: Option, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1ServicePerimeter {} + + +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// ````text +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:jose@example.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// ```` +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// jose@example.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + +/// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +/// describe specific Service Perimeter configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig { + /// Google Cloud services that are subject to the Service Perimeter + /// restrictions. For example, if `storage.googleapis.com` is specified, access + /// to the storage buckets inside the perimeter must meet the perimeter's + /// access restrictions. + #[serde(rename="restrictedServices")] + pub restricted_services: Option>, + /// Configuration for APIs allowed within Perimeter. + #[serde(rename="vpcAccessibleServices")] + pub vpc_accessible_services: Option, + /// A list of Google Cloud resources that are inside of the service perimeter. + /// Currently only projects are allowed. Format: `projects/{project_number}` + pub resources: Option>, + /// A list of `AccessLevel` resource names that allow resources within the + /// `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + /// must be in the same policy as this `ServicePerimeter`. Referencing a + /// nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + /// listed, resources within the perimeter can only be accessed via Google + /// Cloud calls with request origins within the perimeter. Example: + /// `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + /// For Service Perimeter Bridge, must be empty. + #[serde(rename="accessLevels")] + pub access_levels: Option>, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig {} + + +/// A representation of a Google Cloud resource. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceType { + /// The API version. For example: "v1" + pub version: Option, + /// The REST URL for accessing the resource. An HTTP `GET` request using this + /// URL returns the resource itself. For example: + /// "https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123" + /// + /// This value is unspecified for resources without a REST API. + #[serde(rename="resourceUrl")] + pub resource_url: Option, + /// The full name of the immediate parent of this resource. See + /// [Resource + /// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + /// for more information. + /// + /// For Google Cloud assets, this value is the parent resource defined in the + /// [Cloud IAM policy + /// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + /// For example: + /// "//cloudresourcemanager.googleapis.com/projects/my_project_123" + /// + /// For third-party assets, this field may be set differently. + pub parent: Option, + /// The URL of the discovery document containing the resource's JSON schema. + /// For example: + /// "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest" + /// + /// This value is unspecified for resources that do not have an API based on a + /// discovery document, such as Cloud Bigtable. + #[serde(rename="discoveryDocumentUri")] + pub discovery_document_uri: Option, + /// The content of the resource, in which some sensitive fields are removed + /// and may not be present. + pub data: Option>, + /// The JSON schema name listed in the discovery document. For example: + /// "Project" + /// + /// This value is unspecified for resources that do not have an API based on a + /// discovery document, such as Cloud Bigtable. + #[serde(rename="discoveryName")] + pub discovery_name: Option, +} + +impl Part for ResourceType {} + + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// ````text +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// ```` +/// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// Optional. Description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language + /// syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for Expr {} + + +/// A Pub/Sub destination. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PubsubDestination { + /// The name of the Pub/Sub topic to publish to. + /// For example: `projects/PROJECT_ID/topics/TOPIC_ID`. + pub topic: Option, +} + +impl Part for PubsubDestination {} + + +/// An asset in Google Cloud and its temporal metadata, including the time window +/// when it was observed and its status during that window. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TemporalAsset { + /// Whether the asset has been deleted or not. + pub deleted: Option, + /// The time window when the asset data and state was observed. + pub window: Option, + /// An asset in Google Cloud. + pub asset: Option, +} + +impl Part for TemporalAsset {} + + +/// Used in `policy_type` to specify how `list_policy` behaves at this +/// resource. +/// +/// `ListPolicy` can define specific values and subtrees of Cloud Resource +/// Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that +/// are allowed or denied by setting the `allowed_values` and `denied_values` +/// fields. This is achieved by using the `under:` and optional `is:` prefixes. +/// The `under:` prefix is used to denote resource subtree values. +/// The `is:` prefix is used to denote specific values, and is required only +/// if the value contains a ":". Values prefixed with "is:" are treated the +/// same as values with no prefix. +/// Ancestry subtrees must be in one of the following formats: +/// - "projects/", e.g. "projects/tokyo-rain-123" +/// - "folders/", e.g. "folders/1234" +/// - "organizations/", e.g. "organizations/1234" +/// The `supports_under` field of the associated `Constraint` defines whether +/// ancestry prefixes can be used. You can set `allowed_values` and +/// `denied_values` in the same `Policy` if `all_values` is +/// `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all +/// values. If `all_values` is set to either `ALLOW` or `DENY`, +/// `allowed_values` and `denied_values` must be unset. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudOrgpolicyV1ListPolicy { + /// The policy all_values state. + #[serde(rename="allValues")] + pub all_values: Option, + /// List of values allowed at this resource. Can only be set if `all_values` + /// is set to `ALL_VALUES_UNSPECIFIED`. + #[serde(rename="allowedValues")] + pub allowed_values: Option>, + /// Determines the inheritance behavior for this `Policy`. + /// + /// By default, a `ListPolicy` set at a resource supercedes any `Policy` set + /// anywhere up the resource hierarchy. However, if `inherit_from_parent` is + /// set to `true`, then the values from the effective `Policy` of the parent + /// resource are inherited, meaning the values set in this `Policy` are + /// added to the values inherited up the hierarchy. + /// + /// Setting `Policy` hierarchies that inherit both allowed values and denied + /// values isn't recommended in most circumstances to keep the configuration + /// simple and understandable. However, it is possible to set a `Policy` with + /// `allowed_values` set that inherits a `Policy` with `denied_values` set. + /// In this case, the values that are allowed must be in `allowed_values` and + /// not present in `denied_values`. + /// + /// For example, suppose you have a `Constraint` + /// `constraints/serviceuser.services`, which has a `constraint_type` of + /// `list_constraint`, and with `constraint_default` set to `ALLOW`. + /// Suppose that at the Organization level, a `Policy` is applied that + /// restricts the allowed API activations to {`E1`, `E2`}. Then, if a + /// `Policy` is applied to a project below the Organization that has + /// `inherit_from_parent` set to `false` and field all_values set to DENY, + /// then an attempt to activate any API will be denied. + /// + /// The following examples demonstrate different possible layerings for + /// `projects/bar` parented by `organizations/foo`: + /// + /// Example 1 (no inherited values): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "E1" allowed_values:"E2"} + /// `projects/bar` has `inherit_from_parent` `false` and values: + /// {allowed_values: "E3" allowed_values: "E4"} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The accepted values at `projects/bar` are `E3`, and `E4`. + /// + /// Example 2 (inherited values): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "E1" allowed_values:"E2"} + /// `projects/bar` has a `Policy` with values: + /// {value: "E3" value: "E4" inherit_from_parent: true} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + /// + /// Example 3 (inheriting both allowed and denied values): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "E1" allowed_values: "E2"} + /// `projects/bar` has a `Policy` with: + /// {denied_values: "E1"} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The value accepted at `projects/bar` is `E2`. + /// + /// Example 4 (RestoreDefault): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "E1" allowed_values:"E2"} + /// `projects/bar` has a `Policy` with values: + /// {RestoreDefault: {}} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The accepted values at `projects/bar` are either all or none depending on + /// the value of `constraint_default` (if `ALLOW`, all; if + /// `DENY`, none). + /// + /// Example 5 (no policy inherits parent policy): + /// `organizations/foo` has no `Policy` set. + /// `projects/bar` has no `Policy` set. + /// The accepted values at both levels are either all or none depending on + /// the value of `constraint_default` (if `ALLOW`, all; if + /// `DENY`, none). + /// + /// Example 6 (ListConstraint allowing all): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "E1" allowed_values: "E2"} + /// `projects/bar` has a `Policy` with: + /// {all: ALLOW} + /// The accepted values at `organizations/foo` are `E1`, E2`. Any value is accepted at `projects/bar`. + /// + /// Example 7 (ListConstraint allowing none): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "E1" allowed_values: "E2"} + /// `projects/bar` has a `Policy` with: + /// {all: DENY} + /// The accepted values at `organizations/foo` are `E1`, E2`. No value is accepted at `projects/bar`. + /// + /// Example 10 (allowed and denied subtrees of Resource Manager hierarchy): + /// Given the following resource hierarchy + /// O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "under:organizations/O1"} + /// `projects/bar` has a `Policy` with: + /// {allowed_values: "under:projects/P3"} + /// {denied_values: "under:folders/F2"} + /// The accepted values at `organizations/foo` are `organizations/O1`, + /// `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, + /// `projects/P3`. + /// The accepted values at `projects/bar` are `organizations/O1`, + /// `folders/F1`, `projects/P1`. + #[serde(rename="inheritFromParent")] + pub inherit_from_parent: Option, + /// Optional. The Google Cloud Console will try to default to a configuration + /// that matches the value specified in this `Policy`. If `suggested_value` + /// is not set, it will inherit the value specified higher in the hierarchy, + /// unless `inherit_from_parent` is `false`. + #[serde(rename="suggestedValue")] + pub suggested_value: Option, + /// List of values denied at this resource. Can only be set if `all_values` + /// is set to `ALL_VALUES_UNSPECIFIED`. + #[serde(rename="deniedValues")] + pub denied_values: Option>, +} + +impl Part for GoogleCloudOrgpolicyV1ListPolicy {} + + +/// `DevicePolicy` specifies device specific restrictions necessary to acquire a +/// given access level. A `DevicePolicy` specifies requirements for requests from +/// devices to be granted access levels, it does not do any enforcement on the +/// device. `DevicePolicy` acts as an AND over all specified fields, and each +/// repeated field is an OR over its elements. Any unset fields are ignored. For +/// example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : +/// DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be +/// true for requests originating from encrypted Linux desktops and encrypted +/// Windows desktops. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1DevicePolicy { + /// Allowed encryptions statuses, an empty list allows all statuses. + #[serde(rename="allowedEncryptionStatuses")] + pub allowed_encryption_statuses: Option>, + /// Whether the device needs to be corp owned. + #[serde(rename="requireCorpOwned")] + pub require_corp_owned: Option, + /// Allowed device management levels, an empty list allows all management + /// levels. + #[serde(rename="allowedDeviceManagementLevels")] + pub allowed_device_management_levels: Option>, + /// Allowed OS versions, an empty list allows all types and all versions. + #[serde(rename="osConstraints")] + pub os_constraints: Option>, + /// Whether the device needs to be approved by the customer admin. + #[serde(rename="requireAdminApproval")] + pub require_admin_approval: Option, + /// Whether or not screenlock is required for the DevicePolicy to be true. + /// Defaults to `false`. + #[serde(rename="requireScreenlock")] + pub require_screenlock: Option, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1DevicePolicy {} + + +/// `BasicLevel` is an `AccessLevel` using a set of recommended features. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1BasicLevel { + /// How the `conditions` list should be combined to determine if a request is + /// granted this `AccessLevel`. If AND is used, each `Condition` in + /// `conditions` must be satisfied for the `AccessLevel` to be applied. If OR + /// is used, at least one `Condition` in `conditions` must be satisfied for the + /// `AccessLevel` to be applied. Default behavior is AND. + #[serde(rename="combiningFunction")] + pub combining_function: Option, + /// Required. A list of requirements for the `AccessLevel` to be granted. + pub conditions: Option>, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1BasicLevel {} + + +/// An asset feed used to export asset updates to a destinations. +/// An asset feed filter controls what updates are exported. +/// The asset feed must be created within a project, organization, or +/// folder. Supported destinations are: +/// Pub/Sub topics. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create feeds](struct.FeedCreateCall.html) (response) +/// * [get feeds](struct.FeedGetCall.html) (response) +/// * [list feeds](struct.FeedListCall.html) (none) +/// * [delete feeds](struct.FeedDeleteCall.html) (none) +/// * [patch feeds](struct.FeedPatchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Feed { + /// A list of types of the assets to receive updates. You must specify either + /// or both of asset_names and asset_types. Only asset updates matching + /// specified asset_names and asset_types are exported to the feed. + /// For example: `"compute.googleapis.com/Disk"` + /// + /// See [this + /// topic](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + /// for a list of all supported asset types. + #[serde(rename="assetTypes")] + pub asset_types: Option>, + /// A list of the full names of the assets to receive updates. You must specify + /// either or both of asset_names and asset_types. Only asset updates matching + /// specified asset_names and asset_types are exported to the feed. For + /// example: + /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + /// See [Resource + /// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + /// for more info. + #[serde(rename="assetNames")] + pub asset_names: Option>, + /// Asset content type. If not specified, no content but the asset name and + /// type will be returned. + #[serde(rename="contentType")] + pub content_type: Option, + /// Required. The format will be + /// projects/{project_number}/feeds/{client-assigned_feed_identifier} or + /// folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + /// organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + /// + /// The client-assigned feed identifier must be unique within the parent + /// project/folder/organization. + pub name: Option, + /// Required. Feed output configuration defining where the asset updates are + /// published to. + #[serde(rename="feedOutputConfig")] + pub feed_output_config: Option, +} + +impl Resource for Feed {} +impl ResponseResult for Feed {} + + +/// Update asset feed request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch feeds](struct.FeedPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateFeedRequest { + /// Required. The new values of feed details. It must match an existing feed and the + /// field `name` must be in the format of: + /// projects/project_number/feeds/feed_id or + /// folders/folder_number/feeds/feed_id or + /// organizations/organization_number/feeds/feed_id. + pub feed: Option, + /// Required. Only updates the `feed` fields indicated by this mask. + /// The field mask must not be empty, and it must not contain fields that + /// are immutable or only set by the server. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for UpdateFeedRequest {} + + +/// Specifies how APIs are allowed to communicate within the Service +/// Perimeter. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIdentityAccesscontextmanagerV1VpcAccessibleServices { + /// Whether to restrict API calls within the Service Perimeter to the list of + /// APIs specified in 'allowed_services'. + #[serde(rename="enableRestriction")] + pub enable_restriction: Option, + /// The list of APIs usable within the Service Perimeter. Must be empty + /// unless 'enable_restriction' is True. + #[serde(rename="allowedServices")] + pub allowed_services: Option>, +} + +impl Part for GoogleIdentityAccesscontextmanagerV1VpcAccessibleServices {} + + /// Defines a Cloud Organization `Policy` which is used to specify `Constraints` /// for configurations of Cloud Platform resources. /// @@ -994,7 +1644,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1003,6 +1653,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1053,7 +1723,7 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1065,7 +1735,7 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1073,7 +1743,7 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1082,9 +1752,9 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1101,22 +1771,30 @@ pub struct AuditConfig { impl Part for AuditConfig {} -/// A time window of (start_time, end_time]. +/// An `AccessLevel` is a label that can be applied to requests to Google Cloud +/// services, along with a list of requirements necessary for the label to be +/// applied. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TimeWindow { - /// End time of the time window (inclusive). - /// Current timestamp if not specified. - #[serde(rename="endTime")] - pub end_time: Option, - /// Start time of the time window (exclusive). - #[serde(rename="startTime")] - pub start_time: Option, +pub struct GoogleIdentityAccesscontextmanagerV1AccessLevel { + /// A `BasicLevel` composed of `Conditions`. + pub basic: Option, + /// A `CustomLevel` written in the Common Expression Language. + pub custom: Option, + /// Description of the `AccessLevel` and its use. Does not affect behavior. + pub description: Option, + /// Required. Resource name for the Access Level. The `short_name` component + /// must begin with a letter and only include alphanumeric and '_'. Format: + /// `accessPolicies/{policy_id}/accessLevels/{short_name}`. The maximum length + /// of the `short_name` component is 50 characters. + pub name: Option, + /// Human readable title. Must be unique within the Policy. + pub title: Option, } -impl Part for TimeWindow {} +impl Part for GoogleIdentityAccesscontextmanagerV1AccessLevel {} /// This resource represents a long-running operation that is the result of a @@ -1162,32 +1840,22 @@ impl Resource for Operation {} impl ResponseResult for Operation {} -/// A Cloud Storage location. +/// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list feeds](struct.FeedListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GcsDestination { - /// The uri prefix of all generated Cloud Storage objects. For example: - /// "gs://bucket_name/object_name_prefix". Each object uri is in format: - /// "gs://bucket_name/object_name_prefix// and only - /// contains assets for that type. starts from 0. For example: - /// "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is - /// the first shard of output objects containing all - /// compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be - /// returned if file with the same name "gs://bucket_name/object_name_prefix" - /// already exists. - #[serde(rename="uriPrefix")] - pub uri_prefix: Option, - /// The uri of the Cloud Storage object. It's the same uri that is used by - /// gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - /// Editing Object - /// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - /// for more information. - pub uri: Option, +pub struct ListFeedsResponse { + /// A list of feeds. + pub feeds: Option>, } -impl Part for GcsDestination {} +impl ResponseResult for ListFeedsResponse {} @@ -1256,6 +1924,155 @@ impl<'a, C, A> OperationMethods<'a, C, A> { +/// A builder providing access to all methods supported on *feed* resources. +/// It is not used directly, but through the `CloudAsset` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudasset1 as cloudasset1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudasset1::CloudAsset; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudAsset::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `list(...)` and `patch(...)` +/// // to build up your call. +/// let rb = hub.feeds(); +/// # } +/// ``` +pub struct FeedMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudAsset, +} + +impl<'a, C, A> MethodsBuilder for FeedMethods<'a, C, A> {} + +impl<'a, C, A> FeedMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes an asset feed. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the feed and it must be in the format of: + /// projects/project_number/feeds/feed_id + /// folders/folder_number/feeds/feed_id + /// organizations/organization_number/feeds/feed_id + pub fn delete(&self, name: &str) -> FeedDeleteCall<'a, C, A> { + FeedDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a feed in a parent project/folder/organization to listen to its + /// asset updates. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the project/folder/organization where this feed + /// should be created in. It can only be an organization number (such as + /// "organizations/123"), a folder number (such as "folders/123"), a project ID + /// (such as "projects/my-project-id")", or a project number (such as + /// "projects/12345"). + pub fn create(&self, request: CreateFeedRequest, parent: &str) -> FeedCreateCall<'a, C, A> { + FeedCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets details about an asset feed. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the Feed and it must be in the format of: + /// projects/project_number/feeds/feed_id + /// folders/folder_number/feeds/feed_id + /// organizations/organization_number/feeds/feed_id + pub fn get(&self, name: &str) -> FeedGetCall<'a, C, A> { + FeedGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all asset feeds in a parent project/folder/organization. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent project/folder/organization whose feeds are to be + /// listed. It can only be using project/folder/organization number (such as + /// "folders/12345")", or a project ID (such as "projects/my-project-id"). + pub fn list(&self, parent: &str) -> FeedListCall<'a, C, A> { + FeedListCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an asset feed configuration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The format will be + /// projects/{project_number}/feeds/{client-assigned_feed_identifier} or + /// folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + /// organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + /// The client-assigned feed identifier must be unique within the parent + /// project/folder/organization. + pub fn patch(&self, request: UpdateFeedRequest, name: &str) -> FeedPatchCall<'a, C, A> { + FeedPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all free methods, which are not associated with a particular resource. /// It is not used directly, but through the `CloudAsset` hub. /// @@ -1608,6 +2425,1327 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: } +/// Deletes an asset feed. +/// +/// A builder for the *delete* method supported by a *feed* resource. +/// It is not used directly, but through a `FeedMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudasset1 as cloudasset1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudasset1::CloudAsset; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudAsset::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.feeds().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct FeedDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudAsset, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FeedDeleteCall<'a, C, A> {} + +impl<'a, C, A> FeedDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudasset.feeds.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the feed and it must be in the format of: + /// projects/project_number/feeds/feed_id + /// folders/folder_number/feeds/feed_id + /// organizations/organization_number/feeds/feed_id + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FeedDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FeedDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FeedDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FeedDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a feed in a parent project/folder/organization to listen to its +/// asset updates. +/// +/// A builder for the *create* method supported by a *feed* resource. +/// It is not used directly, but through a `FeedMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudasset1 as cloudasset1; +/// use cloudasset1::CreateFeedRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudasset1::CloudAsset; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudAsset::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = CreateFeedRequest::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.feeds().create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct FeedCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudAsset, + _request: CreateFeedRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FeedCreateCall<'a, C, A> {} + +impl<'a, C, A> FeedCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Feed)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudasset.feeds.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/feeds"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CreateFeedRequest) -> FeedCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the project/folder/organization where this feed + /// should be created in. It can only be an organization number (such as + /// "organizations/123"), a folder number (such as "folders/123"), a project ID + /// (such as "projects/my-project-id")", or a project number (such as + /// "projects/12345"). + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> FeedCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FeedCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FeedCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FeedCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets details about an asset feed. +/// +/// A builder for the *get* method supported by a *feed* resource. +/// It is not used directly, but through a `FeedMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudasset1 as cloudasset1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudasset1::CloudAsset; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudAsset::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.feeds().get("name") +/// .doit(); +/// # } +/// ``` +pub struct FeedGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudAsset, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FeedGetCall<'a, C, A> {} + +impl<'a, C, A> FeedGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Feed)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudasset.feeds.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the Feed and it must be in the format of: + /// projects/project_number/feeds/feed_id + /// folders/folder_number/feeds/feed_id + /// organizations/organization_number/feeds/feed_id + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FeedGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FeedGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FeedGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FeedGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all asset feeds in a parent project/folder/organization. +/// +/// A builder for the *list* method supported by a *feed* resource. +/// It is not used directly, but through a `FeedMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudasset1 as cloudasset1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudasset1::CloudAsset; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudAsset::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.feeds().list("parent") +/// .doit(); +/// # } +/// ``` +pub struct FeedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudAsset, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FeedListCall<'a, C, A> {} + +impl<'a, C, A> FeedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListFeedsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudasset.feeds.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/feeds"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent project/folder/organization whose feeds are to be + /// listed. It can only be using project/folder/organization number (such as + /// "folders/12345")", or a project ID (such as "projects/my-project-id"). + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> FeedListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FeedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FeedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FeedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an asset feed configuration. +/// +/// A builder for the *patch* method supported by a *feed* resource. +/// It is not used directly, but through a `FeedMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudasset1 as cloudasset1; +/// use cloudasset1::UpdateFeedRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudasset1::CloudAsset; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudAsset::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UpdateFeedRequest::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.feeds().patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct FeedPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudAsset, + _request: UpdateFeedRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FeedPatchCall<'a, C, A> {} + +impl<'a, C, A> FeedPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Feed)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudasset.feeds.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UpdateFeedRequest) -> FeedPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The format will be + /// projects/{project_number}/feeds/{client-assigned_feed_identifier} or + /// folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + /// organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + /// + /// The client-assigned feed identifier must be unique within the parent + /// project/folder/organization. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FeedPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FeedPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FeedPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FeedPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Batch gets the update history of assets that overlap a time window. /// For RESOURCE content, this API outputs history with asset in both /// non-delete or deleted status. @@ -1642,10 +3780,10 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.methods().batch_get_assets_history("parent") -/// .read_time_window_start_time("dolores") -/// .read_time_window_end_time("kasd") -/// .content_type("accusam") -/// .add_asset_names("takimata") +/// .read_time_window_start_time("amet.") +/// .read_time_window_end_time("erat") +/// .content_type("labore") +/// .add_asset_names("sea") /// .doit(); /// # } /// ``` @@ -1830,15 +3968,15 @@ impl<'a, C, A> MethodBatchGetAssetsHistoryCall<'a, C, A> where C: BorrowMut MethodBatchGetAssetsHistoryCall<'a, C, A> { self._read_time_window_end_time = Some(new_value.to_string()); self } - /// Required. The content type. + /// Optional. The content type. /// /// Sets the *content type* query property to the given value. pub fn content_type(mut self, new_value: &str) -> MethodBatchGetAssetsHistoryCall<'a, C, A> { @@ -1850,7 +3988,7 @@ impl<'a, C, A> MethodBatchGetAssetsHistoryCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Asset (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudasset1_beta1-cli" -homepage = "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory" +homepage = "https://cloud.google.com/asset-inventory/docs/quickstart" documentation = "http://byron.github.io/google-apis-rs/google_cloudasset1_beta1_cli" license = "MIT" keywords = ["cloudasset", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudasset1_beta1] path = "../cloudasset1_beta1" -version = "1.0.12+20190625" +version = "1.0.13+20200403" diff --git a/gen/cloudasset1_beta1-cli/README.md b/gen/cloudasset1_beta1-cli/README.md index 262ee7b9ef..7c78aa6056 100644 --- a/gen/cloudasset1_beta1-cli/README.md +++ b/gen/cloudasset1_beta1-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *Cloud Asset* API can be found at the -[official documentation site](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory). +[official documentation site](https://cloud.google.com/asset-inventory/docs/quickstart). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Asset* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Asset* API at revision *20200403*. The CLI is at version *1.0.13*. ```bash cloudasset1-beta1 [options] diff --git a/gen/cloudasset1_beta1-cli/mkdocs.yml b/gen/cloudasset1_beta1-cli/mkdocs.yml index 3446352e46..6ed9361005 100644 --- a/gen/cloudasset1_beta1-cli/mkdocs.yml +++ b/gen/cloudasset1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Asset v1.0.12+20190625 +site_name: Cloud Asset v1.0.13+20200403 site_url: http://byron.github.io/google-apis-rs/google-cloudasset1_beta1-cli site_description: A complete library to interact with Cloud Asset (protocol v1beta1) diff --git a/gen/cloudasset1_beta1-cli/src/main.rs b/gen/cloudasset1_beta1-cli/src/main.rs index 765e015361..ea4cf440cf 100644 --- a/gen/cloudasset1_beta1-cli/src/main.rs +++ b/gen/cloudasset1_beta1-cli/src/main.rs @@ -984,7 +984,7 @@ fn main() { let mut app = App::new("cloudasset1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200403") .about("The cloud asset API manages the history and inventory of cloud resources.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudasset1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudasset1_beta1/Cargo.toml b/gen/cloudasset1_beta1/Cargo.toml index da771961a6..ab95a79a1e 100644 --- a/gen/cloudasset1_beta1/Cargo.toml +++ b/gen/cloudasset1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudasset1_beta1" -version = "1.0.12+20190625" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Asset (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudasset1_beta1" -homepage = "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory" -documentation = "https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625" +homepage = "https://cloud.google.com/asset-inventory/docs/quickstart" +documentation = "https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403" license = "MIT" keywords = ["cloudasset", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudasset1_beta1/README.md b/gen/cloudasset1_beta1/README.md index 9cca6534d3..abe95fcf02 100644 --- a/gen/cloudasset1_beta1/README.md +++ b/gen/cloudasset1_beta1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-cloudasset1_beta1` library allows access to all features of the *Google Cloud Asset* service. -This documentation was generated from *Cloud Asset* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *cloudasset:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Asset* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *cloudasset:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Asset* *v1_beta1* API can be found at the -[official documentation site](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory). +[official documentation site](https://cloud.google.com/asset-inventory/docs/quickstart). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.CloudAsset.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.CloudAsset.html) ... * folders - * [*export assets*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.FolderExportAssetCall.html) and [*operations get*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.FolderOperationGetCall.html) + * [*export assets*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.FolderExportAssetCall.html) and [*operations get*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.FolderOperationGetCall.html) * organizations - * [*batch get assets history*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.OrganizationBatchGetAssetsHistoryCall.html), [*export assets*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.OrganizationExportAssetCall.html) and [*operations get*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.OrganizationOperationGetCall.html) + * [*batch get assets history*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.OrganizationBatchGetAssetsHistoryCall.html), [*export assets*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.OrganizationExportAssetCall.html) and [*operations get*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.OrganizationOperationGetCall.html) * projects - * [*batch get assets history*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.ProjectBatchGetAssetsHistoryCall.html), [*export assets*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.ProjectExportAssetCall.html) and [*operations get*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.ProjectOperationGetCall.html) + * [*batch get assets history*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.ProjectBatchGetAssetsHistoryCall.html), [*export assets*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.ProjectExportAssetCall.html) and [*operations get*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.ProjectOperationGetCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/struct.CloudAsset.html)** +* **[Hub](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/struct.CloudAsset.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudasset1_beta1/1.0.12+20190625/google_cloudasset1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudasset1_beta1/1.0.13+20200403/google_cloudasset1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudasset1_beta1/src/lib.rs b/gen/cloudasset1_beta1/src/lib.rs index 75c88d7300..1466252bcf 100644 --- a/gen/cloudasset1_beta1/src/lib.rs +++ b/gen/cloudasset1_beta1/src/lib.rs @@ -2,10 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Asset* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *cloudasset:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Asset* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *cloudasset:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Asset* *v1_beta1* API can be found at the -//! [official documentation site](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/quickstart-cloud-asset-inventory). +//! [official documentation site](https://cloud.google.com/asset-inventory/docs/quickstart). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudasset1_beta1). //! # Features //! @@ -338,7 +338,7 @@ impl<'a, C, A> CloudAsset CloudAsset { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudasset.googleapis.com/".to_string(), _root_url: "https://cloudasset.googleapis.com/".to_string(), } @@ -355,7 +355,7 @@ impl<'a, C, A> CloudAsset } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -418,7 +418,7 @@ impl Part for Status {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -429,7 +429,7 @@ impl Part for Status {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -534,30 +534,59 @@ pub struct ExportAssetsRequest { impl RequestValue for ExportAssetsRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -608,7 +637,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -617,6 +646,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -668,7 +717,7 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -680,7 +729,7 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -688,7 +737,7 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -697,9 +746,9 @@ impl ResponseResult for BatchGetAssetsHistoryResponse {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -775,37 +824,50 @@ pub struct TimeWindow { impl Part for TimeWindow {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -813,15 +875,21 @@ impl Part for TimeWindow {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -837,13 +905,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -2015,7 +2106,7 @@ impl<'a, C, A> OrganizationBatchGetAssetsHistoryCall<'a, C, A> where C: BorrowMu self._read_time_window_end_time = Some(new_value.to_string()); self } - /// Required. The content type. + /// Optional. The content type. /// /// Sets the *content type* query property to the given value. pub fn content_type(mut self, new_value: &str) -> OrganizationBatchGetAssetsHistoryCall<'a, C, A> { @@ -2865,7 +2956,7 @@ impl<'a, C, A> ProjectBatchGetAssetsHistoryCall<'a, C, A> where C: BorrowMut ProjectBatchGetAssetsHistoryCall<'a, C, A> { diff --git a/gen/cloudbilling1-cli/Cargo.toml b/gen/cloudbilling1-cli/Cargo.toml index 8c8dc29211..6fcc802b71 100644 --- a/gen/cloudbilling1-cli/Cargo.toml +++ b/gen/cloudbilling1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudbilling1-cli" -version = "1.0.12+20190617" +version = "1.0.13+20200401" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloudbilling (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudbilling1] path = "../cloudbilling1" -version = "1.0.12+20190617" +version = "1.0.13+20200401" diff --git a/gen/cloudbilling1-cli/README.md b/gen/cloudbilling1-cli/README.md index 538609ab5e..4c5e127185 100644 --- a/gen/cloudbilling1-cli/README.md +++ b/gen/cloudbilling1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloudbilling* API at revision *20190617*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloudbilling* API at revision *20200401*. The CLI is at version *1.0.13*. ```bash cloudbilling1 [options] diff --git a/gen/cloudbilling1-cli/mkdocs.yml b/gen/cloudbilling1-cli/mkdocs.yml index 79b7552393..d96ce44eee 100644 --- a/gen/cloudbilling1-cli/mkdocs.yml +++ b/gen/cloudbilling1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloudbilling v1.0.12+20190617 +site_name: Cloudbilling v1.0.13+20200401 site_url: http://byron.github.io/google-apis-rs/google-cloudbilling1-cli site_description: A complete library to interact with Cloudbilling (protocol v1) diff --git a/gen/cloudbilling1-cli/src/main.rs b/gen/cloudbilling1-cli/src/main.rs index 7b6446df0a..54dcbbb04f 100644 --- a/gen/cloudbilling1-cli/src/main.rs +++ b/gen/cloudbilling1-cli/src/main.rs @@ -192,6 +192,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -205,6 +208,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -1080,7 +1084,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the billing account to retrieve. For example, + Some(r##"Required. The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`."##), Some(true), Some(false)), @@ -1152,7 +1156,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the billing account resource to be updated."##), + Some(r##"Required. The name of the billing account resource to be updated."##), Some(true), Some(false)), @@ -1183,7 +1187,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the billing account associated with the projects that + Some(r##"Required. The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`."##), Some(true), Some(false)), @@ -1276,7 +1280,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the project for which billing information is + Some(r##"Required. The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`."##), Some(true), Some(false)), @@ -1329,7 +1333,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the project associated with the billing information + Some(r##"Required. The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`."##), Some(true), Some(false)), @@ -1377,7 +1381,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the service. + Some(r##"Required. The name of the service. Example: "services/DA34-426B-A397""##), Some(true), Some(false)), @@ -1400,7 +1404,7 @@ fn main() { let mut app = App::new("cloudbilling1") .author("Sebastian Thiel ") - .version("1.0.12+20190617") + .version("1.0.13+20200401") .about("Allows developers to manage billing for their Google Cloud Platform projects programmatically.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli") diff --git a/gen/cloudbilling1/Cargo.toml b/gen/cloudbilling1/Cargo.toml index 37dc91dcae..86624f7c46 100644 --- a/gen/cloudbilling1/Cargo.toml +++ b/gen/cloudbilling1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudbilling1" -version = "1.0.12+20190617" +version = "1.0.13+20200401" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloudbilling (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1" homepage = "https://cloud.google.com/billing/" -documentation = "https://docs.rs/google-cloudbilling1/1.0.12+20190617" +documentation = "https://docs.rs/google-cloudbilling1/1.0.13+20200401" license = "MIT" keywords = ["cloudbilling", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudbilling1/README.md b/gen/cloudbilling1/README.md index 0b5698dee2..28e5e51b3b 100644 --- a/gen/cloudbilling1/README.md +++ b/gen/cloudbilling1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-cloudbilling1` library allows access to all features of the *Google Cloudbilling* service. -This documentation was generated from *Cloudbilling* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloudbilling* crate version *1.0.13+20200401*, where *20200401* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloudbilling* *v1* API can be found at the [official documentation site](https://cloud.google.com/billing/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.Cloudbilling.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.Cloudbilling.html) ... -* [billing accounts](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccount.html) - * [*create*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountCreateCall.html), [*get*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountGetCall.html), [*get iam policy*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountListCall.html), [*patch*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountPatchCall.html), [*projects list*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.BillingAccountTestIamPermissionCall.html) +* [billing accounts](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccount.html) + * [*create*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountCreateCall.html), [*get*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountGetCall.html), [*get iam policy*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountListCall.html), [*patch*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountPatchCall.html), [*projects list*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.BillingAccountTestIamPermissionCall.html) * projects - * [*get billing info*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.ProjectGetBillingInfoCall.html) and [*update billing info*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.ProjectUpdateBillingInfoCall.html) -* [services](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.Service.html) - * [*list*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.ServiceListCall.html) and [*skus list*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.ServiceSkuListCall.html) + * [*get billing info*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.ProjectGetBillingInfoCall.html) and [*update billing info*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.ProjectUpdateBillingInfoCall.html) +* [services](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.Service.html) + * [*list*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.ServiceListCall.html) and [*skus list*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.ServiceSkuListCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/struct.Cloudbilling.html)** +* **[Hub](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/struct.Cloudbilling.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudbilling1/1.0.12+20190617/google_cloudbilling1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudbilling1/1.0.13+20200401/google_cloudbilling1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudbilling1/src/lib.rs b/gen/cloudbilling1/src/lib.rs index 874f347938..9debc12952 100644 --- a/gen/cloudbilling1/src/lib.rs +++ b/gen/cloudbilling1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloudbilling* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloudbilling* crate version *1.0.13+20200401*, where *20200401* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloudbilling* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/billing/). @@ -334,7 +334,7 @@ impl<'a, C, A> Cloudbilling Cloudbilling { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudbilling.googleapis.com/".to_string(), _root_url: "https://cloudbilling.googleapis.com/".to_string(), } @@ -351,7 +351,7 @@ impl<'a, C, A> Cloudbilling } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -577,7 +577,7 @@ impl ResponseResult for ListServicesResponse {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -588,7 +588,7 @@ impl ResponseResult for ListServicesResponse {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -665,7 +665,7 @@ pub struct BillingAccount { /// `billingAccounts/012345-567890-ABCDEF` would be the resource name for /// billing account `012345-567890-ABCDEF`. pub name: Option, - /// True if the billing account is open, and will therefore be charged for any + /// Output only. True if the billing account is open, and will therefore be charged for any /// usage on associated projects. False if the billing account is closed, and /// therefore projects associated with it will be unable to use paid services. pub open: Option, @@ -698,37 +698,50 @@ pub struct AggregationInfo { impl Part for AggregationInfo {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -736,15 +749,21 @@ impl Part for AggregationInfo {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -766,13 +785,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -905,7 +947,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -914,6 +956,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1044,7 +1106,7 @@ impl ResponseResult for ProjectBillingInfo {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1056,7 +1118,7 @@ impl ResponseResult for ProjectBillingInfo {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1064,7 +1126,7 @@ impl ResponseResult for ProjectBillingInfo {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1073,9 +1135,9 @@ impl ResponseResult for ProjectBillingInfo {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1092,30 +1154,59 @@ pub struct AuditConfig { impl Part for AuditConfig {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1194,7 +1285,7 @@ impl<'a, C, A> ServiceMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the service. + /// * `parent` - Required. The name of the service. /// Example: "services/DA34-426B-A397" pub fn skus_list(&self, parent: &str) -> ServiceSkuListCall<'a, C, A> { ServiceSkuListCall { @@ -1318,7 +1409,7 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the billing account to retrieve. For example, + /// * `name` - Required. The resource name of the billing account to retrieve. For example, /// `billingAccounts/012345-567890-ABCDEF`. pub fn get(&self, name: &str) -> BillingAccountGetCall<'a, C, A> { BillingAccountGetCall { @@ -1366,7 +1457,7 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the billing account resource to be updated. + /// * `name` - Required. The name of the billing account resource to be updated. pub fn patch(&self, request: BillingAccount, name: &str) -> BillingAccountPatchCall<'a, C, A> { BillingAccountPatchCall { hub: self.hub, @@ -1388,7 +1479,7 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the billing account associated with the projects that + /// * `name` - Required. The resource name of the billing account associated with the projects that /// you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. pub fn projects_list(&self, name: &str) -> BillingAccountProjectListCall<'a, C, A> { BillingAccountProjectListCall { @@ -1439,6 +1530,7 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { BillingAccountGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1524,7 +1616,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the project associated with the billing information + /// * `name` - Required. The resource name of the project associated with the billing information /// that you want to update. For example, `projects/tokyo-rain-123`. pub fn update_billing_info(&self, request: ProjectBillingInfo, name: &str) -> ProjectUpdateBillingInfoCall<'a, C, A> { ProjectUpdateBillingInfoCall { @@ -1546,7 +1638,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the project for which billing information is + /// * `name` - Required. The resource name of the project for which billing information is /// retrieved. For example, `projects/tokyo-rain-123`. pub fn get_billing_info(&self, name: &str) -> ProjectGetBillingInfoCall<'a, C, A> { ProjectGetBillingInfoCall { @@ -1767,7 +1859,7 @@ impl<'a, C, A> ServiceSkuListCall<'a, C, A> where C: BorrowMut, A } - /// The name of the service. + /// Required. The name of the service. /// Example: "services/DA34-426B-A397" /// /// Sets the *parent* path property to the given value. @@ -2812,7 +2904,7 @@ impl<'a, C, A> BillingAccountGetCall<'a, C, A> where C: BorrowMut } - /// The resource name of the billing account to retrieve. For example, + /// Required. The resource name of the billing account to retrieve. For example, /// `billingAccounts/012345-567890-ABCDEF`. /// /// Sets the *name* path property to the given value. @@ -3386,7 +3478,7 @@ impl<'a, C, A> BillingAccountPatchCall<'a, C, A> where C: BorrowMut BillingAccountProjectListCall<'a, C, A> where C: BorrowMut BillingAccountTestIamPermissionCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.billing_accounts().get_iam_policy("resource") +/// .options_requested_policy_version(-70) /// .doit(); /// # } /// ``` @@ -4067,6 +4160,7 @@ pub struct BillingAccountGetIamPolicyCall<'a, C, A> hub: &'a Cloudbilling, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4089,9 +4183,12 @@ impl<'a, C, A> BillingAccountGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4217,6 +4314,20 @@ impl<'a, C, A> BillingAccountGetIamPolicyCall<'a, C, A> where C: BorrowMut BillingAccountGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4516,7 +4627,7 @@ impl<'a, C, A> ProjectUpdateBillingInfoCall<'a, C, A> where C: BorrowMut ProjectGetBillingInfoCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Build (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbuild1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudbuild1] path = "../cloudbuild1" -version = "1.0.12+20190702" +version = "1.0.13+20200323" diff --git a/gen/cloudbuild1-cli/README.md b/gen/cloudbuild1-cli/README.md index af05e98617..7845c2de6c 100644 --- a/gen/cloudbuild1-cli/README.md +++ b/gen/cloudbuild1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Build* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Build* API at revision *20200323*. The CLI is at version *1.0.13*. ```bash cloudbuild1 [options] diff --git a/gen/cloudbuild1-cli/mkdocs.yml b/gen/cloudbuild1-cli/mkdocs.yml index 9af718ee7c..d1db5f760f 100644 --- a/gen/cloudbuild1-cli/mkdocs.yml +++ b/gen/cloudbuild1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Build v1.0.12+20190702 +site_name: Cloud Build v1.0.13+20200323 site_url: http://byron.github.io/google-apis-rs/google-cloudbuild1-cli site_description: A complete library to interact with Cloud Build (protocol v1) diff --git a/gen/cloudbuild1-cli/src/main.rs b/gen/cloudbuild1-cli/src/main.rs index 8ab1afb297..5a6d474b8e 100644 --- a/gen/cloudbuild1-cli/src/main.rs +++ b/gen/cloudbuild1-cli/src/main.rs @@ -356,7 +356,9 @@ impl<'n> Engine<'n> { "timeout" => Some(("timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "log-url" => Some(("logUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-provenance.resolved-repo-source.project-id" => Some(("sourceProvenance.resolvedRepoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-provenance.resolved-repo-source.invert-regex" => Some(("sourceProvenance.resolvedRepoSource.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "source-provenance.resolved-repo-source.commit-sha" => Some(("sourceProvenance.resolvedRepoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-provenance.resolved-repo-source.substitutions" => Some(("sourceProvenance.resolvedRepoSource.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "source-provenance.resolved-repo-source.repo-name" => Some(("sourceProvenance.resolvedRepoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-provenance.resolved-repo-source.tag-name" => Some(("sourceProvenance.resolvedRepoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-provenance.resolved-repo-source.branch-name" => Some(("sourceProvenance.resolvedRepoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -379,15 +381,7 @@ impl<'n> Engine<'n> { "results.artifact-timing.start-time" => Some(("results.artifactTiming.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "results.build-step-images" => Some(("results.buildStepImages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "results.num-artifacts" => Some(("results.numArtifacts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.repo-source.project-id" => Some(("source.repoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.repo-source.commit-sha" => Some(("source.repoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.repo-source.repo-name" => Some(("source.repoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.repo-source.tag-name" => Some(("source.repoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.repo-source.branch-name" => Some(("source.repoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.repo-source.dir" => Some(("source.repoSource.dir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.storage-source.generation" => Some(("source.storageSource.generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.storage-source.object" => Some(("source.storageSource.object", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "source.storage-source.bucket" => Some(("source.storageSource.bucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "substitutions" => Some(("substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "options.substitution-option" => Some(("options.substitutionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "options.machine-type" => Some(("options.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "options.worker-pool" => Some(("options.workerPool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -398,14 +392,25 @@ impl<'n> Engine<'n> { "options.env" => Some(("options.env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "options.requested-verify-option" => Some(("options.requestedVerifyOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "options.logging" => Some(("options.logging", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.repo-source.project-id" => Some(("source.repoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.repo-source.invert-regex" => Some(("source.repoSource.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "source.repo-source.commit-sha" => Some(("source.repoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.repo-source.substitutions" => Some(("source.repoSource.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "source.repo-source.repo-name" => Some(("source.repoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.repo-source.tag-name" => Some(("source.repoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.repo-source.branch-name" => Some(("source.repoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.repo-source.dir" => Some(("source.repoSource.dir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.storage-source.generation" => Some(("source.storageSource.generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.storage-source.object" => Some(("source.storageSource.object", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source.storage-source.bucket" => Some(("source.storageSource.bucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "images" => Some(("images", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "substitutions" => Some(("substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "queue-ttl" => Some(("queueTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build-trigger-id" => Some(("buildTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["artifact-manifest", "artifact-timing", "artifacts", "branch-name", "bucket", "build-step-images", "build-step-outputs", "build-trigger-id", "commit-sha", "create-time", "dir", "disk-size-gb", "end-time", "env", "finish-time", "generation", "id", "images", "location", "log-streaming-option", "log-url", "logging", "logs-bucket", "machine-type", "num-artifacts", "object", "objects", "options", "paths", "project-id", "repo-name", "repo-source", "requested-verify-option", "resolved-repo-source", "resolved-storage-source", "results", "secret-env", "source", "source-provenance", "source-provenance-hash", "start-time", "status", "status-detail", "storage-source", "substitution-option", "substitutions", "tag-name", "tags", "timeout", "timing", "worker-pool"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["artifact-manifest", "artifact-timing", "artifacts", "branch-name", "bucket", "build-step-images", "build-step-outputs", "build-trigger-id", "commit-sha", "create-time", "dir", "disk-size-gb", "end-time", "env", "finish-time", "generation", "id", "images", "invert-regex", "location", "log-streaming-option", "log-url", "logging", "logs-bucket", "machine-type", "num-artifacts", "object", "objects", "options", "paths", "project-id", "queue-ttl", "repo-name", "repo-source", "requested-verify-option", "resolved-repo-source", "resolved-storage-source", "results", "secret-env", "source", "source-provenance", "source-provenance-hash", "start-time", "status", "status-detail", "storage-source", "substitution-option", "substitutions", "tag-name", "tags", "timeout", "timing", "worker-pool"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -688,16 +693,20 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "github.owner" => Some(("github.owner", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.installation-id" => Some(("github.installationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "github.pull-request.invert-regex" => Some(("github.pullRequest.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "github.pull-request.comment-control" => Some(("github.pullRequest.commentControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.pull-request.branch" => Some(("github.pullRequest.branch", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.name" => Some(("github.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "github.push.invert-regex" => Some(("github.push.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "github.push.tag" => Some(("github.push.tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.push.branch" => Some(("github.push.branch", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tags" => Some(("tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "ignored-files" => Some(("ignoredFiles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trigger-template.project-id" => Some(("triggerTemplate.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger-template.invert-regex" => Some(("triggerTemplate.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "trigger-template.commit-sha" => Some(("triggerTemplate.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger-template.substitutions" => Some(("triggerTemplate.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "trigger-template.repo-name" => Some(("triggerTemplate.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trigger-template.tag-name" => Some(("triggerTemplate.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trigger-template.branch-name" => Some(("triggerTemplate.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -710,7 +719,9 @@ impl<'n> Engine<'n> { "build.timeout" => Some(("build.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.log-url" => Some(("build.logUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.project-id" => Some(("build.sourceProvenance.resolvedRepoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source-provenance.resolved-repo-source.invert-regex" => Some(("build.sourceProvenance.resolvedRepoSource.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.commit-sha" => Some(("build.sourceProvenance.resolvedRepoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source-provenance.resolved-repo-source.substitutions" => Some(("build.sourceProvenance.resolvedRepoSource.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "build.source-provenance.resolved-repo-source.repo-name" => Some(("build.sourceProvenance.resolvedRepoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.tag-name" => Some(("build.sourceProvenance.resolvedRepoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.branch-name" => Some(("build.sourceProvenance.resolvedRepoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -733,15 +744,7 @@ impl<'n> Engine<'n> { "build.results.artifact-timing.start-time" => Some(("build.results.artifactTiming.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.results.build-step-images" => Some(("build.results.buildStepImages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "build.results.num-artifacts" => Some(("build.results.numArtifacts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.project-id" => Some(("build.source.repoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.commit-sha" => Some(("build.source.repoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.repo-name" => Some(("build.source.repoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.tag-name" => Some(("build.source.repoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.branch-name" => Some(("build.source.repoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.dir" => Some(("build.source.repoSource.dir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.storage-source.generation" => Some(("build.source.storageSource.generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.storage-source.object" => Some(("build.source.storageSource.object", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.storage-source.bucket" => Some(("build.source.storageSource.bucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.substitutions" => Some(("build.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "build.options.substitution-option" => Some(("build.options.substitutionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.options.machine-type" => Some(("build.options.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.options.worker-pool" => Some(("build.options.workerPool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -752,17 +755,29 @@ impl<'n> Engine<'n> { "build.options.env" => Some(("build.options.env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "build.options.requested-verify-option" => Some(("build.options.requestedVerifyOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.options.logging" => Some(("build.options.logging", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.project-id" => Some(("build.source.repoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.invert-regex" => Some(("build.source.repoSource.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "build.source.repo-source.commit-sha" => Some(("build.source.repoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.substitutions" => Some(("build.source.repoSource.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "build.source.repo-source.repo-name" => Some(("build.source.repoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.tag-name" => Some(("build.source.repoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.branch-name" => Some(("build.source.repoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.dir" => Some(("build.source.repoSource.dir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.storage-source.generation" => Some(("build.source.storageSource.generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.storage-source.object" => Some(("build.source.storageSource.object", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.storage-source.bucket" => Some(("build.source.storageSource.bucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.start-time" => Some(("build.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.project-id" => Some(("build.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.images" => Some(("build.images", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "build.substitutions" => Some(("build.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "build.queue-ttl" => Some(("build.queueTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.create-time" => Some(("build.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.build-trigger-id" => Some(("build.buildTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "included-files" => Some(("includedFiles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "substitutions" => Some(("substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["artifact-manifest", "artifact-timing", "artifacts", "branch", "branch-name", "bucket", "build", "build-step-images", "build-step-outputs", "build-trigger-id", "comment-control", "commit-sha", "create-time", "description", "dir", "disabled", "disk-size-gb", "end-time", "env", "filename", "finish-time", "generation", "github", "id", "ignored-files", "images", "included-files", "installation-id", "location", "log-streaming-option", "log-url", "logging", "logs-bucket", "machine-type", "name", "num-artifacts", "object", "objects", "options", "owner", "paths", "project-id", "pull-request", "push", "repo-name", "repo-source", "requested-verify-option", "resolved-repo-source", "resolved-storage-source", "results", "secret-env", "source", "source-provenance", "source-provenance-hash", "start-time", "status", "status-detail", "storage-source", "substitution-option", "substitutions", "tag", "tag-name", "tags", "timeout", "timing", "trigger-template", "worker-pool"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["artifact-manifest", "artifact-timing", "artifacts", "branch", "branch-name", "bucket", "build", "build-step-images", "build-step-outputs", "build-trigger-id", "comment-control", "commit-sha", "create-time", "description", "dir", "disabled", "disk-size-gb", "end-time", "env", "filename", "finish-time", "generation", "github", "id", "ignored-files", "images", "included-files", "installation-id", "invert-regex", "location", "log-streaming-option", "log-url", "logging", "logs-bucket", "machine-type", "name", "num-artifacts", "object", "objects", "options", "owner", "paths", "project-id", "pull-request", "push", "queue-ttl", "repo-name", "repo-source", "requested-verify-option", "resolved-repo-source", "resolved-storage-source", "results", "secret-env", "source", "source-provenance", "source-provenance-hash", "start-time", "status", "status-detail", "storage-source", "substitution-option", "substitutions", "tag", "tag-name", "tags", "timeout", "timing", "trigger-template", "worker-pool"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1010,16 +1025,20 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "github.owner" => Some(("github.owner", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.installation-id" => Some(("github.installationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "github.pull-request.invert-regex" => Some(("github.pullRequest.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "github.pull-request.comment-control" => Some(("github.pullRequest.commentControl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.pull-request.branch" => Some(("github.pullRequest.branch", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.name" => Some(("github.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "github.push.invert-regex" => Some(("github.push.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "github.push.tag" => Some(("github.push.tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "github.push.branch" => Some(("github.push.branch", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tags" => Some(("tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "ignored-files" => Some(("ignoredFiles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trigger-template.project-id" => Some(("triggerTemplate.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger-template.invert-regex" => Some(("triggerTemplate.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "trigger-template.commit-sha" => Some(("triggerTemplate.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trigger-template.substitutions" => Some(("triggerTemplate.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "trigger-template.repo-name" => Some(("triggerTemplate.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trigger-template.tag-name" => Some(("triggerTemplate.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trigger-template.branch-name" => Some(("triggerTemplate.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1032,7 +1051,9 @@ impl<'n> Engine<'n> { "build.timeout" => Some(("build.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.log-url" => Some(("build.logUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.project-id" => Some(("build.sourceProvenance.resolvedRepoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source-provenance.resolved-repo-source.invert-regex" => Some(("build.sourceProvenance.resolvedRepoSource.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.commit-sha" => Some(("build.sourceProvenance.resolvedRepoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source-provenance.resolved-repo-source.substitutions" => Some(("build.sourceProvenance.resolvedRepoSource.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "build.source-provenance.resolved-repo-source.repo-name" => Some(("build.sourceProvenance.resolvedRepoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.tag-name" => Some(("build.sourceProvenance.resolvedRepoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.source-provenance.resolved-repo-source.branch-name" => Some(("build.sourceProvenance.resolvedRepoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1055,15 +1076,7 @@ impl<'n> Engine<'n> { "build.results.artifact-timing.start-time" => Some(("build.results.artifactTiming.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.results.build-step-images" => Some(("build.results.buildStepImages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "build.results.num-artifacts" => Some(("build.results.numArtifacts", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.project-id" => Some(("build.source.repoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.commit-sha" => Some(("build.source.repoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.repo-name" => Some(("build.source.repoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.tag-name" => Some(("build.source.repoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.branch-name" => Some(("build.source.repoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.repo-source.dir" => Some(("build.source.repoSource.dir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.storage-source.generation" => Some(("build.source.storageSource.generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.storage-source.object" => Some(("build.source.storageSource.object", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "build.source.storage-source.bucket" => Some(("build.source.storageSource.bucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.substitutions" => Some(("build.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "build.options.substitution-option" => Some(("build.options.substitutionOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.options.machine-type" => Some(("build.options.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.options.worker-pool" => Some(("build.options.workerPool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1074,17 +1087,29 @@ impl<'n> Engine<'n> { "build.options.env" => Some(("build.options.env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "build.options.requested-verify-option" => Some(("build.options.requestedVerifyOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.options.logging" => Some(("build.options.logging", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.project-id" => Some(("build.source.repoSource.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.invert-regex" => Some(("build.source.repoSource.invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "build.source.repo-source.commit-sha" => Some(("build.source.repoSource.commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.substitutions" => Some(("build.source.repoSource.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "build.source.repo-source.repo-name" => Some(("build.source.repoSource.repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.tag-name" => Some(("build.source.repoSource.tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.branch-name" => Some(("build.source.repoSource.branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.repo-source.dir" => Some(("build.source.repoSource.dir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.storage-source.generation" => Some(("build.source.storageSource.generation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.storage-source.object" => Some(("build.source.storageSource.object", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "build.source.storage-source.bucket" => Some(("build.source.storageSource.bucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.start-time" => Some(("build.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.project-id" => Some(("build.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.images" => Some(("build.images", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "build.substitutions" => Some(("build.substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "build.queue-ttl" => Some(("build.queueTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.create-time" => Some(("build.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "build.build-trigger-id" => Some(("build.buildTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "included-files" => Some(("includedFiles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "substitutions" => Some(("substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["artifact-manifest", "artifact-timing", "artifacts", "branch", "branch-name", "bucket", "build", "build-step-images", "build-step-outputs", "build-trigger-id", "comment-control", "commit-sha", "create-time", "description", "dir", "disabled", "disk-size-gb", "end-time", "env", "filename", "finish-time", "generation", "github", "id", "ignored-files", "images", "included-files", "installation-id", "location", "log-streaming-option", "log-url", "logging", "logs-bucket", "machine-type", "name", "num-artifacts", "object", "objects", "options", "owner", "paths", "project-id", "pull-request", "push", "repo-name", "repo-source", "requested-verify-option", "resolved-repo-source", "resolved-storage-source", "results", "secret-env", "source", "source-provenance", "source-provenance-hash", "start-time", "status", "status-detail", "storage-source", "substitution-option", "substitutions", "tag", "tag-name", "tags", "timeout", "timing", "trigger-template", "worker-pool"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["artifact-manifest", "artifact-timing", "artifacts", "branch", "branch-name", "bucket", "build", "build-step-images", "build-step-outputs", "build-trigger-id", "comment-control", "commit-sha", "create-time", "description", "dir", "disabled", "disk-size-gb", "end-time", "env", "filename", "finish-time", "generation", "github", "id", "ignored-files", "images", "included-files", "installation-id", "invert-regex", "location", "log-streaming-option", "log-url", "logging", "logs-bucket", "machine-type", "name", "num-artifacts", "object", "objects", "options", "owner", "paths", "project-id", "pull-request", "push", "queue-ttl", "repo-name", "repo-source", "requested-verify-option", "resolved-repo-source", "resolved-storage-source", "results", "secret-env", "source", "source-provenance", "source-provenance-hash", "start-time", "status", "status-detail", "storage-source", "substitution-option", "substitutions", "tag", "tag-name", "tags", "timeout", "timing", "trigger-template", "worker-pool"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1168,13 +1193,15 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invert-regex" => Some(("invertRegex", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "commit-sha" => Some(("commitSha", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "substitutions" => Some(("substitutions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "repo-name" => Some(("repoName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag-name" => Some(("tagName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "branch-name" => Some(("branchName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dir" => Some(("dir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["branch-name", "commit-sha", "dir", "project-id", "repo-name", "tag-name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["branch-name", "commit-sha", "dir", "invert-regex", "project-id", "repo-name", "substitutions", "tag-name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1484,13 +1511,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project."##), + Some(r##"Required. ID of the project."##), Some(true), Some(false)), (Some(r##"id"##), None, - Some(r##"ID of the build."##), + Some(r##"Required. ID of the build."##), Some(true), Some(false)), @@ -1522,7 +1549,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project."##), + Some(r##"Required. ID of the project."##), Some(true), Some(false)), @@ -1553,13 +1580,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project."##), + Some(r##"Required. ID of the project."##), Some(true), Some(false)), (Some(r##"id"##), None, - Some(r##"ID of the build."##), + Some(r##"Required. ID of the build."##), Some(true), Some(false)), @@ -1584,7 +1611,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project."##), + Some(r##"Required. ID of the project."##), Some(true), Some(false)), @@ -1632,13 +1659,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project."##), + Some(r##"Required. ID of the project."##), Some(true), Some(false)), (Some(r##"id"##), None, - Some(r##"Build ID of the original build."##), + Some(r##"Required. Build ID of the original build."##), Some(true), Some(false)), @@ -1668,7 +1695,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project for which to configure automatic builds."##), + Some(r##"Required. ID of the project for which to configure automatic builds."##), Some(true), Some(false)), @@ -1698,13 +1725,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project that owns the trigger."##), + Some(r##"Required. ID of the project that owns the trigger."##), Some(true), Some(false)), (Some(r##"trigger-id"##), None, - Some(r##"ID of the `BuildTrigger` to delete."##), + Some(r##"Required. ID of the `BuildTrigger` to delete."##), Some(true), Some(false)), @@ -1728,13 +1755,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project that owns the trigger."##), + Some(r##"Required. ID of the project that owns the trigger."##), Some(true), Some(false)), (Some(r##"trigger-id"##), None, - Some(r##"ID of the `BuildTrigger` to get."##), + Some(r##"Required. Identifier (`id` or `name`) of the `BuildTrigger` to get."##), Some(true), Some(false)), @@ -1758,7 +1785,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project for which to list BuildTriggers."##), + Some(r##"Required. ID of the project for which to list BuildTriggers."##), Some(true), Some(false)), @@ -1782,13 +1809,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project that owns the trigger."##), + Some(r##"Required. ID of the project that owns the trigger."##), Some(true), Some(false)), (Some(r##"trigger-id"##), None, - Some(r##"ID of the `BuildTrigger` to update."##), + Some(r##"Required. ID of the `BuildTrigger` to update."##), Some(true), Some(false)), @@ -1816,13 +1843,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the project."##), + Some(r##"Required. ID of the project."##), Some(true), Some(false)), (Some(r##"trigger-id"##), None, - Some(r##"ID of the trigger."##), + Some(r##"Required. ID of the trigger."##), Some(true), Some(false)), @@ -1850,7 +1877,7 @@ fn main() { let mut app = App::new("cloudbuild1") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200323") .about("Creates and manages builds on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudbuild1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudbuild1/Cargo.toml b/gen/cloudbuild1/Cargo.toml index 063289e643..c7a15b278f 100644 --- a/gen/cloudbuild1/Cargo.toml +++ b/gen/cloudbuild1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudbuild1" -version = "1.0.12+20190702" +version = "1.0.13+20200323" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Build (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbuild1" homepage = "https://cloud.google.com/cloud-build/docs/" -documentation = "https://docs.rs/google-cloudbuild1/1.0.12+20190702" +documentation = "https://docs.rs/google-cloudbuild1/1.0.13+20200323" license = "MIT" keywords = ["cloudbuild", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudbuild1/README.md b/gen/cloudbuild1/README.md index 4009e2f6f8..cbe004bcd2 100644 --- a/gen/cloudbuild1/README.md +++ b/gen/cloudbuild1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-cloudbuild1` library allows access to all features of the *Google Cloud Build* service. -This documentation was generated from *Cloud Build* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *cloudbuild:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Build* crate version *1.0.13+20200323*, where *20200323* is the exact revision of the *cloudbuild:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Build* *v1* API can be found at the [official documentation site](https://cloud.google.com/cloud-build/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.CloudBuild.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.CloudBuild.html) ... -* [operations](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.OperationListCall.html) +* [operations](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.OperationListCall.html) * projects - * [*builds cancel*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectBuildCancelCall.html), [*builds create*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectBuildCreateCall.html), [*builds get*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectBuildGetCall.html), [*builds list*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectBuildListCall.html), [*builds retry*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectBuildRetryCall.html), [*triggers create*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectTriggerCreateCall.html), [*triggers delete*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectTriggerDeleteCall.html), [*triggers get*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectTriggerGetCall.html), [*triggers list*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectTriggerListCall.html), [*triggers patch*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectTriggerPatchCall.html) and [*triggers run*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.ProjectTriggerRunCall.html) + * [*builds cancel*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectBuildCancelCall.html), [*builds create*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectBuildCreateCall.html), [*builds get*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectBuildGetCall.html), [*builds list*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectBuildListCall.html), [*builds retry*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectBuildRetryCall.html), [*triggers create*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectTriggerCreateCall.html), [*triggers delete*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectTriggerDeleteCall.html), [*triggers get*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectTriggerGetCall.html), [*triggers list*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectTriggerListCall.html), [*triggers patch*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectTriggerPatchCall.html) and [*triggers run*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.ProjectTriggerRunCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/struct.CloudBuild.html)** +* **[Hub](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/struct.CloudBuild.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudbuild1/1.0.12+20190702/google_cloudbuild1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudbuild1/1.0.13+20200323/google_cloudbuild1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudbuild1/src/lib.rs b/gen/cloudbuild1/src/lib.rs index 271adc660e..2940abb153 100644 --- a/gen/cloudbuild1/src/lib.rs +++ b/gen/cloudbuild1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Build* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *cloudbuild:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Build* crate version *1.0.13+20200323*, where *20200323* is the exact revision of the *cloudbuild:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Build* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/cloud-build/docs/). @@ -330,7 +330,7 @@ impl<'a, C, A> CloudBuild CloudBuild { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudbuild.googleapis.com/".to_string(), _root_url: "https://cloudbuild.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> CloudBuild } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -449,18 +449,33 @@ impl Part for Artifacts {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RepoSource { - /// Name of the Cloud Source Repository. If omitted, the name "default" is - /// assumed. - #[serde(rename="repoName")] - pub repo_name: Option, - /// Name of the tag to build. - #[serde(rename="tagName")] - pub tag_name: Option, /// ID of the project that owns the Cloud Source Repository. If omitted, the /// project ID requesting the build is assumed. #[serde(rename="projectId")] pub project_id: Option, - /// Name of the branch to build. + /// Only trigger a build if the revision regex does NOT match the revision + /// regex. + #[serde(rename="invertRegex")] + pub invert_regex: Option, + /// Explicit commit SHA to build. + #[serde(rename="commitSha")] + pub commit_sha: Option, + /// Substitutions to use in a triggered build. + /// Should only be used with RunBuildTrigger + pub substitutions: Option>, + /// Required. Name of the Cloud Source Repository. + #[serde(rename="repoName")] + pub repo_name: Option, + /// Regex matching tags to build. + /// + /// The syntax of the regular expressions accepted is the syntax accepted by + /// RE2 and described at https://github.com/google/re2/wiki/Syntax + #[serde(rename="tagName")] + pub tag_name: Option, + /// Regex matching branches to build. + /// + /// The syntax of the regular expressions accepted is the syntax accepted by + /// RE2 and described at https://github.com/google/re2/wiki/Syntax #[serde(rename="branchName")] pub branch_name: Option, /// Directory, relative to the source root, in which to run the build. @@ -468,9 +483,6 @@ pub struct RepoSource { /// This must be a relative path. If a step's `dir` is specified and is an /// absolute path, this value is ignored for that step's execution. pub dir: Option, - /// Explicit commit SHA to build. - #[serde(rename="commitSha")] - pub commit_sha: Option, } impl RequestValue for RepoSource {} @@ -621,6 +633,13 @@ pub struct Build { /// If any of the images fail to be pushed, the build status is marked /// `FAILURE`. pub images: Option>, + /// TTL in queue for this build. If provided and the build is enqueued longer + /// than this value, the build will expire and the build status will be + /// `EXPIRED`. + /// + /// The TTL starts ticking from create_time. + #[serde(rename="queueTtl")] + pub queue_ttl: Option, /// Output only. Unique identifier of the build. pub id: Option, /// Secrets to decrypt using Cloud Key Management Service. @@ -857,9 +876,10 @@ pub struct BuildOptions { /// Requested verifiability options. #[serde(rename="requestedVerifyOption")] pub requested_verify_option: Option, - /// Option to specify a `WorkerPool` for the build. User specifies the pool - /// with the format "[WORKERPOOL_PROJECT_ID]/[WORKERPOOL_NAME]". - /// This is an experimental field. + /// Option to specify a `WorkerPool` for the build. + /// Format: projects/{project}/workerPools/{workerPool} + /// + /// This field is experimental. #[serde(rename="workerPool")] pub worker_pool: Option, } @@ -874,7 +894,10 @@ impl Part for BuildOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PullRequestFilter { - /// Whether to block builds on a "/gcbrun" comment from a repository owner or + /// If true, branches that do NOT match the git_ref will trigger a build. + #[serde(rename="invertRegex")] + pub invert_regex: Option, + /// Whether to block builds on a "/gcbrun" comment from a repository admin or /// collaborator. #[serde(rename="commentControl")] pub comment_control: Option, @@ -904,6 +927,8 @@ impl Part for PullRequestFilter {} pub struct BuildTrigger { /// GitHubEventsConfig describes the configuration of a trigger that creates /// a build whenever a GitHub event is received. + /// + /// Mutually exclusive with `trigger_template`. pub github: Option, /// Human-readable description of this trigger. pub description: Option, @@ -912,7 +937,7 @@ pub struct BuildTrigger { /// Output only. Unique identifier of the trigger. pub id: Option, /// ignored_files and included_files are file glob matches using - /// http://godoc/pkg/path/filepath#Match extended with support for "**". + /// https://golang.org/pkg/path/filepath/#Match extended with support for "**". /// /// If ignored_files and changed files are both empty, then they are /// not used to determine whether or not to trigger a build. @@ -942,15 +967,26 @@ pub struct BuildTrigger { /// then we do not trigger a build. #[serde(rename="includedFiles")] pub included_files: Option>, - /// Substitutions data for Build resource. + /// Substitutions for Build resource. The keys must match the following + /// regular expression: `^_[A-Z0-9_]+$`.The keys cannot conflict with the + /// keys in bindings. pub substitutions: Option>, /// Template describing the types of source changes to trigger a build. /// /// Branch and tag names in trigger templates are interpreted as regular /// expressions. Any branch or tag change that matches that regular expression /// will trigger a build. + /// + /// Mutually exclusive with `github`. #[serde(rename="triggerTemplate")] pub trigger_template: Option, + /// User-assigned name of the trigger. Must be unique within the project. + /// Trigger names must meet the following requirements: + /// + /// + They must contain only alphanumeric characters and dashes. + /// + They can be 1-64 characters long. + /// + They must begin and end with an alphanumeric character. + pub name: Option, } impl RequestValue for BuildTrigger {} @@ -1127,12 +1163,16 @@ impl Part for Volume {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PushFilter { - /// Regexes of tags to match. + /// When true, only trigger a build if the revision regex does NOT match the + /// git_ref regex. + #[serde(rename="invertRegex")] + pub invert_regex: Option, + /// Regexes matching tags to build. /// /// The syntax of the regular expressions accepted is the syntax accepted by /// RE2 and described at https://github.com/google/re2/wiki/Syntax pub tag: Option, - /// Regexes of branches to match. + /// Regexes matching branches to build. /// /// The syntax of the regular expressions accepted is the syntax accepted by /// RE2 and described at https://github.com/google/re2/wiki/Syntax @@ -1479,8 +1519,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - ID of the project that owns the trigger. - /// * `triggerId` - ID of the `BuildTrigger` to get. + /// * `projectId` - Required. ID of the project that owns the trigger. + /// * `triggerId` - Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. pub fn triggers_get(&self, project_id: &str, trigger_id: &str) -> ProjectTriggerGetCall<'a, C, A> { ProjectTriggerGetCall { hub: self.hub, @@ -1500,7 +1540,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - ID of the project for which to list BuildTriggers. + /// * `projectId` - Required. ID of the project for which to list BuildTriggers. pub fn triggers_list(&self, project_id: &str) -> ProjectTriggerListCall<'a, C, A> { ProjectTriggerListCall { hub: self.hub, @@ -1521,8 +1561,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - ID of the project that owns the trigger. - /// * `triggerId` - ID of the `BuildTrigger` to delete. + /// * `projectId` - Required. ID of the project that owns the trigger. + /// * `triggerId` - Required. ID of the `BuildTrigger` to delete. pub fn triggers_delete(&self, project_id: &str, trigger_id: &str) -> ProjectTriggerDeleteCall<'a, C, A> { ProjectTriggerDeleteCall { hub: self.hub, @@ -1541,8 +1581,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - ID of the project. - /// * `id` - ID of the build. + /// * `projectId` - Required. ID of the project. + /// * `id` - Required. ID of the build. pub fn builds_cancel(&self, request: CancelBuildRequest, project_id: &str, id: &str) -> ProjectBuildCancelCall<'a, C, A> { ProjectBuildCancelCall { hub: self.hub, @@ -1566,7 +1606,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - ID of the project. + /// * `projectId` - Required. ID of the project. pub fn builds_create(&self, request: Build, project_id: &str) -> ProjectBuildCreateCall<'a, C, A> { ProjectBuildCreateCall { hub: self.hub, @@ -1587,8 +1627,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - ID of the project. - /// * `id` - ID of the build. + /// * `projectId` - Required. ID of the project. + /// * `id` - Required. ID of the build. pub fn builds_get(&self, project_id: &str, id: &str) -> ProjectBuildGetCall<'a, C, A> { ProjectBuildGetCall { hub: self.hub, @@ -1609,7 +1649,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - ID of the project. + /// * `projectId` - Required. ID of the project. pub fn builds_list(&self, project_id: &str) -> ProjectBuildListCall<'a, C, A> { ProjectBuildListCall { hub: self.hub, @@ -1630,8 +1670,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - ID of the project. - /// * `triggerId` - ID of the trigger. + /// * `projectId` - Required. ID of the project. + /// * `triggerId` - Required. ID of the trigger. pub fn triggers_run(&self, request: RepoSource, project_id: &str, trigger_id: &str) -> ProjectTriggerRunCall<'a, C, A> { ProjectTriggerRunCall { hub: self.hub, @@ -1677,8 +1717,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - ID of the project. - /// * `id` - Build ID of the original build. + /// * `projectId` - Required. ID of the project. + /// * `id` - Required. Build ID of the original build. pub fn builds_retry(&self, request: RetryBuildRequest, project_id: &str, id: &str) -> ProjectBuildRetryCall<'a, C, A> { ProjectBuildRetryCall { hub: self.hub, @@ -1700,7 +1740,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - ID of the project for which to configure automatic builds. + /// * `projectId` - Required. ID of the project for which to configure automatic builds. pub fn triggers_create(&self, request: BuildTrigger, project_id: &str) -> ProjectTriggerCreateCall<'a, C, A> { ProjectTriggerCreateCall { hub: self.hub, @@ -1721,8 +1761,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - ID of the project that owns the trigger. - /// * `triggerId` - ID of the `BuildTrigger` to update. + /// * `projectId` - Required. ID of the project that owns the trigger. + /// * `triggerId` - Required. ID of the `BuildTrigger` to update. pub fn triggers_patch(&self, request: BuildTrigger, project_id: &str, trigger_id: &str) -> ProjectTriggerPatchCall<'a, C, A> { ProjectTriggerPatchCall { hub: self.hub, @@ -2750,7 +2790,7 @@ impl<'a, C, A> ProjectTriggerGetCall<'a, C, A> where C: BorrowMut } - /// ID of the project that owns the trigger. + /// Required. ID of the project that owns the trigger. /// /// Sets the *project id* path property to the given value. /// @@ -2760,7 +2800,7 @@ impl<'a, C, A> ProjectTriggerGetCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// ID of the `BuildTrigger` to get. + /// Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. /// /// Sets the *trigger id* path property to the given value. /// @@ -3016,7 +3056,7 @@ impl<'a, C, A> ProjectTriggerListCall<'a, C, A> where C: BorrowMut ProjectTriggerDeleteCall<'a, C, A> where C: BorrowMut ProjectTriggerDeleteCall<'a, C, A> where C: BorrowMut ProjectBuildCancelCall<'a, C, A> where C: BorrowMut ProjectBuildCancelCall<'a, C, A> where C: BorrowMut ProjectBuildCreateCall<'a, C, A> where C: BorrowMut ProjectBuildGetCall<'a, C, A> where C: BorrowMut, } - /// ID of the project. + /// Required. ID of the project. /// /// Sets the *project id* path property to the given value. /// @@ -4113,7 +4153,7 @@ impl<'a, C, A> ProjectBuildGetCall<'a, C, A> where C: BorrowMut, self._project_id = new_value.to_string(); self } - /// ID of the build. + /// Required. ID of the build. /// /// Sets the *id* path property to the given value. /// @@ -4375,7 +4415,7 @@ impl<'a, C, A> ProjectBuildListCall<'a, C, A> where C: BorrowMut, } - /// ID of the project. + /// Required. ID of the project. /// /// Sets the *project id* path property to the given value. /// @@ -4673,7 +4713,7 @@ impl<'a, C, A> ProjectTriggerRunCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// ID of the project. + /// Required. ID of the project. /// /// Sets the *project id* path property to the given value. /// @@ -4683,7 +4723,7 @@ impl<'a, C, A> ProjectTriggerRunCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// ID of the trigger. + /// Required. ID of the trigger. /// /// Sets the *trigger id* path property to the given value. /// @@ -4986,7 +5026,7 @@ impl<'a, C, A> ProjectBuildRetryCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// ID of the project. + /// Required. ID of the project. /// /// Sets the *project id* path property to the given value. /// @@ -4996,7 +5036,7 @@ impl<'a, C, A> ProjectBuildRetryCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// Build ID of the original build. + /// Required. Build ID of the original build. /// /// Sets the *id* path property to the given value. /// @@ -5273,7 +5313,7 @@ impl<'a, C, A> ProjectTriggerCreateCall<'a, C, A> where C: BorrowMut ProjectTriggerPatchCall<'a, C, A> where C: BorrowMut ProjectTriggerPatchCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Debugger (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouddebugger2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-clouddebugger2] path = "../clouddebugger2" -version = "1.0.12+20190614" +version = "1.0.13+20200405" diff --git a/gen/clouddebugger2-cli/README.md b/gen/clouddebugger2-cli/README.md index 658cbbf602..cdf802d747 100644 --- a/gen/clouddebugger2-cli/README.md +++ b/gen/clouddebugger2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Debugger* API at revision *20190614*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Debugger* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash clouddebugger2 [options] diff --git a/gen/clouddebugger2-cli/mkdocs.yml b/gen/clouddebugger2-cli/mkdocs.yml index 42d3704595..273f4e92b1 100644 --- a/gen/clouddebugger2-cli/mkdocs.yml +++ b/gen/clouddebugger2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Debugger v1.0.12+20190614 +site_name: Cloud Debugger v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-clouddebugger2-cli site_description: A complete library to interact with Cloud Debugger (protocol v2) diff --git a/gen/clouddebugger2-cli/src/main.rs b/gen/clouddebugger2-cli/src/main.rs index f4296cf2ad..4dec23bea1 100644 --- a/gen/clouddebugger2-cli/src/main.rs +++ b/gen/clouddebugger2-cli/src/main.rs @@ -803,7 +803,7 @@ fn main() { vec![ (Some(r##"debuggee-id"##), None, - Some(r##"Identifies the debuggee."##), + Some(r##"Required. Identifies the debuggee."##), Some(true), Some(false)), @@ -832,7 +832,7 @@ fn main() { vec![ (Some(r##"debuggee-id"##), None, - Some(r##"Identifies the debuggee being debugged."##), + Some(r##"Required. Identifies the debuggee being debugged."##), Some(true), Some(false)), @@ -900,13 +900,13 @@ fn main() { vec![ (Some(r##"debuggee-id"##), None, - Some(r##"ID of the debuggee whose breakpoint to delete."##), + Some(r##"Required. ID of the debuggee whose breakpoint to delete."##), Some(true), Some(false)), (Some(r##"breakpoint-id"##), None, - Some(r##"ID of the breakpoint to delete."##), + Some(r##"Required. ID of the breakpoint to delete."##), Some(true), Some(false)), @@ -928,13 +928,13 @@ fn main() { vec![ (Some(r##"debuggee-id"##), None, - Some(r##"ID of the debuggee whose breakpoint to get."##), + Some(r##"Required. ID of the debuggee whose breakpoint to get."##), Some(true), Some(false)), (Some(r##"breakpoint-id"##), None, - Some(r##"ID of the breakpoint to get."##), + Some(r##"Required. ID of the breakpoint to get."##), Some(true), Some(false)), @@ -956,7 +956,7 @@ fn main() { vec![ (Some(r##"debuggee-id"##), None, - Some(r##"ID of the debuggee whose breakpoints to list."##), + Some(r##"Required. ID of the debuggee whose breakpoints to list."##), Some(true), Some(false)), @@ -978,7 +978,7 @@ fn main() { vec![ (Some(r##"debuggee-id"##), None, - Some(r##"ID of the debuggee where the breakpoint is to be set."##), + Some(r##"Required. ID of the debuggee where the breakpoint is to be set."##), Some(true), Some(false)), @@ -1022,7 +1022,7 @@ fn main() { let mut app = App::new("clouddebugger2") .author("Sebastian Thiel ") - .version("1.0.12+20190614") + .version("1.0.13+20200405") .about("Examines the call stack and variables of a running application without stopping or slowing it down. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli") diff --git a/gen/clouddebugger2/Cargo.toml b/gen/clouddebugger2/Cargo.toml index 4547663f4a..bc09b095a2 100644 --- a/gen/clouddebugger2/Cargo.toml +++ b/gen/clouddebugger2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-clouddebugger2" -version = "1.0.12+20190614" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Debugger (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouddebugger2" homepage = "https://cloud.google.com/debugger" -documentation = "https://docs.rs/google-clouddebugger2/1.0.12+20190614" +documentation = "https://docs.rs/google-clouddebugger2/1.0.13+20200405" license = "MIT" keywords = ["clouddebugger", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/clouddebugger2/README.md b/gen/clouddebugger2/README.md index 0b755e4faa..42fdddd459 100644 --- a/gen/clouddebugger2/README.md +++ b/gen/clouddebugger2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-clouddebugger2` library allows access to all features of the *Google Cloud Debugger* service. -This documentation was generated from *Cloud Debugger* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Debugger* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Debugger* *v2* API can be found at the [official documentation site](https://cloud.google.com/debugger). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.CloudDebugger.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.CloudDebugger.html) ... * controller - * [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.ControllerDebuggeeBreakpointListCall.html), [*debuggees breakpoints update*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.ControllerDebuggeeBreakpointUpdateCall.html) and [*debuggees register*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.ControllerDebuggeeRegisterCall.html) + * [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.ControllerDebuggeeBreakpointListCall.html), [*debuggees breakpoints update*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.ControllerDebuggeeBreakpointUpdateCall.html) and [*debuggees register*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.ControllerDebuggeeRegisterCall.html) * debugger - * [*debuggees breakpoints delete*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointDeleteCall.html), [*debuggees breakpoints get*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointGetCall.html), [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointListCall.html), [*debuggees breakpoints set*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointSetCall.html) and [*debuggees list*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.DebuggerDebuggeeListCall.html) + * [*debuggees breakpoints delete*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointDeleteCall.html), [*debuggees breakpoints get*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointGetCall.html), [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointListCall.html), [*debuggees breakpoints set*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointSetCall.html) and [*debuggees list*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.DebuggerDebuggeeListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/struct.CloudDebugger.html)** +* **[Hub](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/struct.CloudDebugger.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.Part.html)** + * **[Parts](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-clouddebugger2/1.0.12+20190614/google_clouddebugger2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-clouddebugger2/1.0.13+20200405/google_clouddebugger2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/clouddebugger2/src/lib.rs b/gen/clouddebugger2/src/lib.rs index a7e3e77202..f40371aa4a 100644 --- a/gen/clouddebugger2/src/lib.rs +++ b/gen/clouddebugger2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Debugger* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Debugger* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Debugger* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/debugger). @@ -337,7 +337,7 @@ impl<'a, C, A> CloudDebugger CloudDebugger { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://clouddebugger.googleapis.com/".to_string(), _root_url: "https://clouddebugger.googleapis.com/".to_string(), } @@ -351,7 +351,7 @@ impl<'a, C, A> CloudDebugger } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -491,7 +491,7 @@ impl ResponseResult for ListDebuggeesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RegisterDebuggeeRequest { - /// Debuggee information to register. + /// Required. Debuggee information to register. /// The fields `project`, `uniquifier`, `description` and `agent_version` /// of the debuggee must be set. pub debuggee: Option, @@ -724,7 +724,7 @@ impl Part for SourceContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateActiveBreakpointRequest { - /// Updated breakpoint information. + /// Required. Updated breakpoint information. /// The field `id` must be set. /// The agent must echo all Breakpoint specification fields in the update. pub breakpoint: Option, @@ -870,6 +870,9 @@ pub struct CloudWorkspaceId { impl Part for CloudWorkspaceId {} +/// ------------------------------------------------------------------------------ +/// ## Breakpoint (the resource) +/// /// Represents the breakpoint specification, status and results. /// /// # Activities @@ -1144,7 +1147,7 @@ impl Part for Variable {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetBreakpointResponse { /// Breakpoint resource. - /// The field `id` is guaranteed to be set (in addition to the echoed fileds). + /// The field `id` is guaranteed to be set (in addition to the echoed fields). pub breakpoint: Option, } @@ -1251,7 +1254,7 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `debuggeeId` - Identifies the debuggee being debugged. + /// * `debuggeeId` - Required. Identifies the debuggee being debugged. /// * `id` - Breakpoint identifier, unique in the scope of the debuggee. pub fn debuggees_breakpoints_update(&self, request: UpdateActiveBreakpointRequest, debuggee_id: &str, id: &str) -> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> { ControllerDebuggeeBreakpointUpdateCall { @@ -1309,7 +1312,7 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// /// # Arguments /// - /// * `debuggeeId` - Identifies the debuggee. + /// * `debuggeeId` - Required. Identifies the debuggee. pub fn debuggees_breakpoints_list(&self, debuggee_id: &str) -> ControllerDebuggeeBreakpointListCall<'a, C, A> { ControllerDebuggeeBreakpointListCall { hub: self.hub, @@ -1370,8 +1373,8 @@ impl<'a, C, A> DebuggerMethods<'a, C, A> { /// /// # Arguments /// - /// * `debuggeeId` - ID of the debuggee whose breakpoint to get. - /// * `breakpointId` - ID of the breakpoint to get. + /// * `debuggeeId` - Required. ID of the debuggee whose breakpoint to get. + /// * `breakpointId` - Required. ID of the breakpoint to get. pub fn debuggees_breakpoints_get(&self, debuggee_id: &str, breakpoint_id: &str) -> DebuggerDebuggeeBreakpointGetCall<'a, C, A> { DebuggerDebuggeeBreakpointGetCall { hub: self.hub, @@ -1390,8 +1393,8 @@ impl<'a, C, A> DebuggerMethods<'a, C, A> { /// /// # Arguments /// - /// * `debuggeeId` - ID of the debuggee whose breakpoint to delete. - /// * `breakpointId` - ID of the breakpoint to delete. + /// * `debuggeeId` - Required. ID of the debuggee whose breakpoint to delete. + /// * `breakpointId` - Required. ID of the breakpoint to delete. pub fn debuggees_breakpoints_delete(&self, debuggee_id: &str, breakpoint_id: &str) -> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> { DebuggerDebuggeeBreakpointDeleteCall { hub: self.hub, @@ -1426,7 +1429,7 @@ impl<'a, C, A> DebuggerMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `debuggeeId` - ID of the debuggee where the breakpoint is to be set. + /// * `debuggeeId` - Required. ID of the debuggee where the breakpoint is to be set. pub fn debuggees_breakpoints_set(&self, request: Breakpoint, debuggee_id: &str) -> DebuggerDebuggeeBreakpointSetCall<'a, C, A> { DebuggerDebuggeeBreakpointSetCall { hub: self.hub, @@ -1445,7 +1448,7 @@ impl<'a, C, A> DebuggerMethods<'a, C, A> { /// /// # Arguments /// - /// * `debuggeeId` - ID of the debuggee whose breakpoints to list. + /// * `debuggeeId` - Required. ID of the debuggee whose breakpoints to list. pub fn debuggees_breakpoints_list(&self, debuggee_id: &str) -> DebuggerDebuggeeBreakpointListCall<'a, C, A> { DebuggerDebuggeeBreakpointListCall { hub: self.hub, @@ -1682,7 +1685,7 @@ impl<'a, C, A> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> where C: BorrowM self._request = new_value; self } - /// Identifies the debuggee being debugged. + /// Required. Identifies the debuggee being debugged. /// /// Sets the *debuggee id* path property to the given value. /// @@ -2209,7 +2212,7 @@ impl<'a, C, A> ControllerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut } - /// Identifies the debuggee. + /// Required. Identifies the debuggee. /// /// Sets the *debuggee id* path property to the given value. /// @@ -2482,7 +2485,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut } - /// ID of the debuggee whose breakpoint to delete. + /// Required. ID of the debuggee whose breakpoint to delete. /// /// Sets the *debuggee id* path property to the given value. /// @@ -2761,7 +2764,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut self._debuggee_id = new_value.to_string(); self } - /// ID of the breakpoint to delete. + /// Required. ID of the breakpoint to delete. /// /// Sets the *breakpoint id* path property to the given value. /// @@ -2771,7 +2774,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut self._breakpoint_id = new_value.to_string(); self } - /// The client version making the call. + /// Required. The client version making the call. /// Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). /// /// Sets the *client version* query property to the given value. @@ -3005,7 +3008,7 @@ impl<'a, C, A> DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeListCall<'a, C, A> { @@ -3020,7 +3023,7 @@ impl<'a, C, A> DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Clouderrorreporting (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouderrorreporting1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-clouderrorreporting1_beta1] path = "../clouderrorreporting1_beta1" -version = "1.0.12+20190626" +version = "1.0.13+20200331" diff --git a/gen/clouderrorreporting1_beta1-cli/README.md b/gen/clouderrorreporting1_beta1-cli/README.md index 536f592ef8..f1e2fe4c8a 100644 --- a/gen/clouderrorreporting1_beta1-cli/README.md +++ b/gen/clouderrorreporting1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Clouderrorreporting* API at revision *20190626*. The CLI is at version *1.0.12*. +This documentation was generated from the *Clouderrorreporting* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash clouderrorreporting1-beta1 [options] diff --git a/gen/clouderrorreporting1_beta1-cli/mkdocs.yml b/gen/clouderrorreporting1_beta1-cli/mkdocs.yml index ddce185f2b..1a66b1f696 100644 --- a/gen/clouderrorreporting1_beta1-cli/mkdocs.yml +++ b/gen/clouderrorreporting1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Clouderrorreporting v1.0.12+20190626 +site_name: Clouderrorreporting v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-clouderrorreporting1_beta1-cli site_description: A complete library to interact with Clouderrorreporting (protocol v1beta1) diff --git a/gen/clouderrorreporting1_beta1-cli/src/main.rs b/gen/clouderrorreporting1_beta1-cli/src/main.rs index 13185323b2..7c679aac27 100644 --- a/gen/clouderrorreporting1_beta1-cli/src/main.rs +++ b/gen/clouderrorreporting1_beta1-cli/src/main.rs @@ -618,10 +618,11 @@ fn main() { vec![ (Some(r##"project-name"##), None, - Some(r##"[Required] The resource name of the Google Cloud Platform project. Written - as `projects/` plus the + Some(r##"Required. The resource name of the Google Cloud Platform project. Written + as `projects/{projectID}`, where `{projectID}` is the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). + Example: `projects/my-project-123`."##), Some(true), Some(false)), @@ -644,10 +645,11 @@ fn main() { vec![ (Some(r##"project-name"##), None, - Some(r##"[Required] The resource name of the Google Cloud Platform project. Written - as `projects/` plus the + Some(r##"Required. The resource name of the Google Cloud Platform project. Written + as `projects/{projectID}`, where `{projectID}` is the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). + Example: `projects/my-project-123`."##), Some(true), Some(false)), @@ -673,16 +675,17 @@ fn main() { a `key` parameter. For example: `POST - https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456`"##), + https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456`"##), "Details at http://byron.github.io/google-apis-rs/google_clouderrorreporting1_beta1_cli/projects_events-report", vec![ (Some(r##"project-name"##), None, - Some(r##"[Required] The resource name of the Google Cloud Platform project. Written - as `projects/` plus the + Some(r##"Required. The resource name of the Google Cloud Platform project. Written + as `projects/{projectId}`, where `{projectId}` is the [Google Cloud Platform project - ID](https://support.google.com/cloud/answer/6158840). Example: - `projects/my-project-123`."##), + ID](https://support.google.com/cloud/answer/6158840). + + Example: // `projects/my-project-123`."##), Some(true), Some(false)), @@ -710,12 +713,12 @@ fn main() { vec![ (Some(r##"project-name"##), None, - Some(r##"[Required] The resource name of the Google Cloud Platform project. Written - as projects/ plus the - Google Cloud - Platform project ID. + Some(r##"Required. The resource name of the Google Cloud Platform project. Written + as `projects/{projectID}`, where `{projectID}` is the + [Google Cloud Platform project + ID](https://support.google.com/cloud/answer/6158840). - Example: projects/my-project-123."##), + Example: `projects/my-project-123`."##), Some(true), Some(false)), @@ -737,7 +740,7 @@ fn main() { vec![ (Some(r##"group-name"##), None, - Some(r##"[Required] The group resource name. Written as + Some(r##"Required. The group resource name. Written as projects/projectID/groups/group_name. Call @@ -768,7 +771,7 @@ fn main() { (Some(r##"name"##), None, Some(r##"The group resource name. - Example: projects/my-project-123/groups/my-groupid"##), + Example: projects/my-project-123/groups/CNSgkpnppqKCUw"##), Some(true), Some(false)), @@ -796,7 +799,7 @@ fn main() { let mut app = App::new("clouderrorreporting1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190626") + .version("1.0.13+20200331") .about("Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_clouderrorreporting1_beta1_cli") diff --git a/gen/clouderrorreporting1_beta1/Cargo.toml b/gen/clouderrorreporting1_beta1/Cargo.toml index 6fabdf122b..01f21c3c59 100644 --- a/gen/clouderrorreporting1_beta1/Cargo.toml +++ b/gen/clouderrorreporting1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-clouderrorreporting1_beta1" -version = "1.0.12+20190626" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Clouderrorreporting (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouderrorreporting1_beta1" homepage = "https://cloud.google.com/error-reporting/" -documentation = "https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626" +documentation = "https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331" license = "MIT" keywords = ["clouderrorreporting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/clouderrorreporting1_beta1/README.md b/gen/clouderrorreporting1_beta1/README.md index f093d3f407..4a3933fb55 100644 --- a/gen/clouderrorreporting1_beta1/README.md +++ b/gen/clouderrorreporting1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-clouderrorreporting1_beta1` library allows access to all features of the *Google Clouderrorreporting* service. -This documentation was generated from *Clouderrorreporting* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *clouderrorreporting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Clouderrorreporting* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *clouderrorreporting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Clouderrorreporting* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/error-reporting/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.Clouderrorreporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.Clouderrorreporting.html) ... * projects - * [*delete events*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.ProjectDeleteEventCall.html), [*events list*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.ProjectEventListCall.html), [*events report*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.ProjectEventReportCall.html), [*group stats list*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.ProjectGroupStatListCall.html), [*groups get*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.ProjectGroupGetCall.html) and [*groups update*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.ProjectGroupUpdateCall.html) + * [*delete events*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.ProjectDeleteEventCall.html), [*events list*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.ProjectEventListCall.html), [*events report*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.ProjectEventReportCall.html), [*group stats list*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.ProjectGroupStatListCall.html), [*groups get*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.ProjectGroupGetCall.html) and [*groups update*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.ProjectGroupUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/struct.Clouderrorreporting.html)** +* **[Hub](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/struct.Clouderrorreporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-clouderrorreporting1_beta1/1.0.12+20190626/google_clouderrorreporting1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-clouderrorreporting1_beta1/1.0.13+20200331/google_clouderrorreporting1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/clouderrorreporting1_beta1/src/lib.rs b/gen/clouderrorreporting1_beta1/src/lib.rs index 2c8a86dc43..4b0f48c369 100644 --- a/gen/clouderrorreporting1_beta1/src/lib.rs +++ b/gen/clouderrorreporting1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Clouderrorreporting* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *clouderrorreporting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Clouderrorreporting* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *clouderrorreporting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Clouderrorreporting* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/error-reporting/). @@ -330,7 +330,7 @@ impl<'a, C, A> Clouderrorreporting Clouderrorreporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://clouderrorreporting.googleapis.com/".to_string(), _root_url: "https://clouderrorreporting.googleapis.com/".to_string(), } @@ -341,7 +341,7 @@ impl<'a, C, A> Clouderrorreporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -489,7 +489,7 @@ pub struct ErrorGroup { #[serde(rename="groupId")] pub group_id: Option, /// The group resource name. - /// Example: projects/my-project-123/groups/my-groupid + /// Example: projects/my-project-123/groups/CNSgkpnppqKCUw pub name: Option, } @@ -691,15 +691,15 @@ impl ResponseResult for ListGroupStatsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReportedErrorEvent { - /// [Required] The service context in which this error has occurred. + /// Required. The service context in which this error has occurred. #[serde(rename="serviceContext")] pub service_context: Option, - /// [Optional] Time when the event occurred. + /// Optional. Time when the event occurred. /// If not provided, the time when the event was received by the /// Error Reporting system will be used. #[serde(rename="eventTime")] pub event_time: Option, - /// [Required] The error message. + /// Required. The error message. /// If no `context.reportLocation` is provided, the message must contain a /// header (typically consisting of the exception type name and an error /// message) and an exception stack trace in one of the supported programming @@ -724,7 +724,7 @@ pub struct ReportedErrorEvent { /// * **Go**: Must be the return value of /// [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack). pub message: Option, - /// [Optional] A description of the context in which the error occurred. + /// Optional. A description of the context in which the error occurred. pub context: Option, } @@ -855,7 +855,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `groupName` - [Required] The group resource name. Written as + /// * `groupName` - Required. The group resource name. Written as /// projects/projectID/groups/group_name. /// Call /// @@ -878,11 +878,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectName` - [Required] The resource name of the Google Cloud Platform project. Written - /// as projects/ plus the - /// Google Cloud - /// Platform project ID. - /// Example: projects/my-project-123. + /// * `projectName` - Required. The resource name of the Google Cloud Platform project. Written + /// as `projects/{projectID}`, where `{projectID}` is the + /// [Google Cloud Platform project + /// ID](https://support.google.com/cloud/answer/6158840). + /// Example: `projects/my-project-123`. pub fn group_stats_list(&self, project_name: &str) -> ProjectGroupStatListCall<'a, C, A> { ProjectGroupStatListCall { hub: self.hub, @@ -910,8 +910,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectName` - [Required] The resource name of the Google Cloud Platform project. Written - /// as `projects/` plus the + /// * `projectName` - Required. The resource name of the Google Cloud Platform project. Written + /// as `projects/{projectID}`, where `{projectID}` is the /// [Google Cloud Platform project /// ID](https://support.google.com/cloud/answer/6158840). /// Example: `projects/my-project-123`. @@ -931,8 +931,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectName` - [Required] The resource name of the Google Cloud Platform project. Written - /// as `projects/` plus the + /// * `projectName` - Required. The resource name of the Google Cloud Platform project. Written + /// as `projects/{projectID}`, where `{projectID}` is the /// [Google Cloud Platform project /// ID](https://support.google.com/cloud/answer/6158840). /// Example: `projects/my-project-123`. @@ -962,7 +962,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `name` - The group resource name. - /// Example: projects/my-project-123/groups/my-groupid + /// Example: projects/my-project-123/groups/CNSgkpnppqKCUw pub fn groups_update(&self, request: ErrorGroup, name: &str) -> ProjectGroupUpdateCall<'a, C, A> { ProjectGroupUpdateCall { hub: self.hub, @@ -984,16 +984,16 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// a `key` parameter. For example: /// /// `POST - /// https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456` + /// https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456` /// /// # Arguments /// /// * `request` - No description provided. - /// * `projectName` - [Required] The resource name of the Google Cloud Platform project. Written - /// as `projects/` plus the + /// * `projectName` - Required. The resource name of the Google Cloud Platform project. Written + /// as `projects/{projectId}`, where `{projectId}` is the /// [Google Cloud Platform project - /// ID](https://support.google.com/cloud/answer/6158840). Example: - /// `projects/my-project-123`. + /// ID](https://support.google.com/cloud/answer/6158840). + /// Example: // `projects/my-project-123`. pub fn events_report(&self, request: ReportedErrorEvent, project_name: &str) -> ProjectEventReportCall<'a, C, A> { ProjectEventReportCall { hub: self.hub, @@ -1189,7 +1189,7 @@ impl<'a, C, A> ProjectGroupGetCall<'a, C, A> where C: BorrowMut, } - /// [Required] The group resource name. Written as + /// Required. The group resource name. Written as /// projects/projectID/groups/group_name. /// Call /// @@ -1501,12 +1501,12 @@ impl<'a, C, A> ProjectGroupStatListCall<'a, C, A> where C: BorrowMutprojects/ plus the - /// Google Cloud - /// Platform project ID. + /// Required. The resource name of the Google Cloud Platform project. Written + /// as `projects/{projectID}`, where `{projectID}` is the + /// [Google Cloud Platform project + /// ID](https://support.google.com/cloud/answer/6158840). /// - /// Example: projects/my-project-123. + /// Example: `projects/my-project-123`. /// /// Sets the *project name* path property to the given value. /// @@ -1516,7 +1516,7 @@ impl<'a, C, A> ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMutErrorGroupStats with these IDs. + /// Optional. List all ErrorGroupStats with these IDs. /// /// Append the given value to the *group id* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -1588,7 +1588,7 @@ impl<'a, C, A> ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectGroupStatListCall<'a, C, A> where C: BorrowMut ProjectDeleteEventCall<'a, C, A> where C: BorrowMut ProjectEventListCall<'a, C, A> where C: BorrowMut, } - /// [Required] The resource name of the Google Cloud Platform project. Written - /// as `projects/` plus the + /// Required. The resource name of the Google Cloud Platform project. Written + /// as `projects/{projectID}`, where `{projectID}` is the /// [Google Cloud Platform project /// ID](https://support.google.com/cloud/answer/6158840). + /// /// Example: `projects/my-project-123`. /// /// Sets the *project name* path property to the given value. @@ -2150,7 +2152,7 @@ impl<'a, C, A> ProjectEventListCall<'a, C, A> where C: BorrowMut, self._time_range_period = Some(new_value.to_string()); self } - /// [Optional] The exact value to match against + /// Optional. The exact value to match against /// [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). /// /// Sets the *service filter.version* query property to the given value. @@ -2158,7 +2160,7 @@ impl<'a, C, A> ProjectEventListCall<'a, C, A> where C: BorrowMut, self._service_filter_version = Some(new_value.to_string()); self } - /// [Optional] The exact value to match against + /// Optional. The exact value to match against /// [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). /// /// Sets the *service filter.service* query property to the given value. @@ -2166,7 +2168,7 @@ impl<'a, C, A> ProjectEventListCall<'a, C, A> where C: BorrowMut, self._service_filter_service = Some(new_value.to_string()); self } - /// [Optional] The exact value to match against + /// Optional. The exact value to match against /// [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). /// /// Sets the *service filter.resource type* query property to the given value. @@ -2174,21 +2176,21 @@ impl<'a, C, A> ProjectEventListCall<'a, C, A> where C: BorrowMut, self._service_filter_resource_type = Some(new_value.to_string()); self } - /// [Optional] A `next_page_token` provided by a previous response. + /// Optional. A `next_page_token` provided by a previous response. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ProjectEventListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// [Optional] The maximum number of results to return per response. + /// Optional. The maximum number of results to return per response. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectEventListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// [Required] The group for which events shall be returned. + /// Required. The group for which events shall be returned. /// /// Sets the *group id* query property to the given value. pub fn group_id(mut self, new_value: &str) -> ProjectEventListCall<'a, C, A> { @@ -2466,7 +2468,7 @@ impl<'a, C, A> ProjectGroupUpdateCall<'a, C, A> where C: BorrowMutprojects/my-project-123/groups/my-groupid + /// Example: projects/my-project-123/groups/CNSgkpnppqKCUw /// /// Sets the *name* path property to the given value. /// @@ -2547,7 +2549,7 @@ impl<'a, C, A> ProjectGroupUpdateCall<'a, C, A> where C: BorrowMut ProjectEventReportCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Functions (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudfunctions1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudfunctions1] path = "../cloudfunctions1" -version = "1.0.12+20190620" +version = "1.0.13+20200401" diff --git a/gen/cloudfunctions1-cli/README.md b/gen/cloudfunctions1-cli/README.md index 21e12f11c5..cbe802ea8e 100644 --- a/gen/cloudfunctions1-cli/README.md +++ b/gen/cloudfunctions1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Functions* API at revision *20190620*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Functions* API at revision *20200401*. The CLI is at version *1.0.13*. ```bash cloudfunctions1 [options] diff --git a/gen/cloudfunctions1-cli/mkdocs.yml b/gen/cloudfunctions1-cli/mkdocs.yml index c2423ba0d2..16d226ad2a 100644 --- a/gen/cloudfunctions1-cli/mkdocs.yml +++ b/gen/cloudfunctions1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Functions v1.0.12+20190620 +site_name: Cloud Functions v1.0.13+20200401 site_url: http://byron.github.io/google-apis-rs/google-cloudfunctions1-cli site_description: A complete library to interact with Cloud Functions (protocol v1) diff --git a/gen/cloudfunctions1-cli/src/main.rs b/gen/cloudfunctions1-cli/src/main.rs index 94b0902fd6..0676cff5e4 100644 --- a/gen/cloudfunctions1-cli/src/main.rs +++ b/gen/cloudfunctions1-cli/src/main.rs @@ -274,28 +274,30 @@ impl<'n> Engine<'n> { "event-trigger.event-type" => Some(("eventTrigger.eventType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "event-trigger.resource" => Some(("eventTrigger.resource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "event-trigger.service" => Some(("eventTrigger.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "max-instances" => Some(("maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "source-repository.url" => Some(("sourceRepository.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-repository.deployed-url" => Some(("sourceRepository.deployedUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "available-memory-mb" => Some(("availableMemoryMb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "https-trigger.url" => Some(("httpsTrigger.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-archive-url" => Some(("sourceArchiveUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "environment-variables" => Some(("environmentVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "source-upload-url" => Some(("sourceUploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpc-connector-egress-settings" => Some(("vpcConnectorEgressSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "available-memory-mb" => Some(("availableMemoryMb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-instances" => Some(("maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "version-id" => Some(("versionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "entry-point" => Some(("entryPoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpc-connector" => Some(("vpcConnector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "environment-variables" => Some(("environmentVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "source-upload-url" => Some(("sourceUploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "service-account-email" => Some(("serviceAccountEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout" => Some(("timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ingress-settings" => Some(("ingressSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "vpc-connector" => Some(("vpcConnector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["available-memory-mb", "deployed-url", "description", "entry-point", "environment-variables", "event-trigger", "event-type", "https-trigger", "labels", "max-instances", "name", "network", "resource", "runtime", "service", "service-account-email", "source-archive-url", "source-repository", "source-upload-url", "status", "timeout", "update-time", "url", "version-id", "vpc-connector"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["available-memory-mb", "deployed-url", "description", "entry-point", "environment-variables", "event-trigger", "event-type", "https-trigger", "ingress-settings", "labels", "max-instances", "name", "network", "resource", "runtime", "service", "service-account-email", "source-archive-url", "source-repository", "source-upload-url", "status", "timeout", "update-time", "url", "version-id", "vpc-connector", "vpc-connector-egress-settings"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -634,6 +636,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -647,6 +652,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -765,28 +771,30 @@ impl<'n> Engine<'n> { "event-trigger.event-type" => Some(("eventTrigger.eventType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "event-trigger.resource" => Some(("eventTrigger.resource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "event-trigger.service" => Some(("eventTrigger.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "max-instances" => Some(("maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "source-repository.url" => Some(("sourceRepository.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-repository.deployed-url" => Some(("sourceRepository.deployedUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "available-memory-mb" => Some(("availableMemoryMb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "https-trigger.url" => Some(("httpsTrigger.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-archive-url" => Some(("sourceArchiveUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "environment-variables" => Some(("environmentVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "source-upload-url" => Some(("sourceUploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpc-connector-egress-settings" => Some(("vpcConnectorEgressSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "available-memory-mb" => Some(("availableMemoryMb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-instances" => Some(("maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "version-id" => Some(("versionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "entry-point" => Some(("entryPoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpc-connector" => Some(("vpcConnector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "environment-variables" => Some(("environmentVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "source-upload-url" => Some(("sourceUploadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "service-account-email" => Some(("serviceAccountEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout" => Some(("timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ingress-settings" => Some(("ingressSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "vpc-connector" => Some(("vpcConnector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["available-memory-mb", "deployed-url", "description", "entry-point", "environment-variables", "event-trigger", "event-type", "https-trigger", "labels", "max-instances", "name", "network", "resource", "runtime", "service", "service-account-email", "source-archive-url", "source-repository", "source-upload-url", "status", "timeout", "update-time", "url", "version-id", "vpc-connector"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["available-memory-mb", "deployed-url", "description", "entry-point", "environment-variables", "event-trigger", "event-type", "https-trigger", "ingress-settings", "labels", "max-instances", "name", "network", "resource", "runtime", "service", "service-account-email", "source-archive-url", "source-repository", "source-upload-url", "status", "timeout", "update-time", "url", "version-id", "vpc-connector", "vpc-connector-egress-settings"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1294,7 +1302,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the function to be called."##), + Some(r##"Required. The name of the function to be called."##), Some(true), Some(false)), @@ -1324,7 +1332,7 @@ fn main() { vec![ (Some(r##"location"##), None, - Some(r##"The project and location in which the function should be created, specified + Some(r##"Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*`"##), Some(true), Some(false)), @@ -1355,7 +1363,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the function which should be deleted."##), + Some(r##"Required. The name of the function which should be deleted."##), Some(true), Some(false)), @@ -1463,7 +1471,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the function which details should be obtained."##), + Some(r##"Required. The name of the function which details should be obtained."##), Some(true), Some(false)), @@ -1513,7 +1521,9 @@ fn main() { Some(r##"The project and location from which the function should be listed, specified in the format `projects/*/locations/*` If you want to list functions in all locations, use "-" in place of a - location."##), + location. When listing functions in all locations, if one or more + location(s) are unreachable, the response will contain functions from all + reachable locations along with the names of any unreachable locations."##), Some(true), Some(false)), @@ -1648,7 +1658,7 @@ fn main() { let mut app = App::new("cloudfunctions1") .author("Sebastian Thiel ") - .version("1.0.12+20190620") + .version("1.0.13+20200401") .about("Manages lightweight user-provided functions executed in response to events.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudfunctions1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudfunctions1/Cargo.toml b/gen/cloudfunctions1/Cargo.toml index bc51dd3941..ed1a1cab14 100644 --- a/gen/cloudfunctions1/Cargo.toml +++ b/gen/cloudfunctions1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudfunctions1" -version = "1.0.12+20190620" +version = "1.0.13+20200401" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Functions (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudfunctions1" homepage = "https://cloud.google.com/functions" -documentation = "https://docs.rs/google-cloudfunctions1/1.0.12+20190620" +documentation = "https://docs.rs/google-cloudfunctions1/1.0.13+20200401" license = "MIT" keywords = ["cloudfunctions", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudfunctions1/README.md b/gen/cloudfunctions1/README.md index aef51b56b7..95d9267fc3 100644 --- a/gen/cloudfunctions1/README.md +++ b/gen/cloudfunctions1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-cloudfunctions1` library allows access to all features of the *Google Cloud Functions* service. -This documentation was generated from *Cloud Functions* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *cloudfunctions:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Functions* crate version *1.0.13+20200401*, where *20200401* is the exact revision of the *cloudfunctions:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Functions* *v1* API can be found at the [official documentation site](https://cloud.google.com/functions). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.CloudFunctions.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.CloudFunctions.html) ... -* [operations](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.Operation.html) - * [*get*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.OperationListCall.html) +* [operations](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.OperationListCall.html) * projects - * [*locations functions call*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionCallCall.html), [*locations functions create*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionCreateCall.html), [*locations functions delete*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionDeleteCall.html), [*locations functions generate download url*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionGenerateDownloadUrlCall.html), [*locations functions generate upload url*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionGenerateUploadUrlCall.html), [*locations functions get*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionGetCall.html), [*locations functions get iam policy*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionGetIamPolicyCall.html), [*locations functions list*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionListCall.html), [*locations functions patch*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionPatchCall.html), [*locations functions set iam policy*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionSetIamPolicyCall.html), [*locations functions test iam permissions*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationFunctionTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.ProjectLocationListCall.html) + * [*locations functions call*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionCallCall.html), [*locations functions create*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionCreateCall.html), [*locations functions delete*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionDeleteCall.html), [*locations functions generate download url*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionGenerateDownloadUrlCall.html), [*locations functions generate upload url*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionGenerateUploadUrlCall.html), [*locations functions get*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionGetCall.html), [*locations functions get iam policy*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionGetIamPolicyCall.html), [*locations functions list*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionListCall.html), [*locations functions patch*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionPatchCall.html), [*locations functions set iam policy*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionSetIamPolicyCall.html), [*locations functions test iam permissions*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationFunctionTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.ProjectLocationListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/struct.CloudFunctions.html)** +* **[Hub](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/struct.CloudFunctions.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudfunctions1/1.0.12+20190620/google_cloudfunctions1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudfunctions1/1.0.13+20200401/google_cloudfunctions1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudfunctions1/src/lib.rs b/gen/cloudfunctions1/src/lib.rs index 8bcebd9424..62c3c9fff7 100644 --- a/gen/cloudfunctions1/src/lib.rs +++ b/gen/cloudfunctions1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Functions* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *cloudfunctions:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Functions* crate version *1.0.13+20200401*, where *20200401* is the exact revision of the *cloudfunctions:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Functions* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/functions). @@ -331,7 +331,7 @@ impl<'a, C, A> CloudFunctions CloudFunctions { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudfunctions.googleapis.com/".to_string(), _root_url: "https://cloudfunctions.googleapis.com/".to_string(), } @@ -345,7 +345,7 @@ impl<'a, C, A> CloudFunctions } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -384,7 +384,7 @@ impl<'a, C, A> CloudFunctions /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CallFunctionRequest { - /// Input to be passed to the function. + /// Required. Input to be passed to the function. pub data: Option, } @@ -511,30 +511,59 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -552,7 +581,7 @@ impl Part for Expr {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -563,7 +592,7 @@ impl Part for Expr {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -652,37 +681,50 @@ pub struct Location { impl Part for Location {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -690,15 +732,21 @@ impl Part for Location {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -720,13 +768,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -938,7 +1009,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -947,6 +1018,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1029,6 +1120,9 @@ pub struct ListFunctionsResponse { /// to get more functions. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// Locations that could not be reached. The response does not include any + /// functions from these locations. + pub unreachable: Option>, /// The functions that match the request. pub functions: Option>, } @@ -1072,7 +1166,7 @@ impl RequestValue for GenerateUploadUrlRequest {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1084,7 +1178,7 @@ impl RequestValue for GenerateUploadUrlRequest {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1092,7 +1186,7 @@ impl RequestValue for GenerateUploadUrlRequest {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1101,9 +1195,9 @@ impl RequestValue for GenerateUploadUrlRequest {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1122,7 +1216,6 @@ impl Part for AuditConfig {} /// Describes a Cloud Function that contains user computation executed in /// response to an event. It encapsulate function and triggers configurations. -/// LINT.IfChange /// /// # Activities /// @@ -1163,8 +1256,11 @@ pub struct CloudFunction { pub source_archive_url: Option, /// Labels associated with this Cloud Function. pub labels: Option>, - /// Output only. - /// The version identifier of the Cloud Function. Each deployment attempt + /// The egress settings for the connector, controlling what traffic is diverted + /// through it. + #[serde(rename="vpcConnectorEgressSettings")] + pub vpc_connector_egress_settings: Option, + /// Output only. The version identifier of the Cloud Function. Each deployment attempt /// results in a new version of a function being created. #[serde(rename="versionId")] pub version_id: Option, @@ -1193,8 +1289,6 @@ pub struct CloudFunction { /// /// See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for /// more information on connecting Cloud projects. - /// - /// This feature is currently in alpha, available only for whitelisted users. pub network: Option, /// The amount of memory in MB available for a function. /// Defaults to 256MB. @@ -1210,8 +1304,6 @@ pub struct CloudFunction { /// /// See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for /// more information on connecting Cloud projects. - /// - /// This feature is currently in alpha, available only for whitelisted users. #[serde(rename="vpcConnector")] pub vpc_connector: Option, /// Environment variables that shall be available during function execution. @@ -1222,20 +1314,22 @@ pub struct CloudFunction { #[serde(rename="sourceUploadUrl")] pub source_upload_url: Option, /// The email of the function's service account. If empty, defaults to - /// {project_id}@appspot.gserviceaccount.com. + /// `{project_id}@appspot.gserviceaccount.com`. #[serde(rename="serviceAccountEmail")] pub service_account_email: Option, /// The function execution timeout. Execution is considered failed and /// can be terminated if the function is not completed at the end of the /// timeout period. Defaults to 60 seconds. pub timeout: Option, - /// Required. The runtime in which the function is going to run. Choices: - /// - /// * `nodejs6`: Node.js 6 - /// * `nodejs8`: Node.js 8 - /// * `nodejs10`: Node.js 10 - /// * `python37`: Python 3.7 - /// * `go111`: Go 1.11 + /// The ingress settings for the function, controlling what traffic can reach + /// it. + #[serde(rename="ingressSettings")] + pub ingress_settings: Option, + /// The runtime in which to run the function. Required when deploying a new + /// function, optional when updating an existing function. For a complete + /// list of possible choices, see the + /// [`gcloud` command + /// reference](/sdk/gcloud/reference/functions/deploy#--runtime). pub runtime: Option, } @@ -1422,7 +1516,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the function which should be deleted. + /// * `name` - Required. The name of the function which should be deleted. pub fn locations_functions_delete(&self, name: &str) -> ProjectLocationFunctionDeleteCall<'a, C, A> { ProjectLocationFunctionDeleteCall { hub: self.hub, @@ -1447,6 +1541,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectLocationFunctionGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1459,7 +1554,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the function which details should be obtained. + /// * `name` - Required. The name of the function which details should be obtained. pub fn locations_functions_get(&self, name: &str) -> ProjectLocationFunctionGetCall<'a, C, A> { ProjectLocationFunctionGetCall { hub: self.hub, @@ -1502,7 +1597,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `location` - The project and location in which the function should be created, specified + /// * `location` - Required. The project and location in which the function should be created, specified /// in the format `projects/*/locations/*` pub fn locations_functions_create(&self, request: CloudFunction, location: &str) -> ProjectLocationFunctionCreateCall<'a, C, A> { ProjectLocationFunctionCreateCall { @@ -1590,7 +1685,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the function to be called. + /// * `name` - Required. The name of the function to be called. pub fn locations_functions_call(&self, request: CallFunctionRequest, name: &str) -> ProjectLocationFunctionCallCall<'a, C, A> { ProjectLocationFunctionCallCall { hub: self.hub, @@ -1635,7 +1730,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `parent` - The project and location from which the function should be listed, /// specified in the format `projects/*/locations/*` /// If you want to list functions in all locations, use "-" in place of a - /// location. + /// location. When listing functions in all locations, if one or more + /// location(s) are unreachable, the response will contain functions from all + /// reachable locations along with the names of any unreachable locations. pub fn locations_functions_list(&self, parent: &str) -> ProjectLocationFunctionListCall<'a, C, A> { ProjectLocationFunctionListCall { hub: self.hub, @@ -2084,14 +2181,14 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: } - /// The standard list page token. + /// Token identifying which result to start with, which is returned by a previous list call.

          Pagination is only supported when querying for a specific function. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The standard list page size. + /// The maximum number of records that should be returned.
          Requested page size cannot exceed 100. If not set, the default page size is 100.

          Pagination is only supported when querying for a specific function. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a, C, A> { @@ -2105,7 +2202,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._name = Some(new_value.to_string()); self } - /// Required. A filter for matching the requested operations.

          The supported formats of filter are:
          To query for specific function: project:*,location:*,function:*
          To query for all of the latest operations for a project: project:*,latest:true + /// Required. A filter for matching the requested operations.

          The supported formats of filter are:
          To query for a specific function: project:*,location:*,function:*
          To query for all of the latest operations for a project: project:*,latest:true /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C, A> { @@ -2917,7 +3014,7 @@ impl<'a, C, A> ProjectLocationFunctionDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationFunctionDeleteCall<'a, C, A> where C: BorrowMut hub: &'a CloudFunctions, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3050,9 +3149,12 @@ impl<'a, C, A> ProjectLocationFunctionGetIamPolicyCall<'a, C, A> where C: Borrow }; dlg.begin(MethodInfo { id: "cloudfunctions.projects.locations.functions.getIamPolicy", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3178,6 +3280,20 @@ impl<'a, C, A> ProjectLocationFunctionGetIamPolicyCall<'a, C, A> where C: Borrow self._resource = new_value.to_string(); self } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationFunctionGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3416,7 +3532,7 @@ impl<'a, C, A> ProjectLocationFunctionGetCall<'a, C, A> where C: BorrowMut ProjectLocationFunctionCreateCall<'a, C, A> where C: BorrowMut ProjectLocationFunctionCreateCall<'a, C, A> where C: BorrowMut ProjectLocationFunctionCallCall<'a, C, A> where C: BorrowMut ProjectLocationFunctionGenerateDownloadUrlCall<'a, C, A> where C: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_functions_list("parent") -/// .page_token("eos") -/// .page_size(-81) +/// .page_token("erat") +/// .page_size(-95) /// .doit(); /// # } /// ``` @@ -5404,7 +5520,9 @@ impl<'a, C, A> ProjectLocationFunctionListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Identity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudidentity1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudidentity1] path = "../cloudidentity1" -version = "1.0.12+20190629" +version = "1.0.13+20200401" diff --git a/gen/cloudidentity1-cli/README.md b/gen/cloudidentity1-cli/README.md index cfc9bf4034..977f065b19 100644 --- a/gen/cloudidentity1-cli/README.md +++ b/gen/cloudidentity1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Identity* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Identity* API at revision *20200401*. The CLI is at version *1.0.13*. ```bash cloudidentity1 [options] diff --git a/gen/cloudidentity1-cli/mkdocs.yml b/gen/cloudidentity1-cli/mkdocs.yml index 1ec2b8ed6e..6eb1658e5e 100644 --- a/gen/cloudidentity1-cli/mkdocs.yml +++ b/gen/cloudidentity1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Identity v1.0.12+20190629 +site_name: Cloud Identity v1.0.13+20200401 site_url: http://byron.github.io/google-apis-rs/google-cloudidentity1-cli site_description: A complete library to interact with Cloud Identity (protocol v1) diff --git a/gen/cloudidentity1-cli/src/main.rs b/gen/cloudidentity1-cli/src/main.rs index ef989e9e1c..9ac502ffdd 100644 --- a/gen/cloudidentity1-cli/src/main.rs +++ b/gen/cloudidentity1-cli/src/main.rs @@ -1006,7 +1006,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Group in the format: `groups/{group_id}`, where `group_id` is the unique ID assigned to the Group."##), Some(true), @@ -1030,7 +1030,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Group in the format: `groups/{group_id}`, where `group_id` is the unique ID assigned to the Group."##), Some(true), @@ -1049,7 +1049,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"List groups within a customer or a domain."##), + Some(r##"Lists groups within a customer or a domain."##), "Details at http://byron.github.io/google-apis-rs/google_cloudidentity1_cli/groups_list", vec![ (Some(r##"v"##), @@ -1088,7 +1088,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Group to create Membership within. Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to the Group."##), Some(true), @@ -1118,7 +1118,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Membership to be deleted. Format: `groups/{group_id}/memberships/{member_id}`, where `group_id` is @@ -1145,7 +1145,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Membership to be retrieved. Format: `groups/{group_id}/memberships/{member_id}`, where `group_id` is @@ -1167,12 +1167,12 @@ fn main() { Some(false)), ]), ("memberships-list", - Some(r##"List Memberships within a Group."##), + Some(r##"Lists Memberships within a Group."##), "Details at http://byron.github.io/google-apis-rs/google_cloudidentity1_cli/groups_memberships-list", vec![ (Some(r##"parent"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Group to list Memberships within. Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to @@ -1200,7 +1200,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Group to lookup Membership within. Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to @@ -1226,7 +1226,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"[Resource name](https://cloud.google.com/apis/design/resource_names) of the + Some(r##"Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Group in the format: `groups/{group_id}`, where group_id is the unique ID assigned to the Group. @@ -1274,7 +1274,7 @@ fn main() { let mut app = App::new("cloudidentity1") .author("Sebastian Thiel ") - .version("1.0.12+20190629") + .version("1.0.13+20200401") .about("API for provisioning and managing identity resources.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudidentity1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudidentity1/Cargo.toml b/gen/cloudidentity1/Cargo.toml index a8a3408599..86e0604e08 100644 --- a/gen/cloudidentity1/Cargo.toml +++ b/gen/cloudidentity1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudidentity1" -version = "1.0.12+20190629" +version = "1.0.13+20200401" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Identity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudidentity1" homepage = "https://cloud.google.com/identity/" -documentation = "https://docs.rs/google-cloudidentity1/1.0.12+20190629" +documentation = "https://docs.rs/google-cloudidentity1/1.0.13+20200401" license = "MIT" keywords = ["cloudidentity", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudidentity1/README.md b/gen/cloudidentity1/README.md index 3df51f7830..e2dadf222e 100644 --- a/gen/cloudidentity1/README.md +++ b/gen/cloudidentity1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudidentity1` library allows access to all features of the *Google Cloud Identity* service. -This documentation was generated from *Cloud Identity* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *cloudidentity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Identity* crate version *1.0.13+20200401*, where *20200401* is the exact revision of the *cloudidentity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Identity* *v1* API can be found at the [official documentation site](https://cloud.google.com/identity/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.CloudIdentity.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.CloudIdentity.html) ... -* [groups](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.Group.html) - * [*create*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupCreateCall.html), [*delete*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupGetCall.html), [*list*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupListCall.html), [*lookup*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupLookupCall.html), [*memberships create*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupMembershipCreateCall.html), [*memberships delete*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupMembershipDeleteCall.html), [*memberships get*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupMembershipGetCall.html), [*memberships list*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupMembershipListCall.html), [*memberships lookup*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupMembershipLookupCall.html), [*patch*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupPatchCall.html) and [*search*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.GroupSearchCall.html) +* [groups](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.Group.html) + * [*create*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupCreateCall.html), [*delete*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupGetCall.html), [*list*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupListCall.html), [*lookup*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupLookupCall.html), [*memberships create*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupMembershipCreateCall.html), [*memberships delete*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupMembershipDeleteCall.html), [*memberships get*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupMembershipGetCall.html), [*memberships list*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupMembershipListCall.html), [*memberships lookup*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupMembershipLookupCall.html), [*patch*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupPatchCall.html) and [*search*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.GroupSearchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/struct.CloudIdentity.html)** +* **[Hub](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/struct.CloudIdentity.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudidentity1/1.0.12+20190629/google_cloudidentity1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudidentity1/1.0.13+20200401/google_cloudidentity1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudidentity1/src/lib.rs b/gen/cloudidentity1/src/lib.rs index b0df3a53c7..c2cd761bef 100644 --- a/gen/cloudidentity1/src/lib.rs +++ b/gen/cloudidentity1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Identity* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *cloudidentity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Identity* crate version *1.0.13+20200401*, where *20200401* is the exact revision of the *cloudidentity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Identity* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/identity/). @@ -237,18 +237,22 @@ pub use cmn::*; /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { + /// See, change, create, and delete any of the Cloud Identity Groups that you can access, including the members of each group + CloudIdentityGroup, + /// See any Cloud Identity Groups that you can access, including group members and their emails CloudIdentityGroupReadonly, - /// See, change, create, and delete any of the Cloud Identity Groups that you can access, including the members of each group - CloudIdentityGroup, + /// View and manage your data across Google Cloud Platform services + CloudPlatform, } impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::CloudIdentityGroupReadonly => "https://www.googleapis.com/auth/cloud-identity.groups.readonly", Scope::CloudIdentityGroup => "https://www.googleapis.com/auth/cloud-identity.groups", + Scope::CloudIdentityGroupReadonly => "https://www.googleapis.com/auth/cloud-identity.groups.readonly", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", } } } @@ -338,7 +342,7 @@ impl<'a, C, A> CloudIdentity CloudIdentity { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudidentity.googleapis.com/".to_string(), _root_url: "https://cloudidentity.googleapis.com/".to_string(), } @@ -349,7 +353,7 @@ impl<'a, C, A> CloudIdentity } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -470,34 +474,34 @@ impl ResponseResult for LookupMembershipNameResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Group { - /// The time when the Group was last updated. + /// Output only. The time when the Group was last updated. /// Output only. #[serde(rename="updateTime")] pub update_time: Option, /// The Group's display name. #[serde(rename="displayName")] pub display_name: Option, - /// [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group in the format: `groups/{group_id}`, where group_id is the unique ID /// assigned to the Group. /// /// Must be left blank while creating a Group. pub name: Option, - /// The entity under which this Group resides in Cloud Identity resource + /// Required. Immutable. The entity under which this Group resides in Cloud Identity resource /// hierarchy. Must be set when creating a Group, read-only afterwards. /// /// Currently allowed types: `identitysources`. pub parent: Option, - /// `Required`. Labels for Group resource. + /// Required. `Required`. Labels for Group resource. /// For creating Groups under a namespace, set label key to /// 'labels/system/groups/external' and label value as empty. pub labels: Option>, - /// EntityKey of the Group. + /// Required. Immutable. EntityKey of the Group. /// /// Must be set when creating a Group, read-only afterwards. #[serde(rename="groupKey")] pub group_key: Option, - /// The time when the Group was created. + /// Output only. The time when the Group was created. /// Output only. #[serde(rename="createTime")] pub create_time: Option, @@ -583,23 +587,23 @@ impl ResponseResult for LookupGroupNameResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Membership { - /// Last updated timestamp of the Membership. Output only. + /// Output only. Last updated timestamp of the Membership. Output only. #[serde(rename="updateTime")] pub update_time: Option, - /// EntityKey of the entity to be added as the member. Must be set while + /// Required. Immutable. EntityKey of the entity to be added as the member. Must be set while /// creating a Membership, read-only afterwards. /// /// Currently allowed entity types: `Users`, `Groups`. #[serde(rename="preferredMemberKey")] pub preferred_member_key: Option, - /// Creation timestamp of the Membership. Output only. + /// Output only. Creation timestamp of the Membership. Output only. #[serde(rename="createTime")] pub create_time: Option, /// Roles for a member within the Group. /// /// Currently supported MembershipRoles: `"MEMBER"`. pub roles: Option>, - /// [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Membership in the format: `groups/{group_id}/memberships/{member_id}`, /// where group_id is the unique ID assigned to the Group to which Membership /// belongs to, and member_id is the unique ID assigned to the member @@ -753,7 +757,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `parent` - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group to create Membership within. Format: `groups/{group_id}`, where /// `group_id` is the unique ID assigned to the Group. pub fn memberships_create(&self, request: Membership, parent: &str) -> GroupMembershipCreateCall<'a, C, A> { @@ -769,11 +773,11 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List Memberships within a Group. + /// Lists Memberships within a Group. /// /// # Arguments /// - /// * `parent` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `parent` - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group to list Memberships within. /// Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to /// the Group. @@ -792,7 +796,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List groups within a customer or a domain. + /// Lists groups within a customer or a domain. pub fn list(&self) -> GroupListCall<'a, C, A> { GroupListCall { hub: self.hub, @@ -812,7 +816,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `name` - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group in the format: `groups/{group_id}`, where `group_id` is the unique ID /// assigned to the Group. pub fn get(&self, name: &str) -> GroupGetCall<'a, C, A> { @@ -831,7 +835,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `name` - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Membership to be deleted. /// Format: `groups/{group_id}/memberships/{member_id}`, where `group_id` is /// the unique ID assigned to the Group to which Membership belongs to, and @@ -868,7 +872,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `name` - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Membership to be retrieved. /// Format: `groups/{group_id}/memberships/{member_id}`, where `group_id` is /// the unique id assigned to the Group to which Membership belongs to, and @@ -922,7 +926,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `name` - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group in the format: `groups/{group_id}`, where `group_id` is the unique ID /// assigned to the Group. pub fn delete(&self, name: &str) -> GroupDeleteCall<'a, C, A> { @@ -942,7 +946,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `name` - Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group in the format: `groups/{group_id}`, where group_id is the unique ID /// assigned to the Group. /// Must be left blank while creating a Group. @@ -966,7 +970,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// * `parent` - Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group to lookup Membership within. /// Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to /// the Group. @@ -1197,7 +1201,7 @@ impl<'a, C, A> GroupMembershipCreateCall<'a, C, A> where C: BorrowMut GroupMembershipCreateCall<'a, C, A> where C: BorrowMut GroupMembershipListCall<'a, C, A> where C: BorrowMut GroupMembershipListCall<'a, C, A> where C: BorrowMut GroupListCall<'a, C, A> where C: BorrowMut, A: oau self._view = Some(new_value.to_string()); self } - /// `Required`. May be made Optional in the future. - /// Customer ID to list all groups from. + /// Required. Customer ID to list all groups from. /// /// Sets the *parent* query property to the given value. pub fn parent(mut self, new_value: &str) -> GroupListCall<'a, C, A> { @@ -1997,7 +2000,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut } - /// [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group in the format: `groups/{group_id}`, where `group_id` is the unique ID /// assigned to the Group. /// @@ -2247,7 +2250,7 @@ impl<'a, C, A> GroupMembershipDeleteCall<'a, C, A> where C: BorrowMut GroupSearchCall<'a, C, A> where C: BorrowMut, A: o self._view = Some(new_value.to_string()); self } - /// `Required`. Query string for performing search on groups. Users can search + /// Required. `Required`. Query string for performing search on groups. Users can search /// on parent and label attributes of groups. /// EXACT match ('==') is supported on parent, and CONTAINS match ('in') is /// supported on labels. @@ -2763,7 +2766,7 @@ impl<'a, C, A> GroupMembershipGetCall<'a, C, A> where C: BorrowMut GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o } - /// [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group in the format: `groups/{group_id}`, where `group_id` is the unique ID /// assigned to the Group. /// @@ -3787,7 +3790,7 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa self._request = new_value; self } - /// [Resource name](https://cloud.google.com/apis/design/resource_names) of the + /// Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the /// Group in the format: `groups/{group_id}`, where group_id is the unique ID /// assigned to the Group. /// @@ -3801,7 +3804,7 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa self._name = new_value.to_string(); self } - /// Editable fields: `display_name`, `description` + /// Required. Editable fields: `display_name`, `description` /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> GroupPatchCall<'a, C, A> { @@ -4058,7 +4061,7 @@ impl<'a, C, A> GroupMembershipLookupCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Iot (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudiot1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudiot1] path = "../cloudiot1" -version = "1.0.12+20190618" +version = "1.0.13+20200331" diff --git a/gen/cloudiot1-cli/README.md b/gen/cloudiot1-cli/README.md index 58df040d77..088edadd6a 100644 --- a/gen/cloudiot1-cli/README.md +++ b/gen/cloudiot1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Iot* API at revision *20190618*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Iot* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash cloudiot1 [options] diff --git a/gen/cloudiot1-cli/mkdocs.yml b/gen/cloudiot1-cli/mkdocs.yml index 348f4ab4f6..ec7e091ad4 100644 --- a/gen/cloudiot1-cli/mkdocs.yml +++ b/gen/cloudiot1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Iot v1.0.12+20190618 +site_name: Cloud Iot v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-cloudiot1-cli site_description: A complete library to interact with Cloud Iot (protocol v1) diff --git a/gen/cloudiot1-cli/src/main.rs b/gen/cloudiot1-cli/src/main.rs index 288590dfa4..dd94e69453 100644 --- a/gen/cloudiot1-cli/src/main.rs +++ b/gen/cloudiot1-cli/src/main.rs @@ -1038,8 +1038,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1199,8 +1200,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2015,7 +2017,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the registry. For example, + Some(r##"Required. The name of the registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`."##), Some(true), Some(false)), @@ -2044,7 +2046,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The project and cloud region where this device registry must be created. + Some(r##"Required. The project and cloud region where this device registry must be created. For example, `projects/example-project/locations/us-central1`."##), Some(true), Some(false)), @@ -2073,7 +2075,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device registry. For example, + Some(r##"Required. The name of the device registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`."##), Some(true), Some(false)), @@ -2097,7 +2099,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device. For example, + Some(r##"Required. The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`."##), Some(true), @@ -2121,7 +2123,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the device registry where this device should be created. + Some(r##"Required. The name of the device registry where this device should be created. For example, `projects/example-project/locations/us-central1/registries/my-registry`."##), Some(true), @@ -2151,7 +2153,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device. For example, + Some(r##"Required. The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`."##), Some(true), @@ -2175,7 +2177,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device. For example, + Some(r##"Required. The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`."##), Some(true), @@ -2199,7 +2201,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The device registry path. Required. For example, + Some(r##"Required. The device registry path. Required. For example, `projects/my-project/locations/us-central1/registries/my-registry`."##), Some(true), Some(false)), @@ -2224,7 +2226,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device. For example, + Some(r##"Required. The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`."##), Some(true), @@ -2298,7 +2300,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device. For example, + Some(r##"Required. The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`."##), Some(true), @@ -2329,7 +2331,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device. For example, + Some(r##"Required. The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`."##), Some(true), @@ -2353,7 +2355,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the device registry. For example, + Some(r##"Required. The name of the device registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`."##), Some(true), Some(false)), @@ -2407,7 +2409,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The device registry path. Required. For example, + Some(r##"Required. The device registry path. Required. For example, `projects/my-project/locations/us-central1/registries/my-registry`."##), Some(true), Some(false)), @@ -2522,7 +2524,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The project and cloud region path. For example, + Some(r##"Required. The project and cloud region path. For example, `projects/example-project/locations/us-central1`."##), Some(true), Some(false)), @@ -2635,7 +2637,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the registry. For example, + Some(r##"Required. The name of the registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`."##), Some(true), Some(false)), @@ -2664,7 +2666,7 @@ fn main() { let mut app = App::new("cloudiot1") .author("Sebastian Thiel ") - .version("1.0.12+20190618") + .version("1.0.13+20200331") .about("Registers and manages IoT (Internet of Things) devices that connect to the Google Cloud Platform. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudiot1_cli") diff --git a/gen/cloudiot1/Cargo.toml b/gen/cloudiot1/Cargo.toml index 9ca933016c..86bbba5b15 100644 --- a/gen/cloudiot1/Cargo.toml +++ b/gen/cloudiot1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudiot1" -version = "1.0.12+20190618" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Iot (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudiot1" homepage = "https://cloud.google.com/iot" -documentation = "https://docs.rs/google-cloudiot1/1.0.12+20190618" +documentation = "https://docs.rs/google-cloudiot1/1.0.13+20200331" license = "MIT" keywords = ["cloudiot", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudiot1/README.md b/gen/cloudiot1/README.md index 8f24509bfa..4899474a93 100644 --- a/gen/cloudiot1/README.md +++ b/gen/cloudiot1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudiot1` library allows access to all features of the *Google Cloud Iot* service. -This documentation was generated from *Cloud Iot* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudiot:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Iot* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudiot:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Iot* *v1* API can be found at the [official documentation site](https://cloud.google.com/iot). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.CloudIot.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.CloudIot.html) ... * projects - * [*locations registries bind device to gateway*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryBindDeviceToGatewayCall.html), [*locations registries create*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryCreateCall.html), [*locations registries delete*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeleteCall.html), [*locations registries devices config versions list*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceConfigVersionListCall.html), [*locations registries devices create*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceCreateCall.html), [*locations registries devices delete*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceDeleteCall.html), [*locations registries devices get*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceGetCall.html), [*locations registries devices list*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceListCall.html), [*locations registries devices modify cloud to device config*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall.html), [*locations registries devices patch*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDevicePatchCall.html), [*locations registries devices send command to device*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceSendCommandToDeviceCall.html), [*locations registries devices states list*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryDeviceStateListCall.html), [*locations registries get*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryGetCall.html), [*locations registries get iam policy*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryGetIamPolicyCall.html), [*locations registries groups devices list*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryGroupDeviceListCall.html), [*locations registries groups get iam policy*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryGroupGetIamPolicyCall.html), [*locations registries groups set iam policy*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryGroupSetIamPolicyCall.html), [*locations registries groups test iam permissions*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryGroupTestIamPermissionCall.html), [*locations registries list*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryListCall.html), [*locations registries patch*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryPatchCall.html), [*locations registries set iam policy*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistrySetIamPolicyCall.html), [*locations registries test iam permissions*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryTestIamPermissionCall.html) and [*locations registries unbind device from gateway*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.ProjectLocationRegistryUnbindDeviceFromGatewayCall.html) + * [*locations registries bind device to gateway*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryBindDeviceToGatewayCall.html), [*locations registries create*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryCreateCall.html), [*locations registries delete*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeleteCall.html), [*locations registries devices config versions list*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceConfigVersionListCall.html), [*locations registries devices create*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceCreateCall.html), [*locations registries devices delete*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceDeleteCall.html), [*locations registries devices get*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceGetCall.html), [*locations registries devices list*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceListCall.html), [*locations registries devices modify cloud to device config*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall.html), [*locations registries devices patch*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDevicePatchCall.html), [*locations registries devices send command to device*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceSendCommandToDeviceCall.html), [*locations registries devices states list*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryDeviceStateListCall.html), [*locations registries get*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryGetCall.html), [*locations registries get iam policy*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryGetIamPolicyCall.html), [*locations registries groups devices list*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryGroupDeviceListCall.html), [*locations registries groups get iam policy*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryGroupGetIamPolicyCall.html), [*locations registries groups set iam policy*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryGroupSetIamPolicyCall.html), [*locations registries groups test iam permissions*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryGroupTestIamPermissionCall.html), [*locations registries list*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryListCall.html), [*locations registries patch*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryPatchCall.html), [*locations registries set iam policy*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistrySetIamPolicyCall.html), [*locations registries test iam permissions*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryTestIamPermissionCall.html) and [*locations registries unbind device from gateway*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.ProjectLocationRegistryUnbindDeviceFromGatewayCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/struct.CloudIot.html)** +* **[Hub](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/struct.CloudIot.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudiot1/1.0.12+20190618/google_cloudiot1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudiot1/1.0.13+20200331/google_cloudiot1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudiot1/src/lib.rs b/gen/cloudiot1/src/lib.rs index f54cc769c6..caebf6c8fc 100644 --- a/gen/cloudiot1/src/lib.rs +++ b/gen/cloudiot1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Iot* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudiot:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Iot* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudiot:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Iot* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/iot). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudIot CloudIot { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudiot.googleapis.com/".to_string(), _root_url: "https://cloudiot.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> CloudIot } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -492,37 +492,50 @@ pub struct DeviceConfig { impl ResponseResult for DeviceConfig {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -530,15 +543,21 @@ impl ResponseResult for DeviceConfig {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -551,8 +570,9 @@ impl ResponseResult for DeviceConfig {} /// * [locations registries groups get iam policy projects](struct.ProjectLocationRegistryGroupGetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -562,10 +582,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -583,11 +625,11 @@ impl ResponseResult for Policy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UnbindDeviceFromGatewayRequest { - /// The value of `gateway_id` can be either the device numeric ID or the + /// Required. The value of `gateway_id` can be either the device numeric ID or the /// user-defined device identifier. #[serde(rename="gatewayId")] pub gateway_id: Option, - /// The device to disassociate from the specified gateway. The value of + /// Required. The device to disassociate from the specified gateway. The value of /// `device_id` can be either the device numeric ID or the user-defined device /// identifier. #[serde(rename="deviceId")] @@ -905,7 +947,7 @@ pub struct ModifyCloudToDeviceConfigRequest { /// simultaneous updates without losing data. #[serde(rename="versionToUpdate")] pub version_to_update: Option, - /// The configuration data for the device. + /// Required. The configuration data for the device. #[serde(rename="binaryData")] pub binary_data: Option, } @@ -954,7 +996,11 @@ impl ResponseResult for SendCommandToDeviceResponse {} /// * [locations registries groups get iam policy projects](struct.ProjectLocationRegistryGroupGetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} impl RequestValue for GetIamPolicyRequest {} @@ -1010,30 +1056,59 @@ pub struct RegistryCredential { impl Part for RegistryCredential {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1216,6 +1291,27 @@ pub struct ListDeviceRegistriesResponse { impl ResponseResult for ListDeviceRegistriesResponse {} +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + /// Associates `members` with a `role`. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1240,7 +1336,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1249,6 +1345,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1286,7 +1402,7 @@ impl Part for HttpConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SendCommandToDeviceRequest { - /// The command data to send to the device. + /// Required. The command data to send to the device. #[serde(rename="binaryData")] pub binary_data: Option, /// Optional subfolder for the command. If empty, the command will be delivered @@ -1311,11 +1427,11 @@ impl RequestValue for SendCommandToDeviceRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BindDeviceToGatewayRequest { - /// The value of `gateway_id` can be either the device numeric ID or the + /// Required. The value of `gateway_id` can be either the device numeric ID or the /// user-defined device identifier. #[serde(rename="gatewayId")] pub gateway_id: Option, - /// The device to associate with the specified gateway. The value of + /// Required. The device to associate with the specified gateway. The value of /// `device_id` can be either the device numeric ID or the user-defined device /// identifier. #[serde(rename="deviceId")] @@ -1375,7 +1491,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The device registry path. Required. For example, + /// * `parent` - Required. The device registry path. Required. For example, /// `projects/my-project/locations/us-central1/registries/my-registry`. pub fn locations_registries_devices_list(&self, parent: &str) -> ProjectLocationRegistryDeviceListCall<'a, C, A> { ProjectLocationRegistryDeviceListCall { @@ -1402,7 +1518,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the registry. For example, + /// * `parent` - Required. The name of the registry. For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. pub fn locations_registries_unbind_device_from_gateway(&self, request: UnbindDeviceFromGatewayRequest, parent: &str) -> ProjectLocationRegistryUnbindDeviceFromGatewayCall<'a, C, A> { ProjectLocationRegistryUnbindDeviceFromGatewayCall { @@ -1464,7 +1580,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the registry. For example, + /// * `parent` - Required. The name of the registry. For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. pub fn locations_registries_bind_device_to_gateway(&self, request: BindDeviceToGatewayRequest, parent: &str) -> ProjectLocationRegistryBindDeviceToGatewayCall<'a, C, A> { ProjectLocationRegistryBindDeviceToGatewayCall { @@ -1484,7 +1600,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The project and cloud region where this device registry must be created. + /// * `parent` - Required. The project and cloud region where this device registry must be created. /// For example, `projects/example-project/locations/us-central1`. pub fn locations_registries_create(&self, request: DeviceRegistry, parent: &str) -> ProjectLocationRegistryCreateCall<'a, C, A> { ProjectLocationRegistryCreateCall { @@ -1503,7 +1619,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The project and cloud region path. For example, + /// * `parent` - Required. The project and cloud region path. For example, /// `projects/example-project/locations/us-central1`. pub fn locations_registries_list(&self, parent: &str) -> ProjectLocationRegistryListCall<'a, C, A> { ProjectLocationRegistryListCall { @@ -1546,7 +1662,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the device. For example, + /// * `name` - Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. pub fn locations_registries_devices_states_list(&self, name: &str) -> ProjectLocationRegistryDeviceStateListCall<'a, C, A> { @@ -1566,7 +1682,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the device registry. For example, + /// * `name` - Required. The name of the device registry. For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. pub fn locations_registries_get(&self, name: &str) -> ProjectLocationRegistryGetCall<'a, C, A> { ProjectLocationRegistryGetCall { @@ -1584,7 +1700,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the device registry. For example, + /// * `name` - Required. The name of the device registry. For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. pub fn locations_registries_delete(&self, name: &str) -> ProjectLocationRegistryDeleteCall<'a, C, A> { ProjectLocationRegistryDeleteCall { @@ -1602,7 +1718,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The device registry path. Required. For example, + /// * `parent` - Required. The device registry path. Required. For example, /// `projects/my-project/locations/us-central1/registries/my-registry`. pub fn locations_registries_groups_devices_list(&self, parent: &str) -> ProjectLocationRegistryGroupDeviceListCall<'a, C, A> { ProjectLocationRegistryGroupDeviceListCall { @@ -1629,7 +1745,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the device registry where this device should be created. + /// * `parent` - Required. The name of the device registry where this device should be created. /// For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. pub fn locations_registries_devices_create(&self, request: Device, parent: &str) -> ProjectLocationRegistryDeviceCreateCall<'a, C, A> { @@ -1649,7 +1765,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the device. For example, + /// * `name` - Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. pub fn locations_registries_devices_get(&self, name: &str) -> ProjectLocationRegistryDeviceGetCall<'a, C, A> { @@ -1682,7 +1798,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the device. For example, + /// * `name` - Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. pub fn locations_registries_devices_send_command_to_device(&self, request: SendCommandToDeviceRequest, name: &str) -> ProjectLocationRegistryDeviceSendCommandToDeviceCall<'a, C, A> { @@ -1749,7 +1865,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the device. For example, + /// * `name` - Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. pub fn locations_registries_devices_config_versions_list(&self, name: &str) -> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> { @@ -1794,7 +1910,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the device. For example, + /// * `name` - Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. pub fn locations_registries_devices_modify_cloud_to_device_config(&self, request: ModifyCloudToDeviceConfigRequest, name: &str) -> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, A> { @@ -1836,7 +1952,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the device. For example, + /// * `name` - Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. pub fn locations_registries_devices_delete(&self, name: &str) -> ProjectLocationRegistryDeviceDeleteCall<'a, C, A> { @@ -2098,7 +2214,7 @@ impl<'a, C, A> ProjectLocationRegistryDeviceListCall<'a, C, A> where C: BorrowMu } - /// The device registry path. Required. For example, + /// Required. The device registry path. Required. For example, /// `projects/my-project/locations/us-central1/registries/my-registry`. /// /// Sets the *parent* path property to the given value. @@ -2453,7 +2569,7 @@ impl<'a, C, A> ProjectLocationRegistryUnbindDeviceFromGatewayCall<'a, C, A> wher self._request = new_value; self } - /// The name of the registry. For example, + /// Required. The name of the registry. For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. /// /// Sets the *parent* path property to the given value. @@ -2749,7 +2865,7 @@ impl<'a, C, A> ProjectLocationRegistryPatchCall<'a, C, A> where C: BorrowMut ProjectLocationRegistryBindDeviceToGatewayCall<'a, C, A> where C: self._request = new_value; self } - /// The name of the registry. For example, + /// Required. The name of the registry. For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. /// /// Sets the *parent* path property to the given value. @@ -3590,7 +3706,7 @@ impl<'a, C, A> ProjectLocationRegistryCreateCall<'a, C, A> where C: BorrowMut ProjectLocationRegistryListCall<'a, C, A> where C: BorrowMut ProjectLocationRegistryDeviceStateListCall<'a, C, A> where C: Bor } - /// The name of the device. For example, + /// Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. /// @@ -4664,7 +4780,7 @@ impl<'a, C, A> ProjectLocationRegistryGetCall<'a, C, A> where C: BorrowMut ProjectLocationRegistryDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationRegistryGroupDeviceListCall<'a, C, A> where C: Bor } - /// The device registry path. Required. For example, + /// Required. The device registry path. Required. For example, /// `projects/my-project/locations/us-central1/registries/my-registry`. /// /// Sets the *parent* path property to the given value. @@ -5561,7 +5677,7 @@ impl<'a, C, A> ProjectLocationRegistryDeviceCreateCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// The name of the device registry where this device should be created. + /// Required. The name of the device registry where this device should be created. /// For example, /// `projects/example-project/locations/us-central1/registries/my-registry`. /// @@ -5816,7 +5932,7 @@ impl<'a, C, A> ProjectLocationRegistryDeviceGetCall<'a, C, A> where C: BorrowMut } - /// The name of the device. For example, + /// Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. /// @@ -6117,7 +6233,7 @@ impl<'a, C, A> ProjectLocationRegistryDeviceSendCommandToDeviceCall<'a, C, A> wh self._request = new_value; self } - /// The name of the device. For example, + /// Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. /// @@ -6699,7 +6815,7 @@ impl<'a, C, A> ProjectLocationRegistryDevicePatchCall<'a, C, A> where C: BorrowM self._name = new_value.to_string(); self } - /// Only updates the `device` fields indicated by this mask. + /// Required. Only updates the `device` fields indicated by this mask. /// The field mask must not be empty, and it must not contain fields that /// are immutable or only set by the server. /// Mutable top-level fields: `credentials`, `blocked`, and `metadata` @@ -6953,7 +7069,7 @@ impl<'a, C, A> ProjectLocationRegistryDeviceConfigVersionListCall<'a, C, A> wher } - /// The name of the device. For example, + /// Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. /// @@ -7527,7 +7643,7 @@ impl<'a, C, A> ProjectLocationRegistryDeviceModifyCloudToDeviceConfigCall<'a, C, self._request = new_value; self } - /// The name of the device. For example, + /// Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. /// @@ -8059,7 +8175,7 @@ impl<'a, C, A> ProjectLocationRegistryDeviceDeleteCall<'a, C, A> where C: Borrow } - /// The name of the device. For example, + /// Required. The name of the device. For example, /// `projects/p0/locations/us-central1/registries/registry0/devices/device0` or /// `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. /// diff --git a/gen/cloudkms1-cli/Cargo.toml b/gen/cloudkms1-cli/Cargo.toml index 9a8c6af848..c046ff0d91 100644 --- a/gen/cloudkms1-cli/Cargo.toml +++ b/gen/cloudkms1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudkms1-cli" -version = "1.0.12+20190626" +version = "1.0.13+20200313" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud KMS (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudkms1] path = "../cloudkms1" -version = "1.0.12+20190626" +version = "1.0.13+20200313" diff --git a/gen/cloudkms1-cli/README.md b/gen/cloudkms1-cli/README.md index e7e5b80023..5d79ce4610 100644 --- a/gen/cloudkms1-cli/README.md +++ b/gen/cloudkms1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud KMS* API at revision *20190626*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud KMS* API at revision *20200313*. The CLI is at version *1.0.13*. ```bash cloudkms1 [options] diff --git a/gen/cloudkms1-cli/mkdocs.yml b/gen/cloudkms1-cli/mkdocs.yml index 7446bcdeed..ba05eaae8a 100644 --- a/gen/cloudkms1-cli/mkdocs.yml +++ b/gen/cloudkms1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud KMS v1.0.12+20190626 +site_name: Cloud KMS v1.0.13+20200313 site_url: http://byron.github.io/google-apis-rs/google-cloudkms1-cli site_description: A complete library to interact with Cloud KMS (protocol v1) diff --git a/gen/cloudkms1-cli/src/main.rs b/gen/cloudkms1-cli/src/main.rs index 15bbe35624..577499ecd6 100644 --- a/gen/cloudkms1-cli/src/main.rs +++ b/gen/cloudkms1-cli/src/main.rs @@ -216,16 +216,17 @@ impl<'n> Engine<'n> { "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "primary.destroy-time" => Some(("primary.destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.import-failure-reason" => Some(("primary.importFailureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary.algorithm" => Some(("primary.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.protection-level" => Some(("primary.protectionLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.algorithm" => Some(("primary.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.attestation.content" => Some(("primary.attestation.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.attestation.format" => Some(("primary.attestation.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.state" => Some(("primary.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.destroy-event-time" => Some(("primary.destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.generate-time" => Some(("primary.generateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.import-time" => Some(("primary.importTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.external-protection-level-options.external-key-uri" => Some(("primary.externalProtectionLevelOptions.externalKeyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.import-job" => Some(("primary.importJob", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version-template.protection-level" => Some(("versionTemplate.protectionLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version-template.algorithm" => Some(("versionTemplate.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -233,7 +234,7 @@ impl<'n> Engine<'n> { "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "next-rotation-time" => Some(("nextRotationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "labels", "name", "next-rotation-time", "primary", "protection-level", "purpose", "rotation-period", "state", "version-template"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "external-key-uri", "external-protection-level-options", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "labels", "name", "next-rotation-time", "primary", "protection-level", "purpose", "rotation-period", "state", "version-template"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -497,19 +498,20 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "destroy-time" => Some(("destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-failure-reason" => Some(("importFailureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "algorithm" => Some(("algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "protection-level" => Some(("protectionLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "algorithm" => Some(("algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attestation.content" => Some(("attestation.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attestation.format" => Some(("attestation.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destroy-event-time" => Some(("destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "generate-time" => Some(("generateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-time" => Some(("importTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "external-protection-level-options.external-key-uri" => Some(("externalProtectionLevelOptions.externalKeyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-job" => Some(("importJob", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "name", "protection-level", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "external-key-uri", "external-protection-level-options", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "name", "protection-level", "state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -937,19 +939,20 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "destroy-time" => Some(("destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-failure-reason" => Some(("importFailureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "algorithm" => Some(("algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "protection-level" => Some(("protectionLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "algorithm" => Some(("algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attestation.content" => Some(("attestation.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attestation.format" => Some(("attestation.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destroy-event-time" => Some(("destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "generate-time" => Some(("generateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-time" => Some(("importTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "external-protection-level-options.external-key-uri" => Some(("externalProtectionLevelOptions.externalKeyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-job" => Some(("importJob", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "name", "protection-level", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "external-key-uri", "external-protection-level-options", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "name", "protection-level", "state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1473,16 +1476,17 @@ impl<'n> Engine<'n> { "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "primary.destroy-time" => Some(("primary.destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.import-failure-reason" => Some(("primary.importFailureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary.algorithm" => Some(("primary.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.protection-level" => Some(("primary.protectionLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.algorithm" => Some(("primary.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.attestation.content" => Some(("primary.attestation.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.attestation.format" => Some(("primary.attestation.format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.state" => Some(("primary.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.destroy-event-time" => Some(("primary.destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.generate-time" => Some(("primary.generateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.import-time" => Some(("primary.importTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.external-protection-level-options.external-key-uri" => Some(("primary.externalProtectionLevelOptions.externalKeyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary.import-job" => Some(("primary.importJob", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version-template.protection-level" => Some(("versionTemplate.protectionLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version-template.algorithm" => Some(("versionTemplate.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1490,7 +1494,7 @@ impl<'n> Engine<'n> { "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "next-rotation-time" => Some(("nextRotationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "labels", "name", "next-rotation-time", "primary", "protection-level", "purpose", "rotation-period", "state", "version-template"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "attestation", "content", "create-time", "destroy-event-time", "destroy-time", "external-key-uri", "external-protection-level-options", "format", "generate-time", "import-failure-reason", "import-job", "import-time", "labels", "name", "next-rotation-time", "primary", "protection-level", "purpose", "rotation-period", "state", "version-template"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3058,7 +3062,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the CryptoKeyVersion to destroy."##), + Some(r##"Required. The resource name of the CryptoKeyVersion to destroy."##), Some(true), Some(false)), @@ -3086,7 +3090,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the CryptoKeyVersion to get."##), + Some(r##"Required. The name of the CryptoKeyVersion to get."##), Some(true), Some(false)), @@ -3111,7 +3115,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the CryptoKeyVersion public key to + Some(r##"Required. The name of the CryptoKeyVersion public key to get."##), Some(true), Some(false)), @@ -3231,7 +3235,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the CryptoKeyVersion to restore."##), + Some(r##"Required. The resource name of the CryptoKeyVersion to restore."##), Some(true), Some(false)), @@ -3324,7 +3328,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the CryptoKey to get."##), + Some(r##"Required. The name of the CryptoKey to get."##), Some(true), Some(false)), @@ -3419,7 +3423,9 @@ fn main() { ]), ("locations-key-rings-crypto-keys-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-crypto-keys-set-iam-policy", vec![ (Some(r##"resource"##), @@ -3490,7 +3496,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the CryptoKey to update."##), + Some(r##"Required. The resource name of the CryptoKey to update."##), Some(true), Some(false)), @@ -3518,7 +3524,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the KeyRing to get."##), + Some(r##"Required. The name of the KeyRing to get."##), Some(true), Some(false)), @@ -3596,7 +3602,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the ImportJob to get."##), + Some(r##"Required. The name of the ImportJob to get."##), Some(true), Some(false)), @@ -3662,7 +3668,9 @@ fn main() { ]), ("locations-key-rings-import-jobs-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-import-jobs-set-iam-policy", vec![ (Some(r##"resource"##), @@ -3750,7 +3758,9 @@ fn main() { ]), ("locations-key-rings-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_cli/projects_locations-key-rings-set-iam-policy", vec![ (Some(r##"resource"##), @@ -3841,7 +3851,7 @@ fn main() { let mut app = App::new("cloudkms1") .author("Sebastian Thiel ") - .version("1.0.12+20190626") + .version("1.0.13+20200313") .about("Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudkms1_cli") diff --git a/gen/cloudkms1/Cargo.toml b/gen/cloudkms1/Cargo.toml index b21e16adc4..17d1bcb210 100644 --- a/gen/cloudkms1/Cargo.toml +++ b/gen/cloudkms1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudkms1" -version = "1.0.12+20190626" +version = "1.0.13+20200313" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud KMS (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1" homepage = "https://cloud.google.com/kms/" -documentation = "https://docs.rs/google-cloudkms1/1.0.12+20190626" +documentation = "https://docs.rs/google-cloudkms1/1.0.13+20200313" license = "MIT" keywords = ["cloudkms", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudkms1/README.md b/gen/cloudkms1/README.md index 68711efc7c..64a13efcaa 100644 --- a/gen/cloudkms1/README.md +++ b/gen/cloudkms1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudkms1` library allows access to all features of the *Google Cloud KMS* service. -This documentation was generated from *Cloud KMS* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *cloudkms:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud KMS* crate version *1.0.13+20200313*, where *20200313* is the exact revision of the *cloudkms:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud KMS* *v1* API can be found at the [official documentation site](https://cloud.google.com/kms/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.CloudKMS.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.CloudKMS.html) ... * projects - * [*locations get*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationGetCall.html), [*locations key rings create*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions asymmetric decrypt*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionAsymmetricDecryptCall.html), [*locations key rings crypto keys crypto key versions asymmetric sign*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionAsymmetricSignCall.html), [*locations key rings crypto keys crypto key versions create*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions get public key*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetPublicKeyCall.html), [*locations key rings crypto keys crypto key versions import*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionImportCall.html), [*locations key rings crypto keys crypto key versions list*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings import jobs create*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingImportJobCreateCall.html), [*locations key rings import jobs get*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingImportJobGetCall.html), [*locations key rings import jobs get iam policy*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingImportJobGetIamPolicyCall.html), [*locations key rings import jobs list*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingImportJobListCall.html), [*locations key rings import jobs set iam policy*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingImportJobSetIamPolicyCall.html), [*locations key rings import jobs test iam permissions*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingImportJobTestIamPermissionCall.html), [*locations key rings list*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.ProjectLocationListCall.html) + * [*locations get*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationGetCall.html), [*locations key rings create*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions asymmetric decrypt*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionAsymmetricDecryptCall.html), [*locations key rings crypto keys crypto key versions asymmetric sign*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionAsymmetricSignCall.html), [*locations key rings crypto keys crypto key versions create*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions get public key*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetPublicKeyCall.html), [*locations key rings crypto keys crypto key versions import*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionImportCall.html), [*locations key rings crypto keys crypto key versions list*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings import jobs create*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingImportJobCreateCall.html), [*locations key rings import jobs get*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingImportJobGetCall.html), [*locations key rings import jobs get iam policy*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingImportJobGetIamPolicyCall.html), [*locations key rings import jobs list*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingImportJobListCall.html), [*locations key rings import jobs set iam policy*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingImportJobSetIamPolicyCall.html), [*locations key rings import jobs test iam permissions*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingImportJobTestIamPermissionCall.html), [*locations key rings list*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.ProjectLocationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/struct.CloudKMS.html)** +* **[Hub](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/struct.CloudKMS.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudkms1/1.0.12+20190626/google_cloudkms1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudkms1/1.0.13+20200313/google_cloudkms1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudkms1/src/lib.rs b/gen/cloudkms1/src/lib.rs index d34026cb2d..4a0cc8c51d 100644 --- a/gen/cloudkms1/src/lib.rs +++ b/gen/cloudkms1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud KMS* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *cloudkms:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud KMS* crate version *1.0.13+20200313*, where *20200313* is the exact revision of the *cloudkms:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud KMS* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/kms/). @@ -340,7 +340,7 @@ impl<'a, C, A> CloudKMS CloudKMS { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudkms.googleapis.com/".to_string(), _root_url: "https://cloudkms.googleapis.com/".to_string(), } @@ -351,7 +351,7 @@ impl<'a, C, A> CloudKMS } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -467,7 +467,7 @@ pub struct DecryptRequest { /// Required. The encrypted data originally returned in /// EncryptResponse.ciphertext. pub ciphertext: Option, - /// Optional data that must match the data originally supplied in + /// Optional. Optional data that must match the data originally supplied in /// EncryptRequest.additional_authenticated_data. #[serde(rename="additionalAuthenticatedData")] pub additional_authenticated_data: Option, @@ -501,6 +501,11 @@ impl RequestValue for DecryptRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CryptoKeyVersion { + /// Output only. The time this CryptoKeyVersion's key material was + /// destroyed. Only present if state is + /// DESTROYED. + #[serde(rename="destroyEventTime")] + pub destroy_event_time: Option, /// Output only. The time this CryptoKeyVersion's key material is scheduled /// for destruction. Only present if state is /// DESTROY_SCHEDULED. @@ -511,9 +516,6 @@ pub struct CryptoKeyVersion { /// IMPORT_FAILED. #[serde(rename="importFailureReason")] pub import_failure_reason: Option, - /// Output only. The resource name for this CryptoKeyVersion in the format - /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. - pub name: Option, /// Output only. The CryptoKeyVersionAlgorithm that this /// CryptoKeyVersion supports. pub algorithm: Option, @@ -528,15 +530,20 @@ pub struct CryptoKeyVersion { pub attestation: Option, /// The current state of the CryptoKeyVersion. pub state: Option, - /// Output only. The time this CryptoKeyVersion's key material was - /// destroyed. Only present if state is - /// DESTROYED. - #[serde(rename="destroyEventTime")] - pub destroy_event_time: Option, + /// Output only. The name of the ImportJob used to import this + /// CryptoKeyVersion. Only present if the underlying key material was + /// imported. + #[serde(rename="importJob")] + pub import_job: Option, /// Output only. The time this CryptoKeyVersion's key material was /// generated. #[serde(rename="generateTime")] pub generate_time: Option, + /// ExternalProtectionLevelOptions stores a group of additional fields for + /// configuring a CryptoKeyVersion that are specific to the + /// EXTERNAL protection level. + #[serde(rename="externalProtectionLevelOptions")] + pub external_protection_level_options: Option, /// Output only. The time at which this CryptoKeyVersion was created. #[serde(rename="createTime")] pub create_time: Option, @@ -544,11 +551,9 @@ pub struct CryptoKeyVersion { /// was imported. #[serde(rename="importTime")] pub import_time: Option, - /// Output only. The name of the ImportJob used to import this - /// CryptoKeyVersion. Only present if the underlying key material was - /// imported. - #[serde(rename="importJob")] - pub import_job: Option, + /// Output only. The resource name for this CryptoKeyVersion in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + pub name: Option, } impl RequestValue for CryptoKeyVersion {} @@ -661,8 +666,7 @@ pub struct ImportJob { /// Output only. The resource name for this ImportJob in the format /// `projects/*/locations/*/keyRings/*/importJobs/*`. pub name: Option, - /// Required and immutable. The protection level of the ImportJob. This - /// must match the + /// Required. Immutable. The protection level of the ImportJob. This must match the /// protection_level of the /// version_template on the CryptoKey you /// attempt to import into. @@ -690,8 +694,7 @@ pub struct ImportJob { /// Output only. The current state of the ImportJob, indicating if it can /// be used. pub state: Option, - /// Required and immutable. The wrapping method to be used for incoming - /// key material. + /// Required. Immutable. The wrapping method to be used for incoming key material. #[serde(rename="importMethod")] pub import_method: Option, /// Output only. The time this ImportJob's key material was generated. @@ -706,37 +709,50 @@ impl RequestValue for ImportJob {} impl ResponseResult for ImportJob {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -744,15 +760,21 @@ impl ResponseResult for ImportJob {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -778,13 +800,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -880,14 +925,14 @@ pub struct CryptoKey { /// The CryptoKey's primary version can be updated via /// UpdateCryptoKeyPrimaryVersion. /// - /// All keys with purpose - /// ENCRYPT_DECRYPT have a + /// Keys with purpose + /// ENCRYPT_DECRYPT may have a /// primary. For other keys, this field will be omitted. pub primary: Option, /// Output only. The time at which this CryptoKey was created. #[serde(rename="createTime")] pub create_time: Option, - /// The immutable purpose of this CryptoKey. + /// Immutable. The immutable purpose of this CryptoKey. pub purpose: Option, /// A template describing settings for new CryptoKeyVersion instances. /// The properties of new CryptoKeyVersion instances created by either @@ -1040,7 +1085,7 @@ impl ResponseResult for KeyRing {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateCryptoKeyPrimaryVersionRequest { - /// The id of the child CryptoKeyVersion to use as primary. + /// Required. The id of the child CryptoKeyVersion to use as primary. #[serde(rename="cryptoKeyVersionId")] pub crypto_key_version_id: Option, } @@ -1057,7 +1102,7 @@ impl RequestValue for UpdateCryptoKeyPrimaryVersionRequest {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1068,7 +1113,7 @@ impl RequestValue for UpdateCryptoKeyPrimaryVersionRequest {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1131,7 +1176,7 @@ pub struct EncryptRequest { /// plaintext and additional_authenticated_data fields must be no larger than /// 8KiB. pub plaintext: Option, - /// Optional data that, if specified, must also be provided during decryption + /// Optional. Optional data that, if specified, must also be provided during decryption /// through DecryptRequest.additional_authenticated_data. /// /// The maximum size depends on the key version's @@ -1188,30 +1233,59 @@ pub struct DecryptResponse { impl ResponseResult for DecryptResponse {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1257,6 +1331,11 @@ pub struct ImportCryptoKeyVersionRequest { /// /// /// + /// If importing symmetric key material, it is expected that the unwrapped + /// key contains plain bytes. If importing asymmetric key material, it is + /// expected that the unwrapped key is in PKCS#8-encoded DER format (the + /// PrivateKeyInfo structure from RFC 5208). + /// /// This format is the same as the format produced by PKCS#11 mechanism /// CKM_RSA_AES_KEY_WRAP. #[serde(rename="rsaAesWrappedKey")] @@ -1334,7 +1413,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1343,6 +1422,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1401,7 +1500,7 @@ impl ResponseResult for PublicKey {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1413,7 +1512,7 @@ impl ResponseResult for PublicKey {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1421,7 +1520,7 @@ impl ResponseResult for PublicKey {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1430,9 +1529,9 @@ impl ResponseResult for PublicKey {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1449,6 +1548,22 @@ pub struct AuditConfig { impl Part for AuditConfig {} +/// ExternalProtectionLevelOptions stores a group of additional fields for +/// configuring a CryptoKeyVersion that are specific to the +/// EXTERNAL protection level. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExternalProtectionLevelOptions { + /// The URI for an external resource that this CryptoKeyVersion represents. + #[serde(rename="externalKeyUri")] + pub external_key_uri: Option, +} + +impl Part for ExternalProtectionLevelOptions {} + + /// Response message for KeyManagementService.Encrypt. /// /// # Activities @@ -1462,7 +1577,8 @@ impl Part for AuditConfig {} pub struct EncryptResponse { /// The encrypted data. pub ciphertext: Option, - /// The resource name of the CryptoKeyVersion used in encryption. + /// The resource name of the CryptoKeyVersion used in encryption. Check + /// this field to verify that the intended resource was used for encryption. pub name: Option, } @@ -1600,7 +1716,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the CryptoKeyVersion public key to + /// * `name` - Required. The name of the CryptoKeyVersion public key to /// get. pub fn locations_key_rings_crypto_keys_crypto_key_versions_get_public_key(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetPublicKeyCall<'a, C, A> { ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetPublicKeyCall { @@ -1673,7 +1789,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the CryptoKeyVersion to destroy. + /// * `name` - Required. The resource name of the CryptoKeyVersion to destroy. pub fn locations_key_rings_crypto_keys_crypto_key_versions_destroy(&self, request: DestroyCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall { hub: self.hub, @@ -1715,7 +1831,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the KeyRing to get. + /// * `name` - Required. The name of the KeyRing to get. pub fn locations_key_rings_get(&self, name: &str) -> ProjectLocationKeyRingGetCall<'a, C, A> { ProjectLocationKeyRingGetCall { hub: self.hub, @@ -1733,7 +1849,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the CryptoKey to get. + /// * `name` - Required. The name of the CryptoKey to get. pub fn locations_key_rings_crypto_keys_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> { ProjectLocationKeyRingCryptoKeyGetCall { hub: self.hub, @@ -1910,7 +2026,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the CryptoKey to update. + /// * `name` - Required. The resource name of the CryptoKey to update. pub fn locations_key_rings_crypto_keys_update_primary_version(&self, request: UpdateCryptoKeyPrimaryVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall { hub: self.hub, @@ -2033,6 +2149,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2143,6 +2261,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2189,7 +2309,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the CryptoKeyVersion to get. + /// * `name` - Required. The name of the CryptoKeyVersion to get. pub fn locations_key_rings_crypto_keys_crypto_key_versions_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> { ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall { hub: self.hub, @@ -2205,6 +2325,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2234,7 +2356,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the CryptoKeyVersion to restore. + /// * `name` - Required. The resource name of the CryptoKeyVersion to restore. pub fn locations_key_rings_crypto_keys_crypto_key_versions_restore(&self, request: RestoreCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall { hub: self.hub, @@ -2278,7 +2400,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the ImportJob to get. + /// * `name` - Required. The name of the ImportJob to get. pub fn locations_key_rings_import_jobs_get(&self, name: &str) -> ProjectLocationKeyRingImportJobGetCall<'a, C, A> { ProjectLocationKeyRingImportJobGetCall { hub: self.hub, @@ -2552,7 +2674,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A self._name = new_value.to_string(); self } - /// Required list of fields to be updated in this request. + /// Required. List of fields to be updated in this request. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { @@ -2800,7 +2922,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetPublicKeyCall<' } - /// The name of the CryptoKeyVersion public key to + /// Required. The name of the CryptoKeyVersion public key to /// get. /// /// Sets the *name* path property to the given value. @@ -3373,7 +3495,7 @@ impl<'a, C, A> ProjectLocationKeyRingListCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingListCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingListCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// Optional. Only include resources that match the filter in the response - /// (https://cloud.google.com/kms/docs/sorting-and-filtering). + /// Optional. Only include resources that match the filter in the response. For + /// more information, see + /// [Sorting and filtering list + /// results](https://cloud.google.com/kms/docs/sorting-and-filtering). /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectLocationKeyRingListCall<'a, C, A> { @@ -3688,7 +3813,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, self._request = new_value; self } - /// The resource name of the CryptoKeyVersion to destroy. + /// Required. The resource name of the CryptoKeyVersion to destroy. /// /// Sets the *name* path property to the given value. /// @@ -4221,7 +4346,7 @@ impl<'a, C, A> ProjectLocationKeyRingGetCall<'a, C, A> where C: BorrowMut ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> where C: BorrowM } - /// The name of the CryptoKey to get. + /// Required. The name of the CryptoKey to get. /// /// Sets the *name* path property to the given value. /// @@ -6449,9 +6574,13 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> where C self } /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. /// /// Sets the *options.requested policy version* query property to the given value. pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> { @@ -6729,7 +6858,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> self._request = new_value; self } - /// The resource name of the CryptoKey to update. + /// Required. The resource name of the CryptoKey to update. /// /// Sets the *name* path property to the given value. /// @@ -7024,7 +7153,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> where C: Borro self._name = new_value.to_string(); self } - /// Required list of fields to be updated in this request. + /// Required. List of fields to be updated in this request. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { @@ -7569,9 +7698,13 @@ impl<'a, C, A> ProjectLocationKeyRingImportJobGetIamPolicyCall<'a, C, A> where C self } /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. /// /// Sets the *options.requested policy version* query property to the given value. pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationKeyRingImportJobGetIamPolicyCall<'a, C, A> { @@ -7847,7 +7980,7 @@ impl<'a, C, A> ProjectLocationKeyRingImportJobListCall<'a, C, A> where C: Borrow self._parent = new_value.to_string(); self } - /// Optional pagination token, returned earlier via + /// Optional. Optional pagination token, returned earlier via /// ListImportJobsResponse.next_page_token. /// /// Sets the *page token* query property to the given value. @@ -7855,7 +7988,7 @@ impl<'a, C, A> ProjectLocationKeyRingImportJobListCall<'a, C, A> where C: Borrow self._page_token = Some(new_value.to_string()); self } - /// Optional limit on the number of ImportJobs to include in the + /// Optional. Optional limit on the number of ImportJobs to include in the /// response. Further ImportJobs can subsequently be obtained by /// including the ListImportJobsResponse.next_page_token in a subsequent /// request. If unspecified, the server will pick an appropriate default. @@ -7866,16 +7999,19 @@ impl<'a, C, A> ProjectLocationKeyRingImportJobListCall<'a, C, A> where C: Borrow self } /// Optional. Specify how the results should be sorted. If not specified, the - /// results will be sorted in the default order - /// (https://cloud.google.com/kms/docs/sorting-and-filtering). + /// results will be sorted in the default order. For more information, see + /// [Sorting and filtering list + /// results](https://cloud.google.com/kms/docs/sorting-and-filtering). /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> ProjectLocationKeyRingImportJobListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// Optional. Only include resources that match the filter in the response - /// (https://cloud.google.com/kms/docs/sorting-and-filtering). + /// Optional. Only include resources that match the filter in the response. For + /// more information, see + /// [Sorting and filtering list + /// results](https://cloud.google.com/kms/docs/sorting-and-filtering). /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectLocationKeyRingImportJobListCall<'a, C, A> { @@ -8139,9 +8275,13 @@ impl<'a, C, A> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> where C: BorrowM self } /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. /// /// Sets the *options.requested policy version* query property to the given value. pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> { @@ -8213,6 +8353,8 @@ impl<'a, C, A> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> where C: BorrowM /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *locations.keyRings.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -9244,7 +9386,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> self._view = Some(new_value.to_string()); self } - /// Optional pagination token, returned earlier via + /// Optional. Optional pagination token, returned earlier via /// ListCryptoKeyVersionsResponse.next_page_token. /// /// Sets the *page token* query property to the given value. @@ -9252,7 +9394,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> self._page_token = Some(new_value.to_string()); self } - /// Optional limit on the number of CryptoKeyVersions to + /// Optional. Optional limit on the number of CryptoKeyVersions to /// include in the response. Further CryptoKeyVersions can /// subsequently be obtained by including the /// ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. @@ -9264,16 +9406,19 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> self } /// Optional. Specify how the results should be sorted. If not specified, the - /// results will be sorted in the default order - /// (https://cloud.google.com/kms/docs/sorting-and-filtering). + /// results will be sorted in the default order. For more information, see + /// [Sorting and filtering list + /// results](https://cloud.google.com/kms/docs/sorting-and-filtering). /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// Optional. Only include resources that match the filter in the response - /// (https://cloud.google.com/kms/docs/sorting-and-filtering). + /// Optional. Only include resources that match the filter in the response. For + /// more information, see + /// [Sorting and filtering list + /// results](https://cloud.google.com/kms/docs/sorting-and-filtering). /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { @@ -9561,7 +9706,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> where C: Borrow self._version_view = Some(new_value.to_string()); self } - /// Optional pagination token, returned earlier via + /// Optional. Optional pagination token, returned earlier via /// ListCryptoKeysResponse.next_page_token. /// /// Sets the *page token* query property to the given value. @@ -9569,7 +9714,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> where C: Borrow self._page_token = Some(new_value.to_string()); self } - /// Optional limit on the number of CryptoKeys to include in the + /// Optional. Optional limit on the number of CryptoKeys to include in the /// response. Further CryptoKeys can subsequently be obtained by /// including the ListCryptoKeysResponse.next_page_token in a subsequent /// request. If unspecified, the server will pick an appropriate default. @@ -9580,16 +9725,19 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> where C: Borrow self } /// Optional. Specify how the results should be sorted. If not specified, the - /// results will be sorted in the default order - /// (https://cloud.google.com/kms/docs/sorting-and-filtering). + /// results will be sorted in the default order. For more information, see + /// [Sorting and filtering list + /// results](https://cloud.google.com/kms/docs/sorting-and-filtering). /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// Optional. Only include resources that match the filter in the response - /// (https://cloud.google.com/kms/docs/sorting-and-filtering). + /// Optional. Only include resources that match the filter in the response. For + /// more information, see + /// [Sorting and filtering list + /// results](https://cloud.google.com/kms/docs/sorting-and-filtering). /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { @@ -9661,6 +9809,8 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> where C: Borrow /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *locations.keyRings.importJobs.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -10399,7 +10549,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> } - /// The name of the CryptoKeyVersion to get. + /// Required. The name of the CryptoKeyVersion to get. /// /// Sets the *name* path property to the given value. /// @@ -10474,6 +10624,8 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *locations.keyRings.cryptoKeys.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -10965,7 +11117,7 @@ impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, self._request = new_value; self } - /// The resource name of the CryptoKeyVersion to restore. + /// Required. The resource name of the CryptoKeyVersion to restore. /// /// Sets the *name* path property to the given value. /// @@ -11499,7 +11651,7 @@ impl<'a, C, A> ProjectLocationKeyRingImportJobGetCall<'a, C, A> where C: BorrowM } - /// The name of the ImportJob to get. + /// Required. The name of the ImportJob to get. /// /// Sets the *name* path property to the given value. /// diff --git a/gen/cloudkms1_beta1-cli/Cargo.toml b/gen/cloudkms1_beta1-cli/Cargo.toml index 33655a9359..5313d2faed 100644 --- a/gen/cloudkms1_beta1-cli/Cargo.toml +++ b/gen/cloudkms1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudkms1_beta1-cli" -version = "1.0.12+20170515" +version = "1.0.13+20170515" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud KMS (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudkms1_beta1] path = "../cloudkms1_beta1" -version = "1.0.12+20170515" +version = "1.0.13+20170515" diff --git a/gen/cloudkms1_beta1-cli/README.md b/gen/cloudkms1_beta1-cli/README.md index f96552e79e..24571e4d25 100644 --- a/gen/cloudkms1_beta1-cli/README.md +++ b/gen/cloudkms1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud KMS* API at revision *20170515*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud KMS* API at revision *20170515*. The CLI is at version *1.0.13*. ```bash cloudkms1-beta1 [options] diff --git a/gen/cloudkms1_beta1-cli/mkdocs.yml b/gen/cloudkms1_beta1-cli/mkdocs.yml index 488a206dba..a50daff1ab 100644 --- a/gen/cloudkms1_beta1-cli/mkdocs.yml +++ b/gen/cloudkms1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud KMS v1.0.12+20170515 +site_name: Cloud KMS v1.0.13+20170515 site_url: http://byron.github.io/google-apis-rs/google-cloudkms1_beta1-cli site_description: A complete library to interact with Cloud KMS (protocol v1beta1) diff --git a/gen/cloudkms1_beta1-cli/src/main.rs b/gen/cloudkms1_beta1-cli/src/main.rs index 26cca4059b..108fad787e 100644 --- a/gen/cloudkms1_beta1-cli/src/main.rs +++ b/gen/cloudkms1_beta1-cli/src/main.rs @@ -2693,7 +2693,7 @@ fn main() { let mut app = App::new("cloudkms1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20170515") + .version("1.0.13+20170515") .about("Manages encryption for your cloud services the same way you do on-premise. You can generate, use, rotate, and destroy AES256 encryption keys.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudkms1_beta1/Cargo.toml b/gen/cloudkms1_beta1/Cargo.toml index 4b05e2f7c6..869c9b960f 100644 --- a/gen/cloudkms1_beta1/Cargo.toml +++ b/gen/cloudkms1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudkms1_beta1" -version = "1.0.12+20170515" +version = "1.0.13+20170515" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud KMS (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1_beta1" homepage = "https://cloud.google.com/kms/" -documentation = "https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515" +documentation = "https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515" license = "MIT" keywords = ["cloudkms", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudkms1_beta1/README.md b/gen/cloudkms1_beta1/README.md index 010af7df86..2045e0d4e7 100644 --- a/gen/cloudkms1_beta1/README.md +++ b/gen/cloudkms1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudkms1_beta1` library allows access to all features of the *Google Cloud KMS* service. -This documentation was generated from *Cloud KMS* crate version *1.0.12+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud KMS* crate version *1.0.13+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud KMS* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/kms/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.CloudKMS.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.CloudKMS.html) ... * projects - * [*locations get*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationGetCall.html), [*locations key rings create*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions create*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions list*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings list*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.ProjectLocationListCall.html) + * [*locations get*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationGetCall.html), [*locations key rings create*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions create*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions list*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings list*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.ProjectLocationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/struct.CloudKMS.html)** +* **[Hub](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/struct.CloudKMS.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudkms1_beta1/1.0.12+20170515/google_cloudkms1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudkms1_beta1/1.0.13+20170515/google_cloudkms1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudkms1_beta1/src/lib.rs b/gen/cloudkms1_beta1/src/lib.rs index a0789737fb..2103d62934 100644 --- a/gen/cloudkms1_beta1/src/lib.rs +++ b/gen/cloudkms1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud KMS* crate version *1.0.12+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud KMS* crate version *1.0.13+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud KMS* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/kms/). @@ -335,7 +335,7 @@ impl<'a, C, A> CloudKMS CloudKMS { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudkms.googleapis.com/".to_string(), _root_url: "https://cloudkms.googleapis.com/".to_string(), } @@ -346,7 +346,7 @@ impl<'a, C, A> CloudKMS } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudlatencytest2-cli/Cargo.toml b/gen/cloudlatencytest2-cli/Cargo.toml index bd2f63b9ea..cd49a12f2f 100644 --- a/gen/cloudlatencytest2-cli/Cargo.toml +++ b/gen/cloudlatencytest2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudlatencytest2-cli" -version = "1.0.12+20160309" +version = "1.0.13+20160309" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudlatencytest (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2-cli" @@ -41,4 +41,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudlatencytest2] path = "../cloudlatencytest2" -version = "1.0.12+20160309" +version = "1.0.13+20160309" diff --git a/gen/cloudlatencytest2-cli/README.md b/gen/cloudlatencytest2-cli/README.md index 191df84809..b312430026 100644 --- a/gen/cloudlatencytest2-cli/README.md +++ b/gen/cloudlatencytest2-cli/README.md @@ -22,7 +22,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *cloudlatencytest* API at revision *20160309*. The CLI is at version *1.0.12*. +This documentation was generated from the *cloudlatencytest* API at revision *20160309*. The CLI is at version *1.0.13*. ```bash cloudlatencytest2 [options] diff --git a/gen/cloudlatencytest2-cli/mkdocs.yml b/gen/cloudlatencytest2-cli/mkdocs.yml index a7d006b9bc..4a7770d500 100644 --- a/gen/cloudlatencytest2-cli/mkdocs.yml +++ b/gen/cloudlatencytest2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: cloudlatencytest v1.0.12+20160309 +site_name: cloudlatencytest v1.0.13+20160309 site_url: http://byron.github.io/google-apis-rs/google-cloudlatencytest2-cli site_description: A complete library to interact with cloudlatencytest (protocol v2) diff --git a/gen/cloudlatencytest2-cli/src/main.rs b/gen/cloudlatencytest2-cli/src/main.rs index 5e8c651855..d03035767a 100644 --- a/gen/cloudlatencytest2-cli/src/main.rs +++ b/gen/cloudlatencytest2-cli/src/main.rs @@ -367,7 +367,7 @@ fn main() { let mut app = App::new("cloudlatencytest2") .author("Sebastian Thiel ") - .version("1.0.12+20160309") + .version("1.0.13+20160309") .about("Reports latency data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudlatencytest2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudlatencytest2/Cargo.toml b/gen/cloudlatencytest2/Cargo.toml index 4adea393f7..5f970f2d7f 100644 --- a/gen/cloudlatencytest2/Cargo.toml +++ b/gen/cloudlatencytest2/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-cloudlatencytest2" -version = "1.0.12+20160309" +version = "1.0.13+20160309" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudlatencytest (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2" -documentation = "https://docs.rs/google-cloudlatencytest2/1.0.12+20160309" +documentation = "https://docs.rs/google-cloudlatencytest2/1.0.13+20160309" license = "MIT" keywords = ["cloudlatencytest", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudlatencytest2/README.md b/gen/cloudlatencytest2/README.md index ca0f8327f1..52189894d3 100644 --- a/gen/cloudlatencytest2/README.md +++ b/gen/cloudlatencytest2/README.md @@ -5,13 +5,13 @@ DO NOT EDIT ! --> The `google-cloudlatencytest2` library allows access to all features of the *Google cloudlatencytest* service. -This documentation was generated from *cloudlatencytest* crate version *1.0.12+20160309*, where *20160309* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *cloudlatencytest* crate version *1.0.13+20160309*, where *20160309* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/struct.Cloudlatencytest.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/struct.Cloudlatencytest.html) ... * statscollection - * [*updateaggregatedstats*](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/struct.StatscollectionUpdateaggregatedstatCall.html) and [*updatestats*](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/struct.StatscollectionUpdatestatCall.html) + * [*updateaggregatedstats*](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/struct.StatscollectionUpdateaggregatedstatCall.html) and [*updatestats*](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/struct.StatscollectionUpdatestatCall.html) @@ -20,17 +20,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/struct.Cloudlatencytest.html)** +* **[Hub](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/struct.Cloudlatencytest.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -127,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -147,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudlatencytest2/1.0.12+20160309/google_cloudlatencytest2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudlatencytest2/1.0.13+20160309/google_cloudlatencytest2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudlatencytest2/src/lib.rs b/gen/cloudlatencytest2/src/lib.rs index a939c9c52f..d551f0f118 100644 --- a/gen/cloudlatencytest2/src/lib.rs +++ b/gen/cloudlatencytest2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *cloudlatencytest* crate version *1.0.12+20160309*, where *20160309* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *cloudlatencytest* crate version *1.0.13+20160309*, where *20160309* is the exact revision of the *cloudlatencytest:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudlatencytest2). //! # Features //! @@ -326,7 +326,7 @@ impl<'a, C, A> Cloudlatencytest Cloudlatencytest { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/".to_string(), _root_url: "https://cloudlatencytest-pa.googleapis.com/".to_string(), } @@ -337,7 +337,7 @@ impl<'a, C, A> Cloudlatencytest } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudmonitoring2_beta2-cli/Cargo.toml b/gen/cloudmonitoring2_beta2-cli/Cargo.toml index 45373145a8..1c78940a81 100644 --- a/gen/cloudmonitoring2_beta2-cli/Cargo.toml +++ b/gen/cloudmonitoring2_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudmonitoring2_beta2-cli" -version = "1.0.12+20170501" +version = "1.0.13+20170501" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudmonitoring2_beta2] path = "../cloudmonitoring2_beta2" -version = "1.0.12+20170501" +version = "1.0.13+20170501" diff --git a/gen/cloudmonitoring2_beta2-cli/README.md b/gen/cloudmonitoring2_beta2-cli/README.md index 0509375570..b414c8ffdf 100644 --- a/gen/cloudmonitoring2_beta2-cli/README.md +++ b/gen/cloudmonitoring2_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Monitoring* API at revision *20170501*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Monitoring* API at revision *20170501*. The CLI is at version *1.0.13*. ```bash cloudmonitoring2-beta2 [options] diff --git a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml index a89e953bd2..8df698ef13 100644 --- a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml +++ b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Monitoring v1.0.12+20170501 +site_name: Cloud Monitoring v1.0.13+20170501 site_url: http://byron.github.io/google-apis-rs/google-cloudmonitoring2_beta2-cli site_description: A complete library to interact with Cloud Monitoring (protocol v2beta2) diff --git a/gen/cloudmonitoring2_beta2-cli/src/main.rs b/gen/cloudmonitoring2_beta2-cli/src/main.rs index cee6e53864..da787a9e48 100644 --- a/gen/cloudmonitoring2_beta2-cli/src/main.rs +++ b/gen/cloudmonitoring2_beta2-cli/src/main.rs @@ -915,7 +915,7 @@ fn main() { let mut app = App::new("cloudmonitoring2-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20170501") + .version("1.0.13+20170501") .about("Accesses Google Cloud Monitoring data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudmonitoring2_beta2/Cargo.toml b/gen/cloudmonitoring2_beta2/Cargo.toml index 3043258104..8d900f722b 100644 --- a/gen/cloudmonitoring2_beta2/Cargo.toml +++ b/gen/cloudmonitoring2_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudmonitoring2_beta2" -version = "1.0.12+20170501" +version = "1.0.13+20170501" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2" homepage = "https://cloud.google.com/monitoring/v2beta2/" -documentation = "https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501" +documentation = "https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501" license = "MIT" keywords = ["cloudmonitoring", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudmonitoring2_beta2/README.md b/gen/cloudmonitoring2_beta2/README.md index cc5f011101..b85dbd8c61 100644 --- a/gen/cloudmonitoring2_beta2/README.md +++ b/gen/cloudmonitoring2_beta2/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-cloudmonitoring2_beta2` library allows access to all features of the *Google Cloud Monitoring* service. -This documentation was generated from *Cloud Monitoring* crate version *1.0.12+20170501*, where *20170501* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Monitoring* crate version *1.0.13+20170501*, where *20170501* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the [official documentation site](https://cloud.google.com/monitoring/v2beta2/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html) ... -* [metric descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptor.html) - * [*create*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorCreateCall.html), [*delete*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorDeleteCall.html) and [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorListCall.html) +* [metric descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptor.html) + * [*create*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorCreateCall.html), [*delete*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorDeleteCall.html) and [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorListCall.html) * timeseries - * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.TimeseryListCall.html) and [*write*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.TimeseryWriteCall.html) -* [timeseries descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptor.html) - * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptorListCall.html) + * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.TimeseryListCall.html) and [*write*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.TimeseryWriteCall.html) +* [timeseries descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptor.html) + * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptorListCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html)** +* **[Hub](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudmonitoring2_beta2/1.0.12+20170501/google_cloudmonitoring2_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudmonitoring2_beta2/1.0.13+20170501/google_cloudmonitoring2_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudmonitoring2_beta2/src/lib.rs b/gen/cloudmonitoring2_beta2/src/lib.rs index bad384f7cf..bb92313701 100644 --- a/gen/cloudmonitoring2_beta2/src/lib.rs +++ b/gen/cloudmonitoring2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Monitoring* crate version *1.0.12+20170501*, where *20170501* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Monitoring* crate version *1.0.13+20170501*, where *20170501* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/v2beta2/). @@ -345,7 +345,7 @@ impl<'a, C, A> CloudMonitoring CloudMonitoring { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -362,7 +362,7 @@ impl<'a, C, A> CloudMonitoring } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudprivatecatalog1_beta1-cli/Cargo.toml b/gen/cloudprivatecatalog1_beta1-cli/Cargo.toml index a7d9e1841e..b57aed91ad 100644 --- a/gen/cloudprivatecatalog1_beta1-cli/Cargo.toml +++ b/gen/cloudprivatecatalog1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudprivatecatalog1_beta1-cli" -version = "1.0.12+20190622" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Private Catalog (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudprivatecatalog1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudprivatecatalog1_beta1] path = "../cloudprivatecatalog1_beta1" -version = "1.0.12+20190622" +version = "1.0.13+20200405" diff --git a/gen/cloudprivatecatalog1_beta1-cli/README.md b/gen/cloudprivatecatalog1_beta1-cli/README.md index 625693612e..6cf8c56dcf 100644 --- a/gen/cloudprivatecatalog1_beta1-cli/README.md +++ b/gen/cloudprivatecatalog1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Private Catalog* API at revision *20190622*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Private Catalog* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash cloudprivatecatalog1-beta1 [options] diff --git a/gen/cloudprivatecatalog1_beta1-cli/mkdocs.yml b/gen/cloudprivatecatalog1_beta1-cli/mkdocs.yml index 39268a923d..b7999b5fa8 100644 --- a/gen/cloudprivatecatalog1_beta1-cli/mkdocs.yml +++ b/gen/cloudprivatecatalog1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Private Catalog v1.0.12+20190622 +site_name: Cloud Private Catalog v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-cloudprivatecatalog1_beta1-cli site_description: A complete library to interact with Cloud Private Catalog (protocol v1beta1) diff --git a/gen/cloudprivatecatalog1_beta1-cli/src/main.rs b/gen/cloudprivatecatalog1_beta1-cli/src/main.rs index e03678ab9a..696f83cafd 100644 --- a/gen/cloudprivatecatalog1_beta1-cli/src/main.rs +++ b/gen/cloudprivatecatalog1_beta1-cli/src/main.rs @@ -983,7 +983,7 @@ fn main() { let mut app = App::new("cloudprivatecatalog1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190622") + .version("1.0.13+20200405") .about("Enable cloud users to discover enterprise catalogs and products in their organizations.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudprivatecatalog1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudprivatecatalog1_beta1/Cargo.toml b/gen/cloudprivatecatalog1_beta1/Cargo.toml index 10ac848782..f0394a7dfe 100644 --- a/gen/cloudprivatecatalog1_beta1/Cargo.toml +++ b/gen/cloudprivatecatalog1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudprivatecatalog1_beta1" -version = "1.0.12+20190622" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Private Catalog (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudprivatecatalog1_beta1" homepage = "https://cloud.google.com/private-catalog/" -documentation = "https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622" +documentation = "https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405" license = "MIT" keywords = ["cloudprivatecatalog", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudprivatecatalog1_beta1/README.md b/gen/cloudprivatecatalog1_beta1/README.md index de44baec39..097acb9801 100644 --- a/gen/cloudprivatecatalog1_beta1/README.md +++ b/gen/cloudprivatecatalog1_beta1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-cloudprivatecatalog1_beta1` library allows access to all features of the *Google Cloud Private Catalog* service. -This documentation was generated from *Cloud Private Catalog* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudprivatecatalog:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Private Catalog* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *cloudprivatecatalog:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Private Catalog* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/private-catalog/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.CloudPrivateCatalog.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.CloudPrivateCatalog.html) ... * folders - * [*catalogs search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.FolderCatalogSearchCall.html), [*products search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.FolderProductSearchCall.html) and [*versions search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.FolderVersionSearchCall.html) + * [*catalogs search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.FolderCatalogSearchCall.html), [*products search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.FolderProductSearchCall.html) and [*versions search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.FolderVersionSearchCall.html) * organizations - * [*catalogs search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.OrganizationCatalogSearchCall.html), [*products search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.OrganizationProductSearchCall.html) and [*versions search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.OrganizationVersionSearchCall.html) + * [*catalogs search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.OrganizationCatalogSearchCall.html), [*products search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.OrganizationProductSearchCall.html) and [*versions search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.OrganizationVersionSearchCall.html) * projects - * [*catalogs search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.ProjectCatalogSearchCall.html), [*products search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.ProjectProductSearchCall.html) and [*versions search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.ProjectVersionSearchCall.html) + * [*catalogs search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.ProjectCatalogSearchCall.html), [*products search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.ProjectProductSearchCall.html) and [*versions search*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.ProjectVersionSearchCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/struct.CloudPrivateCatalog.html)** +* **[Hub](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/struct.CloudPrivateCatalog.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.12+20190622/google_cloudprivatecatalog1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudprivatecatalog1_beta1/1.0.13+20200405/google_cloudprivatecatalog1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudprivatecatalog1_beta1/src/lib.rs b/gen/cloudprivatecatalog1_beta1/src/lib.rs index a57ed22fc9..3fd034132b 100644 --- a/gen/cloudprivatecatalog1_beta1/src/lib.rs +++ b/gen/cloudprivatecatalog1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Private Catalog* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudprivatecatalog:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Private Catalog* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *cloudprivatecatalog:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Private Catalog* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/private-catalog/). @@ -329,7 +329,7 @@ impl<'a, C, A> CloudPrivateCatalog CloudPrivateCatalog { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudprivatecatalog.googleapis.com/".to_string(), _root_url: "https://cloudprivatecatalog.googleapis.com/".to_string(), } @@ -346,7 +346,7 @@ impl<'a, C, A> CloudPrivateCatalog } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudprivatecatalogproducer1_beta1-cli/Cargo.toml b/gen/cloudprivatecatalogproducer1_beta1-cli/Cargo.toml index 8b33b773ed..8e52cd2253 100644 --- a/gen/cloudprivatecatalogproducer1_beta1-cli/Cargo.toml +++ b/gen/cloudprivatecatalogproducer1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudprivatecatalogproducer1_beta1-cli" -version = "1.0.12+20190622" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud PrivateCatalog Producer (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudprivatecatalogproducer1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudprivatecatalogproducer1_beta1] path = "../cloudprivatecatalogproducer1_beta1" -version = "1.0.12+20190622" +version = "1.0.13+20200405" diff --git a/gen/cloudprivatecatalogproducer1_beta1-cli/README.md b/gen/cloudprivatecatalogproducer1_beta1-cli/README.md index 4bd7aa2fe0..9d5049c2d6 100644 --- a/gen/cloudprivatecatalogproducer1_beta1-cli/README.md +++ b/gen/cloudprivatecatalogproducer1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud PrivateCatalog Producer* API at revision *20190622*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud PrivateCatalog Producer* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash cloudprivatecatalogproducer1-beta1 [options] diff --git a/gen/cloudprivatecatalogproducer1_beta1-cli/mkdocs.yml b/gen/cloudprivatecatalogproducer1_beta1-cli/mkdocs.yml index 6966d625be..8e02db33e3 100644 --- a/gen/cloudprivatecatalogproducer1_beta1-cli/mkdocs.yml +++ b/gen/cloudprivatecatalogproducer1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud PrivateCatalog Producer v1.0.12+20190622 +site_name: Cloud PrivateCatalog Producer v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-cloudprivatecatalogproducer1_beta1-cli site_description: A complete library to interact with Cloud PrivateCatalog Producer (protocol v1beta1) diff --git a/gen/cloudprivatecatalogproducer1_beta1-cli/src/main.rs b/gen/cloudprivatecatalogproducer1_beta1-cli/src/main.rs index 8d7460bedc..74a51add17 100644 --- a/gen/cloudprivatecatalogproducer1_beta1-cli/src/main.rs +++ b/gen/cloudprivatecatalogproducer1_beta1-cli/src/main.rs @@ -500,6 +500,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -513,6 +516,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -3026,7 +3030,7 @@ fn main() { let mut app = App::new("cloudprivatecatalogproducer1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190622") + .version("1.0.13+20200405") .about("Enables cloud users to manage and share enterprise catalogs intheir organizations.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudprivatecatalogproducer1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudprivatecatalogproducer1_beta1/Cargo.toml b/gen/cloudprivatecatalogproducer1_beta1/Cargo.toml index d295645b6e..a5775d1a38 100644 --- a/gen/cloudprivatecatalogproducer1_beta1/Cargo.toml +++ b/gen/cloudprivatecatalogproducer1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudprivatecatalogproducer1_beta1" -version = "1.0.12+20190622" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud PrivateCatalog Producer (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudprivatecatalogproducer1_beta1" homepage = "https://cloud.google.com/private-catalog/" -documentation = "https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622" +documentation = "https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405" license = "MIT" keywords = ["cloudprivatecatalogp", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudprivatecatalogproducer1_beta1/README.md b/gen/cloudprivatecatalogproducer1_beta1/README.md index e7055ff4b8..0302b48419 100644 --- a/gen/cloudprivatecatalogproducer1_beta1/README.md +++ b/gen/cloudprivatecatalogproducer1_beta1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-cloudprivatecatalogproducer1_beta1` library allows access to all features of the *Google Cloud PrivateCatalog Producer* service. -This documentation was generated from *Cloud PrivateCatalog Producer* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudprivatecatalogproducer:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud PrivateCatalog Producer* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *cloudprivatecatalogproducer:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud PrivateCatalog Producer* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/private-catalog/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CloudPrivateCatalogProducer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CloudPrivateCatalogProducer.html) ... * catalogs - * [*associations create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationCreateCall.html), [*associations delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationDeleteCall.html), [*associations get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationGetCall.html), [*associations list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationListCall.html), [*create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogCreateCall.html), [*delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogDeleteCall.html), [*get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogGetCall.html), [*get iam policy*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogListCall.html), [*patch*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogPatchCall.html), [*products copy*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductCopyCall.html), [*products create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductCreateCall.html), [*products delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductDeleteCall.html), [*products get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductGetCall.html), [*products icons upload*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductIconUploadCall.html), [*products list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductListCall.html), [*products patch*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductPatchCall.html), [*products versions create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionCreateCall.html), [*products versions delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionDeleteCall.html), [*products versions get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionGetCall.html), [*products versions list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionListCall.html), [*products versions patch*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionPatchCall.html), [*set iam policy*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CatalogUndeleteCall.html) + * [*associations create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationCreateCall.html), [*associations delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationDeleteCall.html), [*associations get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationGetCall.html), [*associations list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogAssociationListCall.html), [*create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogCreateCall.html), [*delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogDeleteCall.html), [*get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogGetCall.html), [*get iam policy*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogListCall.html), [*patch*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogPatchCall.html), [*products copy*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductCopyCall.html), [*products create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductCreateCall.html), [*products delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductDeleteCall.html), [*products get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductGetCall.html), [*products icons upload*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductIconUploadCall.html), [*products list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductListCall.html), [*products patch*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductPatchCall.html), [*products versions create*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionCreateCall.html), [*products versions delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionDeleteCall.html), [*products versions get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionGetCall.html), [*products versions list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionListCall.html), [*products versions patch*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogProductVersionPatchCall.html), [*set iam policy*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CatalogUndeleteCall.html) * operations - * [*cancel*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.OperationListCall.html) + * [*cancel*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.OperationListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/struct.CloudPrivateCatalogProducer.html)** +* **[Hub](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/struct.CloudPrivateCatalogProducer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.12+20190622/google_cloudprivatecatalogproducer1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudprivatecatalogproducer1_beta1/1.0.13+20200405/google_cloudprivatecatalogproducer1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudprivatecatalogproducer1_beta1/src/lib.rs b/gen/cloudprivatecatalogproducer1_beta1/src/lib.rs index 3d55d37e17..7a0f275c60 100644 --- a/gen/cloudprivatecatalogproducer1_beta1/src/lib.rs +++ b/gen/cloudprivatecatalogproducer1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud PrivateCatalog Producer* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudprivatecatalogproducer:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud PrivateCatalog Producer* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *cloudprivatecatalogproducer:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud PrivateCatalog Producer* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/private-catalog/). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudPrivateCatalogProducer CloudPrivateCatalogProducer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudprivatecatalogproducer.googleapis.com/".to_string(), _root_url: "https://cloudprivatecatalogproducer.googleapis.com/".to_string(), } @@ -350,7 +350,7 @@ impl<'a, C, A> CloudPrivateCatalogProducer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -425,7 +425,7 @@ pub struct GoogleIamV1Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -434,6 +434,26 @@ pub struct GoogleIamV1Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -475,37 +495,50 @@ pub struct GoogleCloudPrivatecatalogproducerV1beta1UndeleteCatalogRequest { _nev impl RequestValue for GoogleCloudPrivatecatalogproducerV1beta1UndeleteCatalogRequest {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -513,15 +546,21 @@ impl RequestValue for GoogleCloudPrivatecatalogproducerV1beta1UndeleteCatalogReq /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -543,13 +582,36 @@ pub struct GoogleIamV1Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -1095,30 +1157,59 @@ impl RequestValue for GoogleCloudPrivatecatalogproducerV1beta1Product {} impl ResponseResult for GoogleCloudPrivatecatalogproducerV1beta1Product {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleTypeExpr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1257,7 +1348,7 @@ impl Part for GoogleRpcStatus {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1269,7 +1360,7 @@ impl Part for GoogleRpcStatus {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1277,7 +1368,7 @@ impl Part for GoogleRpcStatus {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1286,9 +1377,9 @@ impl Part for GoogleRpcStatus {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1314,7 +1405,7 @@ impl Part for GoogleIamV1AuditConfig {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1325,7 +1416,7 @@ impl Part for GoogleIamV1AuditConfig {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1842,6 +1933,7 @@ impl<'a, C, A> CatalogMethods<'a, C, A> { CatalogGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -7378,6 +7470,7 @@ impl<'a, C, A> CatalogCreateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.catalogs().get_iam_policy("resource") +/// .options_requested_policy_version(-95) /// .doit(); /// # } /// ``` @@ -7386,6 +7479,7 @@ pub struct CatalogGetIamPolicyCall<'a, C, A> hub: &'a CloudPrivateCatalogProducer, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7408,9 +7502,12 @@ impl<'a, C, A> CatalogGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7536,6 +7633,20 @@ impl<'a, C, A> CatalogGetIamPolicyCall<'a, C, A> where C: BorrowMut CatalogGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -8470,7 +8581,7 @@ impl<'a, C, A> CatalogAssociationCreateCall<'a, C, A> where C: BorrowMut CatalogProductPatchCall<'a, C, A> where C: BorrowMut CatalogListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.catalogs().delete("name") -/// .force(true) +/// .force(false) /// .doit(); /// # } /// ``` diff --git a/gen/cloudprofiler2-cli/Cargo.toml b/gen/cloudprofiler2-cli/Cargo.toml index 9887f824cc..0964b27db2 100644 --- a/gen/cloudprofiler2-cli/Cargo.toml +++ b/gen/cloudprofiler2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudprofiler2-cli" -version = "1.0.12+20190629" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Profiler (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudprofiler2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudprofiler2] path = "../cloudprofiler2" -version = "1.0.12+20190629" +version = "1.0.13+20200405" diff --git a/gen/cloudprofiler2-cli/README.md b/gen/cloudprofiler2-cli/README.md index 67a2e53402..87ea143cdd 100644 --- a/gen/cloudprofiler2-cli/README.md +++ b/gen/cloudprofiler2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Profiler* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Profiler* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash cloudprofiler2 [options] diff --git a/gen/cloudprofiler2-cli/mkdocs.yml b/gen/cloudprofiler2-cli/mkdocs.yml index 0db4740353..020b87ed87 100644 --- a/gen/cloudprofiler2-cli/mkdocs.yml +++ b/gen/cloudprofiler2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Profiler v1.0.12+20190629 +site_name: Cloud Profiler v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-cloudprofiler2-cli site_description: A complete library to interact with Cloud Profiler (protocol v2) diff --git a/gen/cloudprofiler2-cli/src/main.rs b/gen/cloudprofiler2-cli/src/main.rs index 3fef9b0962..551959322e 100644 --- a/gen/cloudprofiler2-cli/src/main.rs +++ b/gen/cloudprofiler2-cli/src/main.rs @@ -537,7 +537,7 @@ fn main() { let mut app = App::new("cloudprofiler2") .author("Sebastian Thiel ") - .version("1.0.12+20190629") + .version("1.0.13+20200405") .about("Manages continuous profiling information.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudprofiler2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudprofiler2/Cargo.toml b/gen/cloudprofiler2/Cargo.toml index dacee6e2db..09747f2745 100644 --- a/gen/cloudprofiler2/Cargo.toml +++ b/gen/cloudprofiler2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudprofiler2" -version = "1.0.12+20190629" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Profiler (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudprofiler2" homepage = "https://cloud.google.com/profiler/" -documentation = "https://docs.rs/google-cloudprofiler2/1.0.12+20190629" +documentation = "https://docs.rs/google-cloudprofiler2/1.0.13+20200405" license = "MIT" keywords = ["cloudprofiler", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudprofiler2/README.md b/gen/cloudprofiler2/README.md index ec141427d4..08eb1b5744 100644 --- a/gen/cloudprofiler2/README.md +++ b/gen/cloudprofiler2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudprofiler2` library allows access to all features of the *Google Cloud Profiler* service. -This documentation was generated from *Cloud Profiler* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *cloudprofiler:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Profiler* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *cloudprofiler:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Profiler* *v2* API can be found at the [official documentation site](https://cloud.google.com/profiler/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/struct.CloudProfiler.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/struct.CloudProfiler.html) ... * projects - * [*profiles create*](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/struct.ProjectProfileCreateCall.html), [*profiles create offline*](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/struct.ProjectProfileCreateOfflineCall.html) and [*profiles patch*](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/struct.ProjectProfilePatchCall.html) + * [*profiles create*](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/struct.ProjectProfileCreateCall.html), [*profiles create offline*](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/struct.ProjectProfileCreateOfflineCall.html) and [*profiles patch*](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/struct.ProjectProfilePatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/struct.CloudProfiler.html)** +* **[Hub](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/struct.CloudProfiler.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudprofiler2/1.0.12+20190629/google_cloudprofiler2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudprofiler2/1.0.13+20200405/google_cloudprofiler2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudprofiler2/src/lib.rs b/gen/cloudprofiler2/src/lib.rs index 6cfd19c798..bbb45f3ab9 100644 --- a/gen/cloudprofiler2/src/lib.rs +++ b/gen/cloudprofiler2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Profiler* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *cloudprofiler:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Profiler* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *cloudprofiler:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Profiler* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/profiler/). @@ -341,7 +341,7 @@ impl<'a, C, A> CloudProfiler CloudProfiler { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudprofiler.googleapis.com/".to_string(), _root_url: "https://cloudprofiler.googleapis.com/".to_string(), } @@ -352,7 +352,7 @@ impl<'a, C, A> CloudProfiler } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudresourcemanager1-cli/Cargo.toml b/gen/cloudresourcemanager1-cli/Cargo.toml index 9668865a9d..b6758bce55 100644 --- a/gen/cloudresourcemanager1-cli/Cargo.toml +++ b/gen/cloudresourcemanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudresourcemanager1-cli" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudresourcemanager1] path = "../cloudresourcemanager1" -version = "1.0.12+20190701" +version = "1.0.13+20200408" diff --git a/gen/cloudresourcemanager1-cli/README.md b/gen/cloudresourcemanager1-cli/README.md index 5a1bd76837..e9c6a1ba5f 100644 --- a/gen/cloudresourcemanager1-cli/README.md +++ b/gen/cloudresourcemanager1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Resource Manager* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash cloudresourcemanager1 [options] diff --git a/gen/cloudresourcemanager1-cli/mkdocs.yml b/gen/cloudresourcemanager1-cli/mkdocs.yml index 9636d11173..211a11de35 100644 --- a/gen/cloudresourcemanager1-cli/mkdocs.yml +++ b/gen/cloudresourcemanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Resource Manager v1.0.12+20190701 +site_name: Cloud Resource Manager v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-cloudresourcemanager1-cli site_description: A complete library to interact with Cloud Resource Manager (protocol v1) diff --git a/gen/cloudresourcemanager1-cli/src/main.rs b/gen/cloudresourcemanager1-cli/src/main.rs index 3f2ac0a319..5e347cdf17 100644 --- a/gen/cloudresourcemanager1-cli/src/main.rs +++ b/gen/cloudresourcemanager1-cli/src/main.rs @@ -3558,7 +3558,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name/identifier of the Lien to delete."##), + Some(r##"Required. The name/identifier of the Lien to delete."##), Some(true), Some(false)), @@ -3585,7 +3585,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name/identifier of the Lien."##), + Some(r##"Required. The name/identifier of the Lien."##), Some(true), Some(false)), @@ -4018,13 +4018,10 @@ fn main() { ]), ("create", Some(r##"Request that a new Project be created. The result is an Operation which - can be used to track the creation process. It is automatically deleted - after a few hours, so there is no need to call DeleteOperation. - - Our SLO permits Project creation to take up to 30 seconds at the 90th - percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile - latency. 95th percentile latency is around 11 seconds. We recommend - polling at the 5th second with an exponential backoff. + can be used to track the creation process. This process usually takes a few + seconds, but can sometimes take much longer. The tracking Operation is + automatically deleted after a few hours, so there is no need to call + DeleteOperation. Authorization requires the Google IAM permission `resourcemanager.projects.create` on the specified parent for the new @@ -4356,7 +4353,11 @@ fn main() { + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. - + The owner role can be granted only to `user` and `serviceAccount`. + + The owner role can be granted to a `user`, `serviceAccount`, or a group + that is part of an organization. For example, + group@myownpersonaldomain.com could be added as an owner to a project in + the myownpersonaldomain.com organization, but not the examplepetstore.com + organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be @@ -4558,7 +4559,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200408") .about("Creates, reads, and updates metadata for Google Cloud Platform resource containers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudresourcemanager1/Cargo.toml b/gen/cloudresourcemanager1/Cargo.toml index 08e8a1fb5d..d4375d8a53 100644 --- a/gen/cloudresourcemanager1/Cargo.toml +++ b/gen/cloudresourcemanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudresourcemanager1" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1" homepage = "https://cloud.google.com/resource-manager" -documentation = "https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701" +documentation = "https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudresourcemanager1/README.md b/gen/cloudresourcemanager1/README.md index 5c44de26ba..0f488d1132 100644 --- a/gen/cloudresourcemanager1/README.md +++ b/gen/cloudresourcemanager1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-cloudresourcemanager1` library allows access to all features of the *Google Cloud Resource Manager* service. -This documentation was generated from *Cloud Resource Manager* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Resource Manager* *v1* API can be found at the [official documentation site](https://cloud.google.com/resource-manager). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... * folders - * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.FolderClearOrgPolicyCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.FolderGetEffectiveOrgPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.FolderGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.FolderListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.FolderListOrgPolicyCall.html) and [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.FolderSetOrgPolicyCall.html) -* [liens](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.Lien.html) - * [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.LienCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.LienDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.LienGetCall.html) and [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.LienListCall.html) -* [operations](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.Operation.html) - * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OperationGetCall.html) -* [organizations](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.Organization.html) - * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationClearOrgPolicyCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationGetCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationListOrgPolicyCall.html), [*search*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationSetOrgPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.OrganizationTestIamPermissionCall.html) -* [projects](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.Project.html) - * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectClearOrgPolicyCall.html), [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectGetAncestryCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectGetOrgPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectListCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectListOrgPolicyCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectSetOrgPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.ProjectUpdateCall.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.FolderClearOrgPolicyCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.FolderGetEffectiveOrgPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.FolderGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.FolderListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.FolderListOrgPolicyCall.html) and [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.FolderSetOrgPolicyCall.html) +* [liens](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.Lien.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.LienCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.LienDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.LienGetCall.html) and [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.LienListCall.html) +* [operations](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OperationGetCall.html) +* [organizations](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.Organization.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationClearOrgPolicyCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationGetCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationListOrgPolicyCall.html), [*search*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationSetOrgPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.OrganizationTestIamPermissionCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.Project.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectClearOrgPolicyCall.html), [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectGetAncestryCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectGetOrgPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectListCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectListOrgPolicyCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectSetOrgPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.ProjectUpdateCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/struct.CloudResourceManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -150,17 +150,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -170,29 +170,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudresourcemanager1/1.0.12+20190701/google_cloudresourcemanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1/1.0.13+20200408/google_cloudresourcemanager1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudresourcemanager1/src/lib.rs b/gen/cloudresourcemanager1/src/lib.rs index a8c67e6bfe..9c501642d9 100644 --- a/gen/cloudresourcemanager1/src/lib.rs +++ b/gen/cloudresourcemanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Resource Manager* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). @@ -350,7 +350,7 @@ impl<'a, C, A> CloudResourceManager CloudResourceManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudresourcemanager.googleapis.com/".to_string(), _root_url: "https://cloudresourcemanager.googleapis.com/".to_string(), } @@ -373,7 +373,7 @@ impl<'a, C, A> CloudResourceManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -530,37 +530,50 @@ pub struct RestoreDefault { _never_set: Option } impl Part for RestoreDefault {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -568,15 +581,21 @@ impl Part for RestoreDefault {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -600,13 +619,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -760,7 +802,7 @@ impl ResponseResult for ListAvailableOrgPolicyConstraintsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ResourceId { /// Required field representing the resource type this id is for. - /// At present, the valid types are: "organization" and "folder". + /// At present, the valid types are: "organization", "folder", and "project". #[serde(rename="type")] pub type_: Option, /// Required field for the type-specific id. This should correspond to the id @@ -783,9 +825,9 @@ impl Part for ResourceId {} /// if the value contains a ":". Values prefixed with "is:" are treated the /// same as values with no prefix. /// Ancestry subtrees must be in one of the following formats: -/// - “projects/”, e.g. “projects/tokyo-rain-123” -/// - “folders/”, e.g. “folders/1234” -/// - “organizations/”, e.g. “organizations/1234” +/// - "projects/", e.g. "projects/tokyo-rain-123" +/// - "folders/", e.g. "folders/1234" +/// - "organizations/", e.g. "organizations/1234" /// The `supports_under` field of the associated `Constraint` defines whether /// ancestry prefixes can be used. You can set `allowed_values` and /// `denied_values` in the same `Policy` if `all_values` is @@ -832,7 +874,7 @@ pub struct ListPolicy { /// /// Example 1 (no inherited values): /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values:”E2”} + /// {allowed_values: "E1" allowed_values:"E2"} /// `projects/bar` has `inherit_from_parent` `false` and values: /// {allowed_values: "E3" allowed_values: "E4"} /// The accepted values at `organizations/foo` are `E1`, `E2`. @@ -840,9 +882,9 @@ pub struct ListPolicy { /// /// Example 2 (inherited values): /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values:”E2”} + /// {allowed_values: "E1" allowed_values:"E2"} /// `projects/bar` has a `Policy` with values: - /// {value: “E3” value: ”E4” inherit_from_parent: true} + /// {value: "E3" value: "E4" inherit_from_parent: true} /// The accepted values at `organizations/foo` are `E1`, `E2`. /// The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. /// @@ -856,7 +898,7 @@ pub struct ListPolicy { /// /// Example 4 (RestoreDefault): /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values:”E2”} + /// {allowed_values: "E1" allowed_values:"E2"} /// `projects/bar` has a `Policy` with values: /// {RestoreDefault: {}} /// The accepted values at `organizations/foo` are `E1`, `E2`. @@ -873,14 +915,14 @@ pub struct ListPolicy { /// /// Example 6 (ListConstraint allowing all): /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values: ”E2”} + /// {allowed_values: "E1" allowed_values: "E2"} /// `projects/bar` has a `Policy` with: /// {all: ALLOW} /// The accepted values at `organizations/foo` are `E1`, E2`. Any value is accepted at `projects/bar`. /// /// Example 7 (ListConstraint allowing none): /// `organizations/foo` has a `Policy` with values: - /// {allowed_values: “E1” allowed_values: ”E2”} + /// {allowed_values: "E1" allowed_values: "E2"} /// `projects/bar` has a `Policy` with: /// {all: DENY} /// The accepted values at `organizations/foo` are `E1`, E2`. No value is accepted at `projects/bar`. @@ -973,30 +1015,59 @@ pub struct BooleanPolicy { impl Part for BooleanPolicy {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1034,7 +1105,7 @@ impl RequestValue for SetOrgPolicyRequest {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1045,7 +1116,7 @@ impl RequestValue for SetOrgPolicyRequest {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1348,21 +1419,18 @@ pub struct Organization { /// This field is required. pub owner: Option, /// Timestamp when the Organization was created. Assigned by the server. - /// @OutputOnly #[serde(rename="creationTime")] pub creation_time: Option, /// A human-readable string that refers to the Organization in the /// GCP Console UI. This string is set by the server and cannot be /// changed. The string will be set to the primary domain (for example, /// "google.com") of the G Suite customer that owns the organization. - /// @OutputOnly #[serde(rename="displayName")] pub display_name: Option, /// The organization's current lifecycle state. Assigned by the server. - /// @OutputOnly #[serde(rename="lifecycleState")] pub lifecycle_state: Option, - /// Output Only. The resource name of the organization. This is the + /// Output only. The resource name of the organization. This is the /// organization's relative path in the API. Its format is /// "organizations/[organization_id]". For example, "organizations/1234". pub name: Option, @@ -1508,9 +1576,13 @@ impl RequestValue for ListOrgPoliciesRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetPolicyOptions { /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. #[serde(rename="requestedPolicyVersion")] pub requested_policy_version: Option, } @@ -1564,7 +1636,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1573,6 +1645,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1605,7 +1697,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1617,7 +1709,7 @@ impl Part for Binding {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1625,7 +1717,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1634,9 +1726,9 @@ impl Part for Binding {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2394,7 +2486,7 @@ impl<'a, C, A> LienMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name/identifier of the Lien. + /// * `name` - Required. The name/identifier of the Lien. pub fn get(&self, name: &str) -> LienGetCall<'a, C, A> { LienGetCall { hub: self.hub, @@ -2415,7 +2507,7 @@ impl<'a, C, A> LienMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name/identifier of the Lien to delete. + /// * `name` - Required. The name/identifier of the Lien to delete. pub fn delete(&self, name: &str) -> LienDeleteCall<'a, C, A> { LienDeleteCall { hub: self.hub, @@ -2555,13 +2647,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Request that a new Project be created. The result is an Operation which - /// can be used to track the creation process. It is automatically deleted - /// after a few hours, so there is no need to call DeleteOperation. - /// - /// Our SLO permits Project creation to take up to 30 seconds at the 90th - /// percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile - /// latency. 95th percentile latency is around 11 seconds. We recommend - /// polling at the 5th second with an exponential backoff. + /// can be used to track the creation process. This process usually takes a few + /// seconds, but can sometimes take much longer. The tracking Operation is + /// automatically deleted after a few hours, so there is no need to call + /// DeleteOperation. /// /// Authorization requires the Google IAM permission /// `resourcemanager.projects.create` on the specified parent for the new @@ -2799,7 +2888,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// + Project does not support `allUsers` and `allAuthenticatedUsers` as /// `members` in a `Binding` of a `Policy`. /// - /// + The owner role can be granted only to `user` and `serviceAccount`. + /// + The owner role can be granted to a `user`, `serviceAccount`, or a group + /// that is part of an organization. For example, + /// group@myownpersonaldomain.com could be added as an owner to a project in + /// the myownpersonaldomain.com organization, but not the examplepetstore.com + /// organization. /// /// + Service accounts can be made owners of a project directly /// without any restrictions. However, to be added as an owner, a user must be @@ -8146,7 +8239,7 @@ impl<'a, C, A> LienGetCall<'a, C, A> where C: BorrowMut, A: oauth } - /// The name/identifier of the Lien. + /// Required. The name/identifier of the Lien. /// /// Sets the *name* path property to the given value. /// @@ -8398,7 +8491,7 @@ impl<'a, C, A> LienDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - /// The name/identifier of the Lien to delete. + /// Required. The name/identifier of the Lien to delete. /// /// Sets the *name* path property to the given value. /// @@ -8638,8 +8731,12 @@ impl<'a, C, A> LienListCall<'a, C, A> where C: BorrowMut, A: oaut } - /// The name of the resource to list all attached Liens. + /// Required. The name of the resource to list all attached Liens. /// For example, `projects/1234`. + /// + /// (google.api.field_policy).resource_type annotation is not set since the + /// parent depends on the meta api implementation. This field could be a + /// project or other sub project resources. /// /// Sets the *parent* query property to the given value. pub fn parent(mut self, new_value: &str) -> LienListCall<'a, C, A> { @@ -9273,13 +9370,10 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// + Project does not support `allUsers` and `allAuthenticatedUsers` as /// `members` in a `Binding` of a `Policy`. /// -/// + The owner role can be granted only to `user` and `serviceAccount`. +/// + The owner role can be granted to a `user`, `serviceAccount`, or a group +/// that is part of an organization. For example, +/// group@myownpersonaldomain.com could be added as an owner to a project in +/// the myownpersonaldomain.com organization, but not the examplepetstore.com +/// organization. /// /// + Service accounts can be made owners of a project directly /// without any restrictions. However, to be added as an owner, a user must be diff --git a/gen/cloudresourcemanager1_beta1-cli/Cargo.toml b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml index eaf6945617..d57acb062a 100644 --- a/gen/cloudresourcemanager1_beta1-cli/Cargo.toml +++ b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudresourcemanager1_beta1-cli" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudresourcemanager1_beta1] path = "../cloudresourcemanager1_beta1" -version = "1.0.12+20190701" +version = "1.0.13+20200408" diff --git a/gen/cloudresourcemanager1_beta1-cli/README.md b/gen/cloudresourcemanager1_beta1-cli/README.md index fe8778d806..107916dd00 100644 --- a/gen/cloudresourcemanager1_beta1-cli/README.md +++ b/gen/cloudresourcemanager1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Resource Manager* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash cloudresourcemanager1-beta1 [options] diff --git a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml index 8e2b40de0e..01f315f6ef 100644 --- a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml +++ b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Resource Manager v1.0.12+20190701 +site_name: Cloud Resource Manager v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-cloudresourcemanager1_beta1-cli site_description: A complete library to interact with Cloud Resource Manager (protocol v1beta1) diff --git a/gen/cloudresourcemanager1_beta1-cli/src/main.rs b/gen/cloudresourcemanager1_beta1-cli/src/main.rs index 736f7b2eed..9dae0c45cb 100644 --- a/gen/cloudresourcemanager1_beta1-cli/src/main.rs +++ b/gen/cloudresourcemanager1_beta1-cli/src/main.rs @@ -1586,7 +1586,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Output Only. The resource name of the organization. This is the + Some(r##"Output only. The resource name of the organization. This is the organization's relative path in the API. Its format is "organizations/[organization_id]". For example, "organizations/1234"."##), Some(true), @@ -1827,7 +1827,11 @@ fn main() { + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. - + The owner role can be granted only to `user` and `serviceAccount`. + + The owner role can be granted to a `user`, `serviceAccount`, or a group + that is part of an organization. For example, + group@myownpersonaldomain.com could be added as an owner to a project in + the myownpersonaldomain.com organization, but not the examplepetstore.com + organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be @@ -1989,7 +1993,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200408") .about("Creates, reads, and updates metadata for Google Cloud Platform resource containers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudresourcemanager1_beta1/Cargo.toml b/gen/cloudresourcemanager1_beta1/Cargo.toml index ac9b746952..5017dc679b 100644 --- a/gen/cloudresourcemanager1_beta1/Cargo.toml +++ b/gen/cloudresourcemanager1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudresourcemanager1_beta1" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager1_beta1" homepage = "https://cloud.google.com/resource-manager" -documentation = "https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701" +documentation = "https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudresourcemanager1_beta1/README.md b/gen/cloudresourcemanager1_beta1/README.md index 9ffdbaa7fd..e99ef935f1 100644 --- a/gen/cloudresourcemanager1_beta1/README.md +++ b/gen/cloudresourcemanager1_beta1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-cloudresourcemanager1_beta1` library allows access to all features of the *Google Cloud Resource Manager* service. -This documentation was generated from *Cloud Resource Manager* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Resource Manager* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/resource-manager). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html) ... -* [organizations](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.Organization.html) - * [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.OrganizationGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.OrganizationListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.OrganizationSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.OrganizationTestIamPermissionCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.OrganizationUpdateCall.html) -* [projects](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.Project.html) - * [*create*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.ProjectUpdateCall.html) +* [organizations](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.Organization.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.OrganizationGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.OrganizationListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.OrganizationSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.OrganizationTestIamPermissionCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.OrganizationUpdateCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.Project.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.ProjectUpdateCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.12+20190701/google_cloudresourcemanager1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.13+20200408/google_cloudresourcemanager1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudresourcemanager1_beta1/src/lib.rs b/gen/cloudresourcemanager1_beta1/src/lib.rs index 3b57a1e9a8..6044f2a6f6 100644 --- a/gen/cloudresourcemanager1_beta1/src/lib.rs +++ b/gen/cloudresourcemanager1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Resource Manager* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). @@ -338,7 +338,7 @@ impl<'a, C, A> CloudResourceManager CloudResourceManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudresourcemanager.googleapis.com/".to_string(), _root_url: "https://cloudresourcemanager.googleapis.com/".to_string(), } @@ -352,7 +352,7 @@ impl<'a, C, A> CloudResourceManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -389,7 +389,7 @@ impl<'a, C, A> CloudResourceManager /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -400,7 +400,7 @@ impl<'a, C, A> CloudResourceManager /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -489,30 +489,59 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -563,37 +592,50 @@ pub struct GetAncestryRequest { _never_set: Option } impl RequestValue for GetAncestryRequest {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -601,15 +643,21 @@ impl RequestValue for GetAncestryRequest {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -633,13 +681,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -671,10 +742,9 @@ pub struct Organization { /// GCP Console UI. This string is set by the server and cannot be /// changed. The string will be set to the primary domain (for example, /// "google.com") of the G Suite customer that owns the organization. - /// @OutputOnly #[serde(rename="displayName")] pub display_name: Option, - /// Output Only. The resource name of the organization. This is the + /// Output only. The resource name of the organization. This is the /// organization's relative path in the API. Its format is /// "organizations/[organization_id]". For example, "organizations/1234". pub name: Option, @@ -684,11 +754,9 @@ pub struct Organization { #[serde(rename="organizationId")] pub organization_id: Option, /// Timestamp when the Organization was created. Assigned by the server. - /// @OutputOnly #[serde(rename="creationTime")] pub creation_time: Option, /// The organization's current lifecycle state. Assigned by the server. - /// @OutputOnly #[serde(rename="lifecycleState")] pub lifecycle_state: Option, } @@ -906,9 +974,13 @@ impl ResponseResult for ListProjectsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetPolicyOptions { /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. #[serde(rename="requestedPolicyVersion")] pub requested_policy_version: Option, } @@ -961,7 +1033,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -970,6 +1042,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1002,7 +1094,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1014,7 +1106,7 @@ impl Part for Binding {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1022,7 +1114,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1031,9 +1123,9 @@ impl Part for Binding {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1224,7 +1316,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Output Only. The resource name of the organization. This is the + /// * `name` - Output only. The resource name of the organization. This is the /// organization's relative path in the API. Its format is /// "organizations/[organization_id]". For example, "organizations/1234". pub fn update(&self, request: Organization, name: &str) -> OrganizationUpdateCall<'a, C, A> { @@ -1385,7 +1477,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// + Project does not support `allUsers` and `allAuthenticatedUsers` as /// `members` in a `Binding` of a `Policy`. /// - /// + The owner role can be granted only to `user` and `serviceAccount`. + /// + The owner role can be granted to a `user`, `serviceAccount`, or a group + /// that is part of an organization. For example, + /// group@myownpersonaldomain.com could be added as an owner to a project in + /// the myownpersonaldomain.com organization, but not the examplepetstore.com + /// organization. /// /// + Service accounts can be made owners of a project directly /// without any restrictions. However, to be added as an owner, a user must be @@ -2917,7 +3013,7 @@ impl<'a, C, A> OrganizationUpdateCall<'a, C, A> where C: BorrowMut ProjectCreateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// A safety hatch to opt out of the new reliable project creation process. + /// A now unused experiment opt-out option. /// /// Sets the *use legacy stack* query property to the given value. pub fn use_legacy_stack(mut self, new_value: bool) -> ProjectCreateCall<'a, C, A> { @@ -4091,7 +4187,11 @@ impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: /// + Project does not support `allUsers` and `allAuthenticatedUsers` as /// `members` in a `Binding` of a `Policy`. /// -/// + The owner role can be granted only to `user` and `serviceAccount`. +/// + The owner role can be granted to a `user`, `serviceAccount`, or a group +/// that is part of an organization. For example, +/// group@myownpersonaldomain.com could be added as an owner to a project in +/// the myownpersonaldomain.com organization, but not the examplepetstore.com +/// organization. /// /// + Service accounts can be made owners of a project directly /// without any restrictions. However, to be added as an owner, a user must be diff --git a/gen/cloudresourcemanager2-cli/Cargo.toml b/gen/cloudresourcemanager2-cli/Cargo.toml index 6f1811cd01..f59de95c28 100644 --- a/gen/cloudresourcemanager2-cli/Cargo.toml +++ b/gen/cloudresourcemanager2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudresourcemanager2-cli" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudresourcemanager2] path = "../cloudresourcemanager2" -version = "1.0.12+20190701" +version = "1.0.13+20200408" diff --git a/gen/cloudresourcemanager2-cli/README.md b/gen/cloudresourcemanager2-cli/README.md index b87de64c5c..6c4fb13753 100644 --- a/gen/cloudresourcemanager2-cli/README.md +++ b/gen/cloudresourcemanager2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Resource Manager* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash cloudresourcemanager2 [options] diff --git a/gen/cloudresourcemanager2-cli/mkdocs.yml b/gen/cloudresourcemanager2-cli/mkdocs.yml index f7c7c11211..4ac63cd3bf 100644 --- a/gen/cloudresourcemanager2-cli/mkdocs.yml +++ b/gen/cloudresourcemanager2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Resource Manager v1.0.12+20190701 +site_name: Cloud Resource Manager v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-cloudresourcemanager2-cli site_description: A complete library to interact with Cloud Resource Manager (protocol v2) diff --git a/gen/cloudresourcemanager2-cli/src/main.rs b/gen/cloudresourcemanager2-cli/src/main.rs index 8f73e5a2a9..b9085f6db2 100644 --- a/gen/cloudresourcemanager2-cli/src/main.rs +++ b/gen/cloudresourcemanager2-cli/src/main.rs @@ -1171,7 +1171,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"the resource name of the Folder to be deleted. + Some(r##"Required. the resource name of the Folder to be deleted. Must be of the form `folders/{folder_id}`."##), Some(true), Some(false)), @@ -1198,7 +1198,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the Folder to retrieve. + Some(r##"Required. The resource name of the Folder to retrieve. Must be of the form `folders/{folder_id}`."##), Some(true), Some(false)), @@ -1292,7 +1292,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the Folder to move. + Some(r##"Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}"##), Some(true), Some(false)), @@ -1466,7 +1466,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the Folder to undelete. + Some(r##"Required. The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`."##), Some(true), Some(false)), @@ -1522,7 +1522,7 @@ fn main() { let mut app = App::new("cloudresourcemanager2") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200408") .about("Creates, reads, and updates metadata for Google Cloud Platform resource containers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudresourcemanager2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudresourcemanager2/Cargo.toml b/gen/cloudresourcemanager2/Cargo.toml index b7406090d7..df1fec9d82 100644 --- a/gen/cloudresourcemanager2/Cargo.toml +++ b/gen/cloudresourcemanager2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudresourcemanager2" -version = "1.0.12+20190701" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Resource Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudresourcemanager2" homepage = "https://cloud.google.com/resource-manager" -documentation = "https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701" +documentation = "https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudresourcemanager2/README.md b/gen/cloudresourcemanager2/README.md index 6f54e5abb6..d75eadf00c 100644 --- a/gen/cloudresourcemanager2/README.md +++ b/gen/cloudresourcemanager2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-cloudresourcemanager2` library allows access to all features of the *Google Cloud Resource Manager* service. -This documentation was generated from *Cloud Resource Manager* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudresourcemanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *cloudresourcemanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Resource Manager* *v2* API can be found at the [official documentation site](https://cloud.google.com/resource-manager). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.CloudResourceManager.html) ... -* [folders](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.Folder.html) - * [*create*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderListCall.html), [*move*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderMoveCall.html), [*patch*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderPatchCall.html), [*search*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.FolderUndeleteCall.html) -* [operations](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.Operation.html) - * [*get*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.OperationGetCall.html) +* [folders](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.Folder.html) + * [*create*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderListCall.html), [*move*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderMoveCall.html), [*patch*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderPatchCall.html), [*search*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.FolderUndeleteCall.html) +* [operations](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.OperationGetCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/struct.CloudResourceManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -140,17 +140,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -160,29 +160,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudresourcemanager2/1.0.12+20190701/google_cloudresourcemanager2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager2/1.0.13+20200408/google_cloudresourcemanager2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudresourcemanager2/src/lib.rs b/gen/cloudresourcemanager2/src/lib.rs index 51c5e65b5d..1dbc04e933 100644 --- a/gen/cloudresourcemanager2/src/lib.rs +++ b/gen/cloudresourcemanager2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudresourcemanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *cloudresourcemanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Resource Manager* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). @@ -341,7 +341,7 @@ impl<'a, C, A> CloudResourceManager CloudResourceManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudresourcemanager.googleapis.com/".to_string(), _root_url: "https://cloudresourcemanager.googleapis.com/".to_string(), } @@ -355,7 +355,7 @@ impl<'a, C, A> CloudResourceManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -392,7 +392,7 @@ impl<'a, C, A> CloudResourceManager /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -403,7 +403,7 @@ impl<'a, C, A> CloudResourceManager /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -472,13 +472,11 @@ impl RequestValue for TestIamPermissionsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchFoldersRequest { - /// A pagination token returned from a previous call to `SearchFolders` + /// Optional. A pagination token returned from a previous call to `SearchFolders` /// that indicates from where search should continue. - /// This field is optional. #[serde(rename="pageToken")] pub page_token: Option, - /// The maximum number of folders to return in the response. - /// This field is optional. + /// Optional. The maximum number of folders to return in the response. #[serde(rename="pageSize")] pub page_size: Option, /// Search criteria used to select the Folders to return. @@ -538,30 +536,59 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -586,7 +613,6 @@ pub struct SearchFoldersResponse { pub folders: Option>, /// A pagination token returned from a previous call to `SearchFolders` /// that indicates from where searching should continue. - /// This field is optional. #[serde(rename="nextPageToken")] pub next_page_token: Option, } @@ -605,7 +631,7 @@ impl ResponseResult for SearchFoldersResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MoveFolderRequest { - /// The resource name of the Folder or Organization to reparent + /// Required. The resource name of the Folder or Organization to reparent /// the folder under. /// Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. #[serde(rename="destinationParent")] @@ -615,37 +641,50 @@ pub struct MoveFolderRequest { impl RequestValue for MoveFolderRequest {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -653,15 +692,21 @@ impl RequestValue for MoveFolderRequest {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -683,13 +728,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -733,7 +801,7 @@ pub struct Folder { /// Output only. The resource name of the Folder. /// Its format is `folders/{folder_id}`, for example: "folders/1234". pub name: Option, - /// The Folder’s parent's resource name. + /// Required. The Folder’s parent's resource name. /// Updates to the folder's parent must be performed via /// MoveFolder. pub parent: Option, @@ -836,7 +904,6 @@ pub struct ListFoldersResponse { pub folders: Option>, /// A pagination token returned from a previous call to `ListFolders` /// that indicates from where listing should continue. - /// This field is optional. #[serde(rename="nextPageToken")] pub next_page_token: Option, } @@ -870,9 +937,13 @@ impl ResponseResult for TestIamPermissionsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetPolicyOptions { /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. #[serde(rename="requestedPolicyVersion")] pub requested_policy_version: Option, } @@ -904,7 +975,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -913,6 +984,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -945,7 +1036,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -957,7 +1048,7 @@ impl Part for Binding {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -965,7 +1056,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -974,9 +1065,9 @@ impl Part for Binding {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1143,7 +1234,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the Folder to retrieve. + /// * `name` - Required. The resource name of the Folder to retrieve. /// Must be of the form `folders/{folder_id}`. pub fn get(&self, name: &str) -> FolderGetCall<'a, C, A> { FolderGetCall { @@ -1217,7 +1308,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the Folder to undelete. + /// * `name` - Required. The resource name of the Folder to undelete. /// Must be of the form `folders/{folder_id}`. pub fn undelete(&self, request: UndeleteFolderRequest, name: &str) -> FolderUndeleteCall<'a, C, A> { FolderUndeleteCall { @@ -1321,7 +1412,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the Folder to move. + /// * `name` - Required. The resource name of the Folder to move. /// Must be of the form folders/{folder_id} pub fn move_(&self, request: MoveFolderRequest, name: &str) -> FolderMoveCall<'a, C, A> { FolderMoveCall { @@ -1348,7 +1439,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - the resource name of the Folder to be deleted. + /// * `name` - Required. the resource name of the Folder to be deleted. /// Must be of the form `folders/{folder_id}`. pub fn delete(&self, name: &str) -> FolderDeleteCall<'a, C, A> { FolderDeleteCall { @@ -1666,7 +1757,7 @@ impl<'a, C, A> FolderPatchCall<'a, C, A> where C: BorrowMut, A: o self._name = new_value.to_string(); self } - /// Fields to be updated. + /// Required. Fields to be updated. /// Only the `display_name` can be updated. /// /// Sets the *update mask* query property to the given value. @@ -1911,16 +2002,16 @@ impl<'a, C, A> FolderListCall<'a, C, A> where C: BorrowMut, A: oa } - /// Controls whether Folders in the + /// Optional. Controls whether Folders in the /// DELETE_REQUESTED - /// state should be returned. Defaults to false. This field is optional. + /// state should be returned. Defaults to false. /// /// Sets the *show deleted* query property to the given value. pub fn show_deleted(mut self, new_value: bool) -> FolderListCall<'a, C, A> { self._show_deleted = Some(new_value); self } - /// The resource name of the Organization or Folder whose Folders are + /// Required. The resource name of the Organization or Folder whose Folders are /// being listed. /// Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. /// Access to this method is controlled by checking the @@ -1931,17 +2022,15 @@ impl<'a, C, A> FolderListCall<'a, C, A> where C: BorrowMut, A: oa self._parent = Some(new_value.to_string()); self } - /// A pagination token returned from a previous call to `ListFolders` + /// Optional. A pagination token returned from a previous call to `ListFolders` /// that indicates where this listing should continue from. - /// This field is optional. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> FolderListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The maximum number of Folders to return in the response. - /// This field is optional. + /// Optional. The maximum number of Folders to return in the response. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> FolderListCall<'a, C, A> { @@ -2474,7 +2563,7 @@ impl<'a, C, A> FolderGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// The resource name of the Folder to retrieve. + /// Required. The resource name of the Folder to retrieve. /// Must be of the form `folders/{folder_id}`. /// /// Sets the *name* path property to the given value. @@ -3294,7 +3383,7 @@ impl<'a, C, A> FolderUndeleteCall<'a, C, A> where C: BorrowMut, A self._request = new_value; self } - /// The resource name of the Folder to undelete. + /// Required. The resource name of the Folder to undelete. /// Must be of the form `folders/{folder_id}`. /// /// Sets the *name* path property to the given value. @@ -3578,7 +3667,7 @@ impl<'a, C, A> FolderCreateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The resource name of the new Folder's parent. + /// Required. The resource name of the new Folder's parent. /// Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. /// /// Sets the *parent* query property to the given value. @@ -4155,7 +4244,7 @@ impl<'a, C, A> FolderMoveCall<'a, C, A> where C: BorrowMut, A: oa self._request = new_value; self } - /// The resource name of the Folder to move. + /// Required. The resource name of the Folder to move. /// Must be of the form folders/{folder_id} /// /// Sets the *name* path property to the given value. @@ -4412,7 +4501,7 @@ impl<'a, C, A> FolderDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// the resource name of the Folder to be deleted. + /// Required. the resource name of the Folder to be deleted. /// Must be of the form `folders/{folder_id}`. /// /// Sets the *name* path property to the given value. diff --git a/gen/cloudscheduler1-cli/Cargo.toml b/gen/cloudscheduler1-cli/Cargo.toml index acda3cfad3..3e90d75593 100644 --- a/gen/cloudscheduler1-cli/Cargo.toml +++ b/gen/cloudscheduler1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudscheduler1-cli" -version = "1.0.12+20190617" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Scheduler (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudscheduler1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudscheduler1] path = "../cloudscheduler1" -version = "1.0.12+20190617" +version = "1.0.13+20200331" diff --git a/gen/cloudscheduler1-cli/README.md b/gen/cloudscheduler1-cli/README.md index 1b75ef08f3..53a9501f7b 100644 --- a/gen/cloudscheduler1-cli/README.md +++ b/gen/cloudscheduler1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Scheduler* API at revision *20190617*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Scheduler* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash cloudscheduler1 [options] diff --git a/gen/cloudscheduler1-cli/mkdocs.yml b/gen/cloudscheduler1-cli/mkdocs.yml index 36103f575e..211b4cee35 100644 --- a/gen/cloudscheduler1-cli/mkdocs.yml +++ b/gen/cloudscheduler1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Scheduler v1.0.12+20190617 +site_name: Cloud Scheduler v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-cloudscheduler1-cli site_description: A complete library to interact with Cloud Scheduler (protocol v1) diff --git a/gen/cloudscheduler1-cli/src/main.rs b/gen/cloudscheduler1-cli/src/main.rs index f4f1168e6d..7279d9305d 100644 --- a/gen/cloudscheduler1-cli/src/main.rs +++ b/gen/cloudscheduler1-cli/src/main.rs @@ -974,9 +974,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name. For example: + Some(r##"Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`."##), Some(true), Some(false)), @@ -1005,9 +1003,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1030,9 +1026,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1055,9 +1049,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name. For example: + Some(r##"Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`."##), Some(true), Some(false)), @@ -1138,9 +1130,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1174,9 +1164,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1208,9 +1196,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1261,7 +1247,7 @@ fn main() { let mut app = App::new("cloudscheduler1") .author("Sebastian Thiel ") - .version("1.0.12+20190617") + .version("1.0.13+20200331") .about("Creates and manages jobs run on a regular recurring schedule.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudscheduler1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudscheduler1/Cargo.toml b/gen/cloudscheduler1/Cargo.toml index c941d7c6fb..25dce6f925 100644 --- a/gen/cloudscheduler1/Cargo.toml +++ b/gen/cloudscheduler1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudscheduler1" -version = "1.0.12+20190617" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Scheduler (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudscheduler1" homepage = "https://cloud.google.com/scheduler/" -documentation = "https://docs.rs/google-cloudscheduler1/1.0.12+20190617" +documentation = "https://docs.rs/google-cloudscheduler1/1.0.13+20200331" license = "MIT" keywords = ["cloudscheduler", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudscheduler1/README.md b/gen/cloudscheduler1/README.md index bf88d050d7..d88f333ba4 100644 --- a/gen/cloudscheduler1/README.md +++ b/gen/cloudscheduler1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudscheduler1` library allows access to all features of the *Google Cloud Scheduler* service. -This documentation was generated from *Cloud Scheduler* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *cloudscheduler:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Scheduler* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudscheduler:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Scheduler* *v1* API can be found at the [official documentation site](https://cloud.google.com/scheduler/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.CloudScheduler.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.CloudScheduler.html) ... * projects - * [*locations get*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationGetCall.html), [*locations jobs create*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobCreateCall.html), [*locations jobs delete*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobDeleteCall.html), [*locations jobs get*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobGetCall.html), [*locations jobs list*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobListCall.html), [*locations jobs patch*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobPatchCall.html), [*locations jobs pause*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobPauseCall.html), [*locations jobs resume*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobResumeCall.html), [*locations jobs run*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationJobRunCall.html) and [*locations list*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.ProjectLocationListCall.html) + * [*locations get*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationGetCall.html), [*locations jobs create*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobCreateCall.html), [*locations jobs delete*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobDeleteCall.html), [*locations jobs get*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobGetCall.html), [*locations jobs list*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobListCall.html), [*locations jobs patch*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobPatchCall.html), [*locations jobs pause*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobPauseCall.html), [*locations jobs resume*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobResumeCall.html), [*locations jobs run*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationJobRunCall.html) and [*locations list*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.ProjectLocationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/struct.CloudScheduler.html)** +* **[Hub](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/struct.CloudScheduler.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudscheduler1/1.0.12+20190617/google_cloudscheduler1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudscheduler1/1.0.13+20200331/google_cloudscheduler1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudscheduler1/src/lib.rs b/gen/cloudscheduler1/src/lib.rs index 824d7b048d..5c05f54787 100644 --- a/gen/cloudscheduler1/src/lib.rs +++ b/gen/cloudscheduler1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Scheduler* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *cloudscheduler:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Scheduler* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudscheduler:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Scheduler* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/scheduler/). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudScheduler CloudScheduler { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudscheduler.googleapis.com/".to_string(), _root_url: "https://cloudscheduler.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> CloudScheduler } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -651,9 +651,7 @@ pub struct PubsubTarget { /// Pubsub message must contain either non-empty data, or at least one /// attribute. pub data: Option, - /// Required. - /// - /// The name of the Cloud Pub/Sub topic to which messages will + /// Required. The name of the Cloud Pub/Sub topic to which messages will /// be published when a job is delivered. The topic name must be in the /// same format as required by PubSub's /// [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), @@ -761,9 +759,7 @@ pub struct HttpTarget { /// yourself. #[serde(rename="oidcToken")] pub oidc_token: Option, - /// Required. - /// - /// The full URI path that the request will be sent to. This string + /// Required. The full URI path that the request will be sent to. This string /// must begin with either "http://" or "https://". Some examples of /// valid values for uri are: /// `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will @@ -1132,8 +1128,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_pause(&self, request: PauseJobRequest, name: &str) -> ProjectLocationJobPauseCall<'a, C, A> { ProjectLocationJobPauseCall { @@ -1152,8 +1147,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_delete(&self, name: &str) -> ProjectLocationJobDeleteCall<'a, C, A> { ProjectLocationJobDeleteCall { @@ -1171,8 +1165,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_get(&self, name: &str) -> ProjectLocationJobGetCall<'a, C, A> { ProjectLocationJobGetCall { @@ -1191,8 +1184,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The location name. For example: + /// * `parent` - Required. The location name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID`. pub fn locations_jobs_create(&self, request: Job, parent: &str) -> ProjectLocationJobCreateCall<'a, C, A> { ProjectLocationJobCreateCall { @@ -1211,8 +1203,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The location name. For example: + /// * `parent` - Required. The location name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID`. pub fn locations_jobs_list(&self, parent: &str) -> ProjectLocationJobListCall<'a, C, A> { ProjectLocationJobListCall { @@ -1238,8 +1229,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_resume(&self, request: ResumeJobRequest, name: &str) -> ProjectLocationJobResumeCall<'a, C, A> { ProjectLocationJobResumeCall { @@ -1262,8 +1252,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_run(&self, request: RunJobRequest, name: &str) -> ProjectLocationJobRunCall<'a, C, A> { ProjectLocationJobRunCall { @@ -1576,9 +1565,7 @@ impl<'a, C, A> ProjectLocationJobPauseCall<'a, C, A> where C: BorrowMut ProjectLocationJobDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationJobGetCall<'a, C, A> where C: BorrowMut ProjectLocationJobCreateCall<'a, C, A> where C: BorrowMut ProjectLocationJobListCall<'a, C, A> where C: BorrowMut ProjectLocationJobResumeCall<'a, C, A> where C: BorrowMut ProjectLocationJobRunCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Scheduler (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudscheduler1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudscheduler1_beta1] path = "../cloudscheduler1_beta1" -version = "1.0.12+20190617" +version = "1.0.13+20200331" diff --git a/gen/cloudscheduler1_beta1-cli/README.md b/gen/cloudscheduler1_beta1-cli/README.md index 5cfa346a8b..17a4cc19bc 100644 --- a/gen/cloudscheduler1_beta1-cli/README.md +++ b/gen/cloudscheduler1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Scheduler* API at revision *20190617*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Scheduler* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash cloudscheduler1-beta1 [options] diff --git a/gen/cloudscheduler1_beta1-cli/mkdocs.yml b/gen/cloudscheduler1_beta1-cli/mkdocs.yml index e0288adb3a..14be0699c9 100644 --- a/gen/cloudscheduler1_beta1-cli/mkdocs.yml +++ b/gen/cloudscheduler1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Scheduler v1.0.12+20190617 +site_name: Cloud Scheduler v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-cloudscheduler1_beta1-cli site_description: A complete library to interact with Cloud Scheduler (protocol v1beta1) diff --git a/gen/cloudscheduler1_beta1-cli/src/main.rs b/gen/cloudscheduler1_beta1-cli/src/main.rs index 3fb03c4997..81e1086ce5 100644 --- a/gen/cloudscheduler1_beta1-cli/src/main.rs +++ b/gen/cloudscheduler1_beta1-cli/src/main.rs @@ -974,9 +974,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name. For example: + Some(r##"Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`."##), Some(true), Some(false)), @@ -1005,9 +1003,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1030,9 +1026,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1055,9 +1049,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name. For example: + Some(r##"Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`."##), Some(true), Some(false)), @@ -1138,9 +1130,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1174,9 +1164,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1208,9 +1196,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The job name. For example: + Some(r##"Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`."##), Some(true), Some(false)), @@ -1261,7 +1247,7 @@ fn main() { let mut app = App::new("cloudscheduler1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190617") + .version("1.0.13+20200331") .about("Creates and manages jobs run on a regular recurring schedule.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudscheduler1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudscheduler1_beta1/Cargo.toml b/gen/cloudscheduler1_beta1/Cargo.toml index aa14862736..3325f82c95 100644 --- a/gen/cloudscheduler1_beta1/Cargo.toml +++ b/gen/cloudscheduler1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudscheduler1_beta1" -version = "1.0.12+20190617" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Scheduler (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudscheduler1_beta1" homepage = "https://cloud.google.com/scheduler/" -documentation = "https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617" +documentation = "https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331" license = "MIT" keywords = ["cloudscheduler", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudscheduler1_beta1/README.md b/gen/cloudscheduler1_beta1/README.md index 1a76941c39..c29bcbe28b 100644 --- a/gen/cloudscheduler1_beta1/README.md +++ b/gen/cloudscheduler1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudscheduler1_beta1` library allows access to all features of the *Google Cloud Scheduler* service. -This documentation was generated from *Cloud Scheduler* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *cloudscheduler:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Scheduler* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudscheduler:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Scheduler* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/scheduler/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.CloudScheduler.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.CloudScheduler.html) ... * projects - * [*locations get*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationGetCall.html), [*locations jobs create*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobCreateCall.html), [*locations jobs delete*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobDeleteCall.html), [*locations jobs get*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobGetCall.html), [*locations jobs list*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobListCall.html), [*locations jobs patch*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobPatchCall.html), [*locations jobs pause*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobPauseCall.html), [*locations jobs resume*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobResumeCall.html), [*locations jobs run*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationJobRunCall.html) and [*locations list*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.ProjectLocationListCall.html) + * [*locations get*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationGetCall.html), [*locations jobs create*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobCreateCall.html), [*locations jobs delete*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobDeleteCall.html), [*locations jobs get*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobGetCall.html), [*locations jobs list*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobListCall.html), [*locations jobs patch*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobPatchCall.html), [*locations jobs pause*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobPauseCall.html), [*locations jobs resume*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobResumeCall.html), [*locations jobs run*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationJobRunCall.html) and [*locations list*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.ProjectLocationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/struct.CloudScheduler.html)** +* **[Hub](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/struct.CloudScheduler.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudscheduler1_beta1/1.0.12+20190617/google_cloudscheduler1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudscheduler1_beta1/1.0.13+20200331/google_cloudscheduler1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudscheduler1_beta1/src/lib.rs b/gen/cloudscheduler1_beta1/src/lib.rs index 7806ae8896..5c7e97a026 100644 --- a/gen/cloudscheduler1_beta1/src/lib.rs +++ b/gen/cloudscheduler1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Scheduler* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *cloudscheduler:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Scheduler* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudscheduler:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Scheduler* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/scheduler/). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudScheduler CloudScheduler { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudscheduler.googleapis.com/".to_string(), _root_url: "https://cloudscheduler.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> CloudScheduler } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -651,9 +651,7 @@ pub struct PubsubTarget { /// Pubsub message must contain either non-empty data, or at least one /// attribute. pub data: Option, - /// Required. - /// - /// The name of the Cloud Pub/Sub topic to which messages will + /// Required. The name of the Cloud Pub/Sub topic to which messages will /// be published when a job is delivered. The topic name must be in the /// same format as required by PubSub's /// [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), @@ -761,9 +759,7 @@ pub struct HttpTarget { /// yourself. #[serde(rename="oidcToken")] pub oidc_token: Option, - /// Required. - /// - /// The full URI path that the request will be sent to. This string + /// Required. The full URI path that the request will be sent to. This string /// must begin with either "http://" or "https://". Some examples of /// valid values for uri are: /// `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will @@ -1134,8 +1130,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_pause(&self, request: PauseJobRequest, name: &str) -> ProjectLocationJobPauseCall<'a, C, A> { ProjectLocationJobPauseCall { @@ -1154,8 +1149,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_delete(&self, name: &str) -> ProjectLocationJobDeleteCall<'a, C, A> { ProjectLocationJobDeleteCall { @@ -1173,8 +1167,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_get(&self, name: &str) -> ProjectLocationJobGetCall<'a, C, A> { ProjectLocationJobGetCall { @@ -1193,8 +1186,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The location name. For example: + /// * `parent` - Required. The location name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID`. pub fn locations_jobs_create(&self, request: Job, parent: &str) -> ProjectLocationJobCreateCall<'a, C, A> { ProjectLocationJobCreateCall { @@ -1213,8 +1205,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The location name. For example: + /// * `parent` - Required. The location name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID`. pub fn locations_jobs_list(&self, parent: &str) -> ProjectLocationJobListCall<'a, C, A> { ProjectLocationJobListCall { @@ -1240,8 +1231,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_resume(&self, request: ResumeJobRequest, name: &str) -> ProjectLocationJobResumeCall<'a, C, A> { ProjectLocationJobResumeCall { @@ -1264,8 +1254,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The job name. For example: + /// * `name` - Required. The job name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. pub fn locations_jobs_run(&self, request: RunJobRequest, name: &str) -> ProjectLocationJobRunCall<'a, C, A> { ProjectLocationJobRunCall { @@ -1578,9 +1567,7 @@ impl<'a, C, A> ProjectLocationJobPauseCall<'a, C, A> where C: BorrowMut ProjectLocationJobDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationJobGetCall<'a, C, A> where C: BorrowMut ProjectLocationJobCreateCall<'a, C, A> where C: BorrowMut ProjectLocationJobListCall<'a, C, A> where C: BorrowMut ProjectLocationJobResumeCall<'a, C, A> where C: BorrowMut ProjectLocationJobRunCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Shell (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudshell1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudshell1] path = "../cloudshell1" -version = "1.0.12+20190701" +version = "1.0.13+20200409" diff --git a/gen/cloudshell1-cli/README.md b/gen/cloudshell1-cli/README.md index 0e095b2fef..4ba6457d04 100644 --- a/gen/cloudshell1-cli/README.md +++ b/gen/cloudshell1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Shell* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Shell* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash cloudshell1 [options] diff --git a/gen/cloudshell1-cli/mkdocs.yml b/gen/cloudshell1-cli/mkdocs.yml index 381f5bffd2..66985405e5 100644 --- a/gen/cloudshell1-cli/mkdocs.yml +++ b/gen/cloudshell1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Shell v1.0.12+20190701 +site_name: Cloud Shell v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-cloudshell1-cli site_description: A complete library to interact with Cloud Shell (protocol v1) diff --git a/gen/cloudshell1-cli/src/main.rs b/gen/cloudshell1-cli/src/main.rs index 4fec9ffa20..1b0604f278 100644 --- a/gen/cloudshell1-cli/src/main.rs +++ b/gen/cloudshell1-cli/src/main.rs @@ -530,7 +530,7 @@ fn main() { let mut app = App::new("cloudshell1") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200409") .about("Allows users to start, configure, and connect to interactive shell sessions running in the cloud. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudshell1_cli") diff --git a/gen/cloudshell1/Cargo.toml b/gen/cloudshell1/Cargo.toml index 77b5cf09e0..748f9490f4 100644 --- a/gen/cloudshell1/Cargo.toml +++ b/gen/cloudshell1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudshell1" -version = "1.0.12+20190701" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Shell (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudshell1" homepage = "https://cloud.google.com/shell/docs/" -documentation = "https://docs.rs/google-cloudshell1/1.0.12+20190701" +documentation = "https://docs.rs/google-cloudshell1/1.0.13+20200409" license = "MIT" keywords = ["cloudshell", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudshell1/README.md b/gen/cloudshell1/README.md index 1a8d1583d6..fa6c0194b4 100644 --- a/gen/cloudshell1/README.md +++ b/gen/cloudshell1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudshell1` library allows access to all features of the *Google Cloud Shell* service. -This documentation was generated from *Cloud Shell* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudshell:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Shell* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *cloudshell:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Shell* *v1* API can be found at the [official documentation site](https://cloud.google.com/shell/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/struct.CloudShell.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/struct.CloudShell.html) ... -* [operations](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/struct.OperationListCall.html) +* [operations](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/struct.OperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/struct.CloudShell.html)** +* **[Hub](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/struct.CloudShell.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudshell1/1.0.12+20190701/google_cloudshell1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudshell1/1.0.13+20200409/google_cloudshell1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudshell1/src/lib.rs b/gen/cloudshell1/src/lib.rs index f71c48c8d4..87cb095b95 100644 --- a/gen/cloudshell1/src/lib.rs +++ b/gen/cloudshell1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Shell* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *cloudshell:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Shell* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *cloudshell:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Shell* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/shell/docs/). @@ -326,7 +326,7 @@ impl<'a, C, A> CloudShell CloudShell { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudshell.googleapis.com/".to_string(), _root_url: "https://cloudshell.googleapis.com/".to_string(), } @@ -337,7 +337,7 @@ impl<'a, C, A> CloudShell } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/cloudtasks2-cli/Cargo.toml b/gen/cloudtasks2-cli/Cargo.toml index dfab2e61b4..56c7e49b8b 100644 --- a/gen/cloudtasks2-cli/Cargo.toml +++ b/gen/cloudtasks2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudtasks2-cli" -version = "1.0.12+20190618" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Tasks (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudtasks2] path = "../cloudtasks2" -version = "1.0.12+20190618" +version = "1.0.13+20200331" diff --git a/gen/cloudtasks2-cli/README.md b/gen/cloudtasks2-cli/README.md index 8374edeafa..369ec78840 100644 --- a/gen/cloudtasks2-cli/README.md +++ b/gen/cloudtasks2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Tasks* API at revision *20190618*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Tasks* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash cloudtasks2 [options] diff --git a/gen/cloudtasks2-cli/mkdocs.yml b/gen/cloudtasks2-cli/mkdocs.yml index cab0610cd4..e68cdee43f 100644 --- a/gen/cloudtasks2-cli/mkdocs.yml +++ b/gen/cloudtasks2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Tasks v1.0.12+20190618 +site_name: Cloud Tasks v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-cloudtasks2-cli site_description: A complete library to interact with Cloud Tasks (protocol v2) diff --git a/gen/cloudtasks2-cli/src/main.rs b/gen/cloudtasks2-cli/src/main.rs index 987a7f143c..e89aad42df 100644 --- a/gen/cloudtasks2-cli/src/main.rs +++ b/gen/cloudtasks2-cli/src/main.rs @@ -184,6 +184,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "stackdriver-logging-config.sampling-ratio" => Some(("stackdriverLoggingConfig.samplingRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "rate-limits.max-concurrent-dispatches" => Some(("rateLimits.maxConcurrentDispatches", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "rate-limits.max-burst-size" => Some(("rateLimits.maxBurstSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "rate-limits.max-dispatches-per-second" => Some(("rateLimits.maxDispatchesPerSecond", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -199,7 +200,7 @@ impl<'n> Engine<'n> { "retry-config.max-backoff" => Some(("retryConfig.maxBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "retry-config.min-backoff" => Some(("retryConfig.minBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-concurrent-dispatches", "max-dispatches-per-second", "max-doublings", "max-retry-duration", "min-backoff", "name", "purge-time", "rate-limits", "retry-config", "service", "state", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-concurrent-dispatches", "max-dispatches-per-second", "max-doublings", "max-retry-duration", "min-backoff", "name", "purge-time", "rate-limits", "retry-config", "sampling-ratio", "service", "stackdriver-logging-config", "state", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -386,8 +387,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -533,6 +535,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "stackdriver-logging-config.sampling-ratio" => Some(("stackdriverLoggingConfig.samplingRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "rate-limits.max-concurrent-dispatches" => Some(("rateLimits.maxConcurrentDispatches", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "rate-limits.max-burst-size" => Some(("rateLimits.maxBurstSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "rate-limits.max-dispatches-per-second" => Some(("rateLimits.maxDispatchesPerSecond", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -548,7 +551,7 @@ impl<'n> Engine<'n> { "retry-config.max-backoff" => Some(("retryConfig.maxBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "retry-config.min-backoff" => Some(("retryConfig.minBackoff", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-concurrent-dispatches", "max-dispatches-per-second", "max-doublings", "max-retry-duration", "min-backoff", "name", "purge-time", "rate-limits", "retry-config", "service", "state", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-routing-override", "host", "instance", "max-attempts", "max-backoff", "max-burst-size", "max-concurrent-dispatches", "max-dispatches-per-second", "max-doublings", "max-retry-duration", "min-backoff", "name", "purge-time", "rate-limits", "retry-config", "sampling-ratio", "service", "stackdriver-logging-config", "state", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -974,6 +977,14 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "response-view" => Some(("responseView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.body" => Some(("task.httpRequest.body", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.http-method" => Some(("task.httpRequest.httpMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.url" => Some(("task.httpRequest.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.oidc-token.audience" => Some(("task.httpRequest.oidcToken.audience", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.oidc-token.service-account-email" => Some(("task.httpRequest.oidcToken.serviceAccountEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.oauth-token.scope" => Some(("task.httpRequest.oauthToken.scope", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.oauth-token.service-account-email" => Some(("task.httpRequest.oauthToken.serviceAccountEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "task.http-request.headers" => Some(("task.httpRequest.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "task.app-engine-http-request.body" => Some(("task.appEngineHttpRequest.body", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "task.app-engine-http-request.headers" => Some(("task.appEngineHttpRequest.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "task.app-engine-http-request.app-engine-routing.instance" => Some(("task.appEngineHttpRequest.appEngineRouting.instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1000,7 +1011,7 @@ impl<'n> Engine<'n> { "task.dispatch-count" => Some(("task.dispatchCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "task.name" => Some(("task.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-request", "app-engine-routing", "body", "code", "create-time", "dispatch-count", "dispatch-deadline", "dispatch-time", "first-attempt", "headers", "host", "http-method", "instance", "last-attempt", "message", "name", "relative-uri", "response-count", "response-status", "response-time", "response-view", "schedule-time", "service", "task", "version", "view"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine-http-request", "app-engine-routing", "audience", "body", "code", "create-time", "dispatch-count", "dispatch-deadline", "dispatch-time", "first-attempt", "headers", "host", "http-method", "http-request", "instance", "last-attempt", "message", "name", "oauth-token", "oidc-token", "relative-uri", "response-count", "response-status", "response-time", "response-view", "schedule-time", "scope", "service", "service-account-email", "task", "url", "version", "view"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1614,9 +1625,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name in which the queue will be created. + Some(r##"Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud @@ -1661,9 +1670,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1686,9 +1693,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The resource name of the queue. For example: + Some(r##"Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1750,9 +1755,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name. + Some(r##"Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`"##), Some(true), Some(false)), @@ -1841,9 +1844,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1877,9 +1878,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1920,9 +1919,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1994,9 +1991,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist."##), @@ -2031,9 +2026,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2056,9 +2049,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2089,9 +2080,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2137,9 +2126,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2203,7 +2190,7 @@ fn main() { let mut app = App::new("cloudtasks2") .author("Sebastian Thiel ") - .version("1.0.12+20190618") + .version("1.0.13+20200331") .about("Manages the execution of large numbers of distributed requests.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudtasks2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudtasks2/Cargo.toml b/gen/cloudtasks2/Cargo.toml index ada4ce6c16..7ff1853451 100644 --- a/gen/cloudtasks2/Cargo.toml +++ b/gen/cloudtasks2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudtasks2" -version = "1.0.12+20190618" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Tasks (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2" homepage = "https://cloud.google.com/tasks/" -documentation = "https://docs.rs/google-cloudtasks2/1.0.12+20190618" +documentation = "https://docs.rs/google-cloudtasks2/1.0.13+20200331" license = "MIT" keywords = ["cloudtasks", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudtasks2/README.md b/gen/cloudtasks2/README.md index 11aca0ef76..6c81091a6c 100644 --- a/gen/cloudtasks2/README.md +++ b/gen/cloudtasks2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudtasks2` library allows access to all features of the *Google Cloud Tasks* service. -This documentation was generated from *Cloud Tasks* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudtasks:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Tasks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudtasks:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Tasks* *v2* API can be found at the [official documentation site](https://cloud.google.com/tasks/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.CloudTasks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.CloudTasks.html) ... * projects - * [*locations get*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.ProjectLocationQueueTestIamPermissionCall.html) + * [*locations get*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.ProjectLocationQueueTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/struct.CloudTasks.html)** +* **[Hub](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/struct.CloudTasks.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudtasks2/1.0.12+20190618/google_cloudtasks2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudtasks2/1.0.13+20200331/google_cloudtasks2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudtasks2/src/lib.rs b/gen/cloudtasks2/src/lib.rs index 09d53433a1..71dbd14546 100644 --- a/gen/cloudtasks2/src/lib.rs +++ b/gen/cloudtasks2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Tasks* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudtasks:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Tasks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudtasks:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Tasks* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/tasks/). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudTasks CloudTasks { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudtasks.googleapis.com/".to_string(), _root_url: "https://cloudtasks.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> CloudTasks } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -375,6 +375,110 @@ impl<'a, C, A> CloudTasks // ############ // SCHEMAS ### // ########## +/// HTTP request. +/// +/// The task will be pushed to the worker as an HTTP request. If the worker +/// or the redirected worker acknowledges the task by returning a successful HTTP +/// response code ([`200` - `299`]), the task will be removed from the queue. If +/// any other HTTP response code is returned or no response is received, the +/// task will be retried according to the following: +/// +/// * User-specified throttling: retry configuration, +/// rate limits, and the queue's state. +/// +/// * System throttling: To prevent the worker from overloading, Cloud Tasks may +/// temporarily reduce the queue's effective rate. User-specified settings +/// will not be changed. +/// +/// System throttling happens because: +/// +/// * Cloud Tasks backs off on all errors. Normally the backoff specified in +/// rate limits will be used. But if the worker returns +/// `429` (Too Many Requests), `503` (Service Unavailable), or the rate of +/// errors is high, Cloud Tasks will use a higher backoff rate. The retry +/// specified in the `Retry-After` HTTP response header is considered. +/// +/// * To prevent traffic spikes and to smooth sudden increases in traffic, +/// dispatches ramp up slowly when the queue is newly created or idle and +/// if large numbers of tasks suddenly become available to dispatch (due to +/// spikes in create task rates, the queue being unpaused, or many tasks +/// that are scheduled at the same time). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpRequest { + /// HTTP request body. + /// + /// A request body is allowed only if the + /// HTTP method is POST, PUT, or PATCH. It is an + /// error to set body on a task with an incompatible HttpMethod. + pub body: Option, + /// HTTP request headers. + /// + /// This map contains the header field names and values. + /// Headers can be set when the + /// task is created. + /// + /// These headers represent a subset of the headers that will accompany the + /// task's HTTP request. Some HTTP request headers will be ignored or replaced. + /// + /// A partial list of headers that will be ignored or replaced is: + /// + /// * Host: This will be computed by Cloud Tasks and derived from + /// HttpRequest.url. + /// * Content-Length: This will be computed by Cloud Tasks. + /// * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + /// * X-Google-*: Google use only. + /// * X-AppEngine-*: Google use only. + /// + /// `Content-Type` won't be set by Cloud Tasks. You can explicitly set + /// `Content-Type` to a media type when the + /// task is created. + /// For example, `Content-Type` can be set to `"application/octet-stream"` or + /// `"application/json"`. + /// + /// Headers which can have multiple values (according to RFC2616) can be + /// specified using comma-separated values. + /// + /// The size of the headers must be less than 80KB. + pub headers: Option>, + /// The HTTP method to use for the request. The default is POST. + #[serde(rename="httpMethod")] + pub http_method: Option, + /// Required. The full url path that the request will be sent to. + /// + /// This string must begin with either "http://" or "https://". Some examples + /// are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + /// encode some characters for safety and compatibility. The maximum allowed + /// URL length is 2083 characters after encoding. + /// + /// The `Location` header response from a redirect response [`300` - `399`] + /// may be followed. The redirect is not counted as a separate attempt. + pub url: Option, + /// If specified, an + /// [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + /// token will be generated and attached as an `Authorization` header in the + /// HTTP request. + /// + /// This type of authorization can be used for many scenarios, including + /// calling Cloud Run, or endpoints where you intend to validate the token + /// yourself. + #[serde(rename="oidcToken")] + pub oidc_token: Option, + /// If specified, an + /// [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + /// will be generated and attached as an `Authorization` header in the HTTP + /// request. + /// + /// This type of authorization should generally only be used when calling + /// Google APIs hosted on *.googleapis.com. + #[serde(rename="oauthToken")] + pub oauth_token: Option, +} + +impl Part for HttpRequest {} + + /// App Engine HTTP request. /// /// The message defines the HTTP request that is sent to an App Engine app when @@ -403,11 +507,10 @@ impl<'a, C, A> CloudTasks /// The AppEngineRouting used to construct the URL that the task is /// delivered to can be set at the queue-level or task-level: /// -/// * If set, -/// app_engine_routing_override -/// is used for all tasks in the queue, no matter what the setting -/// is for the -/// task-level app_engine_routing. +/// * If app_engine_routing_override is set on the +/// queue, this value is used for all +/// tasks in the queue, no matter what the setting is for the task-level +/// app_engine_routing. /// /// /// The `url` that the task will be sent to is: @@ -481,7 +584,7 @@ pub struct AppEngineHttpRequest { /// In addition, Cloud Tasks sets some headers when the task is dispatched, /// such as headers containing information about the task; see /// [request - /// headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + /// headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). /// These headers are set only when the task is dispatched, so they are not /// visible when the task is returned in a Cloud Tasks response. /// @@ -491,10 +594,10 @@ pub struct AppEngineHttpRequest { pub headers: Option>, /// Task-level setting for App Engine routing. /// - /// If set, - /// app_engine_routing_override - /// is used for all tasks in the queue, no matter what the setting is for the - /// task-level app_engine_routing. + /// * If app_engine_routing_override is set on the + /// queue, this value is used for all + /// tasks in the queue, no matter what the setting is for the task-level + /// app_engine_routing. #[serde(rename="appEngineRouting")] pub app_engine_routing: Option, /// The relative URI. @@ -533,7 +636,11 @@ impl Part for AppEngineHttpRequest {} /// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} impl RequestValue for GetIamPolicyRequest {} @@ -606,30 +713,59 @@ pub struct PauseQueueRequest { _never_set: Option } impl RequestValue for PauseQueueRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -724,6 +860,11 @@ pub struct Queue { /// * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or /// hyphens (-). The maximum length is 100 characters. pub name: Option, + /// Configuration options for writing logs to + /// [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + /// field is unset, then no logs are written. + #[serde(rename="stackdriverLoggingConfig")] + pub stackdriver_logging_config: Option, /// Rate limits for task dispatches. /// /// rate_limits and retry_config are @@ -754,6 +895,7 @@ pub struct Queue { /// task-level app_engine_routing. /// These settings apply only to /// App Engine tasks in this queue. + /// Http tasks are not affected. /// /// If set, `app_engine_routing_override` is used for all /// App Engine tasks in the queue, no matter what the @@ -779,37 +921,50 @@ impl RequestValue for Queue {} impl ResponseResult for Queue {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -817,15 +972,21 @@ impl ResponseResult for Queue {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -836,8 +997,9 @@ impl ResponseResult for Queue {} /// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -847,10 +1009,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -870,6 +1054,11 @@ impl ResponseResult for Policy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Task { + /// HTTP request that is sent to the worker. + /// + /// An HTTP task is a task that has HttpRequest set. + #[serde(rename="httpRequest")] + pub http_request: Option, /// HTTP request that is sent to the App Engine app handler. /// /// An App Engine task is a task that has AppEngineHttpRequest set. @@ -905,9 +1094,7 @@ pub struct Task { /// * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), /// hyphens (-), or underscores (_). The maximum length is 500 characters. pub name: Option, - /// The time when the task is scheduled to be attempted. - /// - /// For App Engine queues, this is when the task will be attempted or retried. + /// The time when the task is scheduled to be attempted or retried. /// /// `schedule_time` will be truncated to the nearest microsecond. #[serde(rename="scheduleTime")] @@ -924,6 +1111,8 @@ pub struct Task { /// /// The default and maximum values depend on the type of request: /// + /// * For HTTP tasks, the default is 10 minutes. The deadline + /// must be in the interval [15 seconds, 30 minutes]. /// /// * For App Engine tasks, 0 indicates that the /// request has the default deadline. The default deadline depends on the @@ -1186,7 +1375,7 @@ pub struct RateLimits { /// value of /// max_dispatches_per_second. /// - /// For App Engine queues that were created or updated using + /// For queues that were created or updated using /// `queue.yaml/xml`, `max_burst_size` is equal to /// [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). /// Since `max_burst_size` is output only, if @@ -1205,8 +1394,7 @@ pub struct RateLimits { /// If unspecified when the queue is created, Cloud Tasks will pick the /// default. /// - /// * For App Engine queues, the maximum allowed value - /// is 500. + /// * The maximum allowed value is 500. /// /// /// This field has the same meaning as @@ -1219,25 +1407,30 @@ pub struct RateLimits { impl Part for RateLimits {} -/// Request message for `SetIamPolicy` method. +/// Contains information needed for generating an +/// [OpenID Connect +/// token](https://developers.google.com/identity/protocols/OpenIDConnect). +/// This type of authorization can be used for many scenarios, including +/// calling Cloud Run, or endpoints where you intend to validate the token +/// yourself. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations queues set iam policy projects](struct.ProjectLocationQueueSetIamPolicyCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. The size of - /// the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) - /// might reject them. - pub policy: Option, +pub struct OidcToken { + /// Audience to be used when generating OIDC token. If not specified, the URI + /// specified in target will be used. + pub audience: Option, + /// [Service account email](https://cloud.google.com/iam/docs/service-accounts) + /// to be used for generating OIDC token. + /// The service account must be within the same project as the queue. The + /// caller must have iam.serviceAccounts.actAs permission for the service + /// account. + #[serde(rename="serviceAccountEmail")] + pub service_account_email: Option, } -impl RequestValue for SetIamPolicyRequest {} +impl Part for OidcToken {} /// Associates `members` with a `role`. @@ -1264,7 +1457,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1273,6 +1466,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1284,6 +1497,70 @@ pub struct Binding { impl Part for Binding {} +/// Contains information needed for generating an +/// [OAuth token](https://developers.google.com/identity/protocols/OAuth2). +/// This type of authorization should generally only be used when calling Google +/// APIs hosted on *.googleapis.com. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OAuthToken { + /// OAuth scope to be used for generating OAuth access token. + /// If not specified, "https://www.googleapis.com/auth/cloud-platform" + /// will be used. + pub scope: Option, + /// [Service account email](https://cloud.google.com/iam/docs/service-accounts) + /// to be used for generating OAuth token. + /// The service account must be within the same project as the queue. The + /// caller must have iam.serviceAccounts.actAs permission for the service + /// account. + #[serde(rename="serviceAccountEmail")] + pub service_account_email: Option, +} + +impl Part for OAuthToken {} + + +/// Configuration options for writing logs to +/// [Stackdriver Logging](https://cloud.google.com/logging/docs/). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StackdriverLoggingConfig { + /// Specifies the fraction of operations to write to + /// [Stackdriver Logging](https://cloud.google.com/logging/docs/). + /// This field may contain any value between 0.0 and 1.0, inclusive. + /// 0.0 is the default and means that no operations are logged. + #[serde(rename="samplingRatio")] + pub sampling_ratio: Option, +} + +impl Part for StackdriverLoggingConfig {} + + +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + /// Request message for CreateTask. /// /// # Activities @@ -1309,9 +1586,7 @@ pub struct CreateTaskRequest { /// permission on the Task resource. #[serde(rename="responseView")] pub response_view: Option, - /// Required. - /// - /// The task to add. + /// Required. The task to add. /// /// Task names have the following format: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. @@ -1365,6 +1640,27 @@ pub struct ResumeQueueRequest { _never_set: Option } impl RequestValue for ResumeQueueRequest {} +/// Request message for `SetIamPolicy` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations queues set iam policy projects](struct.ProjectLocationQueueSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. The size of + /// the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + /// Response message for ListQueues. /// /// # Activities @@ -1409,6 +1705,13 @@ impl ResponseResult for ListQueuesResponse {} /// and [App Engine Flex request /// routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). /// +/// Using AppEngineRouting requires +/// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) +/// Google IAM permission for the project +/// and the following scope: +/// +/// `https://www.googleapis.com/auth/cloud-platform` +/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1663,8 +1966,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_run(&self, request: RunTaskRequest, name: &str) -> ProjectLocationQueueTaskRunCall<'a, C, A> { ProjectLocationQueueTaskRunCall { @@ -1690,8 +1992,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_pause(&self, request: PauseQueueRequest, name: &str) -> ProjectLocationQueuePauseCall<'a, C, A> { ProjectLocationQueuePauseCall { @@ -1710,8 +2011,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_get(&self, name: &str) -> ProjectLocationQueueTaskGetCall<'a, C, A> { ProjectLocationQueueTaskGetCall { @@ -1738,8 +2038,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The queue name. For example: + /// * `parent` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_tasks_list(&self, parent: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { ProjectLocationQueueTaskListCall { @@ -1773,8 +2072,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_resume(&self, request: ResumeQueueRequest, name: &str) -> ProjectLocationQueueResumeCall<'a, C, A> { ProjectLocationQueueResumeCall { @@ -1912,8 +2210,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The location name in which the queue will be created. + /// * `parent` - Required. The location name in which the queue will be created. /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` /// The list of allowed locations can be obtained by calling Cloud /// Tasks' implementation of @@ -1947,8 +2244,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_delete(&self, name: &str) -> ProjectLocationQueueDeleteCall<'a, C, A> { ProjectLocationQueueDeleteCall { @@ -1988,8 +2284,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The location name. + /// * `parent` - Required. The location name. /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` pub fn locations_queues_list(&self, parent: &str) -> ProjectLocationQueueListCall<'a, C, A> { ProjectLocationQueueListCall { @@ -2053,8 +2348,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The resource name of the queue. For example: + /// * `name` - Required. The resource name of the queue. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_get(&self, name: &str) -> ProjectLocationQueueGetCall<'a, C, A> { ProjectLocationQueueGetCall { @@ -2078,8 +2372,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_purge(&self, request: PurgeQueueRequest, name: &str) -> ProjectLocationQueuePurgeCall<'a, C, A> { ProjectLocationQueuePurgeCall { @@ -2103,8 +2396,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The queue name. For example: + /// * `parent` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` /// The queue must already exist. pub fn locations_queues_tasks_create(&self, request: CreateTaskRequest, parent: &str) -> ProjectLocationQueueTaskCreateCall<'a, C, A> { @@ -2128,8 +2420,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_delete(&self, name: &str) -> ProjectLocationQueueTaskDeleteCall<'a, C, A> { ProjectLocationQueueTaskDeleteCall { @@ -2379,9 +2670,7 @@ impl<'a, C, A> ProjectLocationQueueTaskRunCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePauseCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueResumeCall<'a, C, A> where C: BorrowMut ProjectLocationQueueCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePurgeCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskDeleteCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Tasks (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudtasks2_beta2] path = "../cloudtasks2_beta2" -version = "1.0.12+20190618" +version = "1.0.13+20200331" diff --git a/gen/cloudtasks2_beta2-cli/README.md b/gen/cloudtasks2_beta2-cli/README.md index 9f2e8d9fe2..69c4372977 100644 --- a/gen/cloudtasks2_beta2-cli/README.md +++ b/gen/cloudtasks2_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Tasks* API at revision *20190618*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Tasks* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash cloudtasks2-beta2 [options] diff --git a/gen/cloudtasks2_beta2-cli/mkdocs.yml b/gen/cloudtasks2_beta2-cli/mkdocs.yml index 99a1460941..9285584369 100644 --- a/gen/cloudtasks2_beta2-cli/mkdocs.yml +++ b/gen/cloudtasks2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Tasks v1.0.12+20190618 +site_name: Cloud Tasks v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-cloudtasks2_beta2-cli site_description: A complete library to interact with Cloud Tasks (protocol v2beta2) diff --git a/gen/cloudtasks2_beta2-cli/src/main.rs b/gen/cloudtasks2_beta2-cli/src/main.rs index 54b693bb24..2f2753809f 100644 --- a/gen/cloudtasks2_beta2-cli/src/main.rs +++ b/gen/cloudtasks2_beta2-cli/src/main.rs @@ -318,6 +318,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "read-mask" => { + call = call.read_mask(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -331,6 +334,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["read-mask"].iter().map(|v|*v)); v } )); } } @@ -387,8 +391,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1975,9 +1980,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name in which the queue will be created. + Some(r##"Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud @@ -2022,9 +2025,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2047,9 +2048,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The resource name of the queue. For example: + Some(r##"Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2111,9 +2110,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name. + Some(r##"Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`"##), Some(true), Some(false)), @@ -2202,9 +2199,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2238,9 +2233,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2281,9 +2274,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2363,9 +2354,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2399,9 +2388,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2436,9 +2423,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist."##), @@ -2473,9 +2458,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2498,9 +2481,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2544,9 +2525,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2583,9 +2562,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2612,9 +2589,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2669,9 +2644,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2735,7 +2708,7 @@ fn main() { let mut app = App::new("cloudtasks2-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20190618") + .version("1.0.13+20200331") .about("Manages the execution of large numbers of distributed requests.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudtasks2_beta2/Cargo.toml b/gen/cloudtasks2_beta2/Cargo.toml index bc49693c54..2432ecc76d 100644 --- a/gen/cloudtasks2_beta2/Cargo.toml +++ b/gen/cloudtasks2_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudtasks2_beta2" -version = "1.0.12+20190618" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Tasks (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta2" homepage = "https://cloud.google.com/tasks/" -documentation = "https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618" +documentation = "https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331" license = "MIT" keywords = ["cloudtasks", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudtasks2_beta2/README.md b/gen/cloudtasks2_beta2/README.md index 65da0690a7..5b8f118e7d 100644 --- a/gen/cloudtasks2_beta2/README.md +++ b/gen/cloudtasks2_beta2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudtasks2_beta2` library allows access to all features of the *Google Cloud Tasks* service. -This documentation was generated from *Cloud Tasks* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudtasks:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Tasks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudtasks:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Tasks* *v2_beta2* API can be found at the [official documentation site](https://cloud.google.com/tasks/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.CloudTasks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.CloudTasks.html) ... * projects - * [*locations get*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks acknowledge*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskAcknowledgeCall.html), [*locations queues tasks cancel lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCancelLeaseCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskLeaseCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks renew lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRenewLeaseCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.ProjectLocationQueueTestIamPermissionCall.html) + * [*locations get*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks acknowledge*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskAcknowledgeCall.html), [*locations queues tasks cancel lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCancelLeaseCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskLeaseCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks renew lease*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRenewLeaseCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.ProjectLocationQueueTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/struct.CloudTasks.html)** +* **[Hub](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/struct.CloudTasks.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudtasks2_beta2/1.0.12+20190618/google_cloudtasks2_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudtasks2_beta2/1.0.13+20200331/google_cloudtasks2_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudtasks2_beta2/src/lib.rs b/gen/cloudtasks2_beta2/src/lib.rs index 80d669d678..fa1744ea3f 100644 --- a/gen/cloudtasks2_beta2/src/lib.rs +++ b/gen/cloudtasks2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Tasks* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudtasks:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Tasks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudtasks:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Tasks* *v2_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/tasks/). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudTasks CloudTasks { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudtasks.googleapis.com/".to_string(), _root_url: "https://cloudtasks.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> CloudTasks } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -612,82 +612,19 @@ pub struct PauseQueueRequest { _never_set: Option } impl RequestValue for PauseQueueRequest {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. -/// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. -/// -/// **JSON Example** -/// -/// ````text -/// { -/// "bindings": [ -/// { -/// "role": "roles/owner", -/// "members": [ -/// "user:mike@example.com", -/// "group:admins@example.com", -/// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" -/// ] -/// }, -/// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] -/// } -/// ] -/// } -/// ```` -/// -/// **YAML Example** -/// -/// ````text -/// bindings: -/// - members: -/// - user:mike@example.com -/// - group:admins@example.com -/// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner -/// - members: -/// - user:sean@example.com -/// role: roles/viewer -/// ```` -/// -/// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// Request message for PurgeQueue. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations queues set iam policy projects](struct.ProjectLocationQueueSetIamPolicyCall.html) (response) -/// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (response) +/// * [locations queues purge projects](struct.ProjectLocationQueuePurgeCall.html) (request) +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, - /// `etag` is used for optimistic concurrency control as a way to help - /// prevent simultaneous updates of a policy from overwriting each other. - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the policy. - /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. - pub etag: Option, - /// Deprecated. - pub version: Option, -} +pub struct PurgeQueueRequest { _never_set: Option } -impl ResponseResult for Policy {} +impl RequestValue for PurgeQueueRequest {} /// App Engine Routing. @@ -879,19 +816,124 @@ pub struct Location { impl ResponseResult for Location {} -/// Request message for PurgeQueue. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. +/// +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** +/// +/// ````text +/// { +/// "bindings": [ +/// { +/// "role": "roles/resourcemanager.organizationAdmin", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +/// ] +/// }, +/// { +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } +/// } +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 +/// } +/// ```` +/// +/// **YAML example:** +/// +/// ````text +/// bindings: +/// - members: +/// - user:mike@example.com +/// - group:admins@example.com +/// - domain:google.com +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin +/// - members: +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 +/// ```` +/// +/// For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations queues purge projects](struct.ProjectLocationQueuePurgeCall.html) (request) -/// +/// * [locations queues set iam policy projects](struct.ProjectLocationQueueSetIamPolicyCall.html) (response) +/// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PurgeQueueRequest { _never_set: Option } +pub struct Policy { + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. + pub bindings: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + pub etag: Option, + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. + pub version: Option, +} -impl RequestValue for PurgeQueueRequest {} +impl ResponseResult for Policy {} /// Request message for forcing a task to run now using @@ -992,9 +1034,7 @@ pub struct LeaseTasksRequest { /// permission on the Task resource. #[serde(rename="responseView")] pub response_view: Option, - /// Required. - /// - /// The duration of the lease. + /// Required. The duration of the lease. /// /// Each task returned in the response will /// have its schedule_time set to the current @@ -1210,30 +1250,59 @@ pub struct TestIamPermissionsRequest { impl RequestValue for TestIamPermissionsRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1430,9 +1499,7 @@ impl ResponseResult for Queue {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CancelLeaseRequest { - /// Required. - /// - /// The task's current schedule time, available in the + /// Required. The task's current schedule time, available in the /// schedule_time returned by /// LeaseTasks response or /// RenewLease response. This restriction is @@ -1468,7 +1535,11 @@ impl RequestValue for CancelLeaseRequest {} /// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} impl RequestValue for GetIamPolicyRequest {} @@ -1498,9 +1569,7 @@ pub struct CreateTaskRequest { /// permission on the Task resource. #[serde(rename="responseView")] pub response_view: Option, - /// Required. - /// - /// The task to add. + /// Required. The task to add. /// /// Task names have the following format: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. @@ -1551,9 +1620,7 @@ impl RequestValue for CreateTaskRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AcknowledgeTaskRequest { - /// Required. - /// - /// The task's current schedule time, available in the + /// Required. The task's current schedule time, available in the /// schedule_time returned by /// LeaseTasks response or /// RenewLease response. This restriction is @@ -1577,9 +1644,7 @@ impl RequestValue for AcknowledgeTaskRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RenewLeaseRequest { - /// Required. - /// - /// The task's current schedule time, available in the + /// Required. The task's current schedule time, available in the /// schedule_time returned by /// LeaseTasks response or /// RenewLease response. This restriction is @@ -1600,9 +1665,7 @@ pub struct RenewLeaseRequest { /// permission on the Task resource. #[serde(rename="responseView")] pub response_view: Option, - /// Required. - /// - /// The desired new lease duration, starting from now. + /// Required. The desired new lease duration, starting from now. /// /// /// The maximum lease duration is 1 week. @@ -1632,6 +1695,122 @@ pub struct LeaseTasksResponse { impl ResponseResult for LeaseTasksResponse {} +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + +/// App Engine HTTP target. +/// +/// The task will be delivered to the App Engine application hostname +/// specified by its AppEngineHttpTarget and AppEngineHttpRequest. +/// The documentation for AppEngineHttpRequest explains how the +/// task's host URL is constructed. +/// +/// Using AppEngineHttpTarget requires +/// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) +/// Google IAM permission for the project +/// and the following scope: +/// +/// `https://www.googleapis.com/auth/cloud-platform` +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEngineHttpTarget { + /// Overrides for the + /// task-level app_engine_routing. + /// + /// If set, `app_engine_routing_override` is used for all tasks in + /// the queue, no matter what the setting is for the + /// task-level app_engine_routing. + #[serde(rename="appEngineRoutingOverride")] + pub app_engine_routing_override: Option, +} + +impl Part for AppEngineHttpTarget {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + pub role: Option, + /// The condition that is associated with this binding. + /// NOTE: An unsatisfied condition will not allow user access via current + /// binding. Different bindings, including their conditions, are examined + /// independently. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@example.com` . + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// + /// + /// * `domain:{domain}`: The G Suite domain (primary) that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + /// Rate limits. /// /// This message determines the maximum rate that tasks can be dispatched by a @@ -1722,81 +1901,6 @@ pub struct RateLimits { impl Part for RateLimits {} -/// App Engine HTTP target. -/// -/// The task will be delivered to the App Engine application hostname -/// specified by its AppEngineHttpTarget and AppEngineHttpRequest. -/// The documentation for AppEngineHttpRequest explains how the -/// task's host URL is constructed. -/// -/// Using AppEngineHttpTarget requires -/// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) -/// Google IAM permission for the project -/// and the following scope: -/// -/// `https://www.googleapis.com/auth/cloud-platform` -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppEngineHttpTarget { - /// Overrides for the - /// task-level app_engine_routing. - /// - /// If set, `app_engine_routing_override` is used for all tasks in - /// the queue, no matter what the setting is for the - /// task-level app_engine_routing. - #[serde(rename="appEngineRoutingOverride")] - pub app_engine_routing_override: Option, -} - -impl Part for AppEngineHttpTarget {} - - -/// Associates `members` with a `role`. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Binding { - /// Role that is assigned to `members`. - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - pub role: Option, - /// The condition that is associated with this binding. - /// NOTE: An unsatisfied condition will not allow user access via current - /// binding. Different bindings, including their conditions, are examined - /// independently. - pub condition: Option, - /// Specifies the identities requesting access for a Cloud Platform resource. - /// `members` can have the following values: - /// - /// * `allUsers`: A special identifier that represents anyone who is - /// on the internet; with or without a Google account. - /// - /// * `allAuthenticatedUsers`: A special identifier that represents anyone - /// who is authenticated with a Google account or a service account. - /// - /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . - /// - /// - /// * `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. - /// - /// * `group:{emailid}`: An email address that represents a Google group. - /// For example, `admins@example.com`. - /// - /// - /// * `domain:{domain}`: The G Suite domain (primary) that represents all the - /// users of that domain. For example, `google.com` or `example.com`. - /// - /// - pub members: Option>, -} - -impl Part for Binding {} - - /// Request message for ResumeQueue. /// /// # Activities @@ -2004,8 +2108,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_get(&self, name: &str) -> ProjectLocationQueueTaskGetCall<'a, C, A> { ProjectLocationQueueTaskGetCall { @@ -2032,8 +2135,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The queue name. For example: + /// * `parent` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_tasks_list(&self, parent: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { ProjectLocationQueueTaskListCall { @@ -2066,8 +2168,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_delete(&self, name: &str) -> ProjectLocationQueueDeleteCall<'a, C, A> { ProjectLocationQueueDeleteCall { @@ -2176,8 +2277,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The location name in which the queue will be created. + /// * `parent` - Required. The location name in which the queue will be created. /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` /// The list of allowed locations can be obtained by calling Cloud /// Tasks' implementation of @@ -2199,13 +2299,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The resource name of the queue. For example: + /// * `name` - Required. The resource name of the queue. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_get(&self, name: &str) -> ProjectLocationQueueGetCall<'a, C, A> { ProjectLocationQueueGetCall { hub: self.hub, _name: name.to_string(), + _read_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2225,8 +2325,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The queue name. For example: + /// * `parent` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` /// The queue must already exist. pub fn locations_queues_tasks_create(&self, request: CreateTaskRequest, parent: &str) -> ProjectLocationQueueTaskCreateCall<'a, C, A> { @@ -2250,8 +2349,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_delete(&self, name: &str) -> ProjectLocationQueueTaskDeleteCall<'a, C, A> { ProjectLocationQueueTaskDeleteCall { @@ -2282,8 +2380,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_acknowledge(&self, request: AcknowledgeTaskRequest, name: &str) -> ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> { ProjectLocationQueueTaskAcknowledgeCall { @@ -2315,8 +2412,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_resume(&self, request: ResumeQueueRequest, name: &str) -> ProjectLocationQueueResumeCall<'a, C, A> { ProjectLocationQueueResumeCall { @@ -2341,8 +2437,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_cancel_lease(&self, request: CancelLeaseRequest, name: &str) -> ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> { ProjectLocationQueueTaskCancelLeaseCall { @@ -2363,8 +2458,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The location name. + /// * `parent` - Required. The location name. /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` pub fn locations_queues_list(&self, parent: &str) -> ProjectLocationQueueListCall<'a, C, A> { ProjectLocationQueueListCall { @@ -2412,8 +2506,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_run(&self, request: RunTaskRequest, name: &str) -> ProjectLocationQueueTaskRunCall<'a, C, A> { ProjectLocationQueueTaskRunCall { @@ -2439,8 +2532,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_pause(&self, request: PauseQueueRequest, name: &str) -> ProjectLocationQueuePauseCall<'a, C, A> { ProjectLocationQueuePauseCall { @@ -2509,8 +2601,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_renew_lease(&self, request: RenewLeaseRequest, name: &str) -> ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> { ProjectLocationQueueTaskRenewLeaseCall { @@ -2551,8 +2642,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The queue name. For example: + /// * `parent` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_tasks_lease(&self, request: LeaseTasksRequest, parent: &str) -> ProjectLocationQueueTaskLeaseCall<'a, C, A> { ProjectLocationQueueTaskLeaseCall { @@ -2623,8 +2713,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_purge(&self, request: PurgeQueueRequest, name: &str) -> ProjectLocationQueuePurgeCall<'a, C, A> { ProjectLocationQueuePurgeCall { @@ -2826,9 +2915,7 @@ impl<'a, C, A> ProjectLocationQueueTaskGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueCreateCall<'a, C, A> where C: BorrowMut hub: &'a CloudTasks, _name: String, + _read_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4474,9 +4557,12 @@ impl<'a, C, A> ProjectLocationQueueGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._read_mask { + params.push(("readMask", value.to_string())); + } + for &field in ["alt", "name", "readMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4591,9 +4677,7 @@ impl<'a, C, A> ProjectLocationQueueGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueGetCall<'a, C, A> { + self._read_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4879,9 +4971,7 @@ impl<'a, C, A> ProjectLocationQueueTaskCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskAcknowledgeCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// Required. - /// - /// The task name. For example: + /// Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` /// /// Sets the *name* path property to the given value. @@ -5724,9 +5810,7 @@ impl<'a, C, A> ProjectLocationQueueResumeCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// Required. - /// - /// The task name. For example: + /// Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` /// /// Sets the *name* path property to the given value. @@ -6117,9 +6199,9 @@ impl<'a, C, A> ProjectLocationQueueTaskCancelLeaseCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_queues_list("parent") -/// .page_token("et") -/// .page_size(-41) -/// .filter("ipsum") +/// .page_token("diam") +/// .page_size(-55) +/// .filter("Lorem") /// .doit(); /// # } /// ``` @@ -6279,9 +6361,7 @@ impl<'a, C, A> ProjectLocationQueueListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskRunCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePauseCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskRenewLeaseCall<'a, C, A> where C: BorrowM self._request = new_value; self } - /// Required. - /// - /// The task name. For example: + /// Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` /// /// Sets the *name* path property to the given value. @@ -8044,9 +8118,7 @@ impl<'a, C, A> ProjectLocationQueueTaskLeaseCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskLeaseCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePurgeCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Tasks (protocol v2beta3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudtasks2_beta3] path = "../cloudtasks2_beta3" -version = "1.0.12+20190618" +version = "1.0.13+20200331" diff --git a/gen/cloudtasks2_beta3-cli/README.md b/gen/cloudtasks2_beta3-cli/README.md index 81b938a200..20f4a19415 100644 --- a/gen/cloudtasks2_beta3-cli/README.md +++ b/gen/cloudtasks2_beta3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Tasks* API at revision *20190618*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Tasks* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash cloudtasks2-beta3 [options] diff --git a/gen/cloudtasks2_beta3-cli/mkdocs.yml b/gen/cloudtasks2_beta3-cli/mkdocs.yml index 52513012c5..ddd30c009a 100644 --- a/gen/cloudtasks2_beta3-cli/mkdocs.yml +++ b/gen/cloudtasks2_beta3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Tasks v1.0.12+20190618 +site_name: Cloud Tasks v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-cloudtasks2_beta3-cli site_description: A complete library to interact with Cloud Tasks (protocol v2beta3) diff --git a/gen/cloudtasks2_beta3-cli/src/main.rs b/gen/cloudtasks2_beta3-cli/src/main.rs index 8aa128f243..47ddf00090 100644 --- a/gen/cloudtasks2_beta3-cli/src/main.rs +++ b/gen/cloudtasks2_beta3-cli/src/main.rs @@ -387,8 +387,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1624,9 +1625,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name in which the queue will be created. + Some(r##"Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud @@ -1671,9 +1670,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1696,9 +1693,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The resource name of the queue. For example: + Some(r##"Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1760,9 +1755,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The location name. + Some(r##"Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`"##), Some(true), Some(false)), @@ -1851,9 +1844,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1887,9 +1878,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -1930,9 +1919,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2004,9 +1991,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist."##), @@ -2041,9 +2026,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2066,9 +2049,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2099,9 +2080,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The queue name. For example: + Some(r##"Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`"##), Some(true), Some(false)), @@ -2147,9 +2126,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The task name. For example: + Some(r##"Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`"##), Some(true), Some(false)), @@ -2213,7 +2190,7 @@ fn main() { let mut app = App::new("cloudtasks2-beta3") .author("Sebastian Thiel ") - .version("1.0.12+20190618") + .version("1.0.13+20200331") .about("Manages the execution of large numbers of distributed requests.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudtasks2_beta3_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudtasks2_beta3/Cargo.toml b/gen/cloudtasks2_beta3/Cargo.toml index 78de7e9a7c..bc933840d5 100644 --- a/gen/cloudtasks2_beta3/Cargo.toml +++ b/gen/cloudtasks2_beta3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudtasks2_beta3" -version = "1.0.12+20190618" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Tasks (protocol v2beta3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtasks2_beta3" homepage = "https://cloud.google.com/tasks/" -documentation = "https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618" +documentation = "https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331" license = "MIT" keywords = ["cloudtasks", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudtasks2_beta3/README.md b/gen/cloudtasks2_beta3/README.md index c628a24e7b..380860bcdc 100644 --- a/gen/cloudtasks2_beta3/README.md +++ b/gen/cloudtasks2_beta3/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudtasks2_beta3` library allows access to all features of the *Google Cloud Tasks* service. -This documentation was generated from *Cloud Tasks* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudtasks:v2beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Tasks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudtasks:v2beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Tasks* *v2_beta3* API can be found at the [official documentation site](https://cloud.google.com/tasks/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.CloudTasks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.CloudTasks.html) ... * projects - * [*locations get*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.ProjectLocationQueueTestIamPermissionCall.html) + * [*locations get*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationListCall.html), [*locations queues create*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueCreateCall.html), [*locations queues delete*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueDeleteCall.html), [*locations queues get*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueGetCall.html), [*locations queues get iam policy*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueGetIamPolicyCall.html), [*locations queues list*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueListCall.html), [*locations queues patch*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueuePatchCall.html), [*locations queues pause*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueuePauseCall.html), [*locations queues purge*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueuePurgeCall.html), [*locations queues resume*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueResumeCall.html), [*locations queues set iam policy*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueSetIamPolicyCall.html), [*locations queues tasks create*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskCreateCall.html), [*locations queues tasks delete*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskDeleteCall.html), [*locations queues tasks get*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskGetCall.html), [*locations queues tasks list*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskListCall.html), [*locations queues tasks run*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueTaskRunCall.html) and [*locations queues test iam permissions*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.ProjectLocationQueueTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/struct.CloudTasks.html)** +* **[Hub](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/struct.CloudTasks.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudtasks2_beta3/1.0.12+20190618/google_cloudtasks2_beta3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudtasks2_beta3/1.0.13+20200331/google_cloudtasks2_beta3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudtasks2_beta3/src/lib.rs b/gen/cloudtasks2_beta3/src/lib.rs index bfda130516..b854f85cf1 100644 --- a/gen/cloudtasks2_beta3/src/lib.rs +++ b/gen/cloudtasks2_beta3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Tasks* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *cloudtasks:v2beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Tasks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *cloudtasks:v2beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Tasks* *v2_beta3* API can be found at the //! [official documentation site](https://cloud.google.com/tasks/). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudTasks CloudTasks { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudtasks.googleapis.com/".to_string(), _root_url: "https://cloudtasks.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> CloudTasks } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -379,7 +379,7 @@ impl<'a, C, A> CloudTasks /// /// The task will be pushed to the worker as an HTTP request. If the worker /// or the redirected worker acknowledges the task by returning a successful HTTP -/// response code ([`200` - `299`]), the task will removed from the queue. If +/// response code ([`200` - `299`]), the task will be removed from the queue. If /// any other HTTP response code is returned or no response is received, the /// task will be retried according to the following: /// @@ -392,13 +392,13 @@ impl<'a, C, A> CloudTasks /// /// System throttling happens because: /// -/// * Cloud Tasks backoffs on all errors. Normally the backoff specified in +/// * Cloud Tasks backs off on all errors. Normally the backoff specified in /// rate limits will be used. But if the worker returns /// `429` (Too Many Requests), `503` (Service Unavailable), or the rate of /// errors is high, Cloud Tasks will use a higher backoff rate. The retry /// specified in the `Retry-After` HTTP response header is considered. /// -/// * To prevent traffic spikes and to smooth sudden large traffic spikes, +/// * To prevent traffic spikes and to smooth sudden increases in traffic, /// dispatches ramp up slowly when the queue is newly created or idle and /// if large numbers of tasks suddenly become available to dispatch (due to /// spikes in create task rates, the queue being unpaused, or many tasks @@ -585,7 +585,7 @@ pub struct AppEngineHttpRequest { /// In addition, Cloud Tasks sets some headers when the task is dispatched, /// such as headers containing information about the task; see /// [request - /// headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + /// headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). /// These headers are set only when the task is dispatched, so they are not /// visible when the task is returned in a Cloud Tasks response. /// @@ -637,7 +637,11 @@ impl Part for AppEngineHttpRequest {} /// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} impl RequestValue for GetIamPolicyRequest {} @@ -710,30 +714,59 @@ pub struct PauseQueueRequest { _never_set: Option } impl RequestValue for PauseQueueRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -882,37 +915,50 @@ impl RequestValue for Queue {} impl ResponseResult for Queue {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -920,15 +966,21 @@ impl ResponseResult for Queue {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -939,8 +991,9 @@ impl ResponseResult for Queue {} /// * [locations queues get iam policy projects](struct.ProjectLocationQueueGetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -950,10 +1003,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -1379,7 +1454,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1388,6 +1463,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1442,6 +1537,27 @@ pub struct StackdriverLoggingConfig { impl Part for StackdriverLoggingConfig {} +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + /// Request message for CreateTask. /// /// # Activities @@ -1467,9 +1583,7 @@ pub struct CreateTaskRequest { /// permission on the Task resource. #[serde(rename="responseView")] pub response_view: Option, - /// Required. - /// - /// The task to add. + /// Required. The task to add. /// /// Task names have the following format: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. @@ -1873,8 +1987,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_run(&self, request: RunTaskRequest, name: &str) -> ProjectLocationQueueTaskRunCall<'a, C, A> { ProjectLocationQueueTaskRunCall { @@ -1900,8 +2013,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_pause(&self, request: PauseQueueRequest, name: &str) -> ProjectLocationQueuePauseCall<'a, C, A> { ProjectLocationQueuePauseCall { @@ -1920,8 +2032,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_get(&self, name: &str) -> ProjectLocationQueueTaskGetCall<'a, C, A> { ProjectLocationQueueTaskGetCall { @@ -1948,8 +2059,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The queue name. For example: + /// * `parent` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_tasks_list(&self, parent: &str) -> ProjectLocationQueueTaskListCall<'a, C, A> { ProjectLocationQueueTaskListCall { @@ -1983,8 +2093,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_resume(&self, request: ResumeQueueRequest, name: &str) -> ProjectLocationQueueResumeCall<'a, C, A> { ProjectLocationQueueResumeCall { @@ -2122,8 +2231,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The location name in which the queue will be created. + /// * `parent` - Required. The location name in which the queue will be created. /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` /// The list of allowed locations can be obtained by calling Cloud /// Tasks' implementation of @@ -2157,8 +2265,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_delete(&self, name: &str) -> ProjectLocationQueueDeleteCall<'a, C, A> { ProjectLocationQueueDeleteCall { @@ -2198,8 +2305,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The location name. + /// * `parent` - Required. The location name. /// For example: `projects/PROJECT_ID/locations/LOCATION_ID` pub fn locations_queues_list(&self, parent: &str) -> ProjectLocationQueueListCall<'a, C, A> { ProjectLocationQueueListCall { @@ -2263,8 +2369,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The resource name of the queue. For example: + /// * `name` - Required. The resource name of the queue. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_get(&self, name: &str) -> ProjectLocationQueueGetCall<'a, C, A> { ProjectLocationQueueGetCall { @@ -2288,8 +2393,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. - /// The queue name. For example: + /// * `name` - Required. The queue name. For example: /// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` pub fn locations_queues_purge(&self, request: PurgeQueueRequest, name: &str) -> ProjectLocationQueuePurgeCall<'a, C, A> { ProjectLocationQueuePurgeCall { @@ -2313,8 +2417,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The queue name. For example: + /// * `parent` - Required. The queue name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` /// The queue must already exist. pub fn locations_queues_tasks_create(&self, request: CreateTaskRequest, parent: &str) -> ProjectLocationQueueTaskCreateCall<'a, C, A> { @@ -2338,8 +2441,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The task name. For example: + /// * `name` - Required. The task name. For example: /// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` pub fn locations_queues_tasks_delete(&self, name: &str) -> ProjectLocationQueueTaskDeleteCall<'a, C, A> { ProjectLocationQueueTaskDeleteCall { @@ -2589,9 +2691,7 @@ impl<'a, C, A> ProjectLocationQueueTaskRunCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePauseCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueResumeCall<'a, C, A> where C: BorrowMut ProjectLocationQueueCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationQueueListCall<'a, C, A> where C: BorrowMut ProjectLocationQueueGetCall<'a, C, A> where C: BorrowMut ProjectLocationQueuePurgeCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskCreateCall<'a, C, A> where C: BorrowMut ProjectLocationQueueTaskDeleteCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Trace (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtrace1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudtrace1] path = "../cloudtrace1" -version = "1.0.12+20190622" +version = "1.0.13+20200330" diff --git a/gen/cloudtrace1-cli/README.md b/gen/cloudtrace1-cli/README.md index 8e7fa4b755..a5f02a3139 100644 --- a/gen/cloudtrace1-cli/README.md +++ b/gen/cloudtrace1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Trace* API at revision *20190622*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Trace* API at revision *20200330*. The CLI is at version *1.0.13*. ```bash cloudtrace1 [options] diff --git a/gen/cloudtrace1-cli/mkdocs.yml b/gen/cloudtrace1-cli/mkdocs.yml index a93919736c..7d5a2c8751 100644 --- a/gen/cloudtrace1-cli/mkdocs.yml +++ b/gen/cloudtrace1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Trace v1.0.12+20190622 +site_name: Cloud Trace v1.0.13+20200330 site_url: http://byron.github.io/google-apis-rs/google-cloudtrace1-cli site_description: A complete library to interact with Cloud Trace (protocol v1) diff --git a/gen/cloudtrace1-cli/src/main.rs b/gen/cloudtrace1-cli/src/main.rs index 85f470698b..099e73ba3a 100644 --- a/gen/cloudtrace1-cli/src/main.rs +++ b/gen/cloudtrace1-cli/src/main.rs @@ -369,12 +369,14 @@ fn main() { of a trace that you send matches that of an existing trace, any fields in the existing trace and its spans are overwritten by the provided values, and any new fields provided are merged with the existing trace data. If the - ID does not match, a new trace is created."##), + ID does not match, a new trace is created. + In this case, writing traces is not considered an active developer + method since traces are machine generated."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtrace1_cli/projects_patch-traces", vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the Cloud project where the trace data is stored."##), + Some(r##"Required. ID of the Cloud project where the trace data is stored."##), Some(true), Some(false)), @@ -397,18 +399,20 @@ fn main() { Some(false)), ]), ("traces-get", - Some(r##"Gets a single trace by its ID."##), + Some(r##"Gets a single trace by its ID. + In this case, getting for traces is considered an active developer method, + even though it is technically a read-only method."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtrace1_cli/projects_traces-get", vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the Cloud project where the trace data is stored."##), + Some(r##"Required. ID of the Cloud project where the trace data is stored."##), Some(true), Some(false)), (Some(r##"trace-id"##), None, - Some(r##"ID of the trace to return."##), + Some(r##"Required. ID of the trace to return."##), Some(true), Some(false)), @@ -425,12 +429,14 @@ fn main() { Some(false)), ]), ("traces-list", - Some(r##"Returns of a list of traces that match the specified filter conditions."##), + Some(r##"Returns of a list of traces that match the specified filter conditions. + In this case, listing for traces is considered an active developer method, + even though it is technically a read-only method."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtrace1_cli/projects_traces-list", vec![ (Some(r##"project-id"##), None, - Some(r##"ID of the Cloud project where the trace data is stored."##), + Some(r##"Required. ID of the Cloud project where the trace data is stored."##), Some(true), Some(false)), @@ -452,8 +458,8 @@ fn main() { let mut app = App::new("cloudtrace1") .author("Sebastian Thiel ") - .version("1.0.12+20190622") - .about("Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenCensus. + .version("1.0.13+20200330") + .about("Sends application trace data to Cloud Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Cloud Trace API directly. If you are looking to instrument your application for Cloud Trace, we recommend using OpenCensus. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudtrace1_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudtrace1/Cargo.toml b/gen/cloudtrace1/Cargo.toml index 978555d23d..a22d823e46 100644 --- a/gen/cloudtrace1/Cargo.toml +++ b/gen/cloudtrace1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudtrace1" -version = "1.0.12+20190622" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Trace (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtrace1" homepage = "https://cloud.google.com/trace" -documentation = "https://docs.rs/google-cloudtrace1/1.0.12+20190622" +documentation = "https://docs.rs/google-cloudtrace1/1.0.13+20200330" license = "MIT" keywords = ["cloudtrace", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudtrace1/README.md b/gen/cloudtrace1/README.md index bf22777f6e..d97875f0ce 100644 --- a/gen/cloudtrace1/README.md +++ b/gen/cloudtrace1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudtrace1` library allows access to all features of the *Google Cloud Trace* service. -This documentation was generated from *Cloud Trace* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudtrace:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Trace* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *cloudtrace:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Trace* *v1* API can be found at the [official documentation site](https://cloud.google.com/trace). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/struct.CloudTrace.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/struct.CloudTrace.html) ... * projects - * [*patch traces*](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/struct.ProjectPatchTraceCall.html), [*traces get*](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/struct.ProjectTraceGetCall.html) and [*traces list*](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/struct.ProjectTraceListCall.html) + * [*patch traces*](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/struct.ProjectPatchTraceCall.html), [*traces get*](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/struct.ProjectTraceGetCall.html) and [*traces list*](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/struct.ProjectTraceListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/struct.CloudTrace.html)** +* **[Hub](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/struct.CloudTrace.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -124,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -144,29 +144,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudtrace1/1.0.12+20190622/google_cloudtrace1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudtrace1/1.0.13+20200330/google_cloudtrace1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudtrace1/src/lib.rs b/gen/cloudtrace1/src/lib.rs index 0f2042f8cb..d2ec54cb8c 100644 --- a/gen/cloudtrace1/src/lib.rs +++ b/gen/cloudtrace1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Trace* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudtrace:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Trace* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *cloudtrace:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Trace* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/trace). @@ -325,7 +325,7 @@ impl<'a, C, A> CloudTrace CloudTrace { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudtrace.googleapis.com/".to_string(), _root_url: "https://cloudtrace.googleapis.com/".to_string(), } @@ -336,7 +336,7 @@ impl<'a, C, A> CloudTrace } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -471,7 +471,7 @@ pub struct TraceSpan { /// two spans with the same name may be distinguished using `RPC_CLIENT` /// and `RPC_SERVER` to identify queueing latency associated with the span. pub kind: Option, - /// ID of the parent span, if any. Optional. + /// Optional. ID of the parent span, if any. #[serde(rename="parentSpanId")] pub parent_span_id: Option, /// Name of the span. Must be less than 128 bytes. The span name is sanitized @@ -580,11 +580,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Gets a single trace by its ID. + /// In this case, getting for traces is considered an active developer method, + /// even though it is technically a read-only method. /// /// # Arguments /// - /// * `projectId` - ID of the Cloud project where the trace data is stored. - /// * `traceId` - ID of the trace to return. + /// * `projectId` - Required. ID of the Cloud project where the trace data is stored. + /// * `traceId` - Required. ID of the trace to return. pub fn traces_get(&self, project_id: &str, trace_id: &str) -> ProjectTraceGetCall<'a, C, A> { ProjectTraceGetCall { hub: self.hub, @@ -603,11 +605,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// in the existing trace and its spans are overwritten by the provided values, /// and any new fields provided are merged with the existing trace data. If the /// ID does not match, a new trace is created. + /// In this case, writing traces is not considered an active developer + /// method since traces are machine generated. /// /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - ID of the Cloud project where the trace data is stored. + /// * `projectId` - Required. ID of the Cloud project where the trace data is stored. pub fn patch_traces(&self, request: Traces, project_id: &str) -> ProjectPatchTraceCall<'a, C, A> { ProjectPatchTraceCall { hub: self.hub, @@ -622,10 +626,12 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Returns of a list of traces that match the specified filter conditions. + /// In this case, listing for traces is considered an active developer method, + /// even though it is technically a read-only method. /// /// # Arguments /// - /// * `projectId` - ID of the Cloud project where the trace data is stored. + /// * `projectId` - Required. ID of the Cloud project where the trace data is stored. pub fn traces_list(&self, project_id: &str) -> ProjectTraceListCall<'a, C, A> { ProjectTraceListCall { hub: self.hub, @@ -653,6 +659,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // ################# /// Gets a single trace by its ID. +/// In this case, getting for traces is considered an active developer method, +/// even though it is technically a read-only method. /// /// A builder for the *traces.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -825,7 +833,7 @@ impl<'a, C, A> ProjectTraceGetCall<'a, C, A> where C: BorrowMut, } - /// ID of the Cloud project where the trace data is stored. + /// Required. ID of the Cloud project where the trace data is stored. /// /// Sets the *project id* path property to the given value. /// @@ -835,7 +843,7 @@ impl<'a, C, A> ProjectTraceGetCall<'a, C, A> where C: BorrowMut, self._project_id = new_value.to_string(); self } - /// ID of the trace to return. + /// Required. ID of the trace to return. /// /// Sets the *trace id* path property to the given value. /// @@ -913,6 +921,8 @@ impl<'a, C, A> ProjectTraceGetCall<'a, C, A> where C: BorrowMut, /// in the existing trace and its spans are overwritten by the provided values, /// and any new fields provided are merged with the existing trace data. If the /// ID does not match, a new trace is created. +/// In this case, writing traces is not considered an active developer +/// method since traces are machine generated. /// /// A builder for the *patchTraces* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -1114,7 +1124,7 @@ impl<'a, C, A> ProjectPatchTraceCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// ID of the Cloud project where the trace data is stored. + /// Required. ID of the Cloud project where the trace data is stored. /// /// Sets the *project id* path property to the given value. /// @@ -1188,6 +1198,8 @@ impl<'a, C, A> ProjectPatchTraceCall<'a, C, A> where C: BorrowMut /// Returns of a list of traces that match the specified filter conditions. +/// In this case, listing for traces is considered an active developer method, +/// even though it is technically a read-only method. /// /// A builder for the *traces.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -1393,7 +1405,7 @@ impl<'a, C, A> ProjectTraceListCall<'a, C, A> where C: BorrowMut, } - /// ID of the Cloud project where the trace data is stored. + /// Required. ID of the Cloud project where the trace data is stored. /// /// Sets the *project id* path property to the given value. /// @@ -1403,7 +1415,7 @@ impl<'a, C, A> ProjectTraceListCall<'a, C, A> where C: BorrowMut, self._project_id = new_value.to_string(); self } - /// Type of data returned for traces in the list. Optional. Default is + /// Optional. Type of data returned for traces in the list. Default is /// `MINIMAL`. /// /// Sets the *view* query property to the given value. @@ -1420,23 +1432,23 @@ impl<'a, C, A> ProjectTraceListCall<'a, C, A> where C: BorrowMut, self } /// Token identifying the page of results to return. If provided, use the - /// value of the `next_page_token` field from a previous request. Optional. + /// value of the `next_page_token` field from a previous request. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ProjectTraceListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of traces to return. If not specified or <= 0, the + /// Optional. Maximum number of traces to return. If not specified or <= 0, the /// implementation selects a reasonable value. The implementation may - /// return fewer traces than the requested page size. Optional. + /// return fewer traces than the requested page size. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectTraceListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Field used to sort the returned traces. Optional. + /// Optional. Field used to sort the returned traces. /// Can be one of the following: /// /// * `trace_id` @@ -1455,7 +1467,7 @@ impl<'a, C, A> ProjectTraceListCall<'a, C, A> where C: BorrowMut, self._order_by = Some(new_value.to_string()); self } - /// An optional filter against labels for the request. + /// Optional. A filter against labels for the request. /// /// By default, searches use prefix matching. To specify exact match, prepend /// a plus symbol (`+`) to the search term. diff --git a/gen/cloudtrace2-cli/Cargo.toml b/gen/cloudtrace2-cli/Cargo.toml index 831f5b460e..e002191edb 100644 --- a/gen/cloudtrace2-cli/Cargo.toml +++ b/gen/cloudtrace2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudtrace2-cli" -version = "1.0.12+20190622" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Trace (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtrace2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-cloudtrace2] path = "../cloudtrace2" -version = "1.0.12+20190622" +version = "1.0.13+20200330" diff --git a/gen/cloudtrace2-cli/README.md b/gen/cloudtrace2-cli/README.md index eab961fd6a..dca6346d6f 100644 --- a/gen/cloudtrace2-cli/README.md +++ b/gen/cloudtrace2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Trace* API at revision *20190622*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Trace* API at revision *20200330*. The CLI is at version *1.0.13*. ```bash cloudtrace2 [options] diff --git a/gen/cloudtrace2-cli/mkdocs.yml b/gen/cloudtrace2-cli/mkdocs.yml index 412cab63b7..b1a64d9ad4 100644 --- a/gen/cloudtrace2-cli/mkdocs.yml +++ b/gen/cloudtrace2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Trace v1.0.12+20190622 +site_name: Cloud Trace v1.0.13+20200330 site_url: http://byron.github.io/google-apis-rs/google-cloudtrace2-cli site_description: A complete library to interact with Cloud Trace (protocol v2) diff --git a/gen/cloudtrace2-cli/src/main.rs b/gen/cloudtrace2-cli/src/main.rs index 46f4b195b1..f4ffec1bff 100644 --- a/gen/cloudtrace2-cli/src/main.rs +++ b/gen/cloudtrace2-cli/src/main.rs @@ -162,6 +162,7 @@ impl<'n> Engine<'n> { "links.dropped-links-count" => Some(("links.droppedLinksCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "stack-trace.stack-trace-hash-id" => Some(("stackTrace.stackTraceHashId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "stack-trace.stack-frames.dropped-frames-count" => Some(("stackTrace.stackFrames.droppedFramesCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "span-kind" => Some(("spanKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parent-span-id" => Some(("parentSpanId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "span-id" => Some(("spanId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -171,7 +172,7 @@ impl<'n> Engine<'n> { "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "same-process-as-parent-span" => Some(("sameProcessAsParentSpan", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attributes", "child-span-count", "code", "display-name", "dropped-annotations-count", "dropped-attributes-count", "dropped-frames-count", "dropped-links-count", "dropped-message-events-count", "end-time", "links", "message", "name", "parent-span-id", "same-process-as-parent-span", "span-id", "stack-frames", "stack-trace", "stack-trace-hash-id", "start-time", "status", "time-events", "truncated-byte-count", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attributes", "child-span-count", "code", "display-name", "dropped-annotations-count", "dropped-attributes-count", "dropped-frames-count", "dropped-links-count", "dropped-message-events-count", "end-time", "links", "message", "name", "parent-span-id", "same-process-as-parent-span", "span-id", "span-kind", "stack-frames", "stack-trace", "stack-trace-hash-id", "start-time", "status", "time-events", "truncated-byte-count", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -338,7 +339,9 @@ fn main() { ("projects", "methods: 'traces-batch-write' and 'traces-spans-create-span'", vec![ ("traces-batch-write", Some(r##"Sends new spans to new or existing traces. You cannot update - existing spans."##), + existing spans. + In this case, writing traces is not considered an active developer + method since traces are machine generated."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtrace2_cli/projects_traces-batch-write", vec![ (Some(r##"name"##), @@ -367,7 +370,9 @@ fn main() { Some(false)), ]), ("traces-spans-create-span", - Some(r##"Creates a new span."##), + Some(r##"Creates a new span. + In this case, writing traces is not considered an active developer + method since traces are machine generated."##), "Details at http://byron.github.io/google-apis-rs/google_cloudtrace2_cli/projects_traces-spans-create-span", vec![ (Some(r##"name"##), @@ -406,8 +411,8 @@ fn main() { let mut app = App::new("cloudtrace2") .author("Sebastian Thiel ") - .version("1.0.12+20190622") - .about("Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenCensus. + .version("1.0.13+20200330") + .about("Sends application trace data to Cloud Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Cloud Trace API directly. If you are looking to instrument your application for Cloud Trace, we recommend using OpenCensus. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudtrace2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudtrace2/Cargo.toml b/gen/cloudtrace2/Cargo.toml index 32bb54521a..e38709c5b6 100644 --- a/gen/cloudtrace2/Cargo.toml +++ b/gen/cloudtrace2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudtrace2" -version = "1.0.12+20190622" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Trace (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudtrace2" homepage = "https://cloud.google.com/trace" -documentation = "https://docs.rs/google-cloudtrace2/1.0.12+20190622" +documentation = "https://docs.rs/google-cloudtrace2/1.0.13+20200330" license = "MIT" keywords = ["cloudtrace", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/cloudtrace2/README.md b/gen/cloudtrace2/README.md index 28d5df54fc..276b136dd6 100644 --- a/gen/cloudtrace2/README.md +++ b/gen/cloudtrace2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-cloudtrace2` library allows access to all features of the *Google Cloud Trace* service. -This documentation was generated from *Cloud Trace* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudtrace:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Trace* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *cloudtrace:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Trace* *v2* API can be found at the [official documentation site](https://cloud.google.com/trace). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/struct.CloudTrace.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/struct.CloudTrace.html) ... * projects - * [*traces batch write*](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/struct.ProjectTraceBatchWriteCall.html) and [*traces spans create span*](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/struct.ProjectTraceSpanCreateSpanCall.html) + * [*traces batch write*](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/struct.ProjectTraceBatchWriteCall.html) and [*traces spans create span*](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/struct.ProjectTraceSpanCreateSpanCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/struct.CloudTrace.html)** +* **[Hub](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/struct.CloudTrace.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudtrace2/1.0.12+20190622/google_cloudtrace2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudtrace2/1.0.13+20200330/google_cloudtrace2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudtrace2/src/lib.rs b/gen/cloudtrace2/src/lib.rs index 46187ab548..b2f3c3fcf3 100644 --- a/gen/cloudtrace2/src/lib.rs +++ b/gen/cloudtrace2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Trace* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *cloudtrace:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Trace* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *cloudtrace:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Trace* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/trace). @@ -333,7 +333,7 @@ impl<'a, C, A> CloudTrace CloudTrace { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://cloudtrace.googleapis.com/".to_string(), _root_url: "https://cloudtrace.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> CloudTrace } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -413,13 +413,13 @@ impl Part for StackTrace {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Span { - /// An optional final status for this span. + /// Optional. The final status for this span. pub status: Option, - /// An optional number of child spans that were generated while this span + /// Optional. The number of child spans that were generated while this span /// was active. If set, allows implementation to detect missing child spans. #[serde(rename="childSpanCount")] pub child_span_count: Option, - /// A description of the span's operation (up to 128 bytes). + /// Required. A description of the span's operation (up to 128 bytes). /// Stackdriver Trace displays the description in the /// Google Cloud Platform Console. /// For example, the display name can be a qualified method name or a file name @@ -444,11 +444,16 @@ pub struct Span { /// Stack trace captured at the start of the span. #[serde(rename="stackTrace")] pub stack_trace: Option, + /// Distinguishes between spans generated in a particular context. For example, + /// two spans with the same name may be distinguished using `CLIENT` (caller) + /// and `SERVER` (callee) to identify an RPC call. + #[serde(rename="spanKind")] + pub span_kind: Option, /// The [SPAN_ID] of this span's parent span. If this is a root span, /// then this field must be empty. #[serde(rename="parentSpanId")] pub parent_span_id: Option, - /// The start time of the span. On the client side, this is the time kept by + /// Required. The start time of the span. On the client side, this is the time kept by /// the local machine where the span execution starts. On the server side, this /// is the time when the server's application handler starts running. #[serde(rename="startTime")] @@ -456,19 +461,19 @@ pub struct Span { /// A set of attributes on the span. You can have up to 32 attributes per /// span. pub attributes: Option, - /// The [SPAN_ID] portion of the span's resource name. + /// Required. The [SPAN_ID] portion of the span's resource name. #[serde(rename="spanId")] pub span_id: Option, /// A set of time events. You can have up to 32 annotations and 128 message /// events per span. #[serde(rename="timeEvents")] pub time_events: Option, - /// The end time of the span. On the client side, this is the time kept by + /// Required. The end time of the span. On the client side, this is the time kept by /// the local machine where the span execution ends. On the server side, this /// is the time when the server application handler stops running. #[serde(rename="endTime")] pub end_time: Option, - /// (Optional) Set this parameter to indicate whether this span is in + /// Optional. Set this parameter to indicate whether this span is in /// the same process as its parent. If you do not set this parameter, /// Stackdriver Trace is unable to take advantage of this helpful /// information. @@ -628,7 +633,7 @@ impl Part for MessageEvent {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchWriteSpansRequest { - /// A list of new spans. The span names must not match existing + /// Required. A list of new spans. The span names must not match existing /// spans, or the results are undefined. pub spans: Option>, } @@ -868,6 +873,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Creates a new span. + /// In this case, writing traces is not considered an active developer + /// method since traces are machine generated. /// /// # Arguments /// @@ -892,6 +899,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Sends new spans to new or existing traces. You cannot update /// existing spans. + /// In this case, writing traces is not considered an active developer + /// method since traces are machine generated. /// /// # Arguments /// @@ -919,6 +928,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // ################# /// Creates a new span. +/// In this case, writing traces is not considered an active developer +/// method since traces are machine generated. /// /// A builder for the *traces.spans.createSpan* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -1208,6 +1219,8 @@ impl<'a, C, A> ProjectTraceSpanCreateSpanCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud User Accounts (protocol vm_beta)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouduseraccountsvm_beta-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-clouduseraccountsvm_beta] path = "../clouduseraccountsvm_beta" -version = "1.0.12+20160316" +version = "1.0.13+20160316" diff --git a/gen/clouduseraccountsvm_beta-cli/README.md b/gen/clouduseraccountsvm_beta-cli/README.md index 1c197850e8..d31538d0c8 100644 --- a/gen/clouduseraccountsvm_beta-cli/README.md +++ b/gen/clouduseraccountsvm_beta-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud User Accounts* API at revision *20160316*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud User Accounts* API at revision *20160316*. The CLI is at version *1.0.13*. ```bash clouduseraccountsvm-beta [options] diff --git a/gen/clouduseraccountsvm_beta-cli/mkdocs.yml b/gen/clouduseraccountsvm_beta-cli/mkdocs.yml index 39100700cb..09e03d367e 100644 --- a/gen/clouduseraccountsvm_beta-cli/mkdocs.yml +++ b/gen/clouduseraccountsvm_beta-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud User Accounts v1.0.12+20160316 +site_name: Cloud User Accounts v1.0.13+20160316 site_url: http://byron.github.io/google-apis-rs/google-clouduseraccountsvm_beta-cli site_description: A complete library to interact with Cloud User Accounts (protocol vm_beta) diff --git a/gen/clouduseraccountsvm_beta-cli/src/main.rs b/gen/clouduseraccountsvm_beta-cli/src/main.rs index 99eb9021d9..cb7a39a135 100644 --- a/gen/clouduseraccountsvm_beta-cli/src/main.rs +++ b/gen/clouduseraccountsvm_beta-cli/src/main.rs @@ -1840,7 +1840,7 @@ fn main() { let mut app = App::new("clouduseraccountsvm-beta") .author("Sebastian Thiel ") - .version("1.0.12+20160316") + .version("1.0.13+20160316") .about("Creates and manages users and groups for accessing Google Compute Engine virtual machines.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_clouduseraccountsvm_beta_cli") .arg(Arg::with_name("url") diff --git a/gen/clouduseraccountsvm_beta/Cargo.toml b/gen/clouduseraccountsvm_beta/Cargo.toml index d3ba14c0dd..a08b45cf84 100644 --- a/gen/clouduseraccountsvm_beta/Cargo.toml +++ b/gen/clouduseraccountsvm_beta/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-clouduseraccountsvm_beta" -version = "1.0.12+20160316" +version = "1.0.13+20160316" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud User Accounts (protocol vm_beta)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouduseraccountsvm_beta" homepage = "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/" -documentation = "https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316" +documentation = "https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316" license = "MIT" keywords = ["clouduseraccounts", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/clouduseraccountsvm_beta/README.md b/gen/clouduseraccountsvm_beta/README.md index 3ce6ae4b49..809c738a4c 100644 --- a/gen/clouduseraccountsvm_beta/README.md +++ b/gen/clouduseraccountsvm_beta/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-clouduseraccountsvm_beta` library allows access to all features of the *Google Cloud User Accounts* service. -This documentation was generated from *Cloud User Accounts* crate version *1.0.12+20160316*, where *20160316* is the exact revision of the *clouduseraccounts:vm_beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud User Accounts* crate version *1.0.13+20160316*, where *20160316* is the exact revision of the *clouduseraccounts:vm_beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud User Accounts* *vm_beta* API can be found at the [official documentation site](https://cloud.google.com/compute/docs/access/user-accounts/api/latest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.CloudUserAccounts.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.CloudUserAccounts.html) ... * global accounts operations - * [*delete*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GlobalAccountsOperationDeleteCall.html), [*get*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GlobalAccountsOperationGetCall.html) and [*list*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GlobalAccountsOperationListCall.html) -* [groups](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.Group.html) - * [*add member*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GroupAddMemberCall.html), [*delete*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GroupListCall.html) and [*remove member*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.GroupRemoveMemberCall.html) + * [*delete*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GlobalAccountsOperationDeleteCall.html), [*get*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GlobalAccountsOperationGetCall.html) and [*list*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GlobalAccountsOperationListCall.html) +* [groups](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.Group.html) + * [*add member*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GroupAddMemberCall.html), [*delete*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GroupListCall.html) and [*remove member*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.GroupRemoveMemberCall.html) * linux - * [*get authorized keys view*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.LinuxGetAuthorizedKeysViewCall.html) and [*get linux account views*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.LinuxGetLinuxAccountViewCall.html) -* [users](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.User.html) - * [*add public key*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.UserAddPublicKeyCall.html), [*delete*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.UserGetCall.html), [*insert*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.UserInsertCall.html), [*list*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.UserListCall.html) and [*remove public key*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.UserRemovePublicKeyCall.html) + * [*get authorized keys view*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.LinuxGetAuthorizedKeysViewCall.html) and [*get linux account views*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.LinuxGetLinuxAccountViewCall.html) +* [users](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.User.html) + * [*add public key*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.UserAddPublicKeyCall.html), [*delete*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.UserGetCall.html), [*insert*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.UserInsertCall.html), [*list*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.UserListCall.html) and [*remove public key*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.UserRemovePublicKeyCall.html) @@ -29,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/struct.CloudUserAccounts.html)** +* **[Hub](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/struct.CloudUserAccounts.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.Part.html)** + * **[Parts](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -144,17 +144,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -164,29 +164,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.RequestValue.html) and -[decodable](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.RequestValue.html) and +[decodable](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-clouduseraccountsvm_beta/1.0.12+20160316/google_clouduseraccountsvm_beta/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-clouduseraccountsvm_beta/1.0.13+20160316/google_clouduseraccountsvm_beta/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/clouduseraccountsvm_beta/src/lib.rs b/gen/clouduseraccountsvm_beta/src/lib.rs index 57d131c0bc..41e0b7039d 100644 --- a/gen/clouduseraccountsvm_beta/src/lib.rs +++ b/gen/clouduseraccountsvm_beta/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud User Accounts* crate version *1.0.12+20160316*, where *20160316* is the exact revision of the *clouduseraccounts:vm_beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud User Accounts* crate version *1.0.13+20160316*, where *20160316* is the exact revision of the *clouduseraccounts:vm_beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud User Accounts* *vm_beta* API can be found at the //! [official documentation site](https://cloud.google.com/compute/docs/access/user-accounts/api/latest/). @@ -355,7 +355,7 @@ impl<'a, C, A> CloudUserAccounts CloudUserAccounts { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -375,7 +375,7 @@ impl<'a, C, A> CloudUserAccounts } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/commentanalyzer1_alpha1-cli/Cargo.toml b/gen/commentanalyzer1_alpha1-cli/Cargo.toml index 80ad2748aa..b42a49a44a 100644 --- a/gen/commentanalyzer1_alpha1-cli/Cargo.toml +++ b/gen/commentanalyzer1_alpha1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-commentanalyzer1_alpha1-cli" -version = "1.0.12+20190616" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Comment Analyzer (protocol v1alpha1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/commentanalyzer1_alpha1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-commentanalyzer1_alpha1] path = "../commentanalyzer1_alpha1" -version = "1.0.12+20190616" +version = "1.0.13+20200405" diff --git a/gen/commentanalyzer1_alpha1-cli/README.md b/gen/commentanalyzer1_alpha1-cli/README.md index ba8f19c544..ae683c5734 100644 --- a/gen/commentanalyzer1_alpha1-cli/README.md +++ b/gen/commentanalyzer1_alpha1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Comment Analyzer* API at revision *20190616*. The CLI is at version *1.0.12*. +This documentation was generated from the *Comment Analyzer* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash commentanalyzer1-alpha1 [options] diff --git a/gen/commentanalyzer1_alpha1-cli/mkdocs.yml b/gen/commentanalyzer1_alpha1-cli/mkdocs.yml index 3d0629c83b..398edf32d3 100644 --- a/gen/commentanalyzer1_alpha1-cli/mkdocs.yml +++ b/gen/commentanalyzer1_alpha1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Comment Analyzer v1.0.12+20190616 +site_name: Comment Analyzer v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-commentanalyzer1_alpha1-cli site_description: A complete library to interact with Comment Analyzer (protocol v1alpha1) diff --git a/gen/commentanalyzer1_alpha1-cli/src/main.rs b/gen/commentanalyzer1_alpha1-cli/src/main.rs index 8af9e1e60b..2a8005ba79 100644 --- a/gen/commentanalyzer1_alpha1-cli/src/main.rs +++ b/gen/commentanalyzer1_alpha1-cli/src/main.rs @@ -391,7 +391,7 @@ fn main() { let mut app = App::new("commentanalyzer1-alpha1") .author("Sebastian Thiel ") - .version("1.0.12+20190616") + .version("1.0.13+20200405") .about("The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the \"toxicity\" of a comment). Users can leverage the \"SuggestCommentScore\" method to submit corrections to improve Perspective over time. Users can set the \"doNotStore\" flag to ensure that all submitted comments are automatically deleted after scores are returned.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_commentanalyzer1_alpha1_cli") .arg(Arg::with_name("url") diff --git a/gen/commentanalyzer1_alpha1/Cargo.toml b/gen/commentanalyzer1_alpha1/Cargo.toml index ebad77ca37..6ba8366bf5 100644 --- a/gen/commentanalyzer1_alpha1/Cargo.toml +++ b/gen/commentanalyzer1_alpha1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-commentanalyzer1_alpha1" -version = "1.0.12+20190616" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with Comment Analyzer (protocol v1alpha1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/commentanalyzer1_alpha1" homepage = "https://github.com/conversationai/perspectiveapi/blob/master/README.md" -documentation = "https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616" +documentation = "https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405" license = "MIT" keywords = ["commentanalyzer", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/commentanalyzer1_alpha1/README.md b/gen/commentanalyzer1_alpha1/README.md index 232d942edd..a67de2d4c3 100644 --- a/gen/commentanalyzer1_alpha1/README.md +++ b/gen/commentanalyzer1_alpha1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-commentanalyzer1_alpha1` library allows access to all features of the *Google Comment Analyzer* service. -This documentation was generated from *Comment Analyzer* crate version *1.0.12+20190616*, where *20190616* is the exact revision of the *commentanalyzer:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Comment Analyzer* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *commentanalyzer:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Comment Analyzer* *v1_alpha1* API can be found at the [official documentation site](https://github.com/conversationai/perspectiveapi/blob/master/README.md). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/struct.CommentAnalyzer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/struct.CommentAnalyzer.html) ... * comments - * [*analyze*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/struct.CommentAnalyzeCall.html) and [*suggestscore*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/struct.CommentSuggestscoreCall.html) + * [*analyze*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/struct.CommentAnalyzeCall.html) and [*suggestscore*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/struct.CommentSuggestscoreCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/struct.CommentAnalyzer.html)** +* **[Hub](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/struct.CommentAnalyzer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.Part.html)** + * **[Parts](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-commentanalyzer1_alpha1/1.0.12+20190616/google_commentanalyzer1_alpha1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-commentanalyzer1_alpha1/1.0.13+20200405/google_commentanalyzer1_alpha1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/commentanalyzer1_alpha1/src/lib.rs b/gen/commentanalyzer1_alpha1/src/lib.rs index f3db328aae..275c5bc2a8 100644 --- a/gen/commentanalyzer1_alpha1/src/lib.rs +++ b/gen/commentanalyzer1_alpha1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Comment Analyzer* crate version *1.0.12+20190616*, where *20190616* is the exact revision of the *commentanalyzer:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Comment Analyzer* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *commentanalyzer:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Comment Analyzer* *v1_alpha1* API can be found at the //! [official documentation site](https://github.com/conversationai/perspectiveapi/blob/master/README.md). @@ -329,7 +329,7 @@ impl<'a, C, A> CommentAnalyzer CommentAnalyzer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://commentanalyzer.googleapis.com/".to_string(), _root_url: "https://commentanalyzer.googleapis.com/".to_string(), } @@ -340,7 +340,7 @@ impl<'a, C, A> CommentAnalyzer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -406,14 +406,9 @@ impl ResponseResult for SuggestCommentScoreResponse {} pub struct SuggestCommentScoreRequest { /// The comment being scored. pub comment: Option, - /// The language(s) of the comment and context (if none are specified, the - /// language is automatically detected). If multiple languages are specified, - /// the text is checked in all of them that are supported. Both ISO and BCP-47 - /// language codes are accepted. - /// Current Language Restrictions: - /// * Only English text ("en") is supported. - /// If none of the languages specified by the caller are supported, an - /// `UNIMPLEMENTED` error is returned. + /// The language(s) of the comment and context. If none are specified, we + /// attempt to automatically detect the language. Both ISO and BCP-47 language + /// codes are accepted. pub languages: Option>, /// Session ID. Used to join related RPCs into a single session. For example, /// an interactive tool that calls both the AnalyzeComment and @@ -457,6 +452,7 @@ impl RequestValue for SuggestCommentScoreRequest {} /// The comment analysis request message. +/// LINT.IfChange /// /// # Activities /// @@ -473,14 +469,15 @@ pub struct AnalyzeCommentRequest { /// service may store comments/context for debugging purposes. #[serde(rename="doNotStore")] pub do_not_store: Option, - /// The language(s) of the comment and context (if none are specified, the - /// language is automatically detected). If multiple languages are specified, - /// the text is checked in all of them that are supported. Both ISO and BCP-47 - /// language codes are accepted. - /// Current Language Restrictions: - /// * Only English text ("en") is supported. - /// If none of the languages specified by the caller are supported, an - /// `UNIMPLEMENTED` error is returned. + /// The language(s) of the comment and context. If none are specified, we + /// attempt to automatically detect the language. Specifying multiple languages + /// means the text contains multiple lanugages. Both ISO and BCP-47 language + /// codes are accepted. + /// + /// The server returns an error if no language was specified and language + /// detection fails. The server also returns an error if the languages (either + /// specified by the caller, or auto-detected) are not *all* supported by the + /// service. pub languages: Option>, /// Session ID. Used to join related RPCs into a single session. For example, /// an interactive tool that calls both the AnalyzeComment and @@ -495,16 +492,12 @@ pub struct AnalyzeCommentRequest { pub client_token: Option, /// Specification of requested attributes. The AttributeParameters serve as /// configuration for each associated attribute. The map keys are attribute - /// names. The following attributes are available: - /// "ATTACK_ON_AUTHOR" - Attack on author of original article or post. - /// "ATTACK_ON_COMMENTER" - Attack on fellow commenter. - /// "ATTACK_ON_PUBLISHER" - Attack on publisher of article/post. - /// "INCOHERENT" - Difficult to understand, nonsensical. - /// "INFLAMMATORY" - Intending to provoke or inflame. - /// "OBSCENE" - Obscene, such as cursing. - /// "OFF_TOPIC" - Not related to the original topic. - /// "SPAM" - Commercial/advertising spam content. - /// "UNSUBSTANTIAL" - Trivial. + /// names. The available attributes may be different on each RFE installation, + /// and can be seen by calling ListAttributes (see above). + /// For the prod installation, known as Perspective API, at + /// blade:commentanalyzer-esf and commentanalyzer.googleapis.com, see + /// go/checker-models (internal) and + /// https://github.com/conversationai/perspectiveapi/blob/master/2-api/models.md#all-attribute-types. #[serde(rename="requestedAttributes")] pub requested_attributes: Option>, /// An advisory parameter that will return span annotations if the model @@ -537,10 +530,10 @@ pub struct AnalyzeCommentResponse { /// The language(s) used by CommentAnalyzer service to choose which Model to /// use when analyzing the comment. Might better be called /// "effective_languages". The logic used to make the choice is as follows: - /// if Request.languages.empty() - /// effective_languages = detected_languages - /// else + /// if !Request.languages.empty() /// effective_languages = Request.languages + /// else + /// effective_languages = detected_languages[0] pub languages: Option>, /// Scores for the requested attributes. The map keys are attribute names (same /// as the requested_attribute field in AnalyzeCommentRequest, for example diff --git a/gen/composer1-cli/Cargo.toml b/gen/composer1-cli/Cargo.toml index 6858f9ecba..a0e28ee92d 100644 --- a/gen/composer1-cli/Cargo.toml +++ b/gen/composer1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-composer1-cli" -version = "1.0.12+20190613" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Composer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/composer1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-composer1] path = "../composer1" -version = "1.0.12+20190613" +version = "1.0.13+20200406" diff --git a/gen/composer1-cli/README.md b/gen/composer1-cli/README.md index fd5e1a5be4..02fae747df 100644 --- a/gen/composer1-cli/README.md +++ b/gen/composer1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Composer* API at revision *20190613*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Composer* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash composer1 [options] diff --git a/gen/composer1-cli/mkdocs.yml b/gen/composer1-cli/mkdocs.yml index 004e22d7aa..66859beb95 100644 --- a/gen/composer1-cli/mkdocs.yml +++ b/gen/composer1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Composer v1.0.12+20190613 +site_name: Cloud Composer v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-composer1-cli site_description: A complete library to interact with Cloud Composer (protocol v1) diff --git a/gen/composer1-cli/src/main.rs b/gen/composer1-cli/src/main.rs index 0662c9ebd8..118bdc01a2 100644 --- a/gen/composer1-cli/src/main.rs +++ b/gen/composer1-cli/src/main.rs @@ -87,13 +87,25 @@ impl<'n> Engine<'n> { "config.node-config.service-account" => Some(("config.nodeConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.node-config.oauth-scopes" => Some(("config.nodeConfig.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.node-config.disk-size-gb" => Some(("config.nodeConfig.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.node-config.location" => Some(("config.nodeConfig.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.cluster-ipv4-cidr-block" => Some(("config.nodeConfig.ipAllocationPolicy.clusterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.services-ipv4-cidr-block" => Some(("config.nodeConfig.ipAllocationPolicy.servicesIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.use-ip-aliases" => Some(("config.nodeConfig.ipAllocationPolicy.useIpAliases", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.services-secondary-range-name" => Some(("config.nodeConfig.ipAllocationPolicy.servicesSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.cluster-secondary-range-name" => Some(("config.nodeConfig.ipAllocationPolicy.clusterSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.node-config.subnetwork" => Some(("config.nodeConfig.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.location" => Some(("config.nodeConfig.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.node-count" => Some(("config.nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.private-environment-config.cloud-sql-ipv4-cidr-block" => Some(("config.privateEnvironmentConfig.cloudSqlIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.web-server-ipv4-cidr-block" => Some(("config.privateEnvironmentConfig.webServerIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.web-server-ipv4-reserved-range" => Some(("config.privateEnvironmentConfig.webServerIpv4ReservedRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.enable-private-environment" => Some(("config.privateEnvironmentConfig.enablePrivateEnvironment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.private-environment-config.private-cluster-config.enable-private-endpoint" => Some(("config.privateEnvironmentConfig.privateClusterConfig.enablePrivateEndpoint", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.private-environment-config.private-cluster-config.master-ipv4-reserved-range" => Some(("config.privateEnvironmentConfig.privateClusterConfig.masterIpv4ReservedRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.private-cluster-config.master-ipv4-cidr-block" => Some(("config.privateEnvironmentConfig.privateClusterConfig.masterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "uuid" => Some(("uuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["airflow-config-overrides", "airflow-uri", "config", "create-time", "dag-gcs-prefix", "disk-size-gb", "env-variables", "gke-cluster", "image-version", "labels", "location", "machine-type", "name", "network", "node-config", "node-count", "oauth-scopes", "pypi-packages", "python-version", "service-account", "software-config", "state", "subnetwork", "tags", "update-time", "uuid"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["airflow-config-overrides", "airflow-uri", "cloud-sql-ipv4-cidr-block", "cluster-ipv4-cidr-block", "cluster-secondary-range-name", "config", "create-time", "dag-gcs-prefix", "disk-size-gb", "enable-private-endpoint", "enable-private-environment", "env-variables", "gke-cluster", "image-version", "ip-allocation-policy", "labels", "location", "machine-type", "master-ipv4-cidr-block", "master-ipv4-reserved-range", "name", "network", "node-config", "node-count", "oauth-scopes", "private-cluster-config", "private-environment-config", "pypi-packages", "python-version", "service-account", "services-ipv4-cidr-block", "services-secondary-range-name", "software-config", "state", "subnetwork", "tags", "update-time", "use-ip-aliases", "uuid", "web-server-ipv4-cidr-block", "web-server-ipv4-reserved-range"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -357,13 +369,25 @@ impl<'n> Engine<'n> { "config.node-config.service-account" => Some(("config.nodeConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.node-config.oauth-scopes" => Some(("config.nodeConfig.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.node-config.disk-size-gb" => Some(("config.nodeConfig.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.node-config.location" => Some(("config.nodeConfig.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.cluster-ipv4-cidr-block" => Some(("config.nodeConfig.ipAllocationPolicy.clusterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.services-ipv4-cidr-block" => Some(("config.nodeConfig.ipAllocationPolicy.servicesIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.use-ip-aliases" => Some(("config.nodeConfig.ipAllocationPolicy.useIpAliases", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.services-secondary-range-name" => Some(("config.nodeConfig.ipAllocationPolicy.servicesSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.ip-allocation-policy.cluster-secondary-range-name" => Some(("config.nodeConfig.ipAllocationPolicy.clusterSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.node-config.subnetwork" => Some(("config.nodeConfig.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.node-config.location" => Some(("config.nodeConfig.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.node-count" => Some(("config.nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.private-environment-config.cloud-sql-ipv4-cidr-block" => Some(("config.privateEnvironmentConfig.cloudSqlIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.web-server-ipv4-cidr-block" => Some(("config.privateEnvironmentConfig.webServerIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.web-server-ipv4-reserved-range" => Some(("config.privateEnvironmentConfig.webServerIpv4ReservedRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.enable-private-environment" => Some(("config.privateEnvironmentConfig.enablePrivateEnvironment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.private-environment-config.private-cluster-config.enable-private-endpoint" => Some(("config.privateEnvironmentConfig.privateClusterConfig.enablePrivateEndpoint", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.private-environment-config.private-cluster-config.master-ipv4-reserved-range" => Some(("config.privateEnvironmentConfig.privateClusterConfig.masterIpv4ReservedRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.private-environment-config.private-cluster-config.master-ipv4-cidr-block" => Some(("config.privateEnvironmentConfig.privateClusterConfig.masterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "uuid" => Some(("uuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["airflow-config-overrides", "airflow-uri", "config", "create-time", "dag-gcs-prefix", "disk-size-gb", "env-variables", "gke-cluster", "image-version", "labels", "location", "machine-type", "name", "network", "node-config", "node-count", "oauth-scopes", "pypi-packages", "python-version", "service-account", "software-config", "state", "subnetwork", "tags", "update-time", "uuid"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["airflow-config-overrides", "airflow-uri", "cloud-sql-ipv4-cidr-block", "cluster-ipv4-cidr-block", "cluster-secondary-range-name", "config", "create-time", "dag-gcs-prefix", "disk-size-gb", "enable-private-endpoint", "enable-private-environment", "env-variables", "gke-cluster", "image-version", "ip-allocation-policy", "labels", "location", "machine-type", "master-ipv4-cidr-block", "master-ipv4-reserved-range", "name", "network", "node-config", "node-count", "oauth-scopes", "private-cluster-config", "private-environment-config", "pypi-packages", "python-version", "service-account", "services-ipv4-cidr-block", "services-secondary-range-name", "software-config", "state", "subnetwork", "tags", "update-time", "use-ip-aliases", "uuid", "web-server-ipv4-cidr-block", "web-server-ipv4-reserved-range"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1014,7 +1038,7 @@ fn main() { let mut app = App::new("composer1") .author("Sebastian Thiel ") - .version("1.0.12+20190613") + .version("1.0.13+20200406") .about("Manages Apache Airflow environments on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_composer1_cli") .arg(Arg::with_name("url") diff --git a/gen/composer1/Cargo.toml b/gen/composer1/Cargo.toml index d0d442d38b..cf2c7bfd09 100644 --- a/gen/composer1/Cargo.toml +++ b/gen/composer1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-composer1" -version = "1.0.12+20190613" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Composer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/composer1" homepage = "https://cloud.google.com/composer/" -documentation = "https://docs.rs/google-composer1/1.0.12+20190613" +documentation = "https://docs.rs/google-composer1/1.0.13+20200406" license = "MIT" keywords = ["composer", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/composer1/README.md b/gen/composer1/README.md index 81c4c3fab3..fe22e2b4b0 100644 --- a/gen/composer1/README.md +++ b/gen/composer1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-composer1` library allows access to all features of the *Google Cloud Composer* service. -This documentation was generated from *Cloud Composer* crate version *1.0.12+20190613*, where *20190613* is the exact revision of the *composer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Composer* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *composer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Composer* *v1* API can be found at the [official documentation site](https://cloud.google.com/composer/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.CloudComposer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.CloudComposer.html) ... * projects - * [*locations environments create*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationEnvironmentCreateCall.html), [*locations environments delete*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationEnvironmentDeleteCall.html), [*locations environments get*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationEnvironmentGetCall.html), [*locations environments list*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationEnvironmentListCall.html), [*locations environments patch*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationEnvironmentPatchCall.html), [*locations image versions list*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationImageVersionListCall.html), [*locations operations delete*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.ProjectLocationOperationListCall.html) + * [*locations environments create*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationEnvironmentCreateCall.html), [*locations environments delete*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationEnvironmentDeleteCall.html), [*locations environments get*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationEnvironmentGetCall.html), [*locations environments list*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationEnvironmentListCall.html), [*locations environments patch*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationEnvironmentPatchCall.html), [*locations image versions list*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationImageVersionListCall.html), [*locations operations delete*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.ProjectLocationOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/struct.CloudComposer.html)** +* **[Hub](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/struct.CloudComposer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.Part.html)** + * **[Parts](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-composer1/1.0.12+20190613/google_composer1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-composer1/1.0.13+20200406/google_composer1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/composer1/src/lib.rs b/gen/composer1/src/lib.rs index 33b41030b7..2eab14e1b5 100644 --- a/gen/composer1/src/lib.rs +++ b/gen/composer1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Composer* crate version *1.0.12+20190613*, where *20190613* is the exact revision of the *composer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Composer* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *composer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Composer* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/composer/). @@ -334,7 +334,7 @@ impl<'a, C, A> CloudComposer CloudComposer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://composer.googleapis.com/".to_string(), _root_url: "https://composer.googleapis.com/".to_string(), } @@ -345,7 +345,7 @@ impl<'a, C, A> CloudComposer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -379,8 +379,7 @@ impl<'a, C, A> CloudComposer /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct EnvironmentConfig { - /// Output only. - /// The Cloud Storage prefix of the DAGs for this environment. Although Cloud + /// Output only. The Cloud Storage prefix of the DAGs for this environment. Although Cloud /// Storage objects reside in a flat namespace, a hierarchical file tree /// can be simulated using "/"-delimited object name prefixes. DAG objects for /// this environment reside in a simulated directory with the given prefix. @@ -392,16 +391,17 @@ pub struct EnvironmentConfig { /// The configuration used for the Kubernetes Engine cluster. #[serde(rename="nodeConfig")] pub node_config: Option, - /// Output only. - /// The URI of the Apache Airflow Web UI hosted within this environment (see + /// Output only. The URI of the Apache Airflow Web UI hosted within this environment (see /// [Airflow web /// interface](/composer/docs/how-to/accessing/airflow-web-interface)). #[serde(rename="airflowUri")] pub airflow_uri: Option, - /// Output only. - /// The Kubernetes Engine cluster used to run this environment. + /// Output only. The Kubernetes Engine cluster used to run this environment. #[serde(rename="gkeCluster")] pub gke_cluster: Option, + /// The configuration used for the Private IP Cloud Composer environment. + #[serde(rename="privateEnvironmentConfig")] + pub private_environment_config: Option, /// The number of nodes in the Kubernetes Engine cluster that will be /// used to run this environment. #[serde(rename="nodeCount")] @@ -437,6 +437,30 @@ pub struct Status { impl Part for Status {} +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations operations delete projects](struct.ProjectLocationOperationDeleteCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + /// Specifies the selection and configuration of software inside the environment. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -571,6 +595,53 @@ pub struct ListImageVersionsResponse { impl ResponseResult for ListImageVersionsResponse {} +/// An environment for running orchestration tasks. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations environments patch projects](struct.ProjectLocationEnvironmentPatchCall.html) (request) +/// * [locations environments create projects](struct.ProjectLocationEnvironmentCreateCall.html) (request) +/// * [locations environments get projects](struct.ProjectLocationEnvironmentGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Environment { + /// Output only. The time at which this environment was last modified. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The resource name of the environment, in the form: + /// "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + /// + /// EnvironmentId must start with a lowercase letter followed by up to 63 + /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + pub name: Option, + /// Output only. The UUID (Universally Unique IDentifier) associated with this environment. + /// This value is generated when the environment is created. + pub uuid: Option, + /// Optional. User-defined labels for this environment. + /// The labels map can contain no more than 64 entries. Entries of the labels + /// map are UTF8 strings that comply with the following restrictions: + /// + /// * Keys must conform to regexp: \p{Ll}\p{Lo}{0,62} + /// * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + /// * Both keys and values are additionally constrained to be <= 128 bytes in + /// size. + pub labels: Option>, + /// Configuration parameters for this environment. + pub config: Option, + /// The current state of the environment. + pub state: Option, + /// Output only. The time at which this environment was created. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl RequestValue for Environment {} +impl ResponseResult for Environment {} + + /// The environments in a project and location. /// /// # Activities @@ -615,6 +686,9 @@ pub struct NodeConfig { /// specified, the location information from the specified field will be /// propagated to the unspecified field. /// + /// The `machineTypeId` must not be a [shared-core machine + /// type](/compute/docs/machine-types#sharedcore). + /// /// If this field is unspecified, the `machineTypeId` defaults /// to "n1-standard-1". #[serde(rename="machineType")] @@ -650,6 +724,19 @@ pub struct NodeConfig { /// If unspecified, defaults to 100GB. Cannot be updated. #[serde(rename="diskSizeGb")] pub disk_size_gb: Option, + /// Optional. The configuration for controlling how IPs are allocated in the GKE cluster. + #[serde(rename="ipAllocationPolicy")] + pub ip_allocation_policy: Option, + /// Optional. The Compute Engine subnetwork to be used for machine + /// communications, specified as a + /// [relative resource + /// name](/apis/design/resource_names#relative_resource_name). For example: + /// "projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}" + /// + /// If a subnetwork is provided, `nodeConfig.network` must also be provided, + /// and the subnetwork must belong to the enclosing environment's project and + /// location. + pub subnetwork: Option, /// Optional. The Compute Engine [zone](/compute/docs/regions-zones) in which /// to deploy the VMs used to run the Apache Airflow software, specified as a /// [relative resource @@ -665,43 +752,71 @@ pub struct NodeConfig { /// specified, the location information from the specified field will be /// propagated to the unspecified field. pub location: Option, - /// Optional. The Compute Engine subnetwork to be used for machine - /// communications, specified as a - /// [relative resource - /// name](/apis/design/resource_names#relative_resource_name). For example: - /// "projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}" - /// - /// If a subnetwork is provided, `nodeConfig.network` must also be provided, - /// and the subnetwork must belong to the enclosing environment's project and - /// location. - pub subnetwork: Option, } impl Part for NodeConfig {} -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. A typical example is to use it as the request -/// or the response type of an API method. For instance: +/// Configuration for controlling how IPs are allocated in the +/// GKE cluster running the Apache Airflow software. /// -/// ````text -/// service Foo { -/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -/// } -/// ```` +/// This type is not used in any activity, and only used as *part* of another schema. /// -/// The JSON representation for `Empty` is empty JSON object `{}`. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations operations delete projects](struct.ProjectLocationOperationDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Empty { _never_set: Option } +pub struct IPAllocationPolicy { + /// Optional. The IP address range used to allocate IP addresses to pods in + /// the GKE cluster. + /// + /// This field is applicable only when `use_ip_aliases` is true. + /// + /// Set to blank to have GKE choose a range with the default size. + /// + /// Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific + /// netmask. + /// + /// Set to a + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + /// to use. + #[serde(rename="clusterIpv4CidrBlock")] + pub cluster_ipv4_cidr_block: Option, + /// Optional. The IP address range of the services IP addresses in this + /// GKE cluster. + /// + /// This field is applicable only when `use_ip_aliases` is true. + /// + /// Set to blank to have GKE choose a range with the default size. + /// + /// Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific + /// netmask. + /// + /// Set to a + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + /// `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + /// to use. + #[serde(rename="servicesIpv4CidrBlock")] + pub services_ipv4_cidr_block: Option, + /// Optional. The name of the services' secondary range used to allocate + /// IP addresses to the GKE cluster. + /// + /// This field is applicable only when `use_ip_aliases` is true. + #[serde(rename="servicesSecondaryRangeName")] + pub services_secondary_range_name: Option, + /// Optional. Whether or not to enable Alias IPs in the GKE cluster. + /// If `true`, a VPC-native cluster is created. + #[serde(rename="useIpAliases")] + pub use_ip_aliases: Option, + /// Optional. The name of the GKE cluster's secondary range used to allocate + /// IP addresses to pods. + /// + /// This field is applicable only when `use_ip_aliases` is true. + #[serde(rename="clusterSecondaryRangeName")] + pub cluster_secondary_range_name: Option, +} -impl ResponseResult for Empty {} +impl Part for IPAllocationPolicy {} /// ImageVersion information @@ -770,51 +885,64 @@ pub struct Operation { impl ResponseResult for Operation {} -/// An environment for running orchestration tasks. +/// The configuration information for configuring a Private IP Cloud Composer +/// environment. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations environments patch projects](struct.ProjectLocationEnvironmentPatchCall.html) (request) -/// * [locations environments create projects](struct.ProjectLocationEnvironmentCreateCall.html) (request) -/// * [locations environments get projects](struct.ProjectLocationEnvironmentGetCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Environment { - /// Output only. - /// The time at which this environment was last modified. - #[serde(rename="updateTime")] - pub update_time: Option, - /// The resource name of the environment, in the form: - /// "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - pub name: Option, - /// Output only. - /// The UUID (Universally Unique IDentifier) associated with this environment. - /// This value is generated when the environment is created. - pub uuid: Option, - /// Optional. User-defined labels for this environment. - /// The labels map can contain no more than 64 entries. Entries of the labels - /// map are UTF8 strings that comply with the following restrictions: - /// - /// * Keys must conform to regexp: \p{Ll}\p{Lo}{0,62} - /// * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} - /// * Both keys and values are additionally constrained to be <= 128 bytes in - /// size. - pub labels: Option>, - /// Configuration parameters for this environment. - pub config: Option, - /// The current state of the environment. - pub state: Option, - /// Output only. - /// The time at which this environment was created. - #[serde(rename="createTime")] - pub create_time: Option, +pub struct PrivateEnvironmentConfig { + /// Optional. The CIDR block from which IP range in tenant project will be reserved for + /// Cloud SQL. Needs to be disjoint from `web_server_ipv4_cidr_block`. + #[serde(rename="cloudSqlIpv4CidrBlock")] + pub cloud_sql_ipv4_cidr_block: Option, + /// Optional. The CIDR block from which IP range for web server will be reserved. Needs + /// to be disjoint from `private_cluster_config.master_ipv4_cidr_block` and + /// `cloud_sql_ipv4_cidr_block`. + #[serde(rename="webServerIpv4CidrBlock")] + pub web_server_ipv4_cidr_block: Option, + /// Output only. The IP range reserved for the tenant project's App Engine VMs. + #[serde(rename="webServerIpv4ReservedRange")] + pub web_server_ipv4_reserved_range: Option, + /// Optional. If `true`, a Private IP Cloud Composer environment is created. + /// If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be + /// set to true. + #[serde(rename="enablePrivateEnvironment")] + pub enable_private_environment: Option, + /// Optional. Configuration for the private GKE cluster for a Private IP + /// Cloud Composer environment. + #[serde(rename="privateClusterConfig")] + pub private_cluster_config: Option, } -impl RequestValue for Environment {} -impl ResponseResult for Environment {} +impl Part for PrivateEnvironmentConfig {} + + +/// Configuration options for the private GKE cluster in a Cloud Composer +/// environment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PrivateClusterConfig { + /// Optional. If `true`, access to the public endpoint of the GKE cluster is + /// denied. + #[serde(rename="enablePrivateEndpoint")] + pub enable_private_endpoint: Option, + /// Output only. The IP range in CIDR notation to use for the hosted master network. This + /// range is used for assigning internal IP addresses to the GKE cluster + /// master or set of masters and to the internal load balancer virtual IP. + /// This range must not overlap with any other ranges in use + /// within the cluster's network. + #[serde(rename="masterIpv4ReservedRange")] + pub master_ipv4_reserved_range: Option, + /// Optional. The CIDR block from which IPv4 range for GKE master will be reserved. If + /// left blank, the default value of '172.16.0.0/23' is used. + #[serde(rename="masterIpv4CidrBlock")] + pub master_ipv4_cidr_block: Option, +} + +impl Part for PrivateClusterConfig {} diff --git a/gen/compute1-cli/Cargo.toml b/gen/compute1-cli/Cargo.toml index 9883d4ea00..4a829f4db3 100644 --- a/gen/compute1-cli/Cargo.toml +++ b/gen/compute1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-compute1-cli" -version = "1.0.12+20190618" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with compute (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-compute1] path = "../compute1" -version = "1.0.12+20190618" +version = "1.0.13+20200311" diff --git a/gen/compute1-cli/README.md b/gen/compute1-cli/README.md index f3cca095a5..0e701ea2f1 100644 --- a/gen/compute1-cli/README.md +++ b/gen/compute1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *compute* API at revision *20190618*. The CLI is at version *1.0.12*. +This documentation was generated from the *compute* API at revision *20200311*. The CLI is at version *1.0.13*. ```bash compute1 [options] @@ -86,6 +86,13 @@ compute1 [options] set-iam-policy (-r )... [-p ]... [-o ] set-labels (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] + external-vpn-gateways + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + set-labels (-r )... [-p ]... [-o ] + test-iam-permissions (-r )... [-p ]... [-o ] firewalls delete [-p ]... [-o ] get [-p ]... [-o ] @@ -99,6 +106,7 @@ compute1 [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] set-target (-r )... [-p ]... [-o ] global-addresses delete
          [-p ]... [-o ] @@ -110,13 +118,24 @@ compute1 [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] set-target (-r )... [-p ]... [-o ] + global-network-endpoint-groups + attach-network-endpoints (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + detach-network-endpoints (-r )... [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + list-network-endpoints [-p ]... [-o ] global-operations aggregated-list [-p ]... [-o ] delete [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] + wait [-p ]... [-o ] health-checks + aggregated-list [-p ]... [-o ] delete [-p ]... [-o ] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] @@ -151,11 +170,14 @@ compute1 [options] instance-group-managers abandon-instances (-r )... [-p ]... [-o ] aggregated-list [-p ]... [-o ] + apply-updates-to-instances (-r )... [-p ]... [-o ] + create-instances (-r )... [-p ]... [-o ] delete [-p ]... [-o ] delete-instances (-r )... [-p ]... [-o ] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + list-errors [-p ]... [-o ] list-managed-instances [-p ]... [-o ] patch (-r )... [-p ]... [-o ] recreate-instances (-r )... [-p ]... [-o ] @@ -182,6 +204,7 @@ compute1 [options] test-iam-permissions (-r )... [-p ]... [-o ] instances add-access-config (-r )... [-p ]... [-o ] + add-resource-policies (-r )... [-p ]... [-o ] aggregated-list [-p ]... [-o ] attach-disk (-r )... [-p ]... [-o ] delete [-p ]... [-o ] @@ -195,6 +218,7 @@ compute1 [options] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] list-referrers [-p ]... [-o ] + remove-resource-policies (-r )... [-p ]... [-o ] reset [-p ]... [-o ] set-deletion-protection [-p ]... [-o ] set-disk-auto-delete [-p ]... [-o ] @@ -213,7 +237,9 @@ compute1 [options] start-with-encryption-key (-r )... [-p ]... [-o ] stop [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] update-access-config (-r )... [-p ]... [-o ] + update-display-device (-r )... [-p ]... [-o ] update-network-interface (-r )... [-p ]... [-o ] update-shielded-instance-config (-r )... [-p ]... [-o ] interconnect-attachments @@ -264,9 +290,11 @@ compute1 [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + list-peering-routes [-p ]... [-o ] patch (-r )... [-p ]... [-o ] remove-peering (-r )... [-p ]... [-o ] switch-to-custom-mode [-p ]... [-o ] + update-peering (-r )... [-p ]... [-o ] node-groups add-nodes (-r )... [-p ]... [-o ] aggregated-list [-p ]... [-o ] @@ -277,6 +305,7 @@ compute1 [options] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] list-nodes [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] set-iam-policy (-r )... [-p ]... [-o ] set-node-template (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] @@ -293,6 +322,14 @@ compute1 [options] aggregated-list [-p ]... [-o ] get [-p ]... [-o ] list [-p ]... [-o ] + packet-mirrorings + aggregated-list [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + test-iam-permissions (-r )... [-p ]... [-o ] projects disable-xpn-host [-p ]... [-o ] disable-xpn-resource (-r )... [-p ]... [-o ] @@ -341,13 +378,23 @@ compute1 [options] resize (-r )... [-p ]... [-o ] set-labels (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] + region-health-checks + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] region-instance-group-managers abandon-instances (-r )... [-p ]... [-o ] + apply-updates-to-instances (-r )... [-p ]... [-o ] + create-instances (-r )... [-p ]... [-o ] delete [-p ]... [-o ] delete-instances (-r )... [-p ]... [-o ] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + list-errors [-p ]... [-o ] list-managed-instances [-p ]... [-o ] patch (-r )... [-p ]... [-o ] recreate-instances (-r )... [-p ]... [-o ] @@ -363,6 +410,33 @@ compute1 [options] delete [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] + wait [-p ]... [-o ] + region-ssl-certificates + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + region-target-http-proxies + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + set-url-map (-r )... [-p ]... [-o ] + region-target-https-proxies + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + set-ssl-certificates (-r )... [-p ]... [-o ] + set-url-map (-r )... [-p ]... [-o ] + region-url-maps + delete [-p ]... [-o ] + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] + validate (-r )... [-p ]... [-o ] regions get [-p ]... [-o ] list [-p ]... [-o ] @@ -408,6 +482,7 @@ compute1 [options] get-rule [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + list-preconfigured-expression-sets [-p ]... [-o ] patch (-r )... [-p ]... [-o ] patch-rule (-r )... [-p ]... [-o ] remove-rule [-p ]... [-o ] @@ -420,6 +495,7 @@ compute1 [options] set-labels (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] ssl-certificates + aggregated-list [-p ]... [-o ] delete [-p ]... [-o ] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] @@ -445,12 +521,14 @@ compute1 [options] set-private-ip-google-access (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] target-http-proxies + aggregated-list [-p ]... [-o ] delete [-p ]... [-o ] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] set-url-map (-r )... [-p ]... [-o ] target-https-proxies + aggregated-list [-p ]... [-o ] delete [-p ]... [-o ] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] @@ -500,6 +578,7 @@ compute1 [options] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] url-maps + aggregated-list [-p ]... [-o ] delete [-p ]... [-o ] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] @@ -508,6 +587,15 @@ compute1 [options] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] validate (-r )... [-p ]... [-o ] + vpn-gateways + aggregated-list [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + get-status [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + set-labels (-r )... [-p ]... [-o ] + test-iam-permissions (-r )... [-p ]... [-o ] vpn-tunnels aggregated-list [-p ]... [-o ] delete [-p ]... [-o ] @@ -518,6 +606,7 @@ compute1 [options] delete [-p ]... get [-p ]... [-o ] list [-p ]... [-o ] + wait [-p ]... [-o ] zones get [-p ]... [-o ] list [-p ]... [-o ] diff --git a/gen/compute1-cli/mkdocs.yml b/gen/compute1-cli/mkdocs.yml index fbf8581171..81ef43a2d4 100644 --- a/gen/compute1-cli/mkdocs.yml +++ b/gen/compute1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: compute v1.0.12+20190618 +site_name: compute v1.0.13+20200311 site_url: http://byron.github.io/google-apis-rs/google-compute1-cli site_description: A complete library to interact with compute (protocol v1) @@ -59,6 +59,12 @@ pages: - ['disks_set-iam-policy.md', 'Disks', 'Set Iam Policy'] - ['disks_set-labels.md', 'Disks', 'Set Labels'] - ['disks_test-iam-permissions.md', 'Disks', 'Test Iam Permissions'] +- ['external-vpn-gateways_delete.md', 'External Vpn Gateways', 'Delete'] +- ['external-vpn-gateways_get.md', 'External Vpn Gateways', 'Get'] +- ['external-vpn-gateways_insert.md', 'External Vpn Gateways', 'Insert'] +- ['external-vpn-gateways_list.md', 'External Vpn Gateways', 'List'] +- ['external-vpn-gateways_set-labels.md', 'External Vpn Gateways', 'Set Labels'] +- ['external-vpn-gateways_test-iam-permissions.md', 'External Vpn Gateways', 'Test Iam Permissions'] - ['firewalls_delete.md', 'Firewalls', 'Delete'] - ['firewalls_get.md', 'Firewalls', 'Get'] - ['firewalls_insert.md', 'Firewalls', 'Insert'] @@ -70,6 +76,7 @@ pages: - ['forwarding-rules_get.md', 'Forwarding Rules', 'Get'] - ['forwarding-rules_insert.md', 'Forwarding Rules', 'Insert'] - ['forwarding-rules_list.md', 'Forwarding Rules', 'List'] +- ['forwarding-rules_patch.md', 'Forwarding Rules', 'Patch'] - ['forwarding-rules_set-target.md', 'Forwarding Rules', 'Set Target'] - ['global-addresses_delete.md', 'Global Addresses', 'Delete'] - ['global-addresses_get.md', 'Global Addresses', 'Get'] @@ -79,11 +86,21 @@ pages: - ['global-forwarding-rules_get.md', 'Global Forwarding Rules', 'Get'] - ['global-forwarding-rules_insert.md', 'Global Forwarding Rules', 'Insert'] - ['global-forwarding-rules_list.md', 'Global Forwarding Rules', 'List'] +- ['global-forwarding-rules_patch.md', 'Global Forwarding Rules', 'Patch'] - ['global-forwarding-rules_set-target.md', 'Global Forwarding Rules', 'Set Target'] +- ['global-network-endpoint-groups_attach-network-endpoints.md', 'Global Network Endpoint Groups', 'Attach Network Endpoints'] +- ['global-network-endpoint-groups_delete.md', 'Global Network Endpoint Groups', 'Delete'] +- ['global-network-endpoint-groups_detach-network-endpoints.md', 'Global Network Endpoint Groups', 'Detach Network Endpoints'] +- ['global-network-endpoint-groups_get.md', 'Global Network Endpoint Groups', 'Get'] +- ['global-network-endpoint-groups_insert.md', 'Global Network Endpoint Groups', 'Insert'] +- ['global-network-endpoint-groups_list.md', 'Global Network Endpoint Groups', 'List'] +- ['global-network-endpoint-groups_list-network-endpoints.md', 'Global Network Endpoint Groups', 'List Network Endpoints'] - ['global-operations_aggregated-list.md', 'Global Operations', 'Aggregated List'] - ['global-operations_delete.md', 'Global Operations', 'Delete'] - ['global-operations_get.md', 'Global Operations', 'Get'] - ['global-operations_list.md', 'Global Operations', 'List'] +- ['global-operations_wait.md', 'Global Operations', 'Wait'] +- ['health-checks_aggregated-list.md', 'Health Checks', 'Aggregated List'] - ['health-checks_delete.md', 'Health Checks', 'Delete'] - ['health-checks_get.md', 'Health Checks', 'Get'] - ['health-checks_insert.md', 'Health Checks', 'Insert'] @@ -114,11 +131,14 @@ pages: - ['images_test-iam-permissions.md', 'Images', 'Test Iam Permissions'] - ['instance-group-managers_abandon-instances.md', 'Instance Group Managers', 'Abandon Instances'] - ['instance-group-managers_aggregated-list.md', 'Instance Group Managers', 'Aggregated List'] +- ['instance-group-managers_apply-updates-to-instances.md', 'Instance Group Managers', 'Apply Updates To Instances'] +- ['instance-group-managers_create-instances.md', 'Instance Group Managers', 'Create Instances'] - ['instance-group-managers_delete.md', 'Instance Group Managers', 'Delete'] - ['instance-group-managers_delete-instances.md', 'Instance Group Managers', 'Delete Instances'] - ['instance-group-managers_get.md', 'Instance Group Managers', 'Get'] - ['instance-group-managers_insert.md', 'Instance Group Managers', 'Insert'] - ['instance-group-managers_list.md', 'Instance Group Managers', 'List'] +- ['instance-group-managers_list-errors.md', 'Instance Group Managers', 'List Errors'] - ['instance-group-managers_list-managed-instances.md', 'Instance Group Managers', 'List Managed Instances'] - ['instance-group-managers_patch.md', 'Instance Group Managers', 'Patch'] - ['instance-group-managers_recreate-instances.md', 'Instance Group Managers', 'Recreate Instances'] @@ -142,6 +162,7 @@ pages: - ['instance-templates_set-iam-policy.md', 'Instance Templates', 'Set Iam Policy'] - ['instance-templates_test-iam-permissions.md', 'Instance Templates', 'Test Iam Permissions'] - ['instances_add-access-config.md', 'Instances', 'Add Access Config'] +- ['instances_add-resource-policies.md', 'Instances', 'Add Resource Policies'] - ['instances_aggregated-list.md', 'Instances', 'Aggregated List'] - ['instances_attach-disk.md', 'Instances', 'Attach Disk'] - ['instances_delete.md', 'Instances', 'Delete'] @@ -155,6 +176,7 @@ pages: - ['instances_insert.md', 'Instances', 'Insert'] - ['instances_list.md', 'Instances', 'List'] - ['instances_list-referrers.md', 'Instances', 'List Referrers'] +- ['instances_remove-resource-policies.md', 'Instances', 'Remove Resource Policies'] - ['instances_reset.md', 'Instances', 'Reset'] - ['instances_set-deletion-protection.md', 'Instances', 'Set Deletion Protection'] - ['instances_set-disk-auto-delete.md', 'Instances', 'Set Disk Auto Delete'] @@ -173,7 +195,9 @@ pages: - ['instances_start-with-encryption-key.md', 'Instances', 'Start With Encryption Key'] - ['instances_stop.md', 'Instances', 'Stop'] - ['instances_test-iam-permissions.md', 'Instances', 'Test Iam Permissions'] +- ['instances_update.md', 'Instances', 'Update'] - ['instances_update-access-config.md', 'Instances', 'Update Access Config'] +- ['instances_update-display-device.md', 'Instances', 'Update Display Device'] - ['instances_update-network-interface.md', 'Instances', 'Update Network Interface'] - ['instances_update-shielded-instance-config.md', 'Instances', 'Update Shielded Instance Config'] - ['interconnect-attachments_aggregated-list.md', 'Interconnect Attachments', 'Aggregated List'] @@ -216,9 +240,11 @@ pages: - ['networks_get.md', 'Networks', 'Get'] - ['networks_insert.md', 'Networks', 'Insert'] - ['networks_list.md', 'Networks', 'List'] +- ['networks_list-peering-routes.md', 'Networks', 'List Peering Routes'] - ['networks_patch.md', 'Networks', 'Patch'] - ['networks_remove-peering.md', 'Networks', 'Remove Peering'] - ['networks_switch-to-custom-mode.md', 'Networks', 'Switch To Custom Mode'] +- ['networks_update-peering.md', 'Networks', 'Update Peering'] - ['node-groups_add-nodes.md', 'Node Groups', 'Add Nodes'] - ['node-groups_aggregated-list.md', 'Node Groups', 'Aggregated List'] - ['node-groups_delete.md', 'Node Groups', 'Delete'] @@ -228,6 +254,7 @@ pages: - ['node-groups_insert.md', 'Node Groups', 'Insert'] - ['node-groups_list.md', 'Node Groups', 'List'] - ['node-groups_list-nodes.md', 'Node Groups', 'List Nodes'] +- ['node-groups_patch.md', 'Node Groups', 'Patch'] - ['node-groups_set-iam-policy.md', 'Node Groups', 'Set Iam Policy'] - ['node-groups_set-node-template.md', 'Node Groups', 'Set Node Template'] - ['node-groups_test-iam-permissions.md', 'Node Groups', 'Test Iam Permissions'] @@ -242,6 +269,13 @@ pages: - ['node-types_aggregated-list.md', 'Node Types', 'Aggregated List'] - ['node-types_get.md', 'Node Types', 'Get'] - ['node-types_list.md', 'Node Types', 'List'] +- ['packet-mirrorings_aggregated-list.md', 'Packet Mirrorings', 'Aggregated List'] +- ['packet-mirrorings_delete.md', 'Packet Mirrorings', 'Delete'] +- ['packet-mirrorings_get.md', 'Packet Mirrorings', 'Get'] +- ['packet-mirrorings_insert.md', 'Packet Mirrorings', 'Insert'] +- ['packet-mirrorings_list.md', 'Packet Mirrorings', 'List'] +- ['packet-mirrorings_patch.md', 'Packet Mirrorings', 'Patch'] +- ['packet-mirrorings_test-iam-permissions.md', 'Packet Mirrorings', 'Test Iam Permissions'] - ['projects_disable-xpn-host.md', 'Projects', 'Disable Xpn Host'] - ['projects_disable-xpn-resource.md', 'Projects', 'Disable Xpn Resource'] - ['projects_enable-xpn-host.md', 'Projects', 'Enable Xpn Host'] @@ -284,12 +318,21 @@ pages: - ['region-disks_resize.md', 'Region Disks', 'Resize'] - ['region-disks_set-labels.md', 'Region Disks', 'Set Labels'] - ['region-disks_test-iam-permissions.md', 'Region Disks', 'Test Iam Permissions'] +- ['region-health-checks_delete.md', 'Region Health Checks', 'Delete'] +- ['region-health-checks_get.md', 'Region Health Checks', 'Get'] +- ['region-health-checks_insert.md', 'Region Health Checks', 'Insert'] +- ['region-health-checks_list.md', 'Region Health Checks', 'List'] +- ['region-health-checks_patch.md', 'Region Health Checks', 'Patch'] +- ['region-health-checks_update.md', 'Region Health Checks', 'Update'] - ['region-instance-group-managers_abandon-instances.md', 'Region Instance Group Managers', 'Abandon Instances'] +- ['region-instance-group-managers_apply-updates-to-instances.md', 'Region Instance Group Managers', 'Apply Updates To Instances'] +- ['region-instance-group-managers_create-instances.md', 'Region Instance Group Managers', 'Create Instances'] - ['region-instance-group-managers_delete.md', 'Region Instance Group Managers', 'Delete'] - ['region-instance-group-managers_delete-instances.md', 'Region Instance Group Managers', 'Delete Instances'] - ['region-instance-group-managers_get.md', 'Region Instance Group Managers', 'Get'] - ['region-instance-group-managers_insert.md', 'Region Instance Group Managers', 'Insert'] - ['region-instance-group-managers_list.md', 'Region Instance Group Managers', 'List'] +- ['region-instance-group-managers_list-errors.md', 'Region Instance Group Managers', 'List Errors'] - ['region-instance-group-managers_list-managed-instances.md', 'Region Instance Group Managers', 'List Managed Instances'] - ['region-instance-group-managers_patch.md', 'Region Instance Group Managers', 'Patch'] - ['region-instance-group-managers_recreate-instances.md', 'Region Instance Group Managers', 'Recreate Instances'] @@ -303,6 +346,29 @@ pages: - ['region-operations_delete.md', 'Region Operations', 'Delete'] - ['region-operations_get.md', 'Region Operations', 'Get'] - ['region-operations_list.md', 'Region Operations', 'List'] +- ['region-operations_wait.md', 'Region Operations', 'Wait'] +- ['region-ssl-certificates_delete.md', 'Region Ssl Certificates', 'Delete'] +- ['region-ssl-certificates_get.md', 'Region Ssl Certificates', 'Get'] +- ['region-ssl-certificates_insert.md', 'Region Ssl Certificates', 'Insert'] +- ['region-ssl-certificates_list.md', 'Region Ssl Certificates', 'List'] +- ['region-target-http-proxies_delete.md', 'Region Target Http Proxies', 'Delete'] +- ['region-target-http-proxies_get.md', 'Region Target Http Proxies', 'Get'] +- ['region-target-http-proxies_insert.md', 'Region Target Http Proxies', 'Insert'] +- ['region-target-http-proxies_list.md', 'Region Target Http Proxies', 'List'] +- ['region-target-http-proxies_set-url-map.md', 'Region Target Http Proxies', 'Set Url Map'] +- ['region-target-https-proxies_delete.md', 'Region Target Https Proxies', 'Delete'] +- ['region-target-https-proxies_get.md', 'Region Target Https Proxies', 'Get'] +- ['region-target-https-proxies_insert.md', 'Region Target Https Proxies', 'Insert'] +- ['region-target-https-proxies_list.md', 'Region Target Https Proxies', 'List'] +- ['region-target-https-proxies_set-ssl-certificates.md', 'Region Target Https Proxies', 'Set Ssl Certificates'] +- ['region-target-https-proxies_set-url-map.md', 'Region Target Https Proxies', 'Set Url Map'] +- ['region-url-maps_delete.md', 'Region Url Maps', 'Delete'] +- ['region-url-maps_get.md', 'Region Url Maps', 'Get'] +- ['region-url-maps_insert.md', 'Region Url Maps', 'Insert'] +- ['region-url-maps_list.md', 'Region Url Maps', 'List'] +- ['region-url-maps_patch.md', 'Region Url Maps', 'Patch'] +- ['region-url-maps_update.md', 'Region Url Maps', 'Update'] +- ['region-url-maps_validate.md', 'Region Url Maps', 'Validate'] - ['regions_get.md', 'Regions', 'Get'] - ['regions_list.md', 'Regions', 'List'] - ['reservations_aggregated-list.md', 'Reservations', 'Aggregated List'] @@ -342,6 +408,7 @@ pages: - ['security-policies_get-rule.md', 'Security Policies', 'Get Rule'] - ['security-policies_insert.md', 'Security Policies', 'Insert'] - ['security-policies_list.md', 'Security Policies', 'List'] +- ['security-policies_list-preconfigured-expression-sets.md', 'Security Policies', 'List Preconfigured Expression Sets'] - ['security-policies_patch.md', 'Security Policies', 'Patch'] - ['security-policies_patch-rule.md', 'Security Policies', 'Patch Rule'] - ['security-policies_remove-rule.md', 'Security Policies', 'Remove Rule'] @@ -352,6 +419,7 @@ pages: - ['snapshots_set-iam-policy.md', 'Snapshots', 'Set Iam Policy'] - ['snapshots_set-labels.md', 'Snapshots', 'Set Labels'] - ['snapshots_test-iam-permissions.md', 'Snapshots', 'Test Iam Permissions'] +- ['ssl-certificates_aggregated-list.md', 'Ssl Certificates', 'Aggregated List'] - ['ssl-certificates_delete.md', 'Ssl Certificates', 'Delete'] - ['ssl-certificates_get.md', 'Ssl Certificates', 'Get'] - ['ssl-certificates_insert.md', 'Ssl Certificates', 'Insert'] @@ -374,11 +442,13 @@ pages: - ['subnetworks_set-iam-policy.md', 'Subnetworks', 'Set Iam Policy'] - ['subnetworks_set-private-ip-google-access.md', 'Subnetworks', 'Set Private Ip Google Access'] - ['subnetworks_test-iam-permissions.md', 'Subnetworks', 'Test Iam Permissions'] +- ['target-http-proxies_aggregated-list.md', 'Target Http Proxies', 'Aggregated List'] - ['target-http-proxies_delete.md', 'Target Http Proxies', 'Delete'] - ['target-http-proxies_get.md', 'Target Http Proxies', 'Get'] - ['target-http-proxies_insert.md', 'Target Http Proxies', 'Insert'] - ['target-http-proxies_list.md', 'Target Http Proxies', 'List'] - ['target-http-proxies_set-url-map.md', 'Target Http Proxies', 'Set Url Map'] +- ['target-https-proxies_aggregated-list.md', 'Target Https Proxies', 'Aggregated List'] - ['target-https-proxies_delete.md', 'Target Https Proxies', 'Delete'] - ['target-https-proxies_get.md', 'Target Https Proxies', 'Get'] - ['target-https-proxies_insert.md', 'Target Https Proxies', 'Insert'] @@ -422,6 +492,7 @@ pages: - ['target-vpn-gateways_get.md', 'Target Vpn Gateways', 'Get'] - ['target-vpn-gateways_insert.md', 'Target Vpn Gateways', 'Insert'] - ['target-vpn-gateways_list.md', 'Target Vpn Gateways', 'List'] +- ['url-maps_aggregated-list.md', 'Url Maps', 'Aggregated List'] - ['url-maps_delete.md', 'Url Maps', 'Delete'] - ['url-maps_get.md', 'Url Maps', 'Get'] - ['url-maps_insert.md', 'Url Maps', 'Insert'] @@ -430,6 +501,14 @@ pages: - ['url-maps_patch.md', 'Url Maps', 'Patch'] - ['url-maps_update.md', 'Url Maps', 'Update'] - ['url-maps_validate.md', 'Url Maps', 'Validate'] +- ['vpn-gateways_aggregated-list.md', 'Vpn Gateways', 'Aggregated List'] +- ['vpn-gateways_delete.md', 'Vpn Gateways', 'Delete'] +- ['vpn-gateways_get.md', 'Vpn Gateways', 'Get'] +- ['vpn-gateways_get-status.md', 'Vpn Gateways', 'Get Status'] +- ['vpn-gateways_insert.md', 'Vpn Gateways', 'Insert'] +- ['vpn-gateways_list.md', 'Vpn Gateways', 'List'] +- ['vpn-gateways_set-labels.md', 'Vpn Gateways', 'Set Labels'] +- ['vpn-gateways_test-iam-permissions.md', 'Vpn Gateways', 'Test Iam Permissions'] - ['vpn-tunnels_aggregated-list.md', 'Vpn Tunnels', 'Aggregated List'] - ['vpn-tunnels_delete.md', 'Vpn Tunnels', 'Delete'] - ['vpn-tunnels_get.md', 'Vpn Tunnels', 'Get'] @@ -438,6 +517,7 @@ pages: - ['zone-operations_delete.md', 'Zone Operations', 'Delete'] - ['zone-operations_get.md', 'Zone Operations', 'Get'] - ['zone-operations_list.md', 'Zone Operations', 'List'] +- ['zone-operations_wait.md', 'Zone Operations', 'Wait'] - ['zones_get.md', 'Zones', 'Get'] - ['zones_list.md', 'Zones', 'List'] diff --git a/gen/compute1-cli/src/main.rs b/gen/compute1-cli/src/main.rs index 6ef83e1593..5717210abf 100644 --- a/gen/compute1-cli/src/main.rs +++ b/gen/compute1-cli/src/main.rs @@ -61,6 +61,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -77,7 +80,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -243,6 +246,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -259,7 +265,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -586,6 +592,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -602,7 +611,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -768,22 +777,24 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-size" => Some(("recommendedSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "region", "self-link", "status", "target", "utilization-target", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "mode", "name", "recommended-size", "region", "self-link", "status", "target", "utilization-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -936,22 +947,24 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-size" => Some(("recommendedSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "region", "self-link", "status", "target", "utilization-target", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "mode", "name", "recommended-size", "region", "self-link", "status", "target", "utilization-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1042,22 +1055,24 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-size" => Some(("recommendedSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "region", "self-link", "status", "target", "utilization-target", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "mode", "name", "recommended-size", "region", "self-link", "status", "target", "utilization-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1842,6 +1857,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -1858,7 +1876,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -2166,11 +2184,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "connection-draining.draining-timeout-sec" => Some(("connectionDraining.drainingTimeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locality-lb-policy" => Some(("localityLbPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-checks" => Some(("healthChecks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.signed-url-key-names" => Some(("cdnPolicy.signedUrlKeyNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cdn-policy.signed-url-cache-max-age-sec" => Some(("cdnPolicy.signedUrlCacheMaxAgeSec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.query-string-blacklist" => Some(("cdnPolicy.cacheKeyPolicy.queryStringBlacklist", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2179,8 +2198,32 @@ impl<'n> Engine<'n> { "cdn-policy.cache-key-policy.include-host" => Some(("cdnPolicy.cacheKeyPolicy.includeHost", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.include-protocol" => Some(("cdnPolicy.cacheKeyPolicy.includeProtocol", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "enable-cdn" => Some(("enableCDN", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outlier-detection.interval.nanos" => Some(("outlierDetection.interval.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.interval.seconds" => Some(("outlierDetection.interval.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-errors" => Some(("outlierDetection.enforcingConsecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-request-volume" => Some(("outlierDetection.successRateRequestVolume", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.nanos" => Some(("outlierDetection.baseEjectionTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.seconds" => Some(("outlierDetection.baseEjectionTime.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-gateway-failure" => Some(("outlierDetection.enforcingConsecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-minimum-hosts" => Some(("outlierDetection.successRateMinimumHosts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-errors" => Some(("outlierDetection.consecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-stdev-factor" => Some(("outlierDetection.successRateStdevFactor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.max-ejection-percent" => Some(("outlierDetection.maxEjectionPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-gateway-failure" => Some(("outlierDetection.consecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-success-rate" => Some(("outlierDetection.enforcingSuccessRate", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "affinity-cookie-ttl-sec" => Some(("affinityCookieTtlSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.path" => Some(("consistentHash.httpCookie.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.name" => Some(("consistentHash.httpCookie.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.nanos" => Some(("consistentHash.httpCookie.ttl.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.seconds" => Some(("consistentHash.httpCookie.ttl.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.minimum-ring-size" => Some(("consistentHash.minimumRingSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-header-name" => Some(("consistentHash.httpHeaderName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "circuit-breakers.max-pending-requests" => Some(("circuitBreakers.maxPendingRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-retries" => Some(("circuitBreakers.maxRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests" => Some(("circuitBreakers.maxRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests-per-connection" => Some(("circuitBreakers.maxRequestsPerConnection", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-connections" => Some(("circuitBreakers.maxConnections", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2190,13 +2233,19 @@ impl<'n> Engine<'n> { "security-policy" => Some(("securityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.sample-rate" => Some(("logConfig.sampleRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "failover-policy.drop-traffic-if-unhealthy" => Some(("failoverPolicy.dropTrafficIfUnhealthy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "failover-policy.failover-ratio" => Some(("failoverPolicy.failoverRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "failover-policy.disable-connection-drain-on-failover" => Some(("failoverPolicy.disableConnectionDrainOnFailover", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "cache-key-policy", "cdn-policy", "connection-draining", "creation-timestamp", "custom-request-headers", "description", "draining-timeout-sec", "enable-cdn", "enabled", "fingerprint", "health-checks", "iap", "id", "include-host", "include-protocol", "include-query-string", "kind", "load-balancing-scheme", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "timeout-sec"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "base-ejection-time", "cache-key-policy", "cdn-policy", "circuit-breakers", "connection-draining", "consecutive-errors", "consecutive-gateway-failure", "consistent-hash", "creation-timestamp", "custom-request-headers", "description", "disable-connection-drain-on-failover", "draining-timeout-sec", "drop-traffic-if-unhealthy", "enable", "enable-cdn", "enabled", "enforcing-consecutive-errors", "enforcing-consecutive-gateway-failure", "enforcing-success-rate", "failover-policy", "failover-ratio", "fingerprint", "health-checks", "http-cookie", "http-header-name", "iap", "id", "include-host", "include-protocol", "include-query-string", "interval", "kind", "load-balancing-scheme", "locality-lb-policy", "log-config", "max-connections", "max-ejection-percent", "max-pending-requests", "max-requests", "max-requests-per-connection", "max-retries", "minimum-ring-size", "name", "nanos", "network", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "outlier-detection", "path", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "sample-rate", "seconds", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "success-rate-minimum-hosts", "success-rate-request-volume", "success-rate-stdev-factor", "timeout-sec", "ttl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2350,11 +2399,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "connection-draining.draining-timeout-sec" => Some(("connectionDraining.drainingTimeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locality-lb-policy" => Some(("localityLbPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-checks" => Some(("healthChecks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.signed-url-key-names" => Some(("cdnPolicy.signedUrlKeyNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cdn-policy.signed-url-cache-max-age-sec" => Some(("cdnPolicy.signedUrlCacheMaxAgeSec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.query-string-blacklist" => Some(("cdnPolicy.cacheKeyPolicy.queryStringBlacklist", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2363,8 +2413,32 @@ impl<'n> Engine<'n> { "cdn-policy.cache-key-policy.include-host" => Some(("cdnPolicy.cacheKeyPolicy.includeHost", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.include-protocol" => Some(("cdnPolicy.cacheKeyPolicy.includeProtocol", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "enable-cdn" => Some(("enableCDN", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outlier-detection.interval.nanos" => Some(("outlierDetection.interval.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.interval.seconds" => Some(("outlierDetection.interval.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-errors" => Some(("outlierDetection.enforcingConsecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-request-volume" => Some(("outlierDetection.successRateRequestVolume", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.nanos" => Some(("outlierDetection.baseEjectionTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.seconds" => Some(("outlierDetection.baseEjectionTime.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-gateway-failure" => Some(("outlierDetection.enforcingConsecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-minimum-hosts" => Some(("outlierDetection.successRateMinimumHosts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-errors" => Some(("outlierDetection.consecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-stdev-factor" => Some(("outlierDetection.successRateStdevFactor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.max-ejection-percent" => Some(("outlierDetection.maxEjectionPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-gateway-failure" => Some(("outlierDetection.consecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-success-rate" => Some(("outlierDetection.enforcingSuccessRate", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "affinity-cookie-ttl-sec" => Some(("affinityCookieTtlSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.path" => Some(("consistentHash.httpCookie.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.name" => Some(("consistentHash.httpCookie.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.nanos" => Some(("consistentHash.httpCookie.ttl.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.seconds" => Some(("consistentHash.httpCookie.ttl.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.minimum-ring-size" => Some(("consistentHash.minimumRingSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-header-name" => Some(("consistentHash.httpHeaderName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "circuit-breakers.max-pending-requests" => Some(("circuitBreakers.maxPendingRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-retries" => Some(("circuitBreakers.maxRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests" => Some(("circuitBreakers.maxRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests-per-connection" => Some(("circuitBreakers.maxRequestsPerConnection", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-connections" => Some(("circuitBreakers.maxConnections", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2374,13 +2448,19 @@ impl<'n> Engine<'n> { "security-policy" => Some(("securityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.sample-rate" => Some(("logConfig.sampleRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "failover-policy.drop-traffic-if-unhealthy" => Some(("failoverPolicy.dropTrafficIfUnhealthy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "failover-policy.failover-ratio" => Some(("failoverPolicy.failoverRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "failover-policy.disable-connection-drain-on-failover" => Some(("failoverPolicy.disableConnectionDrainOnFailover", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "cache-key-policy", "cdn-policy", "connection-draining", "creation-timestamp", "custom-request-headers", "description", "draining-timeout-sec", "enable-cdn", "enabled", "fingerprint", "health-checks", "iap", "id", "include-host", "include-protocol", "include-query-string", "kind", "load-balancing-scheme", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "timeout-sec"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "base-ejection-time", "cache-key-policy", "cdn-policy", "circuit-breakers", "connection-draining", "consecutive-errors", "consecutive-gateway-failure", "consistent-hash", "creation-timestamp", "custom-request-headers", "description", "disable-connection-drain-on-failover", "draining-timeout-sec", "drop-traffic-if-unhealthy", "enable", "enable-cdn", "enabled", "enforcing-consecutive-errors", "enforcing-consecutive-gateway-failure", "enforcing-success-rate", "failover-policy", "failover-ratio", "fingerprint", "health-checks", "http-cookie", "http-header-name", "iap", "id", "include-host", "include-protocol", "include-query-string", "interval", "kind", "load-balancing-scheme", "locality-lb-policy", "log-config", "max-connections", "max-ejection-percent", "max-pending-requests", "max-requests", "max-requests-per-connection", "max-retries", "minimum-ring-size", "name", "nanos", "network", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "outlier-detection", "path", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "sample-rate", "seconds", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "success-rate-minimum-hosts", "success-rate-request-volume", "success-rate-stdev-factor", "timeout-sec", "ttl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2558,11 +2638,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "connection-draining.draining-timeout-sec" => Some(("connectionDraining.drainingTimeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locality-lb-policy" => Some(("localityLbPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-checks" => Some(("healthChecks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.signed-url-key-names" => Some(("cdnPolicy.signedUrlKeyNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cdn-policy.signed-url-cache-max-age-sec" => Some(("cdnPolicy.signedUrlCacheMaxAgeSec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.query-string-blacklist" => Some(("cdnPolicy.cacheKeyPolicy.queryStringBlacklist", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2571,8 +2652,32 @@ impl<'n> Engine<'n> { "cdn-policy.cache-key-policy.include-host" => Some(("cdnPolicy.cacheKeyPolicy.includeHost", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.include-protocol" => Some(("cdnPolicy.cacheKeyPolicy.includeProtocol", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "enable-cdn" => Some(("enableCDN", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outlier-detection.interval.nanos" => Some(("outlierDetection.interval.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.interval.seconds" => Some(("outlierDetection.interval.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-errors" => Some(("outlierDetection.enforcingConsecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-request-volume" => Some(("outlierDetection.successRateRequestVolume", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.nanos" => Some(("outlierDetection.baseEjectionTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.seconds" => Some(("outlierDetection.baseEjectionTime.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-gateway-failure" => Some(("outlierDetection.enforcingConsecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-minimum-hosts" => Some(("outlierDetection.successRateMinimumHosts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-errors" => Some(("outlierDetection.consecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-stdev-factor" => Some(("outlierDetection.successRateStdevFactor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.max-ejection-percent" => Some(("outlierDetection.maxEjectionPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-gateway-failure" => Some(("outlierDetection.consecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-success-rate" => Some(("outlierDetection.enforcingSuccessRate", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "affinity-cookie-ttl-sec" => Some(("affinityCookieTtlSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.path" => Some(("consistentHash.httpCookie.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.name" => Some(("consistentHash.httpCookie.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.nanos" => Some(("consistentHash.httpCookie.ttl.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.seconds" => Some(("consistentHash.httpCookie.ttl.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.minimum-ring-size" => Some(("consistentHash.minimumRingSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-header-name" => Some(("consistentHash.httpHeaderName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "circuit-breakers.max-pending-requests" => Some(("circuitBreakers.maxPendingRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-retries" => Some(("circuitBreakers.maxRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests" => Some(("circuitBreakers.maxRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests-per-connection" => Some(("circuitBreakers.maxRequestsPerConnection", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-connections" => Some(("circuitBreakers.maxConnections", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2582,13 +2687,19 @@ impl<'n> Engine<'n> { "security-policy" => Some(("securityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.sample-rate" => Some(("logConfig.sampleRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "failover-policy.drop-traffic-if-unhealthy" => Some(("failoverPolicy.dropTrafficIfUnhealthy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "failover-policy.failover-ratio" => Some(("failoverPolicy.failoverRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "failover-policy.disable-connection-drain-on-failover" => Some(("failoverPolicy.disableConnectionDrainOnFailover", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "cache-key-policy", "cdn-policy", "connection-draining", "creation-timestamp", "custom-request-headers", "description", "draining-timeout-sec", "enable-cdn", "enabled", "fingerprint", "health-checks", "iap", "id", "include-host", "include-protocol", "include-query-string", "kind", "load-balancing-scheme", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "timeout-sec"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "base-ejection-time", "cache-key-policy", "cdn-policy", "circuit-breakers", "connection-draining", "consecutive-errors", "consecutive-gateway-failure", "consistent-hash", "creation-timestamp", "custom-request-headers", "description", "disable-connection-drain-on-failover", "draining-timeout-sec", "drop-traffic-if-unhealthy", "enable", "enable-cdn", "enabled", "enforcing-consecutive-errors", "enforcing-consecutive-gateway-failure", "enforcing-success-rate", "failover-policy", "failover-ratio", "fingerprint", "health-checks", "http-cookie", "http-header-name", "iap", "id", "include-host", "include-protocol", "include-query-string", "interval", "kind", "load-balancing-scheme", "locality-lb-policy", "log-config", "max-connections", "max-ejection-percent", "max-pending-requests", "max-requests", "max-requests-per-connection", "max-retries", "minimum-ring-size", "name", "nanos", "network", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "outlier-detection", "path", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "sample-rate", "seconds", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "success-rate-minimum-hosts", "success-rate-request-volume", "success-rate-stdev-factor", "timeout-sec", "ttl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2667,6 +2778,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -2683,7 +2797,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -2938,6 +3052,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -2954,7 +3071,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -3015,12 +3132,14 @@ impl<'n> Engine<'n> { "auto-created" => Some(("autoCreated", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.raw-key" => Some(("sourceDiskEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-disk-encryption-key.kms-key-service-account" => Some(("sourceDiskEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.sha256" => Some(("sourceDiskEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.kms-key-name" => Some(("sourceDiskEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "storage-bytes" => Some(("storageBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snapshot-encryption-key.raw-key" => Some(("snapshotEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snapshot-encryption-key.kms-key-service-account" => Some(("snapshotEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snapshot-encryption-key.sha256" => Some(("snapshotEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snapshot-encryption-key.kms-key-name" => Some(("snapshotEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "storage-locations" => Some(("storageLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -3029,6 +3148,7 @@ impl<'n> Engine<'n> { "source-disk-id" => Some(("sourceDiskId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-size-gb" => Some(("diskSizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk" => Some(("sourceDisk", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "download-bytes" => Some(("downloadBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "licenses" => Some(("licenses", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "storage-bytes-status" => Some(("storageBytesStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3036,7 +3156,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "license-codes" => Some(("licenseCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-created", "creation-timestamp", "description", "disk-size-gb", "id", "kind", "kms-key-name", "label-fingerprint", "labels", "license-codes", "licenses", "name", "raw-key", "self-link", "sha256", "snapshot-encryption-key", "source-disk", "source-disk-encryption-key", "source-disk-id", "status", "storage-bytes", "storage-bytes-status", "storage-locations"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-created", "creation-timestamp", "description", "disk-size-gb", "download-bytes", "id", "kind", "kms-key-name", "kms-key-service-account", "label-fingerprint", "labels", "license-codes", "licenses", "name", "raw-key", "self-link", "sha256", "snapshot-encryption-key", "source-disk", "source-disk-encryption-key", "source-disk-id", "status", "storage-bytes", "storage-bytes-status", "storage-locations"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3287,6 +3407,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "source-image-encryption-key.raw-key" => Some(("sourceImageEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-image-encryption-key.kms-key-service-account" => Some(("sourceImageEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image-encryption-key.sha256" => Some(("sourceImageEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image-encryption-key.kms-key-name" => Some(("sourceImageEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -3295,6 +3416,7 @@ impl<'n> Engine<'n> { "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "license-codes" => Some(("licenseCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "disk-encryption-key.raw-key" => Some(("diskEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-encryption-key.kms-key-service-account" => Some(("diskEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-key.sha256" => Some(("diskEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-key.kms-key-name" => Some(("diskEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3316,13 +3438,14 @@ impl<'n> Engine<'n> { "size-gb" => Some(("sizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.raw-key" => Some(("sourceSnapshotEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-snapshot-encryption-key.kms-key-service-account" => Some(("sourceSnapshotEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.sha256" => Some(("sourceSnapshotEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.kms-key-name" => Some(("sourceSnapshotEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "options" => Some(("options", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image" => Some(("sourceImage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "disk-encryption-key", "id", "kind", "kms-key-name", "label-fingerprint", "labels", "last-attach-timestamp", "last-detach-timestamp", "license-codes", "licenses", "name", "options", "physical-block-size-bytes", "raw-key", "region", "replica-zones", "resource-policies", "self-link", "sha256", "size-gb", "source-image", "source-image-encryption-key", "source-image-id", "source-snapshot", "source-snapshot-encryption-key", "source-snapshot-id", "status", "type", "users", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "disk-encryption-key", "id", "kind", "kms-key-name", "kms-key-service-account", "label-fingerprint", "labels", "last-attach-timestamp", "last-detach-timestamp", "license-codes", "licenses", "name", "options", "physical-block-size-bytes", "raw-key", "region", "replica-zones", "resource-policies", "self-link", "sha256", "size-gb", "source-image", "source-image-encryption-key", "source-image-id", "source-snapshot", "source-snapshot-encryption-key", "source-snapshot-id", "status", "type", "users", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3895,6 +4018,447 @@ impl<'n> Engine<'n> { } } + fn _external_vpn_gateways_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.external_vpn_gateways().delete(opt.value_of("project").unwrap_or(""), opt.value_of("external-vpn-gateway").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _external_vpn_gateways_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.external_vpn_gateways().get(opt.value_of("project").unwrap_or(""), opt.value_of("external-vpn-gateway").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _external_vpn_gateways_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "label-fingerprint" => Some(("labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "redundancy-type" => Some(("redundancyType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "label-fingerprint", "labels", "name", "redundancy-type", "self-link"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ExternalVpnGateway = json::value::from_value(object).unwrap(); + let mut call = self.hub.external_vpn_gateways().insert(request, opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _external_vpn_gateways_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.external_vpn_gateways().list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _external_vpn_gateways_set_labels(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "label-fingerprint" => Some(("labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["label-fingerprint", "labels"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GlobalSetLabelsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.external_vpn_gateways().set_labels(request, opt.value_of("project").unwrap_or(""), opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _external_vpn_gateways_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.external_vpn_gateways().test_iam_permissions(request, opt.value_of("project").unwrap_or(""), opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _firewalls_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.firewalls().delete(opt.value_of("project").unwrap_or(""), opt.value_of("firewall").unwrap_or("")); @@ -4398,6 +4962,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -4414,7 +4981,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -4579,29 +5146,32 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "ip-address" => Some(("IPAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "service-label" => Some(("serviceLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network-tier" => Some(("networkTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port-range" => Some(("portRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "backend-service" => Some(("backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "ip-version" => Some(("ipVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "all-ports" => Some(("allPorts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "ports" => Some(("ports", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ip-version" => Some(("ipVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ip-protocol" => Some(("IPProtocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "subnetwork" => Some(("subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "port-range" => Some(("portRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "service-name" => Some(("serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backend-service" => Some(("backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ip-address" => Some(("IPAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-label" => Some(("serviceLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "allow-global-access" => Some(("allowGlobalAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-tier" => Some(("networkTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-mirroring-collector" => Some(("isMirroringCollector", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subnetwork" => Some(("subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ports" => Some(("ports", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-address", "ip-protocol", "all-ports", "backend-service", "creation-timestamp", "description", "id", "ip-version", "kind", "load-balancing-scheme", "name", "network", "network-tier", "port-range", "ports", "region", "self-link", "service-label", "service-name", "subnetwork", "target"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-address", "ip-protocol", "all-ports", "allow-global-access", "backend-service", "creation-timestamp", "description", "fingerprint", "id", "ip-version", "is-mirroring-collector", "kind", "load-balancing-scheme", "name", "network", "network-tier", "port-range", "ports", "region", "self-link", "service-label", "service-name", "subnetwork", "target"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4730,6 +5300,118 @@ impl<'n> Engine<'n> { } } + fn _forwarding_rules_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "all-ports" => Some(("allPorts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ip-version" => Some(("ipVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ip-protocol" => Some(("IPProtocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "port-range" => Some(("portRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-name" => Some(("serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backend-service" => Some(("backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ip-address" => Some(("IPAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-label" => Some(("serviceLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "allow-global-access" => Some(("allowGlobalAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-tier" => Some(("networkTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-mirroring-collector" => Some(("isMirroringCollector", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subnetwork" => Some(("subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ports" => Some(("ports", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-address", "ip-protocol", "all-ports", "allow-global-access", "backend-service", "creation-timestamp", "description", "fingerprint", "id", "ip-version", "is-mirroring-collector", "kind", "load-balancing-scheme", "name", "network", "network-tier", "port-range", "ports", "region", "self-link", "service-label", "service-name", "subnetwork", "target"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ForwardingRule = json::value::from_value(object).unwrap(); + let mut call = self.hub.forwarding_rules().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("forwarding-rule").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _forwarding_rules_set_target(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -5228,29 +5910,32 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "ip-address" => Some(("IPAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "service-label" => Some(("serviceLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network-tier" => Some(("networkTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port-range" => Some(("portRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "backend-service" => Some(("backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "ip-version" => Some(("ipVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "all-ports" => Some(("allPorts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "ports" => Some(("ports", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ip-version" => Some(("ipVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ip-protocol" => Some(("IPProtocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "subnetwork" => Some(("subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "port-range" => Some(("portRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "service-name" => Some(("serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backend-service" => Some(("backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ip-address" => Some(("IPAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-label" => Some(("serviceLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "allow-global-access" => Some(("allowGlobalAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-tier" => Some(("networkTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-mirroring-collector" => Some(("isMirroringCollector", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subnetwork" => Some(("subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ports" => Some(("ports", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-address", "ip-protocol", "all-ports", "backend-service", "creation-timestamp", "description", "id", "ip-version", "kind", "load-balancing-scheme", "name", "network", "network-tier", "port-range", "ports", "region", "self-link", "service-label", "service-name", "subnetwork", "target"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-address", "ip-protocol", "all-ports", "allow-global-access", "backend-service", "creation-timestamp", "description", "fingerprint", "id", "ip-version", "is-mirroring-collector", "kind", "load-balancing-scheme", "name", "network", "network-tier", "port-range", "ports", "region", "self-link", "service-label", "service-name", "subnetwork", "target"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5379,6 +6064,118 @@ impl<'n> Engine<'n> { } } + fn _global_forwarding_rules_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "all-ports" => Some(("allPorts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ip-version" => Some(("ipVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ip-protocol" => Some(("IPProtocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "port-range" => Some(("portRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-name" => Some(("serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backend-service" => Some(("backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ip-address" => Some(("IPAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-label" => Some(("serviceLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "allow-global-access" => Some(("allowGlobalAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-tier" => Some(("networkTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-mirroring-collector" => Some(("isMirroringCollector", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subnetwork" => Some(("subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ports" => Some(("ports", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-address", "ip-protocol", "all-ports", "allow-global-access", "backend-service", "creation-timestamp", "description", "fingerprint", "id", "ip-version", "is-mirroring-collector", "kind", "load-balancing-scheme", "name", "network", "network-tier", "port-range", "ports", "region", "self-link", "service-label", "service-name", "subnetwork", "target"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ForwardingRule = json::value::from_value(object).unwrap(); + let mut call = self.hub.global_forwarding_rules().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("forwarding-rule").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _global_forwarding_rules_set_target(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -5468,9 +6265,393 @@ impl<'n> Engine<'n> { } } - fn _global_operations_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + fn _global_network_endpoint_groups_attach_network_endpoints(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.global_operations().aggregated_list(opt.value_of("project").unwrap_or("")); + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GlobalNetworkEndpointGroupsAttachEndpointsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.global_network_endpoint_groups().attach_network_endpoints(request, opt.value_of("project").unwrap_or(""), opt.value_of("network-endpoint-group").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _global_network_endpoint_groups_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.global_network_endpoint_groups().delete(opt.value_of("project").unwrap_or(""), opt.value_of("network-endpoint-group").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _global_network_endpoint_groups_detach_network_endpoints(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GlobalNetworkEndpointGroupsDetachEndpointsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.global_network_endpoint_groups().detach_network_endpoints(request, opt.value_of("project").unwrap_or(""), opt.value_of("network-endpoint-group").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _global_network_endpoint_groups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.global_network_endpoint_groups().get(opt.value_of("project").unwrap_or(""), opt.value_of("network-endpoint-group").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _global_network_endpoint_groups_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-port" => Some(("defaultPort", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "network-endpoint-type" => Some(("networkEndpointType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subnetwork" => Some(("subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "default-port", "description", "id", "kind", "name", "network", "network-endpoint-type", "self-link", "size", "subnetwork", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::NetworkEndpointGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.global_network_endpoint_groups().insert(request, opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _global_network_endpoint_groups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.global_network_endpoint_groups().list(opt.value_of("project").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { @@ -5533,6 +6714,139 @@ impl<'n> Engine<'n> { } } + fn _global_network_endpoint_groups_list_network_endpoints(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.global_network_endpoint_groups().list_network_endpoints(opt.value_of("project").unwrap_or(""), opt.value_of("network-endpoint-group").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _global_operations_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.global_operations().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _global_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.global_operations().delete(opt.value_of("project").unwrap_or(""), opt.value_of("operation").unwrap_or("")); @@ -5694,6 +7008,126 @@ impl<'n> Engine<'n> { } } + fn _global_operations_wait(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.global_operations().wait(opt.value_of("project").unwrap_or(""), opt.value_of("operation").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _health_checks_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.health_checks().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _health_checks_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.health_checks().delete(opt.value_of("project").unwrap_or(""), opt.value_of("health-check").unwrap_or("")); @@ -5829,13 +7263,8 @@ impl<'n> Engine<'n> { "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "check-interval-sec" => Some(("checkIntervalSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.request-path" => Some(("httpHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.proxy-header" => Some(("httpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port-specification" => Some(("httpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5843,13 +7272,7 @@ impl<'n> Engine<'n> { "http-health-check.host" => Some(("httpHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port-name" => Some(("httpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port" => Some(("httpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "healthy-threshold" => Some(("healthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "ssl-health-check.proxy-header" => Some(("sslHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ssl-health-check.request" => Some(("sslHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5864,13 +7287,25 @@ impl<'n> Engine<'n> { "http2-health-check.host" => Some(("http2HealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http2-health-check.port-name" => Some(("http2HealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http2-health-check.port" => Some(("http2HealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "region", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6026,13 +7461,8 @@ impl<'n> Engine<'n> { "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "check-interval-sec" => Some(("checkIntervalSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.request-path" => Some(("httpHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.proxy-header" => Some(("httpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port-specification" => Some(("httpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -6040,13 +7470,7 @@ impl<'n> Engine<'n> { "http-health-check.host" => Some(("httpHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port-name" => Some(("httpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port" => Some(("httpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "healthy-threshold" => Some(("healthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "ssl-health-check.proxy-header" => Some(("sslHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ssl-health-check.request" => Some(("sslHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -6061,13 +7485,25 @@ impl<'n> Engine<'n> { "http2-health-check.host" => Some(("http2HealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http2-health-check.port-name" => Some(("http2HealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http2-health-check.port" => Some(("http2HealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "region", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6158,13 +7594,8 @@ impl<'n> Engine<'n> { "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "check-interval-sec" => Some(("checkIntervalSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.request-path" => Some(("httpHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.proxy-header" => Some(("httpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port-specification" => Some(("httpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -6172,13 +7603,7 @@ impl<'n> Engine<'n> { "http-health-check.host" => Some(("httpHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port-name" => Some(("httpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-health-check.port" => Some(("httpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "healthy-threshold" => Some(("healthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "ssl-health-check.proxy-header" => Some(("sslHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ssl-health-check.request" => Some(("sslHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -6193,13 +7618,25 @@ impl<'n> Engine<'n> { "http2-health-check.host" => Some(("http2HealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http2-health-check.port-name" => Some(("http2HealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http2-health-check.port" => Some(("http2HealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "region", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -7544,9 +8981,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "source-image-encryption-key.raw-key" => Some(("sourceImageEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-image-encryption-key.kms-key-service-account" => Some(("sourceImageEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image-encryption-key.sha256" => Some(("sourceImageEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image-encryption-key.kms-key-name" => Some(("sourceImageEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.raw-key" => Some(("sourceDiskEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-disk-encryption-key.kms-key-service-account" => Some(("sourceDiskEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.sha256" => Some(("sourceDiskEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.kms-key-name" => Some(("sourceDiskEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "family" => Some(("family", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -7557,11 +8996,15 @@ impl<'n> Engine<'n> { "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "license-codes" => Some(("licenseCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "source-disk" => Some(("sourceDisk", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-locations" => Some(("storageLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "image-encryption-key.raw-key" => Some(("imageEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "image-encryption-key.kms-key-service-account" => Some(("imageEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "image-encryption-key.sha256" => Some(("imageEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "image-encryption-key.kms-key-name" => Some(("imageEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot" => Some(("sourceSnapshot", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shielded-instance-initial-state.pk.content" => Some(("shieldedInstanceInitialState.pk.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shielded-instance-initial-state.pk.file-type" => Some(("shieldedInstanceInitialState.pk.fileType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "raw-disk.container-type" => Some(("rawDisk.containerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "raw-disk.source" => Some(("rawDisk.source", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -7581,11 +9024,12 @@ impl<'n> Engine<'n> { "deprecated.replacement" => Some(("deprecated.replacement", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-size-gb" => Some(("diskSizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.raw-key" => Some(("sourceSnapshotEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-snapshot-encryption-key.kms-key-service-account" => Some(("sourceSnapshotEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.sha256" => Some(("sourceSnapshotEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.kms-key-name" => Some(("sourceSnapshotEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-size-bytes", "container-type", "creation-timestamp", "deleted", "deprecated", "description", "disk-size-gb", "family", "id", "image-encryption-key", "kind", "kms-key-name", "label-fingerprint", "labels", "license-codes", "licenses", "name", "obsolete", "raw-disk", "raw-key", "replacement", "self-link", "sha1-checksum", "sha256", "source", "source-disk", "source-disk-encryption-key", "source-disk-id", "source-image", "source-image-encryption-key", "source-image-id", "source-snapshot", "source-snapshot-encryption-key", "source-snapshot-id", "source-type", "state", "status"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-size-bytes", "container-type", "content", "creation-timestamp", "deleted", "deprecated", "description", "disk-size-gb", "family", "file-type", "id", "image-encryption-key", "kind", "kms-key-name", "kms-key-service-account", "label-fingerprint", "labels", "license-codes", "licenses", "name", "obsolete", "pk", "raw-disk", "raw-key", "replacement", "self-link", "sha1-checksum", "sha256", "shielded-instance-initial-state", "source", "source-disk", "source-disk-encryption-key", "source-disk-id", "source-image", "source-image-encryption-key", "source-image-id", "source-snapshot", "source-snapshot-encryption-key", "source-snapshot-id", "source-type", "state", "status", "storage-locations"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -8080,6 +9524,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -8096,7 +9543,182 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_apply_updates_to_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "instances" => Some(("instances", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "most-disruptive-allowed-action" => Some(("mostDisruptiveAllowedAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "minimal-action" => Some(("minimalAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["instances", "minimal-action", "most-disruptive-allowed-action"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManagersApplyUpdatesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().apply_updates_to_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _instance_group_managers_create_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstanceGroupManagersCreateInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instance_group_managers().create_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); v } )); } } @@ -8351,6 +9973,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.is-stable" => Some(("status.isStable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.version-target.is-reached" => Some(("status.versionTarget.isReached", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.autoscaler" => Some(("status.autoscaler", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "current-actions.none" => Some(("currentActions.none", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.recreating" => Some(("currentActions.recreating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.creating" => Some(("currentActions.creating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -8368,14 +9992,16 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "target-pools" => Some(("targetPools", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "instance-template" => Some(("instanceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.replacement-method" => Some(("updatePolicy.replacementMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-surge.calculated" => Some(("updatePolicy.maxSurge.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.fixed" => Some(("updatePolicy.maxSurge.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.percent" => Some(("updatePolicy.maxSurge.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.minimal-action" => Some(("updatePolicy.minimalAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.instance-redistribution-type" => Some(("updatePolicy.instanceRedistributionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-unavailable.calculated" => Some(("updatePolicy.maxUnavailable.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.fixed" => Some(("updatePolicy.maxUnavailable.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.percent" => Some(("updatePolicy.maxUnavailable.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "base-instance-name" => Some(("baseInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -8383,7 +10009,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-template", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "autoscaler", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-redistribution-type", "instance-template", "is-reached", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "replacement-method", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "version-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -8512,6 +10138,71 @@ impl<'n> Engine<'n> { } } + fn _instance_group_managers_list_errors(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.instance_group_managers().list_errors(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _instance_group_managers_list_managed_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.instance_group_managers().list_managed_instances(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); @@ -8543,7 +10234,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["filter", "page-token", "order-by", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); v } )); } } @@ -8601,6 +10292,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.is-stable" => Some(("status.isStable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.version-target.is-reached" => Some(("status.versionTarget.isReached", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.autoscaler" => Some(("status.autoscaler", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "current-actions.none" => Some(("currentActions.none", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.recreating" => Some(("currentActions.recreating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.creating" => Some(("currentActions.creating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -8618,14 +10311,16 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "target-pools" => Some(("targetPools", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "instance-template" => Some(("instanceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.replacement-method" => Some(("updatePolicy.replacementMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-surge.calculated" => Some(("updatePolicy.maxSurge.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.fixed" => Some(("updatePolicy.maxSurge.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.percent" => Some(("updatePolicy.maxSurge.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.minimal-action" => Some(("updatePolicy.minimalAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.instance-redistribution-type" => Some(("updatePolicy.instanceRedistributionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-unavailable.calculated" => Some(("updatePolicy.maxUnavailable.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.fixed" => Some(("updatePolicy.maxUnavailable.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.percent" => Some(("updatePolicy.maxUnavailable.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "base-instance-name" => Some(("baseInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -8633,7 +10328,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-template", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "autoscaler", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-redistribution-type", "instance-template", "is-reached", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "replacement-method", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "version-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -9125,6 +10820,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -9141,7 +10839,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -9919,6 +11617,7 @@ impl<'n> Engine<'n> { "properties.shielded-instance-config.enable-vtpm" => Some(("properties.shieldedInstanceConfig.enableVtpm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "properties.shielded-instance-config.enable-integrity-monitoring" => Some(("properties.shieldedInstanceConfig.enableIntegrityMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "properties.shielded-instance-config.enable-secure-boot" => Some(("properties.shieldedInstanceConfig.enableSecureBoot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "properties.resource-policies" => Some(("properties.resourcePolicies", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "properties.min-cpu-platform" => Some(("properties.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.scheduling.automatic-restart" => Some(("properties.scheduling.automaticRestart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "properties.scheduling.preemptible" => Some(("properties.scheduling.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -9932,7 +11631,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "can-ip-forward", "consume-reservation-type", "creation-timestamp", "description", "enable-integrity-monitoring", "enable-secure-boot", "enable-vtpm", "fingerprint", "id", "items", "key", "kind", "labels", "machine-type", "metadata", "min-cpu-platform", "name", "on-host-maintenance", "preemptible", "properties", "reservation-affinity", "scheduling", "self-link", "shielded-instance-config", "source-instance", "tags", "values"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "can-ip-forward", "consume-reservation-type", "creation-timestamp", "description", "enable-integrity-monitoring", "enable-secure-boot", "enable-vtpm", "fingerprint", "id", "items", "key", "kind", "labels", "machine-type", "metadata", "min-cpu-platform", "name", "on-host-maintenance", "preemptible", "properties", "reservation-affinity", "resource-policies", "scheduling", "self-link", "shielded-instance-config", "source-instance", "tags", "values"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -10329,6 +12028,95 @@ impl<'n> Engine<'n> { } } + fn _instances_add_resource_policies(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "resource-policies" => Some(("resourcePolicies", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["resource-policies"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstancesAddResourcePoliciesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instances().add_resource_policies(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _instances_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.instances().aggregated_list(opt.value_of("project").unwrap_or("")); @@ -10344,6 +12132,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -10360,7 +12151,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -10418,34 +12209,41 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "disk-encryption-key.raw-key" => Some(("diskEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-encryption-key.kms-key-service-account" => Some(("diskEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-key.sha256" => Some(("diskEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-key.kms-key-name" => Some(("diskEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "device-name" => Some(("deviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.source-snapshot" => Some(("initializeParams.sourceSnapshot", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "initialize-params.disk-name" => Some(("initializeParams.diskName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "initialize-params.description" => Some(("initializeParams.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "initialize-params.on-update-action" => Some(("initializeParams.onUpdateAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "initialize-params.labels" => Some(("initializeParams.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "initialize-params.source-image-encryption-key.raw-key" => Some(("initializeParams.sourceImageEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "initialize-params.source-image-encryption-key.kms-key-service-account" => Some(("initializeParams.sourceImageEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.source-image-encryption-key.sha256" => Some(("initializeParams.sourceImageEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.source-image-encryption-key.kms-key-name" => Some(("initializeParams.sourceImageEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "initialize-params.description" => Some(("initializeParams.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "initialize-params.labels" => Some(("initializeParams.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "initialize-params.disk-name" => Some(("initializeParams.diskName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.disk-type" => Some(("initializeParams.diskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.disk-size-gb" => Some(("initializeParams.diskSizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.resource-policies" => Some(("initializeParams.resourcePolicies", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "initialize-params.source-image" => Some(("initializeParams.sourceImage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.source-snapshot-encryption-key.raw-key" => Some(("initializeParams.sourceSnapshotEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "initialize-params.source-snapshot-encryption-key.kms-key-service-account" => Some(("initializeParams.sourceSnapshotEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.source-snapshot-encryption-key.sha256" => Some(("initializeParams.sourceSnapshotEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "initialize-params.source-snapshot-encryption-key.kms-key-name" => Some(("initializeParams.sourceSnapshotEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auto-delete" => Some(("autoDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "index" => Some(("index", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "boot" => Some(("boot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "licenses" => Some(("licenses", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "shielded-instance-initial-state.pk.content" => Some(("shieldedInstanceInitialState.pk.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shielded-instance-initial-state.pk.file-type" => Some(("shieldedInstanceInitialState.pk.fileType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-size-gb" => Some(("diskSizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mode" => Some(("mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "interface" => Some(("interface", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "licenses" => Some(("licenses", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source" => Some(("source", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete", "boot", "description", "device-name", "disk-encryption-key", "disk-name", "disk-size-gb", "disk-type", "index", "initialize-params", "interface", "kind", "kms-key-name", "labels", "licenses", "mode", "raw-key", "resource-policies", "sha256", "source", "source-image", "source-image-encryption-key", "source-snapshot", "source-snapshot-encryption-key", "type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete", "boot", "content", "description", "device-name", "disk-encryption-key", "disk-name", "disk-size-gb", "disk-type", "file-type", "index", "initialize-params", "interface", "kind", "kms-key-name", "kms-key-service-account", "labels", "licenses", "mode", "on-update-action", "pk", "raw-key", "resource-policies", "sha256", "shielded-instance-initial-state", "source", "source-image", "source-image-encryption-key", "source-snapshot", "source-snapshot-encryption-key", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -10982,6 +12780,7 @@ impl<'n> Engine<'n> { "reservation-affinity.key" => Some(("reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reservation-affinity.consume-reservation-type" => Some(("reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "display-device.enable-display" => Some(("displayDevice.enableDisplay", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "scheduling.automatic-restart" => Some(("scheduling.automaticRestart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "scheduling.preemptible" => Some(("scheduling.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "scheduling.on-host-maintenance" => Some(("scheduling.onHostMaintenance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -11005,12 +12804,14 @@ impl<'n> Engine<'n> { "tags.items" => Some(("tags.items", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "tags.fingerprint" => Some(("tags.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "label-fingerprint" => Some(("labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-policies" => Some(("resourcePolicies", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "machine-type" => Some(("machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "can-ip-forward", "consume-reservation-type", "cpu-platform", "creation-timestamp", "deletion-protection", "description", "enable-integrity-monitoring", "enable-secure-boot", "enable-vtpm", "fingerprint", "hostname", "id", "items", "key", "kind", "label-fingerprint", "labels", "machine-type", "metadata", "min-cpu-platform", "name", "on-host-maintenance", "preemptible", "reservation-affinity", "scheduling", "self-link", "shielded-instance-config", "shielded-instance-integrity-policy", "start-restricted", "status", "status-message", "tags", "update-auto-learn-policy", "values", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "can-ip-forward", "consume-reservation-type", "cpu-platform", "creation-timestamp", "deletion-protection", "description", "display-device", "enable-display", "enable-integrity-monitoring", "enable-secure-boot", "enable-vtpm", "fingerprint", "hostname", "id", "items", "key", "kind", "label-fingerprint", "labels", "machine-type", "metadata", "min-cpu-platform", "name", "on-host-maintenance", "preemptible", "reservation-affinity", "resource-policies", "scheduling", "self-link", "shielded-instance-config", "shielded-instance-integrity-policy", "start-restricted", "status", "status-message", "tags", "update-auto-learn-policy", "values", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -11207,6 +13008,95 @@ impl<'n> Engine<'n> { } } + fn _instances_remove_resource_policies(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "resource-policies" => Some(("resourcePolicies", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["resource-policies"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstancesRemoveResourcePoliciesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instances().remove_resource_policies(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _instances_reset(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.instances().reset(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance").unwrap_or("")); @@ -12610,6 +14500,135 @@ impl<'n> Engine<'n> { } } + fn _instances_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reservation-affinity.values" => Some(("reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "reservation-affinity.key" => Some(("reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reservation-affinity.consume-reservation-type" => Some(("reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "display-device.enable-display" => Some(("displayDevice.enableDisplay", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "scheduling.automatic-restart" => Some(("scheduling.automaticRestart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "scheduling.preemptible" => Some(("scheduling.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "scheduling.on-host-maintenance" => Some(("scheduling.onHostMaintenance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "min-cpu-platform" => Some(("minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-restricted" => Some(("startRestricted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "shielded-instance-config.enable-vtpm" => Some(("shieldedInstanceConfig.enableVtpm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "shielded-instance-config.enable-integrity-monitoring" => Some(("shieldedInstanceConfig.enableIntegrityMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "shielded-instance-config.enable-secure-boot" => Some(("shieldedInstanceConfig.enableSecureBoot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hostname" => Some(("hostname", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shielded-instance-integrity-policy.update-auto-learn-policy" => Some(("shieldedInstanceIntegrityPolicy.updateAutoLearnPolicy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status-message" => Some(("statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.kind" => Some(("metadata.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.fingerprint" => Some(("metadata.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cpu-platform" => Some(("cpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deletion-protection" => Some(("deletionProtection", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "can-ip-forward" => Some(("canIpForward", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tags.items" => Some(("tags.items", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tags.fingerprint" => Some(("tags.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "label-fingerprint" => Some(("labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-policies" => Some(("resourcePolicies", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "machine-type" => Some(("machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["automatic-restart", "can-ip-forward", "consume-reservation-type", "cpu-platform", "creation-timestamp", "deletion-protection", "description", "display-device", "enable-display", "enable-integrity-monitoring", "enable-secure-boot", "enable-vtpm", "fingerprint", "hostname", "id", "items", "key", "kind", "label-fingerprint", "labels", "machine-type", "metadata", "min-cpu-platform", "name", "on-host-maintenance", "preemptible", "reservation-affinity", "resource-policies", "scheduling", "self-link", "shielded-instance-config", "shielded-instance-integrity-policy", "start-restricted", "status", "status-message", "tags", "update-auto-learn-policy", "values", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Instance = json::value::from_value(object).unwrap(); + let mut call = self.hub.instances().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + "most-disruptive-allowed-action" => { + call = call.most_disruptive_allowed_action(value.unwrap_or("")); + }, + "minimal-action" => { + call = call.minimal_action(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["most-disruptive-allowed-action", "request-id", "minimal-action"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _instances_update_access_config(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -12705,6 +14724,95 @@ impl<'n> Engine<'n> { } } + fn _instances_update_display_device(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "enable-display" => Some(("enableDisplay", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["enable-display"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DisplayDevice = json::value::from_value(object).unwrap(); + let mut call = self.hub.instances().update_display_device(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _instances_update_network_interface(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -12905,6 +15013,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -12921,7 +15032,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -13127,6 +15238,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "validate-only" => { + call = call.validate_only(arg_from_str(value.unwrap_or("false"), err, "validate-only", "boolean")); + }, "request-id" => { call = call.request_id(value.unwrap_or("")); }, @@ -13143,7 +15257,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["request-id"].iter().map(|v|*v)); + v.extend(["validate-only", "request-id"].iter().map(|v|*v)); v } )); } } @@ -14563,6 +16677,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -14579,7 +16696,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -14745,6 +16862,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -14761,7 +16881,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -15454,13 +17574,15 @@ impl<'n> Engine<'n> { "network-peering.auto-create-routes" => Some(("networkPeering.autoCreateRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "network-peering.state-details" => Some(("networkPeering.stateDetails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network-peering.state" => Some(("networkPeering.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network-peering.export-custom-routes" => Some(("networkPeering.exportCustomRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "network-peering.exchange-subnet-routes" => Some(("networkPeering.exchangeSubnetRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-peering.import-custom-routes" => Some(("networkPeering.importCustomRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "network-peering.name" => Some(("networkPeering.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "peer-network" => Some(("peerNetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auto-create-routes" => Some(("autoCreateRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-create-routes", "exchange-subnet-routes", "name", "network", "network-peering", "peer-network", "state", "state-details"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-create-routes", "exchange-subnet-routes", "export-custom-routes", "import-custom-routes", "name", "network", "network-peering", "peer-network", "state", "state-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -15796,6 +17918,80 @@ impl<'n> Engine<'n> { } } + fn _networks_list_peering_routes(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.networks().list_peering_routes(opt.value_of("project").unwrap_or(""), opt.value_of("network").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "region" => { + call = call.region(value.unwrap_or("")); + }, + "peering-name" => { + call = call.peering_name(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + "direction" => { + call = call.direction(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "direction", "region", "max-results", "filter", "page-token", "peering-name"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _networks_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -16040,6 +18236,102 @@ impl<'n> Engine<'n> { } } + fn _networks_update_peering(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "network-peering.network" => Some(("networkPeering.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network-peering.auto-create-routes" => Some(("networkPeering.autoCreateRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-peering.state-details" => Some(("networkPeering.stateDetails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network-peering.state" => Some(("networkPeering.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network-peering.export-custom-routes" => Some(("networkPeering.exportCustomRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-peering.exchange-subnet-routes" => Some(("networkPeering.exchangeSubnetRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-peering.import-custom-routes" => Some(("networkPeering.importCustomRoutes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network-peering.name" => Some(("networkPeering.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-create-routes", "exchange-subnet-routes", "export-custom-routes", "import-custom-routes", "name", "network", "network-peering", "state", "state-details"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::NetworksUpdatePeeringRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.networks().update_peering(request, opt.value_of("project").unwrap_or(""), opt.value_of("network").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _node_groups_add_nodes(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -16144,6 +18436,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -16160,7 +18455,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -16470,14 +18765,19 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy" => Some(("maintenancePolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-template" => Some(("nodeTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.max-nodes" => Some(("autoscalingPolicy.maxNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.min-nodes" => Some(("autoscalingPolicy.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "size" => Some(("size", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "name", "node-template", "self-link", "size", "status", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "creation-timestamp", "description", "fingerprint", "id", "kind", "maintenance-policy", "max-nodes", "min-nodes", "mode", "name", "node-template", "self-link", "size", "status", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -16672,6 +18972,109 @@ impl<'n> Engine<'n> { } } + fn _node_groups_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy" => Some(("maintenancePolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-template" => Some(("nodeTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.max-nodes" => Some(("autoscalingPolicy.maxNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.min-nodes" => Some(("autoscalingPolicy.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "creation-timestamp", "description", "fingerprint", "id", "kind", "maintenance-policy", "max-nodes", "min-nodes", "mode", "name", "node-template", "self-link", "size", "status", "zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::NodeGroup = json::value::from_value(object).unwrap(); + let mut call = self.hub.node_groups().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("node-group").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _node_groups_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -16949,6 +19352,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -16965,7 +19371,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -17515,6 +19921,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -17531,7 +19940,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -17682,6 +20091,540 @@ impl<'n> Engine<'n> { } } + fn _packet_mirrorings_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.packet_mirrorings().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _packet_mirrorings_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.packet_mirrorings().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("packet-mirroring").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _packet_mirrorings_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.packet_mirrorings().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("packet-mirroring").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _packet_mirrorings_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable" => Some(("enable", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "collector-ilb.url" => Some(("collectorIlb.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "collector-ilb.canonical-url" => Some(("collectorIlb.canonicalUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mirrored-resources.tags" => Some(("mirroredResources.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter.ip-protocols" => Some(("filter.IPProtocols", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "filter.cidr-ranges" => Some(("filter.cidrRanges", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "network.url" => Some(("network.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.canonical-url" => Some(("network.canonicalUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-protocols", "canonical-url", "cidr-ranges", "collector-ilb", "creation-timestamp", "description", "enable", "filter", "id", "kind", "mirrored-resources", "name", "network", "priority", "region", "self-link", "tags", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::PacketMirroring = json::value::from_value(object).unwrap(); + let mut call = self.hub.packet_mirrorings().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _packet_mirrorings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.packet_mirrorings().list(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _packet_mirrorings_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable" => Some(("enable", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "collector-ilb.url" => Some(("collectorIlb.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "collector-ilb.canonical-url" => Some(("collectorIlb.canonicalUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mirrored-resources.tags" => Some(("mirroredResources.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "filter.ip-protocols" => Some(("filter.IPProtocols", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "filter.cidr-ranges" => Some(("filter.cidrRanges", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "network.url" => Some(("network.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "network.canonical-url" => Some(("network.canonicalUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ip-protocols", "canonical-url", "cidr-ranges", "collector-ilb", "creation-timestamp", "description", "enable", "filter", "id", "kind", "mirrored-resources", "name", "network", "priority", "region", "self-link", "tags", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::PacketMirroring = json::value::from_value(object).unwrap(); + let mut call = self.hub.packet_mirrorings().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("packet-mirroring").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _packet_mirrorings_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.packet_mirrorings().test_iam_permissions(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_disable_xpn_host(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().disable_xpn_host(opt.value_of("project").unwrap_or("")); @@ -18109,7 +21052,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["filter", "page-token", "order-by", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); v } )); } } @@ -18207,7 +21150,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["filter", "page-token", "order-by", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); v } )); } } @@ -18822,22 +21765,24 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-size" => Some(("recommendedSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "region", "self-link", "status", "target", "utilization-target", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "mode", "name", "recommended-size", "region", "self-link", "status", "target", "utilization-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -18990,22 +21935,24 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-size" => Some(("recommendedSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "region", "self-link", "status", "target", "utilization-target", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "mode", "name", "recommended-size", "region", "self-link", "status", "target", "utilization-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -19096,22 +22043,24 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "recommended-size" => Some(("recommendedSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling-policy.max-num-replicas" => Some(("autoscalingPolicy.maxNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.cool-down-period-sec" => Some(("autoscalingPolicy.coolDownPeriodSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "autoscaling-policy.load-balancing-utilization.utilization-target" => Some(("autoscalingPolicy.loadBalancingUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.mode" => Some(("autoscalingPolicy.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "autoscaling-policy.cpu-utilization.utilization-target" => Some(("autoscalingPolicy.cpuUtilization.utilizationTarget", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "autoscaling-policy.min-num-replicas" => Some(("autoscalingPolicy.minNumReplicas", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "target" => Some(("target", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "name", "region", "self-link", "status", "target", "utilization-target", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling-policy", "cool-down-period-sec", "cpu-utilization", "creation-timestamp", "description", "id", "kind", "load-balancing-utilization", "max-num-replicas", "min-num-replicas", "mode", "name", "recommended-size", "region", "self-link", "status", "target", "utilization-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -19396,11 +22345,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "connection-draining.draining-timeout-sec" => Some(("connectionDraining.drainingTimeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locality-lb-policy" => Some(("localityLbPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-checks" => Some(("healthChecks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.signed-url-key-names" => Some(("cdnPolicy.signedUrlKeyNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cdn-policy.signed-url-cache-max-age-sec" => Some(("cdnPolicy.signedUrlCacheMaxAgeSec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.query-string-blacklist" => Some(("cdnPolicy.cacheKeyPolicy.queryStringBlacklist", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -19409,8 +22359,32 @@ impl<'n> Engine<'n> { "cdn-policy.cache-key-policy.include-host" => Some(("cdnPolicy.cacheKeyPolicy.includeHost", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.include-protocol" => Some(("cdnPolicy.cacheKeyPolicy.includeProtocol", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "enable-cdn" => Some(("enableCDN", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outlier-detection.interval.nanos" => Some(("outlierDetection.interval.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.interval.seconds" => Some(("outlierDetection.interval.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-errors" => Some(("outlierDetection.enforcingConsecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-request-volume" => Some(("outlierDetection.successRateRequestVolume", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.nanos" => Some(("outlierDetection.baseEjectionTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.seconds" => Some(("outlierDetection.baseEjectionTime.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-gateway-failure" => Some(("outlierDetection.enforcingConsecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-minimum-hosts" => Some(("outlierDetection.successRateMinimumHosts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-errors" => Some(("outlierDetection.consecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-stdev-factor" => Some(("outlierDetection.successRateStdevFactor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.max-ejection-percent" => Some(("outlierDetection.maxEjectionPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-gateway-failure" => Some(("outlierDetection.consecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-success-rate" => Some(("outlierDetection.enforcingSuccessRate", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "affinity-cookie-ttl-sec" => Some(("affinityCookieTtlSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.path" => Some(("consistentHash.httpCookie.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.name" => Some(("consistentHash.httpCookie.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.nanos" => Some(("consistentHash.httpCookie.ttl.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.seconds" => Some(("consistentHash.httpCookie.ttl.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.minimum-ring-size" => Some(("consistentHash.minimumRingSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-header-name" => Some(("consistentHash.httpHeaderName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "circuit-breakers.max-pending-requests" => Some(("circuitBreakers.maxPendingRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-retries" => Some(("circuitBreakers.maxRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests" => Some(("circuitBreakers.maxRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests-per-connection" => Some(("circuitBreakers.maxRequestsPerConnection", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-connections" => Some(("circuitBreakers.maxConnections", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -19420,13 +22394,19 @@ impl<'n> Engine<'n> { "security-policy" => Some(("securityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.sample-rate" => Some(("logConfig.sampleRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "failover-policy.drop-traffic-if-unhealthy" => Some(("failoverPolicy.dropTrafficIfUnhealthy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "failover-policy.failover-ratio" => Some(("failoverPolicy.failoverRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "failover-policy.disable-connection-drain-on-failover" => Some(("failoverPolicy.disableConnectionDrainOnFailover", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "cache-key-policy", "cdn-policy", "connection-draining", "creation-timestamp", "custom-request-headers", "description", "draining-timeout-sec", "enable-cdn", "enabled", "fingerprint", "health-checks", "iap", "id", "include-host", "include-protocol", "include-query-string", "kind", "load-balancing-scheme", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "timeout-sec"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "base-ejection-time", "cache-key-policy", "cdn-policy", "circuit-breakers", "connection-draining", "consecutive-errors", "consecutive-gateway-failure", "consistent-hash", "creation-timestamp", "custom-request-headers", "description", "disable-connection-drain-on-failover", "draining-timeout-sec", "drop-traffic-if-unhealthy", "enable", "enable-cdn", "enabled", "enforcing-consecutive-errors", "enforcing-consecutive-gateway-failure", "enforcing-success-rate", "failover-policy", "failover-ratio", "fingerprint", "health-checks", "http-cookie", "http-header-name", "iap", "id", "include-host", "include-protocol", "include-query-string", "interval", "kind", "load-balancing-scheme", "locality-lb-policy", "log-config", "max-connections", "max-ejection-percent", "max-pending-requests", "max-requests", "max-requests-per-connection", "max-retries", "minimum-ring-size", "name", "nanos", "network", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "outlier-detection", "path", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "sample-rate", "seconds", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "success-rate-minimum-hosts", "success-rate-request-volume", "success-rate-stdev-factor", "timeout-sec", "ttl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -19580,11 +22560,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "connection-draining.draining-timeout-sec" => Some(("connectionDraining.drainingTimeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locality-lb-policy" => Some(("localityLbPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-checks" => Some(("healthChecks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.signed-url-key-names" => Some(("cdnPolicy.signedUrlKeyNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cdn-policy.signed-url-cache-max-age-sec" => Some(("cdnPolicy.signedUrlCacheMaxAgeSec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.query-string-blacklist" => Some(("cdnPolicy.cacheKeyPolicy.queryStringBlacklist", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -19593,8 +22574,32 @@ impl<'n> Engine<'n> { "cdn-policy.cache-key-policy.include-host" => Some(("cdnPolicy.cacheKeyPolicy.includeHost", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.include-protocol" => Some(("cdnPolicy.cacheKeyPolicy.includeProtocol", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "enable-cdn" => Some(("enableCDN", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outlier-detection.interval.nanos" => Some(("outlierDetection.interval.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.interval.seconds" => Some(("outlierDetection.interval.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-errors" => Some(("outlierDetection.enforcingConsecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-request-volume" => Some(("outlierDetection.successRateRequestVolume", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.nanos" => Some(("outlierDetection.baseEjectionTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.seconds" => Some(("outlierDetection.baseEjectionTime.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-gateway-failure" => Some(("outlierDetection.enforcingConsecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-minimum-hosts" => Some(("outlierDetection.successRateMinimumHosts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-errors" => Some(("outlierDetection.consecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-stdev-factor" => Some(("outlierDetection.successRateStdevFactor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.max-ejection-percent" => Some(("outlierDetection.maxEjectionPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-gateway-failure" => Some(("outlierDetection.consecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-success-rate" => Some(("outlierDetection.enforcingSuccessRate", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "affinity-cookie-ttl-sec" => Some(("affinityCookieTtlSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.path" => Some(("consistentHash.httpCookie.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.name" => Some(("consistentHash.httpCookie.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.nanos" => Some(("consistentHash.httpCookie.ttl.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.seconds" => Some(("consistentHash.httpCookie.ttl.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.minimum-ring-size" => Some(("consistentHash.minimumRingSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-header-name" => Some(("consistentHash.httpHeaderName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "circuit-breakers.max-pending-requests" => Some(("circuitBreakers.maxPendingRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-retries" => Some(("circuitBreakers.maxRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests" => Some(("circuitBreakers.maxRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests-per-connection" => Some(("circuitBreakers.maxRequestsPerConnection", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-connections" => Some(("circuitBreakers.maxConnections", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -19604,13 +22609,19 @@ impl<'n> Engine<'n> { "security-policy" => Some(("securityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.sample-rate" => Some(("logConfig.sampleRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "failover-policy.drop-traffic-if-unhealthy" => Some(("failoverPolicy.dropTrafficIfUnhealthy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "failover-policy.failover-ratio" => Some(("failoverPolicy.failoverRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "failover-policy.disable-connection-drain-on-failover" => Some(("failoverPolicy.disableConnectionDrainOnFailover", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "cache-key-policy", "cdn-policy", "connection-draining", "creation-timestamp", "custom-request-headers", "description", "draining-timeout-sec", "enable-cdn", "enabled", "fingerprint", "health-checks", "iap", "id", "include-host", "include-protocol", "include-query-string", "kind", "load-balancing-scheme", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "timeout-sec"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "base-ejection-time", "cache-key-policy", "cdn-policy", "circuit-breakers", "connection-draining", "consecutive-errors", "consecutive-gateway-failure", "consistent-hash", "creation-timestamp", "custom-request-headers", "description", "disable-connection-drain-on-failover", "draining-timeout-sec", "drop-traffic-if-unhealthy", "enable", "enable-cdn", "enabled", "enforcing-consecutive-errors", "enforcing-consecutive-gateway-failure", "enforcing-success-rate", "failover-policy", "failover-ratio", "fingerprint", "health-checks", "http-cookie", "http-header-name", "iap", "id", "include-host", "include-protocol", "include-query-string", "interval", "kind", "load-balancing-scheme", "locality-lb-policy", "log-config", "max-connections", "max-ejection-percent", "max-pending-requests", "max-requests", "max-requests-per-connection", "max-retries", "minimum-ring-size", "name", "nanos", "network", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "outlier-detection", "path", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "sample-rate", "seconds", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "success-rate-minimum-hosts", "success-rate-request-volume", "success-rate-stdev-factor", "timeout-sec", "ttl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -19699,11 +22710,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "connection-draining.draining-timeout-sec" => Some(("connectionDraining.drainingTimeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "protocol" => Some(("protocol", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locality-lb-policy" => Some(("localityLbPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "load-balancing-scheme" => Some(("loadBalancingScheme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-checks" => Some(("healthChecks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.signed-url-key-names" => Some(("cdnPolicy.signedUrlKeyNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cdn-policy.signed-url-cache-max-age-sec" => Some(("cdnPolicy.signedUrlCacheMaxAgeSec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.query-string-blacklist" => Some(("cdnPolicy.cacheKeyPolicy.queryStringBlacklist", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -19712,8 +22724,32 @@ impl<'n> Engine<'n> { "cdn-policy.cache-key-policy.include-host" => Some(("cdnPolicy.cacheKeyPolicy.includeHost", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cdn-policy.cache-key-policy.include-protocol" => Some(("cdnPolicy.cacheKeyPolicy.includeProtocol", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "enable-cdn" => Some(("enableCDN", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "outlier-detection.interval.nanos" => Some(("outlierDetection.interval.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.interval.seconds" => Some(("outlierDetection.interval.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-errors" => Some(("outlierDetection.enforcingConsecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-request-volume" => Some(("outlierDetection.successRateRequestVolume", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.nanos" => Some(("outlierDetection.baseEjectionTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.base-ejection-time.seconds" => Some(("outlierDetection.baseEjectionTime.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-consecutive-gateway-failure" => Some(("outlierDetection.enforcingConsecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-minimum-hosts" => Some(("outlierDetection.successRateMinimumHosts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-errors" => Some(("outlierDetection.consecutiveErrors", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.success-rate-stdev-factor" => Some(("outlierDetection.successRateStdevFactor", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.max-ejection-percent" => Some(("outlierDetection.maxEjectionPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.consecutive-gateway-failure" => Some(("outlierDetection.consecutiveGatewayFailure", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "outlier-detection.enforcing-success-rate" => Some(("outlierDetection.enforcingSuccessRate", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "affinity-cookie-ttl-sec" => Some(("affinityCookieTtlSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "session-affinity" => Some(("sessionAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.path" => Some(("consistentHash.httpCookie.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.name" => Some(("consistentHash.httpCookie.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.nanos" => Some(("consistentHash.httpCookie.ttl.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "consistent-hash.http-cookie.ttl.seconds" => Some(("consistentHash.httpCookie.ttl.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.minimum-ring-size" => Some(("consistentHash.minimumRingSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "consistent-hash.http-header-name" => Some(("consistentHash.httpHeaderName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "circuit-breakers.max-pending-requests" => Some(("circuitBreakers.maxPendingRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-retries" => Some(("circuitBreakers.maxRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests" => Some(("circuitBreakers.maxRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-requests-per-connection" => Some(("circuitBreakers.maxRequestsPerConnection", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "circuit-breakers.max-connections" => Some(("circuitBreakers.maxConnections", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "port" => Some(("port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -19723,13 +22759,19 @@ impl<'n> Engine<'n> { "security-policy" => Some(("securityPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "port-name" => Some(("portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.sample-rate" => Some(("logConfig.sampleRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "failover-policy.drop-traffic-if-unhealthy" => Some(("failoverPolicy.dropTrafficIfUnhealthy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "failover-policy.failover-ratio" => Some(("failoverPolicy.failoverRatio", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "failover-policy.disable-connection-drain-on-failover" => Some(("failoverPolicy.disableConnectionDrainOnFailover", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "cache-key-policy", "cdn-policy", "connection-draining", "creation-timestamp", "custom-request-headers", "description", "draining-timeout-sec", "enable-cdn", "enabled", "fingerprint", "health-checks", "iap", "id", "include-host", "include-protocol", "include-query-string", "kind", "load-balancing-scheme", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "timeout-sec"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["affinity-cookie-ttl-sec", "base-ejection-time", "cache-key-policy", "cdn-policy", "circuit-breakers", "connection-draining", "consecutive-errors", "consecutive-gateway-failure", "consistent-hash", "creation-timestamp", "custom-request-headers", "description", "disable-connection-drain-on-failover", "draining-timeout-sec", "drop-traffic-if-unhealthy", "enable", "enable-cdn", "enabled", "enforcing-consecutive-errors", "enforcing-consecutive-gateway-failure", "enforcing-success-rate", "failover-policy", "failover-ratio", "fingerprint", "health-checks", "http-cookie", "http-header-name", "iap", "id", "include-host", "include-protocol", "include-query-string", "interval", "kind", "load-balancing-scheme", "locality-lb-policy", "log-config", "max-connections", "max-ejection-percent", "max-pending-requests", "max-requests", "max-requests-per-connection", "max-retries", "minimum-ring-size", "name", "nanos", "network", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "outlier-detection", "path", "port", "port-name", "protocol", "query-string-blacklist", "query-string-whitelist", "region", "sample-rate", "seconds", "security-policy", "self-link", "session-affinity", "signed-url-cache-max-age-sec", "signed-url-key-names", "success-rate-minimum-hosts", "success-rate-request-volume", "success-rate-stdev-factor", "timeout-sec", "ttl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -19808,6 +22850,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -19824,7 +22869,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -20308,12 +23353,14 @@ impl<'n> Engine<'n> { "auto-created" => Some(("autoCreated", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.raw-key" => Some(("sourceDiskEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-disk-encryption-key.kms-key-service-account" => Some(("sourceDiskEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.sha256" => Some(("sourceDiskEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk-encryption-key.kms-key-name" => Some(("sourceDiskEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "storage-bytes" => Some(("storageBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snapshot-encryption-key.raw-key" => Some(("snapshotEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snapshot-encryption-key.kms-key-service-account" => Some(("snapshotEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snapshot-encryption-key.sha256" => Some(("snapshotEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snapshot-encryption-key.kms-key-name" => Some(("snapshotEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "storage-locations" => Some(("storageLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -20322,6 +23369,7 @@ impl<'n> Engine<'n> { "source-disk-id" => Some(("sourceDiskId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-size-gb" => Some(("diskSizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-disk" => Some(("sourceDisk", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "download-bytes" => Some(("downloadBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "licenses" => Some(("licenses", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "storage-bytes-status" => Some(("storageBytesStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -20329,7 +23377,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "license-codes" => Some(("licenseCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-created", "creation-timestamp", "description", "disk-size-gb", "id", "kind", "kms-key-name", "label-fingerprint", "labels", "license-codes", "licenses", "name", "raw-key", "self-link", "sha256", "snapshot-encryption-key", "source-disk", "source-disk-encryption-key", "source-disk-id", "status", "storage-bytes", "storage-bytes-status", "storage-locations"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-created", "creation-timestamp", "description", "disk-size-gb", "download-bytes", "id", "kind", "kms-key-name", "kms-key-service-account", "label-fingerprint", "labels", "license-codes", "licenses", "name", "raw-key", "self-link", "sha256", "snapshot-encryption-key", "source-disk", "source-disk-encryption-key", "source-disk-id", "status", "storage-bytes", "storage-bytes-status", "storage-locations"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -20525,6 +23573,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "source-image-encryption-key.raw-key" => Some(("sourceImageEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-image-encryption-key.kms-key-service-account" => Some(("sourceImageEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image-encryption-key.sha256" => Some(("sourceImageEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image-encryption-key.kms-key-name" => Some(("sourceImageEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -20533,6 +23582,7 @@ impl<'n> Engine<'n> { "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "license-codes" => Some(("licenseCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "disk-encryption-key.raw-key" => Some(("diskEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-encryption-key.kms-key-service-account" => Some(("diskEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-key.sha256" => Some(("diskEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-key.kms-key-name" => Some(("diskEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -20554,13 +23604,14 @@ impl<'n> Engine<'n> { "size-gb" => Some(("sizeGb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.raw-key" => Some(("sourceSnapshotEncryptionKey.rawKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "source-snapshot-encryption-key.kms-key-service-account" => Some(("sourceSnapshotEncryptionKey.kmsKeyServiceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.sha256" => Some(("sourceSnapshotEncryptionKey.sha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-snapshot-encryption-key.kms-key-name" => Some(("sourceSnapshotEncryptionKey.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "options" => Some(("options", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-image" => Some(("sourceImage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "disk-encryption-key", "id", "kind", "kms-key-name", "label-fingerprint", "labels", "last-attach-timestamp", "last-detach-timestamp", "license-codes", "licenses", "name", "options", "physical-block-size-bytes", "raw-key", "region", "replica-zones", "resource-policies", "self-link", "sha256", "size-gb", "source-image", "source-image-encryption-key", "source-image-id", "source-snapshot", "source-snapshot-encryption-key", "source-snapshot-id", "status", "type", "users", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "disk-encryption-key", "id", "kind", "kms-key-name", "kms-key-service-account", "label-fingerprint", "labels", "last-attach-timestamp", "last-detach-timestamp", "license-codes", "licenses", "name", "options", "physical-block-size-bytes", "raw-key", "region", "replica-zones", "resource-policies", "self-link", "sha256", "size-gb", "source-image", "source-image-encryption-key", "source-image-id", "source-snapshot", "source-snapshot-encryption-key", "source-snapshot-id", "status", "type", "users", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -21045,6 +24096,578 @@ impl<'n> Engine<'n> { } } + fn _region_health_checks_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_health_checks().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("health-check").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_health_checks_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_health_checks().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("health-check").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_health_checks_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-interval-sec" => Some(("checkIntervalSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "http-health-check.request-path" => Some(("httpHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.proxy-header" => Some(("httpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port-specification" => Some(("httpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.response" => Some(("httpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.host" => Some(("httpHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port-name" => Some(("httpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port" => Some(("httpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "healthy-threshold" => Some(("healthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-health-check.proxy-header" => Some(("sslHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.request" => Some(("sslHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.port-specification" => Some(("sslHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.port" => Some(("sslHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-health-check.port-name" => Some(("sslHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.response" => Some(("sslHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.request-path" => Some(("http2HealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.proxy-header" => Some(("http2HealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port-specification" => Some(("http2HealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.response" => Some(("http2HealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.host" => Some(("http2HealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port-name" => Some(("http2HealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port" => Some(("http2HealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "region", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::HealthCheck = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_health_checks().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_health_checks_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_health_checks().list(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_health_checks_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-interval-sec" => Some(("checkIntervalSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "http-health-check.request-path" => Some(("httpHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.proxy-header" => Some(("httpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port-specification" => Some(("httpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.response" => Some(("httpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.host" => Some(("httpHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port-name" => Some(("httpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port" => Some(("httpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "healthy-threshold" => Some(("healthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-health-check.proxy-header" => Some(("sslHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.request" => Some(("sslHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.port-specification" => Some(("sslHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.port" => Some(("sslHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-health-check.port-name" => Some(("sslHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.response" => Some(("sslHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.request-path" => Some(("http2HealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.proxy-header" => Some(("http2HealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port-specification" => Some(("http2HealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.response" => Some(("http2HealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.host" => Some(("http2HealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port-name" => Some(("http2HealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port" => Some(("http2HealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "region", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::HealthCheck = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_health_checks().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("health-check").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_health_checks_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "timeout-sec" => Some(("timeoutSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "check-interval-sec" => Some(("checkIntervalSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "http-health-check.request-path" => Some(("httpHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.proxy-header" => Some(("httpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port-specification" => Some(("httpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.response" => Some(("httpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.host" => Some(("httpHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port-name" => Some(("httpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-health-check.port" => Some(("httpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "unhealthy-threshold" => Some(("unhealthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "healthy-threshold" => Some(("healthyThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-health-check.proxy-header" => Some(("sslHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.request" => Some(("sslHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.port-specification" => Some(("sslHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.port" => Some(("sslHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "ssl-health-check.port-name" => Some(("sslHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-health-check.response" => Some(("sslHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.request-path" => Some(("http2HealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.proxy-header" => Some(("http2HealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port-specification" => Some(("http2HealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.response" => Some(("http2HealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.host" => Some(("http2HealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port-name" => Some(("http2HealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http2-health-check.port" => Some(("http2HealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.proxy-header" => Some(("tcpHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.request" => Some(("tcpHealthCheck.request", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port-specification" => Some(("tcpHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.port" => Some(("tcpHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "tcp-health-check.port-name" => Some(("tcpHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tcp-health-check.response" => Some(("tcpHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.request-path" => Some(("httpsHealthCheck.requestPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.proxy-header" => Some(("httpsHealthCheck.proxyHeader", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-specification" => Some(("httpsHealthCheck.portSpecification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.response" => Some(("httpsHealthCheck.response", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.host" => Some(("httpsHealthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port-name" => Some(("httpsHealthCheck.portName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "https-health-check.port" => Some(("httpsHealthCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["check-interval-sec", "creation-timestamp", "description", "healthy-threshold", "host", "http2-health-check", "http-health-check", "https-health-check", "id", "kind", "name", "port", "port-name", "port-specification", "proxy-header", "region", "request", "request-path", "response", "self-link", "ssl-health-check", "tcp-health-check", "timeout-sec", "type", "unhealthy-threshold"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::HealthCheck = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_health_checks().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("health-check").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _region_instance_group_managers_abandon_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -21134,6 +24757,181 @@ impl<'n> Engine<'n> { } } + fn _region_instance_group_managers_apply_updates_to_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "instances" => Some(("instances", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "most-disruptive-allowed-action" => Some(("mostDisruptiveAllowedAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "minimal-action" => Some(("minimalAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["instances", "minimal-action", "most-disruptive-allowed-action"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RegionInstanceGroupManagersApplyUpdatesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_instance_group_managers().apply_updates_to_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_instance_group_managers_create_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RegionInstanceGroupManagersCreateInstancesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_instance_group_managers().create_instances(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _region_instance_group_managers_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.region_instance_group_managers().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); @@ -21355,6 +25153,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.is-stable" => Some(("status.isStable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.version-target.is-reached" => Some(("status.versionTarget.isReached", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.autoscaler" => Some(("status.autoscaler", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "current-actions.none" => Some(("currentActions.none", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.recreating" => Some(("currentActions.recreating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.creating" => Some(("currentActions.creating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -21372,14 +25172,16 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "target-pools" => Some(("targetPools", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "instance-template" => Some(("instanceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.replacement-method" => Some(("updatePolicy.replacementMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-surge.calculated" => Some(("updatePolicy.maxSurge.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.fixed" => Some(("updatePolicy.maxSurge.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.percent" => Some(("updatePolicy.maxSurge.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.minimal-action" => Some(("updatePolicy.minimalAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.instance-redistribution-type" => Some(("updatePolicy.instanceRedistributionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-unavailable.calculated" => Some(("updatePolicy.maxUnavailable.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.fixed" => Some(("updatePolicy.maxUnavailable.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.percent" => Some(("updatePolicy.maxUnavailable.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "base-instance-name" => Some(("baseInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -21387,7 +25189,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-template", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "autoscaler", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-redistribution-type", "instance-template", "is-reached", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "replacement-method", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "version-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -21516,6 +25318,71 @@ impl<'n> Engine<'n> { } } + fn _region_instance_group_managers_list_errors(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_instance_group_managers().list_errors(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _region_instance_group_managers_list_managed_instances(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.region_instance_group_managers().list_managed_instances(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("instance-group-manager").unwrap_or("")); @@ -21547,7 +25414,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["filter", "page-token", "order-by", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); v } )); } } @@ -21605,6 +25472,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.is-stable" => Some(("status.isStable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.version-target.is-reached" => Some(("status.versionTarget.isReached", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.autoscaler" => Some(("status.autoscaler", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "current-actions.none" => Some(("currentActions.none", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.recreating" => Some(("currentActions.recreating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "current-actions.creating" => Some(("currentActions.creating", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -21622,14 +25491,16 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "target-pools" => Some(("targetPools", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "instance-template" => Some(("instanceTemplate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.replacement-method" => Some(("updatePolicy.replacementMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-surge.calculated" => Some(("updatePolicy.maxSurge.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.fixed" => Some(("updatePolicy.maxSurge.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-surge.percent" => Some(("updatePolicy.maxSurge.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.minimal-action" => Some(("updatePolicy.minimalAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-policy.instance-redistribution-type" => Some(("updatePolicy.instanceRedistributionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-policy.max-unavailable.calculated" => Some(("updatePolicy.maxUnavailable.calculated", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.fixed" => Some(("updatePolicy.maxUnavailable.fixed", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-policy.max-unavailable.percent" => Some(("updatePolicy.maxUnavailable.percent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-policy.type" => Some(("updatePolicy.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "base-instance-name" => Some(("baseInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -21637,7 +25508,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-template", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abandoning", "autoscaler", "base-instance-name", "calculated", "creating", "creating-without-retries", "creation-timestamp", "current-actions", "deleting", "description", "fingerprint", "fixed", "id", "instance-group", "instance-redistribution-type", "instance-template", "is-reached", "is-stable", "kind", "max-surge", "max-unavailable", "minimal-action", "name", "none", "percent", "recreating", "refreshing", "region", "replacement-method", "restarting", "self-link", "status", "target-pools", "target-size", "type", "update-policy", "verifying", "version-target", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -22492,6 +26363,1813 @@ impl<'n> Engine<'n> { } } + fn _region_operations_wait(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_operations().wait(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("operation").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_ssl_certificates_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_ssl_certificates().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("ssl-certificate").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_ssl_certificates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_ssl_certificates().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("ssl-certificate").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_ssl_certificates_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "certificate" => Some(("certificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "private-key" => Some(("privateKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["certificate", "creation-timestamp", "description", "id", "kind", "name", "private-key", "region", "self-link"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SslCertificate = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_ssl_certificates().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_ssl_certificates_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_ssl_certificates().list(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_http_proxies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_target_http_proxies().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("target-http-proxy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_http_proxies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_target_http_proxies().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("target-http-proxy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_http_proxies_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url-map" => Some(("urlMap", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "name", "region", "self-link", "url-map"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TargetHttpProxy = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_target_http_proxies().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_http_proxies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_target_http_proxies().list(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_http_proxies_set_url_map(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "url-map" => Some(("urlMap", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["url-map"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UrlMapReference = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_target_http_proxies().set_url_map(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("target-http-proxy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_https_proxies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_target_https_proxies().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("target-https-proxy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_https_proxies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_target_https_proxies().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("target-https-proxy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_https_proxies_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ssl-certificates" => Some(("sslCertificates", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ssl-policy" => Some(("sslPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "url-map" => Some(("urlMap", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "quic-override" => Some(("quicOverride", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "name", "quic-override", "region", "self-link", "ssl-certificates", "ssl-policy", "url-map"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TargetHttpsProxy = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_target_https_proxies().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_https_proxies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_target_https_proxies().list(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_https_proxies_set_ssl_certificates(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "ssl-certificates" => Some(("sslCertificates", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ssl-certificates"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RegionTargetHttpsProxiesSetSslCertificatesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_target_https_proxies().set_ssl_certificates(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("target-https-proxy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_target_https_proxies_set_url_map(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "url-map" => Some(("urlMap", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["url-map"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UrlMapReference = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_target_https_proxies().set_url_map(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("target-https-proxy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_url_maps_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_url_maps().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("url-map").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_url_maps_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_url_maps().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("url-map").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_url_maps_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.request-mirror-policy.backend-service" => Some(("defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.nanos" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.seconds" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.retry-conditions" => Some(("defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.retry-policy.num-retries" => Some(("defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.http-status" => Some(("defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-methods" => Some(("defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origins" => Some(("defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origin-regexes" => Some(("defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.max-age" => Some(("defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-credentials" => Some(("defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.disabled" => Some(("defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-headers" => Some(("defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.expose-headers" => Some(("defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.timeout.nanos" => Some(("defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.timeout.seconds" => Some(("defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.host-rewrite" => Some(("defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.path-prefix-rewrite" => Some(("defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-service" => Some(("defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "header-action.request-headers-to-remove" => Some(("headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "header-action.response-headers-to-remove" => Some(("headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.path-redirect" => Some(("defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.strip-query" => Some(("defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.redirect-response-code" => Some(("defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.https-redirect" => Some(("defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.prefix-redirect" => Some(("defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.host-redirect" => Some(("defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UrlMap = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_url_maps().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_url_maps_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.region_url_maps().list(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_url_maps_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.request-mirror-policy.backend-service" => Some(("defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.nanos" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.seconds" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.retry-conditions" => Some(("defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.retry-policy.num-retries" => Some(("defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.http-status" => Some(("defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-methods" => Some(("defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origins" => Some(("defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origin-regexes" => Some(("defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.max-age" => Some(("defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-credentials" => Some(("defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.disabled" => Some(("defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-headers" => Some(("defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.expose-headers" => Some(("defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.timeout.nanos" => Some(("defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.timeout.seconds" => Some(("defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.host-rewrite" => Some(("defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.path-prefix-rewrite" => Some(("defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-service" => Some(("defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "header-action.request-headers-to-remove" => Some(("headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "header-action.response-headers-to-remove" => Some(("headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.path-redirect" => Some(("defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.strip-query" => Some(("defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.redirect-response-code" => Some(("defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.https-redirect" => Some(("defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.prefix-redirect" => Some(("defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.host-redirect" => Some(("defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UrlMap = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_url_maps().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("url-map").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_url_maps_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.request-mirror-policy.backend-service" => Some(("defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.nanos" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.seconds" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.retry-conditions" => Some(("defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.retry-policy.num-retries" => Some(("defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.http-status" => Some(("defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-methods" => Some(("defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origins" => Some(("defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origin-regexes" => Some(("defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.max-age" => Some(("defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-credentials" => Some(("defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.disabled" => Some(("defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-headers" => Some(("defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.expose-headers" => Some(("defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.timeout.nanos" => Some(("defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.timeout.seconds" => Some(("defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.host-rewrite" => Some(("defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.path-prefix-rewrite" => Some(("defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-service" => Some(("defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "header-action.request-headers-to-remove" => Some(("headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "header-action.response-headers-to-remove" => Some(("headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.path-redirect" => Some(("defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.strip-query" => Some(("defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.redirect-response-code" => Some(("defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.https-redirect" => Some(("defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.prefix-redirect" => Some(("defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.host-redirect" => Some(("defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UrlMap = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_url_maps().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("url-map").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _region_url_maps_validate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "resource.kind" => Some(("resource.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.description" => Some(("resource.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.request-mirror-policy.backend-service" => Some(("resource.defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.retry-policy.per-try-timeout.nanos" => Some(("resource.defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.retry-policy.per-try-timeout.seconds" => Some(("resource.defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.retry-policy.retry-conditions" => Some(("resource.defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.retry-policy.num-retries" => Some(("resource.defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.delay.percentage" => Some(("resource.defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("resource.defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("resource.defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.abort.percentage" => Some(("resource.defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.abort.http-status" => Some(("resource.defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.allow-methods" => Some(("resource.defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.allow-origins" => Some(("resource.defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.allow-origin-regexes" => Some(("resource.defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.max-age" => Some(("resource.defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.allow-credentials" => Some(("resource.defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.disabled" => Some(("resource.defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.allow-headers" => Some(("resource.defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.expose-headers" => Some(("resource.defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.timeout.nanos" => Some(("resource.defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.timeout.seconds" => Some(("resource.defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.url-rewrite.host-rewrite" => Some(("resource.defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.url-rewrite.path-prefix-rewrite" => Some(("resource.defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.creation-timestamp" => Some(("resource.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-service" => Some(("resource.defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.fingerprint" => Some(("resource.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.header-action.request-headers-to-remove" => Some(("resource.headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.header-action.response-headers-to-remove" => Some(("resource.headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.region" => Some(("resource.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.path-redirect" => Some(("resource.defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.strip-query" => Some(("resource.defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-url-redirect.redirect-response-code" => Some(("resource.defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.https-redirect" => Some(("resource.defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-url-redirect.prefix-redirect" => Some(("resource.defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.host-redirect" => Some(("resource.defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.id" => Some(("resource.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.self-link" => Some(("resource.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.name" => Some(("resource.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "resource", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RegionUrlMapsValidateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.region_url_maps().validate(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("url-map").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _regions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.regions().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); @@ -22624,6 +28302,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -22640,7 +28321,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -23278,6 +28959,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -23294,7 +28978,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -23511,6 +29195,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "group-placement-policy.collocation" => Some(("groupPlacementPolicy.collocation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "group-placement-policy.vm-count" => Some(("groupPlacementPolicy.vmCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "group-placement-policy.availability-domain-count" => Some(("groupPlacementPolicy.availabilityDomainCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -23531,7 +29218,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "daily-schedule", "days-in-cycle", "description", "duration", "guest-flush", "hourly-schedule", "hours-in-cycle", "id", "kind", "labels", "max-retention-days", "name", "on-source-disk-delete", "region", "retention-policy", "schedule", "self-link", "snapshot-properties", "snapshot-schedule-policy", "start-time", "status", "storage-locations"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["availability-domain-count", "collocation", "creation-timestamp", "daily-schedule", "days-in-cycle", "description", "duration", "group-placement-policy", "guest-flush", "hourly-schedule", "hours-in-cycle", "id", "kind", "labels", "max-retention-days", "name", "on-source-disk-delete", "region", "retention-policy", "schedule", "self-link", "snapshot-properties", "snapshot-schedule-policy", "start-time", "status", "storage-locations", "vm-count"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -23848,6 +29535,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -23864,7 +29554,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -24716,6 +30406,7 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tags" => Some(("tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "next-hop-ilb" => Some(("nextHopIlb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "next-hop-instance" => Some(("nextHopInstance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "next-hop-peering" => Some(("nextHopPeering", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -24728,7 +30419,7 @@ impl<'n> Engine<'n> { "next-hop-ip" => Some(("nextHopIp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "dest-range", "id", "kind", "name", "network", "next-hop-gateway", "next-hop-instance", "next-hop-ip", "next-hop-network", "next-hop-peering", "next-hop-vpn-tunnel", "priority", "self-link", "tags"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "dest-range", "id", "kind", "name", "network", "next-hop-gateway", "next-hop-ilb", "next-hop-instance", "next-hop-ip", "next-hop-network", "next-hop-peering", "next-hop-vpn-tunnel", "priority", "self-link", "tags"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -24885,10 +30576,14 @@ impl<'n> Engine<'n> { "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "preview" => Some(("preview", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "match.expr.title" => Some(("match.expr.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "match.expr.expression" => Some(("match.expr.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "match.expr.description" => Some(("match.expr.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "match.expr.location" => Some(("match.expr.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "match.config.src-ip-ranges" => Some(("match.config.srcIpRanges", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "match.versioned-expr" => Some(("match.versionedExpr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "config", "description", "kind", "match", "preview", "priority", "src-ip-ranges", "versioned-expr"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "config", "description", "expr", "expression", "kind", "location", "match", "preview", "priority", "src-ip-ranges", "title", "versioned-expr"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -25272,6 +30967,71 @@ impl<'n> Engine<'n> { } } + fn _security_policies_list_preconfigured_expression_sets(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.security_policies().list_preconfigured_expression_sets(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _security_policies_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -25395,10 +31155,14 @@ impl<'n> Engine<'n> { "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "preview" => Some(("preview", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "match.expr.title" => Some(("match.expr.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "match.expr.expression" => Some(("match.expr.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "match.expr.description" => Some(("match.expr.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "match.expr.location" => Some(("match.expr.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "match.config.src-ip-ranges" => Some(("match.config.srcIpRanges", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "match.versioned-expr" => Some(("match.versionedExpr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "config", "description", "kind", "match", "preview", "priority", "src-ip-ranges", "versioned-expr"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "config", "description", "expr", "expression", "kind", "location", "match", "preview", "priority", "src-ip-ranges", "title", "versioned-expr"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -26002,6 +31766,74 @@ impl<'n> Engine<'n> { } } + fn _ssl_certificates_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.ssl_certificates().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _ssl_certificates_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.ssl_certificates().delete(opt.value_of("project").unwrap_or(""), opt.value_of("ssl-certificate").unwrap_or("")); @@ -26136,13 +31968,14 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "certificate" => Some(("certificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "private-key" => Some(("privateKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["certificate", "creation-timestamp", "description", "id", "kind", "name", "private-key", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["certificate", "creation-timestamp", "description", "id", "kind", "name", "private-key", "region", "self-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -26722,6 +32555,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -26738,7 +32574,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -27046,19 +32882,28 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gateway-address" => Some(("gatewayAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "log-config.flow-sampling" => Some(("logConfig.flowSampling", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.metadata-fields" => Some(("logConfig.metadataFields", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "log-config.filter-expr" => Some(("logConfig.filterExpr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.aggregation-interval" => Some(("logConfig.aggregationInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.metadata" => Some(("logConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purpose" => Some(("purpose", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-flow-logs" => Some(("enableFlowLogs", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "private-ip-google-access" => Some(("privateIpGoogleAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ip-cidr-range" => Some(("ipCidrRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "gateway-address" => Some(("gatewayAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "enable-flow-logs", "fingerprint", "gateway-address", "id", "ip-cidr-range", "kind", "name", "network", "private-ip-google-access", "region", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-interval", "creation-timestamp", "description", "enable", "enable-flow-logs", "filter-expr", "fingerprint", "flow-sampling", "gateway-address", "id", "ip-cidr-range", "kind", "log-config", "metadata", "metadata-fields", "name", "network", "private-ip-google-access", "purpose", "region", "role", "self-link", "state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -27277,19 +33122,28 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gateway-address" => Some(("gatewayAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.enable" => Some(("logConfig.enable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "log-config.flow-sampling" => Some(("logConfig.flowSampling", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "log-config.metadata-fields" => Some(("logConfig.metadataFields", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "log-config.filter-expr" => Some(("logConfig.filterExpr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.aggregation-interval" => Some(("logConfig.aggregationInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "log-config.metadata" => Some(("logConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purpose" => Some(("purpose", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-flow-logs" => Some(("enableFlowLogs", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "private-ip-google-access" => Some(("privateIpGoogleAccess", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ip-cidr-range" => Some(("ipCidrRange", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "gateway-address" => Some(("gatewayAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "enable-flow-logs", "fingerprint", "gateway-address", "id", "ip-cidr-range", "kind", "name", "network", "private-ip-google-access", "region", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-interval", "creation-timestamp", "description", "enable", "enable-flow-logs", "filter-expr", "fingerprint", "flow-sampling", "gateway-address", "id", "ip-cidr-range", "kind", "log-config", "metadata", "metadata-fields", "name", "network", "private-ip-google-access", "purpose", "region", "role", "self-link", "state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -27306,6 +33160,9 @@ impl<'n> Engine<'n> { "request-id" => { call = call.request_id(value.unwrap_or("")); }, + "drain-timeout-seconds" => { + call = call.drain_timeout_seconds(arg_from_str(value.unwrap_or("-0"), err, "drain-timeout-seconds", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -27319,7 +33176,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["request-id"].iter().map(|v|*v)); + v.extend(["request-id", "drain-timeout-seconds"].iter().map(|v|*v)); v } )); } } @@ -27615,6 +33472,74 @@ impl<'n> Engine<'n> { } } + fn _target_http_proxies_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.target_http_proxies().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _target_http_proxies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.target_http_proxies().delete(opt.value_of("project").unwrap_or(""), opt.value_of("target-http-proxy").unwrap_or("")); @@ -27748,13 +33673,14 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "url-map" => Some(("urlMap", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "name", "self-link", "url-map"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "name", "region", "self-link", "url-map"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -27972,6 +33898,74 @@ impl<'n> Engine<'n> { } } + fn _target_https_proxies_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.target_https_proxies().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _target_https_proxies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.target_https_proxies().delete(opt.value_of("project").unwrap_or(""), opt.value_of("target-https-proxy").unwrap_or("")); @@ -28105,6 +34099,7 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ssl-certificates" => Some(("sslCertificates", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "ssl-policy" => Some(("sslPolicy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -28114,7 +34109,7 @@ impl<'n> Engine<'n> { "quic-override" => Some(("quicOverride", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "name", "quic-override", "self-link", "ssl-certificates", "ssl-policy", "url-map"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "name", "quic-override", "region", "self-link", "ssl-certificates", "ssl-policy", "url-map"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -28614,6 +34609,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -28630,7 +34628,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -29125,6 +35123,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -29141,7 +35142,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -30890,6 +36891,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -30906,7 +36910,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -31212,6 +37216,74 @@ impl<'n> Engine<'n> { } } + fn _url_maps_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.url_maps().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _url_maps_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.url_maps().delete(opt.value_of("project").unwrap_or(""), opt.value_of("url-map").unwrap_or("")); @@ -31345,14 +37417,45 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.request-mirror-policy.backend-service" => Some(("defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.nanos" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.seconds" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.retry-conditions" => Some(("defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.retry-policy.num-retries" => Some(("defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.http-status" => Some(("defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-methods" => Some(("defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origins" => Some(("defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origin-regexes" => Some(("defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.max-age" => Some(("defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-credentials" => Some(("defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.disabled" => Some(("defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-headers" => Some(("defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.expose-headers" => Some(("defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.timeout.nanos" => Some(("defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.timeout.seconds" => Some(("defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.host-rewrite" => Some(("defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.path-prefix-rewrite" => Some(("defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-service" => Some(("defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "header-action.request-headers-to-remove" => Some(("headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "header-action.response-headers-to-remove" => Some(("headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.path-redirect" => Some(("defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.strip-query" => Some(("defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.redirect-response-code" => Some(("defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.https-redirect" => Some(("defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.prefix-redirect" => Some(("defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.host-redirect" => Some(("defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "default-service", "description", "fingerprint", "id", "kind", "name", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -31596,14 +37699,45 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.request-mirror-policy.backend-service" => Some(("defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.nanos" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.seconds" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.retry-conditions" => Some(("defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.retry-policy.num-retries" => Some(("defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.http-status" => Some(("defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-methods" => Some(("defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origins" => Some(("defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origin-regexes" => Some(("defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.max-age" => Some(("defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-credentials" => Some(("defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.disabled" => Some(("defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-headers" => Some(("defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.expose-headers" => Some(("defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.timeout.nanos" => Some(("defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.timeout.seconds" => Some(("defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.host-rewrite" => Some(("defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.path-prefix-rewrite" => Some(("defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-service" => Some(("defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "header-action.request-headers-to-remove" => Some(("headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "header-action.response-headers-to-remove" => Some(("headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.path-redirect" => Some(("defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.strip-query" => Some(("defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.redirect-response-code" => Some(("defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.https-redirect" => Some(("defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.prefix-redirect" => Some(("defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.host-redirect" => Some(("defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "default-service", "description", "fingerprint", "id", "kind", "name", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -31692,14 +37826,45 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.request-mirror-policy.backend-service" => Some(("defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.nanos" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.per-try-timeout.seconds" => Some(("defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.retry-policy.retry-conditions" => Some(("defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.retry-policy.num-retries" => Some(("defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.percentage" => Some(("defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-route-action.fault-injection-policy.abort.http-status" => Some(("defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-methods" => Some(("defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origins" => Some(("defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.allow-origin-regexes" => Some(("defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.max-age" => Some(("defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-credentials" => Some(("defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.disabled" => Some(("defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-route-action.cors-policy.allow-headers" => Some(("defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.cors-policy.expose-headers" => Some(("defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-route-action.timeout.nanos" => Some(("defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-route-action.timeout.seconds" => Some(("defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.host-rewrite" => Some(("defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-route-action.url-rewrite.path-prefix-rewrite" => Some(("defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-service" => Some(("defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "header-action.request-headers-to-remove" => Some(("headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "header-action.response-headers-to-remove" => Some(("headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.path-redirect" => Some(("defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.strip-query" => Some(("defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.redirect-response-code" => Some(("defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.https-redirect" => Some(("defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "default-url-redirect.prefix-redirect" => Some(("defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-url-redirect.host-redirect" => Some(("defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "default-service", "description", "fingerprint", "id", "kind", "name", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -31788,14 +37953,45 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "resource.kind" => Some(("resource.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource.description" => Some(("resource.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.request-mirror-policy.backend-service" => Some(("resource.defaultRouteAction.requestMirrorPolicy.backendService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.retry-policy.per-try-timeout.nanos" => Some(("resource.defaultRouteAction.retryPolicy.perTryTimeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.retry-policy.per-try-timeout.seconds" => Some(("resource.defaultRouteAction.retryPolicy.perTryTimeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.retry-policy.retry-conditions" => Some(("resource.defaultRouteAction.retryPolicy.retryConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.retry-policy.num-retries" => Some(("resource.defaultRouteAction.retryPolicy.numRetries", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.delay.percentage" => Some(("resource.defaultRouteAction.faultInjectionPolicy.delay.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.delay.fixed-delay.nanos" => Some(("resource.defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.delay.fixed-delay.seconds" => Some(("resource.defaultRouteAction.faultInjectionPolicy.delay.fixedDelay.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.abort.percentage" => Some(("resource.defaultRouteAction.faultInjectionPolicy.abort.percentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "resource.default-route-action.fault-injection-policy.abort.http-status" => Some(("resource.defaultRouteAction.faultInjectionPolicy.abort.httpStatus", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.allow-methods" => Some(("resource.defaultRouteAction.corsPolicy.allowMethods", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.allow-origins" => Some(("resource.defaultRouteAction.corsPolicy.allowOrigins", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.allow-origin-regexes" => Some(("resource.defaultRouteAction.corsPolicy.allowOriginRegexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.max-age" => Some(("resource.defaultRouteAction.corsPolicy.maxAge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.allow-credentials" => Some(("resource.defaultRouteAction.corsPolicy.allowCredentials", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.disabled" => Some(("resource.defaultRouteAction.corsPolicy.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-route-action.cors-policy.allow-headers" => Some(("resource.defaultRouteAction.corsPolicy.allowHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.cors-policy.expose-headers" => Some(("resource.defaultRouteAction.corsPolicy.exposeHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.default-route-action.timeout.nanos" => Some(("resource.defaultRouteAction.timeout.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "resource.default-route-action.timeout.seconds" => Some(("resource.defaultRouteAction.timeout.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.url-rewrite.host-rewrite" => Some(("resource.defaultRouteAction.urlRewrite.hostRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-route-action.url-rewrite.path-prefix-rewrite" => Some(("resource.defaultRouteAction.urlRewrite.pathPrefixRewrite", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.creation-timestamp" => Some(("resource.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource.default-service" => Some(("resource.defaultService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource.fingerprint" => Some(("resource.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "resource.creation-timestamp" => Some(("resource.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.header-action.request-headers-to-remove" => Some(("resource.headerAction.requestHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.header-action.response-headers-to-remove" => Some(("resource.headerAction.responseHeadersToRemove", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "resource.region" => Some(("resource.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.path-redirect" => Some(("resource.defaultUrlRedirect.pathRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.strip-query" => Some(("resource.defaultUrlRedirect.stripQuery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-url-redirect.redirect-response-code" => Some(("resource.defaultUrlRedirect.redirectResponseCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.https-redirect" => Some(("resource.defaultUrlRedirect.httpsRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "resource.default-url-redirect.prefix-redirect" => Some(("resource.defaultUrlRedirect.prefixRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource.default-url-redirect.host-redirect" => Some(("resource.defaultUrlRedirect.hostRedirect", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource.id" => Some(("resource.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource.self-link" => Some(("resource.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resource.name" => Some(("resource.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "default-service", "description", "fingerprint", "id", "kind", "name", "resource", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["abort", "allow-credentials", "allow-headers", "allow-methods", "allow-origin-regexes", "allow-origins", "backend-service", "cors-policy", "creation-timestamp", "default-route-action", "default-service", "default-url-redirect", "delay", "description", "disabled", "expose-headers", "fault-injection-policy", "fingerprint", "fixed-delay", "header-action", "host-redirect", "host-rewrite", "http-status", "https-redirect", "id", "kind", "max-age", "name", "nanos", "num-retries", "path-prefix-rewrite", "path-redirect", "per-try-timeout", "percentage", "prefix-redirect", "redirect-response-code", "region", "request-headers-to-remove", "request-mirror-policy", "resource", "response-headers-to-remove", "retry-conditions", "retry-policy", "seconds", "self-link", "strip-query", "timeout", "url-rewrite"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -31855,6 +38051,572 @@ impl<'n> Engine<'n> { } } + fn _vpn_gateways_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.vpn_gateways().aggregated_list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _vpn_gateways_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.vpn_gateways().delete(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("vpn-gateway").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _vpn_gateways_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.vpn_gateways().get(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("vpn-gateway").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _vpn_gateways_get_status(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.vpn_gateways().get_status(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("vpn-gateway").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _vpn_gateways_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "label-fingerprint" => Some(("labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "network" => Some(("network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "id", "kind", "label-fingerprint", "labels", "name", "network", "region", "self-link"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::VpnGateway = json::value::from_value(object).unwrap(); + let mut call = self.hub.vpn_gateways().insert(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _vpn_gateways_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.vpn_gateways().list(opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _vpn_gateways_set_labels(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "label-fingerprint" => Some(("labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["label-fingerprint", "labels"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RegionSetLabelsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.vpn_gateways().set_labels(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-id" => { + call = call.request_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["request-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _vpn_gateways_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.vpn_gateways().test_iam_permissions(request, opt.value_of("project").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _vpn_tunnels_aggregated_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.vpn_tunnels().aggregated_list(opt.value_of("project").unwrap_or("")); @@ -31870,6 +38632,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-all-scopes" => { + call = call.include_all_scopes(arg_from_str(value.unwrap_or("false"), err, "include-all-scopes", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -31886,7 +38651,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "max-results"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "include-all-scopes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -32052,24 +38817,29 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "detailed-status" => Some(("detailedStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "ike-version" => Some(("ikeVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "remote-traffic-selector" => Some(("remoteTrafficSelector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "peer-ip" => Some(("peerIp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "local-traffic-selector" => Some(("localTrafficSelector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "target-vpn-gateway" => Some(("targetVpnGateway", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "shared-secret-hash" => Some(("sharedSecretHash", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "router" => Some(("router", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpn-gateway" => Some(("vpnGateway", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peer-external-gateway-interface" => Some(("peerExternalGatewayInterface", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "creation-timestamp" => Some(("creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peer-ip" => Some(("peerIp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "target-vpn-gateway" => Some(("targetVpnGateway", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ike-version" => Some(("ikeVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "local-traffic-selector" => Some(("localTrafficSelector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "peer-gcp-gateway" => Some(("peerGcpGateway", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shared-secret-hash" => Some(("sharedSecretHash", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vpn-gateway-interface" => Some(("vpnGatewayInterface", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "shared-secret" => Some(("sharedSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "remote-traffic-selector" => Some(("remoteTrafficSelector", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peer-external-gateway" => Some(("peerExternalGateway", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "router" => Some(("router", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "detailed-status", "id", "ike-version", "kind", "local-traffic-selector", "name", "peer-ip", "region", "remote-traffic-selector", "router", "self-link", "shared-secret", "shared-secret-hash", "status", "target-vpn-gateway"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-timestamp", "description", "detailed-status", "id", "ike-version", "kind", "local-traffic-selector", "name", "peer-external-gateway", "peer-external-gateway-interface", "peer-gcp-gateway", "peer-ip", "region", "remote-traffic-selector", "router", "self-link", "shared-secret", "shared-secret-hash", "status", "target-vpn-gateway", "vpn-gateway", "vpn-gateway-interface"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -32359,6 +39129,58 @@ impl<'n> Engine<'n> { } } + fn _zone_operations_wait(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.zone_operations().wait(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("operation").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _zones_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.zones().get(opt.value_of("project").unwrap_or(""), opt.value_of("zone").unwrap_or("")); @@ -32687,6 +39509,32 @@ impl<'n> Engine<'n> { } } }, + ("external-vpn-gateways", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._external_vpn_gateways_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._external_vpn_gateways_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._external_vpn_gateways_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._external_vpn_gateways_list(opt, dry_run, &mut err); + }, + ("set-labels", Some(opt)) => { + call_result = self._external_vpn_gateways_set_labels(opt, dry_run, &mut err); + }, + ("test-iam-permissions", Some(opt)) => { + call_result = self._external_vpn_gateways_test_iam_permissions(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("external-vpn-gateways".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("firewalls", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -32730,6 +39578,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._forwarding_rules_list(opt, dry_run, &mut err); }, + ("patch", Some(opt)) => { + call_result = self._forwarding_rules_patch(opt, dry_run, &mut err); + }, ("set-target", Some(opt)) => { call_result = self._forwarding_rules_set_target(opt, dry_run, &mut err); }, @@ -32773,6 +39624,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._global_forwarding_rules_list(opt, dry_run, &mut err); }, + ("patch", Some(opt)) => { + call_result = self._global_forwarding_rules_patch(opt, dry_run, &mut err); + }, ("set-target", Some(opt)) => { call_result = self._global_forwarding_rules_set_target(opt, dry_run, &mut err); }, @@ -32782,6 +39636,35 @@ impl<'n> Engine<'n> { } } }, + ("global-network-endpoint-groups", Some(opt)) => { + match opt.subcommand() { + ("attach-network-endpoints", Some(opt)) => { + call_result = self._global_network_endpoint_groups_attach_network_endpoints(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._global_network_endpoint_groups_delete(opt, dry_run, &mut err); + }, + ("detach-network-endpoints", Some(opt)) => { + call_result = self._global_network_endpoint_groups_detach_network_endpoints(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._global_network_endpoint_groups_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._global_network_endpoint_groups_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._global_network_endpoint_groups_list(opt, dry_run, &mut err); + }, + ("list-network-endpoints", Some(opt)) => { + call_result = self._global_network_endpoint_groups_list_network_endpoints(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("global-network-endpoint-groups".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("global-operations", Some(opt)) => { match opt.subcommand() { ("aggregated-list", Some(opt)) => { @@ -32796,6 +39679,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._global_operations_list(opt, dry_run, &mut err); }, + ("wait", Some(opt)) => { + call_result = self._global_operations_wait(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("global-operations".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -32804,6 +39690,9 @@ impl<'n> Engine<'n> { }, ("health-checks", Some(opt)) => { match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._health_checks_aggregated_list(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._health_checks_delete(opt, dry_run, &mut err); }, @@ -32926,6 +39815,12 @@ impl<'n> Engine<'n> { ("aggregated-list", Some(opt)) => { call_result = self._instance_group_managers_aggregated_list(opt, dry_run, &mut err); }, + ("apply-updates-to-instances", Some(opt)) => { + call_result = self._instance_group_managers_apply_updates_to_instances(opt, dry_run, &mut err); + }, + ("create-instances", Some(opt)) => { + call_result = self._instance_group_managers_create_instances(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._instance_group_managers_delete(opt, dry_run, &mut err); }, @@ -32941,6 +39836,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._instance_group_managers_list(opt, dry_run, &mut err); }, + ("list-errors", Some(opt)) => { + call_result = self._instance_group_managers_list_errors(opt, dry_run, &mut err); + }, ("list-managed-instances", Some(opt)) => { call_result = self._instance_group_managers_list_managed_instances(opt, dry_run, &mut err); }, @@ -33034,6 +39932,9 @@ impl<'n> Engine<'n> { ("add-access-config", Some(opt)) => { call_result = self._instances_add_access_config(opt, dry_run, &mut err); }, + ("add-resource-policies", Some(opt)) => { + call_result = self._instances_add_resource_policies(opt, dry_run, &mut err); + }, ("aggregated-list", Some(opt)) => { call_result = self._instances_aggregated_list(opt, dry_run, &mut err); }, @@ -33073,6 +39974,9 @@ impl<'n> Engine<'n> { ("list-referrers", Some(opt)) => { call_result = self._instances_list_referrers(opt, dry_run, &mut err); }, + ("remove-resource-policies", Some(opt)) => { + call_result = self._instances_remove_resource_policies(opt, dry_run, &mut err); + }, ("reset", Some(opt)) => { call_result = self._instances_reset(opt, dry_run, &mut err); }, @@ -33127,9 +40031,15 @@ impl<'n> Engine<'n> { ("test-iam-permissions", Some(opt)) => { call_result = self._instances_test_iam_permissions(opt, dry_run, &mut err); }, + ("update", Some(opt)) => { + call_result = self._instances_update(opt, dry_run, &mut err); + }, ("update-access-config", Some(opt)) => { call_result = self._instances_update_access_config(opt, dry_run, &mut err); }, + ("update-display-device", Some(opt)) => { + call_result = self._instances_update_display_device(opt, dry_run, &mut err); + }, ("update-network-interface", Some(opt)) => { call_result = self._instances_update_network_interface(opt, dry_run, &mut err); }, @@ -33320,6 +40230,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._networks_list(opt, dry_run, &mut err); }, + ("list-peering-routes", Some(opt)) => { + call_result = self._networks_list_peering_routes(opt, dry_run, &mut err); + }, ("patch", Some(opt)) => { call_result = self._networks_patch(opt, dry_run, &mut err); }, @@ -33329,6 +40242,9 @@ impl<'n> Engine<'n> { ("switch-to-custom-mode", Some(opt)) => { call_result = self._networks_switch_to_custom_mode(opt, dry_run, &mut err); }, + ("update-peering", Some(opt)) => { + call_result = self._networks_update_peering(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("networks".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -33364,6 +40280,9 @@ impl<'n> Engine<'n> { ("list-nodes", Some(opt)) => { call_result = self._node_groups_list_nodes(opt, dry_run, &mut err); }, + ("patch", Some(opt)) => { + call_result = self._node_groups_patch(opt, dry_run, &mut err); + }, ("set-iam-policy", Some(opt)) => { call_result = self._node_groups_set_iam_policy(opt, dry_run, &mut err); }, @@ -33428,6 +40347,35 @@ impl<'n> Engine<'n> { } } }, + ("packet-mirrorings", Some(opt)) => { + match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._packet_mirrorings_aggregated_list(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._packet_mirrorings_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._packet_mirrorings_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._packet_mirrorings_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._packet_mirrorings_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._packet_mirrorings_patch(opt, dry_run, &mut err); + }, + ("test-iam-permissions", Some(opt)) => { + call_result = self._packet_mirrorings_test_iam_permissions(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("packet-mirrorings".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("projects", Some(opt)) => { match opt.subcommand() { ("disable-xpn-host", Some(opt)) => { @@ -33602,11 +40550,43 @@ impl<'n> Engine<'n> { } } }, + ("region-health-checks", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._region_health_checks_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._region_health_checks_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._region_health_checks_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._region_health_checks_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._region_health_checks_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._region_health_checks_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("region-health-checks".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("region-instance-group-managers", Some(opt)) => { match opt.subcommand() { ("abandon-instances", Some(opt)) => { call_result = self._region_instance_group_managers_abandon_instances(opt, dry_run, &mut err); }, + ("apply-updates-to-instances", Some(opt)) => { + call_result = self._region_instance_group_managers_apply_updates_to_instances(opt, dry_run, &mut err); + }, + ("create-instances", Some(opt)) => { + call_result = self._region_instance_group_managers_create_instances(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._region_instance_group_managers_delete(opt, dry_run, &mut err); }, @@ -33622,6 +40602,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._region_instance_group_managers_list(opt, dry_run, &mut err); }, + ("list-errors", Some(opt)) => { + call_result = self._region_instance_group_managers_list_errors(opt, dry_run, &mut err); + }, ("list-managed-instances", Some(opt)) => { call_result = self._region_instance_group_managers_list_managed_instances(opt, dry_run, &mut err); }, @@ -33677,12 +40660,113 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._region_operations_list(opt, dry_run, &mut err); }, + ("wait", Some(opt)) => { + call_result = self._region_operations_wait(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("region-operations".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); } } }, + ("region-ssl-certificates", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._region_ssl_certificates_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._region_ssl_certificates_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._region_ssl_certificates_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._region_ssl_certificates_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("region-ssl-certificates".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("region-target-http-proxies", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._region_target_http_proxies_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._region_target_http_proxies_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._region_target_http_proxies_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._region_target_http_proxies_list(opt, dry_run, &mut err); + }, + ("set-url-map", Some(opt)) => { + call_result = self._region_target_http_proxies_set_url_map(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("region-target-http-proxies".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("region-target-https-proxies", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._region_target_https_proxies_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._region_target_https_proxies_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._region_target_https_proxies_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._region_target_https_proxies_list(opt, dry_run, &mut err); + }, + ("set-ssl-certificates", Some(opt)) => { + call_result = self._region_target_https_proxies_set_ssl_certificates(opt, dry_run, &mut err); + }, + ("set-url-map", Some(opt)) => { + call_result = self._region_target_https_proxies_set_url_map(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("region-target-https-proxies".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("region-url-maps", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._region_url_maps_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._region_url_maps_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._region_url_maps_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._region_url_maps_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._region_url_maps_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._region_url_maps_update(opt, dry_run, &mut err); + }, + ("validate", Some(opt)) => { + call_result = self._region_url_maps_validate(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("region-url-maps".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("regions", Some(opt)) => { match opt.subcommand() { ("get", Some(opt)) => { @@ -33842,6 +40926,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._security_policies_list(opt, dry_run, &mut err); }, + ("list-preconfigured-expression-sets", Some(opt)) => { + call_result = self._security_policies_list_preconfigured_expression_sets(opt, dry_run, &mut err); + }, ("patch", Some(opt)) => { call_result = self._security_policies_patch(opt, dry_run, &mut err); }, @@ -33888,6 +40975,9 @@ impl<'n> Engine<'n> { }, ("ssl-certificates", Some(opt)) => { match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._ssl_certificates_aggregated_list(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._ssl_certificates_delete(opt, dry_run, &mut err); }, @@ -33978,6 +41068,9 @@ impl<'n> Engine<'n> { }, ("target-http-proxies", Some(opt)) => { match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._target_http_proxies_aggregated_list(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._target_http_proxies_delete(opt, dry_run, &mut err); }, @@ -34001,6 +41094,9 @@ impl<'n> Engine<'n> { }, ("target-https-proxies", Some(opt)) => { match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._target_https_proxies_aggregated_list(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._target_https_proxies_delete(opt, dry_run, &mut err); }, @@ -34178,6 +41274,9 @@ impl<'n> Engine<'n> { }, ("url-maps", Some(opt)) => { match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._url_maps_aggregated_list(opt, dry_run, &mut err); + }, ("delete", Some(opt)) => { call_result = self._url_maps_delete(opt, dry_run, &mut err); }, @@ -34208,6 +41307,38 @@ impl<'n> Engine<'n> { } } }, + ("vpn-gateways", Some(opt)) => { + match opt.subcommand() { + ("aggregated-list", Some(opt)) => { + call_result = self._vpn_gateways_aggregated_list(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._vpn_gateways_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._vpn_gateways_get(opt, dry_run, &mut err); + }, + ("get-status", Some(opt)) => { + call_result = self._vpn_gateways_get_status(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._vpn_gateways_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._vpn_gateways_list(opt, dry_run, &mut err); + }, + ("set-labels", Some(opt)) => { + call_result = self._vpn_gateways_set_labels(opt, dry_run, &mut err); + }, + ("test-iam-permissions", Some(opt)) => { + call_result = self._vpn_gateways_test_iam_permissions(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("vpn-gateways".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("vpn-tunnels", Some(opt)) => { match opt.subcommand() { ("aggregated-list", Some(opt)) => { @@ -34242,6 +41373,9 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._zone_operations_list(opt, dry_run, &mut err); }, + ("wait", Some(opt)) => { + call_result = self._zone_operations_wait(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("zone-operations".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -35236,7 +42370,7 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information."##), + Some(r##"Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Understanding backend services for more information."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/backend-services_insert", vec![ (Some(r##"project"##), @@ -35286,7 +42420,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules."##), + Some(r##"Patches the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/backend-services_patch", vec![ (Some(r##"project"##), @@ -35354,7 +42488,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information."##), + Some(r##"Updates the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/backend-services_update", vec![ (Some(r##"project"##), @@ -35945,6 +43079,183 @@ fn main() { ]), ]), + ("external-vpn-gateways", "methods: 'delete', 'get', 'insert', 'list', 'set-labels' and 'test-iam-permissions'", vec![ + ("delete", + Some(r##"Deletes the specified externalVpnGateway."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/external-vpn-gateways_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"external-vpn-gateway"##), + None, + Some(r##"Name of the externalVpnGateways to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/external-vpn-gateways_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"external-vpn-gateway"##), + None, + Some(r##"Name of the externalVpnGateway to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a ExternalVpnGateway in the specified project using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/external-vpn-gateways_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of ExternalVpnGateway available to the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/external-vpn-gateways_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-labels", + Some(r##"Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/external-vpn-gateways_set-labels", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"resource"##), + None, + Some(r##"Name or id of the resource for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/external-vpn-gateways_test-iam-permissions", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"resource"##), + None, + Some(r##"Name or id of the resource for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("firewalls", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", Some(r##"Deletes the specified firewall."##), @@ -36087,7 +43398,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags."##), + Some(r##"Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/firewalls_update", vec![ (Some(r##"project"##), @@ -36122,7 +43433,7 @@ fn main() { ]), ]), - ("forwarding-rules", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'list' and 'set-target'", vec![ + ("forwarding-rules", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'list', 'patch' and 'set-target'", vec![ ("aggregated-list", Some(r##"Retrieves an aggregated list of forwarding rules."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/forwarding-rules_aggregated-list", @@ -36269,6 +43580,46 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/forwarding-rules_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"forwarding-rule"##), + None, + Some(r##"Name of the ForwardingRule resource to patch."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -36426,7 +43777,7 @@ fn main() { ]), ]), - ("global-forwarding-rules", "methods: 'delete', 'get', 'insert', 'list' and 'set-target'", vec![ + ("global-forwarding-rules", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'set-target'", vec![ ("delete", Some(r##"Deletes the specified GlobalForwardingRule resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-forwarding-rules_delete", @@ -36527,6 +43878,40 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-forwarding-rules_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"forwarding-rule"##), + None, + Some(r##"Name of the ForwardingRule resource to patch."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -36569,7 +43954,212 @@ fn main() { ]), ]), - ("global-operations", "methods: 'aggregated-list', 'delete', 'get' and 'list'", vec![ + ("global-network-endpoint-groups", "methods: 'attach-network-endpoints', 'delete', 'detach-network-endpoints', 'get', 'insert', 'list' and 'list-network-endpoints'", vec![ + ("attach-network-endpoints", + Some(r##"Attach a network endpoint to the specified network endpoint group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-network-endpoint-groups_attach-network-endpoints", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"network-endpoint-group"##), + None, + Some(r##"The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-network-endpoint-groups_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"network-endpoint-group"##), + None, + Some(r##"The name of the network endpoint group to delete. It should comply with RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("detach-network-endpoints", + Some(r##"Detach the network endpoint from the specified network endpoint group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-network-endpoint-groups_detach-network-endpoints", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"network-endpoint-group"##), + None, + Some(r##"The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-network-endpoint-groups_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"network-endpoint-group"##), + None, + Some(r##"The name of the network endpoint group. It should comply with RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a network endpoint group in the specified project using the parameters that are included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-network-endpoint-groups_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of network endpoint groups that are located in the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-network-endpoint-groups_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-network-endpoints", + Some(r##"Lists the network endpoints in the specified network endpoint group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-network-endpoint-groups_list-network-endpoints", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"network-endpoint-group"##), + None, + Some(r##"The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("global-operations", "methods: 'aggregated-list', 'delete', 'get', 'list' and 'wait'", vec![ ("aggregated-list", Some(r##"Retrieves an aggregated list of all operations."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-operations_aggregated-list", @@ -36615,7 +44205,7 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Retrieves the specified Operations resource. Gets a list of operations by making a list() request."##), + Some(r##"Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-operations_get", vec![ (Some(r##"project"##), @@ -36658,6 +44248,38 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("wait", + Some(r##"Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + + This method is called on a best-effort basis. Specifically: + - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/global-operations_wait", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"operation"##), + None, + Some(r##"Name of the Operations resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -36666,7 +44288,29 @@ fn main() { ]), ]), - ("health-checks", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("health-checks", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("aggregated-list", + Some(r##"Retrieves the list of all HealthCheck resources, regional and global, available to the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/health-checks_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("delete", Some(r##"Deletes the specified HealthCheck resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/health-checks_delete", @@ -37500,7 +45144,7 @@ fn main() { ]), ]), - ("instance-group-managers", "methods: 'abandon-instances', 'aggregated-list', 'delete', 'delete-instances', 'get', 'insert', 'list', 'list-managed-instances', 'patch', 'recreate-instances', 'resize', 'set-instance-template' and 'set-target-pools'", vec![ + ("instance-group-managers", "methods: 'abandon-instances', 'aggregated-list', 'apply-updates-to-instances', 'create-instances', 'delete', 'delete-instances', 'get', 'insert', 'list', 'list-errors', 'list-managed-instances', 'patch', 'recreate-instances', 'resize', 'set-instance-template' and 'set-target-pools'", vec![ ("abandon-instances", Some(r##"Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. @@ -37561,6 +45205,86 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("apply-updates-to-instances", + Some(r##"Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_apply-updates-to-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone where the managed instance group is located. Should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the managed instance group, should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("create-instances", + Some(r##"Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_create-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone where the managed instance group is located. It should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the managed instance group. It should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -37737,6 +45461,40 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-errors", + Some(r##"Lists all errors thrown by actions on instances for a given managed instance group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instance-group-managers_list-errors", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone where the managed instance group is located. It should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -38513,7 +46271,7 @@ fn main() { ]), ]), - ("instances", "methods: 'add-access-config', 'aggregated-list', 'attach-disk', 'delete', 'delete-access-config', 'detach-disk', 'get', 'get-guest-attributes', 'get-iam-policy', 'get-serial-port-output', 'get-shielded-instance-identity', 'insert', 'list', 'list-referrers', 'reset', 'set-deletion-protection', 'set-disk-auto-delete', 'set-iam-policy', 'set-labels', 'set-machine-resources', 'set-machine-type', 'set-metadata', 'set-min-cpu-platform', 'set-scheduling', 'set-service-account', 'set-shielded-instance-integrity-policy', 'set-tags', 'simulate-maintenance-event', 'start', 'start-with-encryption-key', 'stop', 'test-iam-permissions', 'update-access-config', 'update-network-interface' and 'update-shielded-instance-config'", vec![ + ("instances", "methods: 'add-access-config', 'add-resource-policies', 'aggregated-list', 'attach-disk', 'delete', 'delete-access-config', 'detach-disk', 'get', 'get-guest-attributes', 'get-iam-policy', 'get-serial-port-output', 'get-shielded-instance-identity', 'insert', 'list', 'list-referrers', 'remove-resource-policies', 'reset', 'set-deletion-protection', 'set-disk-auto-delete', 'set-iam-policy', 'set-labels', 'set-machine-resources', 'set-machine-type', 'set-metadata', 'set-min-cpu-platform', 'set-scheduling', 'set-service-account', 'set-shielded-instance-integrity-policy', 'set-tags', 'simulate-maintenance-event', 'start', 'start-with-encryption-key', 'stop', 'test-iam-permissions', 'update', 'update-access-config', 'update-display-device', 'update-network-interface' and 'update-shielded-instance-config'", vec![ ("add-access-config", Some(r##"Adds an access config to an instance's network interface."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instances_add-access-config", @@ -38554,6 +46312,46 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("add-resource-policies", + Some(r##"Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instances_add-resource-policies", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone for this request."##), + Some(true), + Some(false)), + + (Some(r##"instance"##), + None, + Some(r##"The instance name for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -39002,6 +46800,46 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("remove-resource-policies", + Some(r##"Removes resource policies from an instance."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instances_remove-resource-policies", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone for this request."##), + Some(true), + Some(false)), + + (Some(r##"instance"##), + None, + Some(r##"The instance name for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -39698,6 +47536,46 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update", + Some(r##"Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instances_update", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone for this request."##), + Some(true), + Some(false)), + + (Some(r##"instance"##), + None, + Some(r##"Name of the instance resource to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -39744,6 +47622,46 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-display-device", + Some(r##"Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/instances_update-display-device", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone for this request."##), + Some(true), + Some(false)), + + (Some(r##"instance"##), + None, + Some(r##"Name of the instance scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -40259,7 +48177,7 @@ fn main() { ("license-codes", "methods: 'get' and 'test-iam-permissions'", vec![ ("get", - Some(r##"Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code."##), + Some(r##"Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/license-codes_get", vec![ (Some(r##"project"##), @@ -40287,7 +48205,7 @@ fn main() { Some(false)), ]), ("test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource."##), + Some(r##"Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/license-codes_test-iam-permissions", vec![ (Some(r##"project"##), @@ -40324,7 +48242,7 @@ fn main() { ("licenses", "methods: 'delete', 'get', 'get-iam-policy', 'insert', 'list', 'set-iam-policy' and 'test-iam-permissions'", vec![ ("delete", - Some(r##"Deletes the specified license."##), + Some(r##"Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/licenses_delete", vec![ (Some(r##"project"##), @@ -40352,7 +48270,7 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Returns the specified License resource."##), + Some(r##"Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/licenses_get", vec![ (Some(r##"project"##), @@ -40380,7 +48298,7 @@ fn main() { Some(false)), ]), ("get-iam-policy", - Some(r##"Gets the access control policy for a resource. May be empty if no such policy or resource exists."##), + Some(r##"Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/licenses_get-iam-policy", vec![ (Some(r##"project"##), @@ -40408,7 +48326,7 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Create a License resource in the specified project."##), + Some(r##"Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/licenses_insert", vec![ (Some(r##"project"##), @@ -40436,7 +48354,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud."##), + Some(r##"Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/licenses_list", vec![ (Some(r##"project"##), @@ -40458,7 +48376,7 @@ fn main() { Some(false)), ]), ("set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/licenses_set-iam-policy", vec![ (Some(r##"project"##), @@ -40492,7 +48410,7 @@ fn main() { Some(false)), ]), ("test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource."##), + Some(r##"Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/licenses_test-iam-permissions", vec![ (Some(r##"project"##), @@ -40929,7 +48847,7 @@ fn main() { ]), ]), - ("networks", "methods: 'add-peering', 'delete', 'get', 'insert', 'list', 'patch', 'remove-peering' and 'switch-to-custom-mode'", vec![ + ("networks", "methods: 'add-peering', 'delete', 'get', 'insert', 'list', 'list-peering-routes', 'patch', 'remove-peering', 'switch-to-custom-mode' and 'update-peering'", vec![ ("add-peering", Some(r##"Adds a peering to the specified network."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/networks_add-peering", @@ -41064,6 +48982,34 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-peering-routes", + Some(r##"Lists the peering routes exchanged over peering connection."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/networks_list-peering-routes", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"network"##), + None, + Some(r##"Name of the network for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -41160,6 +49106,40 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-peering", + Some(r##"Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes"##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/networks_update-peering", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"network"##), + None, + Some(r##"Name of the network resource which the updated peering is belonging to."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -41168,7 +49148,7 @@ fn main() { ]), ]), - ("node-groups", "methods: 'add-nodes', 'aggregated-list', 'delete', 'delete-nodes', 'get', 'get-iam-policy', 'insert', 'list', 'list-nodes', 'set-iam-policy', 'set-node-template' and 'test-iam-permissions'", vec![ + ("node-groups", "methods: 'add-nodes', 'aggregated-list', 'delete', 'delete-nodes', 'get', 'get-iam-policy', 'insert', 'list', 'list-nodes', 'patch', 'set-iam-policy', 'set-node-template' and 'test-iam-permissions'", vec![ ("add-nodes", Some(r##"Adds specified number of nodes to the node group."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/node-groups_add-nodes", @@ -41283,7 +49263,7 @@ fn main() { (Some(r##"node-group"##), None, - Some(r##"Name of the NodeGroup resource to delete."##), + Some(r##"Name of the NodeGroup resource whose nodes will be deleted."##), Some(true), Some(false)), @@ -41469,6 +49449,46 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Patch the node group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/node-groups_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the zone for this request."##), + Some(true), + Some(false)), + + (Some(r##"node-group"##), + None, + Some(r##"Name of the NodeGroup resource to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -41953,6 +49973,241 @@ fn main() { ]), ]), + ("packet-mirrorings", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'list', 'patch' and 'test-iam-permissions'", vec![ + ("aggregated-list", + Some(r##"Retrieves an aggregated list of packetMirrorings."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/packet-mirrorings_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified PacketMirroring resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/packet-mirrorings_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"packet-mirroring"##), + None, + Some(r##"Name of the PacketMirroring resource to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified PacketMirroring resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/packet-mirrorings_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"packet-mirroring"##), + None, + Some(r##"Name of the PacketMirroring resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a PacketMirroring resource in the specified project and region using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/packet-mirrorings_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves a list of PacketMirroring resources available to the specified project and region."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/packet-mirrorings_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/packet-mirrorings_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"packet-mirroring"##), + None, + Some(r##"Name of the PacketMirroring resource to patch."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/packet-mirrorings_test-iam-permissions", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"The name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"resource"##), + None, + Some(r##"Name or id of the resource for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("projects", "methods: 'disable-xpn-host', 'disable-xpn-resource', 'enable-xpn-host', 'enable-xpn-resource', 'get', 'get-xpn-host', 'get-xpn-resources', 'list-xpn-hosts', 'move-disk', 'move-instance', 'set-common-instance-metadata', 'set-default-network-tier' and 'set-usage-export-bucket'", vec![ ("disable-xpn-host", Some(r##"Disable this project as a shared VPC host project."##), @@ -42601,7 +50856,7 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information."##), + Some(r##"Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Understanding backend services for more information."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-backend-services_insert", vec![ (Some(r##"project"##), @@ -42663,7 +50918,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules."##), + Some(r##"Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-backend-services_patch", vec![ (Some(r##"project"##), @@ -42703,7 +50958,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information."##), + Some(r##"Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-backend-services_update", vec![ (Some(r##"project"##), @@ -43303,7 +51558,220 @@ fn main() { ]), ]), - ("region-instance-group-managers", "methods: 'abandon-instances', 'delete', 'delete-instances', 'get', 'insert', 'list', 'list-managed-instances', 'patch', 'recreate-instances', 'resize', 'set-instance-template' and 'set-target-pools'", vec![ + ("region-health-checks", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("delete", + Some(r##"Deletes the specified HealthCheck resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-health-checks_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"health-check"##), + None, + Some(r##"Name of the HealthCheck resource to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-health-checks_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"health-check"##), + None, + Some(r##"Name of the HealthCheck resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a HealthCheck resource in the specified project using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-health-checks_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of HealthCheck resources available to the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-health-checks_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-health-checks_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"health-check"##), + None, + Some(r##"Name of the HealthCheck resource to patch."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update", + Some(r##"Updates a HealthCheck resource in the specified project using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-health-checks_update", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"health-check"##), + None, + Some(r##"Name of the HealthCheck resource to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("region-instance-group-managers", "methods: 'abandon-instances', 'apply-updates-to-instances', 'create-instances', 'delete', 'delete-instances', 'get', 'insert', 'list', 'list-errors', 'list-managed-instances', 'patch', 'recreate-instances', 'resize', 'set-instance-template' and 'set-target-pools'", vec![ ("abandon-instances", Some(r##"Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. @@ -43342,6 +51810,86 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("apply-updates-to-instances", + Some(r##"Apply updates to selected instances the managed instance group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-instance-group-managers_apply-updates-to-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request, should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the managed instance group, should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("create-instances", + Some(r##"Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-instance-group-managers_create-instances", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"The name of the region where the managed instance group is located. It should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the managed instance group. It should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -43518,6 +52066,40 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-errors", + Some(r##"Lists all errors thrown by actions on instances for a given regional managed instance group."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-instance-group-managers_list-errors", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request. This should conform to RFC1035."##), + Some(true), + Some(false)), + + (Some(r##"instance-group-manager"##), + None, + Some(r##"The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -43913,7 +52495,7 @@ fn main() { ]), ]), - ("region-operations", "methods: 'delete', 'get' and 'list'", vec![ + ("region-operations", "methods: 'delete', 'get', 'list' and 'wait'", vec![ ("delete", Some(r##"Deletes the specified region-specific Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-operations_delete", @@ -43998,6 +52580,816 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("wait", + Some(r##"Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + + This method is called on a best-effort basis. Specifically: + - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-operations_wait", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"operation"##), + None, + Some(r##"Name of the Operations resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("region-ssl-certificates", "methods: 'delete', 'get', 'insert' and 'list'", vec![ + ("delete", + Some(r##"Deletes the specified SslCertificate resource in the region."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-ssl-certificates_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"ssl-certificate"##), + None, + Some(r##"Name of the SslCertificate resource to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-ssl-certificates_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"ssl-certificate"##), + None, + Some(r##"Name of the SslCertificate resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a SslCertificate resource in the specified project and region using the data included in the request"##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-ssl-certificates_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of SslCertificate resources available to the specified project in the specified region."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-ssl-certificates_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("region-target-http-proxies", "methods: 'delete', 'get', 'insert', 'list' and 'set-url-map'", vec![ + ("delete", + Some(r##"Deletes the specified TargetHttpProxy resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-http-proxies_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"target-http-proxy"##), + None, + Some(r##"Name of the TargetHttpProxy resource to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-http-proxies_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"target-http-proxy"##), + None, + Some(r##"Name of the TargetHttpProxy resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a TargetHttpProxy resource in the specified project and region using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-http-proxies_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-http-proxies_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-url-map", + Some(r##"Changes the URL map for TargetHttpProxy."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-http-proxies_set-url-map", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"target-http-proxy"##), + None, + Some(r##"Name of the TargetHttpProxy to set a URL map for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("region-target-https-proxies", "methods: 'delete', 'get', 'insert', 'list', 'set-ssl-certificates' and 'set-url-map'", vec![ + ("delete", + Some(r##"Deletes the specified TargetHttpsProxy resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-https-proxies_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"target-https-proxy"##), + None, + Some(r##"Name of the TargetHttpsProxy resource to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-https-proxies_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"target-https-proxy"##), + None, + Some(r##"Name of the TargetHttpsProxy resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-https-proxies_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-https-proxies_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-ssl-certificates", + Some(r##"Replaces SslCertificates for TargetHttpsProxy."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-https-proxies_set-ssl-certificates", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"target-https-proxy"##), + None, + Some(r##"Name of the TargetHttpsProxy resource to set an SslCertificates resource for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-url-map", + Some(r##"Changes the URL map for TargetHttpsProxy."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-target-https-proxies_set-url-map", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"target-https-proxy"##), + None, + Some(r##"Name of the TargetHttpsProxy to set a URL map for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("region-url-maps", "methods: 'delete', 'get', 'insert', 'list', 'patch', 'update' and 'validate'", vec![ + ("delete", + Some(r##"Deletes the specified UrlMap resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-url-maps_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"url-map"##), + None, + Some(r##"Name of the UrlMap resource to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-url-maps_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"url-map"##), + None, + Some(r##"Name of the UrlMap resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a UrlMap resource in the specified project using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-url-maps_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves the list of UrlMap resources available to the specified project in the specified region."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-url-maps_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-url-maps_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"url-map"##), + None, + Some(r##"Name of the UrlMap resource to patch."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update", + Some(r##"Updates the specified UrlMap resource with the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-url-maps_update", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"url-map"##), + None, + Some(r##"Name of the UrlMap resource to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("validate", + Some(r##"Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/region-url-maps_validate", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"url-map"##), + None, + Some(r##"Name of the UrlMap resource to be validated as."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -44117,7 +53509,7 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves all information of the specified reservation."##), + Some(r##"Retrieves information about the specified reservation."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/reservations_get", vec![ (Some(r##"project"##), @@ -44219,7 +53611,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"A list all the reservations that have been configured for the specified project in specified zone."##), + Some(r##"A list of all the reservations that have been configured for the specified project in specified zone."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/reservations_list", vec![ (Some(r##"project"##), @@ -44247,7 +53639,7 @@ fn main() { Some(false)), ]), ("resize", - Some(r##"Resizes the reservation (applicable to standalone reservations only)"##), + Some(r##"Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/reservations_resize", vec![ (Some(r##"project"##), @@ -45089,7 +54481,7 @@ fn main() { ]), ]), - ("security-policies", "methods: 'add-rule', 'delete', 'get', 'get-rule', 'insert', 'list', 'patch', 'patch-rule' and 'remove-rule'", vec![ + ("security-policies", "methods: 'add-rule', 'delete', 'get', 'get-rule', 'insert', 'list', 'list-preconfigured-expression-sets', 'patch', 'patch-rule' and 'remove-rule'", vec![ ("add-rule", Some(r##"Inserts a rule into a security policy."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/security-policies_add-rule", @@ -45252,6 +54644,28 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-preconfigured-expression-sets", + Some(r##"Gets the current list of preconfigured Web Application Firewall (WAF) expressions."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/security-policies_list-preconfigured-expression-sets", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -45569,7 +54983,29 @@ fn main() { ]), ]), - ("ssl-certificates", "methods: 'delete', 'get', 'insert' and 'list'", vec![ + ("ssl-certificates", "methods: 'aggregated-list', 'delete', 'get', 'insert' and 'list'", vec![ + ("aggregated-list", + Some(r##"Retrieves the list of all SslCertificate resources, regional and global, available to the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/ssl-certificates_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("delete", Some(r##"Deletes the specified SslCertificate resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/ssl-certificates_delete", @@ -46071,7 +55507,7 @@ fn main() { Some(false)), ]), ("list-usable", - Some(r##"Retrieves an aggregated list of usable subnetworks."##), + Some(r##"Retrieves an aggregated list of all usable subnetworks in the project. The list contains all of the subnetworks in the project and the subnetworks that were shared by a Shared VPC host project."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/subnetworks_list-usable", vec![ (Some(r##"project"##), @@ -46093,7 +55529,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingeprint of the subnetwork resource being patched."##), + Some(r##"Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/subnetworks_patch", vec![ (Some(r##"project"##), @@ -46254,7 +55690,29 @@ fn main() { ]), ]), - ("target-http-proxies", "methods: 'delete', 'get', 'insert', 'list' and 'set-url-map'", vec![ + ("target-http-proxies", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'list' and 'set-url-map'", vec![ + ("aggregated-list", + Some(r##"Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/target-http-proxies_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("delete", Some(r##"Deletes the specified TargetHttpProxy resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/target-http-proxies_delete", @@ -46397,7 +55855,29 @@ fn main() { ]), ]), - ("target-https-proxies", "methods: 'delete', 'get', 'insert', 'list', 'set-quic-override', 'set-ssl-certificates', 'set-ssl-policy' and 'set-url-map'", vec![ + ("target-https-proxies", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'list', 'set-quic-override', 'set-ssl-certificates', 'set-ssl-policy' and 'set-url-map'", vec![ + ("aggregated-list", + Some(r##"Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/target-https-proxies_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("delete", Some(r##"Deletes the specified TargetHttpsProxy resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/target-https-proxies_delete", @@ -47769,7 +57249,29 @@ fn main() { ]), ]), - ("url-maps", "methods: 'delete', 'get', 'insert', 'invalidate-cache', 'list', 'patch', 'update' and 'validate'", vec![ + ("url-maps", "methods: 'aggregated-list', 'delete', 'get', 'insert', 'invalidate-cache', 'list', 'patch', 'update' and 'validate'", vec![ + ("aggregated-list", + Some(r##"Retrieves the list of all UrlMap resources, regional and global, available to the specified project."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/url-maps_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Name of the project scoping this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("delete", Some(r##"Deletes the specified UrlMap resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/url-maps_delete", @@ -48014,6 +57516,275 @@ fn main() { ]), ]), + ("vpn-gateways", "methods: 'aggregated-list', 'delete', 'get', 'get-status', 'insert', 'list', 'set-labels' and 'test-iam-permissions'", vec![ + ("aggregated-list", + Some(r##"Retrieves an aggregated list of VPN gateways."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_aggregated-list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified VPN gateway."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"vpn-gateway"##), + None, + Some(r##"Name of the VPN gateway to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"vpn-gateway"##), + None, + Some(r##"Name of the VPN gateway to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-status", + Some(r##"Returns the status for the specified VPN gateway."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_get-status", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"vpn-gateway"##), + None, + Some(r##"Name of the VPN gateway to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("insert", + Some(r##"Creates a VPN gateway in the specified project and region using the data included in the request."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_insert", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Retrieves a list of VPN gateways available to the specified project and region."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-labels", + Some(r##"Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_set-labels", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"The region for this request."##), + Some(true), + Some(false)), + + (Some(r##"resource"##), + None, + Some(r##"Name or id of the resource for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/vpn-gateways_test-iam-permissions", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"The name of the region for this request."##), + Some(true), + Some(false)), + + (Some(r##"resource"##), + None, + Some(r##"Name or id of the resource for this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("vpn-tunnels", "methods: 'aggregated-list', 'delete', 'get', 'insert' and 'list'", vec![ ("aggregated-list", Some(r##"Retrieves an aggregated list of VPN tunnels."##), @@ -48169,7 +57940,7 @@ fn main() { ]), ]), - ("zone-operations", "methods: 'delete', 'get' and 'list'", vec![ + ("zone-operations", "methods: 'delete', 'get', 'list' and 'wait'", vec![ ("delete", Some(r##"Deletes the specified zone-specific Operations resource."##), "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/zone-operations_delete", @@ -48254,6 +58025,44 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("wait", + Some(r##"Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + + This method is called on a best-effort basis. Specifically: + - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`."##), + "Details at http://byron.github.io/google-apis-rs/google_compute1_cli/zone-operations_wait", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID for this request."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"Name of the zone for this request."##), + Some(true), + Some(false)), + + (Some(r##"operation"##), + None, + Some(r##"Name of the Operations resource to return."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -48319,7 +58128,7 @@ fn main() { let mut app = App::new("compute1") .author("Sebastian Thiel ") - .version("1.0.12+20190618") + .version("1.0.13+20200311") .about("Creates and runs virtual machines on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_compute1_cli") .arg(Arg::with_name("url") diff --git a/gen/compute1/Cargo.toml b/gen/compute1/Cargo.toml index e2d9d7a420..2923674760 100644 --- a/gen/compute1/Cargo.toml +++ b/gen/compute1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-compute1" -version = "1.0.12+20190618" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with compute (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/compute1" homepage = "https://developers.google.com/compute/docs/reference/latest/" -documentation = "https://docs.rs/google-compute1/1.0.12+20190618" +documentation = "https://docs.rs/google-compute1/1.0.13+20200311" license = "MIT" keywords = ["compute", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/compute1/README.md b/gen/compute1/README.md index 5743f5d821..8b3217db65 100644 --- a/gen/compute1/README.md +++ b/gen/compute1/README.md @@ -5,136 +5,154 @@ DO NOT EDIT ! --> The `google-compute1` library allows access to all features of the *Google compute* service. -This documentation was generated from *compute* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *compute* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *compute* *v1* API can be found at the [official documentation site](https://developers.google.com/compute/docs/reference/latest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Compute.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Compute.html) ... -* [accelerator types](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AcceleratorType.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AcceleratorTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AcceleratorTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AcceleratorTypeListCall.html) +* [accelerator types](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AcceleratorType.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AcceleratorTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AcceleratorTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AcceleratorTypeListCall.html) * addresses - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AddresseAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AddresseDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AddresseGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AddresseInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AddresseListCall.html) -* [autoscalers](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Autoscaler.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AutoscalerAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AutoscalerDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AutoscalerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AutoscalerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AutoscalerListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AutoscalerPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.AutoscalerUpdateCall.html) -* [backend buckets](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucket.html) - * [*add signed url key*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketAddSignedUrlKeyCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketDeleteCall.html), [*delete signed url key*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketDeleteSignedUrlKeyCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendBucketUpdateCall.html) -* [backend services](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendService.html) - * [*add signed url key*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceAddSignedUrlKeyCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceDeleteCall.html), [*delete signed url key*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceDeleteSignedUrlKeyCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceGetCall.html), [*get health*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceGetHealthCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServicePatchCall.html), [*set security policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceSetSecurityPolicyCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.BackendServiceUpdateCall.html) -* [disk types](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskType.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskTypeListCall.html) -* [disks](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Disk.html) - * [*add resource policies*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskAddResourcePolicyCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskAggregatedListCall.html), [*create snapshot*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskCreateSnapshotCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskListCall.html), [*remove resource policies*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskRemoveResourcePolicyCall.html), [*resize*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskResizeCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.DiskTestIamPermissionCall.html) -* [firewalls](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Firewall.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.FirewallDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.FirewallGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.FirewallInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.FirewallListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.FirewallPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.FirewallUpdateCall.html) -* [forwarding rules](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ForwardingRule.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ForwardingRuleAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ForwardingRuleDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ForwardingRuleGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ForwardingRuleInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ForwardingRuleListCall.html) and [*set target*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ForwardingRuleSetTargetCall.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AddresseAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AddresseDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AddresseGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AddresseInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AddresseListCall.html) +* [autoscalers](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Autoscaler.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AutoscalerAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AutoscalerDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AutoscalerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AutoscalerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AutoscalerListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AutoscalerPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.AutoscalerUpdateCall.html) +* [backend buckets](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucket.html) + * [*add signed url key*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketAddSignedUrlKeyCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketDeleteCall.html), [*delete signed url key*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketDeleteSignedUrlKeyCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendBucketUpdateCall.html) +* [backend services](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendService.html) + * [*add signed url key*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceAddSignedUrlKeyCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceDeleteCall.html), [*delete signed url key*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceDeleteSignedUrlKeyCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceGetCall.html), [*get health*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceGetHealthCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServicePatchCall.html), [*set security policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceSetSecurityPolicyCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.BackendServiceUpdateCall.html) +* [disk types](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskType.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskTypeListCall.html) +* [disks](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Disk.html) + * [*add resource policies*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskAddResourcePolicyCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskAggregatedListCall.html), [*create snapshot*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskCreateSnapshotCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskListCall.html), [*remove resource policies*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskRemoveResourcePolicyCall.html), [*resize*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskResizeCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.DiskTestIamPermissionCall.html) +* [external vpn gateways](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ExternalVpnGateway.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ExternalVpnGatewayDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ExternalVpnGatewayGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ExternalVpnGatewayInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ExternalVpnGatewayListCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ExternalVpnGatewaySetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ExternalVpnGatewayTestIamPermissionCall.html) +* [firewalls](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Firewall.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.FirewallDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.FirewallGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.FirewallInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.FirewallListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.FirewallPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.FirewallUpdateCall.html) +* [forwarding rules](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRule.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRuleAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRuleDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRuleGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRuleInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRuleListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRulePatchCall.html) and [*set target*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ForwardingRuleSetTargetCall.html) * global addresses - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalAddresseDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalAddresseGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalAddresseInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalAddresseListCall.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalAddresseDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalAddresseGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalAddresseInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalAddresseListCall.html) * global forwarding rules - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalForwardingRuleDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalForwardingRuleGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalForwardingRuleInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalForwardingRuleListCall.html) and [*set target*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalForwardingRuleSetTargetCall.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalForwardingRuleDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalForwardingRuleGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalForwardingRuleInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalForwardingRuleListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalForwardingRulePatchCall.html) and [*set target*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalForwardingRuleSetTargetCall.html) +* global network endpoint groups + * [*attach network endpoints*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalNetworkEndpointGroupAttachNetworkEndpointCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalNetworkEndpointGroupDeleteCall.html), [*detach network endpoints*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalNetworkEndpointGroupDetachNetworkEndpointCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalNetworkEndpointGroupGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalNetworkEndpointGroupInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalNetworkEndpointGroupListCall.html) and [*list network endpoints*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalNetworkEndpointGroupListNetworkEndpointCall.html) * global operations - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalOperationAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalOperationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalOperationGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.GlobalOperationListCall.html) -* [health checks](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HealthCheck.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HealthCheckDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HealthCheckGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HealthCheckInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HealthCheckListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HealthCheckPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HealthCheckUpdateCall.html) -* [http health checks](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpHealthCheck.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpHealthCheckDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpHealthCheckGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpHealthCheckInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpHealthCheckListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpHealthCheckPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpHealthCheckUpdateCall.html) -* [https health checks](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpsHealthCheck.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpsHealthCheckDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpsHealthCheckGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpsHealthCheckInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpsHealthCheckListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpsHealthCheckPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.HttpsHealthCheckUpdateCall.html) -* [images](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Image.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageDeleteCall.html), [*deprecate*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageDeprecateCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageGetCall.html), [*get from family*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageGetFromFamilyCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ImageTestIamPermissionCall.html) -* [instance group managers](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManager.html) - * [*abandon instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerAbandonInstanceCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerListCall.html), [*list managed instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerListManagedInstanceCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerPatchCall.html), [*recreate instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerResizeCall.html), [*set instance template*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupManagerSetTargetPoolCall.html) -* [instance groups](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroup.html) - * [*add instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupAddInstanceCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupListCall.html), [*list instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupListInstanceCall.html), [*remove instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupRemoveInstanceCall.html) and [*set named ports*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGroupSetNamedPortCall.html) -* [instance templates](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplate.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplateDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplateGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplateGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplateInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplateListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplateSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTemplateTestIamPermissionCall.html) -* [instances](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Instance.html) - * [*add access config*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceAddAccessConfigCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceAggregatedListCall.html), [*attach disk*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceAttachDiskCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceDeleteCall.html), [*delete access config*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceDeleteAccessConfigCall.html), [*detach disk*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceDetachDiskCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGetCall.html), [*get guest attributes*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGetGuestAttributeCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGetIamPolicyCall.html), [*get serial port output*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGetSerialPortOutputCall.html), [*get shielded instance identity*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceGetShieldedInstanceIdentityCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceListCall.html), [*list referrers*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceListReferrerCall.html), [*reset*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceResetCall.html), [*set deletion protection*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetDeletionProtectionCall.html), [*set disk auto delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetDiskAutoDeleteCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetLabelCall.html), [*set machine resources*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetMachineResourceCall.html), [*set machine type*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetMachineTypeCall.html), [*set metadata*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetMetadataCall.html), [*set min cpu platform*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetMinCpuPlatformCall.html), [*set scheduling*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetSchedulingCall.html), [*set service account*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetServiceAccountCall.html), [*set shielded instance integrity policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html), [*set tags*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSetTagCall.html), [*simulate maintenance event*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceSimulateMaintenanceEventCall.html), [*start*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceStartCall.html), [*start with encryption key*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceStartWithEncryptionKeyCall.html), [*stop*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceStopCall.html), [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceTestIamPermissionCall.html), [*update access config*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceUpdateAccessConfigCall.html), [*update network interface*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceUpdateNetworkInterfaceCall.html) and [*update shielded instance config*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InstanceUpdateShieldedInstanceConfigCall.html) -* [interconnect attachments](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectAttachment.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectAttachmentAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectAttachmentDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectAttachmentGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectAttachmentInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectAttachmentListCall.html) and [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectAttachmentPatchCall.html) -* [interconnect locations](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectLocation.html) - * [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectLocationGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectLocationListCall.html) -* [interconnects](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Interconnect.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectGetCall.html), [*get diagnostics*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectGetDiagnosticCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectListCall.html) and [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.InterconnectPatchCall.html) -* [license codes](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseCode.html) - * [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseCodeGetCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseCodeTestIamPermissionCall.html) -* [licenses](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.License.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.LicenseTestIamPermissionCall.html) -* [machine types](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.MachineType.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.MachineTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.MachineTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.MachineTypeListCall.html) -* [network endpoint groups](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroup.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupAggregatedListCall.html), [*attach network endpoints*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupAttachNetworkEndpointCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupDeleteCall.html), [*detach network endpoints*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupDetachNetworkEndpointCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupListCall.html), [*list network endpoints*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupListNetworkEndpointCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkEndpointGroupTestIamPermissionCall.html) -* [networks](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Network.html) - * [*add peering*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkAddPeeringCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkPatchCall.html), [*remove peering*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkRemovePeeringCall.html) and [*switch to custom mode*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NetworkSwitchToCustomModeCall.html) -* [node groups](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroup.html) - * [*add nodes*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupAddNodeCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupDeleteCall.html), [*delete nodes*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupDeleteNodeCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupListCall.html), [*list nodes*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupListNodeCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupSetIamPolicyCall.html), [*set node template*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupSetNodeTemplateCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeGroupTestIamPermissionCall.html) -* [node templates](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplate.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTemplateTestIamPermissionCall.html) -* [node types](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeType.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.NodeTypeListCall.html) -* [projects](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Project.html) - * [*disable xpn host*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectDisableXpnHostCall.html), [*disable xpn resource*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectDisableXpnResourceCall.html), [*enable xpn host*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectEnableXpnHostCall.html), [*enable xpn resource*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectEnableXpnResourceCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectGetCall.html), [*get xpn host*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectGetXpnHostCall.html), [*get xpn resources*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectGetXpnResourceCall.html), [*list xpn hosts*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectListXpnHostCall.html), [*move disk*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectMoveDiskCall.html), [*move instance*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectMoveInstanceCall.html), [*set common instance metadata*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectSetCommonInstanceMetadataCall.html), [*set default network tier*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectSetDefaultNetworkTierCall.html) and [*set usage export bucket*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ProjectSetUsageExportBucketCall.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalOperationAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalOperationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalOperationGetCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalOperationListCall.html) and [*wait*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.GlobalOperationWaitCall.html) +* [health checks](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheck.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheckAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheckDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheckGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheckInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheckListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheckPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HealthCheckUpdateCall.html) +* [http health checks](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpHealthCheck.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpHealthCheckDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpHealthCheckGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpHealthCheckInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpHealthCheckListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpHealthCheckPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpHealthCheckUpdateCall.html) +* [https health checks](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpsHealthCheck.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpsHealthCheckDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpsHealthCheckGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpsHealthCheckInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpsHealthCheckListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpsHealthCheckPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.HttpsHealthCheckUpdateCall.html) +* [images](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Image.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageDeleteCall.html), [*deprecate*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageDeprecateCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageGetCall.html), [*get from family*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageGetFromFamilyCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ImageTestIamPermissionCall.html) +* [instance group managers](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManager.html) + * [*abandon instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerAbandonInstanceCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerAggregatedListCall.html), [*apply updates to instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerApplyUpdatesToInstanceCall.html), [*create instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerCreateInstanceCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerListCall.html), [*list errors*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerListErrorCall.html), [*list managed instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerListManagedInstanceCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerPatchCall.html), [*recreate instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerResizeCall.html), [*set instance template*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupManagerSetTargetPoolCall.html) +* [instance groups](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroup.html) + * [*add instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupAddInstanceCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupListCall.html), [*list instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupListInstanceCall.html), [*remove instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupRemoveInstanceCall.html) and [*set named ports*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGroupSetNamedPortCall.html) +* [instance templates](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplate.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplateDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplateGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplateGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplateInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplateListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplateSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTemplateTestIamPermissionCall.html) +* [instances](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Instance.html) + * [*add access config*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceAddAccessConfigCall.html), [*add resource policies*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceAddResourcePolicyCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceAggregatedListCall.html), [*attach disk*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceAttachDiskCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceDeleteCall.html), [*delete access config*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceDeleteAccessConfigCall.html), [*detach disk*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceDetachDiskCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGetCall.html), [*get guest attributes*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGetGuestAttributeCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGetIamPolicyCall.html), [*get serial port output*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGetSerialPortOutputCall.html), [*get shielded instance identity*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceGetShieldedInstanceIdentityCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceListCall.html), [*list referrers*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceListReferrerCall.html), [*remove resource policies*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceRemoveResourcePolicyCall.html), [*reset*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceResetCall.html), [*set deletion protection*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetDeletionProtectionCall.html), [*set disk auto delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetDiskAutoDeleteCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetLabelCall.html), [*set machine resources*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetMachineResourceCall.html), [*set machine type*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetMachineTypeCall.html), [*set metadata*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetMetadataCall.html), [*set min cpu platform*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetMinCpuPlatformCall.html), [*set scheduling*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetSchedulingCall.html), [*set service account*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetServiceAccountCall.html), [*set shielded instance integrity policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html), [*set tags*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSetTagCall.html), [*simulate maintenance event*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceSimulateMaintenanceEventCall.html), [*start*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceStartCall.html), [*start with encryption key*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceStartWithEncryptionKeyCall.html), [*stop*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceStopCall.html), [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceTestIamPermissionCall.html), [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceUpdateCall.html), [*update access config*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceUpdateAccessConfigCall.html), [*update display device*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceUpdateDisplayDeviceCall.html), [*update network interface*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceUpdateNetworkInterfaceCall.html) and [*update shielded instance config*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InstanceUpdateShieldedInstanceConfigCall.html) +* [interconnect attachments](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectAttachment.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectAttachmentAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectAttachmentDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectAttachmentGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectAttachmentInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectAttachmentListCall.html) and [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectAttachmentPatchCall.html) +* [interconnect locations](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectLocation.html) + * [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectLocationGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectLocationListCall.html) +* [interconnects](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Interconnect.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectGetCall.html), [*get diagnostics*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectGetDiagnosticCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectListCall.html) and [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.InterconnectPatchCall.html) +* [license codes](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseCode.html) + * [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseCodeGetCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseCodeTestIamPermissionCall.html) +* [licenses](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.License.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.LicenseTestIamPermissionCall.html) +* [machine types](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.MachineType.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.MachineTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.MachineTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.MachineTypeListCall.html) +* [network endpoint groups](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroup.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupAggregatedListCall.html), [*attach network endpoints*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupAttachNetworkEndpointCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupDeleteCall.html), [*detach network endpoints*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupDetachNetworkEndpointCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupListCall.html), [*list network endpoints*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupListNetworkEndpointCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkEndpointGroupTestIamPermissionCall.html) +* [networks](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Network.html) + * [*add peering*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkAddPeeringCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkListCall.html), [*list peering routes*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkListPeeringRouteCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkPatchCall.html), [*remove peering*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkRemovePeeringCall.html), [*switch to custom mode*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkSwitchToCustomModeCall.html) and [*update peering*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NetworkUpdatePeeringCall.html) +* [node groups](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroup.html) + * [*add nodes*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupAddNodeCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupDeleteCall.html), [*delete nodes*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupDeleteNodeCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupListCall.html), [*list nodes*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupListNodeCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupPatchCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupSetIamPolicyCall.html), [*set node template*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupSetNodeTemplateCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeGroupTestIamPermissionCall.html) +* [node templates](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplate.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTemplateTestIamPermissionCall.html) +* [node types](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeType.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTypeAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.NodeTypeListCall.html) +* [packet mirrorings](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroring.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroringAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroringDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroringGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroringInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroringListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroringPatchCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.PacketMirroringTestIamPermissionCall.html) +* [projects](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Project.html) + * [*disable xpn host*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectDisableXpnHostCall.html), [*disable xpn resource*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectDisableXpnResourceCall.html), [*enable xpn host*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectEnableXpnHostCall.html), [*enable xpn resource*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectEnableXpnResourceCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectGetCall.html), [*get xpn host*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectGetXpnHostCall.html), [*get xpn resources*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectGetXpnResourceCall.html), [*list xpn hosts*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectListXpnHostCall.html), [*move disk*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectMoveDiskCall.html), [*move instance*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectMoveInstanceCall.html), [*set common instance metadata*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectSetCommonInstanceMetadataCall.html), [*set default network tier*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectSetDefaultNetworkTierCall.html) and [*set usage export bucket*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ProjectSetUsageExportBucketCall.html) * region autoscalers - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionAutoscalerDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionAutoscalerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionAutoscalerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionAutoscalerListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionAutoscalerPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionAutoscalerUpdateCall.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionAutoscalerDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionAutoscalerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionAutoscalerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionAutoscalerListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionAutoscalerPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionAutoscalerUpdateCall.html) * region backend services - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionBackendServiceDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionBackendServiceGetCall.html), [*get health*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionBackendServiceGetHealthCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionBackendServiceInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionBackendServiceListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionBackendServicePatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionBackendServiceUpdateCall.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionBackendServiceDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionBackendServiceGetCall.html), [*get health*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionBackendServiceGetHealthCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionBackendServiceInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionBackendServiceListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionBackendServicePatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionBackendServiceUpdateCall.html) * region commitments - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionCommitmentAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionCommitmentGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionCommitmentInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionCommitmentListCall.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionCommitmentAggregatedListCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionCommitmentGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionCommitmentInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionCommitmentListCall.html) * region disk types - * [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskTypeListCall.html) + * [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskTypeGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskTypeListCall.html) * region disks - * [*add resource policies*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskAddResourcePolicyCall.html), [*create snapshot*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskCreateSnapshotCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskListCall.html), [*remove resource policies*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskRemoveResourcePolicyCall.html), [*resize*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskResizeCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionDiskTestIamPermissionCall.html) + * [*add resource policies*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskAddResourcePolicyCall.html), [*create snapshot*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskCreateSnapshotCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskListCall.html), [*remove resource policies*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskRemoveResourcePolicyCall.html), [*resize*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskResizeCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionDiskTestIamPermissionCall.html) +* region health checks + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionHealthCheckDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionHealthCheckGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionHealthCheckInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionHealthCheckListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionHealthCheckPatchCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionHealthCheckUpdateCall.html) * region instance group managers - * [*abandon instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerAbandonInstanceCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerDeleteCall.html), [*delete instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerDeleteInstanceCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerListCall.html), [*list managed instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerListManagedInstanceCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerPatchCall.html), [*recreate instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerRecreateInstanceCall.html), [*resize*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerResizeCall.html), [*set instance template*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupManagerSetTargetPoolCall.html) + * [*abandon instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerAbandonInstanceCall.html), [*apply updates to instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerApplyUpdatesToInstanceCall.html), [*create instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerCreateInstanceCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerDeleteCall.html), [*delete instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerDeleteInstanceCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerListCall.html), [*list errors*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerListErrorCall.html), [*list managed instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerListManagedInstanceCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerPatchCall.html), [*recreate instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerRecreateInstanceCall.html), [*resize*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerResizeCall.html), [*set instance template*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupManagerSetTargetPoolCall.html) * region instance groups - * [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupGetCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupListCall.html), [*list instances*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupListInstanceCall.html) and [*set named ports*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionInstanceGroupSetNamedPortCall.html) + * [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupGetCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupListCall.html), [*list instances*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupListInstanceCall.html) and [*set named ports*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionInstanceGroupSetNamedPortCall.html) * region operations - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionOperationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionOperationGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionOperationListCall.html) -* [regions](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Region.html) - * [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RegionListCall.html) -* [reservations](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Reservation.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationListCall.html), [*resize*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationResizeCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ReservationTestIamPermissionCall.html) -* [resource policies](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicy.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicyAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicyGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicyGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicyListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicySetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ResourcePolicyTestIamPermissionCall.html) -* [routers](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Router.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterGetCall.html), [*get nat mapping info*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterGetNatMappingInfoCall.html), [*get router status*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterGetRouterStatuCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterPatchCall.html), [*preview*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterPreviewCall.html) and [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouterUpdateCall.html) -* [routes](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Route.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouteDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouteGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouteInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.RouteListCall.html) -* [security policies](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicy.html) - * [*add rule*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyAddRuleCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyGetCall.html), [*get rule*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyGetRuleCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyPatchCall.html), [*patch rule*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyPatchRuleCall.html) and [*remove rule*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SecurityPolicyRemoveRuleCall.html) -* [snapshots](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Snapshot.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SnapshotDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SnapshotGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SnapshotGetIamPolicyCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SnapshotListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SnapshotSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SnapshotSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SnapshotTestIamPermissionCall.html) -* [ssl certificates](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslCertificate.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslCertificateDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslCertificateGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslCertificateInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslCertificateListCall.html) -* [ssl policies](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslPolicy.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslPolicyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslPolicyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslPolicyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslPolicyListCall.html), [*list available features*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslPolicyListAvailableFeatureCall.html) and [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SslPolicyPatchCall.html) -* [subnetworks](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Subnetwork.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkDeleteCall.html), [*expand ip cidr range*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkExpandIpCidrRangeCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkListCall.html), [*list usable*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkListUsableCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkPatchCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkSetIamPolicyCall.html), [*set private ip google access*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkSetPrivateIpGoogleAccesCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.SubnetworkTestIamPermissionCall.html) -* [target http proxies](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpProxy.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpProxyListCall.html) and [*set url map*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpProxySetUrlMapCall.html) -* [target https proxies](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxy.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxyListCall.html), [*set quic override*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxySetQuicOverrideCall.html), [*set ssl certificates*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxySetSslCertificateCall.html), [*set ssl policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxySetSslPolicyCall.html) and [*set url map*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetHttpsProxySetUrlMapCall.html) -* [target instances](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetInstance.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetInstanceAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetInstanceDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetInstanceGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetInstanceInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetInstanceListCall.html) -* [target pools](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPool.html) - * [*add health check*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolAddHealthCheckCall.html), [*add instance*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolAddInstanceCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolGetCall.html), [*get health*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolGetHealthCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolListCall.html), [*remove health check*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolRemoveHealthCheckCall.html), [*remove instance*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolRemoveInstanceCall.html) and [*set backup*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetPoolSetBackupCall.html) -* [target ssl proxies](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxy.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxyListCall.html), [*set backend service*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxySetBackendServiceCall.html), [*set proxy header*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxySetProxyHeaderCall.html), [*set ssl certificates*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxySetSslCertificateCall.html) and [*set ssl policy*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetSslProxySetSslPolicyCall.html) -* [target tcp proxies](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetTcpProxy.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetTcpProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetTcpProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetTcpProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetTcpProxyListCall.html), [*set backend service*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetTcpProxySetBackendServiceCall.html) and [*set proxy header*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetTcpProxySetProxyHeaderCall.html) -* [target vpn gateways](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetVpnGateway.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetVpnGatewayAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetVpnGatewayDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetVpnGatewayGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetVpnGatewayInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.TargetVpnGatewayListCall.html) -* [url maps](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMap.html) - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapInsertCall.html), [*invalidate cache*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapInvalidateCacheCall.html), [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapPatchCall.html), [*update*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapUpdateCall.html) and [*validate*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.UrlMapValidateCall.html) -* [vpn tunnels](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.VpnTunnel.html) - * [*aggregated list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.VpnTunnelAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.VpnTunnelDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.VpnTunnelGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.VpnTunnelInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.VpnTunnelListCall.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionOperationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionOperationGetCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionOperationListCall.html) and [*wait*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionOperationWaitCall.html) +* region ssl certificates + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionSslCertificateDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionSslCertificateGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionSslCertificateInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionSslCertificateListCall.html) +* region target http proxies + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpProxyListCall.html) and [*set url map*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpProxySetUrlMapCall.html) +* region target https proxies + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpsProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpsProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpsProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpsProxyListCall.html), [*set ssl certificates*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpsProxySetSslCertificateCall.html) and [*set url map*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionTargetHttpsProxySetUrlMapCall.html) +* region url maps + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionUrlMapDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionUrlMapGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionUrlMapInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionUrlMapListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionUrlMapPatchCall.html), [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionUrlMapUpdateCall.html) and [*validate*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionUrlMapValidateCall.html) +* [regions](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Region.html) + * [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RegionListCall.html) +* [reservations](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Reservation.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationListCall.html), [*resize*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationResizeCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ReservationTestIamPermissionCall.html) +* [resource policies](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicy.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicyAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicyGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicyGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicyListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicySetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ResourcePolicyTestIamPermissionCall.html) +* [routers](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Router.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterGetCall.html), [*get nat mapping info*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterGetNatMappingInfoCall.html), [*get router status*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterGetRouterStatuCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterPatchCall.html), [*preview*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterPreviewCall.html) and [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouterUpdateCall.html) +* [routes](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Route.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouteDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouteGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouteInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.RouteListCall.html) +* [security policies](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicy.html) + * [*add rule*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyAddRuleCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyGetCall.html), [*get rule*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyGetRuleCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyListCall.html), [*list preconfigured expression sets*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyListPreconfiguredExpressionSetCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyPatchCall.html), [*patch rule*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyPatchRuleCall.html) and [*remove rule*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SecurityPolicyRemoveRuleCall.html) +* [snapshots](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Snapshot.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SnapshotDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SnapshotGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SnapshotGetIamPolicyCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SnapshotListCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SnapshotSetIamPolicyCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SnapshotSetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SnapshotTestIamPermissionCall.html) +* [ssl certificates](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslCertificate.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslCertificateAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslCertificateDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslCertificateGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslCertificateInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslCertificateListCall.html) +* [ssl policies](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslPolicy.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslPolicyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslPolicyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslPolicyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslPolicyListCall.html), [*list available features*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslPolicyListAvailableFeatureCall.html) and [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SslPolicyPatchCall.html) +* [subnetworks](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Subnetwork.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkDeleteCall.html), [*expand ip cidr range*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkExpandIpCidrRangeCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkGetCall.html), [*get iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkGetIamPolicyCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkListCall.html), [*list usable*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkListUsableCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkPatchCall.html), [*set iam policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkSetIamPolicyCall.html), [*set private ip google access*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkSetPrivateIpGoogleAccesCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.SubnetworkTestIamPermissionCall.html) +* [target http proxies](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpProxy.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpProxyAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpProxyListCall.html) and [*set url map*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpProxySetUrlMapCall.html) +* [target https proxies](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxy.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxyAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxyListCall.html), [*set quic override*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxySetQuicOverrideCall.html), [*set ssl certificates*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxySetSslCertificateCall.html), [*set ssl policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxySetSslPolicyCall.html) and [*set url map*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetHttpsProxySetUrlMapCall.html) +* [target instances](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetInstance.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetInstanceAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetInstanceDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetInstanceGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetInstanceInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetInstanceListCall.html) +* [target pools](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPool.html) + * [*add health check*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolAddHealthCheckCall.html), [*add instance*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolAddInstanceCall.html), [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolGetCall.html), [*get health*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolGetHealthCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolListCall.html), [*remove health check*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolRemoveHealthCheckCall.html), [*remove instance*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolRemoveInstanceCall.html) and [*set backup*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetPoolSetBackupCall.html) +* [target ssl proxies](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxy.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxyListCall.html), [*set backend service*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxySetBackendServiceCall.html), [*set proxy header*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxySetProxyHeaderCall.html), [*set ssl certificates*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxySetSslCertificateCall.html) and [*set ssl policy*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetSslProxySetSslPolicyCall.html) +* [target tcp proxies](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetTcpProxy.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetTcpProxyDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetTcpProxyGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetTcpProxyInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetTcpProxyListCall.html), [*set backend service*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetTcpProxySetBackendServiceCall.html) and [*set proxy header*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetTcpProxySetProxyHeaderCall.html) +* [target vpn gateways](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetVpnGateway.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetVpnGatewayAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetVpnGatewayDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetVpnGatewayGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetVpnGatewayInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.TargetVpnGatewayListCall.html) +* [url maps](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMap.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapInsertCall.html), [*invalidate cache*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapInvalidateCacheCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapListCall.html), [*patch*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapPatchCall.html), [*update*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapUpdateCall.html) and [*validate*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.UrlMapValidateCall.html) +* [vpn gateways](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGateway.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewayAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewayDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewayGetCall.html), [*get status*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewayGetStatuCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewayInsertCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewayListCall.html), [*set labels*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewaySetLabelCall.html) and [*test iam permissions*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnGatewayTestIamPermissionCall.html) +* [vpn tunnels](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnTunnel.html) + * [*aggregated list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnTunnelAggregatedListCall.html), [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnTunnelDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnTunnelGetCall.html), [*insert*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnTunnelInsertCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.VpnTunnelListCall.html) * zone operations - * [*delete*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ZoneOperationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ZoneOperationListCall.html) -* [zones](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Zone.html) - * [*get*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ZoneGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.ZoneListCall.html) + * [*delete*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ZoneOperationDeleteCall.html), [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ZoneOperationGetCall.html), [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ZoneOperationListCall.html) and [*wait*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ZoneOperationWaitCall.html) +* [zones](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Zone.html) + * [*get*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ZoneGetCall.html) and [*list*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.ZoneListCall.html) @@ -143,17 +161,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/struct.Compute.html)** +* **[Hub](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/struct.Compute.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.Part.html)** + * **[Parts](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -168,136 +186,167 @@ Or specifically ... ```ignore let r = hub.backend_buckets().delete(...).doit() -let r = hub.target_ssl_proxies().set_ssl_policy(...).doit() +let r = hub.instance_group_managers().resize(...).doit() let r = hub.ssl_certificates().delete(...).doit() let r = hub.region_disks().resize(...).doit() let r = hub.autoscalers().patch(...).doit() -let r = hub.instance_group_managers().resize(...).doit() -let r = hub.instance_templates().delete(...).doit() +let r = hub.external_vpn_gateways().insert(...).doit() +let r = hub.images().delete(...).doit() +let r = hub.region_autoscalers().delete(...).doit() +let r = hub.images().deprecate(...).doit() let r = hub.region_instance_group_managers().patch(...).doit() -let r = hub.url_maps().update(...).doit() let r = hub.region_backend_services().delete(...).doit() let r = hub.interconnects().delete(...).doit() let r = hub.instances().update_shielded_instance_config(...).doit() -let r = hub.region_disks().add_resource_policies(...).doit() +let r = hub.region_url_maps().insert(...).doit() +let r = hub.firewalls().patch(...).doit() let r = hub.vpn_tunnels().delete(...).doit() let r = hub.region_disks().set_labels(...).doit() +let r = hub.region_operations().wait(...).doit() let r = hub.instances().set_machine_type(...).doit() -let r = hub.https_health_checks().delete(...).doit() +let r = hub.global_forwarding_rules().set_target(...).doit() +let r = hub.instance_groups().set_named_ports(...).doit() let r = hub.node_groups().delete(...).doit() let r = hub.ssl_policies().delete(...).doit() let r = hub.ssl_policies().insert(...).doit() let r = hub.projects().disable_xpn_host(...).doit() +let r = hub.region_instance_group_managers().resize(...).doit() let r = hub.instances().set_service_account(...).doit() let r = hub.global_forwarding_rules().delete(...).doit() let r = hub.vpn_tunnels().insert(...).doit() let r = hub.disks().delete(...).doit() -let r = hub.networks().insert(...).doit() +let r = hub.region_disks().insert(...).doit() +let r = hub.instance_groups().add_instances(...).doit() let r = hub.disks().add_resource_policies(...).doit() +let r = hub.subnetworks().insert(...).doit() let r = hub.health_checks().patch(...).doit() let r = hub.instances().set_scheduling(...).doit() let r = hub.instances().delete(...).doit() let r = hub.target_pools().add_health_check(...).doit() let r = hub.instance_group_managers().insert(...).doit() let r = hub.global_addresses().insert(...).doit() +let r = hub.health_checks().update(...).doit() let r = hub.target_ssl_proxies().set_ssl_certificates(...).doit() -let r = hub.global_forwarding_rules().set_target(...).doit() +let r = hub.https_health_checks().delete(...).doit() +let r = hub.zone_operations().wait(...).doit() let r = hub.autoscalers().insert(...).doit() +let r = hub.networks().update_peering(...).doit() +let r = hub.snapshots().delete(...).doit() let r = hub.security_policies().add_rule(...).doit() -let r = hub.instance_groups().insert(...).doit() -let r = hub.subnetworks().insert(...).doit() +let r = hub.instance_group_managers().delete_instances(...).doit() let r = hub.routes().insert(...).doit() let r = hub.disks().resize(...).doit() -let r = hub.target_tcp_proxies().delete(...).doit() +let r = hub.node_templates().insert(...).doit() let r = hub.target_ssl_proxies().set_backend_service(...).doit() +let r = hub.target_vpn_gateways().insert(...).doit() let r = hub.projects().set_default_network_tier(...).doit() let r = hub.instance_group_managers().set_instance_template(...).doit() let r = hub.node_groups().set_node_template(...).doit() let r = hub.resource_policies().delete(...).doit() -let r = hub.region_autoscalers().delete(...).doit() +let r = hub.security_policies().insert(...).doit() let r = hub.networks().remove_peering(...).doit() +let r = hub.region_target_https_proxies().delete(...).doit() let r = hub.ssl_policies().patch(...).doit() let r = hub.interconnect_attachments().delete(...).doit() -let r = hub.firewalls().patch(...).doit() +let r = hub.region_target_https_proxies().insert(...).doit() let r = hub.target_pools().insert(...).doit() -let r = hub.node_templates().insert(...).doit() +let r = hub.target_tcp_proxies().delete(...).doit() let r = hub.projects().disable_xpn_resource(...).doit() +let r = hub.global_network_endpoint_groups().delete(...).doit() +let r = hub.region_disks().add_resource_policies(...).doit() let r = hub.instances().set_disk_auto_delete(...).doit() let r = hub.region_instance_group_managers().recreate_instances(...).doit() let r = hub.instance_group_managers().set_target_pools(...).doit() let r = hub.disks().insert(...).doit() let r = hub.target_ssl_proxies().delete(...).doit() +let r = hub.autoscalers().update(...).doit() let r = hub.region_backend_services().insert(...).doit() let r = hub.https_health_checks().insert(...).doit() let r = hub.instances().simulate_maintenance_event(...).doit() let r = hub.target_pools().remove_health_check(...).doit() let r = hub.backend_buckets().add_signed_url_key(...).doit() +let r = hub.region_instance_group_managers().create_instances(...).doit() let r = hub.target_https_proxies().set_url_map(...).doit() let r = hub.region_disks().create_snapshot(...).doit() let r = hub.backend_services().delete(...).doit() +let r = hub.region_target_http_proxies().set_url_map(...).doit() let r = hub.instances().update_network_interface(...).doit() let r = hub.url_maps().insert(...).doit() let r = hub.instances().add_access_config(...).doit() let r = hub.instances().set_machine_resources(...).doit() +let r = hub.region_instance_group_managers().apply_updates_to_instances(...).doit() let r = hub.instances().update_access_config(...).doit() -let r = hub.security_policies().insert(...).doit() +let r = hub.networks().delete(...).doit() let r = hub.addresses().insert(...).doit() let r = hub.health_checks().insert(...).doit() let r = hub.global_forwarding_rules().insert(...).doit() let r = hub.target_https_proxies().delete(...).doit() +let r = hub.instances().update(...).doit() let r = hub.target_tcp_proxies().insert(...).doit() +let r = hub.global_network_endpoint_groups().detach_network_endpoints(...).doit() let r = hub.global_operations().get(...).doit() +let r = hub.region_url_maps().update(...).doit() let r = hub.addresses().delete(...).doit() -let r = hub.target_vpn_gateways().insert(...).doit() +let r = hub.region_target_http_proxies().delete(...).doit() let r = hub.target_tcp_proxies().set_backend_service(...).doit() let r = hub.disks().create_snapshot(...).doit() -let r = hub.health_checks().update(...).doit() +let r = hub.region_url_maps().patch(...).doit() let r = hub.instance_groups().remove_instances(...).doit() -let r = hub.instances().set_metadata(...).doit() +let r = hub.snapshots().set_labels(...).doit() +let r = hub.region_health_checks().delete(...).doit() let r = hub.region_commitments().insert(...).doit() let r = hub.backend_services().add_signed_url_key(...).doit() -let r = hub.forwarding_rules().insert(...).doit() +let r = hub.region_target_https_proxies().set_url_map(...).doit() let r = hub.instances().start(...).doit() +let r = hub.vpn_gateways().insert(...).doit() let r = hub.instance_group_managers().delete(...).doit() let r = hub.instances().set_deletion_protection(...).doit() let r = hub.subnetworks().expand_ip_cidr_range(...).doit() -let r = hub.target_https_proxies().set_quic_override(...).doit() +let r = hub.interconnects().insert(...).doit() let r = hub.projects().move_disk(...).doit() -let r = hub.interconnects().patch(...).doit() +let r = hub.region_autoscalers().patch(...).doit() let r = hub.firewalls().insert(...).doit() +let r = hub.global_forwarding_rules().patch(...).doit() let r = hub.disks().set_labels(...).doit() let r = hub.target_pools().set_backup(...).doit() -let r = hub.instance_group_managers().delete_instances(...).doit() let r = hub.backend_services().set_security_policy(...).doit() let r = hub.region_instance_group_managers().delete_instances(...).doit() let r = hub.instances().detach_disk(...).doit() -let r = hub.region_disks().insert(...).doit() +let r = hub.routers().update(...).doit() let r = hub.instance_groups().delete(...).doit() let r = hub.instances().delete_access_config(...).doit() let r = hub.target_https_proxies().set_ssl_certificates(...).doit() -let r = hub.instance_groups().add_instances(...).doit() +let r = hub.networks().insert(...).doit() +let r = hub.instances().update_display_device(...).doit() let r = hub.instance_group_managers().abandon_instances(...).doit() let r = hub.instances().set_tags(...).doit() let r = hub.network_endpoint_groups().attach_network_endpoints(...).doit() let r = hub.reservations().resize(...).doit() -let r = hub.snapshots().delete(...).doit() +let r = hub.instances().set_metadata(...).doit() let r = hub.target_https_proxies().insert(...).doit() -let r = hub.reservations().insert(...).doit() +let r = hub.instance_group_managers().create_instances(...).doit() +let r = hub.node_groups().add_nodes(...).doit() +let r = hub.forwarding_rules().set_target(...).doit() let r = hub.target_tcp_proxies().set_proxy_header(...).doit() let r = hub.backend_services().update(...).doit() let r = hub.disks().remove_resource_policies(...).doit() let r = hub.node_groups().delete_nodes(...).doit() +let r = hub.instance_groups().insert(...).doit() +let r = hub.vpn_gateways().delete(...).doit() +let r = hub.region_url_maps().delete(...).doit() let r = hub.licenses().delete(...).doit() let r = hub.region_disks().remove_resource_policies(...).doit() let r = hub.instance_group_managers().patch(...).doit() -let r = hub.subnetworks().patch(...).doit() +let r = hub.global_network_endpoint_groups().insert(...).doit() +let r = hub.instance_group_managers().recreate_instances(...).doit() +let r = hub.reservations().insert(...).doit() let r = hub.reservations().delete(...).doit() let r = hub.target_https_proxies().set_ssl_policy(...).doit() -let r = hub.instances().attach_disk(...).doit() +let r = hub.target_ssl_proxies().set_ssl_policy(...).doit() let r = hub.projects().set_common_instance_metadata(...).doit() let r = hub.node_templates().delete(...).doit() let r = hub.region_operations().get(...).doit() -let r = hub.node_groups().add_nodes(...).doit() +let r = hub.instances().add_resource_policies(...).doit() let r = hub.backend_buckets().insert(...).doit() let r = hub.node_groups().insert(...).doit() let r = hub.licenses().insert(...).doit() @@ -305,26 +354,29 @@ let r = hub.backend_services().patch(...).doit() let r = hub.target_http_proxies().set_url_map(...).doit() let r = hub.network_endpoint_groups().delete(...).doit() let r = hub.region_instance_group_managers().delete(...).doit() -let r = hub.images().deprecate(...).doit() +let r = hub.region_health_checks().patch(...).doit() let r = hub.http_health_checks().patch(...).doit() -let r = hub.region_autoscalers().insert(...).doit() let r = hub.security_policies().patch_rule(...).doit() +let r = hub.instance_templates().insert(...).doit() +let r = hub.forwarding_rules().insert(...).doit() let r = hub.interconnect_attachments().patch(...).doit() let r = hub.images().insert(...).doit() let r = hub.backend_buckets().delete_signed_url_key(...).doit() let r = hub.url_maps().invalidate_cache(...).doit() -let r = hub.instance_groups().set_named_ports(...).doit() +let r = hub.region_backend_services().patch(...).doit() let r = hub.ssl_certificates().insert(...).doit() -let r = hub.interconnects().insert(...).doit() +let r = hub.instances().remove_resource_policies(...).doit() let r = hub.networks().switch_to_custom_mode(...).doit() -let r = hub.projects().enable_xpn_resource(...).doit() +let r = hub.global_operations().wait(...).doit() let r = hub.projects().move_instance(...).doit() +let r = hub.region_target_http_proxies().insert(...).doit() let r = hub.security_policies().patch(...).doit() let r = hub.autoscalers().delete(...).doit() -let r = hub.snapshots().set_labels(...).doit() -let r = hub.instance_group_managers().recreate_instances(...).doit() +let r = hub.region_instance_group_managers().set_target_pools(...).doit() +let r = hub.region_health_checks().update(...).doit() +let r = hub.subnetworks().patch(...).doit() let r = hub.https_health_checks().update(...).doit() -let r = hub.region_autoscalers().patch(...).doit() +let r = hub.region_ssl_certificates().delete(...).doit() let r = hub.url_maps().patch(...).doit() let r = hub.subnetworks().delete(...).doit() let r = hub.region_disks().delete(...).doit() @@ -332,52 +384,62 @@ let r = hub.instances().stop(...).doit() let r = hub.target_pools().add_instance(...).doit() let r = hub.target_pools().remove_instance(...).doit() let r = hub.network_endpoint_groups().detach_network_endpoints(...).doit() +let r = hub.region_target_https_proxies().set_ssl_certificates(...).doit() let r = hub.target_pools().delete(...).doit() let r = hub.firewalls().update(...).doit() let r = hub.instances().insert(...).doit() let r = hub.projects().set_usage_export_bucket(...).doit() -let r = hub.region_backend_services().patch(...).doit() +let r = hub.region_autoscalers().insert(...).doit() let r = hub.images().set_labels(...).doit() -let r = hub.target_instances().insert(...).doit() +let r = hub.packet_mirrorings().patch(...).doit() +let r = hub.node_groups().patch(...).doit() let r = hub.target_http_proxies().insert(...).doit() let r = hub.interconnect_attachments().insert(...).doit() let r = hub.networks().patch(...).doit() let r = hub.resource_policies().insert(...).doit() let r = hub.security_policies().remove_rule(...).doit() let r = hub.region_instance_groups().set_named_ports(...).doit() -let r = hub.instance_templates().insert(...).doit() +let r = hub.backend_services().insert(...).doit() +let r = hub.external_vpn_gateways().set_labels(...).doit() let r = hub.target_instances().delete(...).doit() +let r = hub.instance_templates().delete(...).doit() let r = hub.region_instance_group_managers().set_instance_template(...).doit() let r = hub.projects().enable_xpn_host(...).doit() -let r = hub.forwarding_rules().set_target(...).doit() +let r = hub.global_network_endpoint_groups().attach_network_endpoints(...).doit() +let r = hub.target_https_proxies().set_quic_override(...).doit() let r = hub.routers().delete(...).doit() -let r = hub.region_instance_group_managers().resize(...).doit() +let r = hub.forwarding_rules().patch(...).doit() let r = hub.target_vpn_gateways().delete(...).doit() +let r = hub.external_vpn_gateways().delete(...).doit() let r = hub.health_checks().delete(...).doit() -let r = hub.backend_services().insert(...).doit() let r = hub.instances().set_labels(...).doit() let r = hub.region_backend_services().update(...).doit() +let r = hub.interconnects().patch(...).doit() let r = hub.instances().set_shielded_instance_integrity_policy(...).doit() let r = hub.target_http_proxies().delete(...).doit() let r = hub.backend_buckets().patch(...).doit() let r = hub.global_addresses().delete(...).doit() +let r = hub.instance_group_managers().apply_updates_to_instances(...).doit() let r = hub.https_health_checks().patch(...).doit() -let r = hub.networks().delete(...).doit() +let r = hub.url_maps().update(...).doit() let r = hub.url_maps().delete(...).doit() let r = hub.routers().insert(...).doit() let r = hub.instances().reset(...).doit() -let r = hub.routers().update(...).doit() +let r = hub.region_health_checks().insert(...).doit() let r = hub.routers().patch(...).doit() let r = hub.networks().add_peering(...).doit() let r = hub.security_policies().delete(...).doit() +let r = hub.vpn_gateways().set_labels(...).doit() let r = hub.target_ssl_proxies().set_proxy_header(...).doit() let r = hub.http_health_checks().delete(...).doit() +let r = hub.target_instances().insert(...).doit() let r = hub.http_health_checks().insert(...).doit() -let r = hub.images().delete(...).doit() +let r = hub.instances().attach_disk(...).doit() let r = hub.region_instance_group_managers().abandon_instances(...).doit() +let r = hub.packet_mirrorings().insert(...).doit() let r = hub.subnetworks().set_private_ip_google_access(...).doit() -let r = hub.autoscalers().update(...).doit() -let r = hub.region_instance_group_managers().set_target_pools(...).doit() +let r = hub.projects().enable_xpn_resource(...).doit() +let r = hub.region_ssl_certificates().insert(...).doit() let r = hub.region_autoscalers().update(...).doit() let r = hub.target_ssl_proxies().insert(...).doit() let r = hub.instances().start_with_encryption_key(...).doit() @@ -385,6 +447,7 @@ let r = hub.instances().set_min_cpu_platform(...).doit() let r = hub.forwarding_rules().delete(...).doit() let r = hub.network_endpoint_groups().insert(...).doit() let r = hub.backend_buckets().update(...).doit() +let r = hub.packet_mirrorings().delete(...).doit() let r = hub.region_instance_group_managers().insert(...).doit() let r = hub.firewalls().delete(...).doit() let r = hub.zone_operations().get(...).doit() @@ -424,6 +487,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_compute1 as compute1; +use compute1::Instance; use compute1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -441,11 +505,18 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Instance::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.instances().set_disk_auto_delete("project", "zone", "instance", true, "deviceName") - .request_id("dolores") +let result = hub.instances().update(req, "project", "zone", "instance") + .request_id("sed") + .most_disruptive_allowed_action("et") + .minimal_action("dolores") .doit(); match result { @@ -468,17 +539,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -488,29 +559,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-compute1/1.0.12+20190618/google_compute1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-compute1/1.0.13+20200311/google_compute1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/compute1/src/lib.rs b/gen/compute1/src/lib.rs index 44c14aa0a1..45aae69b82 100644 --- a/gen/compute1/src/lib.rs +++ b/gen/compute1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *compute* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *compute* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *compute:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *compute* *v1* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/reference/latest/). @@ -25,18 +25,22 @@ //! * [*aggregated list*](struct.DiskTypeAggregatedListCall.html), [*get*](struct.DiskTypeGetCall.html) and [*list*](struct.DiskTypeListCall.html) //! * [disks](struct.Disk.html) //! * [*add resource policies*](struct.DiskAddResourcePolicyCall.html), [*aggregated list*](struct.DiskAggregatedListCall.html), [*create snapshot*](struct.DiskCreateSnapshotCall.html), [*delete*](struct.DiskDeleteCall.html), [*get*](struct.DiskGetCall.html), [*get iam policy*](struct.DiskGetIamPolicyCall.html), [*insert*](struct.DiskInsertCall.html), [*list*](struct.DiskListCall.html), [*remove resource policies*](struct.DiskRemoveResourcePolicyCall.html), [*resize*](struct.DiskResizeCall.html), [*set iam policy*](struct.DiskSetIamPolicyCall.html), [*set labels*](struct.DiskSetLabelCall.html) and [*test iam permissions*](struct.DiskTestIamPermissionCall.html) +//! * [external vpn gateways](struct.ExternalVpnGateway.html) +//! * [*delete*](struct.ExternalVpnGatewayDeleteCall.html), [*get*](struct.ExternalVpnGatewayGetCall.html), [*insert*](struct.ExternalVpnGatewayInsertCall.html), [*list*](struct.ExternalVpnGatewayListCall.html), [*set labels*](struct.ExternalVpnGatewaySetLabelCall.html) and [*test iam permissions*](struct.ExternalVpnGatewayTestIamPermissionCall.html) //! * [firewalls](struct.Firewall.html) //! * [*delete*](struct.FirewallDeleteCall.html), [*get*](struct.FirewallGetCall.html), [*insert*](struct.FirewallInsertCall.html), [*list*](struct.FirewallListCall.html), [*patch*](struct.FirewallPatchCall.html) and [*update*](struct.FirewallUpdateCall.html) //! * [forwarding rules](struct.ForwardingRule.html) -//! * [*aggregated list*](struct.ForwardingRuleAggregatedListCall.html), [*delete*](struct.ForwardingRuleDeleteCall.html), [*get*](struct.ForwardingRuleGetCall.html), [*insert*](struct.ForwardingRuleInsertCall.html), [*list*](struct.ForwardingRuleListCall.html) and [*set target*](struct.ForwardingRuleSetTargetCall.html) +//! * [*aggregated list*](struct.ForwardingRuleAggregatedListCall.html), [*delete*](struct.ForwardingRuleDeleteCall.html), [*get*](struct.ForwardingRuleGetCall.html), [*insert*](struct.ForwardingRuleInsertCall.html), [*list*](struct.ForwardingRuleListCall.html), [*patch*](struct.ForwardingRulePatchCall.html) and [*set target*](struct.ForwardingRuleSetTargetCall.html) //! * global addresses //! * [*delete*](struct.GlobalAddresseDeleteCall.html), [*get*](struct.GlobalAddresseGetCall.html), [*insert*](struct.GlobalAddresseInsertCall.html) and [*list*](struct.GlobalAddresseListCall.html) //! * global forwarding rules -//! * [*delete*](struct.GlobalForwardingRuleDeleteCall.html), [*get*](struct.GlobalForwardingRuleGetCall.html), [*insert*](struct.GlobalForwardingRuleInsertCall.html), [*list*](struct.GlobalForwardingRuleListCall.html) and [*set target*](struct.GlobalForwardingRuleSetTargetCall.html) +//! * [*delete*](struct.GlobalForwardingRuleDeleteCall.html), [*get*](struct.GlobalForwardingRuleGetCall.html), [*insert*](struct.GlobalForwardingRuleInsertCall.html), [*list*](struct.GlobalForwardingRuleListCall.html), [*patch*](struct.GlobalForwardingRulePatchCall.html) and [*set target*](struct.GlobalForwardingRuleSetTargetCall.html) +//! * global network endpoint groups +//! * [*attach network endpoints*](struct.GlobalNetworkEndpointGroupAttachNetworkEndpointCall.html), [*delete*](struct.GlobalNetworkEndpointGroupDeleteCall.html), [*detach network endpoints*](struct.GlobalNetworkEndpointGroupDetachNetworkEndpointCall.html), [*get*](struct.GlobalNetworkEndpointGroupGetCall.html), [*insert*](struct.GlobalNetworkEndpointGroupInsertCall.html), [*list*](struct.GlobalNetworkEndpointGroupListCall.html) and [*list network endpoints*](struct.GlobalNetworkEndpointGroupListNetworkEndpointCall.html) //! * global operations -//! * [*aggregated list*](struct.GlobalOperationAggregatedListCall.html), [*delete*](struct.GlobalOperationDeleteCall.html), [*get*](struct.GlobalOperationGetCall.html) and [*list*](struct.GlobalOperationListCall.html) +//! * [*aggregated list*](struct.GlobalOperationAggregatedListCall.html), [*delete*](struct.GlobalOperationDeleteCall.html), [*get*](struct.GlobalOperationGetCall.html), [*list*](struct.GlobalOperationListCall.html) and [*wait*](struct.GlobalOperationWaitCall.html) //! * [health checks](struct.HealthCheck.html) -//! * [*delete*](struct.HealthCheckDeleteCall.html), [*get*](struct.HealthCheckGetCall.html), [*insert*](struct.HealthCheckInsertCall.html), [*list*](struct.HealthCheckListCall.html), [*patch*](struct.HealthCheckPatchCall.html) and [*update*](struct.HealthCheckUpdateCall.html) +//! * [*aggregated list*](struct.HealthCheckAggregatedListCall.html), [*delete*](struct.HealthCheckDeleteCall.html), [*get*](struct.HealthCheckGetCall.html), [*insert*](struct.HealthCheckInsertCall.html), [*list*](struct.HealthCheckListCall.html), [*patch*](struct.HealthCheckPatchCall.html) and [*update*](struct.HealthCheckUpdateCall.html) //! * [http health checks](struct.HttpHealthCheck.html) //! * [*delete*](struct.HttpHealthCheckDeleteCall.html), [*get*](struct.HttpHealthCheckGetCall.html), [*insert*](struct.HttpHealthCheckInsertCall.html), [*list*](struct.HttpHealthCheckListCall.html), [*patch*](struct.HttpHealthCheckPatchCall.html) and [*update*](struct.HttpHealthCheckUpdateCall.html) //! * [https health checks](struct.HttpsHealthCheck.html) @@ -44,13 +48,13 @@ //! * [images](struct.Image.html) //! * [*delete*](struct.ImageDeleteCall.html), [*deprecate*](struct.ImageDeprecateCall.html), [*get*](struct.ImageGetCall.html), [*get from family*](struct.ImageGetFromFamilyCall.html), [*get iam policy*](struct.ImageGetIamPolicyCall.html), [*insert*](struct.ImageInsertCall.html), [*list*](struct.ImageListCall.html), [*set iam policy*](struct.ImageSetIamPolicyCall.html), [*set labels*](struct.ImageSetLabelCall.html) and [*test iam permissions*](struct.ImageTestIamPermissionCall.html) //! * [instance group managers](struct.InstanceGroupManager.html) -//! * [*abandon instances*](struct.InstanceGroupManagerAbandonInstanceCall.html), [*aggregated list*](struct.InstanceGroupManagerAggregatedListCall.html), [*delete*](struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](struct.InstanceGroupManagerGetCall.html), [*insert*](struct.InstanceGroupManagerInsertCall.html), [*list*](struct.InstanceGroupManagerListCall.html), [*list managed instances*](struct.InstanceGroupManagerListManagedInstanceCall.html), [*patch*](struct.InstanceGroupManagerPatchCall.html), [*recreate instances*](struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](struct.InstanceGroupManagerResizeCall.html), [*set instance template*](struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](struct.InstanceGroupManagerSetTargetPoolCall.html) +//! * [*abandon instances*](struct.InstanceGroupManagerAbandonInstanceCall.html), [*aggregated list*](struct.InstanceGroupManagerAggregatedListCall.html), [*apply updates to instances*](struct.InstanceGroupManagerApplyUpdatesToInstanceCall.html), [*create instances*](struct.InstanceGroupManagerCreateInstanceCall.html), [*delete*](struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](struct.InstanceGroupManagerGetCall.html), [*insert*](struct.InstanceGroupManagerInsertCall.html), [*list*](struct.InstanceGroupManagerListCall.html), [*list errors*](struct.InstanceGroupManagerListErrorCall.html), [*list managed instances*](struct.InstanceGroupManagerListManagedInstanceCall.html), [*patch*](struct.InstanceGroupManagerPatchCall.html), [*recreate instances*](struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](struct.InstanceGroupManagerResizeCall.html), [*set instance template*](struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](struct.InstanceGroupManagerSetTargetPoolCall.html) //! * [instance groups](struct.InstanceGroup.html) //! * [*add instances*](struct.InstanceGroupAddInstanceCall.html), [*aggregated list*](struct.InstanceGroupAggregatedListCall.html), [*delete*](struct.InstanceGroupDeleteCall.html), [*get*](struct.InstanceGroupGetCall.html), [*insert*](struct.InstanceGroupInsertCall.html), [*list*](struct.InstanceGroupListCall.html), [*list instances*](struct.InstanceGroupListInstanceCall.html), [*remove instances*](struct.InstanceGroupRemoveInstanceCall.html) and [*set named ports*](struct.InstanceGroupSetNamedPortCall.html) //! * [instance templates](struct.InstanceTemplate.html) //! * [*delete*](struct.InstanceTemplateDeleteCall.html), [*get*](struct.InstanceTemplateGetCall.html), [*get iam policy*](struct.InstanceTemplateGetIamPolicyCall.html), [*insert*](struct.InstanceTemplateInsertCall.html), [*list*](struct.InstanceTemplateListCall.html), [*set iam policy*](struct.InstanceTemplateSetIamPolicyCall.html) and [*test iam permissions*](struct.InstanceTemplateTestIamPermissionCall.html) //! * [instances](struct.Instance.html) -//! * [*add access config*](struct.InstanceAddAccessConfigCall.html), [*aggregated list*](struct.InstanceAggregatedListCall.html), [*attach disk*](struct.InstanceAttachDiskCall.html), [*delete*](struct.InstanceDeleteCall.html), [*delete access config*](struct.InstanceDeleteAccessConfigCall.html), [*detach disk*](struct.InstanceDetachDiskCall.html), [*get*](struct.InstanceGetCall.html), [*get guest attributes*](struct.InstanceGetGuestAttributeCall.html), [*get iam policy*](struct.InstanceGetIamPolicyCall.html), [*get serial port output*](struct.InstanceGetSerialPortOutputCall.html), [*get shielded instance identity*](struct.InstanceGetShieldedInstanceIdentityCall.html), [*insert*](struct.InstanceInsertCall.html), [*list*](struct.InstanceListCall.html), [*list referrers*](struct.InstanceListReferrerCall.html), [*reset*](struct.InstanceResetCall.html), [*set deletion protection*](struct.InstanceSetDeletionProtectionCall.html), [*set disk auto delete*](struct.InstanceSetDiskAutoDeleteCall.html), [*set iam policy*](struct.InstanceSetIamPolicyCall.html), [*set labels*](struct.InstanceSetLabelCall.html), [*set machine resources*](struct.InstanceSetMachineResourceCall.html), [*set machine type*](struct.InstanceSetMachineTypeCall.html), [*set metadata*](struct.InstanceSetMetadataCall.html), [*set min cpu platform*](struct.InstanceSetMinCpuPlatformCall.html), [*set scheduling*](struct.InstanceSetSchedulingCall.html), [*set service account*](struct.InstanceSetServiceAccountCall.html), [*set shielded instance integrity policy*](struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html), [*set tags*](struct.InstanceSetTagCall.html), [*simulate maintenance event*](struct.InstanceSimulateMaintenanceEventCall.html), [*start*](struct.InstanceStartCall.html), [*start with encryption key*](struct.InstanceStartWithEncryptionKeyCall.html), [*stop*](struct.InstanceStopCall.html), [*test iam permissions*](struct.InstanceTestIamPermissionCall.html), [*update access config*](struct.InstanceUpdateAccessConfigCall.html), [*update network interface*](struct.InstanceUpdateNetworkInterfaceCall.html) and [*update shielded instance config*](struct.InstanceUpdateShieldedInstanceConfigCall.html) +//! * [*add access config*](struct.InstanceAddAccessConfigCall.html), [*add resource policies*](struct.InstanceAddResourcePolicyCall.html), [*aggregated list*](struct.InstanceAggregatedListCall.html), [*attach disk*](struct.InstanceAttachDiskCall.html), [*delete*](struct.InstanceDeleteCall.html), [*delete access config*](struct.InstanceDeleteAccessConfigCall.html), [*detach disk*](struct.InstanceDetachDiskCall.html), [*get*](struct.InstanceGetCall.html), [*get guest attributes*](struct.InstanceGetGuestAttributeCall.html), [*get iam policy*](struct.InstanceGetIamPolicyCall.html), [*get serial port output*](struct.InstanceGetSerialPortOutputCall.html), [*get shielded instance identity*](struct.InstanceGetShieldedInstanceIdentityCall.html), [*insert*](struct.InstanceInsertCall.html), [*list*](struct.InstanceListCall.html), [*list referrers*](struct.InstanceListReferrerCall.html), [*remove resource policies*](struct.InstanceRemoveResourcePolicyCall.html), [*reset*](struct.InstanceResetCall.html), [*set deletion protection*](struct.InstanceSetDeletionProtectionCall.html), [*set disk auto delete*](struct.InstanceSetDiskAutoDeleteCall.html), [*set iam policy*](struct.InstanceSetIamPolicyCall.html), [*set labels*](struct.InstanceSetLabelCall.html), [*set machine resources*](struct.InstanceSetMachineResourceCall.html), [*set machine type*](struct.InstanceSetMachineTypeCall.html), [*set metadata*](struct.InstanceSetMetadataCall.html), [*set min cpu platform*](struct.InstanceSetMinCpuPlatformCall.html), [*set scheduling*](struct.InstanceSetSchedulingCall.html), [*set service account*](struct.InstanceSetServiceAccountCall.html), [*set shielded instance integrity policy*](struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html), [*set tags*](struct.InstanceSetTagCall.html), [*simulate maintenance event*](struct.InstanceSimulateMaintenanceEventCall.html), [*start*](struct.InstanceStartCall.html), [*start with encryption key*](struct.InstanceStartWithEncryptionKeyCall.html), [*stop*](struct.InstanceStopCall.html), [*test iam permissions*](struct.InstanceTestIamPermissionCall.html), [*update*](struct.InstanceUpdateCall.html), [*update access config*](struct.InstanceUpdateAccessConfigCall.html), [*update display device*](struct.InstanceUpdateDisplayDeviceCall.html), [*update network interface*](struct.InstanceUpdateNetworkInterfaceCall.html) and [*update shielded instance config*](struct.InstanceUpdateShieldedInstanceConfigCall.html) //! * [interconnect attachments](struct.InterconnectAttachment.html) //! * [*aggregated list*](struct.InterconnectAttachmentAggregatedListCall.html), [*delete*](struct.InterconnectAttachmentDeleteCall.html), [*get*](struct.InterconnectAttachmentGetCall.html), [*insert*](struct.InterconnectAttachmentInsertCall.html), [*list*](struct.InterconnectAttachmentListCall.html) and [*patch*](struct.InterconnectAttachmentPatchCall.html) //! * [interconnect locations](struct.InterconnectLocation.html) @@ -66,13 +70,15 @@ //! * [network endpoint groups](struct.NetworkEndpointGroup.html) //! * [*aggregated list*](struct.NetworkEndpointGroupAggregatedListCall.html), [*attach network endpoints*](struct.NetworkEndpointGroupAttachNetworkEndpointCall.html), [*delete*](struct.NetworkEndpointGroupDeleteCall.html), [*detach network endpoints*](struct.NetworkEndpointGroupDetachNetworkEndpointCall.html), [*get*](struct.NetworkEndpointGroupGetCall.html), [*insert*](struct.NetworkEndpointGroupInsertCall.html), [*list*](struct.NetworkEndpointGroupListCall.html), [*list network endpoints*](struct.NetworkEndpointGroupListNetworkEndpointCall.html) and [*test iam permissions*](struct.NetworkEndpointGroupTestIamPermissionCall.html) //! * [networks](struct.Network.html) -//! * [*add peering*](struct.NetworkAddPeeringCall.html), [*delete*](struct.NetworkDeleteCall.html), [*get*](struct.NetworkGetCall.html), [*insert*](struct.NetworkInsertCall.html), [*list*](struct.NetworkListCall.html), [*patch*](struct.NetworkPatchCall.html), [*remove peering*](struct.NetworkRemovePeeringCall.html) and [*switch to custom mode*](struct.NetworkSwitchToCustomModeCall.html) +//! * [*add peering*](struct.NetworkAddPeeringCall.html), [*delete*](struct.NetworkDeleteCall.html), [*get*](struct.NetworkGetCall.html), [*insert*](struct.NetworkInsertCall.html), [*list*](struct.NetworkListCall.html), [*list peering routes*](struct.NetworkListPeeringRouteCall.html), [*patch*](struct.NetworkPatchCall.html), [*remove peering*](struct.NetworkRemovePeeringCall.html), [*switch to custom mode*](struct.NetworkSwitchToCustomModeCall.html) and [*update peering*](struct.NetworkUpdatePeeringCall.html) //! * [node groups](struct.NodeGroup.html) -//! * [*add nodes*](struct.NodeGroupAddNodeCall.html), [*aggregated list*](struct.NodeGroupAggregatedListCall.html), [*delete*](struct.NodeGroupDeleteCall.html), [*delete nodes*](struct.NodeGroupDeleteNodeCall.html), [*get*](struct.NodeGroupGetCall.html), [*get iam policy*](struct.NodeGroupGetIamPolicyCall.html), [*insert*](struct.NodeGroupInsertCall.html), [*list*](struct.NodeGroupListCall.html), [*list nodes*](struct.NodeGroupListNodeCall.html), [*set iam policy*](struct.NodeGroupSetIamPolicyCall.html), [*set node template*](struct.NodeGroupSetNodeTemplateCall.html) and [*test iam permissions*](struct.NodeGroupTestIamPermissionCall.html) +//! * [*add nodes*](struct.NodeGroupAddNodeCall.html), [*aggregated list*](struct.NodeGroupAggregatedListCall.html), [*delete*](struct.NodeGroupDeleteCall.html), [*delete nodes*](struct.NodeGroupDeleteNodeCall.html), [*get*](struct.NodeGroupGetCall.html), [*get iam policy*](struct.NodeGroupGetIamPolicyCall.html), [*insert*](struct.NodeGroupInsertCall.html), [*list*](struct.NodeGroupListCall.html), [*list nodes*](struct.NodeGroupListNodeCall.html), [*patch*](struct.NodeGroupPatchCall.html), [*set iam policy*](struct.NodeGroupSetIamPolicyCall.html), [*set node template*](struct.NodeGroupSetNodeTemplateCall.html) and [*test iam permissions*](struct.NodeGroupTestIamPermissionCall.html) //! * [node templates](struct.NodeTemplate.html) //! * [*aggregated list*](struct.NodeTemplateAggregatedListCall.html), [*delete*](struct.NodeTemplateDeleteCall.html), [*get*](struct.NodeTemplateGetCall.html), [*get iam policy*](struct.NodeTemplateGetIamPolicyCall.html), [*insert*](struct.NodeTemplateInsertCall.html), [*list*](struct.NodeTemplateListCall.html), [*set iam policy*](struct.NodeTemplateSetIamPolicyCall.html) and [*test iam permissions*](struct.NodeTemplateTestIamPermissionCall.html) //! * [node types](struct.NodeType.html) //! * [*aggregated list*](struct.NodeTypeAggregatedListCall.html), [*get*](struct.NodeTypeGetCall.html) and [*list*](struct.NodeTypeListCall.html) +//! * [packet mirrorings](struct.PacketMirroring.html) +//! * [*aggregated list*](struct.PacketMirroringAggregatedListCall.html), [*delete*](struct.PacketMirroringDeleteCall.html), [*get*](struct.PacketMirroringGetCall.html), [*insert*](struct.PacketMirroringInsertCall.html), [*list*](struct.PacketMirroringListCall.html), [*patch*](struct.PacketMirroringPatchCall.html) and [*test iam permissions*](struct.PacketMirroringTestIamPermissionCall.html) //! * [projects](struct.Project.html) //! * [*disable xpn host*](struct.ProjectDisableXpnHostCall.html), [*disable xpn resource*](struct.ProjectDisableXpnResourceCall.html), [*enable xpn host*](struct.ProjectEnableXpnHostCall.html), [*enable xpn resource*](struct.ProjectEnableXpnResourceCall.html), [*get*](struct.ProjectGetCall.html), [*get xpn host*](struct.ProjectGetXpnHostCall.html), [*get xpn resources*](struct.ProjectGetXpnResourceCall.html), [*list xpn hosts*](struct.ProjectListXpnHostCall.html), [*move disk*](struct.ProjectMoveDiskCall.html), [*move instance*](struct.ProjectMoveInstanceCall.html), [*set common instance metadata*](struct.ProjectSetCommonInstanceMetadataCall.html), [*set default network tier*](struct.ProjectSetDefaultNetworkTierCall.html) and [*set usage export bucket*](struct.ProjectSetUsageExportBucketCall.html) //! * region autoscalers @@ -85,12 +91,22 @@ //! * [*get*](struct.RegionDiskTypeGetCall.html) and [*list*](struct.RegionDiskTypeListCall.html) //! * region disks //! * [*add resource policies*](struct.RegionDiskAddResourcePolicyCall.html), [*create snapshot*](struct.RegionDiskCreateSnapshotCall.html), [*delete*](struct.RegionDiskDeleteCall.html), [*get*](struct.RegionDiskGetCall.html), [*insert*](struct.RegionDiskInsertCall.html), [*list*](struct.RegionDiskListCall.html), [*remove resource policies*](struct.RegionDiskRemoveResourcePolicyCall.html), [*resize*](struct.RegionDiskResizeCall.html), [*set labels*](struct.RegionDiskSetLabelCall.html) and [*test iam permissions*](struct.RegionDiskTestIamPermissionCall.html) +//! * region health checks +//! * [*delete*](struct.RegionHealthCheckDeleteCall.html), [*get*](struct.RegionHealthCheckGetCall.html), [*insert*](struct.RegionHealthCheckInsertCall.html), [*list*](struct.RegionHealthCheckListCall.html), [*patch*](struct.RegionHealthCheckPatchCall.html) and [*update*](struct.RegionHealthCheckUpdateCall.html) //! * region instance group managers -//! * [*abandon instances*](struct.RegionInstanceGroupManagerAbandonInstanceCall.html), [*delete*](struct.RegionInstanceGroupManagerDeleteCall.html), [*delete instances*](struct.RegionInstanceGroupManagerDeleteInstanceCall.html), [*get*](struct.RegionInstanceGroupManagerGetCall.html), [*insert*](struct.RegionInstanceGroupManagerInsertCall.html), [*list*](struct.RegionInstanceGroupManagerListCall.html), [*list managed instances*](struct.RegionInstanceGroupManagerListManagedInstanceCall.html), [*patch*](struct.RegionInstanceGroupManagerPatchCall.html), [*recreate instances*](struct.RegionInstanceGroupManagerRecreateInstanceCall.html), [*resize*](struct.RegionInstanceGroupManagerResizeCall.html), [*set instance template*](struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](struct.RegionInstanceGroupManagerSetTargetPoolCall.html) +//! * [*abandon instances*](struct.RegionInstanceGroupManagerAbandonInstanceCall.html), [*apply updates to instances*](struct.RegionInstanceGroupManagerApplyUpdatesToInstanceCall.html), [*create instances*](struct.RegionInstanceGroupManagerCreateInstanceCall.html), [*delete*](struct.RegionInstanceGroupManagerDeleteCall.html), [*delete instances*](struct.RegionInstanceGroupManagerDeleteInstanceCall.html), [*get*](struct.RegionInstanceGroupManagerGetCall.html), [*insert*](struct.RegionInstanceGroupManagerInsertCall.html), [*list*](struct.RegionInstanceGroupManagerListCall.html), [*list errors*](struct.RegionInstanceGroupManagerListErrorCall.html), [*list managed instances*](struct.RegionInstanceGroupManagerListManagedInstanceCall.html), [*patch*](struct.RegionInstanceGroupManagerPatchCall.html), [*recreate instances*](struct.RegionInstanceGroupManagerRecreateInstanceCall.html), [*resize*](struct.RegionInstanceGroupManagerResizeCall.html), [*set instance template*](struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](struct.RegionInstanceGroupManagerSetTargetPoolCall.html) //! * region instance groups //! * [*get*](struct.RegionInstanceGroupGetCall.html), [*list*](struct.RegionInstanceGroupListCall.html), [*list instances*](struct.RegionInstanceGroupListInstanceCall.html) and [*set named ports*](struct.RegionInstanceGroupSetNamedPortCall.html) //! * region operations -//! * [*delete*](struct.RegionOperationDeleteCall.html), [*get*](struct.RegionOperationGetCall.html) and [*list*](struct.RegionOperationListCall.html) +//! * [*delete*](struct.RegionOperationDeleteCall.html), [*get*](struct.RegionOperationGetCall.html), [*list*](struct.RegionOperationListCall.html) and [*wait*](struct.RegionOperationWaitCall.html) +//! * region ssl certificates +//! * [*delete*](struct.RegionSslCertificateDeleteCall.html), [*get*](struct.RegionSslCertificateGetCall.html), [*insert*](struct.RegionSslCertificateInsertCall.html) and [*list*](struct.RegionSslCertificateListCall.html) +//! * region target http proxies +//! * [*delete*](struct.RegionTargetHttpProxyDeleteCall.html), [*get*](struct.RegionTargetHttpProxyGetCall.html), [*insert*](struct.RegionTargetHttpProxyInsertCall.html), [*list*](struct.RegionTargetHttpProxyListCall.html) and [*set url map*](struct.RegionTargetHttpProxySetUrlMapCall.html) +//! * region target https proxies +//! * [*delete*](struct.RegionTargetHttpsProxyDeleteCall.html), [*get*](struct.RegionTargetHttpsProxyGetCall.html), [*insert*](struct.RegionTargetHttpsProxyInsertCall.html), [*list*](struct.RegionTargetHttpsProxyListCall.html), [*set ssl certificates*](struct.RegionTargetHttpsProxySetSslCertificateCall.html) and [*set url map*](struct.RegionTargetHttpsProxySetUrlMapCall.html) +//! * region url maps +//! * [*delete*](struct.RegionUrlMapDeleteCall.html), [*get*](struct.RegionUrlMapGetCall.html), [*insert*](struct.RegionUrlMapInsertCall.html), [*list*](struct.RegionUrlMapListCall.html), [*patch*](struct.RegionUrlMapPatchCall.html), [*update*](struct.RegionUrlMapUpdateCall.html) and [*validate*](struct.RegionUrlMapValidateCall.html) //! * [regions](struct.Region.html) //! * [*get*](struct.RegionGetCall.html) and [*list*](struct.RegionListCall.html) //! * [reservations](struct.Reservation.html) @@ -102,19 +118,19 @@ //! * [routes](struct.Route.html) //! * [*delete*](struct.RouteDeleteCall.html), [*get*](struct.RouteGetCall.html), [*insert*](struct.RouteInsertCall.html) and [*list*](struct.RouteListCall.html) //! * [security policies](struct.SecurityPolicy.html) -//! * [*add rule*](struct.SecurityPolicyAddRuleCall.html), [*delete*](struct.SecurityPolicyDeleteCall.html), [*get*](struct.SecurityPolicyGetCall.html), [*get rule*](struct.SecurityPolicyGetRuleCall.html), [*insert*](struct.SecurityPolicyInsertCall.html), [*list*](struct.SecurityPolicyListCall.html), [*patch*](struct.SecurityPolicyPatchCall.html), [*patch rule*](struct.SecurityPolicyPatchRuleCall.html) and [*remove rule*](struct.SecurityPolicyRemoveRuleCall.html) +//! * [*add rule*](struct.SecurityPolicyAddRuleCall.html), [*delete*](struct.SecurityPolicyDeleteCall.html), [*get*](struct.SecurityPolicyGetCall.html), [*get rule*](struct.SecurityPolicyGetRuleCall.html), [*insert*](struct.SecurityPolicyInsertCall.html), [*list*](struct.SecurityPolicyListCall.html), [*list preconfigured expression sets*](struct.SecurityPolicyListPreconfiguredExpressionSetCall.html), [*patch*](struct.SecurityPolicyPatchCall.html), [*patch rule*](struct.SecurityPolicyPatchRuleCall.html) and [*remove rule*](struct.SecurityPolicyRemoveRuleCall.html) //! * [snapshots](struct.Snapshot.html) //! * [*delete*](struct.SnapshotDeleteCall.html), [*get*](struct.SnapshotGetCall.html), [*get iam policy*](struct.SnapshotGetIamPolicyCall.html), [*list*](struct.SnapshotListCall.html), [*set iam policy*](struct.SnapshotSetIamPolicyCall.html), [*set labels*](struct.SnapshotSetLabelCall.html) and [*test iam permissions*](struct.SnapshotTestIamPermissionCall.html) //! * [ssl certificates](struct.SslCertificate.html) -//! * [*delete*](struct.SslCertificateDeleteCall.html), [*get*](struct.SslCertificateGetCall.html), [*insert*](struct.SslCertificateInsertCall.html) and [*list*](struct.SslCertificateListCall.html) +//! * [*aggregated list*](struct.SslCertificateAggregatedListCall.html), [*delete*](struct.SslCertificateDeleteCall.html), [*get*](struct.SslCertificateGetCall.html), [*insert*](struct.SslCertificateInsertCall.html) and [*list*](struct.SslCertificateListCall.html) //! * [ssl policies](struct.SslPolicy.html) //! * [*delete*](struct.SslPolicyDeleteCall.html), [*get*](struct.SslPolicyGetCall.html), [*insert*](struct.SslPolicyInsertCall.html), [*list*](struct.SslPolicyListCall.html), [*list available features*](struct.SslPolicyListAvailableFeatureCall.html) and [*patch*](struct.SslPolicyPatchCall.html) //! * [subnetworks](struct.Subnetwork.html) //! * [*aggregated list*](struct.SubnetworkAggregatedListCall.html), [*delete*](struct.SubnetworkDeleteCall.html), [*expand ip cidr range*](struct.SubnetworkExpandIpCidrRangeCall.html), [*get*](struct.SubnetworkGetCall.html), [*get iam policy*](struct.SubnetworkGetIamPolicyCall.html), [*insert*](struct.SubnetworkInsertCall.html), [*list*](struct.SubnetworkListCall.html), [*list usable*](struct.SubnetworkListUsableCall.html), [*patch*](struct.SubnetworkPatchCall.html), [*set iam policy*](struct.SubnetworkSetIamPolicyCall.html), [*set private ip google access*](struct.SubnetworkSetPrivateIpGoogleAccesCall.html) and [*test iam permissions*](struct.SubnetworkTestIamPermissionCall.html) //! * [target http proxies](struct.TargetHttpProxy.html) -//! * [*delete*](struct.TargetHttpProxyDeleteCall.html), [*get*](struct.TargetHttpProxyGetCall.html), [*insert*](struct.TargetHttpProxyInsertCall.html), [*list*](struct.TargetHttpProxyListCall.html) and [*set url map*](struct.TargetHttpProxySetUrlMapCall.html) +//! * [*aggregated list*](struct.TargetHttpProxyAggregatedListCall.html), [*delete*](struct.TargetHttpProxyDeleteCall.html), [*get*](struct.TargetHttpProxyGetCall.html), [*insert*](struct.TargetHttpProxyInsertCall.html), [*list*](struct.TargetHttpProxyListCall.html) and [*set url map*](struct.TargetHttpProxySetUrlMapCall.html) //! * [target https proxies](struct.TargetHttpsProxy.html) -//! * [*delete*](struct.TargetHttpsProxyDeleteCall.html), [*get*](struct.TargetHttpsProxyGetCall.html), [*insert*](struct.TargetHttpsProxyInsertCall.html), [*list*](struct.TargetHttpsProxyListCall.html), [*set quic override*](struct.TargetHttpsProxySetQuicOverrideCall.html), [*set ssl certificates*](struct.TargetHttpsProxySetSslCertificateCall.html), [*set ssl policy*](struct.TargetHttpsProxySetSslPolicyCall.html) and [*set url map*](struct.TargetHttpsProxySetUrlMapCall.html) +//! * [*aggregated list*](struct.TargetHttpsProxyAggregatedListCall.html), [*delete*](struct.TargetHttpsProxyDeleteCall.html), [*get*](struct.TargetHttpsProxyGetCall.html), [*insert*](struct.TargetHttpsProxyInsertCall.html), [*list*](struct.TargetHttpsProxyListCall.html), [*set quic override*](struct.TargetHttpsProxySetQuicOverrideCall.html), [*set ssl certificates*](struct.TargetHttpsProxySetSslCertificateCall.html), [*set ssl policy*](struct.TargetHttpsProxySetSslPolicyCall.html) and [*set url map*](struct.TargetHttpsProxySetUrlMapCall.html) //! * [target instances](struct.TargetInstance.html) //! * [*aggregated list*](struct.TargetInstanceAggregatedListCall.html), [*delete*](struct.TargetInstanceDeleteCall.html), [*get*](struct.TargetInstanceGetCall.html), [*insert*](struct.TargetInstanceInsertCall.html) and [*list*](struct.TargetInstanceListCall.html) //! * [target pools](struct.TargetPool.html) @@ -126,11 +142,13 @@ //! * [target vpn gateways](struct.TargetVpnGateway.html) //! * [*aggregated list*](struct.TargetVpnGatewayAggregatedListCall.html), [*delete*](struct.TargetVpnGatewayDeleteCall.html), [*get*](struct.TargetVpnGatewayGetCall.html), [*insert*](struct.TargetVpnGatewayInsertCall.html) and [*list*](struct.TargetVpnGatewayListCall.html) //! * [url maps](struct.UrlMap.html) -//! * [*delete*](struct.UrlMapDeleteCall.html), [*get*](struct.UrlMapGetCall.html), [*insert*](struct.UrlMapInsertCall.html), [*invalidate cache*](struct.UrlMapInvalidateCacheCall.html), [*list*](struct.UrlMapListCall.html), [*patch*](struct.UrlMapPatchCall.html), [*update*](struct.UrlMapUpdateCall.html) and [*validate*](struct.UrlMapValidateCall.html) +//! * [*aggregated list*](struct.UrlMapAggregatedListCall.html), [*delete*](struct.UrlMapDeleteCall.html), [*get*](struct.UrlMapGetCall.html), [*insert*](struct.UrlMapInsertCall.html), [*invalidate cache*](struct.UrlMapInvalidateCacheCall.html), [*list*](struct.UrlMapListCall.html), [*patch*](struct.UrlMapPatchCall.html), [*update*](struct.UrlMapUpdateCall.html) and [*validate*](struct.UrlMapValidateCall.html) +//! * [vpn gateways](struct.VpnGateway.html) +//! * [*aggregated list*](struct.VpnGatewayAggregatedListCall.html), [*delete*](struct.VpnGatewayDeleteCall.html), [*get*](struct.VpnGatewayGetCall.html), [*get status*](struct.VpnGatewayGetStatuCall.html), [*insert*](struct.VpnGatewayInsertCall.html), [*list*](struct.VpnGatewayListCall.html), [*set labels*](struct.VpnGatewaySetLabelCall.html) and [*test iam permissions*](struct.VpnGatewayTestIamPermissionCall.html) //! * [vpn tunnels](struct.VpnTunnel.html) //! * [*aggregated list*](struct.VpnTunnelAggregatedListCall.html), [*delete*](struct.VpnTunnelDeleteCall.html), [*get*](struct.VpnTunnelGetCall.html), [*insert*](struct.VpnTunnelInsertCall.html) and [*list*](struct.VpnTunnelListCall.html) //! * zone operations -//! * [*delete*](struct.ZoneOperationDeleteCall.html), [*get*](struct.ZoneOperationGetCall.html) and [*list*](struct.ZoneOperationListCall.html) +//! * [*delete*](struct.ZoneOperationDeleteCall.html), [*get*](struct.ZoneOperationGetCall.html), [*list*](struct.ZoneOperationListCall.html) and [*wait*](struct.ZoneOperationWaitCall.html) //! * [zones](struct.Zone.html) //! * [*get*](struct.ZoneGetCall.html) and [*list*](struct.ZoneListCall.html) //! @@ -168,136 +186,167 @@ //! //! ```ignore //! let r = hub.backend_buckets().delete(...).doit() -//! let r = hub.target_ssl_proxies().set_ssl_policy(...).doit() +//! let r = hub.instance_group_managers().resize(...).doit() //! let r = hub.ssl_certificates().delete(...).doit() //! let r = hub.region_disks().resize(...).doit() //! let r = hub.autoscalers().patch(...).doit() -//! let r = hub.instance_group_managers().resize(...).doit() -//! let r = hub.instance_templates().delete(...).doit() +//! let r = hub.external_vpn_gateways().insert(...).doit() +//! let r = hub.images().delete(...).doit() +//! let r = hub.region_autoscalers().delete(...).doit() +//! let r = hub.images().deprecate(...).doit() //! let r = hub.region_instance_group_managers().patch(...).doit() -//! let r = hub.url_maps().update(...).doit() //! let r = hub.region_backend_services().delete(...).doit() //! let r = hub.interconnects().delete(...).doit() //! let r = hub.instances().update_shielded_instance_config(...).doit() -//! let r = hub.region_disks().add_resource_policies(...).doit() +//! let r = hub.region_url_maps().insert(...).doit() +//! let r = hub.firewalls().patch(...).doit() //! let r = hub.vpn_tunnels().delete(...).doit() //! let r = hub.region_disks().set_labels(...).doit() +//! let r = hub.region_operations().wait(...).doit() //! let r = hub.instances().set_machine_type(...).doit() -//! let r = hub.https_health_checks().delete(...).doit() +//! let r = hub.global_forwarding_rules().set_target(...).doit() +//! let r = hub.instance_groups().set_named_ports(...).doit() //! let r = hub.node_groups().delete(...).doit() //! let r = hub.ssl_policies().delete(...).doit() //! let r = hub.ssl_policies().insert(...).doit() //! let r = hub.projects().disable_xpn_host(...).doit() +//! let r = hub.region_instance_group_managers().resize(...).doit() //! let r = hub.instances().set_service_account(...).doit() //! let r = hub.global_forwarding_rules().delete(...).doit() //! let r = hub.vpn_tunnels().insert(...).doit() //! let r = hub.disks().delete(...).doit() -//! let r = hub.networks().insert(...).doit() +//! let r = hub.region_disks().insert(...).doit() +//! let r = hub.instance_groups().add_instances(...).doit() //! let r = hub.disks().add_resource_policies(...).doit() +//! let r = hub.subnetworks().insert(...).doit() //! let r = hub.health_checks().patch(...).doit() //! let r = hub.instances().set_scheduling(...).doit() //! let r = hub.instances().delete(...).doit() //! let r = hub.target_pools().add_health_check(...).doit() //! let r = hub.instance_group_managers().insert(...).doit() //! let r = hub.global_addresses().insert(...).doit() +//! let r = hub.health_checks().update(...).doit() //! let r = hub.target_ssl_proxies().set_ssl_certificates(...).doit() -//! let r = hub.global_forwarding_rules().set_target(...).doit() +//! let r = hub.https_health_checks().delete(...).doit() +//! let r = hub.zone_operations().wait(...).doit() //! let r = hub.autoscalers().insert(...).doit() +//! let r = hub.networks().update_peering(...).doit() +//! let r = hub.snapshots().delete(...).doit() //! let r = hub.security_policies().add_rule(...).doit() -//! let r = hub.instance_groups().insert(...).doit() -//! let r = hub.subnetworks().insert(...).doit() +//! let r = hub.instance_group_managers().delete_instances(...).doit() //! let r = hub.routes().insert(...).doit() //! let r = hub.disks().resize(...).doit() -//! let r = hub.target_tcp_proxies().delete(...).doit() +//! let r = hub.node_templates().insert(...).doit() //! let r = hub.target_ssl_proxies().set_backend_service(...).doit() +//! let r = hub.target_vpn_gateways().insert(...).doit() //! let r = hub.projects().set_default_network_tier(...).doit() //! let r = hub.instance_group_managers().set_instance_template(...).doit() //! let r = hub.node_groups().set_node_template(...).doit() //! let r = hub.resource_policies().delete(...).doit() -//! let r = hub.region_autoscalers().delete(...).doit() +//! let r = hub.security_policies().insert(...).doit() //! let r = hub.networks().remove_peering(...).doit() +//! let r = hub.region_target_https_proxies().delete(...).doit() //! let r = hub.ssl_policies().patch(...).doit() //! let r = hub.interconnect_attachments().delete(...).doit() -//! let r = hub.firewalls().patch(...).doit() +//! let r = hub.region_target_https_proxies().insert(...).doit() //! let r = hub.target_pools().insert(...).doit() -//! let r = hub.node_templates().insert(...).doit() +//! let r = hub.target_tcp_proxies().delete(...).doit() //! let r = hub.projects().disable_xpn_resource(...).doit() +//! let r = hub.global_network_endpoint_groups().delete(...).doit() +//! let r = hub.region_disks().add_resource_policies(...).doit() //! let r = hub.instances().set_disk_auto_delete(...).doit() //! let r = hub.region_instance_group_managers().recreate_instances(...).doit() //! let r = hub.instance_group_managers().set_target_pools(...).doit() //! let r = hub.disks().insert(...).doit() //! let r = hub.target_ssl_proxies().delete(...).doit() +//! let r = hub.autoscalers().update(...).doit() //! let r = hub.region_backend_services().insert(...).doit() //! let r = hub.https_health_checks().insert(...).doit() //! let r = hub.instances().simulate_maintenance_event(...).doit() //! let r = hub.target_pools().remove_health_check(...).doit() //! let r = hub.backend_buckets().add_signed_url_key(...).doit() +//! let r = hub.region_instance_group_managers().create_instances(...).doit() //! let r = hub.target_https_proxies().set_url_map(...).doit() //! let r = hub.region_disks().create_snapshot(...).doit() //! let r = hub.backend_services().delete(...).doit() +//! let r = hub.region_target_http_proxies().set_url_map(...).doit() //! let r = hub.instances().update_network_interface(...).doit() //! let r = hub.url_maps().insert(...).doit() //! let r = hub.instances().add_access_config(...).doit() //! let r = hub.instances().set_machine_resources(...).doit() +//! let r = hub.region_instance_group_managers().apply_updates_to_instances(...).doit() //! let r = hub.instances().update_access_config(...).doit() -//! let r = hub.security_policies().insert(...).doit() +//! let r = hub.networks().delete(...).doit() //! let r = hub.addresses().insert(...).doit() //! let r = hub.health_checks().insert(...).doit() //! let r = hub.global_forwarding_rules().insert(...).doit() //! let r = hub.target_https_proxies().delete(...).doit() +//! let r = hub.instances().update(...).doit() //! let r = hub.target_tcp_proxies().insert(...).doit() +//! let r = hub.global_network_endpoint_groups().detach_network_endpoints(...).doit() //! let r = hub.global_operations().get(...).doit() +//! let r = hub.region_url_maps().update(...).doit() //! let r = hub.addresses().delete(...).doit() -//! let r = hub.target_vpn_gateways().insert(...).doit() +//! let r = hub.region_target_http_proxies().delete(...).doit() //! let r = hub.target_tcp_proxies().set_backend_service(...).doit() //! let r = hub.disks().create_snapshot(...).doit() -//! let r = hub.health_checks().update(...).doit() +//! let r = hub.region_url_maps().patch(...).doit() //! let r = hub.instance_groups().remove_instances(...).doit() -//! let r = hub.instances().set_metadata(...).doit() +//! let r = hub.snapshots().set_labels(...).doit() +//! let r = hub.region_health_checks().delete(...).doit() //! let r = hub.region_commitments().insert(...).doit() //! let r = hub.backend_services().add_signed_url_key(...).doit() -//! let r = hub.forwarding_rules().insert(...).doit() +//! let r = hub.region_target_https_proxies().set_url_map(...).doit() //! let r = hub.instances().start(...).doit() +//! let r = hub.vpn_gateways().insert(...).doit() //! let r = hub.instance_group_managers().delete(...).doit() //! let r = hub.instances().set_deletion_protection(...).doit() //! let r = hub.subnetworks().expand_ip_cidr_range(...).doit() -//! let r = hub.target_https_proxies().set_quic_override(...).doit() +//! let r = hub.interconnects().insert(...).doit() //! let r = hub.projects().move_disk(...).doit() -//! let r = hub.interconnects().patch(...).doit() +//! let r = hub.region_autoscalers().patch(...).doit() //! let r = hub.firewalls().insert(...).doit() +//! let r = hub.global_forwarding_rules().patch(...).doit() //! let r = hub.disks().set_labels(...).doit() //! let r = hub.target_pools().set_backup(...).doit() -//! let r = hub.instance_group_managers().delete_instances(...).doit() //! let r = hub.backend_services().set_security_policy(...).doit() //! let r = hub.region_instance_group_managers().delete_instances(...).doit() //! let r = hub.instances().detach_disk(...).doit() -//! let r = hub.region_disks().insert(...).doit() +//! let r = hub.routers().update(...).doit() //! let r = hub.instance_groups().delete(...).doit() //! let r = hub.instances().delete_access_config(...).doit() //! let r = hub.target_https_proxies().set_ssl_certificates(...).doit() -//! let r = hub.instance_groups().add_instances(...).doit() +//! let r = hub.networks().insert(...).doit() +//! let r = hub.instances().update_display_device(...).doit() //! let r = hub.instance_group_managers().abandon_instances(...).doit() //! let r = hub.instances().set_tags(...).doit() //! let r = hub.network_endpoint_groups().attach_network_endpoints(...).doit() //! let r = hub.reservations().resize(...).doit() -//! let r = hub.snapshots().delete(...).doit() +//! let r = hub.instances().set_metadata(...).doit() //! let r = hub.target_https_proxies().insert(...).doit() -//! let r = hub.reservations().insert(...).doit() +//! let r = hub.instance_group_managers().create_instances(...).doit() +//! let r = hub.node_groups().add_nodes(...).doit() +//! let r = hub.forwarding_rules().set_target(...).doit() //! let r = hub.target_tcp_proxies().set_proxy_header(...).doit() //! let r = hub.backend_services().update(...).doit() //! let r = hub.disks().remove_resource_policies(...).doit() //! let r = hub.node_groups().delete_nodes(...).doit() +//! let r = hub.instance_groups().insert(...).doit() +//! let r = hub.vpn_gateways().delete(...).doit() +//! let r = hub.region_url_maps().delete(...).doit() //! let r = hub.licenses().delete(...).doit() //! let r = hub.region_disks().remove_resource_policies(...).doit() //! let r = hub.instance_group_managers().patch(...).doit() -//! let r = hub.subnetworks().patch(...).doit() +//! let r = hub.global_network_endpoint_groups().insert(...).doit() +//! let r = hub.instance_group_managers().recreate_instances(...).doit() +//! let r = hub.reservations().insert(...).doit() //! let r = hub.reservations().delete(...).doit() //! let r = hub.target_https_proxies().set_ssl_policy(...).doit() -//! let r = hub.instances().attach_disk(...).doit() +//! let r = hub.target_ssl_proxies().set_ssl_policy(...).doit() //! let r = hub.projects().set_common_instance_metadata(...).doit() //! let r = hub.node_templates().delete(...).doit() //! let r = hub.region_operations().get(...).doit() -//! let r = hub.node_groups().add_nodes(...).doit() +//! let r = hub.instances().add_resource_policies(...).doit() //! let r = hub.backend_buckets().insert(...).doit() //! let r = hub.node_groups().insert(...).doit() //! let r = hub.licenses().insert(...).doit() @@ -305,26 +354,29 @@ //! let r = hub.target_http_proxies().set_url_map(...).doit() //! let r = hub.network_endpoint_groups().delete(...).doit() //! let r = hub.region_instance_group_managers().delete(...).doit() -//! let r = hub.images().deprecate(...).doit() +//! let r = hub.region_health_checks().patch(...).doit() //! let r = hub.http_health_checks().patch(...).doit() -//! let r = hub.region_autoscalers().insert(...).doit() //! let r = hub.security_policies().patch_rule(...).doit() +//! let r = hub.instance_templates().insert(...).doit() +//! let r = hub.forwarding_rules().insert(...).doit() //! let r = hub.interconnect_attachments().patch(...).doit() //! let r = hub.images().insert(...).doit() //! let r = hub.backend_buckets().delete_signed_url_key(...).doit() //! let r = hub.url_maps().invalidate_cache(...).doit() -//! let r = hub.instance_groups().set_named_ports(...).doit() +//! let r = hub.region_backend_services().patch(...).doit() //! let r = hub.ssl_certificates().insert(...).doit() -//! let r = hub.interconnects().insert(...).doit() +//! let r = hub.instances().remove_resource_policies(...).doit() //! let r = hub.networks().switch_to_custom_mode(...).doit() -//! let r = hub.projects().enable_xpn_resource(...).doit() +//! let r = hub.global_operations().wait(...).doit() //! let r = hub.projects().move_instance(...).doit() +//! let r = hub.region_target_http_proxies().insert(...).doit() //! let r = hub.security_policies().patch(...).doit() //! let r = hub.autoscalers().delete(...).doit() -//! let r = hub.snapshots().set_labels(...).doit() -//! let r = hub.instance_group_managers().recreate_instances(...).doit() +//! let r = hub.region_instance_group_managers().set_target_pools(...).doit() +//! let r = hub.region_health_checks().update(...).doit() +//! let r = hub.subnetworks().patch(...).doit() //! let r = hub.https_health_checks().update(...).doit() -//! let r = hub.region_autoscalers().patch(...).doit() +//! let r = hub.region_ssl_certificates().delete(...).doit() //! let r = hub.url_maps().patch(...).doit() //! let r = hub.subnetworks().delete(...).doit() //! let r = hub.region_disks().delete(...).doit() @@ -332,52 +384,62 @@ //! let r = hub.target_pools().add_instance(...).doit() //! let r = hub.target_pools().remove_instance(...).doit() //! let r = hub.network_endpoint_groups().detach_network_endpoints(...).doit() +//! let r = hub.region_target_https_proxies().set_ssl_certificates(...).doit() //! let r = hub.target_pools().delete(...).doit() //! let r = hub.firewalls().update(...).doit() //! let r = hub.instances().insert(...).doit() //! let r = hub.projects().set_usage_export_bucket(...).doit() -//! let r = hub.region_backend_services().patch(...).doit() +//! let r = hub.region_autoscalers().insert(...).doit() //! let r = hub.images().set_labels(...).doit() -//! let r = hub.target_instances().insert(...).doit() +//! let r = hub.packet_mirrorings().patch(...).doit() +//! let r = hub.node_groups().patch(...).doit() //! let r = hub.target_http_proxies().insert(...).doit() //! let r = hub.interconnect_attachments().insert(...).doit() //! let r = hub.networks().patch(...).doit() //! let r = hub.resource_policies().insert(...).doit() //! let r = hub.security_policies().remove_rule(...).doit() //! let r = hub.region_instance_groups().set_named_ports(...).doit() -//! let r = hub.instance_templates().insert(...).doit() +//! let r = hub.backend_services().insert(...).doit() +//! let r = hub.external_vpn_gateways().set_labels(...).doit() //! let r = hub.target_instances().delete(...).doit() +//! let r = hub.instance_templates().delete(...).doit() //! let r = hub.region_instance_group_managers().set_instance_template(...).doit() //! let r = hub.projects().enable_xpn_host(...).doit() -//! let r = hub.forwarding_rules().set_target(...).doit() +//! let r = hub.global_network_endpoint_groups().attach_network_endpoints(...).doit() +//! let r = hub.target_https_proxies().set_quic_override(...).doit() //! let r = hub.routers().delete(...).doit() -//! let r = hub.region_instance_group_managers().resize(...).doit() +//! let r = hub.forwarding_rules().patch(...).doit() //! let r = hub.target_vpn_gateways().delete(...).doit() +//! let r = hub.external_vpn_gateways().delete(...).doit() //! let r = hub.health_checks().delete(...).doit() -//! let r = hub.backend_services().insert(...).doit() //! let r = hub.instances().set_labels(...).doit() //! let r = hub.region_backend_services().update(...).doit() +//! let r = hub.interconnects().patch(...).doit() //! let r = hub.instances().set_shielded_instance_integrity_policy(...).doit() //! let r = hub.target_http_proxies().delete(...).doit() //! let r = hub.backend_buckets().patch(...).doit() //! let r = hub.global_addresses().delete(...).doit() +//! let r = hub.instance_group_managers().apply_updates_to_instances(...).doit() //! let r = hub.https_health_checks().patch(...).doit() -//! let r = hub.networks().delete(...).doit() +//! let r = hub.url_maps().update(...).doit() //! let r = hub.url_maps().delete(...).doit() //! let r = hub.routers().insert(...).doit() //! let r = hub.instances().reset(...).doit() -//! let r = hub.routers().update(...).doit() +//! let r = hub.region_health_checks().insert(...).doit() //! let r = hub.routers().patch(...).doit() //! let r = hub.networks().add_peering(...).doit() //! let r = hub.security_policies().delete(...).doit() +//! let r = hub.vpn_gateways().set_labels(...).doit() //! let r = hub.target_ssl_proxies().set_proxy_header(...).doit() //! let r = hub.http_health_checks().delete(...).doit() +//! let r = hub.target_instances().insert(...).doit() //! let r = hub.http_health_checks().insert(...).doit() -//! let r = hub.images().delete(...).doit() +//! let r = hub.instances().attach_disk(...).doit() //! let r = hub.region_instance_group_managers().abandon_instances(...).doit() +//! let r = hub.packet_mirrorings().insert(...).doit() //! let r = hub.subnetworks().set_private_ip_google_access(...).doit() -//! let r = hub.autoscalers().update(...).doit() -//! let r = hub.region_instance_group_managers().set_target_pools(...).doit() +//! let r = hub.projects().enable_xpn_resource(...).doit() +//! let r = hub.region_ssl_certificates().insert(...).doit() //! let r = hub.region_autoscalers().update(...).doit() //! let r = hub.target_ssl_proxies().insert(...).doit() //! let r = hub.instances().start_with_encryption_key(...).doit() @@ -385,6 +447,7 @@ //! let r = hub.forwarding_rules().delete(...).doit() //! let r = hub.network_endpoint_groups().insert(...).doit() //! let r = hub.backend_buckets().update(...).doit() +//! let r = hub.packet_mirrorings().delete(...).doit() //! let r = hub.region_instance_group_managers().insert(...).doit() //! let r = hub.firewalls().delete(...).doit() //! let r = hub.zone_operations().get(...).doit() @@ -424,6 +487,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_compute1 as compute1; +//! use compute1::Instance; //! use compute1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -442,11 +506,18 @@ //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); //! let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Instance::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.instances().set_disk_auto_delete("project", "zone", "instance", false, "deviceName") -//! .request_id("erat") +//! let result = hub.instances().update(req, "project", "zone", "instance") +//! .request_id("justo") +//! .most_disruptive_allowed_action("amet.") +//! .minimal_action("erat") //! .doit(); //! //! match result { @@ -622,6 +693,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_compute1 as compute1; +/// use compute1::Instance; /// use compute1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -640,11 +712,18 @@ impl Default for Scope { /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Instance::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.instances().set_disk_auto_delete("project", "zone", "instance", true, "deviceName") -/// .request_id("sadipscing") +/// let result = hub.instances().update(req, "project", "zone", "instance") +/// .request_id("dolores") +/// .most_disruptive_allowed_action("gubergren") +/// .minimal_action("sadipscing") /// .doit(); /// /// match result { @@ -682,9 +761,9 @@ impl<'a, C, A> Compute Compute { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), - _base_url: "https://www.googleapis.com/compute/v1/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), + _base_url: "https://compute.googleapis.com/compute/v1/projects/".to_string(), + _root_url: "https://compute.googleapis.com/".to_string(), } } @@ -709,6 +788,9 @@ impl<'a, C, A> Compute pub fn disks(&'a self) -> DiskMethods<'a, C, A> { DiskMethods { hub: &self } } + pub fn external_vpn_gateways(&'a self) -> ExternalVpnGatewayMethods<'a, C, A> { + ExternalVpnGatewayMethods { hub: &self } + } pub fn firewalls(&'a self) -> FirewallMethods<'a, C, A> { FirewallMethods { hub: &self } } @@ -721,6 +803,9 @@ impl<'a, C, A> Compute pub fn global_forwarding_rules(&'a self) -> GlobalForwardingRuleMethods<'a, C, A> { GlobalForwardingRuleMethods { hub: &self } } + pub fn global_network_endpoint_groups(&'a self) -> GlobalNetworkEndpointGroupMethods<'a, C, A> { + GlobalNetworkEndpointGroupMethods { hub: &self } + } pub fn global_operations(&'a self) -> GlobalOperationMethods<'a, C, A> { GlobalOperationMethods { hub: &self } } @@ -781,6 +866,9 @@ impl<'a, C, A> Compute pub fn node_types(&'a self) -> NodeTypeMethods<'a, C, A> { NodeTypeMethods { hub: &self } } + pub fn packet_mirrorings(&'a self) -> PacketMirroringMethods<'a, C, A> { + PacketMirroringMethods { hub: &self } + } pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } @@ -799,6 +887,9 @@ impl<'a, C, A> Compute pub fn region_disks(&'a self) -> RegionDiskMethods<'a, C, A> { RegionDiskMethods { hub: &self } } + pub fn region_health_checks(&'a self) -> RegionHealthCheckMethods<'a, C, A> { + RegionHealthCheckMethods { hub: &self } + } pub fn region_instance_group_managers(&'a self) -> RegionInstanceGroupManagerMethods<'a, C, A> { RegionInstanceGroupManagerMethods { hub: &self } } @@ -808,6 +899,18 @@ impl<'a, C, A> Compute pub fn region_operations(&'a self) -> RegionOperationMethods<'a, C, A> { RegionOperationMethods { hub: &self } } + pub fn region_ssl_certificates(&'a self) -> RegionSslCertificateMethods<'a, C, A> { + RegionSslCertificateMethods { hub: &self } + } + pub fn region_target_http_proxies(&'a self) -> RegionTargetHttpProxyMethods<'a, C, A> { + RegionTargetHttpProxyMethods { hub: &self } + } + pub fn region_target_https_proxies(&'a self) -> RegionTargetHttpsProxyMethods<'a, C, A> { + RegionTargetHttpsProxyMethods { hub: &self } + } + pub fn region_url_maps(&'a self) -> RegionUrlMapMethods<'a, C, A> { + RegionUrlMapMethods { hub: &self } + } pub fn regions(&'a self) -> RegionMethods<'a, C, A> { RegionMethods { hub: &self } } @@ -862,6 +965,9 @@ impl<'a, C, A> Compute pub fn url_maps(&'a self) -> UrlMapMethods<'a, C, A> { UrlMapMethods { hub: &self } } + pub fn vpn_gateways(&'a self) -> VpnGatewayMethods<'a, C, A> { + VpnGatewayMethods { hub: &self } + } pub fn vpn_tunnels(&'a self) -> VpnTunnelMethods<'a, C, A> { VpnTunnelMethods { hub: &self } } @@ -873,7 +979,7 @@ impl<'a, C, A> Compute } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -881,7 +987,7 @@ impl<'a, C, A> Compute } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/compute/v1/projects/`. + /// It defaults to `https://compute.googleapis.com/compute/v1/projects/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -889,7 +995,7 @@ impl<'a, C, A> Compute } /// Set the root url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/`. + /// It defaults to `https://compute.googleapis.com/`. /// /// Returns the previously set root url. pub fn root_url(&mut self, new_root_url: String) -> String { @@ -901,60 +1007,6 @@ impl<'a, C, A> Compute // ############ // SCHEMAS ### // ########## -/// Represents a collection of network endpoints. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [detach network endpoints network endpoint groups](struct.NetworkEndpointGroupDetachNetworkEndpointCall.html) (none) -/// * [insert network endpoint groups](struct.NetworkEndpointGroupInsertCall.html) (request) -/// * [attach network endpoints network endpoint groups](struct.NetworkEndpointGroupAttachNetworkEndpointCall.html) (none) -/// * [aggregated list network endpoint groups](struct.NetworkEndpointGroupAggregatedListCall.html) (none) -/// * [delete network endpoint groups](struct.NetworkEndpointGroupDeleteCall.html) (none) -/// * [list network endpoints network endpoint groups](struct.NetworkEndpointGroupListNetworkEndpointCall.html) (none) -/// * [test iam permissions network endpoint groups](struct.NetworkEndpointGroupTestIamPermissionCall.html) (none) -/// * [list network endpoint groups](struct.NetworkEndpointGroupListCall.html) (none) -/// * [get network endpoint groups](struct.NetworkEndpointGroupGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroup { - /// [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// [Output Only] The URL of the zone where the network endpoint group is located. - pub zone: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// The default port used if the port number is not specified in the network endpoint. - #[serde(rename="defaultPort")] - pub default_port: Option, - /// Type of network endpoints in this network endpoint group. Currently the only supported value is GCE_VM_IP_PORT. - #[serde(rename="networkEndpointType")] - pub network_endpoint_type: Option, - /// The URL of the network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified. - pub network: Option, - /// Optional URL of the subnetwork to which all network endpoints in the NEG belong. - pub subnetwork: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output only] Number of network endpoints in the network endpoint group. - pub size: Option, -} - -impl RequestValue for NetworkEndpointGroup {} -impl Resource for NetworkEndpointGroup {} -impl ResponseResult for NetworkEndpointGroup {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -999,212 +1051,15 @@ impl RequestValue for InstanceGroupsSetNamedPortsRequest {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupListWarningData { +pub struct RegionInstanceGroupManagerListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for RegionInstanceGroupListWarningData {} -impl Part for RegionInstanceGroupListWarningData {} - - -/// Contains a list of UrlMap resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list url maps](struct.UrlMapListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of UrlMap resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for UrlMapList {} - - -/// Contains a list of BackendBucket resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list backend buckets](struct.BackendBucketListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendBucketList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of BackendBucket resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for BackendBucketList {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for AddressAggregatedListWarning {} -impl Part for AddressAggregatedListWarning {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DistributionPolicy { - /// Zones where the regional managed instance group will create and manage instances. - pub zones: Option>, -} - -impl Part for DistributionPolicy {} - - -/// Represents a Disk Type resource. -/// -/// You can choose from a variety of disk types based on your needs. For more information, read Storage options. -/// -/// The diskTypes resource represents disk types for a zonal persistent disk. For more information, read Zonal persistent disks. -/// -/// The regionDiskTypes resource represents disk types for a regional persistent disk. For more information, read Regional persistent disks. (== resource_for beta.diskTypes ==) (== resource_for v1.diskTypes ==) (== resource_for v1.regionDiskTypes ==) (== resource_for beta.regionDiskTypes ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list disk types](struct.DiskTypeAggregatedListCall.html) (none) -/// * [list disk types](struct.DiskTypeListCall.html) (none) -/// * [get region disk types](struct.RegionDiskTypeGetCall.html) (response) -/// * [get disk types](struct.DiskTypeGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskType { - /// [Output Only] Type of the resource. Always compute#diskType for disk types. - pub kind: Option, - /// [Output Only] An optional description of this resource. - pub description: Option, - /// [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. - pub zone: Option, - /// [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". - #[serde(rename="validDiskSize")] - pub valid_disk_size: Option, - /// [Output Only] The deprecation status associated with this disk type. - pub deprecated: Option, - /// [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. - pub region: Option, - /// [Output Only] Server-defined default disk size in GB. - #[serde(rename="defaultDiskSizeGb")] - pub default_disk_size_gb: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Name of the resource. - pub name: Option, -} - -impl Resource for DiskType {} -impl ResponseResult for DiskType {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceListReferrersWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstanceListReferrersWarningData {} -impl Part for InstanceListReferrersWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplateListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NodeTemplateListWarningData {} -impl Part for NodeTemplateListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set private ip google access subnetworks](struct.SubnetworkSetPrivateIpGoogleAccesCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworksSetPrivateIpGoogleAccessRequest { - /// no description provided - #[serde(rename="privateIpGoogleAccess")] - pub private_ip_google_access: Option, -} - -impl RequestValue for SubnetworksSetPrivateIpGoogleAccessRequest {} +impl NestedType for RegionInstanceGroupManagerListWarningData {} +impl Part for RegionInstanceGroupManagerListWarningData {} /// There is no detailed description. @@ -1226,34 +1081,6 @@ pub struct NodeGroupsSetNodeTemplateRequest { impl RequestValue for NodeGroupsSetNodeTemplateRequest {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list licenses](struct.LicenseListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LicensesListResponse { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of License resources. - pub items: Option>, - /// [Output Only] Informational warning message. - pub warning: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for LicensesListResponse {} - - /// There is no detailed description. /// /// # Activities @@ -1272,55 +1099,6 @@ pub struct RegionInstanceGroupManagersAbandonInstancesRequest { impl RequestValue for RegionInstanceGroupManagersAbandonInstancesRequest {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list vpn tunnels](struct.VpnTunnelAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of VpnTunnelsScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for VpnTunnelAggregatedList {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FirewallListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for FirewallListWarning {} -impl Part for FirewallListWarning {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1340,25 +1118,6 @@ impl NestedType for TargetVpnGatewayListWarning {} impl Part for TargetVpnGatewayListWarning {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstanceGroupAggregatedListWarning {} -impl Part for InstanceGroupAggregatedListWarning {} - - /// A metadata key/value entry. /// /// # Activities @@ -1384,87 +1143,57 @@ pub struct Metadata { impl RequestValue for Metadata {} -/// [Output Only] Informational warning message. +/// The retry policy associates with HttpRouteRule /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, +pub struct HttpRetryPolicy { + /// Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. + #[serde(rename="numRetries")] + pub num_retries: Option, + /// Specfies one or more conditions when this retry rule applies. Valid values are: + /// - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. + /// - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. + /// - + /// - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. + /// - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. + /// - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. + /// - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled + /// - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded + /// - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted + /// - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable + #[serde(rename="retryConditions")] + pub retry_conditions: Option>, + /// Specifies a non-zero timeout per retry attempt. + /// If not specified, will use the timeout set in HttpRouteAction. If timeout in HttpRouteAction is not set, will use the largest timeout among all backend services associated with the route. + #[serde(rename="perTryTimeout")] + pub per_try_timeout: Option, } -impl NestedType for InterconnectAttachmentListWarning {} -impl Part for InterconnectAttachmentListWarning {} +impl Part for HttpRetryPolicy {} -/// Specified snapshot properties for scheduled snapshots created by this policy. +/// Represents a Target HTTP Proxy resource. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// Google Compute Engine has two Target HTTP Proxy resources: /// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicySnapshotSchedulePolicySnapshotProperties { - /// Indication to perform a ?guest aware? snapshot. - #[serde(rename="guestFlush")] - pub guest_flush: Option, - /// GCS bucket storage location of the auto snapshot (regional or multi-regional). - #[serde(rename="storageLocations")] - pub storage_locations: Option>, - /// Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty. - pub labels: Option>, -} - -impl Part for ResourcePolicySnapshotSchedulePolicySnapshotProperties {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersRecreateInstancesRequest { - /// The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - pub instances: Option>, -} - -impl RequestValue for InstanceGroupManagersRecreateInstancesRequest {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for AddressAggregatedListWarningData {} -impl Part for AddressAggregatedListWarningData {} - - -/// A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==) +/// * [Global](/compute/docs/reference/rest/{$api_version}/targetHttpProxies) * [Regional](/compute/docs/reference/rest/{$api_version}/regionTargetHttpProxies) +/// +/// A target HTTP proxy is a component of GCP HTTP load balancers. +/// +/// * targetHttpProxies are used by external HTTP load balancers and Traffic Director. * regionTargetHttpProxies are used by internal HTTP load balancers. +/// +/// Forwarding rules reference a target HTTP proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies and Forwarding rule concepts. (== resource_for {$api_version}.targetHttpProxies ==) (== resource_for {$api_version}.regionTargetHttpProxies ==) /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [insert region target http proxies](struct.RegionTargetHttpProxyInsertCall.html) (request) /// * [get target http proxies](struct.TargetHttpProxyGetCall.html) (response) +/// * [get region target http proxies](struct.RegionTargetHttpProxyGetCall.html) (response) /// * [insert target http proxies](struct.TargetHttpProxyInsertCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1473,6 +1202,8 @@ pub struct TargetHttpProxy { pub kind: Option, /// An optional description of this resource. Provide this property when you create the resource. pub description: Option, + /// [Output Only] URL of the region where the regional Target HTTP Proxy resides. This field is not applicable to global Target HTTP Proxies. + pub region: Option, /// URL to the UrlMap resource that defines the mapping from URL to the BackendService. #[serde(rename="urlMap")] pub url_map: Option, @@ -1506,6 +1237,25 @@ pub struct BackendServiceReference { impl Part for BackendServiceReference {} +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicyListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for SecurityPolicyListWarning {} +impl Part for SecurityPolicyListWarning {} + + /// There is no detailed description. /// /// # Activities @@ -1513,205 +1263,16 @@ impl Part for BackendServiceReference {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [aggregated list autoscalers](struct.AutoscalerAggregatedListCall.html) (response) +/// * [set ssl certificates region target https proxies](struct.RegionTargetHttpsProxySetSslCertificateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalerAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of AutoscalersScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, +pub struct RegionTargetHttpsProxiesSetSslCertificatesRequest { + /// New set of SslCertificate resources to associate with this TargetHttpsProxy resource. Currently exactly one SslCertificate resource must be specified. + #[serde(rename="sslCertificates")] + pub ssl_certificates: Option>, } -impl ResponseResult for AutoscalerAggregatedList {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeGroupListWarning {} -impl Part for NodeGroupListWarning {} - - -/// [Output Only] If errors are generated during processing of the operation, this field will be populated. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationError { - /// [Output Only] The array of errors encountered while processing this operation. - pub errors: Option>, -} - -impl NestedType for OperationError {} -impl Part for OperationError {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetHttpProxyListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetHttpProxyListWarning {} -impl Part for TargetHttpProxyListWarning {} - - -/// Contains a list of addresses. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list addresses](struct.AddresseListCall.html) (response) -/// * [list global addresses](struct.GlobalAddresseListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#addressList for lists of addresses. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Address resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for AddressList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for MachineTypeAggregatedListWarningData {} -impl Part for MachineTypeAggregatedListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for VpnTunnelAggregatedListWarning {} -impl Part for VpnTunnelAggregatedListWarning {} - - -/// Increment a streamz counter with the specified metric and field names. -/// -/// Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended. -/// -/// Field names correspond to IAM request parameters and field values are their respective values. -/// -/// Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields. -/// -/// Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]} -/// -/// At this time we do not support multiple field names (though this may be supported in the future). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogConfigCounterOptions { - /// The field value to attribute. - pub field: Option, - /// The metric to update. - pub metric: Option, -} - -impl Part for LogConfigCounterOptions {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionAutoscalerListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for RegionAutoscalerListWarningData {} -impl Part for RegionAutoscalerListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypeAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for AcceleratorTypeAggregatedListWarningData {} -impl Part for AcceleratorTypeAggregatedListWarningData {} +impl RequestValue for RegionTargetHttpsProxiesSetSslCertificatesRequest {} /// [Output Only] Informational warning message. @@ -1733,108 +1294,18 @@ impl NestedType for ResourcePolicyAggregatedListWarning {} impl Part for ResourcePolicyAggregatedListWarning {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [resize region disks](struct.RegionDiskResizeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionDisksResizeRequest { - /// The new size of the regional persistent disk, which is specified in GB. - #[serde(rename="sizeGb")] - pub size_gb: Option, -} - -impl RequestValue for RegionDisksResizeRequest {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetTcpProxyListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetTcpProxyListWarningData {} -impl Part for TargetTcpProxyListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworksScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for SubnetworksScopedListWarningData {} -impl Part for SubnetworksScopedListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list accelerator types](struct.AcceleratorTypeAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypeAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of AcceleratorTypesScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for AcceleratorTypeAggregatedList {} - - -/// The available logging options for a firewall rule. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FirewallLogConfig { - /// This field denotes whether to enable logging for a particular firewall rule. - pub enable: Option, -} - -impl Part for FirewallLogConfig {} - - /// A matcher for the path portion of the URL. The BackendService from the longest-matched rule will serve the URL. If no rule was matched, the default service will be used. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PathMatcher { + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + /// Only one of defaultRouteAction or defaultUrlRedirect must be set. + #[serde(rename="defaultRouteAction")] + pub default_route_action: Option, /// The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: /// - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService /// - compute/v1/projects/project/global/backendServices/backendService @@ -1845,13 +1316,23 @@ pub struct PathMatcher { /// - compute.backendServices.use #[serde(rename="defaultService")] pub default_service: Option, + /// The list of HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. routeRules are evaluated in order of priority, from the lowest to highest number. + /// Within a given pathMatcher, you can set only one of pathRules or routeRules. + #[serde(rename="routeRules")] + pub route_rules: Option>, /// The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis. /// For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. - /// Only one of pathRules or routeRules must be set. + /// Within a given pathMatcher, only one of pathRules or routeRules must be set. #[serde(rename="pathRules")] pub path_rules: Option>, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, + /// Specifies changes to request and response headers that need to take effect for the selected backendService. + /// HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + #[serde(rename="headerAction")] + pub header_action: Option, + /// When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. + /// If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. + #[serde(rename="defaultUrlRedirect")] + pub default_url_redirect: Option, /// The name to which this PathMatcher is referred by the HostRule. pub name: Option, } @@ -1859,204 +1340,59 @@ pub struct PathMatcher { impl Part for PathMatcher {} -/// There is no detailed description. +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedInstanceLastAttempt { - /// [Output Only] Encountered errors during the last attempt to create or delete the instance. - pub errors: Option, +pub struct XpnHostListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, } -impl Part for ManagedInstanceLastAttempt {} +impl NestedType for XpnHostListWarning {} +impl Part for XpnHostListWarning {} -/// There is no detailed description. +/// HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedInstanceVersion { - /// [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }. - #[serde(rename="instanceTemplate")] - pub instance_template: Option, - /// [Output Only] Name of the version. - pub name: Option, +pub struct Int64RangeMatch { + /// The end of the range (exclusive) in signed long integer format. + #[serde(rename="rangeEnd")] + pub range_end: Option, + /// The start of the range (inclusive) in signed long integer format. + #[serde(rename="rangeStart")] + pub range_start: Option, } -impl Part for ManagedInstanceVersion {} +impl Part for Int64RangeMatch {} -/// Represents a Region resource. -/// -/// A region is a geographical area where a resource is located. For more information, read Regions and Zones. (== resource_for beta.regions ==) (== resource_for v1.regions ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list regions](struct.RegionListCall.html) (none) -/// * [get regions](struct.RegionGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Region { - /// [Output Only] Status of the region, either UP or DOWN. - pub status: Option, - /// [Output Only] Type of the resource. Always compute#region for regions. - pub kind: Option, - /// [Output Only] Textual description of the resource. - pub description: Option, - /// [Output Only] The deprecation status associated with this region. - pub deprecated: Option, - /// [Output Only] Quotas assigned to this region. - pub quotas: Option>, - /// [Output Only] A list of zones available in this region, in the form of resource URLs. - pub zones: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Name of the resource. - pub name: Option, -} - -impl Resource for Region {} -impl ResponseResult for Region {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list node templates](struct.NodeTemplateAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplateAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of NodeTemplatesScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for NodeTemplateAggregatedList {} - - -/// There is no detailed description. +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HTTPHealthCheck { - /// The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. - pub port: Option, - /// The value of the host header in the HTTP health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. - pub host: Option, - /// The request path of the HTTP health check request. The default value is /. - #[serde(rename="requestPath")] - pub request_path: Option, - /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. - #[serde(rename="portName")] - pub port_name: Option, - /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, - /// Specifies how port is selected for health checking, can be one of following values: - /// USE_FIXED_PORT: The port number in - /// port - /// is used for health checking. - /// USE_NAMED_PORT: The - /// portName - /// is used for health checking. - /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - /// - /// - /// If not specified, HTTP health check follows behavior specified in - /// port - /// and - /// portName - /// fields. - #[serde(rename="portSpecification")] - pub port_specification: Option, - /// The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. - pub response: Option, +pub struct TargetHttpProxyListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, } -impl Part for HTTPHealthCheck {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicyWeeklyCycleDayOfWeek { - /// [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. - pub duration: Option, - /// Allows to define schedule that runs specified day of the week. - pub day: Option, - /// Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. - #[serde(rename="startTime")] - pub start_time: Option, -} - -impl Part for ResourcePolicyWeeklyCycleDayOfWeek {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list network endpoints network endpoint groups](struct.NetworkEndpointGroupListNetworkEndpointCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupsListEndpointsRequest { - /// Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specifiy this parameter, the health status of network endpoints will not be provided. - #[serde(rename="healthStatus")] - pub health_status: Option, -} - -impl RequestValue for NetworkEndpointGroupsListEndpointsRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [disable xpn resource projects](struct.ProjectDisableXpnResourceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProjectsDisableXpnResourceRequest { - /// Service resource (a.k.a service project) ID. - #[serde(rename="xpnResource")] - pub xpn_resource: Option, -} - -impl RequestValue for ProjectsDisableXpnResourceRequest {} +impl NestedType for TargetHttpProxyListWarning {} +impl Part for TargetHttpProxyListWarning {} /// There is no detailed description. @@ -2089,206 +1425,23 @@ pub struct SubnetworkAggregatedList { impl ResponseResult for SubnetworkAggregatedList {} -/// Identity-Aware Proxy +/// The spec for modifying the path before sending the request to the matched backend service. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServiceIAP { - /// no description provided - #[serde(rename="oauth2ClientId")] - pub oauth2_client_id: Option, - /// no description provided - pub enabled: Option, - /// no description provided - #[serde(rename="oauth2ClientSecret")] - pub oauth2_client_secret: Option, - /// [Output Only] SHA256 hash value for the field oauth2_client_secret above. - #[serde(rename="oauth2ClientSecretSha256")] - pub oauth2_client_secret_sha256: Option, +pub struct UrlRewrite { + /// Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. + /// The value must be between 1 and 255 characters. + #[serde(rename="hostRewrite")] + pub host_rewrite: Option, + /// Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. + /// The value must be between 1 and 1024 characters. + #[serde(rename="pathPrefixRewrite")] + pub path_prefix_rewrite: Option, } -impl Part for BackendServiceIAP {} - - -/// Represents a Managed Instance Group resource. -/// -/// An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups. -/// -/// For zonal Managed Instance Group, use the instanceGroupManagers resource. -/// -/// For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list managed instances instance group managers](struct.InstanceGroupManagerListManagedInstanceCall.html) (none) -/// * [resize instance group managers](struct.InstanceGroupManagerResizeCall.html) (none) -/// * [aggregated list instance group managers](struct.InstanceGroupManagerAggregatedListCall.html) (none) -/// * [get region instance group managers](struct.RegionInstanceGroupManagerGetCall.html) (response) -/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (none) -/// * [list instance group managers](struct.InstanceGroupManagerListCall.html) (none) -/// * [delete instance group managers](struct.InstanceGroupManagerDeleteCall.html) (none) -/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (none) -/// * [get instance group managers](struct.InstanceGroupManagerGetCall.html) (response) -/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (none) -/// * [insert region instance group managers](struct.RegionInstanceGroupManagerInsertCall.html) (request) -/// * [insert instance group managers](struct.InstanceGroupManagerInsertCall.html) (request) -/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (none) -/// * [patch instance group managers](struct.InstanceGroupManagerPatchCall.html) (request) -/// * [patch region instance group managers](struct.RegionInstanceGroupManagerPatchCall.html) (request) -/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManager { - /// [Output Only] The status of this managed instance group. - pub status: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// The autohealing policy for this managed instance group. You can specify only one value. - #[serde(rename="autoHealingPolicies")] - pub auto_healing_policies: Option>, - /// [Output Only] The URL of the Instance Group resource. - #[serde(rename="instanceGroup")] - pub instance_group: Option, - /// [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. - #[serde(rename="currentActions")] - pub current_actions: Option, - /// The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. - #[serde(rename="instanceTemplate")] - pub instance_template: Option, - /// Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. - /// - /// To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager. - pub fingerprint: Option, - /// [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. - pub kind: Option, - /// The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number. - #[serde(rename="targetSize")] - pub target_size: Option, - /// The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, - /// [Output Only] The URL of the zone where the managed instance group is located (for zonal resources). - pub zone: Option, - /// Specifies the instance templates used by this managed instance group to create instances. - /// - /// Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates. - pub versions: Option>, - /// [Output Only] The URL of the region where the managed instance group resides (for regional resources). - pub region: Option, - /// Policy specifying intended distribution of instances in regional managed instance group. - #[serde(rename="distributionPolicy")] - pub distribution_policy: Option, - /// [Output Only] A unique identifier for this resource type. The server generates this identifier. - pub id: Option, - /// The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. - #[serde(rename="baseInstanceName")] - pub base_instance_name: Option, - /// The update policy for this managed instance group. - #[serde(rename="updatePolicy")] - pub update_policy: Option, - /// The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. - #[serde(rename="targetPools")] - pub target_pools: Option>, - /// [Output Only] The URL for this managed instance group. The server defines this URL. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Named ports configured for the Instance Groups complementary to this Instance Group Manager. - #[serde(rename="namedPorts")] - pub named_ports: Option>, -} - -impl RequestValue for InstanceGroupManager {} -impl Resource for InstanceGroupManager {} -impl ResponseResult for InstanceGroupManager {} - - -/// Contain information of Nat mapping for an interface of this endpoint. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VmEndpointNatMappingsInterfaceNatMappings { - /// Primary IP of the VM for this NIC. - #[serde(rename="sourceVirtualIp")] - pub source_virtual_ip: Option, - /// Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges. - #[serde(rename="numTotalNatPorts")] - pub num_total_nat_ports: Option, - /// A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. - #[serde(rename="natIpPortRanges")] - pub nat_ip_port_ranges: Option>, - /// Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24". - #[serde(rename="sourceAliasIpRange")] - pub source_alias_ip_range: Option, -} - -impl Part for VmEndpointNatMappingsInterfaceNatMappings {} - - -/// Contains a list of machine types. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list machine types](struct.MachineTypeListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of MachineType resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for MachineTypeList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list region disk types](struct.RegionDiskTypeListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionDiskTypeList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of DiskType resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RegionDiskTypeList {} +impl Part for UrlRewrite {} /// Contains a list of instance referrers. @@ -2321,53 +1474,6 @@ pub struct InstanceListReferrers { impl ResponseResult for InstanceListReferrers {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HealthCheckListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for HealthCheckListWarningData {} -impl Part for HealthCheckListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list ssl policies](struct.SslPolicyListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslPoliciesList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of SslPolicy resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for SslPoliciesList {} - - /// There is no detailed description. /// /// # Activities @@ -2419,39 +1525,6 @@ pub struct Reference { impl Part for Reference {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicyListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for SecurityPolicyListWarningData {} -impl Part for SecurityPolicyListWarningData {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupsScopedList { - /// [Output Only] An informational warning that appears when the nodeGroup list is empty. - pub warning: Option, - /// [Output Only] A list of node groups contained in this scope. - #[serde(rename="nodeGroups")] - pub node_groups: Option>, -} - -impl Part for NodeGroupsScopedList {} - - /// Associates `members` with a `role`. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2468,7 +1541,7 @@ pub struct Binding { /// /// * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. /// - /// * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` . + /// * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . /// /// /// @@ -2476,6 +1549,12 @@ pub struct Binding { /// /// * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. + /// /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. @@ -2485,136 +1564,64 @@ pub struct Binding { impl Part for Binding {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set security policy backend services](struct.BackendServiceSetSecurityPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicyReference { - /// no description provided - #[serde(rename="securityPolicy")] - pub security_policy: Option, -} - -impl RequestValue for SecurityPolicyReference {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagerStatus { - /// [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. - #[serde(rename="isStable")] - pub is_stable: Option, +pub struct InstanceManagedByIgmError { + /// [Output Only] The time that this error occurred. This value is in RFC3339 text format. + pub timestamp: Option, + /// [Output Only] Details of the instance action that triggered this error. May be null, if the error was not caused by an action on an instance. This field is optional. + #[serde(rename="instanceActionDetails")] + pub instance_action_details: Option, + /// [Output Only] Contents of the error. + pub error: Option, } -impl Part for InstanceGroupManagerStatus {} +impl Part for InstanceManagedByIgmError {} -/// Informational warning which replaces the list of backend services when the list is empty. +/// Represents an Accelerator Type resource. /// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServicesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for BackendServicesScopedListWarning {} -impl Part for BackendServicesScopedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstanceListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetInstanceListWarningData {} -impl Part for TargetInstanceListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetHttpsProxyListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetHttpsProxyListWarningData {} -impl Part for TargetHttpsProxyListWarningData {} - - -/// Contains a list of Route resources. +/// Google Cloud Platform provides graphics processing units (accelerators) that you can add to VM instances to improve or accelerate performance when working with intensive workloads. For more information, read GPUs on Compute Engine. (== resource_for {$api_version}.acceleratorTypes ==) /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list routes](struct.RouteListCall.html) (response) +/// * [list accelerator types](struct.AcceleratorTypeListCall.html) (none) +/// * [get accelerator types](struct.AcceleratorTypeGetCall.html) (response) +/// * [aggregated list accelerator types](struct.AcceleratorTypeAggregatedListCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouteList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. +pub struct AcceleratorType { + /// [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Route resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RouteList {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LicenseCodeLicenseAlias { - /// [Output Only] Description of this License Code. + /// [Output Only] An optional textual description of the resource. pub description: Option, - /// [Output Only] URL of license corresponding to this License Code. + /// [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub zone: Option, + /// [Output Only] The deprecation status associated with this accelerator type. + pub deprecated: Option, + /// [Output Only] Maximum accelerator cards allowed per instance. + #[serde(rename="maximumCardsPerInstance")] + pub maximum_cards_per_instance: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined fully-qualified URL for this resource. #[serde(rename="selfLink")] pub self_link: Option, + /// [Output Only] Name of the resource. + pub name: Option, } -impl Part for LicenseCodeLicenseAlias {} +impl Resource for AcceleratorType {} +impl ResponseResult for AcceleratorType {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -2634,161 +1641,6 @@ impl NestedType for InstanceGroupManagerListWarningData {} impl Part for InstanceGroupManagerListWarningData {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRuleListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for ForwardingRuleListWarning {} -impl Part for ForwardingRuleListWarning {} - - -/// Represents an Interconnect Attachment (VLAN) Location resource. -/// -/// You can use this resource to find location details about an Interconnect attachment (VLAN). For more information about interconnect attachments, read Creating VLAN Attachments. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list interconnect locations](struct.InterconnectLocationListCall.html) (none) -/// * [get interconnect locations](struct.InterconnectLocationGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectLocation { - /// [Output Only] The status of this InterconnectLocation, which can take one of the following values: - /// - CLOSED: The InterconnectLocation is closed and is unavailable for provisioning new Interconnects. - /// - AVAILABLE: The InterconnectLocation is available for provisioning new Interconnects. - pub status: Option, - /// [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". - pub city: Option, - /// [Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations. - pub kind: Option, - /// [Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: "zone1" or "zone2". - #[serde(rename="availabilityZone")] - pub availability_zone: Option, - /// [Output Only] An optional description of the resource. - pub description: Option, - /// [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). - #[serde(rename="peeringdbFacilityId")] - pub peeringdb_facility_id: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Continent for this location, which can take one of the following values: - /// - AFRICA - /// - ASIA_PAC - /// - EUROPE - /// - NORTH_AMERICA - /// - SOUTH_AMERICA - pub continent: Option, - /// [Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions. - #[serde(rename="regionInfos")] - pub region_infos: Option>, - /// [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). - #[serde(rename="facilityProviderFacilityId")] - pub facility_provider_facility_id: Option, - /// [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. - pub address: Option, - /// [Output Only] The name of the provider for this facility (e.g., EQUINIX). - #[serde(rename="facilityProvider")] - pub facility_provider: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Name of the resource. - pub name: Option, -} - -impl Resource for InterconnectLocation {} -impl ResponseResult for InterconnectLocation {} - - -/// The named port. For example: . -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NamedPort { - /// The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, - /// The port number, which can be a value between 1 and 65535. - pub port: Option, -} - -impl Part for NamedPort {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for DiskListWarning {} -impl Part for DiskListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagerListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstanceGroupManagerListWarning {} -impl Part for InstanceGroupManagerListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworkListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for SubnetworkListWarning {} -impl Part for SubnetworkListWarning {} - - /// There is no detailed description. /// /// # Activities @@ -2796,179 +1648,35 @@ impl Part for SubnetworkListWarning {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (request) +/// * [set named ports region instance groups](struct.RegionInstanceGroupSetNamedPortCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceReference { - /// The URL for a specific instance. - pub instance: Option, +pub struct RegionInstanceGroupsSetNamedPortsRequest { + /// The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + pub fingerprint: Option, + /// The list of named ports to set for this instance group. + #[serde(rename="namedPorts")] + pub named_ports: Option>, } -impl RequestValue for InstanceReference {} +impl RequestValue for RegionInstanceGroupsSetNamedPortsRequest {} -/// Contains a list of routers. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list routers](struct.RouterAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Router resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RouterAggregatedList {} - - -/// A Shielded Instance Identity Entry. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ShieldedInstanceIdentityEntry { - /// A PEM-encoded X.509 certificate. This field can be empty. - #[serde(rename="ekCert")] - pub ek_cert: Option, - /// A PEM-encoded public key. - #[serde(rename="ekPub")] - pub ek_pub: Option, +pub struct SubnetworksScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl Part for ShieldedInstanceIdentityEntry {} - - -/// A condition to be met. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Condition { - /// Trusted attributes supplied by the IAM system. - pub iam: Option, - /// Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. - pub sys: Option, - /// The objects of the condition. - pub values: Option>, - /// Trusted attributes discharged by the service. - pub svc: Option, - /// An operator to apply the subject with. - pub op: Option, -} - -impl Part for Condition {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list managed instances region instance group managers](struct.RegionInstanceGroupManagerListManagedInstanceCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagersListInstancesResponse { - /// A list of managed instances. - #[serde(rename="managedInstances")] - pub managed_instances: Option>, -} - -impl ResponseResult for RegionInstanceGroupManagersListInstancesResponse {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete instances region instance group managers](struct.RegionInstanceGroupManagerDeleteInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagersDeleteInstancesRequest { - /// The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - pub instances: Option>, -} - -impl RequestValue for RegionInstanceGroupManagersDeleteInstancesRequest {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstanceListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetInstanceListWarning {} -impl Part for TargetInstanceListWarning {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TCPHealthCheck { - /// The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. - pub port: Option, - /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. - #[serde(rename="portName")] - pub port_name: Option, - /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, - /// The application data to send once the TCP connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. - pub request: Option, - /// Specifies how port is selected for health checking, can be one of following values: - /// USE_FIXED_PORT: The port number in - /// port - /// is used for health checking. - /// USE_NAMED_PORT: The - /// portName - /// is used for health checking. - /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - /// - /// - /// If not specified, TCP health check follows behavior specified in - /// port - /// and - /// portName - /// fields. - #[serde(rename="portSpecification")] - pub port_specification: Option, - /// The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. - pub response: Option, -} - -impl Part for TCPHealthCheck {} +impl NestedType for SubnetworksScopedListWarningData {} +impl Part for SubnetworksScopedListWarningData {} /// There is no detailed description. @@ -2985,7 +1693,7 @@ pub struct NetworksAddPeeringRequest { /// Network peering parameters. In order to specify route policies for peering using import and export custom routes, you must specify all peering related parameters (name, peer network, exchange_subnet_routes) in the network_peering field. The corresponding fields in NetworksAddPeeringRequest will be deprecated soon. #[serde(rename="networkPeering")] pub network_peering: Option, - /// This field will be deprecated soon. Use exchange_subnet_routes in network_peering instead. Whether Google Compute Engine manages the routes automatically. + /// This field will be deprecated soon. Use exchange_subnet_routes in network_peering instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. #[serde(rename="autoCreateRoutes")] pub auto_create_routes: Option, /// URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. @@ -2998,36 +1706,6 @@ pub struct NetworksAddPeeringRequest { impl RequestValue for NetworksAddPeeringRequest {} -/// A list of instance templates. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list instance templates](struct.InstanceTemplateListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceTemplateList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InstanceTemplate resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InstanceTemplateList {} - - /// Contains a list of TargetTcpProxy resources. /// /// # Activities @@ -3058,128 +1736,45 @@ pub struct TargetTcpProxyList { impl ResponseResult for TargetTcpProxyList {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// In contrast to a single BackendService in HttpRouteAction to which all matching traffic is directed to, WeightedBackendService allows traffic to be split across multiple BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LicensesListResponseWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct WeightedBackendService { + /// Specifies changes to request and response headers that need to take effect for the selected backendService. + /// headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + #[serde(rename="headerAction")] + pub header_action: Option, + /// Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . + /// The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. + /// The value must be between 0 and 1000 + pub weight: Option, + /// The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. + #[serde(rename="backendService")] + pub backend_service: Option, } -impl NestedType for LicensesListResponseWarningData {} -impl Part for LicensesListResponseWarningData {} +impl Part for WeightedBackendService {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommitmentsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct LicensesListResponseWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, } -impl NestedType for CommitmentsScopedListWarningData {} -impl Part for CommitmentsScopedListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InterconnectAttachmentsScopedListWarningData {} -impl Part for InterconnectAttachmentsScopedListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstanceGroupListWarningData {} -impl Part for InstanceGroupListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [remove resource policies disks](struct.DiskRemoveResourcePolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksRemoveResourcePoliciesRequest { - /// Resource policies to be removed from this disk. - #[serde(rename="resourcePolicies")] - pub resource_policies: Option>, -} - -impl RequestValue for DisksRemoveResourcePoliciesRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set service account instances](struct.InstanceSetServiceAccountCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesSetServiceAccountRequest { - /// The list of scopes to be made available for this service account. - pub scopes: Option>, - /// Email address of the service account. - pub email: Option, -} - -impl RequestValue for InstancesSetServiceAccountRequest {} - - -/// Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SchedulingNodeAffinity { - /// Defines the operation of node selection. - pub operator: Option, - /// Corresponds to the label values of Node resource. - pub values: Option>, - /// Corresponds to the label key of Node resource. - pub key: Option, -} - -impl Part for SchedulingNodeAffinity {} +impl NestedType for LicensesListResponseWarning {} +impl Part for LicensesListResponseWarning {} /// There is no detailed description. @@ -3229,34 +1824,6 @@ pub struct InstanceMoveRequest { impl RequestValue for InstanceMoveRequest {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [move disk projects](struct.ProjectMoveDiskCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskMoveRequest { - /// The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: - /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - /// - projects/project/zones/zone/disks/disk - /// - zones/zone/disks/disk - #[serde(rename="targetDisk")] - pub target_disk: Option, - /// The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone - /// - projects/project/zones/zone - /// - zones/zone - #[serde(rename="destinationZone")] - pub destination_zone: Option, -} - -impl RequestValue for DiskMoveRequest {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3272,124 +1839,21 @@ pub struct RoutersScopedList { impl Part for RoutersScopedList {} -/// Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only. Next id: 4 -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectCircuitInfo { - /// Customer-side demarc ID for this circuit. - #[serde(rename="customerDemarcId")] - pub customer_demarc_id: Option, - /// Google-assigned unique ID for this circuit. Assigned at circuit turn-up. - #[serde(rename="googleCircuitId")] - pub google_circuit_id: Option, - /// Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA. - #[serde(rename="googleDemarcId")] - pub google_demarc_id: Option, -} - -impl Part for InterconnectCircuitInfo {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [invalidate cache url maps](struct.UrlMapInvalidateCacheCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CacheInvalidationRule { - /// no description provided - pub path: Option, - /// If set, this invalidation rule will only apply to requests with a Host header matching host. - pub host: Option, -} - -impl RequestValue for CacheInvalidationRule {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationListWarningData { +pub struct TargetTcpProxyListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for OperationListWarningData {} -impl Part for OperationListWarningData {} - - -/// Encapsulates numeric value that can be either absolute or relative. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FixedOrPercent { - /// [Output Only] Absolute value of VM instances calculated based on the specific mode. - /// - /// - /// - If the value is fixed, then the calculated value is equal to the fixed value. - /// - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up. - pub calculated: Option, - /// Specifies a fixed number of VM instances. This must be a positive integer. - pub fixed: Option, - /// Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. - pub percent: Option, -} - -impl Part for FixedOrPercent {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersSetTargetPoolsRequest { - /// The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. - pub fingerprint: Option, - /// The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings. - #[serde(rename="targetPools")] - pub target_pools: Option>, -} - -impl RequestValue for InstanceGroupManagersSetTargetPoolsRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set target pools region instance group managers](struct.RegionInstanceGroupManagerSetTargetPoolCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagersSetTargetPoolsRequest { - /// Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional. - pub fingerprint: Option, - /// The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. - #[serde(rename="targetPools")] - pub target_pools: Option>, -} - -impl RequestValue for RegionInstanceGroupManagersSetTargetPoolsRequest {} +impl NestedType for TargetTcpProxyListWarningData {} +impl Part for TargetTcpProxyListWarningData {} /// [Output Only] Informational warning message. @@ -3411,79 +1875,6 @@ impl NestedType for TargetSslProxyListWarning {} impl Part for TargetSslProxyListWarning {} -/// The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FirewallAllowed { - /// The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. - #[serde(rename="IPProtocol")] - pub ip_protocol: Option, - /// An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. - /// - /// Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. - pub ports: Option>, -} - -impl NestedType for FirewallAllowed {} -impl Part for FirewallAllowed {} - - -/// Represent a sole-tenant Node Group resource. -/// -/// A sole-tenant node is a physical server that is dedicated to hosting VM instances only for your specific project. Use sole-tenant nodes to keep your instances physically separated from instances in other projects, or to group your instances together on the same host hardware. For more information, read Sole-tenant nodes. (== resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==) NextID: 15 -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list node groups](struct.NodeGroupAggregatedListCall.html) (none) -/// * [delete node groups](struct.NodeGroupDeleteCall.html) (none) -/// * [test iam permissions node groups](struct.NodeGroupTestIamPermissionCall.html) (none) -/// * [insert node groups](struct.NodeGroupInsertCall.html) (request) -/// * [delete nodes node groups](struct.NodeGroupDeleteNodeCall.html) (none) -/// * [get iam policy node groups](struct.NodeGroupGetIamPolicyCall.html) (none) -/// * [set node template node groups](struct.NodeGroupSetNodeTemplateCall.html) (none) -/// * [get node groups](struct.NodeGroupGetCall.html) (response) -/// * [list node groups](struct.NodeGroupListCall.html) (none) -/// * [list nodes node groups](struct.NodeGroupListNodeCall.html) (none) -/// * [add nodes node groups](struct.NodeGroupAddNodeCall.html) (none) -/// * [set iam policy node groups](struct.NodeGroupSetIamPolicyCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroup { - /// no description provided - pub status: Option, - /// [Output Only] The type of the resource. Always compute#nodeGroup for node group. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// [Output Only] The name of the zone where the node group resides, such as us-central1-a. - pub zone: Option, - /// The URL of the node template to which this node group belongs. - #[serde(rename="nodeTemplate")] - pub node_template: Option, - /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] The total number of nodes in the node group. - pub size: Option, -} - -impl RequestValue for NodeGroup {} -impl Resource for NodeGroup {} -impl ResponseResult for NodeGroup {} - - /// Contains a list of networks. /// /// # Activities @@ -3514,34 +1905,18 @@ pub struct NetworkList { impl ResponseResult for NetworkList {} -/// Contains a list of zone resources. +/// A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list zones](struct.ZoneListCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ZoneList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Zone resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, +pub struct RequestMirrorPolicy { + /// The full or partial URL to the BackendService resource being mirrored to. + #[serde(rename="backendService")] + pub backend_service: Option, } -impl ResponseResult for ZoneList {} +impl Part for RequestMirrorPolicy {} /// There is no detailed description. @@ -3551,48 +1926,33 @@ impl ResponseResult for ZoneList {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (response) +/// * [remove resource policies disks](struct.DiskRemoveResourcePolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of MachineTypesScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, +pub struct DisksRemoveResourcePoliciesRequest { + /// Resource policies to be removed from this disk. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, } -impl ResponseResult for MachineTypeAggregatedList {} +impl RequestValue for DisksRemoveResourcePoliciesRequest {} -/// Provides the configuration for logging a type of permissions. Example: -/// -/// { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } -/// -/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. - #[serde(rename="exemptedMembers")] - pub exempted_members: Option>, - /// The log type that this config enables. - #[serde(rename="logType")] - pub log_type: Option, +pub struct VpnGatewaysScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl Part for AuditLogConfig {} +impl NestedType for VpnGatewaysScopedListWarningData {} +impl Part for VpnGatewaysScopedListWarningData {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -3612,233 +1972,6 @@ impl NestedType for CommitmentAggregatedListWarningData {} impl Part for CommitmentAggregatedListWarningData {} -/// Contains a list of TargetInstance resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list target instances](struct.TargetInstanceListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstanceList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of TargetInstance resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for TargetInstanceList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list available features ssl policies](struct.SslPolicyListAvailableFeatureCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslPoliciesListAvailableFeaturesResponse { - /// no description provided - pub features: Option>, -} - -impl ResponseResult for SslPoliciesListAvailableFeaturesResponse {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ReservationsScopedListWarningData {} -impl Part for ReservationsScopedListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NodeGroupAggregatedListWarningData {} -impl Part for NodeGroupAggregatedListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (request) -/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (request) -/// * [set target global forwarding rules](struct.GlobalForwardingRuleSetTargetCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetReference { - /// no description provided - pub target: Option, -} - -impl RequestValue for TargetReference {} - - -/// Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstancesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetInstancesScopedListWarning {} -impl Part for TargetInstancesScopedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VmEndpointNatMappingsListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for VmEndpointNatMappingsListWarningData {} -impl Part for VmEndpointNatMappingsListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslPoliciesListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for SslPoliciesListWarning {} -impl Part for SslPoliciesListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set min cpu platform instances](struct.InstanceSetMinCpuPlatformCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesSetMinCpuPlatformRequest { - /// Minimum cpu/platform this instance should be started at. - #[serde(rename="minCpuPlatform")] - pub min_cpu_platform: Option, -} - -impl RequestValue for InstancesSetMinCpuPlatformRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list forwarding rules](struct.ForwardingRuleAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRuleAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of ForwardingRulesScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for ForwardingRuleAggregatedList {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestFailure { - /// no description provided - pub path: Option, - /// no description provided - #[serde(rename="actualService")] - pub actual_service: Option, - /// no description provided - pub host: Option, - /// no description provided - #[serde(rename="expectedService")] - pub expected_service: Option, -} - -impl Part for TestFailure {} - - /// An alias IP range attached to an instance's network interface. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3856,160 +1989,40 @@ pub struct AliasIpRange { impl Part for AliasIpRange {} -/// Contains a list of node types. +/// There is no detailed description. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list node types](struct.NodeTypeListCall.html) (response) +/// * [set proxy header target ssl proxies](struct.TargetSslProxySetProxyHeaderCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTypeList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource.Always compute#nodeTypeList for lists of node types. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of NodeType resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, +pub struct TargetSslProxiesSetProxyHeaderRequest { + /// The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, } -impl ResponseResult for NodeTypeList {} +impl RequestValue for TargetSslProxiesSetProxyHeaderRequest {} -/// Informational warning which replaces the list of reservations when the list is empty. +/// Secondary IP range of a usable subnetwork. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationsScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, +pub struct UsableSubnetworkSecondaryRange { + /// The range of IP addresses belonging to this subnetwork secondary range. + #[serde(rename="ipCidrRange")] + pub ip_cidr_range: Option, + /// The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + #[serde(rename="rangeName")] + pub range_name: Option, } -impl NestedType for ReservationsScopedListWarning {} -impl Part for ReservationsScopedListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommitmentAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for CommitmentAggregatedListWarning {} -impl Part for CommitmentAggregatedListWarning {} - - -/// [Output Only] If warning messages are generated during processing of the operation, this field will be populated. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationWarnings { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for OperationWarnings {} -impl Part for OperationWarnings {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointWithHealthStatus { - /// [Output only] The health status of network endpoint; - pub healths: Option>, - /// [Output only] The network endpoint; - #[serde(rename="networkEndpoint")] - pub network_endpoint: Option, -} - -impl Part for NetworkEndpointWithHealthStatus {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FirewallListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for FirewallListWarningData {} -impl Part for FirewallListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTypeAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeTypeAggregatedListWarning {} -impl Part for NodeTypeAggregatedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for MachineTypesScopedListWarningData {} -impl Part for MachineTypesScopedListWarningData {} +impl Part for UsableSubnetworkSecondaryRange {} /// Contains a list of TargetHttpsProxy resources. @@ -4019,6 +2032,7 @@ impl Part for MachineTypesScopedListWarningData {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [list region target https proxies](struct.RegionTargetHttpsProxyListCall.html) (response) /// * [list target https proxies](struct.TargetHttpsProxyListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -4042,23 +2056,6 @@ pub struct TargetHttpsProxyList { impl ResponseResult for TargetHttpsProxyList {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRuleAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ForwardingRuleAggregatedListWarningData {} -impl Part for ForwardingRuleAggregatedListWarningData {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4099,75 +2096,6 @@ impl NestedType for UsableSubnetworksAggregatedListWarning {} impl Part for UsableSubnetworksAggregatedListWarning {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetPoolAggregatedListWarning {} -impl Part for TargetPoolAggregatedListWarning {} - - -/// [Output Only] The warning that replaces the list of managed instance groups when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstanceGroupManagersScopedListWarning {} -impl Part for InstanceGroupManagersScopedListWarning {} - - -/// Contains a list of BackendService resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list backend services](struct.BackendServiceListCall.html) (response) -/// * [list region backend services](struct.RegionBackendServiceListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServiceList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of BackendService resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for BackendServiceList {} - - /// Contains a list of resourcePolicies. /// /// # Activities @@ -4200,39 +2128,6 @@ pub struct ResourcePolicyAggregatedList { impl ResponseResult for ResourcePolicyAggregatedList {} -/// Time window specified for weekly operations. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicyWeeklyCycle { - /// Up to 7 intervals/windows, one for each day of the week. - #[serde(rename="dayOfWeeks")] - pub day_of_weeks: Option>, -} - -impl Part for ResourcePolicyWeeklyCycle {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ImageListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for ImageListWarning {} -impl Part for ImageListWarning {} - - /// There is no detailed description. /// /// # Activities @@ -4241,17 +2136,20 @@ impl Part for ImageListWarning {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [test iam permissions instances](struct.InstanceTestIamPermissionCall.html) (response) -/// * [test iam permissions resource policies](struct.ResourcePolicyTestIamPermissionCall.html) (response) -/// * [test iam permissions license codes](struct.LicenseCodeTestIamPermissionCall.html) (response) -/// * [test iam permissions node templates](struct.NodeTemplateTestIamPermissionCall.html) (response) -/// * [test iam permissions snapshots](struct.SnapshotTestIamPermissionCall.html) (response) +/// * [test iam permissions vpn gateways](struct.VpnGatewayTestIamPermissionCall.html) (response) /// * [test iam permissions node groups](struct.NodeGroupTestIamPermissionCall.html) (response) +/// * [test iam permissions license codes](struct.LicenseCodeTestIamPermissionCall.html) (response) +/// * [test iam permissions snapshots](struct.SnapshotTestIamPermissionCall.html) (response) +/// * [test iam permissions resource policies](struct.ResourcePolicyTestIamPermissionCall.html) (response) +/// * [test iam permissions node templates](struct.NodeTemplateTestIamPermissionCall.html) (response) +/// * [test iam permissions external vpn gateways](struct.ExternalVpnGatewayTestIamPermissionCall.html) (response) /// * [test iam permissions images](struct.ImageTestIamPermissionCall.html) (response) -/// * [test iam permissions reservations](struct.ReservationTestIamPermissionCall.html) (response) +/// * [test iam permissions disks](struct.DiskTestIamPermissionCall.html) (response) +/// * [test iam permissions packet mirrorings](struct.PacketMirroringTestIamPermissionCall.html) (response) /// * [test iam permissions region disks](struct.RegionDiskTestIamPermissionCall.html) (response) /// * [test iam permissions instance templates](struct.InstanceTemplateTestIamPermissionCall.html) (response) /// * [test iam permissions subnetworks](struct.SubnetworkTestIamPermissionCall.html) (response) -/// * [test iam permissions disks](struct.DiskTestIamPermissionCall.html) (response) +/// * [test iam permissions reservations](struct.ReservationTestIamPermissionCall.html) (response) /// * [test iam permissions licenses](struct.LicenseTestIamPermissionCall.html) (response) /// * [test iam permissions network endpoint groups](struct.NetworkEndpointGroupTestIamPermissionCall.html) (response) /// @@ -4264,83 +2162,6 @@ pub struct TestPermissionsResponse { impl ResponseResult for TestPermissionsResponse {} -/// Represents a Cloud VPN Tunnel resource. -/// -/// For more information about VPN, read the the Cloud VPN Overview. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete vpn tunnels](struct.VpnTunnelDeleteCall.html) (none) -/// * [aggregated list vpn tunnels](struct.VpnTunnelAggregatedListCall.html) (none) -/// * [get vpn tunnels](struct.VpnTunnelGetCall.html) (response) -/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (request) -/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnel { - /// [Output Only] Detailed status message for the VPN tunnel. - #[serde(rename="detailedStatus")] - pub detailed_status: Option, - /// IKE protocol version to use when establishing the VPN tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2. - #[serde(rename="ikeVersion")] - pub ike_version: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported. - #[serde(rename="localTrafficSelector")] - pub local_traffic_selector: Option>, - /// Hash of the shared secret. - #[serde(rename="sharedSecretHash")] - pub shared_secret_hash: Option, - /// URL of the router resource to be used for dynamic routing. - pub router: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. - #[serde(rename="sharedSecret")] - pub shared_secret: Option, - /// IP address of the peer VPN gateway. Only IPv4 is supported. - #[serde(rename="peerIp")] - pub peer_ip: Option, - /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - pub kind: Option, - /// Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. - #[serde(rename="remoteTrafficSelector")] - pub remote_traffic_selector: Option>, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] URL of the region where the VPN tunnel resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. - pub region: Option, - /// [Output Only] The status of the VPN tunnel, which can be one of the following: - /// - PROVISIONING: Resource is being allocated for the VPN tunnel. - /// - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. - /// - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. - /// - ESTABLISHED: Secure session is successfully established with the peer VPN. - /// - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS - /// - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). - /// - NEGOTIATION_FAILURE: Handshake failed. - /// - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. - /// - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. - pub status: Option, - /// URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. - #[serde(rename="targetVpnGateway")] - pub target_vpn_gateway: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for VpnTunnel {} -impl Resource for VpnTunnel {} -impl ResponseResult for VpnTunnel {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4360,37 +2181,6 @@ impl NestedType for RegionInstanceGroupsListInstancesWarning {} impl Part for RegionInstanceGroupsListInstancesWarning {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstanceAggregatedListWarningData {} -impl Part for InstanceAggregatedListWarningData {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRuleReference { - /// no description provided - #[serde(rename="forwardingRule")] - pub forwarding_rule: Option, -} - -impl Part for ForwardingRuleReference {} - - /// Defines the IP ranges that want to use NAT for a subnetwork. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4410,31 +2200,6 @@ pub struct RouterNatSubnetworkToNat { impl Part for RouterNatSubnetworkToNat {} -/// A set of Shielded Instance options. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [update shielded instance config instances](struct.InstanceUpdateShieldedInstanceConfigCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ShieldedInstanceConfig { - /// Defines whether the instance has the vTPM enabled. - #[serde(rename="enableVtpm")] - pub enable_vtpm: Option, - /// Defines whether the instance has integrity monitoring enabled. - #[serde(rename="enableIntegrityMonitoring")] - pub enable_integrity_monitoring: Option, - /// Defines whether the instance has Secure Boot enabled. - #[serde(rename="enableSecureBoot")] - pub enable_secure_boot: Option, -} - -impl RequestValue for ShieldedInstanceConfig {} - - /// [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4454,185 +2219,28 @@ impl NestedType for SslPolicyWarnings {} impl Part for SslPolicyWarnings {} -/// Deprecation status for a public resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [deprecate images](struct.ImageDeprecateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeprecationStatus { - /// An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. - pub deleted: Option, - /// An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. - pub deprecated: Option, - /// The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. - pub state: Option, - /// An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. - pub obsolete: Option, - /// The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. - pub replacement: Option, -} - -impl RequestValue for DeprecationStatus {} - - -/// Time window specified for hourly operations. +/// Informational warning which replaces the list of backend services when the list is empty. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicyHourlyCycle { - /// [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. - pub duration: Option, - /// Allows to define schedule that runs every nth hour. - #[serde(rename="hoursInCycle")] - pub hours_in_cycle: Option, - /// Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. - #[serde(rename="startTime")] - pub start_time: Option, -} - -impl Part for ResourcePolicyHourlyCycle {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [start with encryption key instances](struct.InstanceStartWithEncryptionKeyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesStartWithEncryptionKeyRequest { - /// Array of disks associated with this instance that are protected with a customer-supplied encryption key. - /// - /// In order to start the instance, the disk url and its corresponding key must be provided. - /// - /// If the disk is not protected with a customer-supplied encryption key it should not be specified. - pub disks: Option>, -} - -impl RequestValue for InstancesStartWithEncryptionKeyRequest {} - - -/// A Managed Instance resource. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedInstance { - /// [Output Only] The status of the instance. This field is empty when the instance does not exist. - #[serde(rename="instanceStatus")] - pub instance_status: Option, - /// [Output Only] Intended version of this instance. - pub version: Option, - /// [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. - pub instance: Option, - /// [Output Only] Information about the last attempt to create or delete the instance. - #[serde(rename="lastAttempt")] - pub last_attempt: Option, - /// [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - /// - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - /// - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - /// - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - /// - RECREATING The managed instance group is recreating this instance. - /// - DELETING The managed instance group is permanently deleting this instance. - /// - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - /// - RESTARTING The managed instance group is restarting the instance. - /// - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - /// - VERIFYING The managed instance group has created the instance and it is in the process of being verified. - #[serde(rename="currentAction")] - pub current_action: Option, - /// [Output only] The unique identifier for this resource. This field is empty when instance does not exist. - pub id: Option, -} - -impl Part for ManagedInstance {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationListWarning { +pub struct TargetHttpProxiesScopedListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for ReservationListWarning {} -impl Part for ReservationListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslPolicyWarningsData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for SslPolicyWarningsData {} -impl Part for SslPolicyWarningsData {} - - -/// [Output Only] Informational warning which replaces the list of instances when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstancesScopedListWarning {} -impl Part for InstancesScopedListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicyListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for SecurityPolicyListWarning {} -impl Part for SecurityPolicyListWarning {} +impl NestedType for TargetHttpProxiesScopedListWarning {} +impl Part for TargetHttpProxiesScopedListWarning {} /// Represents an Instance resource. /// -/// An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances. (== resource_for beta.instances ==) (== resource_for v1.instances ==) +/// An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances. (== resource_for {$api_version}.instances ==) /// /// # Activities /// @@ -4641,26 +2249,30 @@ impl Part for SecurityPolicyListWarning {} /// /// * [get serial port output instances](struct.InstanceGetSerialPortOutputCall.html) (none) /// * [stop instances](struct.InstanceStopCall.html) (none) -/// * [get iam policy instances](struct.InstanceGetIamPolicyCall.html) (none) +/// * [insert instances](struct.InstanceInsertCall.html) (request) /// * [get instances](struct.InstanceGetCall.html) (response) +/// * [update display device instances](struct.InstanceUpdateDisplayDeviceCall.html) (none) /// * [set tags instances](struct.InstanceSetTagCall.html) (none) /// * [set disk auto delete instances](struct.InstanceSetDiskAutoDeleteCall.html) (none) +/// * [get iam policy instances](struct.InstanceGetIamPolicyCall.html) (none) /// * [update shielded instance config instances](struct.InstanceUpdateShieldedInstanceConfigCall.html) (none) /// * [set metadata instances](struct.InstanceSetMetadataCall.html) (none) /// * [simulate maintenance event instances](struct.InstanceSimulateMaintenanceEventCall.html) (none) /// * [detach disk instances](struct.InstanceDetachDiskCall.html) (none) /// * [delete access config instances](struct.InstanceDeleteAccessConfigCall.html) (none) /// * [set machine type instances](struct.InstanceSetMachineTypeCall.html) (none) -/// * [insert instances](struct.InstanceInsertCall.html) (request) /// * [update network interface instances](struct.InstanceUpdateNetworkInterfaceCall.html) (none) /// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (none) /// * [set machine resources instances](struct.InstanceSetMachineResourceCall.html) (none) -/// * [set labels instances](struct.InstanceSetLabelCall.html) (none) +/// * [set min cpu platform instances](struct.InstanceSetMinCpuPlatformCall.html) (none) /// * [update access config instances](struct.InstanceUpdateAccessConfigCall.html) (none) /// * [set deletion protection instances](struct.InstanceSetDeletionProtectionCall.html) (none) /// * [set shielded instance integrity policy instances](struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html) (none) /// * [set service account instances](struct.InstanceSetServiceAccountCall.html) (none) /// * [list referrers instances](struct.InstanceListReferrerCall.html) (none) +/// * [set labels instances](struct.InstanceSetLabelCall.html) (none) +/// * [update instances](struct.InstanceUpdateCall.html) (request) +/// * [add resource policies instances](struct.InstanceAddResourcePolicyCall.html) (none) /// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (none) /// * [delete instances](struct.InstanceDeleteCall.html) (none) /// * [reset instances](struct.InstanceResetCall.html) (none) @@ -4671,7 +2283,7 @@ impl Part for SecurityPolicyListWarning {} /// * [list instances](struct.InstanceListCall.html) (none) /// * [start instances](struct.InstanceStartCall.html) (none) /// * [start with encryption key instances](struct.InstanceStartWithEncryptionKeyCall.html) (none) -/// * [set min cpu platform instances](struct.InstanceSetMinCpuPlatformCall.html) (none) +/// * [remove resource policies instances](struct.InstanceRemoveResourcePolicyCall.html) (none) /// * [set iam policy instances](struct.InstanceSetIamPolicyCall.html) (none) /// * [aggregated list instances](struct.InstanceAggregatedListCall.html) (none) /// @@ -4698,6 +2310,16 @@ pub struct Instance { pub guest_accelerators: Option>, /// Labels to apply to this instance. These can be later modified by the setLabels method. pub labels: Option>, + /// Enables display device for the instance. + #[serde(rename="displayDevice")] + pub display_device: Option, + /// Resource policies applied to this instance. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, + /// Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance. + /// + /// To see the latest fingerprint, make get() request to the instance. + pub fingerprint: Option, /// Sets the scheduling options for this instance. pub scheduling: Option, /// Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". @@ -4741,7 +2363,7 @@ pub struct Instance { pub shielded_instance_config: Option, /// [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. pub zone: Option, - /// no description provided + /// Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS. pub hostname: Option, /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, @@ -4770,25 +2392,6 @@ impl Resource for Instance {} impl ResponseResult for Instance {} -/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewaysScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetVpnGatewaysScopedListWarning {} -impl Part for TargetVpnGatewaysScopedListWarning {} - - /// There is no detailed description. /// /// # Activities @@ -4807,72 +2410,6 @@ pub struct TargetTcpProxiesSetBackendServiceRequest { impl RequestValue for TargetTcpProxiesSetBackendServiceRequest {} -/// Message containing what to include in the cache key for a request for Cloud CDN. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CacheKeyPolicy { - /// Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. - #[serde(rename="queryStringBlacklist")] - pub query_string_blacklist: Option>, - /// If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely. - #[serde(rename="includeQueryString")] - pub include_query_string: Option, - /// Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. - #[serde(rename="queryStringWhitelist")] - pub query_string_whitelist: Option>, - /// If true, http and https requests will be cached separately. - #[serde(rename="includeProtocol")] - pub include_protocol: Option, - /// If true, requests to different hosts will be cached separately. - #[serde(rename="includeHost")] - pub include_host: Option, -} - -impl Part for CacheKeyPolicy {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for UrlMapListWarning {} -impl Part for UrlMapListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsAddInstanceRequest { - /// A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: - /// - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name - /// - projects/project-id/zones/zone/instances/instance-name - /// - zones/zone/instances/instance-name - pub instances: Option>, -} - -impl RequestValue for TargetPoolsAddInstanceRequest {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4892,56 +2429,6 @@ impl NestedType for RegionAutoscalerListWarning {} impl Part for RegionAutoscalerListWarning {} -/// -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagerAutoHealingPolicy { - /// The URL for the health check that signals autohealing. - #[serde(rename="healthCheck")] - pub health_check: Option, - /// The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600]. - #[serde(rename="initialDelaySec")] - pub initial_delay_sec: Option, -} - -impl Part for InstanceGroupManagerAutoHealingPolicy {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePoliciesScopedList { - /// A list of resourcePolicies contained in this scope. - #[serde(rename="resourcePolicies")] - pub resource_policies: Option>, - /// Informational warning which replaces the list of resourcePolicies when the list is empty. - pub warning: Option, -} - -impl Part for ResourcePoliciesScopedList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SnapshotListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for SnapshotListWarningData {} -impl Part for SnapshotListWarningData {} - - /// Status of a NAT contained in this router. Next tag: 9 /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4951,6 +2438,9 @@ pub struct RouterStatusNatStatus { /// A list of IPs user-allocated for NAT. They will be raw IP strings like "179.12.26.133". #[serde(rename="userAllocatedNatIps")] pub user_allocated_nat_ips: Option>, + /// A list of IPs user-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + #[serde(rename="drainUserAllocatedNatIps")] + pub drain_user_allocated_nat_ips: Option>, /// Unique name of this NAT. pub name: Option, /// A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", "129.2.16.89"] @@ -4959,44 +2449,30 @@ pub struct RouterStatusNatStatus { /// Number of VM endpoints (i.e., Nics) that can use NAT. #[serde(rename="numVmEndpointsWithNatMappings")] pub num_vm_endpoints_with_nat_mappings: Option, - /// The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used. - #[serde(rename="minExtraNatIpsNeeded")] - pub min_extra_nat_ips_needed: Option, /// A list of fully qualified URLs of reserved IP address resources. #[serde(rename="userAllocatedNatIpResources")] pub user_allocated_nat_ip_resources: Option>, + /// A list of IPs auto-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + #[serde(rename="drainAutoAllocatedNatIps")] + pub drain_auto_allocated_nat_ips: Option>, + /// The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used. + #[serde(rename="minExtraNatIpsNeeded")] + pub min_extra_nat_ips_needed: Option, } impl Part for RouterStatusNatStatus {} -/// Policy for retention of scheduled snapshots. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicySnapshotSchedulePolicyRetentionPolicy { - /// Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. - #[serde(rename="onSourceDiskDelete")] - pub on_source_disk_delete: Option, - /// Maximum age of the snapshot that is allowed to be kept. - #[serde(rename="maxRetentionDays")] - pub max_retention_days: Option, -} - -impl Part for ResourcePolicySnapshotSchedulePolicyRetentionPolicy {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RouterInterface { - /// URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be either be a VPN tunnel or an Interconnect attachment. + /// URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a virtual machine instance. #[serde(rename="linkedInterconnectAttachment")] pub linked_interconnect_attachment: Option, - /// URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be either a VPN tunnel or an Interconnect attachment. + /// URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a virtual machine instance. #[serde(rename="linkedVpnTunnel")] pub linked_vpn_tunnel: Option, /// [Output Only] The resource that configures and manages this interface. @@ -5007,7 +2483,7 @@ pub struct RouterInterface { /// IP address and range of the interface. The IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not truncate the address as it represents the IP address of the interface. #[serde(rename="ipRange")] pub ip_range: Option, - /// Name of this interface entry. The name must be 1-63 characters long and comply with RFC1035. + /// Name of this interface entry. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, } @@ -5016,58 +2492,18 @@ impl Part for RouterInterface {} /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [validate url maps](struct.UrlMapValidateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapsValidateRequest { - /// Content of the UrlMap to be validated. - pub resource: Option, -} - -impl RequestValue for UrlMapsValidateRequest {} - - -/// [Output Only] Informational warning message. -/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, +pub struct PacketMirroringMirroredResourceInfoInstanceInfo { + /// Resource URL to the virtual machine instance which is being mirrored. + pub url: Option, + /// [Output Only] Unique identifier for the instance; defined by the server. + #[serde(rename="canonicalUrl")] + pub canonical_url: Option, } -impl NestedType for InterconnectAttachmentAggregatedListWarning {} -impl Part for InterconnectAttachmentAggregatedListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for DiskTypeAggregatedListWarning {} -impl Part for DiskTypeAggregatedListWarning {} +impl Part for PacketMirroringMirroredResourceInfoInstanceInfo {} /// Contains a list of accelerator types. @@ -5100,38 +2536,6 @@ pub struct AcceleratorTypeList { impl ResponseResult for AcceleratorTypeList {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressesScopedList { - /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, - /// [Output Only] A list of addresses contained in this scope. - pub addresses: Option>, -} - -impl Part for AddressesScopedList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectLocationListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InterconnectLocationListWarningData {} -impl Part for InterconnectLocationListWarningData {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -5149,46 +2553,6 @@ impl NestedType for InstancesScopedListWarningData {} impl Part for InstancesScopedListWarningData {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectDiagnosticsLinkLACPStatus { - /// System ID of the port on the neighbor?s side of the LACP exchange. - #[serde(rename="neighborSystemId")] - pub neighbor_system_id: Option, - /// The state of a LACP link, which can take one of the following values: - /// - ACTIVE: The link is configured and active within the bundle. - /// - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. - pub state: Option, - /// System ID of the port on Google?s side of the LACP exchange. - #[serde(rename="googleSystemId")] - pub google_system_id: Option, -} - -impl Part for InterconnectDiagnosticsLinkLACPStatus {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for RegionInstanceGroupListWarning {} -impl Part for RegionInstanceGroupListWarning {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -5254,67 +2618,20 @@ pub struct TargetSslProxyList { impl ResponseResult for TargetSslProxyList {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstanceGroupAggregatedListWarningData {} -impl Part for InstanceGroupAggregatedListWarningData {} - - -/// Guest OS features. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GuestOsFeature { - /// The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. - #[serde(rename="type")] - pub type_: Option, -} - -impl Part for GuestOsFeature {} - - /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsListInstancesRequest { - /// A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. - #[serde(rename="instanceState")] - pub instance_state: Option, -} - -impl RequestValue for InstanceGroupsListInstancesRequest {} - - -/// Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED. -/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentPrivateInfo { - /// [Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region. - pub tag8021q: Option, +pub struct AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { + /// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + pub interface: Option, + /// Specifies the size of the disk in base-2 GB. + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, } -impl Part for InterconnectAttachmentPrivateInfo {} +impl Part for AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk {} /// There is no detailed description. @@ -5330,25 +2647,6 @@ pub struct DistributionPolicyZoneConfiguration { impl Part for DistributionPolicyZoneConfiguration {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommitmentListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for CommitmentListWarning {} -impl Part for CommitmentListWarning {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -5385,101 +2683,19 @@ impl NestedType for CommitmentsScopedListWarning {} impl Part for CommitmentsScopedListWarning {} -/// Specifies the reservations that this instance can consume from. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationAffinity { - /// Corresponds to the label values of a reservation resource. - pub values: Option>, - /// Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. - #[serde(rename="consumeReservationType")] - pub consume_reservation_type: Option, - /// Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value. - pub key: Option, +pub struct ReservationsScopedList { + /// A list of reservations contained in this scope. + pub reservations: Option>, + /// Informational warning which replaces the list of reservations when the list is empty. + pub warning: Option, } -impl Part for ReservationAffinity {} - - -/// Contains a list of Snapshot resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list snapshots](struct.SnapshotListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SnapshotList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Snapshot resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for SnapshotList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalersScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for AutoscalersScopedListWarningData {} -impl Part for AutoscalersScopedListWarningData {} - - -/// A service account. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ServiceAccount { - /// The list of scopes to be made available for this service account. - pub scopes: Option>, - /// Email address of the service account. - pub email: Option, -} - -impl Part for ServiceAccount {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct XpnHostListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for XpnHostListWarningData {} -impl Part for XpnHostListWarningData {} +impl Part for ReservationsScopedList {} /// A rule to be applied in a Policy. @@ -5509,118 +2725,113 @@ pub struct Rule { impl Part for Rule {} -/// [Output Only] Informational warning which replaces the list of operations when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationsScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for OperationsScopedListWarning {} -impl Part for OperationsScopedListWarning {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HTTP2HealthCheck { - /// The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. - pub port: Option, - /// The value of the host header in the HTTP/2 health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. - pub host: Option, - /// The request path of the HTTP/2 health check request. The default value is /. - #[serde(rename="requestPath")] - pub request_path: Option, - /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. - #[serde(rename="portName")] - pub port_name: Option, - /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, - /// Specifies how port is selected for health checking, can be one of following values: - /// USE_FIXED_PORT: The port number in - /// port - /// is used for health checking. - /// USE_NAMED_PORT: The - /// portName - /// is used for health checking. - /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - /// - /// - /// If not specified, HTTP2 health check follows behavior specified in - /// port - /// and - /// portName - /// fields. - #[serde(rename="portSpecification")] - pub port_specification: Option, - /// The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. - pub response: Option, -} - -impl Part for HTTP2HealthCheck {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypesScopedList { - /// [Output Only] Informational warning which replaces the list of disk types when the list is empty. - pub warning: Option, - /// [Output Only] A list of disk types contained in this scope. - #[serde(rename="diskTypes")] - pub disk_types: Option>, -} - -impl Part for DiskTypesScopedList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersSetInstanceTemplateRequest { - /// The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. - #[serde(rename="instanceTemplate")] - pub instance_template: Option, -} - -impl RequestValue for InstanceGroupManagersSetInstanceTemplateRequest {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicyAggregatedListWarningData { +pub struct SslCertificatesScopedListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for ResourcePolicyAggregatedListWarningData {} -impl Part for ResourcePolicyAggregatedListWarningData {} +impl NestedType for SslCertificatesScopedListWarningData {} +impl Part for SslCertificatesScopedListWarningData {} + + +/// Represents a Persistent Disk Snapshot resource. +/// +/// You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. (== resource_for {$api_version}.snapshots ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set iam policy snapshots](struct.SnapshotSetIamPolicyCall.html) (none) +/// * [delete snapshots](struct.SnapshotDeleteCall.html) (none) +/// * [get iam policy snapshots](struct.SnapshotGetIamPolicyCall.html) (none) +/// * [test iam permissions snapshots](struct.SnapshotTestIamPermissionCall.html) (none) +/// * [get snapshots](struct.SnapshotGetCall.html) (response) +/// * [create snapshot region disks](struct.RegionDiskCreateSnapshotCall.html) (request) +/// * [create snapshot disks](struct.DiskCreateSnapshotCall.html) (request) +/// * [list snapshots](struct.SnapshotListCall.html) (none) +/// * [set labels snapshots](struct.SnapshotSetLabelCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Snapshot { + /// [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. + pub status: Option, + /// The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + #[serde(rename="sourceDiskEncryptionKey")] + pub source_disk_encryption_key: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve a snapshot. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. + pub labels: Option>, + /// [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. + #[serde(rename="sourceDiskId")] + pub source_disk_id: Option, + /// [Output Only] Number of bytes downloaded to restore a snapshot to a disk. + #[serde(rename="downloadBytes")] + pub download_bytes: Option, + /// [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). + pub licenses: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Integer license codes indicating which licenses are attached to this snapshot. + #[serde(rename="licenseCodes")] + pub license_codes: Option>, + /// [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk. + #[serde(rename="autoCreated")] + pub auto_created: Option, + /// [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. + pub kind: Option, + /// [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. + #[serde(rename="storageBytes")] + pub storage_bytes: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] The source disk used to create this snapshot. + #[serde(rename="sourceDisk")] + pub source_disk: Option, + /// [Output Only] Size of the source disk, specified in GB. + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, + /// Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + #[serde(rename="storageLocations")] + pub storage_locations: Option>, + /// Encrypts the snapshot using a customer-supplied encryption key. + /// + /// After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. + /// + /// Customer-supplied encryption keys do not protect access to metadata of the snapshot. + /// + /// If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. + #[serde(rename="snapshotEncryptionKey")] + pub snapshot_encryption_key: Option, + /// [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + #[serde(rename="storageBytesStatus")] + pub storage_bytes_status: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Snapshot {} +impl Resource for Snapshot {} +impl ResponseResult for Snapshot {} /// Represents a Cloud Router resource. @@ -5685,209 +2896,15 @@ impl ResponseResult for Router {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicyListWarningData { +pub struct VpnGatewayListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for ResourcePolicyListWarningData {} -impl Part for ResourcePolicyListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationWarningsData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for OperationWarningsData {} -impl Part for OperationWarningsData {} - - -/// A BackendBucket resource. This resource defines a Cloud Storage bucket. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete backend buckets](struct.BackendBucketDeleteCall.html) (none) -/// * [get backend buckets](struct.BackendBucketGetCall.html) (response) -/// * [delete signed url key backend buckets](struct.BackendBucketDeleteSignedUrlKeyCall.html) (none) -/// * [add signed url key backend buckets](struct.BackendBucketAddSignedUrlKeyCall.html) (none) -/// * [update backend buckets](struct.BackendBucketUpdateCall.html) (request) -/// * [insert backend buckets](struct.BackendBucketInsertCall.html) (request) -/// * [patch backend buckets](struct.BackendBucketPatchCall.html) (request) -/// * [list backend buckets](struct.BackendBucketListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendBucket { - /// Type of the resource. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// Cloud CDN configuration for this BackendBucket. - #[serde(rename="cdnPolicy")] - pub cdn_policy: Option, - /// If true, enable Cloud CDN for this BackendBucket. - #[serde(rename="enableCdn")] - pub enable_cdn: Option, - /// Cloud Storage bucket name. - #[serde(rename="bucketName")] - pub bucket_name: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for BackendBucket {} -impl Resource for BackendBucket {} -impl ResponseResult for BackendBucket {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ReservationListWarningData {} -impl Part for ReservationListWarningData {} - - -/// Response to the list request, and contains a list of interconnect attachments. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list interconnect attachments](struct.InterconnectAttachmentListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InterconnectAttachment resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InterconnectAttachmentList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list usable subnetworks](struct.SubnetworkListUsableCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UsableSubnetworksAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// [Output] A list of usable subnetwork URLs. - pub items: Option>, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for UsableSubnetworksAggregatedList {} - - -/// UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HostRule { - /// The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. - pub hosts: Option>, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. - #[serde(rename="pathMatcher")] - pub path_matcher: Option, -} - -impl Part for HostRule {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetHttpProxyListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetHttpProxyListWarningData {} -impl Part for TargetHttpProxyListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagerListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for RegionInstanceGroupManagerListWarningData {} -impl Part for RegionInstanceGroupManagerListWarningData {} +impl NestedType for VpnGatewayListWarningData {} +impl Part for VpnGatewayListWarningData {} /// Contains a list of Operation resources. @@ -5903,10 +2920,10 @@ impl Part for RegionInstanceGroupManagerListWarningData {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OperationList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than `maxResults`, use the `nextPageToken` as a value for the query parameter `pageToken` in the next list request. Subsequent list requests will have their own `nextPageToken` to continue paging through the results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#operations for Operations resource. + /// [Output Only] Type of resource. Always `compute#operations` for Operations resource. pub kind: Option, /// [Output Only] Informational warning message. pub warning: Option, @@ -5922,215 +2939,44 @@ pub struct OperationList { impl ResponseResult for OperationList {} -/// Represents an unmanaged Instance Group resource. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// -/// Use unmanaged instance groups if you need to apply load balancing to groups of heterogeneous instances or if you need to manage the instances yourself. For more information, read Instance groups. -/// -/// For zonal unmanaged Instance Group, use instanceGroups resource. -/// -/// For regional unmanaged Instance Group, use regionInstanceGroups resource. (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (none) -/// * [insert instance groups](struct.InstanceGroupInsertCall.html) (request) -/// * [delete instance groups](struct.InstanceGroupDeleteCall.html) (none) -/// * [get instance groups](struct.InstanceGroupGetCall.html) (response) -/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (none) -/// * [set named ports instance groups](struct.InstanceGroupSetNamedPortCall.html) (none) -/// * [list instance groups](struct.InstanceGroupListCall.html) (none) -/// * [get region instance groups](struct.RegionInstanceGroupGetCall.html) (response) -/// * [aggregated list instance groups](struct.InstanceGroupAggregatedListCall.html) (none) -/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (none) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroup { - /// [Output Only] The resource type, which is always compute#instanceGroup for instance groups. - pub kind: Option, - /// The URL of the network to which all instances in the instance group belong. - pub network: Option, - /// [Output Only] The URL of the zone where the instance group is located (for zonal resources). - pub zone: Option, - /// [Output Only] The URL of the region where the instance group is located (for regional resources). - pub region: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. - pub name: Option, - /// [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. - pub fingerprint: Option, - /// [Output Only] The URL of the subnetwork to which all instances in the instance group belong. - pub subnetwork: Option, - /// Assigns a name to a port number. For example: {name: "http", port: 80} +pub struct InstanceGroupAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceGroupAggregatedListWarningData {} +impl Part for InstanceGroupAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringMirroredResourceInfo { + /// A set of subnetworks for which traffic from/to all VM instances will be mirrored. They must live in the same region as this packetMirroring. /// - /// This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "http", port: 80},{name: "http", port: 8080}] + /// You may specify a maximum of 5 subnetworks. + pub subnetworks: Option>, + /// A set of virtual machine instances that are being mirrored. They must live in zones contained in the same region as this packetMirroring. /// - /// Named ports apply to all instances in this instance group. - #[serde(rename="namedPorts")] - pub named_ports: Option>, - /// [Output Only] The creation timestamp for this instance group in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] A unique identifier for this instance group, generated by the server. - pub id: Option, - /// [Output Only] The URL for this instance group. The server generates this URL. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] The total number of instances in the instance group. - pub size: Option, + /// Note that this config will apply only to those network interfaces of the Instances that belong to the network specified in this packetMirroring. + /// + /// You may specify a maximum of 50 Instances. + pub instances: Option>, + /// A set of mirrored tags. Traffic from/to all VM instances that have one or more of these tags will be mirrored. + pub tags: Option>, } -impl RequestValue for InstanceGroup {} -impl Resource for InstanceGroup {} -impl ResponseResult for InstanceGroup {} - - -/// Represents a Target Instance resource. -/// -/// You can use a target instance to handle traffic for one or more forwarding rules, which is ideal for forwarding protocol traffic that is managed by a single source. For example, ESP, AH, TCP, or UDP. For more information, read Target instances. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (none) -/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (none) -/// * [get target instances](struct.TargetInstanceGetCall.html) (response) -/// * [list target instances](struct.TargetInstanceListCall.html) (none) -/// * [insert target instances](struct.TargetInstanceInsertCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstance { - /// NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported. - #[serde(rename="natPolicy")] - pub nat_policy: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// [Output Only] URL of the zone where the target instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. - pub zone: Option, - /// [Output Only] The type of the resource. Always compute#targetInstance for target instances. - pub kind: Option, - /// A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: - /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - /// - projects/project/zones/zone/instances/instance - /// - zones/zone/instances/instance - pub instance: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for TargetInstance {} -impl Resource for TargetInstance {} -impl ResponseResult for TargetInstance {} - - -/// A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert target tcp proxies](struct.TargetTcpProxyInsertCall.html) (request) -/// * [get target tcp proxies](struct.TargetTcpProxyGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetTcpProxy { - /// [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// URL to the BackendService resource. - pub service: Option, - /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for TargetTcpProxy {} -impl ResponseResult for TargetTcpProxy {} - - -/// [Output Only] A list of managed instance groups. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list instance group managers](struct.InstanceGroupManagerListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagerList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InstanceGroupManager resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InstanceGroupManagerList {} - - -/// Contains a list of nodeGroups. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list node groups](struct.NodeGroupListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of NodeGroup resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for NodeGroupList {} +impl Part for PacketMirroringMirroredResourceInfo {} /// There is no detailed description. @@ -6148,38 +2994,6 @@ pub struct InstancesScopedList { impl Part for InstancesScopedList {} -/// [Output Only] Encountered errors during the last attempt to create or delete the instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedInstanceLastAttemptErrors { - /// [Output Only] The array of errors encountered while processing this operation. - pub errors: Option>, -} - -impl NestedType for ManagedInstanceLastAttemptErrors {} -impl Part for ManagedInstanceLastAttemptErrors {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list xpn hosts projects](struct.ProjectListXpnHostCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProjectsListXpnHostsRequest { - /// Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project. - pub organization: Option, -} - -impl RequestValue for ProjectsListXpnHostsRequest {} - - /// There is no detailed description. /// /// # Activities @@ -6210,187 +3024,6 @@ pub struct NodeGroupsListNodes { impl ResponseResult for NodeGroupsListNodes {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersAbandonInstancesRequest { - /// The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - pub instances: Option>, -} - -impl RequestValue for InstanceGroupManagersAbandonInstancesRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersDeleteInstancesRequest { - /// The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - pub instances: Option>, -} - -impl RequestValue for InstanceGroupManagersDeleteInstancesRequest {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InterconnectAttachmentListWarningData {} -impl Part for InterconnectAttachmentListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NetworkListWarning {} -impl Part for NetworkListWarning {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LicenseResourceRequirements { - /// Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start. - #[serde(rename="minGuestCpuCount")] - pub min_guest_cpu_count: Option, - /// Minimum memory required to use the Instance. Enforced at Instance creation and Instance start. - #[serde(rename="minMemoryMb")] - pub min_memory_mb: Option, -} - -impl Part for LicenseResourceRequirements {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectDiagnosticsLinkStatus { - /// An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level. - #[serde(rename="receivingOpticalPower")] - pub receiving_optical_power: Option, - /// A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled - #[serde(rename="arpCaches")] - pub arp_caches: Option>, - /// The unique ID for this link assigned during turn up by Google. - #[serde(rename="circuitId")] - pub circuit_id: Option, - /// no description provided - #[serde(rename="lacpStatus")] - pub lacp_status: Option, - /// The Demarc address assigned by Google and provided in the LoA. - #[serde(rename="googleDemarc")] - pub google_demarc: Option, - /// An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level. - #[serde(rename="transmittingOpticalPower")] - pub transmitting_optical_power: Option, -} - -impl Part for InterconnectDiagnosticsLinkStatus {} - - -/// Contains a list of autoscalers. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list region autoscalers](struct.RegionAutoscalerListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionAutoscalerList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Autoscaler resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RegionAutoscalerList {} - - -/// Informational warning which replaces the list of resourcePolicies when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePoliciesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for ResourcePoliciesScopedListWarning {} -impl Part for ResourcePoliciesScopedListWarning {} - - -/// Authorization-related information used by Cloud Audit Logging. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuthorizationLoggingOptions { - /// The type of the permission that was checked. - #[serde(rename="permissionType")] - pub permission_type: Option, -} - -impl Part for AuthorizationLoggingOptions {} - - /// There is no detailed description. /// /// # Activities @@ -6410,248 +3043,6 @@ pub struct InstancesSetMachineTypeRequest { impl RequestValue for InstancesSetMachineTypeRequest {} -/// [Output Only] The array of errors encountered while processing this operation. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationErrorErrors { - /// [Output Only] An optional, human-readable error message. - pub message: Option, - /// [Output Only] The error type identifier for this error. - pub code: Option, - /// [Output Only] Indicates the field in the request that caused the error. This property is optional. - pub location: Option, -} - -impl NestedType for OperationErrorErrors {} -impl Part for OperationErrorErrors {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list network endpoint groups](struct.NetworkEndpointGroupAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of NetworkEndpointGroupsScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for NetworkEndpointGroupAggregatedList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [attach network endpoints network endpoint groups](struct.NetworkEndpointGroupAttachNetworkEndpointCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupsAttachEndpointsRequest { - /// The list of network endpoints to be attached. - #[serde(rename="networkEndpoints")] - pub network_endpoints: Option>, -} - -impl RequestValue for NetworkEndpointGroupsAttachEndpointsRequest {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for DiskAggregatedListWarning {} -impl Part for DiskAggregatedListWarning {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworksScopedList { - /// A list of subnetworks contained in this scope. - pub subnetworks: Option>, - /// An informational warning that appears when the list of addresses is empty. - pub warning: Option, -} - -impl Part for SubnetworksScopedList {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewayAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetVpnGatewayAggregatedListWarning {} -impl Part for TargetVpnGatewayAggregatedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NodeGroupListWarningData {} -impl Part for NodeGroupListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NetworkEndpointGroupListWarningData {} -impl Part for NetworkEndpointGroupListWarningData {} - - -/// A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicySnapshotSchedulePolicy { - /// Properties with which snapshots are created such as labels, encryption keys. - #[serde(rename="snapshotProperties")] - pub snapshot_properties: Option, - /// Retention policy applied to snapshots created by this resource policy. - #[serde(rename="retentionPolicy")] - pub retention_policy: Option, - /// A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy. - pub schedule: Option, -} - -impl Part for ResourcePolicySnapshotSchedulePolicy {} - - -/// Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. -/// -/// -/// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. -/// -/// **JSON Example** -/// -/// { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } -/// -/// **YAML Example** -/// -/// bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - members: - user:sean@example.com role: roles/viewer -/// -/// -/// -/// For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs). -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set iam policy disks](struct.DiskSetIamPolicyCall.html) (response) -/// * [set iam policy resource policies](struct.ResourcePolicySetIamPolicyCall.html) (response) -/// * [set iam policy images](struct.ImageSetIamPolicyCall.html) (response) -/// * [get iam policy reservations](struct.ReservationGetIamPolicyCall.html) (response) -/// * [get iam policy instance templates](struct.InstanceTemplateGetIamPolicyCall.html) (response) -/// * [get iam policy snapshots](struct.SnapshotGetIamPolicyCall.html) (response) -/// * [set iam policy subnetworks](struct.SubnetworkSetIamPolicyCall.html) (response) -/// * [set iam policy node templates](struct.NodeTemplateSetIamPolicyCall.html) (response) -/// * [get iam policy resource policies](struct.ResourcePolicyGetIamPolicyCall.html) (response) -/// * [set iam policy instances](struct.InstanceSetIamPolicyCall.html) (response) -/// * [get iam policy instances](struct.InstanceGetIamPolicyCall.html) (response) -/// * [set iam policy snapshots](struct.SnapshotSetIamPolicyCall.html) (response) -/// * [get iam policy node groups](struct.NodeGroupGetIamPolicyCall.html) (response) -/// * [set iam policy instance templates](struct.InstanceTemplateSetIamPolicyCall.html) (response) -/// * [get iam policy licenses](struct.LicenseGetIamPolicyCall.html) (response) -/// * [get iam policy subnetworks](struct.SubnetworkGetIamPolicyCall.html) (response) -/// * [set iam policy licenses](struct.LicenseSetIamPolicyCall.html) (response) -/// * [get iam policy images](struct.ImageGetIamPolicyCall.html) (response) -/// * [set iam policy reservations](struct.ReservationSetIamPolicyCall.html) (response) -/// * [get iam policy disks](struct.DiskGetIamPolicyCall.html) (response) -/// * [set iam policy node groups](struct.NodeGroupSetIamPolicyCall.html) (response) -/// * [get iam policy node templates](struct.NodeTemplateGetIamPolicyCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Policy { - /// Specifies cloud audit logging configuration for this policy. - #[serde(rename="auditConfigs")] - pub audit_configs: Option>, - /// Deprecated. - pub version: Option, - /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. - /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. - pub etag: Option, - /// If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied. - pub rules: Option>, - /// Associates a list of `members` to a `role`. `bindings` with no members will result in an error. - pub bindings: Option>, - /// - #[serde(rename="iamOwned")] - pub iam_owned: Option, -} - -impl ResponseResult for Policy {} - - /// There is no detailed description. /// /// # Activities @@ -6660,6 +3051,7 @@ impl ResponseResult for Policy {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [set labels region disks](struct.RegionDiskSetLabelCall.html) (request) +/// * [set labels vpn gateways](struct.VpnGatewaySetLabelCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RegionSetLabelsRequest { @@ -6710,89 +3102,6 @@ impl NestedType for HttpsHealthCheckListWarningData {} impl Part for HttpsHealthCheckListWarningData {} -/// Represents an Autoscaler resource. -/// -/// -/// -/// Use autoscalers to automatically add or delete instances from a managed instance group according to your defined autoscaling policy. For more information, read Autoscaling Groups of Instances. -/// -/// For zonal managed instance groups resource, use the autoscaler resource. -/// -/// For regional managed instance groups, use the regionAutoscalers resource. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert autoscalers](struct.AutoscalerInsertCall.html) (request) -/// * [update autoscalers](struct.AutoscalerUpdateCall.html) (request) -/// * [update region autoscalers](struct.RegionAutoscalerUpdateCall.html) (request) -/// * [get autoscalers](struct.AutoscalerGetCall.html) (response) -/// * [list autoscalers](struct.AutoscalerListCall.html) (none) -/// * [patch autoscalers](struct.AutoscalerPatchCall.html) (request) -/// * [insert region autoscalers](struct.RegionAutoscalerInsertCall.html) (request) -/// * [aggregated list autoscalers](struct.AutoscalerAggregatedListCall.html) (none) -/// * [patch region autoscalers](struct.RegionAutoscalerPatchCall.html) (request) -/// * [delete autoscalers](struct.AutoscalerDeleteCall.html) (none) -/// * [get region autoscalers](struct.RegionAutoscalerGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Autoscaler { - /// [Output Only] The status of the autoscaler configuration. - pub status: Option, - /// [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). - pub zone: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). - pub region: Option, - /// The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. - /// - /// If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. - #[serde(rename="autoscalingPolicy")] - pub autoscaling_policy: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. - #[serde(rename="statusDetails")] - pub status_details: Option>, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// URL of the managed instance group that this autoscaler will scale. - pub target: Option, -} - -impl RequestValue for Autoscaler {} -impl Resource for Autoscaler {} -impl ResponseResult for Autoscaler {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstanceAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetInstanceAggregatedListWarningData {} -impl Part for TargetInstanceAggregatedListWarningData {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -6810,21 +3119,6 @@ impl NestedType for TargetPoolAggregatedListWarningData {} impl Part for TargetPoolAggregatedListWarningData {} -/// Configuration of logging on a NAT. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterNatLogConfig { - /// Specifies the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. - pub filter: Option, - /// Indicates whether or not to export logs. This is false by default. - pub enable: Option, -} - -impl Part for RouterNatLogConfig {} - - /// There is no detailed description. /// /// # Activities @@ -6833,17 +3127,20 @@ impl Part for RouterNatLogConfig {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [test iam permissions instances](struct.InstanceTestIamPermissionCall.html) (request) -/// * [test iam permissions resource policies](struct.ResourcePolicyTestIamPermissionCall.html) (request) -/// * [test iam permissions license codes](struct.LicenseCodeTestIamPermissionCall.html) (request) -/// * [test iam permissions node templates](struct.NodeTemplateTestIamPermissionCall.html) (request) -/// * [test iam permissions snapshots](struct.SnapshotTestIamPermissionCall.html) (request) +/// * [test iam permissions vpn gateways](struct.VpnGatewayTestIamPermissionCall.html) (request) /// * [test iam permissions node groups](struct.NodeGroupTestIamPermissionCall.html) (request) +/// * [test iam permissions license codes](struct.LicenseCodeTestIamPermissionCall.html) (request) +/// * [test iam permissions snapshots](struct.SnapshotTestIamPermissionCall.html) (request) +/// * [test iam permissions resource policies](struct.ResourcePolicyTestIamPermissionCall.html) (request) +/// * [test iam permissions node templates](struct.NodeTemplateTestIamPermissionCall.html) (request) +/// * [test iam permissions external vpn gateways](struct.ExternalVpnGatewayTestIamPermissionCall.html) (request) /// * [test iam permissions images](struct.ImageTestIamPermissionCall.html) (request) -/// * [test iam permissions reservations](struct.ReservationTestIamPermissionCall.html) (request) +/// * [test iam permissions disks](struct.DiskTestIamPermissionCall.html) (request) +/// * [test iam permissions packet mirrorings](struct.PacketMirroringTestIamPermissionCall.html) (request) /// * [test iam permissions region disks](struct.RegionDiskTestIamPermissionCall.html) (request) /// * [test iam permissions instance templates](struct.InstanceTemplateTestIamPermissionCall.html) (request) /// * [test iam permissions subnetworks](struct.SubnetworkTestIamPermissionCall.html) (request) -/// * [test iam permissions disks](struct.DiskTestIamPermissionCall.html) (request) +/// * [test iam permissions reservations](struct.ReservationTestIamPermissionCall.html) (request) /// * [test iam permissions licenses](struct.LicenseTestIamPermissionCall.html) (request) /// * [test iam permissions network endpoint groups](struct.NetworkEndpointGroupTestIamPermissionCall.html) (request) /// @@ -6856,142 +3153,19 @@ pub struct TestPermissionsRequest { impl RequestValue for TestPermissionsRequest {} -/// [Output Only] An informational warning that replaces the list of instance groups when the list is empty. +/// Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstanceGroupsScopedListWarning {} -impl Part for InstanceGroupsScopedListWarning {} - - -/// Write a Data Access (Gin) log -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogConfigDataAccessOptions { - /// Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now. - #[serde(rename="logMode")] - pub log_mode: Option, -} - -impl Part for LogConfigDataAccessOptions {} - - -/// [Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupsScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NetworkEndpointGroupsScopedListWarning {} -impl Part for NetworkEndpointGroupsScopedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetSslProxyListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. +pub struct LogConfigCounterOptionsCustomField { + /// Name is the field name. + pub name: Option, + /// Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext. pub value: Option, } -impl NestedType for TargetSslProxyListWarningData {} -impl Part for TargetSslProxyListWarningData {} - - -/// A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (none) -/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (none) -/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (none) -/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (none) -/// * [delete target pools](struct.TargetPoolDeleteCall.html) (none) -/// * [insert target pools](struct.TargetPoolInsertCall.html) (request) -/// * [aggregated list target pools](struct.TargetPoolAggregatedListCall.html) (none) -/// * [list target pools](struct.TargetPoolListCall.html) (none) -/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (none) -/// * [get target pools](struct.TargetPoolGetCall.html) (response) -/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPool { - /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. - /// - /// If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. - /// - /// In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. - #[serde(rename="failoverRatio")] - pub failover_ratio: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// [Output Only] URL of the region where the target pool resides. - pub region: Option, - /// [Output Only] Type of the resource. Always compute#targetPool for target pools. - pub kind: Option, - /// Session affinity option, must be one of the following values: - /// NONE: Connections from the same client IP may go to any instance in the pool. - /// CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. - /// CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. - #[serde(rename="sessionAffinity")] - pub session_affinity: Option, - /// A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. - pub instances: Option>, - /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. - /// - /// backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. - /// - /// In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. - #[serde(rename="backupPool")] - pub backup_pool: Option, - /// The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. An empty list means all member instances will be considered healthy at all times. Only HttpHealthChecks are supported. Only one health check may be specified. - #[serde(rename="healthChecks")] - pub health_checks: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for TargetPool {} -impl Resource for TargetPool {} -impl ResponseResult for TargetPool {} +impl Part for LogConfigCounterOptionsCustomField {} /// [Output Only] Informational warning message. @@ -6999,270 +3173,18 @@ impl ResponseResult for TargetPool {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetTcpProxyListWarning { +pub struct SslCertificateAggregatedListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for TargetTcpProxyListWarning {} -impl Part for TargetTcpProxyListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [recreate instances region instance group managers](struct.RegionInstanceGroupManagerRecreateInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagersRecreateRequest { - /// The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - pub instances: Option>, -} - -impl RequestValue for RegionInstanceGroupManagersRecreateRequest {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstancesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetInstancesScopedListWarningData {} -impl Part for TargetInstancesScopedListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServiceAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for BackendServiceAggregatedListWarning {} -impl Part for BackendServiceAggregatedListWarning {} - - -/// Represents an IP Address resource. -/// -/// An address resource represents a regional internal IP address. Regional internal IP addresses are RFC 1918 addresses that come from either a primary or secondary IP range of a subnet in a VPC network. Regional external IP addresses can be assigned to GCP VM instances, Cloud VPN gateways, regional external forwarding rules for network load balancers (in either Standard or Premium Tier), and regional external forwarding rules for HTTP(S), SSL Proxy, and TCP Proxy load balancers in Standard Tier. For more information, read IP addresses. -/// -/// A globalAddresses resource represent a global external IP address. Global external IP addresses are IPv4 or IPv6 addresses. They can only be assigned to global forwarding rules for HTTP(S), SSL Proxy, or TCP Proxy load balancers in Premium Tier. For more information, read Global resources. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (request) -/// * [insert addresses](struct.AddresseInsertCall.html) (request) -/// * [get addresses](struct.AddresseGetCall.html) (response) -/// * [get global addresses](struct.GlobalAddresseGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Address { - /// [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. - pub status: Option, - /// The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. - #[serde(rename="addressType")] - pub address_type: Option, - /// [Output Only] The URLs of the resources that are using this address. - pub users: Option>, - /// The IP version that will be used by this address. Valid options are IPV4 or IPV6. This can only be specified for a global address. - #[serde(rename="ipVersion")] - pub ip_version: Option, - /// The purpose of this resource, which can be one of the following values: - /// - `GCE_ENDPOINT` for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources. - /// - `DNS_RESOLVER` for a DNS resolver address in a subnetwork - /// - `VPC_PEERING` for addresses that are reserved for VPC peer networks. - /// - `NAT_AUTO` for addresses that are external IP addresses automatically reserved for Cloud NAT. - pub purpose: Option, - /// The static IP address represented by this resource. - pub address: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING purpose. - pub network: Option, - /// [Output Only] Type of the resource. Always compute#address for addresses. - pub kind: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. - pub name: Option, - /// The prefix length if the resource reprensents an IP range. - #[serde(rename="prefixLength")] - pub prefix_length: Option, - /// [Output Only] The URL of the region where the regional address resides. This field is not applicable to global addresses. You must specify this field as part of the HTTP request URL. - pub region: Option, - /// An optional description of this resource. Provide this field when you create the resource. - pub description: Option, - /// This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Global forwarding rules can only be Premium Tier. Regional forwarding rules can be either Premium or Standard Tier. Standard Tier addresses applied to regional forwarding rules can be used with any external load balancer. Regional forwarding rules in Premium Tier can only be used with a network load balancer. - /// - /// If this field is not specified, it is assumed to be PREMIUM. - #[serde(rename="networkTier")] - pub network_tier: Option, - /// The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with a GCE_ENDPOINT or DNS_RESOLVER purpose. - pub subnetwork: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for Address {} -impl ResponseResult for Address {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstanceGroupListWarning {} -impl Part for InstanceGroupListWarning {} - - -/// Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for beta.reservations ==) (== resource_for v1.reservations ==) (== NextID: 13 ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete reservations](struct.ReservationDeleteCall.html) (none) -/// * [resize reservations](struct.ReservationResizeCall.html) (none) -/// * [insert reservations](struct.ReservationInsertCall.html) (request) -/// * [test iam permissions reservations](struct.ReservationTestIamPermissionCall.html) (none) -/// * [set iam policy reservations](struct.ReservationSetIamPolicyCall.html) (none) -/// * [list reservations](struct.ReservationListCall.html) (none) -/// * [get iam policy reservations](struct.ReservationGetIamPolicyCall.html) (none) -/// * [aggregated list reservations](struct.ReservationAggregatedListCall.html) (none) -/// * [get reservations](struct.ReservationGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Reservation { - /// [Output Only] The status of the reservation. - pub status: Option, - /// [Output Only] Type of the resource. Always compute#reservations for reservations. - pub kind: Option, - /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. - #[serde(rename="specificReservationRequired")] - pub specific_reservation_required: Option, - /// [OutputOnly] Full or partial url for parent commitment for reservations which are tied to a commitment. - pub commitment: Option, - /// Reservation for instances with specific machine shapes. - #[serde(rename="specificReservation")] - pub specific_reservation: Option, - /// Zone in which the reservation resides, must be provided if reservation is created with commitment creation. - pub zone: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined fully-qualified URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, -} - -impl RequestValue for Reservation {} -impl Resource for Reservation {} -impl ResponseResult for Reservation {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct XpnHostListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for XpnHostListWarning {} -impl Part for XpnHostListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalerListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for AutoscalerListWarning {} -impl Part for AutoscalerListWarning {} - - -/// [Output Only] An informational warning that appears when the machine types list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for MachineTypesScopedListWarning {} -impl Part for MachineTypesScopedListWarning {} +impl NestedType for SslCertificateAggregatedListWarning {} +impl Part for SslCertificateAggregatedListWarning {} /// Response to the list request, and contains a list of interconnects. @@ -7295,7 +3217,17 @@ pub struct InterconnectList { impl ResponseResult for InterconnectList {} -/// A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==) +/// Represents a Forwarding Rule resource. +/// +/// Forwarding rule resources in GCP can be either regional or global in scope: +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/globalForwardingRules) * [Regional](/compute/docs/reference/rest/{$api_version}/forwardingRules) +/// +/// A forwarding rule and its corresponding IP address represent the frontend configuration of a Google Cloud Platform load balancer. Forwarding rules can also reference target instances and Cloud VPN Classic gateways (targetVpnGateway). +/// +/// For more information, read Forwarding rule concepts and Using protocol forwarding. +/// +/// (== resource_for {$api_version}.forwardingRules ==) (== resource_for {$api_version}.globalForwardingRules ==) (== resource_for {$api_version}.regionForwardingRules ==) /// /// # Activities /// @@ -7310,34 +3242,55 @@ impl ResponseResult for InterconnectList {} /// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (none) /// * [get forwarding rules](struct.ForwardingRuleGetCall.html) (response) /// * [list forwarding rules](struct.ForwardingRuleListCall.html) (none) +/// * [patch global forwarding rules](struct.GlobalForwardingRulePatchCall.html) (request) +/// * [patch forwarding rules](struct.ForwardingRulePatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ForwardingRule { /// An optional description of this resource. Provide this property when you create the resource. pub description: Option, - /// An optional prefix to the service name for this Forwarding Rule. If specified, will be the first label of the fully qualified service name. + /// An optional prefix to the service name for this Forwarding Rule. If specified, the prefix is the first label of the fully qualified service name. /// /// The label must be 1-63 characters long, and comply with RFC1035. Specifically, the label must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. /// /// This field is only used for internal load balancing. #[serde(rename="serviceLabel")] pub service_label: Option, - /// The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. This can only be specified for an external global forwarding rule. - #[serde(rename="ipVersion")] - pub ip_version: Option, - /// This signifies what the ForwardingRule will be used for and can only take the following values: INTERNAL, INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that this will be used for Internal Network Load Balancing (TCP, UDP). The value of INTERNAL_SELF_MANAGED means that this will be used for Internal Global HTTP(S) LB. The value of EXTERNAL means that this will be used for External Load Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) - #[serde(rename="loadBalancingScheme")] - pub load_balancing_scheme: Option, - /// The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are valid. - pub target: Option, /// This field is used along with the backend_service field for internal load balancing or with the target field for internal TargetInstance. This field cannot be used with port or portRange fields. /// /// When the load balancing scheme is INTERNAL and protocol is TCP/UDP, specify this field to allow packets addressed to any ports will be forwarded to the backends configured with this forwarding rule. #[serde(rename="allPorts")] pub all_ports: Option, - /// The IP protocol to which this rule applies. Valid options are TCP, UDP, ESP, AH, SCTP or ICMP. + /// The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. This can only be specified for an external global forwarding rule. + #[serde(rename="ipVersion")] + pub ip_version: Option, + /// Specifies the forwarding rule type. /// - /// When the load balancing scheme is INTERNAL, only TCP and UDP are valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only TCPis valid. + /// + /// - EXTERNAL is used for: + /// - Classic Cloud VPN gateways + /// - Protocol forwarding to VMs from an external IP address + /// - The following load balancers: HTTP(S), SSL Proxy, TCP Proxy, and Network TCP/UDP + /// - INTERNAL is used for: + /// - Protocol forwarding to VMs from an internal IP address + /// - Internal TCP/UDP load balancers + /// - INTERNAL_MANAGED is used for: + /// - Internal HTTP(S) load balancers + /// - INTERNAL_SELF_MANAGED is used for: + /// - Traffic Director + /// + /// For more information about forwarding rules, refer to Forwarding rule concepts. + #[serde(rename="loadBalancingScheme")] + pub load_balancing_scheme: Option, + /// The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. For INTERNAL_SELF_MANAGED load balancing, only targetHttpProxy is valid, not targetHttpsProxy. + pub target: Option, + /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ForwardingRule. Include the fingerprint in patch request to ensure that you do not overwrite changes that were applied from another concurrent request. + /// + /// To see the latest fingerprint, make a get() request to retrieve a ForwardingRule. + pub fingerprint: Option, + /// The IP protocol to which this rule applies. For protocol forwarding, valid options are TCP, UDP, ESP, AH, SCTP or ICMP. + /// + /// For Internal TCP/UDP Load Balancing, the load balancing scheme is INTERNAL, and one of TCP or UDP are valid. For Traffic Director, the load balancing scheme is INTERNAL_SELF_MANAGED, and only TCPis valid. For Internal HTTP(S) Load Balancing, the load balancing scheme is INTERNAL_MANAGED, and only TCP is valid. For HTTP(S), SSL Proxy, and TCP Proxy Load Balancing, the load balancing scheme is EXTERNAL and only TCP is valid. For Network TCP/UDP Load Balancing, the load balancing scheme is EXTERNAL, and one of TCP or UDP is valid. #[serde(rename="IPProtocol")] pub ip_protocol: Option, /// [Output Only] Creation timestamp in RFC3339 text format. @@ -7345,15 +3298,15 @@ pub struct ForwardingRule { pub creation_timestamp: Option, /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. pub id: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] Type of the resource. Always compute#forwardingRule for Forwarding Rule resources. + pub kind: Option, /// This field is not used for external load balancing. /// /// For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used. pub network: Option, - /// [Output Only] Type of the resource. Always compute#forwardingRule for Forwarding Rule resources. - pub kind: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. + /// When the load balancing scheme is EXTERNAL, INTERNAL_SELF_MANAGED and INTERNAL_MANAGED, you can specify a port_range. Use with a forwarding rule that points to a target proxy or a target pool. Do not use with a forwarding rule that points to a backend service. This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, TargetInstance. /// /// Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. /// @@ -7367,7 +3320,15 @@ pub struct ForwardingRule { pub port_range: Option, /// [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. pub region: Option, - /// This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM , STANDARD. + /// This field is used along with the backend_service field for internal load balancing. + /// + /// When the load balancing scheme is INTERNAL, a list of ports can be configured, for example, ['80'], ['8000','9000']. Only packets addressed to these ports are forwarded to the backends configured with the forwarding rule. + /// + /// If the forwarding rule's loadBalancingScheme is INTERNAL, you can specify ports in one of the following ways: + /// + /// * A list of up to five ports, which can be non-contiguous * Keyword ALL, which causes the forwarding rule to forward traffic on any port of the forwarding rule's protocol. + pub ports: Option>, + /// This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM, STANDARD. /// /// For regional ForwardingRule, the valid values are PREMIUM and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM. /// @@ -7379,6 +3340,9 @@ pub struct ForwardingRule { /// This field is only used for internal load balancing. #[serde(rename="serviceName")] pub service_name: Option, + /// Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL. + #[serde(rename="isMirroringCollector")] + pub is_mirroring_collector: Option, /// This field is only used for INTERNAL load balancing. /// /// For internal load balancing, this field identifies the BackendService resource to receive the matched traffic. @@ -7390,31 +3354,24 @@ pub struct ForwardingRule { /// /// If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be specified. pub subnetwork: Option, - /// The IP address that this forwarding rule is serving on behalf of. + /// Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant configuration is made available to those proxies. Otherwise, all the resources (e.g. TargetHttpProxy, UrlMap) referenced by the ForwardingRule will not be visible to those proxies. + /// For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. + /// metadataFilters specified here will be applifed before those specified in the UrlMap that this ForwardingRule references. + /// metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + #[serde(rename="metadataFilters")] + pub metadata_filters: Option>, + /// IP address that this forwarding rule serves. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the target that you specify in the forwarding rule. /// - /// Addresses are restricted based on the forwarding rule's load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). + /// If you don't specify a reserved IP address, an ephemeral IP address is assigned. Methods for specifying an IP address: /// - /// When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. + /// * IPv4 dotted decimal, as in `100.1.2.3` * Full URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region/addresses/address-name * Partial URL or by name, as in: * projects/project_id/regions/region/addresses/address-name * regions/region/addresses/address-name * global/addresses/address-name * address-name /// - /// When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be a URL reference to an existing Address resource ( internal regional static IP address), with a purpose of GCE_END_POINT and address_type of INTERNAL. - /// - /// When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. - /// - /// An address can be specified either by a literal IP address or a URL reference to an existing Address resource. The following examples are all valid: - /// - 100.1.2.3 - /// - https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address - /// - projects/project/regions/region/addresses/address - /// - regions/region/addresses/address - /// - global/addresses/address - /// - address + /// The loadBalancingScheme and the forwarding rule's target determine the type of IP address that you can use. For detailed information, refer to [IP address specifications](/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). #[serde(rename="IPAddress")] pub ip_address: Option, - /// This field is used along with the backend_service field for internal load balancing. - /// - /// When the load balancing scheme is INTERNAL, a list of ports can be configured, for example, ['80'], ['8000','9000'] etc. Only packets addressed to these ports will be forwarded to the backends configured with this forwarding rule. - /// - /// You may specify a maximum of up to 5 ports. - pub ports: Option>, + /// This field is used along with the backend_service field for internal load balancing or with the target field for internal TargetInstance. If the field is set to TRUE, clients can access ILB from all regions. Otherwise only allows access from clients in the same region as the internal load balancer. + #[serde(rename="allowGlobalAccess")] + pub allow_global_access: Option, /// [Output Only] Server-defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, @@ -7425,96 +3382,23 @@ impl Resource for ForwardingRule {} impl ResponseResult for ForwardingRule {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplateAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NodeTemplateAggregatedListWarningData {} -impl Part for NodeTemplateAggregatedListWarningData {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceAggregatedListWarning { +pub struct SslCertificateListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for InstanceAggregatedListWarning {} -impl Part for InstanceAggregatedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for DiskTypesScopedListWarningData {} -impl Part for DiskTypesScopedListWarningData {} - - -/// A security policy is comprised of one or more rules. It can also be associated with one or more 'targets'. (== resource_for v1.securityPolicies ==) (== resource_for beta.securityPolicies ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get security policies](struct.SecurityPolicyGetCall.html) (response) -/// * [patch security policies](struct.SecurityPolicyPatchCall.html) (request) -/// * [insert security policies](struct.SecurityPolicyInsertCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicy { - /// [Output only] Type of the resource. Always compute#securityPolicyfor security policies - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. - pub rules: Option>, - /// Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. - /// - /// To see the latest fingerprint, make get() request to the security policy. - pub fingerprint: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for SecurityPolicy {} -impl ResponseResult for SecurityPolicy {} +impl NestedType for SslCertificateListWarning {} +impl Part for SslCertificateListWarning {} /// Describing the ARP neighbor entries seen on this link @@ -7551,135 +3435,26 @@ impl NestedType for RegionDiskTypeListWarningData {} impl Part for RegionDiskTypeListWarningData {} -/// Contain information of Nat mapping for a VM endpoint (i.e., NIC). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VmEndpointNatMappings { - /// no description provided - #[serde(rename="interfaceNatMappings")] - pub interface_nat_mappings: Option>, - /// Name of the VM instance which the endpoint belongs to - #[serde(rename="instanceName")] - pub instance_name: Option, -} - -impl Part for VmEndpointNatMappings {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplateNodeTypeFlexibility { - /// no description provided - pub cpus: Option, - /// no description provided - #[serde(rename="localSsd")] - pub local_ssd: Option, - /// no description provided - pub memory: Option, -} - -impl Part for NodeTemplateNodeTypeFlexibility {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouteWarningsData { +pub struct RegionListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for RouteWarningsData {} -impl Part for RouteWarningsData {} +impl NestedType for RegionListWarningData {} +impl Part for RegionListWarningData {} -/// A network interface resource attached to an instance. +/// Represents a License Code resource. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [update network interface instances](struct.InstanceUpdateNetworkInterfaceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkInterface { - /// [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. - pub kind: Option, - /// An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. - #[serde(rename="aliasIpRanges")] - pub alias_ip_ranges: Option>, - /// URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. - /// - /// If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - /// - https://www.googleapis.com/compute/v1/projects/project/global/networks/network - /// - projects/project/global/networks/network - /// - global/networks/default - pub network: Option, - /// An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access. - #[serde(rename="accessConfigs")] - pub access_configs: Option>, - /// An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system. - #[serde(rename="networkIP")] - pub network_ip: Option, - /// Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface, otherwise the request will fail with error 412 conditionNotMet. - pub fingerprint: Option, - /// The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: - /// - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork - /// - regions/region/subnetworks/subnetwork - pub subnetwork: Option, - /// [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. - pub name: Option, -} - -impl RequestValue for NetworkInterface {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksScopedList { - /// [Output Only] A list of disks contained in this scope. - pub disks: Option>, - /// [Output Only] Informational warning which replaces the list of disks when the list is empty. - pub warning: Option, -} - -impl Part for DisksScopedList {} - - -/// [Output Only] An informational warning that appears when the nodeGroup list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupsScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeGroupsScopedListWarning {} -impl Part for NodeGroupsScopedListWarning {} - - -/// There is no detailed description. +/// A License Code is a unique identifier used to represent a license resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. (== resource_for {$api_version}.licenseCodes ==) /// /// # Activities /// @@ -7718,170 +3493,21 @@ impl Resource for LicenseCode {} impl ResponseResult for LicenseCode {} -/// Contains a list of BackendServicesScopedList. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list backend services](struct.BackendServiceAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServiceAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of BackendServicesScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for BackendServiceAggregatedList {} - - -/// There is no detailed description. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentsScopedList { - /// A list of interconnect attachments contained in this scope. - #[serde(rename="interconnectAttachments")] - pub interconnect_attachments: Option>, - /// Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, +pub struct PacketMirroringAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl Part for InterconnectAttachmentsScopedList {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstancesScopedList { - /// A list of target instances contained in this scope. - #[serde(rename="targetInstances")] - pub target_instances: Option>, - /// Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, -} - -impl Part for TargetInstancesScopedList {} - - -/// A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [update url maps](struct.UrlMapUpdateCall.html) (request) -/// * [insert url maps](struct.UrlMapInsertCall.html) (request) -/// * [list url maps](struct.UrlMapListCall.html) (none) -/// * [invalidate cache url maps](struct.UrlMapInvalidateCacheCall.html) (none) -/// * [delete url maps](struct.UrlMapDeleteCall.html) (none) -/// * [get url maps](struct.UrlMapGetCall.html) (response) -/// * [validate url maps](struct.UrlMapValidateCall.html) (none) -/// * [patch url maps](struct.UrlMapPatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMap { - /// [Output Only] Type of the resource. Always compute#urlMaps for url maps. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. - /// Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. - #[serde(rename="defaultService")] - pub default_service: Option, - /// The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. - pub tests: Option>, - /// The list of HostRules to use against the URL. - #[serde(rename="hostRules")] - pub host_rules: Option>, - /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet. - /// - /// To see the latest fingerprint, make a get() request to retrieve a UrlMap. - pub fingerprint: Option, - /// The list of named PathMatchers to use against the URL. - #[serde(rename="pathMatchers")] - pub path_matchers: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for UrlMap {} -impl Resource for UrlMap {} -impl ResponseResult for UrlMap {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupsListNetworkEndpointsWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NetworkEndpointGroupsListNetworkEndpointsWarning {} -impl Part for NetworkEndpointGroupsListNetworkEndpointsWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list region commitments](struct.RegionCommitmentAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommitmentAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of CommitmentsScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for CommitmentAggregatedList {} +impl NestedType for PacketMirroringAggregatedListWarningData {} +impl Part for PacketMirroringAggregatedListWarningData {} /// Contains a list of VmEndpointNatMappings. @@ -7914,23 +3540,6 @@ pub struct VmEndpointNatMappingsList { impl ResponseResult for VmEndpointNatMappingsList {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommitmentListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for CommitmentListWarningData {} -impl Part for CommitmentListWarningData {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -7948,141 +3557,6 @@ impl NestedType for TargetPoolListWarningData {} impl Part for TargetPoolListWarningData {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set labels snapshots](struct.SnapshotSetLabelCall.html) (request) -/// * [set labels images](struct.ImageSetLabelCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GlobalSetLabelsRequest { - /// The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. - #[serde(rename="labelFingerprint")] - pub label_fingerprint: Option, - /// A list of labels to apply for this resource. Each label key & value must comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). - pub labels: Option>, -} - -impl RequestValue for GlobalSetLabelsRequest {} - - -/// -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceProperties { - /// Specifies the reservations that this instance can consume from. - #[serde(rename="reservationAffinity")] - pub reservation_affinity: Option, - /// Labels to apply to instances that are created from this template. - pub labels: Option>, - /// The machine type to use for instances that are created from this template. - #[serde(rename="machineType")] - pub machine_type: Option, - /// A list of guest accelerator cards' type and count to use for instances created from the instance template. - #[serde(rename="guestAccelerators")] - pub guest_accelerators: Option>, - /// A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. - pub tags: Option, - /// An optional text description for the instances that are created from this instance template. - pub description: Option, - /// An array of disks that are associated with the instances that are created from this template. - pub disks: Option>, - /// The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. - pub metadata: Option, - /// Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. - #[serde(rename="canIpForward")] - pub can_ip_forward: Option, - /// Specifies the scheduling options for the instances that are created from this template. - pub scheduling: Option, - /// Minimum cpu/platform to be used by this instance. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. - #[serde(rename="minCpuPlatform")] - pub min_cpu_platform: Option, - /// A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances. - #[serde(rename="serviceAccounts")] - pub service_accounts: Option>, - /// An array of network access configurations for this interface. - #[serde(rename="networkInterfaces")] - pub network_interfaces: Option>, - /// no description provided - #[serde(rename="shieldedInstanceConfig")] - pub shielded_instance_config: Option, -} - -impl Part for InstanceProperties {} - - -/// Contains a list of node templates. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list node templates](struct.NodeTemplateListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplateList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of NodeTemplate resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for NodeTemplateList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsListInstancesWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstanceGroupsListInstancesWarningData {} -impl Part for InstanceGroupsListInstancesWarningData {} - - -/// This reservation type allows to pre allocate specific instance configuration. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AllocationSpecificSKUReservation { - /// Specifies number of resources that are allocated. - pub count: Option, - /// The instance properties for this specific sku reservation. - #[serde(rename="instanceProperties")] - pub instance_properties: Option, - /// [OutputOnly] Indicates how many resource are in use. - #[serde(rename="inUseCount")] - pub in_use_count: Option, -} - -impl Part for AllocationSpecificSKUReservation {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -8100,46 +3574,6 @@ impl NestedType for BackendServiceListWarningData {} impl Part for BackendServiceListWarningData {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ReservationAggregatedListWarningData {} -impl Part for ReservationAggregatedListWarningData {} - - -/// Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add signed url key backend services](struct.BackendServiceAddSignedUrlKeyCall.html) (request) -/// * [add signed url key backend buckets](struct.BackendBucketAddSignedUrlKeyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SignedUrlKey { - /// Name of the key. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - #[serde(rename="keyName")] - pub key_name: Option, - /// 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. - #[serde(rename="keyValue")] - pub key_value: Option, -} - -impl RequestValue for SignedUrlKey {} - - /// [Output Only] The array of errors encountered while processing this operation. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -8158,139 +3592,21 @@ impl NestedType for ManagedInstanceLastAttemptErrorsErrors {} impl Part for ManagedInstanceLastAttemptErrorsErrors {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for RegionListWarning {} -impl Part for RegionListWarning {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagerAggregatedListWarningData { +pub struct RouterListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for InstanceGroupManagerAggregatedListWarningData {} -impl Part for InstanceGroupManagerAggregatedListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePoliciesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ResourcePoliciesScopedListWarningData {} -impl Part for ResourcePoliciesScopedListWarningData {} - - -/// Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. -/// -/// If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. -/// -/// Example Policy with multiple AuditConfigs: -/// -/// { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } -/// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuditConfig { - /// - #[serde(rename="exemptedMembers")] - pub exempted_members: Option>, - /// The configuration for logging of each type of permission. - #[serde(rename="auditLogConfigs")] - pub audit_log_configs: Option>, - /// Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. - pub service: Option, -} - -impl Part for AuditConfig {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworkAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for SubnetworkAggregatedListWarning {} -impl Part for SubnetworkAggregatedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NetworkEndpointGroupsScopedListWarningData {} -impl Part for NetworkEndpointGroupsScopedListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for MachineTypeAggregatedListWarning {} -impl Part for MachineTypeAggregatedListWarning {} +impl NestedType for RouterListWarningData {} +impl Part for RouterListWarningData {} /// Contains a list of HealthCheck resources. @@ -8301,6 +3617,7 @@ impl Part for MachineTypeAggregatedListWarning {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [list health checks](struct.HealthCheckListCall.html) (response) +/// * [list region health checks](struct.RegionHealthCheckListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HealthCheckList { @@ -8342,22 +3659,6 @@ pub struct LogConfig { impl Part for LogConfig {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelsScopedList { - /// A list of VPN tunnels contained in this scope. - #[serde(rename="vpnTunnels")] - pub vpn_tunnels: Option>, - /// Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, -} - -impl Part for VpnTunnelsScopedList {} - - /// There is no detailed description. /// /// # Activities @@ -8366,6 +3667,7 @@ impl Part for VpnTunnelsScopedList {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [list network endpoint groups](struct.NetworkEndpointGroupListCall.html) (response) +/// * [list global network endpoint groups](struct.GlobalNetworkEndpointGroupListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NetworkEndpointGroupList { @@ -8388,183 +3690,23 @@ pub struct NetworkEndpointGroupList { impl ResponseResult for NetworkEndpointGroupList {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [resize disks](struct.DiskResizeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksResizeRequest { - /// The new size of the persistent disk, which is specified in GB. - #[serde(rename="sizeGb")] - pub size_gb: Option, -} - -impl RequestValue for DisksResizeRequest {} - - -/// Represents an Interconnect resource. -/// -/// An Interconnect resource is a dedicated connection between the GCP network and your on-premises network. For more information, read the Dedicated Interconnect Overview. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get diagnostics interconnects](struct.InterconnectGetDiagnosticCall.html) (none) -/// * [get interconnects](struct.InterconnectGetCall.html) (response) -/// * [delete interconnects](struct.InterconnectDeleteCall.html) (none) -/// * [insert interconnects](struct.InterconnectInsertCall.html) (request) -/// * [patch interconnects](struct.InterconnectPatchCall.html) (request) -/// * [list interconnects](struct.InterconnectListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Interconnect { - /// Type of link requested, which can take one of the following values: - /// - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - /// - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. - #[serde(rename="linkType")] - pub link_type: Option, - /// Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect. - #[serde(rename="customerName")] - pub customer_name: Option, - /// [Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG. - #[serde(rename="circuitInfos")] - pub circuit_infos: Option>, - /// Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Stackdriver logs alerting and Cloud Notifications. - #[serde(rename="nocContactEmail")] - pub noc_contact_email: Option, - /// [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: - /// - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. - /// - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. - /// - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. - #[serde(rename="operationalStatus")] - pub operational_status: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// Type of interconnect, which can take one of the following values: - /// - PARTNER: A partner-managed interconnection shared between customers though a partner. - /// - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. - #[serde(rename="interconnectType")] - pub interconnect_type: Option, - /// [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. - #[serde(rename="interconnectAttachments")] - pub interconnect_attachments: Option>, - /// [Output Only] Type of the resource. Always compute#interconnect for interconnects. - pub kind: Option, - /// [Output Only] Number of links actually provisioned in this interconnect. - #[serde(rename="provisionedLinkCount")] - pub provisioned_link_count: Option, - /// [Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests. - #[serde(rename="googleIpAddress")] - pub google_ip_address: Option, - /// [Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. - #[serde(rename="googleReferenceId")] - pub google_reference_id: Option, - /// [Output Only] A list of outages expected for this Interconnect. - #[serde(rename="expectedOutages")] - pub expected_outages: Option>, - /// [Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests. - #[serde(rename="peerIpAddress")] - pub peer_ip_address: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true. - #[serde(rename="adminEnabled")] - pub admin_enabled: Option, - /// [Output Only] The current state of Interconnect functionality, which can take one of the following values: - /// - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. - /// - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. - /// - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. - pub state: Option, - /// URL of the InterconnectLocation object that represents where this connection is to be provisioned. - pub location: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Target number of physical links in the link bundle, as requested by the customer. - #[serde(rename="requestedLinkCount")] - pub requested_link_count: Option, -} - -impl RequestValue for Interconnect {} -impl Resource for Interconnect {} -impl ResponseResult for Interconnect {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// [Output Only] An informational warning that appears when the node types list is empty. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRulesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct NodeTypesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, } -impl NestedType for ForwardingRulesScopedListWarningData {} -impl Part for ForwardingRulesScopedListWarningData {} - - -/// A list of Disk resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list disks](struct.DiskListCall.html) (response) -/// * [list region disks](struct.RegionDiskListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#diskList for lists of disks. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Disk resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for DiskList {} - - -/// Write a Cloud Audit log -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogConfigCloudAuditOptions { - /// The log_name to populate in the Cloud Audit Record. - #[serde(rename="logName")] - pub log_name: Option, - /// Information used by the Cloud Audit Logging pipeline. - #[serde(rename="authorizationLoggingOptions")] - pub authorization_logging_options: Option, -} - -impl Part for LogConfigCloudAuditOptions {} +impl NestedType for NodeTypesScopedListWarning {} +impl Part for NodeTypesScopedListWarning {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -8584,143 +3726,6 @@ impl NestedType for NodeGroupsListNodesWarningData {} impl Part for NodeGroupsListNodesWarningData {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set machine resources instances](struct.InstanceSetMachineResourceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesSetMachineResourcesRequest { - /// A list of the type and count of accelerator cards attached to the instance. - #[serde(rename="guestAccelerators")] - pub guest_accelerators: Option>, -} - -impl RequestValue for InstancesSetMachineResourcesRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set iam policy resource policies](struct.ResourcePolicySetIamPolicyCall.html) (request) -/// * [set iam policy subnetworks](struct.SubnetworkSetIamPolicyCall.html) (request) -/// * [set iam policy node templates](struct.NodeTemplateSetIamPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionSetPolicyRequest { - /// REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. - pub policy: Option, - /// Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. - pub bindings: Option>, - /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. - pub etag: Option, -} - -impl RequestValue for RegionSetPolicyRequest {} - - -/// A SSL policy specifies the server-side support for SSL features. This can be attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections between clients and the HTTPS or SSL proxy load balancer. They do not affect the connection between the load balancers and the backends. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get ssl policies](struct.SslPolicyGetCall.html) (response) -/// * [patch ssl policies](struct.SslPolicyPatchCall.html) (request) -/// * [insert ssl policies](struct.SslPolicyInsertCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslPolicy { - /// Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. - pub profile: Option, - /// [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. - pub warnings: Option>, - /// The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. - #[serde(rename="minTlsVersion")] - pub min_tls_version: Option, - /// A list of features enabled when the selected profile is CUSTOM. The - /// - method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM. - #[serde(rename="customFeatures")] - pub custom_features: Option>, - /// [Output Only] The list of features enabled in the SSL policy. - #[serde(rename="enabledFeatures")] - pub enabled_features: Option>, - /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. - /// - /// To see the latest fingerprint, make a get() request to retrieve an SslPolicy. - pub fingerprint: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for SslPolicy {} -impl ResponseResult for SslPolicy {} - - -/// A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get target ssl proxies](struct.TargetSslProxyGetCall.html) (response) -/// * [insert target ssl proxies](struct.TargetSslProxyInsertCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetSslProxy { - /// [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// URL to the BackendService resource. - pub service: Option, - /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, - /// URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. - #[serde(rename="sslCertificates")] - pub ssl_certificates: Option>, - /// URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. - #[serde(rename="sslPolicy")] - pub ssl_policy: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for TargetSslProxy {} -impl ResponseResult for TargetSslProxy {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -8738,76 +3743,6 @@ impl NestedType for InterconnectAttachmentAggregatedListWarningData {} impl Part for InterconnectAttachmentAggregatedListWarningData {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypesScopedList { - /// [Output Only] A list of machine types contained in this scope. - #[serde(rename="machineTypes")] - pub machine_types: Option>, - /// [Output Only] An informational warning that appears when the machine types list is empty. - pub warning: Option, -} - -impl Part for MachineTypesScopedList {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstanceAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetInstanceAggregatedListWarning {} -impl Part for TargetInstanceAggregatedListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [remove peering networks](struct.NetworkRemovePeeringCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworksRemovePeeringRequest { - /// Name of the peering, which should conform to RFC1035. - pub name: Option, -} - -impl RequestValue for NetworksRemovePeeringRequest {} - - -/// Message containing Cloud CDN configuration for a backend bucket. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendBucketCdnPolicy { - /// [Output Only] Names of the keys for signing request URLs. - #[serde(rename="signedUrlKeyNames")] - pub signed_url_key_names: Option>, - /// Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. - #[serde(rename="signedUrlCacheMaxAgeSec")] - pub signed_url_cache_max_age_sec: Option, -} - -impl Part for BackendBucketCdnPolicy {} - - /// There is no detailed description. /// /// # Activities @@ -8827,73 +3762,23 @@ pub struct ProjectsEnableXpnResourceRequest { impl RequestValue for ProjectsEnableXpnResourceRequest {} -/// [Output Only] Informational warning message. +/// The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ZoneListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, +pub struct FirewallAllowed { + /// The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + #[serde(rename="IPProtocol")] + pub ip_protocol: Option, + /// An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + /// + /// Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + pub ports: Option>, } -impl NestedType for ZoneListWarning {} -impl Part for ZoneListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for TargetPoolsScopedListWarningData {} -impl Part for TargetPoolsScopedListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InterconnectListWarning {} -impl Part for InterconnectListWarning {} - - -/// A specification of the parameters to use when creating the instance template from a source instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SourceInstanceParams { - /// Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, new custom images will be created from each disk. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. - #[serde(rename="diskConfigs")] - pub disk_configs: Option>, -} - -impl Part for SourceInstanceParams {} +impl NestedType for FirewallAllowed {} +impl Part for FirewallAllowed {} /// There is no detailed description. @@ -8901,32 +3786,15 @@ impl Part for SourceInstanceParams {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypesScopedList { - /// [Output Only] An informational warning that appears when the accelerator types list is empty. - pub warning: Option, - /// [Output Only] A list of accelerator types contained in this scope. - #[serde(rename="acceleratorTypes")] - pub accelerator_types: Option>, +pub struct PacketMirroringNetworkInfo { + /// URL of the network resource. + pub url: Option, + /// [Output Only] Unique identifier for the network; defined by the server. + #[serde(rename="canonicalUrl")] + pub canonical_url: Option, } -impl Part for AcceleratorTypesScopedList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for DiskAggregatedListWarningData {} -impl Part for DiskAggregatedListWarningData {} +impl Part for PacketMirroringNetworkInfo {} /// There is no detailed description. @@ -8952,25 +3820,6 @@ pub struct ProjectsGetXpnResources { impl ResponseResult for ProjectsGetXpnResources {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplateAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeTemplateAggregatedListWarning {} -impl Part for NodeTemplateAggregatedListWarning {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -8988,27 +3837,21 @@ impl NestedType for MachineTypeListWarningData {} impl Part for MachineTypeListWarningData {} -/// Properties of the SKU instances being reserved. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AllocationSpecificSKUAllocationReservedInstanceProperties { - /// Minimum cpu platform the reservation. - #[serde(rename="minCpuPlatform")] - pub min_cpu_platform: Option, - /// Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. - #[serde(rename="machineType")] - pub machine_type: Option, - /// Specifies accelerator type and count. - #[serde(rename="guestAccelerators")] - pub guest_accelerators: Option>, - /// Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. - #[serde(rename="localSsds")] - pub local_ssds: Option>, +pub struct ExternalVpnGatewayListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl Part for AllocationSpecificSKUAllocationReservedInstanceProperties {} +impl NestedType for ExternalVpnGatewayListWarningData {} +impl Part for ExternalVpnGatewayListWarningData {} /// [Output Only] Informational warning message. @@ -9030,44 +3873,6 @@ impl NestedType for VpnTunnelListWarning {} impl Part for VpnTunnelListWarning {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplateListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeTemplateListWarning {} -impl Part for NodeTemplateListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetPoolListWarning {} -impl Part for TargetPoolListWarning {} - - /// Contains a list of HttpsHealthCheck resources. /// /// # Activities @@ -9122,81 +3927,15 @@ impl Part for InstanceWithNamedPorts {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterAggregatedListWarningData { +pub struct ResourcePolicyListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for RouterAggregatedListWarningData {} -impl Part for RouterAggregatedListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for DiskTypeListWarningData {} -impl Part for DiskTypeListWarningData {} - - -/// Message representing the validation result for a UrlMap. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapValidationResult { - /// no description provided - #[serde(rename="testFailures")] - pub test_failures: Option>, - /// no description provided - #[serde(rename="loadErrors")] - pub load_errors: Option>, - /// Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. - #[serde(rename="loadSucceeded")] - pub load_succeeded: Option, - /// If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. - #[serde(rename="testPassed")] - pub test_passed: Option, -} - -impl Part for UrlMapValidationResult {} - - -/// A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a flag indicating whether Google Compute Engine should automatically create routes for the peering. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkPeering { - /// [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. - pub state: Option, - /// The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. - pub network: Option, - /// This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically. When it is set to true, Google Compute Engine will automatically create and manage the routes between two networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to peer network. - #[serde(rename="autoCreateRoutes")] - pub auto_create_routes: Option, - /// Whether full mesh connectivity is created and managed automatically. When it is set to true, Google Compute Engine will automatically create and manage the routes between two networks when the peering state is ACTIVE. Otherwise, user needs to create routes manually to route packets to peer network. - #[serde(rename="exchangeSubnetRoutes")] - pub exchange_subnet_routes: Option, - /// [Output Only] Details about the current state of the peering. - #[serde(rename="stateDetails")] - pub state_details: Option, - /// Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl Part for NetworkPeering {} +impl NestedType for ResourcePolicyListWarningData {} +impl Part for ResourcePolicyListWarningData {} /// There is no detailed description. @@ -9213,153 +3952,46 @@ pub struct ServerBinding { impl Part for ServerBinding {} -/// There is no detailed description. +/// Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant configuration is made available to those proxies. +/// For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. +/// An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in , - /// [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. - pub recreating: Option, - /// [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. - /// - /// If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. - pub creating: Option, - /// [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation. - pub verifying: Option, - /// [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. - pub restarting: Option, - /// [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it. - pub abandoning: Option, - /// [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. - pub deleting: Option, - /// [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly. - #[serde(rename="creatingWithoutRetries")] - pub creating_without_retries: Option, - /// [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance. - pub refreshing: Option, +pub struct MetadataFilter { + /// Specifies how individual filterLabel matches within the list of filterLabels contribute towards the overall metadataFilter match. + /// Supported values are: + /// - MATCH_ANY: At least one of the filterLabels must have a matching label in the provided metadata. + /// - MATCH_ALL: All filterLabels must have matching labels in the provided metadata. + #[serde(rename="filterMatchCriteria")] + pub filter_match_criteria: Option, + /// The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria + /// This list must not be empty and can have at the most 64 entries. + #[serde(rename="filterLabels")] + pub filter_labels: Option>, } -impl Part for InstanceGroupManagerActionsSummary {} +impl Part for MetadataFilter {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct TargetVpnGatewaysScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, } -impl NestedType for NetworkListWarningData {} -impl Part for NetworkListWarningData {} - - -/// The network endpoint. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpoint { - /// The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. - /// - /// The name must be 1-63 characters long, and comply with RFC1035. - pub instance: Option, - /// Optional IPv4 address of network endpoint. The IP address must belong to a VM in GCE (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. - #[serde(rename="ipAddress")] - pub ip_address: Option, - /// Optional port number of network endpoint. If not specified and the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the defaultPort for the network endpoint group will be used. - pub port: Option, -} - -impl Part for NetworkEndpoint {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetInstanceAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of TargetInstance resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for TargetInstanceAggregatedList {} - - -/// Represents an Instance Template resource. -/// -/// You can use instance templates to create VM instances and managed instance groups. For more information, read Instance Templates. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list instance templates](struct.InstanceTemplateListCall.html) (none) -/// * [delete instance templates](struct.InstanceTemplateDeleteCall.html) (none) -/// * [insert instance templates](struct.InstanceTemplateInsertCall.html) (request) -/// * [get instance templates](struct.InstanceTemplateGetCall.html) (response) -/// * [test iam permissions instance templates](struct.InstanceTemplateTestIamPermissionCall.html) (none) -/// * [get iam policy instance templates](struct.InstanceTemplateGetIamPolicyCall.html) (none) -/// * [set iam policy instance templates](struct.InstanceTemplateSetIamPolicyCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceTemplate { - /// [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. - pub kind: Option, - /// The source instance params to use to create this instance template. - #[serde(rename="sourceInstanceParams")] - pub source_instance_params: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// The instance properties for this instance template. - pub properties: Option, - /// The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - /// - projects/project/zones/zone/instances/instance - #[serde(rename="sourceInstance")] - pub source_instance: Option, - /// [Output Only] The creation timestamp for this instance template in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] A unique identifier for this instance template. The server defines this identifier. - pub id: Option, - /// [Output Only] The URL for this instance template. The server defines this URL. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for InstanceTemplate {} -impl Resource for InstanceTemplate {} -impl ResponseResult for InstanceTemplate {} +impl NestedType for TargetVpnGatewaysScopedListWarning {} +impl Part for TargetVpnGatewaysScopedListWarning {} /// A path-matching rule for a URL. If matched, will use the specified BackendService to handle the traffic arriving at this URL. @@ -9370,6 +4002,14 @@ impl ResponseResult for InstanceTemplate {} pub struct PathRule { /// The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here. pub paths: Option>, + /// When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. + /// If urlRedirect is specified, service or routeAction must not be set. + #[serde(rename="urlRedirect")] + pub url_redirect: Option, + /// In response to a matching path, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. + /// Only one of routeAction or urlRedirect must be set. + #[serde(rename="routeAction")] + pub route_action: Option, /// The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. /// Only one of urlRedirect, service or routeAction.weightedBackendService must be set. pub service: Option, @@ -9397,110 +4037,51 @@ impl NestedType for NodeGroupAggregatedListWarning {} impl Part for NodeGroupAggregatedListWarning {} -/// [Output Only] Informational warning message. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, +pub struct CommitmentListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl NestedType for DiskTypeListWarning {} -impl Part for DiskTypeListWarning {} +impl NestedType for CommitmentListWarningData {} +impl Part for CommitmentListWarningData {} -/// There is no detailed description. +/// Contains a list of packetMirrorings. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list instances region instance groups](struct.RegionInstanceGroupListInstanceCall.html) (request) +/// * [aggregated list packet mirrorings](struct.PacketMirroringAggregatedListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupsListInstancesRequest { - /// Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances. - #[serde(rename="portName")] - pub port_name: Option, - /// Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. - #[serde(rename="instanceState")] - pub instance_state: Option, -} - -impl RequestValue for RegionInstanceGroupsListInstancesRequest {} - - -/// Represents a Project resource. -/// -/// A project is used to organize resources in a Google Cloud Platform environment. For more information, read about the Resource Hierarchy. (== resource_for v1.projects ==) (== resource_for beta.projects ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get xpn resources projects](struct.ProjectGetXpnResourceCall.html) (none) -/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (none) -/// * [set common instance metadata projects](struct.ProjectSetCommonInstanceMetadataCall.html) (none) -/// * [get xpn host projects](struct.ProjectGetXpnHostCall.html) (response) -/// * [enable xpn host projects](struct.ProjectEnableXpnHostCall.html) (none) -/// * [disable xpn resource projects](struct.ProjectDisableXpnResourceCall.html) (none) -/// * [enable xpn resource projects](struct.ProjectEnableXpnResourceCall.html) (none) -/// * [move instance projects](struct.ProjectMoveInstanceCall.html) (none) -/// * [get projects](struct.ProjectGetCall.html) (response) -/// * [move disk projects](struct.ProjectMoveDiskCall.html) (none) -/// * [set default network tier projects](struct.ProjectSetDefaultNetworkTierCall.html) (none) -/// * [disable xpn host projects](struct.ProjectDisableXpnHostCall.html) (none) -/// * [list xpn hosts projects](struct.ProjectListXpnHostCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Project { - /// [Output Only] Type of the resource. Always compute#project for projects. +pub struct PacketMirroringAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. pub kind: Option, - /// [Output Only] Default service account used by VMs running in this project. - #[serde(rename="defaultServiceAccount")] - pub default_service_account: Option, - /// An optional textual description of the resource. - pub description: Option, - /// Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. - #[serde(rename="commonInstanceMetadata")] - pub common_instance_metadata: Option, - /// [Output Only] Quotas assigned to this project. - pub quotas: Option>, - /// The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. - #[serde(rename="usageExportLocation")] - pub usage_export_location: Option, - /// Restricted features enabled for use on this project. - #[serde(rename="enabledFeatures")] - pub enabled_features: Option>, - /// [Output Only] The role this project has in a shared VPC configuration. Currently only HOST projects are differentiated. - #[serde(rename="xpnProjectStatus")] - pub xpn_project_status: Option, - /// This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. - #[serde(rename="defaultNetworkTier")] - pub default_network_tier: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources. + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of PacketMirroring resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. pub id: Option, - /// [Output Only] Server-defined URL for the resource. + /// [Output Only] Server-defined URL for this resource. #[serde(rename="selfLink")] pub self_link: Option, - /// The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. - pub name: Option, } -impl Resource for Project {} -impl ResponseResult for Project {} +impl ResponseResult for PacketMirroringAggregatedList {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -9520,246 +4101,61 @@ impl NestedType for DiskListWarningData {} impl Part for DiskListWarningData {} -/// A schedule for disks where the schedueled operations are performed. +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicySnapshotSchedulePolicySchedule { - /// no description provided - #[serde(rename="weeklySchedule")] - pub weekly_schedule: Option, - /// no description provided - #[serde(rename="hourlySchedule")] - pub hourly_schedule: Option, - /// no description provided - #[serde(rename="dailySchedule")] - pub daily_schedule: Option, -} - -impl Part for ResourcePolicySnapshotSchedulePolicySchedule {} - - -/// Contains a list of firewalls. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list firewalls](struct.FirewallListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FirewallList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Firewall resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for FirewallList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get health backend services](struct.BackendServiceGetHealthCall.html) (request) -/// * [get health region backend services](struct.RegionBackendServiceGetHealthCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourceGroupReference { - /// A URI referencing one of the instance groups or network endpoint groups listed in the backend service. - pub group: Option, -} - -impl RequestValue for ResourceGroupReference {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list managed instances instance group managers](struct.InstanceGroupManagerListManagedInstanceCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersListManagedInstancesResponse { - /// [Output Only] The list of instances in the managed instance group. - #[serde(rename="managedInstances")] - pub managed_instances: Option>, -} - -impl ResponseResult for InstanceGroupManagersListManagedInstancesResponse {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set proxy header target ssl proxies](struct.TargetSslProxySetProxyHeaderCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetSslProxiesSetProxyHeaderRequest { - /// The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, -} - -impl RequestValue for TargetSslProxiesSetProxyHeaderRequest {} - - -/// Contains a list of SslCertificate resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list ssl certificates](struct.SslCertificateListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslCertificateList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of SslCertificate resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for SslCertificateList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworkAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for SubnetworkAggregatedListWarningData {} -impl Part for SubnetworkAggregatedListWarningData {} - - -/// Information about any potential InterconnectAttachments between an Interconnect at a specific InterconnectLocation, and a specific Cloud Region. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectLocationRegionInfo { - /// Identifies the network presence of this location. - #[serde(rename="locationPresence")] - pub location_presence: Option, - /// URL for the region of this location. - pub region: Option, - /// Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region. - #[serde(rename="expectedRttMs")] - pub expected_rtt_ms: Option, -} - -impl Part for InterconnectLocationRegionInfo {} - - -/// Contains a list of ForwardingRule resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list global forwarding rules](struct.GlobalForwardingRuleListCall.html) (response) -/// * [list forwarding rules](struct.ForwardingRuleListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRuleList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of ForwardingRule resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for ForwardingRuleList {} - - -/// Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentsScopedListWarning { +pub struct SubnetworkListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for InterconnectAttachmentsScopedListWarning {} -impl Part for InterconnectAttachmentsScopedListWarning {} +impl NestedType for SubnetworkListWarning {} +impl Part for SubnetworkListWarning {} -/// Message for the expected URL mappings. +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapTest { - /// Path portion of the URL. - pub path: Option, - /// Host portion of the URL. - pub host: Option, - /// Description of this test case. - pub description: Option, - /// Expected BackendService resource the given URL should be mapped to. - pub service: Option, +pub struct DiskTypeListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, } -impl Part for UrlMapTest {} +impl NestedType for DiskTypeListWarning {} +impl Part for DiskTypeListWarning {} + + +/// [Output Only] If warning messages are generated during processing of the operation, this field will be populated. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationWarnings { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for OperationWarnings {} +impl Part for OperationWarnings {} /// There is no detailed description. @@ -9769,19 +4165,17 @@ impl Part for UrlMapTest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list instances region instance groups](struct.RegionInstanceGroupListInstanceCall.html) (response) +/// * [aggregated list target http proxies](struct.TargetHttpProxyAggregatedListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupsListInstances { +pub struct TargetHttpProxyAggregatedList { /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// The resource type. + /// A list of TargetHttpProxiesScopedList resources. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InstanceWithNamedPorts resources. - pub items: Option>, /// [Output Only] Unique identifier for the resource; defined by the server. pub id: Option, /// [Output Only] Server-defined URL for this resource. @@ -9789,43 +4183,7 @@ pub struct RegionInstanceGroupsListInstances { pub self_link: Option, } -impl ResponseResult for RegionInstanceGroupsListInstances {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for RegionListWarningData {} -impl Part for RegionListWarningData {} - - -/// [Output Only] An informational warning that appears when the node templates list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplatesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeTemplatesScopedListWarning {} -impl Part for NodeTemplatesScopedListWarning {} +impl ResponseResult for TargetHttpProxyAggregatedList {} /// There is no detailed description. @@ -9865,53 +4223,6 @@ pub struct RouterStatusBgpPeerStatus { impl Part for RouterStatusBgpPeerStatus {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTypesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NodeTypesScopedListWarningData {} -impl Part for NodeTypesScopedListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list interconnect attachments](struct.InterconnectAttachmentAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InterconnectAttachmentsScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InterconnectAttachmentAggregatedList {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -9931,373 +4242,17 @@ impl NestedType for InstanceGroupsListInstancesWarning {} impl Part for InstanceGroupsListInstancesWarning {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HealthStatus { - /// URL of the instance resource. - pub instance: Option, - /// Health state of the instance. - #[serde(rename="healthState")] - pub health_state: Option, - /// The IP address represented by this resource. - #[serde(rename="ipAddress")] - pub ip_address: Option, - /// The port on the instance. - pub port: Option, -} - -impl Part for HealthStatus {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for DiskTypeAggregatedListWarningData {} -impl Part for DiskTypeAggregatedListWarningData {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRulesScopedList { - /// A list of forwarding rules contained in this scope. - #[serde(rename="forwardingRules")] - pub forwarding_rules: Option>, - /// Informational warning which replaces the list of forwarding rules when the list is empty. - pub warning: Option, -} - -impl Part for ForwardingRulesScopedList {} - - -/// Represents an Operation resource. -/// -/// You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. -/// -/// Operations can be global, regional or zonal. -/// - For global operations, use the globalOperations resource. -/// - For regional operations, use the regionOperations resource. -/// - For zonal operations, use the zonalOperations resource. -/// -/// For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete backend buckets](struct.BackendBucketDeleteCall.html) (response) -/// * [set ssl policy target ssl proxies](struct.TargetSslProxySetSslPolicyCall.html) (response) -/// * [delete ssl certificates](struct.SslCertificateDeleteCall.html) (response) -/// * [resize region disks](struct.RegionDiskResizeCall.html) (response) -/// * [patch autoscalers](struct.AutoscalerPatchCall.html) (response) -/// * [resize instance group managers](struct.InstanceGroupManagerResizeCall.html) (response) -/// * [delete instance templates](struct.InstanceTemplateDeleteCall.html) (response) -/// * [patch region instance group managers](struct.RegionInstanceGroupManagerPatchCall.html) (response) -/// * [update url maps](struct.UrlMapUpdateCall.html) (response) -/// * [delete region backend services](struct.RegionBackendServiceDeleteCall.html) (response) -/// * [delete interconnects](struct.InterconnectDeleteCall.html) (response) -/// * [update shielded instance config instances](struct.InstanceUpdateShieldedInstanceConfigCall.html) (response) -/// * [add resource policies region disks](struct.RegionDiskAddResourcePolicyCall.html) (response) -/// * [delete vpn tunnels](struct.VpnTunnelDeleteCall.html) (response) -/// * [set labels region disks](struct.RegionDiskSetLabelCall.html) (response) -/// * [set machine type instances](struct.InstanceSetMachineTypeCall.html) (response) -/// * [delete https health checks](struct.HttpsHealthCheckDeleteCall.html) (response) -/// * [delete node groups](struct.NodeGroupDeleteCall.html) (response) -/// * [delete ssl policies](struct.SslPolicyDeleteCall.html) (response) -/// * [insert ssl policies](struct.SslPolicyInsertCall.html) (response) -/// * [disable xpn host projects](struct.ProjectDisableXpnHostCall.html) (response) -/// * [set service account instances](struct.InstanceSetServiceAccountCall.html) (response) -/// * [delete global forwarding rules](struct.GlobalForwardingRuleDeleteCall.html) (response) -/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (response) -/// * [delete disks](struct.DiskDeleteCall.html) (response) -/// * [insert networks](struct.NetworkInsertCall.html) (response) -/// * [add resource policies disks](struct.DiskAddResourcePolicyCall.html) (response) -/// * [patch health checks](struct.HealthCheckPatchCall.html) (response) -/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (response) -/// * [delete instances](struct.InstanceDeleteCall.html) (response) -/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (response) -/// * [insert instance group managers](struct.InstanceGroupManagerInsertCall.html) (response) -/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (response) -/// * [set ssl certificates target ssl proxies](struct.TargetSslProxySetSslCertificateCall.html) (response) -/// * [set target global forwarding rules](struct.GlobalForwardingRuleSetTargetCall.html) (response) -/// * [insert autoscalers](struct.AutoscalerInsertCall.html) (response) -/// * [add rule security policies](struct.SecurityPolicyAddRuleCall.html) (response) -/// * [insert instance groups](struct.InstanceGroupInsertCall.html) (response) -/// * [insert subnetworks](struct.SubnetworkInsertCall.html) (response) -/// * [insert routes](struct.RouteInsertCall.html) (response) -/// * [resize disks](struct.DiskResizeCall.html) (response) -/// * [delete target tcp proxies](struct.TargetTcpProxyDeleteCall.html) (response) -/// * [set backend service target ssl proxies](struct.TargetSslProxySetBackendServiceCall.html) (response) -/// * [set default network tier projects](struct.ProjectSetDefaultNetworkTierCall.html) (response) -/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (response) -/// * [set node template node groups](struct.NodeGroupSetNodeTemplateCall.html) (response) -/// * [delete resource policies](struct.ResourcePolicyDeleteCall.html) (response) -/// * [delete region autoscalers](struct.RegionAutoscalerDeleteCall.html) (response) -/// * [remove peering networks](struct.NetworkRemovePeeringCall.html) (response) -/// * [patch ssl policies](struct.SslPolicyPatchCall.html) (response) -/// * [delete interconnect attachments](struct.InterconnectAttachmentDeleteCall.html) (response) -/// * [patch firewalls](struct.FirewallPatchCall.html) (response) -/// * [insert target pools](struct.TargetPoolInsertCall.html) (response) -/// * [insert node templates](struct.NodeTemplateInsertCall.html) (response) -/// * [disable xpn resource projects](struct.ProjectDisableXpnResourceCall.html) (response) -/// * [set disk auto delete instances](struct.InstanceSetDiskAutoDeleteCall.html) (response) -/// * [recreate instances region instance group managers](struct.RegionInstanceGroupManagerRecreateInstanceCall.html) (response) -/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (response) -/// * [insert disks](struct.DiskInsertCall.html) (response) -/// * [delete target ssl proxies](struct.TargetSslProxyDeleteCall.html) (response) -/// * [insert region backend services](struct.RegionBackendServiceInsertCall.html) (response) -/// * [insert https health checks](struct.HttpsHealthCheckInsertCall.html) (response) -/// * [simulate maintenance event instances](struct.InstanceSimulateMaintenanceEventCall.html) (response) -/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (response) -/// * [add signed url key backend buckets](struct.BackendBucketAddSignedUrlKeyCall.html) (response) -/// * [set url map target https proxies](struct.TargetHttpsProxySetUrlMapCall.html) (response) -/// * [create snapshot region disks](struct.RegionDiskCreateSnapshotCall.html) (response) -/// * [delete backend services](struct.BackendServiceDeleteCall.html) (response) -/// * [update network interface instances](struct.InstanceUpdateNetworkInterfaceCall.html) (response) -/// * [insert url maps](struct.UrlMapInsertCall.html) (response) -/// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (response) -/// * [set machine resources instances](struct.InstanceSetMachineResourceCall.html) (response) -/// * [update access config instances](struct.InstanceUpdateAccessConfigCall.html) (response) -/// * [insert security policies](struct.SecurityPolicyInsertCall.html) (response) -/// * [insert addresses](struct.AddresseInsertCall.html) (response) -/// * [insert health checks](struct.HealthCheckInsertCall.html) (response) -/// * [insert global forwarding rules](struct.GlobalForwardingRuleInsertCall.html) (response) -/// * [delete target https proxies](struct.TargetHttpsProxyDeleteCall.html) (response) -/// * [insert target tcp proxies](struct.TargetTcpProxyInsertCall.html) (response) -/// * [get global operations](struct.GlobalOperationGetCall.html) (response) -/// * [delete addresses](struct.AddresseDeleteCall.html) (response) -/// * [insert target vpn gateways](struct.TargetVpnGatewayInsertCall.html) (response) -/// * [set backend service target tcp proxies](struct.TargetTcpProxySetBackendServiceCall.html) (response) -/// * [create snapshot disks](struct.DiskCreateSnapshotCall.html) (response) -/// * [update health checks](struct.HealthCheckUpdateCall.html) (response) -/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (response) -/// * [set metadata instances](struct.InstanceSetMetadataCall.html) (response) -/// * [insert region commitments](struct.RegionCommitmentInsertCall.html) (response) -/// * [add signed url key backend services](struct.BackendServiceAddSignedUrlKeyCall.html) (response) -/// * [insert forwarding rules](struct.ForwardingRuleInsertCall.html) (response) -/// * [start instances](struct.InstanceStartCall.html) (response) -/// * [delete instance group managers](struct.InstanceGroupManagerDeleteCall.html) (response) -/// * [set deletion protection instances](struct.InstanceSetDeletionProtectionCall.html) (response) -/// * [expand ip cidr range subnetworks](struct.SubnetworkExpandIpCidrRangeCall.html) (response) -/// * [set quic override target https proxies](struct.TargetHttpsProxySetQuicOverrideCall.html) (response) -/// * [move disk projects](struct.ProjectMoveDiskCall.html) (response) -/// * [patch interconnects](struct.InterconnectPatchCall.html) (response) -/// * [insert firewalls](struct.FirewallInsertCall.html) (response) -/// * [set labels disks](struct.DiskSetLabelCall.html) (response) -/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (response) -/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (response) -/// * [set security policy backend services](struct.BackendServiceSetSecurityPolicyCall.html) (response) -/// * [delete instances region instance group managers](struct.RegionInstanceGroupManagerDeleteInstanceCall.html) (response) -/// * [detach disk instances](struct.InstanceDetachDiskCall.html) (response) -/// * [insert region disks](struct.RegionDiskInsertCall.html) (response) -/// * [delete instance groups](struct.InstanceGroupDeleteCall.html) (response) -/// * [delete access config instances](struct.InstanceDeleteAccessConfigCall.html) (response) -/// * [set ssl certificates target https proxies](struct.TargetHttpsProxySetSslCertificateCall.html) (response) -/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (response) -/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (response) -/// * [set tags instances](struct.InstanceSetTagCall.html) (response) -/// * [attach network endpoints network endpoint groups](struct.NetworkEndpointGroupAttachNetworkEndpointCall.html) (response) -/// * [resize reservations](struct.ReservationResizeCall.html) (response) -/// * [delete snapshots](struct.SnapshotDeleteCall.html) (response) -/// * [insert target https proxies](struct.TargetHttpsProxyInsertCall.html) (response) -/// * [insert reservations](struct.ReservationInsertCall.html) (response) -/// * [set proxy header target tcp proxies](struct.TargetTcpProxySetProxyHeaderCall.html) (response) -/// * [update backend services](struct.BackendServiceUpdateCall.html) (response) -/// * [remove resource policies disks](struct.DiskRemoveResourcePolicyCall.html) (response) -/// * [delete nodes node groups](struct.NodeGroupDeleteNodeCall.html) (response) -/// * [delete licenses](struct.LicenseDeleteCall.html) (response) -/// * [remove resource policies region disks](struct.RegionDiskRemoveResourcePolicyCall.html) (response) -/// * [patch instance group managers](struct.InstanceGroupManagerPatchCall.html) (response) -/// * [patch subnetworks](struct.SubnetworkPatchCall.html) (response) -/// * [delete reservations](struct.ReservationDeleteCall.html) (response) -/// * [set ssl policy target https proxies](struct.TargetHttpsProxySetSslPolicyCall.html) (response) -/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (response) -/// * [set common instance metadata projects](struct.ProjectSetCommonInstanceMetadataCall.html) (response) -/// * [delete node templates](struct.NodeTemplateDeleteCall.html) (response) -/// * [get region operations](struct.RegionOperationGetCall.html) (response) -/// * [add nodes node groups](struct.NodeGroupAddNodeCall.html) (response) -/// * [insert backend buckets](struct.BackendBucketInsertCall.html) (response) -/// * [insert node groups](struct.NodeGroupInsertCall.html) (response) -/// * [insert licenses](struct.LicenseInsertCall.html) (response) -/// * [patch backend services](struct.BackendServicePatchCall.html) (response) -/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (response) -/// * [delete network endpoint groups](struct.NetworkEndpointGroupDeleteCall.html) (response) -/// * [delete region instance group managers](struct.RegionInstanceGroupManagerDeleteCall.html) (response) -/// * [deprecate images](struct.ImageDeprecateCall.html) (response) -/// * [patch http health checks](struct.HttpHealthCheckPatchCall.html) (response) -/// * [insert region autoscalers](struct.RegionAutoscalerInsertCall.html) (response) -/// * [patch rule security policies](struct.SecurityPolicyPatchRuleCall.html) (response) -/// * [patch interconnect attachments](struct.InterconnectAttachmentPatchCall.html) (response) -/// * [insert images](struct.ImageInsertCall.html) (response) -/// * [delete signed url key backend buckets](struct.BackendBucketDeleteSignedUrlKeyCall.html) (response) -/// * [invalidate cache url maps](struct.UrlMapInvalidateCacheCall.html) (response) -/// * [set named ports instance groups](struct.InstanceGroupSetNamedPortCall.html) (response) -/// * [insert ssl certificates](struct.SslCertificateInsertCall.html) (response) -/// * [insert interconnects](struct.InterconnectInsertCall.html) (response) -/// * [switch to custom mode networks](struct.NetworkSwitchToCustomModeCall.html) (response) -/// * [enable xpn resource projects](struct.ProjectEnableXpnResourceCall.html) (response) -/// * [move instance projects](struct.ProjectMoveInstanceCall.html) (response) -/// * [patch security policies](struct.SecurityPolicyPatchCall.html) (response) -/// * [delete autoscalers](struct.AutoscalerDeleteCall.html) (response) -/// * [set labels snapshots](struct.SnapshotSetLabelCall.html) (response) -/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (response) -/// * [update https health checks](struct.HttpsHealthCheckUpdateCall.html) (response) -/// * [patch region autoscalers](struct.RegionAutoscalerPatchCall.html) (response) -/// * [patch url maps](struct.UrlMapPatchCall.html) (response) -/// * [delete subnetworks](struct.SubnetworkDeleteCall.html) (response) -/// * [delete region disks](struct.RegionDiskDeleteCall.html) (response) -/// * [stop instances](struct.InstanceStopCall.html) (response) -/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (response) -/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (response) -/// * [detach network endpoints network endpoint groups](struct.NetworkEndpointGroupDetachNetworkEndpointCall.html) (response) -/// * [delete target pools](struct.TargetPoolDeleteCall.html) (response) -/// * [update firewalls](struct.FirewallUpdateCall.html) (response) -/// * [insert instances](struct.InstanceInsertCall.html) (response) -/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (response) -/// * [patch region backend services](struct.RegionBackendServicePatchCall.html) (response) -/// * [set labels images](struct.ImageSetLabelCall.html) (response) -/// * [insert target instances](struct.TargetInstanceInsertCall.html) (response) -/// * [insert target http proxies](struct.TargetHttpProxyInsertCall.html) (response) -/// * [insert interconnect attachments](struct.InterconnectAttachmentInsertCall.html) (response) -/// * [patch networks](struct.NetworkPatchCall.html) (response) -/// * [insert resource policies](struct.ResourcePolicyInsertCall.html) (response) -/// * [remove rule security policies](struct.SecurityPolicyRemoveRuleCall.html) (response) -/// * [set named ports region instance groups](struct.RegionInstanceGroupSetNamedPortCall.html) (response) -/// * [insert instance templates](struct.InstanceTemplateInsertCall.html) (response) -/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (response) -/// * [set instance template region instance group managers](struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) (response) -/// * [enable xpn host projects](struct.ProjectEnableXpnHostCall.html) (response) -/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (response) -/// * [delete routers](struct.RouterDeleteCall.html) (response) -/// * [resize region instance group managers](struct.RegionInstanceGroupManagerResizeCall.html) (response) -/// * [delete target vpn gateways](struct.TargetVpnGatewayDeleteCall.html) (response) -/// * [delete health checks](struct.HealthCheckDeleteCall.html) (response) -/// * [insert backend services](struct.BackendServiceInsertCall.html) (response) -/// * [set labels instances](struct.InstanceSetLabelCall.html) (response) -/// * [update region backend services](struct.RegionBackendServiceUpdateCall.html) (response) -/// * [set shielded instance integrity policy instances](struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html) (response) -/// * [delete target http proxies](struct.TargetHttpProxyDeleteCall.html) (response) -/// * [patch backend buckets](struct.BackendBucketPatchCall.html) (response) -/// * [delete global addresses](struct.GlobalAddresseDeleteCall.html) (response) -/// * [patch https health checks](struct.HttpsHealthCheckPatchCall.html) (response) -/// * [delete networks](struct.NetworkDeleteCall.html) (response) -/// * [delete url maps](struct.UrlMapDeleteCall.html) (response) -/// * [insert routers](struct.RouterInsertCall.html) (response) -/// * [reset instances](struct.InstanceResetCall.html) (response) -/// * [update routers](struct.RouterUpdateCall.html) (response) -/// * [patch routers](struct.RouterPatchCall.html) (response) -/// * [add peering networks](struct.NetworkAddPeeringCall.html) (response) -/// * [delete security policies](struct.SecurityPolicyDeleteCall.html) (response) -/// * [set proxy header target ssl proxies](struct.TargetSslProxySetProxyHeaderCall.html) (response) -/// * [delete http health checks](struct.HttpHealthCheckDeleteCall.html) (response) -/// * [insert http health checks](struct.HttpHealthCheckInsertCall.html) (response) -/// * [delete images](struct.ImageDeleteCall.html) (response) -/// * [abandon instances region instance group managers](struct.RegionInstanceGroupManagerAbandonInstanceCall.html) (response) -/// * [set private ip google access subnetworks](struct.SubnetworkSetPrivateIpGoogleAccesCall.html) (response) -/// * [update autoscalers](struct.AutoscalerUpdateCall.html) (response) -/// * [set target pools region instance group managers](struct.RegionInstanceGroupManagerSetTargetPoolCall.html) (response) -/// * [update region autoscalers](struct.RegionAutoscalerUpdateCall.html) (response) -/// * [insert target ssl proxies](struct.TargetSslProxyInsertCall.html) (response) -/// * [start with encryption key instances](struct.InstanceStartWithEncryptionKeyCall.html) (response) -/// * [set min cpu platform instances](struct.InstanceSetMinCpuPlatformCall.html) (response) -/// * [delete forwarding rules](struct.ForwardingRuleDeleteCall.html) (response) -/// * [insert network endpoint groups](struct.NetworkEndpointGroupInsertCall.html) (response) -/// * [update backend buckets](struct.BackendBucketUpdateCall.html) (response) -/// * [insert region instance group managers](struct.RegionInstanceGroupManagerInsertCall.html) (response) -/// * [delete firewalls](struct.FirewallDeleteCall.html) (response) -/// * [get zone operations](struct.ZoneOperationGetCall.html) (response) -/// * [update http health checks](struct.HttpHealthCheckUpdateCall.html) (response) -/// * [delete routes](struct.RouteDeleteCall.html) (response) -/// * [delete signed url key backend services](struct.BackendServiceDeleteSignedUrlKeyCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Operation { - /// [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. - pub status: Option, - /// [Output Only] A textual description of the operation, which is set when the operation is created. - pub description: Option, - /// [Output Only] If warning messages are generated during processing of the operation, this field will be populated. - pub warnings: Option>, - /// [Output Only] If errors are generated during processing of the operation, this field will be populated. - pub error: Option, - /// [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. - #[serde(rename="targetId")] - pub target_id: Option, - /// [Output Only] User who requested the operation, for example: user@example.com. - pub user: Option, - /// [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. - #[serde(rename="startTime")] - pub start_time: Option, - /// [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. - #[serde(rename="clientOperationId")] - pub client_operation_id: Option, - /// [Deprecated] This field is deprecated. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Type of the resource. Always compute#operation for Operation resources. - pub kind: Option, - /// [Output Only] Name of the resource. - pub name: Option, - /// [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. - pub zone: Option, - /// [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. - pub region: Option, - /// [Output Only] The type of operation, such as insert, update, or delete, and so on. - #[serde(rename="operationType")] - pub operation_type: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] The time that this operation was requested. This value is in RFC3339 text format. - #[serde(rename="insertTime")] - pub insert_time: Option, - /// [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. - #[serde(rename="httpErrorMessage")] - pub http_error_message: Option, - /// [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. - pub progress: Option, - /// [Output Only] The time that this operation was completed. This value is in RFC3339 text format. - #[serde(rename="endTime")] - pub end_time: Option, - /// [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found. - #[serde(rename="httpErrorStatusCode")] - pub http_error_status_code: Option, - /// [Output Only] An optional textual description of the current status of the operation. - #[serde(rename="statusMessage")] - pub status_message: Option, - /// [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. - #[serde(rename="targetLink")] - pub target_link: Option, -} - -impl ResponseResult for Operation {} - - /// Represents a Persistent Disk resource. /// +/// Google Compute Engine has two Disk resources: +/// +/// * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks) +/// /// Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks. For more information, read Persistent Disks. For more storage options, read Storage options. /// /// The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks. /// -/// The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for beta.disks ==) (== resource_for v1.disks ==) (== resource_for v1.regionDisks ==) (== resource_for beta.regionDisks ==) +/// The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==) /// /// # Activities /// @@ -10322,7 +4277,7 @@ impl ResponseResult for Operation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Disk { - /// [Output Only] The status of disk creation. + /// [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting. pub status: Option, /// The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: /// - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot @@ -10468,13 +4423,25 @@ pub struct ResourcePolicyList { impl ResponseResult for ResourcePolicyList {} -/// A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==) +/// Represents a Target HTTPS Proxy resource. +/// +/// Google Compute Engine has two Target HTTPS Proxy resources: +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/targetHttpsProxies) * [Regional](/compute/docs/reference/rest/{$api_version}/regionTargetHttpsProxies) +/// +/// A target HTTPS proxy is a component of GCP HTTPS load balancers. +/// +/// * targetHttpsProxies are used by external HTTPS load balancers. * regionTargetHttpsProxies are used by internal HTTPS load balancers. +/// +/// Forwarding rules reference a target HTTPS proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies and Forwarding rule concepts. (== resource_for {$api_version}.targetHttpsProxies ==) (== resource_for {$api_version}.regionTargetHttpsProxies ==) /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [insert region target https proxies](struct.RegionTargetHttpsProxyInsertCall.html) (request) +/// * [get region target https proxies](struct.RegionTargetHttpsProxyGetCall.html) (response) /// * [get target https proxies](struct.TargetHttpsProxyGetCall.html) (response) /// * [insert target https proxies](struct.TargetHttpsProxyInsertCall.html) (request) /// @@ -10484,13 +4451,20 @@ pub struct TargetHttpsProxy { pub kind: Option, /// An optional description of this resource. Provide this property when you create the resource. pub description: Option, + /// [Output Only] URL of the region where the regional TargetHttpsProxy resides. This field is not applicable to global TargetHttpsProxies. + pub region: Option, /// URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. #[serde(rename="sslCertificates")] pub ssl_certificates: Option>, - /// URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource will not have any SSL policy configured. + /// URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured. #[serde(rename="sslPolicy")] pub ssl_policy: Option, - /// Specifies the QUIC override policy for this TargetHttpsProxy resource. This determines whether the load balancer will attempt to negotiate QUIC with clients or not. Can specify one of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC, Enables QUIC when set to ENABLE, and disables QUIC when set to DISABLE. If NONE is specified, uses the QUIC policy with no user overrides, which is equivalent to DISABLE. Not specifying this field is equivalent to specifying NONE. + /// Specifies the QUIC override policy for this TargetHttpsProxy resource. This setting determines whether the load balancer attempts to negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. + /// - When quic-override is set to NONE, Google manages whether QUIC is used. + /// - When quic-override is set to ENABLE, the load balancer uses QUIC when possible. + /// - When quic-override is set to DISABLE, the load balancer doesn't use QUIC. + /// - If the quic-override flag is not specified, NONE is implied. + /// - #[serde(rename="quicOverride")] pub quic_override: Option, /// A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: @@ -10515,136 +4489,9 @@ impl RequestValue for TargetHttpsProxy {} impl ResponseResult for TargetHttpsProxy {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTemplatesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NodeTemplatesScopedListWarningData {} -impl Part for NodeTemplatesScopedListWarningData {} - - -/// Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny). -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get rule security policies](struct.SecurityPolicyGetRuleCall.html) (response) -/// * [add rule security policies](struct.SecurityPolicyAddRuleCall.html) (request) -/// * [patch rule security policies](struct.SecurityPolicyPatchRuleCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicyRule { - /// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. - pub priority: Option, - /// [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// The Action to preform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502. - pub action: Option, - /// If set to true, the specified action is not enforced. - pub preview: Option, - /// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding ?action? is enforced. - #[serde(rename="match")] - pub match_: Option, -} - -impl RequestValue for SecurityPolicyRule {} -impl ResponseResult for SecurityPolicyRule {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagerListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for RegionInstanceGroupManagerListWarning {} -impl Part for RegionInstanceGroupManagerListWarning {} - - -/// Represents a VPC Network resource. -/// -/// Networks connect resources to each other and to the internet. For more information, read Virtual Private Cloud (VPC) Network. (== resource_for v1.networks ==) (== resource_for beta.networks ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [patch networks](struct.NetworkPatchCall.html) (request) -/// * [list networks](struct.NetworkListCall.html) (none) -/// * [delete networks](struct.NetworkDeleteCall.html) (none) -/// * [get networks](struct.NetworkGetCall.html) (response) -/// * [insert networks](struct.NetworkInsertCall.html) (request) -/// * [switch to custom mode networks](struct.NetworkSwitchToCustomModeCall.html) (none) -/// * [add peering networks](struct.NetworkAddPeeringCall.html) (none) -/// * [remove peering networks](struct.NetworkRemovePeeringCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Network { - /// [Output Only] Type of the resource. Always compute#network for networks. - pub kind: Option, - /// An optional description of this resource. Provide this field when you create the resource. - pub description: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. - pub name: Option, - /// [Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network. - pub subnetworks: Option>, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. - #[serde(rename="IPv4Range")] - pub i_pv4_range: Option, - /// [Output Only] The gateway address for default routing out of the network, selected by GCP. - #[serde(rename="gatewayIPv4")] - pub gateway_i_pv4: Option, - /// The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. - #[serde(rename="routingConfig")] - pub routing_config: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// When set to true, the VPC network is created in "auto" mode. When set to false, the VPC network is created in "custom" mode. - /// - /// An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. - #[serde(rename="autoCreateSubnetworks")] - pub auto_create_subnetworks: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] A list of network peerings for the resource. - pub peerings: Option>, -} - -impl RequestValue for Network {} -impl Resource for Network {} -impl ResponseResult for Network {} - - /// Represents a Zone resource. /// -/// A zone is a deployment area. These deployment areas are subsets of a region. For example the zone us-east1-a is located in the us-east1 region. For more information, read Regions and Zones. (== resource_for beta.zones ==) (== resource_for v1.zones ==) +/// A zone is a deployment area. These deployment areas are subsets of a region. For example the zone us-east1-a is located in the us-east1 region. For more information, read Regions and Zones. (== resource_for {$api_version}.zones ==) /// /// # Activities /// @@ -10685,183 +4532,6 @@ impl Resource for Zone {} impl ResponseResult for Zone {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LicensesListResponseWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for LicensesListResponseWarning {} -impl Part for LicensesListResponseWarning {} - - -/// An access configuration attached to an instance's network interface. Only one access config per instance is supported. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [update access config instances](struct.InstanceUpdateAccessConfigCall.html) (request) -/// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccessConfig { - /// This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. - /// - /// If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. - /// - /// If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. - #[serde(rename="networkTier")] - pub network_tier: Option, - /// [Output Only] Type of the resource. Always compute#accessConfig for access configs. - pub kind: Option, - /// The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. - pub name: Option, - /// An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. - #[serde(rename="natIP")] - pub nat_ip: Option, - /// Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. - #[serde(rename="setPublicPtr")] - pub set_public_ptr: Option, - /// The type of configuration. The default and only option is ONE_TO_ONE_NAT. - #[serde(rename="type")] - pub type_: Option, - /// The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. - #[serde(rename="publicPtrDomainName")] - pub public_ptr_domain_name: Option, -} - -impl RequestValue for AccessConfig {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list node groups](struct.NodeGroupAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for aggregated lists of node groups. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of NodeGroupsScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for NodeGroupAggregatedList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UsableSubnetworksAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for UsableSubnetworksAggregatedListWarningData {} -impl Part for UsableSubnetworksAggregatedListWarningData {} - - -/// [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouteWarnings { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for RouteWarnings {} -impl Part for RouteWarnings {} - - -/// Contains a list of Router resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list routers](struct.RouterListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#router for routers. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Router resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RouterList {} - - -/// The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UsageExportLocation { - /// The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. - #[serde(rename="bucketName")] - pub bucket_name: Option, - /// An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. - #[serde(rename="reportNamePrefix")] - pub report_name_prefix: Option, -} - -impl RequestValue for UsageExportLocation {} - - /// Contains a list of Autoscaler resources. /// /// # Activities @@ -10892,36 +4562,6 @@ pub struct AutoscalerList { impl ResponseResult for AutoscalerList {} -/// Contains a list of Subnetwork resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list subnetworks](struct.SubnetworkListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworkList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Subnetwork resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for SubnetworkList {} - - /// CPU utilization policy. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -10940,70 +4580,6 @@ pub struct AutoscalingPolicyCpuUtilization { impl Part for AutoscalingPolicyCpuUtilization {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsAddInstancesRequest { - /// The list of instances to add to the instance group. - pub instances: Option>, -} - -impl RequestValue for InstanceGroupsAddInstancesRequest {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServicesScopedList { - /// Informational warning which replaces the list of backend services when the list is empty. - pub warning: Option, - /// A list of BackendServices contained in this scope. - #[serde(rename="backendServices")] - pub backend_services: Option>, -} - -impl Part for BackendServicesScopedList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list instances](struct.InstanceAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// An object that contains a list of instances scoped by zone. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InstanceAggregatedList {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -11021,228 +4597,40 @@ impl NestedType for SubnetworkListWarningData {} impl Part for SubnetworkListWarningData {} -/// Contains a list of managed instance groups. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list region instance group managers](struct.RegionInstanceGroupManagerListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagerList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InstanceGroupManager resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RegionInstanceGroupManagerList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsListInstances { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InstanceWithNamedPorts resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InstanceGroupsListInstances {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// A specification of the type and number of accelerator cards attached to the instance. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceTemplateListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct AcceleratorConfig { + /// The number of the guest accelerator cards exposed to this instance. + #[serde(rename="acceleratorCount")] + pub accelerator_count: Option, + /// Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. + #[serde(rename="acceleratorType")] + pub accelerator_type: Option, } -impl NestedType for InstanceTemplateListWarningData {} -impl Part for InstanceTemplateListWarningData {} +impl Part for AcceleratorConfig {} -/// A license resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get iam policy licenses](struct.LicenseGetIamPolicyCall.html) (none) -/// * [get licenses](struct.LicenseGetCall.html) (response) -/// * [set iam policy licenses](struct.LicenseSetIamPolicyCall.html) (none) -/// * [list licenses](struct.LicenseListCall.html) (none) -/// * [insert licenses](struct.LicenseInsertCall.html) (request) -/// * [delete licenses](struct.LicenseDeleteCall.html) (none) -/// * [test iam permissions licenses](struct.LicenseTestIamPermissionCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct License { - /// [Output Only] Type of resource. Always compute#license for licenses. - pub kind: Option, - /// An optional textual description of the resource; provided by the client when the resource is created. - pub description: Option, - /// [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. - #[serde(rename="chargesUseFee")] - pub charges_use_fee: Option, - /// [Output Only] The unique code used to attach this license to images, snapshots, and disks. - #[serde(rename="licenseCode")] - pub license_code: Option, - /// If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. - pub transferable: Option, - /// no description provided - #[serde(rename="resourceRequirements")] - pub resource_requirements: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Name of the resource. The name must be 1-63 characters long and comply with RFC1035. - pub name: Option, -} - -impl RequestValue for License {} -impl Resource for License {} -impl ResponseResult for License {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsRemoveHealthCheckRequest { - /// Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: - /// - https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check - /// - projects/project/global/httpHealthChecks/health-check - /// - global/httpHealthChecks/health-check - #[serde(rename="healthChecks")] - pub health_checks: Option>, -} - -impl RequestValue for TargetPoolsRemoveHealthCheckRequest {} - - -/// [Output Only] An informational warning that appears when the accelerator types list is empty. +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypesScopedListWarning { +pub struct ExternalVpnGatewayListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for AcceleratorTypesScopedListWarning {} -impl Part for AcceleratorTypesScopedListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list instance group managers](struct.InstanceGroupManagerAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagerAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InstanceGroupManagersScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InstanceGroupManagerAggregatedList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list network endpoints network endpoint groups](struct.NetworkEndpointGroupListNetworkEndpointCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupsListNetworkEndpoints { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of NetworkEndpointWithHealthStatus resources. - pub items: Option>, - /// [Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, -} - -impl ResponseResult for NetworkEndpointGroupsListNetworkEndpoints {} +impl NestedType for ExternalVpnGatewayListWarning {} +impl Part for ExternalVpnGatewayListWarning {} /// Contains a list of instances. @@ -11275,32 +4663,9 @@ pub struct InstanceList { impl ResponseResult for InstanceList {} -/// There is no detailed description. +/// Represents a legacy HTTPS Health Check resource. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set iam policy images](struct.ImageSetIamPolicyCall.html) (request) -/// * [set iam policy snapshots](struct.SnapshotSetIamPolicyCall.html) (request) -/// * [set iam policy instance templates](struct.InstanceTemplateSetIamPolicyCall.html) (request) -/// * [set iam policy licenses](struct.LicenseSetIamPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GlobalSetPolicyRequest { - /// REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. - pub policy: Option, - /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. - pub bindings: Option>, - /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. - pub etag: Option, -} - -impl RequestValue for GlobalSetPolicyRequest {} - - -/// An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS. +/// Legacy health checks are required by network load balancers. For more information, read Health Check Concepts. /// /// # Activities /// @@ -11356,42 +4721,6 @@ impl Resource for HttpsHealthCheck {} impl ResponseResult for HttpsHealthCheck {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for ReservationAggregatedListWarning {} -impl Part for ReservationAggregatedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for AddressListWarningData {} -impl Part for AddressListWarningData {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -11407,179 +4736,6 @@ pub struct CommitmentsScopedList { impl Part for CommitmentsScopedList {} -/// An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete ssl certificates](struct.SslCertificateDeleteCall.html) (none) -/// * [get ssl certificates](struct.SslCertificateGetCall.html) (response) -/// * [insert ssl certificates](struct.SslCertificateInsertCall.html) (request) -/// * [list ssl certificates](struct.SslCertificateListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslCertificate { - /// [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. - pub kind: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. - pub certificate: Option, - /// A write-only private key in PEM format. Only insert requests will include this field. - #[serde(rename="privateKey")] - pub private_key: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, -} - -impl RequestValue for SslCertificate {} -impl Resource for SslCertificate {} -impl ResponseResult for SslCertificate {} - - -/// Represents an expression text. Example: -/// -/// title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Expr { - /// An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. - pub description: Option, - /// Textual representation of an expression in Common Expression Language syntax. - /// - /// The application context of the containing message determines which well-known feature set of CEL is supported. - pub expression: Option, - /// An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. - pub location: Option, - /// An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. - pub title: Option, -} - -impl Part for Expr {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for VpnTunnelAggregatedListWarningData {} -impl Part for VpnTunnelAggregatedListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsAddHealthCheckRequest { - /// The HttpHealthCheck to add to the target pool. - #[serde(rename="healthChecks")] - pub health_checks: Option>, -} - -impl RequestValue for TargetPoolsAddHealthCheckRequest {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstanceGroupsScopedListWarningData {} -impl Part for InstanceGroupsScopedListWarningData {} - - -/// The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FirewallDenied { - /// The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. - #[serde(rename="IPProtocol")] - pub ip_protocol: Option, - /// An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. - /// - /// Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. - pub ports: Option>, -} - -impl NestedType for FirewallDenied {} -impl Part for FirewallDenied {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set ssl certificates target https proxies](struct.TargetHttpsProxySetSslCertificateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetHttpsProxiesSetSslCertificatesRequest { - /// New set of SslCertificate resources to associate with this TargetHttpsProxy resource. Currently exactly one SslCertificate resource must be specified. - #[serde(rename="sslCertificates")] - pub ssl_certificates: Option>, -} - -impl RequestValue for TargetHttpsProxiesSetSslCertificatesRequest {} - - -/// [Output Only] Informational warning which replaces the list of disk types when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for DiskTypesScopedListWarning {} -impl Part for DiskTypesScopedListWarning {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -11596,248 +4752,69 @@ pub struct CustomerEncryptionKeyProtectedDisk { impl Part for CustomerEncryptionKeyProtectedDisk {} -/// Contains a list of HttpHealthCheck resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list http health checks](struct.HttpHealthCheckListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HttpHealthCheckList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of HttpHealthCheck resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for HttpHealthCheckList {} - - -/// A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide. +/// Settings controlling the eviction of unhealthy hosts from the load balancing pool for the backend service. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkRoutingConfig { - /// The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. - #[serde(rename="routingMode")] - pub routing_mode: Option, +pub struct OutlierDetection { + /// The base time that a host is ejected for. The real ejection time is equal to the base ejection time multiplied by the number of times the host has been ejected. Defaults to 30000ms or 30s. + #[serde(rename="baseEjectionTime")] + pub base_ejection_time: Option, + /// The number of hosts in a cluster that must have enough request volume to detect success rate outliers. If the number of hosts is less than this setting, outlier detection via success rate statistics is not performed for any host in the cluster. Defaults to 5. + #[serde(rename="successRateMinimumHosts")] + pub success_rate_minimum_hosts: Option, + /// The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0. + #[serde(rename="enforcingConsecutiveErrors")] + pub enforcing_consecutive_errors: Option, + /// Time interval between ejection analysis sweeps. This can result in both new ejections as well as hosts being returned to service. Defaults to 1 second. + pub interval: Option, + /// The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + #[serde(rename="enforcingConsecutiveGatewayFailure")] + pub enforcing_consecutive_gateway_failure: Option, + /// The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this host in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that host. Defaults to 100. + #[serde(rename="successRateRequestVolume")] + pub success_rate_request_volume: Option, + /// Number of errors before a host is ejected from the connection pool. When the backend host is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5. + #[serde(rename="consecutiveErrors")] + pub consecutive_errors: Option, + /// This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900. + #[serde(rename="successRateStdevFactor")] + pub success_rate_stdev_factor: Option, + /// The percentage chance that a host will be actually ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + #[serde(rename="enforcingSuccessRate")] + pub enforcing_success_rate: Option, + /// The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 3. + #[serde(rename="consecutiveGatewayFailure")] + pub consecutive_gateway_failure: Option, + /// Maximum percentage of hosts in the load balancing pool for the backend service that can be ejected. Defaults to 50%. + #[serde(rename="maxEjectionPercent")] + pub max_ejection_percent: Option, } -impl Part for NetworkRoutingConfig {} +impl Part for OutlierDetection {} -/// An instance-attached disk resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AttachedDisk { - /// Encrypts or decrypts a disk using a customer-supplied encryption key. - /// - /// If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. - /// - /// If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. - /// - /// If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. - /// - /// Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. - #[serde(rename="diskEncryptionKey")] - pub disk_encryption_key: Option, - /// Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. - /// - /// If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. - #[serde(rename="deviceName")] - pub device_name: Option, - /// [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. - pub kind: Option, - /// [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. - /// - /// This property is mutually exclusive with the source property; you can only define one or the other, but not both. - #[serde(rename="initializeParams")] - pub initialize_params: Option, - /// Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). - #[serde(rename="autoDelete")] - pub auto_delete: Option, - /// [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. - pub index: Option, - /// Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. - pub boot: Option, - /// A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. - #[serde(rename="guestOsFeatures")] - pub guest_os_features: Option>, - /// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. TODO(b/131765817): Update documentation when NVME is supported. - pub interface: Option, - /// The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. - pub mode: Option, - /// [Output Only] Any valid publicly visible licenses. - pub licenses: Option>, - /// Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. - #[serde(rename="type")] - pub type_: Option, - /// Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. - /// - /// If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. - /// - /// Note that for InstanceTemplate, specify the disk name, not the URL for the disk. - pub source: Option, -} - -impl RequestValue for AttachedDisk {} - - -/// Response to the list request, and contains a list of interconnect locations. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list interconnect locations](struct.InterconnectLocationListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectLocationList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InterconnectLocation resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for InterconnectLocationList {} - - -/// An HealthCheck resource. This resource defines a template for how individual virtual machines should be checked for health, via one of the supported protocols. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert health checks](struct.HealthCheckInsertCall.html) (request) -/// * [patch health checks](struct.HealthCheckPatchCall.html) (request) -/// * [get health checks](struct.HealthCheckGetCall.html) (response) -/// * [update health checks](struct.HealthCheckUpdateCall.html) (request) -/// * [list health checks](struct.HealthCheckListCall.html) (none) -/// * [delete health checks](struct.HealthCheckDeleteCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HealthCheck { - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. - #[serde(rename="timeoutSec")] - pub timeout_sec: Option, - /// no description provided - #[serde(rename="httpHealthCheck")] - pub http_health_check: Option, - /// A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. - #[serde(rename="unhealthyThreshold")] - pub unhealthy_threshold: Option, - /// no description provided - #[serde(rename="http2HealthCheck")] - pub http2_health_check: Option, - /// no description provided - #[serde(rename="httpsHealthCheck")] - pub https_health_check: Option, - /// [Output Only] Creation timestamp in 3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// Type of the resource. - pub kind: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// How often (in seconds) to send a health check. The default value is 5 seconds. - #[serde(rename="checkIntervalSec")] - pub check_interval_sec: Option, - /// no description provided - #[serde(rename="tcpHealthCheck")] - pub tcp_health_check: Option, - /// A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. - #[serde(rename="healthyThreshold")] - pub healthy_threshold: Option, - /// Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of the protocol-specific health check field must be specified, which must match type field. - #[serde(rename="type")] - pub type_: Option, - /// no description provided - #[serde(rename="sslHealthCheck")] - pub ssl_health_check: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for HealthCheck {} -impl Resource for HealthCheck {} -impl ResponseResult for HealthCheck {} - - -/// Message containing Cloud CDN configuration for a backend service. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServiceCdnPolicy { - /// [Output Only] Names of the keys for signing request URLs. - #[serde(rename="signedUrlKeyNames")] - pub signed_url_key_names: Option>, - /// Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. - #[serde(rename="signedUrlCacheMaxAgeSec")] - pub signed_url_cache_max_age_sec: Option, - /// The CacheKeyPolicy for this CdnPolicy. - #[serde(rename="cacheKeyPolicy")] - pub cache_key_policy: Option, +pub struct HealthChecksAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl Part for BackendServiceCdnPolicy {} - - -/// Configuration parameters of autoscaling based on load balancing. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalingPolicyLoadBalancingUtilization { - /// Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. - #[serde(rename="utilizationTarget")] - pub utilization_target: Option, -} - -impl Part for AutoscalingPolicyLoadBalancingUtilization {} +impl NestedType for HealthChecksAggregatedListWarningData {} +impl Part for HealthChecksAggregatedListWarningData {} /// Represent a sole-tenant Node Template resource. /// -/// You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for beta.nodeTemplates ==) (== resource_for v1.nodeTemplates ==) (== NextID: 16 ==) +/// You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for {$api_version}.nodeTemplates ==) (== NextID: 19 ==) /// /// # Activities /// @@ -11901,62 +4878,6 @@ impl Resource for NodeTemplate {} impl ResponseResult for NodeTemplate {} -/// Secondary IP range of a usable subnetwork. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UsableSubnetworkSecondaryRange { - /// The range of IP addresses belonging to this subnetwork secondary range. - #[serde(rename="ipCidrRange")] - pub ip_cidr_range: Option, - /// The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. - #[serde(rename="rangeName")] - pub range_name: Option, -} - -impl Part for UsableSubnetworkSecondaryRange {} - - -/// [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalersScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for AutoscalersScopedListWarning {} -impl Part for AutoscalersScopedListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set ssl policy target ssl proxies](struct.TargetSslProxySetSslPolicyCall.html) (request) -/// * [set ssl policy target https proxies](struct.TargetHttpsProxySetSslPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslPolicyReference { - /// URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource. - #[serde(rename="sslPolicy")] - pub ssl_policy: Option, -} - -impl RequestValue for SslPolicyReference {} - - /// There is no detailed description. /// /// # Activities @@ -11987,254 +4908,7 @@ pub struct TargetPoolAggregatedList { impl ResponseResult for TargetPoolAggregatedList {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HealthStatusForNetworkEndpoint { - /// URL of the forwarding rule associated with the health state of the network endpoint. - #[serde(rename="forwardingRule")] - pub forwarding_rule: Option, - /// Health state of the network endpoint determined based on the health checks configured. - #[serde(rename="healthState")] - pub health_state: Option, - /// URL of the backend service associated with the health state of the network endpoint. - #[serde(rename="backendService")] - pub backend_service: Option, - /// URL of the health check associated with the health state of the network endpoint. - #[serde(rename="healthCheck")] - pub health_check: Option, -} - -impl Part for HealthStatusForNetworkEndpoint {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ZoneListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ZoneListWarningData {} -impl Part for ZoneListWarningData {} - - -/// Represents a Subnetwork resource. -/// -/// A subnetwork (also known as a subnet) is a logical partition of a Virtual Private Cloud network with one primary IP range and zero or more secondary IP ranges. For more information, read Virtual Private Cloud (VPC) Network. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set private ip google access subnetworks](struct.SubnetworkSetPrivateIpGoogleAccesCall.html) (none) -/// * [expand ip cidr range subnetworks](struct.SubnetworkExpandIpCidrRangeCall.html) (none) -/// * [aggregated list subnetworks](struct.SubnetworkAggregatedListCall.html) (none) -/// * [list usable subnetworks](struct.SubnetworkListUsableCall.html) (none) -/// * [get iam policy subnetworks](struct.SubnetworkGetIamPolicyCall.html) (none) -/// * [insert subnetworks](struct.SubnetworkInsertCall.html) (request) -/// * [test iam permissions subnetworks](struct.SubnetworkTestIamPermissionCall.html) (none) -/// * [set iam policy subnetworks](struct.SubnetworkSetIamPolicyCall.html) (none) -/// * [get subnetworks](struct.SubnetworkGetCall.html) (response) -/// * [delete subnetworks](struct.SubnetworkDeleteCall.html) (none) -/// * [list subnetworks](struct.SubnetworkListCall.html) (none) -/// * [patch subnetworks](struct.SubnetworkPatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Subnetwork { - /// [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. - pub description: Option, - /// The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. - #[serde(rename="gatewayAddress")] - pub gateway_address: Option, - /// URL of the region where the Subnetwork resides. This field can be set only at resource creation time. - pub region: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is to disable flow logging. - #[serde(rename="enableFlowLogs")] - pub enable_flow_logs: Option, - /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. - /// - /// To see the latest fingerprint, make a get() request to retrieve a Subnetwork. - pub fingerprint: Option, - /// Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. - #[serde(rename="privateIpGoogleAccess")] - pub private_ip_google_access: Option, - /// The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time. - #[serde(rename="ipCidrRange")] - pub ip_cidr_range: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request. - #[serde(rename="secondaryIpRanges")] - pub secondary_ip_ranges: Option>, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time. - pub network: Option, -} - -impl RequestValue for Subnetwork {} -impl Resource for Subnetwork {} -impl ResponseResult for Subnetwork {} - - -/// A guest attributes entry. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get guest attributes instances](struct.InstanceGetGuestAttributeCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GuestAttributes { - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. - pub kind: Option, - /// [Output Only] The value of the requested queried path. - #[serde(rename="queryValue")] - pub query_value: Option, - /// [Output Only] The value found for the requested key. - #[serde(rename="variableValue")] - pub variable_value: Option, - /// The path to be queried. This can be the default namespace ('/') or a nested namespace ('//') or a specified key ('//') - #[serde(rename="queryPath")] - pub query_path: Option, - /// The key to search for. - #[serde(rename="variableKey")] - pub variable_key: Option, -} - -impl ResponseResult for GuestAttributes {} - - -/// Represents an Accelerator Type resource. -/// -/// Google Cloud Platform provides graphics processing units (accelerators) that you can add to VM instances to improve or accelerate performance when working with intensive workloads. For more information, read GPUs on Compute Engine. (== resource_for beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list accelerator types](struct.AcceleratorTypeListCall.html) (none) -/// * [get accelerator types](struct.AcceleratorTypeGetCall.html) (response) -/// * [aggregated list accelerator types](struct.AcceleratorTypeAggregatedListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorType { - /// [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. - pub kind: Option, - /// [Output Only] An optional textual description of the resource. - pub description: Option, - /// [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. - pub zone: Option, - /// [Output Only] The deprecation status associated with this accelerator type. - pub deprecated: Option, - /// [Output Only] Maximum accelerator cards allowed per instance. - #[serde(rename="maximumCardsPerInstance")] - pub maximum_cards_per_instance: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined fully-qualified URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Name of the resource. - pub name: Option, -} - -impl Resource for AcceleratorType {} -impl ResponseResult for AcceleratorType {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ImageListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for ImageListWarningData {} -impl Part for ImageListWarningData {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTypesScopedList { - /// [Output Only] An informational warning that appears when the node types list is empty. - pub warning: Option, - /// [Output Only] A list of node types contained in this scope. - #[serde(rename="nodeTypes")] - pub node_types: Option>, -} - -impl Part for NodeTypesScopedList {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { - /// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. - pub interface: Option, - /// Specifies the size of the disk in base-2 GB. - #[serde(rename="diskSizeGb")] - pub disk_size_gb: Option, -} - -impl Part for AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationsScopedList { - /// A list of reservations contained in this scope. - pub reservations: Option>, - /// Informational warning which replaces the list of reservations when the list is empty. - pub warning: Option, -} - -impl Part for ReservationsScopedList {} - - -/// Diagnostics information about interconnect, contains detailed and current technical information about Google?s side of the connection. +/// Diagnostics information about interconnect, contains detailed and current technical information about Google's side of the connection. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -12253,337 +4927,28 @@ pub struct InterconnectDiagnostics { impl Part for InterconnectDiagnostics {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstanceListWarning {} -impl Part for InstanceListWarning {} - - /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list xpn hosts projects](struct.ProjectListXpnHostCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct XpnHostList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// [Output Only] A list of shared VPC host project URLs. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for XpnHostList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct ExchangedPeeringRoute { + /// The priority of the peering route. + pub priority: Option, + /// True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict. + pub imported: Option, + /// The destination range of the route. + #[serde(rename="destRange")] + pub dest_range: Option, + /// The type of the peering route. + #[serde(rename="type")] + pub type_: Option, + /// The region of peering route next hop, only applies to dynamic routes. + #[serde(rename="nextHopRegion")] + pub next_hop_region: Option, } -impl NestedType for VpnTunnelsScopedListWarningData {} -impl Part for VpnTunnelsScopedListWarningData {} - - -/// Represents an Image resource. -/// -/// You can use images to create boot disks for your VM instances. For more information, read Images. (== resource_for beta.images ==) (== resource_for v1.images ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete images](struct.ImageDeleteCall.html) (none) -/// * [set iam policy images](struct.ImageSetIamPolicyCall.html) (none) -/// * [insert images](struct.ImageInsertCall.html) (request) -/// * [test iam permissions images](struct.ImageTestIamPermissionCall.html) (none) -/// * [get iam policy images](struct.ImageGetIamPolicyCall.html) (none) -/// * [get images](struct.ImageGetCall.html) (response) -/// * [get from family images](struct.ImageGetFromFamilyCall.html) (response) -/// * [set labels images](struct.ImageSetLabelCall.html) (none) -/// * [deprecate images](struct.ImageDeprecateCall.html) (none) -/// * [list images](struct.ImageListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Image { - /// [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. - pub status: Option, - /// URL of the source snapshot used to create this image. This can be a full or valid partial URL. You must provide exactly one of: - /// - this property, or - /// - the sourceImage property, or - /// - the rawDisk.source property, or - /// - the sourceDisk property in order to create an image. - #[serde(rename="sourceSnapshot")] - pub source_snapshot: Option, - /// The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. - #[serde(rename="sourceImageEncryptionKey")] - pub source_image_encryption_key: Option, - /// The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. - #[serde(rename="sourceDiskEncryptionKey")] - pub source_disk_encryption_key: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. - pub family: Option, - /// A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. - /// - /// To see the latest fingerprint, make a get() request to retrieve an image. - #[serde(rename="labelFingerprint")] - pub label_fingerprint: Option, - /// Labels to apply to this image. These can be later modified by the setLabels method. - pub labels: Option>, - /// Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). - #[serde(rename="archiveSizeBytes")] - pub archive_size_bytes: Option, - /// [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. - #[serde(rename="sourceDiskId")] - pub source_disk_id: Option, - /// A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. - #[serde(rename="guestOsFeatures")] - pub guest_os_features: Option>, - /// [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name. - #[serde(rename="sourceSnapshotId")] - pub source_snapshot_id: Option, - /// URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of: - /// - this property, or - /// - the rawDisk.source property, or - /// - the sourceDisk property in order to create an image. - #[serde(rename="sourceImage")] - pub source_image: Option, - /// Any applicable license URI. - pub licenses: Option>, - /// The type of the image used to create this disk. The default and only value is RAW - #[serde(rename="sourceType")] - pub source_type: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// Integer license codes indicating which licenses are attached to this image. - #[serde(rename="licenseCodes")] - pub license_codes: Option>, - /// [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name. - #[serde(rename="sourceImageId")] - pub source_image_id: Option, - /// [Output Only] Type of the resource. Always compute#image for images. - pub kind: Option, - /// The parameters of the raw disk image. - #[serde(rename="rawDisk")] - pub raw_disk: Option, - /// URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values: - /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - /// - projects/project/zones/zone/disks/disk - /// - zones/zone/disks/disk - #[serde(rename="sourceDisk")] - pub source_disk: Option, - /// The deprecation status associated with this image. - pub deprecated: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// Size of the image when restored onto a persistent disk (in GB). - #[serde(rename="diskSizeGb")] - pub disk_size_gb: Option, - /// Encrypts the image using a customer-supplied encryption key. - /// - /// After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). - /// - /// Customer-supplied encryption keys do not protect access to metadata of the disk. - /// - /// If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. - #[serde(rename="imageEncryptionKey")] - pub image_encryption_key: Option, - /// The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. - #[serde(rename="sourceSnapshotEncryptionKey")] - pub source_snapshot_encryption_key: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for Image {} -impl Resource for Image {} -impl ResponseResult for Image {} - - -/// A set of instance tags. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set tags instances](struct.InstanceSetTagCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Tags { - /// An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. - pub items: Option>, - /// Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. - /// - /// To see the latest fingerprint, make get() request to the instance. - pub fingerprint: Option, -} - -impl RequestValue for Tags {} - - -/// The parameters of the raw disk image. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ImageRawDisk { - /// The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. - #[serde(rename="containerType")] - pub container_type: Option, - /// The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both. - pub source: Option, - /// [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created. - #[serde(rename="sha1Checksum")] - pub sha1_checksum: Option, -} - -impl NestedType for ImageRawDisk {} -impl Part for ImageRawDisk {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalerAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for AutoscalerAggregatedListWarning {} -impl Part for AutoscalerAggregatedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RoutersScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for RoutersScopedListWarningData {} -impl Part for RoutersScopedListWarningData {} - - -/// Cloud Autoscaler policy. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalingPolicy { - /// Configuration parameters of autoscaling based on a custom metric. - #[serde(rename="customMetricUtilizations")] - pub custom_metric_utilizations: Option>, - /// The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. - #[serde(rename="maxNumReplicas")] - pub max_num_replicas: Option, - /// Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. - #[serde(rename="cpuUtilization")] - pub cpu_utilization: Option, - /// The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed. - #[serde(rename="minNumReplicas")] - pub min_num_replicas: Option, - /// The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. - /// - /// Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process. - #[serde(rename="coolDownPeriodSec")] - pub cool_down_period_sec: Option, - /// Configuration parameters of autoscaling based on load balancer. - #[serde(rename="loadBalancingUtilization")] - pub load_balancing_utilization: Option, -} - -impl Part for AutoscalingPolicy {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VmEndpointNatMappingsListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for VmEndpointNatMappingsListWarning {} -impl Part for VmEndpointNatMappingsListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationsScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for OperationsScopedListWarningData {} -impl Part for OperationsScopedListWarningData {} +impl Part for ExchangedPeeringRoute {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -12603,304 +4968,6 @@ impl NestedType for TargetVpnGatewaysScopedListWarningData {} impl Part for TargetVpnGatewaysScopedListWarningData {} -/// A list of TargetHttpProxy resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list target http proxies](struct.TargetHttpProxyListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetHttpProxyList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of TargetHttpProxy resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for TargetHttpProxyList {} - - -/// Represents a regional Commitment resource. -/// -/// Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. (== resource_for beta.regionCommitments ==) (== resource_for v1.regionCommitments ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert region commitments](struct.RegionCommitmentInsertCall.html) (request) -/// * [get region commitments](struct.RegionCommitmentGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Commitment { - /// [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. - pub status: Option, - /// [Output Only] Type of the resource. Always compute#commitment for commitments. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// List of reservations for this commitment. - pub reservations: Option>, - /// [Output Only] Commitment start time in RFC3339 text format. - #[serde(rename="startTimestamp")] - pub start_timestamp: Option, - /// A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. - pub resources: Option>, - /// [Output Only] Commitment end time in RFC3339 text format. - #[serde(rename="endTimestamp")] - pub end_timestamp: Option, - /// [Output Only] An optional, human-readable explanation of the status. - #[serde(rename="statusMessage")] - pub status_message: Option, - /// [Output Only] URL of the region where this commitment may be used. - pub region: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). - pub plan: Option, -} - -impl RequestValue for Commitment {} -impl ResponseResult for Commitment {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupNode { - /// no description provided - pub status: Option, - /// Instances scheduled on this node. - pub instances: Option>, - /// The type of this node. - #[serde(rename="nodeType")] - pub node_type: Option, - /// The name of the node. - pub name: Option, - /// Binding properties for the physical server. - #[serde(rename="serverBinding")] - pub server_binding: Option, -} - -impl Part for NodeGroupNode {} - - -/// A guest attributes namespace/key/value entry. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GuestAttributesEntry { - /// Namespace for the guest attribute entry. - pub namespace: Option, - /// Key for the guest attribute entry. - pub key: Option, - /// Value for the guest attribute entry. - pub value: Option, -} - -impl Part for GuestAttributesEntry {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for OperationAggregatedListWarning {} -impl Part for OperationAggregatedListWarning {} - - -/// Contains a list of region resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list regions](struct.RegionListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#regionList for lists of regions. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Region resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RegionList {} - - -/// Message containing information of one individual backend. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Backend { - /// The fully-qualified URL of an Instance Group or Network Endpoint Group resource. In case of instance group this defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource. - /// - /// For Network Endpoint Groups this defines list of endpoints. All endpoints of Network Endpoint Group must be hosted on instances located in the same zone as the Network Endpoint Group. - /// - /// Backend service can not contain mix of Instance Group and Network Endpoint Group backends. - /// - /// Note that you must specify an Instance Group or Network Endpoint Group resource using the fully-qualified URL, rather than a partial URL. - /// - /// When the BackendService has load balancing scheme INTERNAL, the instance group must be within the same region as the BackendService. Network Endpoint Groups are not supported for INTERNAL load balancing scheme. - pub group: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0]. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="maxUtilization")] - pub max_utilization: Option, - /// The max number of simultaneous connections that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerEndpoint must be set. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="maxConnectionsPerEndpoint")] - pub max_connections_per_endpoint: Option, - /// A multiplier applied to the group's maximum servicing capacity (based on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the group will serve up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available Capacity. Valid range is [0.0,1.0]. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="capacityScaler")] - pub capacity_scaler: Option, - /// The max number of simultaneous connections that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="maxConnectionsPerInstance")] - pub max_connections_per_instance: Option, - /// The max requests per second (RPS) that a single backend network endpoint can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerEndpoint must be set. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="maxRatePerEndpoint")] - pub max_rate_per_endpoint: Option, - /// The max requests per second (RPS) that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="maxRatePerInstance")] - pub max_rate_per_instance: Option, - /// The max requests per second (RPS) of the group. Can be used with either RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE mode, either maxRate or maxRatePerInstance must be set. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="maxRate")] - pub max_rate: Option, - /// The max number of simultaneous connections for the group. Can be used with either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set. - /// - /// This cannot be used for internal load balancing. - #[serde(rename="maxConnections")] - pub max_connections: Option, - /// Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). - /// - /// For Internal Load Balancing, the default and only supported mode is CONNECTION. - #[serde(rename="balancingMode")] - pub balancing_mode: Option, -} - -impl Part for Backend {} - - -/// [Output Only] An informational warning that appears when the node types list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTypesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeTypesScopedListWarning {} -impl Part for NodeTypesScopedListWarning {} - - -/// Response for the InterconnectsGetDiagnosticsRequest. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get diagnostics interconnects](struct.InterconnectGetDiagnosticCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectsGetDiagnosticsResponse { - /// no description provided - pub result: Option, -} - -impl ResponseResult for InterconnectsGetDiagnosticsResponse {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolInstanceHealth { - /// [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. - pub kind: Option, - /// no description provided - #[serde(rename="healthStatus")] - pub health_status: Option>, -} - -impl ResponseResult for TargetPoolInstanceHealth {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -12916,93 +4983,6 @@ pub struct OperationsScopedList { impl Part for OperationsScopedList {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set named ports region instance groups](struct.RegionInstanceGroupSetNamedPortCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupsSetNamedPortsRequest { - /// The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. - pub fingerprint: Option, - /// The list of named ports to set for this instance group. - #[serde(rename="namedPorts")] - pub named_ports: Option>, -} - -impl RequestValue for RegionInstanceGroupsSetNamedPortsRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list node types](struct.NodeTypeAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTypeAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for aggregated lists of node types. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of NodeTypesScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for NodeTypeAggregatedList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslPoliciesListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for SslPoliciesListWarningData {} -impl Part for SslPoliciesListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslCertificateListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for SslCertificateListWarning {} -impl Part for SslCertificateListWarning {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -13033,75 +5013,40 @@ impl Part for RouterStatus {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServiceListWarning { +pub struct InstanceGroupAggregatedListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for BackendServiceListWarning {} -impl Part for BackendServiceListWarning {} - - -/// Array of guest attribute namespace/key/value tuples. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GuestAttributesValue { - /// no description provided - pub items: Option>, -} - -impl Part for GuestAttributesValue {} +impl NestedType for InstanceGroupAggregatedListWarning {} +impl Part for InstanceGroupAggregatedListWarning {} /// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterBgp { - /// User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. - #[serde(rename="advertisedIpRanges")] - pub advertised_ip_ranges: Option>, - /// User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. - #[serde(rename="advertiseMode")] - pub advertise_mode: Option, - /// User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. - #[serde(rename="advertisedGroups")] - pub advertised_groups: Option>, - /// Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. - pub asn: Option, -} - -impl Part for RouterBgp {} - - -/// Contains a list of reservations. -/// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [aggregated list reservations](struct.ReservationAggregatedListCall.html) (response) +/// * [aggregated list vpn gateways](struct.VpnGatewayAggregatedListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationAggregatedList { +pub struct VpnGatewayAggregatedList { /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Type of resource. + /// [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. pub kind: Option, /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Allocation resources. - pub items: Option>, + pub warning: Option, + /// A list of VpnGateway resources. + pub items: Option>, /// [Output Only] Unique identifier for the resource; defined by the server. pub id: Option, /// [Output Only] Server-defined URL for this resource. @@ -13109,45 +5054,7 @@ pub struct ReservationAggregatedList { pub self_link: Option, } -impl ResponseResult for ReservationAggregatedList {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectLocationListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InterconnectLocationListWarning {} -impl Part for InterconnectLocationListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for MachineTypeListWarning {} -impl Part for MachineTypeListWarning {} +impl ResponseResult for VpnGatewayAggregatedList {} /// There is no detailed description. @@ -13169,25 +5076,6 @@ pub struct ProjectsSetDefaultNetworkTierRequest { impl RequestValue for ProjectsSetDefaultNetworkTierRequest {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NetworkEndpointGroupAggregatedListWarning {} -impl Part for NetworkEndpointGroupAggregatedListWarning {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -13207,36 +5095,6 @@ impl NestedType for InstanceTemplateListWarning {} impl Part for InstanceTemplateListWarning {} -/// Contains a list of TargetVpnGateway resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list target vpn gateways](struct.TargetVpnGatewayListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewayList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of TargetVpnGateway resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for TargetVpnGatewayList {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -13256,44 +5114,6 @@ impl NestedType for BackendBucketListWarning {} impl Part for BackendBucketListWarning {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRuleAggregatedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for ForwardingRuleAggregatedListWarning {} -impl Part for ForwardingRuleAggregatedListWarning {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetHttpsProxyListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetHttpsProxyListWarning {} -impl Part for TargetHttpsProxyListWarning {} - - /// There is no detailed description. /// /// # Activities @@ -13341,46 +5161,55 @@ impl NestedType for NetworkEndpointGroupsListNetworkEndpointsWarningData {} impl Part for NetworkEndpointGroupsListNetworkEndpointsWarningData {} -/// Informational warning which replaces the list of routers when the list is empty. +/// A set of Display Device options +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update display device instances](struct.InstanceUpdateDisplayDeviceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisplayDevice { + /// Defines whether the instance has Display enabled. + #[serde(rename="enableDisplay")] + pub enable_display: Option, +} + +impl RequestValue for DisplayDevice {} + + +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RoutersScopedListWarning { +pub struct MachineTypeListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for RoutersScopedListWarning {} -impl Part for RoutersScopedListWarning {} +impl NestedType for MachineTypeListWarning {} +impl Part for MachineTypeListWarning {} -/// Custom utilization metric policy. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalingPolicyCustomMetricUtilization { - /// The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. - /// - /// The metric must have a value type of INT64 or DOUBLE. - pub metric: Option, - /// Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. - #[serde(rename="utilizationTargetType")] - pub utilization_target_type: Option, - /// The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. - /// - /// For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances. - #[serde(rename="utilizationTarget")] - pub utilization_target: Option, +pub struct WafExpressionSetExpression { + /// Expression ID should uniquely identify the origin of the expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core rule set version 2.9.1 rule id 973337. The ID could be used to determine the individual attack definition that has been detected. It could also be used to exclude it from the policy in case of false positive. + pub id: Option, } -impl Part for AutoscalingPolicyCustomMetricUtilization {} +impl Part for WafExpressionSetExpression {} /// There is no detailed description. @@ -13390,19 +5219,231 @@ impl Part for AutoscalingPolicyCustomMetricUtilization {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [aggregated list disks](struct.DiskAggregatedListCall.html) (response) +/// * [attach network endpoints global network endpoint groups](struct.GlobalNetworkEndpointGroupAttachNetworkEndpointCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskAggregatedList { +pub struct GlobalNetworkEndpointGroupsAttachEndpointsRequest { + /// The list of network endpoints to be attached. + #[serde(rename="networkEndpoints")] + pub network_endpoints: Option>, +} + +impl RequestValue for GlobalNetworkEndpointGroupsAttachEndpointsRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsRemoveInstanceRequest { + /// URLs of the instances to be removed from target pool. + pub instances: Option>, +} + +impl RequestValue for TargetPoolsRemoveInstanceRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list security policies](struct.SecurityPolicyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicyList { /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + /// A list of SecurityPolicy resources. + pub items: Option>, + /// [Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies pub kind: Option, /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of DisksScopedList resources. - pub items: Option>, + pub warning: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, +} + +impl ResponseResult for SecurityPolicyList {} + + +/// Subnetwork which the current user has compute.subnetworks.use permission on. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UsableSubnetwork { + /// Secondary IP ranges. + #[serde(rename="secondaryIpRanges")] + pub secondary_ip_ranges: Option>, + /// The range of internal addresses that are owned by this subnetwork. + #[serde(rename="ipCidrRange")] + pub ip_cidr_range: Option, + /// Network URL. + pub network: Option, + /// Subnetwork URL. + pub subnetwork: Option, +} + +impl Part for UsableSubnetwork {} + + +/// Informational metadata about Partner attachments from Partners to display to customers. These fields are propagated from PARTNER_PROVIDER attachments to their corresponding PARTNER attachments. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentPartnerMetadata { + /// Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values. + #[serde(rename="partnerName")] + pub partner_name: Option, + /// Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance "Chicago 1". This value may be validated to match approved Partner values. + #[serde(rename="interconnectName")] + pub interconnect_name: Option, + /// URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values. + #[serde(rename="portalUrl")] + pub portal_url: Option, +} + +impl Part for InterconnectAttachmentPartnerMetadata {} + + +/// Represent a sole-tenant Node Type resource. +/// +/// Each node within a node group must have a node type. A node type specifies the total amount of cores and memory for that node. Currently, the only available node type is n1-node-96-624 node type that has 96 vCPUs and 624 GB of memory, available in multiple zones. For more information read Node types. (== resource_for {$api_version}.nodeTypes ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list node types](struct.NodeTypeListCall.html) (none) +/// * [get node types](struct.NodeTypeGetCall.html) (response) +/// * [aggregated list node types](struct.NodeTypeAggregatedListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeType { + /// [Output Only] The CPU platform used by this node type. + #[serde(rename="cpuPlatform")] + pub cpu_platform: Option, + /// [Output Only] The number of virtual CPUs that are available to the node type. + #[serde(rename="guestCpus")] + pub guest_cpus: Option, + /// [Output Only] The type of the resource. Always compute#nodeType for node types. + pub kind: Option, + /// [Output Only] An optional textual description of the resource. + pub description: Option, + /// [Output Only] The name of the zone where the node type resides, such as us-central1-a. + pub zone: Option, + /// [Output Only] The deprecation status associated with this node type. + pub deprecated: Option, + /// [Output Only] The amount of physical memory available to the node type, defined in MB. + #[serde(rename="memoryMb")] + pub memory_mb: Option, + /// [Output Only] Local SSD available to the node type, defined in GB. + #[serde(rename="localSsdGb")] + pub local_ssd_gb: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Name of the resource. + pub name: Option, +} + +impl Resource for NodeType {} +impl ResponseResult for NodeType {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplateAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NodeTemplateAggregatedListWarning {} +impl Part for NodeTemplateAggregatedListWarning {} + + +/// The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CorsPolicy { + /// Specifies the content for the Access-Control-Allow-Methods header. + #[serde(rename="allowMethods")] + pub allow_methods: Option>, + /// Specifies the list of origins that will be allowed to do CORS requests. + /// An origin is allowed if it matches either allow_origins or allow_origin_regex. + #[serde(rename="allowOrigins")] + pub allow_origins: Option>, + /// Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + /// An origin is allowed if it matches either allow_origins or allow_origin_regex. + #[serde(rename="allowOriginRegexes")] + pub allow_origin_regexes: Option>, + /// Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header. + #[serde(rename="maxAge")] + pub max_age: Option, + /// In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. + /// Default is false. + #[serde(rename="allowCredentials")] + pub allow_credentials: Option, + /// If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. + pub disabled: Option, + /// Specifies the content for the Access-Control-Allow-Headers header. + #[serde(rename="allowHeaders")] + pub allow_headers: Option>, + /// Specifies the content for the Access-Control-Expose-Headers header. + #[serde(rename="exposeHeaders")] + pub expose_headers: Option>, +} + +impl Part for CorsPolicy {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list disk types](struct.DiskTypeAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypeAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of DiskTypesScopedList resources. + pub items: Option>, /// [Output Only] Unique identifier for the resource; defined by the server. pub id: Option, /// [Output Only] Server-defined URL for this resource. @@ -13410,37 +5451,7 @@ pub struct DiskAggregatedList { pub self_link: Option, } -impl ResponseResult for DiskAggregatedList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list global operations](struct.GlobalOperationAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#operationAggregatedList for aggregated lists of operations. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// [Output Only] A map of scoped operation lists. - pub items: Option>, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for OperationAggregatedList {} +impl ResponseResult for DiskTypeAggregatedList {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -13449,15 +5460,15 @@ impl ResponseResult for OperationAggregatedList {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksScopedListWarningData { +pub struct UrlMapListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for DisksScopedListWarningData {} -impl Part for DisksScopedListWarningData {} +impl NestedType for UrlMapListWarningData {} +impl Part for UrlMapListWarningData {} /// There is no detailed description. @@ -13467,63 +5478,87 @@ impl Part for DisksScopedListWarningData {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [set proxy header target tcp proxies](struct.TargetTcpProxySetProxyHeaderCall.html) (request) +/// * [validate url maps](struct.UrlMapValidateCall.html) (response) +/// * [validate region url maps](struct.RegionUrlMapValidateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetTcpProxiesSetProxyHeaderRequest { - /// The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, +pub struct UrlMapsValidateResponse { + /// no description provided + pub result: Option, } -impl RequestValue for TargetTcpProxiesSetProxyHeaderRequest {} +impl ResponseResult for UrlMapsValidateResponse {} -/// Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided. +/// Deprecation status for a public resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [deprecate images](struct.ImageDeprecateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeprecationStatus { + /// An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + pub deleted: Option, + /// An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + pub deprecated: Option, + /// The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + pub state: Option, + /// An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + pub obsolete: Option, + /// The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + pub replacement: Option, +} + +impl RequestValue for DeprecationStatus {} + + +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterNat { - /// Timeout (in seconds) for UDP connections. Defaults to 30s if not set. - #[serde(rename="udpIdleTimeoutSec")] - pub udp_idle_timeout_sec: Option, - /// A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. - #[serde(rename="natIps")] - pub nat_ips: Option>, - /// Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. +pub struct RouterBgpPeer { + /// The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. + #[serde(rename="advertisedRoutePriority")] + pub advertised_route_priority: Option, + /// Name of the interface the BGP peer is associated with. + #[serde(rename="interfaceName")] + pub interface_name: Option, + /// User-specified flag to indicate which mode to use for advertisement. + #[serde(rename="advertiseMode")] + pub advertise_mode: Option, + /// IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. + #[serde(rename="peerIpAddress")] + pub peer_ip_address: Option, + /// Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. + #[serde(rename="peerAsn")] + pub peer_asn: Option, + /// User-specified list of prefix groups to advertise in custom mode, which can take one of the following options: + /// - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets. + /// - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets. + /// - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC network. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + #[serde(rename="advertisedGroups")] + pub advertised_groups: Option>, + /// User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + #[serde(rename="advertisedIpRanges")] + pub advertised_ip_ranges: Option>, + /// [Output Only] The resource that configures and manages this BGP peer. + /// - MANAGED_BY_USER is the default value and can be managed by you or other users + /// - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. + #[serde(rename="managementType")] + pub management_type: Option, + /// IP address of the interface inside Google Cloud Platform. Only IPv4 is supported. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, - /// Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. - #[serde(rename="tcpTransitoryIdleTimeoutSec")] - pub tcp_transitory_idle_timeout_sec: Option, - /// A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. - pub subnetworks: Option>, - /// Specify the NatIpAllocateOption, which can take one of the following values: - /// - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - /// - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. - #[serde(rename="natIpAllocateOption")] - pub nat_ip_allocate_option: Option, - /// Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. - #[serde(rename="icmpIdleTimeoutSec")] - pub icmp_idle_timeout_sec: Option, - /// Specify the Nat option, which can take one of the following values: - /// - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - /// - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - /// - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region. - #[serde(rename="sourceSubnetworkIpRangesToNat")] - pub source_subnetwork_ip_ranges_to_nat: Option, - /// Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. - #[serde(rename="tcpEstablishedIdleTimeoutSec")] - pub tcp_established_idle_timeout_sec: Option, - /// Configure logging on this NAT. - #[serde(rename="logConfig")] - pub log_config: Option, - /// Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. - #[serde(rename="minPortsPerVm")] - pub min_ports_per_vm: Option, } -impl Part for RouterNat {} +impl Part for RouterBgpPeer {} /// [Output Only] Informational warning message. @@ -13531,18 +5566,3131 @@ impl Part for RouterNat {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypeAggregatedListWarning { +pub struct TargetTcpProxyListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for AcceleratorTypeAggregatedListWarning {} -impl Part for AcceleratorTypeAggregatedListWarning {} +impl NestedType for TargetTcpProxyListWarning {} +impl Part for TargetTcpProxyListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalerAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AutoscalerAggregatedListWarningData {} +impl Part for AutoscalerAggregatedListWarningData {} + + +/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AddressesScopedListWarning {} +impl Part for AddressesScopedListWarning {} + + +/// A full or valid partial URL to a health check. For example, the following are valid URLs: +/// - https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check +/// - projects/project-id/global/httpHealthChecks/health-check +/// - global/httpHealthChecks/health-check +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthCheckReference { + /// no description provided + #[serde(rename="healthCheck")] + pub health_check: Option, +} + +impl Part for HealthCheckReference {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NetworkEndpointGroupAggregatedListWarningData {} +impl Part for NetworkEndpointGroupAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [expand ip cidr range subnetworks](struct.SubnetworkExpandIpCidrRangeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworksExpandIpCidrRangeRequest { + /// The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + #[serde(rename="ipCidrRange")] + pub ip_cidr_range: Option, +} + +impl RequestValue for SubnetworksExpandIpCidrRangeRequest {} + + +/// Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots. +/// +/// (== resource_for {$api_version}.resourcePolicies ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert resource policies](struct.ResourcePolicyInsertCall.html) (request) +/// * [get resource policies](struct.ResourcePolicyGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicy { + /// Resource policy for instacnes for placement configuration. + #[serde(rename="groupPlacementPolicy")] + pub group_placement_policy: Option, + /// [Output Only] The status of resource policy creation. + pub status: Option, + /// [Output Only] Type of the resource. Always compute#resource_policies for resource policies. + pub kind: Option, + /// no description provided + pub description: Option, + /// no description provided + pub region: Option, + /// Resource policy for persistent disks for creating snapshots. + #[serde(rename="snapshotSchedulePolicy")] + pub snapshot_schedule_policy: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined fully-qualified URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for ResourcePolicy {} +impl ResponseResult for ResourcePolicy {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set ssl certificates target ssl proxies](struct.TargetSslProxySetSslCertificateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetSslProxiesSetSslCertificatesRequest { + /// New set of URLs to SslCertificate resources to associate with this TargetSslProxy. Currently exactly one ssl certificate must be specified. + #[serde(rename="sslCertificates")] + pub ssl_certificates: Option>, +} + +impl RequestValue for TargetSslProxiesSetSslCertificatesRequest {} + + +/// Represents an Interconnect Attachment (VLAN) resource. +/// +/// You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. (== resource_for {$api_version}.interconnectAttachments ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch interconnect attachments](struct.InterconnectAttachmentPatchCall.html) (request) +/// * [delete interconnect attachments](struct.InterconnectAttachmentDeleteCall.html) (none) +/// * [aggregated list interconnect attachments](struct.InterconnectAttachmentAggregatedListCall.html) (none) +/// * [get interconnect attachments](struct.InterconnectAttachmentGetCall.html) (response) +/// * [list interconnect attachments](struct.InterconnectAttachmentListCall.html) (none) +/// * [insert interconnect attachments](struct.InterconnectAttachmentInsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachment { + /// Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. + #[serde(rename="partnerAsn")] + pub partner_asn: Option, + /// [Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + #[serde(rename="customerRouterIpAddress")] + pub customer_router_ip_address: Option, + /// An optional description of this resource. + pub description: Option, + /// Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. + #[serde(rename="adminEnabled")] + pub admin_enabled: Option, + /// Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: + /// - BPS_50M: 50 Mbit/s + /// - BPS_100M: 100 Mbit/s + /// - BPS_200M: 200 Mbit/s + /// - BPS_300M: 300 Mbit/s + /// - BPS_400M: 400 Mbit/s + /// - BPS_500M: 500 Mbit/s + /// - BPS_1G: 1 Gbit/s + /// - BPS_2G: 2 Gbit/s + /// - BPS_5G: 5 Gbit/s + /// - BPS_10G: 10 Gbit/s + /// - BPS_20G: 20 Gbit/s + /// - BPS_50G: 50 Gbit/s + pub bandwidth: Option, + /// Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. + #[serde(rename="candidateSubnets")] + pub candidate_subnets: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + #[serde(rename="cloudRouterIpAddress")] + pub cloud_router_ip_address: Option, + /// [Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments. + pub kind: Option, + /// The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. Only specified at creation time. + #[serde(rename="vlanTag8021q")] + pub vlan_tag8021q: Option, + /// URL of the underlying Interconnect object that this attachment's traffic will traverse through. + pub interconnect: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. + #[serde(rename="privateInterconnectInfo")] + pub private_interconnect_info: Option, + /// [Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used. + #[serde(rename="googleReferenceId")] + pub google_reference_id: Option, + /// [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of an PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain" + #[serde(rename="pairingKey")] + pub pairing_key: Option, + /// [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: + /// - ACTIVE: The attachment has been turned up and is ready to use. + /// - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + /// - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. + /// - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. + /// - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. + /// - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. + pub state: Option, + /// [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: + /// - OS_ACTIVE: The attachment has been turned up and is ready to use. + /// - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + #[serde(rename="operationalStatus")] + pub operational_status: Option, + /// Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: + /// - AVAILABILITY_DOMAIN_ANY + /// - AVAILABILITY_DOMAIN_1 + /// - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + #[serde(rename="edgeAvailabilityDomain")] + pub edge_availability_domain: Option, + /// URL of the Cloud Router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network & region within which the Cloud Router is configured. + pub router: Option, + /// Informational metadata about Partner attachments from Partners to display to customers. Output only for for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED. + #[serde(rename="partnerMetadata")] + pub partner_metadata: Option, + /// The type of interconnect attachment this is, which can take one of the following values: + /// - DEDICATED: an attachment to a Dedicated Interconnect. + /// - PARTNER: an attachment to a Partner Interconnect, created by the customer. + /// - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. + #[serde(rename="type")] + pub type_: Option, + /// [Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub region: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for InterconnectAttachment {} +impl Resource for InterconnectAttachment {} +impl ResponseResult for InterconnectAttachment {} + + +/// Description-tagged IP ranges for the router to advertise. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterAdvertisedIpRange { + /// The IP range to advertise. The value must be a CIDR-formatted string. + pub range: Option, + /// User-specified description for the IP range. + pub description: Option, +} + +impl Part for RouterAdvertisedIpRange {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceListReferrersWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstanceListReferrersWarning {} +impl Part for InstanceListReferrersWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworkAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for SubnetworkAggregatedListWarning {} +impl Part for SubnetworkAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get router status routers](struct.RouterGetRouterStatuCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterStatusResponse { + /// Type of resource. + pub kind: Option, + /// no description provided + pub result: Option, +} + +impl ResponseResult for RouterStatusResponse {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WafExpressionSet { + /// List of available expressions. + pub expressions: Option>, + /// Google specified expression set ID. The format should be: - E.g. XSS-20170329 + pub id: Option, + /// A list of alternate IDs. The format should be: - E.g. XSS-stable Generic suffix like "stable" is particularly useful if a policy likes to avail newer set of expressions without having to change the policy. A given alias name can't be used for more than one entity set. + pub aliases: Option>, +} + +impl Part for WafExpressionSet {} + + +/// Represents a collection of network endpoints. +/// +/// For more information read Network endpoint groups overview. (== resource_for {$api_version}.networkEndpointGroups ==) Next ID: 21 +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get global network endpoint groups](struct.GlobalNetworkEndpointGroupGetCall.html) (response) +/// * [detach network endpoints network endpoint groups](struct.NetworkEndpointGroupDetachNetworkEndpointCall.html) (none) +/// * [insert network endpoint groups](struct.NetworkEndpointGroupInsertCall.html) (request) +/// * [attach network endpoints network endpoint groups](struct.NetworkEndpointGroupAttachNetworkEndpointCall.html) (none) +/// * [aggregated list network endpoint groups](struct.NetworkEndpointGroupAggregatedListCall.html) (none) +/// * [delete network endpoint groups](struct.NetworkEndpointGroupDeleteCall.html) (none) +/// * [list network endpoints network endpoint groups](struct.NetworkEndpointGroupListNetworkEndpointCall.html) (none) +/// * [test iam permissions network endpoint groups](struct.NetworkEndpointGroupTestIamPermissionCall.html) (none) +/// * [list network endpoint groups](struct.NetworkEndpointGroupListCall.html) (none) +/// * [insert global network endpoint groups](struct.GlobalNetworkEndpointGroupInsertCall.html) (request) +/// * [get network endpoint groups](struct.NetworkEndpointGroupGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroup { + /// [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// [Output Only] The URL of the zone where the network endpoint group is located. + pub zone: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// The default port used if the port number is not specified in the network endpoint. + #[serde(rename="defaultPort")] + pub default_port: Option, + /// Type of network endpoints in this network endpoint group. + #[serde(rename="networkEndpointType")] + pub network_endpoint_type: Option, + /// The URL of the network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified. + pub network: Option, + /// Optional URL of the subnetwork to which all network endpoints in the NEG belong. + pub subnetwork: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output only] Number of network endpoints in the network endpoint group. + pub size: Option, +} + +impl RequestValue for NetworkEndpointGroup {} +impl Resource for NetworkEndpointGroup {} +impl ResponseResult for NetworkEndpointGroup {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceAggregatedListWarningData {} +impl Part for InstanceAggregatedListWarningData {} + + +/// Represents a Disk Type resource. +/// +/// Google Compute Engine has two Disk Type resources: +/// +/// * [Regional](/compute/docs/reference/rest/{$api_version}/regionDiskTypes) * [Zonal](/compute/docs/reference/rest/{$api_version}/diskTypes) +/// +/// You can choose from a variety of disk types based on your needs. For more information, read Storage options. +/// +/// The diskTypes resource represents disk types for a zonal persistent disk. For more information, read Zonal persistent disks. +/// +/// The regionDiskTypes resource represents disk types for a regional persistent disk. For more information, read Regional persistent disks. (== resource_for {$api_version}.diskTypes ==) (== resource_for {$api_version}.regionDiskTypes ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list disk types](struct.DiskTypeAggregatedListCall.html) (none) +/// * [list disk types](struct.DiskTypeListCall.html) (none) +/// * [get region disk types](struct.RegionDiskTypeGetCall.html) (response) +/// * [get disk types](struct.DiskTypeGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskType { + /// [Output Only] Type of the resource. Always compute#diskType for disk types. + pub kind: Option, + /// [Output Only] An optional description of this resource. + pub description: Option, + /// [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub zone: Option, + /// [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". + #[serde(rename="validDiskSize")] + pub valid_disk_size: Option, + /// [Output Only] The deprecation status associated with this disk type. + pub deprecated: Option, + /// [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub region: Option, + /// [Output Only] Server-defined default disk size in GB. + #[serde(rename="defaultDiskSizeGb")] + pub default_disk_size_gb: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Name of the resource. + pub name: Option, +} + +impl Resource for DiskType {} +impl ResponseResult for DiskType {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplateListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeTemplateListWarningData {} +impl Part for NodeTemplateListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list errors instance group managers](struct.InstanceGroupManagerListErrorCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersListErrorsResponse { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The list of errors of the managed instance group. + pub items: Option>, +} + +impl ResponseResult for InstanceGroupManagersListErrorsResponse {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InterconnectAttachmentsScopedListWarningData {} +impl Part for InterconnectAttachmentsScopedListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AddressAggregatedListWarningData {} +impl Part for AddressAggregatedListWarningData {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for OperationAggregatedListWarning {} +impl Part for OperationAggregatedListWarning {} + + +/// [Output Only] If errors are generated during processing of the operation, this field will be populated. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationError { + /// [Output Only] The array of errors encountered while processing this operation. + pub errors: Option>, +} + +impl NestedType for OperationError {} +impl Part for OperationError {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for VpnTunnelAggregatedListWarning {} +impl Part for VpnTunnelAggregatedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorTypeAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AcceleratorTypeAggregatedListWarningData {} +impl Part for AcceleratorTypeAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [resize region disks](struct.RegionDiskResizeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionDisksResizeRequest { + /// The new size of the regional persistent disk, which is specified in GB. + #[serde(rename="sizeGb")] + pub size_gb: Option, +} + +impl RequestValue for RegionDisksResizeRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list accelerator types](struct.AcceleratorTypeAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorTypeAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of AcceleratorTypesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for AcceleratorTypeAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedInstanceLastAttempt { + /// [Output Only] Encountered errors during the last attempt to create or delete the instance. + pub errors: Option, +} + +impl Part for ManagedInstanceLastAttempt {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstanceAggregatedListWarning {} +impl Part for InstanceAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicyWeeklyCycleDayOfWeek { + /// [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + pub duration: Option, + /// Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + pub day: Option, + /// Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for ResourcePolicyWeeklyCycleDayOfWeek {} + + +/// A VPN connection contains all VPN tunnels connected from this VpnGateway to the same peer gateway. The peer gateway could either be a external VPN gateway or GCP VPN gateway. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayStatusVpnConnection { + /// URL reference to the peer external VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + #[serde(rename="peerExternalGateway")] + pub peer_external_gateway: Option, + /// URL reference to the peer side VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + #[serde(rename="peerGcpGateway")] + pub peer_gcp_gateway: Option, + /// List of VPN tunnels that are in this VPN connection. + pub tunnels: Option>, + /// HighAvailabilityRequirementState for the VPN connection. + pub state: Option, +} + +impl Part for VpnGatewayStatusVpnConnection {} + + +/// Contains a list of machine types. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list machine types](struct.MachineTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypeList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of MachineType resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for MachineTypeList {} + + +/// Contains a list of firewalls. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list firewalls](struct.FirewallListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FirewallList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Firewall resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for FirewallList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PreconfiguredWafSet { + /// List of entities that are currently supported for WAF rules. + #[serde(rename="expressionSets")] + pub expression_sets: Option>, +} + +impl Part for PreconfiguredWafSet {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InterconnectListWarning {} +impl Part for InterconnectListWarning {} + + +/// Represents a customer-supplied encryption key +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CustomerEncryptionKey { + /// Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. + #[serde(rename="rawKey")] + pub raw_key: Option, + /// The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + #[serde(rename="kmsKeyServiceAccount")] + pub kms_key_service_account: Option, + /// [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + pub sha256: Option, + /// The name of the encryption key that is stored in Google Cloud KMS. + #[serde(rename="kmsKeyName")] + pub kms_key_name: Option, +} + +impl Part for CustomerEncryptionKey {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TCPHealthCheck { + /// The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. + pub port: Option, + /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + #[serde(rename="portName")] + pub port_name: Option, + /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, + /// The application data to send once the TCP connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. + pub request: Option, + /// Specifies how port is selected for health checking, can be one of following values: + /// USE_FIXED_PORT: The port number in port is used for health checking. + /// USE_NAMED_PORT: The portName is used for health checking. + /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + /// + /// + /// If not specified, TCP health check follows behavior specified in port and portName fields. + #[serde(rename="portSpecification")] + pub port_specification: Option, + /// The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. + pub response: Option, +} + +impl Part for TCPHealthCheck {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitmentsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for CommitmentsScopedListWarningData {} +impl Part for CommitmentsScopedListWarningData {} + + +/// Message containing connection draining configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConnectionDraining { + /// The amount of time in seconds to allow existing connections to persist while on unhealthy backend VMs. Only applicable if the protocol is not UDP. The valid range is [0, 3600]. + #[serde(rename="drainingTimeoutSec")] + pub draining_timeout_sec: Option, +} + +impl Part for ConnectionDraining {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [move disk projects](struct.ProjectMoveDiskCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskMoveRequest { + /// The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: + /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + /// - projects/project/zones/zone/disks/disk + /// - zones/zone/disks/disk + #[serde(rename="targetDisk")] + pub target_disk: Option, + /// The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: + /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone + /// - projects/project/zones/zone + /// - zones/zone + #[serde(rename="destinationZone")] + pub destination_zone: Option, +} + +impl RequestValue for DiskMoveRequest {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FirewallListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for FirewallListWarning {} +impl Part for FirewallListWarning {} + + +/// Represent a sole-tenant Node Group resource. +/// +/// A sole-tenant node is a physical server that is dedicated to hosting VM instances only for your specific project. Use sole-tenant nodes to keep your instances physically separated from instances in other projects, or to group your instances together on the same host hardware. For more information, read Sole-tenant nodes. (== resource_for {$api_version}.nodeGroups ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list node groups](struct.NodeGroupAggregatedListCall.html) (none) +/// * [delete node groups](struct.NodeGroupDeleteCall.html) (none) +/// * [test iam permissions node groups](struct.NodeGroupTestIamPermissionCall.html) (none) +/// * [insert node groups](struct.NodeGroupInsertCall.html) (request) +/// * [patch node groups](struct.NodeGroupPatchCall.html) (request) +/// * [get iam policy node groups](struct.NodeGroupGetIamPolicyCall.html) (none) +/// * [set node template node groups](struct.NodeGroupSetNodeTemplateCall.html) (none) +/// * [get node groups](struct.NodeGroupGetCall.html) (response) +/// * [list node groups](struct.NodeGroupListCall.html) (none) +/// * [list nodes node groups](struct.NodeGroupListNodeCall.html) (none) +/// * [delete nodes node groups](struct.NodeGroupDeleteNodeCall.html) (none) +/// * [add nodes node groups](struct.NodeGroupAddNodeCall.html) (none) +/// * [set iam policy node groups](struct.NodeGroupSetIamPolicyCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroup { + /// no description provided + pub status: Option, + /// [Output Only] The type of the resource. Always compute#nodeGroup for node group. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// [Output Only] The name of the zone where the node group resides, such as us-central1-a. + pub zone: Option, + /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// Specifies how to handle instances when a node in the group undergoes maintenance. + #[serde(rename="maintenancePolicy")] + pub maintenance_policy: Option, + /// The URL of the node template to which this node group belongs. + #[serde(rename="nodeTemplate")] + pub node_template: Option, + /// Specifies how autoscaling should behave. + #[serde(rename="autoscalingPolicy")] + pub autoscaling_policy: Option, + /// no description provided + pub fingerprint: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] The total number of nodes in the node group. + pub size: Option, +} + +impl RequestValue for NodeGroup {} +impl Resource for NodeGroup {} +impl ResponseResult for NodeGroup {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslPoliciesListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for SslPoliciesListWarning {} +impl Part for SslPoliciesListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTypesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeTypesScopedListWarningData {} +impl Part for NodeTypesScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list forwarding rules](struct.ForwardingRuleAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRuleAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of ForwardingRulesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ForwardingRuleAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestFailure { + /// no description provided + pub path: Option, + /// no description provided + #[serde(rename="actualService")] + pub actual_service: Option, + /// no description provided + pub host: Option, + /// no description provided + #[serde(rename="expectedService")] + pub expected_service: Option, +} + +impl Part for TestFailure {} + + +/// Informational warning which replaces the list of packetMirrorings when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for PacketMirroringsScopedListWarning {} +impl Part for PacketMirroringsScopedListWarning {} + + +/// Time window specified for weekly operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicyWeeklyCycle { + /// Up to 7 intervals/windows, one for each day of the week. + #[serde(rename="dayOfWeeks")] + pub day_of_weeks: Option>, +} + +impl Part for ResourcePolicyWeeklyCycle {} + + +/// A set of Shielded Instance options. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update shielded instance config instances](struct.InstanceUpdateShieldedInstanceConfigCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShieldedInstanceConfig { + /// Defines whether the instance has the vTPM enabled. + #[serde(rename="enableVtpm")] + pub enable_vtpm: Option, + /// Defines whether the instance has integrity monitoring enabled. + #[serde(rename="enableIntegrityMonitoring")] + pub enable_integrity_monitoring: Option, + /// Defines whether the instance has Secure Boot enabled. + #[serde(rename="enableSecureBoot")] + pub enable_secure_boot: Option, +} + +impl RequestValue for ShieldedInstanceConfig {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [validate region url maps](struct.RegionUrlMapValidateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionUrlMapsValidateRequest { + /// Content of the UrlMap to be validated. + pub resource: Option, +} + +impl RequestValue for RegionUrlMapsValidateRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [start with encryption key instances](struct.InstanceStartWithEncryptionKeyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesStartWithEncryptionKeyRequest { + /// Array of disks associated with this instance that are protected with a customer-supplied encryption key. + /// + /// In order to start the instance, the disk url and its corresponding key must be provided. + /// + /// If the disk is not protected with a customer-supplied encryption key it should not be specified. + pub disks: Option>, +} + +impl RequestValue for InstancesStartWithEncryptionKeyRequest {} + + +/// [Output Only] Informational warning which replaces the list of instances when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstancesScopedListWarning {} +impl Part for InstancesScopedListWarning {} + + +/// Message containing what to include in the cache key for a request for Cloud CDN. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CacheKeyPolicy { + /// Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + #[serde(rename="queryStringBlacklist")] + pub query_string_blacklist: Option>, + /// If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely. + #[serde(rename="includeQueryString")] + pub include_query_string: Option, + /// Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + #[serde(rename="queryStringWhitelist")] + pub query_string_whitelist: Option>, + /// If true, http and https requests will be cached separately. + #[serde(rename="includeProtocol")] + pub include_protocol: Option, + /// If true, requests to different hosts will be cached separately. + #[serde(rename="includeHost")] + pub include_host: Option, +} + +impl Part for CacheKeyPolicy {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NetworkListWarning {} +impl Part for NetworkListWarning {} + + +/// A set of instance tags. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set tags instances](struct.InstanceSetTagCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Tags { + /// An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. + pub items: Option>, + /// Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. + /// + /// To see the latest fingerprint, make get() request to the instance. + pub fingerprint: Option, +} + +impl RequestValue for Tags {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypeAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for DiskTypeAggregatedListWarning {} +impl Part for DiskTypeAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressesScopedList { + /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, + /// [Output Only] A list of addresses contained in this scope. + pub addresses: Option>, +} + +impl Part for AddressesScopedList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for RegionInstanceGroupListWarning {} +impl Part for RegionInstanceGroupListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthChecksScopedList { + /// A list of HealthChecks contained in this scope. + #[serde(rename="healthChecks")] + pub health_checks: Option>, + /// Informational warning which replaces the list of backend services when the list is empty. + pub warning: Option, +} + +impl Part for HealthChecksScopedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SSLHealthCheck { + /// The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. + pub port: Option, + /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + #[serde(rename="portName")] + pub port_name: Option, + /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, + /// The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. + pub request: Option, + /// Specifies how port is selected for health checking, can be one of following values: + /// USE_FIXED_PORT: The port number in port is used for health checking. + /// USE_NAMED_PORT: The portName is used for health checking. + /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + /// + /// + /// If not specified, SSL health check follows behavior specified in port and portName fields. + #[serde(rename="portSpecification")] + pub port_specification: Option, + /// The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. + pub response: Option, +} + +impl Part for SSLHealthCheck {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupsListInstancesWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for RegionInstanceGroupsListInstancesWarningData {} +impl Part for RegionInstanceGroupsListInstancesWarningData {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SnapshotListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for SnapshotListWarning {} +impl Part for SnapshotListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitmentListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for CommitmentListWarning {} +impl Part for CommitmentListWarning {} + + +/// Contains a list of Snapshot resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list snapshots](struct.SnapshotListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SnapshotList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Snapshot resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for SnapshotList {} + + +/// A service account. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceAccount { + /// The list of scopes to be made available for this service account. + pub scopes: Option>, + /// Email address of the service account. + pub email: Option, +} + +impl Part for ServiceAccount {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupAutoscalingPolicy { + /// The maximum number of nodes that the group should have. + #[serde(rename="maxNodes")] + pub max_nodes: Option, + /// The minimum number of nodes that the group should have. + #[serde(rename="minNodes")] + pub min_nodes: Option, + /// The autoscaling mode. + pub mode: Option, +} + +impl Part for NodeGroupAutoscalingPolicy {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRuleAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ForwardingRuleAggregatedListWarningData {} +impl Part for ForwardingRuleAggregatedListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicyAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ResourcePolicyAggregatedListWarningData {} +impl Part for ResourcePolicyAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list licenses](struct.LicenseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LicensesListResponse { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of License resources. + pub items: Option>, + /// [Output Only] Informational warning message. + pub warning: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for LicensesListResponse {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ReservationListWarningData {} +impl Part for ReservationListWarningData {} + + +/// Response to the list request, and contains a list of interconnect attachments. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list interconnect attachments](struct.InterconnectAttachmentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InterconnectAttachment resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InterconnectAttachmentList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list usable subnetworks](struct.SubnetworkListUsableCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UsableSubnetworksAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// [Output] A list of usable subnetwork URLs. + pub items: Option>, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for UsableSubnetworksAggregatedList {} + + +/// UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HostRule { + /// The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. + pub hosts: Option>, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. + #[serde(rename="pathMatcher")] + pub path_matcher: Option, +} + +impl Part for HostRule {} + + +/// The named port. For example: . +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NamedPort { + /// The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, + /// The port number, which can be a value between 1 and 65535. + pub port: Option, +} + +impl Part for NamedPort {} + + +/// [Output Only] A list of managed instance groups. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instance group managers](struct.InstanceGroupManagerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InstanceGroupManager resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceGroupManagerList {} + + +/// Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SchedulingNodeAffinity { + /// Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity. + pub operator: Option, + /// Corresponds to the label values of Node resource. + pub values: Option>, + /// Corresponds to the label key of Node resource. + pub key: Option, +} + +impl Part for SchedulingNodeAffinity {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpRouteAction { + /// Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. + #[serde(rename="requestMirrorPolicy")] + pub request_mirror_policy: Option, + /// The spec to modify the URL of the request, prior to forwarding the request to the matched service. + #[serde(rename="urlRewrite")] + pub url_rewrite: Option, + /// Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + /// If not specified, will use the largest timeout among all backend services associated with the route. + pub timeout: Option, + /// Specifies the retry policy associated with this route. + #[serde(rename="retryPolicy")] + pub retry_policy: Option, + /// The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. + /// timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. + #[serde(rename="faultInjectionPolicy")] + pub fault_injection_policy: Option, + /// A list of weighted backend services to send traffic to when a route match occurs. The weights determine the fraction of traffic that flows to their corresponding backend service. If all traffic needs to go to a single backend service, there must be one weightedBackendService with weight set to a non 0 number. + /// Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions like Url rewrites and header transformations are applied depending on additional settings specified in this HttpRouteAction. + #[serde(rename="weightedBackendServices")] + pub weighted_backend_services: Option>, + /// The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing + #[serde(rename="corsPolicy")] + pub cors_policy: Option, +} + +impl Part for HttpRouteAction {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list errors region instance group managers](struct.RegionInstanceGroupManagerListErrorCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersListErrorsResponse { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The list of errors of the managed instance group. + pub items: Option>, +} + +impl ResponseResult for RegionInstanceGroupManagersListErrorsResponse {} + + +/// [Output Only] Encountered errors during the last attempt to create or delete the instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedInstanceLastAttemptErrors { + /// [Output Only] The array of errors encountered while processing this operation. + pub errors: Option>, +} + +impl NestedType for ManagedInstanceLastAttemptErrors {} +impl Part for ManagedInstanceLastAttemptErrors {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list xpn hosts projects](struct.ProjectListXpnHostCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProjectsListXpnHostsRequest { + /// Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project. + pub organization: Option, +} + +impl RequestValue for ProjectsListXpnHostsRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointWithHealthStatus { + /// [Output only] The health status of network endpoint; + pub healths: Option>, + /// [Output only] The network endpoint; + #[serde(rename="networkEndpoint")] + pub network_endpoint: Option, +} + +impl Part for NetworkEndpointWithHealthStatus {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectDiagnosticsLinkStatus { + /// An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level. + #[serde(rename="receivingOpticalPower")] + pub receiving_optical_power: Option, + /// A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled + #[serde(rename="arpCaches")] + pub arp_caches: Option>, + /// The unique ID for this link assigned during turn up by Google. + #[serde(rename="circuitId")] + pub circuit_id: Option, + /// no description provided + #[serde(rename="lacpStatus")] + pub lacp_status: Option, + /// The Demarc address assigned by Google and provided in the LoA. + #[serde(rename="googleDemarc")] + pub google_demarc: Option, + /// An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level. + #[serde(rename="transmittingOpticalPower")] + pub transmitting_optical_power: Option, +} + +impl Part for InterconnectDiagnosticsLinkStatus {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get status vpn gateways](struct.VpnGatewayGetStatuCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewaysGetStatusResponse { + /// no description provided + pub result: Option, +} + +impl ResponseResult for VpnGatewaysGetStatusResponse {} + + +/// Response to the list request, and contains a list of interconnect locations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list interconnect locations](struct.InterconnectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectLocationList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InterconnectLocation resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InterconnectLocationList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslCertificateAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for SslCertificateAggregatedListWarningData {} +impl Part for SslCertificateAggregatedListWarningData {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for DiskAggregatedListWarning {} +impl Part for DiskAggregatedListWarning {} + + +/// Represents an Autoscaler resource. +/// +/// Google Compute Engine has two Autoscaler resources: +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers) +/// +/// Use autoscalers to automatically add or delete instances from a managed instance group according to your defined autoscaling policy. For more information, read Autoscaling Groups of Instances. +/// +/// For zonal managed instance groups resource, use the autoscaler resource. +/// +/// For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert autoscalers](struct.AutoscalerInsertCall.html) (request) +/// * [update autoscalers](struct.AutoscalerUpdateCall.html) (request) +/// * [update region autoscalers](struct.RegionAutoscalerUpdateCall.html) (request) +/// * [get autoscalers](struct.AutoscalerGetCall.html) (response) +/// * [list autoscalers](struct.AutoscalerListCall.html) (none) +/// * [patch autoscalers](struct.AutoscalerPatchCall.html) (request) +/// * [insert region autoscalers](struct.RegionAutoscalerInsertCall.html) (request) +/// * [aggregated list autoscalers](struct.AutoscalerAggregatedListCall.html) (none) +/// * [patch region autoscalers](struct.RegionAutoscalerPatchCall.html) (request) +/// * [delete autoscalers](struct.AutoscalerDeleteCall.html) (none) +/// * [get region autoscalers](struct.RegionAutoscalerGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Autoscaler { + /// [Output Only] The status of the autoscaler configuration. Current set of possible values: + /// - PENDING: Autoscaler backend hasn't read new/updated configuration. + /// - DELETING: Configuration is being deleted. + /// - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. + /// - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. + pub status: Option, + /// [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates recommended MIG size even when autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to the existing managed instance group or autoscaler did not generate its prediction. + #[serde(rename="recommendedSize")] + pub recommended_size: Option, + /// [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). + pub zone: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). + pub region: Option, + /// The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. + /// + /// If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + #[serde(rename="autoscalingPolicy")] + pub autoscaling_policy: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. + #[serde(rename="statusDetails")] + pub status_details: Option>, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// URL of the managed instance group that this autoscaler will scale. + pub target: Option, +} + +impl RequestValue for Autoscaler {} +impl Resource for Autoscaler {} +impl ResponseResult for Autoscaler {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstanceAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetInstanceAggregatedListWarningData {} +impl Part for TargetInstanceAggregatedListWarningData {} + + +/// Configuration of logging on a NAT. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterNatLogConfig { + /// Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: + /// - ERRORS_ONLY: Export logs only for connection failures. + /// - TRANSLATIONS_ONLY: Export logs only for successful connections. + /// - ALL: Export logs for all connections, successful and unsuccessful. + pub filter: Option, + /// Indicates whether or not to export logs. This is false by default. + pub enable: Option, +} + +impl Part for RouterNatLogConfig {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [recreate instances region instance group managers](struct.RegionInstanceGroupManagerRecreateInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersRecreateRequest { + /// The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + pub instances: Option>, +} + +impl RequestValue for RegionInstanceGroupManagersRecreateRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add resource policies instances](struct.InstanceAddResourcePolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesAddResourcePoliciesRequest { + /// Resource policies to be added to this instance. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, +} + +impl RequestValue for InstancesAddResourcePoliciesRequest {} + + +/// Use global external addresses for GFE-based external HTTP(S) load balancers in Premium Tier. +/// +/// Use global internal addresses for reserved peering network range. +/// +/// Use regional external addresses for the following resources: +/// +/// - External IP addresses for VM instances - Regional external forwarding rules - Cloud NAT external IP addresses - GFE based LBs in Standard Tier - Network LBs in Premium or Standard Tier - Cloud VPN gateways (both Classic and HA) +/// +/// Use regional internal IP addresses for subnet IP ranges (primary and secondary). This includes: +/// +/// - Internal IP addresses for VM instances - Alias IP ranges of VM instances (/32 only) - Regional internal forwarding rules - Internal TCP/UDP load balancer addresses - Internal HTTP(S) load balancer addresses - Cloud DNS inbound forwarding IP addresses +/// +/// For more information, read reserved IP address. +/// +/// (== resource_for {$api_version}.addresses ==) (== resource_for {$api_version}.globalAddresses ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (request) +/// * [insert addresses](struct.AddresseInsertCall.html) (request) +/// * [get addresses](struct.AddresseGetCall.html) (response) +/// * [get global addresses](struct.GlobalAddresseGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Address { + /// [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + pub status: Option, + /// The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. + #[serde(rename="addressType")] + pub address_type: Option, + /// [Output Only] The URLs of the resources that are using this address. + pub users: Option>, + /// The IP version that will be used by this address. Valid options are IPV4 or IPV6. This can only be specified for a global address. + #[serde(rename="ipVersion")] + pub ip_version: Option, + /// The purpose of this resource, which can be one of the following values: + /// - `GCE_ENDPOINT` for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources. + /// - `DNS_RESOLVER` for a DNS resolver address in a subnetwork + /// - `VPC_PEERING` for addresses that are reserved for VPC peer networks. + /// - `NAT_AUTO` for addresses that are external IP addresses automatically reserved for Cloud NAT. + pub purpose: Option, + /// The static IP address represented by this resource. + pub address: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING purpose. + pub network: Option, + /// [Output Only] Type of the resource. Always compute#address for addresses. + pub kind: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + pub name: Option, + /// The prefix length if the resource reprensents an IP range. + #[serde(rename="prefixLength")] + pub prefix_length: Option, + /// [Output Only] The URL of the region where the regional address resides. This field is not applicable to global addresses. You must specify this field as part of the HTTP request URL. + pub region: Option, + /// An optional description of this resource. Provide this field when you create the resource. + pub description: Option, + /// This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Global forwarding rules can only be Premium Tier. Regional forwarding rules can be either Premium or Standard Tier. Standard Tier addresses applied to regional forwarding rules can be used with any external load balancer. Regional forwarding rules in Premium Tier can only be used with a network load balancer. + /// + /// If this field is not specified, it is assumed to be PREMIUM. + #[serde(rename="networkTier")] + pub network_tier: Option, + /// The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with a GCE_ENDPOINT or DNS_RESOLVER purpose. + pub subnetwork: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Address {} +impl ResponseResult for Address {} + + +/// A guest attributes entry. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get guest attributes instances](struct.InstanceGetGuestAttributeCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GuestAttributes { + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. + pub kind: Option, + /// [Output Only] The value of the requested queried path. + #[serde(rename="queryValue")] + pub query_value: Option, + /// [Output Only] The value found for the requested key. + #[serde(rename="variableValue")] + pub variable_value: Option, + /// The path to be queried. This can be the default namespace ('/') or a nested namespace ('/\/') or a specified key ('/\/\') + #[serde(rename="queryPath")] + pub query_path: Option, + /// The key to search for. + #[serde(rename="variableKey")] + pub variable_key: Option, +} + +impl ResponseResult for GuestAttributes {} + + +/// Contains a list of managed instance groups. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region instance group managers](struct.RegionInstanceGroupManagerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagerList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InstanceGroupManager resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RegionInstanceGroupManagerList {} + + +/// Contain information of Nat mapping for a VM endpoint (i.e., NIC). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VmEndpointNatMappings { + /// no description provided + #[serde(rename="interfaceNatMappings")] + pub interface_nat_mappings: Option>, + /// Name of the VM instance which the endpoint belongs to + #[serde(rename="instanceName")] + pub instance_name: Option, +} + +impl Part for VmEndpointNatMappings {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksScopedList { + /// [Output Only] A list of disks contained in this scope. + pub disks: Option>, + /// [Output Only] Informational warning which replaces the list of disks when the list is empty. + pub warning: Option, +} + +impl Part for DisksScopedList {} + + +/// Contains a list of BackendServicesScopedList. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list backend services](struct.BackendServiceAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of BackendServicesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for BackendServiceAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentsScopedList { + /// A list of interconnect attachments contained in this scope. + #[serde(rename="interconnectAttachments")] + pub interconnect_attachments: Option>, + /// Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, +} + +impl Part for InterconnectAttachmentsScopedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstancesScopedList { + /// A list of target instances contained in this scope. + #[serde(rename="targetInstances")] + pub target_instances: Option>, + /// Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, +} + +impl Part for TargetInstancesScopedList {} + + +/// Represents a URL Map resource. +/// +/// Google Compute Engine has two URL Map resources: +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/urlMaps) * [Regional](/compute/docs/reference/rest/{$api_version}/regionUrlMaps) +/// +/// A URL map resource is a component of certain types of GCP load balancers and Traffic Director. +/// +/// * urlMaps are used by external HTTP(S) load balancers and Traffic Director. * regionUrlMaps are used by internal HTTP(S) load balancers. +/// +/// This resource defines mappings from host names and URL paths to either a backend service or a backend bucket. +/// +/// To use the global urlMaps resource, the backend service must have a loadBalancingScheme of either EXTERNAL or INTERNAL_SELF_MANAGED. To use the regionUrlMaps resource, the backend service must have a loadBalancingScheme of INTERNAL_MANAGED. For more information, read URL Map Concepts. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete url maps](struct.UrlMapDeleteCall.html) (none) +/// * [update url maps](struct.UrlMapUpdateCall.html) (request) +/// * [insert region url maps](struct.RegionUrlMapInsertCall.html) (request) +/// * [insert url maps](struct.UrlMapInsertCall.html) (request) +/// * [list url maps](struct.UrlMapListCall.html) (none) +/// * [invalidate cache url maps](struct.UrlMapInvalidateCacheCall.html) (none) +/// * [update region url maps](struct.RegionUrlMapUpdateCall.html) (request) +/// * [aggregated list url maps](struct.UrlMapAggregatedListCall.html) (none) +/// * [get region url maps](struct.RegionUrlMapGetCall.html) (response) +/// * [get url maps](struct.UrlMapGetCall.html) (response) +/// * [validate url maps](struct.UrlMapValidateCall.html) (none) +/// * [patch region url maps](struct.RegionUrlMapPatchCall.html) (request) +/// * [patch url maps](struct.UrlMapPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMap { + /// [Output Only] Type of the resource. Always compute#urlMaps for url maps. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + /// Only one of defaultRouteAction or defaultUrlRedirect must be set. + #[serde(rename="defaultRouteAction")] + pub default_route_action: Option, + /// When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. + /// If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. + #[serde(rename="defaultUrlRedirect")] + pub default_url_redirect: Option, + /// The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. + /// Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + #[serde(rename="defaultService")] + pub default_service: Option, + /// The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. + pub tests: Option>, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// The list of HostRules to use against the URL. + #[serde(rename="hostRules")] + pub host_rules: Option>, + /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve a UrlMap. + pub fingerprint: Option, + /// The list of named PathMatchers to use against the URL. + #[serde(rename="pathMatchers")] + pub path_matchers: Option>, + /// Specifies changes to request and response headers that need to take effect for the selected backendService. + /// The headerAction specified here take effect after headerAction specified under pathMatcher. + #[serde(rename="headerAction")] + pub header_action: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] URL of the region where the regional URL map resides. This field is not applicable to global URL maps. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub region: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for UrlMap {} +impl Resource for UrlMap {} +impl ResponseResult for UrlMap {} + + +/// Contains a list of node templates. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list node templates](struct.NodeTemplateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplateList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of NodeTemplate resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for NodeTemplateList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for RegionListWarning {} +impl Part for RegionListWarning {} + + +/// HttpRouteRuleMatch criteria for a request's query parameter. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpQueryParameterMatch { + /// Specifies that the queryParameterMatch matches if the request contains the query parameter, irrespective of whether the parameter has a value or not. + /// Only one of presentMatch, exactMatch or regexMatch must be set. + #[serde(rename="presentMatch")] + pub present_match: Option, + /// The queryParameterMatch matches if the value of the parameter matches the regular expression specified by regexMatch. For the regular expression grammar, please see en.cppreference.com/w/cpp/regex/ecmascript + /// Only one of presentMatch, exactMatch or regexMatch must be set. + /// Note that regexMatch only applies when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + #[serde(rename="regexMatch")] + pub regex_match: Option, + /// The name of the query parameter to match. The query parameter must exist in the request, in the absence of which the request match fails. + pub name: Option, + /// The queryParameterMatch matches if the value of the parameter exactly matches the contents of exactMatch. + /// Only one of presentMatch, exactMatch or regexMatch must be set. + #[serde(rename="exactMatch")] + pub exact_match: Option, +} + +impl Part for HttpQueryParameterMatch {} + + +/// A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". Range is approximately 10,000 years. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Duration { + /// Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive. + pub nanos: Option, + /// Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + pub seconds: Option, +} + +impl Part for Duration {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InterconnectListWarningData {} +impl Part for InterconnectListWarningData {} + + +/// Represents a Cloud Armor Security Policy resource. +/// +/// Only external backend services used by HTTP or HTTPS load balancers can reference a Security Policy. For more information, read read Cloud Armor Security Policy Concepts. (== resource_for {$api_version}.sslPolicies ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get ssl policies](struct.SslPolicyGetCall.html) (response) +/// * [patch ssl policies](struct.SslPolicyPatchCall.html) (request) +/// * [insert ssl policies](struct.SslPolicyInsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslPolicy { + /// Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. + pub profile: Option, + /// [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. + pub warnings: Option>, + /// The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. + #[serde(rename="minTlsVersion")] + pub min_tls_version: Option, + /// A list of features enabled when the selected profile is CUSTOM. The + /// - method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM. + #[serde(rename="customFeatures")] + pub custom_features: Option>, + /// [Output Only] The list of features enabled in the SSL policy. + #[serde(rename="enabledFeatures")] + pub enabled_features: Option>, + /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve an SslPolicy. + pub fingerprint: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for SslPolicy {} +impl ResponseResult for SslPolicy {} + + +/// Represents a Target SSL Proxy resource. +/// +/// A target SSL proxy is a component of a SSL Proxy load balancer. Global forwarding rules reference a target SSL proxy, and the target proxy then references an external backend service. For more information, read Using Target Proxies. (== resource_for {$api_version}.targetSslProxies ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get target ssl proxies](struct.TargetSslProxyGetCall.html) (response) +/// * [insert target ssl proxies](struct.TargetSslProxyInsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetSslProxy { + /// [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// URL to the BackendService resource. + pub service: Option, + /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, + /// URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + #[serde(rename="sslCertificates")] + pub ssl_certificates: Option>, + /// URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. + #[serde(rename="sslPolicy")] + pub ssl_policy: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for TargetSslProxy {} +impl ResponseResult for TargetSslProxy {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypesScopedList { + /// [Output Only] A list of machine types contained in this scope. + #[serde(rename="machineTypes")] + pub machine_types: Option>, + /// [Output Only] An informational warning that appears when the machine types list is empty. + pub warning: Option, +} + +impl Part for MachineTypesScopedList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstanceAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetInstanceAggregatedListWarning {} +impl Part for TargetInstanceAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove peering networks](struct.NetworkRemovePeeringCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworksRemovePeeringRequest { + /// Name of the peering, which should conform to RFC1035. + pub name: Option, +} + +impl RequestValue for NetworksRemovePeeringRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorTypesScopedList { + /// [Output Only] An informational warning that appears when the accelerator types list is empty. + pub warning: Option, + /// [Output Only] A list of accelerator types contained in this scope. + #[serde(rename="acceleratorTypes")] + pub accelerator_types: Option>, +} + +impl Part for AcceleratorTypesScopedList {} + + +/// [Output Only] The warning that replaces the list of managed instance groups when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstanceGroupManagersScopedListWarning {} +impl Part for InstanceGroupManagersScopedListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for VpnGatewayAggregatedListWarning {} +impl Part for VpnGatewayAggregatedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypeListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for DiskTypeListWarningData {} +impl Part for DiskTypeListWarningData {} + + +/// Message representing the validation result for a UrlMap. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapValidationResult { + /// no description provided + #[serde(rename="testFailures")] + pub test_failures: Option>, + /// no description provided + #[serde(rename="loadErrors")] + pub load_errors: Option>, + /// Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. + #[serde(rename="loadSucceeded")] + pub load_succeeded: Option, + /// If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. + #[serde(rename="testPassed")] + pub test_passed: Option, +} + +impl Part for UrlMapValidationResult {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerActionsSummary { + /// [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. + pub none: Option, + /// [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + pub recreating: Option, + /// [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. + /// + /// If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + pub creating: Option, + /// [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation. + pub verifying: Option, + /// [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. + pub restarting: Option, + /// [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it. + pub abandoning: Option, + /// [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. + pub deleting: Option, + /// [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + #[serde(rename="creatingWithoutRetries")] + pub creating_without_retries: Option, + /// [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance. + pub refreshing: Option, +} + +impl Part for InstanceGroupManagerActionsSummary {} + + +/// The network endpoint. Next ID: 7 +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpoint { + /// The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. + /// + /// The name must be 1-63 characters long, and comply with RFC1035. + pub instance: Option, + /// Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. + pub fqdn: Option, + /// Optional port number of network endpoint. If not specified and the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the defaultPort for the network endpoint group will be used. + pub port: Option, +} + +impl Part for NetworkEndpoint {} + + +/// RegionInstanceGroupManagers.createInstances +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create instances region instance group managers](struct.RegionInstanceGroupManagerCreateInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersCreateInstancesRequest { + /// [Required] List of specifications of per-instance configs. + pub instances: Option>, +} + +impl RequestValue for RegionInstanceGroupManagersCreateInstancesRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get health backend services](struct.BackendServiceGetHealthCall.html) (request) +/// * [get health region backend services](struct.RegionBackendServiceGetHealthCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceGroupReference { + /// A URI referencing one of the instance groups or network endpoint groups listed in the backend service. + pub group: Option, +} + +impl RequestValue for ResourceGroupReference {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for RouterAggregatedListWarningData {} +impl Part for RouterAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list autoscalers](struct.AutoscalerAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalerAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of AutoscalersScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for AutoscalerAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PerInstanceConfig { + /// The name of a per-instance config and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance config with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance config for a VM instance that either doesn't exist or is not part of the group will result in an error. + pub name: Option, + /// Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance config or the field needs to be unset. + pub fingerprint: Option, +} + +impl Part for PerInstanceConfig {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsListInstances { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InstanceWithNamedPorts resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceGroupsListInstances {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthChecksAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for HealthChecksAggregatedListWarning {} +impl Part for HealthChecksAggregatedListWarning {} + + +/// [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalersScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AutoscalersScopedListWarning {} +impl Part for AutoscalersScopedListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstanceGroupManagerListWarning {} +impl Part for InstanceGroupManagerListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagerListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for RegionInstanceGroupManagerListWarning {} +impl Part for RegionInstanceGroupManagerListWarning {} + + +/// Contains a list of TargetVpnGateway resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list target vpn gateways](struct.TargetVpnGatewayListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewayList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of TargetVpnGateway resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetVpnGatewayList {} + + +/// An access configuration attached to an instance's network interface. Only one access config per instance is supported. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update access config instances](struct.InstanceUpdateAccessConfigCall.html) (request) +/// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccessConfig { + /// This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. + /// + /// If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. + /// + /// If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. + #[serde(rename="networkTier")] + pub network_tier: Option, + /// [Output Only] Type of the resource. Always compute#accessConfig for access configs. + pub kind: Option, + /// The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. + pub name: Option, + /// An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. + #[serde(rename="natIP")] + pub nat_ip: Option, + /// Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. + #[serde(rename="setPublicPtr")] + pub set_public_ptr: Option, + /// The type of configuration. The default and only option is ONE_TO_ONE_NAT. + #[serde(rename="type")] + pub type_: Option, + /// The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. + #[serde(rename="publicPtrDomainName")] + pub public_ptr_domain_name: Option, +} + +impl RequestValue for AccessConfig {} /// [Output Only] Informational warning message. @@ -13564,21 +8712,118 @@ impl NestedType for RouteListWarning {} impl Part for RouteListWarning {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [resize reservations](struct.ReservationResizeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationsResizeRequest { + /// Number of allocated resources can be resized with minimum = 1 and maximum = 1000. + #[serde(rename="specificSkuCount")] + pub specific_sku_count: Option, +} + +impl RequestValue for ReservationsResizeRequest {} + + +/// The available logging options for the load balancer traffic served by this backend service. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewayListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct BackendServiceLogConfig { + /// This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0. + #[serde(rename="sampleRate")] + pub sample_rate: Option, + /// This field denotes whether to enable logging for the load balancer traffic served by this backend service. + pub enable: Option, } -impl NestedType for TargetVpnGatewayListWarningData {} -impl Part for TargetVpnGatewayListWarningData {} +impl Part for BackendServiceLogConfig {} + + +/// Contains a list of Subnetwork resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list subnetworks](struct.SubnetworkListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworkList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Subnetwork resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for SubnetworkList {} + + +/// Represents a Target VPN Gateway resource. +/// +/// The target VPN gateway resource represents a Classic Cloud VPN gateway. For more information, read the the Cloud VPN Overview. (== resource_for {$api_version}.targetVpnGateways ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete target vpn gateways](struct.TargetVpnGatewayDeleteCall.html) (none) +/// * [aggregated list target vpn gateways](struct.TargetVpnGatewayAggregatedListCall.html) (none) +/// * [get target vpn gateways](struct.TargetVpnGatewayGetCall.html) (response) +/// * [insert target vpn gateways](struct.TargetVpnGatewayInsertCall.html) (request) +/// * [list target vpn gateways](struct.TargetVpnGatewayListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGateway { + /// [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + pub status: Option, + /// [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// [Output Only] URL of the region where the target VPN gateway resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub region: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. + #[serde(rename="forwardingRules")] + pub forwarding_rules: Option>, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. + pub tunnels: Option>, + /// URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + pub network: Option, +} + +impl RequestValue for TargetVpnGateway {} +impl Resource for TargetVpnGateway {} +impl ResponseResult for TargetVpnGateway {} /// There is no detailed description. @@ -13603,6 +8848,547 @@ pub struct BackendServiceGroupHealth { impl ResponseResult for BackendServiceGroupHealth {} +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AddressListWarningData {} +impl Part for AddressListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for VpnTunnelAggregatedListWarningData {} +impl Part for VpnTunnelAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsAddHealthCheckRequest { + /// The HttpHealthCheck to add to the target pool. + #[serde(rename="healthChecks")] + pub health_checks: Option>, +} + +impl RequestValue for TargetPoolsAddHealthCheckRequest {} + + +/// Contains some information about a VPN tunnel. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayStatusTunnel { + /// URL reference to the VPN tunnel. + #[serde(rename="tunnelUrl")] + pub tunnel_url: Option, + /// The VPN gateway interface this VPN tunnel is associated with. + #[serde(rename="localGatewayInterface")] + pub local_gateway_interface: Option, + /// The peer gateway interface this VPN tunnel is connected to, the peer gateway could either be an external VPN gateway or GCP VPN gateway. + #[serde(rename="peerGatewayInterface")] + pub peer_gateway_interface: Option, +} + +impl Part for VpnGatewayStatusTunnel {} + + +/// [Output Only] Informational warning which replaces the list of operations when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for OperationsScopedListWarning {} +impl Part for OperationsScopedListWarning {} + + +/// A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkRoutingConfig { + /// The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. + #[serde(rename="routingMode")] + pub routing_mode: Option, +} + +impl Part for NetworkRoutingConfig {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileContentBuffer { + /// The raw content in the secure keys file. + pub content: Option, + /// no description provided + #[serde(rename="fileType")] + pub file_type: Option, +} + +impl Part for FileContentBuffer {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitmentAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for CommitmentAggregatedListWarning {} +impl Part for CommitmentAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set ssl policy target ssl proxies](struct.TargetSslProxySetSslPolicyCall.html) (request) +/// * [set ssl policy target https proxies](struct.TargetHttpsProxySetSslPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslPolicyReference { + /// URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource. + #[serde(rename="sslPolicy")] + pub ssl_policy: Option, +} + +impl RequestValue for SslPolicyReference {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ZoneListWarningData {} +impl Part for ZoneListWarningData {} + + +/// Represents an Image resource. +/// +/// You can use images to create boot disks for your VM instances. For more information, read Images. (== resource_for {$api_version}.images ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete images](struct.ImageDeleteCall.html) (none) +/// * [set iam policy images](struct.ImageSetIamPolicyCall.html) (none) +/// * [insert images](struct.ImageInsertCall.html) (request) +/// * [test iam permissions images](struct.ImageTestIamPermissionCall.html) (none) +/// * [get iam policy images](struct.ImageGetIamPolicyCall.html) (none) +/// * [get images](struct.ImageGetCall.html) (response) +/// * [get from family images](struct.ImageGetFromFamilyCall.html) (response) +/// * [set labels images](struct.ImageSetLabelCall.html) (none) +/// * [deprecate images](struct.ImageDeprecateCall.html) (none) +/// * [list images](struct.ImageListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Image { + /// [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + pub status: Option, + /// URL of the source snapshot used to create this image. This can be a full or valid partial URL. You must provide exactly one of: + /// - this property, or + /// - the sourceImage property, or + /// - the rawDisk.source property, or + /// - the sourceDisk property in order to create an image. + #[serde(rename="sourceSnapshot")] + pub source_snapshot: Option, + /// The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + #[serde(rename="sourceImageEncryptionKey")] + pub source_image_encryption_key: Option, + /// The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + #[serde(rename="sourceDiskEncryptionKey")] + pub source_disk_encryption_key: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + pub family: Option, + /// A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve an image. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// Labels to apply to this image. These can be later modified by the setLabels method. + pub labels: Option>, + /// Set the secure boot keys of shielded instance. + #[serde(rename="shieldedInstanceInitialState")] + pub shielded_instance_initial_state: Option, + /// Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). + #[serde(rename="archiveSizeBytes")] + pub archive_size_bytes: Option, + /// [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. + #[serde(rename="sourceDiskId")] + pub source_disk_id: Option, + /// A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + #[serde(rename="guestOsFeatures")] + pub guest_os_features: Option>, + /// [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name. + #[serde(rename="sourceSnapshotId")] + pub source_snapshot_id: Option, + /// URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of: + /// - this property, or + /// - the rawDisk.source property, or + /// - the sourceDisk property in order to create an image. + #[serde(rename="sourceImage")] + pub source_image: Option, + /// Any applicable license URI. + pub licenses: Option>, + /// The type of the image used to create this disk. The default and only value is RAW + #[serde(rename="sourceType")] + pub source_type: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// Integer license codes indicating which licenses are attached to this image. + #[serde(rename="licenseCodes")] + pub license_codes: Option>, + /// [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name. + #[serde(rename="sourceImageId")] + pub source_image_id: Option, + /// [Output Only] Type of the resource. Always compute#image for images. + pub kind: Option, + /// The parameters of the raw disk image. + #[serde(rename="rawDisk")] + pub raw_disk: Option, + /// URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values: + /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + /// - projects/project/zones/zone/disks/disk + /// - zones/zone/disks/disk + #[serde(rename="sourceDisk")] + pub source_disk: Option, + /// Cloud Storage bucket storage location of the image (regional or multi-regional). + #[serde(rename="storageLocations")] + pub storage_locations: Option>, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// Size of the image when restored onto a persistent disk (in GB). + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, + /// Encrypts the image using a customer-supplied encryption key. + /// + /// After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). + /// + /// Customer-supplied encryption keys do not protect access to metadata of the disk. + /// + /// If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. + #[serde(rename="imageEncryptionKey")] + pub image_encryption_key: Option, + /// The deprecation status associated with this image. + pub deprecated: Option, + /// The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + #[serde(rename="sourceSnapshotEncryptionKey")] + pub source_snapshot_encryption_key: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Image {} +impl Resource for Image {} +impl ResponseResult for Image {} + + +/// The parameters of the raw disk image. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImageRawDisk { + /// The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. + #[serde(rename="containerType")] + pub container_type: Option, + /// The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both. + pub source: Option, + /// [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created. + #[serde(rename="sha1Checksum")] + pub sha1_checksum: Option, +} + +impl NestedType for ImageRawDisk {} +impl Part for ImageRawDisk {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RoutersScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for RoutersScopedListWarningData {} +impl Part for RoutersScopedListWarningData {} + + +/// Cloud Autoscaler policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalingPolicy { + /// Configuration parameters of autoscaling based on a custom metric. + #[serde(rename="customMetricUtilizations")] + pub custom_metric_utilizations: Option>, + /// The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. + #[serde(rename="maxNumReplicas")] + pub max_num_replicas: Option, + /// Defines operating mode for this policy. + pub mode: Option, + /// Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. + #[serde(rename="cpuUtilization")] + pub cpu_utilization: Option, + /// The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed. + #[serde(rename="minNumReplicas")] + pub min_num_replicas: Option, + /// The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. + /// + /// Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process. + #[serde(rename="coolDownPeriodSec")] + pub cool_down_period_sec: Option, + /// Configuration parameters of autoscaling based on load balancer. + #[serde(rename="loadBalancingUtilization")] + pub load_balancing_utilization: Option, +} + +impl Part for AutoscalingPolicy {} + + +/// Configuration parameters of autoscaling based on load balancing. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalingPolicyLoadBalancingUtilization { + /// Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. + #[serde(rename="utilizationTarget")] + pub utilization_target: Option, +} + +impl Part for AutoscalingPolicyLoadBalancingUtilization {} + + +/// A guest attributes namespace/key/value entry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GuestAttributesEntry { + /// Namespace for the guest attribute entry. + pub namespace: Option, + /// Key for the guest attribute entry. + pub key: Option, + /// Value for the guest attribute entry. + pub value: Option, +} + +impl Part for GuestAttributesEntry {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list ssl certificates](struct.SslCertificateAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslCertificateAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of SslCertificatesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for SslCertificateAggregatedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslPoliciesListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for SslPoliciesListWarningData {} +impl Part for SslPoliciesListWarningData {} + + +/// An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpRouteRule { + /// For routeRules within a given pathMatcher, priority determines the order in which load balancer will interpret routeRules. RouteRules are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied. + /// You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 0 and 2147483647 inclusive. + /// Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules. + pub priority: Option, + /// When this rule is matched, the request is redirected to a URL specified by urlRedirect. + /// If urlRedirect is specified, service or routeAction must not be set. + #[serde(rename="urlRedirect")] + pub url_redirect: Option, + /// The short description conveying the intent of this routeRule. + /// The description can have a maximum length of 1024 characters. + pub description: Option, + /// The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. + /// Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + pub service: Option, + /// In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. + /// Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + #[serde(rename="routeAction")] + pub route_action: Option, + /// Specifies changes to request and response headers that need to take effect for the selected backendService. + /// The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction + #[serde(rename="headerAction")] + pub header_action: Option, + /// no description provided + #[serde(rename="matchRules")] + pub match_rules: Option>, +} + +impl Part for HttpRouteRule {} + + +/// [Output Only] A list of extended scratch disks assigned to the instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypeScratchDisks { + /// Size of the scratch disk, defined in GB. + #[serde(rename="diskGb")] + pub disk_gb: Option, +} + +impl NestedType for MachineTypeScratchDisks {} +impl Part for MachineTypeScratchDisks {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorTypeAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AcceleratorTypeAggregatedListWarning {} +impl Part for AcceleratorTypeAggregatedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewayListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetVpnGatewayListWarningData {} +impl Part for TargetVpnGatewayListWarningData {} + + /// There is no detailed description. /// /// # Activities @@ -13650,44 +9436,6 @@ impl NestedType for TargetVpnGatewayAggregatedListWarningData {} impl Part for TargetVpnGatewayAggregatedListWarningData {} -/// Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for TargetPoolsScopedListWarning {} -impl Part for TargetPoolsScopedListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add resource policies region disks](struct.RegionDiskAddResourcePolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionDisksAddResourcePoliciesRequest { - /// Resource policies to be added to this disk. - #[serde(rename="resourcePolicies")] - pub resource_policies: Option>, -} - -impl RequestValue for RegionDisksAddResourcePoliciesRequest {} - - /// There is no detailed description. /// /// # Activities @@ -13707,65 +9455,6 @@ pub struct NetworkEndpointGroupsDetachEndpointsRequest { impl RequestValue for NetworkEndpointGroupsDetachEndpointsRequest {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypeListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for AcceleratorTypeListWarning {} -impl Part for AcceleratorTypeListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set labels instances](struct.InstanceSetLabelCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstancesSetLabelsRequest { - /// Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels. - #[serde(rename="labelFingerprint")] - pub label_fingerprint: Option, - /// no description provided - pub labels: Option>, -} - -impl RequestValue for InstancesSetLabelsRequest {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupsListNodesWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for NodeGroupsListNodesWarning {} -impl Part for NodeGroupsListNodesWarning {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// @@ -13783,139 +9472,72 @@ impl NestedType for ForwardingRuleListWarningData {} impl Part for ForwardingRuleListWarningData {} -/// Represents a customer-supplied encryption key -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CustomerEncryptionKey { - /// Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. - #[serde(rename="rawKey")] - pub raw_key: Option, - /// [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. - pub sha256: Option, - /// The name of the encryption key that is stored in Google Cloud KMS. - #[serde(rename="kmsKeyName")] - pub kms_key_name: Option, -} - -impl Part for CustomerEncryptionKey {} - - /// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsRemoveInstanceRequest { - /// URLs of the instances to be removed from target pool. - pub instances: Option>, +pub struct TargetHttpsProxiesScopedList { + /// Informational warning which replaces the list of backend services when the list is empty. + pub warning: Option, + /// A list of TargetHttpsProxies contained in this scope. + #[serde(rename="targetHttpsProxies")] + pub target_https_proxies: Option>, } -impl RequestValue for TargetPoolsRemoveInstanceRequest {} +impl Part for TargetHttpsProxiesScopedList {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list security policies](struct.SecurityPolicyListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicyList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of SecurityPolicy resources. - pub items: Option>, - /// [Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, -} - -impl ResponseResult for SecurityPolicyList {} - - -/// Contains a list of TargetPool resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list target pools](struct.TargetPoolListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of TargetPool resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for TargetPoolList {} - - -/// Subnetwork which the current user has compute.subnetworks.use permission on. +/// Informational warning which replaces the list of backend services when the list is empty. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UsableSubnetwork { - /// Secondary IP ranges. - #[serde(rename="secondaryIpRanges")] - pub secondary_ip_ranges: Option>, - /// The range of internal addresses that are owned by this subnetwork. - #[serde(rename="ipCidrRange")] - pub ip_cidr_range: Option, - /// Network URL. - pub network: Option, - /// Subnetwork URL. - pub subnetwork: Option, +pub struct TargetHttpsProxiesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, } -impl Part for UsableSubnetwork {} +impl NestedType for TargetHttpsProxiesScopedListWarning {} +impl Part for TargetHttpsProxiesScopedListWarning {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// This message defines settings for a consistent hash style load balancer. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypeListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct ConsistentHashLoadBalancerSettings { + /// Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + #[serde(rename="httpCookie")] + pub http_cookie: Option, + /// The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. + #[serde(rename="minimumRingSize")] + pub minimum_ring_size: Option, + /// The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD. + #[serde(rename="httpHeaderName")] + pub http_header_name: Option, } -impl NestedType for AcceleratorTypeListWarningData {} -impl Part for AcceleratorTypeListWarningData {} +impl Part for ConsistentHashLoadBalancerSettings {} -/// A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==) +/// Represents a Backend Service resource. +/// +/// A backend service contains configuration values for Google Cloud Platform load balancing services. +/// +/// Backend services in Google Compute Engine can be either regionally or globally scoped. +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/backendServices) * [Regional](/compute/docs/reference/rest/{$api_version}/regionBackendServices) +/// +/// For more information, read Backend Services. +/// +/// (== resource_for {$api_version}.backendService ==) /// /// # Activities /// @@ -13945,16 +9567,41 @@ pub struct BackendService { pub connection_draining: Option, /// The protocol this BackendService uses to communicate with backends. /// - /// Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. - /// - /// For internal load balancing, the possible values are TCP and UDP, and the default is TCP. + /// Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, or UDP. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancer or for Traffic Director for more information. pub protocol: Option, /// An optional description of this resource. Provide this property when you create the resource. pub description: Option, /// Cloud CDN configuration for this BackendService. #[serde(rename="cdnPolicy")] pub cdn_policy: Option, - /// Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other. Possible values are INTERNAL and EXTERNAL. + /// Settings controlling the volume of connections to a backend service. If not set, this feature is considered disabled. + /// + /// This field is applicable to either: + /// - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + /// - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + #[serde(rename="circuitBreakers")] + pub circuit_breakers: Option, + /// The load balancing algorithm used within the scope of the locality. The possible values are: + /// - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. + /// - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. + /// - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. + /// - RANDOM: The load balancer selects a random healthy host. + /// - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. + /// - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, refer to https://ai.google/research/pubs/pub44824 + /// + /// This field is applicable to either: + /// - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + /// - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + /// + /// If sessionAffinity is not NONE, and this field is not set to >MAGLEV or RING_HASH, session affinity settings will not take effect. + #[serde(rename="localityLbPolicy")] + pub locality_lb_policy: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// The backend service timeout has a different meaning depending on the type of load balancer. For more information read, Backend service settings The default is 30 seconds. + #[serde(rename="timeoutSec")] + pub timeout_sec: Option, + /// Specifies the load balancer type. Choose EXTERNAL for load balancers that receive traffic from external clients. Choose INTERNAL for Internal TCP/UDP Load Balancing. Choose INTERNAL_MANAGED for Internal HTTP(S) Load Balancing. Choose INTERNAL_SELF_MANAGED for Traffic Director. A backend service created for one type of load balancing cannot be used with another. For more information, refer to Choosing a load balancer. #[serde(rename="loadBalancingScheme")] pub load_balancing_scheme: Option, /// [Output Only] The resource URL for the security policy associated with this backend service. @@ -13964,58 +9611,71 @@ pub struct BackendService { /// /// To see the latest fingerprint, make a get() request to retrieve a BackendService. pub fingerprint: Option, - /// Name of backend port. The same name should appear in the instance groups referenced by this service. Required when the load balancing scheme is EXTERNAL. + /// A named port on a backend instance group representing the port for communication to the backend VMs in that group. Required when the loadBalancingScheme is EXTERNAL, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED and the backends are instance groups. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. /// - /// When the load balancing scheme is INTERNAL, this field is not used. + /// + /// + /// Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Blaancing). #[serde(rename="portName")] pub port_name: Option, - /// The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required for Compute Engine backend services. A health check must not be specified for App Engine backend and Cloud Function backend. - /// - /// For internal load balancing, a URL to a HealthCheck resource must be specified instead. + /// The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently at most one health check can be specified. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet NEG backends must not have a health check. A health check must #[serde(rename="healthChecks")] pub health_checks: Option>, - /// Type of session affinity to use. The default is NONE. - /// - /// When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or GENERATED_COOKIE. - /// - /// When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. - /// - /// When the protocol is UDP, this field is not used. - #[serde(rename="sessionAffinity")] - pub session_affinity: Option, /// [Output Only] Creation timestamp in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. pub id: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, + /// This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. + #[serde(rename="logConfig")] + pub log_config: Option, /// [Output Only] Type of resource. Always compute#backendService for backend services. pub kind: Option, /// Headers that the HTTP/S load balancer should add to proxied requests. #[serde(rename="customRequestHeaders")] pub custom_request_headers: Option>, - /// If true, enable Cloud CDN for this BackendService. - /// - /// When the load balancing scheme is INTERNAL, this field is not used. + /// If true, enables Cloud CDN for the backend service. Only applicable if the loadBalancingScheme is EXTERNAL and the protocol is HTTP or HTTPS. #[serde(rename="enableCDN")] pub enable_cdn: Option, + /// Settings controlling the eviction of unhealthy hosts from the load balancing pool for the backend service. If not set, this feature is considered disabled. + /// + /// This field is applicable to either: + /// - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + /// - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + #[serde(rename="outlierDetection")] + pub outlier_detection: Option, /// [Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. pub region: Option, - /// Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value for TTL is one day. - /// - /// When the load balancing scheme is INTERNAL, this field is not used. + /// If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is one day (86,400). #[serde(rename="affinityCookieTtlSec")] pub affinity_cookie_ttl_sec: Option, + /// Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. + /// + /// This field is applicable to either: + /// - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + /// - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + #[serde(rename="consistentHash")] + pub consistent_hash: Option, + /// Type of session affinity to use. The default is NONE. Session affinity is not applicable if the --protocol is UDP. + /// + /// When the loadBalancingScheme is EXTERNAL, possible values are NONE, CLIENT_IP, or GENERATED_COOKIE. You can use GENERATED_COOKIE if the protocol is HTTP or HTTPS. + /// + /// When the loadBalancingScheme is INTERNAL, possible values are NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. + /// + /// When the loadBalancingScheme is INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED, possible values are NONE, CLIENT_IP, GENERATED_COOKIE, HEADER_FIELD, or HTTP_COOKIE. + #[serde(rename="sessionAffinity")] + pub session_affinity: Option, /// Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. /// - /// This cannot be used for internal load balancing. + /// This cannot be used if the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing). pub port: Option, - /// How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. - #[serde(rename="timeoutSec")] - pub timeout_sec: Option, + /// The URL of the network to which this backend service belongs. This field can only be spcified when the load balancing scheme is set to INTERNAL. + pub network: Option, /// The list of backends that serve this BackendService. pub backends: Option>, + /// Applicable only to Failover for Internal TCP/UDP Load Balancing. Requires at least one backend instance group to be defined as a backup (failover) backend. + #[serde(rename="failoverPolicy")] + pub failover_policy: Option, /// no description provided pub iap: Option, /// [Output Only] Server-defined URL for the resource. @@ -14047,36 +9707,6 @@ impl NestedType for NetworkEndpointGroupListWarning {} impl Part for NetworkEndpointGroupListWarning {} -/// Contains a list of images. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list images](struct.ImageListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ImageList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Type of resource. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Image resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for ImageList {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -14096,25 +9726,6 @@ impl NestedType for ResourcePolicyListWarning {} impl Part for ResourcePolicyListWarning {} -/// An informational warning that appears when the list of addresses is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworksScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for SubnetworksScopedListWarning {} -impl Part for SubnetworksScopedListWarning {} - - /// Description of a planned outage on this Interconnect. Next id: 9 /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -14151,123 +9762,38 @@ pub struct InterconnectOutageNotification { impl Part for InterconnectOutageNotification {} -/// There is no detailed description. +/// External VPN gateway is the on-premises VPN gateway(s) or another cloud provider's VPN gateway that connects to your Google Cloud VPN gateway. To create a highly available VPN from Google Cloud to your on-premises side or another Cloud provider's VPN gateway, you must create a external VPN gateway resource in GCP, which provides the information to GCP about your external VPN gateway. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [set iam policy reservations](struct.ReservationSetIamPolicyCall.html) (request) -/// * [set iam policy disks](struct.DiskSetIamPolicyCall.html) (request) -/// * [set iam policy node groups](struct.NodeGroupSetIamPolicyCall.html) (request) -/// * [set iam policy instances](struct.InstanceSetIamPolicyCall.html) (request) +/// * [list external vpn gateways](struct.ExternalVpnGatewayListCall.html) (none) +/// * [set labels external vpn gateways](struct.ExternalVpnGatewaySetLabelCall.html) (none) +/// * [get external vpn gateways](struct.ExternalVpnGatewayGetCall.html) (response) +/// * [test iam permissions external vpn gateways](struct.ExternalVpnGatewayTestIamPermissionCall.html) (none) +/// * [insert external vpn gateways](struct.ExternalVpnGatewayInsertCall.html) (request) +/// * [delete external vpn gateways](struct.ExternalVpnGatewayDeleteCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ZoneSetPolicyRequest { - /// REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. - pub policy: Option, - /// Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. - pub bindings: Option>, - /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. - pub etag: Option, -} - -impl RequestValue for ZoneSetPolicyRequest {} - - -/// Informational metadata about Partner attachments from Partners to display to customers. These fields are propagated from PARTNER_PROVIDER attachments to their corresponding PARTNER attachments. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachmentPartnerMetadata { - /// Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values. - #[serde(rename="partnerName")] - pub partner_name: Option, - /// Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner?s portal. For instance "Chicago 1". This value may be validated to match approved Partner values. - #[serde(rename="interconnectName")] - pub interconnect_name: Option, - /// URL of the Partner?s portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values. - #[serde(rename="portalUrl")] - pub portal_url: Option, -} - -impl Part for InterconnectAttachmentPartnerMetadata {} - - -/// Informational warning which replaces the list of forwarding rules when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ForwardingRulesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for ForwardingRulesScopedListWarning {} -impl Part for ForwardingRulesScopedListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete nodes node groups](struct.NodeGroupDeleteNodeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupsDeleteNodesRequest { - /// no description provided - pub nodes: Option>, -} - -impl RequestValue for NodeGroupsDeleteNodesRequest {} - - -/// Represent a sole-tenant Node Type resource. -/// -/// Each node within a node group must have a node type. A node type specifies the total amount of cores and memory for that node. Currently, the only available node type is n1-node-96-624 node type that has 96 vCPUs and 624 GB of memory, available in multiple zones. For more information read Node types. (== resource_for beta.nodeTypes ==) (== resource_for v1.nodeTypes ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list node types](struct.NodeTypeListCall.html) (none) -/// * [get node types](struct.NodeTypeGetCall.html) (response) -/// * [aggregated list node types](struct.NodeTypeAggregatedListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeType { - /// [Output Only] The CPU platform used by this node type. - #[serde(rename="cpuPlatform")] - pub cpu_platform: Option, - /// [Output Only] The number of virtual CPUs that are available to the node type. - #[serde(rename="guestCpus")] - pub guest_cpus: Option, - /// [Output Only] The type of the resource. Always compute#nodeType for node types. +pub struct ExternalVpnGateway { + /// [Output Only] Type of the resource. Always compute#externalVpnGateway for externalVpnGateways. pub kind: Option, - /// [Output Only] An optional textual description of the resource. + /// An optional description of this resource. Provide this property when you create the resource. pub description: Option, - /// [Output Only] The name of the zone where the node type resides, such as us-central1-a. - pub zone: Option, - /// [Output Only] The deprecation status associated with this node type. - pub deprecated: Option, - /// [Output Only] The amount of physical memory available to the node type, defined in MB. - #[serde(rename="memoryMb")] - pub memory_mb: Option, - /// [Output Only] Local SSD available to the node type, defined in GB. - #[serde(rename="localSsdGb")] - pub local_ssd_gb: Option, + /// A fingerprint for the labels being applied to this ExternalVpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve an ExternalVpnGateway. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// Labels to apply to this ExternalVpnGateway resource. These can be later modified by the setLabels method. Each label key/value must comply with RFC1035. Label values may be empty. + pub labels: Option>, + /// Indicates the user-supplied redundancy type of this external VPN gateway. + #[serde(rename="redundancyType")] + pub redundancy_type: Option, + /// List of interfaces for this external VPN gateway. + pub interfaces: Option>, /// [Output Only] Creation timestamp in RFC3339 text format. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, @@ -14276,61 +9802,35 @@ pub struct NodeType { /// [Output Only] Server-defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, - /// [Output Only] Name of the resource. + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. pub name: Option, } -impl Resource for NodeType {} -impl ResponseResult for NodeType {} +impl RequestValue for ExternalVpnGateway {} +impl Resource for ExternalVpnGateway {} +impl ResponseResult for ExternalVpnGateway {} -/// Contains a list of Commitment resources. +/// The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list region commitments](struct.RegionCommitmentListCall.html) (response) +/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommitmentList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of Commitment resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, +pub struct UsageExportLocation { + /// The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + #[serde(rename="bucketName")] + pub bucket_name: Option, + /// An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + #[serde(rename="reportNamePrefix")] + pub report_name_prefix: Option, } -impl ResponseResult for CommitmentList {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [resize reservations](struct.ReservationResizeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReservationsResizeRequest { - /// Number of allocated resources can be resized with minimum = 1 and maximum = 1000. - #[serde(rename="specificSkuCount")] - pub specific_sku_count: Option, -} - -impl RequestValue for ReservationsResizeRequest {} +impl RequestValue for UsageExportLocation {} /// Represents a Firewall Rule resource. @@ -14410,6 +9910,4963 @@ impl Resource for Firewall {} impl ResponseResult for Firewall {} +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for UrlMapsScopedListWarningData {} +impl Part for UrlMapsScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypeAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of MachineTypesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for MachineTypeAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list peering routes networks](struct.NetworkListPeeringRouteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExchangedPeeringRoutesList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#exchangedPeeringRoutesList for exchanged peering routes lists. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of ExchangedPeeringRoute resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ExchangedPeeringRoutesList {} + + +/// Specification determining how headers are added to requests or responses. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpHeaderOption { + /// The name of the header. + #[serde(rename="headerName")] + pub header_name: Option, + /// The value of the header to add. + #[serde(rename="headerValue")] + pub header_value: Option, + /// If false, headerValue is appended to any values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that header. + /// The default value is false. + pub replace: Option, +} + +impl Part for HttpHeaderOption {} + + +/// A shielded Instance identity entry. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get shielded instance identity instances](struct.InstanceGetShieldedInstanceIdentityCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShieldedInstanceIdentity { + /// An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + #[serde(rename="signingKey")] + pub signing_key: Option, + /// [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. + pub kind: Option, + /// An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + #[serde(rename="encryptionKey")] + pub encryption_key: Option, +} + +impl ResponseResult for ShieldedInstanceIdentity {} + + +/// [Output Only] Informational warning which replaces the list of disks when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for DisksScopedListWarning {} +impl Part for DisksScopedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for OperationAggregatedListWarningData {} +impl Part for OperationAggregatedListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for PacketMirroringsScopedListWarningData {} +impl Part for PacketMirroringsScopedListWarningData {} + + +/// Array of key/value pairs. The total size of all keys and values must be less than 512 KB. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetadataItems { + /// Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + pub key: Option, + /// Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + pub value: Option, +} + +impl NestedType for MetadataItems {} +impl Part for MetadataItems {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceListWarningData {} +impl Part for InstanceListWarningData {} + + +/// Specification for how requests are aborted as part of fault injection. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpFaultAbort { + /// The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. + /// The value must be between 0.0 and 100.0 inclusive. + pub percentage: Option, + /// The HTTP status code used to abort the request. + /// The value must be between 200 and 599 inclusive. + #[serde(rename="httpStatus")] + pub http_status: Option, +} + +impl Part for HttpFaultAbort {} + + +/// Informational warning which replaces the list of backend services when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for UrlMapsScopedListWarning {} +impl Part for UrlMapsScopedListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AddressListWarning {} +impl Part for AddressListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeGroupsScopedListWarningData {} +impl Part for NodeGroupsScopedListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslCertificateListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for SslCertificateListWarningData {} +impl Part for SslCertificateListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpProxiesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetHttpProxiesScopedListWarningData {} +impl Part for TargetHttpProxiesScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (request) +/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (request) +/// * [set target global forwarding rules](struct.GlobalForwardingRuleSetTargetCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetReference { + /// no description provided + pub target: Option, +} + +impl RequestValue for TargetReference {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringFilter { + /// Protocols that apply as filter on mirrored traffic. If no protocols are specified, all traffic that matches the specified CIDR ranges is mirrored. If neither cidrRanges nor IPProtocols is specified, all traffic is mirrored. + #[serde(rename="IPProtocols")] + pub ip_protocols: Option>, + /// IP CIDR ranges that apply as filter on the source (ingress) or destination (egress) IP in the IP header. Only IPv4 is supported. If no ranges are specified, all traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all traffic is mirrored. + #[serde(rename="cidrRanges")] + pub cidr_ranges: Option>, +} + +impl Part for PacketMirroringFilter {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsScopedList { + /// [Output Only] An informational warning that replaces the list of instance groups when the list is empty. + pub warning: Option, + /// [Output Only] The list of instance groups that are contained in this scope. + #[serde(rename="instanceGroups")] + pub instance_groups: Option>, +} + +impl Part for InstanceGroupsScopedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringMirroredResourceInfoSubnetInfo { + /// Resource URL to the subnetwork for which traffic from/to all VM instances will be mirrored. + pub url: Option, + /// [Output Only] Unique identifier for the subnetwork; defined by the server. + #[serde(rename="canonicalUrl")] + pub canonical_url: Option, +} + +impl Part for PacketMirroringMirroredResourceInfoSubnetInfo {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerStatusVersionTarget { + /// [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager. + #[serde(rename="isReached")] + pub is_reached: Option, +} + +impl Part for InstanceGroupManagerStatusVersionTarget {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpsHealthCheckListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for HttpsHealthCheckListWarning {} +impl Part for HttpsHealthCheckListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add resource policies disks](struct.DiskAddResourcePolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksAddResourcePoliciesRequest { + /// Resource policies to be added to this disk. Currently you can only specify one policy here. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, +} + +impl RequestValue for DisksAddResourcePoliciesRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerUpdatePolicy { + /// The instance redistribution policy for regional managed instance groups. Valid values are: + /// - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region. + /// - NONE: For non-autoscaled groups, proactive redistribution is disabled. + #[serde(rename="instanceRedistributionType")] + pub instance_redistribution_type: Option, + /// The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: + /// + /// + /// - The instance's status is RUNNING. + /// - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary. + /// + /// At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable. + #[serde(rename="maxUnavailable")] + pub max_unavailable: Option, + /// What action should be used to replace instances. See minimal_action.REPLACE + #[serde(rename="replacementMethod")] + pub replacement_method: Option, + /// The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + #[serde(rename="type")] + pub type_: Option, + /// The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary. + /// + /// At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge. + #[serde(rename="maxSurge")] + pub max_surge: Option, + /// Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + #[serde(rename="minimalAction")] + pub minimal_action: Option, +} + +impl Part for InstanceGroupManagerUpdatePolicy {} + + +/// The available logging options for this subnetwork. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworkLogConfig { + /// Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is to disable flow logging. + pub enable: Option, + /// Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5, which means half of all collected logs are reported. + #[serde(rename="flowSampling")] + pub flow_sampling: Option, + /// Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA. + #[serde(rename="metadataFields")] + pub metadata_fields: Option>, + /// Can only be specified if VPC flow logs for this subnetwork is enabled. Export filter used to define which VPC flow logs should be logged. + #[serde(rename="filterExpr")] + pub filter_expr: Option, + /// Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. + #[serde(rename="aggregationInterval")] + pub aggregation_interval: Option, + /// Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA. + pub metadata: Option, +} + +impl Part for SubnetworkLogConfig {} + + +/// Sets the scheduling options for an Instance. NextID: 10 +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Scheduling { + /// Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. + /// + /// By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + #[serde(rename="automaticRestart")] + pub automatic_restart: Option, + /// A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity. + #[serde(rename="nodeAffinities")] + pub node_affinities: Option>, + /// Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. + pub preemptible: Option, + /// Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options. + #[serde(rename="onHostMaintenance")] + pub on_host_maintenance: Option, +} + +impl RequestValue for Scheduling {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsScopedList { + /// Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, + /// A list of target pools contained in this scope. + #[serde(rename="targetPools")] + pub target_pools: Option>, +} + +impl Part for TargetPoolsScopedList {} + + +/// Describes the high availability requirement state for the VPN connection between this Cloud VPN gateway and a peer gateway. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayStatusHighAvailabilityRequirementState { + /// Indicates the high availability requirement state for the VPN connection. Valid values are CONNECTION_REDUNDANCY_MET, CONNECTION_REDUNDANCY_NOT_MET. + pub state: Option, + /// Indicates the reason why the VPN connection does not meet the high availability redundancy criteria/requirement. Valid values is INCOMPLETE_TUNNELS_COVERAGE. + #[serde(rename="unsatisfiedReason")] + pub unsatisfied_reason: Option, +} + +impl Part for VpnGatewayStatusHighAvailabilityRequirementState {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for RegionInstanceGroupListWarningData {} +impl Part for RegionInstanceGroupListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DistributionPolicy { + /// Zones where the regional managed instance group will create and manage instances. + pub zones: Option>, +} + +impl Part for DistributionPolicy {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsRemoveHealthCheckRequest { + /// Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: + /// - https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check + /// - projects/project/global/httpHealthChecks/health-check + /// - global/httpHealthChecks/health-check + #[serde(rename="healthChecks")] + pub health_checks: Option>, +} + +impl RequestValue for TargetPoolsRemoveHealthCheckRequest {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthCheckListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for HealthCheckListWarningData {} +impl Part for HealthCheckListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set private ip google access subnetworks](struct.SubnetworkSetPrivateIpGoogleAccesCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworksSetPrivateIpGoogleAccessRequest { + /// no description provided + #[serde(rename="privateIpGoogleAccess")] + pub private_ip_google_access: Option, +} + +impl RequestValue for SubnetworksSetPrivateIpGoogleAccessRequest {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpsProxiesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetHttpsProxiesScopedListWarningData {} +impl Part for TargetHttpsProxiesScopedListWarningData {} + + +/// Specified snapshot properties for scheduled snapshots created by this policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicySnapshotSchedulePolicySnapshotProperties { + /// Indication to perform a 'guest aware' snapshot. + #[serde(rename="guestFlush")] + pub guest_flush: Option, + /// Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional). + #[serde(rename="storageLocations")] + pub storage_locations: Option>, + /// Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty. + pub labels: Option>, +} + +impl Part for ResourcePolicySnapshotSchedulePolicySnapshotProperties {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersRecreateInstancesRequest { + /// The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupManagersRecreateInstancesRequest {} + + +/// Contains a list of addresses. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list addresses](struct.AddresseListCall.html) (response) +/// * [list global addresses](struct.GlobalAddresseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#addressList for lists of addresses. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Address resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for AddressList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionAutoscalerListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for RegionAutoscalerListWarningData {} +impl Part for RegionAutoscalerListWarningData {} + + +/// InstanceGroupManagers.applyUpdatesToInstances +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [apply updates to instances region instance group managers](struct.RegionInstanceGroupManagerApplyUpdatesToInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersApplyUpdatesRequest { + /// The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + pub instances: Option>, + /// The most disruptive action that you want to perform on each instance during the update: + /// - REPLACE: Delete the instance and create it again. + /// - RESTART: Stop the instance and start it again. + /// - REFRESH: Do not stop the instance. + /// - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + #[serde(rename="mostDisruptiveAllowedAction")] + pub most_disruptive_allowed_action: Option, + /// The minimal action that you want to perform on each instance during the update: + /// - REPLACE: At minimum, delete the instance and create it again. + /// - RESTART: Stop the instance and start it again. + /// - REFRESH: Do not stop the instance. + /// - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + #[serde(rename="minimalAction")] + pub minimal_action: Option, +} + +impl RequestValue for RegionInstanceGroupManagersApplyUpdatesRequest {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorTypesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AcceleratorTypesScopedListWarningData {} +impl Part for AcceleratorTypesScopedListWarningData {} + + +/// Represents a regional Commitment resource. +/// +/// Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. (== resource_for {$api_version}.regionCommitments ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert region commitments](struct.RegionCommitmentInsertCall.html) (request) +/// * [get region commitments](struct.RegionCommitmentGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Commitment { + /// [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + pub status: Option, + /// [Output Only] Type of the resource. Always compute#commitment for commitments. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// List of reservations in this commitment. + pub reservations: Option>, + /// [Output Only] Commitment start time in RFC3339 text format. + #[serde(rename="startTimestamp")] + pub start_timestamp: Option, + /// A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. + pub resources: Option>, + /// [Output Only] Commitment end time in RFC3339 text format. + #[serde(rename="endTimestamp")] + pub end_timestamp: Option, + /// [Output Only] An optional, human-readable explanation of the status. + #[serde(rename="statusMessage")] + pub status_message: Option, + /// [Output Only] URL of the region where this commitment may be used. + pub region: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + pub plan: Option, +} + +impl RequestValue for Commitment {} +impl ResponseResult for Commitment {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedInstanceVersion { + /// [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }. + #[serde(rename="instanceTemplate")] + pub instance_template: Option, + /// [Output Only] Name of the version. + pub name: Option, +} + +impl Part for ManagedInstanceVersion {} + + +/// Represents a Region resource. +/// +/// A region is a geographical area where a resource is located. For more information, read Regions and Zones. (== resource_for {$api_version}.regions ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list regions](struct.RegionListCall.html) (none) +/// * [get regions](struct.RegionGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Region { + /// [Output Only] Status of the region, either UP or DOWN. + pub status: Option, + /// [Output Only] Type of the resource. Always compute#region for regions. + pub kind: Option, + /// [Output Only] Textual description of the resource. + pub description: Option, + /// [Output Only] The deprecation status associated with this region. + pub deprecated: Option, + /// [Output Only] Quotas assigned to this region. + pub quotas: Option>, + /// [Output Only] A list of zones available in this region, in the form of resource URLs. + pub zones: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Name of the resource. + pub name: Option, +} + +impl Resource for Region {} +impl ResponseResult for Region {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list node templates](struct.NodeTemplateAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplateAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of NodeTemplatesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for NodeTemplateAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HTTPHealthCheck { + /// The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. + pub port: Option, + /// The value of the host header in the HTTP health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. + pub host: Option, + /// The request path of the HTTP health check request. The default value is /. + #[serde(rename="requestPath")] + pub request_path: Option, + /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + #[serde(rename="portName")] + pub port_name: Option, + /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, + /// Specifies how port is selected for health checking, can be one of following values: + /// USE_FIXED_PORT: The port number in port is used for health checking. + /// USE_NAMED_PORT: The portName is used for health checking. + /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + /// + /// + /// If not specified, HTTP health check follows behavior specified in port and portName fields. + #[serde(rename="portSpecification")] + pub port_specification: Option, + /// The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. + pub response: Option, +} + +impl Part for HTTPHealthCheck {} + + +/// MetadataFilter label name value pairs that are expected to match corresponding labels presented as metadata to the loadbalancer. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetadataFilterLabelMatch { + /// Name of metadata label. + /// The name can have a maximum length of 1024 characters and must be at least 1 character long. + pub name: Option, + /// The value of the label must match the specified value. + /// value can have a maximum length of 1024 characters. + pub value: Option, +} + +impl Part for MetadataFilterLabelMatch {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list network endpoints network endpoint groups](struct.NetworkEndpointGroupListNetworkEndpointCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupsListEndpointsRequest { + /// Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specifiy this parameter, the health status of network endpoints will not be provided. + #[serde(rename="healthStatus")] + pub health_status: Option, +} + +impl RequestValue for NetworkEndpointGroupsListEndpointsRequest {} + + +/// Represents a Managed Instance Group resource. +/// +/// An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups. +/// +/// For zonal Managed Instance Group, use the instanceGroupManagers resource. +/// +/// For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list managed instances instance group managers](struct.InstanceGroupManagerListManagedInstanceCall.html) (none) +/// * [resize instance group managers](struct.InstanceGroupManagerResizeCall.html) (none) +/// * [aggregated list instance group managers](struct.InstanceGroupManagerAggregatedListCall.html) (none) +/// * [get region instance group managers](struct.RegionInstanceGroupManagerGetCall.html) (response) +/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (none) +/// * [create instances instance group managers](struct.InstanceGroupManagerCreateInstanceCall.html) (none) +/// * [list errors instance group managers](struct.InstanceGroupManagerListErrorCall.html) (none) +/// * [apply updates to instances instance group managers](struct.InstanceGroupManagerApplyUpdatesToInstanceCall.html) (none) +/// * [delete instance group managers](struct.InstanceGroupManagerDeleteCall.html) (none) +/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (none) +/// * [insert instance group managers](struct.InstanceGroupManagerInsertCall.html) (request) +/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (none) +/// * [list instance group managers](struct.InstanceGroupManagerListCall.html) (none) +/// * [get instance group managers](struct.InstanceGroupManagerGetCall.html) (response) +/// * [patch region instance group managers](struct.RegionInstanceGroupManagerPatchCall.html) (request) +/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (none) +/// * [patch instance group managers](struct.InstanceGroupManagerPatchCall.html) (request) +/// * [insert region instance group managers](struct.RegionInstanceGroupManagerInsertCall.html) (request) +/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManager { + /// [Output Only] The status of this managed instance group. + pub status: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// The autohealing policy for this managed instance group. You can specify only one value. + #[serde(rename="autoHealingPolicies")] + pub auto_healing_policies: Option>, + /// [Output Only] The URL of the Instance Group resource. + #[serde(rename="instanceGroup")] + pub instance_group: Option, + /// [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. + #[serde(rename="currentActions")] + pub current_actions: Option, + /// The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. + #[serde(rename="instanceTemplate")] + pub instance_template: Option, + /// Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager. + pub fingerprint: Option, + /// [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. + pub kind: Option, + /// The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number. + #[serde(rename="targetSize")] + pub target_size: Option, + /// The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, + /// [Output Only] The URL of the zone where the managed instance group is located (for zonal resources). + pub zone: Option, + /// Specifies the instance templates used by this managed instance group to create instances. + /// + /// Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates. + pub versions: Option>, + /// [Output Only] The URL of the region where the managed instance group resides (for regional resources). + pub region: Option, + /// Policy specifying intended distribution of instances in regional managed instance group. + #[serde(rename="distributionPolicy")] + pub distribution_policy: Option, + /// [Output Only] A unique identifier for this resource type. The server generates this identifier. + pub id: Option, + /// The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. + #[serde(rename="baseInstanceName")] + pub base_instance_name: Option, + /// The update policy for this managed instance group. + #[serde(rename="updatePolicy")] + pub update_policy: Option, + /// The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + #[serde(rename="targetPools")] + pub target_pools: Option>, + /// [Output Only] The URL for this managed instance group. The server defines this URL. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Named ports configured for the Instance Groups complementary to this Instance Group Manager. + #[serde(rename="namedPorts")] + pub named_ports: Option>, +} + +impl RequestValue for InstanceGroupManager {} +impl Resource for InstanceGroupManager {} +impl ResponseResult for InstanceGroupManager {} + + +/// Contain information of Nat mapping for an interface of this endpoint. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VmEndpointNatMappingsInterfaceNatMappings { + /// Primary IP of the VM for this NIC. + #[serde(rename="sourceVirtualIp")] + pub source_virtual_ip: Option, + /// A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + #[serde(rename="natIpPortRanges")] + pub nat_ip_port_ranges: Option>, + /// Total number of drain ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field drain_nat_ip_port_ranges. + #[serde(rename="numTotalDrainNatPorts")] + pub num_total_drain_nat_ports: Option, + /// Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges. + #[serde(rename="numTotalNatPorts")] + pub num_total_nat_ports: Option, + /// Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24". + #[serde(rename="sourceAliasIpRange")] + pub source_alias_ip_range: Option, + /// List of all drain IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + #[serde(rename="drainNatIpPortRanges")] + pub drain_nat_ip_port_ranges: Option>, +} + +impl Part for VmEndpointNatMappingsInterfaceNatMappings {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region disk types](struct.RegionDiskTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionDiskTypeList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of DiskType resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RegionDiskTypeList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list ssl policies](struct.SslPolicyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslPoliciesList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of SslPolicy resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for SslPoliciesList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set security policy backend services](struct.BackendServiceSetSecurityPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicyReference { + /// no description provided + #[serde(rename="securityPolicy")] + pub security_policy: Option, +} + +impl RequestValue for SecurityPolicyReference {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstanceListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetInstanceListWarningData {} +impl Part for TargetInstanceListWarningData {} + + +/// Contains a list of Route resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list routes](struct.RouteListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouteList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Route resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RouteList {} + + +/// Represents an Interconnect Attachment (VLAN) Location resource. +/// +/// You can use this resource to find location details about an Interconnect attachment (VLAN). For more information about interconnect attachments, read Creating VLAN Attachments. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list interconnect locations](struct.InterconnectLocationListCall.html) (none) +/// * [get interconnect locations](struct.InterconnectLocationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectLocation { + /// [Output Only] The status of this InterconnectLocation, which can take one of the following values: + /// - CLOSED: The InterconnectLocation is closed and is unavailable for provisioning new Interconnects. + /// - AVAILABLE: The InterconnectLocation is available for provisioning new Interconnects. + pub status: Option, + /// [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + pub city: Option, + /// [Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations. + pub kind: Option, + /// [Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: "zone1" or "zone2". + #[serde(rename="availabilityZone")] + pub availability_zone: Option, + /// [Output Only] An optional description of the resource. + pub description: Option, + /// [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + #[serde(rename="peeringdbFacilityId")] + pub peeringdb_facility_id: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Continent for this location, which can take one of the following values: + /// - AFRICA + /// - ASIA_PAC + /// - EUROPE + /// - NORTH_AMERICA + /// - SOUTH_AMERICA + pub continent: Option, + /// [Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions. + #[serde(rename="regionInfos")] + pub region_infos: Option>, + /// [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + #[serde(rename="facilityProviderFacilityId")] + pub facility_provider_facility_id: Option, + /// [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + pub address: Option, + /// [Output Only] The name of the provider for this facility (e.g., EQUINIX). + #[serde(rename="facilityProvider")] + pub facility_provider: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Name of the resource. + pub name: Option, +} + +impl Resource for InterconnectLocation {} +impl ResponseResult for InterconnectLocation {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpsProxyAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetHttpsProxyAggregatedListWarning {} +impl Part for TargetHttpsProxyAggregatedListWarning {} + + +/// Contains a list of routers. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list routers](struct.RouterAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Router resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RouterAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list managed instances region instance group managers](struct.RegionInstanceGroupManagerListManagedInstanceCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersListInstancesResponse { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of managed instances. + #[serde(rename="managedInstances")] + pub managed_instances: Option>, +} + +impl ResponseResult for RegionInstanceGroupManagersListInstancesResponse {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete instances region instance group managers](struct.RegionInstanceGroupManagerDeleteInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersDeleteInstancesRequest { + /// The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + pub instances: Option>, +} + +impl RequestValue for RegionInstanceGroupManagersDeleteInstancesRequest {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceGroupListWarningData {} +impl Part for InstanceGroupListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set service account instances](struct.InstanceSetServiceAccountCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesSetServiceAccountRequest { + /// The list of scopes to be made available for this service account. + pub scopes: Option>, + /// Email address of the service account. + pub email: Option, +} + +impl RequestValue for InstancesSetServiceAccountRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceManagedByIgmErrorInstanceActionDetails { + /// [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values: + pub action: Option, + /// [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created. + pub instance: Option, + /// [Output Only] Version this instance was created from, or was being created from, but the creation failed. Corresponds to one of the versions that were set on the Instance Group Manager resource at the time this instance was being created. + pub version: Option, +} + +impl Part for InstanceManagedByIgmErrorInstanceActionDetails {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for DiskListWarning {} +impl Part for DiskListWarning {} + + +/// Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only. Next id: 4 +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectCircuitInfo { + /// Customer-side demarc ID for this circuit. + #[serde(rename="customerDemarcId")] + pub customer_demarc_id: Option, + /// Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + #[serde(rename="googleCircuitId")] + pub google_circuit_id: Option, + /// Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA. + #[serde(rename="googleDemarcId")] + pub google_demarc_id: Option, +} + +impl Part for InterconnectCircuitInfo {} + + +/// Contains a list of zone resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list zones](struct.ZoneListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Zone resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ZoneList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpProxiesScopedList { + /// Informational warning which replaces the list of backend services when the list is empty. + pub warning: Option, + /// A list of TargetHttpProxies contained in this scope. + #[serde(rename="targetHttpProxies")] + pub target_http_proxies: Option>, +} + +impl Part for TargetHttpProxiesScopedList {} + + +/// Contains a list of TargetInstance resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list target instances](struct.TargetInstanceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstanceList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of TargetInstance resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetInstanceList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list available features ssl policies](struct.SslPolicyListAvailableFeatureCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslPoliciesListAvailableFeaturesResponse { + /// no description provided + pub features: Option>, +} + +impl ResponseResult for SslPoliciesListAvailableFeaturesResponse {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VmEndpointNatMappingsListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for VmEndpointNatMappingsListWarningData {} +impl Part for VmEndpointNatMappingsListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set min cpu platform instances](struct.InstanceSetMinCpuPlatformCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesSetMinCpuPlatformRequest { + /// Minimum cpu/platform this instance should be started at. + #[serde(rename="minCpuPlatform")] + pub min_cpu_platform: Option, +} + +impl RequestValue for InstancesSetMinCpuPlatformRequest {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTypeAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NodeTypeAggregatedListWarning {} +impl Part for NodeTypeAggregatedListWarning {} + + +/// Contains a list of node types. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list node types](struct.NodeTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTypeList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource.Always compute#nodeTypeList for lists of node types. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of NodeType resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for NodeTypeList {} + + +/// Informational warning which replaces the list of reservations when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ReservationsScopedListWarning {} +impl Part for ReservationsScopedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstancesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetInstancesScopedListWarningData {} +impl Part for TargetInstancesScopedListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypeAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for DiskTypeAggregatedListWarningData {} +impl Part for DiskTypeAggregatedListWarningData {} + + +/// Time window specified for hourly operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicyHourlyCycle { + /// [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + pub duration: Option, + /// Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle. + #[serde(rename="hoursInCycle")] + pub hours_in_cycle: Option, + /// Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for ResourcePolicyHourlyCycle {} + + +/// An informational warning that appears when the list of addresses is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworksScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for SubnetworksScopedListWarning {} +impl Part for SubnetworksScopedListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for VpnGatewayListWarning {} +impl Part for VpnGatewayListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for UrlMapListWarning {} +impl Part for UrlMapListWarning {} + + +/// +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerAutoHealingPolicy { + /// The URL for the health check that signals autohealing. + #[serde(rename="healthCheck")] + pub health_check: Option, + /// The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600]. + #[serde(rename="initialDelaySec")] + pub initial_delay_sec: Option, +} + +impl Part for InstanceGroupManagerAutoHealingPolicy {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePoliciesScopedList { + /// A list of resourcePolicies contained in this scope. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, + /// Informational warning which replaces the list of resourcePolicies when the list is empty. + pub warning: Option, +} + +impl Part for ResourcePoliciesScopedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [validate url maps](struct.UrlMapValidateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsValidateRequest { + /// Content of the UrlMap to be validated. + pub resource: Option, +} + +impl RequestValue for UrlMapsValidateRequest {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InterconnectAttachmentAggregatedListWarning {} +impl Part for InterconnectAttachmentAggregatedListWarning {} + + +/// InstanceGroupManagers.createInstances +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create instances instance group managers](struct.InstanceGroupManagerCreateInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersCreateInstancesRequest { + /// [Required] List of specifications of per-instance configs. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupManagersCreateInstancesRequest {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for VpnGatewayAggregatedListWarningData {} +impl Part for VpnGatewayAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list target https proxies](struct.TargetHttpsProxyAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpsProxyAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#targetHttpsProxyAggregatedList for lists of Target HTTP Proxies. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of TargetHttpsProxiesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetHttpsProxyAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HTTP2HealthCheck { + /// The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. + pub port: Option, + /// The value of the host header in the HTTP/2 health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. + pub host: Option, + /// The request path of the HTTP/2 health check request. The default value is /. + #[serde(rename="requestPath")] + pub request_path: Option, + /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + #[serde(rename="portName")] + pub port_name: Option, + /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, + /// Specifies how port is selected for health checking, can be one of following values: + /// USE_FIXED_PORT: The port number in port is used for health checking. + /// USE_NAMED_PORT: The portName is used for health checking. + /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + /// + /// + /// If not specified, HTTP2 health check follows behavior specified in port and portName fields. + #[serde(rename="portSpecification")] + pub port_specification: Option, + /// The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. + pub response: Option, +} + +impl Part for HTTP2HealthCheck {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersSetInstanceTemplateRequest { + /// The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. + #[serde(rename="instanceTemplate")] + pub instance_template: Option, +} + +impl RequestValue for InstanceGroupManagersSetInstanceTemplateRequest {} + + +/// matchRule criteria for request header matches. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpHeaderMatch { + /// The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript + /// For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. + /// Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + /// Note that regexMatch only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + #[serde(rename="regexMatch")] + pub regex_match: Option, + /// If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. + /// The default setting is false. + #[serde(rename="invertMatch")] + pub invert_match: Option, + /// The name of the HTTP header to match. + /// For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". + /// For matching a request's method, use the headerName ":method". + #[serde(rename="headerName")] + pub header_name: Option, + /// The value of the header must start with the contents of prefixMatch. + /// Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + #[serde(rename="prefixMatch")] + pub prefix_match: Option, + /// The value of the header must end with the contents of suffixMatch. + /// Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + #[serde(rename="suffixMatch")] + pub suffix_match: Option, + /// The value should exactly match contents of exactMatch. + /// Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + #[serde(rename="exactMatch")] + pub exact_match: Option, + /// A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. + /// Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + #[serde(rename="presentMatch")] + pub present_match: Option, + /// The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. + /// For example for a range [-5, 0] + /// - -3 will match. + /// - 0 will not match. + /// - 0.25 will not match. + /// - -3someString will not match. + /// Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + /// Note that rangeMatch is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. + #[serde(rename="rangeMatch")] + pub range_match: Option, +} + +impl Part for HttpHeaderMatch {} + + +/// Represents a Cloud Storage Bucket resource. +/// +/// This Cloud Storage bucket resource is referenced by a URL map of a load balancer. For more information, read Backend Buckets. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete backend buckets](struct.BackendBucketDeleteCall.html) (none) +/// * [get backend buckets](struct.BackendBucketGetCall.html) (response) +/// * [delete signed url key backend buckets](struct.BackendBucketDeleteSignedUrlKeyCall.html) (none) +/// * [add signed url key backend buckets](struct.BackendBucketAddSignedUrlKeyCall.html) (none) +/// * [update backend buckets](struct.BackendBucketUpdateCall.html) (request) +/// * [insert backend buckets](struct.BackendBucketInsertCall.html) (request) +/// * [patch backend buckets](struct.BackendBucketPatchCall.html) (request) +/// * [list backend buckets](struct.BackendBucketListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendBucket { + /// Type of the resource. + pub kind: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// Cloud CDN configuration for this BackendBucket. + #[serde(rename="cdnPolicy")] + pub cdn_policy: Option, + /// If true, enable Cloud CDN for this BackendBucket. + #[serde(rename="enableCdn")] + pub enable_cdn: Option, + /// Cloud Storage bucket name. + #[serde(rename="bucketName")] + pub bucket_name: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for BackendBucket {} +impl Resource for BackendBucket {} +impl ResponseResult for BackendBucket {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpProxyListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetHttpProxyListWarningData {} +impl Part for TargetHttpProxyListWarningData {} + + +/// Represents an Instance Group resource. +/// +/// Instance Groups can be used to configure a target for load balancing. +/// +/// Instance groups can either be managed or unmanaged. +/// +/// To create managed instance groups, use the instanceGroupManager or regionInstanceGroupManager resource instead. +/// +/// Use zonal unmanaged instance groups if you need to apply load balancing to groups of heterogeneous instances or if you need to manage the instances yourself. You cannot create regional unmanaged instance groups. +/// +/// For more information, read Instance groups. +/// +/// (== resource_for {$api_version}.instanceGroups ==) (== resource_for {$api_version}.regionInstanceGroups ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (none) +/// * [insert instance groups](struct.InstanceGroupInsertCall.html) (request) +/// * [delete instance groups](struct.InstanceGroupDeleteCall.html) (none) +/// * [get instance groups](struct.InstanceGroupGetCall.html) (response) +/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (none) +/// * [set named ports instance groups](struct.InstanceGroupSetNamedPortCall.html) (none) +/// * [list instance groups](struct.InstanceGroupListCall.html) (none) +/// * [get region instance groups](struct.RegionInstanceGroupGetCall.html) (response) +/// * [aggregated list instance groups](struct.InstanceGroupAggregatedListCall.html) (none) +/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroup { + /// [Output Only] The resource type, which is always compute#instanceGroup for instance groups. + pub kind: Option, + /// The URL of the network to which all instances in the instance group belong. + pub network: Option, + /// [Output Only] The URL of the zone where the instance group is located (for zonal resources). + pub zone: Option, + /// [Output Only] The URL of the region where the instance group is located (for regional resources). + pub region: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. + pub name: Option, + /// [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. + pub fingerprint: Option, + /// [Output Only] The URL of the subnetwork to which all instances in the instance group belong. + pub subnetwork: Option, + /// Assigns a name to a port number. For example: {name: "http", port: 80} + /// + /// This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "http", port: 80},{name: "http", port: 8080}] + /// + /// Named ports apply to all instances in this instance group. + #[serde(rename="namedPorts")] + pub named_ports: Option>, + /// [Output Only] The creation timestamp for this instance group in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] A unique identifier for this instance group, generated by the server. + pub id: Option, + /// [Output Only] The URL for this instance group. The server generates this URL. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] The total number of instances in the instance group. + pub size: Option, +} + +impl RequestValue for InstanceGroup {} +impl Resource for InstanceGroup {} +impl ResponseResult for InstanceGroup {} + + +/// Represents a Target Instance resource. +/// +/// You can use a target instance to handle traffic for one or more forwarding rules, which is ideal for forwarding protocol traffic that is managed by a single source. For example, ESP, AH, TCP, or UDP. For more information, read Target instances. (== resource_for {$api_version}.targetInstances ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (none) +/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (none) +/// * [get target instances](struct.TargetInstanceGetCall.html) (response) +/// * [list target instances](struct.TargetInstanceListCall.html) (none) +/// * [insert target instances](struct.TargetInstanceInsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstance { + /// NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported. + #[serde(rename="natPolicy")] + pub nat_policy: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// [Output Only] URL of the zone where the target instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub zone: Option, + /// [Output Only] The type of the resource. Always compute#targetInstance for target instances. + pub kind: Option, + /// A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: + /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + /// - projects/project/zones/zone/instances/instance + /// - zones/zone/instances/instance + pub instance: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for TargetInstance {} +impl Resource for TargetInstance {} +impl ResponseResult for TargetInstance {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworksScopedList { + /// A list of subnetworks contained in this scope. + pub subnetworks: Option>, + /// An informational warning that appears when the list of addresses is empty. + pub warning: Option, +} + +impl Part for SubnetworksScopedList {} + + +/// Contains a list of nodeGroups. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list node groups](struct.NodeGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of NodeGroup resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for NodeGroupList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstanceListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetInstanceListWarning {} +impl Part for TargetInstanceListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersAbandonInstancesRequest { + /// The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupManagersAbandonInstancesRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersDeleteInstancesRequest { + /// The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupManagersDeleteInstancesRequest {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InterconnectAttachmentListWarningData {} +impl Part for InterconnectAttachmentListWarningData {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for UrlMapsAggregatedListWarning {} +impl Part for UrlMapsAggregatedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslPolicyWarningsData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for SslPolicyWarningsData {} +impl Part for SslPolicyWarningsData {} + + +/// Contains a list of autoscalers. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region autoscalers](struct.RegionAutoscalerListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionAutoscalerList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Autoscaler resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RegionAutoscalerList {} + + +/// Authorization-related information used by Cloud Audit Logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthorizationLoggingOptions { + /// The type of the permission that was checked. + #[serde(rename="permissionType")] + pub permission_type: Option, +} + +impl Part for AuthorizationLoggingOptions {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringForwardingRuleInfo { + /// Resource URL to the forwarding rule representing the ILB configured as destination of the mirrored traffic. + pub url: Option, + /// [Output Only] Unique identifier for the forwarding rule; defined by the server. + #[serde(rename="canonicalUrl")] + pub canonical_url: Option, +} + +impl Part for PacketMirroringForwardingRuleInfo {} + + +/// [Output Only] The array of errors encountered while processing this operation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationErrorErrors { + /// [Output Only] An optional, human-readable error message. + pub message: Option, + /// [Output Only] The error type identifier for this error. + pub code: Option, + /// [Output Only] Indicates the field in the request that caused the error. This property is optional. + pub location: Option, +} + +impl NestedType for OperationErrorErrors {} +impl Part for OperationErrorErrors {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list network endpoint groups](struct.NetworkEndpointGroupAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of NetworkEndpointGroupsScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for NetworkEndpointGroupAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [attach network endpoints network endpoint groups](struct.NetworkEndpointGroupAttachNetworkEndpointCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupsAttachEndpointsRequest { + /// The list of network endpoints to be attached. + #[serde(rename="networkEndpoints")] + pub network_endpoints: Option>, +} + +impl RequestValue for NetworkEndpointGroupsAttachEndpointsRequest {} + + +/// Represents a Target TCP Proxy resource. +/// +/// A target TCP proxy is a component of a TCP Proxy load balancer. Global forwarding rules reference target TCP proxy, and the target proxy then references an external backend service. For more information, read TCP Proxy Load Balancing overview. (== resource_for {$api_version}.targetTcpProxies ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert target tcp proxies](struct.TargetTcpProxyInsertCall.html) (request) +/// * [get target tcp proxies](struct.TargetTcpProxyGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetTcpProxy { + /// [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// URL to the BackendService resource. + pub service: Option, + /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for TargetTcpProxy {} +impl ResponseResult for TargetTcpProxy {} + + +/// A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicySnapshotSchedulePolicy { + /// Properties with which snapshots are created such as labels, encryption keys. + #[serde(rename="snapshotProperties")] + pub snapshot_properties: Option, + /// Retention policy applied to snapshots created by this resource policy. + #[serde(rename="retentionPolicy")] + pub retention_policy: Option, + /// A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy. + pub schedule: Option, +} + +impl Part for ResourcePolicySnapshotSchedulePolicy {} + + +/// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. +/// +/// +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. +/// +/// Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. +/// +/// **JSON example:** +/// +/// { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } +/// +/// **YAML example:** +/// +/// bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3 +/// +/// For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set iam policy disks](struct.DiskSetIamPolicyCall.html) (response) +/// * [get iam policy subnetworks](struct.SubnetworkGetIamPolicyCall.html) (response) +/// * [set iam policy images](struct.ImageSetIamPolicyCall.html) (response) +/// * [get iam policy reservations](struct.ReservationGetIamPolicyCall.html) (response) +/// * [get iam policy instance templates](struct.InstanceTemplateGetIamPolicyCall.html) (response) +/// * [get iam policy snapshots](struct.SnapshotGetIamPolicyCall.html) (response) +/// * [set iam policy subnetworks](struct.SubnetworkSetIamPolicyCall.html) (response) +/// * [set iam policy node templates](struct.NodeTemplateSetIamPolicyCall.html) (response) +/// * [get iam policy resource policies](struct.ResourcePolicyGetIamPolicyCall.html) (response) +/// * [set iam policy instances](struct.InstanceSetIamPolicyCall.html) (response) +/// * [get iam policy instances](struct.InstanceGetIamPolicyCall.html) (response) +/// * [set iam policy snapshots](struct.SnapshotSetIamPolicyCall.html) (response) +/// * [get iam policy node groups](struct.NodeGroupGetIamPolicyCall.html) (response) +/// * [set iam policy instance templates](struct.InstanceTemplateSetIamPolicyCall.html) (response) +/// * [get iam policy licenses](struct.LicenseGetIamPolicyCall.html) (response) +/// * [set iam policy resource policies](struct.ResourcePolicySetIamPolicyCall.html) (response) +/// * [set iam policy licenses](struct.LicenseSetIamPolicyCall.html) (response) +/// * [get iam policy images](struct.ImageGetIamPolicyCall.html) (response) +/// * [set iam policy reservations](struct.ReservationSetIamPolicyCall.html) (response) +/// * [get iam policy disks](struct.DiskGetIamPolicyCall.html) (response) +/// * [set iam policy node groups](struct.NodeGroupSetIamPolicyCall.html) (response) +/// * [get iam policy node templates](struct.NodeTemplateGetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. + /// + /// Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. + pub version: Option, + /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + pub etag: Option, + /// If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied. + pub rules: Option>, + /// Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member. + pub bindings: Option>, + /// + #[serde(rename="iamOwned")] + pub iam_owned: Option, +} + +impl ResponseResult for Policy {} + + +/// [Output Only] An informational warning that replaces the list of instance groups when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstanceGroupsScopedListWarning {} +impl Part for InstanceGroupsScopedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpsProxyAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetHttpsProxyAggregatedListWarningData {} +impl Part for TargetHttpsProxyAggregatedListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetSslProxyListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetSslProxyListWarningData {} +impl Part for TargetSslProxyListWarningData {} + + +/// Represents a Target Pool resource. +/// +/// Target pools are used for network TCP/UDP load balancing. A target pool references member instances, an associated legacy HttpHealthCheck resource, and, optionally, a backup target pool. For more information, read Using target pools. (== resource_for {$api_version}.targetPools ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (none) +/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (none) +/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (none) +/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (none) +/// * [delete target pools](struct.TargetPoolDeleteCall.html) (none) +/// * [insert target pools](struct.TargetPoolInsertCall.html) (request) +/// * [aggregated list target pools](struct.TargetPoolAggregatedListCall.html) (none) +/// * [list target pools](struct.TargetPoolListCall.html) (none) +/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (none) +/// * [get target pools](struct.TargetPoolGetCall.html) (response) +/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPool { + /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. + /// + /// If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. + /// + /// In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + #[serde(rename="failoverRatio")] + pub failover_ratio: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// [Output Only] URL of the region where the target pool resides. + pub region: Option, + /// [Output Only] Type of the resource. Always compute#targetPool for target pools. + pub kind: Option, + /// Session affinity option, must be one of the following values: + /// NONE: Connections from the same client IP may go to any instance in the pool. + /// CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. + /// CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. + #[serde(rename="sessionAffinity")] + pub session_affinity: Option, + /// A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. + pub instances: Option>, + /// This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. + /// + /// backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. + /// + /// In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + #[serde(rename="backupPool")] + pub backup_pool: Option, + /// The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. An empty list means all member instances will be considered healthy at all times. Only HttpHealthChecks are supported. Only one health check may be specified. + #[serde(rename="healthChecks")] + pub health_checks: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for TargetPool {} +impl Resource for TargetPool {} +impl ResponseResult for TargetPool {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetPoolsScopedListWarningData {} +impl Part for TargetPoolsScopedListWarningData {} + + +/// Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete reservations](struct.ReservationDeleteCall.html) (none) +/// * [resize reservations](struct.ReservationResizeCall.html) (none) +/// * [insert reservations](struct.ReservationInsertCall.html) (request) +/// * [test iam permissions reservations](struct.ReservationTestIamPermissionCall.html) (none) +/// * [set iam policy reservations](struct.ReservationSetIamPolicyCall.html) (none) +/// * [list reservations](struct.ReservationListCall.html) (none) +/// * [get iam policy reservations](struct.ReservationGetIamPolicyCall.html) (none) +/// * [aggregated list reservations](struct.ReservationAggregatedListCall.html) (none) +/// * [get reservations](struct.ReservationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Reservation { + /// [Output Only] The status of the reservation. + pub status: Option, + /// [Output Only] Type of the resource. Always compute#reservations for reservations. + pub kind: Option, + /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. + #[serde(rename="specificReservationRequired")] + pub specific_reservation_required: Option, + /// [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. + pub commitment: Option, + /// Reservation for instances with specific machine shapes. + #[serde(rename="specificReservation")] + pub specific_reservation: Option, + /// Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. + pub zone: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined fully-qualified URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, +} + +impl RequestValue for Reservation {} +impl Resource for Reservation {} +impl ResponseResult for Reservation {} + + +/// [Output Only] An informational warning that appears when the machine types list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for MachineTypesScopedListWarning {} +impl Part for MachineTypesScopedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplateAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeTemplateAggregatedListWarningData {} +impl Part for NodeTemplateAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslCertificatesScopedList { + /// Informational warning which replaces the list of backend services when the list is empty. + pub warning: Option, + /// List of SslCertificates contained in this scope. + #[serde(rename="sslCertificates")] + pub ssl_certificates: Option>, +} + +impl Part for SslCertificatesScopedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for DiskTypesScopedListWarningData {} +impl Part for DiskTypesScopedListWarningData {} + + +/// Represents a License resource. +/// +/// A License represents billing and aggregate usage data for public and marketplace images. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. (== resource_for {$api_version}.licenses ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get iam policy licenses](struct.LicenseGetIamPolicyCall.html) (none) +/// * [get licenses](struct.LicenseGetCall.html) (response) +/// * [set iam policy licenses](struct.LicenseSetIamPolicyCall.html) (none) +/// * [list licenses](struct.LicenseListCall.html) (none) +/// * [insert licenses](struct.LicenseInsertCall.html) (request) +/// * [delete licenses](struct.LicenseDeleteCall.html) (none) +/// * [test iam permissions licenses](struct.LicenseTestIamPermissionCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct License { + /// [Output Only] Type of resource. Always compute#license for licenses. + pub kind: Option, + /// An optional textual description of the resource; provided by the client when the resource is created. + pub description: Option, + /// [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. + #[serde(rename="chargesUseFee")] + pub charges_use_fee: Option, + /// [Output Only] The unique code used to attach this license to images, snapshots, and disks. + #[serde(rename="licenseCode")] + pub license_code: Option, + /// If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. + pub transferable: Option, + /// no description provided + #[serde(rename="resourceRequirements")] + pub resource_requirements: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. The name must be 1-63 characters long and comply with RFC1035. + pub name: Option, +} + +impl RequestValue for License {} +impl Resource for License {} +impl ResponseResult for License {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplateNodeTypeFlexibility { + /// no description provided + pub cpus: Option, + /// no description provided + #[serde(rename="localSsd")] + pub local_ssd: Option, + /// no description provided + pub memory: Option, +} + +impl Part for NodeTemplateNodeTypeFlexibility {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouteWarningsData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for RouteWarningsData {} +impl Part for RouteWarningsData {} + + +/// A network interface resource attached to an instance. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update network interface instances](struct.InstanceUpdateNetworkInterfaceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkInterface { + /// [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. + pub kind: Option, + /// An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. + #[serde(rename="aliasIpRanges")] + pub alias_ip_ranges: Option>, + /// URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. + /// + /// If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + /// - https://www.googleapis.com/compute/v1/projects/project/global/networks/network + /// - projects/project/global/networks/network + /// - global/networks/default + pub network: Option, + /// An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access. + #[serde(rename="accessConfigs")] + pub access_configs: Option>, + /// An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system. + #[serde(rename="networkIP")] + pub network_ip: Option, + /// Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface, otherwise the request will fail with error 412 conditionNotMet. + pub fingerprint: Option, + /// The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: + /// - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork + /// - regions/region/subnetworks/subnetwork + pub subnetwork: Option, + /// [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. + pub name: Option, +} + +impl RequestValue for NetworkInterface {} + + +/// A VPN gateway interface. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayVpnGatewayInterface { + /// The external IP address for this VPN gateway interface. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// The numeric ID of this VPN gateway interface. + pub id: Option, +} + +impl Part for VpnGatewayVpnGatewayInterface {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupNode { + /// no description provided + pub status: Option, + /// Binding properties for the physical server. + #[serde(rename="serverBinding")] + pub server_binding: Option, + /// The type of this node. + #[serde(rename="nodeType")] + pub node_type: Option, + /// The name of the node. + pub name: Option, + /// Instances scheduled on this node. + pub instances: Option>, + /// Server ID associated with this node. + #[serde(rename="serverId")] + pub server_id: Option, +} + +impl Part for NodeGroupNode {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list region commitments](struct.RegionCommitmentAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitmentAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of CommitmentsScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for CommitmentAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set labels snapshots](struct.SnapshotSetLabelCall.html) (request) +/// * [set labels external vpn gateways](struct.ExternalVpnGatewaySetLabelCall.html) (request) +/// * [set labels images](struct.ImageSetLabelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GlobalSetLabelsRequest { + /// The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// A list of labels to apply for this resource. Each label key & value must comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). + pub labels: Option>, +} + +impl RequestValue for GlobalSetLabelsRequest {} + + +/// This reservation type allows to pre allocate specific instance configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AllocationSpecificSKUReservation { + /// Specifies the number of resources that are allocated. + pub count: Option, + /// The instance properties for the reservation. + #[serde(rename="instanceProperties")] + pub instance_properties: Option, + /// [Output Only] Indicates how many instances are in use. + #[serde(rename="inUseCount")] + pub in_use_count: Option, +} + +impl Part for AllocationSpecificSKUReservation {} + + +/// Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add signed url key backend services](struct.BackendServiceAddSignedUrlKeyCall.html) (request) +/// * [add signed url key backend buckets](struct.BackendBucketAddSignedUrlKeyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SignedUrlKey { + /// Name of the key. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + #[serde(rename="keyName")] + pub key_name: Option, + /// 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. + #[serde(rename="keyValue")] + pub key_value: Option, +} + +impl RequestValue for SignedUrlKey {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePoliciesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ResourcePoliciesScopedListWarningData {} +impl Part for ResourcePoliciesScopedListWarningData {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypeAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for MachineTypeAggregatedListWarning {} +impl Part for MachineTypeAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelsScopedList { + /// A list of VPN tunnels contained in this scope. + #[serde(rename="vpnTunnels")] + pub vpn_tunnels: Option>, + /// Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, +} + +impl Part for VpnTunnelsScopedList {} + + +/// Represents an Interconnect resource. +/// +/// An Interconnect resource is a dedicated connection between the GCP network and your on-premises network. For more information, read the Dedicated Interconnect Overview. (== resource_for {$api_version}.interconnects ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get diagnostics interconnects](struct.InterconnectGetDiagnosticCall.html) (none) +/// * [get interconnects](struct.InterconnectGetCall.html) (response) +/// * [delete interconnects](struct.InterconnectDeleteCall.html) (none) +/// * [insert interconnects](struct.InterconnectInsertCall.html) (request) +/// * [patch interconnects](struct.InterconnectPatchCall.html) (request) +/// * [list interconnects](struct.InterconnectListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Interconnect { + /// Type of link requested, which can take one of the following values: + /// - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics + /// - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. + #[serde(rename="linkType")] + pub link_type: Option, + /// Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect. + #[serde(rename="customerName")] + pub customer_name: Option, + /// [Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG. + #[serde(rename="circuitInfos")] + pub circuit_infos: Option>, + /// Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Stackdriver logs alerting and Cloud Notifications. + #[serde(rename="nocContactEmail")] + pub noc_contact_email: Option, + /// [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: + /// - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. + /// - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. + /// - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + #[serde(rename="operationalStatus")] + pub operational_status: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// Type of interconnect, which can take one of the following values: + /// - PARTNER: A partner-managed interconnection shared between customers though a partner. + /// - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. + #[serde(rename="interconnectType")] + pub interconnect_type: Option, + /// [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. + #[serde(rename="interconnectAttachments")] + pub interconnect_attachments: Option>, + /// [Output Only] Type of the resource. Always compute#interconnect for interconnects. + pub kind: Option, + /// [Output Only] Number of links actually provisioned in this interconnect. + #[serde(rename="provisionedLinkCount")] + pub provisioned_link_count: Option, + /// [Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests. + #[serde(rename="googleIpAddress")] + pub google_ip_address: Option, + /// [Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. + #[serde(rename="googleReferenceId")] + pub google_reference_id: Option, + /// [Output Only] A list of outages expected for this Interconnect. + #[serde(rename="expectedOutages")] + pub expected_outages: Option>, + /// [Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests. + #[serde(rename="peerIpAddress")] + pub peer_ip_address: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true. + #[serde(rename="adminEnabled")] + pub admin_enabled: Option, + /// [Output Only] The current state of Interconnect functionality, which can take one of the following values: + /// - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. + /// - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. + /// - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + pub state: Option, + /// URL of the InterconnectLocation object that represents where this connection is to be provisioned. + pub location: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Target number of physical links in the link bundle, as requested by the customer. + #[serde(rename="requestedLinkCount")] + pub requested_link_count: Option, +} + +impl RequestValue for Interconnect {} +impl Resource for Interconnect {} +impl ResponseResult for Interconnect {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRulesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ForwardingRulesScopedListWarningData {} +impl Part for ForwardingRulesScopedListWarningData {} + + +/// Informational warning which replaces the list of resourcePolicies when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePoliciesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ResourcePoliciesScopedListWarning {} +impl Part for ResourcePoliciesScopedListWarning {} + + +/// Initial State for shielded instance, these are public keys which are safe to store in public +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InitialStateConfig { + /// The forbidden key database (dbx). + pub dbxs: Option>, + /// The Key Database (db). + pub dbs: Option>, + /// The Key Exchange Key (KEK). + pub keks: Option>, + /// The Platform Key (PK). + pub pk: Option, +} + +impl Part for InitialStateConfig {} + + +/// A specification of the parameters to use when creating the instance template from a source instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SourceInstanceParams { + /// Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, new custom images will be created from each disk. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. + #[serde(rename="diskConfigs")] + pub disk_configs: Option>, +} + +impl Part for SourceInstanceParams {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for PacketMirroringAggregatedListWarning {} +impl Part for PacketMirroringAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsScopedList { + /// A list of UrlMaps contained in this scope. + #[serde(rename="urlMaps")] + pub url_maps: Option>, + /// Informational warning which replaces the list of backend services when the list is empty. + pub warning: Option, +} + +impl Part for UrlMapsScopedList {} + + +/// A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a flag indicating whether Google Compute Engine should automatically create routes for the peering. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkPeering { + /// The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + pub network: Option, + /// This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + #[serde(rename="autoCreateRoutes")] + pub auto_create_routes: Option, + /// [Output Only] Details about the current state of the peering. + #[serde(rename="stateDetails")] + pub state_details: Option, + /// [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. + pub state: Option, + /// Whether to export the custom routes to peer network. + #[serde(rename="exportCustomRoutes")] + pub export_custom_routes: Option, + /// Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + #[serde(rename="exchangeSubnetRoutes")] + pub exchange_subnet_routes: Option, + /// Whether to import the custom routes from peer network. + #[serde(rename="importCustomRoutes")] + pub import_custom_routes: Option, + /// Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl Part for NetworkPeering {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for BackendServiceAggregatedListWarningData {} +impl Part for BackendServiceAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instances region instance groups](struct.RegionInstanceGroupListInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupsListInstancesRequest { + /// Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances. + #[serde(rename="portName")] + pub port_name: Option, + /// Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. + #[serde(rename="instanceState")] + pub instance_state: Option, +} + +impl RequestValue for RegionInstanceGroupsListInstancesRequest {} + + +/// A schedule for disks where the schedueled operations are performed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicySnapshotSchedulePolicySchedule { + /// no description provided + #[serde(rename="weeklySchedule")] + pub weekly_schedule: Option, + /// no description provided + #[serde(rename="hourlySchedule")] + pub hourly_schedule: Option, + /// no description provided + #[serde(rename="dailySchedule")] + pub daily_schedule: Option, +} + +impl Part for ResourcePolicySnapshotSchedulePolicySchedule {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplateListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NodeTemplateListWarning {} +impl Part for NodeTemplateListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetPoolListWarning {} +impl Part for TargetPoolListWarning {} + + +/// Information about any potential InterconnectAttachments between an Interconnect at a specific InterconnectLocation, and a specific Cloud Region. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectLocationRegionInfo { + /// Identifies the network presence of this location. + #[serde(rename="locationPresence")] + pub location_presence: Option, + /// URL for the region of this location. + pub region: Option, + /// Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region. + #[serde(rename="expectedRttMs")] + pub expected_rtt_ms: Option, +} + +impl Part for InterconnectLocationRegionInfo {} + + +/// Contains a list of ForwardingRule resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list global forwarding rules](struct.GlobalForwardingRuleListCall.html) (response) +/// * [list forwarding rules](struct.ForwardingRuleListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRuleList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of ForwardingRule resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ForwardingRuleList {} + + +/// Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InterconnectAttachmentsScopedListWarning {} +impl Part for InterconnectAttachmentsScopedListWarning {} + + +/// Message for the expected URL mappings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapTest { + /// Path portion of the URL. + pub path: Option, + /// Host portion of the URL. + pub host: Option, + /// Description of this test case. + pub description: Option, + /// Expected BackendService resource the given URL should be mapped to. + pub service: Option, +} + +impl Part for UrlMapTest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instances region instance groups](struct.RegionInstanceGroupListInstanceCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupsListInstances { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The resource type. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InstanceWithNamedPorts resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RegionInstanceGroupsListInstances {} + + +/// Informational warning which replaces the list of backend services when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthChecksScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for HealthChecksScopedListWarning {} +impl Part for HealthChecksScopedListWarning {} + + +/// Response to the list request, and contains a list of externalVpnGateways. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list external vpn gateways](struct.ExternalVpnGatewayListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExternalVpnGatewayList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#externalVpnGatewayList for lists of externalVpnGateways. + pub kind: Option, + /// no description provided + pub etag: Option, + /// A list of ExternalVpnGateway resources. + pub items: Option>, + /// [Output Only] Informational warning message. + pub warning: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ExternalVpnGatewayList {} + + +/// The information about the HTTP Cookie on which the hash function is based for load balancing policies that use a consistent hash. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConsistentHashLoadBalancerSettingsHttpCookie { + /// Path to set for the cookie. + pub path: Option, + /// Name of the cookie. + pub name: Option, + /// Lifetime of the cookie. + pub ttl: Option, +} + +impl Part for ConsistentHashLoadBalancerSettingsHttpCookie {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpHealthCheckListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for HttpHealthCheckListWarningData {} +impl Part for HttpHealthCheckListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRulesScopedList { + /// A list of forwarding rules contained in this scope. + #[serde(rename="forwardingRules")] + pub forwarding_rules: Option>, + /// Informational warning which replaces the list of forwarding rules when the list is empty. + pub warning: Option, +} + +impl Part for ForwardingRulesScopedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplatesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeTemplatesScopedListWarningData {} +impl Part for NodeTemplatesScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list health checks](struct.HealthCheckAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthChecksAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of HealthChecksScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for HealthChecksAggregatedList {} + + +/// Represents a VPC Network resource. +/// +/// Networks connect resources to each other and to the internet. For more information, read Virtual Private Cloud (VPC) Network. (== resource_for {$api_version}.networks ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch networks](struct.NetworkPatchCall.html) (request) +/// * [list networks](struct.NetworkListCall.html) (none) +/// * [delete networks](struct.NetworkDeleteCall.html) (none) +/// * [update peering networks](struct.NetworkUpdatePeeringCall.html) (none) +/// * [get networks](struct.NetworkGetCall.html) (response) +/// * [insert networks](struct.NetworkInsertCall.html) (request) +/// * [switch to custom mode networks](struct.NetworkSwitchToCustomModeCall.html) (none) +/// * [add peering networks](struct.NetworkAddPeeringCall.html) (none) +/// * [list peering routes networks](struct.NetworkListPeeringRouteCall.html) (none) +/// * [remove peering networks](struct.NetworkRemovePeeringCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Network { + /// [Output Only] Type of the resource. Always compute#network for networks. + pub kind: Option, + /// An optional description of this resource. Provide this field when you create the resource. + pub description: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + pub name: Option, + /// [Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network. + pub subnetworks: Option>, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + #[serde(rename="IPv4Range")] + pub i_pv4_range: Option, + /// [Output Only] The gateway address for default routing out of the network, selected by GCP. + #[serde(rename="gatewayIPv4")] + pub gateway_i_pv4: Option, + /// The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. + #[serde(rename="routingConfig")] + pub routing_config: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// When set to true, the VPC network is created in "auto" mode. When set to false, the VPC network is created in "custom" mode. + /// + /// An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. + #[serde(rename="autoCreateSubnetworks")] + pub auto_create_subnetworks: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] A list of network peerings for the resource. + pub peerings: Option>, +} + +impl RequestValue for Network {} +impl Resource for Network {} +impl ResponseResult for Network {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct XpnHostListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for XpnHostListWarningData {} +impl Part for XpnHostListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UsableSubnetworksAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for UsableSubnetworksAggregatedListWarningData {} +impl Part for UsableSubnetworksAggregatedListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedInstanceInstanceHealth { + /// [Output Only] The URL for the health check that verifies whether the instance is healthy. + #[serde(rename="healthCheck")] + pub health_check: Option, + /// [Output Only] The current detailed instance health state. + #[serde(rename="detailedHealthState")] + pub detailed_health_state: Option, +} + +impl Part for ManagedInstanceInstanceHealth {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeGroupListWarningData {} +impl Part for NodeGroupListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsAddInstancesRequest { + /// The list of instances to add to the instance group. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupsAddInstancesRequest {} + + +/// Specifies settings for an HTTP redirect. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpRedirectAction { + /// The path that will be used in the redirect response instead of the one that was supplied in the request. + /// pathRedirect cannot be supplied together with prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect. + /// The value must be between 1 and 1024 characters. + #[serde(rename="pathRedirect")] + pub path_redirect: Option, + /// The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. + /// prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect. + /// The value must be between 1 and 1024 characters. + #[serde(rename="prefixRedirect")] + pub prefix_redirect: Option, + /// If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. + /// The default is set to false. + #[serde(rename="stripQuery")] + pub strip_query: Option, + /// The HTTP Status code to use for this RedirectAction. + /// Supported values are: + /// - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301. + /// - FOUND, which corresponds to 302. + /// - SEE_OTHER which corresponds to 303. + /// - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method will be retained. + /// - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. + #[serde(rename="redirectResponseCode")] + pub redirect_response_code: Option, + /// If set to true, the URL scheme in the redirected request is set to https. If set to false, the URL scheme of the redirected request will remain the same as that of the request. + /// This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. + /// The default is set to false. + #[serde(rename="httpsRedirect")] + pub https_redirect: Option, + /// The host that will be used in the redirect response instead of the one that was supplied in the request. + /// The value must be between 1 and 255 characters. + #[serde(rename="hostRedirect")] + pub host_redirect: Option, +} + +impl Part for HttpRedirectAction {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list instance group managers](struct.InstanceGroupManagerAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InstanceGroupManagersScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceGroupManagerAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list network endpoints network endpoint groups](struct.NetworkEndpointGroupListNetworkEndpointCall.html) (response) +/// * [list network endpoints global network endpoint groups](struct.GlobalNetworkEndpointGroupListNetworkEndpointCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupsListNetworkEndpoints { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of NetworkEndpointWithHealthStatus resources. + pub items: Option>, + /// [Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, +} + +impl ResponseResult for NetworkEndpointGroupsListNetworkEndpoints {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalerListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AutoscalerListWarningData {} +impl Part for AutoscalerListWarningData {} + + +/// Represents an Instance Template resource. +/// +/// You can use instance templates to create VM instances and managed instance groups. For more information, read Instance Templates. (== resource_for {$api_version}.instanceTemplates ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instance templates](struct.InstanceTemplateListCall.html) (none) +/// * [delete instance templates](struct.InstanceTemplateDeleteCall.html) (none) +/// * [insert instance templates](struct.InstanceTemplateInsertCall.html) (request) +/// * [get instance templates](struct.InstanceTemplateGetCall.html) (response) +/// * [test iam permissions instance templates](struct.InstanceTemplateTestIamPermissionCall.html) (none) +/// * [get iam policy instance templates](struct.InstanceTemplateGetIamPolicyCall.html) (none) +/// * [set iam policy instance templates](struct.InstanceTemplateSetIamPolicyCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceTemplate { + /// [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. + pub kind: Option, + /// The source instance params to use to create this instance template. + #[serde(rename="sourceInstanceParams")] + pub source_instance_params: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// The instance properties for this instance template. + pub properties: Option, + /// The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: + /// - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + /// - projects/project/zones/zone/instances/instance + #[serde(rename="sourceInstance")] + pub source_instance: Option, + /// [Output Only] The creation timestamp for this instance template in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] A unique identifier for this instance template. The server defines this identifier. + pub id: Option, + /// [Output Only] The URL for this instance template. The server defines this URL. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for InstanceTemplate {} +impl Resource for InstanceTemplate {} +impl ResponseResult for InstanceTemplate {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceManagedByIgmErrorManagedInstanceError { + /// [Output Only] Error message. + pub message: Option, + /// [Output Only] Error code. + pub code: Option, +} + +impl Part for InstanceManagedByIgmErrorManagedInstanceError {} + + +/// A list of instance templates. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instance templates](struct.InstanceTemplateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceTemplateList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InstanceTemplate resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceTemplateList {} + + +/// An instance-attached disk resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AttachedDisk { + /// Encrypts or decrypts a disk using a customer-supplied encryption key. + /// + /// If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. + /// + /// If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. + /// + /// If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. + /// + /// Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + #[serde(rename="diskEncryptionKey")] + pub disk_encryption_key: Option, + /// Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. + /// + /// If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. + #[serde(rename="deviceName")] + pub device_name: Option, + /// [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + pub kind: Option, + /// [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. + /// + /// This property is mutually exclusive with the source property; you can only define one or the other, but not both. + #[serde(rename="initializeParams")] + pub initialize_params: Option, + /// Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + #[serde(rename="autoDelete")] + pub auto_delete: Option, + /// [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. + pub index: Option, + /// Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + pub boot: Option, + /// [Output Only] shielded vm initial state stored on disk + #[serde(rename="shieldedInstanceInitialState")] + pub shielded_instance_initial_state: Option, + /// A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + #[serde(rename="guestOsFeatures")] + pub guest_os_features: Option>, + /// The size of the disk in GB. + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, + /// The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + pub mode: Option, + /// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + pub interface: Option, + /// [Output Only] Any valid publicly visible licenses. + pub licenses: Option>, + /// Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. + #[serde(rename="type")] + pub type_: Option, + /// Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. + /// + /// If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. + /// + /// Note that for InstanceTemplate, specify the disk name, not the URL for the disk. + pub source: Option, +} + +impl RequestValue for AttachedDisk {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [detach network endpoints global network endpoint groups](struct.GlobalNetworkEndpointGroupDetachNetworkEndpointCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GlobalNetworkEndpointGroupsDetachEndpointsRequest { + /// The list of network endpoints to be detached. + #[serde(rename="networkEndpoints")] + pub network_endpoints: Option>, +} + +impl RequestValue for GlobalNetworkEndpointGroupsDetachEndpointsRequest {} + + +/// Represents a Subnetwork resource. +/// +/// A subnetwork (also known as a subnet) is a logical partition of a Virtual Private Cloud network with one primary IP range and zero or more secondary IP ranges. For more information, read Virtual Private Cloud (VPC) Network. (== resource_for {$api_version}.subnetworks ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set private ip google access subnetworks](struct.SubnetworkSetPrivateIpGoogleAccesCall.html) (none) +/// * [expand ip cidr range subnetworks](struct.SubnetworkExpandIpCidrRangeCall.html) (none) +/// * [aggregated list subnetworks](struct.SubnetworkAggregatedListCall.html) (none) +/// * [list usable subnetworks](struct.SubnetworkListUsableCall.html) (none) +/// * [get iam policy subnetworks](struct.SubnetworkGetIamPolicyCall.html) (none) +/// * [insert subnetworks](struct.SubnetworkInsertCall.html) (request) +/// * [test iam permissions subnetworks](struct.SubnetworkTestIamPermissionCall.html) (none) +/// * [set iam policy subnetworks](struct.SubnetworkSetIamPolicyCall.html) (none) +/// * [get subnetworks](struct.SubnetworkGetCall.html) (response) +/// * [delete subnetworks](struct.SubnetworkDeleteCall.html) (none) +/// * [list subnetworks](struct.SubnetworkListCall.html) (none) +/// * [patch subnetworks](struct.SubnetworkPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Subnetwork { + /// An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. + pub description: Option, + /// An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request. + #[serde(rename="secondaryIpRanges")] + pub secondary_ip_ranges: Option>, + /// The purpose of the resource. This field can be either PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. If unspecified, the purpose defaults to PRIVATE_RFC_1918. + pub purpose: Option, + /// Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is to disable flow logging. + #[serde(rename="enableFlowLogs")] + pub enable_flow_logs: Option, + /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve a Subnetwork. + pub fingerprint: Option, + /// Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. + #[serde(rename="privateIpGoogleAccess")] + pub private_ip_google_access: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. + pub kind: Option, + /// The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time. + pub network: Option, + /// URL of the region where the Subnetwork resides. This field can be set only at resource creation time. + pub region: Option, + /// This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Stackdriver. + #[serde(rename="logConfig")] + pub log_config: Option, + /// [Output Only] The state of the subnetwork, which can be one of READY or DRAINING. A subnetwork that is READY is ready to be used. The state of DRAINING is only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY. + pub state: Option, + /// The role of subnetwork. Currently, this field is only used when purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + pub role: Option, + /// The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time. + #[serde(rename="ipCidrRange")] + pub ip_cidr_range: Option, + /// [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. + #[serde(rename="gatewayAddress")] + pub gateway_address: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Subnetwork {} +impl Resource for Subnetwork {} +impl ResponseResult for Subnetwork {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove resource policies instances](struct.InstanceRemoveResourcePolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesRemoveResourcePoliciesRequest { + /// Resource policies to be removed from this instance. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, +} + +impl RequestValue for InstancesRemoveResourcePoliciesRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTypesScopedList { + /// [Output Only] An informational warning that appears when the node types list is empty. + pub warning: Option, + /// [Output Only] A list of node types contained in this scope. + #[serde(rename="nodeTypes")] + pub node_types: Option>, +} + +impl Part for NodeTypesScopedList {} + + +/// Specifies the reservations that this instance can consume from. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationAffinity { + /// Corresponds to the label values of a reservation resource. + pub values: Option>, + /// Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. + #[serde(rename="consumeReservationType")] + pub consume_reservation_type: Option, + /// Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value. + pub key: Option, +} + +impl Part for ReservationAffinity {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list xpn hosts projects](struct.ProjectListXpnHostCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct XpnHostList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// [Output Only] A list of shared VPC host project URLs. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for XpnHostList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalerAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AutoscalerAggregatedListWarning {} +impl Part for AutoscalerAggregatedListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstanceGroupListWarning {} +impl Part for InstanceGroupListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringsScopedList { + /// Informational warning which replaces the list of packetMirrorings when the list is empty. + pub warning: Option, + /// A list of packetMirrorings contained in this scope. + #[serde(rename="packetMirrorings")] + pub packet_mirrorings: Option>, +} + +impl Part for PacketMirroringsScopedList {} + + +/// Contains a list of region resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list regions](struct.RegionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#regionList for lists of regions. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Region resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RegionList {} + + +/// Message containing information of one individual backend. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Backend { + /// The fully-qualified URL of an instance group or network endpoint group (NEG) resource. The type of backend that a backend service supports depends on the backend service's loadBalancingScheme. + /// + /// + /// - When the loadBalancingScheme for the backend service is EXTERNAL, INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED, the backend can be either an instance group or a NEG. The backends on the backend service must be either all instance groups or all NEGs. You cannot mix instance group and NEG backends on the same backend service. + /// + /// + /// - When the loadBalancingScheme for the backend service is INTERNAL, the backend must be an instance group in the same region as the backend service. NEGs are not supported. + /// + /// You must use the fully-qualified URL (starting with https://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported. + pub group: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// Defines the maximum average backend utilization of a backend VM in an instance group. The valid range is [0.0, 1.0]. This is an optional parameter if the backend's balancingMode is UTILIZATION. + /// + /// This parameter can be used in conjunction with maxRate, maxRatePerInstance, maxConnections (except for regional managed instance groups), or maxConnectionsPerInstance. + #[serde(rename="maxUtilization")] + pub max_utilization: Option, + /// This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService. + pub failover: Option, + /// Defines a target maximum number of simultaneous connections for an endpoint of a NEG. This is multiplied by the number of endpoints in the NEG to implicitly calculate a maximum number of target maximum simultaneous connections for the NEG. If the backend's balancingMode is CONNECTION, and the backend is attached to a backend service whose loadBalancingScheme is EXTERNAL, you must specify either this parameter, maxConnections, or maxConnectionsPerInstance. + /// + /// Not available if the backend's balancingMode is RATE. Internal TCP/UDP load balancing does not support setting maxConnectionsPerEndpoint even though its backends require a balancing mode of CONNECTION. + #[serde(rename="maxConnectionsPerEndpoint")] + pub max_connections_per_endpoint: Option, + /// A multiplier applied to the group's maximum servicing capacity (based on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the group will serve up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available Capacity. Valid range is [0.0,1.0]. + /// + /// This cannot be used for internal load balancing. + #[serde(rename="capacityScaler")] + pub capacity_scaler: Option, + /// Defines a target maximum number of simultaneous connections for a single VM in a backend instance group. This is multiplied by the number of instances in the instance group to implicitly calculate a target maximum number of simultaneous connections for the whole instance group. If the backend's balancingMode is UTILIZATION, this is an optional parameter. If the backend's balancingMode is CONNECTION, and backend is attached to a backend service whose loadBalancingScheme is EXTERNAL, you must specify either this parameter, maxConnections, or maxConnectionsPerEndpoint. + /// + /// Not available if the backend's balancingMode is RATE. Internal TCP/UDP load balancing does not support setting maxConnectionsPerInstance even though its backends require a balancing mode of CONNECTION. + #[serde(rename="maxConnectionsPerInstance")] + pub max_connections_per_instance: Option, + /// Defines a maximum target for requests per second (RPS) for an endpoint of a NEG. This is multiplied by the number of endpoints in the NEG to implicitly calculate a target maximum rate for the NEG. + /// + /// If the backend's balancingMode is RATE, you must specify either this parameter, maxRate (except for regional managed instance groups), or maxRatePerInstance. + /// + /// Not available if the backend's balancingMode is CONNECTION. + #[serde(rename="maxRatePerEndpoint")] + pub max_rate_per_endpoint: Option, + /// Defines a maximum target for requests per second (RPS) for a single VM in a backend instance group. This is multiplied by the number of instances in the instance group to implicitly calculate a target maximum rate for the whole instance group. + /// + /// If the backend's balancingMode is UTILIZATION, this is an optional parameter. If the backend's balancingMode is RATE, you must specify either this parameter, maxRate (except for regional managed instance groups), or maxRatePerEndpoint. + /// + /// Not available if the backend's balancingMode is CONNECTION. + #[serde(rename="maxRatePerInstance")] + pub max_rate_per_instance: Option, + /// Defines a maximum number of HTTP requests per second (RPS) that the backend can handle. Valid for network endpoint group and instance group backends (except for regional managed instance groups). Must not be defined if the backend is a managed instance group that uses autoscaling based on load balancing. + /// + /// If the backend's balancingMode is UTILIZATION, this is an optional parameter. If the backend's balancingMode is RATE, you must specify maxRate, maxRatePerInstance, or maxRatePerEndpoint. + /// + /// Not available if the backend's balancingMode is CONNECTION. + #[serde(rename="maxRate")] + pub max_rate: Option, + /// Defines a target maximum number of simultaneous connections that the backend can handle. Valid for network endpoint group and instance group backends (except for regional managed instance groups). If the backend's balancingMode is UTILIZATION, this is an optional parameter. If the backend's balancingMode is CONNECTION, and backend is attached to a backend service whose loadBalancingScheme is EXTERNAL, you must specify either this parameter, maxConnectionsPerInstance, or maxConnectionsPerEndpoint. + /// + /// Not available if the backend's balancingMode is RATE. If the loadBalancingScheme is INTERNAL, then maxConnections is not supported, even though the backend requires a balancing mode of CONNECTION. + #[serde(rename="maxConnections")] + pub max_connections: Option, + /// Specifies the balancing mode for the backend. + /// + /// When choosing a balancing mode, you need to consider the loadBalancingScheme, and protocol for the backend service, as well as the type of backend (instance group or NEG). + /// + /// + /// - If the load balancing mode is CONNECTION, then the load is spread based on how many concurrent connections the backend can handle. + /// You can use the CONNECTION balancing mode if the protocol for the backend service is SSL, TCP, or UDP. + /// + /// If the loadBalancingScheme for the backend service is EXTERNAL (SSL Proxy and TCP Proxy load balancers), you must also specify exactly one of the following parameters: maxConnections (except for regional managed instance groups), maxConnectionsPerInstance, or maxConnectionsPerEndpoint. + /// + /// If the loadBalancingScheme for the backend service is INTERNAL (internal TCP/UDP load balancers), you cannot specify any additional parameters. + /// + /// - If the load balancing mode is RATE, the load is spread based on the rate of HTTP requests per second (RPS). + /// You can use the RATE balancing mode if the protocol for the backend service is HTTP or HTTPS. You must specify exactly one of the following parameters: maxRate (except for regional managed instance groups), maxRatePerInstance, or maxRatePerEndpoint. + /// + /// - If the load balancing mode is UTILIZATION, the load is spread based on the backend utilization of instances in an instance group. + /// You can use the UTILIZATION balancing mode if the loadBalancingScheme of the backend service is EXTERNAL, INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED and the backends are instance groups. There are no restrictions on the backend service protocol. + #[serde(rename="balancingMode")] + pub balancing_mode: Option, +} + +impl Part for Backend {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthChecksScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for HealthChecksScopedListWarningData {} +impl Part for HealthChecksScopedListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterBgp { + /// User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + #[serde(rename="advertisedIpRanges")] + pub advertised_ip_ranges: Option>, + /// User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. + #[serde(rename="advertiseMode")] + pub advertise_mode: Option, + /// User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + #[serde(rename="advertisedGroups")] + pub advertised_groups: Option>, + /// Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. + pub asn: Option, +} + +impl Part for RouterBgp {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NetworkEndpointGroupAggregatedListWarning {} +impl Part for NetworkEndpointGroupAggregatedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImageListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ImageListWarningData {} +impl Part for ImageListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list disks](struct.DiskAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of DisksScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for DiskAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list global operations](struct.GlobalOperationAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than `maxResults`, use the `nextPageToken` as a value for the query parameter `pageToken` in the next list request. Subsequent list requests will have their own `nextPageToken` to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always `compute#operationAggregatedList` for aggregated lists of operations. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// [Output Only] A map of scoped operation lists. + pub items: Option>, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for OperationAggregatedList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for RouterAggregatedListWarning {} +impl Part for RouterAggregatedListWarning {} + + +/// Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterNat { + /// A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only. + #[serde(rename="drainNatIps")] + pub drain_nat_ips: Option>, + /// Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + #[serde(rename="udpIdleTimeoutSec")] + pub udp_idle_timeout_sec: Option, + /// A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. + #[serde(rename="natIps")] + pub nat_ips: Option>, + /// Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. + pub name: Option, + /// Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. + #[serde(rename="tcpTransitoryIdleTimeoutSec")] + pub tcp_transitory_idle_timeout_sec: Option, + /// A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. + pub subnetworks: Option>, + /// Specify the NatIpAllocateOption, which can take one of the following values: + /// - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. + /// - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. + #[serde(rename="natIpAllocateOption")] + pub nat_ip_allocate_option: Option, + /// Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + #[serde(rename="icmpIdleTimeoutSec")] + pub icmp_idle_timeout_sec: Option, + /// Specify the Nat option, which can take one of the following values: + /// - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. + /// - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. + /// - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region. + #[serde(rename="sourceSubnetworkIpRangesToNat")] + pub source_subnetwork_ip_ranges_to_nat: Option, + /// Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. + #[serde(rename="tcpEstablishedIdleTimeoutSec")] + pub tcp_established_idle_timeout_sec: Option, + /// Configure logging on this NAT. + #[serde(rename="logConfig")] + pub log_config: Option, + /// Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. + #[serde(rename="minPortsPerVm")] + pub min_ports_per_vm: Option, +} + +impl Part for RouterNat {} + + +/// Represents a PacketMirroring resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert packet mirrorings](struct.PacketMirroringInsertCall.html) (request) +/// * [get packet mirrorings](struct.PacketMirroringGetCall.html) (response) +/// * [list packet mirrorings](struct.PacketMirroringListCall.html) (none) +/// * [test iam permissions packet mirrorings](struct.PacketMirroringTestIamPermissionCall.html) (none) +/// * [aggregated list packet mirrorings](struct.PacketMirroringAggregatedListCall.html) (none) +/// * [delete packet mirrorings](struct.PacketMirroringDeleteCall.html) (none) +/// * [patch packet mirrorings](struct.PacketMirroringPatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroring { + /// Filter for mirrored traffic. If unspecified, all traffic is mirrored. + pub filter: Option, + /// [Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings. + pub kind: Option, + /// Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. + /// + /// The default is TRUE. + pub enable: Option, + /// The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true. + #[serde(rename="collectorIlb")] + pub collector_ilb: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored. + #[serde(rename="mirroredResources")] + pub mirrored_resources: Option, + /// [Output Only] URI of the region where the packetMirroring resides. + pub region: Option, + /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. + /// + /// Default value is 1000. Valid range is 0 through 65535. + pub priority: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network. + pub network: Option, +} + +impl RequestValue for PacketMirroring {} +impl Resource for PacketMirroring {} +impl ResponseResult for PacketMirroring {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add resource policies region disks](struct.RegionDiskAddResourcePolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionDisksAddResourcePoliciesRequest { + /// Resource policies to be added to this disk. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, +} + +impl RequestValue for RegionDisksAddResourcePoliciesRequest {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupsListNodesWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NodeGroupsListNodesWarning {} +impl Part for NodeGroupsListNodesWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for UrlMapsAggregatedListWarningData {} +impl Part for UrlMapsAggregatedListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorTypeListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AcceleratorTypeListWarningData {} +impl Part for AcceleratorTypeListWarningData {} + + /// There is no detailed description. /// /// # Activities @@ -14440,24 +14897,1162 @@ pub struct ReservationList { impl ResponseResult for ReservationList {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HTTPSHealthCheck { + /// The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. + pub port: Option, + /// The value of the host header in the HTTPS health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. + pub host: Option, + /// The request path of the HTTPS health check request. The default value is /. + #[serde(rename="requestPath")] + pub request_path: Option, + /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + #[serde(rename="portName")] + pub port_name: Option, + /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, + /// Specifies how port is selected for health checking, can be one of following values: + /// USE_FIXED_PORT: The port number in port is used for health checking. + /// USE_NAMED_PORT: The portName is used for health checking. + /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + /// + /// + /// If not specified, HTTPS health check follows behavior specified in port and portName fields. + #[serde(rename="portSpecification")] + pub port_specification: Option, + /// The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. + pub response: Option, +} + +impl Part for HTTPSHealthCheck {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpHealthCheckListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for HttpHealthCheckListWarning {} +impl Part for HttpHealthCheckListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupsListNetworkEndpointsWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NetworkEndpointGroupsListNetworkEndpointsWarning {} +impl Part for NetworkEndpointGroupsListNetworkEndpointsWarning {} + + +/// Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicyRuleMatcher { + /// User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. + pub expr: Option, + /// The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + pub config: Option, + /// Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. + #[serde(rename="versionedExpr")] + pub versioned_expr: Option, +} + +impl Part for SecurityPolicyRuleMatcher {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicyRuleMatcherConfig { + /// CIDR IP address range. + #[serde(rename="srcIpRanges")] + pub src_ip_ranges: Option>, +} + +impl Part for SecurityPolicyRuleMatcherConfig {} + + +/// Contains a list of InstanceGroup resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region instance groups](struct.RegionInstanceGroupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The resource type. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InstanceGroup resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RegionInstanceGroupList {} + + /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectListWarningData { +pub struct InterconnectLocationListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for InterconnectListWarningData {} -impl Part for InterconnectListWarningData {} +impl NestedType for InterconnectLocationListWarningData {} +impl Part for InterconnectLocationListWarningData {} -/// An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP. +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set url map target https proxies](struct.TargetHttpsProxySetUrlMapCall.html) (request) +/// * [set url map region target http proxies](struct.RegionTargetHttpProxySetUrlMapCall.html) (request) +/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (request) +/// * [set url map region target https proxies](struct.RegionTargetHttpsProxySetUrlMapCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapReference { + /// no description provided + #[serde(rename="urlMap")] + pub url_map: Option, +} + +impl RequestValue for UrlMapReference {} + + +/// Guest OS features. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GuestOsFeature { + /// The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for GuestOsFeature {} + + +/// [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouteWarnings { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for RouteWarnings {} +impl Part for RouteWarnings {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsRemoveInstancesRequest { + /// The list of instances to remove from the instance group. + pub instances: Option>, +} + +impl RequestValue for InstanceGroupsRemoveInstancesRequest {} + + +/// Contains a list of VpnTunnel resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of VpnTunnel resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for VpnTunnelList {} + + +/// Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. +/// +/// If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. +/// +/// Example Policy with multiple AuditConfigs: +/// +/// { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } +/// +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditConfig { + /// + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The configuration for logging of each type of permission. + #[serde(rename="auditLogConfigs")] + pub audit_log_configs: Option>, + /// Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + pub service: Option, +} + +impl Part for AuditConfig {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set labels disks](struct.DiskSetLabelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneSetLabelsRequest { + /// The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// The labels to set for this resource. + pub labels: Option>, +} + +impl RequestValue for ZoneSetLabelsRequest {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionDiskTypeListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for RegionDiskTypeListWarning {} +impl Part for RegionDiskTypeListWarning {} + + +/// Contains a list of disk types. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list disk types](struct.DiskTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypeList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#diskTypeList for disk types. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of DiskType resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for DiskTypeList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalersScopedList { + /// [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. + pub warning: Option, + /// [Output Only] A list of autoscalers contained in this scope. + pub autoscalers: Option>, +} + +impl Part for AutoscalersScopedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewaysScopedList { + /// [Output Only] A list of target VPN gateways contained in this scope. + #[serde(rename="targetVpnGateways")] + pub target_vpn_gateways: Option>, + /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, +} + +impl Part for TargetVpnGatewaysScopedList {} + + +/// The policy describes the baseline against which Instance boot integrity is measured. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set shielded instance integrity policy instances](struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShieldedInstanceIntegrityPolicy { + /// Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. + #[serde(rename="updateAutoLearnPolicy")] + pub update_auto_learn_policy: Option, +} + +impl RequestValue for ShieldedInstanceIntegrityPolicy {} + + +/// Contains a list of PacketMirroring resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list packet mirrorings](struct.PacketMirroringListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#packetMirroring for packetMirrorings. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of PacketMirroring resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for PacketMirroringList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set instance template region instance group managers](struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersSetTemplateRequest { + /// URL of the InstanceTemplate resource from which all new instances will be created. + #[serde(rename="instanceTemplate")] + pub instance_template: Option, +} + +impl RequestValue for RegionInstanceGroupManagersSetTemplateRequest {} + + +/// Represents a Machine Type resource. +/// +/// You can use specific machine types for your VM instances based on performance and pricing requirements. For more information, read Machine Types. (== resource_for {$api_version}.machineTypes ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list machine types](struct.MachineTypeListCall.html) (none) +/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (none) +/// * [get machine types](struct.MachineTypeGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineType { + /// [Output Only] The number of virtual CPUs that are available to the instance. + #[serde(rename="guestCpus")] + pub guest_cpus: Option, + /// [Deprecated] This property is deprecated and will never be populated with any relevant values. + #[serde(rename="imageSpaceGb")] + pub image_space_gb: Option, + /// [Output Only] The type of the resource. Always compute#machineType for machine types. + pub kind: Option, + /// [Output Only] An optional textual description of the resource. + pub description: Option, + /// [Output Only] The name of the zone where the machine type resides, such as us-central1-a. + pub zone: Option, + /// [Output Only] Maximum total persistent disks size (GB) allowed. + #[serde(rename="maximumPersistentDisksSizeGb")] + pub maximum_persistent_disks_size_gb: Option, + /// [Output Only] The deprecation status associated with this machine type. + pub deprecated: Option, + /// [Output Only] Maximum persistent disks allowed. + #[serde(rename="maximumPersistentDisks")] + pub maximum_persistent_disks: Option, + /// [Output Only] The amount of physical memory available to the instance, defined in MB. + #[serde(rename="memoryMb")] + pub memory_mb: Option, + /// [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. + #[serde(rename="isSharedCpu")] + pub is_shared_cpu: Option, + /// [Output Only] A list of extended scratch disks assigned to the instance. + #[serde(rename="scratchDisks")] + pub scratch_disks: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] Name of the resource. + pub name: Option, +} + +impl Resource for MachineType {} +impl ResponseResult for MachineType {} + + +/// Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for VpnTunnelsScopedListWarning {} +impl Part for VpnTunnelsScopedListWarning {} + + +/// Time window specified for daily operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicyDailyCycle { + /// [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + pub duration: Option, + /// Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle. + #[serde(rename="daysInCycle")] + pub days_in_cycle: Option, + /// Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for ResourcePolicyDailyCycle {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersScopedList { + /// [Output Only] The warning that replaces the list of managed instance groups when the list is empty. + pub warning: Option, + /// [Output Only] The list of managed instance groups that are contained in the specified project and zone. + #[serde(rename="instanceGroupManagers")] + pub instance_group_managers: Option>, +} + +impl Part for InstanceGroupManagersScopedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list url maps](struct.UrlMapAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapsAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of UrlMapsScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for UrlMapsAggregatedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add nodes node groups](struct.NodeGroupAddNodeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupsAddNodesRequest { + /// Count of additional nodes to be added to the node group. + #[serde(rename="additionalNodeCount")] + pub additional_node_count: Option, +} + +impl RequestValue for NodeGroupsAddNodesRequest {} + + +/// Contains a list of UrlMap resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region url maps](struct.RegionUrlMapListCall.html) (response) +/// * [list url maps](struct.UrlMapListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UrlMapList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of UrlMap resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for UrlMapList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AddressAggregatedListWarning {} +impl Part for AddressAggregatedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicyListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for SecurityPolicyListWarningData {} +impl Part for SecurityPolicyListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagerStatus { + /// [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + #[serde(rename="isStable")] + pub is_stable: Option, + /// [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + #[serde(rename="versionTarget")] + pub version_target: Option, + /// [Output Only] The URL of the Autoscaler that targets this instance group manager. + pub autoscaler: Option, +} + +impl Part for InstanceGroupManagerStatus {} + + +/// HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpRouteRuleMatch { + /// Specifies that prefixMatch and fullPathMatch matches are case sensitive. + /// The default value is false. + /// ignoreCase must not be used with regexMatch. + #[serde(rename="ignoreCase")] + pub ignore_case: Option, + /// For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see en.cppreference.com/w/cpp/regex/ecmascript + /// Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + /// Note that regexMatch only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + #[serde(rename="regexMatch")] + pub regex_match: Option, + /// Specifies a list of header match criteria, all of which must match corresponding headers in the request. + #[serde(rename="headerMatches")] + pub header_matches: Option>, + /// For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. + /// fullPathMatch must be between 1 and 1024 characters. + /// Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + #[serde(rename="fullPathMatch")] + pub full_path_match: Option, + /// Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. If a match takes place, the relevant routing configuration is made available to those proxies. + /// For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. + /// metadataFilters specified here will be applied after those specified in ForwardingRule that refers to the UrlMap this HttpRouteRuleMatch belongs to. + /// metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + #[serde(rename="metadataFilters")] + pub metadata_filters: Option>, + /// For satisfying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. + /// The value must be between 1 and 1024 characters. + /// Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + #[serde(rename="prefixMatch")] + pub prefix_match: Option, + /// Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request. + #[serde(rename="queryParameterMatches")] + pub query_parameter_matches: Option>, +} + +impl Part for HttpRouteRuleMatch {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list vpn tunnels](struct.VpnTunnelAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of VpnTunnelsScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for VpnTunnelAggregatedList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InterconnectAttachmentListWarning {} +impl Part for InterconnectAttachmentListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImageListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ImageListWarning {} +impl Part for ImageListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NodeGroupListWarning {} +impl Part for NodeGroupListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectDiagnosticsLinkLACPStatus { + /// System ID of the port on the neighbor's side of the LACP exchange. + #[serde(rename="neighborSystemId")] + pub neighbor_system_id: Option, + /// The state of a LACP link, which can take one of the following values: + /// - ACTIVE: The link is configured and active within the bundle. + /// - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. + pub state: Option, + /// System ID of the port on Google's side of the LACP exchange. + #[serde(rename="googleSystemId")] + pub google_system_id: Option, +} + +impl Part for InterconnectDiagnosticsLinkLACPStatus {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypeAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for MachineTypeAggregatedListWarningData {} +impl Part for MachineTypeAggregatedListWarningData {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetVpnGatewayAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetVpnGatewayAggregatedListWarning {} +impl Part for TargetVpnGatewayAggregatedListWarning {} + + +/// The available logging options for a firewall rule. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FirewallLogConfig { + /// This field denotes whether to enable logging for a particular firewall rule. + pub enable: Option, +} + +impl Part for FirewallLogConfig {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ReservationAggregatedListWarning {} +impl Part for ReservationAggregatedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [disable xpn resource projects](struct.ProjectDisableXpnResourceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProjectsDisableXpnResourceRequest { + /// Service resource (a.k.a service project) ID. + #[serde(rename="xpnResource")] + pub xpn_resource: Option, +} + +impl RequestValue for ProjectsDisableXpnResourceRequest {} + + +/// Identity-Aware Proxy +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceIAP { + /// no description provided + #[serde(rename="oauth2ClientId")] + pub oauth2_client_id: Option, + /// no description provided + pub enabled: Option, + /// no description provided + #[serde(rename="oauth2ClientSecret")] + pub oauth2_client_secret: Option, + /// [Output Only] SHA256 hash value for the field oauth2_client_secret above. + #[serde(rename="oauth2ClientSecretSha256")] + pub oauth2_client_secret_sha256: Option, +} + +impl Part for BackendServiceIAP {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServicesScopedList { + /// Informational warning which replaces the list of backend services when the list is empty. + pub warning: Option, + /// A list of BackendServices contained in this scope. + #[serde(rename="backendServices")] + pub backend_services: Option>, +} + +impl Part for BackendServicesScopedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPoliciesWafConfig { + /// no description provided + #[serde(rename="wafRules")] + pub waf_rules: Option, +} + +impl Part for SecurityPoliciesWafConfig {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExchangedPeeringRoutesListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ExchangedPeeringRoutesListWarningData {} +impl Part for ExchangedPeeringRoutesListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupsScopedList { + /// [Output Only] An informational warning that appears when the nodeGroup list is empty. + pub warning: Option, + /// [Output Only] A list of node groups contained in this scope. + #[serde(rename="nodeGroups")] + pub node_groups: Option>, +} + +impl Part for NodeGroupsScopedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeGroupAggregatedListWarningData {} +impl Part for NodeGroupAggregatedListWarningData {} + + +/// Informational warning which replaces the list of backend services when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServicesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for BackendServicesScopedListWarning {} +impl Part for BackendServicesScopedListWarning {} + + +/// A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation as well as network locality +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicyGroupPlacementPolicy { + /// Specifies network collocation + pub collocation: Option, + /// Number of vms in this placement group + #[serde(rename="vmCount")] + pub vm_count: Option, + /// The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network + #[serde(rename="availabilityDomainCount")] + pub availability_domain_count: Option, +} + +impl Part for ResourcePolicyGroupPlacementPolicy {} + + +/// Encapsulates numeric value that can be either absolute or relative. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FixedOrPercent { + /// [Output Only] Absolute value of VM instances calculated based on the specific mode. + /// + /// + /// - If the value is fixed, then the calculated value is equal to the fixed value. + /// - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up. + pub calculated: Option, + /// Specifies a fixed number of VM instances. This must be a positive integer. + pub fixed: Option, + /// Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. + pub percent: Option, +} + +impl Part for FixedOrPercent {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRuleListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ForwardingRuleListWarning {} +impl Part for ForwardingRuleListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceReference { + /// The URL for a specific instance. + pub instance: Option, +} + +impl RequestValue for InstanceReference {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for DisksScopedListWarningData {} +impl Part for DisksScopedListWarningData {} + + +/// Represents a legacy HTTP Health Check resource. +/// +/// Legacy health checks are required by network load balancers. For more information, read Health Check Concepts. /// /// # Activities /// @@ -14503,7 +16098,7 @@ pub struct HttpHealthCheck { /// [Output Only] Server-defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, - /// The request path of the HTTP health check request. The default value is /. + /// The request path of the HTTP health check request. The default value is /. This field does not support query parameters. #[serde(rename="requestPath")] pub request_path: Option, } @@ -14513,115 +16108,6 @@ impl Resource for HttpHealthCheck {} impl ResponseResult for HttpHealthCheck {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HTTPSHealthCheck { - /// The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. - pub port: Option, - /// The value of the host header in the HTTPS health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. - pub host: Option, - /// The request path of the HTTPS health check request. The default value is /. - #[serde(rename="requestPath")] - pub request_path: Option, - /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. - #[serde(rename="portName")] - pub port_name: Option, - /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, - /// Specifies how port is selected for health checking, can be one of following values: - /// USE_FIXED_PORT: The port number in - /// port - /// is used for health checking. - /// USE_NAMED_PORT: The - /// portName - /// is used for health checking. - /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - /// - /// - /// If not specified, HTTPS health check follows behavior specified in - /// port - /// and - /// portName - /// fields. - #[serde(rename="portSpecification")] - pub port_specification: Option, - /// The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. - pub response: Option, -} - -impl Part for HTTPSHealthCheck {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HttpHealthCheckListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for HttpHealthCheckListWarning {} -impl Part for HttpHealthCheckListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HttpHealthCheckListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for HttpHealthCheckListWarningData {} -impl Part for HttpHealthCheckListWarningData {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [aggregated list disk types](struct.DiskTypeAggregatedListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeAggregatedList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#diskTypeAggregatedList. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of DiskTypesScopedList resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for DiskTypeAggregatedList {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -14647,31 +16133,32 @@ impl Part for NodeTypeListWarning {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapListWarningData { +pub struct AutoscalersScopedListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for UrlMapListWarningData {} -impl Part for UrlMapListWarningData {} +impl NestedType for AutoscalersScopedListWarningData {} +impl Part for AutoscalersScopedListWarningData {} -/// Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. +/// Message containing Cloud CDN configuration for a backend bucket. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicyRuleMatcher { - /// The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. - pub config: Option, - /// Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. - #[serde(rename="versionedExpr")] - pub versioned_expr: Option, +pub struct BackendBucketCdnPolicy { + /// [Output Only] Names of the keys for signing request URLs. + #[serde(rename="signedUrlKeyNames")] + pub signed_url_key_names: Option>, + /// Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + #[serde(rename="signedUrlCacheMaxAgeSec")] + pub signed_url_cache_max_age_sec: Option, } -impl Part for SecurityPolicyRuleMatcher {} +impl Part for BackendBucketCdnPolicy {} /// There is no detailed description. @@ -14681,15 +16168,272 @@ impl Part for SecurityPolicyRuleMatcher {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [validate url maps](struct.UrlMapValidateCall.html) (response) +/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapsValidateResponse { - /// no description provided - pub result: Option, +pub struct InstanceGroupManagersSetTargetPoolsRequest { + /// The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + pub fingerprint: Option, + /// The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + #[serde(rename="targetPools")] + pub target_pools: Option>, } -impl ResponseResult for UrlMapsValidateResponse {} +impl RequestValue for InstanceGroupManagersSetTargetPoolsRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set target pools region instance group managers](struct.RegionInstanceGroupManagerSetTargetPoolCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionInstanceGroupManagersSetTargetPoolsRequest { + /// Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional. + pub fingerprint: Option, + /// The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + #[serde(rename="targetPools")] + pub target_pools: Option>, +} + +impl RequestValue for RegionInstanceGroupManagersSetTargetPoolsRequest {} + + +/// Provides the configuration for logging a type of permissions. Example: +/// +/// { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] } +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// + #[serde(rename="ignoreChildExemptions")] + pub ignore_child_exemptions: Option, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LicensesListResponseWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for LicensesListResponseWarningData {} +impl Part for LicensesListResponseWarningData {} + + +/// Response for the InterconnectsGetDiagnosticsRequest. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get diagnostics interconnects](struct.InterconnectGetDiagnosticCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectsGetDiagnosticsResponse { + /// no description provided + pub result: Option, +} + +impl ResponseResult for InterconnectsGetDiagnosticsResponse {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ReservationsScopedListWarningData {} +impl Part for ReservationsScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update peering networks](struct.NetworkUpdatePeeringCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworksUpdatePeeringRequest { + /// no description provided + #[serde(rename="networkPeering")] + pub network_peering: Option, +} + +impl RequestValue for NetworksUpdatePeeringRequest {} + + +/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewaysScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for VpnGatewaysScopedListWarning {} +impl Part for VpnGatewaysScopedListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MachineTypesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for MachineTypesScopedListWarningData {} +impl Part for MachineTypesScopedListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [preview routers](struct.RouterPreviewCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RoutersPreviewResponse { + /// Preview of given router. + pub resource: Option, +} + +impl ResponseResult for RoutersPreviewResponse {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExchangedPeeringRoutesListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ExchangedPeeringRoutesListWarning {} +impl Part for ExchangedPeeringRoutesListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for DiskAggregatedListWarningData {} +impl Part for DiskAggregatedListWarningData {} + + +/// Contains a list of BackendService resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list backend services](struct.BackendServiceListCall.html) (response) +/// * [list region backend services](struct.RegionBackendServiceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of BackendService resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for BackendServiceList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SnapshotListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for SnapshotListWarningData {} +impl Part for SnapshotListWarningData {} /// There is no detailed description. @@ -14697,13 +16441,2721 @@ impl ResponseResult for UrlMapsValidateResponse {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityPolicyRuleMatcherConfig { - /// CIDR IP address range. - #[serde(rename="srcIpRanges")] - pub src_ip_ranges: Option>, +pub struct ForwardingRuleReference { + /// no description provided + #[serde(rename="forwardingRule")] + pub forwarding_rule: Option, } -impl Part for SecurityPolicyRuleMatcherConfig {} +impl Part for ForwardingRuleReference {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for PacketMirroringListWarning {} +impl Part for PacketMirroringListWarning {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ZoneListWarning {} +impl Part for ZoneListWarning {} + + +/// Properties of the SKU instances being reserved. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AllocationSpecificSKUAllocationReservedInstanceProperties { + /// Minimum cpu platform the reservation. + #[serde(rename="minCpuPlatform")] + pub min_cpu_platform: Option, + /// Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. + #[serde(rename="machineType")] + pub machine_type: Option, + /// Specifies accelerator type and count. + #[serde(rename="guestAccelerators")] + pub guest_accelerators: Option>, + /// Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. + #[serde(rename="localSsds")] + pub local_ssds: Option>, +} + +impl Part for AllocationSpecificSKUAllocationReservedInstanceProperties {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ReservationListWarning {} +impl Part for ReservationListWarning {} + + +/// InstanceGroupManagers.applyUpdatesToInstances +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [apply updates to instances instance group managers](struct.InstanceGroupManagerApplyUpdatesToInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersApplyUpdatesRequest { + /// The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + pub instances: Option>, + /// The most disruptive action that you want to perform on each instance during the update: + /// - REPLACE: Delete the instance and create it again. + /// - RESTART: Stop the instance and start it again. + /// - REFRESH: Do not stop the instance. + /// - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + #[serde(rename="mostDisruptiveAllowedAction")] + pub most_disruptive_allowed_action: Option, + /// The minimal action that you want to perform on each instance during the update: + /// - REPLACE: At minimum, delete the instance and create it again. + /// - RESTART: Stop the instance and start it again. + /// - REFRESH: Do not stop the instance. + /// - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + #[serde(rename="minimalAction")] + pub minimal_action: Option, +} + +impl RequestValue for InstanceGroupManagersApplyUpdatesRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsAddInstanceRequest { + /// A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: + /// - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name + /// - projects/project-id/zones/zone/instances/instance-name + /// - zones/zone/instances/instance-name + pub instances: Option>, +} + +impl RequestValue for TargetPoolsAddInstanceRequest {} + + +/// [Output Only] Informational warning which replaces the list of disk types when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for DiskTypesScopedListWarning {} +impl Part for DiskTypesScopedListWarning {} + + +/// Policy for retention of scheduled snapshots. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourcePolicySnapshotSchedulePolicyRetentionPolicy { + /// Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. + #[serde(rename="onSourceDiskDelete")] + pub on_source_disk_delete: Option, + /// Maximum age of the snapshot that is allowed to be kept. + #[serde(rename="maxRetentionDays")] + pub max_retention_days: Option, +} + +impl Part for ResourcePolicySnapshotSchedulePolicyRetentionPolicy {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for ReservationAggregatedListWarningData {} +impl Part for ReservationAggregatedListWarningData {} + + +/// Contains a list of Router resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list routers](struct.RouterListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouterList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#router for routers. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Router resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RouterList {} + + +/// Settings controlling the volume of connections to a backend service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CircuitBreakers { + /// The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. + #[serde(rename="maxRetries")] + pub max_retries: Option, + /// The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit. + #[serde(rename="maxRequests")] + pub max_requests: Option, + /// The maximum number of connections to the backend service. If not specified, there is no limit. + #[serde(rename="maxConnections")] + pub max_connections: Option, + /// Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive. + #[serde(rename="maxRequestsPerConnection")] + pub max_requests_per_connection: Option, + /// The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. + #[serde(rename="maxPendingRequests")] + pub max_pending_requests: Option, +} + +impl Part for CircuitBreakers {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list instances instance groups](struct.InstanceGroupListInstanceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsListInstancesRequest { + /// A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + #[serde(rename="instanceState")] + pub instance_state: Option, +} + +impl RequestValue for InstanceGroupsListInstancesRequest {} + + +/// Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentPrivateInfo { + /// [Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region. + pub tag8021q: Option, +} + +impl Part for InterconnectAttachmentPrivateInfo {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewaysScopedList { + /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. + pub warning: Option, + /// [Output Only] A list of VPN gateways contained in this scope. + #[serde(rename="vpnGateways")] + pub vpn_gateways: Option>, +} + +impl Part for VpnGatewaysScopedList {} + + +/// The request and response header transformations that take effect before the request is passed along to the selected backendService. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpHeaderAction { + /// A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. + #[serde(rename="requestHeadersToRemove")] + pub request_headers_to_remove: Option>, + /// A list of header names for headers that need to be removed from the response prior to sending the response back to the client. + #[serde(rename="responseHeadersToRemove")] + pub response_headers_to_remove: Option>, + /// Headers to add to a matching request prior to forwarding the request to the backendService. + #[serde(rename="requestHeadersToAdd")] + pub request_headers_to_add: Option>, + /// Headers to add the response prior to sending the response back to the client. + #[serde(rename="responseHeadersToAdd")] + pub response_headers_to_add: Option>, +} + +impl Part for HttpHeaderAction {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for VpnTunnelListWarningData {} +impl Part for VpnTunnelListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskTypesScopedList { + /// [Output Only] Informational warning which replaces the list of disk types when the list is empty. + pub warning: Option, + /// [Output Only] A list of disk types contained in this scope. + #[serde(rename="diskTypes")] + pub disk_types: Option>, +} + +impl Part for DiskTypesScopedList {} + + +/// The interface for the external VPN gateway. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExternalVpnGatewayInterface { + /// IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// The numeric ID of this interface. The allowed input values for this id for different redundancy types of external VPN gateway: SINGLE_IP_INTERNALLY_REDUNDANT - 0 TWO_IPS_REDUNDANCY - 0, 1 FOUR_IPS_REDUNDANCY - 0, 1, 2, 3 + pub id: Option, +} + +impl Part for ExternalVpnGatewayInterface {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LicenseCodeLicenseAlias { + /// [Output Only] Description of this License Code. + pub description: Option, + /// [Output Only] URL of license corresponding to this License Code. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl Part for LicenseCodeLicenseAlias {} + + +/// A Shielded Instance Identity Entry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShieldedInstanceIdentityEntry { + /// A PEM-encoded X.509 certificate. This field can be empty. + #[serde(rename="ekCert")] + pub ek_cert: Option, + /// A PEM-encoded public key. + #[serde(rename="ekPub")] + pub ek_pub: Option, +} + +impl Part for ShieldedInstanceIdentityEntry {} + + +/// Increment a streamz counter with the specified metric and field names. +/// +/// Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended. +/// +/// Field names correspond to IAM request parameters and field values are their respective values. +/// +/// Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields. +/// +/// Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]} +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogConfigCounterOptions { + /// The field value to attribute. + pub field: Option, + /// Custom fields. + #[serde(rename="customFields")] + pub custom_fields: Option>, + /// The metric to update. + pub metric: Option, +} + +impl Part for LogConfigCounterOptions {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddressesScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for AddressesScopedListWarningData {} +impl Part for AddressesScopedListWarningData {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LicenseResourceRequirements { + /// Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start. + #[serde(rename="minGuestCpuCount")] + pub min_guest_cpu_count: Option, + /// Minimum memory required to use the Instance. Enforced at Instance creation and Instance start. + #[serde(rename="minMemoryMb")] + pub min_memory_mb: Option, +} + +impl Part for LicenseResourceRequirements {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalerListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AutoscalerListWarning {} +impl Part for AutoscalerListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NetworkEndpointGroupListWarningData {} +impl Part for NetworkEndpointGroupListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NetworkEndpointGroupsScopedListWarningData {} +impl Part for NetworkEndpointGroupsScopedListWarningData {} + + +/// Write a Data Access (Gin) log +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogConfigDataAccessOptions { + /// Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding. + #[serde(rename="logMode")] + pub log_mode: Option, +} + +impl Part for LogConfigDataAccessOptions {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTypeListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NodeTypeListWarningData {} +impl Part for NodeTypeListWarningData {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceAggregatedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for BackendServiceAggregatedListWarning {} +impl Part for BackendServiceAggregatedListWarning {} + + +/// Represents a VPN gateway resource. Next ID: 13 +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get vpn gateways](struct.VpnGatewayGetCall.html) (response) +/// * [aggregated list vpn gateways](struct.VpnGatewayAggregatedListCall.html) (none) +/// * [insert vpn gateways](struct.VpnGatewayInsertCall.html) (request) +/// * [get status vpn gateways](struct.VpnGatewayGetStatuCall.html) (none) +/// * [delete vpn gateways](struct.VpnGatewayDeleteCall.html) (none) +/// * [set labels vpn gateways](struct.VpnGatewaySetLabelCall.html) (none) +/// * [test iam permissions vpn gateways](struct.VpnGatewayTestIamPermissionCall.html) (none) +/// * [list vpn gateways](struct.VpnGatewayListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGateway { + /// [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make a get() request to retrieve an VpnGateway. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// Labels to apply to this VpnGateway resource. These can be later modified by the setLabels method. Each label key/value must comply with RFC1035. Label values may be empty. + pub labels: Option>, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] A list of interfaces on this VPN gateway. + #[serde(rename="vpnInterfaces")] + pub vpn_interfaces: Option>, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] URL of the region where the VPN gateway resides. + pub region: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + pub network: Option, +} + +impl RequestValue for VpnGateway {} +impl Resource for VpnGateway {} +impl ResponseResult for VpnGateway {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set ssl certificates target https proxies](struct.TargetHttpsProxySetSslCertificateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpsProxiesSetSslCertificatesRequest { + /// New set of SslCertificate resources to associate with this TargetHttpsProxy resource. Currently exactly one SslCertificate resource must be specified. + #[serde(rename="sslCertificates")] + pub ssl_certificates: Option>, +} + +impl RequestValue for TargetHttpsProxiesSetSslCertificatesRequest {} + + +/// Represents a Cloud Armor Security Policy resource. +/// +/// Only external backend services that use load balancers can reference a Security Policy. For more information, read Cloud Armor Security Policy Concepts. (== resource_for {$api_version}.securityPolicies ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get security policies](struct.SecurityPolicyGetCall.html) (response) +/// * [patch security policies](struct.SecurityPolicyPatchCall.html) (request) +/// * [insert security policies](struct.SecurityPolicyInsertCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicy { + /// [Output only] Type of the resource. Always compute#securityPolicyfor security policies + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + pub rules: Option>, + /// Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. + /// + /// To see the latest fingerprint, make get() request to the security policy. + pub fingerprint: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, +} + +impl RequestValue for SecurityPolicy {} +impl ResponseResult for SecurityPolicy {} + + +/// Applicable only to Failover for Internal TCP/UDP Load Balancing. On failover or failback, this field indicates whether connection draining will be honored. GCP has a fixed connection draining timeout of 10 minutes. A setting of true terminates existing TCP connections to the active pool during failover and failback, immediately draining traffic. A setting of false allows existing TCP connections to persist, even on VMs no longer in the active pool, for up to the duration of the connection draining timeout (10 minutes). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceFailoverPolicy { + /// This can be set to true only if the protocol is TCP. + /// + /// The default is false. + #[serde(rename="disableConnectionDrainOnFailover")] + pub disable_connection_drain_on_failover: Option, + /// Applicable only to Failover for Internal TCP/UDP Load Balancing. The value of the field must be in the range [0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. + #[serde(rename="failoverRatio")] + pub failover_ratio: Option, + /// Applicable only to Failover for Internal TCP/UDP Load Balancing. If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy. If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. + /// + /// The default is false. + #[serde(rename="dropTrafficIfUnhealthy")] + pub drop_traffic_if_unhealthy: Option, +} + +impl Part for BackendServiceFailoverPolicy {} + + +/// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" +/// +/// Example (Equality): +/// +/// title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" +/// +/// Example (Logic): +/// +/// title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" +/// +/// Example (Data Manipulation): +/// +/// title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" +/// +/// The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + pub title: Option, +} + +impl Part for Expr {} + + +/// [Output Only] An informational warning that appears when the nodeGroup list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NodeGroupsScopedListWarning {} +impl Part for NodeGroupsScopedListWarning {} + + +/// The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpFaultInjection { + /// The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. + pub delay: Option, + /// The specification for how client requests are aborted as part of fault injection. + pub abort: Option, +} + +impl Part for HttpFaultInjection {} + + +/// +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceProperties { + /// Specifies the reservations that this instance can consume from. + #[serde(rename="reservationAffinity")] + pub reservation_affinity: Option, + /// Labels to apply to instances that are created from this template. + pub labels: Option>, + /// The machine type to use for instances that are created from this template. + #[serde(rename="machineType")] + pub machine_type: Option, + /// A list of guest accelerator cards' type and count to use for instances created from the instance template. + #[serde(rename="guestAccelerators")] + pub guest_accelerators: Option>, + /// A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + pub tags: Option, + /// An optional text description for the instances that are created from this instance template. + pub description: Option, + /// An array of disks that are associated with the instances that are created from this template. + pub disks: Option>, + /// The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + pub metadata: Option, + /// Resource policies (names, not ULRs) applied to instances created from this template. + #[serde(rename="resourcePolicies")] + pub resource_policies: Option>, + /// Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + #[serde(rename="canIpForward")] + pub can_ip_forward: Option, + /// Specifies the scheduling options for the instances that are created from this template. + pub scheduling: Option, + /// Minimum cpu/platform to be used by this instance. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + #[serde(rename="minCpuPlatform")] + pub min_cpu_platform: Option, + /// A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances. + #[serde(rename="serviceAccounts")] + pub service_accounts: Option>, + /// An array of network access configurations for this interface. + #[serde(rename="networkInterfaces")] + pub network_interfaces: Option>, + /// no description provided + #[serde(rename="shieldedInstanceConfig")] + pub shielded_instance_config: Option, +} + +impl Part for InstanceProperties {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [resize disks](struct.DiskResizeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DisksResizeRequest { + /// The new size of the persistent disk, which is specified in GB. + #[serde(rename="sizeGb")] + pub size_gb: Option, +} + +impl RequestValue for DisksResizeRequest {} + + +/// Write a Cloud Audit log +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogConfigCloudAuditOptions { + /// The log_name to populate in the Cloud Audit Record. + #[serde(rename="logName")] + pub log_name: Option, + /// Information used by the Cloud Audit Logging pipeline. + #[serde(rename="authorizationLoggingOptions")] + pub authorization_logging_options: Option, +} + +impl Part for LogConfigCloudAuditOptions {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set machine resources instances](struct.InstanceSetMachineResourceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesSetMachineResourcesRequest { + /// A list of the type and count of accelerator cards attached to the instance. + #[serde(rename="guestAccelerators")] + pub guest_accelerators: Option>, +} + +impl RequestValue for InstancesSetMachineResourcesRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set iam policy node templates](struct.NodeTemplateSetIamPolicyCall.html) (request) +/// * [set iam policy subnetworks](struct.SubnetworkSetIamPolicyCall.html) (request) +/// * [set iam policy resource policies](struct.ResourcePolicySetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegionSetPolicyRequest { + /// REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + pub policy: Option, + /// Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + pub bindings: Option>, + /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + pub etag: Option, +} + +impl RequestValue for RegionSetPolicyRequest {} + + +/// Informational warning which replaces the list of backend services when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslCertificatesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for SslCertificatesScopedListWarning {} +impl Part for SslCertificatesScopedListWarning {} + + +/// Contains a list of SslCertificate resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region ssl certificates](struct.RegionSslCertificateListCall.html) (response) +/// * [list ssl certificates](struct.SslCertificateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslCertificateList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of SslCertificate resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for SslCertificateList {} + + +/// Represents a Project resource. +/// +/// A project is used to organize resources in a Google Cloud Platform environment. For more information, read about the Resource Hierarchy. (== resource_for {$api_version}.projects ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get xpn resources projects](struct.ProjectGetXpnResourceCall.html) (none) +/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (none) +/// * [set common instance metadata projects](struct.ProjectSetCommonInstanceMetadataCall.html) (none) +/// * [get xpn host projects](struct.ProjectGetXpnHostCall.html) (response) +/// * [enable xpn host projects](struct.ProjectEnableXpnHostCall.html) (none) +/// * [disable xpn resource projects](struct.ProjectDisableXpnResourceCall.html) (none) +/// * [enable xpn resource projects](struct.ProjectEnableXpnResourceCall.html) (none) +/// * [move instance projects](struct.ProjectMoveInstanceCall.html) (none) +/// * [get projects](struct.ProjectGetCall.html) (response) +/// * [move disk projects](struct.ProjectMoveDiskCall.html) (none) +/// * [set default network tier projects](struct.ProjectSetDefaultNetworkTierCall.html) (none) +/// * [disable xpn host projects](struct.ProjectDisableXpnHostCall.html) (none) +/// * [list xpn hosts projects](struct.ProjectListXpnHostCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Project { + /// [Output Only] Type of the resource. Always compute#project for projects. + pub kind: Option, + /// [Output Only] Default service account used by VMs running in this project. + #[serde(rename="defaultServiceAccount")] + pub default_service_account: Option, + /// An optional textual description of the resource. + pub description: Option, + /// Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. + #[serde(rename="commonInstanceMetadata")] + pub common_instance_metadata: Option, + /// [Output Only] Quotas assigned to this project. + pub quotas: Option>, + /// The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. + #[serde(rename="usageExportLocation")] + pub usage_export_location: Option, + /// Restricted features enabled for use on this project. + #[serde(rename="enabledFeatures")] + pub enabled_features: Option>, + /// [Output Only] The role this project has in a shared VPC configuration. Currently only HOST projects are differentiated. + #[serde(rename="xpnProjectStatus")] + pub xpn_project_status: Option, + /// This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + #[serde(rename="defaultNetworkTier")] + pub default_network_tier: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources. + pub id: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + pub name: Option, +} + +impl Resource for Project {} +impl ResponseResult for Project {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list managed instances instance group managers](struct.InstanceGroupManagerListManagedInstanceCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupManagersListManagedInstancesResponse { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] The list of instances in the managed instance group. + #[serde(rename="managedInstances")] + pub managed_instances: Option>, +} + +impl ResponseResult for InstanceGroupManagersListManagedInstancesResponse {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthCheckListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for HealthCheckListWarning {} +impl Part for HealthCheckListWarning {} + + +/// [Output Only] An informational warning that appears when the node templates list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTemplatesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NodeTemplatesScopedListWarning {} +impl Part for NodeTemplatesScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list interconnect attachments](struct.InterconnectAttachmentAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectAttachmentAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of InterconnectAttachmentsScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InterconnectAttachmentAggregatedList {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthStatus { + /// URL of the instance resource. + pub instance: Option, + /// Health state of the instance. + #[serde(rename="healthState")] + pub health_state: Option, + /// A forwarding rule IP address assigned to this instance. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// The named port of the instance group, not necessarily the port that is health-checked. + pub port: Option, +} + +impl Part for HealthStatus {} + + +/// Message containing Cloud CDN configuration for a backend service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceCdnPolicy { + /// [Output Only] Names of the keys for signing request URLs. + #[serde(rename="signedUrlKeyNames")] + pub signed_url_key_names: Option>, + /// Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + #[serde(rename="signedUrlCacheMaxAgeSec")] + pub signed_url_cache_max_age_sec: Option, + /// The CacheKeyPolicy for this CdnPolicy. + #[serde(rename="cacheKeyPolicy")] + pub cache_key_policy: Option, +} + +impl Part for BackendServiceCdnPolicy {} + + +/// Represents an Operation resource. +/// +/// Google Compute Engine has three Operation resources: +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations) +/// +/// You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. +/// +/// Operations can be global, regional or zonal. +/// - For global operations, use the `globalOperations` resource. +/// - For regional operations, use the `regionOperations` resource. +/// - For zonal operations, use the `zonalOperations` resource. +/// +/// For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete backend buckets](struct.BackendBucketDeleteCall.html) (response) +/// * [resize instance group managers](struct.InstanceGroupManagerResizeCall.html) (response) +/// * [delete ssl certificates](struct.SslCertificateDeleteCall.html) (response) +/// * [resize region disks](struct.RegionDiskResizeCall.html) (response) +/// * [patch autoscalers](struct.AutoscalerPatchCall.html) (response) +/// * [insert external vpn gateways](struct.ExternalVpnGatewayInsertCall.html) (response) +/// * [delete images](struct.ImageDeleteCall.html) (response) +/// * [delete region autoscalers](struct.RegionAutoscalerDeleteCall.html) (response) +/// * [deprecate images](struct.ImageDeprecateCall.html) (response) +/// * [patch region instance group managers](struct.RegionInstanceGroupManagerPatchCall.html) (response) +/// * [delete region backend services](struct.RegionBackendServiceDeleteCall.html) (response) +/// * [delete interconnects](struct.InterconnectDeleteCall.html) (response) +/// * [update shielded instance config instances](struct.InstanceUpdateShieldedInstanceConfigCall.html) (response) +/// * [insert region url maps](struct.RegionUrlMapInsertCall.html) (response) +/// * [patch firewalls](struct.FirewallPatchCall.html) (response) +/// * [delete vpn tunnels](struct.VpnTunnelDeleteCall.html) (response) +/// * [set labels region disks](struct.RegionDiskSetLabelCall.html) (response) +/// * [wait region operations](struct.RegionOperationWaitCall.html) (response) +/// * [set machine type instances](struct.InstanceSetMachineTypeCall.html) (response) +/// * [set target global forwarding rules](struct.GlobalForwardingRuleSetTargetCall.html) (response) +/// * [set named ports instance groups](struct.InstanceGroupSetNamedPortCall.html) (response) +/// * [delete node groups](struct.NodeGroupDeleteCall.html) (response) +/// * [delete ssl policies](struct.SslPolicyDeleteCall.html) (response) +/// * [insert ssl policies](struct.SslPolicyInsertCall.html) (response) +/// * [disable xpn host projects](struct.ProjectDisableXpnHostCall.html) (response) +/// * [resize region instance group managers](struct.RegionInstanceGroupManagerResizeCall.html) (response) +/// * [set service account instances](struct.InstanceSetServiceAccountCall.html) (response) +/// * [delete global forwarding rules](struct.GlobalForwardingRuleDeleteCall.html) (response) +/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (response) +/// * [delete disks](struct.DiskDeleteCall.html) (response) +/// * [insert region disks](struct.RegionDiskInsertCall.html) (response) +/// * [add instances instance groups](struct.InstanceGroupAddInstanceCall.html) (response) +/// * [add resource policies disks](struct.DiskAddResourcePolicyCall.html) (response) +/// * [insert subnetworks](struct.SubnetworkInsertCall.html) (response) +/// * [patch health checks](struct.HealthCheckPatchCall.html) (response) +/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (response) +/// * [delete instances](struct.InstanceDeleteCall.html) (response) +/// * [add health check target pools](struct.TargetPoolAddHealthCheckCall.html) (response) +/// * [insert instance group managers](struct.InstanceGroupManagerInsertCall.html) (response) +/// * [insert global addresses](struct.GlobalAddresseInsertCall.html) (response) +/// * [update health checks](struct.HealthCheckUpdateCall.html) (response) +/// * [set ssl certificates target ssl proxies](struct.TargetSslProxySetSslCertificateCall.html) (response) +/// * [delete https health checks](struct.HttpsHealthCheckDeleteCall.html) (response) +/// * [wait zone operations](struct.ZoneOperationWaitCall.html) (response) +/// * [insert autoscalers](struct.AutoscalerInsertCall.html) (response) +/// * [update peering networks](struct.NetworkUpdatePeeringCall.html) (response) +/// * [delete snapshots](struct.SnapshotDeleteCall.html) (response) +/// * [add rule security policies](struct.SecurityPolicyAddRuleCall.html) (response) +/// * [delete instances instance group managers](struct.InstanceGroupManagerDeleteInstanceCall.html) (response) +/// * [insert routes](struct.RouteInsertCall.html) (response) +/// * [resize disks](struct.DiskResizeCall.html) (response) +/// * [insert node templates](struct.NodeTemplateInsertCall.html) (response) +/// * [set backend service target ssl proxies](struct.TargetSslProxySetBackendServiceCall.html) (response) +/// * [insert target vpn gateways](struct.TargetVpnGatewayInsertCall.html) (response) +/// * [set default network tier projects](struct.ProjectSetDefaultNetworkTierCall.html) (response) +/// * [set instance template instance group managers](struct.InstanceGroupManagerSetInstanceTemplateCall.html) (response) +/// * [set node template node groups](struct.NodeGroupSetNodeTemplateCall.html) (response) +/// * [delete resource policies](struct.ResourcePolicyDeleteCall.html) (response) +/// * [insert security policies](struct.SecurityPolicyInsertCall.html) (response) +/// * [remove peering networks](struct.NetworkRemovePeeringCall.html) (response) +/// * [delete region target https proxies](struct.RegionTargetHttpsProxyDeleteCall.html) (response) +/// * [patch ssl policies](struct.SslPolicyPatchCall.html) (response) +/// * [delete interconnect attachments](struct.InterconnectAttachmentDeleteCall.html) (response) +/// * [insert region target https proxies](struct.RegionTargetHttpsProxyInsertCall.html) (response) +/// * [insert target pools](struct.TargetPoolInsertCall.html) (response) +/// * [delete target tcp proxies](struct.TargetTcpProxyDeleteCall.html) (response) +/// * [disable xpn resource projects](struct.ProjectDisableXpnResourceCall.html) (response) +/// * [delete global network endpoint groups](struct.GlobalNetworkEndpointGroupDeleteCall.html) (response) +/// * [add resource policies region disks](struct.RegionDiskAddResourcePolicyCall.html) (response) +/// * [set disk auto delete instances](struct.InstanceSetDiskAutoDeleteCall.html) (response) +/// * [recreate instances region instance group managers](struct.RegionInstanceGroupManagerRecreateInstanceCall.html) (response) +/// * [set target pools instance group managers](struct.InstanceGroupManagerSetTargetPoolCall.html) (response) +/// * [insert disks](struct.DiskInsertCall.html) (response) +/// * [delete target ssl proxies](struct.TargetSslProxyDeleteCall.html) (response) +/// * [update autoscalers](struct.AutoscalerUpdateCall.html) (response) +/// * [insert region backend services](struct.RegionBackendServiceInsertCall.html) (response) +/// * [insert https health checks](struct.HttpsHealthCheckInsertCall.html) (response) +/// * [simulate maintenance event instances](struct.InstanceSimulateMaintenanceEventCall.html) (response) +/// * [remove health check target pools](struct.TargetPoolRemoveHealthCheckCall.html) (response) +/// * [add signed url key backend buckets](struct.BackendBucketAddSignedUrlKeyCall.html) (response) +/// * [create instances region instance group managers](struct.RegionInstanceGroupManagerCreateInstanceCall.html) (response) +/// * [set url map target https proxies](struct.TargetHttpsProxySetUrlMapCall.html) (response) +/// * [create snapshot region disks](struct.RegionDiskCreateSnapshotCall.html) (response) +/// * [delete backend services](struct.BackendServiceDeleteCall.html) (response) +/// * [set url map region target http proxies](struct.RegionTargetHttpProxySetUrlMapCall.html) (response) +/// * [update network interface instances](struct.InstanceUpdateNetworkInterfaceCall.html) (response) +/// * [insert url maps](struct.UrlMapInsertCall.html) (response) +/// * [add access config instances](struct.InstanceAddAccessConfigCall.html) (response) +/// * [set machine resources instances](struct.InstanceSetMachineResourceCall.html) (response) +/// * [apply updates to instances region instance group managers](struct.RegionInstanceGroupManagerApplyUpdatesToInstanceCall.html) (response) +/// * [update access config instances](struct.InstanceUpdateAccessConfigCall.html) (response) +/// * [delete networks](struct.NetworkDeleteCall.html) (response) +/// * [insert addresses](struct.AddresseInsertCall.html) (response) +/// * [insert health checks](struct.HealthCheckInsertCall.html) (response) +/// * [insert global forwarding rules](struct.GlobalForwardingRuleInsertCall.html) (response) +/// * [delete target https proxies](struct.TargetHttpsProxyDeleteCall.html) (response) +/// * [update instances](struct.InstanceUpdateCall.html) (response) +/// * [insert target tcp proxies](struct.TargetTcpProxyInsertCall.html) (response) +/// * [detach network endpoints global network endpoint groups](struct.GlobalNetworkEndpointGroupDetachNetworkEndpointCall.html) (response) +/// * [get global operations](struct.GlobalOperationGetCall.html) (response) +/// * [update region url maps](struct.RegionUrlMapUpdateCall.html) (response) +/// * [delete addresses](struct.AddresseDeleteCall.html) (response) +/// * [delete region target http proxies](struct.RegionTargetHttpProxyDeleteCall.html) (response) +/// * [set backend service target tcp proxies](struct.TargetTcpProxySetBackendServiceCall.html) (response) +/// * [create snapshot disks](struct.DiskCreateSnapshotCall.html) (response) +/// * [patch region url maps](struct.RegionUrlMapPatchCall.html) (response) +/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (response) +/// * [set labels snapshots](struct.SnapshotSetLabelCall.html) (response) +/// * [delete region health checks](struct.RegionHealthCheckDeleteCall.html) (response) +/// * [insert region commitments](struct.RegionCommitmentInsertCall.html) (response) +/// * [add signed url key backend services](struct.BackendServiceAddSignedUrlKeyCall.html) (response) +/// * [set url map region target https proxies](struct.RegionTargetHttpsProxySetUrlMapCall.html) (response) +/// * [start instances](struct.InstanceStartCall.html) (response) +/// * [insert vpn gateways](struct.VpnGatewayInsertCall.html) (response) +/// * [delete instance group managers](struct.InstanceGroupManagerDeleteCall.html) (response) +/// * [set deletion protection instances](struct.InstanceSetDeletionProtectionCall.html) (response) +/// * [expand ip cidr range subnetworks](struct.SubnetworkExpandIpCidrRangeCall.html) (response) +/// * [insert interconnects](struct.InterconnectInsertCall.html) (response) +/// * [move disk projects](struct.ProjectMoveDiskCall.html) (response) +/// * [patch region autoscalers](struct.RegionAutoscalerPatchCall.html) (response) +/// * [insert firewalls](struct.FirewallInsertCall.html) (response) +/// * [patch global forwarding rules](struct.GlobalForwardingRulePatchCall.html) (response) +/// * [set labels disks](struct.DiskSetLabelCall.html) (response) +/// * [set backup target pools](struct.TargetPoolSetBackupCall.html) (response) +/// * [set security policy backend services](struct.BackendServiceSetSecurityPolicyCall.html) (response) +/// * [delete instances region instance group managers](struct.RegionInstanceGroupManagerDeleteInstanceCall.html) (response) +/// * [detach disk instances](struct.InstanceDetachDiskCall.html) (response) +/// * [update routers](struct.RouterUpdateCall.html) (response) +/// * [delete instance groups](struct.InstanceGroupDeleteCall.html) (response) +/// * [delete access config instances](struct.InstanceDeleteAccessConfigCall.html) (response) +/// * [set ssl certificates target https proxies](struct.TargetHttpsProxySetSslCertificateCall.html) (response) +/// * [insert networks](struct.NetworkInsertCall.html) (response) +/// * [update display device instances](struct.InstanceUpdateDisplayDeviceCall.html) (response) +/// * [abandon instances instance group managers](struct.InstanceGroupManagerAbandonInstanceCall.html) (response) +/// * [set tags instances](struct.InstanceSetTagCall.html) (response) +/// * [attach network endpoints network endpoint groups](struct.NetworkEndpointGroupAttachNetworkEndpointCall.html) (response) +/// * [resize reservations](struct.ReservationResizeCall.html) (response) +/// * [set metadata instances](struct.InstanceSetMetadataCall.html) (response) +/// * [insert target https proxies](struct.TargetHttpsProxyInsertCall.html) (response) +/// * [create instances instance group managers](struct.InstanceGroupManagerCreateInstanceCall.html) (response) +/// * [add nodes node groups](struct.NodeGroupAddNodeCall.html) (response) +/// * [set target forwarding rules](struct.ForwardingRuleSetTargetCall.html) (response) +/// * [set proxy header target tcp proxies](struct.TargetTcpProxySetProxyHeaderCall.html) (response) +/// * [update backend services](struct.BackendServiceUpdateCall.html) (response) +/// * [remove resource policies disks](struct.DiskRemoveResourcePolicyCall.html) (response) +/// * [delete nodes node groups](struct.NodeGroupDeleteNodeCall.html) (response) +/// * [insert instance groups](struct.InstanceGroupInsertCall.html) (response) +/// * [delete vpn gateways](struct.VpnGatewayDeleteCall.html) (response) +/// * [delete region url maps](struct.RegionUrlMapDeleteCall.html) (response) +/// * [delete licenses](struct.LicenseDeleteCall.html) (response) +/// * [remove resource policies region disks](struct.RegionDiskRemoveResourcePolicyCall.html) (response) +/// * [patch instance group managers](struct.InstanceGroupManagerPatchCall.html) (response) +/// * [insert global network endpoint groups](struct.GlobalNetworkEndpointGroupInsertCall.html) (response) +/// * [recreate instances instance group managers](struct.InstanceGroupManagerRecreateInstanceCall.html) (response) +/// * [insert reservations](struct.ReservationInsertCall.html) (response) +/// * [delete reservations](struct.ReservationDeleteCall.html) (response) +/// * [set ssl policy target https proxies](struct.TargetHttpsProxySetSslPolicyCall.html) (response) +/// * [set ssl policy target ssl proxies](struct.TargetSslProxySetSslPolicyCall.html) (response) +/// * [set common instance metadata projects](struct.ProjectSetCommonInstanceMetadataCall.html) (response) +/// * [delete node templates](struct.NodeTemplateDeleteCall.html) (response) +/// * [get region operations](struct.RegionOperationGetCall.html) (response) +/// * [add resource policies instances](struct.InstanceAddResourcePolicyCall.html) (response) +/// * [insert backend buckets](struct.BackendBucketInsertCall.html) (response) +/// * [insert node groups](struct.NodeGroupInsertCall.html) (response) +/// * [insert licenses](struct.LicenseInsertCall.html) (response) +/// * [patch backend services](struct.BackendServicePatchCall.html) (response) +/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (response) +/// * [delete network endpoint groups](struct.NetworkEndpointGroupDeleteCall.html) (response) +/// * [delete region instance group managers](struct.RegionInstanceGroupManagerDeleteCall.html) (response) +/// * [patch region health checks](struct.RegionHealthCheckPatchCall.html) (response) +/// * [patch http health checks](struct.HttpHealthCheckPatchCall.html) (response) +/// * [patch rule security policies](struct.SecurityPolicyPatchRuleCall.html) (response) +/// * [insert instance templates](struct.InstanceTemplateInsertCall.html) (response) +/// * [insert forwarding rules](struct.ForwardingRuleInsertCall.html) (response) +/// * [patch interconnect attachments](struct.InterconnectAttachmentPatchCall.html) (response) +/// * [insert images](struct.ImageInsertCall.html) (response) +/// * [delete signed url key backend buckets](struct.BackendBucketDeleteSignedUrlKeyCall.html) (response) +/// * [invalidate cache url maps](struct.UrlMapInvalidateCacheCall.html) (response) +/// * [patch region backend services](struct.RegionBackendServicePatchCall.html) (response) +/// * [insert ssl certificates](struct.SslCertificateInsertCall.html) (response) +/// * [remove resource policies instances](struct.InstanceRemoveResourcePolicyCall.html) (response) +/// * [switch to custom mode networks](struct.NetworkSwitchToCustomModeCall.html) (response) +/// * [wait global operations](struct.GlobalOperationWaitCall.html) (response) +/// * [move instance projects](struct.ProjectMoveInstanceCall.html) (response) +/// * [insert region target http proxies](struct.RegionTargetHttpProxyInsertCall.html) (response) +/// * [patch security policies](struct.SecurityPolicyPatchCall.html) (response) +/// * [delete autoscalers](struct.AutoscalerDeleteCall.html) (response) +/// * [set target pools region instance group managers](struct.RegionInstanceGroupManagerSetTargetPoolCall.html) (response) +/// * [update region health checks](struct.RegionHealthCheckUpdateCall.html) (response) +/// * [patch subnetworks](struct.SubnetworkPatchCall.html) (response) +/// * [update https health checks](struct.HttpsHealthCheckUpdateCall.html) (response) +/// * [delete region ssl certificates](struct.RegionSslCertificateDeleteCall.html) (response) +/// * [patch url maps](struct.UrlMapPatchCall.html) (response) +/// * [delete subnetworks](struct.SubnetworkDeleteCall.html) (response) +/// * [delete region disks](struct.RegionDiskDeleteCall.html) (response) +/// * [stop instances](struct.InstanceStopCall.html) (response) +/// * [add instance target pools](struct.TargetPoolAddInstanceCall.html) (response) +/// * [remove instance target pools](struct.TargetPoolRemoveInstanceCall.html) (response) +/// * [detach network endpoints network endpoint groups](struct.NetworkEndpointGroupDetachNetworkEndpointCall.html) (response) +/// * [set ssl certificates region target https proxies](struct.RegionTargetHttpsProxySetSslCertificateCall.html) (response) +/// * [delete target pools](struct.TargetPoolDeleteCall.html) (response) +/// * [update firewalls](struct.FirewallUpdateCall.html) (response) +/// * [insert instances](struct.InstanceInsertCall.html) (response) +/// * [set usage export bucket projects](struct.ProjectSetUsageExportBucketCall.html) (response) +/// * [insert region autoscalers](struct.RegionAutoscalerInsertCall.html) (response) +/// * [set labels images](struct.ImageSetLabelCall.html) (response) +/// * [patch packet mirrorings](struct.PacketMirroringPatchCall.html) (response) +/// * [patch node groups](struct.NodeGroupPatchCall.html) (response) +/// * [insert target http proxies](struct.TargetHttpProxyInsertCall.html) (response) +/// * [insert interconnect attachments](struct.InterconnectAttachmentInsertCall.html) (response) +/// * [patch networks](struct.NetworkPatchCall.html) (response) +/// * [insert resource policies](struct.ResourcePolicyInsertCall.html) (response) +/// * [remove rule security policies](struct.SecurityPolicyRemoveRuleCall.html) (response) +/// * [set named ports region instance groups](struct.RegionInstanceGroupSetNamedPortCall.html) (response) +/// * [insert backend services](struct.BackendServiceInsertCall.html) (response) +/// * [set labels external vpn gateways](struct.ExternalVpnGatewaySetLabelCall.html) (response) +/// * [delete target instances](struct.TargetInstanceDeleteCall.html) (response) +/// * [delete instance templates](struct.InstanceTemplateDeleteCall.html) (response) +/// * [set instance template region instance group managers](struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) (response) +/// * [enable xpn host projects](struct.ProjectEnableXpnHostCall.html) (response) +/// * [attach network endpoints global network endpoint groups](struct.GlobalNetworkEndpointGroupAttachNetworkEndpointCall.html) (response) +/// * [set quic override target https proxies](struct.TargetHttpsProxySetQuicOverrideCall.html) (response) +/// * [delete routers](struct.RouterDeleteCall.html) (response) +/// * [patch forwarding rules](struct.ForwardingRulePatchCall.html) (response) +/// * [delete target vpn gateways](struct.TargetVpnGatewayDeleteCall.html) (response) +/// * [delete external vpn gateways](struct.ExternalVpnGatewayDeleteCall.html) (response) +/// * [delete health checks](struct.HealthCheckDeleteCall.html) (response) +/// * [set labels instances](struct.InstanceSetLabelCall.html) (response) +/// * [update region backend services](struct.RegionBackendServiceUpdateCall.html) (response) +/// * [patch interconnects](struct.InterconnectPatchCall.html) (response) +/// * [set shielded instance integrity policy instances](struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html) (response) +/// * [delete target http proxies](struct.TargetHttpProxyDeleteCall.html) (response) +/// * [patch backend buckets](struct.BackendBucketPatchCall.html) (response) +/// * [delete global addresses](struct.GlobalAddresseDeleteCall.html) (response) +/// * [apply updates to instances instance group managers](struct.InstanceGroupManagerApplyUpdatesToInstanceCall.html) (response) +/// * [patch https health checks](struct.HttpsHealthCheckPatchCall.html) (response) +/// * [update url maps](struct.UrlMapUpdateCall.html) (response) +/// * [delete url maps](struct.UrlMapDeleteCall.html) (response) +/// * [insert routers](struct.RouterInsertCall.html) (response) +/// * [reset instances](struct.InstanceResetCall.html) (response) +/// * [insert region health checks](struct.RegionHealthCheckInsertCall.html) (response) +/// * [patch routers](struct.RouterPatchCall.html) (response) +/// * [add peering networks](struct.NetworkAddPeeringCall.html) (response) +/// * [delete security policies](struct.SecurityPolicyDeleteCall.html) (response) +/// * [set labels vpn gateways](struct.VpnGatewaySetLabelCall.html) (response) +/// * [set proxy header target ssl proxies](struct.TargetSslProxySetProxyHeaderCall.html) (response) +/// * [delete http health checks](struct.HttpHealthCheckDeleteCall.html) (response) +/// * [insert target instances](struct.TargetInstanceInsertCall.html) (response) +/// * [insert http health checks](struct.HttpHealthCheckInsertCall.html) (response) +/// * [attach disk instances](struct.InstanceAttachDiskCall.html) (response) +/// * [abandon instances region instance group managers](struct.RegionInstanceGroupManagerAbandonInstanceCall.html) (response) +/// * [insert packet mirrorings](struct.PacketMirroringInsertCall.html) (response) +/// * [set private ip google access subnetworks](struct.SubnetworkSetPrivateIpGoogleAccesCall.html) (response) +/// * [enable xpn resource projects](struct.ProjectEnableXpnResourceCall.html) (response) +/// * [insert region ssl certificates](struct.RegionSslCertificateInsertCall.html) (response) +/// * [update region autoscalers](struct.RegionAutoscalerUpdateCall.html) (response) +/// * [insert target ssl proxies](struct.TargetSslProxyInsertCall.html) (response) +/// * [start with encryption key instances](struct.InstanceStartWithEncryptionKeyCall.html) (response) +/// * [set min cpu platform instances](struct.InstanceSetMinCpuPlatformCall.html) (response) +/// * [delete forwarding rules](struct.ForwardingRuleDeleteCall.html) (response) +/// * [insert network endpoint groups](struct.NetworkEndpointGroupInsertCall.html) (response) +/// * [update backend buckets](struct.BackendBucketUpdateCall.html) (response) +/// * [delete packet mirrorings](struct.PacketMirroringDeleteCall.html) (response) +/// * [insert region instance group managers](struct.RegionInstanceGroupManagerInsertCall.html) (response) +/// * [delete firewalls](struct.FirewallDeleteCall.html) (response) +/// * [get zone operations](struct.ZoneOperationGetCall.html) (response) +/// * [update http health checks](struct.HttpHealthCheckUpdateCall.html) (response) +/// * [delete routes](struct.RouteDeleteCall.html) (response) +/// * [delete signed url key backend services](struct.BackendServiceDeleteSignedUrlKeyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. + pub status: Option, + /// [Output Only] A textual description of the operation, which is set when the operation is created. + pub description: Option, + /// [Output Only] If warning messages are generated during processing of the operation, this field will be populated. + pub warnings: Option>, + /// [Output Only] If errors are generated during processing of the operation, this field will be populated. + pub error: Option, + /// [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. + #[serde(rename="targetId")] + pub target_id: Option, + /// [Output Only] User who requested the operation, for example: `user@example.com`. + pub user: Option, + /// [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. + #[serde(rename="startTime")] + pub start_time: Option, + /// [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. + #[serde(rename="clientOperationId")] + pub client_operation_id: Option, + /// [Deprecated] This field is deprecated. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the operation. This identifier is defined by the server. + pub id: Option, + /// [Output Only] Type of the resource. Always `compute#operation` for Operation resources. + pub kind: Option, + /// [Output Only] Name of the operation. + pub name: Option, + /// [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. + pub zone: Option, + /// [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. + pub region: Option, + /// [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on. + #[serde(rename="operationType")] + pub operation_type: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// [Output Only] The time that this operation was requested. This value is in RFC3339 text format. + #[serde(rename="insertTime")] + pub insert_time: Option, + /// [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`. + #[serde(rename="httpErrorMessage")] + pub http_error_message: Option, + /// [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. + pub progress: Option, + /// [Output Only] The time that this operation was completed. This value is in RFC3339 text format. + #[serde(rename="endTime")] + pub end_time: Option, + /// [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found. + #[serde(rename="httpErrorStatusCode")] + pub http_error_status_code: Option, + /// [Output Only] An optional textual description of the current status of the operation. + #[serde(rename="statusMessage")] + pub status_message: Option, + /// [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. + #[serde(rename="targetLink")] + pub target_link: Option, +} + +impl ResponseResult for Operation {} + + +/// A list of TargetHttpProxy resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list target http proxies](struct.TargetHttpProxyListCall.html) (response) +/// * [list region target http proxies](struct.RegionTargetHttpProxyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpProxyList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of TargetHttpProxy resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetHttpProxyList {} + + +/// Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get rule security policies](struct.SecurityPolicyGetRuleCall.html) (response) +/// * [add rule security policies](struct.SecurityPolicyAddRuleCall.html) (request) +/// * [patch rule security policies](struct.SecurityPolicyPatchRuleCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPolicyRule { + /// An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + pub priority: Option, + /// [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules + pub kind: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// The Action to preform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502. + pub action: Option, + /// If set to true, the specified action is not enforced. + pub preview: Option, + /// A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + #[serde(rename="match")] + pub match_: Option, +} + +impl RequestValue for SecurityPolicyRule {} +impl ResponseResult for SecurityPolicyRule {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InterconnectLocationListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InterconnectLocationListWarning {} +impl Part for InterconnectLocationListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list node groups](struct.NodeGroupAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for aggregated lists of node groups. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of NodeGroupsScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for NodeGroupAggregatedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpsProxyListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for TargetHttpsProxyListWarningData {} +impl Part for TargetHttpsProxyListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list instances](struct.InstanceAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// An object that contains a list of instances scoped by zone. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for InstanceAggregatedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceTemplateListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceTemplateListWarningData {} +impl Part for InstanceTemplateListWarningData {} + + +/// [Output Only] An informational warning that appears when the accelerator types list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorTypesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for AcceleratorTypesScopedListWarning {} +impl Part for AcceleratorTypesScopedListWarning {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupsScopedList { + /// [Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty. + pub warning: Option, + /// [Output Only] The list of network endpoint groups that are contained in this scope. + #[serde(rename="networkEndpointGroups")] + pub network_endpoint_groups: Option>, +} + +impl Part for NetworkEndpointGroupsScopedList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set iam policy images](struct.ImageSetIamPolicyCall.html) (request) +/// * [set iam policy snapshots](struct.SnapshotSetIamPolicyCall.html) (request) +/// * [set iam policy instance templates](struct.InstanceTemplateSetIamPolicyCall.html) (request) +/// * [set iam policy licenses](struct.LicenseSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GlobalSetPolicyRequest { + /// REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + pub policy: Option, + /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + pub bindings: Option>, + /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + pub etag: Option, +} + +impl RequestValue for GlobalSetPolicyRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayStatus { + /// List of VPN connection for this VpnGateway. + #[serde(rename="vpnConnections")] + pub vpn_connections: Option>, +} + +impl Part for VpnGatewayStatus {} + + +/// Represents an SSL Certificate resource. +/// +/// Google Compute Engine has two SSL Certificate resources: +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/sslCertificates) * [Regional](/compute/docs/reference/rest/{$api_version}/regionSslCertificates) +/// +/// +/// +/// The sslCertificates are used by: +/// - external HTTPS load balancers +/// - SSL proxy load balancers +/// +/// The regionSslCertificates are used by internal HTTPS load balancers. +/// +/// Optionally, certificate file contents that you upload can contain a set of up to five PEM-encoded certificates. The API call creates an object (sslCertificate) that holds this data. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and using SSL certificates and SSL certificates quotas and limits. (== resource_for {$api_version}.sslCertificates ==) (== resource_for {$api_version}.regionSslCertificates ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete ssl certificates](struct.SslCertificateDeleteCall.html) (none) +/// * [get region ssl certificates](struct.RegionSslCertificateGetCall.html) (response) +/// * [insert ssl certificates](struct.SslCertificateInsertCall.html) (request) +/// * [get ssl certificates](struct.SslCertificateGetCall.html) (response) +/// * [aggregated list ssl certificates](struct.SslCertificateAggregatedListCall.html) (none) +/// * [insert region ssl certificates](struct.RegionSslCertificateInsertCall.html) (request) +/// * [list ssl certificates](struct.SslCertificateListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SslCertificate { + /// [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. + pub kind: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + pub certificate: Option, + /// [Output Only] URL of the region where the regional SSL Certificate resides. This field is not applicable to global SSL Certificate. + pub region: Option, + /// A write-only private key in PEM format. Only insert requests will include this field. + #[serde(rename="privateKey")] + pub private_key: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// [Output only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, +} + +impl RequestValue for SslCertificate {} +impl Resource for SslCertificate {} +impl ResponseResult for SslCertificate {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceGroupsScopedListWarningData {} +impl Part for InstanceGroupsScopedListWarningData {} + + +/// The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FirewallDenied { + /// The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + #[serde(rename="IPProtocol")] + pub ip_protocol: Option, + /// An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + /// + /// Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + pub ports: Option>, +} + +impl NestedType for FirewallDenied {} +impl Part for FirewallDenied {} + + +/// Contains a list of HttpHealthCheck resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list http health checks](struct.HttpHealthCheckListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpHealthCheckList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of HttpHealthCheck resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for HttpHealthCheckList {} + + +/// Represents a Health Check resource. +/// +/// Google Compute Engine has two Health Check resources: +/// +/// * [Global](/compute/docs/reference/rest/{$api_version}/healthChecks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionHealthChecks) +/// +/// Internal HTTP(S) load balancers use regional health checks. All other types of GCP load balancers and managed instance group auto-healing use global health checks. For more information, read Health Check Concepts. +/// +/// To perform health checks on network load balancers, you must use either httpHealthChecks or httpsHealthChecks. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [insert health checks](struct.HealthCheckInsertCall.html) (request) +/// * [get region health checks](struct.RegionHealthCheckGetCall.html) (response) +/// * [patch region health checks](struct.RegionHealthCheckPatchCall.html) (request) +/// * [aggregated list health checks](struct.HealthCheckAggregatedListCall.html) (none) +/// * [patch health checks](struct.HealthCheckPatchCall.html) (request) +/// * [get health checks](struct.HealthCheckGetCall.html) (response) +/// * [insert region health checks](struct.RegionHealthCheckInsertCall.html) (request) +/// * [update health checks](struct.HealthCheckUpdateCall.html) (request) +/// * [list health checks](struct.HealthCheckListCall.html) (none) +/// * [delete health checks](struct.HealthCheckDeleteCall.html) (none) +/// * [update region health checks](struct.RegionHealthCheckUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthCheck { + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. + #[serde(rename="timeoutSec")] + pub timeout_sec: Option, + /// no description provided + #[serde(rename="httpHealthCheck")] + pub http_health_check: Option, + /// A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. + #[serde(rename="unhealthyThreshold")] + pub unhealthy_threshold: Option, + /// no description provided + #[serde(rename="http2HealthCheck")] + pub http2_health_check: Option, + /// [Output Only] Region where the health check resides. Not applicable to global health checks. + pub region: Option, + /// no description provided + #[serde(rename="httpsHealthCheck")] + pub https_health_check: Option, + /// [Output Only] Creation timestamp in 3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// Type of the resource. + pub kind: Option, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// How often (in seconds) to send a health check. The default value is 5 seconds. + #[serde(rename="checkIntervalSec")] + pub check_interval_sec: Option, + /// no description provided + #[serde(rename="tcpHealthCheck")] + pub tcp_health_check: Option, + /// A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. + #[serde(rename="healthyThreshold")] + pub healthy_threshold: Option, + /// Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of the protocol-specific health check field must be specified, which must match type field. + #[serde(rename="type")] + pub type_: Option, + /// no description provided + #[serde(rename="sslHealthCheck")] + pub ssl_health_check: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for HealthCheck {} +impl Resource for HealthCheck {} +impl ResponseResult for HealthCheck {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set backend service target ssl proxies](struct.TargetSslProxySetBackendServiceCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetSslProxiesSetBackendServiceRequest { + /// The URL of the new BackendService resource for the targetSslProxy. + pub service: Option, +} + +impl RequestValue for TargetSslProxiesSetBackendServiceRequest {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HealthStatusForNetworkEndpoint { + /// URL of the forwarding rule associated with the health state of the network endpoint. + #[serde(rename="forwardingRule")] + pub forwarding_rule: Option, + /// Health state of the network endpoint determined based on the health checks configured. + #[serde(rename="healthState")] + pub health_state: Option, + /// URL of the backend service associated with the health state of the network endpoint. + #[serde(rename="backendService")] + pub backend_service: Option, + /// URL of the health check associated with the health state of the network endpoint. + #[serde(rename="healthCheck")] + pub health_check: Option, +} + +impl Part for HealthStatusForNetworkEndpoint {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PacketMirroringListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for PacketMirroringListWarningData {} +impl Part for PacketMirroringListWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for NetworkListWarningData {} +impl Part for NetworkListWarningData {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [invalidate cache url maps](struct.UrlMapInvalidateCacheCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CacheInvalidationRule { + /// no description provided + pub path: Option, + /// If set, this invalidation rule will only apply to requests with a Host header matching host. + pub host: Option, +} + +impl RequestValue for CacheInvalidationRule {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for InstanceListWarning {} +impl Part for InstanceListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnelsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for VpnTunnelsScopedListWarningData {} +impl Part for VpnTunnelsScopedListWarningData {} + + +/// A list of Disk resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list disks](struct.DiskListCall.html) (response) +/// * [list region disks](struct.RegionDiskListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DiskList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#diskList for lists of disks. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Disk resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for DiskList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list preconfigured expression sets security policies](struct.SecurityPolicyListPreconfiguredExpressionSetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityPoliciesListPreconfiguredExpressionSetsResponse { + /// no description provided + #[serde(rename="preconfiguredExpressionSets")] + pub preconfigured_expression_sets: Option, +} + +impl ResponseResult for SecurityPoliciesListPreconfiguredExpressionSetsResponse {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VmEndpointNatMappingsListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for VmEndpointNatMappingsListWarning {} +impl Part for VmEndpointNatMappingsListWarning {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationsScopedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for OperationsScopedListWarningData {} +impl Part for OperationsScopedListWarningData {} + + +/// [Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkEndpointGroupsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for NetworkEndpointGroupsScopedListWarning {} +impl Part for NetworkEndpointGroupsScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get health target pools](struct.TargetPoolGetHealthCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolInstanceHealth { + /// [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. + pub kind: Option, + /// no description provided + #[serde(rename="healthStatus")] + pub health_status: Option>, +} + +impl ResponseResult for TargetPoolInstanceHealth {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list node types](struct.NodeTypeAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeTypeAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for aggregated lists of node types. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of NodeTypesScopedList resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for NodeTypeAggregatedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for OperationListWarningData {} +impl Part for OperationListWarningData {} + + +/// Array of guest attribute namespace/key/value tuples. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GuestAttributesValue { + /// no description provided + pub items: Option>, +} + +impl Part for GuestAttributesValue {} + + +/// Contains a list of reservations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list reservations](struct.ReservationAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Allocation resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ReservationAggregatedList {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetHttpsProxyListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetHttpsProxyListWarning {} +impl Part for TargetHttpsProxyListWarning {} + + +/// Informational warning which replaces the list of routers when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RoutersScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for RoutersScopedListWarning {} +impl Part for RoutersScopedListWarning {} + + +/// Custom utilization metric policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalingPolicyCustomMetricUtilization { + /// The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. + /// + /// The metric must have a value type of INT64 or DOUBLE. + pub metric: Option, + /// Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + #[serde(rename="utilizationTargetType")] + pub utilization_target_type: Option, + /// The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. + /// + /// For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances. + #[serde(rename="utilizationTarget")] + pub utilization_target: Option, +} + +impl Part for AutoscalingPolicyCustomMetricUtilization {} + + +/// [Output Only] Informational warning message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendServiceListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for BackendServiceListWarning {} +impl Part for BackendServiceListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set proxy header target tcp proxies](struct.TargetTcpProxySetProxyHeaderCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetTcpProxiesSetProxyHeaderRequest { + /// The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + #[serde(rename="proxyHeader")] + pub proxy_header: Option, +} + +impl RequestValue for TargetTcpProxiesSetProxyHeaderRequest {} + + +/// A condition to be met. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Condition { + /// Trusted attributes supplied by the IAM system. + pub iam: Option, + /// Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. + pub sys: Option, + /// The objects of the condition. + pub values: Option>, + /// Trusted attributes discharged by the service. + pub svc: Option, + /// An operator to apply the subject with. + pub op: Option, +} + +impl Part for Condition {} + + +/// Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolsScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetPoolsScopedListWarning {} +impl Part for TargetPoolsScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set labels instances](struct.InstanceSetLabelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesSetLabelsRequest { + /// Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// no description provided + pub labels: Option>, +} + +impl RequestValue for InstancesSetLabelsRequest {} + + +/// Contains a list of BackendBucket resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list backend buckets](struct.BackendBucketListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackendBucketList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of BackendBucket resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for BackendBucketList {} + + +/// Contains a list of images. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list images](struct.ImageListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImageList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Image resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ImageList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set iam policy disks](struct.DiskSetIamPolicyCall.html) (request) +/// * [set iam policy reservations](struct.ReservationSetIamPolicyCall.html) (request) +/// * [set iam policy node groups](struct.NodeGroupSetIamPolicyCall.html) (request) +/// * [set iam policy instances](struct.InstanceSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ZoneSetPolicyRequest { + /// REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + pub policy: Option, + /// Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + pub bindings: Option>, + /// Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + pub etag: Option, +} + +impl RequestValue for ZoneSetPolicyRequest {} + + +/// Informational warning which replaces the list of forwarding rules when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ForwardingRulesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for ForwardingRulesScopedListWarning {} +impl Part for ForwardingRulesScopedListWarning {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete nodes node groups](struct.NodeGroupDeleteNodeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeGroupsDeleteNodesRequest { + /// Names of the nodes to delete. + pub nodes: Option>, +} + +impl RequestValue for NodeGroupsDeleteNodesRequest {} + + +/// Contains a list of Commitment resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list region commitments](struct.RegionCommitmentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitmentList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of Commitment resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for CommitmentList {} + + +/// Contains a list of VpnGateway resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list vpn gateways](struct.VpnGatewayListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnGatewayList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of VpnGateway resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for VpnGatewayList {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [aggregated list target instances](struct.TargetInstanceAggregatedListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstanceAggregatedList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Type of resource. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of TargetInstance resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetInstanceAggregatedList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupsListInstancesWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceGroupsListInstancesWarningData {} +impl Part for InstanceGroupsListInstancesWarningData {} + + +/// Informational warning which replaces the list of addresses when the list is empty. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetInstancesScopedListWarning { + /// [Output Only] A human-readable description of the warning code. + pub message: Option, + /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + pub code: Option, + /// [Output Only] Metadata about this warning in key: value format. For example: + /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } + pub data: Option>, +} + +impl NestedType for TargetInstancesScopedListWarning {} +impl Part for TargetInstancesScopedListWarning {} /// A list of InstanceGroup resources. @@ -14736,304 +19188,155 @@ pub struct InstanceGroupList { impl ResponseResult for InstanceGroupList {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeTypeListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NodeTypeListWarningData {} -impl Part for NodeTypeListWarningData {} - - -/// A shielded Instance identity entry. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get shielded instance identity instances](struct.InstanceGetShieldedInstanceIdentityCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ShieldedInstanceIdentity { - /// An Attestation Key (AK) issued to the Shielded Instance's vTPM. - #[serde(rename="signingKey")] - pub signing_key: Option, - /// [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. - pub kind: Option, - /// An Endorsement Key (EK) issued to the Shielded Instance's vTPM. - #[serde(rename="encryptionKey")] - pub encryption_key: Option, -} - -impl ResponseResult for ShieldedInstanceIdentity {} - - -/// Contains a list of InstanceGroup resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list region instance groups](struct.RegionInstanceGroupListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The resource type. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of InstanceGroup resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RegionInstanceGroupList {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterBgpPeer { - /// The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. - #[serde(rename="advertisedRoutePriority")] - pub advertised_route_priority: Option, - /// Name of the interface the BGP peer is associated with. - #[serde(rename="interfaceName")] - pub interface_name: Option, - /// User-specified flag to indicate which mode to use for advertisement. - #[serde(rename="advertiseMode")] - pub advertise_mode: Option, - /// IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. - #[serde(rename="peerIpAddress")] - pub peer_ip_address: Option, - /// Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. - #[serde(rename="peerAsn")] - pub peer_asn: Option, - /// User-specified list of prefix groups to advertise in custom mode, which can take one of the following options: - /// - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets. - /// - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets. - /// - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC network. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. - #[serde(rename="advertisedGroups")] - pub advertised_groups: Option>, - /// User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. - #[serde(rename="advertisedIpRanges")] - pub advertised_ip_ranges: Option>, - /// [Output Only] The resource that configures and manages this BGP peer. - /// - MANAGED_BY_USER is the default value and can be managed by you or other users - /// - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. - #[serde(rename="managementType")] - pub management_type: Option, - /// IP address of the interface inside Google Cloud Platform. Only IPv4 is supported. - #[serde(rename="ipAddress")] - pub ip_address: Option, - /// Name of this BGP peer. The name must be 1-63 characters long and comply with RFC1035. - pub name: Option, -} - -impl Part for RouterBgpPeer {} - - -/// [Output Only] Informational warning which replaces the list of disks when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for DisksScopedListWarning {} -impl Part for DisksScopedListWarning {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for OperationAggregatedListWarningData {} -impl Part for OperationAggregatedListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupsListInstancesWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for RegionInstanceGroupsListInstancesWarningData {} -impl Part for RegionInstanceGroupsListInstancesWarningData {} - - -/// Array of key/value pairs. The total size of all keys and values must be less than 512 KB. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MetadataItems { - /// Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. - pub key: Option, - /// Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). - pub value: Option, -} - -impl NestedType for MetadataItems {} -impl Part for MetadataItems {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set url map target https proxies](struct.TargetHttpsProxySetUrlMapCall.html) (request) -/// * [set url map target http proxies](struct.TargetHttpProxySetUrlMapCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlMapReference { - /// no description provided - #[serde(rename="urlMap")] - pub url_map: Option, -} - -impl RequestValue for UrlMapReference {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SSLHealthCheck { - /// The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. - pub port: Option, - /// Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. - #[serde(rename="portName")] - pub port_name: Option, - /// Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. - #[serde(rename="proxyHeader")] - pub proxy_header: Option, - /// The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. - pub request: Option, - /// Specifies how port is selected for health checking, can be one of following values: - /// USE_FIXED_PORT: The port number in - /// port - /// is used for health checking. - /// USE_NAMED_PORT: The - /// portName - /// is used for health checking. - /// USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - /// - /// - /// If not specified, SSL health check follows behavior specified in - /// port - /// and - /// portName - /// fields. - #[serde(rename="portSpecification")] - pub port_specification: Option, - /// The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. - pub response: Option, -} - -impl Part for SSLHealthCheck {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalerAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for AutoscalerAggregatedListWarningData {} -impl Part for AutoscalerAggregatedListWarningData {} - - -/// [Output Only] Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressesScopedListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for AddressesScopedListWarning {} -impl Part for AddressesScopedListWarning {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SnapshotListWarning { +pub struct TargetPoolAggregatedListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for SnapshotListWarning {} -impl Part for SnapshotListWarning {} +impl NestedType for TargetPoolAggregatedListWarning {} +impl Part for TargetPoolAggregatedListWarning {} + + +/// Represents a Cloud VPN Tunnel resource. +/// +/// For more information about VPN, read the the Cloud VPN Overview. (== resource_for {$api_version}.vpnTunnels ==) +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete vpn tunnels](struct.VpnTunnelDeleteCall.html) (none) +/// * [aggregated list vpn tunnels](struct.VpnTunnelAggregatedListCall.html) (none) +/// * [get vpn tunnels](struct.VpnTunnelGetCall.html) (response) +/// * [insert vpn tunnels](struct.VpnTunnelInsertCall.html) (request) +/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VpnTunnel { + /// [Output Only] Detailed status message for the VPN tunnel. + #[serde(rename="detailedStatus")] + pub detailed_status: Option, + /// [Output Only] The status of the VPN tunnel, which can be one of the following: + /// - PROVISIONING: Resource is being allocated for the VPN tunnel. + /// - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. + /// - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. + /// - ESTABLISHED: Secure session is successfully established with the peer VPN. + /// - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS + /// - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). + /// - NEGOTIATION_FAILURE: Handshake failed. + /// - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. + /// - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. + /// - NO_INCOMING_PACKETS: No incoming packets from peer. + /// - REJECTED: Tunnel configuration was rejected, can be result of being blacklisted. + /// - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources. + /// - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state. + /// - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT. + /// - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel. + pub status: Option, + /// An optional description of this resource. Provide this property when you create the resource. + pub description: Option, + /// IKE protocol version to use when establishing the VPN tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2. + #[serde(rename="ikeVersion")] + pub ike_version: Option, + /// Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported. + #[serde(rename="localTrafficSelector")] + pub local_traffic_selector: Option>, + /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + pub kind: Option, + /// Hash of the shared secret. + #[serde(rename="sharedSecretHash")] + pub shared_secret_hash: Option, + /// URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. This must be used (instead of target_vpn_gateway) if a High Availability VPN gateway resource is created. + #[serde(rename="vpnGateway")] + pub vpn_gateway: Option, + /// The interface ID of the external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. + #[serde(rename="peerExternalGatewayInterface")] + pub peer_external_gateway_interface: Option, + /// [Output Only] Creation timestamp in RFC3339 text format. + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. + pub id: Option, + /// Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. + #[serde(rename="sharedSecret")] + pub shared_secret: Option, + /// IP address of the peer VPN gateway. Only IPv4 is supported. + #[serde(rename="peerIp")] + pub peer_ip: Option, + /// URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field can be used when creating highly available VPN from VPC network to VPC network, the field is exclusive with the field peerExternalGateway. If provided, the VPN tunnel will automatically use the same vpnGatewayInterface ID in the peer GCP VPN gateway. + #[serde(rename="peerGcpGateway")] + pub peer_gcp_gateway: Option, + /// Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + #[serde(rename="remoteTrafficSelector")] + pub remote_traffic_selector: Option>, + /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + pub name: Option, + /// URL of the router resource to be used for dynamic routing. + pub router: Option, + /// The interface ID of the VPN gateway with which this VPN tunnel is associated. + #[serde(rename="vpnGatewayInterface")] + pub vpn_gateway_interface: Option, + /// [Output Only] URL of the region where the VPN tunnel resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + pub region: Option, + /// URL of the peer side external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field is exclusive with the field peerGcpGateway. + #[serde(rename="peerExternalGateway")] + pub peer_external_gateway: Option, + /// URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. + #[serde(rename="targetVpnGateway")] + pub target_vpn_gateway: Option, + /// [Output Only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for VpnTunnel {} +impl Resource for VpnTunnel {} +impl ResponseResult for VpnTunnel {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceListReferrersWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for InstanceListReferrersWarningData {} +impl Part for InstanceListReferrersWarningData {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubnetworkAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, +} + +impl NestedType for SubnetworkAggregatedListWarningData {} +impl Part for SubnetworkAggregatedListWarningData {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -15053,89 +19356,6 @@ impl NestedType for InstanceGroupManagersScopedListWarningData {} impl Part for InstanceGroupManagersScopedListWarningData {} -/// A full or valid partial URL to a health check. For example, the following are valid URLs: -/// - https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check -/// - projects/project-id/global/httpHealthChecks/health-check -/// - global/httpHealthChecks/health-check -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HealthCheckReference { - /// no description provided - #[serde(rename="healthCheck")] - pub health_check: Option, -} - -impl Part for HealthCheckReference {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for NetworkEndpointGroupAggregatedListWarningData {} -impl Part for NetworkEndpointGroupAggregatedListWarningData {} - - -/// Represents a Target VPN Gateway resource. -/// -/// The target VPN gateway resource represents a Classic Cloud VPN gateway. For more information, read the the Cloud VPN Overview. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete target vpn gateways](struct.TargetVpnGatewayDeleteCall.html) (none) -/// * [aggregated list target vpn gateways](struct.TargetVpnGatewayAggregatedListCall.html) (none) -/// * [get target vpn gateways](struct.TargetVpnGatewayGetCall.html) (response) -/// * [insert target vpn gateways](struct.TargetVpnGatewayInsertCall.html) (request) -/// * [list target vpn gateways](struct.TargetVpnGatewayListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGateway { - /// [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. - pub status: Option, - /// [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. - pub kind: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// [Output Only] URL of the region where the target VPN gateway resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. - pub region: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. - #[serde(rename="forwardingRules")] - pub forwarding_rules: Option>, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. - pub tunnels: Option>, - /// URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. - pub network: Option, -} - -impl RequestValue for TargetVpnGateway {} -impl Resource for TargetVpnGateway {} -impl ResponseResult for TargetVpnGateway {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -15155,40 +19375,6 @@ impl NestedType for RouterListWarning {} impl Part for RouterListWarning {} -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BackendServiceAggregatedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for BackendServiceAggregatedListWarningData {} -impl Part for BackendServiceAggregatedListWarningData {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for InstanceListWarningData {} -impl Part for InstanceListWarningData {} - - /// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -15208,43 +19394,6 @@ impl NestedType for OperationListWarning {} impl Part for OperationListWarning {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [expand ip cidr range subnetworks](struct.SubnetworkExpandIpCidrRangeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubnetworksExpandIpCidrRangeRequest { - /// The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. - #[serde(rename="ipCidrRange")] - pub ip_cidr_range: Option, -} - -impl RequestValue for SubnetworksExpandIpCidrRangeRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [remove instances instance groups](struct.InstanceGroupRemoveInstanceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsRemoveInstancesRequest { - /// The list of instances to remove from the instance group. - pub instances: Option>, -} - -impl RequestValue for InstanceGroupsRemoveInstancesRequest {} - - /// [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. /// /// This property is mutually exclusive with the source property; you can only define one or the other, but not both. @@ -15253,7 +19402,7 @@ impl RequestValue for InstanceGroupsRemoveInstancesRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AttachedDiskInitializeParams { - /// The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or disks.source is required except for local SSD. + /// The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required except for local SSD. /// /// To create a disk with a snapshot that you created, specify the snapshot name in the following format: /// global/snapshots/my-backup @@ -15262,18 +19411,21 @@ pub struct AttachedDiskInitializeParams { /// If the source snapshot is deleted later, this field will not be set. #[serde(rename="sourceSnapshot")] pub source_snapshot: Option, + /// Specifies the disk name. If not specified, the default is to use the name of the instance. If a disk with the same name already exists in the given region, the existing disk is attached to the new instance and the new disk is not created. + #[serde(rename="diskName")] + pub disk_name: Option, + /// An optional description. Provide this property when creating the disk. + pub description: Option, + /// Specifies which action to take on instance update with this disk. Default is to use the existing disk. + #[serde(rename="onUpdateAction")] + pub on_update_action: Option, + /// Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. + pub labels: Option>, /// The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. /// /// Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. #[serde(rename="sourceImageEncryptionKey")] pub source_image_encryption_key: Option, - /// An optional description. Provide this property when creating the disk. - pub description: Option, - /// Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. - pub labels: Option>, - /// Specifies the disk name. If not specified, the default is to use the name of the instance. If the disk with the instance name exists already in the given zone/region, a new name will be automatically generated. - #[serde(rename="diskName")] - pub disk_name: Option, /// Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: /// https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard /// @@ -15284,13 +19436,13 @@ pub struct AttachedDiskInitializeParams { /// - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. #[serde(rename="diskType")] pub disk_type: Option, - /// Specifies the size of the disk in base-2 GB. + /// Specifies the size of the disk in base-2 GB. The size must be at least 10 GB. If you specify a sourceImage, which is required for boot disks, the default size is the size of the sourceImage. If you do not specify a sourceImage, the default disk size is 500 GB. #[serde(rename="diskSizeGb")] pub disk_size_gb: Option, /// Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. #[serde(rename="resourcePolicies")] pub resource_policies: Option>, - /// The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. + /// The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. /// /// To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: /// projects/debian-cloud/global/images/family/debian-9 @@ -15355,137 +19507,6 @@ impl NestedType for BackendServicesScopedListWarningData {} impl Part for BackendServicesScopedListWarningData {} -/// A specification of the desired way to instantiate a disk in the instance template when its created from a source instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskInstantiationConfig { - /// Specifies the device name of the disk to which the configurations apply to. - #[serde(rename="deviceName")] - pub device_name: Option, - /// The custom source image to be used to restore this disk when instantiating this instance template. - #[serde(rename="customImage")] - pub custom_image: Option, - /// Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). - #[serde(rename="autoDelete")] - pub auto_delete: Option, - /// Specifies whether to include the disk and what image to use. Possible values are: - /// - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - /// - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - /// - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. - /// - attach-read-only: to attach a read-only disk. Applicable to read-only disks. - /// - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. - #[serde(rename="instantiateFrom")] - pub instantiate_from: Option, -} - -impl Part for DiskInstantiationConfig {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [insert resource policies](struct.ResourcePolicyInsertCall.html) (request) -/// * [get resource policies](struct.ResourcePolicyGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicy { - /// [Output Only] The status of resource policy creation. - pub status: Option, - /// [Output Only] Type of the resource. Always compute#resource_policies for resource policies. - pub kind: Option, - /// no description provided - pub description: Option, - /// no description provided - pub region: Option, - /// Resource policy for persistent disks for creating snapshots. - #[serde(rename="snapshotSchedulePolicy")] - pub snapshot_schedule_policy: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined fully-qualified URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, -} - -impl RequestValue for ResourcePolicy {} -impl ResponseResult for ResourcePolicy {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for AddressesScopedListWarningData {} -impl Part for AddressesScopedListWarningData {} - - -/// Contains a list of VpnTunnel resources. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list vpn tunnels](struct.VpnTunnelListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of VpnTunnel resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for VpnTunnelList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for RouterListWarningData {} -impl Part for RouterListWarningData {} - - /// Represents a secondary IP range of a subnetwork. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -15503,162 +19524,21 @@ pub struct SubnetworkSecondaryRange { impl Part for SubnetworkSecondaryRange {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddressListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for AddressListWarning {} -impl Part for AddressListWarning {} - - /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupsScopedListWarningData { +pub struct FirewallListWarningData { /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). pub key: Option, /// [Output Only] A warning data value corresponding to the key. pub value: Option, } -impl NestedType for NodeGroupsScopedListWarningData {} -impl Part for NodeGroupsScopedListWarningData {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HealthCheckListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for HealthCheckListWarning {} -impl Part for HealthCheckListWarning {} - - -/// Message containing connection draining configuration. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ConnectionDraining { - /// Time for which instance will be drained (not accept new connections, but still work to finish started). - #[serde(rename="drainingTimeoutSec")] - pub draining_timeout_sec: Option, -} - -impl Part for ConnectionDraining {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set labels disks](struct.DiskSetLabelCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ZoneSetLabelsRequest { - /// The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint. - #[serde(rename="labelFingerprint")] - pub label_fingerprint: Option, - /// The labels to set for this resource. - pub labels: Option>, -} - -impl RequestValue for ZoneSetLabelsRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [preview routers](struct.RouterPreviewCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RoutersPreviewResponse { - /// Preview of given router. - pub resource: Option, -} - -impl ResponseResult for RoutersPreviewResponse {} - - -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionDiskTypeListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for RegionDiskTypeListWarning {} -impl Part for RegionDiskTypeListWarning {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagerUpdatePolicy { - /// The maximum number of instances that can be created above the specified targetSize during the update process. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary. - /// - /// At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge. - #[serde(rename="maxSurge")] - pub max_surge: Option, - /// The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). - #[serde(rename="type")] - pub type_: Option, - /// The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: - /// - /// - /// - The instance's status is RUNNING. - /// - If there is a health check on the instance group, the instance's liveness health check result must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. By default, a fixed value of 1 is used. This value can be either a fixed number or a percentage if the instance group has 10 or more instances. If you set a percentage, the number of instances will be rounded up if necessary. - /// - /// At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable. - #[serde(rename="maxUnavailable")] - pub max_unavailable: Option, - /// Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. - #[serde(rename="minimalAction")] - pub minimal_action: Option, -} - -impl Part for InstanceGroupManagerUpdatePolicy {} +impl NestedType for FirewallListWarningData {} +impl Part for FirewallListWarningData {} /// [Output Only] Metadata about this warning in key: value format. For example: @@ -15678,71 +19558,9 @@ impl NestedType for BackendBucketListWarningData {} impl Part for BackendBucketListWarningData {} -/// Contains a list of disk types. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list disk types](struct.DiskTypeListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DiskTypeList { - /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// [Output Only] Type of resource. Always compute#diskTypeList for disk types. - pub kind: Option, - /// [Output Only] Informational warning message. - pub warning: Option, - /// A list of DiskType resources. - pub items: Option>, - /// [Output Only] Unique identifier for the resource; defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for this resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for DiskTypeList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SslCertificateListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for SslCertificateListWarningData {} -impl Part for SslCertificateListWarningData {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalersScopedList { - /// [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. - pub warning: Option, - /// [Output Only] A list of autoscalers contained in this scope. - pub autoscalers: Option>, -} - -impl Part for AutoscalersScopedList {} - - /// Represents a Route resource. /// -/// A route defines a path from VM instances in the VPC network to a specific destination. This destination can be inside or outside the VPC network. For more information, read the Routes overview. (== resource_for beta.routes ==) (== resource_for v1.routes ==) +/// A route defines a path from VM instances in the VPC network to a specific destination. This destination can be inside or outside the VPC network. For more information, read the Routes overview. (== resource_for {$api_version}.routes ==) /// /// # Activities /// @@ -15763,6 +19581,11 @@ pub struct Route { pub description: Option, /// A list of instance tags to which this route applies. pub tags: Option>, + /// The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets. You can only specify the forwarding rule as a partial or full URL. For example, the following are all valid URLs: + /// - https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule + /// - regions/region/forwardingRules/forwardingRule + #[serde(rename="nextHopIlb")] + pub next_hop_ilb: Option, /// The URL of the local network if it should handle matching packets. #[serde(rename="nextHopNetwork")] pub next_hop_network: Option, @@ -15807,116 +19630,59 @@ impl Resource for Route {} impl ResponseResult for Route {} -/// There is no detailed description. +/// A Managed Instance resource. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetVpnGatewaysScopedList { - /// [Output Only] A list of target VPN gateways contained in this scope. - #[serde(rename="targetVpnGateways")] - pub target_vpn_gateways: Option>, - /// [Output Only] Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, +pub struct ManagedInstance { + /// [Output Only] The status of the instance. This field is empty when the instance does not exist. + #[serde(rename="instanceStatus")] + pub instance_status: Option, + /// [Output Only] Intended version of this instance. + pub version: Option, + /// [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. + pub instance: Option, + /// [Output Only] Information about the last attempt to create or delete the instance. + #[serde(rename="lastAttempt")] + pub last_attempt: Option, + /// [Output Only] Health state of the instance per health-check. + #[serde(rename="instanceHealth")] + pub instance_health: Option>, + /// [Output only] The unique identifier for this resource. This field is empty when instance does not exist. + pub id: Option, + /// [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: + /// - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. + /// - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. + /// - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. + /// - RECREATING The managed instance group is recreating this instance. + /// - DELETING The managed instance group is permanently deleting this instance. + /// - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. + /// - RESTARTING The managed instance group is restarting the instance. + /// - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. + /// - VERIFYING The managed instance group has created the instance and it is in the process of being verified. + #[serde(rename="currentAction")] + pub current_action: Option, } -impl Part for TargetVpnGatewaysScopedList {} +impl Part for ManagedInstance {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set backend service target ssl proxies](struct.TargetSslProxySetBackendServiceCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetSslProxiesSetBackendServiceRequest { - /// The URL of the new BackendService resource for the targetSslProxy. - pub service: Option, -} - -impl RequestValue for TargetSslProxiesSetBackendServiceRequest {} - - -/// Sets the scheduling options for an Instance. NextID: 9 -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set scheduling instances](struct.InstanceSetSchedulingCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Scheduling { - /// Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. - /// - /// By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. - #[serde(rename="automaticRestart")] - pub automatic_restart: Option, - /// A set of node affinity and anti-affinity. - #[serde(rename="nodeAffinities")] - pub node_affinities: Option>, - /// Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. - pub preemptible: Option, - /// Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options. - #[serde(rename="onHostMaintenance")] - pub on_host_maintenance: Option, -} - -impl RequestValue for Scheduling {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } +/// Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AutoscalerListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, +pub struct HttpFaultDelay { + /// The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. + /// The value must be between 0.0 and 100.0 inclusive. + pub percentage: Option, + /// Specifies the value of the fixed delay interval. + #[serde(rename="fixedDelay")] + pub fixed_delay: Option, } -impl NestedType for AutoscalerListWarningData {} -impl Part for AutoscalerListWarningData {} - - -/// [Output Only] A list of extended scratch disks assigned to the instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineTypeScratchDisks { - /// Size of the scratch disk, defined in GB. - #[serde(rename="diskGb")] - pub disk_gb: Option, -} - -impl NestedType for MachineTypeScratchDisks {} -impl Part for MachineTypeScratchDisks {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for VpnTunnelListWarningData {} -impl Part for VpnTunnelListWarningData {} +impl Part for HttpFaultDelay {} /// An instance's serial console output. @@ -15946,20 +19712,21 @@ pub struct SerialPortOutput { impl ResponseResult for SerialPortOutput {} -/// There is no detailed description. +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetPoolsScopedList { - /// Informational warning which replaces the list of addresses when the list is empty. - pub warning: Option, - /// A list of target pools contained in this scope. - #[serde(rename="targetPools")] - pub target_pools: Option>, +pub struct InstanceGroupManagerAggregatedListWarningData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl Part for TargetPoolsScopedList {} +impl NestedType for InstanceGroupManagerAggregatedListWarningData {} +impl Part for InstanceGroupManagerAggregatedListWarningData {} /// [Output Only] Informational warning message. @@ -15967,70 +19734,18 @@ impl Part for TargetPoolsScopedList {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterAggregatedListWarning { +pub struct ForwardingRuleAggregatedListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for RouterAggregatedListWarning {} -impl Part for RouterAggregatedListWarning {} - - -/// The policy describes the baseline against which Instance boot integrity is measured. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set shielded instance integrity policy instances](struct.InstanceSetShieldedInstanceIntegrityPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ShieldedInstanceIntegrityPolicy { - /// Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. - #[serde(rename="updateAutoLearnPolicy")] - pub update_auto_learn_policy: Option, -} - -impl RequestValue for ShieldedInstanceIntegrityPolicy {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupsScopedList { - /// [Output Only] An informational warning that replaces the list of instance groups when the list is empty. - pub warning: Option, - /// [Output Only] The list of instance groups that are contained in this scope. - #[serde(rename="instanceGroups")] - pub instance_groups: Option>, -} - -impl Part for InstanceGroupsScopedList {} - - -/// [Output Only] Metadata about this warning in key: value format. For example: -/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorTypesScopedListWarningData { - /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). - pub key: Option, - /// [Output Only] A warning data value corresponding to the key. - pub value: Option, -} - -impl NestedType for AcceleratorTypesScopedListWarningData {} -impl Part for AcceleratorTypesScopedListWarningData {} +impl NestedType for ForwardingRuleAggregatedListWarning {} +impl Part for ForwardingRuleAggregatedListWarning {} /// Service resource (a.k.a service project) ID. @@ -16049,265 +19764,70 @@ pub struct XpnResourceId { impl Part for XpnResourceId {} -/// Represents an Interconnect Attachment (VLAN) resource. -/// -/// You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [patch interconnect attachments](struct.InterconnectAttachmentPatchCall.html) (request) -/// * [delete interconnect attachments](struct.InterconnectAttachmentDeleteCall.html) (none) -/// * [aggregated list interconnect attachments](struct.InterconnectAttachmentAggregatedListCall.html) (none) -/// * [get interconnect attachments](struct.InterconnectAttachmentGetCall.html) (response) -/// * [list interconnect attachments](struct.InterconnectAttachmentListCall.html) (none) -/// * [insert interconnect attachments](struct.InterconnectAttachmentInsertCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterconnectAttachment { - /// Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. - #[serde(rename="partnerAsn")] - pub partner_asn: Option, - /// [Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. - #[serde(rename="customerRouterIpAddress")] - pub customer_router_ip_address: Option, - /// An optional description of this resource. - pub description: Option, - /// Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. - #[serde(rename="adminEnabled")] - pub admin_enabled: Option, - /// Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - /// - BPS_50M: 50 Mbit/s - /// - BPS_100M: 100 Mbit/s - /// - BPS_200M: 200 Mbit/s - /// - BPS_300M: 300 Mbit/s - /// - BPS_400M: 400 Mbit/s - /// - BPS_500M: 500 Mbit/s - /// - BPS_1G: 1 Gbit/s - /// - BPS_2G: 2 Gbit/s - /// - BPS_5G: 5 Gbit/s - /// - BPS_10G: 10 Gbit/s - pub bandwidth: Option, - /// Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google?s edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. - #[serde(rename="candidateSubnets")] - pub candidate_subnets: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. - #[serde(rename="cloudRouterIpAddress")] - pub cloud_router_ip_address: Option, - /// [Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments. - pub kind: Option, - /// The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. Only specified at creation time. - #[serde(rename="vlanTag8021q")] - pub vlan_tag8021q: Option, - /// URL of the underlying Interconnect object that this attachment's traffic will traverse through. - pub interconnect: Option, - /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. - #[serde(rename="privateInterconnectInfo")] - pub private_interconnect_info: Option, - /// [Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used. - #[serde(rename="googleReferenceId")] - pub google_reference_id: Option, - /// [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of an PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain" - #[serde(rename="pairingKey")] - pub pairing_key: Option, - /// [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - /// - ACTIVE: The attachment has been turned up and is ready to use. - /// - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - /// - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - /// - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - /// - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - /// - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. - pub state: Option, - /// [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: - /// - OS_ACTIVE: The attachment has been turned up and is ready to use. - /// - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - #[serde(rename="operationalStatus")] - pub operational_status: Option, - /// Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - /// - AVAILABILITY_DOMAIN_ANY - /// - AVAILABILITY_DOMAIN_1 - /// - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. - #[serde(rename="edgeAvailabilityDomain")] - pub edge_availability_domain: Option, - /// URL of the Cloud Router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network & region within which the Cloud Router is configured. - pub router: Option, - /// Informational metadata about Partner attachments from Partners to display to customers. Output only for for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED. - #[serde(rename="partnerMetadata")] - pub partner_metadata: Option, - /// The type of interconnect attachment this is, which can take one of the following values: - /// - DEDICATED: an attachment to a Dedicated Interconnect. - /// - PARTNER: an attachment to a Partner Interconnect, created by the customer. - /// - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. - #[serde(rename="type")] - pub type_: Option, - /// [Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. - pub region: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for InterconnectAttachment {} -impl Resource for InterconnectAttachment {} -impl ResponseResult for InterconnectAttachment {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set instance template region instance group managers](struct.RegionInstanceGroupManagerSetInstanceTemplateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegionInstanceGroupManagersSetTemplateRequest { - /// URL of the InstanceTemplate resource from which all new instances will be created. - #[serde(rename="instanceTemplate")] - pub instance_template: Option, -} - -impl RequestValue for RegionInstanceGroupManagersSetTemplateRequest {} - - -/// Description-tagged IP ranges for the router to advertise. +/// [Output Only] Informational warning message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterAdvertisedIpRange { - /// The IP range to advertise. The value must be a CIDR-formatted string. - pub range: Option, - /// User-specified description for the IP range. - pub description: Option, -} - -impl Part for RouterAdvertisedIpRange {} - - -/// Represents a Machine Type resource. -/// -/// You can use specific machine types for your VM instances based on performance and pricing requirements. For more information, read Machine Types. (== resource_for v1.machineTypes ==) (== resource_for beta.machineTypes ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list machine types](struct.MachineTypeListCall.html) (none) -/// * [aggregated list machine types](struct.MachineTypeAggregatedListCall.html) (none) -/// * [get machine types](struct.MachineTypeGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MachineType { - /// [Output Only] The number of virtual CPUs that are available to the instance. - #[serde(rename="guestCpus")] - pub guest_cpus: Option, - /// [Deprecated] This property is deprecated and will never be populated with any relevant values. - #[serde(rename="imageSpaceGb")] - pub image_space_gb: Option, - /// [Output Only] The type of the resource. Always compute#machineType for machine types. - pub kind: Option, - /// [Output Only] An optional textual description of the resource. - pub description: Option, - /// [Output Only] The name of the zone where the machine type resides, such as us-central1-a. - pub zone: Option, - /// [Output Only] Maximum total persistent disks size (GB) allowed. - #[serde(rename="maximumPersistentDisksSizeGb")] - pub maximum_persistent_disks_size_gb: Option, - /// [Output Only] The deprecation status associated with this machine type. - pub deprecated: Option, - /// [Output Only] Maximum persistent disks allowed. - #[serde(rename="maximumPersistentDisks")] - pub maximum_persistent_disks: Option, - /// [Output Only] The amount of physical memory available to the instance, defined in MB. - #[serde(rename="memoryMb")] - pub memory_mb: Option, - /// [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. - #[serde(rename="isSharedCpu")] - pub is_shared_cpu: Option, - /// [Output Only] A list of extended scratch disks assigned to the instance. - #[serde(rename="scratchDisks")] - pub scratch_disks: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// [Output Only] Name of the resource. - pub name: Option, -} - -impl Resource for MachineType {} -impl ResponseResult for MachineType {} - - -/// A specification of the type and number of accelerator cards attached to the instance. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorConfig { - /// The number of the guest accelerator cards exposed to this instance. - #[serde(rename="acceleratorCount")] - pub accelerator_count: Option, - /// Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. - #[serde(rename="acceleratorType")] - pub accelerator_type: Option, -} - -impl Part for AcceleratorConfig {} - - -/// Informational warning which replaces the list of addresses when the list is empty. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VpnTunnelsScopedListWarning { +pub struct AcceleratorTypeListWarning { /// [Output Only] A human-readable description of the warning code. pub message: Option, /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. pub code: Option, /// [Output Only] Metadata about this warning in key: value format. For example: /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, + pub data: Option>, } -impl NestedType for VpnTunnelsScopedListWarning {} -impl Part for VpnTunnelsScopedListWarning {} +impl NestedType for AcceleratorTypeListWarning {} +impl Part for AcceleratorTypeListWarning {} -/// Time window specified for daily operations. +/// Contains a list of TargetPool resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list target pools](struct.TargetPoolListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TargetPoolList { + /// [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. + pub kind: Option, + /// [Output Only] Informational warning message. + pub warning: Option, + /// A list of TargetPool resources. + pub items: Option>, + /// [Output Only] Unique identifier for the resource; defined by the server. + pub id: Option, + /// [Output Only] Server-defined URL for this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for TargetPoolList {} + + +/// [Output Only] Metadata about this warning in key: value format. For example: +/// "data": [ { "key": "scope", "value": "zones/us-east1-d" } /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResourcePolicyDailyCycle { - /// [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. - pub duration: Option, - /// Defines a schedule that runs every nth day of the month. - #[serde(rename="daysInCycle")] - pub days_in_cycle: Option, - /// Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. - #[serde(rename="startTime")] - pub start_time: Option, +pub struct OperationWarningsData { + /// [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + pub key: Option, + /// [Output Only] A warning data value corresponding to the key. + pub value: Option, } -impl Part for ResourcePolicyDailyCycle {} +impl NestedType for OperationWarningsData {} +impl Part for OperationWarningsData {} /// There is no detailed description. @@ -16318,7 +19838,23 @@ impl Part for ResourcePolicyDailyCycle {} pub struct AutoscalerStatusDetails { /// The status message. pub message: Option, - /// The type of error returned. + /// The type of error, warning, or notice returned. Current set of possible values: + /// - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state). + /// - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group. + /// - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas. + /// - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling. + /// - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels. + /// - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. + /// - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling. + /// - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. + /// - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. + /// - MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only up" mode. The autoscaler can add instances but not remove any. + /// - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it. + /// - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances. + /// - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region. + /// - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist. + /// - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. + /// - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions. #[serde(rename="type")] pub type_: Option, } @@ -16326,60 +19862,6 @@ pub struct AutoscalerStatusDetails { impl Part for AutoscalerStatusDetails {} -/// [Output Only] Informational warning message. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceListReferrersWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, -} - -impl NestedType for InstanceListReferrersWarning {} -impl Part for InstanceListReferrersWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set ssl certificates target ssl proxies](struct.TargetSslProxySetSslCertificateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TargetSslProxiesSetSslCertificatesRequest { - /// New set of URLs to SslCertificate resources to associate with this TargetSslProxy. Currently exactly one ssl certificate must be specified. - #[serde(rename="sslCertificates")] - pub ssl_certificates: Option>, -} - -impl RequestValue for TargetSslProxiesSetSslCertificatesRequest {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupManagersScopedList { - /// [Output Only] The warning that replaces the list of managed instance groups when the list is empty. - pub warning: Option, - /// [Output Only] The list of managed instance groups that are contained in the specified project and zone. - #[serde(rename="instanceGroupManagers")] - pub instance_group_managers: Option>, -} - -impl Part for InstanceGroupManagersScopedList {} - - /// Commitment for a particular resource (a Commitment is composed of one or more of these). /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -16399,186 +19881,32 @@ pub struct ResourceCommitment { impl Part for ResourceCommitment {} -/// [Output Only] Informational warning message. +/// A specification of the desired way to instantiate a disk in the instance template when its created from a source instance. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HttpsHealthCheckListWarning { - /// [Output Only] A human-readable description of the warning code. - pub message: Option, - /// [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. - pub code: Option, - /// [Output Only] Metadata about this warning in key: value format. For example: - /// "data": [ { "key": "scope", "value": "zones/us-east1-d" } - pub data: Option>, +pub struct DiskInstantiationConfig { + /// Specifies the device name of the disk to which the configurations apply to. + #[serde(rename="deviceName")] + pub device_name: Option, + /// The custom source image to be used to restore this disk when instantiating this instance template. + #[serde(rename="customImage")] + pub custom_image: Option, + /// Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + #[serde(rename="autoDelete")] + pub auto_delete: Option, + /// Specifies whether to include the disk and what image to use. Possible values are: + /// - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. + /// - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. + /// - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. + /// - attach-read-only: to attach a read-only disk. Applicable to read-only disks. + /// - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. + #[serde(rename="instantiateFrom")] + pub instantiate_from: Option, } -impl NestedType for HttpsHealthCheckListWarning {} -impl Part for HttpsHealthCheckListWarning {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add resource policies disks](struct.DiskAddResourcePolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DisksAddResourcePoliciesRequest { - /// Resource policies to be added to this disk. - #[serde(rename="resourcePolicies")] - pub resource_policies: Option>, -} - -impl RequestValue for DisksAddResourcePoliciesRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [add nodes node groups](struct.NodeGroupAddNodeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeGroupsAddNodesRequest { - /// Count of additional nodes to be added to the node group. - #[serde(rename="additionalNodeCount")] - pub additional_node_count: Option, -} - -impl RequestValue for NodeGroupsAddNodesRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get router status routers](struct.RouterGetRouterStatuCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RouterStatusResponse { - /// Type of resource. - pub kind: Option, - /// no description provided - pub result: Option, -} - -impl ResponseResult for RouterStatusResponse {} - - -/// Represents a Persistent Disk Snapshot resource. -/// -/// You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==) -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [set iam policy snapshots](struct.SnapshotSetIamPolicyCall.html) (none) -/// * [delete snapshots](struct.SnapshotDeleteCall.html) (none) -/// * [get iam policy snapshots](struct.SnapshotGetIamPolicyCall.html) (none) -/// * [test iam permissions snapshots](struct.SnapshotTestIamPermissionCall.html) (none) -/// * [get snapshots](struct.SnapshotGetCall.html) (response) -/// * [create snapshot region disks](struct.RegionDiskCreateSnapshotCall.html) (request) -/// * [create snapshot disks](struct.DiskCreateSnapshotCall.html) (request) -/// * [list snapshots](struct.SnapshotListCall.html) (none) -/// * [set labels snapshots](struct.SnapshotSetLabelCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Snapshot { - /// [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. - pub status: Option, - /// The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. - #[serde(rename="sourceDiskEncryptionKey")] - pub source_disk_encryption_key: Option, - /// An optional description of this resource. Provide this property when you create the resource. - pub description: Option, - /// A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. - /// - /// To see the latest fingerprint, make a get() request to retrieve a snapshot. - #[serde(rename="labelFingerprint")] - pub label_fingerprint: Option, - /// Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. - pub labels: Option>, - /// [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. - #[serde(rename="sourceDiskId")] - pub source_disk_id: Option, - /// [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). - pub licenses: Option>, - /// [Output Only] Creation timestamp in RFC3339 text format. - #[serde(rename="creationTimestamp")] - pub creation_timestamp: Option, - /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. - pub id: Option, - /// [Output Only] Integer license codes indicating which licenses are attached to this snapshot. - #[serde(rename="licenseCodes")] - pub license_codes: Option>, - /// [Output Only] Set to true if snapshots are automatically by applying resource policy on the target disk. - #[serde(rename="autoCreated")] - pub auto_created: Option, - /// [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. - pub kind: Option, - /// [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. - #[serde(rename="storageBytes")] - pub storage_bytes: Option, - /// Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - pub name: Option, - /// [Output Only] The source disk used to create this snapshot. - #[serde(rename="sourceDisk")] - pub source_disk: Option, - /// [Output Only] Size of the snapshot, specified in GB. - #[serde(rename="diskSizeGb")] - pub disk_size_gb: Option, - /// GCS bucket storage location of the snapshot (regional or multi-regional). - #[serde(rename="storageLocations")] - pub storage_locations: Option>, - /// Encrypts the snapshot using a customer-supplied encryption key. - /// - /// After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. - /// - /// Customer-supplied encryption keys do not protect access to metadata of the snapshot. - /// - /// If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. - #[serde(rename="snapshotEncryptionKey")] - pub snapshot_encryption_key: Option, - /// [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. - #[serde(rename="storageBytesStatus")] - pub storage_bytes_status: Option, - /// [Output Only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for Snapshot {} -impl Resource for Snapshot {} -impl ResponseResult for Snapshot {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkEndpointGroupsScopedList { - /// [Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty. - pub warning: Option, - /// [Output Only] The list of network endpoint groups that are contained in this scope. - #[serde(rename="networkEndpointGroups")] - pub network_endpoint_groups: Option>, -} - -impl Part for NetworkEndpointGroupsScopedList {} +impl Part for DiskInstantiationConfig {} /// There is no detailed description. @@ -16832,20 +20160,19 @@ impl<'a, C, A> BackendBucketMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds a key for validating requests with signed URLs for this backend bucket. + /// Retrieves the list of BackendBucket resources available to the specified project. /// /// # Arguments /// - /// * `request` - No description provided. /// * `project` - Project ID for this request. - /// * `backendBucket` - Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. - pub fn add_signed_url_key(&self, request: SignedUrlKey, project: &str, backend_bucket: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { - BackendBucketAddSignedUrlKeyCall { + pub fn list(&self, project: &str) -> BackendBucketListCall<'a, C, A> { + BackendBucketListCall { hub: self.hub, - _request: request, _project: project.to_string(), - _backend_bucket: backend_bucket.to_string(), - _request_id: Default::default(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -16913,27 +20240,6 @@ impl<'a, C, A> BackendBucketMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of BackendBucket resources available to the specified project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn list(&self, project: &str) -> BackendBucketListCall<'a, C, A> { - BackendBucketListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. @@ -16977,6 +20283,28 @@ impl<'a, C, A> BackendBucketMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Adds a key for validating requests with signed URLs for this backend bucket. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `backendBucket` - Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + pub fn add_signed_url_key(&self, request: SignedUrlKey, project: &str, backend_bucket: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { + BackendBucketAddSignedUrlKeyCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _backend_bucket: backend_bucket.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -17354,6 +20682,408 @@ impl<'a, C, A> InterconnectMethods<'a, C, A> { +/// A builder providing access to all methods supported on *regionUrlMap* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)`, `update(...)` and `validate(...)` +/// // to build up your call. +/// let rb = hub.region_url_maps(); +/// # } +/// ``` +pub struct RegionUrlMapMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionUrlMapMethods<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified UrlMap resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `urlMap` - Name of the UrlMap resource to delete. + pub fn delete(&self, project: &str, region: &str, url_map: &str) -> RegionUrlMapDeleteCall<'a, C, A> { + RegionUrlMapDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _url_map: url_map.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `urlMap` - Name of the UrlMap resource to patch. + pub fn patch(&self, request: UrlMap, project: &str, region: &str, url_map: &str) -> RegionUrlMapPatchCall<'a, C, A> { + RegionUrlMapPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _url_map: url_map.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `urlMap` - Name of the UrlMap resource to return. + pub fn get(&self, project: &str, region: &str, url_map: &str) -> RegionUrlMapGetCall<'a, C, A> { + RegionUrlMapGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _url_map: url_map.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a UrlMap resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn insert(&self, request: UrlMap, project: &str, region: &str) -> RegionUrlMapInsertCall<'a, C, A> { + RegionUrlMapInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of UrlMap resources available to the specified project in the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionUrlMapListCall<'a, C, A> { + RegionUrlMapListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `urlMap` - Name of the UrlMap resource to be validated as. + pub fn validate(&self, request: RegionUrlMapsValidateRequest, project: &str, region: &str, url_map: &str) -> RegionUrlMapValidateCall<'a, C, A> { + RegionUrlMapValidateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _url_map: url_map.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified UrlMap resource with the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `urlMap` - Name of the UrlMap resource to update. + pub fn update(&self, request: UrlMap, project: &str, region: &str, url_map: &str) -> RegionUrlMapUpdateCall<'a, C, A> { + RegionUrlMapUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _url_map: url_map.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *regionBackendService* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `get_health(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.region_backend_services(); +/// # } +/// ``` +pub struct RegionBackendServiceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionBackendServiceMethods<'a, C, A> {} + +impl<'a, C, A> RegionBackendServiceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Understanding backend services for more information. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn insert(&self, request: BackendService, project: &str, region: &str) -> RegionBackendServiceInsertCall<'a, C, A> { + RegionBackendServiceInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of regional BackendService resources available to the specified project in the given region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionBackendServiceListCall<'a, C, A> { + RegionBackendServiceListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `backendService` - Name of the BackendService resource to update. + pub fn update(&self, request: BackendService, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceUpdateCall<'a, C, A> { + RegionBackendServiceUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _backend_service: backend_service.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified regional BackendService resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `backendService` - Name of the BackendService resource to return. + pub fn get(&self, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceGetCall<'a, C, A> { + RegionBackendServiceGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _backend_service: backend_service.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified regional BackendService resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `backendService` - Name of the BackendService resource to delete. + pub fn delete(&self, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { + RegionBackendServiceDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _backend_service: backend_service.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `backendService` - Name of the BackendService resource to patch. + pub fn patch(&self, request: BackendService, project: &str, region: &str, backend_service: &str) -> RegionBackendServicePatchCall<'a, C, A> { + RegionBackendServicePatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _backend_service: backend_service.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the most recent health check results for this regional BackendService. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - No description provided. + /// * `region` - Name of the region scoping this request. + /// * `backendService` - Name of the BackendService resource for which to get health. + pub fn get_health(&self, request: ResourceGroupReference, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceGetHealthCall<'a, C, A> { + RegionBackendServiceGetHealthCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _backend_service: backend_service.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *reservation* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -17395,7 +21125,7 @@ impl<'a, C, A> ReservationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves all information of the specified reservation. + /// Retrieves information about the specified reservation. /// /// # Arguments /// @@ -17414,29 +21144,6 @@ impl<'a, C, A> ReservationMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// A list all the reservations that have been configured for the specified project in specified zone. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - Name of the zone for this request. - pub fn list(&self, project: &str, zone: &str) -> ReservationListCall<'a, C, A> { - ReservationListCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes the specified reservation. @@ -17459,6 +21166,29 @@ impl<'a, C, A> ReservationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// A list of all the reservations that have been configured for the specified project in specified zone. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - Name of the zone for this request. + pub fn list(&self, project: &str, zone: &str) -> ReservationListCall<'a, C, A> { + ReservationListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves an aggregated list of reservations. @@ -17473,6 +21203,7 @@ impl<'a, C, A> ReservationMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -17528,7 +21259,7 @@ impl<'a, C, A> ReservationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resizes the reservation (applicable to standalone reservations only) + /// Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. /// /// # Arguments /// @@ -17596,6 +21327,152 @@ impl<'a, C, A> ReservationMethods<'a, C, A> { +/// A builder providing access to all methods supported on *globalOperation* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `list(...)` and `wait(...)` +/// // to build up your call. +/// let rb = hub.global_operations(); +/// # } +/// ``` +pub struct GlobalOperationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for GlobalOperationMethods<'a, C, A> {} + +impl<'a, C, A> GlobalOperationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of Operation resources contained within the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> GlobalOperationListCall<'a, C, A> { + GlobalOperationListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + /// + /// This method is called on a best-effort basis. Specifically: + /// - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + /// - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `operation` - Name of the Operations resource to return. + pub fn wait(&self, project: &str, operation: &str) -> GlobalOperationWaitCall<'a, C, A> { + GlobalOperationWaitCall { + hub: self.hub, + _project: project.to_string(), + _operation: operation.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified Operations resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `operation` - Name of the Operations resource to delete. + pub fn delete(&self, project: &str, operation: &str) -> GlobalOperationDeleteCall<'a, C, A> { + GlobalOperationDeleteCall { + hub: self.hub, + _project: project.to_string(), + _operation: operation.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of all operations. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + GlobalOperationAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `operation` - Name of the Operations resource to return. + pub fn get(&self, project: &str, operation: &str) -> GlobalOperationGetCall<'a, C, A> { + GlobalOperationGetCall { + hub: self.hub, + _project: project.to_string(), + _operation: operation.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *globalAddresse* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -17940,27 +21817,6 @@ impl<'a, C, A> MethodsBuilder for SnapshotMethods<'a, C, A> {} impl<'a, C, A> SnapshotMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Returns permissions that a caller has on the specified resource. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `resource` - Name or id of the resource for this request. - pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, resource: &str) -> SnapshotTestIamPermissionCall<'a, C, A> { - SnapshotTestIamPermissionCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. @@ -18002,6 +21858,27 @@ impl<'a, C, A> SnapshotMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, resource: &str) -> SnapshotTestIamPermissionCall<'a, C, A> { + SnapshotTestIamPermissionCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the access control policy on the specified resource. Replaces any existing policy. @@ -18161,6 +22038,7 @@ impl<'a, C, A> DiskTypeMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -18194,7 +22072,7 @@ impl<'a, C, A> DiskTypeMethods<'a, C, A> { -/// A builder providing access to all methods supported on *zone* resources. +/// A builder providing access to all methods supported on *externalVpnGateway* resources. /// It is not used directly, but through the `Compute` hub. /// /// # Example @@ -18218,34 +22096,35 @@ impl<'a, C, A> DiskTypeMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)` and `list(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `set_labels(...)` and `test_iam_permissions(...)` /// // to build up your call. -/// let rb = hub.zones(); +/// let rb = hub.external_vpn_gateways(); /// # } /// ``` -pub struct ZoneMethods<'a, C, A> +pub struct ExternalVpnGatewayMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, } -impl<'a, C, A> MethodsBuilder for ZoneMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for ExternalVpnGatewayMethods<'a, C, A> {} -impl<'a, C, A> ZoneMethods<'a, C, A> { +impl<'a, C, A> ExternalVpnGatewayMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the specified Zone resource. Gets a list of available zones by making a list() request. + /// Creates a ExternalVpnGateway in the specified project using the data included in the request. /// /// # Arguments /// + /// * `request` - No description provided. /// * `project` - Project ID for this request. - /// * `zone` - Name of the zone resource to return. - pub fn get(&self, project: &str, zone: &str) -> ZoneGetCall<'a, C, A> { - ZoneGetCall { + pub fn insert(&self, request: ExternalVpnGateway, project: &str) -> ExternalVpnGatewayInsertCall<'a, C, A> { + ExternalVpnGatewayInsertCall { hub: self.hub, + _request: request, _project: project.to_string(), - _zone: zone.to_string(), + _request_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -18254,13 +22133,94 @@ impl<'a, C, A> ZoneMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of Zone resources available to the specified project. + /// Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn set_labels(&self, request: GlobalSetLabelsRequest, project: &str, resource: &str) -> ExternalVpnGatewaySetLabelCall<'a, C, A> { + ExternalVpnGatewaySetLabelCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. /// /// # Arguments /// /// * `project` - Project ID for this request. - pub fn list(&self, project: &str) -> ZoneListCall<'a, C, A> { - ZoneListCall { + /// * `externalVpnGateway` - Name of the externalVpnGateway to return. + pub fn get(&self, project: &str, external_vpn_gateway: &str) -> ExternalVpnGatewayGetCall<'a, C, A> { + ExternalVpnGatewayGetCall { + hub: self.hub, + _project: project.to_string(), + _external_vpn_gateway: external_vpn_gateway.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified externalVpnGateway. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `externalVpnGateway` - Name of the externalVpnGateways to delete. + pub fn delete(&self, project: &str, external_vpn_gateway: &str) -> ExternalVpnGatewayDeleteCall<'a, C, A> { + ExternalVpnGatewayDeleteCall { + hub: self.hub, + _project: project.to_string(), + _external_vpn_gateway: external_vpn_gateway.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, resource: &str) -> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> { + ExternalVpnGatewayTestIamPermissionCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of ExternalVpnGateway available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> ExternalVpnGatewayListCall<'a, C, A> { + ExternalVpnGatewayListCall { hub: self.hub, _project: project.to_string(), _page_token: Default::default(), @@ -18300,7 +22260,7 @@ impl<'a, C, A> ZoneMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `add_access_config(...)`, `aggregated_list(...)`, `attach_disk(...)`, `delete(...)`, `delete_access_config(...)`, `detach_disk(...)`, `get(...)`, `get_guest_attributes(...)`, `get_iam_policy(...)`, `get_serial_port_output(...)`, `get_shielded_instance_identity(...)`, `insert(...)`, `list(...)`, `list_referrers(...)`, `reset(...)`, `set_deletion_protection(...)`, `set_disk_auto_delete(...)`, `set_iam_policy(...)`, `set_labels(...)`, `set_machine_resources(...)`, `set_machine_type(...)`, `set_metadata(...)`, `set_min_cpu_platform(...)`, `set_scheduling(...)`, `set_service_account(...)`, `set_shielded_instance_integrity_policy(...)`, `set_tags(...)`, `simulate_maintenance_event(...)`, `start(...)`, `start_with_encryption_key(...)`, `stop(...)`, `test_iam_permissions(...)`, `update_access_config(...)`, `update_network_interface(...)` and `update_shielded_instance_config(...)` +/// // like `add_access_config(...)`, `add_resource_policies(...)`, `aggregated_list(...)`, `attach_disk(...)`, `delete(...)`, `delete_access_config(...)`, `detach_disk(...)`, `get(...)`, `get_guest_attributes(...)`, `get_iam_policy(...)`, `get_serial_port_output(...)`, `get_shielded_instance_identity(...)`, `insert(...)`, `list(...)`, `list_referrers(...)`, `remove_resource_policies(...)`, `reset(...)`, `set_deletion_protection(...)`, `set_disk_auto_delete(...)`, `set_iam_policy(...)`, `set_labels(...)`, `set_machine_resources(...)`, `set_machine_type(...)`, `set_metadata(...)`, `set_min_cpu_platform(...)`, `set_scheduling(...)`, `set_service_account(...)`, `set_shielded_instance_integrity_policy(...)`, `set_tags(...)`, `simulate_maintenance_event(...)`, `start(...)`, `start_with_encryption_key(...)`, `stop(...)`, `test_iam_permissions(...)`, `update(...)`, `update_access_config(...)`, `update_display_device(...)`, `update_network_interface(...)` and `update_shielded_instance_config(...)` /// // to build up your call. /// let rb = hub.instances(); /// # } @@ -18339,6 +22299,30 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `instance` - Name of the instance scoping this request. + pub fn set_machine_resources(&self, request: InstancesSetMachineResourcesRequest, project: &str, zone: &str, instance: &str) -> InstanceSetMachineResourceCall<'a, C, A> { + InstanceSetMachineResourceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance: instance.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets an instance's scheduling options. @@ -18411,6 +22395,32 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `instance` - Name of the instance resource to update. + pub fn update(&self, request: Instance, project: &str, zone: &str, instance: &str) -> InstanceUpdateCall<'a, C, A> { + InstanceUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance: instance.to_string(), + _request_id: Default::default(), + _most_disruptive_allowed_action: Default::default(), + _minimal_action: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns the specified guest attributes entry. @@ -18478,6 +22488,30 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `instance` - Name or id of the instance scoping this request. + pub fn set_shielded_instance_integrity_policy(&self, request: ShieldedInstanceIntegrityPolicy, project: &str, zone: &str, instance: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + InstanceSetShieldedInstanceIntegrityPolicyCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance: instance.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Simulates a maintenance event on the instance. @@ -18618,31 +22652,6 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `instance` - The instance name for this request. - pub fn attach_disk(&self, request: AttachedDisk, project: &str, zone: &str, instance: &str) -> InstanceAttachDiskCall<'a, C, A> { - InstanceAttachDiskCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance: instance.to_string(), - _request_id: Default::default(), - _force_attach: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances. @@ -18668,6 +22677,30 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Removes resource policies from an instance. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `instance` - The instance name for this request. + pub fn remove_resource_policies(&self, request: InstancesRemoveResourcePoliciesRequest, project: &str, zone: &str, instance: &str) -> InstanceRemoveResourcePolicyCall<'a, C, A> { + InstanceRemoveResourcePolicyCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance: instance.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. @@ -18730,6 +22763,7 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -18782,6 +22816,28 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `instance` - Name of the instance resource to stop. + pub fn stop(&self, project: &str, zone: &str, instance: &str) -> InstanceStopCall<'a, C, A> { + InstanceStopCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance: instance.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes an access config from an instance's network interface. @@ -18810,22 +22866,23 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `zone` - The name of the zone for this request. - /// * `instance` - Name or id of the instance scoping this request. - pub fn set_shielded_instance_integrity_policy(&self, request: ShieldedInstanceIntegrityPolicy, project: &str, zone: &str, instance: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { - InstanceSetShieldedInstanceIntegrityPolicyCall { + /// * `instance` - The instance name for this request. + pub fn attach_disk(&self, request: AttachedDisk, project: &str, zone: &str, instance: &str) -> InstanceAttachDiskCall<'a, C, A> { + InstanceAttachDiskCall { hub: self.hub, _request: request, _project: project.to_string(), _zone: zone.to_string(), _instance: instance.to_string(), _request_id: Default::default(), + _force_attach: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -18882,21 +22939,24 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns permissions that a caller has on the specified resource. + /// Adds an access config to an instance's network interface. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `zone` - The name of the zone for this request. - /// * `resource` - Name or id of the resource for this request. - pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, zone: &str, resource: &str) -> InstanceTestIamPermissionCall<'a, C, A> { - InstanceTestIamPermissionCall { + /// * `instance` - The instance name for this request. + /// * `networkInterface` - The name of the network interface to add to this instance. + pub fn add_access_config(&self, request: AccessConfig, project: &str, zone: &str, instance: &str, network_interface: &str) -> InstanceAddAccessConfigCall<'a, C, A> { + InstanceAddAccessConfigCall { hub: self.hub, _request: request, _project: project.to_string(), _zone: zone.to_string(), - _resource: resource.to_string(), + _instance: instance.to_string(), + _network_interface: network_interface.to_string(), + _request_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -18926,6 +22986,29 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, zone: &str, resource: &str) -> InstanceTestIamPermissionCall<'a, C, A> { + InstanceTestIamPermissionCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns the last 1 MB of serial port output from the specified instance. @@ -18975,54 +23058,6 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Adds an access config to an instance's network interface. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `instance` - The instance name for this request. - /// * `networkInterface` - The name of the network interface to add to this instance. - pub fn add_access_config(&self, request: AccessConfig, project: &str, zone: &str, instance: &str, network_interface: &str) -> InstanceAddAccessConfigCall<'a, C, A> { - InstanceAddAccessConfigCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance: instance.to_string(), - _network_interface: network_interface.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `instance` - Name of the instance resource to stop. - pub fn stop(&self, project: &str, zone: &str, instance: &str) -> InstanceStopCall<'a, C, A> { - InstanceStopCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _instance: instance.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Sets the access control policy on the specified resource. Replaces any existing policy. @@ -19092,7 +23127,7 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + /// Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// # Arguments /// @@ -19100,8 +23135,32 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// * `project` - Project ID for this request. /// * `zone` - The name of the zone for this request. /// * `instance` - Name of the instance scoping this request. - pub fn set_machine_resources(&self, request: InstancesSetMachineResourcesRequest, project: &str, zone: &str, instance: &str) -> InstanceSetMachineResourceCall<'a, C, A> { - InstanceSetMachineResourceCall { + pub fn update_display_device(&self, request: DisplayDevice, project: &str, zone: &str, instance: &str) -> InstanceUpdateDisplayDeviceCall<'a, C, A> { + InstanceUpdateDisplayDeviceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance: instance.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `instance` - The instance name for this request. + pub fn add_resource_policies(&self, request: InstancesAddResourcePoliciesRequest, project: &str, zone: &str, instance: &str) -> InstanceAddResourcePolicyCall<'a, C, A> { + InstanceAddResourcePolicyCall { hub: self.hub, _request: request, _project: project.to_string(), @@ -19140,6 +23199,136 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { +/// A builder providing access to all methods supported on *regionSslCertificate* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.region_ssl_certificates(); +/// # } +/// ``` +pub struct RegionSslCertificateMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionSslCertificateMethods<'a, C, A> {} + +impl<'a, C, A> RegionSslCertificateMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified SslCertificate resource in the region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `sslCertificate` - Name of the SslCertificate resource to delete. + pub fn delete(&self, project: &str, region: &str, ssl_certificate: &str) -> RegionSslCertificateDeleteCall<'a, C, A> { + RegionSslCertificateDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _ssl_certificate: ssl_certificate.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a SslCertificate resource in the specified project and region using the data included in the request + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn insert(&self, request: SslCertificate, project: &str, region: &str) -> RegionSslCertificateInsertCall<'a, C, A> { + RegionSslCertificateInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of SslCertificate resources available to the specified project in the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionSslCertificateListCall<'a, C, A> { + RegionSslCertificateListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `sslCertificate` - Name of the SslCertificate resource to return. + pub fn get(&self, project: &str, region: &str, ssl_certificate: &str) -> RegionSslCertificateGetCall<'a, C, A> { + RegionSslCertificateGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _ssl_certificate: ssl_certificate.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *securityPolicy* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -19164,7 +23353,7 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `add_rule(...)`, `delete(...)`, `get(...)`, `get_rule(...)`, `insert(...)`, `list(...)`, `patch(...)`, `patch_rule(...)` and `remove_rule(...)` +/// // like `add_rule(...)`, `delete(...)`, `get(...)`, `get_rule(...)`, `insert(...)`, `list(...)`, `list_preconfigured_expression_sets(...)`, `patch(...)`, `patch_rule(...)` and `remove_rule(...)` /// // to build up your call. /// let rb = hub.security_policies(); /// # } @@ -19179,6 +23368,26 @@ impl<'a, C, A> MethodsBuilder for SecurityPolicyMethods<'a, C, A> {} impl<'a, C, A> SecurityPolicyMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Deletes a rule at the specified priority. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `securityPolicy` - Name of the security policy to update. + pub fn remove_rule(&self, project: &str, security_policy: &str) -> SecurityPolicyRemoveRuleCall<'a, C, A> { + SecurityPolicyRemoveRuleCall { + hub: self.hub, + _project: project.to_string(), + _security_policy: security_policy.to_string(), + _priority: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Inserts a rule into a security policy. @@ -19220,6 +23429,27 @@ impl<'a, C, A> SecurityPolicyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list_preconfigured_expression_sets(&self, project: &str) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> { + SecurityPolicyListPreconfiguredExpressionSetCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Patches the specified policy with the data included in the request. @@ -19343,26 +23573,6 @@ impl<'a, C, A> SecurityPolicyMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Deletes a rule at the specified priority. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `securityPolicy` - Name of the security policy to update. - pub fn remove_rule(&self, project: &str, security_policy: &str) -> SecurityPolicyRemoveRuleCall<'a, C, A> { - SecurityPolicyRemoveRuleCall { - hub: self.hub, - _project: project.to_string(), - _security_policy: security_policy.to_string(), - _priority: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -19449,7 +23659,7 @@ impl<'a, C, A> BackendServiceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + /// Updates the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. /// /// # Arguments /// @@ -19471,7 +23681,7 @@ impl<'a, C, A> BackendServiceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// Patches the specified BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// # Arguments /// @@ -19546,6 +23756,7 @@ impl<'a, C, A> BackendServiceMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -19620,7 +23831,7 @@ impl<'a, C, A> BackendServiceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + /// Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Understanding backend services for more information. /// /// # Arguments /// @@ -19741,6 +23952,26 @@ impl<'a, C, A> ImageMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified image. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `image` - Name of the image resource to delete. + pub fn delete(&self, project: &str, image: &str) -> ImageDeleteCall<'a, C, A> { + ImageDeleteCall { + hub: self.hub, + _project: project.to_string(), + _image: image.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the deprecation status of an image. @@ -19786,44 +24017,6 @@ impl<'a, C, A> ImageMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `resource` - Name or id of the resource for this request. - pub fn get_iam_policy(&self, project: &str, resource: &str) -> ImageGetIamPolicyCall<'a, C, A> { - ImageGetIamPolicyCall { - hub: self.hub, - _project: project.to_string(), - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the latest image that is part of an image family and is not deprecated. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `family` - Name of the image family to search for. - pub fn get_from_family(&self, project: &str, family: &str) -> ImageGetFromFamilyCall<'a, C, A> { - ImageGetFromFamilyCall { - hub: self.hub, - _project: project.to_string(), - _family: family.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Creates an image in the specified project using the data included in the request. @@ -19847,18 +24040,17 @@ impl<'a, C, A> ImageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified image. + /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. /// /// # Arguments /// /// * `project` - Project ID for this request. - /// * `image` - Name of the image resource to delete. - pub fn delete(&self, project: &str, image: &str) -> ImageDeleteCall<'a, C, A> { - ImageDeleteCall { + /// * `resource` - Name or id of the resource for this request. + pub fn get_iam_policy(&self, project: &str, resource: &str) -> ImageGetIamPolicyCall<'a, C, A> { + ImageGetIamPolicyCall { hub: self.hub, _project: project.to_string(), - _image: image.to_string(), - _request_id: Default::default(), + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -19885,11 +24077,30 @@ impl<'a, C, A> ImageMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Returns the latest image that is part of an image family and is not deprecated. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `family` - Name of the image family to search for. + pub fn get_from_family(&self, project: &str, family: &str) -> ImageGetFromFamilyCall<'a, C, A> { + ImageGetFromFamilyCall { + hub: self.hub, + _project: project.to_string(), + _family: family.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } -/// A builder providing access to all methods supported on *regionBackendService* resources. +/// A builder providing access to all methods supported on *regionAutoscaler* resources. /// It is not used directly, but through the `Compute` hub. /// /// # Example @@ -19913,31 +24124,97 @@ impl<'a, C, A> ImageMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `get_health(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` /// // to build up your call. -/// let rb = hub.region_backend_services(); +/// let rb = hub.region_autoscalers(); /// # } /// ``` -pub struct RegionBackendServiceMethods<'a, C, A> +pub struct RegionAutoscalerMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, } -impl<'a, C, A> MethodsBuilder for RegionBackendServiceMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for RegionAutoscalerMethods<'a, C, A> {} -impl<'a, C, A> RegionBackendServiceMethods<'a, C, A> { +impl<'a, C, A> RegionAutoscalerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of regional BackendService resources available to the specified project in the given region. + /// Deletes the specified autoscaler. /// /// # Arguments /// /// * `project` - Project ID for this request. /// * `region` - Name of the region scoping this request. - pub fn list(&self, project: &str, region: &str) -> RegionBackendServiceListCall<'a, C, A> { - RegionBackendServiceListCall { + /// * `autoscaler` - Name of the autoscaler to delete. + pub fn delete(&self, project: &str, region: &str, autoscaler: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { + RegionAutoscalerDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _autoscaler: autoscaler.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified autoscaler. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `autoscaler` - Name of the autoscaler to return. + pub fn get(&self, project: &str, region: &str, autoscaler: &str) -> RegionAutoscalerGetCall<'a, C, A> { + RegionAutoscalerGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _autoscaler: autoscaler.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an autoscaler in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn update(&self, request: Autoscaler, project: &str, region: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { + RegionAutoscalerUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _autoscaler: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of autoscalers contained within the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionAutoscalerListCall<'a, C, A> { + RegionAutoscalerListCall { hub: self.hub, _project: project.to_string(), _region: region.to_string(), @@ -19953,20 +24230,21 @@ impl<'a, C, A> RegionBackendServiceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + /// Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `region` - Name of the region scoping this request. - pub fn insert(&self, request: BackendService, project: &str, region: &str) -> RegionBackendServiceInsertCall<'a, C, A> { - RegionBackendServiceInsertCall { + pub fn patch(&self, request: Autoscaler, project: &str, region: &str) -> RegionAutoscalerPatchCall<'a, C, A> { + RegionAutoscalerPatchCall { hub: self.hub, _request: request, _project: project.to_string(), _region: region.to_string(), _request_id: Default::default(), + _autoscaler: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -19975,117 +24253,25 @@ impl<'a, C, A> RegionBackendServiceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. + /// Creates an autoscaler in the specified project using the data included in the request. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `region` - Name of the region scoping this request. - /// * `backendService` - Name of the BackendService resource to update. - pub fn update(&self, request: BackendService, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceUpdateCall<'a, C, A> { - RegionBackendServiceUpdateCall { + pub fn insert(&self, request: Autoscaler, project: &str, region: &str) -> RegionAutoscalerInsertCall<'a, C, A> { + RegionAutoscalerInsertCall { hub: self.hub, _request: request, _project: project.to_string(), _region: region.to_string(), - _backend_service: backend_service.to_string(), _request_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified regional BackendService resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `backendService` - Name of the BackendService resource to return. - pub fn get(&self, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceGetCall<'a, C, A> { - RegionBackendServiceGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _backend_service: backend_service.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified regional BackendService resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `backendService` - Name of the BackendService resource to delete. - pub fn delete(&self, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { - RegionBackendServiceDeleteCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _backend_service: backend_service.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `backendService` - Name of the BackendService resource to patch. - pub fn patch(&self, request: BackendService, project: &str, region: &str, backend_service: &str) -> RegionBackendServicePatchCall<'a, C, A> { - RegionBackendServicePatchCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _backend_service: backend_service.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the most recent health check results for this regional BackendService. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - No description provided. - /// * `region` - Name of the region scoping this request. - /// * `backendService` - Name of the BackendService resource for which to get health. - pub fn get_health(&self, request: ResourceGroupReference, project: &str, region: &str, backend_service: &str) -> RegionBackendServiceGetHealthCall<'a, C, A> { - RegionBackendServiceGetHealthCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _backend_service: backend_service.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -20131,7 +24317,7 @@ impl<'a, C, A> LicenseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified license. + /// Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -20151,7 +24337,7 @@ impl<'a, C, A> LicenseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + /// Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -20172,7 +24358,7 @@ impl<'a, C, A> LicenseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. + /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -20191,7 +24377,7 @@ impl<'a, C, A> LicenseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -20212,7 +24398,7 @@ impl<'a, C, A> LicenseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the specified License resource. + /// Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -20231,7 +24417,7 @@ impl<'a, C, A> LicenseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns permissions that a caller has on the specified resource. + /// Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -20252,7 +24438,7 @@ impl<'a, C, A> LicenseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Create a License resource in the specified project. + /// Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -20312,6 +24498,30 @@ impl<'a, C, A> MethodsBuilder for InstanceGroupMethods<'a, C, A> {} impl<'a, C, A> InstanceGroupMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Sets the named ports for the specified instance group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the instance group is located. + /// * `instanceGroup` - The name of the instance group where the named ports are updated. + pub fn set_named_ports(&self, request: InstanceGroupsSetNamedPortsRequest, project: &str, zone: &str, instance_group: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + InstanceGroupSetNamedPortCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group: instance_group.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates an instance group in the specified project using the parameters that are included in the request. @@ -20406,30 +24616,6 @@ impl<'a, C, A> InstanceGroupMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Sets the named ports for the specified instance group. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the instance group is located. - /// * `instanceGroup` - The name of the instance group where the named ports are updated. - pub fn set_named_ports(&self, request: InstanceGroupsSetNamedPortsRequest, project: &str, zone: &str, instance_group: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { - InstanceGroupSetNamedPortCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group: instance_group.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves the list of instance groups and sorts them by zone. @@ -20444,6 +24630,30 @@ impl<'a, C, A> InstanceGroupMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of instance groups that are located in the specified project and zone. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the instance group is located. + pub fn list(&self, project: &str, zone: &str) -> InstanceGroupListCall<'a, C, A> { + InstanceGroupListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -20498,29 +24708,6 @@ impl<'a, C, A> InstanceGroupMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of instance groups that are located in the specified project and zone. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the instance group is located. - pub fn list(&self, project: &str, zone: &str) -> InstanceGroupListCall<'a, C, A> { - InstanceGroupListCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -20549,7 +24736,7 @@ impl<'a, C, A> InstanceGroupMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `set_quic_override(...)`, `set_ssl_certificates(...)`, `set_ssl_policy(...)` and `set_url_map(...)` +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `set_quic_override(...)`, `set_ssl_certificates(...)`, `set_ssl_policy(...)` and `set_url_map(...)` /// // to build up your call. /// let rb = hub.target_https_proxies(); /// # } @@ -20564,6 +24751,28 @@ impl<'a, C, A> MethodsBuilder for TargetHttpsProxyMethods<'a, C, A> {} impl<'a, C, A> TargetHttpsProxyMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + pub fn aggregated_list(&self, project: &str) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { + TargetHttpsProxyAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. @@ -20759,7 +24968,7 @@ impl<'a, C, A> TargetHttpsProxyMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `add_peering(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)`, `remove_peering(...)` and `switch_to_custom_mode(...)` +/// // like `add_peering(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `list_peering_routes(...)`, `patch(...)`, `remove_peering(...)`, `switch_to_custom_mode(...)` and `update_peering(...)` /// // to build up your call. /// let rb = hub.networks(); /// # } @@ -20835,6 +25044,32 @@ impl<'a, C, A> NetworkMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the peering routes exchanged over peering connection. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `network` - Name of the network for this request. + pub fn list_peering_routes(&self, project: &str, network: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + NetworkListPeeringRouteCall { + hub: self.hub, + _project: project.to_string(), + _network: network.to_string(), + _region: Default::default(), + _peering_name: Default::default(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _direction: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Switches the network mode from auto subnet mode to custom subnet mode. @@ -20879,15 +25114,15 @@ impl<'a, C, A> NetworkMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Removes a peering from the specified network. + /// Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID for this request. - /// * `network` - Name of the network resource to remove peering from. - pub fn remove_peering(&self, request: NetworksRemovePeeringRequest, project: &str, network: &str) -> NetworkRemovePeeringCall<'a, C, A> { - NetworkRemovePeeringCall { + /// * `network` - Name of the network resource which the updated peering is belonging to. + pub fn update_peering(&self, request: NetworksUpdatePeeringRequest, project: &str, network: &str) -> NetworkUpdatePeeringCall<'a, C, A> { + NetworkUpdatePeeringCall { hub: self.hub, _request: request, _project: project.to_string(), @@ -20901,15 +25136,17 @@ impl<'a, C, A> NetworkMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified network. + /// Removes a peering from the specified network. /// /// # Arguments /// + /// * `request` - No description provided. /// * `project` - Project ID for this request. - /// * `network` - Name of the network to delete. - pub fn delete(&self, project: &str, network: &str) -> NetworkDeleteCall<'a, C, A> { - NetworkDeleteCall { + /// * `network` - Name of the network resource to remove peering from. + pub fn remove_peering(&self, request: NetworksRemovePeeringRequest, project: &str, network: &str) -> NetworkRemovePeeringCall<'a, C, A> { + NetworkRemovePeeringCall { hub: self.hub, + _request: request, _project: project.to_string(), _network: network.to_string(), _request_id: Default::default(), @@ -20939,6 +25176,26 @@ impl<'a, C, A> NetworkMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified network. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `network` - Name of the network to delete. + pub fn delete(&self, project: &str, network: &str) -> NetworkDeleteCall<'a, C, A> { + NetworkDeleteCall { + hub: self.hub, + _project: project.to_string(), + _network: network.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -21019,6 +25276,7 @@ impl<'a, C, A> NodeTypeMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -21148,6 +25406,7 @@ impl<'a, C, A> AddresseMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -21201,182 +25460,6 @@ impl<'a, C, A> AddresseMethods<'a, C, A> { -/// A builder providing access to all methods supported on *regionAutoscaler* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` -/// // to build up your call. -/// let rb = hub.region_autoscalers(); -/// # } -/// ``` -pub struct RegionAutoscalerMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for RegionAutoscalerMethods<'a, C, A> {} - -impl<'a, C, A> RegionAutoscalerMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified autoscaler. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `autoscaler` - Name of the autoscaler to delete. - pub fn delete(&self, project: &str, region: &str, autoscaler: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { - RegionAutoscalerDeleteCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _autoscaler: autoscaler.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified autoscaler. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `autoscaler` - Name of the autoscaler to return. - pub fn get(&self, project: &str, region: &str, autoscaler: &str) -> RegionAutoscalerGetCall<'a, C, A> { - RegionAutoscalerGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _autoscaler: autoscaler.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates an autoscaler in the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn update(&self, request: Autoscaler, project: &str, region: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { - RegionAutoscalerUpdateCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _autoscaler: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of autoscalers contained within the specified region. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn list(&self, project: &str, region: &str) -> RegionAutoscalerListCall<'a, C, A> { - RegionAutoscalerListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn patch(&self, request: Autoscaler, project: &str, region: &str) -> RegionAutoscalerPatchCall<'a, C, A> { - RegionAutoscalerPatchCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _autoscaler: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates an autoscaler in the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn insert(&self, request: Autoscaler, project: &str, region: &str) -> RegionAutoscalerInsertCall<'a, C, A> { - RegionAutoscalerInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *interconnectAttachment* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -21430,6 +25513,7 @@ impl<'a, C, A> InterconnectAttachmentMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -21476,6 +25560,7 @@ impl<'a, C, A> InterconnectAttachmentMethods<'a, C, A> { _request: request, _project: project.to_string(), _region: region.to_string(), + _validate_only: Default::default(), _request_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -21576,7 +25661,7 @@ impl<'a, C, A> InterconnectAttachmentMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `add_nodes(...)`, `aggregated_list(...)`, `delete(...)`, `delete_nodes(...)`, `get(...)`, `get_iam_policy(...)`, `insert(...)`, `list(...)`, `list_nodes(...)`, `set_iam_policy(...)`, `set_node_template(...)` and `test_iam_permissions(...)` +/// // like `add_nodes(...)`, `aggregated_list(...)`, `delete(...)`, `delete_nodes(...)`, `get(...)`, `get_iam_policy(...)`, `insert(...)`, `list(...)`, `list_nodes(...)`, `patch(...)`, `set_iam_policy(...)`, `set_node_template(...)` and `test_iam_permissions(...)` /// // to build up your call. /// let rb = hub.node_groups(); /// # } @@ -21705,6 +25790,30 @@ impl<'a, C, A> NodeGroupMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Patch the node group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `nodeGroup` - Name of the NodeGroup resource to update. + pub fn patch(&self, request: NodeGroup, project: &str, zone: &str, node_group: &str) -> NodeGroupPatchCall<'a, C, A> { + NodeGroupPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _node_group: node_group.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the node template of the node group. @@ -21729,27 +25838,6 @@ impl<'a, C, A> NodeGroupMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> NodeGroupAggregatedListCall<'a, C, A> { - NodeGroupAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. @@ -21804,7 +25892,7 @@ impl<'a, C, A> NodeGroupMethods<'a, C, A> { /// * `request` - No description provided. /// * `project` - Project ID for this request. /// * `zone` - The name of the zone for this request. - /// * `nodeGroup` - Name of the NodeGroup resource to delete. + /// * `nodeGroup` - Name of the NodeGroup resource whose nodes will be deleted. pub fn delete_nodes(&self, request: NodeGroupsDeleteNodesRequest, project: &str, zone: &str, node_group: &str) -> NodeGroupDeleteNodeCall<'a, C, A> { NodeGroupDeleteNodeCall { hub: self.hub, @@ -21819,6 +25907,28 @@ impl<'a, C, A> NodeGroupMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> NodeGroupAggregatedListCall<'a, C, A> { + NodeGroupAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the access control policy on the specified resource. Replaces any existing policy. @@ -21869,6 +25979,160 @@ impl<'a, C, A> NodeGroupMethods<'a, C, A> { +/// A builder providing access to all methods supported on *regionTargetHttpProxy* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `set_url_map(...)` +/// // to build up your call. +/// let rb = hub.region_target_http_proxies(); +/// # } +/// ``` +pub struct RegionTargetHttpProxyMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionTargetHttpProxyMethods<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpProxyMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Changes the URL map for TargetHttpProxy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `targetHttpProxy` - Name of the TargetHttpProxy to set a URL map for. + pub fn set_url_map(&self, request: UrlMapReference, project: &str, region: &str, target_http_proxy: &str) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> { + RegionTargetHttpProxySetUrlMapCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _target_http_proxy: target_http_proxy.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionTargetHttpProxyListCall<'a, C, A> { + RegionTargetHttpProxyListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `targetHttpProxy` - Name of the TargetHttpProxy resource to return. + pub fn get(&self, project: &str, region: &str, target_http_proxy: &str) -> RegionTargetHttpProxyGetCall<'a, C, A> { + RegionTargetHttpProxyGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _target_http_proxy: target_http_proxy.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified TargetHttpProxy resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `targetHttpProxy` - Name of the TargetHttpProxy resource to delete. + pub fn delete(&self, project: &str, region: &str, target_http_proxy: &str) -> RegionTargetHttpProxyDeleteCall<'a, C, A> { + RegionTargetHttpProxyDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _target_http_proxy: target_http_proxy.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn insert(&self, request: TargetHttpProxy, project: &str, region: &str) -> RegionTargetHttpProxyInsertCall<'a, C, A> { + RegionTargetHttpProxyInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *autoscaler* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -21908,28 +26172,6 @@ impl<'a, C, A> MethodsBuilder for AutoscalerMethods<'a, C, A> {} impl<'a, C, A> AutoscalerMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified autoscaler. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - Name of the zone for this request. - /// * `autoscaler` - Name of the autoscaler to delete. - pub fn delete(&self, project: &str, zone: &str, autoscaler: &str) -> AutoscalerDeleteCall<'a, C, A> { - AutoscalerDeleteCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _autoscaler: autoscaler.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves an aggregated list of autoscalers. @@ -21944,6 +26186,7 @@ impl<'a, C, A> AutoscalerMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -22020,6 +26263,28 @@ impl<'a, C, A> AutoscalerMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified autoscaler. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - Name of the zone for this request. + /// * `autoscaler` - Name of the autoscaler to delete. + pub fn delete(&self, project: &str, zone: &str, autoscaler: &str) -> AutoscalerDeleteCall<'a, C, A> { + AutoscalerDeleteCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _autoscaler: autoscaler.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates an autoscaler in the specified project using the data included in the request. @@ -22152,7 +26417,7 @@ impl<'a, C, A> SubnetworkMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingeprint of the subnetwork resource being patched. + /// Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. /// /// # Arguments /// @@ -22168,6 +26433,7 @@ impl<'a, C, A> SubnetworkMethods<'a, C, A> { _region: region.to_string(), _subnetwork: subnetwork.to_string(), _request_id: Default::default(), + _drain_timeout_seconds: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -22176,7 +26442,7 @@ impl<'a, C, A> SubnetworkMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves an aggregated list of usable subnetworks. + /// Retrieves an aggregated list of all usable subnetworks in the project. The list contains all of the subnetworks in the project and the subnetworks that were shared by a Shared VPC host project. /// /// # Arguments /// @@ -22346,6 +26612,7 @@ impl<'a, C, A> SubnetworkMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -22401,7 +26668,7 @@ impl<'a, C, A> SubnetworkMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `invalidate_cache(...)`, `list(...)`, `patch(...)`, `update(...)` and `validate(...)` +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `invalidate_cache(...)`, `list(...)`, `patch(...)`, `update(...)` and `validate(...)` /// // to build up your call. /// let rb = hub.url_maps(); /// # } @@ -22476,27 +26743,6 @@ impl<'a, C, A> UrlMapMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of UrlMap resources available to the specified project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn list(&self, project: &str) -> UrlMapListCall<'a, C, A> { - UrlMapListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. @@ -22519,6 +26765,50 @@ impl<'a, C, A> UrlMapMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of all UrlMap resources, regional and global, available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + pub fn aggregated_list(&self, project: &str) -> UrlMapAggregatedListCall<'a, C, A> { + UrlMapAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified UrlMap resource with the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `urlMap` - Name of the UrlMap resource to update. + pub fn update(&self, request: UrlMap, project: &str, url_map: &str) -> UrlMapUpdateCall<'a, C, A> { + UrlMapUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _url_map: url_map.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes the specified UrlMap resource. @@ -22539,6 +26829,27 @@ impl<'a, C, A> UrlMapMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of UrlMap resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> UrlMapListCall<'a, C, A> { + UrlMapListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. @@ -22560,28 +26871,6 @@ impl<'a, C, A> UrlMapMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified UrlMap resource with the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `urlMap` - Name of the UrlMap resource to update. - pub fn update(&self, request: UrlMap, project: &str, url_map: &str) -> UrlMapUpdateCall<'a, C, A> { - UrlMapUpdateCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _url_map: url_map.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -22672,7 +26961,7 @@ impl<'a, C, A> RegionDiskTypeMethods<'a, C, A> { -/// A builder providing access to all methods supported on *globalOperation* resources. +/// A builder providing access to all methods supported on *packetMirroring* resources. /// It is not used directly, but through the `Compute` hub. /// /// # Example @@ -22696,32 +26985,34 @@ impl<'a, C, A> RegionDiskTypeMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `delete(...)`, `get(...)` and `list(...)` +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `test_iam_permissions(...)` /// // to build up your call. -/// let rb = hub.global_operations(); +/// let rb = hub.packet_mirrorings(); /// # } /// ``` -pub struct GlobalOperationMethods<'a, C, A> +pub struct PacketMirroringMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, } -impl<'a, C, A> MethodsBuilder for GlobalOperationMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for PacketMirroringMethods<'a, C, A> {} -impl<'a, C, A> GlobalOperationMethods<'a, C, A> { +impl<'a, C, A> PacketMirroringMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a list of Operation resources contained within the specified project. + /// Retrieves a list of PacketMirroring resources available to the specified project and region. /// /// # Arguments /// /// * `project` - Project ID for this request. - pub fn list(&self, project: &str) -> GlobalOperationListCall<'a, C, A> { - GlobalOperationListCall { + /// * `region` - Name of the region for this request. + pub fn list(&self, project: &str, region: &str) -> PacketMirroringListCall<'a, C, A> { + PacketMirroringListCall { hub: self.hub, _project: project.to_string(), + _region: region.to_string(), _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), @@ -22734,17 +27025,20 @@ impl<'a, C, A> GlobalOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified Operations resource. + /// Creates a PacketMirroring resource in the specified project and region using the data included in the request. /// /// # Arguments /// + /// * `request` - No description provided. /// * `project` - Project ID for this request. - /// * `operation` - Name of the Operations resource to delete. - pub fn delete(&self, project: &str, operation: &str) -> GlobalOperationDeleteCall<'a, C, A> { - GlobalOperationDeleteCall { + /// * `region` - Name of the region for this request. + pub fn insert(&self, request: PacketMirroring, project: &str, region: &str) -> PacketMirroringInsertCall<'a, C, A> { + PacketMirroringInsertCall { hub: self.hub, + _request: request, _project: project.to_string(), - _operation: operation.to_string(), + _region: region.to_string(), + _request_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -22753,18 +27047,19 @@ impl<'a, C, A> GlobalOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves an aggregated list of all operations. + /// Retrieves an aggregated list of packetMirrorings. /// /// # Arguments /// /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { - GlobalOperationAggregatedListCall { + pub fn aggregated_list(&self, project: &str) -> PacketMirroringAggregatedListCall<'a, C, A> { + PacketMirroringAggregatedListCall { hub: self.hub, _project: project.to_string(), _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -22774,17 +27069,88 @@ impl<'a, C, A> GlobalOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the specified Operations resource. Gets a list of operations by making a list() request. + /// Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `packetMirroring` - Name of the PacketMirroring resource to patch. + pub fn patch(&self, request: PacketMirroring, project: &str, region: &str, packet_mirroring: &str) -> PacketMirroringPatchCall<'a, C, A> { + PacketMirroringPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _packet_mirroring: packet_mirroring.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - The name of the region for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, region: &str, resource: &str) -> PacketMirroringTestIamPermissionCall<'a, C, A> { + PacketMirroringTestIamPermissionCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified PacketMirroring resource. /// /// # Arguments /// /// * `project` - Project ID for this request. - /// * `operation` - Name of the Operations resource to return. - pub fn get(&self, project: &str, operation: &str) -> GlobalOperationGetCall<'a, C, A> { - GlobalOperationGetCall { + /// * `region` - Name of the region for this request. + /// * `packetMirroring` - Name of the PacketMirroring resource to return. + pub fn get(&self, project: &str, region: &str, packet_mirroring: &str) -> PacketMirroringGetCall<'a, C, A> { + PacketMirroringGetCall { hub: self.hub, _project: project.to_string(), - _operation: operation.to_string(), + _region: region.to_string(), + _packet_mirroring: packet_mirroring.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified PacketMirroring resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `packetMirroring` - Name of the PacketMirroring resource to delete. + pub fn delete(&self, project: &str, region: &str, packet_mirroring: &str) -> PacketMirroringDeleteCall<'a, C, A> { + PacketMirroringDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _packet_mirroring: packet_mirroring.to_string(), + _request_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -23065,7 +27431,7 @@ impl<'a, C, A> RegionMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `set_target(...)` +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `set_target(...)` /// // to build up your call. /// let rb = hub.forwarding_rules(); /// # } @@ -23080,6 +27446,27 @@ impl<'a, C, A> MethodsBuilder for ForwardingRuleMethods<'a, C, A> {} impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Returns the specified ForwardingRule resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `forwardingRule` - Name of the ForwardingRule resource to return. + pub fn get(&self, project: &str, region: &str, forwarding_rule: &str) -> ForwardingRuleGetCall<'a, C, A> { + ForwardingRuleGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _forwarding_rule: forwarding_rule.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a ForwardingRule resource in the specified project and region using the data included in the request. @@ -23102,27 +27489,6 @@ impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of forwarding rules. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - ForwardingRuleAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes the specified ForwardingRule resource. @@ -23145,6 +27511,28 @@ impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of forwarding rules. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + ForwardingRuleAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves a list of ForwardingRule resources available to the specified project and region. @@ -23168,27 +27556,6 @@ impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Returns the specified ForwardingRule resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `forwardingRule` - Name of the ForwardingRule resource to return. - pub fn get(&self, project: &str, region: &str, forwarding_rule: &str) -> ForwardingRuleGetCall<'a, C, A> { - ForwardingRuleGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _forwarding_rule: forwarding_rule.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Changes target URL for forwarding rule. The new target should be of the same type as the old target. @@ -23212,6 +27579,208 @@ impl<'a, C, A> ForwardingRuleMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `forwardingRule` - Name of the ForwardingRule resource to patch. + pub fn patch(&self, request: ForwardingRule, project: &str, region: &str, forwarding_rule: &str) -> ForwardingRulePatchCall<'a, C, A> { + ForwardingRulePatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _forwarding_rule: forwarding_rule.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *regionTargetHttpsProxy* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `set_ssl_certificates(...)` and `set_url_map(...)` +/// // to build up your call. +/// let rb = hub.region_target_https_proxies(); +/// # } +/// ``` +pub struct RegionTargetHttpsProxyMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionTargetHttpsProxyMethods<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpsProxyMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified TargetHttpsProxy resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `targetHttpsProxy` - Name of the TargetHttpsProxy resource to delete. + pub fn delete(&self, project: &str, region: &str, target_https_proxy: &str) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> { + RegionTargetHttpsProxyDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _target_https_proxy: target_https_proxy.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Changes the URL map for TargetHttpsProxy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `targetHttpsProxy` - Name of the TargetHttpsProxy to set a URL map for. + pub fn set_url_map(&self, request: UrlMapReference, project: &str, region: &str, target_https_proxy: &str) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> { + RegionTargetHttpsProxySetUrlMapCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _target_https_proxy: target_https_proxy.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn insert(&self, request: TargetHttpsProxy, project: &str, region: &str) -> RegionTargetHttpsProxyInsertCall<'a, C, A> { + RegionTargetHttpsProxyInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionTargetHttpsProxyListCall<'a, C, A> { + RegionTargetHttpsProxyListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Replaces SslCertificates for TargetHttpsProxy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `targetHttpsProxy` - Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + pub fn set_ssl_certificates(&self, request: RegionTargetHttpsProxiesSetSslCertificatesRequest, project: &str, region: &str, target_https_proxy: &str) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> { + RegionTargetHttpsProxySetSslCertificateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _target_https_proxy: target_https_proxy.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `targetHttpsProxy` - Name of the TargetHttpsProxy resource to return. + pub fn get(&self, project: &str, region: &str, target_https_proxy: &str) -> RegionTargetHttpsProxyGetCall<'a, C, A> { + RegionTargetHttpsProxyGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _target_https_proxy: target_https_proxy.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -23293,6 +27862,7 @@ impl<'a, C, A> TargetPoolMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -23349,29 +27919,6 @@ impl<'a, C, A> TargetPoolMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of target pools available to the specified project and region. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn list(&self, project: &str, region: &str) -> TargetPoolListCall<'a, C, A> { - TargetPoolListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Adds health check URLs to a target pool. @@ -23441,6 +27988,29 @@ impl<'a, C, A> TargetPoolMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of target pools available to the specified project and region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> TargetPoolListCall<'a, C, A> { + TargetPoolListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns the specified target pool. Gets a list of available target pools by making a list() request. @@ -23586,6 +28156,7 @@ impl<'a, C, A> TargetInstanceMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -23686,7 +28257,7 @@ impl<'a, C, A> TargetInstanceMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `set_target(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `set_target(...)` /// // to build up your call. /// let rb = hub.global_forwarding_rules(); /// # } @@ -23740,6 +28311,28 @@ impl<'a, C, A> GlobalForwardingRuleMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `forwardingRule` - Name of the ForwardingRule resource to patch. + pub fn patch(&self, request: ForwardingRule, project: &str, forwarding_rule: &str) -> GlobalForwardingRulePatchCall<'a, C, A> { + GlobalForwardingRulePatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _forwarding_rule: forwarding_rule.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. @@ -23845,26 +28438,6 @@ impl<'a, C, A> MethodsBuilder for HttpsHealthCheckMethods<'a, C, A> {} impl<'a, C, A> HttpsHealthCheckMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified HttpsHealthCheck resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `httpsHealthCheck` - Name of the HttpsHealthCheck resource to delete. - pub fn delete(&self, project: &str, https_health_check: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { - HttpsHealthCheckDeleteCall { - hub: self.hub, - _project: project.to_string(), - _https_health_check: https_health_check.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Creates a HttpsHealthCheck resource in the specified project using the data included in the request. @@ -23968,6 +28541,26 @@ impl<'a, C, A> HttpsHealthCheckMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified HttpsHealthCheck resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `httpsHealthCheck` - Name of the HttpsHealthCheck resource to delete. + pub fn delete(&self, project: &str, https_health_check: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { + HttpsHealthCheckDeleteCall { + hub: self.hub, + _project: project.to_string(), + _https_health_check: https_health_check.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -24011,27 +28604,6 @@ impl<'a, C, A> MethodsBuilder for MachineTypeMethods<'a, C, A> {} impl<'a, C, A> MachineTypeMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of machine types. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> MachineTypeAggregatedListCall<'a, C, A> { - MachineTypeAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns the specified machine type. Gets a list of available machine types by making a list() request. @@ -24053,6 +28625,28 @@ impl<'a, C, A> MachineTypeMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of machine types. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> MachineTypeAggregatedListCall<'a, C, A> { + MachineTypeAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves a list of machine types available to the specified project. @@ -24270,6 +28864,7 @@ impl<'a, C, A> NetworkEndpointGroupMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -24369,7 +28964,7 @@ impl<'a, C, A> LicenseCodeMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. + /// Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -24388,7 +28983,7 @@ impl<'a, C, A> LicenseCodeMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns permissions that a caller has on the specified resource. + /// Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// # Arguments /// @@ -24410,2185 +29005,6 @@ impl<'a, C, A> LicenseCodeMethods<'a, C, A> { -/// A builder providing access to all methods supported on *regionInstanceGroup* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)`, `list(...)`, `list_instances(...)` and `set_named_ports(...)` -/// // to build up your call. -/// let rb = hub.region_instance_groups(); -/// # } -/// ``` -pub struct RegionInstanceGroupMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for RegionInstanceGroupMethods<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of instance group resources contained within the specified region. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn list(&self, project: &str, region: &str) -> RegionInstanceGroupListCall<'a, C, A> { - RegionInstanceGroupListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the named ports for the specified regional instance group. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroup` - The name of the regional instance group where the named ports are updated. - pub fn set_named_ports(&self, request: RegionInstanceGroupsSetNamedPortsRequest, project: &str, region: &str, instance_group: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { - RegionInstanceGroupSetNamedPortCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group: instance_group.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified instance group resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroup` - Name of the instance group resource to return. - pub fn get(&self, project: &str, region: &str, instance_group: &str) -> RegionInstanceGroupGetCall<'a, C, A> { - RegionInstanceGroupGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _instance_group: instance_group.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroup` - Name of the regional instance group for which we want to list the instances. - pub fn list_instances(&self, request: RegionInstanceGroupsListInstancesRequest, project: &str, region: &str, instance_group: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - RegionInstanceGroupListInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group: instance_group.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *router* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `get_nat_mapping_info(...)`, `get_router_status(...)`, `insert(...)`, `list(...)`, `patch(...)`, `preview(...)` and `update(...)` -/// // to build up your call. -/// let rb = hub.routers(); -/// # } -/// ``` -pub struct RouterMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for RouterMethods<'a, C, A> {} - -impl<'a, C, A> RouterMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified Router resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `router` - Name of the Router resource to delete. - pub fn delete(&self, project: &str, region: &str, router: &str) -> RouterDeleteCall<'a, C, A> { - RouterDeleteCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _router: router.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `router` - Name of the Router resource to query. - pub fn preview(&self, request: Router, project: &str, region: &str, router: &str) -> RouterPreviewCall<'a, C, A> { - RouterPreviewCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _router: router.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of routers. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> RouterAggregatedListCall<'a, C, A> { - RouterAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves runtime information of the specified router. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `router` - Name of the Router resource to query. - pub fn get_router_status(&self, project: &str, region: &str, router: &str) -> RouterGetRouterStatuCall<'a, C, A> { - RouterGetRouterStatuCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _router: router.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `router` - Name of the Router resource to update. - pub fn update(&self, request: Router, project: &str, region: &str, router: &str) -> RouterUpdateCall<'a, C, A> { - RouterUpdateCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _router: router.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified Router resource. Gets a list of available routers by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `router` - Name of the Router resource to return. - pub fn get(&self, project: &str, region: &str, router: &str) -> RouterGetCall<'a, C, A> { - RouterGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _router: router.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of Router resources available to the specified project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn list(&self, project: &str, region: &str) -> RouterListCall<'a, C, A> { - RouterListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `router` - Name of the Router resource to patch. - pub fn patch(&self, request: Router, project: &str, region: &str, router: &str) -> RouterPatchCall<'a, C, A> { - RouterPatchCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _router: router.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves runtime Nat mapping information of VM endpoints. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `router` - Name of the Router resource to query for Nat Mapping information of VM endpoints. - pub fn get_nat_mapping_info(&self, project: &str, region: &str, router: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { - RouterGetNatMappingInfoCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _router: router.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a Router resource in the specified project and region using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn insert(&self, request: Router, project: &str, region: &str) -> RouterInsertCall<'a, C, A> { - RouterInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *healthCheck* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` -/// // to build up your call. -/// let rb = hub.health_checks(); -/// # } -/// ``` -pub struct HealthCheckMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for HealthCheckMethods<'a, C, A> {} - -impl<'a, C, A> HealthCheckMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Updates a HealthCheck resource in the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `healthCheck` - Name of the HealthCheck resource to update. - pub fn update(&self, request: HealthCheck, project: &str, health_check: &str) -> HealthCheckUpdateCall<'a, C, A> { - HealthCheckUpdateCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _health_check: health_check.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a HealthCheck resource in the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn insert(&self, request: HealthCheck, project: &str) -> HealthCheckInsertCall<'a, C, A> { - HealthCheckInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `healthCheck` - Name of the HealthCheck resource to return. - pub fn get(&self, project: &str, health_check: &str) -> HealthCheckGetCall<'a, C, A> { - HealthCheckGetCall { - hub: self.hub, - _project: project.to_string(), - _health_check: health_check.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified HealthCheck resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `healthCheck` - Name of the HealthCheck resource to delete. - pub fn delete(&self, project: &str, health_check: &str) -> HealthCheckDeleteCall<'a, C, A> { - HealthCheckDeleteCall { - hub: self.hub, - _project: project.to_string(), - _health_check: health_check.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `healthCheck` - Name of the HealthCheck resource to patch. - pub fn patch(&self, request: HealthCheck, project: &str, health_check: &str) -> HealthCheckPatchCall<'a, C, A> { - HealthCheckPatchCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _health_check: health_check.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of HealthCheck resources available to the specified project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn list(&self, project: &str) -> HealthCheckListCall<'a, C, A> { - HealthCheckListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *regionInstanceGroupManager* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `abandon_instances(...)`, `delete(...)`, `delete_instances(...)`, `get(...)`, `insert(...)`, `list(...)`, `list_managed_instances(...)`, `patch(...)`, `recreate_instances(...)`, `resize(...)`, `set_instance_template(...)` and `set_target_pools(...)` -/// // to build up your call. -/// let rb = hub.region_instance_group_managers(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for RegionInstanceGroupManagerMethods<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified managed instance group and all of the instances in that group. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - Name of the managed instance group to delete. - pub fn delete(&self, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { - RegionInstanceGroupManagerDeleteCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// You can specify a maximum of 1000 instances with this method per request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - Name of the managed instance group. - pub fn delete_instances(&self, request: RegionInstanceGroupManagersDeleteInstancesRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { - RegionInstanceGroupManagerDeleteInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn set_instance_template(&self, request: RegionInstanceGroupManagersSetTemplateRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - RegionInstanceGroupManagerSetInstanceTemplateCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. - /// - /// The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - Name of the managed instance group. - /// * `size` - Number of instances that should exist in this instance group manager. - pub fn resize(&self, project: &str, region: &str, instance_group_manager: &str, size: i32) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { - RegionInstanceGroupManagerResizeCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _size: size, - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - Name of the managed instance group. - pub fn set_target_pools(&self, request: RegionInstanceGroupManagersSetTargetPoolsRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { - RegionInstanceGroupManagerSetTargetPoolCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. - /// - /// A regional managed instance group can contain up to 2000 instances. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn insert(&self, request: InstanceGroupManager, project: &str, region: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { - RegionInstanceGroupManagerInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns all of the details about the specified managed instance group. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - Name of the managed instance group to return. - pub fn get(&self, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { - RegionInstanceGroupManagerGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn list_managed_instances(&self, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - RegionInstanceGroupManagerListManagedInstanceCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - The name of the instance group manager. - pub fn patch(&self, request: InstanceGroupManager, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { - RegionInstanceGroupManagerPatchCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// You can specify a maximum of 1000 instances with this method per request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - Name of the managed instance group. - pub fn recreate_instances(&self, request: RegionInstanceGroupManagersRecreateRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { - RegionInstanceGroupManagerRecreateInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of managed instance groups that are contained within the specified region. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - pub fn list(&self, project: &str, region: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { - RegionInstanceGroupManagerListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// You can specify a maximum of 1000 instances with this method per request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region scoping this request. - /// * `instanceGroupManager` - Name of the managed instance group. - pub fn abandon_instances(&self, request: RegionInstanceGroupManagersAbandonInstancesRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { - RegionInstanceGroupManagerAbandonInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *resourcePolicy* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `get_iam_policy(...)`, `insert(...)`, `list(...)`, `set_iam_policy(...)` and `test_iam_permissions(...)` -/// // to build up your call. -/// let rb = hub.resource_policies(); -/// # } -/// ``` -pub struct ResourcePolicyMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for ResourcePolicyMethods<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Retrieves all information of the specified resource policy. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `resourcePolicy` - Name of the resource policy to retrieve. - pub fn get(&self, project: &str, region: &str, resource_policy: &str) -> ResourcePolicyGetCall<'a, C, A> { - ResourcePolicyGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _resource_policy: resource_policy.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - The name of the region for this request. - /// * `resource` - Name or id of the resource for this request. - pub fn set_iam_policy(&self, request: RegionSetPolicyRequest, project: &str, region: &str, resource: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { - ResourcePolicySetIamPolicyCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - The name of the region for this request. - /// * `resource` - Name or id of the resource for this request. - pub fn get_iam_policy(&self, project: &str, region: &str, resource: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { - ResourcePolicyGetIamPolicyCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new resource policy. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn insert(&self, request: ResourcePolicy, project: &str, region: &str) -> ResourcePolicyInsertCall<'a, C, A> { - ResourcePolicyInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns permissions that a caller has on the specified resource. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - The name of the region for this request. - /// * `resource` - Name or id of the resource for this request. - pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, region: &str, resource: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { - ResourcePolicyTestIamPermissionCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// A list all the resource policies that have been configured for the specified project in specified region. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn list(&self, project: &str, region: &str) -> ResourcePolicyListCall<'a, C, A> { - ResourcePolicyListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified resource policy. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `resourcePolicy` - Name of the resource policy to delete. - pub fn delete(&self, project: &str, region: &str, resource_policy: &str) -> ResourcePolicyDeleteCall<'a, C, A> { - ResourcePolicyDeleteCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _resource_policy: resource_policy.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of resource policies. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { - ResourcePolicyAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *regionCommitment* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `get(...)`, `insert(...)` and `list(...)` -/// // to build up your call. -/// let rb = hub.region_commitments(); -/// # } -/// ``` -pub struct RegionCommitmentMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for RegionCommitmentMethods<'a, C, A> {} - -impl<'a, C, A> RegionCommitmentMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified commitment resource. Gets a list of available commitments by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `commitment` - Name of the commitment to return. - pub fn get(&self, project: &str, region: &str, commitment: &str) -> RegionCommitmentGetCall<'a, C, A> { - RegionCommitmentGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _commitment: commitment.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a commitment in the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn insert(&self, request: Commitment, project: &str, region: &str) -> RegionCommitmentInsertCall<'a, C, A> { - RegionCommitmentInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of commitments contained within the specified region. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn list(&self, project: &str, region: &str) -> RegionCommitmentListCall<'a, C, A> { - RegionCommitmentListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of commitments. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { - RegionCommitmentAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *targetVpnGateway* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)` and `list(...)` -/// // to build up your call. -/// let rb = hub.target_vpn_gateways(); -/// # } -/// ``` -pub struct TargetVpnGatewayMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for TargetVpnGatewayMethods<'a, C, A> {} - -impl<'a, C, A> TargetVpnGatewayMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Creates a target VPN gateway in the specified project and region using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn insert(&self, request: TargetVpnGateway, project: &str, region: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { - TargetVpnGatewayInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _region: region.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of target VPN gateways. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { - TargetVpnGatewayAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `targetVpnGateway` - Name of the target VPN gateway to return. - pub fn get(&self, project: &str, region: &str, target_vpn_gateway: &str) -> TargetVpnGatewayGetCall<'a, C, A> { - TargetVpnGatewayGetCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _target_vpn_gateway: target_vpn_gateway.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of target VPN gateways available to the specified project and region. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - pub fn list(&self, project: &str, region: &str) -> TargetVpnGatewayListCall<'a, C, A> { - TargetVpnGatewayListCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified target VPN gateway. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `region` - Name of the region for this request. - /// * `targetVpnGateway` - Name of the target VPN gateway to delete. - pub fn delete(&self, project: &str, region: &str, target_vpn_gateway: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { - TargetVpnGatewayDeleteCall { - hub: self.hub, - _project: project.to_string(), - _region: region.to_string(), - _target_vpn_gateway: target_vpn_gateway.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *instanceGroupManager* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `abandon_instances(...)`, `aggregated_list(...)`, `delete(...)`, `delete_instances(...)`, `get(...)`, `insert(...)`, `list(...)`, `list_managed_instances(...)`, `patch(...)`, `recreate_instances(...)`, `resize(...)`, `set_instance_template(...)` and `set_target_pools(...)` -/// // to build up your call. -/// let rb = hub.instance_group_managers(); -/// # } -/// ``` -pub struct InstanceGroupManagerMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for InstanceGroupManagerMethods<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn list_managed_instances(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - InstanceGroupManagerListManagedInstanceCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. - /// - /// A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where you want to create the managed instance group. - pub fn insert(&self, request: InstanceGroupManager, project: &str, zone: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { - InstanceGroupManagerInsertCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of managed instance groups that are contained within the specified project and zone. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - pub fn list(&self, project: &str, zone: &str) -> InstanceGroupManagerListCall<'a, C, A> { - InstanceGroupManagerListCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of managed instance groups and groups them by zone. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { - InstanceGroupManagerAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn get(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerGetCall<'a, C, A> { - InstanceGroupManagerGetCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn set_instance_template(&self, request: InstanceGroupManagersSetInstanceTemplateRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - InstanceGroupManagerSetInstanceTemplateCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn set_target_pools(&self, request: InstanceGroupManagersSetTargetPoolsRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { - InstanceGroupManagerSetTargetPoolCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// You can specify a maximum of 1000 instances with this method per request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn abandon_instances(&self, request: InstanceGroupManagersAbandonInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { - InstanceGroupManagerAbandonInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where you want to create the managed instance group. - /// * `instanceGroupManager` - The name of the instance group manager. - pub fn patch(&self, request: InstanceGroupManager, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { - InstanceGroupManagerPatchCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. - /// - /// When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: - /// - /// + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. - /// - /// This list is subject to change. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - /// * `size` - The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. - pub fn resize(&self, project: &str, zone: &str, instance_group_manager: &str, size: i32) -> InstanceGroupManagerResizeCall<'a, C, A> { - InstanceGroupManagerResizeCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _size: size, - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// You can specify a maximum of 1000 instances with this method per request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn delete_instances(&self, request: InstanceGroupManagersDeleteInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { - InstanceGroupManagerDeleteInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group to delete. - pub fn delete(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { - InstanceGroupManagerDeleteCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. - /// - /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. - /// - /// You can specify a maximum of 1000 instances with this method per request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone where the managed instance group is located. - /// * `instanceGroupManager` - The name of the managed instance group. - pub fn recreate_instances(&self, request: InstanceGroupManagersRecreateInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { - InstanceGroupManagerRecreateInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _zone: zone.to_string(), - _instance_group_manager: instance_group_manager.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *acceleratorType* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aggregated_list(...)`, `get(...)` and `list(...)` -/// // to build up your call. -/// let rb = hub.accelerator_types(); -/// # } -/// ``` -pub struct AcceleratorTypeMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for AcceleratorTypeMethods<'a, C, A> {} - -impl<'a, C, A> AcceleratorTypeMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Retrieves an aggregated list of accelerator types. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn aggregated_list(&self, project: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { - AcceleratorTypeAggregatedListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of accelerator types available to the specified project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - pub fn list(&self, project: &str, zone: &str) -> AcceleratorTypeListCall<'a, C, A> { - AcceleratorTypeListCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified accelerator type. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `acceleratorType` - Name of the accelerator type to return. - pub fn get(&self, project: &str, zone: &str, accelerator_type: &str) -> AcceleratorTypeGetCall<'a, C, A> { - AcceleratorTypeGetCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _accelerator_type: accelerator_type.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *project* resources. -/// It is not used directly, but through the `Compute` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_compute1 as compute1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use compute1::Compute; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `disable_xpn_host(...)`, `disable_xpn_resource(...)`, `enable_xpn_host(...)`, `enable_xpn_resource(...)`, `get(...)`, `get_xpn_host(...)`, `get_xpn_resources(...)`, `list_xpn_hosts(...)`, `move_disk(...)`, `move_instance(...)`, `set_common_instance_metadata(...)`, `set_default_network_tier(...)` and `set_usage_export_bucket(...)` -/// // to build up your call. -/// let rb = hub.projects(); -/// # } -/// ``` -pub struct ProjectMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, -} - -impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} - -impl<'a, C, A> ProjectMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Lists all shared VPC host projects visible to the user in an organization. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn list_xpn_hosts(&self, request: ProjectsListXpnHostsRequest, project: &str) -> ProjectListXpnHostCall<'a, C, A> { - ProjectListXpnHostCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Disable this project as a shared VPC host project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn disable_xpn_host(&self, project: &str) -> ProjectDisableXpnHostCall<'a, C, A> { - ProjectDisableXpnHostCall { - hub: self.hub, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn enable_xpn_resource(&self, request: ProjectsEnableXpnResourceRequest, project: &str) -> ProjectEnableXpnResourceCall<'a, C, A> { - ProjectEnableXpnResourceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Moves an instance and its attached persistent disks from one zone to another. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn move_instance(&self, request: InstanceMoveRequest, project: &str) -> ProjectMoveInstanceCall<'a, C, A> { - ProjectMoveInstanceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn set_usage_export_bucket(&self, request: UsageExportLocation, project: &str) -> ProjectSetUsageExportBucketCall<'a, C, A> { - ProjectSetUsageExportBucketCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Enable this project as a shared VPC host project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn enable_xpn_host(&self, project: &str) -> ProjectEnableXpnHostCall<'a, C, A> { - ProjectEnableXpnHostCall { - hub: self.hub, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Disable a service resource (also known as service project) associated with this host project. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn disable_xpn_resource(&self, request: ProjectsDisableXpnResourceRequest, project: &str) -> ProjectDisableXpnResourceCall<'a, C, A> { - ProjectDisableXpnResourceCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the shared VPC host project that this project links to. May be empty if no link exists. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn get_xpn_host(&self, project: &str) -> ProjectGetXpnHostCall<'a, C, A> { - ProjectGetXpnHostCall { - hub: self.hub, - _project: project.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the specified Project resource. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn get(&self, project: &str) -> ProjectGetCall<'a, C, A> { - ProjectGetCall { - hub: self.hub, - _project: project.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn set_default_network_tier(&self, request: ProjectsSetDefaultNetworkTierRequest, project: &str) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { - ProjectSetDefaultNetworkTierCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets service resources (a.k.a service project) associated with this host project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn get_xpn_resources(&self, project: &str) -> ProjectGetXpnResourceCall<'a, C, A> { - ProjectGetXpnResourceCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Moves a persistent disk from one zone to another. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn move_disk(&self, request: DiskMoveRequest, project: &str) -> ProjectMoveDiskCall<'a, C, A> { - ProjectMoveDiskCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets metadata common to all instances within the specified project using the data included in the request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `project` - Project ID for this request. - pub fn set_common_instance_metadata(&self, request: Metadata, project: &str) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { - ProjectSetCommonInstanceMetadataCall { - hub: self.hub, - _request: request, - _project: project.to_string(), - _request_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *regionDisk* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -26863,6 +29279,2711 @@ impl<'a, C, A> RegionDiskMethods<'a, C, A> { +/// A builder providing access to all methods supported on *router* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `get_nat_mapping_info(...)`, `get_router_status(...)`, `insert(...)`, `list(...)`, `patch(...)`, `preview(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.routers(); +/// # } +/// ``` +pub struct RouterMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RouterMethods<'a, C, A> {} + +impl<'a, C, A> RouterMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified Router resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `router` - Name of the Router resource to delete. + pub fn delete(&self, project: &str, region: &str, router: &str) -> RouterDeleteCall<'a, C, A> { + RouterDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _router: router.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `router` - Name of the Router resource to query. + pub fn preview(&self, request: Router, project: &str, region: &str, router: &str) -> RouterPreviewCall<'a, C, A> { + RouterPreviewCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _router: router.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of routers. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> RouterAggregatedListCall<'a, C, A> { + RouterAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves runtime information of the specified router. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `router` - Name of the Router resource to query. + pub fn get_router_status(&self, project: &str, region: &str, router: &str) -> RouterGetRouterStatuCall<'a, C, A> { + RouterGetRouterStatuCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _router: router.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `router` - Name of the Router resource to update. + pub fn update(&self, request: Router, project: &str, region: &str, router: &str) -> RouterUpdateCall<'a, C, A> { + RouterUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _router: router.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified Router resource. Gets a list of available routers by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `router` - Name of the Router resource to return. + pub fn get(&self, project: &str, region: &str, router: &str) -> RouterGetCall<'a, C, A> { + RouterGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _router: router.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of Router resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn list(&self, project: &str, region: &str) -> RouterListCall<'a, C, A> { + RouterListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `router` - Name of the Router resource to patch. + pub fn patch(&self, request: Router, project: &str, region: &str, router: &str) -> RouterPatchCall<'a, C, A> { + RouterPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _router: router.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves runtime Nat mapping information of VM endpoints. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `router` - Name of the Router resource to query for Nat Mapping information of VM endpoints. + pub fn get_nat_mapping_info(&self, project: &str, region: &str, router: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { + RouterGetNatMappingInfoCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _router: router.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a Router resource in the specified project and region using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn insert(&self, request: Router, project: &str, region: &str) -> RouterInsertCall<'a, C, A> { + RouterInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *healthCheck* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.health_checks(); +/// # } +/// ``` +pub struct HealthCheckMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for HealthCheckMethods<'a, C, A> {} + +impl<'a, C, A> HealthCheckMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates a HealthCheck resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `healthCheck` - Name of the HealthCheck resource to update. + pub fn update(&self, request: HealthCheck, project: &str, health_check: &str) -> HealthCheckUpdateCall<'a, C, A> { + HealthCheckUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _health_check: health_check.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + pub fn aggregated_list(&self, project: &str) -> HealthCheckAggregatedListCall<'a, C, A> { + HealthCheckAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a HealthCheck resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn insert(&self, request: HealthCheck, project: &str) -> HealthCheckInsertCall<'a, C, A> { + HealthCheckInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `healthCheck` - Name of the HealthCheck resource to return. + pub fn get(&self, project: &str, health_check: &str) -> HealthCheckGetCall<'a, C, A> { + HealthCheckGetCall { + hub: self.hub, + _project: project.to_string(), + _health_check: health_check.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified HealthCheck resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `healthCheck` - Name of the HealthCheck resource to delete. + pub fn delete(&self, project: &str, health_check: &str) -> HealthCheckDeleteCall<'a, C, A> { + HealthCheckDeleteCall { + hub: self.hub, + _project: project.to_string(), + _health_check: health_check.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `healthCheck` - Name of the HealthCheck resource to patch. + pub fn patch(&self, request: HealthCheck, project: &str, health_check: &str) -> HealthCheckPatchCall<'a, C, A> { + HealthCheckPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _health_check: health_check.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of HealthCheck resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> HealthCheckListCall<'a, C, A> { + HealthCheckListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *regionInstanceGroupManager* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `abandon_instances(...)`, `apply_updates_to_instances(...)`, `create_instances(...)`, `delete(...)`, `delete_instances(...)`, `get(...)`, `insert(...)`, `list(...)`, `list_errors(...)`, `list_managed_instances(...)`, `patch(...)`, `recreate_instances(...)`, `resize(...)`, `set_instance_template(...)` and `set_target_pools(...)` +/// // to build up your call. +/// let rb = hub.region_instance_group_managers(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionInstanceGroupManagerMethods<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified managed instance group and all of the instances in that group. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - Name of the managed instance group to delete. + pub fn delete(&self, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { + RegionInstanceGroupManagerDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - The name of the region where the managed instance group is located. It should conform to RFC1035. + /// * `instanceGroupManager` - The name of the managed instance group. It should conform to RFC1035. + pub fn create_instances(&self, request: RegionInstanceGroupManagersCreateInstancesRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> { + RegionInstanceGroupManagerCreateInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// You can specify a maximum of 1000 instances with this method per request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - Name of the managed instance group. + pub fn delete_instances(&self, request: RegionInstanceGroupManagersDeleteInstancesRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { + RegionInstanceGroupManagerDeleteInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn set_instance_template(&self, request: RegionInstanceGroupManagersSetTemplateRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + RegionInstanceGroupManagerSetInstanceTemplateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. + /// + /// The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - Name of the managed instance group. + /// * `size` - Number of instances that should exist in this instance group manager. + pub fn resize(&self, project: &str, region: &str, instance_group_manager: &str, size: i32) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { + RegionInstanceGroupManagerResizeCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _size: size, + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - Name of the managed instance group. + pub fn set_target_pools(&self, request: RegionInstanceGroupManagersSetTargetPoolsRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { + RegionInstanceGroupManagerSetTargetPoolCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + /// + /// A regional managed instance group can contain up to 2000 instances. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn insert(&self, request: InstanceGroupManager, project: &str, region: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { + RegionInstanceGroupManagerInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all errors thrown by actions on instances for a given regional managed instance group. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. This should conform to RFC1035. + /// * `instanceGroupManager` - The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + pub fn list_errors(&self, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + RegionInstanceGroupManagerListErrorCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn list_managed_instances(&self, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + RegionInstanceGroupManagerListManagedInstanceCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Apply updates to selected instances the managed instance group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request, should conform to RFC1035. + /// * `instanceGroupManager` - The name of the managed instance group, should conform to RFC1035. + pub fn apply_updates_to_instances(&self, request: RegionInstanceGroupManagersApplyUpdatesRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + RegionInstanceGroupManagerApplyUpdatesToInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns all of the details about the specified managed instance group. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - Name of the managed instance group to return. + pub fn get(&self, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { + RegionInstanceGroupManagerGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - The name of the instance group manager. + pub fn patch(&self, request: InstanceGroupManager, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { + RegionInstanceGroupManagerPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// You can specify a maximum of 1000 instances with this method per request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - Name of the managed instance group. + pub fn recreate_instances(&self, request: RegionInstanceGroupManagersRecreateRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { + RegionInstanceGroupManagerRecreateInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of managed instance groups that are contained within the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { + RegionInstanceGroupManagerListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// You can specify a maximum of 1000 instances with this method per request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroupManager` - Name of the managed instance group. + pub fn abandon_instances(&self, request: RegionInstanceGroupManagersAbandonInstancesRequest, project: &str, region: &str, instance_group_manager: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { + RegionInstanceGroupManagerAbandonInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *vpnGateway* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `get_status(...)`, `insert(...)`, `list(...)`, `set_labels(...)` and `test_iam_permissions(...)` +/// // to build up your call. +/// let rb = hub.vpn_gateways(); +/// # } +/// ``` +pub struct VpnGatewayMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for VpnGatewayMethods<'a, C, A> {} + +impl<'a, C, A> VpnGatewayMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Returns the status for the specified VPN gateway. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `vpnGateway` - Name of the VPN gateway to return. + pub fn get_status(&self, project: &str, region: &str, vpn_gateway: &str) -> VpnGatewayGetStatuCall<'a, C, A> { + VpnGatewayGetStatuCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _vpn_gateway: vpn_gateway.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of VPN gateways. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> VpnGatewayAggregatedListCall<'a, C, A> { + VpnGatewayAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a VPN gateway in the specified project and region using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn insert(&self, request: VpnGateway, project: &str, region: &str) -> VpnGatewayInsertCall<'a, C, A> { + VpnGatewayInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified VPN gateway. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `vpnGateway` - Name of the VPN gateway to delete. + pub fn delete(&self, project: &str, region: &str, vpn_gateway: &str) -> VpnGatewayDeleteCall<'a, C, A> { + VpnGatewayDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _vpn_gateway: vpn_gateway.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `vpnGateway` - Name of the VPN gateway to return. + pub fn get(&self, project: &str, region: &str, vpn_gateway: &str) -> VpnGatewayGetCall<'a, C, A> { + VpnGatewayGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _vpn_gateway: vpn_gateway.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - The region for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn set_labels(&self, request: RegionSetLabelsRequest, project: &str, region: &str, resource: &str) -> VpnGatewaySetLabelCall<'a, C, A> { + VpnGatewaySetLabelCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _resource: resource.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - The name of the region for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, region: &str, resource: &str) -> VpnGatewayTestIamPermissionCall<'a, C, A> { + VpnGatewayTestIamPermissionCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of VPN gateways available to the specified project and region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn list(&self, project: &str, region: &str) -> VpnGatewayListCall<'a, C, A> { + VpnGatewayListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *resourcePolicy* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `get_iam_policy(...)`, `insert(...)`, `list(...)`, `set_iam_policy(...)` and `test_iam_permissions(...)` +/// // to build up your call. +/// let rb = hub.resource_policies(); +/// # } +/// ``` +pub struct ResourcePolicyMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for ResourcePolicyMethods<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves all information of the specified resource policy. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `resourcePolicy` - Name of the resource policy to retrieve. + pub fn get(&self, project: &str, region: &str, resource_policy: &str) -> ResourcePolicyGetCall<'a, C, A> { + ResourcePolicyGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _resource_policy: resource_policy.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - The name of the region for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn set_iam_policy(&self, request: RegionSetPolicyRequest, project: &str, region: &str, resource: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { + ResourcePolicySetIamPolicyCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new resource policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn insert(&self, request: ResourcePolicy, project: &str, region: &str) -> ResourcePolicyInsertCall<'a, C, A> { + ResourcePolicyInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - The name of the region for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn test_iam_permissions(&self, request: TestPermissionsRequest, project: &str, region: &str, resource: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { + ResourcePolicyTestIamPermissionCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// A list all the resource policies that have been configured for the specified project in specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn list(&self, project: &str, region: &str) -> ResourcePolicyListCall<'a, C, A> { + ResourcePolicyListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a resource. May be empty if no such policy or resource exists. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - The name of the region for this request. + /// * `resource` - Name or id of the resource for this request. + pub fn get_iam_policy(&self, project: &str, region: &str, resource: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { + ResourcePolicyGetIamPolicyCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified resource policy. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `resourcePolicy` - Name of the resource policy to delete. + pub fn delete(&self, project: &str, region: &str, resource_policy: &str) -> ResourcePolicyDeleteCall<'a, C, A> { + ResourcePolicyDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _resource_policy: resource_policy.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of resource policies. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { + ResourcePolicyAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *regionCommitment* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `get(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.region_commitments(); +/// # } +/// ``` +pub struct RegionCommitmentMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionCommitmentMethods<'a, C, A> {} + +impl<'a, C, A> RegionCommitmentMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified commitment resource. Gets a list of available commitments by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `commitment` - Name of the commitment to return. + pub fn get(&self, project: &str, region: &str, commitment: &str) -> RegionCommitmentGetCall<'a, C, A> { + RegionCommitmentGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _commitment: commitment.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a commitment in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn insert(&self, request: Commitment, project: &str, region: &str) -> RegionCommitmentInsertCall<'a, C, A> { + RegionCommitmentInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of commitments contained within the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn list(&self, project: &str, region: &str) -> RegionCommitmentListCall<'a, C, A> { + RegionCommitmentListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of commitments. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { + RegionCommitmentAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *targetVpnGateway* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.target_vpn_gateways(); +/// # } +/// ``` +pub struct TargetVpnGatewayMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for TargetVpnGatewayMethods<'a, C, A> {} + +impl<'a, C, A> TargetVpnGatewayMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates a target VPN gateway in the specified project and region using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn insert(&self, request: TargetVpnGateway, project: &str, region: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { + TargetVpnGatewayInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of target VPN gateways. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + TargetVpnGatewayAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `targetVpnGateway` - Name of the target VPN gateway to return. + pub fn get(&self, project: &str, region: &str, target_vpn_gateway: &str) -> TargetVpnGatewayGetCall<'a, C, A> { + TargetVpnGatewayGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _target_vpn_gateway: target_vpn_gateway.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of target VPN gateways available to the specified project and region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + pub fn list(&self, project: &str, region: &str) -> TargetVpnGatewayListCall<'a, C, A> { + TargetVpnGatewayListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified target VPN gateway. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `targetVpnGateway` - Name of the target VPN gateway to delete. + pub fn delete(&self, project: &str, region: &str, target_vpn_gateway: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { + TargetVpnGatewayDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _target_vpn_gateway: target_vpn_gateway.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *instanceGroupManager* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `abandon_instances(...)`, `aggregated_list(...)`, `apply_updates_to_instances(...)`, `create_instances(...)`, `delete(...)`, `delete_instances(...)`, `get(...)`, `insert(...)`, `list(...)`, `list_errors(...)`, `list_managed_instances(...)`, `patch(...)`, `recreate_instances(...)`, `resize(...)`, `set_instance_template(...)` and `set_target_pools(...)` +/// // to build up your call. +/// let rb = hub.instance_group_managers(); +/// # } +/// ``` +pub struct InstanceGroupManagerMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for InstanceGroupManagerMethods<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn list_managed_instances(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + InstanceGroupManagerListManagedInstanceCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + /// + /// A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where you want to create the managed instance group. + pub fn insert(&self, request: InstanceGroupManager, project: &str, zone: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { + InstanceGroupManagerInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of managed instance groups that are contained within the specified project and zone. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + pub fn list(&self, project: &str, zone: &str) -> InstanceGroupManagerListCall<'a, C, A> { + InstanceGroupManagerListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of managed instance groups and groups them by zone. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + InstanceGroupManagerAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn get(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + InstanceGroupManagerGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. It should conform to RFC1035. + /// * `instanceGroupManager` - The name of the managed instance group. It should conform to RFC1035. + pub fn create_instances(&self, request: InstanceGroupManagersCreateInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> { + InstanceGroupManagerCreateInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all errors thrown by actions on instances for a given managed instance group. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. It should conform to RFC1035. + /// * `instanceGroupManager` - The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + pub fn list_errors(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerListErrorCall<'a, C, A> { + InstanceGroupManagerListErrorCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn set_instance_template(&self, request: InstanceGroupManagersSetInstanceTemplateRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + InstanceGroupManagerSetInstanceTemplateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn set_target_pools(&self, request: InstanceGroupManagersSetTargetPoolsRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + InstanceGroupManagerSetTargetPoolCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where you want to create the managed instance group. + /// * `instanceGroupManager` - The name of the instance group manager. + pub fn patch(&self, request: InstanceGroupManager, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { + InstanceGroupManagerPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + /// + /// When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + /// + /// + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. + /// + /// This list is subject to change. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + /// * `size` - The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + pub fn resize(&self, project: &str, zone: &str, instance_group_manager: &str, size: i32) -> InstanceGroupManagerResizeCall<'a, C, A> { + InstanceGroupManagerResizeCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _size: size, + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// You can specify a maximum of 1000 instances with this method per request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn abandon_instances(&self, request: InstanceGroupManagersAbandonInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + InstanceGroupManagerAbandonInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// You can specify a maximum of 1000 instances with this method per request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn delete_instances(&self, request: InstanceGroupManagersDeleteInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + InstanceGroupManagerDeleteInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group to delete. + pub fn delete(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + InstanceGroupManagerDeleteCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + /// + /// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + /// + /// You can specify a maximum of 1000 instances with this method per request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. + /// * `instanceGroupManager` - The name of the managed instance group. + pub fn recreate_instances(&self, request: InstanceGroupManagersRecreateInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + InstanceGroupManagerRecreateInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone where the managed instance group is located. Should conform to RFC1035. + /// * `instanceGroupManager` - The name of the managed instance group, should conform to RFC1035. + pub fn apply_updates_to_instances(&self, request: InstanceGroupManagersApplyUpdatesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + InstanceGroupManagerApplyUpdatesToInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _zone: zone.to_string(), + _instance_group_manager: instance_group_manager.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *acceleratorType* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `aggregated_list(...)`, `get(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.accelerator_types(); +/// # } +/// ``` +pub struct AcceleratorTypeMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for AcceleratorTypeMethods<'a, C, A> {} + +impl<'a, C, A> AcceleratorTypeMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an aggregated list of accelerator types. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn aggregated_list(&self, project: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + AcceleratorTypeAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of accelerator types available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + pub fn list(&self, project: &str, zone: &str) -> AcceleratorTypeListCall<'a, C, A> { + AcceleratorTypeListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified accelerator type. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `acceleratorType` - Name of the accelerator type to return. + pub fn get(&self, project: &str, zone: &str, accelerator_type: &str) -> AcceleratorTypeGetCall<'a, C, A> { + AcceleratorTypeGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _accelerator_type: accelerator_type.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *globalNetworkEndpointGroup* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `attach_network_endpoints(...)`, `delete(...)`, `detach_network_endpoints(...)`, `get(...)`, `insert(...)`, `list(...)` and `list_network_endpoints(...)` +/// // to build up your call. +/// let rb = hub.global_network_endpoint_groups(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for GlobalNetworkEndpointGroupMethods<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Detach the network endpoint from the specified network endpoint group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `networkEndpointGroup` - The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + pub fn detach_network_endpoints(&self, request: GlobalNetworkEndpointGroupsDetachEndpointsRequest, project: &str, network_endpoint_group: &str) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> { + GlobalNetworkEndpointGroupDetachNetworkEndpointCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _network_endpoint_group: network_endpoint_group.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a network endpoint group in the specified project using the parameters that are included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn insert(&self, request: NetworkEndpointGroup, project: &str) -> GlobalNetworkEndpointGroupInsertCall<'a, C, A> { + GlobalNetworkEndpointGroupInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the network endpoints in the specified network endpoint group. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `networkEndpointGroup` - The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + pub fn list_network_endpoints(&self, project: &str, network_endpoint_group: &str) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + GlobalNetworkEndpointGroupListNetworkEndpointCall { + hub: self.hub, + _project: project.to_string(), + _network_endpoint_group: network_endpoint_group.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Attach a network endpoint to the specified network endpoint group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `networkEndpointGroup` - The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + pub fn attach_network_endpoints(&self, request: GlobalNetworkEndpointGroupsAttachEndpointsRequest, project: &str, network_endpoint_group: &str) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> { + GlobalNetworkEndpointGroupAttachNetworkEndpointCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _network_endpoint_group: network_endpoint_group.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `networkEndpointGroup` - The name of the network endpoint group to delete. It should comply with RFC1035. + pub fn delete(&self, project: &str, network_endpoint_group: &str) -> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> { + GlobalNetworkEndpointGroupDeleteCall { + hub: self.hub, + _project: project.to_string(), + _network_endpoint_group: network_endpoint_group.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of network endpoint groups that are located in the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> GlobalNetworkEndpointGroupListCall<'a, C, A> { + GlobalNetworkEndpointGroupListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `networkEndpointGroup` - The name of the network endpoint group. It should comply with RFC1035. + pub fn get(&self, project: &str, network_endpoint_group: &str) -> GlobalNetworkEndpointGroupGetCall<'a, C, A> { + GlobalNetworkEndpointGroupGetCall { + hub: self.hub, + _project: project.to_string(), + _network_endpoint_group: network_endpoint_group.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `disable_xpn_host(...)`, `disable_xpn_resource(...)`, `enable_xpn_host(...)`, `enable_xpn_resource(...)`, `get(...)`, `get_xpn_host(...)`, `get_xpn_resources(...)`, `list_xpn_hosts(...)`, `move_disk(...)`, `move_instance(...)`, `set_common_instance_metadata(...)`, `set_default_network_tier(...)` and `set_usage_export_bucket(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists all shared VPC host projects visible to the user in an organization. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn list_xpn_hosts(&self, request: ProjectsListXpnHostsRequest, project: &str) -> ProjectListXpnHostCall<'a, C, A> { + ProjectListXpnHostCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Disable this project as a shared VPC host project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn disable_xpn_host(&self, project: &str) -> ProjectDisableXpnHostCall<'a, C, A> { + ProjectDisableXpnHostCall { + hub: self.hub, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Moves an instance and its attached persistent disks from one zone to another. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn move_instance(&self, request: InstanceMoveRequest, project: &str) -> ProjectMoveInstanceCall<'a, C, A> { + ProjectMoveInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn set_usage_export_bucket(&self, request: UsageExportLocation, project: &str) -> ProjectSetUsageExportBucketCall<'a, C, A> { + ProjectSetUsageExportBucketCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Enable this project as a shared VPC host project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn enable_xpn_host(&self, project: &str) -> ProjectEnableXpnHostCall<'a, C, A> { + ProjectEnableXpnHostCall { + hub: self.hub, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets metadata common to all instances within the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn set_common_instance_metadata(&self, request: Metadata, project: &str) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { + ProjectSetCommonInstanceMetadataCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Disable a service resource (also known as service project) associated with this host project. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn disable_xpn_resource(&self, request: ProjectsDisableXpnResourceRequest, project: &str) -> ProjectDisableXpnResourceCall<'a, C, A> { + ProjectDisableXpnResourceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the shared VPC host project that this project links to. May be empty if no link exists. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn get_xpn_host(&self, project: &str) -> ProjectGetXpnHostCall<'a, C, A> { + ProjectGetXpnHostCall { + hub: self.hub, + _project: project.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified Project resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn get(&self, project: &str) -> ProjectGetCall<'a, C, A> { + ProjectGetCall { + hub: self.hub, + _project: project.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn enable_xpn_resource(&self, request: ProjectsEnableXpnResourceRequest, project: &str) -> ProjectEnableXpnResourceCall<'a, C, A> { + ProjectEnableXpnResourceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn set_default_network_tier(&self, request: ProjectsSetDefaultNetworkTierRequest, project: &str) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { + ProjectSetDefaultNetworkTierCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets service resources (a.k.a service project) associated with this host project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn get_xpn_resources(&self, project: &str) -> ProjectGetXpnResourceCall<'a, C, A> { + ProjectGetXpnResourceCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Moves a persistent disk from one zone to another. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + pub fn move_disk(&self, request: DiskMoveRequest, project: &str) -> ProjectMoveDiskCall<'a, C, A> { + ProjectMoveDiskCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *zone* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.zones(); +/// # } +/// ``` +pub struct ZoneMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for ZoneMethods<'a, C, A> {} + +impl<'a, C, A> ZoneMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified Zone resource. Gets a list of available zones by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - Name of the zone resource to return. + pub fn get(&self, project: &str, zone: &str) -> ZoneGetCall<'a, C, A> { + ZoneGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of Zone resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> ZoneListCall<'a, C, A> { + ZoneListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *httpHealthCheck* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -26922,27 +32043,6 @@ impl<'a, C, A> HttpHealthCheckMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves the list of HttpHealthCheck resources available to the specified project. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - pub fn list(&self, project: &str) -> HttpHealthCheckListCall<'a, C, A> { - HttpHealthCheckListCall { - hub: self.hub, - _project: project.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. @@ -26985,6 +32085,27 @@ impl<'a, C, A> HttpHealthCheckMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of HttpHealthCheck resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + pub fn list(&self, project: &str) -> HttpHealthCheckListCall<'a, C, A> { + HttpHealthCheckListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request. @@ -27138,6 +32259,29 @@ impl<'a, C, A> DiskMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of persistent disks contained within the specified zone. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + pub fn list(&self, project: &str, zone: &str) -> DiskListCall<'a, C, A> { + DiskListCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. @@ -27175,29 +32319,7 @@ impl<'a, C, A> DiskMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a list of persistent disks contained within the specified zone. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - pub fn list(&self, project: &str, zone: &str) -> DiskListCall<'a, C, A> { - DiskListCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _page_token: Default::default(), - _order_by: Default::default(), - _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -27297,6 +32419,27 @@ impl<'a, C, A> DiskMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - The name of the zone for this request. + /// * `disk` - Name of the persistent disk to return. + pub fn get(&self, project: &str, zone: &str, disk: &str) -> DiskGetCall<'a, C, A> { + DiskGetCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _disk: disk.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Removes resource policies from a disk. @@ -27344,27 +32487,6 @@ impl<'a, C, A> DiskMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `zone` - The name of the zone for this request. - /// * `disk` - Name of the persistent disk to return. - pub fn get(&self, project: &str, zone: &str, disk: &str) -> DiskGetCall<'a, C, A> { - DiskGetCall { - hub: self.hub, - _project: project.to_string(), - _zone: zone.to_string(), - _disk: disk.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -27393,7 +32515,7 @@ impl<'a, C, A> DiskMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `set_url_map(...)` +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `set_url_map(...)` /// // to build up your call. /// let rb = hub.target_http_proxies(); /// # } @@ -27408,25 +32530,6 @@ impl<'a, C, A> MethodsBuilder for TargetHttpProxyMethods<'a, C, A> {} impl<'a, C, A> TargetHttpProxyMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `targetHttpProxy` - Name of the TargetHttpProxy resource to return. - pub fn get(&self, project: &str, target_http_proxy: &str) -> TargetHttpProxyGetCall<'a, C, A> { - TargetHttpProxyGetCall { - hub: self.hub, - _project: project.to_string(), - _target_http_proxy: target_http_proxy.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes the specified TargetHttpProxy resource. @@ -27447,6 +32550,47 @@ impl<'a, C, A> TargetHttpProxyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + pub fn aggregated_list(&self, project: &str) -> TargetHttpProxyAggregatedListCall<'a, C, A> { + TargetHttpProxyAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `targetHttpProxy` - Name of the TargetHttpProxy resource to return. + pub fn get(&self, project: &str, target_http_proxy: &str) -> TargetHttpProxyGetCall<'a, C, A> { + TargetHttpProxyGetCall { + hub: self.hub, + _project: project.to_string(), + _target_http_proxy: target_http_proxy.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Changes the URL map for TargetHttpProxy. @@ -27537,7 +32681,7 @@ impl<'a, C, A> TargetHttpProxyMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)` and `list(...)` +/// // like `aggregated_list(...)`, `delete(...)`, `get(...)`, `insert(...)` and `list(...)` /// // to build up your call. /// let rb = hub.ssl_certificates(); /// # } @@ -27572,6 +32716,28 @@ impl<'a, C, A> SslCertificateMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Name of the project scoping this request. + pub fn aggregated_list(&self, project: &str) -> SslCertificateAggregatedListCall<'a, C, A> { + SslCertificateAggregatedListCall { + hub: self.hub, + _project: project.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _include_all_scopes: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves the list of SslCertificate resources available to the specified project. @@ -27635,6 +32801,184 @@ impl<'a, C, A> SslCertificateMethods<'a, C, A> { +/// A builder providing access to all methods supported on *regionHealthCheck* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.region_health_checks(); +/// # } +/// ``` +pub struct RegionHealthCheckMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionHealthCheckMethods<'a, C, A> {} + +impl<'a, C, A> RegionHealthCheckMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates a HealthCheck resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `healthCheck` - Name of the HealthCheck resource to update. + pub fn update(&self, request: HealthCheck, project: &str, region: &str, health_check: &str) -> RegionHealthCheckUpdateCall<'a, C, A> { + RegionHealthCheckUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _health_check: health_check.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of HealthCheck resources available to the specified project. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionHealthCheckListCall<'a, C, A> { + RegionHealthCheckListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `healthCheck` - Name of the HealthCheck resource to return. + pub fn get(&self, project: &str, region: &str, health_check: &str) -> RegionHealthCheckGetCall<'a, C, A> { + RegionHealthCheckGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _health_check: health_check.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified HealthCheck resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `healthCheck` - Name of the HealthCheck resource to delete. + pub fn delete(&self, project: &str, region: &str, health_check: &str) -> RegionHealthCheckDeleteCall<'a, C, A> { + RegionHealthCheckDeleteCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _health_check: health_check.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `healthCheck` - Name of the HealthCheck resource to patch. + pub fn patch(&self, request: HealthCheck, project: &str, region: &str, health_check: &str) -> RegionHealthCheckPatchCall<'a, C, A> { + RegionHealthCheckPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _health_check: health_check.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a HealthCheck resource in the specified project using the data included in the request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn insert(&self, request: HealthCheck, project: &str, region: &str) -> RegionHealthCheckInsertCall<'a, C, A> { + RegionHealthCheckInsertCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *zoneOperation* resources. /// It is not used directly, but through the `Compute` hub. /// @@ -27659,7 +33003,7 @@ impl<'a, C, A> SslCertificateMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)` and `list(...)` +/// // like `delete(...)`, `get(...)`, `list(...)` and `wait(...)` /// // to build up your call. /// let rb = hub.zone_operations(); /// # } @@ -27674,6 +33018,31 @@ impl<'a, C, A> MethodsBuilder for ZoneOperationMethods<'a, C, A> {} impl<'a, C, A> ZoneOperationMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + /// + /// This method is called on a best-effort basis. Specifically: + /// - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + /// - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `zone` - Name of the zone for this request. + /// * `operation` - Name of the Operations resource to return. + pub fn wait(&self, project: &str, zone: &str, operation: &str) -> ZoneOperationWaitCall<'a, C, A> { + ZoneOperationWaitCall { + hub: self.hub, + _project: project.to_string(), + _zone: zone.to_string(), + _operation: operation.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes the specified zone-specific Operations resource. @@ -27903,6 +33272,25 @@ impl<'a, C, A> MethodsBuilder for InterconnectLocationMethods<'a, C, A> {} impl<'a, C, A> InterconnectLocationMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `interconnectLocation` - Name of the interconnect location to return. + pub fn get(&self, project: &str, interconnect_location: &str) -> InterconnectLocationGetCall<'a, C, A> { + InterconnectLocationGetCall { + hub: self.hub, + _project: project.to_string(), + _interconnect_location: interconnect_location.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves the list of interconnect locations available to the specified project. @@ -27923,25 +33311,6 @@ impl<'a, C, A> InterconnectLocationMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. - /// - /// # Arguments - /// - /// * `project` - Project ID for this request. - /// * `interconnectLocation` - Name of the interconnect location to return. - pub fn get(&self, project: &str, interconnect_location: &str) -> InterconnectLocationGetCall<'a, C, A> { - InterconnectLocationGetCall { - hub: self.hub, - _project: project.to_string(), - _interconnect_location: interconnect_location.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -28089,7 +33458,7 @@ impl<'a, C, A> FirewallMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. + /// Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. /// /// # Arguments /// @@ -28208,6 +33577,7 @@ impl<'a, C, A> VpnTunnelMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -28404,6 +33774,7 @@ impl<'a, C, A> NodeTemplateMethods<'a, C, A> { _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_all_scopes: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -28505,7 +33876,7 @@ impl<'a, C, A> NodeTemplateMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)` and `list(...)` +/// // like `delete(...)`, `get(...)`, `list(...)` and `wait(...)` /// // to build up your call. /// let rb = hub.region_operations(); /// # } @@ -28520,6 +33891,31 @@ impl<'a, C, A> MethodsBuilder for RegionOperationMethods<'a, C, A> {} impl<'a, C, A> RegionOperationMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + /// + /// This method is called on a best-effort basis. Specifically: + /// - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + /// - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region for this request. + /// * `operation` - Name of the Operations resource to return. + pub fn wait(&self, project: &str, region: &str, operation: &str) -> RegionOperationWaitCall<'a, C, A> { + RegionOperationWaitCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _operation: operation.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves the specified region-specific Operations resource. @@ -28588,6 +33984,143 @@ impl<'a, C, A> RegionOperationMethods<'a, C, A> { +/// A builder providing access to all methods supported on *regionInstanceGroup* resources. +/// It is not used directly, but through the `Compute` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_compute1 as compute1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use compute1::Compute; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get(...)`, `list(...)`, `list_instances(...)` and `set_named_ports(...)` +/// // to build up your call. +/// let rb = hub.region_instance_groups(); +/// # } +/// ``` +pub struct RegionInstanceGroupMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, +} + +impl<'a, C, A> MethodsBuilder for RegionInstanceGroupMethods<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the list of instance group resources contained within the specified region. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + pub fn list(&self, project: &str, region: &str) -> RegionInstanceGroupListCall<'a, C, A> { + RegionInstanceGroupListCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the named ports for the specified regional instance group. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroup` - The name of the regional instance group where the named ports are updated. + pub fn set_named_ports(&self, request: RegionInstanceGroupsSetNamedPortsRequest, project: &str, region: &str, instance_group: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { + RegionInstanceGroupSetNamedPortCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group: instance_group.to_string(), + _request_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the specified instance group resource. + /// + /// # Arguments + /// + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroup` - Name of the instance group resource to return. + pub fn get(&self, project: &str, region: &str, instance_group: &str) -> RegionInstanceGroupGetCall<'a, C, A> { + RegionInstanceGroupGetCall { + hub: self.hub, + _project: project.to_string(), + _region: region.to_string(), + _instance_group: instance_group.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Project ID for this request. + /// * `region` - Name of the region scoping this request. + /// * `instanceGroup` - Name of the regional instance group for which we want to list the instances. + pub fn list_instances(&self, request: RegionInstanceGroupsListInstancesRequest, project: &str, region: &str, instance_group: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + RegionInstanceGroupListInstanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _region: region.to_string(), + _instance_group: instance_group.to_string(), + _page_token: Default::default(), + _order_by: Default::default(), + _max_results: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + // ################### @@ -29901,7 +35434,7 @@ impl<'a, C, A> TargetTcpProxyListCall<'a, C, A> where C: BorrowMut TargetTcpProxyListCall<'a, C, A> { @@ -29910,29 +35443,29 @@ impl<'a, C, A> TargetTcpProxyListCall<'a, C, A> where C: BorrowMut TargetTcpProxyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetTcpProxyListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetTcpProxyListCall<'a, C, A> { @@ -30565,9 +36098,9 @@ impl<'a, C, A> BackendBucketDeleteCall<'a, C, A> where C: BorrowMut BackendBucketDeleteCall<'a, C, A> where C: BorrowMut BackendBucketDeleteCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SignedUrlKey::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.backend_buckets().add_signed_url_key(req, "project", "backendBucket") -/// .request_id("labore") +/// let result = hub.backend_buckets().list("project") +/// .page_token("no") +/// .order_by("labore") +/// .max_results(62) +/// .filter("dolore") /// .doit(); /// # } /// ``` -pub struct BackendBucketAddSignedUrlKeyCall<'a, C, A> +pub struct BackendBucketListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: SignedUrlKey, _project: String, - _backend_bucket: String, - _request_id: Option, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for BackendBucketAddSignedUrlKeyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for BackendBucketListCall<'a, C, A> {} -impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> BackendBucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, BackendBucketList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -30630,15 +36161,23 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.backendBuckets.addSignedUrlKey", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "compute.backendBuckets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("backendBucket", self._backend_bucket.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); } - for &field in ["alt", "project", "backendBucket", "requestId"].iter() { + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -30650,12 +36189,12 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -30666,8 +36205,8 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["backendBucket", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -30679,17 +36218,6 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut BackendBucketAddSignedUrlKeyCall<'a, C, A> { - self._request = new_value; - self - } /// Project ID for this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// - /// Sets the *backend bucket* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn backend_bucket(mut self, new_value: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { - self._backend_bucket = new_value.to_string(); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); self } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> BackendBucketListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -30811,7 +36343,7 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut BackendBucketAddSignedUrlKeyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BackendBucketListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -30832,7 +36364,7 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> BackendBucketListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -30841,7 +36373,7 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> BackendBucketListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -30892,7 +36424,7 @@ impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut BackendBucketInsertCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.backend_buckets().list("project") -/// .page_token("et") -/// .order_by("eirmod") -/// .max_results(43) -/// .filter("et") -/// .doit(); -/// # } -/// ``` -pub struct BackendBucketListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for BackendBucketListCall<'a, C, A> {} - -impl<'a, C, A> BackendBucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, BackendBucketList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.backendBuckets.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/backendBuckets"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> BackendBucketListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> BackendBucketListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BackendBucketListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> BackendBucketListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> BackendBucketListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// A builder for the *patch* method supported by a *backendBucket* resource. @@ -32015,7 +37249,7 @@ impl<'a, C, A> BackendBucketListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.backend_buckets().patch(req, "project", "backendBucket") -/// .request_id("consetetur") +/// .request_id("et") /// .doit(); /// # } /// ``` @@ -32314,7 +37548,7 @@ impl<'a, C, A> BackendBucketPatchCall<'a, C, A> where C: BorrowMut BackendBucketUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SignedUrlKey::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.backend_buckets().add_signed_url_key(req, "project", "backendBucket") +/// .request_id("sed") +/// .doit(); +/// # } +/// ``` +pub struct BackendBucketAddSignedUrlKeyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: SignedUrlKey, + _project: String, + _backend_bucket: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BackendBucketAddSignedUrlKeyCall<'a, C, A> {} + +impl<'a, C, A> BackendBucketAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.backendBuckets.addSignedUrlKey", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("backendBucket", self._backend_bucket.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "backendBucket", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{backendBucket}", "backendBucket")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["backendBucket", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SignedUrlKey) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + /// + /// Sets the *backend bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn backend_bucket(mut self, new_value: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { + self._backend_bucket = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BackendBucketAddSignedUrlKeyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Changes SslCertificates for TargetSslProxy. /// /// A builder for the *setSslCertificates* method supported by a *targetSslProxy* resource. @@ -33366,7 +38899,7 @@ impl<'a, C, A> TargetSslProxyListCall<'a, C, A> where C: BorrowMut TargetSslProxyListCall<'a, C, A> { @@ -33375,29 +38908,29 @@ impl<'a, C, A> TargetSslProxyListCall<'a, C, A> where C: BorrowMut TargetSslProxyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetSslProxyListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetSslProxyListCall<'a, C, A> { @@ -35632,7 +41165,7 @@ impl<'a, C, A> InterconnectListCall<'a, C, A> where C: BorrowMut, self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> InterconnectListCall<'a, C, A> { @@ -35641,29 +41174,29 @@ impl<'a, C, A> InterconnectListCall<'a, C, A> where C: BorrowMut, } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> InterconnectListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InterconnectListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InterconnectListCall<'a, C, A> { @@ -36536,7 +42069,4130 @@ impl<'a, C, A> InterconnectGetCall<'a, C, A> where C: BorrowMut, } -/// Retrieves all information of the specified reservation. +/// Deletes the specified UrlMap resource. +/// +/// A builder for the *delete* method supported by a *regionUrlMap* resource. +/// It is not used directly, but through a `RegionUrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_url_maps().delete("project", "region", "urlMap") +/// .request_id("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct RegionUrlMapDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _url_map: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionUrlMapDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionUrlMaps.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("urlMap", self._url_map.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "urlMap", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/urlMaps/{urlMap}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{urlMap}", "urlMap")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["urlMap", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionUrlMapDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionUrlMapDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the UrlMap resource to delete. + /// + /// Sets the *url map* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn url_map(mut self, new_value: &str) -> RegionUrlMapDeleteCall<'a, C, A> { + self._url_map = new_value.to_string(); + self + } + /// begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionUrlMapDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionUrlMapDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionUrlMapDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionUrlMapDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *regionUrlMap* resource. +/// It is not used directly, but through a `RegionUrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::UrlMap; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UrlMap::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.region_url_maps().patch(req, "project", "region", "urlMap") +/// .request_id("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct RegionUrlMapPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: UrlMap, + _project: String, + _region: String, + _url_map: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionUrlMapPatchCall<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionUrlMaps.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("urlMap", self._url_map.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "urlMap", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/urlMaps/{urlMap}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{urlMap}", "urlMap")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["urlMap", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UrlMap) -> RegionUrlMapPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionUrlMapPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionUrlMapPatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the UrlMap resource to patch. + /// + /// Sets the *url map* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn url_map(mut self, new_value: &str) -> RegionUrlMapPatchCall<'a, C, A> { + self._url_map = new_value.to_string(); + self + } + /// begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionUrlMapPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionUrlMapPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionUrlMapPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionUrlMapPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. +/// +/// A builder for the *get* method supported by a *regionUrlMap* resource. +/// It is not used directly, but through a `RegionUrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_url_maps().get("project", "region", "urlMap") +/// .doit(); +/// # } +/// ``` +pub struct RegionUrlMapGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _url_map: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionUrlMapGetCall<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UrlMap)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionUrlMaps.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("urlMap", self._url_map.to_string())); + for &field in ["alt", "project", "region", "urlMap"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/urlMaps/{urlMap}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{urlMap}", "urlMap")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["urlMap", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionUrlMapGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionUrlMapGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the UrlMap resource to return. + /// + /// Sets the *url map* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn url_map(mut self, new_value: &str) -> RegionUrlMapGetCall<'a, C, A> { + self._url_map = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionUrlMapGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionUrlMapGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionUrlMapGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a UrlMap resource in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *regionUrlMap* resource. +/// It is not used directly, but through a `RegionUrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::UrlMap; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UrlMap::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.region_url_maps().insert(req, "project", "region") +/// .request_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct RegionUrlMapInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: UrlMap, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionUrlMapInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionUrlMaps.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/urlMaps"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UrlMap) -> RegionUrlMapInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionUrlMapInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionUrlMapInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionUrlMapInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionUrlMapInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionUrlMapInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionUrlMapInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of UrlMap resources available to the specified project in the specified region. +/// +/// A builder for the *list* method supported by a *regionUrlMap* resource. +/// It is not used directly, but through a `RegionUrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_url_maps().list("project", "region") +/// .page_token("sit") +/// .order_by("diam") +/// .max_results(64) +/// .filter("justo") +/// .doit(); +/// # } +/// ``` +pub struct RegionUrlMapListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionUrlMapListCall<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UrlMapList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionUrlMaps.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/urlMaps"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionUrlMapListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionUrlMapListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionUrlMapListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionUrlMapListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionUrlMapListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionUrlMapListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionUrlMapListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionUrlMapListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionUrlMapListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. +/// +/// A builder for the *validate* method supported by a *regionUrlMap* resource. +/// It is not used directly, but through a `RegionUrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionUrlMapsValidateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionUrlMapsValidateRequest::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.region_url_maps().validate(req, "project", "region", "urlMap") +/// .doit(); +/// # } +/// ``` +pub struct RegionUrlMapValidateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionUrlMapsValidateRequest, + _project: String, + _region: String, + _url_map: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionUrlMapValidateCall<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapValidateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UrlMapsValidateResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionUrlMaps.validate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("urlMap", self._url_map.to_string())); + for &field in ["alt", "project", "region", "urlMap"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/urlMaps/{urlMap}/validate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{urlMap}", "urlMap")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["urlMap", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionUrlMapsValidateRequest) -> RegionUrlMapValidateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionUrlMapValidateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionUrlMapValidateCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the UrlMap resource to be validated as. + /// + /// Sets the *url map* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn url_map(mut self, new_value: &str) -> RegionUrlMapValidateCall<'a, C, A> { + self._url_map = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionUrlMapValidateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionUrlMapValidateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionUrlMapValidateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified UrlMap resource with the data included in the request. +/// +/// A builder for the *update* method supported by a *regionUrlMap* resource. +/// It is not used directly, but through a `RegionUrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::UrlMap; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UrlMap::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.region_url_maps().update(req, "project", "region", "urlMap") +/// .request_id("est") +/// .doit(); +/// # } +/// ``` +pub struct RegionUrlMapUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: UrlMap, + _project: String, + _region: String, + _url_map: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionUrlMapUpdateCall<'a, C, A> {} + +impl<'a, C, A> RegionUrlMapUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionUrlMaps.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("urlMap", self._url_map.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "urlMap", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/urlMaps/{urlMap}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{urlMap}", "urlMap")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["urlMap", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UrlMap) -> RegionUrlMapUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionUrlMapUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionUrlMapUpdateCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the UrlMap resource to update. + /// + /// Sets the *url map* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn url_map(mut self, new_value: &str) -> RegionUrlMapUpdateCall<'a, C, A> { + self._url_map = new_value.to_string(); + self + } + /// begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionUrlMapUpdateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionUrlMapUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionUrlMapUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionUrlMapUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Understanding backend services for more information. +/// +/// A builder for the *insert* method supported by a *regionBackendService* resource. +/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::BackendService; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BackendService::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.region_backend_services().insert(req, "project", "region") +/// .request_id("ut") +/// .doit(); +/// # } +/// ``` +pub struct RegionBackendServiceInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: BackendService, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionBackendServiceInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionBackendServices.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BackendService) -> RegionBackendServiceInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionBackendServiceInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionBackendServiceInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionBackendServiceInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionBackendServiceInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionBackendServiceInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of regional BackendService resources available to the specified project in the given region. +/// +/// A builder for the *list* method supported by a *regionBackendService* resource. +/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_backend_services().list("project", "region") +/// .page_token("voluptua.") +/// .order_by("duo") +/// .max_results(8) +/// .filter("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct RegionBackendServiceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionBackendServiceListCall<'a, C, A> {} + +impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BackendServiceList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionBackendServices.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionBackendServiceListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionBackendServiceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionBackendServiceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. +/// +/// A builder for the *update* method supported by a *regionBackendService* resource. +/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::BackendService; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BackendService::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.region_backend_services().update(req, "project", "region", "backendService") +/// .request_id("dolor") +/// .doit(); +/// # } +/// ``` +pub struct RegionBackendServiceUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: BackendService, + _project: String, + _region: String, + _backend_service: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionBackendServiceUpdateCall<'a, C, A> {} + +impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionBackendServices.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("backendService", self._backend_service.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "backendService", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices/{backendService}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{backendService}", "backendService")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["backendService", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BackendService) -> RegionBackendServiceUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionBackendServiceUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionBackendServiceUpdateCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the BackendService resource to update. + /// + /// Sets the *backend service* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceUpdateCall<'a, C, A> { + self._backend_service = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionBackendServiceUpdateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionBackendServiceUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionBackendServiceUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified regional BackendService resource. +/// +/// A builder for the *get* method supported by a *regionBackendService* resource. +/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_backend_services().get("project", "region", "backendService") +/// .doit(); +/// # } +/// ``` +pub struct RegionBackendServiceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _backend_service: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionBackendServiceGetCall<'a, C, A> {} + +impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BackendService)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionBackendServices.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("backendService", self._backend_service.to_string())); + for &field in ["alt", "project", "region", "backendService"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices/{backendService}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{backendService}", "backendService")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["backendService", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionBackendServiceGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionBackendServiceGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the BackendService resource to return. + /// + /// Sets the *backend service* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceGetCall<'a, C, A> { + self._backend_service = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionBackendServiceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionBackendServiceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified regional BackendService resource. +/// +/// A builder for the *delete* method supported by a *regionBackendService* resource. +/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_backend_services().delete("project", "region", "backendService") +/// .request_id("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct RegionBackendServiceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _backend_service: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionBackendServiceDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegionBackendServiceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionBackendServices.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("backendService", self._backend_service.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "backendService", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices/{backendService}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{backendService}", "backendService")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["backendService", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the BackendService resource to delete. + /// + /// Sets the *backend service* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { + self._backend_service = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionBackendServiceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionBackendServiceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified regional BackendService resource with the data included in the request. There are several Understanding backend services to keep in mind when updating a backend service. Read Understanding backend services for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *regionBackendService* resource. +/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::BackendService; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BackendService::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.region_backend_services().patch(req, "project", "region", "backendService") +/// .request_id("et") +/// .doit(); +/// # } +/// ``` +pub struct RegionBackendServicePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: BackendService, + _project: String, + _region: String, + _backend_service: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionBackendServicePatchCall<'a, C, A> {} + +impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionBackendServices.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("backendService", self._backend_service.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "backendService", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices/{backendService}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{backendService}", "backendService")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["backendService", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BackendService) -> RegionBackendServicePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionBackendServicePatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionBackendServicePatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the BackendService resource to patch. + /// + /// Sets the *backend service* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn backend_service(mut self, new_value: &str) -> RegionBackendServicePatchCall<'a, C, A> { + self._backend_service = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionBackendServicePatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServicePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionBackendServicePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionBackendServicePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the most recent health check results for this regional BackendService. +/// +/// A builder for the *getHealth* method supported by a *regionBackendService* resource. +/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ResourceGroupReference; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ResourceGroupReference::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.region_backend_services().get_health(req, "project", "region", "backendService") +/// .doit(); +/// # } +/// ``` +pub struct RegionBackendServiceGetHealthCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ResourceGroupReference, + _project: String, + _region: String, + _backend_service: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionBackendServiceGetHealthCall<'a, C, A> {} + +impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BackendServiceGroupHealth)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionBackendServices.getHealth", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("backendService", self._backend_service.to_string())); + for &field in ["alt", "project", "region", "backendService"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices/{backendService}/getHealth"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{backendService}", "backendService")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["backendService", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ResourceGroupReference) -> RegionBackendServiceGetHealthCall<'a, C, A> { + self._request = new_value; + self + } + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionBackendServiceGetHealthCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionBackendServiceGetHealthCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the BackendService resource for which to get health. + /// + /// Sets the *backend service* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceGetHealthCall<'a, C, A> { + self._backend_service = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceGetHealthCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionBackendServiceGetHealthCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionBackendServiceGetHealthCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves information about the specified reservation. /// /// A builder for the *get* method supported by a *reservation* resource. /// It is not used directly, but through a `ReservationMethods` instance. @@ -36800,316 +46456,6 @@ impl<'a, C, A> ReservationGetCall<'a, C, A> where C: BorrowMut, A } -/// A list all the reservations that have been configured for the specified project in specified zone. -/// -/// A builder for the *list* method supported by a *reservation* resource. -/// It is not used directly, but through a `ReservationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.reservations().list("project", "zone") -/// .page_token("sed") -/// .order_by("ea") -/// .max_results(39) -/// .filter("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct ReservationListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ReservationListCall<'a, C, A> {} - -impl<'a, C, A> ReservationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ReservationList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.reservations.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/reservations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ReservationListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ReservationListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ReservationListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ReservationListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Deletes the specified reservation. /// /// A builder for the *delete* method supported by a *reservation* resource. @@ -37138,7 +46484,7 @@ impl<'a, C, A> ReservationListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.reservations().delete("project", "zone", "reservation") -/// .request_id("labore") +/// .request_id("ut") /// .doit(); /// # } /// ``` @@ -37390,6 +46736,316 @@ impl<'a, C, A> ReservationDeleteCall<'a, C, A> where C: BorrowMut } +/// A list of all the reservations that have been configured for the specified project in specified zone. +/// +/// A builder for the *list* method supported by a *reservation* resource. +/// It is not used directly, but through a `ReservationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.reservations().list("project", "zone") +/// .page_token("ipsum") +/// .order_by("ut") +/// .max_results(98) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct ReservationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReservationListCall<'a, C, A> {} + +impl<'a, C, A> ReservationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ReservationList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.reservations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/reservations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ReservationListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ReservationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ReservationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ReservationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReservationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves an aggregated list of reservations. /// /// A builder for the *aggregatedList* method supported by a *reservation* resource. @@ -37418,10 +47074,11 @@ impl<'a, C, A> ReservationDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.reservations().aggregated_list("project") -/// .page_token("aliquyam") -/// .order_by("dolores") -/// .max_results(3) -/// .filter("diam") +/// .page_token("eirmod") +/// .order_by("sanctus") +/// .max_results(74) +/// .include_all_scopes(false) +/// .filter("et") /// .doit(); /// # } /// ``` @@ -37433,6 +47090,7 @@ pub struct ReservationAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -37455,7 +47113,7 @@ impl<'a, C, A> ReservationAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -37466,10 +47124,13 @@ impl<'a, C, A> ReservationAggregatedListCall<'a, C, A> where C: BorrowMut ReservationAggregatedListCall<'a, C, A> where C: BorrowMut ReservationAggregatedListCall<'a, C, A> { @@ -37600,29 +47261,36 @@ impl<'a, C, A> ReservationAggregatedListCall<'a, C, A> where C: BorrowMut ReservationAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ReservationAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> ReservationAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ReservationAggregatedListCall<'a, C, A> { @@ -38278,7 +47946,7 @@ impl<'a, C, A> ReservationTestIamPermissionCall<'a, C, A> where C: BorrowMut ReservationTestIamPermissionCall<'a, C, A> where C: BorrowMut ReservationResizeCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.reservations().insert(req, "project", "zone") -/// .request_id("dolores") +/// .request_id("nonumy") /// .doit(); /// # } /// ``` @@ -39152,6 +48820,1363 @@ impl<'a, C, A> ReservationGetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_operations().list("project") +/// .page_token("rebum.") +/// .order_by("labore") +/// .max_results(19) +/// .filter("elitr") +/// .doit(); +/// # } +/// ``` +pub struct GlobalOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalOperationListCall<'a, C, A> {} + +impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OperationList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalOperations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> GlobalOperationListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. +/// +/// This method is called on a best-effort basis. Specifically: +/// - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +/// - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. +/// +/// A builder for the *wait* method supported by a *globalOperation* resource. +/// It is not used directly, but through a `GlobalOperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_operations().wait("project", "operation") +/// .doit(); +/// # } +/// ``` +pub struct GlobalOperationWaitCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _operation: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalOperationWaitCall<'a, C, A> {} + +impl<'a, C, A> GlobalOperationWaitCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalOperations.wait", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("operation", self._operation.to_string())); + for &field in ["alt", "project", "operation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}/wait"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{operation}", "operation")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["operation", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalOperationWaitCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the Operations resource to return. + /// + /// Sets the *operation* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn operation(mut self, new_value: &str) -> GlobalOperationWaitCall<'a, C, A> { + self._operation = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalOperationWaitCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalOperationWaitCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalOperationWaitCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified Operations resource. +/// +/// A builder for the *delete* method supported by a *globalOperation* resource. +/// It is not used directly, but through a `GlobalOperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_operations().delete("project", "operation") +/// .doit(); +/// # } +/// ``` +pub struct GlobalOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _operation: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalOperations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("operation", self._operation.to_string())); + for &field in ["project", "operation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{operation}", "operation")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["operation", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalOperationDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the Operations resource to delete. + /// + /// Sets the *operation* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn operation(mut self, new_value: &str) -> GlobalOperationDeleteCall<'a, C, A> { + self._operation = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalOperationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalOperationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of all operations. +/// +/// A builder for the *aggregatedList* method supported by a *globalOperation* resource. +/// It is not used directly, but through a `GlobalOperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_operations().aggregated_list("project") +/// .page_token("consetetur") +/// .order_by("diam") +/// .max_results(79) +/// .include_all_scopes(false) +/// .filter("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct GlobalOperationAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalOperationAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OperationAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalOperations.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalOperationAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalOperationAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalOperationAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. +/// +/// A builder for the *get* method supported by a *globalOperation* resource. +/// It is not used directly, but through a `GlobalOperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_operations().get("project", "operation") +/// .doit(); +/// # } +/// ``` +pub struct GlobalOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _operation: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalOperationGetCall<'a, C, A> {} + +impl<'a, C, A> GlobalOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalOperations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("operation", self._operation.to_string())); + for &field in ["alt", "project", "operation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{operation}", "operation")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["operation", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalOperationGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the Operations resource to return. + /// + /// Sets the *operation* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn operation(mut self, new_value: &str) -> GlobalOperationGetCall<'a, C, A> { + self._operation = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates an address resource in the specified project by using the data included in the request. /// /// A builder for the *insert* method supported by a *globalAddresse* resource. @@ -39186,7 +50211,7 @@ impl<'a, C, A> ReservationGetIamPolicyCall<'a, C, A> where C: BorrowMut GlobalAddresseInsertCall<'a, C, A> where C: BorrowMut GlobalAddresseDeleteCall<'a, C, A> where C: BorrowMut GlobalAddresseListCall<'a, C, A> where C: BorrowMut GlobalAddresseListCall<'a, C, A> { @@ -39917,29 +50942,29 @@ impl<'a, C, A> GlobalAddresseListCall<'a, C, A> where C: BorrowMut GlobalAddresseListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> GlobalAddresseListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> GlobalAddresseListCall<'a, C, A> { @@ -40285,10 +51310,10 @@ impl<'a, C, A> GlobalAddresseGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instance_templates().list("project") -/// .page_token("eirmod") -/// .order_by("At") -/// .max_results(5) -/// .filter("et") +/// .page_token("gubergren") +/// .order_by("et") +/// .max_results(56) +/// .filter("accusam") /// .doit(); /// # } /// ``` @@ -40458,7 +51483,7 @@ impl<'a, C, A> InstanceTemplateListCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> { @@ -40467,29 +51492,29 @@ impl<'a, C, A> InstanceTemplateListCall<'a, C, A> where C: BorrowMut InstanceTemplateListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceTemplateListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceTemplateListCall<'a, C, A> { @@ -40835,7 +51860,7 @@ impl<'a, C, A> InstanceTemplateGetIamPolicyCall<'a, C, A> where C: BorrowMut InstanceTemplateTestIamPermissionCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instance_templates().insert(req, "project") -/// .request_id("ut") +/// .request_id("consetetur") /// .doit(); /// # } /// ``` @@ -42180,289 +53205,6 @@ impl<'a, C, A> InstanceTemplateGetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestPermissionsRequest::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.snapshots().test_iam_permissions(req, "project", "resource") -/// .doit(); -/// # } -/// ``` -pub struct SnapshotTestIamPermissionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: TestPermissionsRequest, - _project: String, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SnapshotTestIamPermissionCall<'a, C, A> {} - -impl<'a, C, A> SnapshotTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TestPermissionsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.snapshots.testIamPermissions", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "project", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/snapshots/{resource}/testIamPermissions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{resource}", "resource")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["resource", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: TestPermissionsRequest) -> SnapshotTestIamPermissionCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> SnapshotTestIamPermissionCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name or id of the resource for this request. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> SnapshotTestIamPermissionCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SnapshotTestIamPermissionCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> SnapshotTestIamPermissionCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SnapshotTestIamPermissionCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. /// /// For more information, see Deleting snapshots. @@ -42493,7 +53235,7 @@ impl<'a, C, A> SnapshotTestIamPermissionCall<'a, C, A> where C: BorrowMut SnapshotGetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestPermissionsRequest::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.snapshots().test_iam_permissions(req, "project", "resource") +/// .doit(); +/// # } +/// ``` +pub struct SnapshotTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TestPermissionsRequest, + _project: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SnapshotTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> SnapshotTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestPermissionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.snapshots.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/snapshots/{resource}/testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["resource", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestPermissionsRequest) -> SnapshotTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> SnapshotTestIamPermissionCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> SnapshotTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SnapshotTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SnapshotTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SnapshotTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the access control policy on the specified resource. Replaces any existing policy. /// /// A builder for the *setIamPolicy* method supported by a *snapshot* resource. @@ -43548,10 +54573,10 @@ impl<'a, C, A> SnapshotGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.snapshots().list("project") -/// .page_token("sed") -/// .order_by("et") -/// .max_results(46) -/// .filter("justo") +/// .page_token("diam") +/// .order_by("nonumy") +/// .max_results(8) +/// .filter("diam") /// .doit(); /// # } /// ``` @@ -43721,7 +54746,7 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> SnapshotListCall<'a, C, A> { @@ -43730,29 +54755,29 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> SnapshotListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SnapshotListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SnapshotListCall<'a, C, A> { @@ -44393,10 +55418,11 @@ impl<'a, C, A> DiskTypeGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.disk_types().aggregated_list("project") -/// .page_token("et") -/// .order_by("sed") -/// .max_results(91) -/// .filter("invidunt") +/// .page_token("takimata") +/// .order_by("dolores") +/// .max_results(5) +/// .include_all_scopes(true) +/// .filter("amet.") /// .doit(); /// # } /// ``` @@ -44408,6 +55434,7 @@ pub struct DiskTypeAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -44430,7 +55457,7 @@ impl<'a, C, A> DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -44441,10 +55468,13 @@ impl<'a, C, A> DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut DiskTypeAggregatedListCall<'a, C, A> { @@ -44575,29 +55605,36 @@ impl<'a, C, A> DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut DiskTypeAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DiskTypeAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> DiskTypeAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskTypeAggregatedListCall<'a, C, A> { @@ -44691,10 +55728,10 @@ impl<'a, C, A> DiskTypeAggregatedListCall<'a, C, A> where C: BorrowMut DiskTypeListCall<'a, C, A> where C: BorrowMut, A: self._zone = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { @@ -44885,29 +55922,29 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DiskTypeListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskTypeListCall<'a, C, A> { @@ -44973,10 +56010,580 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: } -/// Returns the specified Zone resource. Gets a list of available zones by making a list() request. +/// Creates a ExternalVpnGateway in the specified project using the data included in the request. /// -/// A builder for the *get* method supported by a *zone* resource. -/// It is not used directly, but through a `ZoneMethods` instance. +/// A builder for the *insert* method supported by a *externalVpnGateway* resource. +/// It is not used directly, but through a `ExternalVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ExternalVpnGateway; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ExternalVpnGateway::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.external_vpn_gateways().insert(req, "project") +/// .request_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct ExternalVpnGatewayInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ExternalVpnGateway, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ExternalVpnGatewayInsertCall<'a, C, A> {} + +impl<'a, C, A> ExternalVpnGatewayInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.externalVpnGateways.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/externalVpnGateways"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ExternalVpnGateway) -> ExternalVpnGatewayInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ExternalVpnGatewayInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ExternalVpnGatewayInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExternalVpnGatewayInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ExternalVpnGatewayInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExternalVpnGatewayInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. +/// +/// A builder for the *setLabels* method supported by a *externalVpnGateway* resource. +/// It is not used directly, but through a `ExternalVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::GlobalSetLabelsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GlobalSetLabelsRequest::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.external_vpn_gateways().set_labels(req, "project", "resource") +/// .doit(); +/// # } +/// ``` +pub struct ExternalVpnGatewaySetLabelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: GlobalSetLabelsRequest, + _project: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ExternalVpnGatewaySetLabelCall<'a, C, A> {} + +impl<'a, C, A> ExternalVpnGatewaySetLabelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.externalVpnGateways.setLabels", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/externalVpnGateways/{resource}/setLabels"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["resource", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GlobalSetLabelsRequest) -> ExternalVpnGatewaySetLabelCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ExternalVpnGatewaySetLabelCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ExternalVpnGatewaySetLabelCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExternalVpnGatewaySetLabelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ExternalVpnGatewaySetLabelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExternalVpnGatewaySetLabelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. +/// +/// A builder for the *get* method supported by a *externalVpnGateway* resource. +/// It is not used directly, but through a `ExternalVpnGatewayMethods` instance. /// /// # Example /// @@ -45000,28 +56607,28 @@ impl<'a, C, A> DiskTypeListCall<'a, C, A> where C: BorrowMut, A: /// // 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.zones().get("project", "zone") +/// let result = hub.external_vpn_gateways().get("project", "externalVpnGateway") /// .doit(); /// # } /// ``` -pub struct ZoneGetCall<'a, C, A> +pub struct ExternalVpnGatewayGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _zone: String, + _external_vpn_gateway: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ZoneGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ExternalVpnGatewayGetCall<'a, C, A> {} -impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ExternalVpnGatewayGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Zone)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ExternalVpnGateway)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -45029,12 +56636,12 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.zones.get", + dlg.begin(MethodInfo { id: "compute.externalVpnGateways.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - for &field in ["alt", "project", "zone"].iter() { + params.push(("externalVpnGateway", self._external_vpn_gateway.to_string())); + for &field in ["alt", "project", "externalVpnGateway"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -45046,12 +56653,12 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}"; + let mut url = self.hub._base_url.clone() + "{project}/global/externalVpnGateways/{externalVpnGateway}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + for &(find_this, param_name) in [("{project}", "project"), ("{externalVpnGateway}", "externalVpnGateway")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -45063,7 +56670,7 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth } { let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { + for param_name in ["externalVpnGateway", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -45152,18 +56759,18 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ZoneGetCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> ExternalVpnGatewayGetCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the zone resource to return. + /// Name of the externalVpnGateway to return. /// - /// Sets the *zone* path property to the given value. + /// Sets the *external vpn gateway* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> ZoneGetCall<'a, C, A> { - self._zone = new_value.to_string(); + pub fn external_vpn_gateway(mut self, new_value: &str) -> ExternalVpnGatewayGetCall<'a, C, A> { + self._external_vpn_gateway = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -45172,7 +56779,7 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ZoneGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExternalVpnGatewayGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -45193,7 +56800,7 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ZoneGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ExternalVpnGatewayGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -45213,7 +56820,7 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ZoneGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ExternalVpnGatewayGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -45225,10 +56832,10 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth } -/// Retrieves the list of Zone resources available to the specified project. +/// Deletes the specified externalVpnGateway. /// -/// A builder for the *list* method supported by a *zone* resource. -/// It is not used directly, but through a `ZoneMethods` instance. +/// A builder for the *delete* method supported by a *externalVpnGateway* resource. +/// It is not used directly, but through a `ExternalVpnGatewayMethods` instance. /// /// # Example /// @@ -45252,15 +56859,566 @@ impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // 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.zones().list("project") -/// .page_token("consetetur") -/// .order_by("diam") -/// .max_results(79) -/// .filter("dolores") +/// let result = hub.external_vpn_gateways().delete("project", "externalVpnGateway") +/// .request_id("sit") /// .doit(); /// # } /// ``` -pub struct ZoneListCall<'a, C, A> +pub struct ExternalVpnGatewayDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _external_vpn_gateway: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ExternalVpnGatewayDeleteCall<'a, C, A> {} + +impl<'a, C, A> ExternalVpnGatewayDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.externalVpnGateways.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("externalVpnGateway", self._external_vpn_gateway.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "externalVpnGateway", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/externalVpnGateways/{externalVpnGateway}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{externalVpnGateway}", "externalVpnGateway")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["externalVpnGateway", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ExternalVpnGatewayDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the externalVpnGateways to delete. + /// + /// Sets the *external vpn gateway* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn external_vpn_gateway(mut self, new_value: &str) -> ExternalVpnGatewayDeleteCall<'a, C, A> { + self._external_vpn_gateway = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ExternalVpnGatewayDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExternalVpnGatewayDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ExternalVpnGatewayDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExternalVpnGatewayDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// +/// A builder for the *testIamPermissions* method supported by a *externalVpnGateway* resource. +/// It is not used directly, but through a `ExternalVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::TestPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestPermissionsRequest::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.external_vpn_gateways().test_iam_permissions(req, "project", "resource") +/// .doit(); +/// # } +/// ``` +pub struct ExternalVpnGatewayTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TestPermissionsRequest, + _project: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ExternalVpnGatewayTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestPermissionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.externalVpnGateways.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/externalVpnGateways/{resource}/testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["resource", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestPermissionsRequest) -> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExternalVpnGatewayTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of ExternalVpnGateway available to the specified project. +/// +/// A builder for the *list* method supported by a *externalVpnGateway* resource. +/// It is not used directly, but through a `ExternalVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.external_vpn_gateways().list("project") +/// .page_token("Lorem") +/// .order_by("amet.") +/// .max_results(60) +/// .filter("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ExternalVpnGatewayListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, @@ -45274,13 +57432,13 @@ pub struct ZoneListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ZoneListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ExternalVpnGatewayListCall<'a, C, A> {} -impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ExternalVpnGatewayListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ZoneList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ExternalVpnGatewayList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -45288,7 +57446,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.zones.list", + dlg.begin(MethodInfo { id: "compute.externalVpnGateways.list", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("project", self._project.to_string())); @@ -45316,7 +57474,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones"; + let mut url = self.hub._base_url.clone() + "{project}/global/externalVpnGateways"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -45422,45 +57580,45 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> ExternalVpnGatewayListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> ExternalVpnGatewayListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + pub fn order_by(mut self, new_value: &str) -> ExternalVpnGatewayListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ZoneListCall<'a, C, A> { + pub fn max_results(mut self, new_value: u32) -> ExternalVpnGatewayListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + pub fn filter(mut self, new_value: &str) -> ExternalVpnGatewayListCall<'a, C, A> { self._filter = Some(new_value.to_string()); self } @@ -45470,7 +57628,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ZoneListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExternalVpnGatewayListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -45491,7 +57649,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ZoneListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ExternalVpnGatewayListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -45511,7 +57669,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ZoneListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ExternalVpnGatewayListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -45557,7 +57715,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().set_service_account(req, "project", "zone", "instance") -/// .request_id("elitr") +/// .request_id("sit") /// .doit(); /// # } /// ``` @@ -45834,6 +57992,317 @@ impl<'a, C, A> InstanceSetServiceAccountCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstancesSetMachineResourcesRequest::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.instances().set_machine_resources(req, "project", "zone", "instance") +/// .request_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct InstanceSetMachineResourceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstancesSetMachineResourcesRequest, + _project: String, + _zone: String, + _instance: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceSetMachineResourceCall<'a, C, A> {} + +impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.setMachineResources", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/setMachineResources"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstancesSetMachineResourcesRequest) -> InstanceSetMachineResourceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceSetMachineResourceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceSetMachineResourceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the instance scoping this request. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceSetMachineResourceCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceSetMachineResourceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceSetMachineResourceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceSetMachineResourceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceSetMachineResourceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets an instance's scheduling options. /// /// A builder for the *setScheduling* method supported by a *instance* resource. @@ -45868,7 +58337,7 @@ impl<'a, C, A> InstanceSetServiceAccountCall<'a, C, A> where C: BorrowMut InstanceSetSchedulingCall<'a, C, A> where C: BorrowMut InstanceDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().update_network_interface(req, "project", "zone", "instance", "networkInterface") -/// .request_id("gubergren") +/// .request_id("eos") /// .doit(); /// # } /// ``` @@ -46748,6 +59217,341 @@ impl<'a, C, A> InstanceUpdateNetworkInterfaceCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Instance::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.instances().update(req, "project", "zone", "instance") +/// .request_id("sit") +/// .most_disruptive_allowed_action("labore") +/// .minimal_action("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct InstanceUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Instance, + _project: String, + _zone: String, + _instance: String, + _request_id: Option, + _most_disruptive_allowed_action: Option, + _minimal_action: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceUpdateCall<'a, C, A> {} + +impl<'a, C, A> InstanceUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + if let Some(value) = self._most_disruptive_allowed_action { + params.push(("mostDisruptiveAllowedAction", value.to_string())); + } + if let Some(value) = self._minimal_action { + params.push(("minimalAction", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "requestId", "mostDisruptiveAllowedAction", "minimalAction"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Instance) -> InstanceUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceUpdateCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the instance resource to update. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceUpdateCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceUpdateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + /// + /// Sets the *most disruptive allowed action* query property to the given value. + pub fn most_disruptive_allowed_action(mut self, new_value: &str) -> InstanceUpdateCall<'a, C, A> { + self._most_disruptive_allowed_action = Some(new_value.to_string()); + self + } + /// Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + /// + /// Sets the *minimal action* query property to the given value. + pub fn minimal_action(mut self, new_value: &str) -> InstanceUpdateCall<'a, C, A> { + self._minimal_action = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns the specified guest attributes entry. /// /// A builder for the *getGuestAttributes* method supported by a *instance* resource. @@ -46776,8 +59580,8 @@ impl<'a, C, A> InstanceUpdateNetworkInterfaceCall<'a, C, A> where C: BorrowMut InstanceGetGuestAttributeCall<'a, C, A> where C: BorrowMut InstanceStartCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().reset("project", "zone", "instance") -/// .request_id("vero") +/// .request_id("dolor") /// .doit(); /// # } /// ``` @@ -47596,6 +60400,317 @@ impl<'a, C, A> InstanceResetCall<'a, C, A> where C: BorrowMut, A: } +/// Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +/// +/// A builder for the *setShieldedInstanceIntegrityPolicy* method supported by a *instance* resource. +/// It is not used directly, but through a `InstanceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ShieldedInstanceIntegrityPolicy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ShieldedInstanceIntegrityPolicy::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.instances().set_shielded_instance_integrity_policy(req, "project", "zone", "instance") +/// .request_id("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ShieldedInstanceIntegrityPolicy, + _project: String, + _zone: String, + _instance: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> {} + +impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.setShieldedInstanceIntegrityPolicy", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ShieldedInstanceIntegrityPolicy) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name or id of the instance scoping this request. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Simulates a maintenance event on the instance. /// /// A builder for the *simulateMaintenanceEvent* method supported by a *instance* resource. @@ -47894,7 +61009,7 @@ impl<'a, C, A> InstanceSimulateMaintenanceEventCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().update_access_config(req, "project", "zone", "instance", "networkInterface") -/// .request_id("dolore") +/// .request_id("sea") /// .doit(); /// # } /// ``` @@ -48217,7 +61332,7 @@ impl<'a, C, A> InstanceUpdateAccessConfigCall<'a, C, A> where C: BorrowMut InstanceSetTagCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().set_metadata(req, "project", "zone", "instance") -/// .request_id("diam") +/// .request_id("magna") /// .doit(); /// # } /// ``` @@ -48833,7 +61948,7 @@ impl<'a, C, A> InstanceSetMetadataCall<'a, C, A> where C: BorrowMut InstanceGetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AttachedDisk::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.instances().attach_disk(req, "project", "zone", "instance") -/// .request_id("consetetur") -/// .force_attach(true) -/// .doit(); -/// # } -/// ``` -pub struct InstanceAttachDiskCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: AttachedDisk, - _project: String, - _zone: String, - _instance: String, - _request_id: Option, - _force_attach: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceAttachDiskCall<'a, C, A> {} - -impl<'a, C, A> InstanceAttachDiskCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instances.attachDisk", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instance", self._instance.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - if let Some(value) = self._force_attach { - params.push(("forceAttach", value.to_string())); - } - for &field in ["alt", "project", "zone", "instance", "requestId", "forceAttach"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/attachDisk"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instance", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AttachedDisk) -> InstanceAttachDiskCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The instance name for this request. - /// - /// Sets the *instance* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { - self._instance = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// Whether to force attach the disk even if it's currently attached to another instance. - /// - /// Sets the *force attach* query property to the given value. - pub fn force_attach(mut self, new_value: bool) -> InstanceAttachDiskCall<'a, C, A> { - self._force_attach = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceAttachDiskCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceAttachDiskCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceAttachDiskCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances. /// /// A builder for the *listReferrers* method supported by a *instance* resource. @@ -49712,10 +62504,10 @@ impl<'a, C, A> InstanceAttachDiskCall<'a, C, A> where C: BorrowMut InstanceListReferrerCall<'a, C, A> where C: BorrowMut InstanceListReferrerCall<'a, C, A> { @@ -49918,29 +62710,29 @@ impl<'a, C, A> InstanceListReferrerCall<'a, C, A> where C: BorrowMut InstanceListReferrerCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceListReferrerCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceListReferrerCall<'a, C, A> { @@ -50006,6 +62798,317 @@ impl<'a, C, A> InstanceListReferrerCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstancesRemoveResourcePoliciesRequest::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.instances().remove_resource_policies(req, "project", "zone", "instance") +/// .request_id("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct InstanceRemoveResourcePolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstancesRemoveResourcePoliciesRequest, + _project: String, + _zone: String, + _instance: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceRemoveResourcePolicyCall<'a, C, A> {} + +impl<'a, C, A> InstanceRemoveResourcePolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.removeResourcePolicies", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstancesRemoveResourcePoliciesRequest) -> InstanceRemoveResourcePolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceRemoveResourcePolicyCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceRemoveResourcePolicyCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The instance name for this request. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceRemoveResourcePolicyCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceRemoveResourcePolicyCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceRemoveResourcePolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceRemoveResourcePolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceRemoveResourcePolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. /// /// A builder for the *setLabels* method supported by a *instance* resource. @@ -50040,7 +63143,7 @@ impl<'a, C, A> InstanceListReferrerCall<'a, C, A> where C: BorrowMut InstanceSetLabelCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().start_with_encryption_key(req, "project", "zone", "instance") -/// .request_id("gubergren") +/// .request_id("sed") /// .doit(); /// # } /// ``` @@ -50656,10 +63759,11 @@ impl<'a, C, A> InstanceStartWithEncryptionKeyCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -50693,7 +63798,7 @@ impl<'a, C, A> InstanceAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -50704,10 +63809,13 @@ impl<'a, C, A> InstanceAggregatedListCall<'a, C, A> where C: BorrowMut InstanceAggregatedListCall<'a, C, A> where C: BorrowMut InstanceAggregatedListCall<'a, C, A> { @@ -50838,29 +63946,36 @@ impl<'a, C, A> InstanceAggregatedListCall<'a, C, A> where C: BorrowMut InstanceAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> InstanceAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceAggregatedListCall<'a, C, A> { @@ -50960,7 +64075,7 @@ impl<'a, C, A> InstanceAggregatedListCall<'a, C, A> where C: BorrowMut InstanceGetCall<'a, C, A> where C: BorrowMut, A: o } +/// Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. +/// +/// A builder for the *stop* method supported by a *instance* resource. +/// It is not used directly, but through a `InstanceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instances().stop("project", "zone", "instance") +/// .request_id("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct InstanceStopCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceStopCall<'a, C, A> {} + +impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.stop", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/stop"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the instance resource to stop. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceStopCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceStopCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceStopCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes an access config from an instance's network interface. /// /// A builder for the *deleteAccessConfig* method supported by a *instance* resource. @@ -51529,7 +64924,7 @@ impl<'a, C, A> InstanceGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().delete_access_config("project", "zone", "instance", "accessConfig", "networkInterface") -/// .request_id("diam") +/// .request_id("kasd") /// .doit(); /// # } /// ``` @@ -51805,9 +65200,9 @@ impl<'a, C, A> InstanceDeleteAccessConfigCall<'a, C, A> where C: BorrowMut InstanceDeleteAccessConfigCall<'a, C, A> where C: BorrowMut InstanceDeleteAccessConfigCall<'a, C, A> where C: BorrowMut +pub struct InstanceAttachDiskCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: ShieldedInstanceIntegrityPolicy, + _request: AttachedDisk, _project: String, _zone: String, _instance: String, _request_id: Option, + _force_attach: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for InstanceAttachDiskCall<'a, C, A> {} -impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> InstanceAttachDiskCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -51871,16 +65268,19 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.instances.setShieldedInstanceIntegrityPolicy", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "compute.instances.attachDisk", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("zone", self._zone.to_string())); params.push(("instance", self._instance.to_string())); if let Some(value) = self._request_id { params.push(("requestId", value.to_string())); } - for &field in ["alt", "project", "zone", "instance", "requestId"].iter() { + if let Some(value) = self._force_attach { + params.push(("forceAttach", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "requestId", "forceAttach"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -51892,7 +65292,7 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy"; + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/attachDisk"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -51951,7 +65351,7 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -52012,7 +65412,7 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: ShieldedInstanceIntegrityPolicy) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + pub fn request(mut self, new_value: AttachedDisk) -> InstanceAttachDiskCall<'a, C, A> { self._request = new_value; self } @@ -52022,7 +65422,7 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -52032,17 +65432,17 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// Name or id of the instance scoping this request. + /// The instance name for this request. /// /// Sets the *instance* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + pub fn instance(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { self._instance = new_value.to_string(); self } @@ -52053,17 +65453,24 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). /// /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + pub fn request_id(mut self, new_value: &str) -> InstanceAttachDiskCall<'a, C, A> { self._request_id = Some(new_value.to_string()); self } + /// Whether to force attach the disk even if it's currently attached to another instance. + /// + /// Sets the *force attach* query property to the given value. + pub fn force_attach(mut self, new_value: bool) -> InstanceAttachDiskCall<'a, C, A> { + self._force_attach = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceAttachDiskCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -52084,7 +65491,7 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> InstanceAttachDiskCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -52104,7 +65511,7 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> InstanceAttachDiskCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -52150,7 +65557,7 @@ impl<'a, C, A> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C, A> where C: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().set_min_cpu_platform(req, "project", "zone", "instance") -/// .request_id("sed") +/// .request_id("erat") /// .doit(); /// # } /// ``` @@ -52461,7 +65868,7 @@ impl<'a, C, A> InstanceSetMinCpuPlatformCall<'a, C, A> where C: BorrowMut InstanceUpdateShieldedInstanceConfigCall<'a, C, A> where C: Borro } +/// Adds an access config to an instance's network interface. +/// +/// A builder for the *addAccessConfig* method supported by a *instance* resource. +/// It is not used directly, but through a `InstanceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::AccessConfig; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AccessConfig::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.instances().add_access_config(req, "project", "zone", "instance", "networkInterface") +/// .request_id("clita") +/// .doit(); +/// # } +/// ``` +pub struct InstanceAddAccessConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: AccessConfig, + _project: String, + _zone: String, + _instance: String, + _network_interface: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceAddAccessConfigCall<'a, C, A> {} + +impl<'a, C, A> InstanceAddAccessConfigCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.addAccessConfig", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + params.push(("networkInterface", self._network_interface.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "networkInterface", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/addAccessConfig"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AccessConfig) -> InstanceAddAccessConfigCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The instance name for this request. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// The name of the network interface to add to this instance. + /// + /// Sets the *network interface* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network_interface(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { + self._network_interface = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceAddAccessConfigCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceAddAccessConfigCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceAddAccessConfigCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an instance resource in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *instance* resource. +/// It is not used directly, but through a `InstanceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Instance; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Instance::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.instances().insert(req, "project", "zone") +/// .source_instance_template("ea") +/// .request_id("et") +/// .doit(); +/// # } +/// ``` +pub struct InstanceInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Instance, + _project: String, + _zone: String, + _source_instance_template: Option, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceInsertCall<'a, C, A> {} + +impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._source_instance_template { + params.push(("sourceInstanceTemplate", value.to_string())); + } + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "sourceInstanceTemplate", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Instance) -> InstanceInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies instance template to create the instance. + /// + /// This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + /// - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate + /// - projects/project/global/instanceTemplates/instanceTemplate + /// - global/instanceTemplates/instanceTemplate + /// + /// Sets the *source instance template* query property to the given value. + pub fn source_instance_template(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { + self._source_instance_template = Some(new_value.to_string()); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns permissions that a caller has on the specified resource. /// /// A builder for the *testIamPermissions* method supported by a *instance* resource. @@ -53033,322 +67079,6 @@ impl<'a, C, A> InstanceTestIamPermissionCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Instance::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.instances().insert(req, "project", "zone") -/// .source_instance_template("erat") -/// .request_id("gubergren") -/// .doit(); -/// # } -/// ``` -pub struct InstanceInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Instance, - _project: String, - _zone: String, - _source_instance_template: Option, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceInsertCall<'a, C, A> {} - -impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instances.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - if let Some(value) = self._source_instance_template { - params.push(("sourceInstanceTemplate", value.to_string())); - } - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "sourceInstanceTemplate", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Instance) -> InstanceInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Specifies instance template to create the instance. - /// - /// This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - /// - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate - /// - projects/project/global/instanceTemplates/instanceTemplate - /// - global/instanceTemplates/instanceTemplate - /// - /// Sets the *source instance template* query property to the given value. - pub fn source_instance_template(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { - self._source_instance_template = Some(new_value.to_string()); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns the last 1 MB of serial port output from the specified instance. /// /// A builder for the *getSerialPortOutput* method supported by a *instance* resource. @@ -53377,8 +67107,8 @@ impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().get_serial_port_output("project", "zone", "instance") -/// .start("Lorem") -/// .port(-78) +/// .start("sed") +/// .port(-98) /// .doit(); /// # } /// ``` @@ -53664,8 +67394,8 @@ impl<'a, C, A> InstanceGetSerialPortOutputCall<'a, C, A> where C: BorrowMut InstanceSetDiskAutoDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AccessConfig::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.instances().add_access_config(req, "project", "zone", "instance", "networkInterface") -/// .request_id("magna") -/// .doit(); -/// # } -/// ``` -pub struct InstanceAddAccessConfigCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: AccessConfig, - _project: String, - _zone: String, - _instance: String, - _network_interface: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceAddAccessConfigCall<'a, C, A> {} - -impl<'a, C, A> InstanceAddAccessConfigCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instances.addAccessConfig", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instance", self._instance.to_string())); - params.push(("networkInterface", self._network_interface.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instance", "networkInterface", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/addAccessConfig"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instance", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AccessConfig) -> InstanceAddAccessConfigCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The instance name for this request. - /// - /// Sets the *instance* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { - self._instance = new_value.to_string(); - self - } - /// The name of the network interface to add to this instance. - /// - /// Sets the *network interface* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn network_interface(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { - self._network_interface = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceAddAccessConfigCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceAddAccessConfigCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceAddAccessConfigCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceAddAccessConfigCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. -/// -/// A builder for the *stop* method supported by a *instance* resource. -/// It is not used directly, but through a `InstanceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.instances().stop("project", "zone", "instance") -/// .request_id("sit") -/// .doit(); -/// # } -/// ``` -pub struct InstanceStopCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _instance: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceStopCall<'a, C, A> {} - -impl<'a, C, A> InstanceStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instances.stop", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instance", self._instance.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instance", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/stop"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instance", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Name of the instance resource to stop. - /// - /// Sets the *instance* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { - self._instance = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceStopCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceStopCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceStopCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceStopCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Sets the access control policy on the specified resource. Replaces any existing policy. /// /// A builder for the *setIamPolicy* method supported by a *instance* resource. @@ -55131,7 +68258,7 @@ impl<'a, C, A> InstanceGetShieldedInstanceIdentityCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instances().set_deletion_protection("project", "zone", "resource") -/// .request_id("dolores") +/// .request_id("Lorem") /// .deletion_protection(true) /// .doit(); /// # } @@ -55395,9 +68522,9 @@ impl<'a, C, A> InstanceSetDeletionProtectionCall<'a, C, A> where C: BorrowMut InstanceSetDeletionProtectionCall<'a, C, A> where C: BorrowMut InstanceSetDeletionProtectionCall<'a, C, A> where C: BorrowMut +pub struct InstanceUpdateDisplayDeviceCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: InstancesSetMachineResourcesRequest, + _request: DisplayDevice, _project: String, _zone: String, _instance: String, @@ -55447,9 +68574,9 @@ pub struct InstanceSetMachineResourceCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for InstanceSetMachineResourceCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for InstanceUpdateDisplayDeviceCall<'a, C, A> {} -impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> InstanceUpdateDisplayDeviceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -55461,7 +68588,318 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.instances.setMachineResources", + dlg.begin(MethodInfo { id: "compute.instances.updateDisplayDevice", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instance", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instance", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DisplayDevice) -> InstanceUpdateDisplayDeviceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceUpdateDisplayDeviceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceUpdateDisplayDeviceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the instance scoping this request. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> InstanceUpdateDisplayDeviceCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceUpdateDisplayDeviceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceUpdateDisplayDeviceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceUpdateDisplayDeviceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceUpdateDisplayDeviceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. +/// +/// A builder for the *addResourcePolicies* method supported by a *instance* resource. +/// It is not used directly, but through a `InstanceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstancesAddResourcePoliciesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstancesAddResourcePoliciesRequest::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.instances().add_resource_policies(req, "project", "zone", "instance") +/// .request_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct InstanceAddResourcePolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstancesAddResourcePoliciesRequest, + _project: String, + _zone: String, + _instance: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceAddResourcePolicyCall<'a, C, A> {} + +impl<'a, C, A> InstanceAddResourcePolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instances.addResourcePolicies", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("project", self._project.to_string())); @@ -55482,7 +68920,7 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut InstanceSetMachineResourceCall<'a, C, A> { + pub fn request(mut self, new_value: InstancesAddResourcePoliciesRequest) -> InstanceAddResourcePolicyCall<'a, C, A> { self._request = new_value; self } @@ -55612,7 +69050,7 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut InstanceSetMachineResourceCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> InstanceAddResourcePolicyCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -55622,17 +69060,17 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut InstanceSetMachineResourceCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> InstanceAddResourcePolicyCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// Name of the instance scoping this request. + /// The instance name for this request. /// /// Sets the *instance* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> InstanceSetMachineResourceCall<'a, C, A> { + pub fn instance(mut self, new_value: &str) -> InstanceAddResourcePolicyCall<'a, C, A> { self._instance = new_value.to_string(); self } @@ -55643,7 +69081,7 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut InstanceSetMachineResourceCall<'a, C, A> { + pub fn request_id(mut self, new_value: &str) -> InstanceAddResourcePolicyCall<'a, C, A> { self._request_id = Some(new_value.to_string()); self } @@ -55653,7 +69091,7 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut InstanceSetMachineResourceCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceAddResourcePolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -55674,7 +69112,7 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceSetMachineResourceCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> InstanceAddResourcePolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -55694,7 +69132,7 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> InstanceSetMachineResourceCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> InstanceAddResourcePolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -55734,10 +69172,10 @@ impl<'a, C, A> InstanceSetMachineResourceCall<'a, C, A> where C: BorrowMut InstanceListCall<'a, C, A> where C: BorrowMut, A: self._zone = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { @@ -55928,29 +69366,29 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { @@ -56016,6 +69454,1423 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: } +/// Deletes the specified SslCertificate resource in the region. +/// +/// A builder for the *delete* method supported by a *regionSslCertificate* resource. +/// It is not used directly, but through a `RegionSslCertificateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_ssl_certificates().delete("project", "region", "sslCertificate") +/// .request_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct RegionSslCertificateDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _ssl_certificate: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionSslCertificateDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegionSslCertificateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionSslCertificates.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("sslCertificate", self._ssl_certificate.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "sslCertificate", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/sslCertificates/{sslCertificate}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{sslCertificate}", "sslCertificate")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["sslCertificate", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionSslCertificateDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionSslCertificateDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the SslCertificate resource to delete. + /// + /// Sets the *ssl certificate* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn ssl_certificate(mut self, new_value: &str) -> RegionSslCertificateDeleteCall<'a, C, A> { + self._ssl_certificate = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionSslCertificateDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionSslCertificateDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionSslCertificateDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionSslCertificateDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a SslCertificate resource in the specified project and region using the data included in the request +/// +/// A builder for the *insert* method supported by a *regionSslCertificate* resource. +/// It is not used directly, but through a `RegionSslCertificateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::SslCertificate; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SslCertificate::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.region_ssl_certificates().insert(req, "project", "region") +/// .request_id("et") +/// .doit(); +/// # } +/// ``` +pub struct RegionSslCertificateInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: SslCertificate, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionSslCertificateInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionSslCertificateInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionSslCertificates.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/sslCertificates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SslCertificate) -> RegionSslCertificateInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionSslCertificateInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionSslCertificateInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionSslCertificateInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionSslCertificateInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionSslCertificateInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionSslCertificateInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of SslCertificate resources available to the specified project in the specified region. +/// +/// A builder for the *list* method supported by a *regionSslCertificate* resource. +/// It is not used directly, but through a `RegionSslCertificateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_ssl_certificates().list("project", "region") +/// .page_token("takimata") +/// .order_by("invidunt") +/// .max_results(54) +/// .filter("dolor") +/// .doit(); +/// # } +/// ``` +pub struct RegionSslCertificateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionSslCertificateListCall<'a, C, A> {} + +impl<'a, C, A> RegionSslCertificateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SslCertificateList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionSslCertificates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/sslCertificates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionSslCertificateListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionSslCertificateListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionSslCertificateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionSslCertificateListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionSslCertificateListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionSslCertificateListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionSslCertificateListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionSslCertificateListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionSslCertificateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. +/// +/// A builder for the *get* method supported by a *regionSslCertificate* resource. +/// It is not used directly, but through a `RegionSslCertificateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_ssl_certificates().get("project", "region", "sslCertificate") +/// .doit(); +/// # } +/// ``` +pub struct RegionSslCertificateGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _ssl_certificate: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionSslCertificateGetCall<'a, C, A> {} + +impl<'a, C, A> RegionSslCertificateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SslCertificate)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionSslCertificates.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("sslCertificate", self._ssl_certificate.to_string())); + for &field in ["alt", "project", "region", "sslCertificate"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/sslCertificates/{sslCertificate}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{sslCertificate}", "sslCertificate")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["sslCertificate", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionSslCertificateGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionSslCertificateGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the SslCertificate resource to return. + /// + /// Sets the *ssl certificate* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn ssl_certificate(mut self, new_value: &str) -> RegionSslCertificateGetCall<'a, C, A> { + self._ssl_certificate = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionSslCertificateGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionSslCertificateGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionSslCertificateGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a rule at the specified priority. +/// +/// A builder for the *removeRule* method supported by a *securityPolicy* resource. +/// It is not used directly, but through a `SecurityPolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.security_policies().remove_rule("project", "securityPolicy") +/// .priority(-70) +/// .doit(); +/// # } +/// ``` +pub struct SecurityPolicyRemoveRuleCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _security_policy: String, + _priority: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SecurityPolicyRemoveRuleCall<'a, C, A> {} + +impl<'a, C, A> SecurityPolicyRemoveRuleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.securityPolicies.removeRule", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("securityPolicy", self._security_policy.to_string())); + if let Some(value) = self._priority { + params.push(("priority", value.to_string())); + } + for &field in ["alt", "project", "securityPolicy", "priority"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/securityPolicies/{securityPolicy}/removeRule"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{securityPolicy}", "securityPolicy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["securityPolicy", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> SecurityPolicyRemoveRuleCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the security policy to update. + /// + /// Sets the *security policy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn security_policy(mut self, new_value: &str) -> SecurityPolicyRemoveRuleCall<'a, C, A> { + self._security_policy = new_value.to_string(); + self + } + /// The priority of the rule to remove from the security policy. + /// + /// Sets the *priority* query property to the given value. + pub fn priority(mut self, new_value: i32) -> SecurityPolicyRemoveRuleCall<'a, C, A> { + self._priority = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SecurityPolicyRemoveRuleCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SecurityPolicyRemoveRuleCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SecurityPolicyRemoveRuleCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Inserts a rule into a security policy. /// /// A builder for the *addRule* method supported by a *securityPolicy* resource. @@ -56327,7 +71182,7 @@ impl<'a, C, A> SecurityPolicyAddRuleCall<'a, C, A> where C: BorrowMut SecurityPolicyDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.security_policies().list_preconfigured_expression_sets("project") +/// .page_token("magna") +/// .order_by("amet.") +/// .max_results(62) +/// .filter("ea") +/// .doit(); +/// # } +/// ``` +pub struct SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> {} + +impl<'a, C, A> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SecurityPoliciesListPreconfiguredExpressionSetsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.securityPolicies.listPreconfiguredExpressionSets", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/securityPolicies/listPreconfiguredExpressionSets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SecurityPolicyListPreconfiguredExpressionSetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Patches the specified policy with the data included in the request. /// /// A builder for the *patch* method supported by a *securityPolicy* resource. @@ -56601,7 +71754,7 @@ impl<'a, C, A> SecurityPolicyDeleteCall<'a, C, A> where C: BorrowMut SecurityPolicyPatchCall<'a, C, A> where C: BorrowMut SecurityPolicyGetRuleCall<'a, C, A> where C: BorrowMut SecurityPolicyGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.security_policies().list("project") -/// .page_token("sed") -/// .order_by("tempor") -/// .max_results(38) -/// .filter("kasd") +/// .page_token("consetetur") +/// .order_by("eirmod") +/// .max_results(69) +/// .filter("no") /// .doit(); /// # } /// ``` @@ -57870,7 +73023,7 @@ impl<'a, C, A> SecurityPolicyListCall<'a, C, A> where C: BorrowMut SecurityPolicyListCall<'a, C, A> { @@ -57879,29 +73032,29 @@ impl<'a, C, A> SecurityPolicyListCall<'a, C, A> where C: BorrowMut SecurityPolicyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SecurityPolicyListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SecurityPolicyListCall<'a, C, A> { @@ -58001,7 +73154,7 @@ impl<'a, C, A> SecurityPolicyListCall<'a, C, A> where C: BorrowMut SecurityPolicyPatchRuleCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.security_policies().remove_rule("project", "securityPolicy") -/// .priority(-76) -/// .doit(); -/// # } -/// ``` -pub struct SecurityPolicyRemoveRuleCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _security_policy: String, - _priority: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SecurityPolicyRemoveRuleCall<'a, C, A> {} - -impl<'a, C, A> SecurityPolicyRemoveRuleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.securityPolicies.removeRule", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("securityPolicy", self._security_policy.to_string())); - if let Some(value) = self._priority { - params.push(("priority", value.to_string())); - } - for &field in ["alt", "project", "securityPolicy", "priority"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/securityPolicies/{securityPolicy}/removeRule"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{securityPolicy}", "securityPolicy")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["securityPolicy", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> SecurityPolicyRemoveRuleCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the security policy to update. - /// - /// Sets the *security policy* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn security_policy(mut self, new_value: &str) -> SecurityPolicyRemoveRuleCall<'a, C, A> { - self._security_policy = new_value.to_string(); - self - } - /// The priority of the rule to remove from the security policy. - /// - /// Sets the *priority* query property to the given value. - pub fn priority(mut self, new_value: i32) -> SecurityPolicyRemoveRuleCall<'a, C, A> { - self._priority = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SecurityPolicyRemoveRuleCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> SecurityPolicyRemoveRuleCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SecurityPolicyRemoveRuleCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Gets the most recent health check results for this BackendService. /// /// A builder for the *getHealth* method supported by a *backendService* resource. @@ -58836,7 +73725,7 @@ impl<'a, C, A> BackendServiceGetHealthCall<'a, C, A> where C: BorrowMut BackendServiceDeleteCall<'a, C, A> where C: BorrowMut BackendServiceDeleteCall<'a, C, A> where C: BorrowMut BackendServiceUpdateCall<'a, C, A> where C: BorrowMut BackendServiceUpdateCall<'a, C, A> where C: BorrowMut BackendServiceAddSignedUrlKeyCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -60290,7 +75181,7 @@ impl<'a, C, A> BackendServiceAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -60301,10 +75192,13 @@ impl<'a, C, A> BackendServiceAggregatedListCall<'a, C, A> where C: BorrowMut BackendServiceAggregatedListCall<'a, C, A> where C: BorrowMut BackendServiceAggregatedListCall<'a, C, A> { @@ -60435,29 +75329,36 @@ impl<'a, C, A> BackendServiceAggregatedListCall<'a, C, A> where C: BorrowMut BackendServiceAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> BackendServiceAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> BackendServiceAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> BackendServiceAggregatedListCall<'a, C, A> { @@ -60557,7 +75458,7 @@ impl<'a, C, A> BackendServiceAggregatedListCall<'a, C, A> where C: BorrowMut BackendServiceSetSecurityPolicyCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.backend_services().delete_signed_url_key("project", "backendService", "keyName") -/// .request_id("amet") +/// .request_id("sit") /// .doit(); /// # } /// ``` @@ -61130,10 +76031,10 @@ impl<'a, C, A> BackendServiceDeleteSignedUrlKeyCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.backend_services().list("project") -/// .page_token("eirmod") -/// .order_by("elitr") -/// .max_results(88) -/// .filter("et") +/// .page_token("vero") +/// .order_by("accusam") +/// .max_results(27) +/// .filter("clita") /// .doit(); /// # } /// ``` @@ -61303,7 +76204,7 @@ impl<'a, C, A> BackendServiceListCall<'a, C, A> where C: BorrowMut BackendServiceListCall<'a, C, A> { @@ -61312,29 +76213,29 @@ impl<'a, C, A> BackendServiceListCall<'a, C, A> where C: BorrowMut BackendServiceListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> BackendServiceListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> BackendServiceListCall<'a, C, A> { @@ -61400,7 +76301,7 @@ impl<'a, C, A> BackendServiceListCall<'a, C, A> where C: BorrowMut BackendServiceListCall<'a, C, A> where C: BorrowMut BackendServiceInsertCall<'a, C, A> where C: BorrowMut ImageListCall<'a, C, A> where C: BorrowMut, A: oau self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ImageListCall<'a, C, A> { @@ -61897,29 +76798,29 @@ impl<'a, C, A> ImageListCall<'a, C, A> where C: BorrowMut, A: oau } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> ImageListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ImageListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ImageListCall<'a, C, A> { @@ -62520,6 +77421,274 @@ impl<'a, C, A> ImageSetLabelCall<'a, C, A> where C: BorrowMut, A: } +/// Deletes the specified image. +/// +/// A builder for the *delete* method supported by a *image* resource. +/// It is not used directly, but through a `ImageMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.images().delete("project", "image") +/// .request_id("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct ImageDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _image: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ImageDeleteCall<'a, C, A> {} + +impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.images.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("image", self._image.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "image", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/images/{image}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["image", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the image resource to delete. + /// + /// Sets the *image* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn image(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { + self._image = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ImageDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ImageDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ImageDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the deprecation status of an image. /// /// If an empty request body is given, clears the deprecation status instead. @@ -62556,7 +77725,7 @@ impl<'a, C, A> ImageSetLabelCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.images().deprecate(req, "project", "image") -/// .request_id("sea") +/// .request_id("justo") /// .doit(); /// # } /// ``` @@ -63104,510 +78273,6 @@ impl<'a, C, A> ImageTestIamPermissionCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.images().get_iam_policy("project", "resource") -/// .doit(); -/// # } -/// ``` -pub struct ImageGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ImageGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ImageGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.images.getIamPolicy", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "project", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/images/{resource}/getIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{resource}", "resource")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["resource", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageGetIamPolicyCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name or id of the resource for this request. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ImageGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ImageGetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageGetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the latest image that is part of an image family and is not deprecated. -/// -/// A builder for the *getFromFamily* method supported by a *image* resource. -/// It is not used directly, but through a `ImageMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.images().get_from_family("project", "family") -/// .doit(); -/// # } -/// ``` -pub struct ImageGetFromFamilyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _family: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ImageGetFromFamilyCall<'a, C, A> {} - -impl<'a, C, A> ImageGetFromFamilyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Image)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.images.getFromFamily", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("family", self._family.to_string())); - for &field in ["alt", "project", "family"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/images/family/{family}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{family}", "family")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["family", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageGetFromFamilyCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the image family to search for. - /// - /// Sets the *family* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn family(mut self, new_value: &str) -> ImageGetFromFamilyCall<'a, C, A> { - self._family = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ImageGetFromFamilyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageGetFromFamilyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageGetFromFamilyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates an image in the specified project using the data included in the request. /// /// A builder for the *insert* method supported by a *image* resource. @@ -63642,7 +78307,7 @@ impl<'a, C, A> ImageGetFromFamilyCall<'a, C, A> where C: BorrowMut ImageInsertCall<'a, C, A> where C: BorrowMut, A: o } -/// Deletes the specified image. +/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. /// -/// A builder for the *delete* method supported by a *image* resource. +/// A builder for the *getIamPolicy* method supported by a *image* resource. /// It is not used directly, but through a `ImageMethods` instance. /// /// # Example @@ -63934,30 +78599,28 @@ impl<'a, C, A> ImageInsertCall<'a, C, A> where C: BorrowMut, A: o /// // 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.images().delete("project", "image") -/// .request_id("dolore") +/// let result = hub.images().get_iam_policy("project", "resource") /// .doit(); /// # } /// ``` -pub struct ImageDeleteCall<'a, C, A> +pub struct ImageGetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _image: String, - _request_id: Option, + _resource: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ImageDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ImageGetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ImageGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -63965,15 +78628,12 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.images.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "compute.images.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("image", self._image.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "image", "requestId"].iter() { + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "resource"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -63985,12 +78645,12 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/images/{image}"; + let mut url = self.hub._base_url.clone() + "{project}/global/images/{resource}/getIamPolicy"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project"), ("{image}", "image")].iter() { + for &(find_this, param_name) in [("{project}", "project"), ("{resource}", "resource")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -64002,7 +78662,7 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o } { let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["image", "project"].iter() { + for param_name in ["resource", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -64032,7 +78692,7 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -64091,29 +78751,18 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> ImageGetIamPolicyCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the image resource to delete. + /// Name or id of the resource for this request. /// - /// Sets the *image* path property to the given value. + /// Sets the *resource* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn image(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { - self._image = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ImageDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); + pub fn resource(mut self, new_value: &str) -> ImageGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -64122,7 +78771,7 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ImageDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ImageGetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -64143,7 +78792,7 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ImageDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ImageGetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -64152,7 +78801,7 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -64163,7 +78812,7 @@ impl<'a, C, A> ImageDeleteCall<'a, C, A> where C: BorrowMut, A: o /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ImageDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ImageGetIamPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -64458,10 +79107,10 @@ impl<'a, C, A> ImageSetIamPolicyCall<'a, C, A> where C: BorrowMut } -/// Retrieves the list of regional BackendService resources available to the specified project in the given region. +/// Returns the latest image that is part of an image family and is not deprecated. /// -/// A builder for the *list* method supported by a *regionBackendService* resource. -/// It is not used directly, but through a `RegionBackendServiceMethods` instance. +/// A builder for the *getFromFamily* method supported by a *image* resource. +/// It is not used directly, but through a `ImageMethods` instance. /// /// # Example /// @@ -64485,36 +79134,28 @@ impl<'a, C, A> ImageSetIamPolicyCall<'a, C, A> where C: BorrowMut /// // 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.region_backend_services().list("project", "region") -/// .page_token("accusam") -/// .order_by("diam") -/// .max_results(48) -/// .filter("eirmod") +/// let result = hub.images().get_from_family("project", "family") /// .doit(); /// # } /// ``` -pub struct RegionBackendServiceListCall<'a, C, A> +pub struct ImageGetFromFamilyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, + _family: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RegionBackendServiceListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ImageGetFromFamilyCall<'a, C, A> {} -impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ImageGetFromFamilyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, BackendServiceList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Image)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -64522,24 +79163,12 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.regionBackendServices.list", + dlg.begin(MethodInfo { id: "compute.images.getFromFamily", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + params.push(("family", self._family.to_string())); + for &field in ["alt", "project", "family"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -64551,12 +79180,12 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -64568,7 +79197,7 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { + for param_name in ["family", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -64657,56 +79286,18 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut RegionBackendServiceListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> ImageGetFromFamilyCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the region scoping this request. + /// Name of the image family to search for. /// - /// Sets the *region* path property to the given value. + /// Sets the *family* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionBackendServiceListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionBackendServiceListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + pub fn family(mut self, new_value: &str) -> ImageGetFromFamilyCall<'a, C, A> { + self._family = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -64715,7 +79306,7 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut RegionBackendServiceListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ImageGetFromFamilyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -64736,7 +79327,7 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegionBackendServiceListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ImageGetFromFamilyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -64756,7 +79347,7 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RegionBackendServiceListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ImageGetFromFamilyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -64768,10 +79359,10 @@ impl<'a, C, A> RegionBackendServiceListCall<'a, C, A> where C: BorrowMut RegionBackendServiceListCall<'a, C, A> where C: BorrowMut RegionBackendServiceListCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BackendService::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.region_backend_services().insert(req, "project", "region") -/// .request_id("voluptua.") +/// let result = hub.region_autoscalers().delete("project", "region", "autoscaler") +/// .request_id("Lorem") /// .doit(); /// # } /// ``` -pub struct RegionBackendServiceInsertCall<'a, C, A> +pub struct RegionAutoscalerDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: BackendService, _project: String, _region: String, + _autoscaler: String, _request_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RegionBackendServiceInsertCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RegionAutoscalerDeleteCall<'a, C, A> {} -impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RegionAutoscalerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -64833,15 +79418,16 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.regionBackendServices.insert", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "compute.regionAutoscalers.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("region", self._region.to_string())); + params.push(("autoscaler", self._autoscaler.to_string())); if let Some(value) = self._request_id { params.push(("requestId", value.to_string())); } - for &field in ["alt", "project", "region", "requestId"].iter() { + for &field in ["alt", "project", "region", "autoscaler", "requestId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -64853,12 +79439,12 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -64869,8 +79455,8 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["autoscaler", "region", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -64882,17 +79468,6 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut RegionBackendServiceInsertCall<'a, C, A> { - self._request = new_value; - self - } /// Project ID for this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionBackendServiceInsertCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -64993,10 +79555,20 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut RegionBackendServiceInsertCall<'a, C, A> { + pub fn region(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { self._region = new_value.to_string(); self } + /// Name of the autoscaler to delete. + /// + /// Sets the *autoscaler* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { + self._autoscaler = new_value.to_string(); + self + } /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. /// /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. @@ -65004,7 +79576,7 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut RegionBackendServiceInsertCall<'a, C, A> { + pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { self._request_id = Some(new_value.to_string()); self } @@ -65014,7 +79586,7 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut RegionBackendServiceInsertCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -65035,7 +79607,7 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegionBackendServiceInsertCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RegionAutoscalerDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -65055,7 +79627,7 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RegionBackendServiceInsertCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RegionAutoscalerDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -65067,10 +79639,10 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_autoscalers().get("project", "region", "autoscaler") +/// .doit(); +/// # } +/// ``` +pub struct RegionAutoscalerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _autoscaler: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionAutoscalerGetCall<'a, C, A> {} + +impl<'a, C, A> RegionAutoscalerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Autoscaler)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionAutoscalers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("autoscaler", self._autoscaler.to_string())); + for &field in ["alt", "project", "region", "autoscaler"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/autoscalers/{autoscaler}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{autoscaler}", "autoscaler")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["autoscaler", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionAutoscalerGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionAutoscalerGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the autoscaler to return. + /// + /// Sets the *autoscaler* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerGetCall<'a, C, A> { + self._autoscaler = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionAutoscalerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionAutoscalerGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates an autoscaler in the specified project using the data included in the request. +/// +/// A builder for the *update* method supported by a *regionAutoscaler* resource. +/// It is not used directly, but through a `RegionAutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Autoscaler; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -65095,33 +79931,34 @@ impl<'a, C, A> RegionBackendServiceInsertCall<'a, C, A> where C: BorrowMut +pub struct RegionAutoscalerUpdateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: BackendService, + _request: Autoscaler, _project: String, _region: String, - _backend_service: String, _request_id: Option, + _autoscaler: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RegionBackendServiceUpdateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RegionAutoscalerUpdateCall<'a, C, A> {} -impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RegionAutoscalerUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -65133,16 +79970,18 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.regionBackendServices.update", + dlg.begin(MethodInfo { id: "compute.regionAutoscalers.update", http_method: hyper::method::Method::Put }); let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("region", self._region.to_string())); - params.push(("backendService", self._backend_service.to_string())); if let Some(value) = self._request_id { params.push(("requestId", value.to_string())); } - for &field in ["alt", "project", "region", "backendService", "requestId"].iter() { + if let Some(value) = self._autoscaler { + params.push(("autoscaler", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId", "autoscaler"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -65154,12 +79993,12 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -65170,8 +80009,8 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["backendService", "region", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -65274,7 +80113,7 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut RegionBackendServiceUpdateCall<'a, C, A> { + pub fn request(mut self, new_value: Autoscaler) -> RegionAutoscalerUpdateCall<'a, C, A> { self._request = new_value; self } @@ -65284,7 +80123,7 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut RegionBackendServiceUpdateCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -65294,20 +80133,10 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut RegionBackendServiceUpdateCall<'a, C, A> { + pub fn region(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { self._region = new_value.to_string(); self } - /// Name of the BackendService resource to update. - /// - /// Sets the *backend service* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceUpdateCall<'a, C, A> { - self._backend_service = new_value.to_string(); - self - } /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. /// /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. @@ -65315,17 +80144,24 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut RegionBackendServiceUpdateCall<'a, C, A> { + pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { self._request_id = Some(new_value.to_string()); self } + /// Name of the autoscaler to update. + /// + /// Sets the *autoscaler* query property to the given value. + pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { + self._autoscaler = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceUpdateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerUpdateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -65346,7 +80182,7 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegionBackendServiceUpdateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RegionAutoscalerUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -65366,7 +80202,7 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RegionBackendServiceUpdateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RegionAutoscalerUpdateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -65378,10 +80214,10 @@ impl<'a, C, A> RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut RegionBackendServiceUpdateCall<'a, C, A> where C: BorrowMut +pub struct RegionAutoscalerListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, _region: String, - _backend_service: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RegionBackendServiceGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RegionAutoscalerListCall<'a, C, A> {} -impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RegionAutoscalerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, BackendService)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, RegionAutoscalerList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -65435,13 +80278,24 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.regionBackendServices.get", + dlg.begin(MethodInfo { id: "compute.regionAutoscalers.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("region", self._region.to_string())); - params.push(("backendService", self._backend_service.to_string())); - for &field in ["alt", "project", "region", "backendService"].iter() { + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -65453,12 +80307,12 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -65469,8 +80323,8 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["backendService", "region", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -65559,7 +80413,7 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -65569,18 +80423,46 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetCall<'a, C, A> { + pub fn region(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { self._region = new_value.to_string(); self } - /// Name of the BackendService resource to return. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// - /// Sets the *backend service* path property to the given value. + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceGetCall<'a, C, A> { - self._backend_service = new_value.to_string(); + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionAutoscalerListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -65589,7 +80471,7 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -65610,7 +80492,7 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegionBackendServiceGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RegionAutoscalerListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -65630,7 +80512,7 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RegionBackendServiceGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RegionAutoscalerListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -65642,10 +80524,10 @@ impl<'a, C, A> RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_backend_services().delete("project", "region", "backendService") -/// .request_id("sed") -/// .doit(); -/// # } -/// ``` -pub struct RegionBackendServiceDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _backend_service: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionBackendServiceDeleteCall<'a, C, A> {} - -impl<'a, C, A> RegionBackendServiceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionBackendServices.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("backendService", self._backend_service.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "backendService", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/backendServices/{backendService}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{backendService}", "backendService")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["backendService", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the BackendService resource to delete. - /// - /// Sets the *backend service* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { - self._backend_service = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionBackendServiceDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServiceDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionBackendServiceDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionBackendServiceDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. -/// -/// A builder for the *patch* method supported by a *regionBackendService* resource. -/// It is not used directly, but through a `RegionBackendServiceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::BackendService; +/// use compute1::Autoscaler; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -65950,33 +80552,34 @@ impl<'a, C, A> RegionBackendServiceDeleteCall<'a, C, A> where C: BorrowMut +pub struct RegionAutoscalerPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: BackendService, + _request: Autoscaler, _project: String, _region: String, - _backend_service: String, _request_id: Option, + _autoscaler: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RegionBackendServicePatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RegionAutoscalerPatchCall<'a, C, A> {} -impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RegionAutoscalerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -65988,16 +80591,18 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.regionBackendServices.patch", + dlg.begin(MethodInfo { id: "compute.regionAutoscalers.patch", http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("region", self._region.to_string())); - params.push(("backendService", self._backend_service.to_string())); if let Some(value) = self._request_id { params.push(("requestId", value.to_string())); } - for &field in ["alt", "project", "region", "backendService", "requestId"].iter() { + if let Some(value) = self._autoscaler { + params.push(("autoscaler", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId", "autoscaler"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -66009,12 +80614,12 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -66025,8 +80630,8 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["backendService", "region", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -66129,7 +80734,7 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut RegionBackendServicePatchCall<'a, C, A> { + pub fn request(mut self, new_value: Autoscaler) -> RegionAutoscalerPatchCall<'a, C, A> { self._request = new_value; self } @@ -66139,7 +80744,7 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut RegionBackendServicePatchCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -66149,20 +80754,10 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut RegionBackendServicePatchCall<'a, C, A> { + pub fn region(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { self._region = new_value.to_string(); self } - /// Name of the BackendService resource to patch. - /// - /// Sets the *backend service* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn backend_service(mut self, new_value: &str) -> RegionBackendServicePatchCall<'a, C, A> { - self._backend_service = new_value.to_string(); - self - } /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. /// /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. @@ -66170,17 +80765,24 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut RegionBackendServicePatchCall<'a, C, A> { + pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { self._request_id = Some(new_value.to_string()); self } + /// Name of the autoscaler to patch. + /// + /// Sets the *autoscaler* query property to the given value. + pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { + self._autoscaler = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionBackendServicePatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -66201,7 +80803,7 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegionBackendServicePatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RegionAutoscalerPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -66221,7 +80823,7 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RegionBackendServicePatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RegionAutoscalerPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -66233,10 +80835,10 @@ impl<'a, C, A> RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut RegionBackendServicePatchCall<'a, C, A> where C: BorrowMut +pub struct RegionAutoscalerInsertCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, - _request: ResourceGroupReference, + _request: Autoscaler, _project: String, _region: String, - _backend_service: String, + _request_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for RegionBackendServiceGetHealthCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RegionAutoscalerInsertCall<'a, C, A> {} -impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RegionAutoscalerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, BackendServiceGroupHealth)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -66297,13 +80900,15 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.regionBackendServices.getHealth", + dlg.begin(MethodInfo { id: "compute.regionAutoscalers.insert", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("region", self._region.to_string())); - params.push(("backendService", self._backend_service.to_string())); - for &field in ["alt", "project", "region", "backendService"].iter() { + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -66315,12 +80920,12 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -66331,8 +80936,8 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["backendService", "region", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -66435,16 +81040,17 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetHealthCall<'a, C, A> { + pub fn request(mut self, new_value: Autoscaler) -> RegionAutoscalerInsertCall<'a, C, A> { self._request = new_value; self } + /// Project ID for this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionBackendServiceGetHealthCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> RegionAutoscalerInsertCall<'a, C, A> { self._project = new_value.to_string(); self } @@ -66454,18 +81060,19 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetHealthCall<'a, C, A> { + pub fn region(mut self, new_value: &str) -> RegionAutoscalerInsertCall<'a, C, A> { self._region = new_value.to_string(); self } - /// Name of the BackendService resource for which to get health. + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). /// - /// Sets the *backend service* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn backend_service(mut self, new_value: &str) -> RegionBackendServiceGetHealthCall<'a, C, A> { - self._backend_service = new_value.to_string(); + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -66474,7 +81081,7 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetHealthCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerInsertCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -66495,7 +81102,7 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RegionBackendServiceGetHealthCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RegionAutoscalerInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -66515,7 +81122,7 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> RegionBackendServiceGetHealthCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RegionAutoscalerInsertCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -66527,7 +81134,7 @@ impl<'a, C, A> RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut RegionBackendServiceGetHealthCall<'a, C, A> where C: BorrowMut LicenseDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. +/// Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// A builder for the *list* method supported by a *license* resource. /// It is not used directly, but through a `LicenseMethods` instance. @@ -66824,9 +81431,9 @@ impl<'a, C, A> LicenseDeleteCall<'a, C, A> where C: BorrowMut, A: /// // Values shown here are possibly random and not representative ! /// let result = hub.licenses().list("project") /// .page_token("sit") -/// .order_by("justo") -/// .max_results(40) -/// .filter("ipsum") +/// .order_by("ipsum") +/// .max_results(37) +/// .filter("clita") /// .doit(); /// # } /// ``` @@ -66996,7 +81603,7 @@ impl<'a, C, A> LicenseListCall<'a, C, A> where C: BorrowMut, A: o self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> LicenseListCall<'a, C, A> { @@ -67005,29 +81612,29 @@ impl<'a, C, A> LicenseListCall<'a, C, A> where C: BorrowMut, A: o } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> LicenseListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> LicenseListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> LicenseListCall<'a, C, A> { @@ -67093,7 +81700,7 @@ impl<'a, C, A> LicenseListCall<'a, C, A> where C: BorrowMut, A: o } -/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. +/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// A builder for the *getIamPolicy* method supported by a *license* resource. /// It is not used directly, but through a `LicenseMethods` instance. @@ -67345,7 +81952,7 @@ impl<'a, C, A> LicenseGetIamPolicyCall<'a, C, A> where C: BorrowMut LicenseSetIamPolicyCall<'a, C, A> where C: BorrowMut LicenseGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Returns permissions that a caller has on the specified resource. +/// Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// A builder for the *testIamPermissions* method supported by a *license* resource. /// It is not used directly, but through a `LicenseMethods` instance. @@ -68163,7 +82770,7 @@ impl<'a, C, A> LicenseTestIamPermissionCall<'a, C, A> where C: BorrowMut LicenseTestIamPermissionCall<'a, C, A> where C: BorrowMut LicenseInsertCall<'a, C, A> where C: BorrowMut, A: } +/// Sets the named ports for the specified instance group. +/// +/// A builder for the *setNamedPorts* method supported by a *instanceGroup* resource. +/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupsSetNamedPortsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupsSetNamedPortsRequest::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.instance_groups().set_named_ports(req, "project", "zone", "instanceGroup") +/// .request_id("et") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupSetNamedPortCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupsSetNamedPortsRequest, + _project: String, + _zone: String, + _instance_group: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupSetNamedPortCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupSetNamedPortCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.setNamedPorts", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroup", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupsSetNamedPortsRequest) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group where the named ports are updated. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupSetNamedPortCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupSetNamedPortCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupSetNamedPortCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates an instance group in the specified project using the parameters that are included in the request. /// /// A builder for the *insert* method supported by a *instanceGroup* resource. @@ -68484,7 +83402,7 @@ impl<'a, C, A> LicenseInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.instance_groups().insert(req, "project", "zone") -/// .request_id("eos") +/// .request_id("invidunt") /// .doit(); /// # } /// ``` @@ -68783,7 +83701,7 @@ impl<'a, C, A> InstanceGroupInsertCall<'a, C, A> where C: BorrowMut InstanceGroupAddInstanceCall<'a, C, A> where C: BorrowMut InstanceGroupRemoveInstanceCall<'a, C, A> where C: BorrowMut InstanceGroupDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupsSetNamedPortsRequest::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.instance_groups().set_named_ports(req, "project", "zone", "instanceGroup") -/// .request_id("clita") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupSetNamedPortCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupsSetNamedPortsRequest, - _project: String, - _zone: String, - _instance_group: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupSetNamedPortCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupSetNamedPortCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroups.setNamedPorts", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroup", self._instance_group.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroup", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroup}", "instanceGroup")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroup", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupsSetNamedPortsRequest) -> InstanceGroupSetNamedPortCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the instance group where the named ports are updated. - /// - /// Sets the *instance group* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { - self._instance_group = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupSetNamedPortCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupSetNamedPortCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupSetNamedPortCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupSetNamedPortCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves the list of instance groups and sorts them by zone. /// /// A builder for the *aggregatedList* method supported by a *instanceGroup* resource. @@ -69992,10 +84599,11 @@ impl<'a, C, A> InstanceGroupSetNamedPortCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -70029,7 +84638,7 @@ impl<'a, C, A> InstanceGroupAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -70040,10 +84649,13 @@ impl<'a, C, A> InstanceGroupAggregatedListCall<'a, C, A> where C: BorrowMut InstanceGroupAggregatedListCall<'a, C, A> where C: BorrowMut InstanceGroupAggregatedListCall<'a, C, A> { @@ -70174,29 +84786,36 @@ impl<'a, C, A> InstanceGroupAggregatedListCall<'a, C, A> where C: BorrowMut InstanceGroupAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceGroupAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> InstanceGroupAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceGroupAggregatedListCall<'a, C, A> { @@ -70262,6 +84881,316 @@ impl<'a, C, A> InstanceGroupAggregatedListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_groups().list("project", "zone") +/// .page_token("sit") +/// .order_by("magna") +/// .max_results(49) +/// .filter("clita") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupListCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the instances in the specified instance group. /// /// A builder for the *listInstances* method supported by a *instanceGroup* resource. @@ -70296,10 +85225,10 @@ impl<'a, C, A> InstanceGroupAggregatedListCall<'a, C, A> where C: BorrowMut InstanceGroupListInstanceCall<'a, C, A> where C: BorrowMut InstanceGroupListInstanceCall<'a, C, A> { @@ -70527,29 +85456,29 @@ impl<'a, C, A> InstanceGroupListInstanceCall<'a, C, A> where C: BorrowMut InstanceGroupListInstanceCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InstanceGroupListInstanceCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceGroupListInstanceCall<'a, C, A> { @@ -70879,10 +85808,10 @@ impl<'a, C, A> InstanceGroupGetCall<'a, C, A> where C: BorrowMut, } -/// Retrieves the list of instance groups that are located in the specified project and zone. +/// Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. /// -/// A builder for the *list* method supported by a *instanceGroup* resource. -/// It is not used directly, but through a `InstanceGroupMethods` instance. +/// A builder for the *aggregatedList* method supported by a *targetHttpsProxy* resource. +/// It is not used directly, but through a `TargetHttpsProxyMethods` instance. /// /// # Example /// @@ -70906,36 +85835,37 @@ impl<'a, C, A> InstanceGroupGetCall<'a, C, A> where C: BorrowMut, /// // 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.instance_groups().list("project", "zone") +/// let result = hub.target_https_proxies().aggregated_list("project") /// .page_token("dolor") -/// .order_by("et") -/// .max_results(54) -/// .filter("sit") +/// .order_by("tempor") +/// .max_results(52) +/// .include_all_scopes(false) +/// .filter("et") /// .doit(); /// # } /// ``` -pub struct InstanceGroupListCall<'a, C, A> +pub struct TargetHttpsProxyAggregatedListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _zone: String, _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for InstanceGroupListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for TargetHttpsProxyAggregatedListCall<'a, C, A> {} -impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> TargetHttpsProxyAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpsProxyAggregatedList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -70943,11 +85873,10 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.instanceGroups.list", + dlg.begin(MethodInfo { id: "compute.targetHttpsProxies.aggregatedList", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -70957,10 +85886,13 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } if let Some(value) = self._filter { params.push(("filter", value.to_string())); } - for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -70972,12 +85904,12 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroups"; + let mut url = self.hub._base_url.clone() + "{project}/aggregated/targetHttpsProxies"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + for &(find_this, param_name) in [("{project}", "project")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -70988,8 +85920,8 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -71072,61 +86004,58 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut } - /// Project ID for this request. + /// Name of the project scoping this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// The name of the zone where the instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + pub fn order_by(mut self, new_value: &str) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> InstanceGroupListCall<'a, C, A> { + pub fn max_results(mut self, new_value: u32) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> InstanceGroupListCall<'a, C, A> { + pub fn filter(mut self, new_value: &str) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { self._filter = Some(new_value.to_string()); self } @@ -71136,7 +86065,7 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetHttpsProxyAggregatedListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -71157,7 +86086,7 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> TargetHttpsProxyAggregatedListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -71177,7 +86106,7 @@ impl<'a, C, A> InstanceGroupListCall<'a, C, A> where C: BorrowMut /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> TargetHttpsProxyAggregatedListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -71475,7 +86404,7 @@ impl<'a, C, A> TargetHttpsProxyGetCall<'a, C, A> where C: BorrowMut TargetHttpsProxySetQuicOverrideCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_https_proxies().list("project") -/// .page_token("vero") -/// .order_by("accusam") -/// .max_results(27) -/// .filter("clita") +/// .page_token("eos") +/// .order_by("dolor") +/// .max_results(51) +/// .filter("amet") /// .doit(); /// # } /// ``` @@ -71941,7 +86870,7 @@ impl<'a, C, A> TargetHttpsProxyListCall<'a, C, A> where C: BorrowMut TargetHttpsProxyListCall<'a, C, A> { @@ -71950,29 +86879,29 @@ impl<'a, C, A> TargetHttpsProxyListCall<'a, C, A> where C: BorrowMut TargetHttpsProxyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetHttpsProxyListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetHttpsProxyListCall<'a, C, A> { @@ -72066,7 +86995,7 @@ impl<'a, C, A> TargetHttpsProxyListCall<'a, C, A> where C: BorrowMut TargetHttpsProxyDeleteCall<'a, C, A> where C: BorrowMut TargetHttpsProxySetUrlMapCall<'a, C, A> where C: BorrowMut TargetHttpsProxyInsertCall<'a, C, A> where C: BorrowMut TargetHttpsProxySetSslCertificateCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_https_proxies().set_ssl_policy(req, "project", "targetHttpsProxy") -/// .request_id("gubergren") +/// .request_id("dolores") /// .doit(); /// # } /// ``` @@ -73524,7 +88453,7 @@ impl<'a, C, A> TargetHttpsProxySetSslPolicyCall<'a, C, A> where C: BorrowMut NetworkGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.networks().insert(req, "project") -/// .request_id("clita") +/// .request_id("sit") /// .doit(); /// # } /// ``` @@ -74328,6 +89257,352 @@ impl<'a, C, A> NetworkInsertCall<'a, C, A> where C: BorrowMut, A: } +/// Lists the peering routes exchanged over peering connection. +/// +/// A builder for the *listPeeringRoutes* method supported by a *network* resource. +/// It is not used directly, but through a `NetworkMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.networks().list_peering_routes("project", "network") +/// .region("sed") +/// .peering_name("et") +/// .page_token("rebum.") +/// .order_by("eos") +/// .max_results(90) +/// .filter("dolores") +/// .direction("ut") +/// .doit(); +/// # } +/// ``` +pub struct NetworkListPeeringRouteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _network: String, + _region: Option, + _peering_name: Option, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _direction: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NetworkListPeeringRouteCall<'a, C, A> {} + +impl<'a, C, A> NetworkListPeeringRouteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ExchangedPeeringRoutesList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.networks.listPeeringRoutes", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(11 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("network", self._network.to_string())); + if let Some(value) = self._region { + params.push(("region", value.to_string())); + } + if let Some(value) = self._peering_name { + params.push(("peeringName", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + if let Some(value) = self._direction { + params.push(("direction", value.to_string())); + } + for &field in ["alt", "project", "network", "region", "peeringName", "pageToken", "orderBy", "maxResults", "filter", "direction"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networks/{network}/listPeeringRoutes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{network}", "network")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["network", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the network for this request. + /// + /// Sets the *network* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._network = new_value.to_string(); + self + } + /// The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + /// + /// Sets the *region* query property to the given value. + pub fn region(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._region = Some(new_value.to_string()); + self + } + /// The response will show routes exchanged over the given peering connection. + /// + /// Sets the *peering name* query property to the given value. + pub fn peering_name(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._peering_name = Some(new_value.to_string()); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> NetworkListPeeringRouteCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The direction of the exchanged routes. + /// + /// Sets the *direction* query property to the given value. + pub fn direction(mut self, new_value: &str) -> NetworkListPeeringRouteCall<'a, C, A> { + self._direction = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NetworkListPeeringRouteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NetworkListPeeringRouteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NetworkListPeeringRouteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Switches the network mode from auto subnet mode to custom subnet mode. /// /// A builder for the *switchToCustomMode* method supported by a *network* resource. @@ -74356,7 +89631,7 @@ impl<'a, C, A> NetworkInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.networks().switch_to_custom_mode("project", "network") -/// .request_id("dolor") +/// .request_id("voluptua.") /// .doit(); /// # } /// ``` @@ -74630,7 +89905,7 @@ impl<'a, C, A> NetworkSwitchToCustomModeCall<'a, C, A> where C: BorrowMut NetworkPatchCall<'a, C, A> where C: BorrowMut, A: } +/// Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes +/// +/// A builder for the *updatePeering* method supported by a *network* resource. +/// It is not used directly, but through a `NetworkMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::NetworksUpdatePeeringRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = NetworksUpdatePeeringRequest::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.networks().update_peering(req, "project", "network") +/// .request_id("sanctus") +/// .doit(); +/// # } +/// ``` +pub struct NetworkUpdatePeeringCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: NetworksUpdatePeeringRequest, + _project: String, + _network: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NetworkUpdatePeeringCall<'a, C, A> {} + +impl<'a, C, A> NetworkUpdatePeeringCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.networks.updatePeering", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("network", self._network.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "network", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networks/{network}/updatePeering"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{network}", "network")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["network", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: NetworksUpdatePeeringRequest) -> NetworkUpdatePeeringCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> NetworkUpdatePeeringCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the network resource which the updated peering is belonging to. + /// + /// Sets the *network* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network(mut self, new_value: &str) -> NetworkUpdatePeeringCall<'a, C, A> { + self._network = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> NetworkUpdatePeeringCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NetworkUpdatePeeringCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NetworkUpdatePeeringCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NetworkUpdatePeeringCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Removes a peering from the specified network. /// /// A builder for the *removePeering* method supported by a *network* resource. @@ -74929,7 +90503,7 @@ impl<'a, C, A> NetworkPatchCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.networks().remove_peering(req, "project", "network") -/// .request_id("rebum.") +/// .request_id("no") /// .doit(); /// # } /// ``` @@ -75194,6 +90768,304 @@ impl<'a, C, A> NetworkRemovePeeringCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.networks().list("project") +/// .page_token("consetetur") +/// .order_by("aliquyam") +/// .max_results(73) +/// .filter("magna") +/// .doit(); +/// # } +/// ``` +pub struct NetworkListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NetworkListCall<'a, C, A> {} + +impl<'a, C, A> NetworkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NetworkList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.networks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> NetworkListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NetworkListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NetworkListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NetworkListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes the specified network. /// /// A builder for the *delete* method supported by a *network* resource. @@ -75222,7 +91094,7 @@ impl<'a, C, A> NetworkRemovePeeringCall<'a, C, A> where C: BorrowMut NetworkDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves the list of networks available to the specified project. -/// -/// A builder for the *list* method supported by a *network* resource. -/// It is not used directly, but through a `NetworkMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.networks().list("project") -/// .page_token("dolore") -/// .order_by("est") -/// .max_results(13) -/// .filter("accusam") -/// .doit(); -/// # } -/// ``` -pub struct NetworkListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for NetworkListCall<'a, C, A> {} - -impl<'a, C, A> NetworkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, NetworkList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.networks.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/networks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> NetworkListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> NetworkListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NetworkListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> NetworkListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> NetworkListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves a list of node types available to the specified project. /// /// A builder for the *list* method supported by a *nodeType* resource. @@ -75788,10 +91362,10 @@ impl<'a, C, A> NetworkListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.node_types().list("project", "zone") -/// .page_token("eirmod") -/// .order_by("sit") -/// .max_results(7) -/// .filter("amet") +/// .page_token("sed") +/// .order_by("amet.") +/// .max_results(32) +/// .filter("sit") /// .doit(); /// # } /// ``` @@ -75973,7 +91547,7 @@ impl<'a, C, A> NodeTypeListCall<'a, C, A> where C: BorrowMut, A: self._zone = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NodeTypeListCall<'a, C, A> { @@ -75982,29 +91556,29 @@ impl<'a, C, A> NodeTypeListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> NodeTypeListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NodeTypeListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NodeTypeListCall<'a, C, A> { @@ -76098,10 +91672,11 @@ impl<'a, C, A> NodeTypeListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.node_types().aggregated_list("project") -/// .page_token("duo") -/// .order_by("et") -/// .max_results(94) -/// .filter("et") +/// .page_token("voluptua.") +/// .order_by("sed") +/// .max_results(92) +/// .include_all_scopes(true) +/// .filter("kasd") /// .doit(); /// # } /// ``` @@ -76113,6 +91688,7 @@ pub struct NodeTypeAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -76135,7 +91711,7 @@ impl<'a, C, A> NodeTypeAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -76146,10 +91722,13 @@ impl<'a, C, A> NodeTypeAggregatedListCall<'a, C, A> where C: BorrowMut NodeTypeAggregatedListCall<'a, C, A> where C: BorrowMut NodeTypeAggregatedListCall<'a, C, A> { @@ -76280,29 +91859,36 @@ impl<'a, C, A> NodeTypeAggregatedListCall<'a, C, A> where C: BorrowMut NodeTypeAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NodeTypeAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> NodeTypeAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NodeTypeAggregatedListCall<'a, C, A> { @@ -76660,7 +92246,7 @@ impl<'a, C, A> NodeTypeGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.addresses().delete("project", "region", "address") -/// .request_id("rebum.") +/// .request_id("et") /// .doit(); /// # } /// ``` @@ -76940,10 +92526,10 @@ impl<'a, C, A> AddresseDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.addresses().list("project", "region") -/// .page_token("clita") -/// .order_by("clita") -/// .max_results(86) -/// .filter("ut") +/// .page_token("sed") +/// .order_by("sit") +/// .max_results(6) +/// .filter("sea") /// .doit(); /// # } /// ``` @@ -77125,7 +92711,7 @@ impl<'a, C, A> AddresseListCall<'a, C, A> where C: BorrowMut, A: self._region = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> AddresseListCall<'a, C, A> { @@ -77134,29 +92720,29 @@ impl<'a, C, A> AddresseListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> AddresseListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> AddresseListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> AddresseListCall<'a, C, A> { @@ -77250,10 +92836,11 @@ impl<'a, C, A> AddresseListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.addresses().aggregated_list("project") -/// .page_token("tempor") -/// .order_by("sed") -/// .max_results(23) -/// .filter("At") +/// .page_token("invidunt") +/// .order_by("invidunt") +/// .max_results(51) +/// .include_all_scopes(false) +/// .filter("tempor") /// .doit(); /// # } /// ``` @@ -77265,6 +92852,7 @@ pub struct AddresseAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -77287,7 +92875,7 @@ impl<'a, C, A> AddresseAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -77298,10 +92886,13 @@ impl<'a, C, A> AddresseAggregatedListCall<'a, C, A> where C: BorrowMut AddresseAggregatedListCall<'a, C, A> where C: BorrowMut AddresseAggregatedListCall<'a, C, A> { @@ -77432,29 +93023,36 @@ impl<'a, C, A> AddresseAggregatedListCall<'a, C, A> where C: BorrowMut AddresseAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> AddresseAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> AddresseAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> AddresseAggregatedListCall<'a, C, A> { @@ -77818,7 +93416,7 @@ impl<'a, C, A> AddresseGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.addresses().insert(req, "project", "region") -/// .request_id("Stet") +/// .request_id("erat") /// .doit(); /// # } /// ``` @@ -78083,1781 +93681,6 @@ impl<'a, C, A> AddresseInsertCall<'a, C, A> where C: BorrowMut, A } -/// Deletes the specified autoscaler. -/// -/// A builder for the *delete* method supported by a *regionAutoscaler* resource. -/// It is not used directly, but through a `RegionAutoscalerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_autoscalers().delete("project", "region", "autoscaler") -/// .request_id("invidunt") -/// .doit(); -/// # } -/// ``` -pub struct RegionAutoscalerDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _autoscaler: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionAutoscalerDeleteCall<'a, C, A> {} - -impl<'a, C, A> RegionAutoscalerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionAutoscalers.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("autoscaler", self._autoscaler.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "autoscaler", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/autoscalers/{autoscaler}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{autoscaler}", "autoscaler")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["autoscaler", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the autoscaler to delete. - /// - /// Sets the *autoscaler* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { - self._autoscaler = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionAutoscalerDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionAutoscalerDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified autoscaler. -/// -/// A builder for the *get* method supported by a *regionAutoscaler* resource. -/// It is not used directly, but through a `RegionAutoscalerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_autoscalers().get("project", "region", "autoscaler") -/// .doit(); -/// # } -/// ``` -pub struct RegionAutoscalerGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _autoscaler: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionAutoscalerGetCall<'a, C, A> {} - -impl<'a, C, A> RegionAutoscalerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Autoscaler)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionAutoscalers.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("autoscaler", self._autoscaler.to_string())); - for &field in ["alt", "project", "region", "autoscaler"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/autoscalers/{autoscaler}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{autoscaler}", "autoscaler")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["autoscaler", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionAutoscalerGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionAutoscalerGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the autoscaler to return. - /// - /// Sets the *autoscaler* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerGetCall<'a, C, A> { - self._autoscaler = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionAutoscalerGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionAutoscalerGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates an autoscaler in the specified project using the data included in the request. -/// -/// A builder for the *update* method supported by a *regionAutoscaler* resource. -/// It is not used directly, but through a `RegionAutoscalerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Autoscaler; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Autoscaler::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.region_autoscalers().update(req, "project", "region") -/// .request_id("sed") -/// .autoscaler("tempor") -/// .doit(); -/// # } -/// ``` -pub struct RegionAutoscalerUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Autoscaler, - _project: String, - _region: String, - _request_id: Option, - _autoscaler: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionAutoscalerUpdateCall<'a, C, A> {} - -impl<'a, C, A> RegionAutoscalerUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionAutoscalers.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - if let Some(value) = self._autoscaler { - params.push(("autoscaler", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId", "autoscaler"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/autoscalers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Autoscaler) -> RegionAutoscalerUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// Name of the autoscaler to update. - /// - /// Sets the *autoscaler* query property to the given value. - pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerUpdateCall<'a, C, A> { - self._autoscaler = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionAutoscalerUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionAutoscalerUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves a list of autoscalers contained within the specified region. -/// -/// A builder for the *list* method supported by a *regionAutoscaler* resource. -/// It is not used directly, but through a `RegionAutoscalerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_autoscalers().list("project", "region") -/// .page_token("Lorem") -/// .order_by("dolor") -/// .max_results(50) -/// .filter("sed") -/// .doit(); -/// # } -/// ``` -pub struct RegionAutoscalerListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionAutoscalerListCall<'a, C, A> {} - -impl<'a, C, A> RegionAutoscalerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RegionAutoscalerList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionAutoscalers.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/autoscalers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionAutoscalerListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionAutoscalerListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionAutoscalerListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionAutoscalerListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. -/// -/// A builder for the *patch* method supported by a *regionAutoscaler* resource. -/// It is not used directly, but through a `RegionAutoscalerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Autoscaler; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Autoscaler::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.region_autoscalers().patch(req, "project", "region") -/// .request_id("sea") -/// .autoscaler("voluptua.") -/// .doit(); -/// # } -/// ``` -pub struct RegionAutoscalerPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Autoscaler, - _project: String, - _region: String, - _request_id: Option, - _autoscaler: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionAutoscalerPatchCall<'a, C, A> {} - -impl<'a, C, A> RegionAutoscalerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionAutoscalers.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - if let Some(value) = self._autoscaler { - params.push(("autoscaler", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId", "autoscaler"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/autoscalers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Autoscaler) -> RegionAutoscalerPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// Name of the autoscaler to patch. - /// - /// Sets the *autoscaler* query property to the given value. - pub fn autoscaler(mut self, new_value: &str) -> RegionAutoscalerPatchCall<'a, C, A> { - self._autoscaler = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionAutoscalerPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionAutoscalerPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates an autoscaler in the specified project using the data included in the request. -/// -/// A builder for the *insert* method supported by a *regionAutoscaler* resource. -/// It is not used directly, but through a `RegionAutoscalerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Autoscaler; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Autoscaler::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.region_autoscalers().insert(req, "project", "region") -/// .request_id("sit") -/// .doit(); -/// # } -/// ``` -pub struct RegionAutoscalerInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Autoscaler, - _project: String, - _region: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionAutoscalerInsertCall<'a, C, A> {} - -impl<'a, C, A> RegionAutoscalerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionAutoscalers.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/autoscalers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Autoscaler) -> RegionAutoscalerInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionAutoscalerInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionAutoscalerInsertCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionAutoscalerInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionAutoscalerInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionAutoscalerInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionAutoscalerInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves an aggregated list of interconnect attachments. /// /// A builder for the *aggregatedList* method supported by a *interconnectAttachment* resource. @@ -79886,10 +93709,11 @@ impl<'a, C, A> RegionAutoscalerInsertCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -79923,7 +93748,7 @@ impl<'a, C, A> InterconnectAttachmentAggregatedListCall<'a, C, A> where C: Borro }; dlg.begin(MethodInfo { id: "compute.interconnectAttachments.aggregatedList", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -79934,10 +93759,13 @@ impl<'a, C, A> InterconnectAttachmentAggregatedListCall<'a, C, A> where C: Borro if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } if let Some(value) = self._filter { params.push(("filter", value.to_string())); } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -80059,7 +93887,7 @@ impl<'a, C, A> InterconnectAttachmentAggregatedListCall<'a, C, A> where C: Borro self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> InterconnectAttachmentAggregatedListCall<'a, C, A> { @@ -80068,29 +93896,36 @@ impl<'a, C, A> InterconnectAttachmentAggregatedListCall<'a, C, A> where C: Borro } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> InterconnectAttachmentAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InterconnectAttachmentAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> InterconnectAttachmentAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InterconnectAttachmentAggregatedListCall<'a, C, A> { @@ -80190,7 +94025,7 @@ impl<'a, C, A> InterconnectAttachmentAggregatedListCall<'a, C, A> where C: Borro /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.interconnect_attachments().patch(req, "project", "region", "interconnectAttachment") -/// .request_id("gubergren") +/// .request_id("vero") /// .doit(); /// # } /// ``` @@ -80501,7 +94336,8 @@ impl<'a, C, A> InterconnectAttachmentPatchCall<'a, C, A> where C: BorrowMut _request: InterconnectAttachment, _project: String, _region: String, + _validate_only: Option, _request_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -80534,13 +94371,16 @@ impl<'a, C, A> InterconnectAttachmentInsertCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("region", self._region.to_string())); + if let Some(value) = self._validate_only { + params.push(("validateOnly", value.to_string())); + } if let Some(value) = self._request_id { params.push(("requestId", value.to_string())); } - for &field in ["alt", "project", "region", "requestId"].iter() { + for &field in ["alt", "project", "region", "validateOnly", "requestId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -80696,6 +94536,13 @@ impl<'a, C, A> InterconnectAttachmentInsertCall<'a, C, A> where C: BorrowMut InterconnectAttachmentInsertCall<'a, C, A> { + self._validate_only = Some(new_value); + self + } /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. /// /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. @@ -81058,7 +94905,7 @@ impl<'a, C, A> InterconnectAttachmentGetCall<'a, C, A> where C: BorrowMut InterconnectAttachmentDeleteCall<'a, C, A> where C: BorrowMut InterconnectAttachmentListCall<'a, C, A> where C: BorrowMut InterconnectAttachmentListCall<'a, C, A> { @@ -81532,29 +95379,29 @@ impl<'a, C, A> InterconnectAttachmentListCall<'a, C, A> where C: BorrowMut InterconnectAttachmentListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> InterconnectAttachmentListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InterconnectAttachmentListCall<'a, C, A> { @@ -81912,10 +95759,10 @@ impl<'a, C, A> NodeGroupGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.node_groups().list_nodes("project", "zone", "nodeGroup") -/// .page_token("kasd") -/// .order_by("nonumy") -/// .max_results(53) -/// .filter("diam") +/// .page_token("consetetur") +/// .order_by("et") +/// .max_results(31) +/// .filter("erat") /// .doit(); /// # } /// ``` @@ -82109,7 +95956,7 @@ impl<'a, C, A> NodeGroupListNodeCall<'a, C, A> where C: BorrowMut self._node_group = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NodeGroupListNodeCall<'a, C, A> { @@ -82118,29 +95965,29 @@ impl<'a, C, A> NodeGroupListNodeCall<'a, C, A> where C: BorrowMut } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> NodeGroupListNodeCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NodeGroupListNodeCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NodeGroupListNodeCall<'a, C, A> { @@ -82234,10 +96081,10 @@ impl<'a, C, A> NodeGroupListNodeCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.node_groups().list("project", "zone") -/// .page_token("dolor") -/// .order_by("et") -/// .max_results(97) -/// .filter("gubergren") +/// .page_token("takimata") +/// .order_by("dolor") +/// .max_results(60) +/// .filter("sanctus") /// .doit(); /// # } /// ``` @@ -82419,7 +96266,7 @@ impl<'a, C, A> NodeGroupListCall<'a, C, A> where C: BorrowMut, A: self._zone = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NodeGroupListCall<'a, C, A> { @@ -82428,29 +96275,29 @@ impl<'a, C, A> NodeGroupListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> NodeGroupListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NodeGroupListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NodeGroupListCall<'a, C, A> { @@ -82549,8 +96396,8 @@ impl<'a, C, A> NodeGroupListCall<'a, C, A> where C: BorrowMut, A: /// // 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.node_groups().insert(req, "project", "zone", -69) -/// .request_id("dolores") +/// let result = hub.node_groups().insert(req, "project", "zone", -20) +/// .request_id("accusam") /// .doit(); /// # } /// ``` @@ -83091,6 +96938,317 @@ impl<'a, C, A> NodeGroupGetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = NodeGroup::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.node_groups().patch(req, "project", "zone", "nodeGroup") +/// .request_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct NodeGroupPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: NodeGroup, + _project: String, + _zone: String, + _node_group: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NodeGroupPatchCall<'a, C, A> {} + +impl<'a, C, A> NodeGroupPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.nodeGroups.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("nodeGroup", self._node_group.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "nodeGroup", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/nodeGroups/{nodeGroup}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{nodeGroup}", "nodeGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["nodeGroup", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: NodeGroup) -> NodeGroupPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> NodeGroupPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> NodeGroupPatchCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the NodeGroup resource to update. + /// + /// Sets the *node group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn node_group(mut self, new_value: &str) -> NodeGroupPatchCall<'a, C, A> { + self._node_group = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> NodeGroupPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NodeGroupPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NodeGroupPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NodeGroupPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the node template of the node group. /// /// A builder for the *setNodeTemplate* method supported by a *nodeGroup* resource. @@ -83125,7 +97283,7 @@ impl<'a, C, A> NodeGroupGetIamPolicyCall<'a, C, A> where C: BorrowMut NodeGroupSetNodeTemplateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.node_groups().aggregated_list("project") -/// .page_token("sed") -/// .order_by("et") -/// .max_results(35) -/// .filter("eos") -/// .doit(); -/// # } -/// ``` -pub struct NodeGroupAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for NodeGroupAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> NodeGroupAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, NodeGroupAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.nodeGroups.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/nodeGroups"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> NodeGroupAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NodeGroupAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> NodeGroupAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> NodeGroupAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns permissions that a caller has on the specified resource. /// /// A builder for the *testIamPermissions* method supported by a *nodeGroup* resource. @@ -84023,7 +97883,7 @@ impl<'a, C, A> NodeGroupTestIamPermissionCall<'a, C, A> where C: BorrowMut NodeGroupDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.node_groups().delete_nodes(req, "project", "zone", "nodeGroup") -/// .request_id("takimata") +/// .request_id("et") /// .doit(); /// # } /// ``` @@ -84506,7 +98366,7 @@ impl<'a, C, A> NodeGroupDeleteNodeCall<'a, C, A> where C: BorrowMut NodeGroupDeleteNodeCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.node_groups().aggregated_list("project") +/// .page_token("consetetur") +/// .order_by("amet.") +/// .max_results(88) +/// .include_all_scopes(false) +/// .filter("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct NodeGroupAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NodeGroupAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> NodeGroupAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NodeGroupAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.nodeGroups.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/nodeGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> NodeGroupAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> NodeGroupAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> NodeGroupAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NodeGroupAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NodeGroupAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NodeGroupAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the access control policy on the specified resource. Replaces any existing policy. /// /// A builder for the *setIamPolicy* method supported by a *nodeGroup* resource. @@ -84915,7 +99085,7 @@ impl<'a, C, A> NodeGroupSetIamPolicyCall<'a, C, A> where C: BorrowMut NodeGroupAddNodeCall<'a, C, A> where C: BorrowMut, } -/// Deletes the specified autoscaler. +/// Changes the URL map for TargetHttpProxy. /// -/// A builder for the *delete* method supported by a *autoscaler* resource. -/// It is not used directly, but through a `AutoscalerMethods` instance. +/// A builder for the *setUrlMap* method supported by a *regionTargetHttpProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::UrlMapReference; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UrlMapReference::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.region_target_http_proxies().set_url_map(req, "project", "region", "targetHttpProxy") +/// .request_id("diam") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpProxySetUrlMapCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: UrlMapReference, + _project: String, + _region: String, + _target_http_proxy: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpProxySetUrlMapCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpProxySetUrlMapCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpProxies.setUrlMap", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetHttpProxy", self._target_http_proxy.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "targetHttpProxy", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetHttpProxy}", "targetHttpProxy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetHttpProxy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UrlMapReference) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the TargetHttpProxy to set a URL map for. + /// + /// Sets the *target http proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_http_proxy(mut self, new_value: &str) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> { + self._target_http_proxy = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpProxySetUrlMapCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. +/// +/// A builder for the *list* method supported by a *regionTargetHttpProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpProxyMethods` instance. /// /// # Example /// @@ -85219,31 +99700,36 @@ impl<'a, C, A> NodeGroupAddNodeCall<'a, C, A> where C: BorrowMut, /// // 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.autoscalers().delete("project", "zone", "autoscaler") -/// .request_id("eirmod") +/// let result = hub.region_target_http_proxies().list("project", "region") +/// .page_token("vero") +/// .order_by("sit") +/// .max_results(32) +/// .filter("ipsum") /// .doit(); /// # } /// ``` -pub struct AutoscalerDeleteCall<'a, C, A> +pub struct RegionTargetHttpProxyListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _zone: String, - _autoscaler: String, - _request_id: Option, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AutoscalerDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RegionTargetHttpProxyListCall<'a, C, A> {} -impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RegionTargetHttpProxyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpProxyList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -85251,16 +99737,24 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.autoscalers.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "compute.regionTargetHttpProxies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("autoscaler", self._autoscaler.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); } - for &field in ["alt", "project", "zone", "autoscaler", "requestId"].iter() { + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -85272,12 +99766,304 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/autoscalers/{autoscaler}"; + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpProxies"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{autoscaler}", "autoscaler")].iter() { + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpProxyListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpProxyListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionTargetHttpProxyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionTargetHttpProxyListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionTargetHttpProxyListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionTargetHttpProxyListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpProxyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpProxyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpProxyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. +/// +/// A builder for the *get* method supported by a *regionTargetHttpProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_target_http_proxies().get("project", "region", "targetHttpProxy") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpProxyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _target_http_proxy: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpProxyGetCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpProxyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpProxy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpProxies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetHttpProxy", self._target_http_proxy.to_string())); + for &field in ["alt", "project", "region", "targetHttpProxy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetHttpProxy}", "targetHttpProxy")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -85289,7 +100075,276 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, } { let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["autoscaler", "zone", "project"].iter() { + for param_name in ["targetHttpProxy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpProxyGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpProxyGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the TargetHttpProxy resource to return. + /// + /// Sets the *target http proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_http_proxy(mut self, new_value: &str) -> RegionTargetHttpProxyGetCall<'a, C, A> { + self._target_http_proxy = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpProxyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpProxyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpProxyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified TargetHttpProxy resource. +/// +/// A builder for the *delete* method supported by a *regionTargetHttpProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_target_http_proxies().delete("project", "region", "targetHttpProxy") +/// .request_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpProxyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _target_http_proxy: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpProxyDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpProxyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpProxies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetHttpProxy", self._target_http_proxy.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "targetHttpProxy", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetHttpProxy}", "targetHttpProxy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetHttpProxy", "region", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -85378,28 +100433,28 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> RegionTargetHttpProxyDeleteCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the zone for this request. + /// Name of the region scoping this request. /// - /// Sets the *zone* path property to the given value. + /// Sets the *region* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { - self._zone = new_value.to_string(); + pub fn region(mut self, new_value: &str) -> RegionTargetHttpProxyDeleteCall<'a, C, A> { + self._region = new_value.to_string(); self } - /// Name of the autoscaler to delete. + /// Name of the TargetHttpProxy resource to delete. /// - /// Sets the *autoscaler* path property to the given value. + /// Sets the *target http proxy* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn autoscaler(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { - self._autoscaler = new_value.to_string(); + pub fn target_http_proxy(mut self, new_value: &str) -> RegionTargetHttpProxyDeleteCall<'a, C, A> { + self._target_http_proxy = new_value.to_string(); self } /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. @@ -85409,7 +100464,7 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). /// /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + pub fn request_id(mut self, new_value: &str) -> RegionTargetHttpProxyDeleteCall<'a, C, A> { self._request_id = Some(new_value.to_string()); self } @@ -85419,7 +100474,7 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AutoscalerDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpProxyDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -85440,7 +100495,7 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AutoscalerDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpProxyDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -85460,7 +100515,306 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AutoscalerDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpProxyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. +/// +/// A builder for the *insert* method supported by a *regionTargetHttpProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::TargetHttpProxy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TargetHttpProxy::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.region_target_http_proxies().insert(req, "project", "region") +/// .request_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpProxyInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TargetHttpProxy, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpProxyInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpProxyInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpProxies.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpProxies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TargetHttpProxy) -> RegionTargetHttpProxyInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpProxyInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpProxyInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionTargetHttpProxyInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpProxyInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpProxyInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpProxyInsertCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -85500,10 +100854,11 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.autoscalers().aggregated_list("project") -/// .page_token("sea") -/// .order_by("labore") -/// .max_results(8) -/// .filter("amet.") +/// .page_token("invidunt") +/// .order_by("clita") +/// .max_results(80) +/// .include_all_scopes(true) +/// .filter("Lorem") /// .doit(); /// # } /// ``` @@ -85515,6 +100870,7 @@ pub struct AutoscalerAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -85537,7 +100893,7 @@ impl<'a, C, A> AutoscalerAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -85548,10 +100904,13 @@ impl<'a, C, A> AutoscalerAggregatedListCall<'a, C, A> where C: BorrowMut AutoscalerAggregatedListCall<'a, C, A> where C: BorrowMut AutoscalerAggregatedListCall<'a, C, A> { @@ -85682,29 +101041,36 @@ impl<'a, C, A> AutoscalerAggregatedListCall<'a, C, A> where C: BorrowMut AutoscalerAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> AutoscalerAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> AutoscalerAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> AutoscalerAggregatedListCall<'a, C, A> { @@ -85798,10 +101164,10 @@ impl<'a, C, A> AutoscalerAggregatedListCall<'a, C, A> where C: BorrowMut AutoscalerListCall<'a, C, A> where C: BorrowMut, A self._zone = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> AutoscalerListCall<'a, C, A> { @@ -85992,29 +101358,29 @@ impl<'a, C, A> AutoscalerListCall<'a, C, A> where C: BorrowMut, A } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> AutoscalerListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> AutoscalerListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> AutoscalerListCall<'a, C, A> { @@ -86114,8 +101480,8 @@ impl<'a, C, A> AutoscalerListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.autoscalers().patch(req, "project", "zone") -/// .request_id("At") -/// .autoscaler("diam") +/// .request_id("magna") +/// .autoscaler("Stet") /// .doit(); /// # } /// ``` @@ -86425,8 +101791,8 @@ impl<'a, C, A> AutoscalerPatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.autoscalers().update(req, "project", "zone") -/// .request_id("At") -/// .autoscaler("justo") +/// .request_id("ut") +/// .autoscaler("Stet") /// .doit(); /// # } /// ``` @@ -86702,6 +102068,286 @@ impl<'a, C, A> AutoscalerUpdateCall<'a, C, A> where C: BorrowMut, } +/// Deletes the specified autoscaler. +/// +/// A builder for the *delete* method supported by a *autoscaler* resource. +/// It is not used directly, but through a `AutoscalerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.autoscalers().delete("project", "zone", "autoscaler") +/// .request_id("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct AutoscalerDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _autoscaler: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AutoscalerDeleteCall<'a, C, A> {} + +impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.autoscalers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("autoscaler", self._autoscaler.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "autoscaler", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/autoscalers/{autoscaler}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{autoscaler}", "autoscaler")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["autoscaler", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the autoscaler to delete. + /// + /// Sets the *autoscaler* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn autoscaler(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + self._autoscaler = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> AutoscalerDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AutoscalerDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AutoscalerDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AutoscalerDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates an autoscaler in the specified project using the data included in the request. /// /// A builder for the *insert* method supported by a *autoscaler* resource. @@ -86736,7 +102382,7 @@ impl<'a, C, A> AutoscalerUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.autoscalers().insert(req, "project", "zone") -/// .request_id("dolores") +/// .request_id("sanctus") /// .doit(); /// # } /// ``` @@ -87299,7 +102945,7 @@ impl<'a, C, A> AutoscalerGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.subnetworks().insert(req, "project", "region") -/// .request_id("invidunt") +/// .request_id("labore") /// .doit(); /// # } /// ``` @@ -87859,7 +103505,7 @@ impl<'a, C, A> SubnetworkTestIamPermissionCall<'a, C, A> where C: BorrowMut SubnetworkTestIamPermissionCall<'a, C, A> where C: BorrowMut _region: String, _subnetwork: String, _request_id: Option, + _drain_timeout_seconds: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -87927,14 +103575,17 @@ impl<'a, C, A> SubnetworkPatchCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "compute.subnetworks.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("region", self._region.to_string())); params.push(("subnetwork", self._subnetwork.to_string())); if let Some(value) = self._request_id { params.push(("requestId", value.to_string())); } - for &field in ["alt", "project", "region", "subnetwork", "requestId"].iter() { + if let Some(value) = self._drain_timeout_seconds { + params.push(("drainTimeoutSeconds", value.to_string())); + } + for &field in ["alt", "project", "region", "subnetwork", "requestId", "drainTimeoutSeconds"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -88111,6 +103762,13 @@ impl<'a, C, A> SubnetworkPatchCall<'a, C, A> where C: BorrowMut, self._request_id = Some(new_value.to_string()); self } + /// The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + /// + /// Sets the *drain timeout seconds* query property to the given value. + pub fn drain_timeout_seconds(mut self, new_value: i32) -> SubnetworkPatchCall<'a, C, A> { + self._drain_timeout_seconds = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -88170,7 +103828,7 @@ impl<'a, C, A> SubnetworkPatchCall<'a, C, A> where C: BorrowMut, } -/// Retrieves an aggregated list of usable subnetworks. +/// Retrieves an aggregated list of all usable subnetworks in the project. The list contains all of the subnetworks in the project and the subnetworks that were shared by a Shared VPC host project. /// /// A builder for the *listUsable* method supported by a *subnetwork* resource. /// It is not used directly, but through a `SubnetworkMethods` instance. @@ -88198,10 +103856,10 @@ impl<'a, C, A> SubnetworkPatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.subnetworks().list_usable("project") -/// .page_token("Lorem") +/// .page_token("sadipscing") /// .order_by("erat") -/// .max_results(0) -/// .filter("Lorem") +/// .max_results(83) +/// .filter("invidunt") /// .doit(); /// # } /// ``` @@ -88371,7 +104029,7 @@ impl<'a, C, A> SubnetworkListUsableCall<'a, C, A> where C: BorrowMut SubnetworkListUsableCall<'a, C, A> { @@ -88380,29 +104038,29 @@ impl<'a, C, A> SubnetworkListUsableCall<'a, C, A> where C: BorrowMut SubnetworkListUsableCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SubnetworkListUsableCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SubnetworkListUsableCall<'a, C, A> { @@ -88782,7 +104440,7 @@ impl<'a, C, A> SubnetworkDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.subnetworks().set_private_ip_google_access(req, "project", "region", "subnetwork") -/// .request_id("vero") +/// .request_id("sit") /// .doit(); /// # } /// ``` @@ -89093,7 +104751,7 @@ impl<'a, C, A> SubnetworkSetPrivateIpGoogleAccesCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.subnetworks().expand_ip_cidr_range(req, "project", "region", "subnetwork") -/// .request_id("Stet") +/// .request_id("duo") /// .doit(); /// # } /// ``` @@ -89957,10 +105615,10 @@ impl<'a, C, A> SubnetworkSetIamPolicyCall<'a, C, A> where C: BorrowMut SubnetworkListCall<'a, C, A> where C: BorrowMut, A self._region = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> SubnetworkListCall<'a, C, A> { @@ -90151,29 +105809,29 @@ impl<'a, C, A> SubnetworkListCall<'a, C, A> where C: BorrowMut, A } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> SubnetworkListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SubnetworkListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SubnetworkListCall<'a, C, A> { @@ -90267,10 +105925,11 @@ impl<'a, C, A> SubnetworkListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.subnetworks().aggregated_list("project") -/// .page_token("duo") -/// .order_by("gubergren") -/// .max_results(69) -/// .filter("At") +/// .page_token("diam") +/// .order_by("eos") +/// .max_results(68) +/// .include_all_scopes(true) +/// .filter("Lorem") /// .doit(); /// # } /// ``` @@ -90282,6 +105941,7 @@ pub struct SubnetworkAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -90304,7 +105964,7 @@ impl<'a, C, A> SubnetworkAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -90315,10 +105975,13 @@ impl<'a, C, A> SubnetworkAggregatedListCall<'a, C, A> where C: BorrowMut SubnetworkAggregatedListCall<'a, C, A> where C: BorrowMut SubnetworkAggregatedListCall<'a, C, A> { @@ -90449,29 +106112,36 @@ impl<'a, C, A> SubnetworkAggregatedListCall<'a, C, A> where C: BorrowMut SubnetworkAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SubnetworkAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> SubnetworkAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SubnetworkAggregatedListCall<'a, C, A> { @@ -90835,7 +106505,7 @@ impl<'a, C, A> SubnetworkGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.url_maps().insert(req, "project") -/// .request_id("duo") +/// .request_id("kasd") /// .doit(); /// # } /// ``` @@ -91623,304 +107293,6 @@ impl<'a, C, A> UrlMapValidateCall<'a, C, A> where C: BorrowMut, A } -/// Retrieves the list of UrlMap resources available to the specified project. -/// -/// A builder for the *list* method supported by a *urlMap* resource. -/// It is not used directly, but through a `UrlMapMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.url_maps().list("project") -/// .page_token("nonumy") -/// .order_by("sanctus") -/// .max_results(32) -/// .filter("diam") -/// .doit(); -/// # } -/// ``` -pub struct UrlMapListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UrlMapListCall<'a, C, A> {} - -impl<'a, C, A> UrlMapListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, UrlMapList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.urlMaps.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/urlMaps"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> UrlMapListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UrlMapListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UrlMapListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UrlMapListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. /// /// A builder for the *invalidateCache* method supported by a *urlMap* resource. @@ -92220,9 +107592,9 @@ impl<'a, C, A> UrlMapInvalidateCacheCall<'a, C, A> where C: BorrowMut UrlMapInvalidateCacheCall<'a, C, A> where C: BorrowMut +pub struct UrlMapAggregatedListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _url_map: String, - _request_id: Option, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UrlMapDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for UrlMapAggregatedListCall<'a, C, A> {} -impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UrlMapAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, UrlMapsAggregatedList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -92278,15 +107657,26 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.urlMaps.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "compute.urlMaps.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("urlMap", self._url_map.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); } - for &field in ["alt", "project", "urlMap", "requestId"].iter() { + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -92298,12 +107688,12 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/urlMaps/{urlMap}"; + let mut url = self.hub._base_url.clone() + "{project}/aggregated/urlMaps"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project"), ("{urlMap}", "urlMap")].iter() { + for &(find_this, param_name) in [("{project}", "project")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -92314,8 +107704,8 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["urlMap", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -92345,7 +107735,7 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -92398,35 +107788,59 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// Project ID for this request. + /// Name of the project scoping this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> UrlMapDeleteCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> UrlMapAggregatedListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the UrlMap resource to delete. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// - /// Sets the *url map* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn url_map(mut self, new_value: &str) -> UrlMapDeleteCall<'a, C, A> { - self._url_map = new_value.to_string(); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> UrlMapAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); self } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> UrlMapDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> UrlMapAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> UrlMapAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> UrlMapAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> UrlMapAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -92435,7 +107849,7 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UrlMapDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UrlMapAggregatedListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -92456,7 +107870,7 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UrlMapDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UrlMapAggregatedListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -92465,7 +107879,7 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -92476,306 +107890,7 @@ impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UrlMapDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. -/// -/// A builder for the *patch* method supported by a *urlMap* resource. -/// It is not used directly, but through a `UrlMapMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::UrlMap; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UrlMap::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.url_maps().patch(req, "project", "urlMap") -/// .request_id("sit") -/// .doit(); -/// # } -/// ``` -pub struct UrlMapPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: UrlMap, - _project: String, - _url_map: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UrlMapPatchCall<'a, C, A> {} - -impl<'a, C, A> UrlMapPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.urlMaps.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("urlMap", self._url_map.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "urlMap", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/urlMaps/{urlMap}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{urlMap}", "urlMap")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["urlMap", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: UrlMap) -> UrlMapPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> UrlMapPatchCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the UrlMap resource to patch. - /// - /// Sets the *url map* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn url_map(mut self, new_value: &str) -> UrlMapPatchCall<'a, C, A> { - self._url_map = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> UrlMapPatchCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UrlMapPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UrlMapPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UrlMapPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UrlMapAggregatedListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -92821,7 +107936,7 @@ impl<'a, C, A> UrlMapPatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.url_maps().update(req, "project", "urlMap") -/// .request_id("sit") +/// .request_id("rebum.") /// .doit(); /// # } /// ``` @@ -93086,6 +108201,871 @@ impl<'a, C, A> UrlMapUpdateCall<'a, C, A> where C: BorrowMut, A: } +/// Deletes the specified UrlMap resource. +/// +/// A builder for the *delete* method supported by a *urlMap* resource. +/// It is not used directly, but through a `UrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.url_maps().delete("project", "urlMap") +/// .request_id("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct UrlMapDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _url_map: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UrlMapDeleteCall<'a, C, A> {} + +impl<'a, C, A> UrlMapDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.urlMaps.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("urlMap", self._url_map.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "urlMap", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/urlMaps/{urlMap}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{urlMap}", "urlMap")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["urlMap", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> UrlMapDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the UrlMap resource to delete. + /// + /// Sets the *url map* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn url_map(mut self, new_value: &str) -> UrlMapDeleteCall<'a, C, A> { + self._url_map = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> UrlMapDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UrlMapDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UrlMapDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UrlMapDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of UrlMap resources available to the specified project. +/// +/// A builder for the *list* method supported by a *urlMap* resource. +/// It is not used directly, but through a `UrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.url_maps().list("project") +/// .page_token("voluptua.") +/// .order_by("justo") +/// .max_results(28) +/// .filter("At") +/// .doit(); +/// # } +/// ``` +pub struct UrlMapListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UrlMapListCall<'a, C, A> {} + +impl<'a, C, A> UrlMapListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UrlMapList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.urlMaps.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/urlMaps"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> UrlMapListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> UrlMapListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UrlMapListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UrlMapListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UrlMapListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *urlMap* resource. +/// It is not used directly, but through a `UrlMapMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::UrlMap; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UrlMap::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.url_maps().patch(req, "project", "urlMap") +/// .request_id("dolore") +/// .doit(); +/// # } +/// ``` +pub struct UrlMapPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: UrlMap, + _project: String, + _url_map: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UrlMapPatchCall<'a, C, A> {} + +impl<'a, C, A> UrlMapPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.urlMaps.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("urlMap", self._url_map.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "urlMap", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/urlMaps/{urlMap}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{urlMap}", "urlMap")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["urlMap", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UrlMap) -> UrlMapPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> UrlMapPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the UrlMap resource to patch. + /// + /// Sets the *url map* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn url_map(mut self, new_value: &str) -> UrlMapPatchCall<'a, C, A> { + self._url_map = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> UrlMapPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> UrlMapPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UrlMapPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UrlMapPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves a list of regional disk types available to the specified project. /// /// A builder for the *list* method supported by a *regionDiskType* resource. @@ -93114,10 +109094,10 @@ impl<'a, C, A> UrlMapUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.region_disk_types().list("project", "region") -/// .page_token("magna") -/// .order_by("eirmod") -/// .max_results(63) -/// .filter("sea") +/// .page_token("justo") +/// .order_by("ipsum") +/// .max_results(70) +/// .filter("est") /// .doit(); /// # } /// ``` @@ -93299,7 +109279,7 @@ impl<'a, C, A> RegionDiskTypeListCall<'a, C, A> where C: BorrowMut RegionDiskTypeListCall<'a, C, A> { @@ -93308,29 +109288,29 @@ impl<'a, C, A> RegionDiskTypeListCall<'a, C, A> where C: BorrowMut RegionDiskTypeListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RegionDiskTypeListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RegionDiskTypeListCall<'a, C, A> { @@ -93660,10 +109640,10 @@ impl<'a, C, A> RegionDiskTypeGetCall<'a, C, A> where C: BorrowMut } -/// Retrieves a list of Operation resources contained within the specified project. +/// Retrieves a list of PacketMirroring resources available to the specified project and region. /// -/// A builder for the *list* method supported by a *globalOperation* resource. -/// It is not used directly, but through a `GlobalOperationMethods` instance. +/// A builder for the *list* method supported by a *packetMirroring* resource. +/// It is not used directly, but through a `PacketMirroringMethods` instance. /// /// # Example /// @@ -93687,19 +109667,20 @@ impl<'a, C, A> RegionDiskTypeGetCall<'a, C, A> where C: BorrowMut /// // 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.global_operations().list("project") -/// .page_token("sed") -/// .order_by("et") -/// .max_results(20) -/// .filter("consetetur") +/// let result = hub.packet_mirrorings().list("project", "region") +/// .page_token("eos") +/// .order_by("Lorem") +/// .max_results(89) +/// .filter("At") /// .doit(); /// # } /// ``` -pub struct GlobalOperationListCall<'a, C, A> +pub struct PacketMirroringListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, + _region: String, _page_token: Option, _order_by: Option, _max_results: Option, @@ -93709,13 +109690,13 @@ pub struct GlobalOperationListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GlobalOperationListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for PacketMirroringListCall<'a, C, A> {} -impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> PacketMirroringListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OperationList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, PacketMirroringList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -93723,10 +109704,11 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.globalOperations.list", + dlg.begin(MethodInfo { id: "compute.packetMirrorings.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -93739,7 +109721,7 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut GlobalOperationListCall<'a, C, A> where C: BorrowMut = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PacketMirroringListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> PacketMirroringListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> PacketMirroringListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> PacketMirroringListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> PacketMirroringListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> PacketMirroringListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PacketMirroringListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PacketMirroringListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PacketMirroringListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a PacketMirroring resource in the specified project and region using the data included in the request. +/// +/// A builder for the *insert* method supported by a *packetMirroring* resource. +/// It is not used directly, but through a `PacketMirroringMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::PacketMirroring; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = PacketMirroring::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.packet_mirrorings().insert(req, "project", "region") +/// .request_id("rebum.") +/// .doit(); +/// # } +/// ``` +pub struct PacketMirroringInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: PacketMirroring, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PacketMirroringInsertCall<'a, C, A> {} + +impl<'a, C, A> PacketMirroringInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.packetMirrorings.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/packetMirrorings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: PacketMirroring) -> PacketMirroringInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PacketMirroringInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> PacketMirroringInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> PacketMirroringInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PacketMirroringInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PacketMirroringInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PacketMirroringInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of packetMirrorings. +/// +/// A builder for the *aggregatedList* method supported by a *packetMirroring* resource. +/// It is not used directly, but through a `PacketMirroringMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.packet_mirrorings().aggregated_list("project") +/// .page_token("dolore") +/// .order_by("est") +/// .max_results(13) +/// .include_all_scopes(true) +/// .filter("rebum.") +/// .doit(); +/// # } +/// ``` +pub struct PacketMirroringAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PacketMirroringAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> PacketMirroringAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, PacketMirroringAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.packetMirrorings.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/packetMirrorings"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -93857,45 +110451,52 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut GlobalOperationListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> PacketMirroringAggregatedListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> PacketMirroringAggregatedListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { + pub fn order_by(mut self, new_value: &str) -> PacketMirroringAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> GlobalOperationListCall<'a, C, A> { + pub fn max_results(mut self, new_value: u32) -> PacketMirroringAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> PacketMirroringAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> GlobalOperationListCall<'a, C, A> { + pub fn filter(mut self, new_value: &str) -> PacketMirroringAggregatedListCall<'a, C, A> { self._filter = Some(new_value.to_string()); self } @@ -93905,7 +110506,7 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut GlobalOperationListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PacketMirroringAggregatedListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -93926,7 +110527,7 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> GlobalOperationListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> PacketMirroringAggregatedListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -93946,7 +110547,7 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> GlobalOperationListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> PacketMirroringAggregatedListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -93958,10 +110559,616 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = PacketMirroring::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.packet_mirrorings().patch(req, "project", "region", "packetMirroring") +/// .request_id("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct PacketMirroringPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: PacketMirroring, + _project: String, + _region: String, + _packet_mirroring: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PacketMirroringPatchCall<'a, C, A> {} + +impl<'a, C, A> PacketMirroringPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.packetMirrorings.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("packetMirroring", self._packet_mirroring.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "packetMirroring", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/packetMirrorings/{packetMirroring}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{packetMirroring}", "packetMirroring")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["packetMirroring", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: PacketMirroring) -> PacketMirroringPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PacketMirroringPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> PacketMirroringPatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the PacketMirroring resource to patch. + /// + /// Sets the *packet mirroring* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn packet_mirroring(mut self, new_value: &str) -> PacketMirroringPatchCall<'a, C, A> { + self._packet_mirroring = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> PacketMirroringPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PacketMirroringPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PacketMirroringPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PacketMirroringPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// +/// A builder for the *testIamPermissions* method supported by a *packetMirroring* resource. +/// It is not used directly, but through a `PacketMirroringMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::TestPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestPermissionsRequest::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.packet_mirrorings().test_iam_permissions(req, "project", "region", "resource") +/// .doit(); +/// # } +/// ``` +pub struct PacketMirroringTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TestPermissionsRequest, + _project: String, + _region: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PacketMirroringTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> PacketMirroringTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestPermissionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.packetMirrorings.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "region", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resource", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestPermissionsRequest) -> PacketMirroringTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PacketMirroringTestIamPermissionCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> PacketMirroringTestIamPermissionCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> PacketMirroringTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PacketMirroringTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PacketMirroringTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PacketMirroringTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified PacketMirroring resource. +/// +/// A builder for the *get* method supported by a *packetMirroring* resource. +/// It is not used directly, but through a `PacketMirroringMethods` instance. /// /// # Example /// @@ -93985,28 +111192,29 @@ impl<'a, C, A> GlobalOperationListCall<'a, C, A> where C: BorrowMut +pub struct PacketMirroringGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _operation: String, + _region: String, + _packet_mirroring: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for GlobalOperationDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for PacketMirroringGetCall<'a, C, A> {} -impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> PacketMirroringGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, PacketMirroring)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -94014,12 +111222,13 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.globalOperations.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "compute.packetMirrorings.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("operation", self._operation.to_string())); - for &field in ["project", "operation"].iter() { + params.push(("region", self._region.to_string())); + params.push(("packetMirroring", self._packet_mirroring.to_string())); + for &field in ["alt", "project", "region", "packetMirroring"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -94029,13 +111238,14 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -94046,8 +111256,277 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["operation", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["packetMirroring", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PacketMirroringGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> PacketMirroringGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the PacketMirroring resource to return. + /// + /// Sets the *packet mirroring* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn packet_mirroring(mut self, new_value: &str) -> PacketMirroringGetCall<'a, C, A> { + self._packet_mirroring = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PacketMirroringGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PacketMirroringGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PacketMirroringGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified PacketMirroring resource. +/// +/// A builder for the *delete* method supported by a *packetMirroring* resource. +/// It is not used directly, but through a `PacketMirroringMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.packet_mirrorings().delete("project", "region", "packetMirroring") +/// .request_id("ea") +/// .doit(); +/// # } +/// ``` +pub struct PacketMirroringDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _packet_mirroring: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PacketMirroringDeleteCall<'a, C, A> {} + +impl<'a, C, A> PacketMirroringDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.packetMirrorings.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("packetMirroring", self._packet_mirroring.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "packetMirroring", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/packetMirrorings/{packetMirroring}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{packetMirroring}", "packetMirroring")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["packetMirroring", "region", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -94110,7 +111589,17 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut Err(Error::BadRequest(serr)) } } - let result_value = res; + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; dlg.finished(true); return Ok(result_value) @@ -94126,18 +111615,39 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut GlobalOperationDeleteCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> PacketMirroringDeleteCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Name of the Operations resource to delete. + /// Name of the region for this request. /// - /// Sets the *operation* path property to the given value. + /// Sets the *region* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn operation(mut self, new_value: &str) -> GlobalOperationDeleteCall<'a, C, A> { - self._operation = new_value.to_string(); + pub fn region(mut self, new_value: &str) -> PacketMirroringDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the PacketMirroring resource to delete. + /// + /// Sets the *packet mirroring* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn packet_mirroring(mut self, new_value: &str) -> PacketMirroringDeleteCall<'a, C, A> { + self._packet_mirroring = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> PacketMirroringDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -94146,7 +111656,7 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut GlobalOperationDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PacketMirroringDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -94167,7 +111677,7 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> GlobalOperationDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> PacketMirroringDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -94187,557 +111697,7 @@ impl<'a, C, A> GlobalOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> GlobalOperationDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves an aggregated list of all operations. -/// -/// A builder for the *aggregatedList* method supported by a *globalOperation* resource. -/// It is not used directly, but through a `GlobalOperationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.global_operations().aggregated_list("project") -/// .page_token("nonumy") -/// .order_by("sanctus") -/// .max_results(5) -/// .filter("sit") -/// .doit(); -/// # } -/// ``` -pub struct GlobalOperationAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for GlobalOperationAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> GlobalOperationAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OperationAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.globalOperations.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/operations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> GlobalOperationAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> GlobalOperationAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalOperationAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GlobalOperationAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GlobalOperationAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the specified Operations resource. Gets a list of operations by making a list() request. -/// -/// A builder for the *get* method supported by a *globalOperation* resource. -/// It is not used directly, but through a `GlobalOperationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.global_operations().get("project", "operation") -/// .doit(); -/// # } -/// ``` -pub struct GlobalOperationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _operation: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for GlobalOperationGetCall<'a, C, A> {} - -impl<'a, C, A> GlobalOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.globalOperations.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("operation", self._operation.to_string())); - for &field in ["alt", "project", "operation"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{operation}", "operation")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["operation", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> GlobalOperationGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the Operations resource to return. - /// - /// Sets the *operation* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn operation(mut self, new_value: &str) -> GlobalOperationGetCall<'a, C, A> { - self._operation = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalOperationGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> GlobalOperationGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> GlobalOperationGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> PacketMirroringDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -95029,10 +111989,10 @@ impl<'a, C, A> SslPolicyGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.ssl_policies().list("project") -/// .page_token("sed") -/// .order_by("kasd") -/// .max_results(22) -/// .filter("takimata") +/// .page_token("et") +/// .order_by("justo") +/// .max_results(8) +/// .filter("Lorem") /// .doit(); /// # } /// ``` @@ -95202,7 +112162,7 @@ impl<'a, C, A> SslPolicyListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> SslPolicyListCall<'a, C, A> { @@ -95211,29 +112171,29 @@ impl<'a, C, A> SslPolicyListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> SslPolicyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SslPolicyListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SslPolicyListCall<'a, C, A> { @@ -95333,7 +112293,7 @@ impl<'a, C, A> SslPolicyListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.ssl_policies().insert(req, "project") -/// .request_id("vero") +/// .request_id("dolores") /// .doit(); /// # } /// ``` @@ -95614,10 +112574,10 @@ impl<'a, C, A> SslPolicyInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.ssl_policies().list_available_features("project") -/// .page_token("duo") -/// .order_by("ipsum") -/// .max_results(17) -/// .filter("clita") +/// .page_token("elitr") +/// .order_by("vero") +/// .max_results(32) +/// .filter("consetetur") /// .doit(); /// # } /// ``` @@ -95787,7 +112747,7 @@ impl<'a, C, A> SslPolicyListAvailableFeatureCall<'a, C, A> where C: BorrowMut SslPolicyListAvailableFeatureCall<'a, C, A> { @@ -95796,29 +112756,29 @@ impl<'a, C, A> SslPolicyListAvailableFeatureCall<'a, C, A> where C: BorrowMut SslPolicyListAvailableFeatureCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SslPolicyListAvailableFeatureCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SslPolicyListAvailableFeatureCall<'a, C, A> { @@ -95918,7 +112878,7 @@ impl<'a, C, A> SslPolicyListAvailableFeatureCall<'a, C, A> where C: BorrowMut SslPolicyPatchCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.ssl_policies().delete("project", "sslPolicy") -/// .request_id("amet") +/// .request_id("dolore") /// .doit(); /// # } /// ``` @@ -96731,10 +113691,10 @@ impl<'a, C, A> RegionGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.regions().list("project") -/// .page_token("invidunt") -/// .order_by("clita") -/// .max_results(80) -/// .filter("sadipscing") +/// .page_token("et") +/// .order_by("Lorem") +/// .max_results(99) +/// .filter("amet") /// .doit(); /// # } /// ``` @@ -96904,7 +113864,7 @@ impl<'a, C, A> RegionListCall<'a, C, A> where C: BorrowMut, A: oa self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> RegionListCall<'a, C, A> { @@ -96913,29 +113873,29 @@ impl<'a, C, A> RegionListCall<'a, C, A> where C: BorrowMut, A: oa } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> RegionListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RegionListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RegionListCall<'a, C, A> { @@ -97001,1193 +113961,6 @@ impl<'a, C, A> RegionListCall<'a, C, A> where C: BorrowMut, A: oa } -/// Creates a ForwardingRule resource in the specified project and region using the data included in the request. -/// -/// A builder for the *insert* method supported by a *forwardingRule* resource. -/// It is not used directly, but through a `ForwardingRuleMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::ForwardingRule; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ForwardingRule::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.forwarding_rules().insert(req, "project", "region") -/// .request_id("diam") -/// .doit(); -/// # } -/// ``` -pub struct ForwardingRuleInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: ForwardingRule, - _project: String, - _region: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ForwardingRuleInsertCall<'a, C, A> {} - -impl<'a, C, A> ForwardingRuleInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.forwardingRules.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/forwardingRules"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ForwardingRule) -> ForwardingRuleInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ForwardingRuleInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ForwardingRuleInsertCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ForwardingRuleInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ForwardingRuleInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ForwardingRuleInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves an aggregated list of forwarding rules. -/// -/// A builder for the *aggregatedList* method supported by a *forwardingRule* resource. -/// It is not used directly, but through a `ForwardingRuleMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.forwarding_rules().aggregated_list("project") -/// .page_token("vero") -/// .order_by("sanctus") -/// .max_results(74) -/// .filter("rebum.") -/// .doit(); -/// # } -/// ``` -pub struct ForwardingRuleAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ForwardingRuleAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> ForwardingRuleAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.forwardingRules.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/forwardingRules"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ForwardingRuleAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ForwardingRuleAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified ForwardingRule resource. -/// -/// A builder for the *delete* method supported by a *forwardingRule* resource. -/// It is not used directly, but through a `ForwardingRuleMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.forwarding_rules().delete("project", "region", "forwardingRule") -/// .request_id("dolore") -/// .doit(); -/// # } -/// ``` -pub struct ForwardingRuleDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _forwarding_rule: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ForwardingRuleDeleteCall<'a, C, A> {} - -impl<'a, C, A> ForwardingRuleDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.forwardingRules.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("forwardingRule", self._forwarding_rule.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "forwardingRule", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/forwardingRules/{forwardingRule}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{forwardingRule}", "forwardingRule")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["forwardingRule", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the ForwardingRule resource to delete. - /// - /// Sets the *forwarding rule* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn forwarding_rule(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { - self._forwarding_rule = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ForwardingRuleDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ForwardingRuleDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves a list of ForwardingRule resources available to the specified project and region. -/// -/// A builder for the *list* method supported by a *forwardingRule* resource. -/// It is not used directly, but through a `ForwardingRuleMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.forwarding_rules().list("project", "region") -/// .page_token("Stet") -/// .order_by("et") -/// .max_results(21) -/// .filter("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct ForwardingRuleListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ForwardingRuleListCall<'a, C, A> {} - -impl<'a, C, A> ForwardingRuleListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.forwardingRules.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/forwardingRules"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ForwardingRuleListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ForwardingRuleListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ForwardingRuleListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns the specified ForwardingRule resource. /// /// A builder for the *get* method supported by a *forwardingRule* resource. @@ -98452,6 +114225,1205 @@ impl<'a, C, A> ForwardingRuleGetCall<'a, C, A> where C: BorrowMut } +/// Creates a ForwardingRule resource in the specified project and region using the data included in the request. +/// +/// A builder for the *insert* method supported by a *forwardingRule* resource. +/// It is not used directly, but through a `ForwardingRuleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ForwardingRule; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ForwardingRule::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.forwarding_rules().insert(req, "project", "region") +/// .request_id("ea") +/// .doit(); +/// # } +/// ``` +pub struct ForwardingRuleInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ForwardingRule, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ForwardingRuleInsertCall<'a, C, A> {} + +impl<'a, C, A> ForwardingRuleInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.forwardingRules.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/forwardingRules"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ForwardingRule) -> ForwardingRuleInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ForwardingRuleInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ForwardingRuleInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ForwardingRuleInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ForwardingRuleInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ForwardingRuleInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified ForwardingRule resource. +/// +/// A builder for the *delete* method supported by a *forwardingRule* resource. +/// It is not used directly, but through a `ForwardingRuleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.forwarding_rules().delete("project", "region", "forwardingRule") +/// .request_id("ut") +/// .doit(); +/// # } +/// ``` +pub struct ForwardingRuleDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _forwarding_rule: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ForwardingRuleDeleteCall<'a, C, A> {} + +impl<'a, C, A> ForwardingRuleDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.forwardingRules.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("forwardingRule", self._forwarding_rule.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "forwardingRule", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/forwardingRules/{forwardingRule}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{forwardingRule}", "forwardingRule")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["forwardingRule", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the ForwardingRule resource to delete. + /// + /// Sets the *forwarding rule* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn forwarding_rule(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { + self._forwarding_rule = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ForwardingRuleDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ForwardingRuleDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ForwardingRuleDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of forwarding rules. +/// +/// A builder for the *aggregatedList* method supported by a *forwardingRule* resource. +/// It is not used directly, but through a `ForwardingRuleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.forwarding_rules().aggregated_list("project") +/// .page_token("nonumy") +/// .order_by("At") +/// .max_results(10) +/// .include_all_scopes(true) +/// .filter("sit") +/// .doit(); +/// # } +/// ``` +pub struct ForwardingRuleAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ForwardingRuleAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> ForwardingRuleAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.forwardingRules.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/forwardingRules"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ForwardingRuleAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ForwardingRuleAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of ForwardingRule resources available to the specified project and region. +/// +/// A builder for the *list* method supported by a *forwardingRule* resource. +/// It is not used directly, but through a `ForwardingRuleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.forwarding_rules().list("project", "region") +/// .page_token("At") +/// .order_by("takimata") +/// .max_results(84) +/// .filter("sed") +/// .doit(); +/// # } +/// ``` +pub struct ForwardingRuleListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ForwardingRuleListCall<'a, C, A> {} + +impl<'a, C, A> ForwardingRuleListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingRuleList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.forwardingRules.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/forwardingRules"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ForwardingRuleListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ForwardingRuleListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRuleListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ForwardingRuleListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ForwardingRuleListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Changes target URL for forwarding rule. The new target should be of the same type as the old target. /// /// A builder for the *setTarget* method supported by a *forwardingRule* resource. @@ -98486,7 +115458,7 @@ impl<'a, C, A> ForwardingRuleGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.forwarding_rules().set_target(req, "project", "region", "forwardingRule") -/// .request_id("ipsum") +/// .request_id("takimata") /// .doit(); /// # } /// ``` @@ -98763,6 +115735,2092 @@ impl<'a, C, A> ForwardingRuleSetTargetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ForwardingRule::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.forwarding_rules().patch(req, "project", "region", "forwardingRule") +/// .request_id("magna") +/// .doit(); +/// # } +/// ``` +pub struct ForwardingRulePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ForwardingRule, + _project: String, + _region: String, + _forwarding_rule: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ForwardingRulePatchCall<'a, C, A> {} + +impl<'a, C, A> ForwardingRulePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.forwardingRules.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("forwardingRule", self._forwarding_rule.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "forwardingRule", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/forwardingRules/{forwardingRule}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{forwardingRule}", "forwardingRule")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["forwardingRule", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ForwardingRule) -> ForwardingRulePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ForwardingRulePatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ForwardingRulePatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the ForwardingRule resource to patch. + /// + /// Sets the *forwarding rule* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn forwarding_rule(mut self, new_value: &str) -> ForwardingRulePatchCall<'a, C, A> { + self._forwarding_rule = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ForwardingRulePatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ForwardingRulePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ForwardingRulePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ForwardingRulePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified TargetHttpsProxy resource. +/// +/// A builder for the *delete* method supported by a *regionTargetHttpsProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpsProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_target_https_proxies().delete("project", "region", "targetHttpsProxy") +/// .request_id("kasd") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpsProxyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _target_https_proxy: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpsProxyDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpsProxyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpsProxies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetHttpsProxy", self._target_https_proxy.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "targetHttpsProxy", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetHttpsProxy}", "targetHttpsProxy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetHttpsProxy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the TargetHttpsProxy resource to delete. + /// + /// Sets the *target https proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_https_proxy(mut self, new_value: &str) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> { + self._target_https_proxy = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpsProxyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Changes the URL map for TargetHttpsProxy. +/// +/// A builder for the *setUrlMap* method supported by a *regionTargetHttpsProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpsProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::UrlMapReference; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UrlMapReference::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.region_target_https_proxies().set_url_map(req, "project", "region", "targetHttpsProxy") +/// .request_id("sea") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpsProxySetUrlMapCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: UrlMapReference, + _project: String, + _region: String, + _target_https_proxy: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpsProxySetUrlMapCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpsProxies.setUrlMap", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetHttpsProxy", self._target_https_proxy.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "targetHttpsProxy", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetHttpsProxy}", "targetHttpsProxy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetHttpsProxy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UrlMapReference) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the TargetHttpsProxy to set a URL map for. + /// + /// Sets the *target https proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_https_proxy(mut self, new_value: &str) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> { + self._target_https_proxy = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpsProxySetUrlMapCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. +/// +/// A builder for the *insert* method supported by a *regionTargetHttpsProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpsProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::TargetHttpsProxy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TargetHttpsProxy::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.region_target_https_proxies().insert(req, "project", "region") +/// .request_id("dolor") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpsProxyInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TargetHttpsProxy, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpsProxyInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpsProxyInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpsProxies.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpsProxies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TargetHttpsProxy) -> RegionTargetHttpsProxyInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpsProxyInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpsProxyInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionTargetHttpsProxyInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpsProxyInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpsProxyInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpsProxyInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. +/// +/// A builder for the *list* method supported by a *regionTargetHttpsProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpsProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_target_https_proxies().list("project", "region") +/// .page_token("diam") +/// .order_by("voluptua.") +/// .max_results(88) +/// .filter("At") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpsProxyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpsProxyListCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpsProxyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpsProxyList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpsProxies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpsProxies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpsProxyListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpsProxyListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionTargetHttpsProxyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionTargetHttpsProxyListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionTargetHttpsProxyListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionTargetHttpsProxyListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpsProxyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpsProxyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpsProxyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Replaces SslCertificates for TargetHttpsProxy. +/// +/// A builder for the *setSslCertificates* method supported by a *regionTargetHttpsProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpsProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionTargetHttpsProxiesSetSslCertificatesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionTargetHttpsProxiesSetSslCertificatesRequest::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.region_target_https_proxies().set_ssl_certificates(req, "project", "region", "targetHttpsProxy") +/// .request_id("et") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionTargetHttpsProxiesSetSslCertificatesRequest, + _project: String, + _region: String, + _target_https_proxy: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpsProxies.setSslCertificates", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetHttpsProxy", self._target_https_proxy.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "targetHttpsProxy", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetHttpsProxy}", "targetHttpsProxy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetHttpsProxy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionTargetHttpsProxiesSetSslCertificatesRequest) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + /// + /// Sets the *target https proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_https_proxy(mut self, new_value: &str) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> { + self._target_https_proxy = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpsProxySetSslCertificateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. +/// +/// A builder for the *get* method supported by a *regionTargetHttpsProxy* resource. +/// It is not used directly, but through a `RegionTargetHttpsProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_target_https_proxies().get("project", "region", "targetHttpsProxy") +/// .doit(); +/// # } +/// ``` +pub struct RegionTargetHttpsProxyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _target_https_proxy: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionTargetHttpsProxyGetCall<'a, C, A> {} + +impl<'a, C, A> RegionTargetHttpsProxyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpsProxy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionTargetHttpsProxies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetHttpsProxy", self._target_https_proxy.to_string())); + for &field in ["alt", "project", "region", "targetHttpsProxy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetHttpsProxy}", "targetHttpsProxy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetHttpsProxy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionTargetHttpsProxyGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionTargetHttpsProxyGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the TargetHttpsProxy resource to return. + /// + /// Sets the *target https proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_https_proxy(mut self, new_value: &str) -> RegionTargetHttpsProxyGetCall<'a, C, A> { + self._target_https_proxy = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionTargetHttpsProxyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionTargetHttpsProxyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionTargetHttpsProxyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Removes health check URL from a target pool. /// /// A builder for the *removeHealthCheck* method supported by a *targetPool* resource. @@ -98797,7 +117855,7 @@ impl<'a, C, A> ForwardingRuleSetTargetCall<'a, C, A> where C: BorrowMut TargetPoolRemoveHealthCheckCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -99139,7 +118199,7 @@ impl<'a, C, A> TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -99150,10 +118210,13 @@ impl<'a, C, A> TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut TargetPoolAggregatedListCall<'a, C, A> { @@ -99284,29 +118347,36 @@ impl<'a, C, A> TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut TargetPoolAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetPoolAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> TargetPoolAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetPoolAggregatedListCall<'a, C, A> { @@ -99406,8 +118476,8 @@ impl<'a, C, A> TargetPoolAggregatedListCall<'a, C, A> where C: BorrowMut TargetPoolSetBackupCall<'a, C, A> where C: BorrowMut TargetPoolAddInstanceCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.target_pools().list("project", "region") -/// .page_token("takimata") -/// .order_by("et") -/// .max_results(44) -/// .filter("sit") -/// .doit(); -/// # } -/// ``` -pub struct TargetPoolListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetPoolListCall<'a, C, A> {} - -impl<'a, C, A> TargetPoolListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TargetPoolList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetPools.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetPools"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> TargetPoolListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetPoolListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetPoolListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetPoolListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Adds health check URLs to a target pool. /// /// A builder for the *addHealthCheck* method supported by a *targetPool* resource. @@ -100350,7 +119110,7 @@ impl<'a, C, A> TargetPoolListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_pools().add_health_check(req, "project", "region", "targetPool") -/// .request_id("duo") +/// .request_id("erat") /// .doit(); /// # } /// ``` @@ -100661,7 +119421,7 @@ impl<'a, C, A> TargetPoolAddHealthCheckCall<'a, C, A> where C: BorrowMut TargetPoolGetHealthCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.target_pools().list("project", "region") +/// .page_token("magna") +/// .order_by("et") +/// .max_results(9) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct TargetPoolListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetPoolListCall<'a, C, A> {} + +impl<'a, C, A> TargetPoolListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetPoolList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetPools.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetPools"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TargetPoolListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> TargetPoolListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetPoolListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetPoolListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetPoolListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns the specified target pool. Gets a list of available target pools by making a list() request. /// /// A builder for the *get* method supported by a *targetPool* resource. @@ -101519,7 +120589,7 @@ impl<'a, C, A> TargetPoolGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_pools().remove_instance(req, "project", "region", "targetPool") -/// .request_id("eos") +/// .request_id("rebum.") /// .doit(); /// # } /// ``` @@ -101824,7 +120894,7 @@ impl<'a, C, A> TargetPoolRemoveInstanceCall<'a, C, A> where C: BorrowMut TargetPoolDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_instances().insert(req, "project", "zone") -/// .request_id("tempor") +/// .request_id("eos") /// .doit(); /// # } /// ``` @@ -102403,10 +121473,11 @@ impl<'a, C, A> TargetInstanceInsertCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -102440,7 +121512,7 @@ impl<'a, C, A> TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -102451,10 +121523,13 @@ impl<'a, C, A> TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut TargetInstanceAggregatedListCall<'a, C, A> { @@ -102585,29 +121660,36 @@ impl<'a, C, A> TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut TargetInstanceAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetInstanceAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> TargetInstanceAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetInstanceAggregatedListCall<'a, C, A> { @@ -102701,7 +121783,7 @@ impl<'a, C, A> TargetInstanceAggregatedListCall<'a, C, A> where C: BorrowMut TargetInstanceGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.target_instances().list("project", "zone") -/// .page_token("erat") -/// .order_by("eos") -/// .max_results(31) -/// .filter("justo") +/// .page_token("diam") +/// .order_by("sanctus") +/// .max_results(23) +/// .filter("ut") /// .doit(); /// # } /// ``` @@ -103430,7 +122512,7 @@ impl<'a, C, A> TargetInstanceListCall<'a, C, A> where C: BorrowMut TargetInstanceListCall<'a, C, A> { @@ -103439,29 +122521,29 @@ impl<'a, C, A> TargetInstanceListCall<'a, C, A> where C: BorrowMut TargetInstanceListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetInstanceListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetInstanceListCall<'a, C, A> { @@ -103555,7 +122637,7 @@ impl<'a, C, A> TargetInstanceListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ForwardingRule::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.global_forwarding_rules().patch(req, "project", "forwardingRule") +/// .request_id("tempor") +/// .doit(); +/// # } +/// ``` +pub struct GlobalForwardingRulePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ForwardingRule, + _project: String, + _forwarding_rule: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalForwardingRulePatchCall<'a, C, A> {} + +impl<'a, C, A> GlobalForwardingRulePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalForwardingRules.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("forwardingRule", self._forwarding_rule.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "forwardingRule", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/forwardingRules/{forwardingRule}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{forwardingRule}", "forwardingRule")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["forwardingRule", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ForwardingRule) -> GlobalForwardingRulePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalForwardingRulePatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the ForwardingRule resource to patch. + /// + /// Sets the *forwarding rule* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn forwarding_rule(mut self, new_value: &str) -> GlobalForwardingRulePatchCall<'a, C, A> { + self._forwarding_rule = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> GlobalForwardingRulePatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalForwardingRulePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalForwardingRulePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalForwardingRulePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. /// /// A builder for the *setTarget* method supported by a *globalForwardingRule* resource. @@ -104081,7 +123462,7 @@ impl<'a, C, A> GlobalForwardingRuleGetCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleSetTargetCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> { @@ -104556,29 +123937,29 @@ impl<'a, C, A> GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> GlobalForwardingRuleListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> GlobalForwardingRuleListCall<'a, C, A> { @@ -104678,7 +124059,7 @@ impl<'a, C, A> GlobalForwardingRuleListCall<'a, C, A> where C: BorrowMut GlobalForwardingRuleInsertCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.https_health_checks().delete("project", "httpsHealthCheck") -/// .request_id("est") -/// .doit(); -/// # } -/// ``` -pub struct HttpsHealthCheckDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _https_health_check: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HttpsHealthCheckDeleteCall<'a, C, A> {} - -impl<'a, C, A> HttpsHealthCheckDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.httpsHealthChecks.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("httpsHealthCheck", self._https_health_check.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "httpsHealthCheck", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/httpsHealthChecks/{httpsHealthCheck}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{httpsHealthCheck}", "httpsHealthCheck")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["httpsHealthCheck", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the HttpsHealthCheck resource to delete. - /// - /// Sets the *https health check* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn https_health_check(mut self, new_value: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { - self._https_health_check = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HttpsHealthCheckDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HttpsHealthCheckDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HttpsHealthCheckDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates a HttpsHealthCheck resource in the specified project using the data included in the request. /// /// A builder for the *insert* method supported by a *httpsHealthCheck* resource. @@ -105233,7 +124346,7 @@ impl<'a, C, A> HttpsHealthCheckDeleteCall<'a, C, A> where C: BorrowMut HttpsHealthCheckGetCall<'a, C, A> where C: BorrowMut HttpsHealthCheckUpdateCall<'a, C, A> where C: BorrowMut HttpsHealthCheckPatchCall<'a, C, A> where C: BorrowMut HttpsHealthCheckListCall<'a, C, A> where C: BorrowMut HttpsHealthCheckListCall<'a, C, A> { @@ -106546,29 +125659,29 @@ impl<'a, C, A> HttpsHealthCheckListCall<'a, C, A> where C: BorrowMut HttpsHealthCheckListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> HttpsHealthCheckListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> HttpsHealthCheckListCall<'a, C, A> { @@ -106634,10 +125747,10 @@ impl<'a, C, A> HttpsHealthCheckListCall<'a, C, A> where C: BorrowMut HttpsHealthCheckListCall<'a, C, A> where C: BorrowMut +pub struct HttpsHealthCheckDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, + _https_health_check: String, + _request_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for MachineTypeAggregatedListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for HttpsHealthCheckDeleteCall<'a, C, A> {} -impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> HttpsHealthCheckDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, MachineTypeAggregatedList)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -106697,23 +125805,15 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.machineTypes.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "compute.httpsHealthChecks.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); + params.push(("httpsHealthCheck", self._https_health_check.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + for &field in ["alt", "project", "httpsHealthCheck", "requestId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -106725,12 +125825,12 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -106741,8 +125841,8 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["httpsHealthCheck", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -106772,7 +125872,7 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut MachineTypeAggregatedListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Name of the HttpsHealthCheck resource to delete. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); + /// Sets the *https health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn https_health_check(mut self, new_value: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { + self._https_health_check = new_value.to_string(); self } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> MachineTypeAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> HttpsHealthCheckDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -106879,7 +125962,7 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut MachineTypeAggregatedListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HttpsHealthCheckDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -106900,7 +125983,7 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> MachineTypeAggregatedListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> HttpsHealthCheckDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -106909,7 +125992,7 @@ impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> MachineTypeAggregatedListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> HttpsHealthCheckDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -107196,6 +126279,316 @@ impl<'a, C, A> MachineTypeGetCall<'a, C, A> where C: BorrowMut, A } +/// Retrieves an aggregated list of machine types. +/// +/// A builder for the *aggregatedList* method supported by a *machineType* resource. +/// It is not used directly, but through a `MachineTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.machine_types().aggregated_list("project") +/// .page_token("labore") +/// .order_by("ea") +/// .max_results(49) +/// .include_all_scopes(false) +/// .filter("sed") +/// .doit(); +/// # } +/// ``` +pub struct MachineTypeAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MachineTypeAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> MachineTypeAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, MachineTypeAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.machineTypes.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/machineTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> MachineTypeAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> MachineTypeAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> MachineTypeAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MachineTypeAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> MachineTypeAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MachineTypeAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves a list of machine types available to the specified project. /// /// A builder for the *list* method supported by a *machineType* resource. @@ -107224,10 +126617,10 @@ impl<'a, C, A> MachineTypeGetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.machine_types().list("project", "zone") -/// .page_token("dolor") -/// .order_by("dolor") -/// .max_results(17) -/// .filter("sit") +/// .page_token("tempor") +/// .order_by("takimata") +/// .max_results(16) +/// .filter("sed") /// .doit(); /// # } /// ``` @@ -107409,7 +126802,7 @@ impl<'a, C, A> MachineTypeListCall<'a, C, A> where C: BorrowMut, self._zone = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> MachineTypeListCall<'a, C, A> { @@ -107418,29 +126811,29 @@ impl<'a, C, A> MachineTypeListCall<'a, C, A> where C: BorrowMut, } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> MachineTypeListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> MachineTypeListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> MachineTypeListCall<'a, C, A> { @@ -107534,7 +126927,7 @@ impl<'a, C, A> MachineTypeListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.network_endpoint_groups().delete("project", "zone", "networkEndpointGroup") -/// .request_id("Stet") +/// .request_id("vero") /// .doit(); /// # } /// ``` @@ -107820,7 +127213,7 @@ impl<'a, C, A> NetworkEndpointGroupDeleteCall<'a, C, A> where C: BorrowMut NetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> where C: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.network_endpoint_groups().list("project", "zone") -/// .page_token("sed") -/// .order_by("dolores") -/// .max_results(83) -/// .filter("elitr") +/// .page_token("ea") +/// .order_by("kasd") +/// .max_results(68) +/// .filter("est") /// .doit(); /// # } /// ``` @@ -108310,7 +127703,7 @@ impl<'a, C, A> NetworkEndpointGroupListCall<'a, C, A> where C: BorrowMut NetworkEndpointGroupListCall<'a, C, A> { @@ -108319,29 +127712,29 @@ impl<'a, C, A> NetworkEndpointGroupListCall<'a, C, A> where C: BorrowMut NetworkEndpointGroupListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NetworkEndpointGroupListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NetworkEndpointGroupListCall<'a, C, A> { @@ -108441,7 +127834,7 @@ impl<'a, C, A> NetworkEndpointGroupListCall<'a, C, A> where C: BorrowMut NetworkEndpointGroupTestIamPermissionCall<'a, C, A> where C: Borr /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.network_endpoint_groups().attach_network_endpoints(req, "project", "zone", "networkEndpointGroup") -/// .request_id("sed") +/// .request_id("diam") /// .doit(); /// # } /// ``` @@ -109340,10 +128733,11 @@ impl<'a, C, A> NetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> where C: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.network_endpoint_groups().aggregated_list("project") -/// .page_token("sadipscing") -/// .order_by("et") -/// .max_results(0) -/// .filter("sit") +/// .page_token("ea") +/// .order_by("Lorem") +/// .max_results(79) +/// .include_all_scopes(false) +/// .filter("diam") /// .doit(); /// # } /// ``` @@ -109355,6 +128749,7 @@ pub struct NetworkEndpointGroupAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -109377,7 +128772,7 @@ impl<'a, C, A> NetworkEndpointGroupAggregatedListCall<'a, C, A> where C: BorrowM }; dlg.begin(MethodInfo { id: "compute.networkEndpointGroups.aggregatedList", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -109388,10 +128783,13 @@ impl<'a, C, A> NetworkEndpointGroupAggregatedListCall<'a, C, A> where C: BorrowM if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } if let Some(value) = self._filter { params.push(("filter", value.to_string())); } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -109513,7 +128911,7 @@ impl<'a, C, A> NetworkEndpointGroupAggregatedListCall<'a, C, A> where C: BorrowM self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NetworkEndpointGroupAggregatedListCall<'a, C, A> { @@ -109522,29 +128920,36 @@ impl<'a, C, A> NetworkEndpointGroupAggregatedListCall<'a, C, A> where C: BorrowM } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> NetworkEndpointGroupAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NetworkEndpointGroupAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> NetworkEndpointGroupAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NetworkEndpointGroupAggregatedListCall<'a, C, A> { @@ -109644,10 +129049,10 @@ impl<'a, C, A> NetworkEndpointGroupAggregatedListCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.network_endpoint_groups().list_network_endpoints(req, "project", "zone", "networkEndpointGroup") -/// .page_token("amet") -/// .order_by("amet.") -/// .max_results(57) -/// .filter("ea") +/// .page_token("tempor") +/// .order_by("et") +/// .max_results(96) +/// .filter("dolores") /// .doit(); /// # } /// ``` @@ -109866,7 +129271,7 @@ impl<'a, C, A> NetworkEndpointGroupListNetworkEndpointCall<'a, C, A> where C: Bo self._network_endpoint_group = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { @@ -109875,29 +129280,29 @@ impl<'a, C, A> NetworkEndpointGroupListNetworkEndpointCall<'a, C, A> where C: Bo } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> NetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { @@ -110227,7 +129632,7 @@ impl<'a, C, A> NetworkEndpointGroupGetCall<'a, C, A> where C: BorrowMut LicenseCodeGetCall<'a, C, A> where C: BorrowMut, A } -/// Returns permissions that a caller has on the specified resource. +/// Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. /// /// A builder for the *testIamPermissions* method supported by a *licenseCode* resource. /// It is not used directly, but through a `LicenseCodeMethods` instance. @@ -110762,22932 +130167,6 @@ impl<'a, C, A> LicenseCodeTestIamPermissionCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_instance_groups().list("project", "region") -/// .page_token("sit") -/// .order_by("sed") -/// .max_results(23) -/// .filter("At") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupListCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets the named ports for the specified regional instance group. -/// -/// A builder for the *setNamedPorts* method supported by a *regionInstanceGroup* resource. -/// It is not used directly, but through a `RegionInstanceGroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionInstanceGroupsSetNamedPortsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupsSetNamedPortsRequest::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.region_instance_groups().set_named_ports(req, "project", "region", "instanceGroup") -/// .request_id("kasd") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupSetNamedPortCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionInstanceGroupsSetNamedPortsRequest, - _project: String, - _region: String, - _instance_group: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupSetNamedPortCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupSetNamedPortCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.setNamedPorts", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroup", self._instance_group.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroup", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroup}", "instanceGroup")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroup", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionInstanceGroupsSetNamedPortsRequest) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// The name of the regional instance group where the named ports are updated. - /// - /// Sets the *instance group* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { - self._instance_group = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified instance group resource. -/// -/// A builder for the *get* method supported by a *regionInstanceGroup* resource. -/// It is not used directly, but through a `RegionInstanceGroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_instance_groups().get("project", "region", "instanceGroup") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _instance_group: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupGetCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroup)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroup", self._instance_group.to_string())); - for &field in ["alt", "project", "region", "instanceGroup"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups/{instanceGroup}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroup}", "instanceGroup")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroup", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the instance group resource to return. - /// - /// Sets the *instance group* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group(mut self, new_value: &str) -> RegionInstanceGroupGetCall<'a, C, A> { - self._instance_group = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. -/// -/// A builder for the *listInstances* method supported by a *regionInstanceGroup* resource. -/// It is not used directly, but through a `RegionInstanceGroupMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionInstanceGroupsListInstancesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupsListInstancesRequest::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.region_instance_groups().list_instances(req, "project", "region", "instanceGroup") -/// .page_token("magna") -/// .order_by("Stet") -/// .max_results(19) -/// .filter("et") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupListInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionInstanceGroupsListInstancesRequest, - _project: String, - _region: String, - _instance_group: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupListInstanceCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupListInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupsListInstances)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.listInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroup", self._instance_group.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroup", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroup}", "instanceGroup")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroup", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionInstanceGroupsListInstancesRequest) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the regional instance group for which we want to list the instances. - /// - /// Sets the *instance group* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._instance_group = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupListInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupListInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupListInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified Router resource. -/// -/// A builder for the *delete* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.routers().delete("project", "region", "router") -/// .request_id("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct RouterDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _router: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterDeleteCall<'a, C, A> {} - -impl<'a, C, A> RouterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("router", self._router.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "router", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["router", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the Router resource to delete. - /// - /// Sets the *router* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn router(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { - self._router = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. -/// -/// A builder for the *preview* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Router; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().preview(req, "project", "region", "router") -/// .doit(); -/// # } -/// ``` -pub struct RouterPreviewCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Router, - _project: String, - _region: String, - _router: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterPreviewCall<'a, C, A> {} - -impl<'a, C, A> RouterPreviewCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RoutersPreviewResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.preview", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("router", self._router.to_string())); - for &field in ["alt", "project", "region", "router"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}/preview"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["router", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Router) -> RouterPreviewCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterPreviewCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterPreviewCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the Router resource to query. - /// - /// Sets the *router* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn router(mut self, new_value: &str) -> RouterPreviewCall<'a, C, A> { - self._router = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterPreviewCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterPreviewCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterPreviewCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves an aggregated list of routers. -/// -/// A builder for the *aggregatedList* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.routers().aggregated_list("project") -/// .page_token("et") -/// .order_by("consetetur") -/// .max_results(9) -/// .filter("voluptua.") -/// .doit(); -/// # } -/// ``` -pub struct RouterAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> RouterAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RouterAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/routers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RouterAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves runtime information of the specified router. -/// -/// A builder for the *getRouterStatus* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.routers().get_router_status("project", "region", "router") -/// .doit(); -/// # } -/// ``` -pub struct RouterGetRouterStatuCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _router: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterGetRouterStatuCall<'a, C, A> {} - -impl<'a, C, A> RouterGetRouterStatuCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RouterStatusResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.getRouterStatus", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("router", self._router.to_string())); - for &field in ["alt", "project", "region", "router"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}/getRouterStatus"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["router", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterGetRouterStatuCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterGetRouterStatuCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the Router resource to query. - /// - /// Sets the *router* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn router(mut self, new_value: &str) -> RouterGetRouterStatuCall<'a, C, A> { - self._router = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterGetRouterStatuCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterGetRouterStatuCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterGetRouterStatuCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. -/// -/// A builder for the *update* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Router; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().update(req, "project", "region", "router") -/// .request_id("sit") -/// .doit(); -/// # } -/// ``` -pub struct RouterUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Router, - _project: String, - _region: String, - _router: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterUpdateCall<'a, C, A> {} - -impl<'a, C, A> RouterUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("router", self._router.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "router", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["router", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Router) -> RouterUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the Router resource to update. - /// - /// Sets the *router* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn router(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { - self._router = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified Router resource. Gets a list of available routers by making a list() request. -/// -/// A builder for the *get* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.routers().get("project", "region", "router") -/// .doit(); -/// # } -/// ``` -pub struct RouterGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _router: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterGetCall<'a, C, A> {} - -impl<'a, C, A> RouterGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Router)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("router", self._router.to_string())); - for &field in ["alt", "project", "region", "router"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["router", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the Router resource to return. - /// - /// Sets the *router* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn router(mut self, new_value: &str) -> RouterGetCall<'a, C, A> { - self._router = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves a list of Router resources available to the specified project. -/// -/// A builder for the *list* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.routers().list("project", "region") -/// .page_token("erat") -/// .order_by("amet.") -/// .max_results(80) -/// .filter("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct RouterListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterListCall<'a, C, A> {} - -impl<'a, C, A> RouterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RouterList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RouterListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RouterListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RouterListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RouterListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. -/// -/// A builder for the *patch* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Router; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().patch(req, "project", "region", "router") -/// .request_id("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct RouterPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Router, - _project: String, - _region: String, - _router: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterPatchCall<'a, C, A> {} - -impl<'a, C, A> RouterPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("router", self._router.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "router", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["router", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Router) -> RouterPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the Router resource to patch. - /// - /// Sets the *router* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn router(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { - self._router = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves runtime Nat mapping information of VM endpoints. -/// -/// A builder for the *getNatMappingInfo* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.routers().get_nat_mapping_info("project", "region", "router") -/// .page_token("rebum.") -/// .order_by("ipsum") -/// .max_results(26) -/// .filter("ut") -/// .doit(); -/// # } -/// ``` -pub struct RouterGetNatMappingInfoCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _router: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterGetNatMappingInfoCall<'a, C, A> {} - -impl<'a, C, A> RouterGetNatMappingInfoCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, VmEndpointNatMappingsList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.getNatMappingInfo", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("router", self._router.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "router", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}/getNatMappingInfo"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["router", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the Router resource to query for Nat Mapping information of VM endpoints. - /// - /// Sets the *router* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn router(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._router = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterGetNatMappingInfoCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterGetNatMappingInfoCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterGetNatMappingInfoCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a Router resource in the specified project and region using the data included in the request. -/// -/// A builder for the *insert* method supported by a *router* resource. -/// It is not used directly, but through a `RouterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Router; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().insert(req, "project", "region") -/// .request_id("et") -/// .doit(); -/// # } -/// ``` -pub struct RouterInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Router, - _project: String, - _region: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RouterInsertCall<'a, C, A> {} - -impl<'a, C, A> RouterInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.routers.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Router) -> RouterInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RouterInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RouterInsertCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RouterInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RouterInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RouterInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates a HealthCheck resource in the specified project using the data included in the request. -/// -/// A builder for the *update* method supported by a *healthCheck* resource. -/// It is not used directly, but through a `HealthCheckMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::HealthCheck; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.health_checks().update(req, "project", "healthCheck") -/// .request_id("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct HealthCheckUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: HealthCheck, - _project: String, - _health_check: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HealthCheckUpdateCall<'a, C, A> {} - -impl<'a, C, A> HealthCheckUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.healthChecks.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("healthCheck", self._health_check.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "healthCheck", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["healthCheck", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HealthCheck) -> HealthCheckUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HealthCheckUpdateCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the HealthCheck resource to update. - /// - /// Sets the *health check* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn health_check(mut self, new_value: &str) -> HealthCheckUpdateCall<'a, C, A> { - self._health_check = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> HealthCheckUpdateCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HealthCheckUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HealthCheckUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a HealthCheck resource in the specified project using the data included in the request. -/// -/// A builder for the *insert* method supported by a *healthCheck* resource. -/// It is not used directly, but through a `HealthCheckMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::HealthCheck; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.health_checks().insert(req, "project") -/// .request_id("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct HealthCheckInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: HealthCheck, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HealthCheckInsertCall<'a, C, A> {} - -impl<'a, C, A> HealthCheckInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.healthChecks.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HealthCheck) -> HealthCheckInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HealthCheckInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> HealthCheckInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HealthCheckInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HealthCheckInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. -/// -/// A builder for the *get* method supported by a *healthCheck* resource. -/// It is not used directly, but through a `HealthCheckMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.health_checks().get("project", "healthCheck") -/// .doit(); -/// # } -/// ``` -pub struct HealthCheckGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _health_check: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HealthCheckGetCall<'a, C, A> {} - -impl<'a, C, A> HealthCheckGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HealthCheck)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.healthChecks.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("healthCheck", self._health_check.to_string())); - for &field in ["alt", "project", "healthCheck"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["healthCheck", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HealthCheckGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the HealthCheck resource to return. - /// - /// Sets the *health check* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn health_check(mut self, new_value: &str) -> HealthCheckGetCall<'a, C, A> { - self._health_check = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HealthCheckGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HealthCheckGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified HealthCheck resource. -/// -/// A builder for the *delete* method supported by a *healthCheck* resource. -/// It is not used directly, but through a `HealthCheckMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.health_checks().delete("project", "healthCheck") -/// .request_id("labore") -/// .doit(); -/// # } -/// ``` -pub struct HealthCheckDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _health_check: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HealthCheckDeleteCall<'a, C, A> {} - -impl<'a, C, A> HealthCheckDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.healthChecks.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("healthCheck", self._health_check.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "healthCheck", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["healthCheck", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HealthCheckDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the HealthCheck resource to delete. - /// - /// Sets the *health check* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn health_check(mut self, new_value: &str) -> HealthCheckDeleteCall<'a, C, A> { - self._health_check = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> HealthCheckDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HealthCheckDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HealthCheckDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. -/// -/// A builder for the *patch* method supported by a *healthCheck* resource. -/// It is not used directly, but through a `HealthCheckMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::HealthCheck; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.health_checks().patch(req, "project", "healthCheck") -/// .request_id("sed") -/// .doit(); -/// # } -/// ``` -pub struct HealthCheckPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: HealthCheck, - _project: String, - _health_check: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HealthCheckPatchCall<'a, C, A> {} - -impl<'a, C, A> HealthCheckPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.healthChecks.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("healthCheck", self._health_check.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "healthCheck", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["healthCheck", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HealthCheck) -> HealthCheckPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HealthCheckPatchCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the HealthCheck resource to patch. - /// - /// Sets the *health check* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn health_check(mut self, new_value: &str) -> HealthCheckPatchCall<'a, C, A> { - self._health_check = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> HealthCheckPatchCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HealthCheckPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HealthCheckPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the list of HealthCheck resources available to the specified project. -/// -/// A builder for the *list* method supported by a *healthCheck* resource. -/// It is not used directly, but through a `HealthCheckMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.health_checks().list("project") -/// .page_token("Lorem") -/// .order_by("sit") -/// .max_results(22) -/// .filter("ipsum") -/// .doit(); -/// # } -/// ``` -pub struct HealthCheckListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HealthCheckListCall<'a, C, A> {} - -impl<'a, C, A> HealthCheckListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HealthCheckList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.healthChecks.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> HealthCheckListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HealthCheckListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HealthCheckListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified managed instance group and all of the instances in that group. -/// -/// A builder for the *delete* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_instance_group_managers().delete("project", "region", "instanceGroupManager") -/// .request_id("ipsum") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerDeleteCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the managed instance group to delete. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// You can specify a maximum of 1000 instances with this method per request. -/// -/// A builder for the *deleteInstances* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionInstanceGroupManagersDeleteInstancesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersDeleteInstancesRequest::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.region_instance_group_managers().delete_instances(req, "project", "region", "instanceGroupManager") -/// .request_id("kasd") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionInstanceGroupManagersDeleteInstancesRequest, - _project: String, - _region: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.deleteInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionInstanceGroupManagersDeleteInstancesRequest) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. -/// -/// A builder for the *setInstanceTemplate* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionInstanceGroupManagersSetTemplateRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersSetTemplateRequest::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.region_instance_group_managers().set_instance_template(req, "project", "region", "instanceGroupManager") -/// .request_id("kasd") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionInstanceGroupManagersSetTemplateRequest, - _project: String, - _region: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.setInstanceTemplate", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionInstanceGroupManagersSetTemplateRequest) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. -/// -/// The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// A builder for the *resize* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_instance_group_managers().resize("project", "region", "instanceGroupManager", -66) -/// .request_id("rebum.") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerResizeCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _instance_group_manager: String, - _size: i32, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerResizeCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerResizeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.resize", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - params.push(("size", self._size.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "size", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// Number of instances that should exist in this instance group manager. - /// - /// Sets the *size* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn size(mut self, new_value: i32) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { - self._size = new_value; - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerResizeCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerResizeCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. -/// -/// A builder for the *setTargetPools* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionInstanceGroupManagersSetTargetPoolsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersSetTargetPoolsRequest::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.region_instance_group_managers().set_target_pools(req, "project", "region", "instanceGroupManager") -/// .request_id("amet") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionInstanceGroupManagersSetTargetPoolsRequest, - _project: String, - _region: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.setTargetPools", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionInstanceGroupManagersSetTargetPoolsRequest) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. -/// -/// A regional managed instance group can contain up to 2000 instances. -/// -/// A builder for the *insert* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManager; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.region_instance_group_managers().insert(req, "project", "region") -/// .request_id("sea") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManager, - _project: String, - _region: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerInsertCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManager) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns all of the details about the specified managed instance group. -/// -/// A builder for the *get* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_instance_group_managers().get("project", "region", "instanceGroupManager") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _instance_group_manager: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerGetCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManager)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - for &field in ["alt", "project", "region", "instanceGroupManager"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the managed instance group to return. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. -/// -/// A builder for the *listManagedInstances* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_instance_group_managers().list_managed_instances("project", "region", "instanceGroupManager") -/// .page_token("eirmod") -/// .order_by("clita") -/// .max_results(94) -/// .filter("consetetur") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _instance_group_manager: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupManagersListInstancesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.listManagedInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("order_by", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "pageToken", "order_by", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order_by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. -/// -/// A builder for the *patch* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManager; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.region_instance_group_managers().patch(req, "project", "region", "instanceGroupManager") -/// .request_id("et") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManager, - _project: String, - _region: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerPatchCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManager) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// The name of the instance group manager. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// You can specify a maximum of 1000 instances with this method per request. -/// -/// A builder for the *recreateInstances* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionInstanceGroupManagersRecreateRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersRecreateRequest::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.region_instance_group_managers().recreate_instances(req, "project", "region", "instanceGroupManager") -/// .request_id("At") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionInstanceGroupManagersRecreateRequest, - _project: String, - _region: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.recreateInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionInstanceGroupManagersRecreateRequest) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the list of managed instance groups that are contained within the specified region. -/// -/// A builder for the *list* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_instance_group_managers().list("project", "region") -/// .page_token("sit") -/// .order_by("sanctus") -/// .max_results(83) -/// .filter("eos") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerListCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupManagerList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupManagerListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// You can specify a maximum of 1000 instances with this method per request. -/// -/// A builder for the *abandonInstances* method supported by a *regionInstanceGroupManager* resource. -/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionInstanceGroupManagersAbandonInstancesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersAbandonInstancesRequest::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.region_instance_group_managers().abandon_instances(req, "project", "region", "instanceGroupManager") -/// .request_id("consetetur") -/// .doit(); -/// # } -/// ``` -pub struct RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionInstanceGroupManagersAbandonInstancesRequest, - _project: String, - _region: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> {} - -impl<'a, C, A> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.abandonInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionInstanceGroupManagersAbandonInstancesRequest) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region scoping this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves all information of the specified resource policy. -/// -/// A builder for the *get* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.resource_policies().get("project", "region", "resourcePolicy") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicyGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _resource_policy: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicyGetCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ResourcePolicy)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("resourcePolicy", self._resource_policy.to_string())); - for &field in ["alt", "project", "region", "resourcePolicy"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resourcePolicy}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resourcePolicy}", "resourcePolicy")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["resourcePolicy", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicyGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ResourcePolicyGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the resource policy to retrieve. - /// - /// Sets the *resource policy* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource_policy(mut self, new_value: &str) -> ResourcePolicyGetCall<'a, C, A> { - self._resource_policy = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicyGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicyGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets the access control policy on the specified resource. Replaces any existing policy. -/// -/// A builder for the *setIamPolicy* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::RegionSetPolicyRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionSetPolicyRequest::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.resource_policies().set_iam_policy(req, "project", "region", "resource") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicySetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: RegionSetPolicyRequest, - _project: String, - _region: String, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicySetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicySetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.setIamPolicy", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "project", "region", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["resource", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: RegionSetPolicyRequest) -> ResourcePolicySetIamPolicyCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name or id of the resource for this request. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicySetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicySetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicySetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. -/// -/// A builder for the *getIamPolicy* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.resource_policies().get_iam_policy("project", "region", "resource") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicyGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicyGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.getIamPolicy", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "project", "region", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["resource", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name or id of the resource for this request. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicyGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicyGetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new resource policy. -/// -/// A builder for the *insert* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::ResourcePolicy; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ResourcePolicy::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.resource_policies().insert(req, "project", "region") -/// .request_id("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicyInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: ResourcePolicy, - _project: String, - _region: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicyInsertCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ResourcePolicy) -> ResourcePolicyInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicyInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ResourcePolicyInsertCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ResourcePolicyInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicyInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicyInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns permissions that a caller has on the specified resource. -/// -/// A builder for the *testIamPermissions* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::TestPermissionsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestPermissionsRequest::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.resource_policies().test_iam_permissions(req, "project", "region", "resource") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicyTestIamPermissionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: TestPermissionsRequest, - _project: String, - _region: String, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicyTestIamPermissionCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TestPermissionsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.testIamPermissions", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "project", "region", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["resource", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: TestPermissionsRequest) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name or id of the resource for this request. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicyTestIamPermissionCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicyTestIamPermissionCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// A list all the resource policies that have been configured for the specified project in specified region. -/// -/// A builder for the *list* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.resource_policies().list("project", "region") -/// .page_token("labore") -/// .order_by("ea") -/// .max_results(49) -/// .filter("kasd") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicyListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicyListCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ResourcePolicyList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ResourcePolicyListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicyListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicyListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified resource policy. -/// -/// A builder for the *delete* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.resource_policies().delete("project", "region", "resourcePolicy") -/// .request_id("tempor") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicyDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _resource_policy: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicyDeleteCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("resourcePolicy", self._resource_policy.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "resourcePolicy", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resourcePolicy}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resourcePolicy}", "resourcePolicy")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["resourcePolicy", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the resource policy to delete. - /// - /// Sets the *resource policy* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource_policy(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { - self._resource_policy = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicyDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicyDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves an aggregated list of resource policies. -/// -/// A builder for the *aggregatedList* method supported by a *resourcePolicy* resource. -/// It is not used directly, but through a `ResourcePolicyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.resource_policies().aggregated_list("project") -/// .page_token("et") -/// .order_by("sed") -/// .max_results(28) -/// .filter("amet.") -/// .doit(); -/// # } -/// ``` -pub struct ResourcePolicyAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ResourcePolicyAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> ResourcePolicyAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ResourcePolicyAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.resourcePolicies.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/resourcePolicies"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ResourcePolicyAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ResourcePolicyAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ResourcePolicyAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified commitment resource. Gets a list of available commitments by making a list() request. -/// -/// A builder for the *get* method supported by a *regionCommitment* resource. -/// It is not used directly, but through a `RegionCommitmentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_commitments().get("project", "region", "commitment") -/// .doit(); -/// # } -/// ``` -pub struct RegionCommitmentGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _commitment: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionCommitmentGetCall<'a, C, A> {} - -impl<'a, C, A> RegionCommitmentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Commitment)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionCommitments.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("commitment", self._commitment.to_string())); - for &field in ["alt", "project", "region", "commitment"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/commitments/{commitment}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{commitment}", "commitment")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["commitment", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionCommitmentGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionCommitmentGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the commitment to return. - /// - /// Sets the *commitment* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn commitment(mut self, new_value: &str) -> RegionCommitmentGetCall<'a, C, A> { - self._commitment = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionCommitmentGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionCommitmentGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a commitment in the specified project using the data included in the request. -/// -/// A builder for the *insert* method supported by a *regionCommitment* resource. -/// It is not used directly, but through a `RegionCommitmentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Commitment; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Commitment::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.region_commitments().insert(req, "project", "region") -/// .request_id("invidunt") -/// .doit(); -/// # } -/// ``` -pub struct RegionCommitmentInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Commitment, - _project: String, - _region: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionCommitmentInsertCall<'a, C, A> {} - -impl<'a, C, A> RegionCommitmentInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionCommitments.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/commitments"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Commitment) -> RegionCommitmentInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionCommitmentInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionCommitmentInsertCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> RegionCommitmentInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionCommitmentInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionCommitmentInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves a list of commitments contained within the specified region. -/// -/// A builder for the *list* method supported by a *regionCommitment* resource. -/// It is not used directly, but through a `RegionCommitmentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_commitments().list("project", "region") -/// .page_token("ea") -/// .order_by("kasd") -/// .max_results(68) -/// .filter("est") -/// .doit(); -/// # } -/// ``` -pub struct RegionCommitmentListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionCommitmentListCall<'a, C, A> {} - -impl<'a, C, A> RegionCommitmentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, CommitmentList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionCommitments.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/commitments"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionCommitmentListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionCommitmentListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionCommitmentListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves an aggregated list of commitments. -/// -/// A builder for the *aggregatedList* method supported by a *regionCommitment* resource. -/// It is not used directly, but through a `RegionCommitmentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.region_commitments().aggregated_list("project") -/// .page_token("sanctus") -/// .order_by("justo") -/// .max_results(11) -/// .filter("sit") -/// .doit(); -/// # } -/// ``` -pub struct RegionCommitmentAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RegionCommitmentAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> RegionCommitmentAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, CommitmentAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.regionCommitments.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/commitments"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> RegionCommitmentAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RegionCommitmentAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RegionCommitmentAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a target VPN gateway in the specified project and region using the data included in the request. -/// -/// A builder for the *insert* method supported by a *targetVpnGateway* resource. -/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::TargetVpnGateway; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TargetVpnGateway::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.target_vpn_gateways().insert(req, "project", "region") -/// .request_id("est") -/// .doit(); -/// # } -/// ``` -pub struct TargetVpnGatewayInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: TargetVpnGateway, - _project: String, - _region: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetVpnGatewayInsertCall<'a, C, A> {} - -impl<'a, C, A> TargetVpnGatewayInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetVpnGateways.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: TargetVpnGateway) -> TargetVpnGatewayInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves an aggregated list of target VPN gateways. -/// -/// A builder for the *aggregatedList* method supported by a *targetVpnGateway* resource. -/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.target_vpn_gateways().aggregated_list("project") -/// .page_token("diam") -/// .order_by("Lorem") -/// .max_results(85) -/// .filter("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct TargetVpnGatewayAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetVpnGatewayAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> TargetVpnGatewayAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TargetVpnGatewayAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetVpnGateways.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/targetVpnGateways"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. -/// -/// A builder for the *get* method supported by a *targetVpnGateway* resource. -/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.target_vpn_gateways().get("project", "region", "targetVpnGateway") -/// .doit(); -/// # } -/// ``` -pub struct TargetVpnGatewayGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _target_vpn_gateway: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetVpnGatewayGetCall<'a, C, A> {} - -impl<'a, C, A> TargetVpnGatewayGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TargetVpnGateway)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetVpnGateways.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("targetVpnGateway", self._target_vpn_gateway.to_string())); - for &field in ["alt", "project", "region", "targetVpnGateway"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetVpnGateway}", "targetVpnGateway")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["targetVpnGateway", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetVpnGatewayGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> TargetVpnGatewayGetCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the target VPN gateway to return. - /// - /// Sets the *target vpn gateway* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn target_vpn_gateway(mut self, new_value: &str) -> TargetVpnGatewayGetCall<'a, C, A> { - self._target_vpn_gateway = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves a list of target VPN gateways available to the specified project and region. -/// -/// A builder for the *list* method supported by a *targetVpnGateway* resource. -/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.target_vpn_gateways().list("project", "region") -/// .page_token("diam") -/// .order_by("tempor") -/// .max_results(27) -/// .filter("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct TargetVpnGatewayListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetVpnGatewayListCall<'a, C, A> {} - -impl<'a, C, A> TargetVpnGatewayListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TargetVpnGatewayList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetVpnGateways.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> TargetVpnGatewayListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified target VPN gateway. -/// -/// A builder for the *delete* method supported by a *targetVpnGateway* resource. -/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.target_vpn_gateways().delete("project", "region", "targetVpnGateway") -/// .request_id("rebum.") -/// .doit(); -/// # } -/// ``` -pub struct TargetVpnGatewayDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _region: String, - _target_vpn_gateway: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetVpnGatewayDeleteCall<'a, C, A> {} - -impl<'a, C, A> TargetVpnGatewayDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetVpnGateways.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("region", self._region.to_string())); - params.push(("targetVpnGateway", self._target_vpn_gateway.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "region", "targetVpnGateway", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetVpnGateway}", "targetVpnGateway")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["targetVpnGateway", "region", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the region for this request. - /// - /// Sets the *region* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn region(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { - self._region = new_value.to_string(); - self - } - /// Name of the target VPN gateway to delete. - /// - /// Sets the *target vpn gateway* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn target_vpn_gateway(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { - self._target_vpn_gateway = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. -/// -/// A builder for the *listManagedInstances* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.instance_group_managers().list_managed_instances("project", "zone", "instanceGroupManager") -/// .page_token("vero") -/// .order_by("ipsum") -/// .max_results(77) -/// .filter("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerListManagedInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _instance_group_manager: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerListManagedInstanceCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerListManagedInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagersListManagedInstancesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.listManagedInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("order_by", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "pageToken", "order_by", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order_by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. -/// -/// A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. -/// -/// A builder for the *insert* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManager; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.instance_group_managers().insert(req, "project", "zone") -/// .request_id("et") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManager, - _project: String, - _zone: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerInsertCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManager) -> InstanceGroupManagerInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where you want to create the managed instance group. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves a list of managed instance groups that are contained within the specified project and zone. -/// -/// A builder for the *list* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.instance_group_managers().list("project", "zone") -/// .page_token("sanctus") -/// .order_by("sanctus") -/// .max_results(8) -/// .filter("labore") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerListCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagerList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the list of managed instance groups and groups them by zone. -/// -/// A builder for the *aggregatedList* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.instance_group_managers().aggregated_list("project") -/// .page_token("erat") -/// .order_by("clita") -/// .max_results(66) -/// .filter("accusam") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagerAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/instanceGroupManagers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. -/// -/// A builder for the *get* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.instance_group_managers().get("project", "zone", "instanceGroupManager") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _instance_group_manager: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerGetCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManager)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. -/// -/// A builder for the *setInstanceTemplate* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManagersSetInstanceTemplateRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersSetInstanceTemplateRequest::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.instance_group_managers().set_instance_template(req, "project", "zone", "instanceGroupManager") -/// .request_id("gubergren") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManagersSetInstanceTemplateRequest, - _project: String, - _zone: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.setInstanceTemplate", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManagersSetInstanceTemplateRequest) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. -/// -/// A builder for the *setTargetPools* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManagersSetTargetPoolsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersSetTargetPoolsRequest::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.instance_group_managers().set_target_pools(req, "project", "zone", "instanceGroupManager") -/// .request_id("et") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerSetTargetPoolCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManagersSetTargetPoolsRequest, - _project: String, - _zone: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerSetTargetPoolCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerSetTargetPoolCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.setTargetPools", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManagersSetTargetPoolsRequest) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// You can specify a maximum of 1000 instances with this method per request. -/// -/// A builder for the *abandonInstances* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManagersAbandonInstancesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersAbandonInstancesRequest::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.instance_group_managers().abandon_instances(req, "project", "zone", "instanceGroupManager") -/// .request_id("voluptua.") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerAbandonInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManagersAbandonInstancesRequest, - _project: String, - _zone: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerAbandonInstanceCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerAbandonInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.abandonInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManagersAbandonInstancesRequest) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. -/// -/// A builder for the *patch* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManager; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.instance_group_managers().patch(req, "project", "zone", "instanceGroupManager") -/// .request_id("dolores") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManager, - _project: String, - _zone: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerPatchCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManager) -> InstanceGroupManagerPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where you want to create the managed instance group. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the instance group manager. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. -/// -/// When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: -/// -/// + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. -/// -/// This list is subject to change. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// A builder for the *resize* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.instance_group_managers().resize("project", "zone", "instanceGroupManager", -3) -/// .request_id("ipsum") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerResizeCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _instance_group_manager: String, - _size: i32, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerResizeCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerResizeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.resize", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - params.push(("size", self._size.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "size", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. - /// - /// Sets the *size* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn size(mut self, new_value: i32) -> InstanceGroupManagerResizeCall<'a, C, A> { - self._size = new_value; - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerResizeCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerResizeCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerResizeCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// You can specify a maximum of 1000 instances with this method per request. -/// -/// A builder for the *deleteInstances* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManagersDeleteInstancesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersDeleteInstancesRequest::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.instance_group_managers().delete_instances(req, "project", "zone", "instanceGroupManager") -/// .request_id("accusam") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerDeleteInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManagersDeleteInstancesRequest, - _project: String, - _zone: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerDeleteInstanceCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.deleteInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManagersDeleteInstancesRequest) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. -/// -/// A builder for the *delete* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.instance_group_managers().delete("project", "zone", "instanceGroupManager") -/// .request_id("diam") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerDeleteCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group to delete. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. -/// -/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. -/// -/// You can specify a maximum of 1000 instances with this method per request. -/// -/// A builder for the *recreateInstances* method supported by a *instanceGroupManager* resource. -/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceGroupManagersRecreateInstancesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersRecreateInstancesRequest::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.instance_group_managers().recreate_instances(req, "project", "zone", "instanceGroupManager") -/// .request_id("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct InstanceGroupManagerRecreateInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceGroupManagersRecreateInstancesRequest, - _project: String, - _zone: String, - _instance_group_manager: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstanceGroupManagerRecreateInstanceCall<'a, C, A> {} - -impl<'a, C, A> InstanceGroupManagerRecreateInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.recreateInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("instanceGroupManager", self._instance_group_manager.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["instanceGroupManager", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceGroupManagersRecreateInstancesRequest) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone where the managed instance group is located. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The name of the managed instance group. - /// - /// Sets the *instance group manager* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._instance_group_manager = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves an aggregated list of accelerator types. -/// -/// A builder for the *aggregatedList* method supported by a *acceleratorType* resource. -/// It is not used directly, but through a `AcceleratorTypeMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.accelerator_types().aggregated_list("project") -/// .page_token("clita") -/// .order_by("est") -/// .max_results(70) -/// .filter("labore") -/// .doit(); -/// # } -/// ``` -pub struct AcceleratorTypeAggregatedListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AcceleratorTypeAggregatedListCall<'a, C, A> {} - -impl<'a, C, A> AcceleratorTypeAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AcceleratorTypeAggregatedList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.acceleratorTypes.aggregatedList", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/aggregated/acceleratorTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> AcceleratorTypeAggregatedListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AcceleratorTypeAggregatedListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AcceleratorTypeAggregatedListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AcceleratorTypeAggregatedListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves a list of accelerator types available to the specified project. -/// -/// A builder for the *list* method supported by a *acceleratorType* resource. -/// It is not used directly, but through a `AcceleratorTypeMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.accelerator_types().list("project", "zone") -/// .page_token("labore") -/// .order_by("rebum.") -/// .max_results(37) -/// .filter("dolor") -/// .doit(); -/// # } -/// ``` -pub struct AcceleratorTypeListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AcceleratorTypeListCall<'a, C, A> {} - -impl<'a, C, A> AcceleratorTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AcceleratorTypeList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.acceleratorTypes.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/acceleratorTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> AcceleratorTypeListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AcceleratorTypeListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AcceleratorTypeListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AcceleratorTypeListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified accelerator type. -/// -/// A builder for the *get* method supported by a *acceleratorType* resource. -/// It is not used directly, but through a `AcceleratorTypeMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.accelerator_types().get("project", "zone", "acceleratorType") -/// .doit(); -/// # } -/// ``` -pub struct AcceleratorTypeGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _accelerator_type: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AcceleratorTypeGetCall<'a, C, A> {} - -impl<'a, C, A> AcceleratorTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AcceleratorType)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.acceleratorTypes.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("acceleratorType", self._accelerator_type.to_string())); - for &field in ["alt", "project", "zone", "acceleratorType"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{acceleratorType}", "acceleratorType")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["acceleratorType", "zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> AcceleratorTypeGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> AcceleratorTypeGetCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Name of the accelerator type to return. - /// - /// Sets the *accelerator type* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn accelerator_type(mut self, new_value: &str) -> AcceleratorTypeGetCall<'a, C, A> { - self._accelerator_type = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AcceleratorTypeGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AcceleratorTypeGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AcceleratorTypeGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all shared VPC host projects visible to the user in an organization. -/// -/// A builder for the *listXpnHosts* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::ProjectsListXpnHostsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsListXpnHostsRequest::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().list_xpn_hosts(req, "project") -/// .page_token("amet") -/// .order_by("et") -/// .max_results(97) -/// .filter("sea") -/// .doit(); -/// # } -/// ``` -pub struct ProjectListXpnHostCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: ProjectsListXpnHostsRequest, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectListXpnHostCall<'a, C, A> {} - -impl<'a, C, A> ProjectListXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, XpnHostList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.listXpnHosts", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("order_by", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "order_by", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/listXpnHosts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ProjectsListXpnHostsRequest) -> ProjectListXpnHostCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order_by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ProjectListXpnHostCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectListXpnHostCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectListXpnHostCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectListXpnHostCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Disable this project as a shared VPC host project. -/// -/// A builder for the *disableXpnHost* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().disable_xpn_host("project") -/// .request_id("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct ProjectDisableXpnHostCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectDisableXpnHostCall<'a, C, A> {} - -impl<'a, C, A> ProjectDisableXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.disableXpnHost", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/disableXpnHost"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectDisableXpnHostCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectDisableXpnHostCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDisableXpnHostCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectDisableXpnHostCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDisableXpnHostCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. -/// -/// A builder for the *enableXpnResource* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::ProjectsEnableXpnResourceRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsEnableXpnResourceRequest::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().enable_xpn_resource(req, "project") -/// .request_id("voluptua.") -/// .doit(); -/// # } -/// ``` -pub struct ProjectEnableXpnResourceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: ProjectsEnableXpnResourceRequest, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectEnableXpnResourceCall<'a, C, A> {} - -impl<'a, C, A> ProjectEnableXpnResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.enableXpnResource", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/enableXpnResource"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ProjectsEnableXpnResourceRequest) -> ProjectEnableXpnResourceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectEnableXpnResourceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectEnableXpnResourceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectEnableXpnResourceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectEnableXpnResourceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectEnableXpnResourceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Moves an instance and its attached persistent disks from one zone to another. -/// -/// A builder for the *moveInstance* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::InstanceMoveRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceMoveRequest::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().move_instance(req, "project") -/// .request_id("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct ProjectMoveInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: InstanceMoveRequest, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMoveInstanceCall<'a, C, A> {} - -impl<'a, C, A> ProjectMoveInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.moveInstance", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/moveInstance"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InstanceMoveRequest) -> ProjectMoveInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectMoveInstanceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectMoveInstanceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectMoveInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectMoveInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectMoveInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. -/// -/// A builder for the *setUsageExportBucket* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::UsageExportLocation; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UsageExportLocation::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().set_usage_export_bucket(req, "project") -/// .request_id("ipsum") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSetUsageExportBucketCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: UsageExportLocation, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSetUsageExportBucketCall<'a, C, A> {} - -impl<'a, C, A> ProjectSetUsageExportBucketCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.setUsageExportBucket", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/setUsageExportBucket"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: UsageExportLocation) -> ProjectSetUsageExportBucketCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectSetUsageExportBucketCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectSetUsageExportBucketCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetUsageExportBucketCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectSetUsageExportBucketCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectSetUsageExportBucketCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Enable this project as a shared VPC host project. -/// -/// A builder for the *enableXpnHost* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().enable_xpn_host("project") -/// .request_id("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct ProjectEnableXpnHostCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectEnableXpnHostCall<'a, C, A> {} - -impl<'a, C, A> ProjectEnableXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.enableXpnHost", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/enableXpnHost"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectEnableXpnHostCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectEnableXpnHostCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectEnableXpnHostCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectEnableXpnHostCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectEnableXpnHostCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Disable a service resource (also known as service project) associated with this host project. -/// -/// A builder for the *disableXpnResource* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::ProjectsDisableXpnResourceRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsDisableXpnResourceRequest::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().disable_xpn_resource(req, "project") -/// .request_id("no") -/// .doit(); -/// # } -/// ``` -pub struct ProjectDisableXpnResourceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: ProjectsDisableXpnResourceRequest, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectDisableXpnResourceCall<'a, C, A> {} - -impl<'a, C, A> ProjectDisableXpnResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.disableXpnResource", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/disableXpnResource"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ProjectsDisableXpnResourceRequest) -> ProjectDisableXpnResourceCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectDisableXpnResourceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectDisableXpnResourceCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDisableXpnResourceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectDisableXpnResourceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDisableXpnResourceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the shared VPC host project that this project links to. May be empty if no link exists. -/// -/// A builder for the *getXpnHost* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().get_xpn_host("project") -/// .doit(); -/// # } -/// ``` -pub struct ProjectGetXpnHostCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGetXpnHostCall<'a, C, A> {} - -impl<'a, C, A> ProjectGetXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Project)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.getXpnHost", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - for &field in ["alt", "project"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/getXpnHost"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectGetXpnHostCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetXpnHostCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectGetXpnHostCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectGetXpnHostCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the specified Project resource. -/// -/// A builder for the *get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().get("project") -/// .doit(); -/// # } -/// ``` -pub struct ProjectGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Project)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - for &field in ["alt", "project"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectGetCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. -/// -/// A builder for the *setDefaultNetworkTier* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::ProjectsSetDefaultNetworkTierRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsSetDefaultNetworkTierRequest::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().set_default_network_tier(req, "project") -/// .request_id("takimata") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSetDefaultNetworkTierCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: ProjectsSetDefaultNetworkTierRequest, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSetDefaultNetworkTierCall<'a, C, A> {} - -impl<'a, C, A> ProjectSetDefaultNetworkTierCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.setDefaultNetworkTier", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/setDefaultNetworkTier"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ProjectsSetDefaultNetworkTierRequest) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectSetDefaultNetworkTierCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectSetDefaultNetworkTierCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets service resources (a.k.a service project) associated with this host project. -/// -/// A builder for the *getXpnResources* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().get_xpn_resources("project") -/// .page_token("ipsum") -/// .order_by("et") -/// .max_results(62) -/// .filter("dolore") -/// .doit(); -/// # } -/// ``` -pub struct ProjectGetXpnResourceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGetXpnResourceCall<'a, C, A> {} - -impl<'a, C, A> ProjectGetXpnResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ProjectsGetXpnResources)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.getXpnResources", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("order_by", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "order_by", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/getXpnResources"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order_by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ProjectGetXpnResourceCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetXpnResourceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectGetXpnResourceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectGetXpnResourceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Moves a persistent disk from one zone to another. -/// -/// A builder for the *moveDisk* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::DiskMoveRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DiskMoveRequest::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().move_disk(req, "project") -/// .request_id("labore") -/// .doit(); -/// # } -/// ``` -pub struct ProjectMoveDiskCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: DiskMoveRequest, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMoveDiskCall<'a, C, A> {} - -impl<'a, C, A> ProjectMoveDiskCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.moveDisk", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/moveDisk"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: DiskMoveRequest) -> ProjectMoveDiskCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectMoveDiskCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectMoveDiskCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectMoveDiskCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectMoveDiskCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectMoveDiskCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets metadata common to all instances within the specified project using the data included in the request. -/// -/// A builder for the *setCommonInstanceMetadata* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// use compute1::Metadata; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Metadata::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().set_common_instance_metadata(req, "project") -/// .request_id("dolor") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSetCommonInstanceMetadataCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _request: Metadata, - _project: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSetCommonInstanceMetadataCall<'a, C, A> {} - -impl<'a, C, A> ProjectSetCommonInstanceMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.projects.setCommonInstanceMetadata", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/setCommonInstanceMetadata"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Metadata) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { - self._request = new_value; - self - } - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Sets the labels on the target regional disk. /// /// A builder for the *setLabels* method supported by a *regionDisk* resource. @@ -133722,7 +130201,7 @@ impl<'a, C, A> ProjectSetCommonInstanceMetadataCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.region_disks().set_labels(req, "project", "region", "resource") -/// .request_id("At") +/// .request_id("consetetur") /// .doit(); /// # } /// ``` @@ -134592,7 +131071,7 @@ impl<'a, C, A> RegionDiskTestIamPermissionCall<'a, C, A> where C: BorrowMut RegionDiskCreateSnapshotCall<'a, C, A> where C: BorrowMut RegionDiskRemoveResourcePolicyCall<'a, C, A> where C: BorrowMut RegionDiskListCall<'a, C, A> where C: BorrowMut, A self._region = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> RegionDiskListCall<'a, C, A> { @@ -135402,29 +131881,29 @@ impl<'a, C, A> RegionDiskListCall<'a, C, A> where C: BorrowMut, A } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> RegionDiskListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RegionDiskListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RegionDiskListCall<'a, C, A> { @@ -135524,7 +132003,7 @@ impl<'a, C, A> RegionDiskListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.region_disks().add_resource_policies(req, "project", "region", "disk") -/// .request_id("consetetur") +/// .request_id("et") /// .doit(); /// # } /// ``` @@ -135835,8 +132314,8 @@ impl<'a, C, A> RegionDiskAddResourcePolicyCall<'a, C, A> where C: BorrowMut RegionDiskDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.region_disks().resize(req, "project", "region", "disk") -/// .request_id("dolores") +/// .request_id("dolor") /// .doit(); /// # } /// ``` @@ -136703,6 +133182,28828 @@ impl<'a, C, A> RegionDiskResizeCall<'a, C, A> where C: BorrowMut, } +/// Deletes the specified Router resource. +/// +/// A builder for the *delete* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.routers().delete("project", "region", "router") +/// .request_id("tempor") +/// .doit(); +/// # } +/// ``` +pub struct RouterDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _router: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterDeleteCall<'a, C, A> {} + +impl<'a, C, A> RouterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("router", self._router.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "router", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["router", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Router resource to delete. + /// + /// Sets the *router* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn router(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { + self._router = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RouterDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. +/// +/// A builder for the *preview* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Router; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().preview(req, "project", "region", "router") +/// .doit(); +/// # } +/// ``` +pub struct RouterPreviewCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Router, + _project: String, + _region: String, + _router: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterPreviewCall<'a, C, A> {} + +impl<'a, C, A> RouterPreviewCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RoutersPreviewResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.preview", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("router", self._router.to_string())); + for &field in ["alt", "project", "region", "router"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}/preview"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["router", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Router) -> RouterPreviewCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterPreviewCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterPreviewCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Router resource to query. + /// + /// Sets the *router* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn router(mut self, new_value: &str) -> RouterPreviewCall<'a, C, A> { + self._router = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterPreviewCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterPreviewCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterPreviewCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of routers. +/// +/// A builder for the *aggregatedList* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.routers().aggregated_list("project") +/// .page_token("diam") +/// .order_by("elitr") +/// .max_results(72) +/// .include_all_scopes(false) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct RouterAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> RouterAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RouterAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/routers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RouterAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> RouterAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RouterAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves runtime information of the specified router. +/// +/// A builder for the *getRouterStatus* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.routers().get_router_status("project", "region", "router") +/// .doit(); +/// # } +/// ``` +pub struct RouterGetRouterStatuCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _router: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterGetRouterStatuCall<'a, C, A> {} + +impl<'a, C, A> RouterGetRouterStatuCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RouterStatusResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.getRouterStatus", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("router", self._router.to_string())); + for &field in ["alt", "project", "region", "router"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}/getRouterStatus"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["router", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterGetRouterStatuCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterGetRouterStatuCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Router resource to query. + /// + /// Sets the *router* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn router(mut self, new_value: &str) -> RouterGetRouterStatuCall<'a, C, A> { + self._router = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterGetRouterStatuCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterGetRouterStatuCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterGetRouterStatuCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. +/// +/// A builder for the *update* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Router; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().update(req, "project", "region", "router") +/// .request_id("est") +/// .doit(); +/// # } +/// ``` +pub struct RouterUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Router, + _project: String, + _region: String, + _router: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterUpdateCall<'a, C, A> {} + +impl<'a, C, A> RouterUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("router", self._router.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "router", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["router", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Router) -> RouterUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Router resource to update. + /// + /// Sets the *router* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn router(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { + self._router = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RouterUpdateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified Router resource. Gets a list of available routers by making a list() request. +/// +/// A builder for the *get* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.routers().get("project", "region", "router") +/// .doit(); +/// # } +/// ``` +pub struct RouterGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _router: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterGetCall<'a, C, A> {} + +impl<'a, C, A> RouterGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Router)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("router", self._router.to_string())); + for &field in ["alt", "project", "region", "router"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["router", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Router resource to return. + /// + /// Sets the *router* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn router(mut self, new_value: &str) -> RouterGetCall<'a, C, A> { + self._router = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of Router resources available to the specified project. +/// +/// A builder for the *list* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.routers().list("project", "region") +/// .page_token("sed") +/// .order_by("dolore") +/// .max_results(40) +/// .filter("amet") +/// .doit(); +/// # } +/// ``` +pub struct RouterListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterListCall<'a, C, A> {} + +impl<'a, C, A> RouterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RouterList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RouterListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RouterListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RouterListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RouterListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Router; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().patch(req, "project", "region", "router") +/// .request_id("elitr") +/// .doit(); +/// # } +/// ``` +pub struct RouterPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Router, + _project: String, + _region: String, + _router: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterPatchCall<'a, C, A> {} + +impl<'a, C, A> RouterPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("router", self._router.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "router", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["router", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Router) -> RouterPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Router resource to patch. + /// + /// Sets the *router* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn router(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { + self._router = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RouterPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves runtime Nat mapping information of VM endpoints. +/// +/// A builder for the *getNatMappingInfo* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.routers().get_nat_mapping_info("project", "region", "router") +/// .page_token("diam") +/// .order_by("aliquyam") +/// .max_results(66) +/// .filter("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct RouterGetNatMappingInfoCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _router: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterGetNatMappingInfoCall<'a, C, A> {} + +impl<'a, C, A> RouterGetNatMappingInfoCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VmEndpointNatMappingsList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.getNatMappingInfo", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("router", self._router.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "router", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers/{router}/getNatMappingInfo"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{router}", "router")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["router", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Router resource to query for Nat Mapping information of VM endpoints. + /// + /// Sets the *router* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn router(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._router = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterGetNatMappingInfoCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterGetNatMappingInfoCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterGetNatMappingInfoCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a Router resource in the specified project and region using the data included in the request. +/// +/// A builder for the *insert* method supported by a *router* resource. +/// It is not used directly, but through a `RouterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Router; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Router::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.routers().insert(req, "project", "region") +/// .request_id("dolor") +/// .doit(); +/// # } +/// ``` +pub struct RouterInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Router, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RouterInsertCall<'a, C, A> {} + +impl<'a, C, A> RouterInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.routers.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/routers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Router) -> RouterInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RouterInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RouterInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RouterInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RouterInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RouterInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RouterInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a HealthCheck resource in the specified project using the data included in the request. +/// +/// A builder for the *update* method supported by a *healthCheck* resource. +/// It is not used directly, but through a `HealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::HealthCheck; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.health_checks().update(req, "project", "healthCheck") +/// .request_id("dolor") +/// .doit(); +/// # } +/// ``` +pub struct HealthCheckUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: HealthCheck, + _project: String, + _health_check: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HealthCheckUpdateCall<'a, C, A> {} + +impl<'a, C, A> HealthCheckUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.healthChecks.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "healthCheck", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["healthCheck", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HealthCheck) -> HealthCheckUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HealthCheckUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to update. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> HealthCheckUpdateCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> HealthCheckUpdateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HealthCheckUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HealthCheckUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. +/// +/// A builder for the *aggregatedList* method supported by a *healthCheck* resource. +/// It is not used directly, but through a `HealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.health_checks().aggregated_list("project") +/// .page_token("takimata") +/// .order_by("amet.") +/// .max_results(97) +/// .include_all_scopes(false) +/// .filter("tempor") +/// .doit(); +/// # } +/// ``` +pub struct HealthCheckAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HealthCheckAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> HealthCheckAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HealthChecksAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.healthChecks.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/healthChecks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HealthCheckAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> HealthCheckAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> HealthCheckAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> HealthCheckAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> HealthCheckAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> HealthCheckAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HealthCheckAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HealthCheckAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a HealthCheck resource in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *healthCheck* resource. +/// It is not used directly, but through a `HealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::HealthCheck; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.health_checks().insert(req, "project") +/// .request_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct HealthCheckInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: HealthCheck, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HealthCheckInsertCall<'a, C, A> {} + +impl<'a, C, A> HealthCheckInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.healthChecks.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HealthCheck) -> HealthCheckInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HealthCheckInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> HealthCheckInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HealthCheckInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HealthCheckInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. +/// +/// A builder for the *get* method supported by a *healthCheck* resource. +/// It is not used directly, but through a `HealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.health_checks().get("project", "healthCheck") +/// .doit(); +/// # } +/// ``` +pub struct HealthCheckGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _health_check: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HealthCheckGetCall<'a, C, A> {} + +impl<'a, C, A> HealthCheckGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HealthCheck)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.healthChecks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + for &field in ["alt", "project", "healthCheck"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["healthCheck", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HealthCheckGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to return. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> HealthCheckGetCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HealthCheckGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HealthCheckGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified HealthCheck resource. +/// +/// A builder for the *delete* method supported by a *healthCheck* resource. +/// It is not used directly, but through a `HealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.health_checks().delete("project", "healthCheck") +/// .request_id("tempor") +/// .doit(); +/// # } +/// ``` +pub struct HealthCheckDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _health_check: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HealthCheckDeleteCall<'a, C, A> {} + +impl<'a, C, A> HealthCheckDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.healthChecks.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "healthCheck", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["healthCheck", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HealthCheckDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to delete. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> HealthCheckDeleteCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> HealthCheckDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HealthCheckDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HealthCheckDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *healthCheck* resource. +/// It is not used directly, but through a `HealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::HealthCheck; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.health_checks().patch(req, "project", "healthCheck") +/// .request_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct HealthCheckPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: HealthCheck, + _project: String, + _health_check: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HealthCheckPatchCall<'a, C, A> {} + +impl<'a, C, A> HealthCheckPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.healthChecks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "healthCheck", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["healthCheck", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HealthCheck) -> HealthCheckPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HealthCheckPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to patch. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> HealthCheckPatchCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> HealthCheckPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HealthCheckPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HealthCheckPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of HealthCheck resources available to the specified project. +/// +/// A builder for the *list* method supported by a *healthCheck* resource. +/// It is not used directly, but through a `HealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.health_checks().list("project") +/// .page_token("eirmod") +/// .order_by("sadipscing") +/// .max_results(66) +/// .filter("tempor") +/// .doit(); +/// # } +/// ``` +pub struct HealthCheckListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HealthCheckListCall<'a, C, A> {} + +impl<'a, C, A> HealthCheckListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HealthCheckList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.healthChecks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/healthChecks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> HealthCheckListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> HealthCheckListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HealthCheckListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HealthCheckListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HealthCheckListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified managed instance group and all of the instances in that group. +/// +/// A builder for the *delete* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_group_managers().delete("project", "region", "instanceGroupManager") +/// .request_id("ea") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the managed instance group to delete. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +/// +/// A builder for the *createInstances* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupManagersCreateInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersCreateInstancesRequest::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.region_instance_group_managers().create_instances(req, "project", "region", "instanceGroupManager") +/// .request_id("eos") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupManagersCreateInstancesRequest, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.createInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupManagersCreateInstancesRequest) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region where the managed instance group is located. It should conform to RFC1035. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The name of the managed instance group. It should conform to RFC1035. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerCreateInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// You can specify a maximum of 1000 instances with this method per request. +/// +/// A builder for the *deleteInstances* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupManagersDeleteInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersDeleteInstancesRequest::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.region_instance_group_managers().delete_instances(req, "project", "region", "instanceGroupManager") +/// .request_id("vero") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupManagersDeleteInstancesRequest, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.deleteInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupManagersDeleteInstancesRequest) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerDeleteInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. +/// +/// A builder for the *setInstanceTemplate* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupManagersSetTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersSetTemplateRequest::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.region_instance_group_managers().set_instance_template(req, "project", "region", "instanceGroupManager") +/// .request_id("takimata") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupManagersSetTemplateRequest, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.setInstanceTemplate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupManagersSetTemplateRequest) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. +/// +/// The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// A builder for the *resize* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_group_managers().resize("project", "region", "instanceGroupManager", -36) +/// .request_id("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerResizeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _instance_group_manager: String, + _size: i32, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerResizeCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerResizeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.resize", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + params.push(("size", self._size.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "size", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// Number of instances that should exist in this instance group manager. + /// + /// Sets the *size* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn size(mut self, new_value: i32) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { + self._size = new_value; + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerResizeCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerResizeCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerResizeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. +/// +/// A builder for the *setTargetPools* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupManagersSetTargetPoolsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersSetTargetPoolsRequest::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.region_instance_group_managers().set_target_pools(req, "project", "region", "instanceGroupManager") +/// .request_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupManagersSetTargetPoolsRequest, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.setTargetPools", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupManagersSetTargetPoolsRequest) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerSetTargetPoolCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. +/// +/// A regional managed instance group can contain up to 2000 instances. +/// +/// A builder for the *insert* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManager; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.region_instance_group_managers().insert(req, "project", "region") +/// .request_id("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManager, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManager) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all errors thrown by actions on instances for a given regional managed instance group. +/// +/// A builder for the *listErrors* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_group_managers().list_errors("project", "region", "instanceGroupManager") +/// .page_token("ut") +/// .order_by("sea") +/// .max_results(86) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerListErrorCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _instance_group_manager: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerListErrorCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerListErrorCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupManagersListErrorsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.listErrors", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. This should conform to RFC1035. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerListErrorCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. +/// +/// A builder for the *listManagedInstances* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_group_managers().list_managed_instances("project", "region", "instanceGroupManager") +/// .page_token("amet.") +/// .order_by("Lorem") +/// .max_results(65) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _instance_group_manager: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupManagersListInstancesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.listManagedInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerListManagedInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Apply updates to selected instances the managed instance group. +/// +/// A builder for the *applyUpdatesToInstances* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupManagersApplyUpdatesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersApplyUpdatesRequest::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.region_instance_group_managers().apply_updates_to_instances(req, "project", "region", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupManagersApplyUpdatesRequest, + _project: String, + _region: String, + _instance_group_manager: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.applyUpdatesToInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "region", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupManagersApplyUpdatesRequest) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request, should conform to RFC1035. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The name of the managed instance group, should conform to RFC1035. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns all of the details about the specified managed instance group. +/// +/// A builder for the *get* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_group_managers().get("project", "region", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _instance_group_manager: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerGetCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManager)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "region", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the managed instance group to return. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerGetCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManager; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.region_instance_group_managers().patch(req, "project", "region", "instanceGroupManager") +/// .request_id("eos") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManager, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerPatchCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManager) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The name of the instance group manager. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// You can specify a maximum of 1000 instances with this method per request. +/// +/// A builder for the *recreateInstances* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupManagersRecreateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersRecreateRequest::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.region_instance_group_managers().recreate_instances(req, "project", "region", "instanceGroupManager") +/// .request_id("amet") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupManagersRecreateRequest, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.recreateInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupManagersRecreateRequest) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerRecreateInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of managed instance groups that are contained within the specified region. +/// +/// A builder for the *list* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_group_managers().list("project", "region") +/// .page_token("elitr") +/// .order_by("eirmod") +/// .max_results(92) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerListCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupManagerList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupManagerListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupManagerListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// You can specify a maximum of 1000 instances with this method per request. +/// +/// A builder for the *abandonInstances* method supported by a *regionInstanceGroupManager* resource. +/// It is not used directly, but through a `RegionInstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupManagersAbandonInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupManagersAbandonInstancesRequest::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.region_instance_group_managers().abandon_instances(req, "project", "region", "instanceGroupManager") +/// .request_id("voluptua.") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupManagersAbandonInstancesRequest, + _project: String, + _region: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroupManagers.abandonInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupManagersAbandonInstancesRequest) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupManagerAbandonInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the status for the specified VPN gateway. +/// +/// A builder for the *getStatus* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.vpn_gateways().get_status("project", "region", "vpnGateway") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewayGetStatuCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _vpn_gateway: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewayGetStatuCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewayGetStatuCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VpnGatewaysGetStatusResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.getStatus", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("vpnGateway", self._vpn_gateway.to_string())); + for &field in ["alt", "project", "region", "vpnGateway"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{vpnGateway}", "vpnGateway")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["vpnGateway", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewayGetStatuCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnGatewayGetStatuCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the VPN gateway to return. + /// + /// Sets the *vpn gateway* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn vpn_gateway(mut self, new_value: &str) -> VpnGatewayGetStatuCall<'a, C, A> { + self._vpn_gateway = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewayGetStatuCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewayGetStatuCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewayGetStatuCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of VPN gateways. +/// +/// A builder for the *aggregatedList* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.vpn_gateways().aggregated_list("project") +/// .page_token("eos") +/// .order_by("sadipscing") +/// .max_results(95) +/// .include_all_scopes(false) +/// .filter("duo") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewayAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewayAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewayAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VpnGatewayAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/vpnGateways"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewayAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> VpnGatewayAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> VpnGatewayAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> VpnGatewayAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> VpnGatewayAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> VpnGatewayAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewayAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewayAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewayAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a VPN gateway in the specified project and region using the data included in the request. +/// +/// A builder for the *insert* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::VpnGateway; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = VpnGateway::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.vpn_gateways().insert(req, "project", "region") +/// .request_id("erat") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewayInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: VpnGateway, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewayInsertCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewayInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/vpnGateways"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: VpnGateway) -> VpnGatewayInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewayInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnGatewayInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> VpnGatewayInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewayInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewayInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewayInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified VPN gateway. +/// +/// A builder for the *delete* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.vpn_gateways().delete("project", "region", "vpnGateway") +/// .request_id("magna") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewayDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _vpn_gateway: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewayDeleteCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewayDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("vpnGateway", self._vpn_gateway.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "vpnGateway", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/vpnGateways/{vpnGateway}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{vpnGateway}", "vpnGateway")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["vpnGateway", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewayDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnGatewayDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the VPN gateway to delete. + /// + /// Sets the *vpn gateway* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn vpn_gateway(mut self, new_value: &str) -> VpnGatewayDeleteCall<'a, C, A> { + self._vpn_gateway = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> VpnGatewayDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewayDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewayDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewayDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. +/// +/// A builder for the *get* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.vpn_gateways().get("project", "region", "vpnGateway") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewayGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _vpn_gateway: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewayGetCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewayGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VpnGateway)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("vpnGateway", self._vpn_gateway.to_string())); + for &field in ["alt", "project", "region", "vpnGateway"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/vpnGateways/{vpnGateway}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{vpnGateway}", "vpnGateway")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["vpnGateway", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewayGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnGatewayGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the VPN gateway to return. + /// + /// Sets the *vpn gateway* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn vpn_gateway(mut self, new_value: &str) -> VpnGatewayGetCall<'a, C, A> { + self._vpn_gateway = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewayGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewayGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewayGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. +/// +/// A builder for the *setLabels* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionSetLabelsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionSetLabelsRequest::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.vpn_gateways().set_labels(req, "project", "region", "resource") +/// .request_id("takimata") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewaySetLabelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionSetLabelsRequest, + _project: String, + _region: String, + _resource: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewaySetLabelCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewaySetLabelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.setLabels", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resource", self._resource.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "resource", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/vpnGateways/{resource}/setLabels"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resource", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionSetLabelsRequest) -> VpnGatewaySetLabelCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewaySetLabelCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnGatewaySetLabelCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> VpnGatewaySetLabelCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> VpnGatewaySetLabelCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewaySetLabelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewaySetLabelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewaySetLabelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// +/// A builder for the *testIamPermissions* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::TestPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestPermissionsRequest::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.vpn_gateways().test_iam_permissions(req, "project", "region", "resource") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewayTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TestPermissionsRequest, + _project: String, + _region: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewayTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewayTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestPermissionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "region", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resource", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestPermissionsRequest) -> VpnGatewayTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewayTestIamPermissionCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnGatewayTestIamPermissionCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> VpnGatewayTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewayTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewayTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewayTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of VPN gateways available to the specified project and region. +/// +/// A builder for the *list* method supported by a *vpnGateway* resource. +/// It is not used directly, but through a `VpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.vpn_gateways().list("project", "region") +/// .page_token("diam") +/// .order_by("ut") +/// .max_results(42) +/// .filter("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct VpnGatewayListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VpnGatewayListCall<'a, C, A> {} + +impl<'a, C, A> VpnGatewayListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, VpnGatewayList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.vpnGateways.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/vpnGateways"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> VpnGatewayListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> VpnGatewayListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> VpnGatewayListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> VpnGatewayListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> VpnGatewayListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> VpnGatewayListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> VpnGatewayListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> VpnGatewayListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VpnGatewayListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves all information of the specified resource policy. +/// +/// A builder for the *get* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.resource_policies().get("project", "region", "resourcePolicy") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _resource_policy: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicyGetCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ResourcePolicy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resourcePolicy", self._resource_policy.to_string())); + for &field in ["alt", "project", "region", "resourcePolicy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resourcePolicy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resourcePolicy}", "resourcePolicy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resourcePolicy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicyGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ResourcePolicyGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the resource policy to retrieve. + /// + /// Sets the *resource policy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource_policy(mut self, new_value: &str) -> ResourcePolicyGetCall<'a, C, A> { + self._resource_policy = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any existing policy. +/// +/// A builder for the *setIamPolicy* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionSetPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionSetPolicyRequest::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.resource_policies().set_iam_policy(req, "project", "region", "resource") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicySetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionSetPolicyRequest, + _project: String, + _region: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicySetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicySetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "region", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resource", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionSetPolicyRequest) -> ResourcePolicySetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ResourcePolicySetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicySetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicySetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicySetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new resource policy. +/// +/// A builder for the *insert* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ResourcePolicy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ResourcePolicy::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.resource_policies().insert(req, "project", "region") +/// .request_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicyInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ResourcePolicy, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicyInsertCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ResourcePolicy) -> ResourcePolicyInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicyInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ResourcePolicyInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ResourcePolicyInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicyInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicyInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// +/// A builder for the *testIamPermissions* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::TestPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestPermissionsRequest::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.resource_policies().test_iam_permissions(req, "project", "region", "resource") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicyTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TestPermissionsRequest, + _project: String, + _region: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicyTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestPermissionsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "region", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resource", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestPermissionsRequest) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicyTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicyTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// A list all the resource policies that have been configured for the specified project in specified region. +/// +/// A builder for the *list* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.resource_policies().list("project", "region") +/// .page_token("kasd") +/// .order_by("Stet") +/// .max_results(57) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicyListCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ResourcePolicyList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ResourcePolicyListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ResourcePolicyListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. May be empty if no such policy or resource exists. +/// +/// A builder for the *getIamPolicy* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.resource_policies().get_iam_policy("project", "region", "resource") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicyGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicyGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "project", "region", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resource", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name or id of the resource for this request. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicyGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicyGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified resource policy. +/// +/// A builder for the *delete* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.resource_policies().delete("project", "region", "resourcePolicy") +/// .request_id("labore") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _resource_policy: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicyDeleteCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("resourcePolicy", self._resource_policy.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "resourcePolicy", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/resourcePolicies/{resourcePolicy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{resourcePolicy}", "resourcePolicy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["resourcePolicy", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the resource policy to delete. + /// + /// Sets the *resource policy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource_policy(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { + self._resource_policy = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ResourcePolicyDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of resource policies. +/// +/// A builder for the *aggregatedList* method supported by a *resourcePolicy* resource. +/// It is not used directly, but through a `ResourcePolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.resource_policies().aggregated_list("project") +/// .page_token("ipsum") +/// .order_by("accusam") +/// .max_results(42) +/// .include_all_scopes(false) +/// .filter("amet.") +/// .doit(); +/// # } +/// ``` +pub struct ResourcePolicyAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourcePolicyAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> ResourcePolicyAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ResourcePolicyAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.resourcePolicies.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/resourcePolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ResourcePolicyAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> ResourcePolicyAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ResourcePolicyAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourcePolicyAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourcePolicyAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourcePolicyAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified commitment resource. Gets a list of available commitments by making a list() request. +/// +/// A builder for the *get* method supported by a *regionCommitment* resource. +/// It is not used directly, but through a `RegionCommitmentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_commitments().get("project", "region", "commitment") +/// .doit(); +/// # } +/// ``` +pub struct RegionCommitmentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _commitment: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionCommitmentGetCall<'a, C, A> {} + +impl<'a, C, A> RegionCommitmentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Commitment)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionCommitments.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("commitment", self._commitment.to_string())); + for &field in ["alt", "project", "region", "commitment"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/commitments/{commitment}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{commitment}", "commitment")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["commitment", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionCommitmentGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionCommitmentGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the commitment to return. + /// + /// Sets the *commitment* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn commitment(mut self, new_value: &str) -> RegionCommitmentGetCall<'a, C, A> { + self._commitment = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionCommitmentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionCommitmentGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a commitment in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *regionCommitment* resource. +/// It is not used directly, but through a `RegionCommitmentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Commitment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Commitment::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.region_commitments().insert(req, "project", "region") +/// .request_id("kasd") +/// .doit(); +/// # } +/// ``` +pub struct RegionCommitmentInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Commitment, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionCommitmentInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionCommitmentInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionCommitments.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/commitments"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Commitment) -> RegionCommitmentInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionCommitmentInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionCommitmentInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionCommitmentInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionCommitmentInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionCommitmentInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of commitments contained within the specified region. +/// +/// A builder for the *list* method supported by a *regionCommitment* resource. +/// It is not used directly, but through a `RegionCommitmentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_commitments().list("project", "region") +/// .page_token("gubergren") +/// .order_by("ut") +/// .max_results(68) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct RegionCommitmentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionCommitmentListCall<'a, C, A> {} + +impl<'a, C, A> RegionCommitmentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CommitmentList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionCommitments.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/commitments"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionCommitmentListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionCommitmentListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionCommitmentListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionCommitmentListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of commitments. +/// +/// A builder for the *aggregatedList* method supported by a *regionCommitment* resource. +/// It is not used directly, but through a `RegionCommitmentMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_commitments().aggregated_list("project") +/// .page_token("erat") +/// .order_by("et") +/// .max_results(36) +/// .include_all_scopes(true) +/// .filter("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct RegionCommitmentAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionCommitmentAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> RegionCommitmentAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CommitmentAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionCommitments.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/commitments"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionCommitmentAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> RegionCommitmentAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionCommitmentAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionCommitmentAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionCommitmentAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionCommitmentAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a target VPN gateway in the specified project and region using the data included in the request. +/// +/// A builder for the *insert* method supported by a *targetVpnGateway* resource. +/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::TargetVpnGateway; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TargetVpnGateway::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.target_vpn_gateways().insert(req, "project", "region") +/// .request_id("elitr") +/// .doit(); +/// # } +/// ``` +pub struct TargetVpnGatewayInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: TargetVpnGateway, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetVpnGatewayInsertCall<'a, C, A> {} + +impl<'a, C, A> TargetVpnGatewayInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetVpnGateways.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TargetVpnGateway) -> TargetVpnGatewayInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> TargetVpnGatewayInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of target VPN gateways. +/// +/// A builder for the *aggregatedList* method supported by a *targetVpnGateway* resource. +/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.target_vpn_gateways().aggregated_list("project") +/// .page_token("voluptua.") +/// .order_by("rebum.") +/// .max_results(56) +/// .include_all_scopes(false) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct TargetVpnGatewayAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetVpnGatewayAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> TargetVpnGatewayAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetVpnGatewayAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetVpnGateways.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/targetVpnGateways"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. +/// +/// A builder for the *get* method supported by a *targetVpnGateway* resource. +/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.target_vpn_gateways().get("project", "region", "targetVpnGateway") +/// .doit(); +/// # } +/// ``` +pub struct TargetVpnGatewayGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _target_vpn_gateway: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetVpnGatewayGetCall<'a, C, A> {} + +impl<'a, C, A> TargetVpnGatewayGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetVpnGateway)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetVpnGateways.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetVpnGateway", self._target_vpn_gateway.to_string())); + for &field in ["alt", "project", "region", "targetVpnGateway"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetVpnGateway}", "targetVpnGateway")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetVpnGateway", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetVpnGatewayGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> TargetVpnGatewayGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the target VPN gateway to return. + /// + /// Sets the *target vpn gateway* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_vpn_gateway(mut self, new_value: &str) -> TargetVpnGatewayGetCall<'a, C, A> { + self._target_vpn_gateway = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of target VPN gateways available to the specified project and region. +/// +/// A builder for the *list* method supported by a *targetVpnGateway* resource. +/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.target_vpn_gateways().list("project", "region") +/// .page_token("eos") +/// .order_by("sadipscing") +/// .max_results(63) +/// .filter("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct TargetVpnGatewayListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetVpnGatewayListCall<'a, C, A> {} + +impl<'a, C, A> TargetVpnGatewayListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetVpnGatewayList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetVpnGateways.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TargetVpnGatewayListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> TargetVpnGatewayListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified target VPN gateway. +/// +/// A builder for the *delete* method supported by a *targetVpnGateway* resource. +/// It is not used directly, but through a `TargetVpnGatewayMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.target_vpn_gateways().delete("project", "region", "targetVpnGateway") +/// .request_id("dolores") +/// .doit(); +/// # } +/// ``` +pub struct TargetVpnGatewayDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _target_vpn_gateway: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetVpnGatewayDeleteCall<'a, C, A> {} + +impl<'a, C, A> TargetVpnGatewayDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetVpnGateways.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("targetVpnGateway", self._target_vpn_gateway.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "targetVpnGateway", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{targetVpnGateway}", "targetVpnGateway")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["targetVpnGateway", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the target VPN gateway to delete. + /// + /// Sets the *target vpn gateway* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_vpn_gateway(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { + self._target_vpn_gateway = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> TargetVpnGatewayDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetVpnGatewayDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetVpnGatewayDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetVpnGatewayDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. +/// +/// A builder for the *listManagedInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_group_managers().list_managed_instances("project", "zone", "instanceGroupManager") +/// .page_token("ipsum") +/// .order_by("eirmod") +/// .max_results(16) +/// .filter("elitr") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerListManagedInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerListManagedInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerListManagedInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagersListManagedInstancesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.listManagedInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerListManagedInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. +/// +/// A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. +/// +/// A builder for the *insert* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManager; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.instance_group_managers().insert(req, "project", "zone") +/// .request_id("accusam") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManager, + _project: String, + _zone: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerInsertCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManager) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where you want to create the managed instance group. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of managed instance groups that are contained within the specified project and zone. +/// +/// A builder for the *list* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_group_managers().list("project", "zone") +/// .page_token("aliquyam") +/// .order_by("dolores") +/// .max_results(78) +/// .filter("amet") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerListCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagerList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of managed instance groups and groups them by zone. +/// +/// A builder for the *aggregatedList* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_group_managers().aggregated_list("project") +/// .page_token("nonumy") +/// .order_by("aliquyam") +/// .max_results(53) +/// .include_all_scopes(false) +/// .filter("sanctus") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagerAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/instanceGroupManagers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. +/// +/// A builder for the *get* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_group_managers().get("project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerGetCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManager)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerGetCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +/// +/// A builder for the *createInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersCreateInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersCreateInstancesRequest::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.instance_group_managers().create_instances(req, "project", "zone", "instanceGroupManager") +/// .request_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerCreateInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersCreateInstancesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerCreateInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerCreateInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.createInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersCreateInstancesRequest) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. It should conform to RFC1035. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. It should conform to RFC1035. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerCreateInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all errors thrown by actions on instances for a given managed instance group. +/// +/// A builder for the *listErrors* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_group_managers().list_errors("project", "zone", "instanceGroupManager") +/// .page_token("dolor") +/// .order_by("sit") +/// .max_results(73) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerListErrorCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerListErrorCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerListErrorCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroupManagersListErrorsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.listErrors", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listErrors"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. It should conform to RFC1035. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerListErrorCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerListErrorCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerListErrorCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. +/// +/// A builder for the *setInstanceTemplate* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersSetInstanceTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersSetInstanceTemplateRequest::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.instance_group_managers().set_instance_template(req, "project", "zone", "instanceGroupManager") +/// .request_id("takimata") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersSetInstanceTemplateRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.setInstanceTemplate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersSetInstanceTemplateRequest) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. +/// +/// A builder for the *setTargetPools* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersSetTargetPoolsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersSetTargetPoolsRequest::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.instance_group_managers().set_target_pools(req, "project", "zone", "instanceGroupManager") +/// .request_id("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerSetTargetPoolCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersSetTargetPoolsRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerSetTargetPoolCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerSetTargetPoolCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.setTargetPools", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersSetTargetPoolsRequest) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerSetTargetPoolCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManager; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManager::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.instance_group_managers().patch(req, "project", "zone", "instanceGroupManager") +/// .request_id("clita") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManager, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerPatchCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManager) -> InstanceGroupManagerPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where you want to create the managed instance group. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the instance group manager. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. +/// +/// When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: +/// +/// + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. +/// +/// This list is subject to change. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// A builder for the *resize* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_group_managers().resize("project", "zone", "instanceGroupManager", -62) +/// .request_id("duo") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerResizeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _size: i32, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerResizeCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerResizeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.resize", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + params.push(("size", self._size.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "size", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + /// + /// Sets the *size* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn size(mut self, new_value: i32) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._size = new_value; + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerResizeCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerResizeCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerResizeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// You can specify a maximum of 1000 instances with this method per request. +/// +/// A builder for the *abandonInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersAbandonInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersAbandonInstancesRequest::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.instance_group_managers().abandon_instances(req, "project", "zone", "instanceGroupManager") +/// .request_id("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerAbandonInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersAbandonInstancesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerAbandonInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerAbandonInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.abandonInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersAbandonInstancesRequest) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerAbandonInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// You can specify a maximum of 1000 instances with this method per request. +/// +/// A builder for the *deleteInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersDeleteInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersDeleteInstancesRequest::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.instance_group_managers().delete_instances(req, "project", "zone", "instanceGroupManager") +/// .request_id("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerDeleteInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersDeleteInstancesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerDeleteInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.deleteInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersDeleteInstancesRequest) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerDeleteInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. +/// +/// A builder for the *delete* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.instance_group_managers().delete("project", "zone", "instanceGroupManager") +/// .request_id("duo") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerDeleteCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group to delete. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. +/// +/// If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +/// +/// You can specify a maximum of 1000 instances with this method per request. +/// +/// A builder for the *recreateInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersRecreateInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersRecreateInstancesRequest::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.instance_group_managers().recreate_instances(req, "project", "zone", "instanceGroupManager") +/// .request_id("duo") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerRecreateInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersRecreateInstancesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerRecreateInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerRecreateInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.recreateInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "zone", "instanceGroupManager", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersRecreateInstancesRequest) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerRecreateInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. +/// +/// A builder for the *applyUpdatesToInstances* method supported by a *instanceGroupManager* resource. +/// It is not used directly, but through a `InstanceGroupManagerMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceGroupManagersApplyUpdatesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceGroupManagersApplyUpdatesRequest::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.instance_group_managers().apply_updates_to_instances(req, "project", "zone", "instanceGroupManager") +/// .doit(); +/// # } +/// ``` +pub struct InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceGroupManagersApplyUpdatesRequest, + _project: String, + _zone: String, + _instance_group_manager: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> {} + +impl<'a, C, A> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.instanceGroupManagers.applyUpdatesToInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("instanceGroupManager", self._instance_group_manager.to_string())); + for &field in ["alt", "project", "zone", "instanceGroupManager"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{instanceGroupManager}", "instanceGroupManager")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroupManager", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceGroupManagersApplyUpdatesRequest) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone where the managed instance group is located. Should conform to RFC1035. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the managed instance group, should conform to RFC1035. + /// + /// Sets the *instance group manager* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group_manager(mut self, new_value: &str) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._instance_group_manager = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstanceGroupManagerApplyUpdatesToInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an aggregated list of accelerator types. +/// +/// A builder for the *aggregatedList* method supported by a *acceleratorType* resource. +/// It is not used directly, but through a `AcceleratorTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.accelerator_types().aggregated_list("project") +/// .page_token("magna") +/// .order_by("ipsum") +/// .max_results(8) +/// .include_all_scopes(false) +/// .filter("eos") +/// .doit(); +/// # } +/// ``` +pub struct AcceleratorTypeAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AcceleratorTypeAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> AcceleratorTypeAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AcceleratorTypeAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.acceleratorTypes.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/acceleratorTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AcceleratorTypeAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AcceleratorTypeAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AcceleratorTypeAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves a list of accelerator types available to the specified project. +/// +/// A builder for the *list* method supported by a *acceleratorType* resource. +/// It is not used directly, but through a `AcceleratorTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.accelerator_types().list("project", "zone") +/// .page_token("sanctus") +/// .order_by("est") +/// .max_results(91) +/// .filter("est") +/// .doit(); +/// # } +/// ``` +pub struct AcceleratorTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AcceleratorTypeListCall<'a, C, A> {} + +impl<'a, C, A> AcceleratorTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AcceleratorTypeList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.acceleratorTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/acceleratorTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> AcceleratorTypeListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> AcceleratorTypeListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AcceleratorTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AcceleratorTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AcceleratorTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified accelerator type. +/// +/// A builder for the *get* method supported by a *acceleratorType* resource. +/// It is not used directly, but through a `AcceleratorTypeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.accelerator_types().get("project", "zone", "acceleratorType") +/// .doit(); +/// # } +/// ``` +pub struct AcceleratorTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _accelerator_type: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AcceleratorTypeGetCall<'a, C, A> {} + +impl<'a, C, A> AcceleratorTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AcceleratorType)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.acceleratorTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("acceleratorType", self._accelerator_type.to_string())); + for &field in ["alt", "project", "zone", "acceleratorType"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{acceleratorType}", "acceleratorType")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["acceleratorType", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> AcceleratorTypeGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> AcceleratorTypeGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the accelerator type to return. + /// + /// Sets the *accelerator type* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn accelerator_type(mut self, new_value: &str) -> AcceleratorTypeGetCall<'a, C, A> { + self._accelerator_type = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AcceleratorTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AcceleratorTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AcceleratorTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Detach the network endpoint from the specified network endpoint group. +/// +/// A builder for the *detachNetworkEndpoints* method supported by a *globalNetworkEndpointGroup* resource. +/// It is not used directly, but through a `GlobalNetworkEndpointGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::GlobalNetworkEndpointGroupsDetachEndpointsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GlobalNetworkEndpointGroupsDetachEndpointsRequest::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.global_network_endpoint_groups().detach_network_endpoints(req, "project", "networkEndpointGroup") +/// .request_id("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: GlobalNetworkEndpointGroupsDetachEndpointsRequest, + _project: String, + _network_endpoint_group: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalNetworkEndpointGroups.detachNetworkEndpoints", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("networkEndpointGroup", self._network_endpoint_group.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "networkEndpointGroup", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{networkEndpointGroup}", "networkEndpointGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["networkEndpointGroup", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GlobalNetworkEndpointGroupsDetachEndpointsRequest) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + /// + /// Sets the *network endpoint group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network_endpoint_group(mut self, new_value: &str) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> { + self._network_endpoint_group = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalNetworkEndpointGroupDetachNetworkEndpointCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a network endpoint group in the specified project using the parameters that are included in the request. +/// +/// A builder for the *insert* method supported by a *globalNetworkEndpointGroup* resource. +/// It is not used directly, but through a `GlobalNetworkEndpointGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::NetworkEndpointGroup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = NetworkEndpointGroup::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.global_network_endpoint_groups().insert(req, "project") +/// .request_id("et") +/// .doit(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: NetworkEndpointGroup, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalNetworkEndpointGroupInsertCall<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalNetworkEndpointGroups.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networkEndpointGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: NetworkEndpointGroup) -> GlobalNetworkEndpointGroupInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalNetworkEndpointGroupInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> GlobalNetworkEndpointGroupInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalNetworkEndpointGroupInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalNetworkEndpointGroupInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalNetworkEndpointGroupInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the network endpoints in the specified network endpoint group. +/// +/// A builder for the *listNetworkEndpoints* method supported by a *globalNetworkEndpointGroup* resource. +/// It is not used directly, but through a `GlobalNetworkEndpointGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_network_endpoint_groups().list_network_endpoints("project", "networkEndpointGroup") +/// .page_token("sit") +/// .order_by("duo") +/// .max_results(97) +/// .filter("dolor") +/// .doit(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _network_endpoint_group: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NetworkEndpointGroupsListNetworkEndpoints)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalNetworkEndpointGroups.listNetworkEndpoints", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("networkEndpointGroup", self._network_endpoint_group.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "networkEndpointGroup", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{networkEndpointGroup}", "networkEndpointGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["networkEndpointGroup", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + /// + /// Sets the *network endpoint group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network_endpoint_group(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + self._network_endpoint_group = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalNetworkEndpointGroupListNetworkEndpointCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Attach a network endpoint to the specified network endpoint group. +/// +/// A builder for the *attachNetworkEndpoints* method supported by a *globalNetworkEndpointGroup* resource. +/// It is not used directly, but through a `GlobalNetworkEndpointGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::GlobalNetworkEndpointGroupsAttachEndpointsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GlobalNetworkEndpointGroupsAttachEndpointsRequest::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.global_network_endpoint_groups().attach_network_endpoints(req, "project", "networkEndpointGroup") +/// .request_id("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: GlobalNetworkEndpointGroupsAttachEndpointsRequest, + _project: String, + _network_endpoint_group: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalNetworkEndpointGroups.attachNetworkEndpoints", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("networkEndpointGroup", self._network_endpoint_group.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "networkEndpointGroup", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{networkEndpointGroup}", "networkEndpointGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["networkEndpointGroup", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GlobalNetworkEndpointGroupsAttachEndpointsRequest) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + /// + /// Sets the *network endpoint group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network_endpoint_group(mut self, new_value: &str) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> { + self._network_endpoint_group = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalNetworkEndpointGroupAttachNetworkEndpointCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. +/// +/// A builder for the *delete* method supported by a *globalNetworkEndpointGroup* resource. +/// It is not used directly, but through a `GlobalNetworkEndpointGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_network_endpoint_groups().delete("project", "networkEndpointGroup") +/// .request_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _network_endpoint_group: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalNetworkEndpointGroupDeleteCall<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalNetworkEndpointGroups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("networkEndpointGroup", self._network_endpoint_group.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "networkEndpointGroup", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networkEndpointGroups/{networkEndpointGroup}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{networkEndpointGroup}", "networkEndpointGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["networkEndpointGroup", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the network endpoint group to delete. It should comply with RFC1035. + /// + /// Sets the *network endpoint group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network_endpoint_group(mut self, new_value: &str) -> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> { + self._network_endpoint_group = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalNetworkEndpointGroupDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of network endpoint groups that are located in the specified project. +/// +/// A builder for the *list* method supported by a *globalNetworkEndpointGroup* resource. +/// It is not used directly, but through a `GlobalNetworkEndpointGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_network_endpoint_groups().list("project") +/// .page_token("consetetur") +/// .order_by("kasd") +/// .max_results(29) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalNetworkEndpointGroupListCall<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NetworkEndpointGroupList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalNetworkEndpointGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networkEndpointGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> GlobalNetworkEndpointGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> GlobalNetworkEndpointGroupListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalNetworkEndpointGroupListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalNetworkEndpointGroupListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalNetworkEndpointGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. +/// +/// A builder for the *get* method supported by a *globalNetworkEndpointGroup* resource. +/// It is not used directly, but through a `GlobalNetworkEndpointGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.global_network_endpoint_groups().get("project", "networkEndpointGroup") +/// .doit(); +/// # } +/// ``` +pub struct GlobalNetworkEndpointGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _network_endpoint_group: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for GlobalNetworkEndpointGroupGetCall<'a, C, A> {} + +impl<'a, C, A> GlobalNetworkEndpointGroupGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NetworkEndpointGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.globalNetworkEndpointGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("networkEndpointGroup", self._network_endpoint_group.to_string())); + for &field in ["alt", "project", "networkEndpointGroup"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/networkEndpointGroups/{networkEndpointGroup}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{networkEndpointGroup}", "networkEndpointGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["networkEndpointGroup", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> GlobalNetworkEndpointGroupGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the network endpoint group. It should comply with RFC1035. + /// + /// Sets the *network endpoint group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn network_endpoint_group(mut self, new_value: &str) -> GlobalNetworkEndpointGroupGetCall<'a, C, A> { + self._network_endpoint_group = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> GlobalNetworkEndpointGroupGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> GlobalNetworkEndpointGroupGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> GlobalNetworkEndpointGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all shared VPC host projects visible to the user in an organization. +/// +/// A builder for the *listXpnHosts* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ProjectsListXpnHostsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsListXpnHostsRequest::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().list_xpn_hosts(req, "project") +/// .page_token("amet") +/// .order_by("sit") +/// .max_results(77) +/// .filter("At") +/// .doit(); +/// # } +/// ``` +pub struct ProjectListXpnHostCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ProjectsListXpnHostsRequest, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectListXpnHostCall<'a, C, A> {} + +impl<'a, C, A> ProjectListXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, XpnHostList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.listXpnHosts", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/listXpnHosts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ProjectsListXpnHostsRequest) -> ProjectListXpnHostCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ProjectListXpnHostCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectListXpnHostCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectListXpnHostCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectListXpnHostCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectListXpnHostCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Disable this project as a shared VPC host project. +/// +/// A builder for the *disableXpnHost* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().disable_xpn_host("project") +/// .request_id("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDisableXpnHostCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDisableXpnHostCall<'a, C, A> {} + +impl<'a, C, A> ProjectDisableXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.disableXpnHost", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/disableXpnHost"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectDisableXpnHostCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectDisableXpnHostCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDisableXpnHostCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectDisableXpnHostCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDisableXpnHostCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Moves an instance and its attached persistent disks from one zone to another. +/// +/// A builder for the *moveInstance* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::InstanceMoveRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InstanceMoveRequest::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().move_instance(req, "project") +/// .request_id("voluptua.") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMoveInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: InstanceMoveRequest, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMoveInstanceCall<'a, C, A> {} + +impl<'a, C, A> ProjectMoveInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.moveInstance", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/moveInstance"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InstanceMoveRequest) -> ProjectMoveInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectMoveInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectMoveInstanceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectMoveInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectMoveInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectMoveInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. +/// +/// A builder for the *setUsageExportBucket* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::UsageExportLocation; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UsageExportLocation::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().set_usage_export_bucket(req, "project") +/// .request_id("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSetUsageExportBucketCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: UsageExportLocation, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSetUsageExportBucketCall<'a, C, A> {} + +impl<'a, C, A> ProjectSetUsageExportBucketCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.setUsageExportBucket", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/setUsageExportBucket"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UsageExportLocation) -> ProjectSetUsageExportBucketCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectSetUsageExportBucketCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectSetUsageExportBucketCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetUsageExportBucketCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectSetUsageExportBucketCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSetUsageExportBucketCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Enable this project as a shared VPC host project. +/// +/// A builder for the *enableXpnHost* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().enable_xpn_host("project") +/// .request_id("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct ProjectEnableXpnHostCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectEnableXpnHostCall<'a, C, A> {} + +impl<'a, C, A> ProjectEnableXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.enableXpnHost", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/enableXpnHost"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectEnableXpnHostCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectEnableXpnHostCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectEnableXpnHostCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectEnableXpnHostCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectEnableXpnHostCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets metadata common to all instances within the specified project using the data included in the request. +/// +/// A builder for the *setCommonInstanceMetadata* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::Metadata; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Metadata::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().set_common_instance_metadata(req, "project") +/// .request_id("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSetCommonInstanceMetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: Metadata, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSetCommonInstanceMetadataCall<'a, C, A> {} + +impl<'a, C, A> ProjectSetCommonInstanceMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.setCommonInstanceMetadata", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/setCommonInstanceMetadata"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Metadata) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSetCommonInstanceMetadataCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Disable a service resource (also known as service project) associated with this host project. +/// +/// A builder for the *disableXpnResource* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ProjectsDisableXpnResourceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsDisableXpnResourceRequest::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().disable_xpn_resource(req, "project") +/// .request_id("duo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDisableXpnResourceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ProjectsDisableXpnResourceRequest, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDisableXpnResourceCall<'a, C, A> {} + +impl<'a, C, A> ProjectDisableXpnResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.disableXpnResource", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/disableXpnResource"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ProjectsDisableXpnResourceRequest) -> ProjectDisableXpnResourceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectDisableXpnResourceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectDisableXpnResourceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDisableXpnResourceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectDisableXpnResourceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDisableXpnResourceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the shared VPC host project that this project links to. May be empty if no link exists. +/// +/// A builder for the *getXpnHost* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().get_xpn_host("project") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetXpnHostCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetXpnHostCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetXpnHostCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Project)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.getXpnHost", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + for &field in ["alt", "project"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/getXpnHost"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectGetXpnHostCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetXpnHostCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectGetXpnHostCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetXpnHostCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified Project resource. +/// +/// A builder for the *get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().get("project") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Project)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + for &field in ["alt", "project"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. +/// +/// A builder for the *enableXpnResource* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ProjectsEnableXpnResourceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsEnableXpnResourceRequest::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().enable_xpn_resource(req, "project") +/// .request_id("takimata") +/// .doit(); +/// # } +/// ``` +pub struct ProjectEnableXpnResourceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ProjectsEnableXpnResourceRequest, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectEnableXpnResourceCall<'a, C, A> {} + +impl<'a, C, A> ProjectEnableXpnResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.enableXpnResource", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/enableXpnResource"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ProjectsEnableXpnResourceRequest) -> ProjectEnableXpnResourceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectEnableXpnResourceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectEnableXpnResourceCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectEnableXpnResourceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectEnableXpnResourceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectEnableXpnResourceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. +/// +/// A builder for the *setDefaultNetworkTier* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::ProjectsSetDefaultNetworkTierRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ProjectsSetDefaultNetworkTierRequest::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().set_default_network_tier(req, "project") +/// .request_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSetDefaultNetworkTierCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: ProjectsSetDefaultNetworkTierRequest, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSetDefaultNetworkTierCall<'a, C, A> {} + +impl<'a, C, A> ProjectSetDefaultNetworkTierCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.setDefaultNetworkTier", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/setDefaultNetworkTier"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ProjectsSetDefaultNetworkTierRequest) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetDefaultNetworkTierCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectSetDefaultNetworkTierCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSetDefaultNetworkTierCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets service resources (a.k.a service project) associated with this host project. +/// +/// A builder for the *getXpnResources* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().get_xpn_resources("project") +/// .page_token("sanctus") +/// .order_by("justo") +/// .max_results(94) +/// .filter("eos") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetXpnResourceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetXpnResourceCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetXpnResourceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ProjectsGetXpnResources)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.getXpnResources", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/getXpnResources"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ProjectGetXpnResourceCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectGetXpnResourceCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetXpnResourceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectGetXpnResourceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetXpnResourceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Moves a persistent disk from one zone to another. +/// +/// A builder for the *moveDisk* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::DiskMoveRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DiskMoveRequest::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().move_disk(req, "project") +/// .request_id("sea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMoveDiskCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: DiskMoveRequest, + _project: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMoveDiskCall<'a, C, A> {} + +impl<'a, C, A> ProjectMoveDiskCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.projects.moveDisk", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/moveDisk"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DiskMoveRequest) -> ProjectMoveDiskCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectMoveDiskCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> ProjectMoveDiskCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectMoveDiskCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectMoveDiskCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectMoveDiskCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified Zone resource. Gets a list of available zones by making a list() request. +/// +/// A builder for the *get* method supported by a *zone* resource. +/// It is not used directly, but through a `ZoneMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.zones().get("project", "zone") +/// .doit(); +/// # } +/// ``` +pub struct ZoneGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ZoneGetCall<'a, C, A> {} + +impl<'a, C, A> ZoneGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Zone)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.zones.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + for &field in ["alt", "project", "zone"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ZoneGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone resource to return. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ZoneGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ZoneGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ZoneGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ZoneGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of Zone resources available to the specified project. +/// +/// A builder for the *list* method supported by a *zone* resource. +/// It is not used directly, but through a `ZoneMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.zones().list("project") +/// .page_token("dolor") +/// .order_by("gubergren") +/// .max_results(75) +/// .filter("labore") +/// .doit(); +/// # } +/// ``` +pub struct ZoneListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ZoneListCall<'a, C, A> {} + +impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ZoneList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.zones.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ZoneListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ZoneListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ZoneListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ZoneListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ZoneListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a HttpHealthCheck resource in the specified project using the data included in the request. /// /// A builder for the *insert* method supported by a *httpHealthCheck* resource. @@ -136737,7 +162038,7 @@ impl<'a, C, A> RegionDiskResizeCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.http_health_checks().insert(req, "project") -/// .request_id("ut") +/// .request_id("tempor") /// .doit(); /// # } /// ``` @@ -136990,304 +162291,6 @@ impl<'a, C, A> HttpHealthCheckInsertCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.http_health_checks().list("project") -/// .page_token("Stet") -/// .order_by("et") -/// .max_results(96) -/// .filter("dolor") -/// .doit(); -/// # } -/// ``` -pub struct HttpHealthCheckListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for HttpHealthCheckListCall<'a, C, A> {} - -impl<'a, C, A> HttpHealthCheckListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpHealthCheckList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.httpHealthChecks.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/httpHealthChecks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> HttpHealthCheckListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HttpHealthCheckListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> HttpHealthCheckListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> HttpHealthCheckListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. /// /// A builder for the *patch* method supported by a *httpHealthCheck* resource. @@ -137322,7 +162325,7 @@ impl<'a, C, A> HttpHealthCheckListCall<'a, C, A> where C: BorrowMut HttpHealthCheckPatchCall<'a, C, A> where C: BorrowMut HttpHealthCheckDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.http_health_checks().list("project") +/// .page_token("et") +/// .order_by("sed") +/// .max_results(68) +/// .filter("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct HttpHealthCheckListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for HttpHealthCheckListCall<'a, C, A> {} + +impl<'a, C, A> HttpHealthCheckListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpHealthCheckList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.httpHealthChecks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/httpHealthChecks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> HttpHealthCheckListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> HttpHealthCheckListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> HttpHealthCheckListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> HttpHealthCheckListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> HttpHealthCheckListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request. /// /// A builder for the *get* method supported by a *httpHealthCheck* resource. @@ -138141,7 +163442,7 @@ impl<'a, C, A> HttpHealthCheckGetCall<'a, C, A> where C: BorrowMut HttpHealthCheckUpdateCall<'a, C, A> where C: BorrowMut DiskSetIamPolicyCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.disks().create_snapshot(req, "project", "zone", "disk") -/// .request_id("elitr") -/// .guest_flush(true) +/// .request_id("tempor") +/// .guest_flush(false) /// .doit(); /// # } /// ``` @@ -139304,6 +164605,316 @@ impl<'a, C, A> DiskCreateSnapshotCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.disks().list("project", "zone") +/// .page_token("dolores") +/// .order_by("diam") +/// .max_results(98) +/// .filter("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct DiskListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DiskListCall<'a, C, A> {} + +impl<'a, C, A> DiskListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DiskList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.disks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/disks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> DiskListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> DiskListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> DiskListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> DiskListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> DiskListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> DiskListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DiskListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DiskListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DiskListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns permissions that a caller has on the specified resource. /// /// A builder for the *testIamPermissions* method supported by a *disk* resource. @@ -139627,10 +165238,11 @@ impl<'a, C, A> DiskTestIamPermissionCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -139664,7 +165277,7 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -139675,10 +165288,13 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut DiskAggregatedListCall<'a, C, A> where C: BorrowMut DiskAggregatedListCall<'a, C, A> { @@ -139809,29 +165425,36 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut DiskAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DiskAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> DiskAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> DiskAggregatedListCall<'a, C, A> { @@ -139897,316 +165520,6 @@ impl<'a, C, A> DiskAggregatedListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.disks().list("project", "zone") -/// .page_token("eos") -/// .order_by("sadipscing") -/// .max_results(95) -/// .filter("Stet") -/// .doit(); -/// # } -/// ``` -pub struct DiskListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _zone: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DiskListCall<'a, C, A> {} - -impl<'a, C, A> DiskListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DiskList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.disks.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "zone", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/disks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> DiskListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// The name of the zone for this request. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> DiskListCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> DiskListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> DiskListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> DiskListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> DiskListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DiskListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DiskListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DiskListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. /// /// A builder for the *setLabels* method supported by a *disk* resource. @@ -140241,7 +165554,7 @@ impl<'a, C, A> DiskListCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.disks().set_labels(req, "project", "zone", "resource") -/// .request_id("erat") +/// .request_id("consetetur") /// .doit(); /// # } /// ``` @@ -140552,7 +165865,7 @@ impl<'a, C, A> DiskSetLabelCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.disks().resize(req, "project", "zone", "disk") -/// .request_id("magna") +/// .request_id("gubergren") /// .doit(); /// # } /// ``` @@ -140863,8 +166176,8 @@ impl<'a, C, A> DiskResizeCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.disks().insert(req, "project", "zone") -/// .source_image("duo") -/// .request_id("vero") +/// .source_image("sadipscing") +/// .request_id("clita") /// .doit(); /// # } /// ``` @@ -141404,6 +166717,270 @@ impl<'a, C, A> DiskGetIamPolicyCall<'a, C, A> where C: BorrowMut, } +/// Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. +/// +/// A builder for the *get* method supported by a *disk* resource. +/// It is not used directly, but through a `DiskMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.disks().get("project", "zone", "disk") +/// .doit(); +/// # } +/// ``` +pub struct DiskGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _disk: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DiskGetCall<'a, C, A> {} + +impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Disk)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.disks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("disk", self._disk.to_string())); + for &field in ["alt", "project", "zone", "disk"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/disks/{disk}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{disk}", "disk")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["disk", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// The name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the persistent disk to return. + /// + /// Sets the *disk* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn disk(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { + self._disk = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DiskGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DiskGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DiskGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Removes resource policies from a disk. /// /// A builder for the *removeResourcePolicies* method supported by a *disk* resource. @@ -141438,7 +167015,7 @@ impl<'a, C, A> DiskGetIamPolicyCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.disks().remove_resource_policies(req, "project", "zone", "disk") -/// .request_id("magna") +/// .request_id("voluptua.") /// .doit(); /// # } /// ``` @@ -141749,7 +167326,7 @@ impl<'a, C, A> DiskRemoveResourcePolicyCall<'a, C, A> where C: BorrowMut DiskAddResourcePolicyCall<'a, C, A> where C: BorrowMut DiskAddResourcePolicyCall<'a, C, A> where C: BorrowMut +pub struct TargetHttpProxyDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Compute, _project: String, - _zone: String, - _disk: String, + _target_http_proxy: String, + _request_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for DiskGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for TargetHttpProxyDeleteCall<'a, C, A> {} -impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> TargetHttpProxyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Disk)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -142083,13 +167661,15 @@ impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "compute.disks.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "compute.targetHttpProxies.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("zone", self._zone.to_string())); - params.push(("disk", self._disk.to_string())); - for &field in ["alt", "project", "zone", "disk"].iter() { + params.push(("targetHttpProxy", self._target_http_proxy.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "targetHttpProxy", "requestId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -142101,12 +167681,12 @@ impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/disks/{disk}"; + let mut url = self.hub._base_url.clone() + "{project}/global/targetHttpProxies/{targetHttpProxy}"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{disk}", "disk")].iter() { + for &(find_this, param_name) in [("{project}", "project"), ("{targetHttpProxy}", "targetHttpProxy")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -142117,8 +167697,294 @@ impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["disk", "zone", "project"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["targetHttpProxy", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> TargetHttpProxyDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the TargetHttpProxy resource to delete. + /// + /// Sets the *target http proxy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_http_proxy(mut self, new_value: &str) -> TargetHttpProxyDeleteCall<'a, C, A> { + self._target_http_proxy = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> TargetHttpProxyDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetHttpProxyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TargetHttpProxyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TargetHttpProxyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. +/// +/// A builder for the *aggregatedList* method supported by a *targetHttpProxy* resource. +/// It is not used directly, but through a `TargetHttpProxyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.target_http_proxies().aggregated_list("project") +/// .page_token("sadipscing") +/// .order_by("Stet") +/// .max_results(71) +/// .include_all_scopes(false) +/// .filter("ea") +/// .doit(); +/// # } +/// ``` +pub struct TargetHttpProxyAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TargetHttpProxyAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> TargetHttpProxyAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TargetHttpProxyAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.targetHttpProxies.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/targetHttpProxies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -142201,34 +168067,59 @@ impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth } - /// Project ID for this request. + /// Name of the project scoping this request. /// /// Sets the *project* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> TargetHttpProxyAggregatedListCall<'a, C, A> { self._project = new_value.to_string(); self } - /// The name of the zone for this request. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { - self._zone = new_value.to_string(); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TargetHttpProxyAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); self } - /// Name of the persistent disk to return. + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// - /// Sets the *disk* path property to the given value. + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> TargetHttpProxyAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn disk(mut self, new_value: &str) -> DiskGetCall<'a, C, A> { - self._disk = new_value.to_string(); + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> TargetHttpProxyAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> TargetHttpProxyAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> TargetHttpProxyAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -142237,7 +168128,7 @@ impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DiskGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetHttpProxyAggregatedListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -142258,7 +168149,7 @@ impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DiskGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> TargetHttpProxyAggregatedListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -142278,7 +168169,7 @@ impl<'a, C, A> DiskGetCall<'a, C, A> where C: BorrowMut, A: oauth /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DiskGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> TargetHttpProxyAggregatedListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -142542,274 +168433,6 @@ impl<'a, C, A> TargetHttpProxyGetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.target_http_proxies().delete("project", "targetHttpProxy") -/// .request_id("amet") -/// .doit(); -/// # } -/// ``` -pub struct TargetHttpProxyDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _target_http_proxy: String, - _request_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TargetHttpProxyDeleteCall<'a, C, A> {} - -impl<'a, C, A> TargetHttpProxyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.targetHttpProxies.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - params.push(("targetHttpProxy", self._target_http_proxy.to_string())); - if let Some(value) = self._request_id { - params.push(("requestId", value.to_string())); - } - for &field in ["alt", "project", "targetHttpProxy", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/targetHttpProxies/{targetHttpProxy}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project"), ("{targetHttpProxy}", "targetHttpProxy")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["targetHttpProxy", "project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> TargetHttpProxyDeleteCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Name of the TargetHttpProxy resource to delete. - /// - /// Sets the *target http proxy* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn target_http_proxy(mut self, new_value: &str) -> TargetHttpProxyDeleteCall<'a, C, A> { - self._target_http_proxy = new_value.to_string(); - self - } - /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. - /// - /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. - /// - /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - /// - /// Sets the *request id* query property to the given value. - pub fn request_id(mut self, new_value: &str) -> TargetHttpProxyDeleteCall<'a, C, A> { - self._request_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TargetHttpProxyDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TargetHttpProxyDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TargetHttpProxyDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Changes the URL map for TargetHttpProxy. /// /// A builder for the *setUrlMap* method supported by a *targetHttpProxy* resource. @@ -142844,7 +168467,7 @@ impl<'a, C, A> TargetHttpProxyDeleteCall<'a, C, A> where C: BorrowMut TargetHttpProxySetUrlMapCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> { @@ -143319,29 +168942,29 @@ impl<'a, C, A> TargetHttpProxyListCall<'a, C, A> where C: BorrowMut TargetHttpProxyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TargetHttpProxyListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TargetHttpProxyListCall<'a, C, A> { @@ -143441,7 +169064,7 @@ impl<'a, C, A> TargetHttpProxyListCall<'a, C, A> where C: BorrowMut TargetHttpProxyInsertCall<'a, C, A> where C: BorrowMut SslCertificateDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.ssl_certificates().aggregated_list("project") +/// .page_token("et") +/// .order_by("sanctus") +/// .max_results(86) +/// .include_all_scopes(true) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct SslCertificateAggregatedListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _include_all_scopes: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SslCertificateAggregatedListCall<'a, C, A> {} + +impl<'a, C, A> SslCertificateAggregatedListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SslCertificateAggregatedList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.sslCertificates.aggregatedList", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._include_all_scopes { + params.push(("includeAllScopes", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "includeAllScopes", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/aggregated/sslCertificates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the project scoping this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> SslCertificateAggregatedListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SslCertificateAggregatedListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> SslCertificateAggregatedListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> SslCertificateAggregatedListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> SslCertificateAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> SslCertificateAggregatedListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SslCertificateAggregatedListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SslCertificateAggregatedListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SslCertificateAggregatedListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves the list of SslCertificate resources available to the specified project. /// /// A builder for the *list* method supported by a *sslCertificate* resource. @@ -143990,10 +169923,10 @@ impl<'a, C, A> SslCertificateDeleteCall<'a, C, A> where C: BorrowMut SslCertificateListCall<'a, C, A> where C: BorrowMut SslCertificateListCall<'a, C, A> { @@ -144172,29 +170105,29 @@ impl<'a, C, A> SslCertificateListCall<'a, C, A> where C: BorrowMut SslCertificateListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> SslCertificateListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> SslCertificateListCall<'a, C, A> { @@ -144294,7 +170227,7 @@ impl<'a, C, A> SslCertificateListCall<'a, C, A> where C: BorrowMut SslCertificateGetCall<'a, C, A> where C: BorrowMut } +/// Updates a HealthCheck resource in the specified project using the data included in the request. +/// +/// A builder for the *update* method supported by a *regionHealthCheck* resource. +/// It is not used directly, but through a `RegionHealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::HealthCheck; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.region_health_checks().update(req, "project", "region", "healthCheck") +/// .request_id("dolore") +/// .doit(); +/// # } +/// ``` +pub struct RegionHealthCheckUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: HealthCheck, + _project: String, + _region: String, + _health_check: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionHealthCheckUpdateCall<'a, C, A> {} + +impl<'a, C, A> RegionHealthCheckUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionHealthChecks.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "healthCheck", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["healthCheck", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HealthCheck) -> RegionHealthCheckUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionHealthCheckUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionHealthCheckUpdateCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to update. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> RegionHealthCheckUpdateCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionHealthCheckUpdateCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionHealthCheckUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionHealthCheckUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionHealthCheckUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the list of HealthCheck resources available to the specified project. +/// +/// A builder for the *list* method supported by a *regionHealthCheck* resource. +/// It is not used directly, but through a `RegionHealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_health_checks().list("project", "region") +/// .page_token("clita") +/// .order_by("sanctus") +/// .max_results(81) +/// .filter("At") +/// .doit(); +/// # } +/// ``` +pub struct RegionHealthCheckListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionHealthCheckListCall<'a, C, A> {} + +impl<'a, C, A> RegionHealthCheckListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HealthCheckList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionHealthChecks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/healthChecks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionHealthCheckListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionHealthCheckListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionHealthCheckListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionHealthCheckListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionHealthCheckListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionHealthCheckListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionHealthCheckListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionHealthCheckListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionHealthCheckListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. +/// +/// A builder for the *get* method supported by a *regionHealthCheck* resource. +/// It is not used directly, but through a `RegionHealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_health_checks().get("project", "region", "healthCheck") +/// .doit(); +/// # } +/// ``` +pub struct RegionHealthCheckGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _health_check: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionHealthCheckGetCall<'a, C, A> {} + +impl<'a, C, A> RegionHealthCheckGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HealthCheck)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionHealthChecks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + for &field in ["alt", "project", "region", "healthCheck"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["healthCheck", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionHealthCheckGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionHealthCheckGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to return. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> RegionHealthCheckGetCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionHealthCheckGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionHealthCheckGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionHealthCheckGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified HealthCheck resource. +/// +/// A builder for the *delete* method supported by a *regionHealthCheck* resource. +/// It is not used directly, but through a `RegionHealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_health_checks().delete("project", "region", "healthCheck") +/// .request_id("magna") +/// .doit(); +/// # } +/// ``` +pub struct RegionHealthCheckDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _health_check: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionHealthCheckDeleteCall<'a, C, A> {} + +impl<'a, C, A> RegionHealthCheckDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionHealthChecks.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "healthCheck", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["healthCheck", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionHealthCheckDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionHealthCheckDeleteCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to delete. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> RegionHealthCheckDeleteCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionHealthCheckDeleteCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionHealthCheckDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionHealthCheckDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionHealthCheckDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +/// +/// A builder for the *patch* method supported by a *regionHealthCheck* resource. +/// It is not used directly, but through a `RegionHealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::HealthCheck; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.region_health_checks().patch(req, "project", "region", "healthCheck") +/// .request_id("sed") +/// .doit(); +/// # } +/// ``` +pub struct RegionHealthCheckPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: HealthCheck, + _project: String, + _region: String, + _health_check: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionHealthCheckPatchCall<'a, C, A> {} + +impl<'a, C, A> RegionHealthCheckPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionHealthChecks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("healthCheck", self._health_check.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "healthCheck", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/healthChecks/{healthCheck}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{healthCheck}", "healthCheck")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["healthCheck", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HealthCheck) -> RegionHealthCheckPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionHealthCheckPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionHealthCheckPatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the HealthCheck resource to patch. + /// + /// Sets the *health check* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn health_check(mut self, new_value: &str) -> RegionHealthCheckPatchCall<'a, C, A> { + self._health_check = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionHealthCheckPatchCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionHealthCheckPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionHealthCheckPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionHealthCheckPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a HealthCheck resource in the specified project using the data included in the request. +/// +/// A builder for the *insert* method supported by a *regionHealthCheck* resource. +/// It is not used directly, but through a `RegionHealthCheckMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::HealthCheck; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HealthCheck::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.region_health_checks().insert(req, "project", "region") +/// .request_id("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct RegionHealthCheckInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: HealthCheck, + _project: String, + _region: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionHealthCheckInsertCall<'a, C, A> {} + +impl<'a, C, A> RegionHealthCheckInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionHealthChecks.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/healthChecks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HealthCheck) -> RegionHealthCheckInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionHealthCheckInsertCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionHealthCheckInsertCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionHealthCheckInsertCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionHealthCheckInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionHealthCheckInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionHealthCheckInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. +/// +/// This method is called on a best-effort basis. Specifically: +/// - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. +/// - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. +/// +/// A builder for the *wait* method supported by a *zoneOperation* resource. +/// It is not used directly, but through a `ZoneOperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.zone_operations().wait("project", "zone", "operation") +/// .doit(); +/// # } +/// ``` +pub struct ZoneOperationWaitCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _zone: String, + _operation: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ZoneOperationWaitCall<'a, C, A> {} + +impl<'a, C, A> ZoneOperationWaitCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.zoneOperations.wait", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("operation", self._operation.to_string())); + for &field in ["alt", "project", "zone", "operation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}/wait"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{zone}", "zone"), ("{operation}", "operation")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["operation", "zone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ZoneOperationWaitCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the zone for this request. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ZoneOperationWaitCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// Name of the Operations resource to return. + /// + /// Sets the *operation* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn operation(mut self, new_value: &str) -> ZoneOperationWaitCall<'a, C, A> { + self._operation = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ZoneOperationWaitCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ZoneOperationWaitCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ZoneOperationWaitCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes the specified zone-specific Operations resource. /// /// A builder for the *delete* method supported by a *zoneOperation* resource. @@ -145080,10 +173056,10 @@ impl<'a, C, A> ZoneOperationDeleteCall<'a, C, A> where C: BorrowMut ZoneOperationListCall<'a, C, A> where C: BorrowMut self._zone = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ZoneOperationListCall<'a, C, A> { @@ -145274,29 +173250,29 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> ZoneOperationListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ZoneOperationListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ZoneOperationListCall<'a, C, A> { @@ -145660,7 +173636,7 @@ impl<'a, C, A> ZoneOperationGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.routes().insert(req, "project") -/// .request_id("sea") +/// .request_id("Lorem") /// .doit(); /// # } /// ``` @@ -146193,10 +174169,10 @@ impl<'a, C, A> RouteGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.routes().list("project") -/// .page_token("Stet") -/// .order_by("labore") -/// .max_results(1) -/// .filter("sanctus") +/// .page_token("voluptua.") +/// .order_by("est") +/// .max_results(95) +/// .filter("justo") /// .doit(); /// # } /// ``` @@ -146366,7 +174342,7 @@ impl<'a, C, A> RouteListCall<'a, C, A> where C: BorrowMut, A: oau self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> RouteListCall<'a, C, A> { @@ -146375,29 +174351,29 @@ impl<'a, C, A> RouteListCall<'a, C, A> where C: BorrowMut, A: oau } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> RouteListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RouteListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RouteListCall<'a, C, A> { @@ -146491,7 +174467,7 @@ impl<'a, C, A> RouteListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.routes().delete("project", "route") -/// .request_id("erat") +/// .request_id("At") /// .doit(); /// # } /// ``` @@ -146731,304 +174707,6 @@ impl<'a, C, A> RouteDeleteCall<'a, C, A> where C: BorrowMut, A: o } -/// Retrieves the list of interconnect locations available to the specified project. -/// -/// A builder for the *list* method supported by a *interconnectLocation* resource. -/// It is not used directly, but through a `InterconnectLocationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_compute1 as compute1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use compute1::Compute; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.interconnect_locations().list("project") -/// .page_token("rebum.") -/// .order_by("sadipscing") -/// .max_results(49) -/// .filter("sea") -/// .doit(); -/// # } -/// ``` -pub struct InterconnectLocationListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Compute, - _project: String, - _page_token: Option, - _order_by: Option, - _max_results: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InterconnectLocationListCall<'a, C, A> {} - -impl<'a, C, A> InterconnectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InterconnectLocationList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "compute.interconnectLocations.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("project", self._project.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{project}/global/interconnectLocations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{project}", "project")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["project"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Project ID for this request. - /// - /// Sets the *project* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { - self._project = new_value.to_string(); - self - } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. - /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. - /// - /// Currently, only sorting by name or creationTimestamp desc is supported. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> InterconnectLocationListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. - /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. - /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. - /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InterconnectLocationListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InterconnectLocationListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InterconnectLocationListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. /// /// A builder for the *get* method supported by a *interconnectLocation* resource. @@ -147281,6 +174959,304 @@ impl<'a, C, A> InterconnectLocationGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.interconnect_locations().list("project") +/// .page_token("Lorem") +/// .order_by("clita") +/// .max_results(80) +/// .filter("tempor") +/// .doit(); +/// # } +/// ``` +pub struct InterconnectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InterconnectLocationListCall<'a, C, A> {} + +impl<'a, C, A> InterconnectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InterconnectLocationList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.interconnectLocations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/global/interconnectLocations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> InterconnectLocationListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InterconnectLocationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InterconnectLocationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InterconnectLocationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InterconnectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a firewall rule in the specified project using the data included in the request. /// /// A builder for the *insert* method supported by a *firewall* resource. @@ -147315,7 +175291,7 @@ impl<'a, C, A> InterconnectLocationGetCall<'a, C, A> where C: BorrowMut FirewallInsertCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.firewalls().delete("project", "firewall") -/// .request_id("sadipscing") +/// .request_id("voluptua.") /// .doit(); /// # } /// ``` @@ -147864,10 +175840,10 @@ impl<'a, C, A> FirewallDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.firewalls().list("project") -/// .page_token("consetetur") -/// .order_by("magna") -/// .max_results(30) -/// .filter("elitr") +/// .page_token("sanctus") +/// .order_by("At") +/// .max_results(66) +/// .filter("et") /// .doit(); /// # } /// ``` @@ -148037,7 +176013,7 @@ impl<'a, C, A> FirewallListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { @@ -148046,29 +176022,29 @@ impl<'a, C, A> FirewallListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> FirewallListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> FirewallListCall<'a, C, A> { @@ -148168,7 +176144,7 @@ impl<'a, C, A> FirewallListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.firewalls().patch(req, "project", "firewall") -/// .request_id("justo") +/// .request_id("sed") /// .doit(); /// # } /// ``` @@ -148685,7 +176661,7 @@ impl<'a, C, A> FirewallGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. +/// Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. /// /// A builder for the *update* method supported by a *firewall* resource. /// It is not used directly, but through a `FirewallMethods` instance. @@ -148719,7 +176695,7 @@ impl<'a, C, A> FirewallGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.firewalls().update(req, "project", "firewall") -/// .request_id("elitr") +/// .request_id("accusam") /// .doit(); /// # } /// ``` @@ -149282,7 +177258,7 @@ impl<'a, C, A> VpnTunnelGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.vpn_tunnels().insert(req, "project", "region") -/// .request_id("aliquyam") +/// .request_id("ipsum") /// .doit(); /// # } /// ``` @@ -149575,10 +177551,11 @@ impl<'a, C, A> VpnTunnelInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.vpn_tunnels().aggregated_list("project") -/// .page_token("et") -/// .order_by("amet") -/// .max_results(51) -/// .filter("nonumy") +/// .page_token("rebum.") +/// .order_by("takimata") +/// .max_results(78) +/// .include_all_scopes(true) +/// .filter("ut") /// .doit(); /// # } /// ``` @@ -149590,6 +177567,7 @@ pub struct VpnTunnelAggregatedListCall<'a, C, A> _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -149612,7 +177590,7 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -149623,10 +177601,13 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelAggregatedListCall<'a, C, A> { @@ -149757,29 +177738,36 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> VpnTunnelAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> VpnTunnelAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> VpnTunnelAggregatedListCall<'a, C, A> { @@ -149873,7 +177861,7 @@ impl<'a, C, A> VpnTunnelAggregatedListCall<'a, C, A> where C: BorrowMut VpnTunnelDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.vpn_tunnels().list("project", "region") -/// .page_token("takimata") -/// .order_by("eirmod") -/// .max_results(52) -/// .filter("At") +/// .page_token("ut") +/// .order_by("vero") +/// .max_results(48) +/// .filter("elitr") /// .doit(); /// # } /// ``` @@ -150338,7 +178326,7 @@ impl<'a, C, A> VpnTunnelListCall<'a, C, A> where C: BorrowMut, A: self._region = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { @@ -150347,29 +178335,29 @@ impl<'a, C, A> VpnTunnelListCall<'a, C, A> where C: BorrowMut, A: } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> VpnTunnelListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> VpnTunnelListCall<'a, C, A> { @@ -150727,7 +178715,7 @@ impl<'a, C, A> NodeTemplateGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.node_templates().delete("project", "region", "nodeTemplate") -/// .request_id("diam") +/// .request_id("sed") /// .doit(); /// # } /// ``` @@ -151007,10 +178995,10 @@ impl<'a, C, A> NodeTemplateDeleteCall<'a, C, A> where C: BorrowMut NodeTemplateListCall<'a, C, A> where C: BorrowMut, self._region = new_value.to_string(); self } - /// Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> NodeTemplateListCall<'a, C, A> { @@ -151201,29 +179189,29 @@ impl<'a, C, A> NodeTemplateListCall<'a, C, A> where C: BorrowMut, } /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. /// - /// You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. /// - /// Currently, only sorting by name or creationTimestamp desc is supported. + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> NodeTemplateListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NodeTemplateListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NodeTemplateListCall<'a, C, A> { @@ -151323,7 +179311,7 @@ impl<'a, C, A> NodeTemplateListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.node_templates().insert(req, "project", "region") -/// .request_id("nonumy") +/// .request_id("diam") /// .doit(); /// # } /// ``` @@ -151617,9 +179605,10 @@ impl<'a, C, A> NodeTemplateInsertCall<'a, C, A> where C: BorrowMut _page_token: Option, _order_by: Option, _max_results: Option, + _include_all_scopes: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -151653,7 +179643,7 @@ impl<'a, C, A> NodeTemplateAggregatedListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -151664,10 +179654,13 @@ impl<'a, C, A> NodeTemplateAggregatedListCall<'a, C, A> where C: BorrowMut NodeTemplateAggregatedListCall<'a, C, A> where C: BorrowMut NodeTemplateAggregatedListCall<'a, C, A> { @@ -151798,29 +179791,36 @@ impl<'a, C, A> NodeTemplateAggregatedListCall<'a, C, A> where C: BorrowMut NodeTemplateAggregatedListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> NodeTemplateAggregatedListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + /// + /// Sets the *include all scopes* query property to the given value. + pub fn include_all_scopes(mut self, new_value: bool) -> NodeTemplateAggregatedListCall<'a, C, A> { + self._include_all_scopes = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> NodeTemplateAggregatedListCall<'a, C, A> { @@ -152740,6 +180740,274 @@ impl<'a, C, A> NodeTemplateSetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_operations().wait("project", "region", "operation") +/// .doit(); +/// # } +/// ``` +pub struct RegionOperationWaitCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _operation: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionOperationWaitCall<'a, C, A> {} + +impl<'a, C, A> RegionOperationWaitCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionOperations.wait", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("operation", self._operation.to_string())); + for &field in ["alt", "project", "region", "operation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/operations/{operation}/wait"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{operation}", "operation")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["operation", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionOperationWaitCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region for this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionOperationWaitCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the Operations resource to return. + /// + /// Sets the *operation* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn operation(mut self, new_value: &str) -> RegionOperationWaitCall<'a, C, A> { + self._operation = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionOperationWaitCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionOperationWaitCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionOperationWaitCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves the specified region-specific Operations resource. /// /// A builder for the *get* method supported by a *regionOperation* resource. @@ -153032,10 +181300,10 @@ impl<'a, C, A> RegionOperationGetCall<'a, C, A> where C: BorrowMut RegionOperationListCall<'a, C, A> where C: BorrowMut RegionOperationListCall<'a, C, A> { @@ -153226,29 +181494,29 @@ impl<'a, C, A> RegionOperationListCall<'a, C, A> where C: BorrowMut RegionOperationListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> RegionOperationListCall<'a, C, A> { self._max_results = Some(new_value); self } - /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. /// - /// For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. /// - /// You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. /// - /// To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> RegionOperationListCall<'a, C, A> { @@ -153567,3 +181835,1241 @@ impl<'a, C, A> RegionOperationDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_groups().list("project", "region") +/// .page_token("sanctus") +/// .order_by("ea") +/// .max_results(33) +/// .filter("duo") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupListCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the named ports for the specified regional instance group. +/// +/// A builder for the *setNamedPorts* method supported by a *regionInstanceGroup* resource. +/// It is not used directly, but through a `RegionInstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupsSetNamedPortsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupsSetNamedPortsRequest::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.region_instance_groups().set_named_ports(req, "project", "region", "instanceGroup") +/// .request_id("sanctus") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupSetNamedPortCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupsSetNamedPortsRequest, + _project: String, + _region: String, + _instance_group: String, + _request_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupSetNamedPortCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupSetNamedPortCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.setNamedPorts", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + if let Some(value) = self._request_id { + params.push(("requestId", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroup", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupsSetNamedPortsRequest) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The name of the regional instance group where the named ports are updated. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. + /// + /// For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. + /// + /// The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + /// + /// Sets the *request id* query property to the given value. + pub fn request_id(mut self, new_value: &str) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { + self._request_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupSetNamedPortCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the specified instance group resource. +/// +/// A builder for the *get* method supported by a *regionInstanceGroup* resource. +/// It is not used directly, but through a `RegionInstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.region_instance_groups().get("project", "region", "instanceGroup") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _project: String, + _region: String, + _instance_group: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupGetCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InstanceGroup)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + for &field in ["alt", "project", "region", "instanceGroup"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups/{instanceGroup}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupGetCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupGetCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the instance group resource to return. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> RegionInstanceGroupGetCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. +/// +/// A builder for the *listInstances* method supported by a *regionInstanceGroup* resource. +/// It is not used directly, but through a `RegionInstanceGroupMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_compute1 as compute1; +/// use compute1::RegionInstanceGroupsListInstancesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use compute1::Compute; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RegionInstanceGroupsListInstancesRequest::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.region_instance_groups().list_instances(req, "project", "region", "instanceGroup") +/// .page_token("aliquyam") +/// .order_by("dolor") +/// .max_results(30) +/// .filter("magna") +/// .doit(); +/// # } +/// ``` +pub struct RegionInstanceGroupListInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Compute, + _request: RegionInstanceGroupsListInstancesRequest, + _project: String, + _region: String, + _instance_group: String, + _page_token: Option, + _order_by: Option, + _max_results: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RegionInstanceGroupListInstanceCall<'a, C, A> {} + +impl<'a, C, A> RegionInstanceGroupListInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RegionInstanceGroupsListInstances)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "compute.regionInstanceGroups.listInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("region", self._region.to_string())); + params.push(("instanceGroup", self._instance_group.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "region", "instanceGroup", "pageToken", "orderBy", "maxResults", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{region}", "region"), ("{instanceGroup}", "instanceGroup")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["instanceGroup", "region", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RegionInstanceGroupsListInstancesRequest) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// Project ID for this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Name of the region scoping this request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Name of the regional instance group for which we want to list the instances. + /// + /// Sets the *instance group* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance_group(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._instance_group = new_value.to_string(); + self + } + /// Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + /// + /// You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + /// + /// Currently, only sorting by `name` or `creationTimestamp desc` is supported. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + /// + /// For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + /// + /// You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + /// + /// To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RegionInstanceGroupListInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RegionInstanceGroupListInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RegionInstanceGroupListInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/consumersurveys2-cli/Cargo.toml b/gen/consumersurveys2-cli/Cargo.toml index 96b897c3b6..2969cead14 100644 --- a/gen/consumersurveys2-cli/Cargo.toml +++ b/gen/consumersurveys2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-consumersurveys2-cli" -version = "1.0.12+20170407" +version = "1.0.13+20170407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Consumer Surveys (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/consumersurveys2-cli" @@ -41,4 +41,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-consumersurveys2] path = "../consumersurveys2" -version = "1.0.12+20170407" +version = "1.0.13+20170407" diff --git a/gen/consumersurveys2-cli/README.md b/gen/consumersurveys2-cli/README.md index 30a0533c1a..8018f49852 100644 --- a/gen/consumersurveys2-cli/README.md +++ b/gen/consumersurveys2-cli/README.md @@ -22,7 +22,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Consumer Surveys* API at revision *20170407*. The CLI is at version *1.0.12*. +This documentation was generated from the *Consumer Surveys* API at revision *20170407*. The CLI is at version *1.0.13*. ```bash consumersurveys2 [options] diff --git a/gen/consumersurveys2-cli/mkdocs.yml b/gen/consumersurveys2-cli/mkdocs.yml index cd178906b5..e564504be2 100644 --- a/gen/consumersurveys2-cli/mkdocs.yml +++ b/gen/consumersurveys2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Consumer Surveys v1.0.12+20170407 +site_name: Consumer Surveys v1.0.13+20170407 site_url: http://byron.github.io/google-apis-rs/google-consumersurveys2-cli site_description: A complete library to interact with Consumer Surveys (protocol v2) diff --git a/gen/consumersurveys2-cli/src/main.rs b/gen/consumersurveys2-cli/src/main.rs index aab8369a91..da9e1eea42 100644 --- a/gen/consumersurveys2-cli/src/main.rs +++ b/gen/consumersurveys2-cli/src/main.rs @@ -1266,7 +1266,7 @@ fn main() { let mut app = App::new("consumersurveys2") .author("Sebastian Thiel ") - .version("1.0.12+20170407") + .version("1.0.13+20170407") .about("Creates and conducts surveys, lists the surveys that an authenticated user owns, and retrieves survey results and information about specified surveys.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_consumersurveys2_cli") .arg(Arg::with_name("url") diff --git a/gen/consumersurveys2/Cargo.toml b/gen/consumersurveys2/Cargo.toml index 7a68f7e3d5..494fcbca01 100644 --- a/gen/consumersurveys2/Cargo.toml +++ b/gen/consumersurveys2/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-consumersurveys2" -version = "1.0.12+20170407" +version = "1.0.13+20170407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Consumer Surveys (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/consumersurveys2" -documentation = "https://docs.rs/google-consumersurveys2/1.0.12+20170407" +documentation = "https://docs.rs/google-consumersurveys2/1.0.13+20170407" license = "MIT" keywords = ["consumersurveys", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/consumersurveys2/README.md b/gen/consumersurveys2/README.md index 5cc8cc71d0..33cebfd102 100644 --- a/gen/consumersurveys2/README.md +++ b/gen/consumersurveys2/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-consumersurveys2` library allows access to all features of the *Google Consumer Surveys* service. -This documentation was generated from *Consumer Surveys* crate version *1.0.12+20170407*, where *20170407* is the exact revision of the *consumersurveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Consumer Surveys* crate version *1.0.13+20170407*, where *20170407* is the exact revision of the *consumersurveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.ConsumerSurveys.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.ConsumerSurveys.html) ... * mobileapppanels - * [*get*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.MobileapppanelGetCall.html), [*list*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.MobileapppanelListCall.html) and [*update*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.MobileapppanelUpdateCall.html) + * [*get*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.MobileapppanelGetCall.html), [*list*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.MobileapppanelListCall.html) and [*update*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.MobileapppanelUpdateCall.html) * results - * [*get*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.ResultGetCall.html) -* [surveys](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.Survey.html) - * [*delete*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.SurveyDeleteCall.html), [*get*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.SurveyGetCall.html), [*insert*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.SurveyInsertCall.html), [*list*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.SurveyListCall.html), [*start*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.SurveyStartCall.html), [*stop*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.SurveyStopCall.html) and [*update*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.SurveyUpdateCall.html) + * [*get*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.ResultGetCall.html) +* [surveys](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.Survey.html) + * [*delete*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.SurveyDeleteCall.html), [*get*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.SurveyGetCall.html), [*insert*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.SurveyInsertCall.html), [*list*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.SurveyListCall.html), [*start*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.SurveyStartCall.html), [*stop*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.SurveyStopCall.html) and [*update*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.SurveyUpdateCall.html) Download supported by ... -* [*get results*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.ResultGetCall.html) +* [*get results*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.ResultGetCall.html) @@ -28,17 +28,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/struct.ConsumerSurveys.html)** +* **[Hub](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/struct.ConsumerSurveys.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.Part.html)** + * **[Parts](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-consumersurveys2/1.0.12+20170407/google_consumersurveys2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-consumersurveys2/1.0.13+20170407/google_consumersurveys2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/consumersurveys2/src/lib.rs b/gen/consumersurveys2/src/lib.rs index 8fca631120..4cc7f79295 100644 --- a/gen/consumersurveys2/src/lib.rs +++ b/gen/consumersurveys2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Consumer Surveys* crate version *1.0.12+20170407*, where *20170407* is the exact revision of the *consumersurveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Consumer Surveys* crate version *1.0.13+20170407*, where *20170407* is the exact revision of the *consumersurveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/consumersurveys2). //! # Features //! @@ -342,7 +342,7 @@ impl<'a, C, A> ConsumerSurveys ConsumerSurveys { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/consumersurveys/v2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -359,7 +359,7 @@ impl<'a, C, A> ConsumerSurveys } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/container1-cli/Cargo.toml b/gen/container1-cli/Cargo.toml index add66a42f1..e30f611225 100644 --- a/gen/container1-cli/Cargo.toml +++ b/gen/container1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-container1-cli" -version = "1.0.12+20190610" +version = "1.0.13+20200324" authors = ["Sebastian Thiel "] description = "A complete library to interact with Container (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-container1] path = "../container1" -version = "1.0.12+20190610" +version = "1.0.13+20200324" diff --git a/gen/container1-cli/README.md b/gen/container1-cli/README.md index e53a221406..6a4b6934b0 100644 --- a/gen/container1-cli/README.md +++ b/gen/container1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Container* API at revision *20190610*. The CLI is at version *1.0.12*. +This documentation was generated from the *Container* API at revision *20200324*. The CLI is at version *1.0.13*. ```bash container1 [options] diff --git a/gen/container1-cli/mkdocs.yml b/gen/container1-cli/mkdocs.yml index 04719f3648..35d6152e97 100644 --- a/gen/container1-cli/mkdocs.yml +++ b/gen/container1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Container v1.0.12+20190610 +site_name: Container v1.0.13+20200324 site_url: http://byron.github.io/google-apis-rs/google-container1-cli site_description: A complete library to interact with Container (protocol v1) diff --git a/gen/container1-cli/src/main.rs b/gen/container1-cli/src/main.rs index 714fe21eed..c6b5fafe58 100644 --- a/gen/container1-cli/src/main.rs +++ b/gen/container1-cli/src/main.rs @@ -220,14 +220,19 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "cluster.node-ipv4-cidr-size" => Some(("cluster.nodeIpv4CidrSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.recurring-window.recurrence" => Some(("cluster.maintenancePolicy.window.recurringWindow.recurrence", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.recurring-window.window.end-time" => Some(("cluster.maintenancePolicy.window.recurringWindow.window.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.recurring-window.window.start-time" => Some(("cluster.maintenancePolicy.window.recurringWindow.window.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.maintenance-policy.window.daily-maintenance-window.duration" => Some(("cluster.maintenancePolicy.window.dailyMaintenanceWindow.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.maintenance-policy.window.daily-maintenance-window.start-time" => Some(("cluster.maintenancePolicy.window.dailyMaintenanceWindow.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.resource-version" => Some(("cluster.maintenancePolicy.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.network-policy.enabled" => Some(("cluster.networkPolicy.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.network-policy.provider" => Some(("cluster.networkPolicy.provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-authorized-networks-config.enabled" => Some(("cluster.masterAuthorizedNetworksConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.http-load-balancing.disabled" => Some(("cluster.addonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.network-policy-config.disabled" => Some(("cluster.addonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.kubernetes-dashboard.disabled" => Some(("cluster.addonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.addons-config.cloud-run-config.disabled" => Some(("cluster.addonsConfig.cloudRunConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.horizontal-pod-autoscaling.disabled" => Some(("cluster.addonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.locations" => Some(("cluster.locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.enable-kubernetes-alpha" => Some(("cluster.enableKubernetesAlpha", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -237,15 +242,19 @@ impl<'n> Engine<'n> { "cluster.instance-group-urls" => Some(("cluster.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.network-config.subnetwork" => Some(("cluster.networkConfig.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.network-config.network" => Some(("cluster.networkConfig.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.network-config.enable-intra-node-visibility" => Some(("cluster.networkConfig.enableIntraNodeVisibility", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.shielded-nodes.enabled" => Some(("cluster.shieldedNodes.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.location" => Some(("cluster.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.workload-identity-config.workload-pool" => Some(("cluster.workloadIdentityConfig.workloadPool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.resource-usage-export-config.bigquery-destination.dataset-id" => Some(("cluster.resourceUsageExportConfig.bigqueryDestination.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.resource-usage-export-config.enable-network-egress-metering" => Some(("cluster.resourceUsageExportConfig.enableNetworkEgressMetering", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.resource-usage-export-config.consumption-metering-config.enabled" => Some(("cluster.resourceUsageExportConfig.consumptionMeteringConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.private-cluster-config.enable-private-endpoint" => Some(("cluster.privateClusterConfig.enablePrivateEndpoint", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "cluster.private-cluster-config.master-ipv4-cidr-block" => Some(("cluster.privateClusterConfig.masterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.private-cluster-config.private-endpoint" => Some(("cluster.privateClusterConfig.privateEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.private-cluster-config.public-endpoint" => Some(("cluster.privateClusterConfig.publicEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.private-cluster-config.enable-private-nodes" => Some(("cluster.privateClusterConfig.enablePrivateNodes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.private-cluster-config.private-endpoint" => Some(("cluster.privateClusterConfig.privateEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.private-cluster-config.master-ipv4-cidr-block" => Some(("cluster.privateClusterConfig.masterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.private-cluster-config.peering-name" => Some(("cluster.privateClusterConfig.peeringName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.services-ipv4-cidr" => Some(("cluster.servicesIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.status-message" => Some(("cluster.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.ip-allocation-policy.node-ipv4-cidr" => Some(("cluster.ipAllocationPolicy.nodeIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -261,8 +270,19 @@ impl<'n> Engine<'n> { "cluster.ip-allocation-policy.services-secondary-range-name" => Some(("cluster.ipAllocationPolicy.servicesSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.ip-allocation-policy.services-ipv4-cidr" => Some(("cluster.ipAllocationPolicy.servicesIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.status" => Some(("cluster.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-surge" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-unavailable" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.auto-repair" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.description" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.auto-upgrade-start-time" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.auto-upgrade" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.service-account" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.oauth-scopes" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.autoscaling.autoprovisioning-locations" => Some(("cluster.autoscaling.autoprovisioningLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.autoscaling.enable-node-autoprovisioning" => Some(("cluster.autoscaling.enableNodeAutoprovisioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.description" => Some(("cluster.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-version" => Some(("cluster.currentNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.binary-authorization.enabled" => Some(("cluster.binaryAuthorization.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.label-fingerprint" => Some(("cluster.labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-master-version" => Some(("cluster.currentMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.username" => Some(("cluster.masterAuth.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -276,25 +296,37 @@ impl<'n> Engine<'n> { "cluster.initial-node-count" => Some(("cluster.initialNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.monitoring-service" => Some(("cluster.monitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.create-time" => Some(("cluster.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.database-encryption.state" => Some(("cluster.databaseEncryption.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.database-encryption.key-name" => Some(("cluster.databaseEncryption.keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.enable-tpu" => Some(("cluster.enableTpu", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.endpoint" => Some(("cluster.endpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-count" => Some(("cluster.currentNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.name" => Some(("cluster.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.vertical-pod-autoscaling.enabled" => Some(("cluster.verticalPodAutoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.legacy-abac.enabled" => Some(("cluster.legacyAbac.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.initial-cluster-version" => Some(("cluster.initialClusterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.reservation-affinity.values" => Some(("cluster.nodeConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.node-config.reservation-affinity.key" => Some(("cluster.nodeConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.reservation-affinity.consume-reservation-type" => Some(("cluster.nodeConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.sandbox-config.type" => Some(("cluster.nodeConfig.sandboxConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.machine-type" => Some(("cluster.nodeConfig.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.shielded-instance-config.enable-integrity-monitoring" => Some(("cluster.nodeConfig.shieldedInstanceConfig.enableIntegrityMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.node-config.shielded-instance-config.enable-secure-boot" => Some(("cluster.nodeConfig.shieldedInstanceConfig.enableSecureBoot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.node-config.tags" => Some(("cluster.nodeConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.node-config.preemptible" => Some(("cluster.nodeConfig.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.node-config.labels" => Some(("cluster.nodeConfig.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.node-config.service-account" => Some(("cluster.nodeConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.oauth-scopes" => Some(("cluster.nodeConfig.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.node-config.disk-type" => Some(("cluster.nodeConfig.diskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.workload-metadata-config.mode" => Some(("cluster.nodeConfig.workloadMetadataConfig.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.disk-size-gb" => Some(("cluster.nodeConfig.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.node-config.min-cpu-platform" => Some(("cluster.nodeConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.metadata" => Some(("cluster.nodeConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.node-config.image-type" => Some(("cluster.nodeConfig.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.local-ssd-count" => Some(("cluster.nodeConfig.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.cluster-ipv4-cidr" => Some(("cluster.clusterIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.authenticator-groups-config.enabled" => Some(("cluster.authenticatorGroupsConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.authenticator-groups-config.security-group" => Some(("cluster.authenticatorGroupsConfig.securityGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.subnetwork" => Some(("cluster.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.resource-labels" => Some(("cluster.resourceLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.self-link" => Some(("cluster.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -303,7 +335,7 @@ impl<'n> Engine<'n> { "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "bigquery-destination", "client-certificate", "client-certificate-config", "client-key", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "cluster-ipv4-cidr-block", "cluster-secondary-range-name", "consumption-metering-config", "create-subnetwork", "create-time", "current-master-version", "current-node-count", "current-node-version", "daily-maintenance-window", "dataset-id", "default-max-pods-constraint", "description", "disabled", "disk-size-gb", "disk-type", "duration", "enable-kubernetes-alpha", "enable-network-egress-metering", "enable-private-endpoint", "enable-private-nodes", "enable-tpu", "enabled", "endpoint", "expire-time", "horizontal-pod-autoscaling", "http-load-balancing", "image-type", "initial-cluster-version", "initial-node-count", "instance-group-urls", "ip-allocation-policy", "issue-client-certificate", "kubernetes-dashboard", "label-fingerprint", "labels", "legacy-abac", "local-ssd-count", "location", "locations", "logging-service", "machine-type", "maintenance-policy", "master-auth", "master-authorized-networks-config", "master-ipv4-cidr-block", "max-pods-per-node", "metadata", "min-cpu-platform", "monitoring-service", "name", "network", "network-config", "network-policy", "network-policy-config", "node-config", "node-ipv4-cidr", "node-ipv4-cidr-block", "node-ipv4-cidr-size", "oauth-scopes", "parent", "password", "preemptible", "private-cluster-config", "private-endpoint", "project-id", "provider", "public-endpoint", "resource-labels", "resource-usage-export-config", "self-link", "service-account", "services-ipv4-cidr", "services-ipv4-cidr-block", "services-secondary-range-name", "start-time", "status", "status-message", "subnetwork", "subnetwork-name", "tags", "tpu-ipv4-cidr-block", "use-ip-aliases", "username", "window", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "authenticator-groups-config", "auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoprovisioning-locations", "autoprovisioning-node-pool-defaults", "autoscaling", "bigquery-destination", "binary-authorization", "client-certificate", "client-certificate-config", "client-key", "cloud-run-config", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "cluster-ipv4-cidr-block", "cluster-secondary-range-name", "consume-reservation-type", "consumption-metering-config", "create-subnetwork", "create-time", "current-master-version", "current-node-count", "current-node-version", "daily-maintenance-window", "database-encryption", "dataset-id", "default-max-pods-constraint", "description", "disabled", "disk-size-gb", "disk-type", "duration", "enable-integrity-monitoring", "enable-intra-node-visibility", "enable-kubernetes-alpha", "enable-network-egress-metering", "enable-node-autoprovisioning", "enable-private-endpoint", "enable-private-nodes", "enable-secure-boot", "enable-tpu", "enabled", "end-time", "endpoint", "expire-time", "horizontal-pod-autoscaling", "http-load-balancing", "image-type", "initial-cluster-version", "initial-node-count", "instance-group-urls", "ip-allocation-policy", "issue-client-certificate", "key", "key-name", "kubernetes-dashboard", "label-fingerprint", "labels", "legacy-abac", "local-ssd-count", "location", "locations", "logging-service", "machine-type", "maintenance-policy", "management", "master-auth", "master-authorized-networks-config", "master-ipv4-cidr-block", "max-pods-per-node", "max-surge", "max-unavailable", "metadata", "min-cpu-platform", "mode", "monitoring-service", "name", "network", "network-config", "network-policy", "network-policy-config", "node-config", "node-ipv4-cidr", "node-ipv4-cidr-block", "node-ipv4-cidr-size", "oauth-scopes", "parent", "password", "peering-name", "preemptible", "private-cluster-config", "private-endpoint", "project-id", "provider", "public-endpoint", "recurrence", "recurring-window", "reservation-affinity", "resource-labels", "resource-usage-export-config", "resource-version", "sandbox-config", "security-group", "self-link", "service-account", "services-ipv4-cidr", "services-ipv4-cidr-block", "services-secondary-range-name", "shielded-instance-config", "shielded-nodes", "start-time", "state", "status", "status-message", "subnetwork", "subnetwork-name", "tags", "tpu-ipv4-cidr-block", "type", "upgrade-options", "upgrade-settings", "use-ip-aliases", "username", "values", "vertical-pod-autoscaling", "window", "workload-identity-config", "workload-metadata-config", "workload-pool", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -630,20 +662,31 @@ impl<'n> Engine<'n> { "node-pool.name" => Some(("nodePool.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.instance-group-urls" => Some(("nodePool.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.autoscaling.min-node-count" => Some(("nodePool.autoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.autoscaling.autoprovisioned" => Some(("nodePool.autoscaling.autoprovisioned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.autoscaling.enabled" => Some(("nodePool.autoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.autoscaling.max-node-count" => Some(("nodePool.autoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.locations" => Some(("nodePool.locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.max-pods-constraint.max-pods-per-node" => Some(("nodePool.maxPodsConstraint.maxPodsPerNode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.version" => Some(("nodePool.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.upgrade-settings.max-surge" => Some(("nodePool.upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.upgrade-settings.max-unavailable" => Some(("nodePool.upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.initial-node-count" => Some(("nodePool.initialNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.pod-ipv4-cidr-size" => Some(("nodePool.podIpv4CidrSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.status-message" => Some(("nodePool.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.reservation-affinity.values" => Some(("nodePool.config.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "node-pool.config.reservation-affinity.key" => Some(("nodePool.config.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.reservation-affinity.consume-reservation-type" => Some(("nodePool.config.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.sandbox-config.type" => Some(("nodePool.config.sandboxConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.machine-type" => Some(("nodePool.config.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.shielded-instance-config.enable-integrity-monitoring" => Some(("nodePool.config.shieldedInstanceConfig.enableIntegrityMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "node-pool.config.shielded-instance-config.enable-secure-boot" => Some(("nodePool.config.shieldedInstanceConfig.enableSecureBoot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.config.tags" => Some(("nodePool.config.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.config.preemptible" => Some(("nodePool.config.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.config.labels" => Some(("nodePool.config.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "node-pool.config.service-account" => Some(("nodePool.config.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.oauth-scopes" => Some(("nodePool.config.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.config.disk-type" => Some(("nodePool.config.diskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.workload-metadata-config.mode" => Some(("nodePool.config.workloadMetadataConfig.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.disk-size-gb" => Some(("nodePool.config.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.config.min-cpu-platform" => Some(("nodePool.config.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.metadata" => Some(("nodePool.config.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -651,7 +694,7 @@ impl<'n> Engine<'n> { "node-pool.config.local-ssd-count" => Some(("nodePool.config.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.self-link" => Some(("nodePool.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoscaling", "cluster-id", "config", "description", "disk-size-gb", "disk-type", "enabled", "image-type", "initial-node-count", "instance-group-urls", "labels", "local-ssd-count", "machine-type", "management", "max-node-count", "max-pods-constraint", "max-pods-per-node", "metadata", "min-cpu-platform", "min-node-count", "name", "node-pool", "oauth-scopes", "parent", "pod-ipv4-cidr-size", "preemptible", "project-id", "self-link", "service-account", "status", "status-message", "tags", "upgrade-options", "version", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoprovisioned", "autoscaling", "cluster-id", "config", "consume-reservation-type", "description", "disk-size-gb", "disk-type", "enable-integrity-monitoring", "enable-secure-boot", "enabled", "image-type", "initial-node-count", "instance-group-urls", "key", "labels", "local-ssd-count", "locations", "machine-type", "management", "max-node-count", "max-pods-constraint", "max-pods-per-node", "max-surge", "max-unavailable", "metadata", "min-cpu-platform", "min-node-count", "mode", "name", "node-pool", "oauth-scopes", "parent", "pod-ipv4-cidr-size", "preemptible", "project-id", "reservation-affinity", "sandbox-config", "self-link", "service-account", "shielded-instance-config", "status", "status-message", "tags", "type", "upgrade-options", "upgrade-settings", "values", "version", "workload-metadata-config", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1019,12 +1062,13 @@ impl<'n> Engine<'n> { "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling.min-node-count" => Some(("autoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling.autoprovisioned" => Some(("autoscaling.autoprovisioned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "autoscaling.enabled" => Some(("autoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "autoscaling.max-node-count" => Some(("autoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool-id" => Some(("nodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling", "cluster-id", "enabled", "max-node-count", "min-node-count", "name", "node-pool-id", "project-id", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoprovisioned", "autoscaling", "cluster-id", "enabled", "max-node-count", "min-node-count", "name", "node-pool-id", "project-id", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1294,11 +1338,15 @@ impl<'n> Engine<'n> { "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locations" => Some(("locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool-id" => Some(("nodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workload-metadata-config.mode" => Some(("workloadMetadataConfig.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "upgrade-settings.max-surge" => Some(("upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "upgrade-settings.max-unavailable" => Some(("upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-version" => Some(("nodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "image-type" => Some(("imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "image-type", "name", "node-pool-id", "node-version", "project-id", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "image-type", "locations", "max-surge", "max-unavailable", "mode", "name", "node-pool-id", "node-version", "project-id", "upgrade-settings", "workload-metadata-config", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1385,12 +1433,13 @@ impl<'n> Engine<'n> { "addons-config.http-load-balancing.disabled" => Some(("addonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "addons-config.network-policy-config.disabled" => Some(("addonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "addons-config.kubernetes-dashboard.disabled" => Some(("addonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "addons-config.cloud-run-config.disabled" => Some(("addonsConfig.cloudRunConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "addons-config.horizontal-pod-autoscaling.disabled" => Some(("addonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "cluster-id", "disabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "name", "network-policy-config", "project-id", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "cloud-run-config", "cluster-id", "disabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "name", "network-policy-config", "project-id", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1741,13 +1790,17 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.window.recurring-window.recurrence" => Some(("maintenancePolicy.window.recurringWindow.recurrence", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.window.recurring-window.window.end-time" => Some(("maintenancePolicy.window.recurringWindow.window.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.window.recurring-window.window.start-time" => Some(("maintenancePolicy.window.recurringWindow.window.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "maintenance-policy.window.daily-maintenance-window.duration" => Some(("maintenancePolicy.window.dailyMaintenanceWindow.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "maintenance-policy.window.daily-maintenance-window.start-time" => Some(("maintenancePolicy.window.dailyMaintenanceWindow.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.resource-version" => Some(("maintenancePolicy.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "daily-maintenance-window", "duration", "maintenance-policy", "name", "project-id", "start-time", "window", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "daily-maintenance-window", "duration", "end-time", "maintenance-policy", "name", "project-id", "recurrence", "recurring-window", "resource-version", "start-time", "window", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2287,26 +2340,45 @@ impl<'n> Engine<'n> { "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-intra-node-visibility-config.enabled" => Some(("update.desiredIntraNodeVisibilityConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-logging-service" => Some(("update.desiredLoggingService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-master-authorized-networks-config.enabled" => Some(("update.desiredMasterAuthorizedNetworksConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-shielded-nodes.enabled" => Some(("update.desiredShieldedNodes.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-id" => Some(("update.desiredNodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-addons-config.http-load-balancing.disabled" => Some(("update.desiredAddonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.network-policy-config.disabled" => Some(("update.desiredAddonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.kubernetes-dashboard.disabled" => Some(("update.desiredAddonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-addons-config.cloud-run-config.disabled" => Some(("update.desiredAddonsConfig.cloudRunConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.horizontal-pod-autoscaling.disabled" => Some(("update.desiredAddonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-vertical-pod-autoscaling.enabled" => Some(("update.desiredVerticalPodAutoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-master-version" => Some(("update.desiredMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-locations" => Some(("update.desiredLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "update.desired-node-version" => Some(("update.desiredNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-image-type" => Some(("update.desiredImageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-binary-authorization.enabled" => Some(("update.desiredBinaryAuthorization.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-database-encryption.state" => Some(("update.desiredDatabaseEncryption.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-database-encryption.key-name" => Some(("update.desiredDatabaseEncryption.keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-resource-usage-export-config.bigquery-destination.dataset-id" => Some(("update.desiredResourceUsageExportConfig.bigqueryDestination.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-resource-usage-export-config.enable-network-egress-metering" => Some(("update.desiredResourceUsageExportConfig.enableNetworkEgressMetering", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-resource-usage-export-config.consumption-metering-config.enabled" => Some(("update.desiredResourceUsageExportConfig.consumptionMeteringConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-workload-identity-config.workload-pool" => Some(("update.desiredWorkloadIdentityConfig.workloadPool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-surge" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-unavailable" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.auto-repair" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.description" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.auto-upgrade-start-time" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.auto-upgrade" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.service-account" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.oauth-scopes" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.desired-cluster-autoscaling.autoprovisioning-locations" => Some(("update.desiredClusterAutoscaling.autoprovisioningLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.desired-cluster-autoscaling.enable-node-autoprovisioning" => Some(("update.desiredClusterAutoscaling.enableNodeAutoprovisioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-autoscaling.min-node-count" => Some(("update.desiredNodePoolAutoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-node-pool-autoscaling.autoprovisioned" => Some(("update.desiredNodePoolAutoscaling.autoprovisioned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-autoscaling.enabled" => Some(("update.desiredNodePoolAutoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-autoscaling.max-node-count" => Some(("update.desiredNodePoolAutoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update.desired-monitoring-service" => Some(("update.desiredMonitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-destination", "cluster-id", "consumption-metering-config", "dataset-id", "desired-addons-config", "desired-image-type", "desired-locations", "desired-logging-service", "desired-master-authorized-networks-config", "desired-master-version", "desired-monitoring-service", "desired-node-pool-autoscaling", "desired-node-pool-id", "desired-node-version", "desired-resource-usage-export-config", "disabled", "enable-network-egress-metering", "enabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "max-node-count", "min-node-count", "name", "network-policy-config", "project-id", "update", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoprovisioned", "autoprovisioning-locations", "autoprovisioning-node-pool-defaults", "bigquery-destination", "cloud-run-config", "cluster-id", "consumption-metering-config", "dataset-id", "description", "desired-addons-config", "desired-binary-authorization", "desired-cluster-autoscaling", "desired-database-encryption", "desired-image-type", "desired-intra-node-visibility-config", "desired-locations", "desired-logging-service", "desired-master-authorized-networks-config", "desired-master-version", "desired-monitoring-service", "desired-node-pool-autoscaling", "desired-node-pool-id", "desired-node-version", "desired-resource-usage-export-config", "desired-shielded-nodes", "desired-vertical-pod-autoscaling", "desired-workload-identity-config", "disabled", "enable-network-egress-metering", "enable-node-autoprovisioning", "enabled", "horizontal-pod-autoscaling", "http-load-balancing", "key-name", "kubernetes-dashboard", "management", "max-node-count", "max-surge", "max-unavailable", "min-node-count", "name", "network-policy-config", "oauth-scopes", "project-id", "service-account", "state", "update", "upgrade-options", "upgrade-settings", "workload-pool", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2799,12 +2871,13 @@ impl<'n> Engine<'n> { "addons-config.http-load-balancing.disabled" => Some(("addonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "addons-config.network-policy-config.disabled" => Some(("addonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "addons-config.kubernetes-dashboard.disabled" => Some(("addonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "addons-config.cloud-run-config.disabled" => Some(("addonsConfig.cloudRunConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "addons-config.horizontal-pod-autoscaling.disabled" => Some(("addonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "cluster-id", "disabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "name", "network-policy-config", "project-id", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "cloud-run-config", "cluster-id", "disabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "name", "network-policy-config", "project-id", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2976,14 +3049,19 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "cluster.node-ipv4-cidr-size" => Some(("cluster.nodeIpv4CidrSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.recurring-window.recurrence" => Some(("cluster.maintenancePolicy.window.recurringWindow.recurrence", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.recurring-window.window.end-time" => Some(("cluster.maintenancePolicy.window.recurringWindow.window.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.window.recurring-window.window.start-time" => Some(("cluster.maintenancePolicy.window.recurringWindow.window.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.maintenance-policy.window.daily-maintenance-window.duration" => Some(("cluster.maintenancePolicy.window.dailyMaintenanceWindow.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.maintenance-policy.window.daily-maintenance-window.start-time" => Some(("cluster.maintenancePolicy.window.dailyMaintenanceWindow.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.maintenance-policy.resource-version" => Some(("cluster.maintenancePolicy.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.network-policy.enabled" => Some(("cluster.networkPolicy.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.network-policy.provider" => Some(("cluster.networkPolicy.provider", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-authorized-networks-config.enabled" => Some(("cluster.masterAuthorizedNetworksConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.http-load-balancing.disabled" => Some(("cluster.addonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.network-policy-config.disabled" => Some(("cluster.addonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.kubernetes-dashboard.disabled" => Some(("cluster.addonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.addons-config.cloud-run-config.disabled" => Some(("cluster.addonsConfig.cloudRunConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.horizontal-pod-autoscaling.disabled" => Some(("cluster.addonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.locations" => Some(("cluster.locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.enable-kubernetes-alpha" => Some(("cluster.enableKubernetesAlpha", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2993,15 +3071,19 @@ impl<'n> Engine<'n> { "cluster.instance-group-urls" => Some(("cluster.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.network-config.subnetwork" => Some(("cluster.networkConfig.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.network-config.network" => Some(("cluster.networkConfig.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.network-config.enable-intra-node-visibility" => Some(("cluster.networkConfig.enableIntraNodeVisibility", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.shielded-nodes.enabled" => Some(("cluster.shieldedNodes.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.location" => Some(("cluster.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.workload-identity-config.workload-pool" => Some(("cluster.workloadIdentityConfig.workloadPool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.resource-usage-export-config.bigquery-destination.dataset-id" => Some(("cluster.resourceUsageExportConfig.bigqueryDestination.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.resource-usage-export-config.enable-network-egress-metering" => Some(("cluster.resourceUsageExportConfig.enableNetworkEgressMetering", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.resource-usage-export-config.consumption-metering-config.enabled" => Some(("cluster.resourceUsageExportConfig.consumptionMeteringConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.private-cluster-config.enable-private-endpoint" => Some(("cluster.privateClusterConfig.enablePrivateEndpoint", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "cluster.private-cluster-config.master-ipv4-cidr-block" => Some(("cluster.privateClusterConfig.masterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.private-cluster-config.private-endpoint" => Some(("cluster.privateClusterConfig.privateEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.private-cluster-config.public-endpoint" => Some(("cluster.privateClusterConfig.publicEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.private-cluster-config.enable-private-nodes" => Some(("cluster.privateClusterConfig.enablePrivateNodes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.private-cluster-config.private-endpoint" => Some(("cluster.privateClusterConfig.privateEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.private-cluster-config.master-ipv4-cidr-block" => Some(("cluster.privateClusterConfig.masterIpv4CidrBlock", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.private-cluster-config.peering-name" => Some(("cluster.privateClusterConfig.peeringName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.services-ipv4-cidr" => Some(("cluster.servicesIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.status-message" => Some(("cluster.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.ip-allocation-policy.node-ipv4-cidr" => Some(("cluster.ipAllocationPolicy.nodeIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3017,8 +3099,19 @@ impl<'n> Engine<'n> { "cluster.ip-allocation-policy.services-secondary-range-name" => Some(("cluster.ipAllocationPolicy.servicesSecondaryRangeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.ip-allocation-policy.services-ipv4-cidr" => Some(("cluster.ipAllocationPolicy.servicesIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.status" => Some(("cluster.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-surge" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-unavailable" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.auto-repair" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.description" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.auto-upgrade-start-time" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.management.auto-upgrade" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.service-account" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.autoscaling.autoprovisioning-node-pool-defaults.oauth-scopes" => Some(("cluster.autoscaling.autoprovisioningNodePoolDefaults.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.autoscaling.autoprovisioning-locations" => Some(("cluster.autoscaling.autoprovisioningLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.autoscaling.enable-node-autoprovisioning" => Some(("cluster.autoscaling.enableNodeAutoprovisioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.description" => Some(("cluster.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-version" => Some(("cluster.currentNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.binary-authorization.enabled" => Some(("cluster.binaryAuthorization.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.label-fingerprint" => Some(("cluster.labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-master-version" => Some(("cluster.currentMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.username" => Some(("cluster.masterAuth.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3032,25 +3125,37 @@ impl<'n> Engine<'n> { "cluster.initial-node-count" => Some(("cluster.initialNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.monitoring-service" => Some(("cluster.monitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.create-time" => Some(("cluster.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.database-encryption.state" => Some(("cluster.databaseEncryption.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.database-encryption.key-name" => Some(("cluster.databaseEncryption.keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.enable-tpu" => Some(("cluster.enableTpu", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.endpoint" => Some(("cluster.endpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-count" => Some(("cluster.currentNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.name" => Some(("cluster.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.vertical-pod-autoscaling.enabled" => Some(("cluster.verticalPodAutoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.legacy-abac.enabled" => Some(("cluster.legacyAbac.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.initial-cluster-version" => Some(("cluster.initialClusterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.reservation-affinity.values" => Some(("cluster.nodeConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.node-config.reservation-affinity.key" => Some(("cluster.nodeConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.reservation-affinity.consume-reservation-type" => Some(("cluster.nodeConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.sandbox-config.type" => Some(("cluster.nodeConfig.sandboxConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.machine-type" => Some(("cluster.nodeConfig.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.shielded-instance-config.enable-integrity-monitoring" => Some(("cluster.nodeConfig.shieldedInstanceConfig.enableIntegrityMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.node-config.shielded-instance-config.enable-secure-boot" => Some(("cluster.nodeConfig.shieldedInstanceConfig.enableSecureBoot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.node-config.tags" => Some(("cluster.nodeConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.node-config.preemptible" => Some(("cluster.nodeConfig.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.node-config.labels" => Some(("cluster.nodeConfig.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.node-config.service-account" => Some(("cluster.nodeConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.oauth-scopes" => Some(("cluster.nodeConfig.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "cluster.node-config.disk-type" => Some(("cluster.nodeConfig.diskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.node-config.workload-metadata-config.mode" => Some(("cluster.nodeConfig.workloadMetadataConfig.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.disk-size-gb" => Some(("cluster.nodeConfig.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.node-config.min-cpu-platform" => Some(("cluster.nodeConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.metadata" => Some(("cluster.nodeConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.node-config.image-type" => Some(("cluster.nodeConfig.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.local-ssd-count" => Some(("cluster.nodeConfig.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.cluster-ipv4-cidr" => Some(("cluster.clusterIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.authenticator-groups-config.enabled" => Some(("cluster.authenticatorGroupsConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.authenticator-groups-config.security-group" => Some(("cluster.authenticatorGroupsConfig.securityGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.subnetwork" => Some(("cluster.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.resource-labels" => Some(("cluster.resourceLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.self-link" => Some(("cluster.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3059,7 +3164,7 @@ impl<'n> Engine<'n> { "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "bigquery-destination", "client-certificate", "client-certificate-config", "client-key", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "cluster-ipv4-cidr-block", "cluster-secondary-range-name", "consumption-metering-config", "create-subnetwork", "create-time", "current-master-version", "current-node-count", "current-node-version", "daily-maintenance-window", "dataset-id", "default-max-pods-constraint", "description", "disabled", "disk-size-gb", "disk-type", "duration", "enable-kubernetes-alpha", "enable-network-egress-metering", "enable-private-endpoint", "enable-private-nodes", "enable-tpu", "enabled", "endpoint", "expire-time", "horizontal-pod-autoscaling", "http-load-balancing", "image-type", "initial-cluster-version", "initial-node-count", "instance-group-urls", "ip-allocation-policy", "issue-client-certificate", "kubernetes-dashboard", "label-fingerprint", "labels", "legacy-abac", "local-ssd-count", "location", "locations", "logging-service", "machine-type", "maintenance-policy", "master-auth", "master-authorized-networks-config", "master-ipv4-cidr-block", "max-pods-per-node", "metadata", "min-cpu-platform", "monitoring-service", "name", "network", "network-config", "network-policy", "network-policy-config", "node-config", "node-ipv4-cidr", "node-ipv4-cidr-block", "node-ipv4-cidr-size", "oauth-scopes", "parent", "password", "preemptible", "private-cluster-config", "private-endpoint", "project-id", "provider", "public-endpoint", "resource-labels", "resource-usage-export-config", "self-link", "service-account", "services-ipv4-cidr", "services-ipv4-cidr-block", "services-secondary-range-name", "start-time", "status", "status-message", "subnetwork", "subnetwork-name", "tags", "tpu-ipv4-cidr-block", "use-ip-aliases", "username", "window", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "authenticator-groups-config", "auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoprovisioning-locations", "autoprovisioning-node-pool-defaults", "autoscaling", "bigquery-destination", "binary-authorization", "client-certificate", "client-certificate-config", "client-key", "cloud-run-config", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "cluster-ipv4-cidr-block", "cluster-secondary-range-name", "consume-reservation-type", "consumption-metering-config", "create-subnetwork", "create-time", "current-master-version", "current-node-count", "current-node-version", "daily-maintenance-window", "database-encryption", "dataset-id", "default-max-pods-constraint", "description", "disabled", "disk-size-gb", "disk-type", "duration", "enable-integrity-monitoring", "enable-intra-node-visibility", "enable-kubernetes-alpha", "enable-network-egress-metering", "enable-node-autoprovisioning", "enable-private-endpoint", "enable-private-nodes", "enable-secure-boot", "enable-tpu", "enabled", "end-time", "endpoint", "expire-time", "horizontal-pod-autoscaling", "http-load-balancing", "image-type", "initial-cluster-version", "initial-node-count", "instance-group-urls", "ip-allocation-policy", "issue-client-certificate", "key", "key-name", "kubernetes-dashboard", "label-fingerprint", "labels", "legacy-abac", "local-ssd-count", "location", "locations", "logging-service", "machine-type", "maintenance-policy", "management", "master-auth", "master-authorized-networks-config", "master-ipv4-cidr-block", "max-pods-per-node", "max-surge", "max-unavailable", "metadata", "min-cpu-platform", "mode", "monitoring-service", "name", "network", "network-config", "network-policy", "network-policy-config", "node-config", "node-ipv4-cidr", "node-ipv4-cidr-block", "node-ipv4-cidr-size", "oauth-scopes", "parent", "password", "peering-name", "preemptible", "private-cluster-config", "private-endpoint", "project-id", "provider", "public-endpoint", "recurrence", "recurring-window", "reservation-affinity", "resource-labels", "resource-usage-export-config", "resource-version", "sandbox-config", "security-group", "self-link", "service-account", "services-ipv4-cidr", "services-ipv4-cidr-block", "services-secondary-range-name", "shielded-instance-config", "shielded-nodes", "start-time", "state", "status", "status-message", "subnetwork", "subnetwork-name", "tags", "tpu-ipv4-cidr-block", "type", "upgrade-options", "upgrade-settings", "use-ip-aliases", "username", "values", "vertical-pod-autoscaling", "window", "workload-identity-config", "workload-metadata-config", "workload-pool", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3759,12 +3864,13 @@ impl<'n> Engine<'n> { "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "autoscaling.min-node-count" => Some(("autoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "autoscaling.autoprovisioned" => Some(("autoscaling.autoprovisioned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "autoscaling.enabled" => Some(("autoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "autoscaling.max-node-count" => Some(("autoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool-id" => Some(("nodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["autoscaling", "cluster-id", "enabled", "max-node-count", "min-node-count", "name", "node-pool-id", "project-id", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["autoprovisioned", "autoscaling", "cluster-id", "enabled", "max-node-count", "min-node-count", "name", "node-pool-id", "project-id", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3859,20 +3965,31 @@ impl<'n> Engine<'n> { "node-pool.name" => Some(("nodePool.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.instance-group-urls" => Some(("nodePool.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.autoscaling.min-node-count" => Some(("nodePool.autoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.autoscaling.autoprovisioned" => Some(("nodePool.autoscaling.autoprovisioned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.autoscaling.enabled" => Some(("nodePool.autoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.autoscaling.max-node-count" => Some(("nodePool.autoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.locations" => Some(("nodePool.locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.max-pods-constraint.max-pods-per-node" => Some(("nodePool.maxPodsConstraint.maxPodsPerNode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.version" => Some(("nodePool.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.upgrade-settings.max-surge" => Some(("nodePool.upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.upgrade-settings.max-unavailable" => Some(("nodePool.upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.initial-node-count" => Some(("nodePool.initialNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.pod-ipv4-cidr-size" => Some(("nodePool.podIpv4CidrSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.status-message" => Some(("nodePool.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.reservation-affinity.values" => Some(("nodePool.config.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "node-pool.config.reservation-affinity.key" => Some(("nodePool.config.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.reservation-affinity.consume-reservation-type" => Some(("nodePool.config.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.sandbox-config.type" => Some(("nodePool.config.sandboxConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.machine-type" => Some(("nodePool.config.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.shielded-instance-config.enable-integrity-monitoring" => Some(("nodePool.config.shieldedInstanceConfig.enableIntegrityMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "node-pool.config.shielded-instance-config.enable-secure-boot" => Some(("nodePool.config.shieldedInstanceConfig.enableSecureBoot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.config.tags" => Some(("nodePool.config.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.config.preemptible" => Some(("nodePool.config.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.config.labels" => Some(("nodePool.config.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "node-pool.config.service-account" => Some(("nodePool.config.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.oauth-scopes" => Some(("nodePool.config.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool.config.disk-type" => Some(("nodePool.config.diskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.workload-metadata-config.mode" => Some(("nodePool.config.workloadMetadataConfig.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.disk-size-gb" => Some(("nodePool.config.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.config.min-cpu-platform" => Some(("nodePool.config.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.metadata" => Some(("nodePool.config.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -3880,7 +3997,7 @@ impl<'n> Engine<'n> { "node-pool.config.local-ssd-count" => Some(("nodePool.config.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.self-link" => Some(("nodePool.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoscaling", "cluster-id", "config", "description", "disk-size-gb", "disk-type", "enabled", "image-type", "initial-node-count", "instance-group-urls", "labels", "local-ssd-count", "machine-type", "management", "max-node-count", "max-pods-constraint", "max-pods-per-node", "metadata", "min-cpu-platform", "min-node-count", "name", "node-pool", "oauth-scopes", "parent", "pod-ipv4-cidr-size", "preemptible", "project-id", "self-link", "service-account", "status", "status-message", "tags", "upgrade-options", "version", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoprovisioned", "autoscaling", "cluster-id", "config", "consume-reservation-type", "description", "disk-size-gb", "disk-type", "enable-integrity-monitoring", "enable-secure-boot", "enabled", "image-type", "initial-node-count", "instance-group-urls", "key", "labels", "local-ssd-count", "locations", "machine-type", "management", "max-node-count", "max-pods-constraint", "max-pods-per-node", "max-surge", "max-unavailable", "metadata", "min-cpu-platform", "min-node-count", "mode", "name", "node-pool", "oauth-scopes", "parent", "pod-ipv4-cidr-size", "preemptible", "project-id", "reservation-affinity", "sandbox-config", "self-link", "service-account", "shielded-instance-config", "status", "status-message", "tags", "type", "upgrade-options", "upgrade-settings", "values", "version", "workload-metadata-config", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4407,11 +4524,15 @@ impl<'n> Engine<'n> { "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "locations" => Some(("locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "node-pool-id" => Some(("nodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workload-metadata-config.mode" => Some(("workloadMetadataConfig.mode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "upgrade-settings.max-surge" => Some(("upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "upgrade-settings.max-unavailable" => Some(("upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-version" => Some(("nodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "image-type" => Some(("imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "image-type", "name", "node-pool-id", "node-version", "project-id", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "image-type", "locations", "max-surge", "max-unavailable", "mode", "name", "node-pool-id", "node-version", "project-id", "upgrade-settings", "workload-metadata-config", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4585,13 +4706,17 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.window.recurring-window.recurrence" => Some(("maintenancePolicy.window.recurringWindow.recurrence", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.window.recurring-window.window.end-time" => Some(("maintenancePolicy.window.recurringWindow.window.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.window.recurring-window.window.start-time" => Some(("maintenancePolicy.window.recurringWindow.window.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "maintenance-policy.window.daily-maintenance-window.duration" => Some(("maintenancePolicy.window.dailyMaintenanceWindow.duration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "maintenance-policy.window.daily-maintenance-window.start-time" => Some(("maintenancePolicy.window.dailyMaintenanceWindow.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "maintenance-policy.resource-version" => Some(("maintenancePolicy.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "daily-maintenance-window", "duration", "maintenance-policy", "name", "project-id", "start-time", "window", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["cluster-id", "daily-maintenance-window", "duration", "end-time", "maintenance-policy", "name", "project-id", "recurrence", "recurring-window", "resource-version", "start-time", "window", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4952,26 +5077,45 @@ impl<'n> Engine<'n> { "cluster-id" => Some(("clusterId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "zone" => Some(("zone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-intra-node-visibility-config.enabled" => Some(("update.desiredIntraNodeVisibilityConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-logging-service" => Some(("update.desiredLoggingService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-master-authorized-networks-config.enabled" => Some(("update.desiredMasterAuthorizedNetworksConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-shielded-nodes.enabled" => Some(("update.desiredShieldedNodes.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-id" => Some(("update.desiredNodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-addons-config.http-load-balancing.disabled" => Some(("update.desiredAddonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.network-policy-config.disabled" => Some(("update.desiredAddonsConfig.networkPolicyConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.kubernetes-dashboard.disabled" => Some(("update.desiredAddonsConfig.kubernetesDashboard.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-addons-config.cloud-run-config.disabled" => Some(("update.desiredAddonsConfig.cloudRunConfig.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.horizontal-pod-autoscaling.disabled" => Some(("update.desiredAddonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-vertical-pod-autoscaling.enabled" => Some(("update.desiredVerticalPodAutoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-master-version" => Some(("update.desiredMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-locations" => Some(("update.desiredLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "update.desired-node-version" => Some(("update.desiredNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-image-type" => Some(("update.desiredImageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-binary-authorization.enabled" => Some(("update.desiredBinaryAuthorization.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-database-encryption.state" => Some(("update.desiredDatabaseEncryption.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-database-encryption.key-name" => Some(("update.desiredDatabaseEncryption.keyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-resource-usage-export-config.bigquery-destination.dataset-id" => Some(("update.desiredResourceUsageExportConfig.bigqueryDestination.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-resource-usage-export-config.enable-network-egress-metering" => Some(("update.desiredResourceUsageExportConfig.enableNetworkEgressMetering", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-resource-usage-export-config.consumption-metering-config.enabled" => Some(("update.desiredResourceUsageExportConfig.consumptionMeteringConfig.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-workload-identity-config.workload-pool" => Some(("update.desiredWorkloadIdentityConfig.workloadPool", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-surge" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxSurge", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.upgrade-settings.max-unavailable" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.upgradeSettings.maxUnavailable", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.auto-repair" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.description" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.upgrade-options.auto-upgrade-start-time" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.management.auto-upgrade" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.service-account" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-cluster-autoscaling.autoprovisioning-node-pool-defaults.oauth-scopes" => Some(("update.desiredClusterAutoscaling.autoprovisioningNodePoolDefaults.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.desired-cluster-autoscaling.autoprovisioning-locations" => Some(("update.desiredClusterAutoscaling.autoprovisioningLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.desired-cluster-autoscaling.enable-node-autoprovisioning" => Some(("update.desiredClusterAutoscaling.enableNodeAutoprovisioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-autoscaling.min-node-count" => Some(("update.desiredNodePoolAutoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-node-pool-autoscaling.autoprovisioned" => Some(("update.desiredNodePoolAutoscaling.autoprovisioned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-autoscaling.enabled" => Some(("update.desiredNodePoolAutoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-node-pool-autoscaling.max-node-count" => Some(("update.desiredNodePoolAutoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update.desired-monitoring-service" => Some(("update.desiredMonitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-destination", "cluster-id", "consumption-metering-config", "dataset-id", "desired-addons-config", "desired-image-type", "desired-locations", "desired-logging-service", "desired-master-authorized-networks-config", "desired-master-version", "desired-monitoring-service", "desired-node-pool-autoscaling", "desired-node-pool-id", "desired-node-version", "desired-resource-usage-export-config", "disabled", "enable-network-egress-metering", "enabled", "horizontal-pod-autoscaling", "http-load-balancing", "kubernetes-dashboard", "max-node-count", "min-node-count", "name", "network-policy-config", "project-id", "update", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoprovisioned", "autoprovisioning-locations", "autoprovisioning-node-pool-defaults", "bigquery-destination", "cloud-run-config", "cluster-id", "consumption-metering-config", "dataset-id", "description", "desired-addons-config", "desired-binary-authorization", "desired-cluster-autoscaling", "desired-database-encryption", "desired-image-type", "desired-intra-node-visibility-config", "desired-locations", "desired-logging-service", "desired-master-authorized-networks-config", "desired-master-version", "desired-monitoring-service", "desired-node-pool-autoscaling", "desired-node-pool-id", "desired-node-version", "desired-resource-usage-export-config", "desired-shielded-nodes", "desired-vertical-pod-autoscaling", "desired-workload-identity-config", "disabled", "enable-network-egress-metering", "enable-node-autoprovisioning", "enabled", "horizontal-pod-autoscaling", "http-load-balancing", "key-name", "kubernetes-dashboard", "management", "max-node-count", "max-surge", "max-unavailable", "min-node-count", "name", "network-policy-config", "oauth-scopes", "project-id", "service-account", "state", "update", "upgrade-options", "upgrade-settings", "workload-pool", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6084,7 +6228,10 @@ fn main() { Some(false)), ]), ("locations-clusters-set-locations", - Some(r##"Sets the locations for a specific cluster."##), + Some(r##"Sets the locations for a specific cluster. + Deprecated. Use + [projects.locations.clusters.update](/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + instead."##), "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_locations-clusters-set-locations", vec![ (Some(r##"name"##), @@ -6816,7 +6963,10 @@ fn main() { Some(false)), ]), ("zones-clusters-locations", - Some(r##"Sets the locations for a specific cluster."##), + Some(r##"Sets the locations for a specific cluster. + Deprecated. Use + [projects.locations.clusters.update](/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + instead."##), "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-locations", vec![ (Some(r##"project-id"##), @@ -7497,14 +7647,14 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project + Some(r##"Required. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine + Some(r##"Required. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), Some(true), @@ -7512,7 +7662,7 @@ fn main() { (Some(r##"cluster-id"##), None, - Some(r##"The name of the cluster to update."##), + Some(r##"Required. The name of the cluster to update."##), Some(true), Some(false)), @@ -7875,7 +8025,7 @@ fn main() { let mut app = App::new("container1") .author("Sebastian Thiel ") - .version("1.0.12+20190610") + .version("1.0.13+20200324") .about("Builds and manages container-based applications, powered by the open source Kubernetes technology.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_container1_cli") .arg(Arg::with_name("url") diff --git a/gen/container1/Cargo.toml b/gen/container1/Cargo.toml index 45ba53e75c..727be84b14 100644 --- a/gen/container1/Cargo.toml +++ b/gen/container1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-container1" -version = "1.0.12+20190610" +version = "1.0.13+20200324" authors = ["Sebastian Thiel "] description = "A complete library to interact with Container (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/container1" homepage = "https://cloud.google.com/container-engine/" -documentation = "https://docs.rs/google-container1/1.0.12+20190610" +documentation = "https://docs.rs/google-container1/1.0.13+20200324" license = "MIT" keywords = ["container", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/container1/README.md b/gen/container1/README.md index 26881a0aa9..d523cf8f95 100644 --- a/gen/container1/README.md +++ b/gen/container1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-container1` library allows access to all features of the *Google Container* service. -This documentation was generated from *Container* crate version *1.0.12+20190610*, where *20190610* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Container* crate version *1.0.13+20200324*, where *20200324* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Container* *v1* API can be found at the [official documentation site](https://cloud.google.com/container-engine/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.Container.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.Container.html) ... * projects - * [*aggregated usable subnetworks list*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectAggregatedUsableSubnetworkListCall.html), [*locations clusters complete ip rotation*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterCompleteIpRotationCall.html), [*locations clusters create*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterCreateCall.html), [*locations clusters delete*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterDeleteCall.html), [*locations clusters get*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterGetCall.html), [*locations clusters get jwks*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterGetJwkCall.html), [*locations clusters list*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterListCall.html), [*locations clusters node pools create*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolCreateCall.html), [*locations clusters node pools delete*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolDeleteCall.html), [*locations clusters node pools get*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolGetCall.html), [*locations clusters node pools list*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolListCall.html), [*locations clusters node pools rollback*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolRollbackCall.html), [*locations clusters node pools set autoscaling*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolSetAutoscalingCall.html), [*locations clusters node pools set management*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolSetManagementCall.html), [*locations clusters node pools set size*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolSetSizeCall.html), [*locations clusters node pools update*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterNodePoolUpdateCall.html), [*locations clusters set addons*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetAddonCall.html), [*locations clusters set legacy abac*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetLegacyAbacCall.html), [*locations clusters set locations*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetLocationCall.html), [*locations clusters set logging*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetLoggingCall.html), [*locations clusters set maintenance policy*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetMaintenancePolicyCall.html), [*locations clusters set master auth*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetMasterAuthCall.html), [*locations clusters set monitoring*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetMonitoringCall.html), [*locations clusters set network policy*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetNetworkPolicyCall.html), [*locations clusters set resource labels*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterSetResourceLabelCall.html), [*locations clusters start ip rotation*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterStartIpRotationCall.html), [*locations clusters update*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterUpdateCall.html), [*locations clusters update master*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterUpdateMasterCall.html), [*locations clusters well-known get openid-configuration*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationClusterWellKnownGetOpenidConfigurationCall.html), [*locations get server config*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationGetServerConfigCall.html), [*locations operations cancel*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectLocationOperationListCall.html), [*zones clusters addons*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterAddonCall.html), [*zones clusters complete ip rotation*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterListCall.html), [*zones clusters locations*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterLocationCall.html), [*zones clusters logging*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterLoggingCall.html), [*zones clusters master*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterMasterCall.html), [*zones clusters monitoring*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterMonitoringCall.html), [*zones clusters node pools autoscaling*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolAutoscalingCall.html), [*zones clusters node pools create*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters node pools set size*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolSetSizeCall.html), [*zones clusters node pools update*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterNodePoolUpdateCall.html), [*zones clusters resource labels*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set maintenance policy*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterSetMaintenancePolicyCall.html), [*zones clusters set master auth*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters set network policy*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterSetNetworkPolicyCall.html), [*zones clusters start ip rotation*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.ProjectZoneOperationListCall.html) + * [*aggregated usable subnetworks list*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectAggregatedUsableSubnetworkListCall.html), [*locations clusters complete ip rotation*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterCompleteIpRotationCall.html), [*locations clusters create*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterCreateCall.html), [*locations clusters delete*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterDeleteCall.html), [*locations clusters get*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterGetCall.html), [*locations clusters get jwks*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterGetJwkCall.html), [*locations clusters list*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterListCall.html), [*locations clusters node pools create*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolCreateCall.html), [*locations clusters node pools delete*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolDeleteCall.html), [*locations clusters node pools get*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolGetCall.html), [*locations clusters node pools list*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolListCall.html), [*locations clusters node pools rollback*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolRollbackCall.html), [*locations clusters node pools set autoscaling*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolSetAutoscalingCall.html), [*locations clusters node pools set management*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolSetManagementCall.html), [*locations clusters node pools set size*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolSetSizeCall.html), [*locations clusters node pools update*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterNodePoolUpdateCall.html), [*locations clusters set addons*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetAddonCall.html), [*locations clusters set legacy abac*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetLegacyAbacCall.html), [*locations clusters set locations*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetLocationCall.html), [*locations clusters set logging*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetLoggingCall.html), [*locations clusters set maintenance policy*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetMaintenancePolicyCall.html), [*locations clusters set master auth*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetMasterAuthCall.html), [*locations clusters set monitoring*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetMonitoringCall.html), [*locations clusters set network policy*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetNetworkPolicyCall.html), [*locations clusters set resource labels*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterSetResourceLabelCall.html), [*locations clusters start ip rotation*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterStartIpRotationCall.html), [*locations clusters update*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterUpdateCall.html), [*locations clusters update master*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterUpdateMasterCall.html), [*locations clusters well-known get openid-configuration*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationClusterWellKnownGetOpenidConfigurationCall.html), [*locations get server config*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationGetServerConfigCall.html), [*locations operations cancel*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectLocationOperationListCall.html), [*zones clusters addons*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterAddonCall.html), [*zones clusters complete ip rotation*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterListCall.html), [*zones clusters locations*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterLocationCall.html), [*zones clusters logging*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterLoggingCall.html), [*zones clusters master*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterMasterCall.html), [*zones clusters monitoring*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterMonitoringCall.html), [*zones clusters node pools autoscaling*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolAutoscalingCall.html), [*zones clusters node pools create*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters node pools set size*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolSetSizeCall.html), [*zones clusters node pools update*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterNodePoolUpdateCall.html), [*zones clusters resource labels*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set maintenance policy*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterSetMaintenancePolicyCall.html), [*zones clusters set master auth*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters set network policy*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterSetNetworkPolicyCall.html), [*zones clusters start ip rotation*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.ProjectZoneOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-container1/1.0.12+20190610/google_container1/struct.Container.html)** +* **[Hub](https://docs.rs/google-container1/1.0.13+20200324/google_container1/struct.Container.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.Part.html)** + * **[Parts](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -175,17 +175,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-container1/1.0.12+20190610/google_container1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-container1/1.0.13+20200324/google_container1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-container1/1.0.12+20190610/google_container1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-container1/1.0.13+20200324/google_container1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -195,29 +195,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-container1/1.0.12+20190610/google_container1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-container1/1.0.13+20200324/google_container1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/container1/src/lib.rs b/gen/container1/src/lib.rs index 20dceae3e8..9f932e5dd5 100644 --- a/gen/container1/src/lib.rs +++ b/gen/container1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Container* crate version *1.0.12+20190610*, where *20190610* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Container* crate version *1.0.13+20200324*, where *20200324* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Container* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/container-engine/). @@ -374,7 +374,7 @@ impl<'a, C, A> Container Container { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://container.googleapis.com/".to_string(), _root_url: "https://container.googleapis.com/".to_string(), } @@ -385,7 +385,7 @@ impl<'a, C, A> Container } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -425,22 +425,22 @@ impl<'a, C, A> Container /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetMaintenancePolicyRequest { - /// The Google Developers Console [project ID or project + /// Required. The Google Developers Console [project ID or project /// number](https://support.google.com/cloud/answer/6158840). #[serde(rename="projectId")] pub project_id: Option, - /// The maintenance policy to be set for the cluster. An empty field + /// Required. The maintenance policy to be set for the cluster. An empty field /// clears the existing maintenance policy. #[serde(rename="maintenancePolicy")] pub maintenance_policy: Option, - /// The name of the cluster to update. + /// Required. The name of the cluster to update. #[serde(rename="clusterId")] pub cluster_id: Option, /// The name (project, location, cluster id) of the cluster to set maintenance /// policy. /// Specified in the format 'projects/*/locations/*/clusters/*'. pub name: Option, - /// The name of the Google Compute Engine + /// Required. The name of the Google Compute Engine /// [zone](/compute/docs/zones#available) in which the cluster /// resides. pub zone: Option, @@ -449,6 +449,50 @@ pub struct SetMaintenancePolicyRequest { impl RequestValue for SetMaintenancePolicyRequest {} +/// A set of Shielded Instance options. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShieldedInstanceConfig { + /// Defines whether the instance has integrity monitoring enabled. + /// + /// Enables monitoring and attestation of the boot integrity of the instance. + /// The attestation is performed against the integrity policy baseline. This + /// baseline is initially derived from the implicitly trusted boot image when + /// the instance is created. + #[serde(rename="enableIntegrityMonitoring")] + pub enable_integrity_monitoring: Option, + /// Defines whether the instance has Secure Boot enabled. + /// + /// Secure Boot helps ensure that the system only runs authentic software by + /// verifying the digital signature of all boot components, and halting the + /// boot process if signature verification fails. + #[serde(rename="enableSecureBoot")] + pub enable_secure_boot: Option, +} + +impl Part for ShieldedInstanceConfig {} + + +/// Represents an arbitrary window of time. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TimeWindow { + /// The time that the window ends. The end time should take place after the + /// start time. + #[serde(rename="endTime")] + pub end_time: Option, + /// The time that the window first starts. + #[serde(rename="startTime")] + pub start_time: Option, +} + +impl Part for TimeWindow {} + + /// AcceleratorConfig represents a Hardware Accelerator request. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -459,7 +503,7 @@ pub struct AcceleratorConfig { #[serde(rename="acceleratorCount")] pub accelerator_count: Option, /// The accelerator type resource name. List of supported accelerators - /// [here](/compute/docs/gpus/#Introduction) + /// [here](/compute/docs/gpus) #[serde(rename="acceleratorType")] pub accelerator_type: Option, } @@ -467,6 +511,21 @@ pub struct AcceleratorConfig { impl Part for AcceleratorConfig {} +/// WorkloadMetadataConfig defines the metadata configuration to expose to +/// workloads on the node pool. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkloadMetadataConfig { + /// Mode is the configuration for how to expose metadata to workloads running + /// on the node pool. + pub mode: Option, +} + +impl Part for WorkloadMetadataConfig {} + + /// A generic empty message that you can re-use to avoid defining duplicated /// empty messages in your APIs. A typical example is to use it as the request /// or the response type of an API method. For instance: @@ -518,7 +577,7 @@ pub struct SetNodePoolAutoscalingRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="projectId")] pub project_id: Option, - /// Autoscaling configuration for the node pool. + /// Required. Autoscaling configuration for the node pool. pub autoscaling: Option, /// Deprecated. The name of the cluster to upgrade. /// This field has been deprecated and replaced by the name field. @@ -559,7 +618,7 @@ impl Part for BigQueryDestination {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateClusterRequest { - /// A [cluster + /// Required. A [cluster /// resource](/container-engine/reference/rest/v1/projects.zones.clusters) pub cluster: Option, /// The parent (project and location) where the cluster will be created. @@ -592,18 +651,22 @@ impl RequestValue for CreateClusterRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetOpenIDConfigResponse { - /// supported ID Token signing Algorithms. - pub id_token_signing_alg_values_supported: Option>, - /// Supported claims. - pub claims_supported: Option>, - /// Supported response types. - pub response_types_supported: Option>, /// JSON Web Key uri. pub jwks_uri: Option, + /// OnePlatform automatically extracts this field and uses it to set the HTTP + /// Cache-Control header. + #[serde(rename="cacheHeader")] + pub cache_header: Option, /// Supported grant types. pub grant_types: Option>, /// Supported subject types. pub subject_types_supported: Option>, + /// supported ID Token signing Algorithms. + pub id_token_signing_alg_values_supported: Option>, + /// Supported response types. + pub response_types_supported: Option>, + /// Supported claims. + pub claims_supported: Option>, /// OIDC Issuer. pub issuer: Option, } @@ -631,6 +694,21 @@ pub struct MasterAuthorizedNetworksConfig { impl Part for MasterAuthorizedNetworksConfig {} +/// Configuration for the use of Kubernetes Service Accounts in GCP IAM +/// policies. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkloadIdentityConfig { + /// The workload pool to attach all Kubernetes service accounts to. + #[serde(rename="workloadPool")] + pub workload_pool: Option, +} + +impl Part for WorkloadIdentityConfig {} + + /// Constraints applied to pods. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -662,7 +740,7 @@ pub struct SetAddonsConfigRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="projectId")] pub project_id: Option, - /// The desired configurations for the various addons available to run in the + /// Required. The desired configurations for the various addons available to run in the /// cluster. #[serde(rename="addonsConfig")] pub addons_config: Option, @@ -683,6 +761,47 @@ pub struct SetAddonsConfigRequest { impl RequestValue for SetAddonsConfigRequest {} +/// Represents an arbitrary window of time that recurs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RecurringTimeWindow { + /// An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) for how + /// this window reccurs. They go on for the span of time between the start and + /// end time. + /// + /// For example, to have something repeat every weekday, you'd use: + /// FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR + /// To repeat some window daily (equivalent to the DailyMaintenanceWindow): + /// FREQ=DAILY + /// For the first weekend of every month: + /// FREQ=MONTHLY;BYSETPOS=1;BYDAY=SA,SU + /// This specifies how frequently the window starts. Eg, if you wanted to have + /// a 9-5 UTC-4 window every weekday, you'd use something like: + /// + /// start time = 2019-01-01T09:00:00-0400 + /// end time = 2019-01-01T17:00:00-0400 + /// recurrence = FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR + /// + /// Windows can span multiple days. Eg, to make the window encompass every + /// weekend from midnight Saturday till the last minute of Sunday UTC: + /// + /// start time = 2019-01-05T00:00:00Z + /// end time = 2019-01-07T23:59:00Z + /// recurrence = FREQ=WEEKLY;BYDAY=SA + /// + /// Note the start and end time's specific dates are largely arbitrary except + /// to specify duration of the window and when it first starts. + /// The FREQ values of HOURLY, MINUTELY, and SECONDLY are not supported. + pub recurrence: Option, + /// The window of the first recurrence. + pub window: Option, +} + +impl Part for RecurringTimeWindow {} + + /// Time window specified for daily maintenance operations. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -721,7 +840,7 @@ pub struct UpdateMasterRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="projectId")] pub project_id: Option, - /// The Kubernetes version to change the master to. + /// Required. The Kubernetes version to change the master to. /// /// Users may specify either explicit versions offered by Kubernetes Engine or /// version aliases, which have the following behavior: @@ -750,6 +869,23 @@ pub struct UpdateMasterRequest { impl RequestValue for UpdateMasterRequest {} +/// RFC-2616: cache control support +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HttpCacheControlResponseHeader { + /// 14.6 response cache age, in seconds since the response is generated + pub age: Option, + /// 14.21 response cache expires, in RFC 1123 date format + pub expires: Option, + /// 14.9 request and response directives + pub directive: Option, +} + +impl Part for HttpCacheControlResponseHeader {} + + /// Configuration for client certificates on the cluster. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -780,6 +916,20 @@ pub struct HttpLoadBalancing { impl Part for HttpLoadBalancing {} +/// IntraNodeVisibilityConfig contains the desired config of the intra-node +/// visibility on this cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntraNodeVisibilityConfig { + /// Enables intra node visibility for this cluster. + pub enabled: Option, +} + +impl Part for IntraNodeVisibilityConfig {} + + /// NetworkConfig reports the relative names of network & subnetwork. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -795,6 +945,10 @@ pub struct NetworkConfig { /// the cluster is connected. /// Example: projects/my-project/global/networks/my-network pub network: Option, + /// Whether Intra-node visibility is enabled for this cluster. + /// This makes same node pod to pod traffic visible for VPC network. + #[serde(rename="enableIntraNodeVisibility")] + pub enable_intra_node_visibility: Option, } impl Part for NetworkConfig {} @@ -830,7 +984,7 @@ pub struct CreateNodePoolRequest { /// resides. /// This field has been deprecated and replaced by the parent field. pub zone: Option, - /// The node pool to create. + /// Required. The node pool to create. #[serde(rename="nodePool")] pub node_pool: Option, } @@ -844,9 +998,18 @@ impl RequestValue for CreateNodePoolRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MaintenanceWindow { + /// RecurringWindow specifies some number of recurring time periods for + /// maintenance to occur. The time windows may be overlapping. If no + /// maintenance windows are set, maintenance can occur at any time. + #[serde(rename="recurringWindow")] + pub recurring_window: Option, /// DailyMaintenanceWindow specifies a daily maintenance operation window. #[serde(rename="dailyMaintenanceWindow")] pub daily_maintenance_window: Option, + /// Exceptions to maintenance window. Non-emergency maintenance should not + /// occur in these windows. + #[serde(rename="maintenanceExclusions")] + pub maintenance_exclusions: Option>, } impl Part for MaintenanceWindow {} @@ -886,12 +1049,18 @@ pub struct NodePool { /// Autoscaler configuration for this NodePool. Autoscaler is enabled /// only if a valid configuration is present. pub autoscaling: Option, + /// The list of Google Compute Engine [zones](/compute/docs/zones#available) + /// in which the NodePool's nodes should be located. + pub locations: Option>, /// The constraint on the maximum number of pods that can be run /// simultaneously on a node in the node pool. #[serde(rename="maxPodsConstraint")] pub max_pods_constraint: Option, /// The version of the Kubernetes of this node. pub version: Option, + /// Upgrade settings control disruption and speed of the upgrade. + #[serde(rename="upgradeSettings")] + pub upgrade_settings: Option, /// The initial node count for the pool. You must ensure that your /// Compute Engine resource quota /// is sufficient for this number of instances. You must also have available @@ -914,6 +1083,84 @@ pub struct NodePool { impl ResponseResult for NodePool {} +/// AutoprovisioningNodePoolDefaults contains defaults for a node pool created +/// by NAP. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoprovisioningNodePoolDefaults { + /// The Google Cloud Platform Service Account to be used by the node VMs. If + /// service_account is specified, scopes should be empty. + #[serde(rename="serviceAccount")] + pub service_account: Option, + /// Specifies the node management options for NAP created node-pools. + pub management: Option, + /// Specifies the upgrade settings for NAP created node pools + #[serde(rename="upgradeSettings")] + pub upgrade_settings: Option, + /// Scopes that are used by NAP when creating node pools. If oauth_scopes are + /// specified, service_account should be empty. + #[serde(rename="oauthScopes")] + pub oauth_scopes: Option>, +} + +impl Part for AutoprovisioningNodePoolDefaults {} + + +/// Configuration options for the Cloud Run feature. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CloudRunConfig { + /// Whether Cloud Run addon is enabled for this cluster. + pub disabled: Option, +} + +impl Part for CloudRunConfig {} + + +/// Information about operation (or operation stage) progress. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationProgress { + /// Progress metric bundle, for example: + /// metrics: [{name: "nodes done", int_value: 15}, + /// {name: "nodes total", int_value: 32}] + /// or + /// metrics: [{name: "progress", double_value: 0.56}, + /// {name: "progress scale", double_value: 1.0}] + pub metrics: Option>, + /// Status of an operation stage. + /// Unset for single-stage operations. + pub status: Option, + /// Substages of an operation or a stage. + pub stages: Option>, + /// A non-parameterized string describing an operation stage. + /// Unset for single-stage operations. + pub name: Option, +} + +impl Part for OperationProgress {} + + +/// Configuration for Binary Authorization. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BinaryAuthorization { + /// Enable Binary Authorization for this cluster. If enabled, all container + /// images will be validated by Binary Authorization. + pub enabled: Option, +} + +impl Part for BinaryAuthorization {} + + /// A Google Kubernetes Engine cluster. /// /// # Activities @@ -973,11 +1220,14 @@ pub struct Cluster { /// The logging service the cluster should use to write logs. /// Currently available options: /// - /// * "logging.googleapis.com/kubernetes" - the Google Cloud Logging - /// service with Kubernetes-native resource model in Stackdriver - /// * `logging.googleapis.com` - the Google Cloud Logging service. + /// * `logging.googleapis.com/kubernetes` - The Cloud Logging + /// service with a Kubernetes-native resource model + /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + /// available as of GKE 1.15). /// * `none` - no logs will be exported from the cluster. - /// * if left as an empty string,`logging.googleapis.com` will be used. + /// + /// If left as an empty string,`logging.googleapis.com/kubernetes` will be + /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. #[serde(rename="loggingService")] pub logging_service: Option, /// Deprecated. Use node_pools.instance_group_urls. @@ -987,17 +1237,24 @@ pub struct Cluster { #[serde(rename="networkConfig")] pub network_config: Option, /// The name of this cluster. The name must be unique within this project - /// and zone, and can be up to 40 characters with the following restrictions: + /// and location (e.g. zone or region), and can be up to 40 characters with + /// the following restrictions: /// /// * Lowercase letters, numbers, and hyphens only. /// * Must start with a letter. /// * Must end with a number or a letter. pub name: Option, + /// Shielded Nodes configuration. + #[serde(rename="shieldedNodes")] + pub shielded_nodes: Option, /// [Output only] The name of the Google Compute Engine /// [zone](/compute/docs/regions-zones/regions-zones#available) or /// [region](/compute/docs/regions-zones/regions-zones#available) in which /// the cluster resides. pub location: Option, + /// Configuration for Binary Authorization. + #[serde(rename="binaryAuthorization")] + pub binary_authorization: Option, /// Configuration for exporting resource usages. Resource usage export is /// disabled when this config is unspecified. #[serde(rename="resourceUsageExportConfig")] @@ -1016,6 +1273,9 @@ pub struct Cluster { pub ip_allocation_policy: Option, /// [Output only] The current status of this cluster. pub status: Option, + /// [Output only] The current software version of the master endpoint. + #[serde(rename="currentMasterVersion")] + pub current_master_version: Option, /// An optional description of this cluster. pub description: Option, /// [Output only] Deprecated, use @@ -1025,12 +1285,15 @@ pub struct Cluster { /// upgraded, this reflects the minimum version of all nodes. #[serde(rename="currentNodeVersion")] pub current_node_version: Option, + /// Configuration for the use of Kubernetes Service Accounts in GCP IAM + /// policies. + #[serde(rename="workloadIdentityConfig")] + pub workload_identity_config: Option, /// The fingerprint of the set of labels for this cluster. #[serde(rename="labelFingerprint")] pub label_fingerprint: Option, - /// [Output only] The current software version of the master endpoint. - #[serde(rename="currentMasterVersion")] - pub current_master_version: Option, + /// Cluster-level autoscaling configuration. + pub autoscaling: Option, /// The authentication information for accessing the master endpoint. /// If unspecified, the defaults are used: /// For clusters before v1.12, if master_auth is unspecified, `username` will @@ -1062,15 +1325,23 @@ pub struct Cluster { /// The monitoring service the cluster should use to write metrics. /// Currently available options: /// - /// * `monitoring.googleapis.com` - the Google Cloud Monitoring service. - /// * `none` - no metrics will be exported from the cluster. - /// * if left as an empty string, `monitoring.googleapis.com` will be used. + /// * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + /// service with a Kubernetes-native resource model + /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + /// longer available as of GKE 1.15). + /// * `none` - No metrics will be exported from the cluster. + /// + /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. #[serde(rename="monitoringService")] pub monitoring_service: Option, /// [Output only] The time the cluster was created, in /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. #[serde(rename="createTime")] pub create_time: Option, + /// Configuration of etcd encryption. + #[serde(rename="databaseEncryption")] + pub database_encryption: Option, /// Configuration for private cluster. #[serde(rename="privateClusterConfig")] pub private_cluster_config: Option, @@ -1090,6 +1361,9 @@ pub struct Cluster { /// resides. /// This field is deprecated, use location instead. pub zone: Option, + /// Cluster-level Vertical Pod Autoscaling configuration. + #[serde(rename="verticalPodAutoscaling")] + pub vertical_pod_autoscaling: Option, /// Configuration for the legacy ABAC authorization mode. #[serde(rename="legacyAbac")] pub legacy_abac: Option, @@ -1127,6 +1401,9 @@ pub struct Cluster { /// one automatically chosen or specify a `/14` block in `10.0.0.0/8`. #[serde(rename="clusterIpv4Cidr")] pub cluster_ipv4_cidr: Option, + /// Configuration controlling RBAC group membership information. + #[serde(rename="authenticatorGroupsConfig")] + pub authenticator_groups_config: Option, /// The name of the Google Compute Engine /// [subnetwork](/compute/docs/subnetworks) to which the /// cluster is connected. @@ -1283,11 +1560,57 @@ pub struct GetJSONWebKeysResponse { /// The public component of the keys used by the cluster to sign token /// requests. pub keys: Option>, + /// OnePlatform automatically extracts this field and uses it to set the HTTP + /// Cache-Control header. + #[serde(rename="cacheHeader")] + pub cache_header: Option, } impl ResponseResult for GetJSONWebKeysResponse {} +/// These upgrade settings control the level of parallelism and the level of +/// disruption caused by an upgrade. +/// +/// maxUnavailable controls the number of nodes that can be simultaneously +/// unavailable. +/// +/// maxSurge controls the number of additional nodes that can be added to the +/// node pool temporarily for the time of the upgrade to increase the number of +/// available nodes. +/// +/// (maxUnavailable + maxSurge) determines the level of parallelism (how many +/// nodes are being upgraded at the same time). +/// +/// Note: upgrades inevitably introduce some disruption since workloads need to +/// be moved from old nodes to new, upgraded ones. Even if maxUnavailable=0, +/// this holds true. (Disruption stays within the limits of +/// PodDisruptionBudget, if it is configured.) +/// +/// Consider a hypothetical node pool with 5 nodes having maxSurge=2, +/// maxUnavailable=1. This means the upgrade process upgrades 3 nodes +/// simultaneously. It creates 2 additional (upgraded) nodes, then it brings +/// down 3 old (not yet upgraded) nodes at the same time. This ensures that +/// there are always at least 4 nodes available. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpgradeSettings { + /// The maximum number of nodes that can be created beyond the current size + /// of the node pool during the upgrade process. + #[serde(rename="maxSurge")] + pub max_surge: Option, + /// The maximum number of nodes that can be simultaneously unavailable during + /// the upgrade process. A node is considered available if its status is + /// Ready. + #[serde(rename="maxUnavailable")] + pub max_unavailable: Option, +} + +impl Part for UpgradeSettings {} + + /// This operation resource represents operations that may have happened or are /// happening on the cluster. All fields are output only. /// @@ -1378,10 +1701,12 @@ pub struct Operation { /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. #[serde(rename="startTime")] pub start_time: Option, + /// Output only. [Output only] Progress information for an operation. + pub progress: Option, /// Which conditions caused the current node pool state. #[serde(rename="nodepoolConditions")] pub nodepool_conditions: Option>, - /// If an error has occurred, a textual description of the error. + /// Output only. If an error has occurred, a textual description of the error. #[serde(rename="statusMessage")] pub status_message: Option, /// Which conditions caused the current cluster state. @@ -1401,12 +1726,6 @@ pub struct PrivateClusterConfig { /// Whether the master's internal IP address is used as the cluster endpoint. #[serde(rename="enablePrivateEndpoint")] pub enable_private_endpoint: Option, - /// The IP range in CIDR notation to use for the hosted master network. This - /// range will be used for assigning internal IP addresses to the master or - /// set of masters, as well as the ILB VIP. This range must not overlap with - /// any other ranges in use within the cluster's network. - #[serde(rename="masterIpv4CidrBlock")] - pub master_ipv4_cidr_block: Option, /// Output only. The internal IP address of this cluster's master endpoint. #[serde(rename="privateEndpoint")] pub private_endpoint: Option, @@ -1418,11 +1737,37 @@ pub struct PrivateClusterConfig { /// private networking. #[serde(rename="enablePrivateNodes")] pub enable_private_nodes: Option, + /// The IP range in CIDR notation to use for the hosted master network. This + /// range will be used for assigning internal IP addresses to the master or + /// set of masters, as well as the ILB VIP. This range must not overlap with + /// any other ranges in use within the cluster's network. + #[serde(rename="masterIpv4CidrBlock")] + pub master_ipv4_cidr_block: Option, + /// Output only. The peering name in the customer VPC used by this cluster. + #[serde(rename="peeringName")] + pub peering_name: Option, } impl Part for PrivateClusterConfig {} +/// Configuration of etcd encryption. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DatabaseEncryption { + /// Denotes the state of etcd encryption. + pub state: Option, + /// Name of CloudKMS key to use for the encryption of secrets in etcd. + /// Ex. projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key + #[serde(rename="keyName")] + pub key_name: Option, +} + +impl Part for DatabaseEncryption {} + + /// ClusterUpdate describes an update to the cluster. Exactly one update can /// be applied to a cluster with each request, so at most one field can be /// provided. @@ -1434,15 +1779,19 @@ pub struct ClusterUpdate { /// The logging service the cluster should use to write logs. /// Currently available options: /// - /// * "logging.googleapis.com/kubernetes" - the Google Cloud Logging - /// service with Kubernetes-native resource model in Stackdriver - /// * "logging.googleapis.com" - the Google Cloud Logging service - /// * "none" - no logs will be exported from the cluster + /// * `logging.googleapis.com/kubernetes` - The Cloud Logging + /// service with a Kubernetes-native resource model + /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + /// available as of GKE 1.15). + /// * `none` - no logs will be exported from the cluster. + /// + /// If left as an empty string,`logging.googleapis.com/kubernetes` will be + /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. #[serde(rename="desiredLoggingService")] pub desired_logging_service: Option, - /// The desired configuration options for master authorized networks feature. - #[serde(rename="desiredMasterAuthorizedNetworksConfig")] - pub desired_master_authorized_networks_config: Option, + /// Configurations for the various addons available to run in the cluster. + #[serde(rename="desiredAddonsConfig")] + pub desired_addons_config: Option, /// The desired list of Google Compute Engine /// [zones](/compute/docs/zones#available) in which the cluster's nodes /// should be located. Changing the locations a cluster is in will result @@ -1452,9 +1801,34 @@ pub struct ClusterUpdate { /// This list must always include the cluster's primary zone. #[serde(rename="desiredLocations")] pub desired_locations: Option>, - /// Configurations for the various addons available to run in the cluster. - #[serde(rename="desiredAddonsConfig")] - pub desired_addons_config: Option, + /// The desired image type for the node pool. + /// NOTE: Set the "desired_node_pool" field as well. + #[serde(rename="desiredImageType")] + pub desired_image_type: Option, + /// The desired configuration for exporting resource usage. + #[serde(rename="desiredResourceUsageExportConfig")] + pub desired_resource_usage_export_config: Option, + /// Cluster-level autoscaling configuration. + #[serde(rename="desiredClusterAutoscaling")] + pub desired_cluster_autoscaling: Option, + /// Autoscaler configuration for the node pool specified in + /// desired_node_pool_id. If there is only one pool in the + /// cluster and desired_node_pool_id is not provided then + /// the change applies to that single node pool. + #[serde(rename="desiredNodePoolAutoscaling")] + pub desired_node_pool_autoscaling: Option, + /// The desired config of Intra-node visibility. + #[serde(rename="desiredIntraNodeVisibilityConfig")] + pub desired_intra_node_visibility_config: Option, + /// The desired configuration options for master authorized networks feature. + #[serde(rename="desiredMasterAuthorizedNetworksConfig")] + pub desired_master_authorized_networks_config: Option, + /// The node pool to be upgraded. This field is mandatory if + /// "desired_node_version", "desired_image_family" or + /// "desired_node_pool_autoscaling" is specified and there is more than one + /// node pool on the cluster. + #[serde(rename="desiredNodePoolId")] + pub desired_node_pool_id: Option, /// The Kubernetes version to change the master to. /// /// Users may specify either explicit versions offered by @@ -1467,12 +1841,9 @@ pub struct ClusterUpdate { /// - "-": picks the default Kubernetes version #[serde(rename="desiredMasterVersion")] pub desired_master_version: Option, - /// The node pool to be upgraded. This field is mandatory if - /// "desired_node_version", "desired_image_family" or - /// "desired_node_pool_autoscaling" is specified and there is more than one - /// node pool on the cluster. - #[serde(rename="desiredNodePoolId")] - pub desired_node_pool_id: Option, + /// Cluster-level Vertical Pod Autoscaling configuration. + #[serde(rename="desiredVerticalPodAutoscaling")] + pub desired_vertical_pod_autoscaling: Option, /// The Kubernetes version to change the nodes to (typically an /// upgrade). /// @@ -1486,28 +1857,31 @@ pub struct ClusterUpdate { /// - "-": picks the Kubernetes master version #[serde(rename="desiredNodeVersion")] pub desired_node_version: Option, - /// The desired image type for the node pool. - /// NOTE: Set the "desired_node_pool" field as well. - #[serde(rename="desiredImageType")] - pub desired_image_type: Option, - /// The desired configuration for exporting resource usage. - #[serde(rename="desiredResourceUsageExportConfig")] - pub desired_resource_usage_export_config: Option, - /// Autoscaler configuration for the node pool specified in - /// desired_node_pool_id. If there is only one pool in the - /// cluster and desired_node_pool_id is not provided then - /// the change applies to that single node pool. - #[serde(rename="desiredNodePoolAutoscaling")] - pub desired_node_pool_autoscaling: Option, /// The monitoring service the cluster should use to write metrics. /// Currently available options: /// - /// * "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring - /// service with Kubernetes-native resource model in Stackdriver - /// * "monitoring.googleapis.com" - the Google Cloud Monitoring service - /// * "none" - no metrics will be exported from the cluster + /// * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + /// service with a Kubernetes-native resource model + /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + /// longer available as of GKE 1.15). + /// * `none` - No metrics will be exported from the cluster. + /// + /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. #[serde(rename="desiredMonitoringService")] pub desired_monitoring_service: Option, + /// The desired configuration options for the Binary Authorization feature. + #[serde(rename="desiredBinaryAuthorization")] + pub desired_binary_authorization: Option, + /// Configuration for Workload Identity. + #[serde(rename="desiredWorkloadIdentityConfig")] + pub desired_workload_identity_config: Option, + /// Configuration for Shielded Nodes. + #[serde(rename="desiredShieldedNodes")] + pub desired_shielded_nodes: Option, + /// Configuration of etcd encryption. + #[serde(rename="desiredDatabaseEncryption")] + pub desired_database_encryption: Option, } impl Part for ClusterUpdate {} @@ -1522,8 +1896,8 @@ impl Part for ClusterUpdate {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HorizontalPodAutoscaling { /// Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - /// When enabled, it ensures that a Heapster pod is running in the cluster, - /// which is also used by the Cloud Monitoring service. + /// When enabled, it ensures that metrics are collected into Stackdriver + /// Monitoring. pub disabled: Option, } @@ -1568,14 +1942,12 @@ impl ResponseResult for ServerConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NodeConfig { - /// The number of local SSD disks to be attached to the node. - /// - /// The limit for this value is dependant upon the maximum number of - /// disks available on a machine per zone. See: - /// https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits - /// for more information. - #[serde(rename="localSsdCount")] - pub local_ssd_count: Option, + /// The optional reservation affinity. Setting this field will apply + /// the specified [Zonal Compute + /// Reservation](/compute/docs/instances/reserving-zonal-resources) + /// to this node pool. + #[serde(rename="reservationAffinity")] + pub reservation_affinity: Option, /// The name of a Google Compute Engine [machine /// type](/compute/docs/machine-types) (e.g. /// `n1-standard-1`). @@ -1602,15 +1974,6 @@ pub struct NodeConfig { /// For more information, including usage and the valid values, see: /// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ pub labels: Option>, - /// The Google Cloud Platform Service Account to be used by the node VMs. If - /// no Service Account is specified, the "default" service account is used. - #[serde(rename="serviceAccount")] - pub service_account: Option, - /// List of kubernetes taints to be applied to each node. - /// - /// For more information, including usage and the valid values, see: - /// https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - pub taints: Option>, /// The set of Google API scopes to be made available on all of the /// node VMs under the "default" service account. /// @@ -1627,12 +1990,11 @@ pub struct NodeConfig { /// Monitoring are enabled, in which case their required scopes will be added. #[serde(rename="oauthScopes")] pub oauth_scopes: Option>, - /// Size of the disk attached to each node, specified in GB. - /// The smallest allowed disk size is 10GB. + /// List of kubernetes taints to be applied to each node. /// - /// If unspecified, the default disk size is 100GB. - #[serde(rename="diskSizeGb")] - pub disk_size_gb: Option, + /// For more information, including usage and the valid values, see: + /// https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + pub taints: Option>, /// A list of hardware accelerators to be attached to each node. /// See https://cloud.google.com/compute/docs/gpus for more information about /// support for GPUs. @@ -1646,11 +2008,39 @@ pub struct NodeConfig { /// platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) #[serde(rename="minCpuPlatform")] pub min_cpu_platform: Option, + /// The number of local SSD disks to be attached to the node. + /// + /// The limit for this value is dependent upon the maximum number of + /// disks available on a machine per zone. See: + /// https://cloud.google.com/compute/docs/disks/local-ssd + /// for more information. + #[serde(rename="localSsdCount")] + pub local_ssd_count: Option, + /// Sandbox configuration for this node. + #[serde(rename="sandboxConfig")] + pub sandbox_config: Option, + /// Shielded Instance options. + #[serde(rename="shieldedInstanceConfig")] + pub shielded_instance_config: Option, + /// The Google Cloud Platform Service Account to be used by the node VMs. + /// Specify the email address of the Service Account; otherwise, if no Service + /// Account is specified, the "default" service account is used. + #[serde(rename="serviceAccount")] + pub service_account: Option, /// Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') /// /// If unspecified, the default disk type is 'pd-standard' #[serde(rename="diskType")] pub disk_type: Option, + /// The workload metadata configuration for this node. + #[serde(rename="workloadMetadataConfig")] + pub workload_metadata_config: Option, + /// Size of the disk attached to each node, specified in GB. + /// The smallest allowed disk size is 10GB. + /// + /// If unspecified, the default disk size is 100GB. + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, /// The image type to use for this node. Note that for a given image type, /// the latest version of it will be used. #[serde(rename="imageType")] @@ -1667,8 +2057,9 @@ pub struct NodeConfig { /// "configure-sh" /// "containerd-configure-sh" /// "enable-os-login" - /// "gci-update-strategy" /// "gci-ensure-gke-docker" + /// "gci-metrics-enabled" + /// "gci-update-strategy" /// "instance-template" /// "kube-env" /// "startup-script" @@ -1712,6 +2103,44 @@ pub struct AutoUpgradeOptions { impl Part for AutoUpgradeOptions {} +/// StartIPRotationRequest creates a new IP for the cluster and then performs +/// a node upgrade on each node pool to point to the new IP. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations clusters start ip rotation projects](struct.ProjectLocationClusterStartIpRotationCall.html) (request) +/// * [zones clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StartIPRotationRequest { + /// Deprecated. The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// This field has been deprecated and replaced by the name field. + #[serde(rename="projectId")] + pub project_id: Option, + /// Deprecated. The name of the cluster. + /// This field has been deprecated and replaced by the name field. + #[serde(rename="clusterId")] + pub cluster_id: Option, + /// Whether to rotate credentials during IP rotation. + #[serde(rename="rotateCredentials")] + pub rotate_credentials: Option, + /// The name (project, location, cluster id) of the cluster to start IP + /// rotation. Specified in the format 'projects/*/locations/*/clusters/*'. + pub name: Option, + /// Deprecated. The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// This field has been deprecated and replaced by the name field. + pub zone: Option, +} + +impl RequestValue for StartIPRotationRequest {} + + /// SetMonitoringServiceRequest sets the monitoring service of a cluster. /// /// # Activities @@ -1729,13 +2158,17 @@ pub struct SetMonitoringServiceRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="projectId")] pub project_id: Option, - /// The monitoring service the cluster should use to write metrics. + /// Required. The monitoring service the cluster should use to write metrics. /// Currently available options: /// - /// * "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring - /// service with Kubernetes-native resource model in Stackdriver - /// * "monitoring.googleapis.com" - the Google Cloud Monitoring service - /// * "none" - no metrics will be exported from the cluster + /// * "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring + /// service with a Kubernetes-native resource model + /// * `monitoring.googleapis.com` - The legacy Cloud Monitoring service (no + /// longer available as of GKE 1.15). + /// * `none` - No metrics will be exported from the cluster. + /// + /// If left as an empty string,`monitoring.googleapis.com/kubernetes` will be + /// used for GKE 1.14+ or `monitoring.googleapis.com` for earlier versions. #[serde(rename="monitoringService")] pub monitoring_service: Option, /// Deprecated. The name of the cluster to upgrade. @@ -1796,6 +2229,25 @@ pub struct RollbackNodePoolUpgradeRequest { impl RequestValue for RollbackNodePoolUpgradeRequest {} +/// Contains information about amount of some resource in the cluster. +/// For memory, value should be in GB. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceLimit { + /// Resource name "cpu", "memory" or gpu-specific string. + #[serde(rename="resourceType")] + pub resource_type: Option, + /// Minimum amount of the resource in the cluster. + pub minimum: Option, + /// Maximum amount of the resource in the cluster. + pub maximum: Option, +} + +impl Part for ResourceLimit {} + + /// Configuration for NetworkPolicy. This only tracks whether the addon /// is enabled or not on the Master, it does not track whether network policy /// is enabled for the nodes. @@ -1819,6 +2271,13 @@ impl Part for NetworkPolicyConfig {} pub struct MaintenancePolicy { /// Specifies the maintenance window in which maintenance may be performed. pub window: Option, + /// A hash identifying the version of this policy, so that updates to fields of + /// the policy won't accidentally undo intermediate changes (and so that users + /// of the API unaware of some fields won't accidentally remove other fields). + /// Make a get() request to the cluster to get the current + /// resource version and include it with requests to set the policy. + #[serde(rename="resourceVersion")] + pub resource_version: Option, } impl Part for MaintenancePolicy {} @@ -1853,7 +2312,7 @@ impl Part for NetworkPolicy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetNodePoolManagementRequest { - /// NodeManagement configuration for the node pool. + /// Required. NodeManagement configuration for the node pool. pub management: Option, /// The name (project, location, cluster, node pool id) of the node pool to set /// management properties. Specified in the format @@ -1905,6 +2364,10 @@ pub struct AddonsConfig { /// https://cloud.google.com/kubernetes-engine/docs/concepts/dashboards #[serde(rename="kubernetesDashboard")] pub kubernetes_dashboard: Option, + /// Configuration for the Cloud Run addon, which allows the user to use a + /// managed Knative service. + #[serde(rename="cloudRunConfig")] + pub cloud_run_config: Option, /// Configuration for the horizontal pod autoscaling feature, which /// increases or decreases the number of replica pods a replication controller /// has based on the resource usage of the existing pods. @@ -1979,7 +2442,7 @@ pub struct SetLocationsRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="clusterId")] pub cluster_id: Option, - /// The desired list of Google Compute Engine + /// Required. The desired list of Google Compute Engine /// [zones](/compute/docs/zones#available) in which the cluster's nodes /// should be located. Changing the locations a cluster is in will result /// in nodes being either created or removed from the cluster, depending on @@ -2013,42 +2476,51 @@ pub struct KubernetesDashboard { impl Part for KubernetesDashboard {} -/// StartIPRotationRequest creates a new IP for the cluster and then performs -/// a node upgrade on each node pool to point to the new IP. +/// Configuration for returning group information from authenticators. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations clusters start ip rotation projects](struct.ProjectLocationClusterStartIpRotationCall.html) (request) -/// * [zones clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StartIPRotationRequest { - /// Deprecated. The Google Developers Console [project ID or project - /// number](https://developers.google.com/console/help/new/#projectnumber). - /// This field has been deprecated and replaced by the name field. - #[serde(rename="projectId")] - pub project_id: Option, - /// Deprecated. The name of the cluster. - /// This field has been deprecated and replaced by the name field. - #[serde(rename="clusterId")] - pub cluster_id: Option, - /// Whether to rotate credentials during IP rotation. - #[serde(rename="rotateCredentials")] - pub rotate_credentials: Option, - /// The name (project, location, cluster id) of the cluster to start IP - /// rotation. Specified in the format 'projects/*/locations/*/clusters/*'. - pub name: Option, - /// Deprecated. The name of the Google Compute Engine - /// [zone](/compute/docs/zones#available) in which the cluster - /// resides. - /// This field has been deprecated and replaced by the name field. - pub zone: Option, +pub struct AuthenticatorGroupsConfig { + /// Whether this cluster should return group membership lookups + /// during authentication using a group of security groups. + pub enabled: Option, + /// The name of the security group-of-groups to be used. Only relevant + /// if enabled = true. + #[serde(rename="securityGroup")] + pub security_group: Option, } -impl RequestValue for StartIPRotationRequest {} +impl Part for AuthenticatorGroupsConfig {} + + +/// SandboxConfig contains configurations of the sandbox to use for the node. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SandboxConfig { + /// Type of the sandbox to use for the node. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for SandboxConfig {} + + +/// VerticalPodAutoscaling contains global, per-cluster information +/// required by Vertical Pod Autoscaler to automatically adjust +/// the resources of pods controlled by it. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VerticalPodAutoscaling { + /// Enables vertical pod autoscaling. + pub enabled: Option, +} + +impl Part for VerticalPodAutoscaling {} /// CompleteIPRotationRequest moves the cluster master back into single-IP mode. @@ -2112,7 +2584,7 @@ pub struct SetLabelsRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="projectId")] pub project_id: Option, - /// The fingerprint of the previous set of labels for this resource, + /// Required. The fingerprint of the previous set of labels for this resource, /// used to detect conflicts. The fingerprint is initially generated by /// Kubernetes Engine and changes after every request to modify or update /// labels. You must always provide an up-to-date fingerprint hash when @@ -2124,7 +2596,7 @@ pub struct SetLabelsRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="clusterId")] pub cluster_id: Option, - /// The labels to set for that cluster. + /// Required. The labels to set for that cluster. #[serde(rename="resourceLabels")] pub resource_labels: Option>, } @@ -2132,6 +2604,35 @@ pub struct SetLabelsRequest { impl RequestValue for SetLabelsRequest {} +/// ClusterAutoscaling contains global, per-cluster information +/// required by Cluster Autoscaler to automatically adjust +/// the size of the cluster and create/delete +/// node pools based on the current needs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClusterAutoscaling { + /// AutoprovisioningNodePoolDefaults contains defaults for a node pool + /// created by NAP. + #[serde(rename="autoprovisioningNodePoolDefaults")] + pub autoprovisioning_node_pool_defaults: Option, + /// The list of Google Compute Engine [zones](/compute/docs/zones#available) + /// in which the NodePool's nodes can be created by NAP. + #[serde(rename="autoprovisioningLocations")] + pub autoprovisioning_locations: Option>, + /// Enables automatic node pool creation and deletion. + #[serde(rename="enableNodeAutoprovisioning")] + pub enable_node_autoprovisioning: Option, + /// Contains global constraints regarding minimum and maximum + /// amount of resources in the cluster. + #[serde(rename="resourceLimits")] + pub resource_limits: Option>, +} + +impl Part for ClusterAutoscaling {} + + /// ListClustersResponse is the result of ListClustersRequest. /// /// # Activities @@ -2176,6 +2677,19 @@ pub struct UsableSubnetworkSecondaryRange { impl Part for UsableSubnetworkSecondaryRange {} +/// Configuration of Shielded Nodes feature. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShieldedNodes { + /// Whether Shielded Nodes features are enabled on all nodes in this cluster. + pub enabled: Option, +} + +impl Part for ShieldedNodes {} + + /// Jwk is a JSON Web Key as specified in RFC 7517 /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2290,11 +2804,17 @@ pub struct SetLoggingServiceRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="projectId")] pub project_id: Option, - /// The logging service the cluster should use to write metrics. + /// Required. The logging service the cluster should use to write logs. /// Currently available options: /// - /// * "logging.googleapis.com" - the Google Cloud Logging service - /// * "none" - no metrics will be exported from the cluster + /// * `logging.googleapis.com/kubernetes` - The Cloud Logging + /// service with a Kubernetes-native resource model + /// * `logging.googleapis.com` - The legacy Cloud Logging service (no longer + /// available as of GKE 1.15). + /// * `none` - no logs will be exported from the cluster. + /// + /// If left as an empty string,`logging.googleapis.com/kubernetes` will be + /// used for GKE 1.14+ or `logging.googleapis.com` for earlier versions. #[serde(rename="loggingService")] pub logging_service: Option, /// Deprecated. The name of the cluster to upgrade. @@ -2334,6 +2854,28 @@ pub struct ListNodePoolsResponse { impl ResponseResult for ListNodePoolsResponse {} +/// [ReservationAffinity](/compute/docs/instances/reserving-zonal-resources) is +/// the configuration of desired reservation which instances could take +/// capacity from. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReservationAffinity { + /// Corresponds to the label value(s) of reservation resource(s). + pub values: Option>, + /// Corresponds to the type of reservation consumption. + #[serde(rename="consumeReservationType")] + pub consume_reservation_type: Option, + /// Corresponds to the label key of a reservation resource. To target a + /// SPECIFIC_RESERVATION by name, specify "googleapis.com/reservation-name" as + /// the key and specify the name of your reservation as its value. + pub key: Option, +} + +impl Part for ReservationAffinity {} + + /// StatusCondition describes why a cluster or a node pool has a certain status /// (e.g., ERROR or DEGRADED). /// @@ -2390,7 +2932,7 @@ pub struct SetLegacyAbacRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="clusterId")] pub cluster_id: Option, - /// Whether ABAC authorization will be enabled in the cluster. + /// Required. Whether ABAC authorization will be enabled in the cluster. pub enabled: Option, /// The name (project, location, cluster id) of the cluster to set legacy abac. /// Specified in the format 'projects/*/locations/*/clusters/*'. @@ -2410,6 +2952,28 @@ pub struct SetLegacyAbacRequest { impl RequestValue for SetLegacyAbacRequest {} +/// Progress metric is (string, int|float|string) pair. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Metric { + /// For metrics with custom values (ratios, visual progress, etc.). + #[serde(rename="stringValue")] + pub string_value: Option, + /// For metrics with integer value. + #[serde(rename="intValue")] + pub int_value: Option, + /// For metrics with floating point value. + #[serde(rename="doubleValue")] + pub double_value: Option, + /// Required. Metric name, e.g., "nodes total", "percent done". + pub name: Option, +} + +impl Part for Metric {} + + /// NodePoolAutoscaling contains information required by cluster autoscaler to /// adjust the size of the node pool to the current cluster usage. /// @@ -2421,6 +2985,8 @@ pub struct NodePoolAutoscaling { /// max_node_count. #[serde(rename="minNodeCount")] pub min_node_count: Option, + /// Can this node pool be deleted automatically. + pub autoprovisioned: Option, /// Is autoscaling enabled for this node pool. pub enabled: Option, /// Maximum number of nodes in the NodePool. Must be >= min_node_count. There @@ -2500,7 +3066,7 @@ pub struct UpdateClusterRequest { /// resides. /// This field has been deprecated and replaced by the name field. pub zone: Option, - /// A description of the update. + /// Required. A description of the update. pub update: Option, } @@ -2527,7 +3093,7 @@ pub struct SetMasterAuthRequest { /// resides. /// This field has been deprecated and replaced by the name field. pub zone: Option, - /// The exact form of action to be taken on the master auth. + /// Required. The exact form of action to be taken on the master auth. pub action: Option, /// Deprecated. The Google Developers Console [project ID or project /// number](https://support.google.com/cloud/answer/6158840). @@ -2538,7 +3104,7 @@ pub struct SetMasterAuthRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="clusterId")] pub cluster_id: Option, - /// A description of the update. + /// Required. A description of the update. pub update: Option, } @@ -2574,7 +3140,7 @@ pub struct SetNetworkPolicyRequest { /// resides. /// This field has been deprecated and replaced by the name field. pub zone: Option, - /// Configuration options for the NetworkPolicy feature. + /// Required. Configuration options for the NetworkPolicy feature. #[serde(rename="networkPolicy")] pub network_policy: Option, } @@ -2667,7 +3233,7 @@ pub struct SetNodePoolSizeRequest { /// resides. /// This field has been deprecated and replaced by the name field. pub zone: Option, - /// The desired node count for the pool. + /// Required. The desired node count for the pool. #[serde(rename="nodeCount")] pub node_count: Option, /// Deprecated. The Google Developers Console [project ID or project @@ -2746,7 +3312,27 @@ pub struct UpdateNodePoolRequest { /// This field has been deprecated and replaced by the name field. #[serde(rename="projectId")] pub project_id: Option, - /// The Kubernetes version to change the nodes to (typically an + /// Deprecated. The name of the cluster to upgrade. + /// This field has been deprecated and replaced by the name field. + #[serde(rename="clusterId")] + pub cluster_id: Option, + /// The desired list of Google Compute Engine + /// [zones](/compute/docs/zones#available) in which the node pool's nodes + /// should be located. Changing the locations for a node pool will result + /// in nodes being either created or removed from the node pool, depending + /// on whether locations are being added or removed. + pub locations: Option>, + /// Deprecated. The name of the node pool to upgrade. + /// This field has been deprecated and replaced by the name field. + #[serde(rename="nodePoolId")] + pub node_pool_id: Option, + /// The desired workload metadata config for the node pool. + #[serde(rename="workloadMetadataConfig")] + pub workload_metadata_config: Option, + /// Upgrade settings control disruption and speed of the upgrade. + #[serde(rename="upgradeSettings")] + pub upgrade_settings: Option, + /// Required. The Kubernetes version to change the nodes to (typically an /// upgrade). /// /// Users may specify either explicit versions offered by Kubernetes Engine or @@ -2759,17 +3345,9 @@ pub struct UpdateNodePoolRequest { /// - "-": picks the Kubernetes master version #[serde(rename="nodeVersion")] pub node_version: Option, - /// Deprecated. The name of the cluster to upgrade. - /// This field has been deprecated and replaced by the name field. - #[serde(rename="clusterId")] - pub cluster_id: Option, - /// The desired image type for the node pool. + /// Required. The desired image type for the node pool. #[serde(rename="imageType")] pub image_type: Option, - /// Deprecated. The name of the node pool to upgrade. - /// This field has been deprecated and replaced by the name field. - #[serde(rename="nodePoolId")] - pub node_pool_id: Option, } impl RequestValue for UpdateNodePoolRequest {} @@ -3558,6 +4136,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Sets the locations for a specific cluster. + /// Deprecated. Use + /// [projects.locations.clusters.update](/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + /// instead. /// /// # Arguments /// @@ -3845,12 +4426,12 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project + /// * `projectId` - Required. The Google Developers Console [project ID or project /// number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine + /// * `zone` - Required. The name of the Google Compute Engine /// [zone](/compute/docs/zones#available) in which the cluster /// resides. - /// * `clusterId` - The name of the cluster to update. + /// * `clusterId` - Required. The name of the cluster to update. pub fn zones_clusters_set_maintenance_policy(&self, request: SetMaintenancePolicyRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> { ProjectZoneClusterSetMaintenancePolicyCall { hub: self.hub, @@ -3940,6 +4521,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Sets the locations for a specific cluster. + /// Deprecated. Use + /// [projects.locations.clusters.update](/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) + /// instead. /// /// # Arguments /// @@ -12808,6 +13392,9 @@ impl<'a, C, A> ProjectLocationClusterSetMonitoringCall<'a, C, A> where C: Borrow /// Sets the locations for a specific cluster. +/// Deprecated. Use +/// [projects.locations.clusters.update](/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) +/// instead. /// /// A builder for the *locations.clusters.setLocations* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -16228,7 +16815,7 @@ impl<'a, C, A> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> where C: Bor self._request = new_value; self } - /// The Google Developers Console [project ID or project + /// Required. The Google Developers Console [project ID or project /// number](https://support.google.com/cloud/answer/6158840). /// /// Sets the *project id* path property to the given value. @@ -16239,7 +16826,7 @@ impl<'a, C, A> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> where C: Bor self._project_id = new_value.to_string(); self } - /// The name of the Google Compute Engine + /// Required. The name of the Google Compute Engine /// [zone](/compute/docs/zones#available) in which the cluster /// resides. /// @@ -16251,7 +16838,7 @@ impl<'a, C, A> ProjectZoneClusterSetMaintenancePolicyCall<'a, C, A> where C: Bor self._zone = new_value.to_string(); self } - /// The name of the cluster to update. + /// Required. The name of the cluster to update. /// /// Sets the *cluster id* path property to the given value. /// @@ -17188,6 +17775,9 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut /// Sets the locations for a specific cluster. +/// Deprecated. Use +/// [projects.locations.clusters.update](/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) +/// instead. /// /// A builder for the *zones.clusters.locations* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. diff --git a/gen/containeranalysis1_beta1-cli/Cargo.toml b/gen/containeranalysis1_beta1-cli/Cargo.toml index 56292a0a42..ded438e117 100644 --- a/gen/containeranalysis1_beta1-cli/Cargo.toml +++ b/gen/containeranalysis1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-containeranalysis1_beta1-cli" -version = "1.0.12+20190625" +version = "1.0.13+20200327" authors = ["Sebastian Thiel "] description = "A complete library to interact with Container Analysis (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/containeranalysis1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-containeranalysis1_beta1] path = "../containeranalysis1_beta1" -version = "1.0.12+20190625" +version = "1.0.13+20200327" diff --git a/gen/containeranalysis1_beta1-cli/README.md b/gen/containeranalysis1_beta1-cli/README.md index c112e7291b..bf875c816a 100644 --- a/gen/containeranalysis1_beta1-cli/README.md +++ b/gen/containeranalysis1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Container Analysis* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *Container Analysis* API at revision *20200327*. The CLI is at version *1.0.13*. ```bash containeranalysis1-beta1 [options] diff --git a/gen/containeranalysis1_beta1-cli/mkdocs.yml b/gen/containeranalysis1_beta1-cli/mkdocs.yml index 86774d51ec..daff7420b8 100644 --- a/gen/containeranalysis1_beta1-cli/mkdocs.yml +++ b/gen/containeranalysis1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Container Analysis v1.0.12+20190625 +site_name: Container Analysis v1.0.13+20200327 site_url: http://byron.github.io/google-apis-rs/google-containeranalysis1_beta1-cli site_description: A complete library to interact with Container Analysis (protocol v1beta1) diff --git a/gen/containeranalysis1_beta1-cli/src/main.rs b/gen/containeranalysis1_beta1-cli/src/main.rs index f8675aa8c2..c709043ffe 100644 --- a/gen/containeranalysis1_beta1-cli/src/main.rs +++ b/gen/containeranalysis1_beta1-cli/src/main.rs @@ -170,6 +170,7 @@ impl<'n> Engine<'n> { "vulnerability.cvss-v3.confidentiality-impact" => Some(("vulnerability.cvssV3.confidentialityImpact", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "vulnerability.cvss-score" => Some(("vulnerability.cvssScore", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "vulnerability.severity" => Some(("vulnerability.severity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vulnerability.source-update-time" => Some(("vulnerability.sourceUpdateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deployable.resource-uri" => Some(("deployable.resourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "attestation-authority.hint.human-readable-name" => Some(("attestationAuthority.hint.humanReadableName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -188,7 +189,7 @@ impl<'n> Engine<'n> { "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "discovery.analysis-kind" => Some(("discovery.analysisKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["analysis-kind", "attack-complexity", "attack-vector", "attestation-authority", "availability-impact", "base-image", "base-score", "build", "builder-version", "confidentiality-impact", "create-time", "cvss-score", "cvss-v3", "deployable", "discovery", "expiration-time", "exploitability-score", "fingerprint", "hint", "human-readable-name", "impact-score", "integrity-impact", "key-id", "key-type", "kind", "long-description", "name", "package", "privileges-required", "public-key", "related-note-names", "resource-uri", "resource-url", "scope", "severity", "short-description", "signature", "update-time", "user-interaction", "v1-name", "v2-blob", "v2-name", "vulnerability"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["analysis-kind", "attack-complexity", "attack-vector", "attestation-authority", "availability-impact", "base-image", "base-score", "build", "builder-version", "confidentiality-impact", "create-time", "cvss-score", "cvss-v3", "deployable", "discovery", "expiration-time", "exploitability-score", "fingerprint", "hint", "human-readable-name", "impact-score", "integrity-impact", "key-id", "key-type", "kind", "long-description", "name", "package", "privileges-required", "public-key", "related-note-names", "resource-uri", "resource-url", "scope", "severity", "short-description", "signature", "source-update-time", "update-time", "user-interaction", "v1-name", "v2-blob", "v2-name", "vulnerability"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -379,8 +380,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -604,6 +606,7 @@ impl<'n> Engine<'n> { "vulnerability.cvss-v3.confidentiality-impact" => Some(("vulnerability.cvssV3.confidentialityImpact", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "vulnerability.cvss-score" => Some(("vulnerability.cvssScore", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "vulnerability.severity" => Some(("vulnerability.severity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "vulnerability.source-update-time" => Some(("vulnerability.sourceUpdateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deployable.resource-uri" => Some(("deployable.resourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "attestation-authority.hint.human-readable-name" => Some(("attestationAuthority.hint.humanReadableName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -622,7 +625,7 @@ impl<'n> Engine<'n> { "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "discovery.analysis-kind" => Some(("discovery.analysisKind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["analysis-kind", "attack-complexity", "attack-vector", "attestation-authority", "availability-impact", "base-image", "base-score", "build", "builder-version", "confidentiality-impact", "create-time", "cvss-score", "cvss-v3", "deployable", "discovery", "expiration-time", "exploitability-score", "fingerprint", "hint", "human-readable-name", "impact-score", "integrity-impact", "key-id", "key-type", "kind", "long-description", "name", "package", "privileges-required", "public-key", "related-note-names", "resource-uri", "resource-url", "scope", "severity", "short-description", "signature", "update-time", "user-interaction", "v1-name", "v2-blob", "v2-name", "vulnerability"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["analysis-kind", "attack-complexity", "attack-vector", "attestation-authority", "availability-impact", "base-image", "base-score", "build", "builder-version", "confidentiality-impact", "create-time", "cvss-score", "cvss-v3", "deployable", "discovery", "expiration-time", "exploitability-score", "fingerprint", "hint", "human-readable-name", "impact-score", "integrity-impact", "key-id", "key-type", "kind", "long-description", "name", "package", "privileges-required", "public-key", "related-note-names", "resource-uri", "resource-url", "scope", "severity", "short-description", "signature", "source-update-time", "update-time", "user-interaction", "v1-name", "v2-blob", "v2-name", "vulnerability"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -711,9 +714,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1218,8 +1220,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1627,9 +1630,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2154,7 +2156,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project in the form of `projects/[PROJECT_ID]`, under which + Some(r##"Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which the notes are to be created."##), Some(true), Some(false)), @@ -2183,7 +2185,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project in the form of `projects/[PROJECT_ID]`, under which + Some(r##"Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which the note is to be created."##), Some(true), Some(false)), @@ -2212,7 +2214,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the note in the form of + Some(r##"Required. The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`."##), Some(true), Some(false)), @@ -2235,7 +2237,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the note in the form of + Some(r##"Required. The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`."##), Some(true), Some(false)), @@ -2294,7 +2296,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project to list notes for in the form of + Some(r##"Required. The name of the project to list notes for in the form of `projects/[PROJECT_ID]`."##), Some(true), Some(false)), @@ -2319,7 +2321,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the note to list occurrences for in the form of + Some(r##"Required. The name of the note to list occurrences for in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`."##), Some(true), Some(false)), @@ -2342,7 +2344,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the note in the form of + Some(r##"Required. The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`."##), Some(true), Some(false)), @@ -2442,7 +2444,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project in the form of `projects/[PROJECT_ID]`, under which + Some(r##"Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which the occurrences are to be created."##), Some(true), Some(false)), @@ -2471,7 +2473,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project in the form of `projects/[PROJECT_ID]`, under which + Some(r##"Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which the occurrence is to be created."##), Some(true), Some(false)), @@ -2502,7 +2504,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the occurrence in the form of + Some(r##"Required. The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`."##), Some(true), Some(false)), @@ -2525,7 +2527,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the occurrence in the form of + Some(r##"Required. The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`."##), Some(true), Some(false)), @@ -2585,7 +2587,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the occurrence in the form of + Some(r##"Required. The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`."##), Some(true), Some(false)), @@ -2608,7 +2610,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project to get a vulnerability summary for in the form of + Some(r##"Required. The name of the project to get a vulnerability summary for in the form of `projects/[PROJECT_ID]`."##), Some(true), Some(false)), @@ -2631,7 +2633,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project to list occurrences for in the form of + Some(r##"Required. The name of the project to list occurrences for in the form of `projects/[PROJECT_ID]`."##), Some(true), Some(false)), @@ -2654,7 +2656,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the occurrence in the form of + Some(r##"Required. The name of the occurrence in the form of `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`."##), Some(true), Some(false)), @@ -2754,7 +2756,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the scan configuration in the form of + Some(r##"Required. The name of the scan configuration in the form of `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`."##), Some(true), Some(false)), @@ -2777,7 +2779,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project to list scan configurations for in the form of + Some(r##"Required. The name of the project to list scan configurations for in the form of `projects/[PROJECT_ID]`."##), Some(true), Some(false)), @@ -2800,7 +2802,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the scan configuration in the form of + Some(r##"Required. The name of the scan configuration in the form of `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`."##), Some(true), Some(false)), @@ -2829,7 +2831,7 @@ fn main() { let mut app = App::new("containeranalysis1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200327") .about("An implementation of the Grafeas API, which stores, and enables querying and retrieval of critical metadata about all of your software artifacts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_containeranalysis1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/containeranalysis1_beta1/Cargo.toml b/gen/containeranalysis1_beta1/Cargo.toml index 2a2fa50975..1110308991 100644 --- a/gen/containeranalysis1_beta1/Cargo.toml +++ b/gen/containeranalysis1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-containeranalysis1_beta1" -version = "1.0.12+20190625" +version = "1.0.13+20200327" authors = ["Sebastian Thiel "] description = "A complete library to interact with Container Analysis (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/containeranalysis1_beta1" homepage = "https://cloud.google.com/container-analysis/api/reference/rest/" -documentation = "https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625" +documentation = "https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327" license = "MIT" keywords = ["containeranalysis", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/containeranalysis1_beta1/README.md b/gen/containeranalysis1_beta1/README.md index 4177c0c29c..88177cd0af 100644 --- a/gen/containeranalysis1_beta1/README.md +++ b/gen/containeranalysis1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-containeranalysis1_beta1` library allows access to all features of the *Google Container Analysis* service. -This documentation was generated from *Container Analysis* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *containeranalysis:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Container Analysis* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *containeranalysis:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Container Analysis* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/container-analysis/api/reference/rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ContainerAnalysis.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ContainerAnalysis.html) ... * projects - * [*notes batch create*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteBatchCreateCall.html), [*notes create*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteCreateCall.html), [*notes delete*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteDeleteCall.html), [*notes get*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteGetCall.html), [*notes get iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteGetIamPolicyCall.html), [*notes list*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteListCall.html), [*notes occurrences list*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteOccurrenceListCall.html), [*notes patch*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNotePatchCall.html), [*notes set iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteSetIamPolicyCall.html), [*notes test iam permissions*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectNoteTestIamPermissionCall.html), [*occurrences batch create*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceBatchCreateCall.html), [*occurrences create*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceCreateCall.html), [*occurrences delete*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceDeleteCall.html), [*occurrences get*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetCall.html), [*occurrences get iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetIamPolicyCall.html), [*occurrences get notes*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetNoteCall.html), [*occurrences get vulnerability summary*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetVulnerabilitySummaryCall.html), [*occurrences list*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceListCall.html), [*occurrences patch*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrencePatchCall.html), [*occurrences set iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceSetIamPolicyCall.html), [*occurrences test iam permissions*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectOccurrenceTestIamPermissionCall.html), [*scan configs get*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectScanConfigGetCall.html), [*scan configs list*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectScanConfigListCall.html) and [*scan configs update*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ProjectScanConfigUpdateCall.html) + * [*notes batch create*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteBatchCreateCall.html), [*notes create*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteCreateCall.html), [*notes delete*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteDeleteCall.html), [*notes get*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteGetCall.html), [*notes get iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteGetIamPolicyCall.html), [*notes list*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteListCall.html), [*notes occurrences list*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteOccurrenceListCall.html), [*notes patch*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNotePatchCall.html), [*notes set iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteSetIamPolicyCall.html), [*notes test iam permissions*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectNoteTestIamPermissionCall.html), [*occurrences batch create*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceBatchCreateCall.html), [*occurrences create*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceCreateCall.html), [*occurrences delete*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceDeleteCall.html), [*occurrences get*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetCall.html), [*occurrences get iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetIamPolicyCall.html), [*occurrences get notes*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetNoteCall.html), [*occurrences get vulnerability summary*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceGetVulnerabilitySummaryCall.html), [*occurrences list*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceListCall.html), [*occurrences patch*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrencePatchCall.html), [*occurrences set iam policy*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceSetIamPolicyCall.html), [*occurrences test iam permissions*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectOccurrenceTestIamPermissionCall.html), [*scan configs get*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectScanConfigGetCall.html), [*scan configs list*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectScanConfigListCall.html) and [*scan configs update*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ProjectScanConfigUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/struct.ContainerAnalysis.html)** +* **[Hub](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/struct.ContainerAnalysis.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-containeranalysis1_beta1/1.0.12+20190625/google_containeranalysis1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-containeranalysis1_beta1/1.0.13+20200327/google_containeranalysis1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/containeranalysis1_beta1/src/lib.rs b/gen/containeranalysis1_beta1/src/lib.rs index ebc8adb03d..b4d27214bc 100644 --- a/gen/containeranalysis1_beta1/src/lib.rs +++ b/gen/containeranalysis1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Container Analysis* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *containeranalysis:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Container Analysis* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *containeranalysis:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Container Analysis* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/container-analysis/api/reference/rest/). @@ -334,7 +334,7 @@ impl<'a, C, A> ContainerAnalysis ContainerAnalysis { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://containeranalysis.googleapis.com/".to_string(), _root_url: "https://containeranalysis.googleapis.com/".to_string(), } @@ -345,7 +345,7 @@ impl<'a, C, A> ContainerAnalysis } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -452,16 +452,19 @@ pub struct Detail { pub min_affected_version: Option, /// Required. The name of the package where the vulnerability was found. pub package: Option, - /// The type of package; whether native or non native(ruby gems, node.js - /// packages etc). - #[serde(rename="packageType")] - pub package_type: Option, /// Whether this detail is obsolete. Occurrences are expected not to point to /// obsolete details. #[serde(rename="isObsolete")] pub is_obsolete: Option, - /// Deprecated, do not use. Use fixed_location instead. - /// + /// The type of package; whether native or non native(ruby gems, node.js + /// packages etc). + #[serde(rename="packageType")] + pub package_type: Option, + /// The time this information was last changed at the source. This is an + /// upstream timestamp from the underlying information source - e.g. Ubuntu + /// security tracker. + #[serde(rename="sourceUpdateTime")] + pub source_update_time: Option, /// The max version of the package in which the vulnerability exists. #[serde(rename="maxAffectedVersion")] pub max_affected_version: Option, @@ -550,7 +553,7 @@ impl Part for GenericSignedAttestation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchCreateOccurrencesRequest { - /// The occurrences to create. Max allowed length is 1000. + /// Required. The occurrences to create. Max allowed length is 1000. pub occurrences: Option>, } @@ -676,13 +679,6 @@ pub struct SetIamPolicyRequest { /// valid policy but certain Cloud Platform services (such as Projects) /// might reject them. pub policy: Option, - /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - /// the fields in the mask will be modified. If no mask is provided, the - /// following default mask is used: - /// paths: "bindings, etag" - /// This field is only used by Cloud IAM. - #[serde(rename="updateMask")] - pub update_mask: Option, } impl RequestValue for SetIamPolicyRequest {} @@ -779,7 +775,11 @@ impl ResponseResult for ListScanConfigsResponse {} /// * [occurrences get iam policy projects](struct.ProjectOccurrenceGetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} impl RequestValue for GetIamPolicyRequest {} @@ -1043,7 +1043,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1052,6 +1052,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1199,22 +1219,17 @@ pub struct BuildProvenance { impl Part for BuildProvenance {} -/// Note holding the version of the provider's builder and the signature of the -/// provenance message in the build details occurrence. +/// Details of an attestation occurrence. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Build { - /// Required. Immutable. Version of the builder which produced this build. - #[serde(rename="builderVersion")] - pub builder_version: Option, - /// Signature of the build in occurrences pointing to this build note - /// containing build details. - pub signature: Option, +pub struct Details { + /// Required. Attestation for the resource. + pub attestation: Option, } -impl Part for Build {} +impl Part for Details {} /// Details of a deployment occurrence. @@ -1241,7 +1256,7 @@ impl Part for GrafeasV1beta1DeploymentDetails {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchCreateNotesRequest { - /// The notes to create. Max allowed length is 1000. + /// Required. The notes to create. Max allowed length is 1000. pub notes: Option>, } @@ -1409,50 +1424,68 @@ pub struct Version { impl Part for Version {} -/// Details of an attestation occurrence. +/// Note holding the version of the provider's builder and the signature of the +/// provenance message in the build details occurrence. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Details { - /// Required. Attestation for the resource. - pub attestation: Option, +pub struct Build { + /// Required. Immutable. Version of the builder which produced this build. + #[serde(rename="builderVersion")] + pub builder_version: Option, + /// Signature of the build in occurrences pointing to this build note + /// containing build details. + pub signature: Option, } -impl Part for Details {} +impl Part for Build {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -1460,15 +1493,21 @@ impl Part for Details {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -1481,9 +1520,10 @@ impl Part for Details {} /// * [occurrences get iam policy projects](struct.ProjectOccurrenceGetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Specifies cloud audit logging configuration for this policy. - #[serde(rename="auditConfigs")] - pub audit_configs: Option>, + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. + pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// It is strongly suggested that systems make use of the `etag` in the @@ -1492,13 +1532,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -1746,44 +1805,6 @@ pub struct BuildSignature { impl Part for BuildSignature {} -/// Provides the configuration for logging a type of permissions. -/// Example: -/// -/// ````text -/// { -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// "exempted_members": [ -/// "user:foo@gmail.com" -/// ] -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// } -/// ] -/// } -/// ```` -/// -/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of - /// permission. - /// Follows the same format of Binding.members. - #[serde(rename="exemptedMembers")] - pub exempted_members: Option>, - /// The log type that this config enables. - #[serde(rename="logType")] - pub log_type: Option, -} - -impl Part for AuditLogConfig {} - - /// An entity that can have metadata. For example, a Docker image. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1847,30 +1868,59 @@ pub struct Package { impl Part for Package {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1897,12 +1947,17 @@ pub struct Vulnerability { /// The CVSS score for this vulnerability. #[serde(rename="cvssScore")] pub cvss_score: Option, + /// Note provider assigned impact of the vulnerability. + pub severity: Option, + /// The time this information was last changed at the source. This is an + /// upstream timestamp from the underlying information source - e.g. Ubuntu + /// security tracker. + #[serde(rename="sourceUpdateTime")] + pub source_update_time: Option, /// All information about the package to specifically identify this /// vulnerability. One entry per (version range and cpe_uri) the package /// vulnerability has manifested in. pub details: Option>, - /// Note provider assigned impact of the vulnerability. - pub severity: Option, } impl Part for Vulnerability {} @@ -2219,6 +2274,27 @@ impl RequestValue for Occurrence {} impl ResponseResult for Occurrence {} +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + /// Response for listing notes. /// /// # Activities @@ -2256,75 +2332,6 @@ pub struct Deployable { impl Part for Deployable {} -/// Specifies the audit configuration for a service. -/// The configuration determines which permission types are logged, and what -/// identities, if any, are exempted from logging. -/// An AuditConfig must have one or more AuditLogConfigs. -/// -/// If there are AuditConfigs for both `allServices` and a specific service, -/// the union of the two AuditConfigs is used for that service: the log_types -/// specified in each AuditConfig are enabled, and the exempted_members in each -/// AuditLogConfig are exempted. -/// -/// Example Policy with multiple AuditConfigs: -/// -/// ````text -/// { -/// "audit_configs": [ -/// { -/// "service": "allServices" -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// "exempted_members": [ -/// "user:foo@gmail.com" -/// ] -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// }, -/// { -/// "log_type": "ADMIN_READ", -/// } -/// ] -/// }, -/// { -/// "service": "fooservice.googleapis.com" -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// "exempted_members": [ -/// "user:bar@gmail.com" -/// ] -/// } -/// ] -/// } -/// ] -/// } -/// ```` -/// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuditConfig { - /// The configuration for logging of each type of permission. - #[serde(rename="auditLogConfigs")] - pub audit_log_configs: Option>, - /// Specifies a service that will be enabled for audit logging. - /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - /// `allServices` is a special value that covers all services. - pub service: Option, -} - -impl Part for AuditConfig {} - - /// Per resource and severity counts of fixable and total vulnerabilities. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2397,7 +2404,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the project to list scan configurations for in the form of + /// * `parent` - Required. The name of the project to list scan configurations for in the form of /// `projects/[PROJECT_ID]`. pub fn scan_configs_list(&self, parent: &str) -> ProjectScanConfigListCall<'a, C, A> { ProjectScanConfigListCall { @@ -2472,7 +2479,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the project in the form of `projects/[PROJECT_ID]`, under which + /// * `parent` - Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which /// the occurrences are to be created. pub fn occurrences_batch_create(&self, request: BatchCreateOccurrencesRequest, parent: &str) -> ProjectOccurrenceBatchCreateCall<'a, C, A> { ProjectOccurrenceBatchCreateCall { @@ -2491,7 +2498,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the note in the form of + /// * `name` - Required. The name of the note in the form of /// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. pub fn notes_get(&self, name: &str) -> ProjectNoteGetCall<'a, C, A> { ProjectNoteGetCall { @@ -2509,7 +2516,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the occurrence in the form of + /// * `name` - Required. The name of the occurrence in the form of /// `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. pub fn occurrences_get(&self, name: &str) -> ProjectOccurrenceGetCall<'a, C, A> { ProjectOccurrenceGetCall { @@ -2528,7 +2535,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the note in the form of + /// * `name` - Required. The name of the note in the form of /// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. pub fn notes_patch(&self, request: Note, name: &str) -> ProjectNotePatchCall<'a, C, A> { ProjectNotePatchCall { @@ -2550,7 +2557,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the note to list occurrences for in the form of + /// * `name` - Required. The name of the note to list occurrences for in the form of /// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. pub fn notes_occurrences_list(&self, name: &str) -> ProjectNoteOccurrenceListCall<'a, C, A> { ProjectNoteOccurrenceListCall { @@ -2571,7 +2578,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the project to list notes for in the form of + /// * `parent` - Required. The name of the project to list notes for in the form of /// `projects/[PROJECT_ID]`. pub fn notes_list(&self, parent: &str) -> ProjectNoteListCall<'a, C, A> { ProjectNoteListCall { @@ -2593,7 +2600,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the occurrence in the form of + /// * `name` - Required. The name of the occurrence in the form of /// `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. pub fn occurrences_patch(&self, request: Occurrence, name: &str) -> ProjectOccurrencePatchCall<'a, C, A> { ProjectOccurrencePatchCall { @@ -2613,7 +2620,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the project to get a vulnerability summary for in the form of + /// * `parent` - Required. The name of the project to get a vulnerability summary for in the form of /// `projects/[PROJECT_ID]`. pub fn occurrences_get_vulnerability_summary(&self, parent: &str) -> ProjectOccurrenceGetVulnerabilitySummaryCall<'a, C, A> { ProjectOccurrenceGetVulnerabilitySummaryCall { @@ -2633,7 +2640,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the project in the form of `projects/[PROJECT_ID]`, under which + /// * `parent` - Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which /// the occurrence is to be created. pub fn occurrences_create(&self, request: Occurrence, parent: &str) -> ProjectOccurrenceCreateCall<'a, C, A> { ProjectOccurrenceCreateCall { @@ -2707,7 +2714,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the occurrence in the form of + /// * `name` - Required. The name of the occurrence in the form of /// `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. pub fn occurrences_get_notes(&self, name: &str) -> ProjectOccurrenceGetNoteCall<'a, C, A> { ProjectOccurrenceGetNoteCall { @@ -2726,7 +2733,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the scan configuration in the form of + /// * `name` - Required. The name of the scan configuration in the form of /// `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. pub fn scan_configs_update(&self, request: ScanConfig, name: &str) -> ProjectScanConfigUpdateCall<'a, C, A> { ProjectScanConfigUpdateCall { @@ -2745,7 +2752,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the project to list occurrences for in the form of + /// * `parent` - Required. The name of the project to list occurrences for in the form of /// `projects/[PROJECT_ID]`. pub fn occurrences_list(&self, parent: &str) -> ProjectOccurrenceListCall<'a, C, A> { ProjectOccurrenceListCall { @@ -2768,7 +2775,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the occurrence in the form of + /// * `name` - Required. The name of the occurrence in the form of /// `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. pub fn occurrences_delete(&self, name: &str) -> ProjectOccurrenceDeleteCall<'a, C, A> { ProjectOccurrenceDeleteCall { @@ -2787,7 +2794,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the project in the form of `projects/[PROJECT_ID]`, under which + /// * `parent` - Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which /// the notes are to be created. pub fn notes_batch_create(&self, request: BatchCreateNotesRequest, parent: &str) -> ProjectNoteBatchCreateCall<'a, C, A> { ProjectNoteBatchCreateCall { @@ -2806,7 +2813,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the note in the form of + /// * `name` - Required. The name of the note in the form of /// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. pub fn notes_delete(&self, name: &str) -> ProjectNoteDeleteCall<'a, C, A> { ProjectNoteDeleteCall { @@ -2824,7 +2831,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the scan configuration in the form of + /// * `name` - Required. The name of the scan configuration in the form of /// `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. pub fn scan_configs_get(&self, name: &str) -> ProjectScanConfigGetCall<'a, C, A> { ProjectScanConfigGetCall { @@ -2870,7 +2877,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the project in the form of `projects/[PROJECT_ID]`, under which + /// * `parent` - Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which /// the note is to be created. pub fn notes_create(&self, request: Note, parent: &str) -> ProjectNoteCreateCall<'a, C, A> { ProjectNoteCreateCall { @@ -3109,7 +3116,7 @@ impl<'a, C, A> ProjectScanConfigListCall<'a, C, A> where C: BorrowMut ProjectScanConfigListCall<'a, C, A> where C: BorrowMut ProjectScanConfigListCall<'a, C, A> { @@ -3983,7 +3990,7 @@ impl<'a, C, A> ProjectOccurrenceBatchCreateCall<'a, C, A> where C: BorrowMut ProjectNoteGetCall<'a, C, A> where C: BorrowMut, A } - /// The name of the note in the form of + /// Required. The name of the note in the form of /// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. /// /// Sets the *name* path property to the given value. @@ -4481,7 +4488,7 @@ impl<'a, C, A> ProjectOccurrenceGetCall<'a, C, A> where C: BorrowMut ProjectNotePatchCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The name of the note in the form of + /// Required. The name of the note in the form of /// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. /// /// Sets the *name* path property to the given value. @@ -5039,7 +5046,7 @@ impl<'a, C, A> ProjectNoteOccurrenceListCall<'a, C, A> where C: BorrowMut ProjectNoteListCall<'a, C, A> where C: BorrowMut, } - /// The name of the project to list notes for in the form of + /// Required. The name of the project to list notes for in the form of /// `projects/[PROJECT_ID]`. /// /// Sets the *parent* path property to the given value. @@ -5631,7 +5638,7 @@ impl<'a, C, A> ProjectOccurrencePatchCall<'a, C, A> where C: BorrowMut ProjectOccurrenceGetVulnerabilitySummaryCall<'a, C, A> where C: B } - /// The name of the project to get a vulnerability summary for in the form of + /// Required. The name of the project to get a vulnerability summary for in the form of /// `projects/[PROJECT_ID]`. /// /// Sets the *parent* path property to the given value. @@ -6179,7 +6186,7 @@ impl<'a, C, A> ProjectOccurrenceCreateCall<'a, C, A> where C: BorrowMut ProjectOccurrenceGetNoteCall<'a, C, A> where C: BorrowMut ProjectScanConfigUpdateCall<'a, C, A> where C: BorrowMut ProjectOccurrenceListCall<'a, C, A> where C: BorrowMut ProjectOccurrenceDeleteCall<'a, C, A> where C: BorrowMut ProjectNoteBatchCreateCall<'a, C, A> where C: BorrowMut ProjectNoteDeleteCall<'a, C, A> where C: BorrowMut } - /// The name of the note in the form of + /// Required. The name of the note in the form of /// `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. /// /// Sets the *name* path property to the given value. @@ -8598,7 +8605,7 @@ impl<'a, C, A> ProjectScanConfigGetCall<'a, C, A> where C: BorrowMut ProjectNoteCreateCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The name of the project in the form of `projects/[PROJECT_ID]`, under which + /// Required. The name of the project in the form of `projects/[PROJECT_ID]`, under which /// the note is to be created. /// /// Sets the *parent* path property to the given value. @@ -9181,7 +9188,7 @@ impl<'a, C, A> ProjectNoteCreateCall<'a, C, A> where C: BorrowMut self._parent = new_value.to_string(); self } - /// The ID to use for this note. + /// Required. The ID to use for this note. /// /// Sets the *note id* query property to the given value. pub fn note_id(mut self, new_value: &str) -> ProjectNoteCreateCall<'a, C, A> { diff --git a/gen/content2-cli/Cargo.toml b/gen/content2-cli/Cargo.toml index deecbee591..92f40b09e4 100644 --- a/gen/content2-cli/Cargo.toml +++ b/gen/content2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200310" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-content2] path = "../content2" -version = "1.0.12+20190702" +version = "1.0.13+20200310" diff --git a/gen/content2-cli/README.md b/gen/content2-cli/README.md index 77fd48b984..f8e4a49d2d 100644 --- a/gen/content2-cli/README.md +++ b/gen/content2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Shopping Content* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Shopping Content* API at revision *20200310*. The CLI is at version *1.0.13*. ```bash content2 [options] @@ -38,7 +38,6 @@ content2 [options] insert (-r )... [-p ]... [-o ] link (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] accountstatuses custombatch (-r )... [-p ]... [-o ] @@ -48,7 +47,6 @@ content2 [options] custombatch (-r )... [-p ]... [-o ] get [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] datafeeds custombatch (-r )... [-p ]... [-o ] @@ -57,7 +55,6 @@ content2 [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] datafeedstatuses custombatch (-r )... [-p ]... [-o ] @@ -72,7 +69,6 @@ content2 [options] getaccessiblegmbaccounts [-p ]... [-o ] list [-p ]... [-o ] listposdataproviders [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] requestgmbaccess [-p ]... [-o ] requestinventoryverification [-p ]... [-o ] setinventoryverificationcontact [-p ]... [-o ] @@ -81,11 +77,6 @@ content2 [options] orderinvoices createchargeinvoice (-r )... [-p ]... [-o ] createrefundinvoice (-r )... [-p ]... [-o ] - orderpayments - notifyauthapproved (-r )... [-p ]... [-o ] - notifyauthdeclined (-r )... [-p ]... [-o ] - notifycharge (-r )... [-p ]... [-o ] - notifyrefund (-r )... [-p ]... [-o ] orderreports listdisbursements [-p ]... [-o ] listtransactions [-p ]... [-o ] @@ -138,8 +129,8 @@ content2 [options] get [-p ]... [-o ] getsupportedcarriers [-p ]... [-o ] getsupportedholidays [-p ]... [-o ] + getsupportedpickupservices [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] content2 --help diff --git a/gen/content2-cli/mkdocs.yml b/gen/content2-cli/mkdocs.yml index 0cab9e2bbf..05d97631be 100644 --- a/gen/content2-cli/mkdocs.yml +++ b/gen/content2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v1.0.12+20190702 +site_name: Shopping Content v1.0.13+20200310 site_url: http://byron.github.io/google-apis-rs/google-content2-cli site_description: A complete library to interact with Shopping Content (protocol v2) @@ -17,7 +17,6 @@ pages: - ['accounts_insert.md', 'Accounts', 'Insert'] - ['accounts_link.md', 'Accounts', 'Link'] - ['accounts_list.md', 'Accounts', 'List'] -- ['accounts_patch.md', 'Accounts', 'Patch'] - ['accounts_update.md', 'Accounts', 'Update'] - ['accountstatuses_custombatch.md', 'Accountstatuses', 'Custombatch'] - ['accountstatuses_get.md', 'Accountstatuses', 'Get'] @@ -25,7 +24,6 @@ pages: - ['accounttax_custombatch.md', 'Accounttax', 'Custombatch'] - ['accounttax_get.md', 'Accounttax', 'Get'] - ['accounttax_list.md', 'Accounttax', 'List'] -- ['accounttax_patch.md', 'Accounttax', 'Patch'] - ['accounttax_update.md', 'Accounttax', 'Update'] - ['datafeeds_custombatch.md', 'Datafeeds', 'Custombatch'] - ['datafeeds_delete.md', 'Datafeeds', 'Delete'] @@ -33,7 +31,6 @@ pages: - ['datafeeds_get.md', 'Datafeeds', 'Get'] - ['datafeeds_insert.md', 'Datafeeds', 'Insert'] - ['datafeeds_list.md', 'Datafeeds', 'List'] -- ['datafeeds_patch.md', 'Datafeeds', 'Patch'] - ['datafeeds_update.md', 'Datafeeds', 'Update'] - ['datafeedstatuses_custombatch.md', 'Datafeedstatuses', 'Custombatch'] - ['datafeedstatuses_get.md', 'Datafeedstatuses', 'Get'] @@ -45,7 +42,6 @@ pages: - ['liasettings_getaccessiblegmbaccounts.md', 'Liasettings', 'Getaccessiblegmbaccounts'] - ['liasettings_list.md', 'Liasettings', 'List'] - ['liasettings_listposdataproviders.md', 'Liasettings', 'Listposdataproviders'] -- ['liasettings_patch.md', 'Liasettings', 'Patch'] - ['liasettings_requestgmbaccess.md', 'Liasettings', 'Requestgmbaccess'] - ['liasettings_requestinventoryverification.md', 'Liasettings', 'Requestinventoryverification'] - ['liasettings_setinventoryverificationcontact.md', 'Liasettings', 'Setinventoryverificationcontact'] @@ -53,10 +49,6 @@ pages: - ['liasettings_update.md', 'Liasettings', 'Update'] - ['orderinvoices_createchargeinvoice.md', 'Orderinvoices', 'Createchargeinvoice'] - ['orderinvoices_createrefundinvoice.md', 'Orderinvoices', 'Createrefundinvoice'] -- ['orderpayments_notifyauthapproved.md', 'Orderpayments', 'Notifyauthapproved'] -- ['orderpayments_notifyauthdeclined.md', 'Orderpayments', 'Notifyauthdeclined'] -- ['orderpayments_notifycharge.md', 'Orderpayments', 'Notifycharge'] -- ['orderpayments_notifyrefund.md', 'Orderpayments', 'Notifyrefund'] - ['orderreports_listdisbursements.md', 'Orderreports', 'Listdisbursements'] - ['orderreports_listtransactions.md', 'Orderreports', 'Listtransactions'] - ['orderreturns_get.md', 'Orderreturns', 'Get'] @@ -102,8 +94,8 @@ pages: - ['shippingsettings_get.md', 'Shippingsettings', 'Get'] - ['shippingsettings_getsupportedcarriers.md', 'Shippingsettings', 'Getsupportedcarriers'] - ['shippingsettings_getsupportedholidays.md', 'Shippingsettings', 'Getsupportedholidays'] +- ['shippingsettings_getsupportedpickupservices.md', 'Shippingsettings', 'Getsupportedpickupservices'] - ['shippingsettings_list.md', 'Shippingsettings', 'List'] -- ['shippingsettings_patch.md', 'Shippingsettings', 'Patch'] - ['shippingsettings_update.md', 'Shippingsettings', 'Update'] theme: readthedocs diff --git a/gen/content2-cli/src/main.rs b/gen/content2-cli/src/main.rs index 9e4ff0a84f..eb46f189a3 100644 --- a/gen/content2-cli/src/main.rs +++ b/gen/content2-cli/src/main.rs @@ -597,112 +597,6 @@ impl<'n> Engine<'n> { } } - fn _accounts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "reviews-url" => Some(("reviewsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "adult-content" => Some(("adultContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "website-url" => Some(("websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.phone-number" => Some(("businessInformation.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.customer-service.url" => Some(("businessInformation.customerService.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.customer-service.phone-number" => Some(("businessInformation.customerService.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.customer-service.email" => Some(("businessInformation.customerService.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.address.postal-code" => Some(("businessInformation.address.postalCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.address.country" => Some(("businessInformation.address.country", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.address.region" => Some(("businessInformation.address.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.address.street-address" => Some(("businessInformation.address.streetAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "business-information.address.locality" => Some(("businessInformation.address.locality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "google-my-business-link.status" => Some(("googleMyBusinessLink.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "google-my-business-link.gmb-email" => Some(("googleMyBusinessLink.gmbEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "seller-id" => Some(("sellerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "adult-content", "business-information", "country", "customer-service", "email", "gmb-email", "google-my-business-link", "id", "kind", "locality", "name", "phone-number", "postal-code", "region", "reviews-url", "seller-id", "status", "street-address", "url", "website-url"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Account = json::value::from_value(object).unwrap(); - let mut call = self.hub.accounts().patch(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["dry-run"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _accounts_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1210,96 +1104,6 @@ impl<'n> Engine<'n> { } } - fn _accounttax_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "kind"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::AccountTax = json::value::from_value(object).unwrap(); - let mut call = self.hub.accounttax().patch(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["dry-run"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _accounttax_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1802,115 +1606,6 @@ impl<'n> Engine<'n> { } } - fn _datafeeds_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-type" => Some(("contentType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "content-language" => Some(("contentLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "format.file-encoding" => Some(("format.fileEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "format.quoting-mode" => Some(("format.quotingMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "format.column-delimiter" => Some(("format.columnDelimiter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fetch-schedule.username" => Some(("fetchSchedule.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fetch-schedule.hour" => Some(("fetchSchedule.hour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "fetch-schedule.fetch-url" => Some(("fetchSchedule.fetchUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fetch-schedule.paused" => Some(("fetchSchedule.paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "fetch-schedule.weekday" => Some(("fetchSchedule.weekday", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fetch-schedule.time-zone" => Some(("fetchSchedule.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fetch-schedule.password" => Some(("fetchSchedule.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fetch-schedule.minute-of-hour" => Some(("fetchSchedule.minuteOfHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "fetch-schedule.day-of-month" => Some(("fetchSchedule.dayOfMonth", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "target-country" => Some(("targetCountry", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "file-name" => Some(("fileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "intended-destinations" => Some(("intendedDestinations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "attribute-language" => Some(("attributeLanguage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["attribute-language", "column-delimiter", "content-language", "content-type", "day-of-month", "fetch-schedule", "fetch-url", "file-encoding", "file-name", "format", "hour", "id", "intended-destinations", "kind", "minute-of-hour", "name", "password", "paused", "quoting-mode", "target-country", "time-zone", "username", "weekday"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Datafeed = json::value::from_value(object).unwrap(); - let mut call = self.hub.datafeeds().patch(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("datafeed-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["dry-run"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _datafeeds_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2723,96 +2418,6 @@ impl<'n> Engine<'n> { } } - fn _liasettings_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "kind"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::LiaSettings = json::value::from_value(object).unwrap(); - let mut call = self.hub.liasettings().patch(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["dry-run"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _liasettings_requestgmbaccess(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.liasettings().requestgmbaccess(opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or(""), opt.value_of("gmb-email").unwrap_or("")); @@ -3311,353 +2916,6 @@ impl<'n> Engine<'n> { } } - fn _orderpayments_notifyauthapproved(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "auth-amount-tax.currency" => Some(("authAmountTax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-amount-tax.value" => Some(("authAmountTax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-amount-pretax.currency" => Some(("authAmountPretax.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-amount-pretax.value" => Some(("authAmountPretax.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-amount-pretax", "auth-amount-tax", "currency", "value"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::OrderpaymentsNotifyAuthApprovedRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.orderpayments().notifyauthapproved(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _orderpayments_notifyauthdeclined(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "decline-reason" => Some(("declineReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["decline-reason"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::OrderpaymentsNotifyAuthDeclinedRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.orderpayments().notifyauthdeclined(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _orderpayments_notifycharge(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "charge-state" => Some(("chargeState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "invoice-id" => Some(("invoiceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "invoice-ids" => Some(("invoiceIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["charge-state", "invoice-id", "invoice-ids"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::OrderpaymentsNotifyChargeRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.orderpayments().notifycharge(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _orderpayments_notifyrefund(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "invoice-id" => Some(("invoiceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "refund-state" => Some(("refundState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "invoice-ids" => Some(("invoiceIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["invoice-id", "invoice-ids", "refund-state"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::OrderpaymentsNotifyRefundRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.orderpayments().notifyrefund(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _orderreports_listdisbursements(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.orderreports().listdisbursements(opt.value_of("merchant-id").unwrap_or(""), opt.value_of("disbursement-start-date").unwrap_or("")); @@ -4350,9 +3608,10 @@ impl<'n> Engine<'n> { "test-order.payment-method.expiration-year" => Some(("testOrder.paymentMethod.expirationYear", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "test-order.payment-method.last-four-digits" => Some(("testOrder.paymentMethod.lastFourDigits", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-order.payment-method.predefined-billing-address" => Some(("testOrder.paymentMethod.predefinedBillingAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-order.predefined-pickup-details" => Some(("testOrder.predefinedPickupDetails", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-name" => Some(("templateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["country", "currency", "customer", "email", "enable-orderinvoices", "expiration-month", "expiration-year", "explicit-marketing-preference", "full-name", "kind", "last-four-digits", "last-updated-timestamp", "marketing-rights-info", "notification-mode", "payment-method", "predefined-billing-address", "predefined-delivery-address", "shipping-cost", "shipping-cost-tax", "shipping-option", "template-name", "test-order", "type", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["country", "currency", "customer", "email", "enable-orderinvoices", "expiration-month", "expiration-year", "explicit-marketing-preference", "full-name", "kind", "last-four-digits", "last-updated-timestamp", "marketing-rights-info", "notification-mode", "payment-method", "predefined-billing-address", "predefined-delivery-address", "predefined-pickup-details", "shipping-cost", "shipping-cost-tax", "shipping-option", "template-name", "test-order", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -7123,18 +6382,12 @@ impl<'n> Engine<'n> { } } - fn _shippingsettings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + fn _shippingsettings_getsupportedpickupservices(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.shippingsettings().list(opt.value_of("merchant-id").unwrap_or("")); + let mut call = self.hub.shippingsettings().getsupportedpickupservices(opt.value_of("merchant-id").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { - "page-token" => { - call = call.page_token(value.unwrap_or("")); - }, - "max-results" => { - call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); - }, _ => { let mut found = false; for param in &self.gp { @@ -7148,7 +6401,6 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "max-results"].iter().map(|v|*v)); v } )); } } @@ -7182,47 +6434,17 @@ impl<'n> Engine<'n> { } } - fn _shippingsettings_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + fn _shippingsettings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::ShippingSettings = json::value::from_value(object).unwrap(); - let mut call = self.hub.shippingsettings().patch(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); + let mut call = self.hub.shippingsettings().list(opt.value_of("merchant-id").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "boolean")); + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, _ => { let mut found = false; @@ -7237,7 +6459,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["dry-run"].iter().map(|v|*v)); + v.extend(["page-token", "max-results"].iter().map(|v|*v)); v } )); } } @@ -7391,9 +6613,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._accounts_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._accounts_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._accounts_update(opt, dry_run, &mut err); }, @@ -7431,9 +6650,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._accounttax_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._accounttax_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._accounttax_update(opt, dry_run, &mut err); }, @@ -7463,9 +6679,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._datafeeds_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._datafeeds_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._datafeeds_update(opt, dry_run, &mut err); }, @@ -7523,9 +6736,6 @@ impl<'n> Engine<'n> { ("listposdataproviders", Some(opt)) => { call_result = self._liasettings_listposdataproviders(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._liasettings_patch(opt, dry_run, &mut err); - }, ("requestgmbaccess", Some(opt)) => { call_result = self._liasettings_requestgmbaccess(opt, dry_run, &mut err); }, @@ -7561,26 +6771,6 @@ impl<'n> Engine<'n> { } } }, - ("orderpayments", Some(opt)) => { - match opt.subcommand() { - ("notifyauthapproved", Some(opt)) => { - call_result = self._orderpayments_notifyauthapproved(opt, dry_run, &mut err); - }, - ("notifyauthdeclined", Some(opt)) => { - call_result = self._orderpayments_notifyauthdeclined(opt, dry_run, &mut err); - }, - ("notifycharge", Some(opt)) => { - call_result = self._orderpayments_notifycharge(opt, dry_run, &mut err); - }, - ("notifyrefund", Some(opt)) => { - call_result = self._orderpayments_notifyrefund(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("orderpayments".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("orderreports", Some(opt)) => { match opt.subcommand() { ("listdisbursements", Some(opt)) => { @@ -7766,12 +6956,12 @@ impl<'n> Engine<'n> { ("getsupportedholidays", Some(opt)) => { call_result = self._shippingsettings_getsupportedholidays(opt, dry_run, &mut err); }, + ("getsupportedpickupservices", Some(opt)) => { + call_result = self._shippingsettings_getsupportedpickupservices(opt, dry_run, &mut err); + }, ("list", Some(opt)) => { call_result = self._shippingsettings_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._shippingsettings_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._shippingsettings_update(opt, dry_run, &mut err); }, @@ -7863,7 +7053,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("accounts", "methods: 'authinfo', 'claimwebsite', 'custombatch', 'delete', 'get', 'insert', 'link', 'list', 'patch' and 'update'", vec![ + ("accounts", "methods: 'authinfo', 'claimwebsite', 'custombatch', 'delete', 'get', 'insert', 'link', 'list' and 'update'", vec![ ("authinfo", Some(r##"Returns information about the authenticated user."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_authinfo", @@ -8058,40 +7248,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates a Merchant Center account. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_patch", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), - Some(true), - Some(false)), - - (Some(r##"account-id"##), - None, - Some(r##"The ID of the account."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -8209,7 +7365,7 @@ fn main() { ]), ]), - ("accounttax", "methods: 'custombatch', 'get', 'list', 'patch' and 'update'", vec![ + ("accounttax", "methods: 'custombatch', 'get', 'list' and 'update'", vec![ ("custombatch", Some(r##"Retrieves and updates tax settings of multiple accounts in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_custombatch", @@ -8276,40 +7432,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates the tax settings of the account. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounttax_patch", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), - Some(true), - Some(false)), - - (Some(r##"account-id"##), - None, - Some(r##"The ID of the account for which to get/update account tax settings."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -8352,7 +7474,7 @@ fn main() { ]), ]), - ("datafeeds", "methods: 'custombatch', 'delete', 'fetchnow', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("datafeeds", "methods: 'custombatch', 'delete', 'fetchnow', 'get', 'insert', 'list' and 'update'", vec![ ("custombatch", Some(r##"Deletes, fetches, gets, inserts and updates multiple datafeeds in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_custombatch", @@ -8497,40 +7619,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates a datafeed configuration of your Merchant Center account. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/datafeeds_patch", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the account that manages the datafeed. This account cannot be a multi-client account."##), - Some(true), - Some(false)), - - (Some(r##"datafeed-id"##), - None, - Some(r##"The ID of the datafeed."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -8713,7 +7801,7 @@ fn main() { ]), ]), - ("liasettings", "methods: 'custombatch', 'get', 'getaccessiblegmbaccounts', 'list', 'listposdataproviders', 'patch', 'requestgmbaccess', 'requestinventoryverification', 'setinventoryverificationcontact', 'setposdataprovider' and 'update'", vec![ + ("liasettings", "methods: 'custombatch', 'get', 'getaccessiblegmbaccounts', 'list', 'listposdataproviders', 'requestgmbaccess', 'requestinventoryverification', 'setinventoryverificationcontact', 'setposdataprovider' and 'update'", vec![ ("custombatch", Some(r##"Retrieves and/or updates the LIA settings of multiple accounts in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/liasettings_custombatch", @@ -8824,40 +7912,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates the LIA settings of the account. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/liasettings_patch", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), - Some(true), - Some(false)), - - (Some(r##"account-id"##), - None, - Some(r##"The ID of the account for which to get or update LIA settings."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -9125,145 +8179,6 @@ fn main() { ]), ]), - ("orderpayments", "methods: 'notifyauthapproved', 'notifyauthdeclined', 'notifycharge' and 'notifyrefund'", vec![ - ("notifyauthapproved", - Some(r##"Notify about successfully authorizing user's payment method for a given amount."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orderpayments_notifyauthapproved", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), - Some(true), - Some(false)), - - (Some(r##"order-id"##), - None, - Some(r##"The ID of the order for for which payment authorization is happening."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("notifyauthdeclined", - Some(r##"Notify about failure to authorize user's payment method."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orderpayments_notifyauthdeclined", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), - Some(true), - Some(false)), - - (Some(r##"order-id"##), - None, - Some(r##"The ID of the order for which payment authorization was declined."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("notifycharge", - Some(r##"Notify about charge on user's selected payments method."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orderpayments_notifycharge", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), - Some(true), - Some(false)), - - (Some(r##"order-id"##), - None, - Some(r##"The ID of the order for which charge is happening."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("notifyrefund", - Some(r##"Notify about refund on user's selected payments method."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orderpayments_notifyrefund", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the account that manages the order. This cannot be a multi-client account."##), - Some(true), - Some(false)), - - (Some(r##"order-id"##), - None, - Some(r##"The ID of the order for which charge is happening."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ]), - ("orderreports", "methods: 'listdisbursements' and 'listtransactions'", vec![ ("listdisbursements", Some(r##"Retrieves a report for disbursements from your Merchant Center account."##), @@ -9716,7 +8631,7 @@ fn main() { Some(false)), ]), ("instorerefundlineitem", - Some(r##"Notifies that item return and refund was handled directly by merchant outside of Google payments processing (e.g. cash refund done in store). + Some(r##"Deprecated. Notifies that item return and refund was handled directly by merchant outside of Google payments processing (e.g. cash refund done in store). Note: We recommend calling the returnrefundlineitem method to refund in-store returns. We will issue the refund directly to the customer. This helps to prevent possible differences arising between merchant and Google transaction records. We also recommend having the point of sale system communicate with Google to ensure that customers do not receive a double refund by first refunding via Google then via an in-store return."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_instorerefundlineitem", vec![ @@ -10399,7 +9314,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the products in your Merchant Center account."##), + Some(r##"Lists the products in your Merchant Center account. The response might contain fewer items than specified by maxResults. Rely on nextPageToken to determine if there are more items to be requested."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/products_list", vec![ (Some(r##"merchant-id"##), @@ -10497,7 +9412,7 @@ fn main() { ]), ]), - ("shippingsettings", "methods: 'custombatch', 'get', 'getsupportedcarriers', 'getsupportedholidays', 'list', 'patch' and 'update'", vec![ + ("shippingsettings", "methods: 'custombatch', 'get', 'getsupportedcarriers', 'getsupportedholidays', 'getsupportedpickupservices', 'list' and 'update'", vec![ ("custombatch", Some(r##"Retrieves and updates the shipping settings of multiple accounts in a single request."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_custombatch", @@ -10592,13 +9507,13 @@ fn main() { Some(false), Some(false)), ]), - ("list", - Some(r##"Lists the shipping settings of the sub-accounts in your Merchant Center account."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_list", + ("getsupportedpickupservices", + Some(r##"Retrieves supported pickup services for an account."##), + "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_getsupportedpickupservices", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account. This must be a multi-client account."##), + Some(r##"The ID of the account for which to retrieve the supported pickup services."##), Some(true), Some(false)), @@ -10614,28 +9529,16 @@ fn main() { Some(false), Some(false)), ]), - ("patch", - Some(r##"Updates the shipping settings of the account. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_patch", + ("list", + Some(r##"Lists the shipping settings of the sub-accounts in your Merchant Center account."##), + "Details at http://byron.github.io/google-apis-rs/google_content2_cli/shippingsettings_list", vec![ (Some(r##"merchant-id"##), None, - Some(r##"The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account."##), + Some(r##"The ID of the managing account. This must be a multi-client account."##), Some(true), Some(false)), - (Some(r##"account-id"##), - None, - Some(r##"The ID of the account for which to get/update shipping settings."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), @@ -10688,7 +9591,7 @@ fn main() { let mut app = App::new("content2") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200310") .about("Manages product items, inventory, and Merchant Center accounts for Google Shopping.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_content2_cli") .arg(Arg::with_name("url") diff --git a/gen/content2/Cargo.toml b/gen/content2/Cargo.toml index 045b988726..9d4821a83b 100644 --- a/gen/content2/Cargo.toml +++ b/gen/content2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-content2" -version = "1.0.12+20190702" +version = "1.0.13+20200310" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2" homepage = "https://developers.google.com/shopping-content" -documentation = "https://docs.rs/google-content2/1.0.12+20190702" +documentation = "https://docs.rs/google-content2/1.0.13+20200310" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/content2/README.md b/gen/content2/README.md index 51550d6b6a..fab83cbfc5 100644 --- a/gen/content2/README.md +++ b/gen/content2/README.md @@ -5,46 +5,44 @@ DO NOT EDIT ! --> The `google-content2` library allows access to all features of the *Google Shopping Content* service. -This documentation was generated from *Shopping Content* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Shopping Content* crate version *1.0.13+20200310*, where *20200310* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Shopping Content* *v2* API can be found at the [official documentation site](https://developers.google.com/shopping-content). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShoppingContent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShoppingContent.html) ... -* [accounts](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.Account.html) - * [*authinfo*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountAuthinfoCall.html), [*claimwebsite*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountClaimwebsiteCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountInsertCall.html), [*link*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountLinkCall.html), [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountUpdateCall.html) +* [accounts](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.Account.html) + * [*authinfo*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountAuthinfoCall.html), [*claimwebsite*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountClaimwebsiteCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountInsertCall.html), [*link*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountLinkCall.html), [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountListCall.html) and [*update*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountUpdateCall.html) * accountstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccountstatuseListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccountstatuseListCall.html) * accounttax - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccounttaxCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccounttaxGetCall.html), [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccounttaxListCall.html), [*patch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccounttaxPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.AccounttaxUpdateCall.html) -* [datafeeds](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.Datafeed.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedDeleteCall.html), [*fetchnow*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedFetchnowCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedListCall.html), [*patch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedUpdateCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccounttaxCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccounttaxGetCall.html), [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccounttaxListCall.html) and [*update*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.AccounttaxUpdateCall.html) +* [datafeeds](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.Datafeed.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedDeleteCall.html), [*fetchnow*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedFetchnowCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedListCall.html) and [*update*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedUpdateCall.html) * datafeedstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.DatafeedstatuseListCall.html) -* [inventory](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.Inventory.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.InventoryCustombatchCall.html) and [*set*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.InventorySetCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.DatafeedstatuseListCall.html) +* [inventory](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.Inventory.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.InventoryCustombatchCall.html) and [*set*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.InventorySetCall.html) * liasettings - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingGetCall.html), [*getaccessiblegmbaccounts*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingGetaccessiblegmbaccountCall.html), [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingListCall.html), [*listposdataproviders*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingListposdataproviderCall.html), [*patch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingPatchCall.html), [*requestgmbaccess*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingRequestgmbaccesCall.html), [*requestinventoryverification*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingRequestinventoryverificationCall.html), [*setinventoryverificationcontact*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingSetinventoryverificationcontactCall.html), [*setposdataprovider*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingSetposdataproviderCall.html) and [*update*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.LiasettingUpdateCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingGetCall.html), [*getaccessiblegmbaccounts*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingGetaccessiblegmbaccountCall.html), [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingListCall.html), [*listposdataproviders*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingListposdataproviderCall.html), [*requestgmbaccess*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingRequestgmbaccesCall.html), [*requestinventoryverification*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingRequestinventoryverificationCall.html), [*setinventoryverificationcontact*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingSetinventoryverificationcontactCall.html), [*setposdataprovider*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingSetposdataproviderCall.html) and [*update*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.LiasettingUpdateCall.html) * orderinvoices - * [*createchargeinvoice*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderinvoiceCreatechargeinvoiceCall.html) and [*createrefundinvoice*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderinvoiceCreaterefundinvoiceCall.html) -* orderpayments - * [*notifyauthapproved*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderpaymentNotifyauthapprovedCall.html), [*notifyauthdeclined*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderpaymentNotifyauthdeclinedCall.html), [*notifycharge*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderpaymentNotifychargeCall.html) and [*notifyrefund*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderpaymentNotifyrefundCall.html) + * [*createchargeinvoice*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderinvoiceCreatechargeinvoiceCall.html) and [*createrefundinvoice*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderinvoiceCreaterefundinvoiceCall.html) * orderreports - * [*listdisbursements*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderreportListdisbursementCall.html) and [*listtransactions*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderreportListtransactionCall.html) + * [*listdisbursements*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderreportListdisbursementCall.html) and [*listtransactions*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderreportListtransactionCall.html) * orderreturns - * [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderreturnGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderreturnListCall.html) -* [orders](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.Order.html) - * [*acknowledge*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderCancellineitemCall.html), [*canceltestorderbycustomer*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderCanceltestorderbycustomerCall.html), [*createtestorder*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderCreatetestorderCall.html), [*createtestreturn*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderCreatetestreturnCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderGettestordertemplateCall.html), [*instorerefundlineitem*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderInstorerefundlineitemCall.html), [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderRefundCall.html), [*rejectreturnlineitem*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderRejectreturnlineitemCall.html), [*returnlineitem*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderReturnlineitemCall.html), [*returnrefundlineitem*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderReturnrefundlineitemCall.html), [*setlineitemmetadata*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.OrderUpdateshipmentCall.html) + * [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderreturnGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderreturnListCall.html) +* [orders](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderCancellineitemCall.html), [*canceltestorderbycustomer*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderCanceltestorderbycustomerCall.html), [*createtestorder*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderCreatetestorderCall.html), [*createtestreturn*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderCreatetestreturnCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderGettestordertemplateCall.html), [*instorerefundlineitem*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderInstorerefundlineitemCall.html), [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderRefundCall.html), [*rejectreturnlineitem*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderRejectreturnlineitemCall.html), [*returnlineitem*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderReturnlineitemCall.html), [*returnrefundlineitem*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderReturnrefundlineitemCall.html), [*setlineitemmetadata*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.OrderUpdateshipmentCall.html) * pos - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.PoCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.PoDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.PoGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.PoInsertCall.html), [*inventory*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.PoInventoryCall.html), [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.PoListCall.html) and [*sale*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.PoSaleCall.html) -* [products](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.Product.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductInsertCall.html) and [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.PoCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.PoDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.PoGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.PoInsertCall.html), [*inventory*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.PoInventoryCall.html), [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.PoListCall.html) and [*sale*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.PoSaleCall.html) +* [products](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.Product.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductInsertCall.html) and [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductListCall.html) * productstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ProductstatuseListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ProductstatuseListCall.html) * shippingsettings - * [*custombatch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShippingsettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShippingsettingGetsupportedcarrierCall.html), [*getsupportedholidays*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShippingsettingGetsupportedholidayCall.html), [*list*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShippingsettingListCall.html), [*patch*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShippingsettingPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShippingsettingUpdateCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShippingsettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShippingsettingGetsupportedcarrierCall.html), [*getsupportedholidays*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShippingsettingGetsupportedholidayCall.html), [*getsupportedpickupservices*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShippingsettingGetsupportedpickupserviceCall.html), [*list*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShippingsettingListCall.html) and [*update*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShippingsettingUpdateCall.html) @@ -53,17 +51,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-content2/1.0.12+20190702/google_content2/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2/1.0.13+20200310/google_content2/struct.ShoppingContent.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -182,17 +180,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-content2/1.0.12+20190702/google_content2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-content2/1.0.13+20200310/google_content2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-content2/1.0.12+20190702/google_content2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-content2/1.0.13+20200310/google_content2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -202,29 +200,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-content2/1.0.12+20190702/google_content2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2/1.0.13+20200310/google_content2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/content2/src/lib.rs b/gen/content2/src/lib.rs index bea2d37edd..b0b6612d44 100644 --- a/gen/content2/src/lib.rs +++ b/gen/content2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Shopping Content* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Shopping Content* crate version *1.0.13+20200310*, where *20200310* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Shopping Content* *v2* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content). @@ -12,23 +12,21 @@ //! Handle the following *Resources* with ease from the central [hub](struct.ShoppingContent.html) ... //! //! * [accounts](struct.Account.html) -//! * [*authinfo*](struct.AccountAuthinfoCall.html), [*claimwebsite*](struct.AccountClaimwebsiteCall.html), [*custombatch*](struct.AccountCustombatchCall.html), [*delete*](struct.AccountDeleteCall.html), [*get*](struct.AccountGetCall.html), [*insert*](struct.AccountInsertCall.html), [*link*](struct.AccountLinkCall.html), [*list*](struct.AccountListCall.html), [*patch*](struct.AccountPatchCall.html) and [*update*](struct.AccountUpdateCall.html) +//! * [*authinfo*](struct.AccountAuthinfoCall.html), [*claimwebsite*](struct.AccountClaimwebsiteCall.html), [*custombatch*](struct.AccountCustombatchCall.html), [*delete*](struct.AccountDeleteCall.html), [*get*](struct.AccountGetCall.html), [*insert*](struct.AccountInsertCall.html), [*link*](struct.AccountLinkCall.html), [*list*](struct.AccountListCall.html) and [*update*](struct.AccountUpdateCall.html) //! * accountstatuses //! * [*custombatch*](struct.AccountstatuseCustombatchCall.html), [*get*](struct.AccountstatuseGetCall.html) and [*list*](struct.AccountstatuseListCall.html) //! * accounttax -//! * [*custombatch*](struct.AccounttaxCustombatchCall.html), [*get*](struct.AccounttaxGetCall.html), [*list*](struct.AccounttaxListCall.html), [*patch*](struct.AccounttaxPatchCall.html) and [*update*](struct.AccounttaxUpdateCall.html) +//! * [*custombatch*](struct.AccounttaxCustombatchCall.html), [*get*](struct.AccounttaxGetCall.html), [*list*](struct.AccounttaxListCall.html) and [*update*](struct.AccounttaxUpdateCall.html) //! * [datafeeds](struct.Datafeed.html) -//! * [*custombatch*](struct.DatafeedCustombatchCall.html), [*delete*](struct.DatafeedDeleteCall.html), [*fetchnow*](struct.DatafeedFetchnowCall.html), [*get*](struct.DatafeedGetCall.html), [*insert*](struct.DatafeedInsertCall.html), [*list*](struct.DatafeedListCall.html), [*patch*](struct.DatafeedPatchCall.html) and [*update*](struct.DatafeedUpdateCall.html) +//! * [*custombatch*](struct.DatafeedCustombatchCall.html), [*delete*](struct.DatafeedDeleteCall.html), [*fetchnow*](struct.DatafeedFetchnowCall.html), [*get*](struct.DatafeedGetCall.html), [*insert*](struct.DatafeedInsertCall.html), [*list*](struct.DatafeedListCall.html) and [*update*](struct.DatafeedUpdateCall.html) //! * datafeedstatuses //! * [*custombatch*](struct.DatafeedstatuseCustombatchCall.html), [*get*](struct.DatafeedstatuseGetCall.html) and [*list*](struct.DatafeedstatuseListCall.html) //! * [inventory](struct.Inventory.html) //! * [*custombatch*](struct.InventoryCustombatchCall.html) and [*set*](struct.InventorySetCall.html) //! * liasettings -//! * [*custombatch*](struct.LiasettingCustombatchCall.html), [*get*](struct.LiasettingGetCall.html), [*getaccessiblegmbaccounts*](struct.LiasettingGetaccessiblegmbaccountCall.html), [*list*](struct.LiasettingListCall.html), [*listposdataproviders*](struct.LiasettingListposdataproviderCall.html), [*patch*](struct.LiasettingPatchCall.html), [*requestgmbaccess*](struct.LiasettingRequestgmbaccesCall.html), [*requestinventoryverification*](struct.LiasettingRequestinventoryverificationCall.html), [*setinventoryverificationcontact*](struct.LiasettingSetinventoryverificationcontactCall.html), [*setposdataprovider*](struct.LiasettingSetposdataproviderCall.html) and [*update*](struct.LiasettingUpdateCall.html) +//! * [*custombatch*](struct.LiasettingCustombatchCall.html), [*get*](struct.LiasettingGetCall.html), [*getaccessiblegmbaccounts*](struct.LiasettingGetaccessiblegmbaccountCall.html), [*list*](struct.LiasettingListCall.html), [*listposdataproviders*](struct.LiasettingListposdataproviderCall.html), [*requestgmbaccess*](struct.LiasettingRequestgmbaccesCall.html), [*requestinventoryverification*](struct.LiasettingRequestinventoryverificationCall.html), [*setinventoryverificationcontact*](struct.LiasettingSetinventoryverificationcontactCall.html), [*setposdataprovider*](struct.LiasettingSetposdataproviderCall.html) and [*update*](struct.LiasettingUpdateCall.html) //! * orderinvoices //! * [*createchargeinvoice*](struct.OrderinvoiceCreatechargeinvoiceCall.html) and [*createrefundinvoice*](struct.OrderinvoiceCreaterefundinvoiceCall.html) -//! * orderpayments -//! * [*notifyauthapproved*](struct.OrderpaymentNotifyauthapprovedCall.html), [*notifyauthdeclined*](struct.OrderpaymentNotifyauthdeclinedCall.html), [*notifycharge*](struct.OrderpaymentNotifychargeCall.html) and [*notifyrefund*](struct.OrderpaymentNotifyrefundCall.html) //! * orderreports //! * [*listdisbursements*](struct.OrderreportListdisbursementCall.html) and [*listtransactions*](struct.OrderreportListtransactionCall.html) //! * orderreturns @@ -42,7 +40,7 @@ //! * productstatuses //! * [*custombatch*](struct.ProductstatuseCustombatchCall.html), [*get*](struct.ProductstatuseGetCall.html) and [*list*](struct.ProductstatuseListCall.html) //! * shippingsettings -//! * [*custombatch*](struct.ShippingsettingCustombatchCall.html), [*get*](struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](struct.ShippingsettingGetsupportedcarrierCall.html), [*getsupportedholidays*](struct.ShippingsettingGetsupportedholidayCall.html), [*list*](struct.ShippingsettingListCall.html), [*patch*](struct.ShippingsettingPatchCall.html) and [*update*](struct.ShippingsettingUpdateCall.html) +//! * [*custombatch*](struct.ShippingsettingCustombatchCall.html), [*get*](struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](struct.ShippingsettingGetsupportedcarrierCall.html), [*getsupportedholidays*](struct.ShippingsettingGetsupportedholidayCall.html), [*getsupportedpickupservices*](struct.ShippingsettingGetsupportedpickupserviceCall.html), [*list*](struct.ShippingsettingListCall.html) and [*update*](struct.ShippingsettingUpdateCall.html) //! //! //! @@ -382,7 +380,7 @@ impl<'a, C, A> ShoppingContent ShoppingContent { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/content/v2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -412,9 +410,6 @@ impl<'a, C, A> ShoppingContent pub fn orderinvoices(&'a self) -> OrderinvoiceMethods<'a, C, A> { OrderinvoiceMethods { hub: &self } } - pub fn orderpayments(&'a self) -> OrderpaymentMethods<'a, C, A> { - OrderpaymentMethods { hub: &self } - } pub fn orderreports(&'a self) -> OrderreportMethods<'a, C, A> { OrderreportMethods { hub: &self } } @@ -438,7 +433,7 @@ impl<'a, C, A> ShoppingContent } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -476,6 +471,10 @@ pub struct OrdersCustomBatchRequestEntryUpdateShipment { #[serde(rename="deliveryDate")] pub delivery_date: Option, /// New status for the shipment. Not updated if missing. + /// + /// Acceptable values are: + /// - "delivered" + /// - "undeliverable" pub status: Option, /// The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, @@ -582,8 +581,17 @@ impl Part for AccountUser {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccountsCustomBatchRequestEntryLinkRequest { /// Action to perform for this link. The "request" action is only available to select merchants. + /// + /// Acceptable values are: + /// - "approve" + /// - "remove" + /// - "request" pub action: Option, /// Type of the link between the two accounts. + /// + /// Acceptable values are: + /// - "channelPartner" + /// - "eCommercePlatform" #[serde(rename="linkType")] pub link_type: Option, /// The ID of the linked account. @@ -740,6 +748,11 @@ pub struct OrderLineItemProduct { /// The REST ID of the product. pub id: Option, /// Condition or state of the item. + /// + /// Acceptable values are: + /// - "new" + /// - "refurbished" + /// - "used" pub condition: Option, /// The CLDR territory code of the target country of the product. #[serde(rename="targetCountry")] @@ -755,6 +768,10 @@ pub struct OrderLineItemProduct { /// Price of the item. pub price: Option, /// The item's channel (online or local). + /// + /// Acceptable values are: + /// - "local" + /// - "online" pub channel: Option, } @@ -771,8 +788,18 @@ pub struct LiaInventorySettings { #[serde(rename="inventoryVerificationContactEmail")] pub inventory_verification_contact_email: Option, /// The status of the inventory verification process. + /// + /// Acceptable values are: + /// - "active" + /// - "inactive" + /// - "pending" pub status: Option, /// The status of the verification contact. + /// + /// Acceptable values are: + /// - "active" + /// - "inactive" + /// - "pending" #[serde(rename="inventoryVerificationContactStatus")] pub inventory_verification_contact_status: Option, /// The name of the contact for the inventory verification process. @@ -783,28 +810,7 @@ pub struct LiaInventorySettings { impl Part for LiaInventorySettings {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifyauthdeclined orderpayments](struct.OrderpaymentNotifyauthdeclinedCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyAuthDeclinedResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#orderpaymentsNotifyAuthDeclinedResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrderpaymentsNotifyAuthDeclinedResponse {} - - -/// Account data. After the creation of a new account it may take a few minutes before it is fully operational. The methods delete, insert, patch, and update require the admin role. +/// Account data. After the creation of a new account it may take a few minutes before it is fully operational. The methods delete, insert, and update require the admin role. /// /// # Activities /// @@ -812,7 +818,6 @@ impl ResponseResult for OrderpaymentsNotifyAuthDeclinedResponse {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [custombatch accounts](struct.AccountCustombatchCall.html) (none) -/// * [patch accounts](struct.AccountPatchCall.html) (request|response) /// * [get accounts](struct.AccountGetCall.html) (response) /// * [update accounts](struct.AccountUpdateCall.html) (request|response) /// * [list accounts](struct.AccountListCall.html) (none) @@ -829,7 +834,7 @@ pub struct Account { pub reviews_url: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#account". pub kind: Option, - /// Display name for the account. + /// Required. Display name for the account. pub name: Option, /// List of linked YouTube channels that are active or pending approval. To create a new link request, add a new link with status active to the list. It will remain in a pending state until approved or rejected in the YT Creator Studio interface. To delete an active link, or to cancel a link request, remove it from the list. #[serde(rename="youtubeChannelLinks")] @@ -837,7 +842,7 @@ pub struct Account { /// Indicates whether the merchant sells adult content. #[serde(rename="adultContent")] pub adult_content: Option, - /// Merchant Center account ID. + /// Required for update. Merchant Center account ID. pub id: Option, /// The merchant's website. #[serde(rename="websiteUrl")] @@ -893,6 +898,21 @@ impl ResponseResult for LiasettingsListResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCustomBatchRequestEntryReturnLineItem { /// The reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -917,6 +937,10 @@ impl Part for OrdersCustomBatchRequestEntryReturnLineItem {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderCustomerMarketingRightsInfo { /// Last known customer selection regarding marketing preferences. In certain cases this selection might not be known, so this field would be empty. If a customer selected granted in their most recent order, they can be subscribed to marketing emails. Customers who have chosen denied must not be subscribed, or must be unsubscribed if already opted-in. + /// + /// Acceptable values are: + /// - "denied" + /// - "granted" #[serde(rename="explicitMarketingPreference")] pub explicit_marketing_preference: Option, /// Timestamp when last time marketing preference was updated. Could be empty, if user wasn't offered a selection yet. @@ -1087,6 +1111,24 @@ impl Part for AccountStatusItemLevelIssue {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCustomBatchRequestEntryRefund { /// The reason for the refund. + /// + /// Acceptable values are: + /// - "adjustment" + /// - "courtesyAdjustment" + /// - "customerCanceled" + /// - "customerDiscretionaryReturn" + /// - "deliveredLateByCarrier" + /// - "feeAdjustment" + /// - "lateShipmentCredit" + /// - "noInventory" + /// - "other" + /// - "priceError" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "shippingCostAdjustment" + /// - "taxAdjustment" + /// - "undeliverableShippingAddress" + /// - "wrongProductShipped" pub reason: Option, /// Deprecated. Please use amountPretax and amountTax instead. pub amount: Option, @@ -1104,6 +1146,27 @@ pub struct OrdersCustomBatchRequestEntryRefund { impl Part for OrdersCustomBatchRequestEntryRefund {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [getsupportedpickupservices shippingsettings](struct.ShippingsettingGetsupportedpickupserviceCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ShippingsettingsGetSupportedPickupServicesResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsGetSupportedPickupServicesResponse". + pub kind: Option, + /// A list of supported pickup services. May be empty. + #[serde(rename="pickupServices")] + pub pickup_services: Option>, +} + +impl ResponseResult for ShippingsettingsGetSupportedPickupServicesResponse {} + + /// There is no detailed description. /// /// # Activities @@ -1137,6 +1200,9 @@ pub struct InvoiceSummaryAdditionalChargeSummary { #[serde(rename="totalAmount")] pub total_amount: Option, /// [required] Type of the additional charge. + /// + /// Acceptable values are: + /// - "shipping" #[serde(rename="type")] pub type_: Option, } @@ -1160,9 +1226,20 @@ pub struct TestOrderPaymentMethod { #[serde(rename="expirationYear")] pub expiration_year: Option, /// The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder. + /// + /// Acceptable values are: + /// - "AMEX" + /// - "DISCOVER" + /// - "MASTERCARD" + /// - "VISA" #[serde(rename="type")] pub type_: Option, /// The billing address. + /// + /// Acceptable values are: + /// - "dwight" + /// - "jim" + /// - "pam" #[serde(rename="predefinedBillingAddress")] pub predefined_billing_address: Option, } @@ -1170,27 +1247,6 @@ pub struct TestOrderPaymentMethod { impl Part for TestOrderPaymentMethod {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifycharge orderpayments](struct.OrderpaymentNotifychargeCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyChargeResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#orderpaymentsNotifyChargeResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrderpaymentsNotifyChargeResponse {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1198,9 +1254,27 @@ impl ResponseResult for OrderpaymentsNotifyChargeResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InventoryPickup { /// Whether store pickup is available for this offer and whether the pickup option should be shown as buy, reserve, or not supported. Only supported for local inventory. Unless the value is "not supported", must be submitted together with pickupSla. + /// + /// Acceptable values are: + /// - "buy" + /// - "not supported" + /// - "reserve" + /// - "ship to store" #[serde(rename="pickupMethod")] pub pickup_method: Option, /// The expected date that an order will be ready for pickup, relative to when the order is placed. Only supported for local inventory. Must be submitted together with pickupMethod. + /// + /// Acceptable values are: + /// - "five day" + /// - "four day" + /// - "multi day" + /// - "multi week" + /// - "next day" + /// - "same day" + /// - "seven day" + /// - "six day" + /// - "three day" + /// - "two day" #[serde(rename="pickupSla")] pub pickup_sla: Option, } @@ -1219,22 +1293,22 @@ impl Part for InventoryPickup {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PosSaleResponse { - /// A unique identifier for the item. + /// Required. A unique identifier for the item. #[serde(rename="itemId")] pub item_id: Option, - /// The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. + /// Required. The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. #[serde(rename="storeCode")] pub store_code: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#posSaleResponse". pub kind: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. #[serde(rename="contentLanguage")] pub content_language: Option, - /// The inventory timestamp, in ISO 8601 format. + /// Required. The inventory timestamp, in ISO 8601 format. pub timestamp: Option, - /// The price of the item. + /// Required. The price of the item. pub price: Option, - /// The CLDR territory code for the item. + /// Required. The CLDR territory code for the item. #[serde(rename="targetCountry")] pub target_country: Option, /// Global Trade Item Number. @@ -1242,7 +1316,7 @@ pub struct PosSaleResponse { /// A unique ID to group items from the same sale event. #[serde(rename="saleId")] pub sale_id: Option, - /// The relative change of the available quantity. Negative for items returned. + /// Required. The relative change of the available quantity. Negative for items returned. pub quantity: Option, } @@ -1255,24 +1329,35 @@ impl ResponseResult for PosSaleResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReturnShipment { - /// no description provided + /// Type of the return method. + /// + /// Acceptable values are: + /// - "byMail" + /// - "contactCustomerSupport" + /// - "returnless" #[serde(rename="returnMethodType")] pub return_method_type: Option, - /// no description provided + /// State of the shipment. + /// + /// Acceptable values are: + /// - "completed" + /// - "new" + /// - "shipped" + /// - "undeliverable" pub state: Option, - /// no description provided + /// Tracking information of the shipment. One return shipment might be handled by several shipping carriers sequentially. #[serde(rename="shipmentTrackingInfos")] pub shipment_tracking_infos: Option>, - /// no description provided + /// Shipment ID generated by Google. #[serde(rename="shipmentId")] pub shipment_id: Option, - /// no description provided + /// The date of delivery of the shipment, in ISO 8601 format. #[serde(rename="deliveryDate")] pub delivery_date: Option, - /// no description provided + /// The date of creation of the shipment, in ISO 8601 format. #[serde(rename="creationDate")] pub creation_date: Option, - /// no description provided + /// The date of shipping of the shipment, in ISO 8601 format. #[serde(rename="shippingDate")] pub shipping_date: Option, } @@ -1301,6 +1386,13 @@ pub struct OrdersCreateTestOrderRequest { #[serde(rename="testOrder")] pub test_order: Option, /// The test order template to use. Specify as an alternative to testOrder as a shortcut for retrieving a template and then creating an order using that template. + /// + /// Acceptable values are: + /// - "template1" + /// - "template1a" + /// - "template1b" + /// - "template2" + /// - "template3" #[serde(rename="templateName")] pub template_name: Option, } @@ -1320,6 +1412,11 @@ impl RequestValue for OrdersCreateTestOrderRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCancelTestOrderByCustomerRequest { /// The reason for the cancellation. + /// + /// Acceptable values are: + /// - "changedMind" + /// - "orderedWrongItem" + /// - "other" pub reason: Option, } @@ -1366,6 +1463,14 @@ pub struct AccountsCustomBatchRequestEntry { #[serde(rename="linkRequest")] pub link_request: Option, /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "claimWebsite" + /// - "delete" + /// - "get" + /// - "insert" + /// - "link" + /// - "update" pub method: Option, /// Only applicable if the method is claimwebsite. Indicates whether or not to take the claim from another account in case there is a conflict. pub overwrite: Option, @@ -1434,6 +1539,10 @@ pub struct AccountStatusProducts { /// The destination the data applies to. pub destination: Option, /// The channel the data applies to. + /// + /// Acceptable values are: + /// - "local" + /// - "online" pub channel: Option, /// Aggregated product statistics. pub statistics: Option, @@ -1453,27 +1562,27 @@ impl Part for AccountStatusProducts {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PosInventoryResponse { - /// A unique identifier for the item. + /// Required. A unique identifier for the item. #[serde(rename="itemId")] pub item_id: Option, - /// The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. + /// Required. The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. #[serde(rename="storeCode")] pub store_code: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#posInventoryResponse". pub kind: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. #[serde(rename="contentLanguage")] pub content_language: Option, - /// The inventory timestamp, in ISO 8601 format. + /// Required. The inventory timestamp, in ISO 8601 format. pub timestamp: Option, - /// The current price of the item. + /// Required. The current price of the item. pub price: Option, - /// The CLDR territory code for the item. + /// Required. The CLDR territory code for the item. #[serde(rename="targetCountry")] pub target_country: Option, /// Global Trade Item Number. pub gtin: Option, - /// The available quantity of the item. + /// Required. The available quantity of the item. pub quantity: Option, } @@ -1494,6 +1603,10 @@ pub struct OrdersReturnRefundLineItemResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersReturnRefundLineItemResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -1560,6 +1673,11 @@ pub struct Inventory { /// Number and amount of installments to pay for an item. Brazil only. pub installment: Option, /// The availability of the product. + /// + /// Acceptable values are: + /// - "in stock" + /// - "out of stock" + /// - "preorder" pub availability: Option, /// Store pickup information. Only supported for local inventory. Not setting pickup means "don't update" while setting it to the empty value ({} in JSON) means "delete". Otherwise, pickupMethod and pickupSla must be set together, unless pickupMethod is "not supported". pub pickup: Option, @@ -1616,15 +1734,15 @@ impl RequestValue for OrdersShipLineItemsRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [setinventoryverificationcontact liasettings](struct.LiasettingSetinventoryverificationcontactCall.html) (response) +/// * [fetchnow datafeeds](struct.DatafeedFetchnowCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LiasettingsSetInventoryVerificationContactResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#liasettingsSetInventoryVerificationContactResponse". +pub struct DatafeedsFetchNowResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#datafeedsFetchNowResponse". pub kind: Option, } -impl ResponseResult for LiasettingsSetInventoryVerificationContactResponse {} +impl ResponseResult for DatafeedsFetchNowResponse {} /// There is no detailed description. @@ -1751,12 +1869,50 @@ impl Part for OrderLineItemProductVariantAttribute {} pub struct OrderCancellation { /// The quantity that was canceled. pub quantity: Option, - /// The reason for the cancellation. Orders that are cancelled with a noInventory reason will lead to the removal of the product from Shopping Actions until you make an update to that product. This will not affect your Shopping ads. + /// The reason for the cancellation. Orders that are canceled with a noInventory reason will lead to the removal of the product from Shopping Actions until you make an update to that product. This will not affect your Shopping ads. + /// + /// Acceptable values are: + /// - "autoPostInternal" + /// - "autoPostInvalidBillingAddress" + /// - "autoPostNoInventory" + /// - "autoPostPriceError" + /// - "autoPostUndeliverableShippingAddress" + /// - "couponAbuse" + /// - "customerCanceled" + /// - "customerInitiatedCancel" + /// - "customerSupportRequested" + /// - "failToPushOrderGoogleError" + /// - "failToPushOrderMerchantError" + /// - "failToPushOrderMerchantFulfillmentError" + /// - "failToPushOrderToMerchant" + /// - "failToPushOrderToMerchantOutOfStock" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "merchantDidNotShipOnTime" + /// - "noInventory" + /// - "orderTimeout" + /// - "other" + /// - "paymentAbuse" + /// - "paymentDeclined" + /// - "priceError" + /// - "returnRefundAbuse" + /// - "shippingPriceError" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" pub reason: Option, /// Date on which the cancellation has been created, in ISO 8601 format. #[serde(rename="creationDate")] pub creation_date: Option, /// The actor that created the cancellation. + /// + /// Acceptable values are: + /// - "customer" + /// - "googleBot" + /// - "googleCustomerService" + /// - "googlePayments" + /// - "googleSabre" + /// - "merchant" pub actor: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -1815,7 +1971,24 @@ pub struct OrdersCustomBatchRequestEntry { /// An entry ID, unique within the batch request. #[serde(rename="batchId")] pub batch_id: Option, - /// The method to apply. + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "acknowledge" + /// - "cancel" + /// - "cancelLineItem" + /// - "get" + /// - "getByMerchantOrderId" + /// - "inStoreRefundLineItem" + /// - "refund" + /// - "rejectReturnLineItem" + /// - "returnLineItem" + /// - "returnRefundLineItem" + /// - "setLineItemMetadata" + /// - "shipLineItems" + /// - "updateLineItemShippingDetails" + /// - "updateMerchantOrderId" + /// - "updateShipment" pub method: Option, /// The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId. #[serde(rename="operationId")] @@ -1861,25 +2034,6 @@ pub struct AccountsLinkResponse { impl ResponseResult for AccountsLinkResponse {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifyauthdeclined orderpayments](struct.OrderpaymentNotifyauthdeclinedCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyAuthDeclinedRequest { - /// Reason why payment authorization was declined. - #[serde(rename="declineReason")] - pub decline_reason: Option, -} - -impl RequestValue for OrderpaymentsNotifyAuthDeclinedRequest {} - - /// There is no detailed description. /// /// # Activities @@ -1924,6 +2078,18 @@ pub struct OrdersCancelLineItemRequest { #[serde(rename="lineItemId")] pub line_item_id: Option, /// The reason for the cancellation. + /// + /// Acceptable values are: + /// - "customerInitiatedCancel" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "noInventory" + /// - "other" + /// - "priceError" + /// - "shippingPriceError" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" pub reason: Option, /// Tax amount that corresponds to cancellation amount in amountPretax. Optional, but if filled, then amountPretax must be set. Calculated automatically if not provided. #[serde(rename="amountTax")] @@ -1949,25 +2115,25 @@ impl RequestValue for OrdersCancelLineItemRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PosInventoryRequest { - /// A unique identifier for the item. + /// Required. A unique identifier for the item. #[serde(rename="itemId")] pub item_id: Option, - /// The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. + /// Required. The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. #[serde(rename="storeCode")] pub store_code: Option, - /// The CLDR territory code for the item. + /// Required. The CLDR territory code for the item. #[serde(rename="targetCountry")] pub target_country: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. #[serde(rename="contentLanguage")] pub content_language: Option, - /// The inventory timestamp, in ISO 8601 format. + /// Required. The inventory timestamp, in ISO 8601 format. pub timestamp: Option, - /// The current price of the item. + /// Required. The current price of the item. pub price: Option, /// Global Trade Item Number. pub gtin: Option, - /// The available quantity of the item. + /// Required. The available quantity of the item. pub quantity: Option, } @@ -1981,6 +2147,12 @@ impl RequestValue for PosInventoryRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductDestination { /// Whether the destination is required, excluded or should be validated. + /// + /// Acceptable values are: + /// - "default" + /// - "excluded" + /// - "optional" + /// - "required" pub intention: Option, /// The name of the destination. #[serde(rename="destinationName")] @@ -2004,7 +2176,14 @@ pub struct PosCustomBatchRequestEntry { pub target_merchant_id: Option, /// The sale information to submit. Set this only if the method is sale. pub sale: Option, - /// no description provided + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "delete" + /// - "get" + /// - "insert" + /// - "inventory" + /// - "sale" pub method: Option, /// An entry ID, unique within the batch request. #[serde(rename="batchId")] @@ -2042,6 +2221,21 @@ pub struct OrdersCustomBatchRequestEntryInStoreRefundLineItem { /// The quantity to return and refund. pub quantity: Option, /// The reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. #[serde(rename="productId")] @@ -2084,6 +2278,15 @@ pub struct DatafeedFetchSchedule { /// Whether the scheduled fetch is paused or not. pub paused: Option, /// The day of the week the feed file should be fetched. + /// + /// Acceptable values are: + /// - "monday" + /// - "tuesday" + /// - "wednesday" + /// - "thursday" + /// - "friday" + /// - "saturday" + /// - "sunday" pub weekday: Option, /// Time zone used for schedule. UTC by default. E.g., "America/Los_Angeles". #[serde(rename="timeZone")] @@ -2109,7 +2312,6 @@ impl Part for DatafeedFetchSchedule {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [get liasettings](struct.LiasettingGetCall.html) (response) -/// * [patch liasettings](struct.LiasettingPatchCall.html) (request|response) /// * [update liasettings](struct.LiasettingUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2158,12 +2360,32 @@ pub struct OrderLegacyPromotionBenefit { /// The discount in the order price when the promotion is applied. pub discount: Option, /// Describes whether the promotion applies to products (e.g. 20% off) or to shipping (e.g. Free Shipping). + /// + /// Acceptable values are: + /// - "product" + /// - "shipping" #[serde(rename="type")] pub type_: Option, /// The impact on tax when the promotion is applied. #[serde(rename="taxImpact")] pub tax_impact: Option, /// Further describes the benefit of the promotion. Note that we will expand on this enumeration as we support new promotion sub-types. + /// + /// Acceptable values are: + /// - "buyMGetMoneyOff" + /// - "buyMGetNMoneyOff" + /// - "buyMGetNPercentOff" + /// - "buyMGetPercentOff" + /// - "freeGift" + /// - "freeGiftWithItemId" + /// - "freeGiftWithValue" + /// - "freeOvernightShipping" + /// - "freeShipping" + /// - "freeTwoDayShipping" + /// - "moneyOff" + /// - "percentageOff" + /// - "rewardPoints" + /// - "salePrice" #[serde(rename="subType")] pub sub_type: Option, } @@ -2186,7 +2408,10 @@ pub struct AccountstatusesCustomBatchRequestEntry { /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, - /// The method (get). + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "get" pub method: Option, /// If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. pub destinations: Option>, @@ -2201,22 +2426,22 @@ impl Part for AccountstatusesCustomBatchRequestEntry {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PosSale { - /// A unique identifier for the item. + /// Required. A unique identifier for the item. #[serde(rename="itemId")] pub item_id: Option, - /// The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. + /// Required. The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. #[serde(rename="storeCode")] pub store_code: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#posSale". pub kind: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. #[serde(rename="contentLanguage")] pub content_language: Option, - /// The inventory timestamp, in ISO 8601 format. + /// Required. The inventory timestamp, in ISO 8601 format. pub timestamp: Option, - /// The price of the item. + /// Required. The price of the item. pub price: Option, - /// The CLDR territory code for the item. + /// Required. The CLDR territory code for the item. #[serde(rename="targetCountry")] pub target_country: Option, /// Global Trade Item Number. @@ -2224,35 +2449,13 @@ pub struct PosSale { /// A unique ID to group items from the same sale event. #[serde(rename="saleId")] pub sale_id: Option, - /// The relative change of the available quantity. Negative for items returned. + /// Required. The relative change of the available quantity. Negative for items returned. pub quantity: Option, } impl Part for PosSale {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifyauthapproved orderpayments](struct.OrderpaymentNotifyauthapprovedCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyAuthApprovedRequest { - /// Authorized amount for pre-tax charge on user's credit card. - #[serde(rename="authAmountPretax")] - pub auth_amount_pretax: Option, - /// Authorized amount for tax charge on user's credit card. - #[serde(rename="authAmountTax")] - pub auth_amount_tax: Option, -} - -impl RequestValue for OrderpaymentsNotifyAuthApprovedRequest {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2260,6 +2463,13 @@ impl RequestValue for OrderpaymentsNotifyAuthApprovedRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCustomBatchRequestEntryRejectReturnLineItem { /// The reason for the return. + /// + /// Acceptable values are: + /// - "damagedOrUsed" + /// - "missingComponent" + /// - "notEligible" + /// - "other" + /// - "outOfReturnWindow" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -2277,6 +2487,23 @@ pub struct OrdersCustomBatchRequestEntryRejectReturnLineItem { impl Part for OrdersCustomBatchRequestEntryRejectReturnLineItem {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PickupCarrierService { + /// The name of the pickup service (e.g., "Access point"). Required. + #[serde(rename="serviceName")] + pub service_name: Option, + /// The name of the pickup carrier (e.g., "UPS"). Required. + #[serde(rename="carrierName")] + pub carrier_name: Option, +} + +impl Part for PickupCarrierService {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2329,8 +2556,62 @@ pub struct OrderRefund { #[serde(rename="creationDate")] pub creation_date: Option, /// The reason for the refund. + /// + /// Acceptable values are: + /// - "adjustment" + /// - "autoPostInternal" + /// - "autoPostInvalidBillingAddress" + /// - "autoPostNoInventory" + /// - "autoPostPriceError" + /// - "autoPostUndeliverableShippingAddress" + /// - "couponAbuse" + /// - "courtesyAdjustment" + /// - "customerCanceled" + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "customerSupportRequested" + /// - "deliveredLateByCarrier" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "failToPushOrderGoogleError" + /// - "failToPushOrderMerchantError" + /// - "failToPushOrderMerchantFulfillmentError" + /// - "failToPushOrderToMerchant" + /// - "failToPushOrderToMerchantOutOfStock" + /// - "feeAdjustment" + /// - "invalidCoupon" + /// - "lateShipmentCredit" + /// - "malformedShippingAddress" + /// - "merchantDidNotShipOnTime" + /// - "noInventory" + /// - "orderTimeout" + /// - "other" + /// - "paymentAbuse" + /// - "paymentDeclined" + /// - "priceAdjustment" + /// - "priceError" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "promoReallocation" + /// - "qualityNotAsExpected" + /// - "returnRefundAbuse" + /// - "shippingCostAdjustment" + /// - "shippingPriceError" + /// - "taxAdjustment" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// The actor that created the refund. + /// + /// Acceptable values are: + /// - "customer" + /// - "googleBot" + /// - "googleCustomerService" + /// - "googlePayments" + /// - "googleSabre" + /// - "merchant" pub actor: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -2409,6 +2690,12 @@ pub struct DatafeedStatus { /// The two-letter ISO 639-1 language for which the status is reported. pub language: Option, /// The processing status of the feed. + /// + /// Acceptable values are: + /// - ""failure": The feed could not be processed or all items had errors." + /// - "in progress": The feed is being processed. + /// - "none": The feed has not yet been processed. For example, a feed that has never been uploaded will have this processing status. + /// - "success": The feed was processed successfully, though some items might have had errors. #[serde(rename="processingStatus")] pub processing_status: Option, /// The number of items in the feed that were processed. @@ -2439,6 +2726,10 @@ impl ResponseResult for DatafeedStatus {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestOrderCustomerMarketingRightsInfo { /// Last know user use selection regards marketing preferences. In certain cases selection might not be known, so this field would be empty. + /// + /// Acceptable values are: + /// - "denied" + /// - "granted" #[serde(rename="explicitMarketingPreference")] pub explicit_marketing_preference: Option, /// Timestamp when last time marketing preference was updated. Could be empty, if user wasn't offered a selection yet. @@ -2456,6 +2747,11 @@ impl Part for TestOrderCustomerMarketingRightsInfo {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UnitInvoiceTaxLine { /// [required] Type of the tax. + /// + /// Acceptable values are: + /// - "otherFee" + /// - "otherFeeTax" + /// - "sales" #[serde(rename="taxType")] pub tax_type: Option, /// [required] Tax amount for the tax type. @@ -2519,6 +2815,13 @@ impl Part for Installment {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersRejectReturnLineItemRequest { /// The reason for the return. + /// + /// Acceptable values are: + /// - "damagedOrUsed" + /// - "missingComponent" + /// - "notEligible" + /// - "other" + /// - "outOfReturnWindow" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -2551,6 +2854,9 @@ pub struct OrderCustomer { /// Full name of the customer. #[serde(rename="fullName")] pub full_name: Option, + /// Email address for the merchant to send value-added tax or invoice documentation of the order. This documentation is made available to the customer. + #[serde(rename="invoiceReceivingEmail")] + pub invoice_receiving_email: Option, /// Deprecated. pub email: Option, /// Customer's marketing preferences. Contains the marketing opt-in information that is current at the time that the merchant call. User preference selections can change from one order to the next so preferences must be checked with every order. @@ -2580,7 +2886,7 @@ pub struct AccountstatusesCustomBatchResponseEntry { impl Part for AccountstatusesCustomBatchResponseEntry {} -/// There is no detailed description. +/// Order return. Production access (all methods) requires the order manager role. Sandbox access does not. /// /// # Activities /// @@ -2591,22 +2897,22 @@ impl Part for AccountstatusesCustomBatchResponseEntry {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MerchantOrderReturn { - /// no description provided + /// Google order ID. #[serde(rename="orderId")] pub order_id: Option, - /// no description provided + /// Merchant defined order ID. #[serde(rename="merchantOrderId")] pub merchant_order_id: Option, - /// no description provided + /// Order return ID generated by Google. #[serde(rename="orderReturnId")] pub order_return_id: Option, - /// no description provided + /// The date of creation of the return, in ISO 8601 format. #[serde(rename="creationDate")] pub creation_date: Option, - /// no description provided + /// Shipments of the return. #[serde(rename="returnShipments")] pub return_shipments: Option>, - /// no description provided + /// Items of the return. #[serde(rename="returnItems")] pub return_items: Option>, } @@ -2628,6 +2934,10 @@ pub struct OrdersRejectReturnLineItemResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersRejectReturnLineItemResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -2649,6 +2959,10 @@ pub struct OrdersInStoreRefundLineItemResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersInStoreRefundLineItemResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -2705,7 +3019,6 @@ impl ResponseResult for ShippingsettingsGetSupportedHolidaysResponse {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [update accounttax](struct.AccounttaxUpdateCall.html) (request|response) -/// * [patch accounttax](struct.AccounttaxPatchCall.html) (request|response) /// * [get accounttax](struct.AccounttaxGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2714,7 +3027,7 @@ pub struct AccountTax { pub rules: Option>, /// Identifies what kind of resource this is. Value: the fixed string "content#accountTax". pub kind: Option, - /// The ID of the account to which these account tax settings belong. + /// Required. The ID of the account to which these account tax settings belong. #[serde(rename="accountId")] pub account_id: Option, } @@ -2737,6 +3050,10 @@ pub struct OrdersRefundResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersRefundResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -2774,6 +3091,11 @@ pub struct AccountsCustomBatchResponseEntry { /// A list of errors defined if and only if the request failed. pub errors: Option, /// Deprecated. This field is never set. + /// + /// Acceptable values are: + /// - "active" + /// - "inactive" + /// - "pending" #[serde(rename="linkStatus")] pub link_status: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#accountsCustomBatchResponseEntry". @@ -2790,6 +3112,10 @@ impl Part for AccountsCustomBatchResponseEntry {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccountGoogleMyBusinessLink { /// Status of the link between this Merchant Center account and the GMB account. + /// + /// Acceptable values are: + /// - "active" + /// - "pending" pub status: Option, /// The GMB email address of which a specific account within a GMB account. A sample account within a GMB account could be a business account with set of locations, managed under the GMB account. #[serde(rename="gmbEmail")] @@ -2809,7 +3135,6 @@ impl Part for AccountGoogleMyBusinessLink {} /// * [insert datafeeds](struct.DatafeedInsertCall.html) (request|response) /// * [custombatch datafeeds](struct.DatafeedCustombatchCall.html) (none) /// * [fetchnow datafeeds](struct.DatafeedFetchnowCall.html) (none) -/// * [patch datafeeds](struct.DatafeedPatchCall.html) (request|response) /// * [list datafeeds](struct.DatafeedListCall.html) (none) /// * [delete datafeeds](struct.DatafeedDeleteCall.html) (none) /// * [get datafeeds](struct.DatafeedGetCall.html) (response) @@ -2819,10 +3144,15 @@ impl Part for AccountGoogleMyBusinessLink {} pub struct Datafeed { /// Identifies what kind of resource this is. Value: the fixed string "content#datafeed". pub kind: Option, - /// The type of data feed. For product inventory feeds, only feeds for local stores, not online stores, are supported. + /// Required. The type of data feed. For product inventory feeds, only feeds for local stores, not online stores, are supported. + /// + /// Acceptable values are: + /// - "local products" + /// - "product inventory" + /// - "products" #[serde(rename="contentType")] pub content_type: Option, - /// A descriptive name of the data feed. + /// Required for insert. A descriptive name of the data feed. pub name: Option, /// [DEPRECATED] Please use targets[].language instead. The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targetCountry. #[serde(rename="contentLanguage")] @@ -2835,13 +3165,13 @@ pub struct Datafeed { /// [DEPRECATED] Please use targets[].country instead. The country where the items in the feed will be included in the search index, represented as a CLDR territory code. #[serde(rename="targetCountry")] pub target_country: Option, - /// The filename of the feed. All feeds must have a unique file name. + /// Required. The filename of the feed. All feeds must have a unique file name. #[serde(rename="fileName")] pub file_name: Option, /// [DEPRECATED] Please use targets[].includedDestinations instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center). #[serde(rename="intendedDestinations")] pub intended_destinations: Option>, - /// The ID of the data feed. + /// Required for update. The ID of the data feed. pub id: Option, /// The targets this feed should apply to (country, language, destinations). pub targets: Option>, @@ -2877,25 +3207,42 @@ impl Part for OrdersCustomBatchRequestEntryCreateTestReturnReturnItem {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestOrder { - /// The details of the customer who placed the order. + /// Required. The details of the customer who placed the order. pub customer: Option, /// Deprecated. Ignored if provided. pub promotions: Option>, /// Identifies what kind of resource this is. Value: the fixed string "content#testOrder". pub kind: Option, - /// Line items that are ordered. At least one line item must be provided. + /// Required. Line items that are ordered. At least one line item must be provided. #[serde(rename="lineItems")] pub line_items: Option>, /// Determines if test order must be pulled by merchant or pushed to merchant via push integration. + /// + /// Acceptable values are: + /// - "checkoutIntegration" + /// - "merchantPull" #[serde(rename="notificationMode")] pub notification_mode: Option, - /// Identifier of one of the predefined delivery addresses for the delivery. + /// Required. Identifier of one of the predefined delivery addresses for the delivery. + /// + /// Acceptable values are: + /// - "dwight" + /// - "jim" + /// - "pam" #[serde(rename="predefinedDeliveryAddress")] pub predefined_delivery_address: Option, - /// The price of shipping for all items. Shipping tax is automatically calculated for MFL orders. For non-MFL orders, tax settings from Merchant Center are applied. Note that shipping is not taxed in certain states. + /// Required. The price of shipping for all items. Shipping tax is automatically calculated for orders where marketplace facilitator tax laws are applicable. Otherwise, tax settings from Merchant Center are applied. Note that shipping is not taxed in certain states. #[serde(rename="shippingCost")] pub shipping_cost: Option, - /// The requested shipping option. + /// Required. The requested shipping option. + /// + /// Acceptable values are: + /// - "economy" + /// - "expedited" + /// - "oneDay" + /// - "sameDay" + /// - "standard" + /// - "twoDay" #[serde(rename="shippingOption")] pub shipping_option: Option, /// Whether the orderinvoices service should support this order. @@ -2907,6 +3254,14 @@ pub struct TestOrder { /// The details of the payment method. #[serde(rename="paymentMethod")] pub payment_method: Option, + /// Identifier of one of the predefined pickup details. Required for orders containing line items with shipping type pickup. + /// + /// Acceptable values are: + /// - "dwight" + /// - "jim" + /// - "pam" + #[serde(rename="predefinedPickupDetails")] + pub predefined_pickup_details: Option, } impl Part for TestOrder {} @@ -2918,15 +3273,15 @@ impl Part for TestOrder {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderLineItemShippingDetailsMethod { - /// Minimum transit time. + /// Required. Minimum transit time. #[serde(rename="minDaysInTransit")] pub min_days_in_transit: Option, /// The carrier for the shipping. Optional. See shipments[].carrier for a list of acceptable values. pub carrier: Option, - /// The name of the shipping method. + /// Required. The name of the shipping method. #[serde(rename="methodName")] pub method_name: Option, - /// Maximum transit time. + /// Required. Maximum transit time. #[serde(rename="maxDaysInTransit")] pub max_days_in_transit: Option, } @@ -3046,28 +3401,28 @@ impl RequestValue for OrdersCustomBatchRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PosSaleRequest { - /// A unique identifier for the item. + /// Required. A unique identifier for the item. #[serde(rename="itemId")] pub item_id: Option, - /// The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. + /// Required. The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. #[serde(rename="storeCode")] pub store_code: Option, - /// The CLDR territory code for the item. + /// Required. The CLDR territory code for the item. #[serde(rename="targetCountry")] pub target_country: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. #[serde(rename="contentLanguage")] pub content_language: Option, - /// The inventory timestamp, in ISO 8601 format. + /// Required. The inventory timestamp, in ISO 8601 format. pub timestamp: Option, - /// The price of the item. + /// Required. The price of the item. pub price: Option, /// A unique ID to group items from the same sale event. #[serde(rename="saleId")] pub sale_id: Option, /// Global Trade Item Number. pub gtin: Option, - /// The relative change of the available quantity. Negative for items returned. + /// Required. The relative change of the available quantity. Negative for items returned. pub quantity: Option, } @@ -3091,6 +3446,21 @@ pub struct OrdersReturnRefundLineItemRequest { #[serde(rename="amountPretax")] pub amount_pretax: Option, /// The reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -3118,10 +3488,56 @@ impl RequestValue for OrdersReturnRefundLineItemRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RefundReason { - /// no description provided + /// Code of the refund reason. + /// + /// Acceptable values are: + /// - "adjustment" + /// - "autoPostInternal" + /// - "autoPostInvalidBillingAddress" + /// - "autoPostNoInventory" + /// - "autoPostPriceError" + /// - "autoPostUndeliverableShippingAddress" + /// - "couponAbuse" + /// - "courtesyAdjustment" + /// - "customerCanceled" + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "customerSupportRequested" + /// - "deliveredLateByCarrier" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "failToPushOrderGoogleError" + /// - "failToPushOrderMerchantError" + /// - "failToPushOrderMerchantFulfillmentError" + /// - "failToPushOrderToMerchant" + /// - "failToPushOrderToMerchantOutOfStock" + /// - "feeAdjustment" + /// - "invalidCoupon" + /// - "lateShipmentCredit" + /// - "malformedShippingAddress" + /// - "merchantDidNotShipOnTime" + /// - "noInventory" + /// - "orderTimeout" + /// - "other" + /// - "paymentAbuse" + /// - "paymentDeclined" + /// - "priceAdjustment" + /// - "priceError" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "promoReallocation" + /// - "qualityNotAsExpected" + /// - "returnRefundAbuse" + /// - "shippingCostAdjustment" + /// - "shippingPriceError" + /// - "taxAdjustment" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" #[serde(rename="reasonCode")] pub reason_code: Option, - /// no description provided + /// Description of the reason. pub description: Option, } @@ -3209,12 +3625,19 @@ impl Part for CarrierRate {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderLineItemShippingDetails { - /// The delivery by date, in ISO 8601 format. + /// Required. The delivery by date, in ISO 8601 format. #[serde(rename="deliverByDate")] pub deliver_by_date: Option, - /// Details of the shipping method. + /// Type of shipment. Indicates whether deliveryDetails or pickupDetails is applicable for this shipment. + /// + /// Acceptable values are: + /// - "delivery" + /// - "pickup" + #[serde(rename="type")] + pub type_: Option, + /// Required. Details of the shipping method. pub method: Option, - /// The ship by date, in ISO 8601 format. + /// Required. The ship by date, in ISO 8601 format. #[serde(rename="shipByDate")] pub ship_by_date: Option, } @@ -3230,7 +3653,6 @@ impl Part for OrderLineItemShippingDetails {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [update shippingsettings](struct.ShippingsettingUpdateCall.html) (request|response) -/// * [patch shippingsettings](struct.ShippingsettingPatchCall.html) (request|response) /// * [get shippingsettings](struct.ShippingsettingGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -3286,7 +3708,7 @@ pub struct OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { /// The tracking ID for the shipment. #[serde(rename="trackingId")] pub tracking_id: Option, - /// The ID of the shipment. This is assigned by the merchant and is unique to each shipment. + /// Required. The ID of the shipment. This is assigned by the merchant and is unique to each shipment. #[serde(rename="shipmentId")] pub shipment_id: Option, } @@ -3306,6 +3728,21 @@ impl Part for OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersReturnLineItemRequest { /// The reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -3355,7 +3792,7 @@ pub struct AccountTaxTaxRule { /// If true, shipping charges are also taxed. #[serde(rename="shippingTaxed")] pub shipping_taxed: Option, - /// State (or province) is which the tax is applicable, described by its location ID (also called criteria ID). + /// Required. State (or province) is which the tax is applicable, described by its location ID (also called criteria ID). #[serde(rename="locationId")] pub location_id: Option, /// Whether the tax rate is taken from a global tax table or specified explicitly. @@ -3405,27 +3842,6 @@ pub struct OrdersCustomBatchRequestEntrySetLineItemMetadata { impl Part for OrdersCustomBatchRequestEntrySetLineItemMetadata {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifyauthapproved orderpayments](struct.OrderpaymentNotifyauthapprovedCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyAuthApprovedResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#orderpaymentsNotifyAuthApprovedResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrderpaymentsNotifyAuthApprovedResponse {} - - /// The single value of a rate group or the value of a rate group table's cell. Exactly one of noShipping, flatRate, pricePercentage, carrierRateName, subtableName must be set. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3466,6 +3882,16 @@ pub struct HolidaysHoliday { /// Unique identifier for the holiday to be used when configuring holiday cutoffs. Always present. pub id: Option, /// The holiday type. Always present. + /// + /// Acceptable values are: + /// - "Christmas" + /// - "Easter" + /// - "Father's Day" + /// - "Halloween" + /// - "Independence Day (USA)" + /// - "Mother's Day" + /// - "Thanksgiving" + /// - "Valentine's Day" #[serde(rename="type")] pub type_: Option, /// Hour of the day in the delivery location's timezone on the guaranteed delivery date by which the order has to arrive at the customer's. Possible values are: 0 (midnight), 1, ..., 12 (noon), 13, ..., 23. Always present. @@ -3485,10 +3911,26 @@ impl Part for HolidaysHoliday {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CustomerReturnReason { - /// no description provided + /// Code of the return reason. + /// + /// Acceptable values are: + /// - "betterPriceFound" + /// - "changedMind" + /// - "damagedOrDefectiveItem" + /// - "didNotMatchDescription" + /// - "doesNotFit" + /// - "expiredItem" + /// - "incorrectItemReceived" + /// - "noLongerNeeded" + /// - "notSpecified" + /// - "orderedWrongItem" + /// - "other" + /// - "qualityNotExpected" + /// - "receivedTooLate" + /// - "undeliverable" #[serde(rename="reasonCode")] pub reason_code: Option, - /// no description provided + /// Description of the reason. pub description: Option, } @@ -3512,7 +3954,14 @@ pub struct DatafeedsCustomBatchRequestEntry { /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, - /// no description provided + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "delete" + /// - "fetchNow" + /// - "get" + /// - "insert" + /// - "update" pub method: Option, } @@ -3542,7 +3991,7 @@ pub struct OrderreturnsListResponse { impl ResponseResult for OrderreturnsListResponse {} -/// Order. All methods require the order manager role. +/// Order. Production access (all methods) requires the order manager role. Sandbox access does not. /// /// # Activities /// @@ -3576,15 +4025,40 @@ impl ResponseResult for OrderreturnsListResponse {} pub struct Order { /// Shipments of the order. pub shipments: Option>, - /// The details of the customer who placed the order. - pub customer: Option, + /// The status of the order. + /// + /// Acceptable values are: + /// - "canceled" + /// - "delivered" + /// - "inProgress" + /// - "partiallyDelivered" + /// - "partiallyReturned" + /// - "partiallyShipped" + /// - "pendingShipment" + /// - "returned" + /// - "shipped" + pub status: Option, /// The party responsible for collecting and remitting taxes. + /// + /// Acceptable values are: + /// - "marketplaceFacilitator" + /// - "merchant" #[serde(rename="taxCollector")] pub tax_collector: Option, - /// The total cost of shipping for all items. - #[serde(rename="shippingCost")] - pub shipping_cost: Option, + /// The status of the payment. + /// + /// Acceptable values are: + /// - "paymentCaptured" + /// - "paymentRejected" + /// - "paymentSecured" + /// - "pendingAuthorization" + #[serde(rename="paymentStatus")] + pub payment_status: Option, /// Deprecated. + /// + /// Acceptable values are: + /// - "googleExpress" + /// - "purchasesOnGoogle" #[serde(rename="channelType")] pub channel_type: Option, /// The net amount for the order. For example, if an order was originally for a grand total of $100 and a refund was issued for $20, the net amount will be $80. @@ -3592,32 +4066,53 @@ pub struct Order { pub net_amount: Option, /// The REST ID of the order. Globally unique. pub id: Option, - /// The details of the merchant provided promotions applied to the order. More details about the program are here. - pub promotions: Option>, + /// The details of the customer who placed the order. + pub customer: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#order". pub kind: Option, /// Line items that are ordered. #[serde(rename="lineItems")] pub line_items: Option>, + /// The details of the merchant provided promotions applied to the order. + /// + /// To determine which promotions apply to which products, check the Promotions[].Benefits[].OfferIds field against the LineItems[].Product.OfferId field for each promotion. If a promotion is applied to more than 1 offerId, divide the discount value by the number of affected offers to determine how much discount to apply to each offerId. + /// + /// Examples: + /// - To calculate the line item level discount for a single specific item: For each promotion, subtract the Promotions[].Benefits[].Discount.value amount from the LineItems[].Price.value. + /// - To calculate the line item level discount for multiple quantity of a specific item: For each promotion, divide the Promotions[].Benefits[].Discount.value by the quantity of products and substract it from LineItems[].Product.Price.value for each quantity item. + /// + /// Only 1 promotion can be applied to an offerId in a given order. To refund an item which had a promotion applied to it, make sure to refund the amount after first subtracting the promotion discount from the item price. + /// + /// More details about the program are here. + pub promotions: Option>, /// Refunds for the order. pub refunds: Option>, + /// Deprecated. Shipping details are provided with line items instead. + /// + /// Acceptable values are: + /// - "economy" + /// - "expedited" + /// - "oneDay" + /// - "sameDay" + /// - "standard" + /// - "twoDay" + #[serde(rename="shippingOption")] + pub shipping_option: Option, /// Whether the order was acknowledged. pub acknowledged: Option, - /// The status of the payment. - #[serde(rename="paymentStatus")] - pub payment_status: Option, + /// The total cost of shipping for all items. + #[serde(rename="shippingCost")] + pub shipping_cost: Option, /// no description provided #[serde(rename="merchantId")] pub merchant_id: Option, /// Merchant-provided ID of the order. #[serde(rename="merchantOrderId")] pub merchant_order_id: Option, - /// Deprecated. Shipping details are provided with line items instead. - #[serde(rename="shippingOption")] - pub shipping_option: Option, - /// The status of the order. - pub status: Option, - /// Delivery details for shipments. + /// Pickup details for shipments of type pickup. + #[serde(rename="pickupDetails")] + pub pickup_details: Option, + /// Delivery details for shipments of type delivery. #[serde(rename="deliveryDetails")] pub delivery_details: Option, /// The date when the order was placed, in ISO 8601 format. @@ -3649,6 +4144,10 @@ pub struct OrdersCancelResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -3670,6 +4169,10 @@ pub struct OrdersReturnLineItemResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersReturnLineItemResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -3677,27 +4180,6 @@ pub struct OrdersReturnLineItemResponse { impl ResponseResult for OrdersReturnLineItemResponse {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifyrefund orderpayments](struct.OrderpaymentNotifyrefundCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyRefundResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#orderpaymentsNotifyRefundResponse". - pub kind: Option, - /// The status of the execution. - #[serde(rename="executionStatus")] - pub execution_status: Option, -} - -impl ResponseResult for OrderpaymentsNotifyRefundResponse {} - - /// There is no detailed description. /// /// # Activities @@ -3712,6 +4194,10 @@ pub struct OrdersAcknowledgeResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersAcknowledgeResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -3776,7 +4262,7 @@ pub struct OrderShipmentLineItemShipment { /// The ID of the product to ship. This is the REST ID used in the products service. Either lineItemId or productId is required. #[serde(rename="productId")] pub product_id: Option, - /// The ID of the line item that is shipped. Either lineItemId or productId is required. + /// The ID of the line item that is shipped. This value is assigned by Google when an order is created. Either lineItemId or productId is required. #[serde(rename="lineItemId")] pub line_item_id: Option, /// The quantity that is shipped. @@ -3819,6 +4305,18 @@ impl Part for AccounttaxCustomBatchResponseEntry {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCancelRequest { /// The reason for the cancellation. + /// + /// Acceptable values are: + /// - "customerInitiatedCancel" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "noInventory" + /// - "other" + /// - "priceError" + /// - "shippingPriceError" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -3858,6 +4356,10 @@ impl Part for ProductUnitPricingBaseMeasure {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersUpdateShipmentRequest { /// New status for the shipment. Not updated if missing. + /// + /// Acceptable values are: + /// - "delivered" + /// - "undeliverable" pub status: Option, /// The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values. pub carrier: Option, @@ -3905,13 +4407,13 @@ impl Part for Table {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderLineItemReturnInfo { - /// URL of the item return policy. + /// Required. URL of the item return policy. #[serde(rename="policyUrl")] pub policy_url: Option, - /// Whether the item is returnable. + /// Required. Whether the item is returnable. #[serde(rename="isReturnable")] pub is_returnable: Option, - /// How many days later the item can be returned. + /// Required. How many days later the item can be returned. #[serde(rename="daysToReturn")] pub days_to_return: Option, } @@ -3977,6 +4479,11 @@ pub struct Service { #[serde(rename="deliveryTime")] pub delivery_time: Option, /// Eligibility for this service. + /// + /// Acceptable values are: + /// - "All scenarios" + /// - "All scenarios except Shopping Actions" + /// - "Shopping Actions" pub eligibility: Option, /// The CLDR territory code of the country to which the service applies. Required. #[serde(rename="deliveryCountry")] @@ -3986,6 +4493,16 @@ pub struct Service { pub rate_groups: Option>, /// The CLDR code of the currency to which this service applies. Must match that of the prices in rate groups. pub currency: Option, + /// Type of locations this service ships orders to. + /// + /// Acceptable values are: + /// - "delivery" + /// - "pickup" + #[serde(rename="shipmentType")] + pub shipment_type: Option, + /// The carrier-service pair delivering items to collection points. The list of supported pickup services can be retrieved via the getSupportedPickupServices method. Required if and only if the service delivery type is pickup. + #[serde(rename="pickupService")] + pub pickup_service: Option, /// A boolean exposing the active status of the shipping service. Required. pub active: Option, /// Minimum order value for this service. If set, indicates that customers will have to spend at least this amount. All prices within a service must have the same currency. @@ -4050,7 +4567,7 @@ pub struct LiaCountrySettings { /// The status of the "Store pickup" feature. #[serde(rename="storePickupActive")] pub store_pickup_active: Option, - /// CLDR country code (e.g. "US"). + /// Required. CLDR country code (e.g. "US"). pub country: Option, /// The POS data provider linked with this country. #[serde(rename="posDataProvider")] @@ -4092,6 +4609,10 @@ pub struct OrderinvoicesCreateRefundInvoiceResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#orderinvoicesCreateRefundInvoiceResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -4265,6 +4786,17 @@ pub struct CustomAttribute { /// Free-form unit of the attribute. Unit can only be used for values of type int, float, or price. pub unit: Option, /// The type of the attribute. + /// + /// Acceptable values are: + /// - "boolean" + /// - "datetimerange" + /// - "float" + /// - "group" + /// - "int" + /// - "price" + /// - "text" + /// - "time" + /// - "url" #[serde(rename="type")] pub type_: Option, /// The name of the attribute. Underscores will be replaced by spaces upon insertion. @@ -4288,7 +4820,12 @@ pub struct TestOrderCustomer { /// Full name of the customer. #[serde(rename="fullName")] pub full_name: Option, - /// Email address of the customer. + /// Required. Email address of the customer. + /// + /// Acceptable values are: + /// - "pog.dwight.schrute@gmail.com" + /// - "pog.jim.halpert@gmail.com" + /// - "penpog.pam.beesly@gmail.comding" pub email: Option, /// Customer's marketing preferences. #[serde(rename="marketingRightsInfo")] @@ -4424,6 +4961,10 @@ pub struct OrdersSetLineItemMetadataResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersSetLineItemMetadataResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -4440,19 +4981,21 @@ pub struct ProductsCustomBatchRequestEntry { /// An entry ID, unique within the batch request. #[serde(rename="batchId")] pub batch_id: Option, - /// no description provided - pub method: Option, /// The product to insert. Only required if the method is insert. pub product: Option, - /// The ID of the product to get or delete. Only defined if the method is get or delete. - #[serde(rename="productId")] - pub product_id: Option, - /// The ContentAPI feed id. - #[serde(rename="feedId")] - pub feed_id: Option, /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "delete" + /// - "get" + /// - "insert" + pub method: Option, + /// The ID of the product to get or delete. Only defined if the method is get or delete. + #[serde(rename="productId")] + pub product_id: Option, } impl Part for ProductsCustomBatchRequestEntry {} @@ -4510,6 +5053,10 @@ pub struct OrdersShipLineItemsResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersShipLineItemsResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -4517,6 +5064,24 @@ pub struct OrdersShipLineItemsResponse { impl ResponseResult for OrdersShipLineItemsResponse {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrderPickupDetails { + /// ID of the pickup location. + #[serde(rename="locationId")] + pub location_id: Option, + /// Collectors authorized to pick up shipment from the pickup location. + pub collectors: Option>, + /// Address of the pickup location where the shipment should be sent. Note that recipientName in the address is the name of the business at the pickup location. + pub address: Option, +} + +impl Part for OrderPickupDetails {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4526,11 +5091,34 @@ pub struct OrderReturn { /// Quantity that is returned. pub quantity: Option, /// The reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// Date on which the item has been created, in ISO 8601 format. #[serde(rename="creationDate")] pub creation_date: Option, /// The actor that created the refund. + /// + /// Acceptable values are: + /// - "customer" + /// - "googleBot" + /// - "googleCustomerService" + /// - "googlePayments" + /// - "googleSabre" + /// - "merchant" pub actor: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -4586,6 +5174,19 @@ pub struct DatafeedstatusesCustomBatchResponse { impl ResponseResult for DatafeedstatusesCustomBatchResponse {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TransitTableTransitTimeRow { + /// no description provided + pub values: Option>, +} + +impl Part for TransitTableTransitTimeRow {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4614,6 +5215,9 @@ pub struct UnitInvoiceAdditionalCharge { #[serde(rename="additionalChargeAmount")] pub additional_charge_amount: Option, /// [required] Type of the additional charge. + /// + /// Acceptable values are: + /// - "shipping" #[serde(rename="type")] pub type_: Option, /// Deprecated. @@ -4638,6 +5242,10 @@ pub struct OrdersUpdateLineItemShippingDetailsResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateLineItemShippingDetailsResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -4654,6 +5262,11 @@ pub struct AccountStatusAccountLevelIssue { /// The URL of a web page to help resolving this issue. pub documentation: Option, /// Severity of the issue. + /// + /// Acceptable values are: + /// - "critical" + /// - "error" + /// - "suggestion" pub severity: Option, /// Short description of the issue. pub title: Option, @@ -4702,6 +5315,10 @@ pub struct OrdersUpdateMerchantOrderIdResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateMerchantOrderIdResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -4771,6 +5388,18 @@ impl RequestValue for DatafeedsCustomBatchRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrdersCustomBatchRequestEntryCancel { /// The reason for the cancellation. + /// + /// Acceptable values are: + /// - "customerInitiatedCancel" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "noInventory" + /// - "other" + /// - "priceError" + /// - "shippingPriceError" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -4786,10 +5415,42 @@ impl Part for OrdersCustomBatchRequestEntryCancel {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ShipmentTrackingInfo { - /// no description provided + /// The tracking number for the package. #[serde(rename="trackingNumber")] pub tracking_number: Option, - /// no description provided + /// The shipping carrier that handles the package. + /// + /// Acceptable values are: + /// - "boxtal" + /// - "bpost" + /// - "chronopost" + /// - "colisPrive" + /// - "colissimo" + /// - "cxt" + /// - "deliv" + /// - "dhl" + /// - "dpd" + /// - "dynamex" + /// - "eCourier" + /// - "easypost" + /// - "efw" + /// - "fedex" + /// - "fedexSmartpost" + /// - "geodis" + /// - "gls" + /// - "googleCourier" + /// - "gsx" + /// - "jdLogistics" + /// - "laPoste" + /// - "lasership" + /// - "manual" + /// - "mpx" + /// - "onTrac" + /// - "other" + /// - "tnt" + /// - "uds" + /// - "ups" + /// - "usps" pub carrier: Option, } @@ -4855,6 +5516,21 @@ impl Part for ProductStatusDataQualityIssue {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption { /// [required] Reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// Optional description of the return reason. pub description: Option, @@ -4901,6 +5577,22 @@ pub struct OrdersGetTestOrderTemplateResponse { impl ResponseResult for OrdersGetTestOrderTemplateResponse {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrderPickupDetailsCollector { + /// Phone number of the person picking up the shipment. + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// Name of the person picking up the shipment. + pub name: Option, +} + +impl Part for OrderPickupDetailsCollector {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4925,6 +5617,11 @@ impl Part for Promotion {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiaAboutPageSettings { /// The status of the verification process for the About page. + /// + /// Acceptable values are: + /// - "active" + /// - "inactive" + /// - "pending" pub status: Option, /// The URL for the About page. pub url: Option, @@ -4941,12 +5638,6 @@ impl Part for LiaAboutPageSettings {} pub struct OrderLineItem { /// Product data as seen by customer from the time of the order placement. Note that certain attributes values (e.g. title or gtin) might be reformatted and no longer match values submitted via product feed. pub product: Option, - /// Number of items delivered. - #[serde(rename="quantityDelivered")] - pub quantity_delivered: Option, - /// Details of the return policy for the line item. - #[serde(rename="returnInfo")] - pub return_info: Option, /// Total price for the line item. For example, if two items for $10 are purchased, the total price will be $20. pub price: Option, /// Number of items pending. @@ -4954,29 +5645,38 @@ pub struct OrderLineItem { pub quantity_pending: Option, /// Total tax amount for the line item. For example, if two items are purchased, and each have a cost tax of $2, the total tax amount will be $4. pub tax: Option, + /// Number of items ready for pickup. + #[serde(rename="quantityReadyForPickup")] + pub quantity_ready_for_pickup: Option, + /// Number of items returned. + #[serde(rename="quantityReturned")] + pub quantity_returned: Option, + /// The ID of the line item. + pub id: Option, + /// Details of the requested shipping for the line item. + #[serde(rename="shippingDetails")] + pub shipping_details: Option, + /// Number of items delivered. + #[serde(rename="quantityDelivered")] + pub quantity_delivered: Option, + /// Details of the return policy for the line item. + #[serde(rename="returnInfo")] + pub return_info: Option, /// Cancellations of the line item. pub cancellations: Option>, /// Number of items canceled. #[serde(rename="quantityCanceled")] pub quantity_canceled: Option, - /// The ID of the line item. - pub id: Option, + /// Annotations that are attached to the line item. + pub annotations: Option>, /// Returns of the line item. pub returns: Option>, /// Number of items shipped. #[serde(rename="quantityShipped")] pub quantity_shipped: Option, - /// Annotations that are attached to the line item. - pub annotations: Option>, - /// Number of items returned. - #[serde(rename="quantityReturned")] - pub quantity_returned: Option, /// Number of items ordered. #[serde(rename="quantityOrdered")] pub quantity_ordered: Option, - /// Details of the requested shipping for the line item. - #[serde(rename="shippingDetails")] - pub shipping_details: Option, } impl Part for OrderLineItem {} @@ -5000,6 +5700,18 @@ pub struct OrdersCustomBatchRequestEntryCancelLineItem { #[serde(rename="lineItemId")] pub line_item_id: Option, /// The reason for the cancellation. + /// + /// Acceptable values are: + /// - "customerInitiatedCancel" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "noInventory" + /// - "other" + /// - "priceError" + /// - "shippingPriceError" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" pub reason: Option, /// Tax amount that corresponds to cancellation amount in amountPretax. Optional, but if filled, then amountPretax must be set. Calculated automatically if not provided. #[serde(rename="amountTax")] @@ -5020,9 +5732,13 @@ impl Part for OrdersCustomBatchRequestEntryCancelLineItem {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Weight { - /// The weight unit. + /// Required. The weight unit. + /// + /// Acceptable values are: + /// - "kg" + /// - "lb" pub unit: Option, - /// The weight represented as a number. + /// Required. The weight represented as a number. pub value: Option, } @@ -5101,6 +5817,21 @@ pub struct OrdersCustomBatchRequestEntryReturnRefundLineItem { /// The quantity to return and refund. pub quantity: Option, /// The reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. #[serde(rename="productId")] @@ -5236,12 +5967,28 @@ impl Part for AccountIdentifier {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DatafeedFormat { /// Character encoding scheme of the data feed. If not specified, the encoding will be auto-detected. + /// + /// Acceptable values are: + /// - "latin-1" + /// - "utf-16be" + /// - "utf-16le" + /// - "utf-8" + /// - "windows-1252" #[serde(rename="fileEncoding")] pub file_encoding: Option, /// Specifies how double quotes are interpreted. If not specified, the mode will be auto-detected. Ignored for non-DSV data feeds. + /// + /// Acceptable values are: + /// - "normal character" + /// - "value quoting" #[serde(rename="quotingMode")] pub quoting_mode: Option, /// Delimiter for the separation of values in a delimiter-separated values feed. If not specified, the delimiter will be auto-detected. Ignored for non-DSV data feeds. + /// + /// Acceptable values are: + /// - "pipe" + /// - "tab" + /// - "tilde" #[serde(rename="columnDelimiter")] pub column_delimiter: Option, } @@ -5320,6 +6067,10 @@ pub struct OrdersUpdateShipmentResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateShipmentResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -5344,6 +6095,21 @@ pub struct OrdersInStoreRefundLineItemRequest { #[serde(rename="amountPretax")] pub amount_pretax: Option, /// The reason for the return. + /// + /// Acceptable values are: + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "invalidCoupon" + /// - "malformedShippingAddress" + /// - "other" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "qualityNotAsExpected" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// The explanation of the reason. #[serde(rename="reasonText")] @@ -5377,8 +6143,17 @@ impl RequestValue for OrdersInStoreRefundLineItemRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccountsLinkRequest { /// Action to perform for this link. The "request" action is only available to select merchants. + /// + /// Acceptable values are: + /// - "approve" + /// - "remove" + /// - "request" pub action: Option, /// Type of the link between the two accounts. + /// + /// Acceptable values are: + /// - "channelPartner" + /// - "eCommercePlatform" #[serde(rename="linkType")] pub link_type: Option, /// The ID of the linked account. @@ -5406,7 +6181,10 @@ pub struct ProductstatusesCustomBatchRequestEntry { pub merchant_id: Option, /// If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. pub destinations: Option>, - /// no description provided + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "get" pub method: Option, /// The ID of the product whose status to get. #[serde(rename="productId")] @@ -5448,7 +6226,15 @@ pub struct LiasettingsCustomBatchRequestEntry { /// The account ID by which this merchant is known to the POS provider. #[serde(rename="posExternalAccountId")] pub pos_external_account_id: Option, - /// no description provided + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "get" + /// - "getAccessibleGmbAccounts" + /// - "requestGmbAccess" + /// - "requestInventoryVerification" + /// - "setInventoryVerificationContact" + /// - "update" pub method: Option, /// The ID of the account for which to get/update account shipping settings. #[serde(rename="accountId")] @@ -5477,7 +6263,10 @@ pub struct DatafeedstatusesCustomBatchRequestEntry { /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, - /// no description provided + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "get" pub method: Option, } @@ -5629,6 +6418,10 @@ pub struct OrdersCancelLineItemResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelLineItemResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -5674,9 +6467,16 @@ pub struct OrderLegacyPromotion { /// no description provided pub benefits: Option>, /// Indicates that the promotion is valid online. + /// + /// Acceptable values are: + /// - "online" #[serde(rename="redemptionChannel")] pub redemption_channel: Option, /// Whether the promotion is applicable to all products or only specific products. + /// + /// Acceptable values are: + /// - "allProducts" + /// - "specificProducts" #[serde(rename="productApplicability")] pub product_applicability: Option, /// The date and time frame when the promotion is active and ready for validation review. Note that the promotion live time may be delayed for a few hours due to the validation review. @@ -5726,6 +6526,24 @@ pub struct OrdersRefundRequest { #[serde(rename="reasonText")] pub reason_text: Option, /// The reason for the refund. + /// + /// Acceptable values are: + /// - "adjustment" + /// - "courtesyAdjustment" + /// - "customerCanceled" + /// - "customerDiscretionaryReturn" + /// - "deliveredLateByCarrier" + /// - "feeAdjustment" + /// - "lateShipmentCredit" + /// - "noInventory" + /// - "other" + /// - "priceError" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "shippingCostAdjustment" + /// - "taxAdjustment" + /// - "undeliverableShippingAddress" + /// - "wrongProductShipped" pub reason: Option, /// Tax amount that corresponds to refund amount in amountPretax. Optional, but if filled, amountPretax must be set. Calculated automatically if not provided. #[serde(rename="amountTax")] @@ -5909,6 +6727,11 @@ impl Part for PosDataProviders {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiaOnDisplayToOrderSettings { /// The status of the ?On display to order? feature. + /// + /// Acceptable values are: + /// - "active" + /// - "inactive" + /// - "pending" pub status: Option, /// Shipping cost and policy URL. #[serde(rename="shippingCostPolicyUrl")] @@ -5924,27 +6747,27 @@ impl Part for LiaOnDisplayToOrderSettings {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PosInventory { - /// A unique identifier for the item. + /// Required. A unique identifier for the item. #[serde(rename="itemId")] pub item_id: Option, - /// The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. + /// Required. The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business. #[serde(rename="storeCode")] pub store_code: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#posInventory". pub kind: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. #[serde(rename="contentLanguage")] pub content_language: Option, - /// The inventory timestamp, in ISO 8601 format. + /// Required. The inventory timestamp, in ISO 8601 format. pub timestamp: Option, - /// The current price of the item. + /// Required. The current price of the item. pub price: Option, - /// The CLDR territory code for the item. + /// Required. The CLDR territory code for the item. #[serde(rename="targetCountry")] pub target_country: Option, /// Global Trade Item Number. pub gtin: Option, - /// The available quantity of the item. + /// Required. The available quantity of the item. pub quantity: Option, } @@ -6043,7 +6866,10 @@ pub struct AccountStatusDataQualityIssue { /// no description provided #[serde(rename="displayedValue")] pub displayed_value: Option, - /// no description provided + /// Acceptable values are: + /// - "critical" + /// - "error" + /// - "suggestion" pub severity: Option, /// no description provided #[serde(rename="lastChecked")] @@ -6084,9 +6910,19 @@ pub struct ProductStatusDestinationStatus { /// The name of the destination pub destination: Option, /// The destination's approval status. + /// + /// Acceptable values are: + /// - "approved" + /// - "disapproved" #[serde(rename="approvalStatus")] pub approval_status: Option, /// Provided for backward compatibility only. Always set to "required". + /// + /// Acceptable values are: + /// - "default" + /// - "excluded" + /// - "optional" + /// - "required" pub intention: Option, } @@ -6125,37 +6961,56 @@ impl Part for InventoryCustomBatchRequestEntry {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderShipment { /// The status of the shipment. + /// + /// Acceptable values are: + /// - "delivered" + /// - "readyForPickup" + /// - "shipped" + /// - "undeliverable" pub status: Option, /// Date on which the shipment has been created, in ISO 8601 format. #[serde(rename="creationDate")] pub creation_date: Option, /// The carrier handling the shipment. /// - /// Acceptable values for US are: - /// - "gsx" - /// - "ups" - /// - "usps" - /// - "fedex" - /// - "dhl" - /// - "ecourier" - /// - "cxt" - /// - "google" - /// - "ontrac" - /// - "emsy" - /// - "ont" - /// - "deliv" - /// - "dynamex" - /// - "lasership" - /// - "mpx" - /// - "uds" - /// - "efw" - /// - /// Acceptable values for FR are: - /// - "colissimo" - /// - "chronopost" - /// - "gls" - /// - "dpd" - /// - "bpost" + /// For supported carriers, Google includes the carrier name and tracking URL in emails to customers. For select supported carriers, Google also automatically updates the shipment status based on the provided shipment ID. Note: You can also use unsupported carriers, but emails to customers will not include the carrier name or tracking URL, and there will be no automatic order status updates. + /// Supported carriers for US are: + /// - "ups" (United Parcel Service) automatic status updates + /// - "usps" (United States Postal Service) automatic status updates + /// - "fedex" (FedEx) automatic status updates + /// - "dhl" (DHL eCommerce) automatic status updates (US only) + /// - "ontrac" (OnTrac) automatic status updates + /// - "dhl express" (DHL Express) + /// - "deliv" (Deliv) + /// - "dynamex" (TForce) + /// - "lasership" (LaserShip) + /// - "mpx" (Military Parcel Xpress) + /// - "uds" (United Delivery Service) + /// - "efw" (Estes Forwarding Worldwide) + /// - "jd logistics" (JD Logistics) + /// - "yunexpress" (YunExpress) + /// - "china post" (China Post) + /// - "china ems" (China Post Express Mail Service) + /// - "singapore post" (Singapore Post) + /// - "pos malaysia" (Pos Malaysia) + /// - "postnl" (PostNL) + /// - "ptt" (PTT Turkish Post) + /// - "eub" (ePacket) + /// - "chukou1" (Chukou1 Logistics) + /// Supported carriers for FR are: + /// - "la poste" (La Poste) automatic status updates + /// - "colissimo" (Colissimo by La Poste) automatic status updates + /// - "ups" (United Parcel Service) automatic status updates + /// - "chronopost" (Chronopost by La Poste) + /// - "gls" (General Logistics Systems France) + /// - "dpd" (DPD Group by GeoPost) + /// - "bpost" (Belgian Post Group) + /// - "colis prive" (Colis Privé) + /// - "boxtal" (Boxtal) + /// - "geodis" (GEODIS) + /// - "tnt" (TNT) + /// - "db schenker" (DB Schenker) + /// - "aramex" (Aramex) pub carrier: Option, /// The tracking ID for the shipment. #[serde(rename="trackingId")] @@ -6179,18 +7034,18 @@ impl Part for OrderShipment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestOrderLineItem { - /// Details of the return policy for the line item. + /// Required. Details of the return policy for the line item. #[serde(rename="returnInfo")] pub return_info: Option, - /// Product data from the time of the order placement. + /// Required. Product data from the time of the order placement. pub product: Option, /// Deprecated. Ignored if provided. #[serde(rename="unitTax")] pub unit_tax: Option, - /// Number of items ordered. + /// Required. Number of items ordered. #[serde(rename="quantityOrdered")] pub quantity_ordered: Option, - /// Details of the requested shipping for the line item. + /// Required. Details of the requested shipping for the line item. #[serde(rename="shippingDetails")] pub shipping_details: Option, } @@ -6216,7 +7071,11 @@ pub struct AccounttaxCustomBatchRequestEntry { /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, - /// no description provided + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "get" + /// - "update" pub method: Option, } @@ -6237,6 +7096,10 @@ pub struct OrderinvoicesCreateChargeInvoiceResponse { /// Identifies what kind of resource this is. Value: the fixed string "content#orderinvoicesCreateChargeInvoiceResponse". pub kind: Option, /// The status of the execution. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -6251,15 +7114,15 @@ impl ResponseResult for OrderinvoicesCreateChargeInvoiceResponse {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [fetchnow datafeeds](struct.DatafeedFetchnowCall.html) (response) +/// * [setinventoryverificationcontact liasettings](struct.LiasettingSetinventoryverificationcontactCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DatafeedsFetchNowResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#datafeedsFetchNowResponse". +pub struct LiasettingsSetInventoryVerificationContactResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#liasettingsSetInventoryVerificationContactResponse". pub kind: Option, } -impl ResponseResult for DatafeedsFetchNowResponse {} +impl ResponseResult for LiasettingsSetInventoryVerificationContactResponse {} /// There is no detailed description. @@ -6315,6 +7178,52 @@ impl Part for HolidayCutoff {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption { /// [required] Reason for the refund. + /// + /// Acceptable values are: + /// - "adjustment" + /// - "autoPostInternal" + /// - "autoPostInvalidBillingAddress" + /// - "autoPostNoInventory" + /// - "autoPostPriceError" + /// - "autoPostUndeliverableShippingAddress" + /// - "couponAbuse" + /// - "courtesyAdjustment" + /// - "customerCanceled" + /// - "customerDiscretionaryReturn" + /// - "customerInitiatedMerchantCancel" + /// - "customerSupportRequested" + /// - "deliveredLateByCarrier" + /// - "deliveredTooLate" + /// - "expiredItem" + /// - "failToPushOrderGoogleError" + /// - "failToPushOrderMerchantError" + /// - "failToPushOrderMerchantFulfillmentError" + /// - "failToPushOrderToMerchant" + /// - "failToPushOrderToMerchantOutOfStock" + /// - "feeAdjustment" + /// - "invalidCoupon" + /// - "lateShipmentCredit" + /// - "malformedShippingAddress" + /// - "merchantDidNotShipOnTime" + /// - "noInventory" + /// - "orderTimeout" + /// - "other" + /// - "paymentAbuse" + /// - "paymentDeclined" + /// - "priceAdjustment" + /// - "priceError" + /// - "productArrivedDamaged" + /// - "productNotAsDescribed" + /// - "promoReallocation" + /// - "qualityNotAsExpected" + /// - "returnRefundAbuse" + /// - "shippingCostAdjustment" + /// - "shippingPriceError" + /// - "taxAdjustment" + /// - "taxError" + /// - "undeliverableShippingAddress" + /// - "unsupportedPoBoxAddress" + /// - "wrongProductShipped" pub reason: Option, /// Optional description of the refund reason. pub description: Option, @@ -6344,20 +7253,27 @@ impl Part for Price {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MerchantOrderReturnItem { - /// no description provided + /// Product level item ID. If the returned items are of the same product, they will have the same ID. #[serde(rename="itemId")] pub item_id: Option, - /// no description provided + /// Product data from the time of the order placement. pub product: Option, - /// no description provided + /// The reason that merchant chooses to accept a return item. #[serde(rename="merchantReturnReason")] pub merchant_return_reason: Option, - /// no description provided + /// The reason that the customer chooses to return an item. #[serde(rename="customerReturnReason")] pub customer_return_reason: Option, - /// no description provided + /// State of the item. + /// + /// Acceptable values are: + /// - "canceled" + /// - "new" + /// - "received" + /// - "refunded" + /// - "rejected" pub state: Option, - /// no description provided + /// IDs of the return shipments that this return item belongs to. #[serde(rename="returnShipmentIds")] pub return_shipment_ids: Option>, } @@ -6370,12 +7286,18 @@ impl Part for MerchantOrderReturnItem {} /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TransitTableTransitTimeRow { - /// no description provided - pub values: Option>, +pub struct PickupServicesPickupService { + /// The CLDR country code of the carrier (e.g., "US"). Always present. + pub country: Option, + /// The name of the pickup service (e.g., "Access point"). Always present. + #[serde(rename="serviceName")] + pub service_name: Option, + /// The name of the carrier (e.g., "UPS"). Always present. + #[serde(rename="carrierName")] + pub carrier_name: Option, } -impl Part for TransitTableTransitTimeRow {} +impl Part for PickupServicesPickupService {} /// There is no detailed description. @@ -6384,25 +7306,29 @@ impl Part for TransitTableTransitTimeRow {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestOrderLineItemProduct { - /// The CLDR territory code of the target country of the product. + /// Required. The CLDR territory code of the target country of the product. #[serde(rename="targetCountry")] pub target_country: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. + /// + /// Acceptable values are: + /// - "en" + /// - "fr" #[serde(rename="contentLanguage")] pub content_language: Option, - /// The title of the product. + /// Required. The title of the product. pub title: Option, /// Manufacturer Part Number (MPN) of the item. Optional. pub mpn: Option, /// Variant attributes for the item. Optional. #[serde(rename="variantAttributes")] pub variant_attributes: Option>, - /// Brand of the item. + /// Required. Brand of the item. pub brand: Option, - /// URL of an image of the item. + /// Required. URL of an image of the item. #[serde(rename="imageLink")] pub image_link: Option, - /// An identifier of the item. + /// Required. An identifier of the item. #[serde(rename="offerId")] pub offer_id: Option, /// Shared identifier for all variants of the same product. Optional. @@ -6410,13 +7336,19 @@ pub struct TestOrderLineItemProduct { pub item_group_id: Option, /// Global Trade Item Number (GTIN) of the item. Optional. pub gtin: Option, - /// Condition or state of the item. + /// Required. Condition or state of the item. + /// + /// Acceptable values are: + /// - "new" pub condition: Option, /// Fees for the item. Optional. pub fees: Option>, - /// The price for the product. Tax is automatically calculated for MFL orders. For non-MFL orders, tax settings from Merchant Center are applied. + /// Required. The price for the product. Tax is automatically calculated for orders where marketplace facilitator tax laws are applicable. Otherwise, tax settings from Merchant Center are applied. pub price: Option, /// Deprecated. + /// + /// Acceptable values are: + /// - "online" pub channel: Option, } @@ -6462,31 +7394,6 @@ pub struct OrdersGetByMerchantOrderIdResponse { impl ResponseResult for OrdersGetByMerchantOrderIdResponse {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifyrefund orderpayments](struct.OrderpaymentNotifyrefundCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyRefundRequest { - /// Deprecated. Please use invoiceIds instead. - #[serde(rename="invoiceId")] - pub invoice_id: Option, - /// Whether refund was successful. - #[serde(rename="refundState")] - pub refund_state: Option, - /// Invoice IDs from the orderinvoices service that correspond to the refund. - #[serde(rename="invoiceIds")] - pub invoice_ids: Option>, -} - -impl RequestValue for OrderpaymentsNotifyRefundRequest {} - - /// There is no detailed description. /// /// # Activities @@ -6584,7 +7491,13 @@ pub struct DatafeedTarget { pub excluded_destinations: Option>, /// The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targets[].country. pub language: Option, - /// The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included unless provided in the excluded_destination field. + /// The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included unless provided in excludedDestinations. + /// + /// List of supported destinations (if available to the account): + /// - DisplayAds + /// - Shopping + /// - ShoppingActions + /// - SurfacesAcrossGoogle #[serde(rename="includedDestinations")] pub included_destinations: Option>, } @@ -6637,6 +7550,11 @@ pub struct InventorySetRequest { #[serde(rename="customLabel3")] pub custom_label3: Option, /// The availability of the product. + /// + /// Acceptable values are: + /// - "in stock" + /// - "out of stock" + /// - "preorder" pub availability: Option, /// Loyalty points that users receive after purchasing the item. Japan only. #[serde(rename="loyaltyPoints")] @@ -6726,12 +7644,12 @@ impl Part for PostalCodeRange {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PosStore { - /// The street address of the store. + /// Required. The street address of the store. #[serde(rename="storeAddress")] pub store_address: Option, /// Identifies what kind of resource this is. Value: the fixed string "content#posStore". pub kind: Option, - /// A store identifier that is unique for the given merchant. + /// Required. A store identifier that is unique for the given merchant. #[serde(rename="storeCode")] pub store_code: Option, } @@ -6747,6 +7665,10 @@ impl ResponseResult for PosStore {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccountAdwordsLink { /// Status of the link between this Merchant Center account and the AdWords account. Upon retrieval, it represents the actual status of the link and can be either active if it was approved in Google AdWords or pending if it's pending approval. Upon insertion, it represents the intended status of the link. Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status will remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if it was active or cancel the link request if it was pending. + /// + /// Acceptable values are: + /// - "active" + /// - "pending" pub status: Option, /// Customer ID of the AdWords account. #[serde(rename="adwordsId")] @@ -6794,31 +7716,6 @@ pub struct OrderPaymentMethod { impl Part for OrderPaymentMethod {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [notifycharge orderpayments](struct.OrderpaymentNotifychargeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderpaymentsNotifyChargeRequest { - /// Whether charge was successful. - #[serde(rename="chargeState")] - pub charge_state: Option, - /// Deprecated. Please use invoiceIds instead. - #[serde(rename="invoiceId")] - pub invoice_id: Option, - /// Invoice IDs from the orderinvoices service that correspond to the charge. - #[serde(rename="invoiceIds")] - pub invoice_ids: Option>, -} - -impl RequestValue for OrderpaymentsNotifyChargeRequest {} - - /// A batch entry encoding a single non-batch productstatuses response. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -6870,24 +7767,46 @@ pub struct Product { #[serde(rename="expirationDate")] pub expiration_date: Option, /// Availability status of the item. + /// + /// Acceptable values are: + /// - "in stock" + /// - "out of stock" + /// - "preorder" pub availability: Option, /// Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise. #[serde(rename="adwordsGrouping")] pub adwords_grouping: Option, /// Specifies the intended destinations for the product. pub destinations: Option>, - /// The CLDR territory code for the item. + /// Required. The CLDR territory code for the item. #[serde(rename="targetCountry")] pub target_country: Option, /// Custom label 4 for custom grouping of items in a Shopping campaign. #[serde(rename="customLabel4")] pub custom_label4: Option, /// The source of the offer, i.e., how the offer was created. + /// + /// Acceptable values are: + /// - "api" + /// - "crawl" + /// - "feed" pub source: Option, /// Additional categories of the item (formatted as in products data specification). #[serde(rename="additionalProductTypes")] pub additional_product_types: Option>, /// The energy efficiency class as defined in EU directive 2010/30/EU. + /// + /// Acceptable values are: + /// - "A" + /// - "A+" + /// - "A++" + /// - "A+++" + /// - "B" + /// - "C" + /// - "D" + /// - "E" + /// - "F" + /// - "G" #[serde(rename="minEnergyEfficiencyClass")] pub min_energy_efficiency_class: Option, /// Deprecated. Whether an item is available for purchase only online. @@ -6904,7 +7823,7 @@ pub struct Product { /// Height of the item for shipping. #[serde(rename="shippingHeight")] pub shipping_height: Option, - /// The two-letter ISO 639-1 language code for the item. + /// Required. The two-letter ISO 639-1 language code for the item. #[serde(rename="contentLanguage")] pub content_language: Option, /// Manufacturer Part Number (MPN) of the item. @@ -6923,12 +7842,45 @@ pub struct Product { #[serde(rename="adwordsRedirect")] pub adwords_redirect: Option, /// The energy efficiency class as defined in EU directive 2010/30/EU. + /// + /// Acceptable values are: + /// - "A" + /// - "A+" + /// - "A++" + /// - "A+++" + /// - "B" + /// - "C" + /// - "D" + /// - "E" + /// - "F" + /// - "G" #[serde(rename="energyEfficiencyClass")] pub energy_efficiency_class: Option, /// System in which the size is specified. Recommended for apparel items. + /// + /// Acceptable values are: + /// - "AU" + /// - "BR" + /// - "CN" + /// - "DE" + /// - "EU" + /// - "FR" + /// - "IT" + /// - "JP" + /// - "MEX" + /// - "UK" + /// - "US" #[serde(rename="sizeSystem")] pub size_system: Option, /// The cut of the item. Recommended for apparel items. + /// + /// Acceptable values are: + /// - "big and tall" + /// - "maternity" + /// - "oversize" + /// - "petite" + /// - "plus" + /// - "regular" #[serde(rename="sizeType")] pub size_type: Option, /// Custom label 3 for custom grouping of items in a Shopping campaign. @@ -6938,6 +7890,10 @@ pub struct Product { #[serde(rename="customLabel2")] pub custom_label2: Option, /// Condition or state of the item. + /// + /// Acceptable values are: + /// - "local" + /// - "online" pub condition: Option, /// Custom label 0 for custom grouping of items in a Shopping campaign. #[serde(rename="customLabel0")] @@ -6946,13 +7902,30 @@ pub struct Product { pub kind: Option, /// Number and amount of installments to pay for an item. Brazil only. pub installment: Option, - /// Size of the item. + /// Size of the item. Only one value is allowed. For variants with different sizes, insert a separate product for each size with the same itemGroupId value (see size definition). pub sizes: Option>, /// Target gender of the item. + /// + /// Acceptable values are: + /// - "female" + /// - "male" + /// - "unisex" pub gender: Option, /// Tax information. pub taxes: Option>, /// The energy efficiency class as defined in EU directive 2010/30/EU. + /// + /// Acceptable values are: + /// - "A" + /// - "A+" + /// - "A++" + /// - "A+++" + /// - "B" + /// - "C" + /// - "D" + /// - "E" + /// - "F" + /// - "G" #[serde(rename="maxEnergyEfficiencyClass")] pub max_energy_efficiency_class: Option, /// False when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Required according to the Unique Product Identifier Rules for all target countries except for Canada. @@ -6971,6 +7944,14 @@ pub struct Product { #[serde(rename="customLabel1")] pub custom_label1: Option, /// Target age group of the item. + /// + /// Acceptable values are: + /// - "adult" + /// - "infant" + /// - "kids" + /// - "newborn" + /// - "toddler" + /// - "youngAdult" #[serde(rename="ageGroup")] pub age_group: Option, /// Title of an item for dynamic remarketing campaigns. @@ -6979,7 +7960,7 @@ pub struct Product { /// Additional URLs of images of the item. #[serde(rename="additionalImageLinks")] pub additional_image_links: Option>, - /// A unique identifier for the item. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. Only valid unicode characters are accepted. See the products feed specification for details. + /// Required. A unique identifier for the item. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. Only valid unicode characters are accepted. See the products feed specification for details. /// Note: Content API methods that operate on products take the REST ID of the product, not this identifier. #[serde(rename="offerId")] pub offer_id: Option, @@ -7013,7 +7994,7 @@ pub struct Product { /// The measure and dimension of an item. #[serde(rename="unitPricingMeasure")] pub unit_pricing_measure: Option, - /// A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (e.g., { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. + /// A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (e.g., { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Shopping Actions. #[serde(rename="customAttributes")] pub custom_attributes: Option>, /// The day a pre-ordered product becomes available for delivery, in ISO 8601 format. @@ -7022,7 +8003,11 @@ pub struct Product { /// Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price. #[serde(rename="isBundle")] pub is_bundle: Option, - /// The item's channel (online or local). + /// Required. The item's channel (online or local). + /// + /// Acceptable values are: + /// - "local" + /// - "online" pub channel: Option, /// The material of which the item is made. pub material: Option, @@ -7089,7 +8074,11 @@ pub struct OrdersCustomBatchResponseEntry { pub order: Option, /// The status of the execution. Only defined if /// - the request was successful; and - /// - the method is not get, getByMerchantOrderId, or one of the test methods. + /// - the method is not get, getByMerchantOrderId, or one of the test methods. + /// + /// Acceptable values are: + /// - "duplicate" + /// - "executed" #[serde(rename="executionStatus")] pub execution_status: Option, } @@ -7135,7 +8124,11 @@ pub struct ShippingsettingsCustomBatchRequestEntry { /// The account shipping settings to update. Only defined if the method is update. #[serde(rename="shippingSettings")] pub shipping_settings: Option, - /// no description provided + /// The method of the batch entry. + /// + /// Acceptable values are: + /// - "get" + /// - "update" pub method: Option, } @@ -7295,25 +8288,6 @@ impl<'a, C, A> MethodsBuilder for OrderreturnMethods<'a, C, A> {} impl<'a, C, A> OrderreturnMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Retrieves an order return from your Merchant Center account. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `returnId` - Merchant order return ID generated by Google. - pub fn get(&self, merchant_id: &str, return_id: &str) -> OrderreturnGetCall<'a, C, A> { - OrderreturnGetCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _return_id: return_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists order returns in your Merchant Center account. @@ -7335,6 +8309,25 @@ impl<'a, C, A> OrderreturnMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an order return from your Merchant Center account. + /// + /// # Arguments + /// + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `returnId` - Merchant order return ID generated by Google. + pub fn get(&self, merchant_id: &str, return_id: &str) -> OrderreturnGetCall<'a, C, A> { + OrderreturnGetCall { + hub: self.hub, + _merchant_id: merchant_id.to_string(), + _return_id: return_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -7363,7 +8356,7 @@ impl<'a, C, A> OrderreturnMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `custombatch(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `custombatch(...)`, `get(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.accounttax(); /// # } @@ -7437,28 +8430,6 @@ impl<'a, C, A> AccounttaxMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates the tax settings of the account. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// * `accountId` - The ID of the account for which to get/update account tax settings. - pub fn patch(&self, request: AccountTax, merchant_id: &str, account_id: &str) -> AccounttaxPatchCall<'a, C, A> { - AccounttaxPatchCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _account_id: account_id.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists the tax settings of the sub-accounts in your Merchant Center account. @@ -7481,132 +8452,6 @@ impl<'a, C, A> AccounttaxMethods<'a, C, A> { -/// A builder providing access to all methods supported on *orderpayment* resources. -/// It is not used directly, but through the `ShoppingContent` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_content2 as content2; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use content2::ShoppingContent; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `notifyauthapproved(...)`, `notifyauthdeclined(...)`, `notifycharge(...)` and `notifyrefund(...)` -/// // to build up your call. -/// let rb = hub.orderpayments(); -/// # } -/// ``` -pub struct OrderpaymentMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, -} - -impl<'a, C, A> MethodsBuilder for OrderpaymentMethods<'a, C, A> {} - -impl<'a, C, A> OrderpaymentMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Notify about successfully authorizing user's payment method for a given amount. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `orderId` - The ID of the order for for which payment authorization is happening. - pub fn notifyauthapproved(&self, request: OrderpaymentsNotifyAuthApprovedRequest, merchant_id: &str, order_id: &str) -> OrderpaymentNotifyauthapprovedCall<'a, C, A> { - OrderpaymentNotifyauthapprovedCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Notify about failure to authorize user's payment method. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `orderId` - The ID of the order for which payment authorization was declined. - pub fn notifyauthdeclined(&self, request: OrderpaymentsNotifyAuthDeclinedRequest, merchant_id: &str, order_id: &str) -> OrderpaymentNotifyauthdeclinedCall<'a, C, A> { - OrderpaymentNotifyauthdeclinedCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Notify about charge on user's selected payments method. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `orderId` - The ID of the order for which charge is happening. - pub fn notifycharge(&self, request: OrderpaymentsNotifyChargeRequest, merchant_id: &str, order_id: &str) -> OrderpaymentNotifychargeCall<'a, C, A> { - OrderpaymentNotifychargeCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Notify about refund on user's selected payments method. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `orderId` - The ID of the order for which charge is happening. - pub fn notifyrefund(&self, request: OrderpaymentsNotifyRefundRequest, merchant_id: &str, order_id: &str) -> OrderpaymentNotifyrefundCall<'a, C, A> { - OrderpaymentNotifyrefundCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *shippingsetting* resources. /// It is not used directly, but through the `ShoppingContent` hub. /// @@ -7631,7 +8476,7 @@ impl<'a, C, A> OrderpaymentMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `custombatch(...)`, `get(...)`, `getsupportedcarriers(...)`, `getsupportedholidays(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `custombatch(...)`, `get(...)`, `getsupportedcarriers(...)`, `getsupportedholidays(...)`, `getsupportedpickupservices(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.shippingsettings(); /// # } @@ -7663,6 +8508,25 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the shipping settings of the sub-accounts in your Merchant Center account. + /// + /// # Arguments + /// + /// * `merchantId` - The ID of the managing account. This must be a multi-client account. + pub fn list(&self, merchant_id: &str) -> ShippingsettingListCall<'a, C, A> { + ShippingsettingListCall { + hub: self.hub, + _merchant_id: merchant_id.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves and updates the shipping settings of multiple accounts in a single request. @@ -7681,28 +8545,6 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates the shipping settings of the account. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// * `accountId` - The ID of the account for which to get/update shipping settings. - pub fn patch(&self, request: ShippingSettings, merchant_id: &str, account_id: &str) -> ShippingsettingPatchCall<'a, C, A> { - ShippingsettingPatchCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _account_id: account_id.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves the shipping settings of the account. @@ -7724,13 +8566,13 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves supported holidays for an account. + /// Retrieves supported pickup services for an account. /// /// # Arguments /// - /// * `merchantId` - The ID of the account for which to retrieve the supported holidays. - pub fn getsupportedholidays(&self, merchant_id: &str) -> ShippingsettingGetsupportedholidayCall<'a, C, A> { - ShippingsettingGetsupportedholidayCall { + /// * `merchantId` - The ID of the account for which to retrieve the supported pickup services. + pub fn getsupportedpickupservices(&self, merchant_id: &str) -> ShippingsettingGetsupportedpickupserviceCall<'a, C, A> { + ShippingsettingGetsupportedpickupserviceCall { hub: self.hub, _merchant_id: merchant_id.to_string(), _delegate: Default::default(), @@ -7741,17 +8583,15 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the shipping settings of the sub-accounts in your Merchant Center account. + /// Retrieves supported holidays for an account. /// /// # Arguments /// - /// * `merchantId` - The ID of the managing account. This must be a multi-client account. - pub fn list(&self, merchant_id: &str) -> ShippingsettingListCall<'a, C, A> { - ShippingsettingListCall { + /// * `merchantId` - The ID of the account for which to retrieve the supported holidays. + pub fn getsupportedholidays(&self, merchant_id: &str) -> ShippingsettingGetsupportedholidayCall<'a, C, A> { + ShippingsettingGetsupportedholidayCall { hub: self.hub, _merchant_id: merchant_id.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -7807,7 +8647,7 @@ impl<'a, C, A> ShippingsettingMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `custombatch(...)`, `delete(...)`, `fetchnow(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `custombatch(...)`, `delete(...)`, `fetchnow(...)`, `get(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.datafeeds(); /// # } @@ -7824,15 +8664,34 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a datafeed configuration of your Merchant Center account. This method supports patch semantics. + /// Retrieves a datafeed configuration from your Merchant Center account. + /// + /// # Arguments + /// + /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. + /// * `datafeedId` - The ID of the datafeed. + pub fn get(&self, merchant_id: &str, datafeed_id: &str) -> DatafeedGetCall<'a, C, A> { + DatafeedGetCall { + hub: self.hub, + _merchant_id: merchant_id.to_string(), + _datafeed_id: datafeed_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a datafeed configuration of your Merchant Center account. /// /// # Arguments /// /// * `request` - No description provided. /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. /// * `datafeedId` - The ID of the datafeed. - pub fn patch(&self, request: Datafeed, merchant_id: &str, datafeed_id: &str) -> DatafeedPatchCall<'a, C, A> { - DatafeedPatchCall { + pub fn update(&self, request: Datafeed, merchant_id: &str, datafeed_id: &str) -> DatafeedUpdateCall<'a, C, A> { + DatafeedUpdateCall { hub: self.hub, _request: request, _merchant_id: merchant_id.to_string(), @@ -7882,25 +8741,6 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves a datafeed configuration from your Merchant Center account. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. - /// * `datafeedId` - The ID of the datafeed. - pub fn get(&self, merchant_id: &str, datafeed_id: &str) -> DatafeedGetCall<'a, C, A> { - DatafeedGetCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _datafeed_id: datafeed_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Invokes a fetch for the datafeed in your Merchant Center account. @@ -7941,28 +8781,6 @@ impl<'a, C, A> DatafeedMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates a datafeed configuration of your Merchant Center account. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that manages the datafeed. This account cannot be a multi-client account. - /// * `datafeedId` - The ID of the datafeed. - pub fn update(&self, request: Datafeed, merchant_id: &str, datafeed_id: &str) -> DatafeedUpdateCall<'a, C, A> { - DatafeedUpdateCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _datafeed_id: datafeed_id.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists the configurations for datafeeds in your Merchant Center account. @@ -8024,28 +8842,6 @@ impl<'a, C, A> MethodsBuilder for PoMethods<'a, C, A> {} impl<'a, C, A> PoMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Deletes a store for the given merchant. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the POS or inventory data provider. - /// * `targetMerchantId` - The ID of the target merchant. - /// * `storeCode` - A store code that is unique per merchant. - pub fn delete(&self, merchant_id: &str, target_merchant_id: &str, store_code: &str) -> PoDeleteCall<'a, C, A> { - PoDeleteCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _target_merchant_id: target_merchant_id.to_string(), - _store_code: store_code.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists the stores of the target merchant. @@ -8169,6 +8965,28 @@ impl<'a, C, A> PoMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a store for the given merchant. + /// + /// # Arguments + /// + /// * `merchantId` - The ID of the POS or inventory data provider. + /// * `targetMerchantId` - The ID of the target merchant. + /// * `storeCode` - A store code that is unique per merchant. + pub fn delete(&self, merchant_id: &str, target_merchant_id: &str, store_code: &str) -> PoDeleteCall<'a, C, A> { + PoDeleteCall { + hub: self.hub, + _merchant_id: merchant_id.to_string(), + _target_merchant_id: target_merchant_id.to_string(), + _store_code: store_code.to_string(), + _dry_run: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -8296,7 +9114,7 @@ impl<'a, C, A> AccountstatuseMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `authinfo(...)`, `claimwebsite(...)`, `custombatch(...)`, `delete(...)`, `get(...)`, `insert(...)`, `link(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `authinfo(...)`, `claimwebsite(...)`, `custombatch(...)`, `delete(...)`, `get(...)`, `insert(...)`, `link(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.accounts(); /// # } @@ -8442,28 +9260,6 @@ impl<'a, C, A> AccountMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates a Merchant Center account. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// * `accountId` - The ID of the account. - pub fn patch(&self, request: Account, merchant_id: &str, account_id: &str) -> AccountPatchCall<'a, C, A> { - AccountPatchCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _account_id: account_id.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Performs an action on a link between two Merchant Center accounts, namely accountId and linkedAccountId. @@ -8508,7 +9304,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { -/// A builder providing access to all methods supported on *inventory* resources. +/// A builder providing access to all methods supported on *orderinvoice* resources. /// It is not used directly, but through the `ShoppingContent` hub. /// /// # Example @@ -8532,33 +9328,36 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `custombatch(...)` and `set(...)` +/// // like `createchargeinvoice(...)` and `createrefundinvoice(...)` /// // to build up your call. -/// let rb = hub.inventory(); +/// let rb = hub.orderinvoices(); /// # } /// ``` -pub struct InventoryMethods<'a, C, A> +pub struct OrderinvoiceMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, } -impl<'a, C, A> MethodsBuilder for InventoryMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for OrderinvoiceMethods<'a, C, A> {} -impl<'a, C, A> InventoryMethods<'a, C, A> { +impl<'a, C, A> OrderinvoiceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. + /// Creates a refund invoice for one or more shipment groups, and triggers a refund for orderinvoice enabled orders. This can only be used for line items that have previously been charged using createChargeInvoice. All amounts (except for the summary) are incremental with respect to the previous invoice. /// /// # Arguments /// /// * `request` - No description provided. - pub fn custombatch(&self, request: InventoryCustomBatchRequest) -> InventoryCustombatchCall<'a, C, A> { - InventoryCustombatchCall { + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn createrefundinvoice(&self, request: OrderinvoicesCreateRefundInvoiceRequest, merchant_id: &str, order_id: &str) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { + OrderinvoiceCreaterefundinvoiceCall { hub: self.hub, _request: request, - _dry_run: Default::default(), + _merchant_id: merchant_id.to_string(), + _order_id: order_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -8567,22 +9366,19 @@ impl<'a, C, A> InventoryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates price and availability of a product in your Merchant Center account. + /// Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. - /// * `storeCode` - The code of the store for which to update price and availability. Use online to update price and availability of an online product. - /// * `productId` - The REST ID of the product for which to update price and availability. - pub fn set(&self, request: InventorySetRequest, merchant_id: &str, store_code: &str, product_id: &str) -> InventorySetCall<'a, C, A> { - InventorySetCall { + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn createchargeinvoice(&self, request: OrderinvoicesCreateChargeInvoiceRequest, merchant_id: &str, order_id: &str) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { + OrderinvoiceCreatechargeinvoiceCall { hub: self.hub, _request: request, _merchant_id: merchant_id.to_string(), - _store_code: store_code.to_string(), - _product_id: product_id.to_string(), - _dry_run: Default::default(), + _order_id: order_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -8616,7 +9412,7 @@ impl<'a, C, A> InventoryMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `custombatch(...)`, `get(...)`, `getaccessiblegmbaccounts(...)`, `list(...)`, `listposdataproviders(...)`, `patch(...)`, `requestgmbaccess(...)`, `requestinventoryverification(...)`, `setinventoryverificationcontact(...)`, `setposdataprovider(...)` and `update(...)` +/// // like `custombatch(...)`, `get(...)`, `getaccessiblegmbaccounts(...)`, `list(...)`, `listposdataproviders(...)`, `requestgmbaccess(...)`, `requestinventoryverification(...)`, `setinventoryverificationcontact(...)`, `setposdataprovider(...)` and `update(...)` /// // to build up your call. /// let rb = hub.liasettings(); /// # } @@ -8658,28 +9454,6 @@ impl<'a, C, A> LiasettingMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates the LIA settings of the account. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// * `accountId` - The ID of the account for which to get or update LIA settings. - pub fn patch(&self, request: LiaSettings, merchant_id: &str, account_id: &str) -> LiasettingPatchCall<'a, C, A> { - LiasettingPatchCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _account_id: account_id.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves the list of POS data providers that have active settings for the all eiligible countries. @@ -8773,24 +9547,6 @@ impl<'a, C, A> LiasettingMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves and/or updates the LIA settings of multiple accounts in a single request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn custombatch(&self, request: LiasettingsCustomBatchRequest) -> LiasettingCustombatchCall<'a, C, A> { - LiasettingCustombatchCall { - hub: self.hub, - _request: request, - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists the LIA settings of the sub-accounts in your Merchant Center account. @@ -8831,6 +9587,24 @@ impl<'a, C, A> LiasettingMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves and/or updates the LIA settings of multiple accounts in a single request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn custombatch(&self, request: LiasettingsCustomBatchRequest) -> LiasettingCustombatchCall<'a, C, A> { + LiasettingCustombatchCall { + hub: self.hub, + _request: request, + _dry_run: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the POS data provider for the specified country. @@ -8999,6 +9773,25 @@ impl<'a, C, A> MethodsBuilder for ProductMethods<'a, C, A> {} impl<'a, C, A> ProductMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Retrieves a product from your Merchant Center account. + /// + /// # Arguments + /// + /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. + /// * `productId` - The REST ID of the product. + pub fn get(&self, merchant_id: &str, product_id: &str) -> ProductGetCall<'a, C, A> { + ProductGetCall { + hub: self.hub, + _merchant_id: merchant_id.to_string(), + _product_id: product_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Retrieves, inserts, and deletes multiple products in a single request. @@ -9019,7 +9812,7 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the products in your Merchant Center account. + /// Lists the products in your Merchant Center account. The response might contain fewer items than specified by maxResults. Rely on nextPageToken to determine if there are more items to be requested. /// /// # Arguments /// @@ -9076,25 +9869,6 @@ impl<'a, C, A> ProductMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves a product from your Merchant Center account. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. - /// * `productId` - The REST ID of the product. - pub fn get(&self, merchant_id: &str, product_id: &str) -> ProductGetCall<'a, C, A> { - ProductGetCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _product_id: product_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -9239,20 +10013,17 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Notifies that item return and refund was handled directly by merchant outside of Google payments processing (e.g. cash refund done in store). - /// Note: We recommend calling the returnrefundlineitem method to refund in-store returns. We will issue the refund directly to the customer. This helps to prevent possible differences arising between merchant and Google transaction records. We also recommend having the point of sale system communicate with Google to ensure that customers do not receive a double refund by first refunding via Google then via an in-store return. + /// Retrieves an order using merchant order ID. /// /// # Arguments /// - /// * `request` - No description provided. /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `orderId` - The ID of the order. - pub fn instorerefundlineitem(&self, request: OrdersInStoreRefundLineItemRequest, merchant_id: &str, order_id: &str) -> OrderInstorerefundlineitemCall<'a, C, A> { - OrderInstorerefundlineitemCall { + /// * `merchantOrderId` - The merchant order ID to be looked for. + pub fn getbymerchantorderid(&self, merchant_id: &str, merchant_order_id: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { + OrderGetbymerchantorderidCall { hub: self.hub, - _request: request, _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), + _merchant_order_id: merchant_order_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -9280,25 +10051,6 @@ impl<'a, C, A> OrderMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves an order using merchant order ID. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `merchantOrderId` - The merchant order ID to be looked for. - pub fn getbymerchantorderid(&self, merchant_id: &str, merchant_order_id: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { - OrderGetbymerchantorderidCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _merchant_order_id: merchant_order_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided via other methods. Submitted key-value pairs can be retrieved as part of the orders resource. @@ -9490,6 +10242,28 @@ impl<'a, C, A> OrderMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deprecated. Notifies that item return and refund was handled directly by merchant outside of Google payments processing (e.g. cash refund done in store). + /// Note: We recommend calling the returnrefundlineitem method to refund in-store returns. We will issue the refund directly to the customer. This helps to prevent possible differences arising between merchant and Google transaction records. We also recommend having the point of sale system communicate with Google to ensure that customers do not receive a double refund by first refunding via Google then via an in-store return. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. + /// * `orderId` - The ID of the order. + pub fn instorerefundlineitem(&self, request: OrdersInStoreRefundLineItemRequest, merchant_id: &str, order_id: &str) -> OrderInstorerefundlineitemCall<'a, C, A> { + OrderInstorerefundlineitemCall { + hub: self.hub, + _request: request, + _merchant_id: merchant_id.to_string(), + _order_id: order_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a shipment's status, carrier, and/or tracking ID. @@ -9693,7 +10467,7 @@ impl<'a, C, A> OrderMethods<'a, C, A> { -/// A builder providing access to all methods supported on *orderinvoice* resources. +/// A builder providing access to all methods supported on *inventory* resources. /// It is not used directly, but through the `ShoppingContent` hub. /// /// # Example @@ -9717,36 +10491,33 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `createchargeinvoice(...)` and `createrefundinvoice(...)` +/// // like `custombatch(...)` and `set(...)` /// // to build up your call. -/// let rb = hub.orderinvoices(); +/// let rb = hub.inventory(); /// # } /// ``` -pub struct OrderinvoiceMethods<'a, C, A> +pub struct InventoryMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, } -impl<'a, C, A> MethodsBuilder for OrderinvoiceMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for InventoryMethods<'a, C, A> {} -impl<'a, C, A> OrderinvoiceMethods<'a, C, A> { +impl<'a, C, A> InventoryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a refund invoice for one or more shipment groups, and triggers a refund for orderinvoice enabled orders. This can only be used for line items that have previously been charged using createChargeInvoice. All amounts (except for the summary) are incremental with respect to the previous invoice. + /// Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `orderId` - The ID of the order. - pub fn createrefundinvoice(&self, request: OrderinvoicesCreateRefundInvoiceRequest, merchant_id: &str, order_id: &str) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { - OrderinvoiceCreaterefundinvoiceCall { + pub fn custombatch(&self, request: InventoryCustomBatchRequest) -> InventoryCustombatchCall<'a, C, A> { + InventoryCustombatchCall { hub: self.hub, _request: request, - _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -9755,19 +10526,22 @@ impl<'a, C, A> OrderinvoiceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders. + /// Updates price and availability of a product in your Merchant Center account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the account that manages the order. This cannot be a multi-client account. - /// * `orderId` - The ID of the order. - pub fn createchargeinvoice(&self, request: OrderinvoicesCreateChargeInvoiceRequest, merchant_id: &str, order_id: &str) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { - OrderinvoiceCreatechargeinvoiceCall { + /// * `merchantId` - The ID of the account that contains the product. This account cannot be a multi-client account. + /// * `storeCode` - The code of the store for which to update price and availability. Use online to update price and availability of an online product. + /// * `productId` - The REST ID of the product for which to update price and availability. + pub fn set(&self, request: InventorySetRequest, merchant_id: &str, store_code: &str, product_id: &str) -> InventorySetCall<'a, C, A> { + InventorySetCall { hub: self.hub, _request: request, _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), + _store_code: store_code.to_string(), + _product_id: product_id.to_string(), + _dry_run: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -10371,258 +11145,6 @@ impl<'a, C, A> OrderreportListtransactionCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.orderreturns().get("merchantId", "returnId") -/// .doit(); -/// # } -/// ``` -pub struct OrderreturnGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _return_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderreturnGetCall<'a, C, A> {} - -impl<'a, C, A> OrderreturnGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, MerchantOrderReturn)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orderreturns.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("returnId", self._return_id.to_string())); - for &field in ["alt", "merchantId", "returnId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/orderreturns/{returnId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{returnId}", "returnId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["returnId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the account that manages the order. This cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderreturnGetCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// Merchant order return ID generated by Google. - /// - /// Sets the *return id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn return_id(mut self, new_value: &str) -> OrderreturnGetCall<'a, C, A> { - self._return_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderreturnGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderreturnGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderreturnGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists order returns in your Merchant Center account. /// /// A builder for the *list* method supported by a *orderreturn* resource. @@ -10651,11 +11173,11 @@ impl<'a, C, A> OrderreturnGetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.orderreturns().list("merchantId") -/// .page_token("elitr") -/// .order_by("amet") -/// .max_results(41) -/// .created_start_date("labore") -/// .created_end_date("eirmod") +/// .page_token("dolor") +/// .order_by("eirmod") +/// .max_results(58) +/// .created_start_date("amet") +/// .created_end_date("no") /// .doit(); /// # } /// ``` @@ -10923,6 +11445,258 @@ impl<'a, C, A> OrderreturnListCall<'a, C, A> where C: BorrowMut, } +/// Retrieves an order return from your Merchant Center account. +/// +/// A builder for the *get* method supported by a *orderreturn* resource. +/// It is not used directly, but through a `OrderreturnMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.orderreturns().get("merchantId", "returnId") +/// .doit(); +/// # } +/// ``` +pub struct OrderreturnGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _return_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderreturnGetCall<'a, C, A> {} + +impl<'a, C, A> OrderreturnGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, MerchantOrderReturn)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orderreturns.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("returnId", self._return_id.to_string())); + for &field in ["alt", "merchantId", "returnId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orderreturns/{returnId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{returnId}", "returnId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["returnId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderreturnGetCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// Merchant order return ID generated by Google. + /// + /// Sets the *return id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn return_id(mut self, new_value: &str) -> OrderreturnGetCall<'a, C, A> { + self._return_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderreturnGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderreturnGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrderreturnGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the tax settings of the account. /// /// A builder for the *update* method supported by a *accounttax* resource. @@ -11720,301 +12494,6 @@ impl<'a, C, A> AccounttaxCustombatchCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AccountTax::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.accounttax().patch(req, "merchantId", "accountId") -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct AccounttaxPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: AccountTax, - _merchant_id: String, - _account_id: String, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccounttaxPatchCall<'a, C, A> {} - -impl<'a, C, A> AccounttaxPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccountTax)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.accounttax.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax/{accountId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["accountId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AccountTax) -> AccounttaxPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> AccounttaxPatchCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the account for which to get/update account tax settings. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccounttaxPatchCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> AccounttaxPatchCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccounttaxPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AccounttaxPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccounttaxPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the tax settings of the sub-accounts in your Merchant Center account. /// /// A builder for the *list* method supported by a *accounttax* resource. @@ -12043,8 +12522,8 @@ impl<'a, C, A> AccounttaxPatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounttax().list("merchantId") -/// .page_token("sanctus") -/// .max_results(79) +/// .page_token("duo") +/// .max_results(80) /// .doit(); /// # } /// ``` @@ -12279,1138 +12758,6 @@ impl<'a, C, A> AccounttaxListCall<'a, C, A> where C: BorrowMut, A } -/// Notify about successfully authorizing user's payment method for a given amount. -/// -/// A builder for the *notifyauthapproved* method supported by a *orderpayment* resource. -/// It is not used directly, but through a `OrderpaymentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::OrderpaymentsNotifyAuthApprovedRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrderpaymentsNotifyAuthApprovedRequest::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.orderpayments().notifyauthapproved(req, "merchantId", "orderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderpaymentNotifyauthapprovedCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: OrderpaymentsNotifyAuthApprovedRequest, - _merchant_id: String, - _order_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderpaymentNotifyauthapprovedCall<'a, C, A> {} - -impl<'a, C, A> OrderpaymentNotifyauthapprovedCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrderpaymentsNotifyAuthApprovedResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orderpayments.notifyauthapproved", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/orderpayments/{orderId}/notifyAuthApproved"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: OrderpaymentsNotifyAuthApprovedRequest) -> OrderpaymentNotifyauthapprovedCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the account that manages the order. This cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderpaymentNotifyauthapprovedCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the order for for which payment authorization is happening. - /// - /// Sets the *order id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderpaymentNotifyauthapprovedCall<'a, C, A> { - self._order_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderpaymentNotifyauthapprovedCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderpaymentNotifyauthapprovedCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderpaymentNotifyauthapprovedCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Notify about failure to authorize user's payment method. -/// -/// A builder for the *notifyauthdeclined* method supported by a *orderpayment* resource. -/// It is not used directly, but through a `OrderpaymentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::OrderpaymentsNotifyAuthDeclinedRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrderpaymentsNotifyAuthDeclinedRequest::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.orderpayments().notifyauthdeclined(req, "merchantId", "orderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderpaymentNotifyauthdeclinedCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: OrderpaymentsNotifyAuthDeclinedRequest, - _merchant_id: String, - _order_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderpaymentNotifyauthdeclinedCall<'a, C, A> {} - -impl<'a, C, A> OrderpaymentNotifyauthdeclinedCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrderpaymentsNotifyAuthDeclinedResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orderpayments.notifyauthdeclined", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/orderpayments/{orderId}/notifyAuthDeclined"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: OrderpaymentsNotifyAuthDeclinedRequest) -> OrderpaymentNotifyauthdeclinedCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the account that manages the order. This cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderpaymentNotifyauthdeclinedCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the order for which payment authorization was declined. - /// - /// Sets the *order id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderpaymentNotifyauthdeclinedCall<'a, C, A> { - self._order_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderpaymentNotifyauthdeclinedCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderpaymentNotifyauthdeclinedCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderpaymentNotifyauthdeclinedCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Notify about charge on user's selected payments method. -/// -/// A builder for the *notifycharge* method supported by a *orderpayment* resource. -/// It is not used directly, but through a `OrderpaymentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::OrderpaymentsNotifyChargeRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrderpaymentsNotifyChargeRequest::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.orderpayments().notifycharge(req, "merchantId", "orderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderpaymentNotifychargeCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: OrderpaymentsNotifyChargeRequest, - _merchant_id: String, - _order_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderpaymentNotifychargeCall<'a, C, A> {} - -impl<'a, C, A> OrderpaymentNotifychargeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrderpaymentsNotifyChargeResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orderpayments.notifycharge", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/orderpayments/{orderId}/notifyCharge"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: OrderpaymentsNotifyChargeRequest) -> OrderpaymentNotifychargeCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the account that manages the order. This cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderpaymentNotifychargeCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the order for which charge is happening. - /// - /// Sets the *order id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderpaymentNotifychargeCall<'a, C, A> { - self._order_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderpaymentNotifychargeCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderpaymentNotifychargeCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderpaymentNotifychargeCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Notify about refund on user's selected payments method. -/// -/// A builder for the *notifyrefund* method supported by a *orderpayment* resource. -/// It is not used directly, but through a `OrderpaymentMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::OrderpaymentsNotifyRefundRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrderpaymentsNotifyRefundRequest::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.orderpayments().notifyrefund(req, "merchantId", "orderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderpaymentNotifyrefundCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: OrderpaymentsNotifyRefundRequest, - _merchant_id: String, - _order_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderpaymentNotifyrefundCall<'a, C, A> {} - -impl<'a, C, A> OrderpaymentNotifyrefundCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrderpaymentsNotifyRefundResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orderpayments.notifyrefund", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/orderpayments/{orderId}/notifyRefund"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: OrderpaymentsNotifyRefundRequest) -> OrderpaymentNotifyrefundCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the account that manages the order. This cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderpaymentNotifyrefundCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the order for which charge is happening. - /// - /// Sets the *order id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderpaymentNotifyrefundCall<'a, C, A> { - self._order_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderpaymentNotifyrefundCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderpaymentNotifyrefundCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderpaymentNotifyrefundCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves supported carriers and carrier services for an account. /// /// A builder for the *getsupportedcarriers* method supported by a *shippingsetting* resource. @@ -13651,6 +12998,270 @@ impl<'a, C, A> ShippingsettingGetsupportedcarrierCall<'a, C, A> where C: BorrowM } +/// Lists the shipping settings of the sub-accounts in your Merchant Center account. +/// +/// A builder for the *list* method supported by a *shippingsetting* resource. +/// It is not used directly, but through a `ShippingsettingMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.shippingsettings().list("merchantId") +/// .page_token("et") +/// .max_results(55) +/// .doit(); +/// # } +/// ``` +pub struct ShippingsettingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ShippingsettingListCall<'a, C, A> {} + +impl<'a, C, A> ShippingsettingListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ShippingsettingsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.shippingsettings.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + for &field in ["alt", "merchantId", "pageToken", "maxResults"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/shippingsettings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the managing account. This must be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> ShippingsettingListCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The token returned by the previous request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ShippingsettingListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of shipping settings to return in the response, used for paging. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ShippingsettingListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ShippingsettingListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ShippingsettingListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ShippingsettingListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves and updates the shipping settings of multiple accounts in a single request. /// /// A builder for the *custombatch* method supported by a *shippingsetting* resource. @@ -13901,301 +13512,6 @@ impl<'a, C, A> ShippingsettingCustombatchCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ShippingSettings::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.shippingsettings().patch(req, "merchantId", "accountId") -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct ShippingsettingPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: ShippingSettings, - _merchant_id: String, - _account_id: String, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ShippingsettingPatchCall<'a, C, A> {} - -impl<'a, C, A> ShippingsettingPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ShippingSettings)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.shippingsettings.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/shippingsettings/{accountId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["accountId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ShippingSettings) -> ShippingsettingPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> ShippingsettingPatchCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the account for which to get/update shipping settings. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> ShippingsettingPatchCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> ShippingsettingPatchCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ShippingsettingPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ShippingsettingPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ShippingsettingPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves the shipping settings of the account. /// /// A builder for the *get* method supported by a *shippingsetting* resource. @@ -14448,6 +13764,246 @@ impl<'a, C, A> ShippingsettingGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.shippingsettings().getsupportedpickupservices("merchantId") +/// .doit(); +/// # } +/// ``` +pub struct ShippingsettingGetsupportedpickupserviceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ShippingsettingGetsupportedpickupserviceCall<'a, C, A> {} + +impl<'a, C, A> ShippingsettingGetsupportedpickupserviceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ShippingsettingsGetSupportedPickupServicesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.shippingsettings.getsupportedpickupservices", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + for &field in ["alt", "merchantId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/supportedPickupServices"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the account for which to retrieve the supported pickup services. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> ShippingsettingGetsupportedpickupserviceCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ShippingsettingGetsupportedpickupserviceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ShippingsettingGetsupportedpickupserviceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ShippingsettingGetsupportedpickupserviceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves supported holidays for an account. /// /// A builder for the *getsupportedholidays* method supported by a *shippingsetting* resource. @@ -14688,270 +14244,6 @@ impl<'a, C, A> ShippingsettingGetsupportedholidayCall<'a, C, A> where C: BorrowM } -/// Lists the shipping settings of the sub-accounts in your Merchant Center account. -/// -/// A builder for the *list* method supported by a *shippingsetting* resource. -/// It is not used directly, but through a `ShippingsettingMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.shippingsettings().list("merchantId") -/// .page_token("vero") -/// .max_results(73) -/// .doit(); -/// # } -/// ``` -pub struct ShippingsettingListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _page_token: Option, - _max_results: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ShippingsettingListCall<'a, C, A> {} - -impl<'a, C, A> ShippingsettingListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ShippingsettingsListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.shippingsettings.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - for &field in ["alt", "merchantId", "pageToken", "maxResults"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/shippingsettings"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the managing account. This must be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> ShippingsettingListCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The token returned by the previous request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ShippingsettingListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of shipping settings to return in the response, used for paging. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ShippingsettingListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ShippingsettingListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ShippingsettingListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ShippingsettingListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates the shipping settings of the account. /// /// A builder for the *update* method supported by a *shippingsetting* resource. @@ -15247,9 +14539,261 @@ impl<'a, C, A> ShippingsettingUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.datafeeds().get("merchantId", "datafeedId") +/// .doit(); +/// # } +/// ``` +pub struct DatafeedGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _datafeed_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatafeedGetCall<'a, C, A> {} + +impl<'a, C, A> DatafeedGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Datafeed)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.datafeeds.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("datafeedId", self._datafeed_id.to_string())); + for &field in ["alt", "merchantId", "datafeedId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{datafeedId}", "datafeedId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["datafeedId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> DatafeedGetCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the datafeed. + /// + /// Sets the *datafeed id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn datafeed_id(mut self, new_value: &str) -> DatafeedGetCall<'a, C, A> { + self._datafeed_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DatafeedGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DatafeedGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatafeedGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a datafeed configuration of your Merchant Center account. +/// +/// A builder for the *update* method supported by a *datafeed* resource. /// It is not used directly, but through a `DatafeedMethods` instance. /// /// # Example @@ -15280,12 +14824,12 @@ impl<'a, C, A> ShippingsettingUpdateCall<'a, C, A> where C: BorrowMut +pub struct DatafeedUpdateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, @@ -15298,9 +14842,9 @@ pub struct DatafeedPatchCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for DatafeedPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for DatafeedUpdateCall<'a, C, A> {} -impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -15312,8 +14856,8 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.datafeeds.patch", - http_method: hyper::method::Method::Patch }); + dlg.begin(MethodInfo { id: "content.datafeeds.update", + http_method: hyper::method::Method::Put }); let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); params.push(("merchantId", self._merchant_id.to_string())); params.push(("datafeedId", self._datafeed_id.to_string())); @@ -15391,7 +14935,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -15452,7 +14996,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: Datafeed) -> DatafeedPatchCall<'a, C, A> { + pub fn request(mut self, new_value: Datafeed) -> DatafeedUpdateCall<'a, C, A> { self._request = new_value; self } @@ -15462,7 +15006,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> DatafeedPatchCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> DatafeedUpdateCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } @@ -15472,14 +15016,14 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn datafeed_id(mut self, new_value: &str) -> DatafeedPatchCall<'a, C, A> { + pub fn datafeed_id(mut self, new_value: &str) -> DatafeedUpdateCall<'a, C, A> { self._datafeed_id = new_value.to_string(); self } /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). /// /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> DatafeedPatchCall<'a, C, A> { + pub fn dry_run(mut self, new_value: bool) -> DatafeedUpdateCall<'a, C, A> { self._dry_run = Some(new_value); self } @@ -15489,7 +15033,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DatafeedPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DatafeedUpdateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -15510,7 +15054,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DatafeedPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> DatafeedUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -15530,7 +15074,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatafeedPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> DatafeedUpdateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -15570,7 +15114,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().delete("merchantId", "datafeedId") -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -15829,7 +15373,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().custombatch(req) -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -16045,258 +15589,6 @@ impl<'a, C, A> DatafeedCustombatchCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.datafeeds().get("merchantId", "datafeedId") -/// .doit(); -/// # } -/// ``` -pub struct DatafeedGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _datafeed_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DatafeedGetCall<'a, C, A> {} - -impl<'a, C, A> DatafeedGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Datafeed)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.datafeeds.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("datafeedId", self._datafeed_id.to_string())); - for &field in ["alt", "merchantId", "datafeedId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{datafeedId}", "datafeedId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["datafeedId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> DatafeedGetCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the datafeed. - /// - /// Sets the *datafeed id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn datafeed_id(mut self, new_value: &str) -> DatafeedGetCall<'a, C, A> { - self._datafeed_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DatafeedGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DatafeedGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatafeedGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Invokes a fetch for the datafeed in your Merchant Center account. /// /// A builder for the *fetchnow* method supported by a *datafeed* resource. @@ -16325,7 +15617,7 @@ impl<'a, C, A> DatafeedGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().fetchnow("merchantId", "datafeedId") -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -16595,7 +15887,7 @@ impl<'a, C, A> DatafeedFetchnowCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().insert(req, "merchantId") -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -16844,301 +16136,6 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A } -/// Updates a datafeed configuration of your Merchant Center account. -/// -/// A builder for the *update* method supported by a *datafeed* resource. -/// It is not used directly, but through a `DatafeedMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::Datafeed; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Datafeed::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.datafeeds().update(req, "merchantId", "datafeedId") -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct DatafeedUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: Datafeed, - _merchant_id: String, - _datafeed_id: String, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DatafeedUpdateCall<'a, C, A> {} - -impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Datafeed)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.datafeeds.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("datafeedId", self._datafeed_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "datafeedId", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{datafeedId}", "datafeedId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["datafeedId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Datafeed) -> DatafeedUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the account that manages the datafeed. This account cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> DatafeedUpdateCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the datafeed. - /// - /// Sets the *datafeed id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn datafeed_id(mut self, new_value: &str) -> DatafeedUpdateCall<'a, C, A> { - self._datafeed_id = new_value.to_string(); - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> DatafeedUpdateCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> DatafeedUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DatafeedUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatafeedUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the configurations for datafeeds in your Merchant Center account. /// /// A builder for the *list* method supported by a *datafeed* resource. @@ -17168,7 +16165,7 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeeds().list("merchantId") /// .page_token("invidunt") -/// .max_results(35) +/// .max_results(5) /// .doit(); /// # } /// ``` @@ -17403,271 +16400,6 @@ impl<'a, C, A> DatafeedListCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a store for the given merchant. -/// -/// A builder for the *delete* method supported by a *po* resource. -/// It is not used directly, but through a `PoMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.pos().delete("merchantId", "targetMerchantId", "storeCode") -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct PoDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _target_merchant_id: String, - _store_code: String, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for PoDeleteCall<'a, C, A> {} - -impl<'a, C, A> PoDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.pos.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("targetMerchantId", self._target_merchant_id.to_string())); - params.push(("storeCode", self._store_code.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["merchantId", "targetMerchantId", "storeCode", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "{merchantId}/pos/{targetMerchantId}/store/{storeCode}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{targetMerchantId}", "targetMerchantId"), ("{storeCode}", "storeCode")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["storeCode", "targetMerchantId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the POS or inventory data provider. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> PoDeleteCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the target merchant. - /// - /// Sets the *target merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn target_merchant_id(mut self, new_value: &str) -> PoDeleteCall<'a, C, A> { - self._target_merchant_id = new_value.to_string(); - self - } - /// A store code that is unique per merchant. - /// - /// Sets the *store code* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn store_code(mut self, new_value: &str) -> PoDeleteCall<'a, C, A> { - self._store_code = new_value.to_string(); - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> PoDeleteCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PoDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> PoDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> PoDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the stores of the target merchant. /// /// A builder for the *list* method supported by a *po* resource. @@ -18468,7 +17200,7 @@ impl<'a, C, A> PoGetCall<'a, C, A> where C: BorrowMut, A: oauth2: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.pos().inventory(req, "merchantId", "targetMerchantId") -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -18763,7 +17495,7 @@ impl<'a, C, A> PoInventoryCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.pos().insert(req, "merchantId", "targetMerchantId") -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -19058,7 +17790,7 @@ impl<'a, C, A> PoInsertCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.pos().sale(req, "merchantId", "targetMerchantId") -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -19319,6 +18051,271 @@ impl<'a, C, A> PoSaleCall<'a, C, A> where C: BorrowMut, A: oauth2 } +/// Deletes a store for the given merchant. +/// +/// A builder for the *delete* method supported by a *po* resource. +/// It is not used directly, but through a `PoMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.pos().delete("merchantId", "targetMerchantId", "storeCode") +/// .dry_run(true) +/// .doit(); +/// # } +/// ``` +pub struct PoDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _target_merchant_id: String, + _store_code: String, + _dry_run: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PoDeleteCall<'a, C, A> {} + +impl<'a, C, A> PoDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.pos.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("targetMerchantId", self._target_merchant_id.to_string())); + params.push(("storeCode", self._store_code.to_string())); + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["merchantId", "targetMerchantId", "storeCode", "dryRun"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "{merchantId}/pos/{targetMerchantId}/store/{storeCode}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{targetMerchantId}", "targetMerchantId"), ("{storeCode}", "storeCode")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["storeCode", "targetMerchantId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the POS or inventory data provider. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> PoDeleteCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the target merchant. + /// + /// Sets the *target merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn target_merchant_id(mut self, new_value: &str) -> PoDeleteCall<'a, C, A> { + self._target_merchant_id = new_value.to_string(); + self + } + /// A store code that is unique per merchant. + /// + /// Sets the *store code* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn store_code(mut self, new_value: &str) -> PoDeleteCall<'a, C, A> { + self._store_code = new_value.to_string(); + self + } + /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> PoDeleteCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PoDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PoDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PoDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the statuses of the sub-accounts in your Merchant Center account. /// /// A builder for the *list* method supported by a *accountstatuse* resource. @@ -19347,9 +18344,9 @@ impl<'a, C, A> PoSaleCall<'a, C, A> where C: BorrowMut, A: oauth2 /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accountstatuses().list("merchantId") -/// .page_token("dolores") -/// .max_results(3) -/// .add_destinations("diam") +/// .page_token("sed") +/// .max_results(19) +/// .add_destinations("sit") /// .doit(); /// # } /// ``` @@ -19864,7 +18861,7 @@ impl<'a, C, A> AccountstatuseCustombatchCall<'a, C, A> where C: BorrowMut AccountAuthinfoCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().update(req, "merchantId", "accountId") -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -20633,8 +19630,8 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().list("merchantId") -/// .page_token("justo") -/// .max_results(44) +/// .page_token("eos") +/// .max_results(63) /// .doit(); /// # } /// ``` @@ -21703,7 +20700,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().custombatch(req) -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -21919,301 +20916,6 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Account::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.accounts().patch(req, "merchantId", "accountId") -/// .dry_run(false) -/// .doit(); -/// # } -/// ``` -pub struct AccountPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: Account, - _merchant_id: String, - _account_id: String, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountPatchCall<'a, C, A> {} - -impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Account)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.accounts.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["accountId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Account) -> AccountPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> AccountPatchCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the account. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountPatchCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> AccountPatchCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccountPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AccountPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Performs an action on a link between two Merchant Center accounts, namely accountId and linkedAccountId. /// /// A builder for the *link* method supported by a *account* resource. @@ -22525,7 +21227,7 @@ impl<'a, C, A> AccountLinkCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().claimwebsite("merchantId", "accountId") -/// .overwrite(true) +/// .overwrite(false) /// .doit(); /// # } /// ``` @@ -22761,10 +21463,10 @@ impl<'a, C, A> AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut +pub struct OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, - _request: InventoryCustomBatchRequest, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InventoryCustombatchCall<'a, C, A> {} - -impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InventoryCustomBatchResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.inventory.custombatch", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "inventory/batch"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: InventoryCustomBatchRequest) -> InventoryCustombatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> InventoryCustombatchCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InventoryCustombatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InventoryCustombatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InventoryCustombatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates price and availability of a product in your Merchant Center account. -/// -/// A builder for the *set* method supported by a *inventory* resource. -/// It is not used directly, but through a `InventoryMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::InventorySetRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InventorySetRequest::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.inventory().set(req, "merchantId", "storeCode", "productId") -/// .dry_run(false) -/// .doit(); -/// # } -/// ``` -pub struct InventorySetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: InventorySetRequest, + _request: OrderinvoicesCreateRefundInvoiceRequest, _merchant_id: String, - _store_code: String, - _product_id: String, - _dry_run: Option, + _order_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for InventorySetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrderinvoiceCreaterefundinvoiceCall<'a, C, A> {} -impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, InventorySetResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrderinvoicesCreateRefundInvoiceResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -23077,16 +21526,12 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.inventory.set", + dlg.begin(MethodInfo { id: "content.orderinvoices.createrefundinvoice", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("merchantId", self._merchant_id.to_string())); - params.push(("storeCode", self._store_code.to_string())); - params.push(("productId", self._product_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "storeCode", "productId", "dryRun"].iter() { + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -23098,12 +21543,12 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/inventory/{storeCode}/products/{productId}"; + let mut url = self.hub._base_url.clone() + "{merchantId}/orderinvoices/{orderId}/createRefundInvoice"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{storeCode}", "storeCode"), ("{productId}", "productId")].iter() { + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -23114,8 +21559,8 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["productId", "storeCode", "merchantId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["orderId", "merchantId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -23218,45 +21663,28 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: InventorySetRequest) -> InventorySetCall<'a, C, A> { + pub fn request(mut self, new_value: OrderinvoicesCreateRefundInvoiceRequest) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { self._request = new_value; self } - /// The ID of the account that contains the product. This account cannot be a multi-client account. + /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> InventorySetCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } - /// The code of the store for which to update price and availability. Use online to update price and availability of an online product. + /// The ID of the order. /// - /// Sets the *store code* path property to the given value. + /// Sets the *order id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn store_code(mut self, new_value: &str) -> InventorySetCall<'a, C, A> { - self._store_code = new_value.to_string(); - self - } - /// The REST ID of the product for which to update price and availability. - /// - /// Sets the *product id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn product_id(mut self, new_value: &str) -> InventorySetCall<'a, C, A> { - self._product_id = new_value.to_string(); - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> InventorySetCall<'a, C, A> { - self._dry_run = Some(new_value); + pub fn order_id(mut self, new_value: &str) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { + self._order_id = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -23265,7 +21693,7 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InventorySetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -23286,7 +21714,7 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InventorySetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -23306,7 +21734,290 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InventorySetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders. +/// +/// A builder for the *createchargeinvoice* method supported by a *orderinvoice* resource. +/// It is not used directly, but through a `OrderinvoiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// use content2::OrderinvoicesCreateChargeInvoiceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrderinvoicesCreateChargeInvoiceRequest::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.orderinvoices().createchargeinvoice(req, "merchantId", "orderId") +/// .doit(); +/// # } +/// ``` +pub struct OrderinvoiceCreatechargeinvoiceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: OrderinvoicesCreateChargeInvoiceRequest, + _merchant_id: String, + _order_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderinvoiceCreatechargeinvoiceCall<'a, C, A> {} + +impl<'a, C, A> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrderinvoicesCreateChargeInvoiceResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orderinvoices.createchargeinvoice", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orderinvoices/{orderId}/createChargeInvoice"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["orderId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: OrderinvoicesCreateChargeInvoiceRequest) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the order. + /// + /// Sets the *order id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn order_id(mut self, new_value: &str) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { + self._order_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -23618,301 +22329,6 @@ impl<'a, C, A> LiasettingSetinventoryverificationcontactCall<'a, C, A> where C: } -/// Updates the LIA settings of the account. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *liasetting* resource. -/// It is not used directly, but through a `LiasettingMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::LiaSettings; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LiaSettings::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.liasettings().patch(req, "merchantId", "accountId") -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct LiasettingPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: LiaSettings, - _merchant_id: String, - _account_id: String, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for LiasettingPatchCall<'a, C, A> {} - -impl<'a, C, A> LiasettingPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LiaSettings)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.liasettings.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/liasettings/{accountId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["accountId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LiaSettings) -> LiasettingPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> LiasettingPatchCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the account for which to get or update LIA settings. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> LiasettingPatchCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> LiasettingPatchCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LiasettingPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> LiasettingPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LiasettingPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves the list of POS data providers that have active settings for the all eiligible countries. /// /// A builder for the *listposdataproviders* method supported by a *liasetting* resource. @@ -24406,7 +22822,7 @@ impl<'a, C, A> LiasettingGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.liasettings().update(req, "merchantId", "accountId") -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -25183,256 +23599,6 @@ impl<'a, C, A> LiasettingRequestgmbaccesCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LiasettingsCustomBatchRequest::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.liasettings().custombatch(req) -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct LiasettingCustombatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: LiasettingsCustomBatchRequest, - _dry_run: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for LiasettingCustombatchCall<'a, C, A> {} - -impl<'a, C, A> LiasettingCustombatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LiasettingsCustomBatchResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.liasettings.custombatch", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "liasettings/batch"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LiasettingsCustomBatchRequest) -> LiasettingCustombatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> LiasettingCustombatchCall<'a, C, A> { - self._dry_run = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LiasettingCustombatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> LiasettingCustombatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LiasettingCustombatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the LIA settings of the sub-accounts in your Merchant Center account. /// /// A builder for the *list* method supported by a *liasetting* resource. @@ -25461,8 +23627,8 @@ impl<'a, C, A> LiasettingCustombatchCall<'a, C, A> where C: BorrowMut LiasettingRequestinventoryverificationCall<'a, C, A> where C: Bor } +/// Retrieves and/or updates the LIA settings of multiple accounts in a single request. +/// +/// A builder for the *custombatch* method supported by a *liasetting* resource. +/// It is not used directly, but through a `LiasettingMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// use content2::LiasettingsCustomBatchRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LiasettingsCustomBatchRequest::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.liasettings().custombatch(req) +/// .dry_run(false) +/// .doit(); +/// # } +/// ``` +pub struct LiasettingCustombatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: LiasettingsCustomBatchRequest, + _dry_run: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LiasettingCustombatchCall<'a, C, A> {} + +impl<'a, C, A> LiasettingCustombatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LiasettingsCustomBatchResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.liasettings.custombatch", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "dryRun"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "liasettings/batch"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LiasettingsCustomBatchRequest) -> LiasettingCustombatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> LiasettingCustombatchCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LiasettingCustombatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> LiasettingCustombatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LiasettingCustombatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the POS data provider for the specified country. /// /// A builder for the *setposdataprovider* method supported by a *liasetting* resource. @@ -25989,8 +24405,8 @@ impl<'a, C, A> LiasettingRequestinventoryverificationCall<'a, C, A> where C: Bor /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.liasettings().setposdataprovider("merchantId", "accountId", "country") -/// .pos_external_account_id("ipsum") -/// .pos_data_provider_id("justo") +/// .pos_external_account_id("nonumy") +/// .pos_data_provider_id("rebum.") /// .doit(); /// # } /// ``` @@ -26277,11 +24693,11 @@ impl<'a, C, A> LiasettingSetposdataproviderCall<'a, C, A> where C: BorrowMut ProductstatuseListCall<'a, C, A> where C: BorrowMut ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.products().get("merchantId", "productId") +/// .doit(); +/// # } +/// ``` +pub struct ProductGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _product_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProductGetCall<'a, C, A> {} + +impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Product)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.products.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("productId", self._product_id.to_string())); + for &field in ["alt", "merchantId", "productId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/products/{productId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{productId}", "productId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["productId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the account that contains the product. This account cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The REST ID of the product. + /// + /// Sets the *product id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn product_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProductGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProductGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProductGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Retrieves, inserts, and deletes multiple products in a single request. /// /// A builder for the *custombatch* method supported by a *product* resource. @@ -27115,7 +25783,7 @@ impl<'a, C, A> ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.products().insert(req, "merchantId") -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -28143,258 +26811,6 @@ impl<'a, C, A> ProductInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves a product from your Merchant Center account. -/// -/// A builder for the *get* method supported by a *product* resource. -/// It is not used directly, but through a `ProductMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.products().get("merchantId", "productId") -/// .doit(); -/// # } -/// ``` -pub struct ProductGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _product_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProductGetCall<'a, C, A> {} - -impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Product)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.products.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("productId", self._product_id.to_string())); - for &field in ["alt", "merchantId", "productId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/products/{productId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{productId}", "productId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["productId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the account that contains the product. This account cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The REST ID of the product. - /// - /// Sets the *product id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn product_id(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { - self._product_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProductGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProductGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProductGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves the status of a datafeed from your Merchant Center account. /// /// A builder for the *get* method supported by a *datafeedstatuse* resource. @@ -28423,8 +26839,8 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.datafeedstatuses().get("merchantId", "datafeedId") -/// .language("aliquyam") -/// .country("elitr") +/// .language("dolor") +/// .country("takimata") /// .doit(); /// # } /// ``` @@ -28699,8 +27115,8 @@ impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrdersInStoreRefundLineItemRequest::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.orders().instorerefundlineitem(req, "merchantId", "orderId") +/// let result = hub.orders().getbymerchantorderid("merchantId", "merchantOrderId") /// .doit(); /// # } /// ``` -pub struct OrderInstorerefundlineitemCall<'a, C, A> +pub struct OrderGetbymerchantorderidCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, - _request: OrdersInStoreRefundLineItemRequest, _merchant_id: String, - _order_id: String, + _merchant_order_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrderInstorerefundlineitemCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrderGetbymerchantorderidCall<'a, C, A> {} -impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersInStoreRefundLineItemResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersGetByMerchantOrderIdResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -29237,12 +27645,12 @@ impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.orders.instorerefundlineitem", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "content.orders.getbymerchantorderid", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { + params.push(("merchantOrderId", self._merchant_order_id.to_string())); + for &field in ["alt", "merchantId", "merchantOrderId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -29254,12 +27662,12 @@ impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -29271,7 +27679,7 @@ impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { + for param_name in ["merchantOrderId", "merchantId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -29283,17 +27691,6 @@ impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut OrderInstorerefundlineitemCall<'a, C, A> { - self._request = new_value; - self - } /// The ID of the account that manages the order. This cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderInstorerefundlineitemCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } - /// The ID of the order. + /// The merchant order ID to be looked for. /// - /// Sets the *order id* path property to the given value. + /// Sets the *merchant order id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderInstorerefundlineitemCall<'a, C, A> { - self._order_id = new_value.to_string(); + pub fn merchant_order_id(mut self, new_value: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { + self._merchant_order_id = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -29404,7 +27788,7 @@ impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut OrderInstorerefundlineitemCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderGetbymerchantorderidCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -29425,7 +27809,7 @@ impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrderInstorerefundlineitemCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrderGetbymerchantorderidCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -29445,7 +27829,7 @@ impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrderInstorerefundlineitemCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrderGetbymerchantorderidCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -29740,258 +28124,6 @@ impl<'a, C, A> OrderCreatetestreturnCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.orders().getbymerchantorderid("merchantId", "merchantOrderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderGetbymerchantorderidCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _merchant_order_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderGetbymerchantorderidCall<'a, C, A> {} - -impl<'a, C, A> OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersGetByMerchantOrderIdResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orders.getbymerchantorderid", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("merchantOrderId", self._merchant_order_id.to_string())); - for &field in ["alt", "merchantId", "merchantOrderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/ordersbymerchantid/{merchantOrderId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{merchantOrderId}", "merchantOrderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["merchantOrderId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the account that manages the order. This cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The merchant order ID to be looked for. - /// - /// Sets the *merchant order id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_order_id(mut self, new_value: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { - self._merchant_order_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderGetbymerchantorderidCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderGetbymerchantorderidCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderGetbymerchantorderidCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided via other methods. Submitted key-value pairs can be retrieved as part of the orders resource. /// /// A builder for the *setlineitemmetadata* method supported by a *order* resource. @@ -31152,12 +29284,12 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.orders().list("merchantId") -/// .add_statuses("rebum.") -/// .placed_date_start("et") -/// .placed_date_end("clita") -/// .page_token("eos") -/// .order_by("dolores") -/// .max_results(76) +/// .add_statuses("diam") +/// .placed_date_start("accusam") +/// .placed_date_end("dolores") +/// .page_token("consetetur") +/// .order_by("dolor") +/// .max_results(19) /// .acknowledged(false) /// .doit(); /// # } @@ -31767,7 +29899,7 @@ impl<'a, C, A> OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderRejectreturnlineitemCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrdersInStoreRefundLineItemRequest::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.orders().instorerefundlineitem(req, "merchantId", "orderId") +/// .doit(); +/// # } +/// ``` +pub struct OrderInstorerefundlineitemCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: OrdersInStoreRefundLineItemRequest, + _merchant_id: String, + _order_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrderInstorerefundlineitemCall<'a, C, A> {} + +impl<'a, C, A> OrderInstorerefundlineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersInStoreRefundLineItemResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.orders.instorerefundlineitem", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("orderId", self._order_id.to_string())); + for &field in ["alt", "merchantId", "orderId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/inStoreRefundLineItem"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["orderId", "merchantId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: OrdersInStoreRefundLineItemRequest) -> OrderInstorerefundlineitemCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the account that manages the order. This cannot be a multi-client account. + /// + /// Sets the *merchant id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn merchant_id(mut self, new_value: &str) -> OrderInstorerefundlineitemCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the order. + /// + /// Sets the *order id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn order_id(mut self, new_value: &str) -> OrderInstorerefundlineitemCall<'a, C, A> { + self._order_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderInstorerefundlineitemCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> OrderInstorerefundlineitemCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrderInstorerefundlineitemCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates a shipment's status, carrier, and/or tracking ID. /// /// A builder for the *updateshipment* method supported by a *order* resource. @@ -35280,10 +33696,10 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderCancellineitemCall<'a, C, A> where C: BorrowMut +pub struct InventoryCustombatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, - _request: OrderinvoicesCreateRefundInvoiceRequest, - _merchant_id: String, - _order_id: String, + _request: InventoryCustomBatchRequest, + _dry_run: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrderinvoiceCreaterefundinvoiceCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for InventoryCustombatchCall<'a, C, A> {} -impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrderinvoicesCreateRefundInvoiceResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, InventoryCustomBatchResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -35343,12 +33759,13 @@ impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut< Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.orderinvoices.createrefundinvoice", + dlg.begin(MethodInfo { id: "content.inventory.custombatch", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "dryRun"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -35360,12 +33777,268 @@ impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orderinvoices/{orderId}/createRefundInvoice"; + let mut url = self.hub._base_url.clone() + "inventory/batch"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: InventoryCustomBatchRequest) -> InventoryCustombatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> InventoryCustombatchCall<'a, C, A> { + self._dry_run = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InventoryCustombatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InventoryCustombatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InventoryCustombatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates price and availability of a product in your Merchant Center account. +/// +/// A builder for the *set* method supported by a *inventory* resource. +/// It is not used directly, but through a `InventoryMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// use content2::InventorySetRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = InventorySetRequest::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.inventory().set(req, "merchantId", "storeCode", "productId") +/// .dry_run(false) +/// .doit(); +/// # } +/// ``` +pub struct InventorySetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _request: InventorySetRequest, + _merchant_id: String, + _store_code: String, + _product_id: String, + _dry_run: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InventorySetCall<'a, C, A> {} + +impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, InventorySetResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "content.inventory.set", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("merchantId", self._merchant_id.to_string())); + params.push(("storeCode", self._store_code.to_string())); + params.push(("productId", self._product_id.to_string())); + if let Some(value) = self._dry_run { + params.push(("dryRun", value.to_string())); + } + for &field in ["alt", "merchantId", "storeCode", "productId", "dryRun"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{merchantId}/inventory/{storeCode}/products/{productId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{storeCode}", "storeCode"), ("{productId}", "productId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -35376,8 +34049,8 @@ impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut< url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["productId", "storeCode", "merchantId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -35480,28 +34153,45 @@ impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut< /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: OrderinvoicesCreateRefundInvoiceRequest) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { + pub fn request(mut self, new_value: InventorySetRequest) -> InventorySetCall<'a, C, A> { self._request = new_value; self } - /// The ID of the account that manages the order. This cannot be a multi-client account. + /// The ID of the account that contains the product. This account cannot be a multi-client account. /// /// Sets the *merchant id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> InventorySetCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } - /// The ID of the order. + /// The code of the store for which to update price and availability. Use online to update price and availability of an online product. /// - /// Sets the *order id* path property to the given value. + /// Sets the *store code* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { - self._order_id = new_value.to_string(); + pub fn store_code(mut self, new_value: &str) -> InventorySetCall<'a, C, A> { + self._store_code = new_value.to_string(); + self + } + /// The REST ID of the product for which to update price and availability. + /// + /// Sets the *product id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn product_id(mut self, new_value: &str) -> InventorySetCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any). + /// + /// Sets the *dry run* query property to the given value. + pub fn dry_run(mut self, new_value: bool) -> InventorySetCall<'a, C, A> { + self._dry_run = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -35510,7 +34200,7 @@ impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut< /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> InventorySetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -35531,7 +34221,7 @@ impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut< /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> InventorySetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -35551,290 +34241,7 @@ impl<'a, C, A> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> where C: BorrowMut< /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderinvoiceCreaterefundinvoiceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders. -/// -/// A builder for the *createchargeinvoice* method supported by a *orderinvoice* resource. -/// It is not used directly, but through a `OrderinvoiceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::OrderinvoicesCreateChargeInvoiceRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = OrderinvoicesCreateChargeInvoiceRequest::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.orderinvoices().createchargeinvoice(req, "merchantId", "orderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderinvoiceCreatechargeinvoiceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: OrderinvoicesCreateChargeInvoiceRequest, - _merchant_id: String, - _order_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderinvoiceCreatechargeinvoiceCall<'a, C, A> {} - -impl<'a, C, A> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrderinvoicesCreateChargeInvoiceResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "content.orderinvoices.createchargeinvoice", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("orderId", self._order_id.to_string())); - for &field in ["alt", "merchantId", "orderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/orderinvoices/{orderId}/createChargeInvoice"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{orderId}", "orderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: OrderinvoicesCreateChargeInvoiceRequest) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the account that manages the order. This cannot be a multi-client account. - /// - /// Sets the *merchant id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn merchant_id(mut self, new_value: &str) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the order. - /// - /// Sets the *order id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn order_id(mut self, new_value: &str) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { - self._order_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderinvoiceCreatechargeinvoiceCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> InventorySetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/content2_sandbox-cli/Cargo.toml b/gen/content2_sandbox-cli/Cargo.toml index 7d343b7338..cbf2087f81 100644 --- a/gen/content2_sandbox-cli/Cargo.toml +++ b/gen/content2_sandbox-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2_sandbox-cli" -version = "1.0.12+20181009" +version = "1.0.13+20181009" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2_sandbox-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-content2_sandbox] path = "../content2_sandbox" -version = "1.0.12+20181009" +version = "1.0.13+20181009" diff --git a/gen/content2_sandbox-cli/README.md b/gen/content2_sandbox-cli/README.md index 6937980ee0..c6b2c5dca7 100644 --- a/gen/content2_sandbox-cli/README.md +++ b/gen/content2_sandbox-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Shopping Content* API at revision *20181009*. The CLI is at version *1.0.12*. +This documentation was generated from the *Shopping Content* API at revision *20181009*. The CLI is at version *1.0.13*. ```bash content2-sandbox [options] diff --git a/gen/content2_sandbox-cli/mkdocs.yml b/gen/content2_sandbox-cli/mkdocs.yml index 35a84e6b8f..3cd1a0bb17 100644 --- a/gen/content2_sandbox-cli/mkdocs.yml +++ b/gen/content2_sandbox-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v1.0.12+20181009 +site_name: Shopping Content v1.0.13+20181009 site_url: http://byron.github.io/google-apis-rs/google-content2_sandbox-cli site_description: A complete library to interact with Shopping Content (protocol v2sandbox) diff --git a/gen/content2_sandbox-cli/src/main.rs b/gen/content2_sandbox-cli/src/main.rs index e04b3fc0aa..bb8d9d6896 100644 --- a/gen/content2_sandbox-cli/src/main.rs +++ b/gen/content2_sandbox-cli/src/main.rs @@ -3693,7 +3693,7 @@ fn main() { let mut app = App::new("content2-sandbox") .author("Sebastian Thiel ") - .version("1.0.12+20181009") + .version("1.0.13+20181009") .about("Manages product items, inventory, and Merchant Center accounts for Google Shopping.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli") .arg(Arg::with_name("url") diff --git a/gen/content2_sandbox/Cargo.toml b/gen/content2_sandbox/Cargo.toml index 5fc6326bdb..be96497521 100644 --- a/gen/content2_sandbox/Cargo.toml +++ b/gen/content2_sandbox/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-content2_sandbox" -version = "1.0.12+20181009" +version = "1.0.13+20181009" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2_sandbox" homepage = "https://developers.google.com/shopping-content" -documentation = "https://docs.rs/google-content2_sandbox/1.0.12+20181009" +documentation = "https://docs.rs/google-content2_sandbox/1.0.13+20181009" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/content2_sandbox/README.md b/gen/content2_sandbox/README.md index bb0ae23349..11bfcbaf3a 100644 --- a/gen/content2_sandbox/README.md +++ b/gen/content2_sandbox/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-content2_sandbox` library allows access to all features of the *Google Shopping Content* service. -This documentation was generated from *Shopping Content* crate version *1.0.12+20181009*, where *20181009* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Shopping Content* crate version *1.0.13+20181009*, where *20181009* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Shopping Content* *v2_sandbox* API can be found at the [official documentation site](https://developers.google.com/shopping-content). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.ShoppingContent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.ShoppingContent.html) ... * orderinvoices - * [*createchargeinvoice*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderinvoiceCreatechargeinvoiceCall.html) and [*createrefundinvoice*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderinvoiceCreaterefundinvoiceCall.html) + * [*createchargeinvoice*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderinvoiceCreatechargeinvoiceCall.html) and [*createrefundinvoice*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderinvoiceCreaterefundinvoiceCall.html) * orderpayments - * [*notifyauthapproved*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderpaymentNotifyauthapprovedCall.html), [*notifyauthdeclined*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderpaymentNotifyauthdeclinedCall.html), [*notifycharge*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderpaymentNotifychargeCall.html) and [*notifyrefund*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderpaymentNotifyrefundCall.html) + * [*notifyauthapproved*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderpaymentNotifyauthapprovedCall.html), [*notifyauthdeclined*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderpaymentNotifyauthdeclinedCall.html), [*notifycharge*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderpaymentNotifychargeCall.html) and [*notifyrefund*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderpaymentNotifyrefundCall.html) * orderreturns - * [*get*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderreturnGetCall.html) and [*list*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderreturnListCall.html) -* [orders](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.Order.html) - * [*acknowledge*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderCancellineitemCall.html), [*canceltestorderbycustomer*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderCanceltestorderbycustomerCall.html), [*createtestorder*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderCreatetestorderCall.html), [*createtestreturn*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderCreatetestreturnCall.html), [*custombatch*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderGettestordertemplateCall.html), [*instorerefundlineitem*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderInstorerefundlineitemCall.html), [*list*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderRefundCall.html), [*rejectreturnlineitem*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderRejectreturnlineitemCall.html), [*returnlineitem*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderReturnlineitemCall.html), [*returnrefundlineitem*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderReturnrefundlineitemCall.html), [*setlineitemmetadata*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.OrderUpdateshipmentCall.html) + * [*get*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderreturnGetCall.html) and [*list*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderreturnListCall.html) +* [orders](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderCancellineitemCall.html), [*canceltestorderbycustomer*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderCanceltestorderbycustomerCall.html), [*createtestorder*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderCreatetestorderCall.html), [*createtestreturn*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderCreatetestreturnCall.html), [*custombatch*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderGettestordertemplateCall.html), [*instorerefundlineitem*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderInstorerefundlineitemCall.html), [*list*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderRefundCall.html), [*rejectreturnlineitem*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderRejectreturnlineitemCall.html), [*returnlineitem*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderReturnlineitemCall.html), [*returnrefundlineitem*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderReturnrefundlineitemCall.html), [*setlineitemmetadata*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderSetlineitemmetadataCall.html), [*shiplineitems*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderShiplineitemCall.html), [*updatelineitemshippingdetails*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderUpdatelineitemshippingdetailCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.OrderUpdateshipmentCall.html) @@ -29,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/struct.ShoppingContent.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -158,17 +158,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -178,29 +178,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.RequestValue.html) and -[decodable](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-content2_sandbox/1.0.12+20181009/google_content2_sandbox/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2_sandbox/1.0.13+20181009/google_content2_sandbox/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/content2_sandbox/src/lib.rs b/gen/content2_sandbox/src/lib.rs index ce18ec7d8a..49d0bf06b2 100644 --- a/gen/content2_sandbox/src/lib.rs +++ b/gen/content2_sandbox/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Shopping Content* crate version *1.0.12+20181009*, where *20181009* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Shopping Content* crate version *1.0.13+20181009*, where *20181009* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Shopping Content* *v2_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content). @@ -358,7 +358,7 @@ impl<'a, C, A> ShoppingContent ShoppingContent { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/content/v2sandbox/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -378,7 +378,7 @@ impl<'a, C, A> ShoppingContent } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/coordinate1-cli/Cargo.toml b/gen/coordinate1-cli/Cargo.toml index 277b385919..3029ebc00c 100644 --- a/gen/coordinate1-cli/Cargo.toml +++ b/gen/coordinate1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-coordinate1-cli" -version = "1.0.12+20150811" +version = "1.0.13+20150811" authors = ["Sebastian Thiel "] description = "A complete library to interact with coordinate (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/coordinate1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-coordinate1] path = "../coordinate1" -version = "1.0.12+20150811" +version = "1.0.13+20150811" diff --git a/gen/coordinate1-cli/README.md b/gen/coordinate1-cli/README.md index 7747c5915e..63fa7dd9fb 100644 --- a/gen/coordinate1-cli/README.md +++ b/gen/coordinate1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *coordinate* API at revision *20150811*. The CLI is at version *1.0.12*. +This documentation was generated from the *coordinate* API at revision *20150811*. The CLI is at version *1.0.13*. ```bash coordinate1 [options] diff --git a/gen/coordinate1-cli/mkdocs.yml b/gen/coordinate1-cli/mkdocs.yml index 34e48271cd..7e38731dd4 100644 --- a/gen/coordinate1-cli/mkdocs.yml +++ b/gen/coordinate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: coordinate v1.0.12+20150811 +site_name: coordinate v1.0.13+20150811 site_url: http://byron.github.io/google-apis-rs/google-coordinate1-cli site_description: A complete library to interact with coordinate (protocol v1) diff --git a/gen/coordinate1-cli/src/main.rs b/gen/coordinate1-cli/src/main.rs index 0bd6d6d21c..13b7e5c07f 100644 --- a/gen/coordinate1-cli/src/main.rs +++ b/gen/coordinate1-cli/src/main.rs @@ -1571,7 +1571,7 @@ fn main() { let mut app = App::new("coordinate1") .author("Sebastian Thiel ") - .version("1.0.12+20150811") + .version("1.0.13+20150811") .about("Lets you view and manage jobs in a Coordinate team.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_coordinate1_cli") .arg(Arg::with_name("url") diff --git a/gen/coordinate1/Cargo.toml b/gen/coordinate1/Cargo.toml index e8d436105b..80bfa1e5a9 100644 --- a/gen/coordinate1/Cargo.toml +++ b/gen/coordinate1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-coordinate1" -version = "1.0.12+20150811" +version = "1.0.13+20150811" authors = ["Sebastian Thiel "] description = "A complete library to interact with coordinate (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/coordinate1" homepage = "https://developers.google.com/coordinate/" -documentation = "https://docs.rs/google-coordinate1/1.0.12+20150811" +documentation = "https://docs.rs/google-coordinate1/1.0.13+20150811" license = "MIT" keywords = ["coordinate", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/coordinate1/README.md b/gen/coordinate1/README.md index 8fdeb529c0..55c359b090 100644 --- a/gen/coordinate1/README.md +++ b/gen/coordinate1/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-coordinate1` library allows access to all features of the *Google coordinate* service. -This documentation was generated from *coordinate* crate version *1.0.12+20150811*, where *20150811* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *coordinate* crate version *1.0.13+20150811*, where *20150811* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *coordinate* *v1* API can be found at the [official documentation site](https://developers.google.com/coordinate/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.Coordinate.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.Coordinate.html) ... -* [custom field def](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.CustomFieldDef.html) - * [*list*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.CustomFieldDefListCall.html) -* [jobs](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.Job.html) - * [*get*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.JobGetCall.html), [*insert*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.JobInsertCall.html), [*list*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.JobListCall.html), [*patch*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.JobPatchCall.html) and [*update*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.JobUpdateCall.html) -* [location](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.Location.html) - * [*list*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.LocationListCall.html) -* [schedule](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.Schedule.html) - * [*get*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.ScheduleGetCall.html), [*patch*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.SchedulePatchCall.html) and [*update*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.ScheduleUpdateCall.html) -* [team](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.Team.html) - * [*list*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.TeamListCall.html) -* [worker](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.Worker.html) - * [*list*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.WorkerListCall.html) +* [custom field def](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.CustomFieldDef.html) + * [*list*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.CustomFieldDefListCall.html) +* [jobs](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.Job.html) + * [*get*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.JobGetCall.html), [*insert*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.JobInsertCall.html), [*list*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.JobListCall.html), [*patch*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.JobPatchCall.html) and [*update*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.JobUpdateCall.html) +* [location](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.Location.html) + * [*list*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.LocationListCall.html) +* [schedule](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.Schedule.html) + * [*get*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.ScheduleGetCall.html), [*patch*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.SchedulePatchCall.html) and [*update*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.ScheduleUpdateCall.html) +* [team](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.Team.html) + * [*list*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.TeamListCall.html) +* [worker](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.Worker.html) + * [*list*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.WorkerListCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/struct.Coordinate.html)** +* **[Hub](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/struct.Coordinate.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.Part.html)** + * **[Parts](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -154,17 +154,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -174,29 +174,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-coordinate1/1.0.12+20150811/google_coordinate1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-coordinate1/1.0.13+20150811/google_coordinate1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/coordinate1/src/lib.rs b/gen/coordinate1/src/lib.rs index a89eab39de..97b80df30f 100644 --- a/gen/coordinate1/src/lib.rs +++ b/gen/coordinate1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *coordinate* crate version *1.0.12+20150811*, where *20150811* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *coordinate* crate version *1.0.13+20150811*, where *20150811* is the exact revision of the *coordinate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *coordinate* *v1* API can be found at the //! [official documentation site](https://developers.google.com/coordinate/). @@ -367,7 +367,7 @@ impl<'a, C, A> Coordinate Coordinate { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/coordinate/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -393,7 +393,7 @@ impl<'a, C, A> Coordinate } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/customsearch1-cli/Cargo.toml b/gen/customsearch1-cli/Cargo.toml index 5040f85bc9..e46bf1d27d 100644 --- a/gen/customsearch1-cli/Cargo.toml +++ b/gen/customsearch1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-customsearch1-cli" -version = "1.0.12+20181001" +version = "1.0.13+20181001" authors = ["Sebastian Thiel "] description = "A complete library to interact with customsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-customsearch1] path = "../customsearch1" -version = "1.0.12+20181001" +version = "1.0.13+20181001" diff --git a/gen/customsearch1-cli/README.md b/gen/customsearch1-cli/README.md index 2169463042..143454611a 100644 --- a/gen/customsearch1-cli/README.md +++ b/gen/customsearch1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *customsearch* API at revision *20181001*. The CLI is at version *1.0.12*. +This documentation was generated from the *customsearch* API at revision *20181001*. The CLI is at version *1.0.13*. ```bash customsearch1 [options] diff --git a/gen/customsearch1-cli/mkdocs.yml b/gen/customsearch1-cli/mkdocs.yml index b86d267dda..00516c26a7 100644 --- a/gen/customsearch1-cli/mkdocs.yml +++ b/gen/customsearch1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: customsearch v1.0.12+20181001 +site_name: customsearch v1.0.13+20181001 site_url: http://byron.github.io/google-apis-rs/google-customsearch1-cli site_description: A complete library to interact with customsearch (protocol v1) diff --git a/gen/customsearch1-cli/src/main.rs b/gen/customsearch1-cli/src/main.rs index 02f3f3a651..25af44a910 100644 --- a/gen/customsearch1-cli/src/main.rs +++ b/gen/customsearch1-cli/src/main.rs @@ -478,7 +478,7 @@ fn main() { let mut app = App::new("customsearch1") .author("Sebastian Thiel ") - .version("1.0.12+20181001") + .version("1.0.13+20181001") .about("Searches over a website or collection of websites") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_customsearch1_cli") .arg(Arg::with_name("folder") diff --git a/gen/customsearch1/Cargo.toml b/gen/customsearch1/Cargo.toml index fdd9d7e78e..3f79c9c58c 100644 --- a/gen/customsearch1/Cargo.toml +++ b/gen/customsearch1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-customsearch1" -version = "1.0.12+20181001" +version = "1.0.13+20181001" authors = ["Sebastian Thiel "] description = "A complete library to interact with customsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/customsearch1" homepage = "https://developers.google.com/custom-search/v1/using_rest" -documentation = "https://docs.rs/google-customsearch1/1.0.12+20181001" +documentation = "https://docs.rs/google-customsearch1/1.0.13+20181001" license = "MIT" keywords = ["customsearch", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/customsearch1/README.md b/gen/customsearch1/README.md index 3339fcf549..b87c69075b 100644 --- a/gen/customsearch1/README.md +++ b/gen/customsearch1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-customsearch1` library allows access to all features of the *Google customsearch* service. -This documentation was generated from *customsearch* crate version *1.0.12+20181001*, where *20181001* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *customsearch* crate version *1.0.13+20181001*, where *20181001* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *customsearch* *v1* API can be found at the [official documentation site](https://developers.google.com/custom-search/v1/using_rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/struct.Customsearch.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/struct.Customsearch.html) ... * cse - * [*list*](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/struct.CseListCall.html) and [*siterestrict list*](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/struct.CseSiterestrictListCall.html) + * [*list*](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/struct.CseListCall.html) and [*siterestrict list*](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/struct.CseSiterestrictListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/struct.Customsearch.html)** +* **[Hub](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/struct.Customsearch.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.Part.html)** + * **[Parts](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -155,17 +155,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -175,29 +175,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-customsearch1/1.0.12+20181001/google_customsearch1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-customsearch1/1.0.13+20181001/google_customsearch1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/customsearch1/src/lib.rs b/gen/customsearch1/src/lib.rs index e9f889f480..ae4c3da0ab 100644 --- a/gen/customsearch1/src/lib.rs +++ b/gen/customsearch1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *customsearch* crate version *1.0.12+20181001*, where *20181001* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *customsearch* crate version *1.0.13+20181001*, where *20181001* is the exact revision of the *customsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *customsearch* *v1* API can be found at the //! [official documentation site](https://developers.google.com/custom-search/v1/using_rest). @@ -356,7 +356,7 @@ impl<'a, C, A> Customsearch Customsearch { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/customsearch/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -367,7 +367,7 @@ impl<'a, C, A> Customsearch } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/datafusion1_beta1-cli/Cargo.toml b/gen/datafusion1_beta1-cli/Cargo.toml index cee0e97356..c16dfece48 100644 --- a/gen/datafusion1_beta1-cli/Cargo.toml +++ b/gen/datafusion1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-datafusion1_beta1-cli" -version = "1.0.12+20190617" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] description = "A complete library to interact with Data Fusion (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datafusion1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-datafusion1_beta1] path = "../datafusion1_beta1" -version = "1.0.12+20190617" +version = "1.0.13+20200318" diff --git a/gen/datafusion1_beta1-cli/README.md b/gen/datafusion1_beta1-cli/README.md index c3aa292cc8..c44cf56d08 100644 --- a/gen/datafusion1_beta1-cli/README.md +++ b/gen/datafusion1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Data Fusion* API at revision *20190617*. The CLI is at version *1.0.12*. +This documentation was generated from the *Data Fusion* API at revision *20200318*. The CLI is at version *1.0.13*. ```bash datafusion1-beta1 [options] diff --git a/gen/datafusion1_beta1-cli/mkdocs.yml b/gen/datafusion1_beta1-cli/mkdocs.yml index de412123f4..7bd748a8d2 100644 --- a/gen/datafusion1_beta1-cli/mkdocs.yml +++ b/gen/datafusion1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Data Fusion v1.0.12+20190617 +site_name: Data Fusion v1.0.13+20200318 site_url: http://byron.github.io/google-apis-rs/google-datafusion1_beta1-cli site_description: A complete library to interact with Data Fusion (protocol v1beta1) diff --git a/gen/datafusion1_beta1-cli/src/main.rs b/gen/datafusion1_beta1-cli/src/main.rs index ef78d7b0f6..2a3b408c3a 100644 --- a/gen/datafusion1_beta1-cli/src/main.rs +++ b/gen/datafusion1_beta1-cli/src/main.rs @@ -121,6 +121,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "state-message" => Some(("stateMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -133,15 +134,16 @@ impl<'n> Engine<'n> { "network-config.ip-allocation" => Some(("networkConfig.ipAllocation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network-config.network" => Some(("networkConfig.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "service-endpoint" => Some(("serviceEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "state-message" => Some(("stateMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-endpoint" => Some(("apiEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gcs-bucket" => Some(("gcsBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-stackdriver-monitoring" => Some(("enableStackdriverMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "description", "display-name", "enable-stackdriver-logging", "enable-stackdriver-monitoring", "ip-allocation", "labels", "name", "network", "network-config", "options", "private-instance", "service-account", "service-endpoint", "state", "state-message", "type", "update-time", "version", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["api-endpoint", "create-time", "description", "display-name", "enable-stackdriver-logging", "enable-stackdriver-monitoring", "gcs-bucket", "ip-allocation", "labels", "name", "network", "network-config", "options", "private-instance", "service-account", "service-endpoint", "state", "state-message", "type", "update-time", "version", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -315,6 +317,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -328,6 +333,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -449,6 +455,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "state-message" => Some(("stateMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -461,15 +468,16 @@ impl<'n> Engine<'n> { "network-config.ip-allocation" => Some(("networkConfig.ipAllocation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "network-config.network" => Some(("networkConfig.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "service-endpoint" => Some(("serviceEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "state-message" => Some(("stateMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-endpoint" => Some(("apiEndpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gcs-bucket" => Some(("gcsBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-stackdriver-monitoring" => Some(("enableStackdriverMonitoring", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "description", "display-name", "enable-stackdriver-logging", "enable-stackdriver-monitoring", "ip-allocation", "labels", "name", "network", "network-config", "options", "private-instance", "service-account", "service-endpoint", "state", "state-message", "type", "update-time", "version", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["api-endpoint", "create-time", "description", "display-name", "enable-stackdriver-logging", "enable-stackdriver-monitoring", "gcs-bucket", "ip-allocation", "labels", "name", "network", "network-config", "options", "private-instance", "service-account", "service-endpoint", "state", "state-message", "type", "update-time", "version", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -640,12 +648,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -886,6 +893,9 @@ impl<'n> Engine<'n> { "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, + "include-unrevealed-locations" => { + call = call.include_unrevealed_locations(arg_from_str(value.unwrap_or("false"), err, "include-unrevealed-locations", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -902,7 +912,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["filter", "page-token", "include-unrevealed-locations", "page-size"].iter().map(|v|*v)); v } )); } } @@ -1541,7 +1551,9 @@ fn main() { ]), ("locations-instances-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_datafusion1_beta1_cli/projects_locations-instances-set-iam-policy", vec![ (Some(r##"resource"##), @@ -1781,7 +1793,7 @@ fn main() { let mut app = App::new("datafusion1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190617") + .version("1.0.13+20200318") .about("Cloud Data Fusion is a fully-managed, cloud native, enterprise data integration service for quickly building and managing data pipelines. It provides a graphical interface to increase time efficiency and reduce complexity, and allows business users, developers, and data diff --git a/gen/datafusion1_beta1/Cargo.toml b/gen/datafusion1_beta1/Cargo.toml index 8bbdc84482..a729577581 100644 --- a/gen/datafusion1_beta1/Cargo.toml +++ b/gen/datafusion1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-datafusion1_beta1" -version = "1.0.12+20190617" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] description = "A complete library to interact with Data Fusion (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datafusion1_beta1" homepage = "https://cloud.google.com/data-fusion/docs" -documentation = "https://docs.rs/google-datafusion1_beta1/1.0.12+20190617" +documentation = "https://docs.rs/google-datafusion1_beta1/1.0.13+20200318" license = "MIT" keywords = ["datafusion", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/datafusion1_beta1/README.md b/gen/datafusion1_beta1/README.md index 995d6b3ce0..cb95b03112 100644 --- a/gen/datafusion1_beta1/README.md +++ b/gen/datafusion1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-datafusion1_beta1` library allows access to all features of the *Google Data Fusion* service. -This documentation was generated from *Data Fusion* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *datafusion:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Data Fusion* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *datafusion:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Data Fusion* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/data-fusion/docs). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.DataFusion.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.DataFusion.html) ... * projects - * [*locations get*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances get*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceGetCall.html), [*locations instances get iam policy*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceGetIamPolicyCall.html), [*locations instances list*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstancePatchCall.html), [*locations instances restart*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceRestartCall.html), [*locations instances set iam policy*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceSetIamPolicyCall.html), [*locations instances test iam permissions*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceTestIamPermissionCall.html), [*locations instances upgrade*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationInstanceUpgradeCall.html), [*locations list*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.ProjectLocationOperationListCall.html) + * [*locations get*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances get*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceGetCall.html), [*locations instances get iam policy*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceGetIamPolicyCall.html), [*locations instances list*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstancePatchCall.html), [*locations instances restart*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceRestartCall.html), [*locations instances set iam policy*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceSetIamPolicyCall.html), [*locations instances test iam permissions*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceTestIamPermissionCall.html), [*locations instances upgrade*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationInstanceUpgradeCall.html), [*locations list*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.ProjectLocationOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/struct.DataFusion.html)** +* **[Hub](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/struct.DataFusion.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-datafusion1_beta1/1.0.12+20190617/google_datafusion1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-datafusion1_beta1/1.0.13+20200318/google_datafusion1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/datafusion1_beta1/src/lib.rs b/gen/datafusion1_beta1/src/lib.rs index 3d92dcb3dd..c78c208b18 100644 --- a/gen/datafusion1_beta1/src/lib.rs +++ b/gen/datafusion1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Data Fusion* crate version *1.0.12+20190617*, where *20190617* is the exact revision of the *datafusion:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Data Fusion* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *datafusion:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Data Fusion* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/data-fusion/docs). @@ -336,7 +336,7 @@ impl<'a, C, A> DataFusion DataFusion { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://datafusion.googleapis.com/".to_string(), _root_url: "https://datafusion.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> DataFusion } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -399,42 +399,42 @@ pub struct ListInstancesResponse { impl ResponseResult for ListInstancesResponse {} -/// Increment a streamz counter with the specified metric and field names. +/// Provides the configuration for logging a type of permissions. +/// Example: /// -/// Metric names should start with a '/', generally be lowercase-only, -/// and end in "_count". Field names should not contain an initial slash. -/// The actual exported metric names will have "/iam/policy" prepended. +/// ````text +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:jose@example.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// ```` /// -/// Field names correspond to IAM request parameters and field values are -/// their respective values. -/// -/// Supported field names: -/// -/// * "authority", which is "[token]" if IAMContext.token is present, -/// otherwise the value of IAMContext.authority_selector if present, and -/// otherwise a representation of IAMContext.principal; or -/// * "iam_principal", a representation of IAMContext.principal even if a -/// token or authority selector is present; or -/// * "" (empty string), resulting in a counter with no fields. -/// -/// Examples: -/// counter { metric: "/debug_access_count" field: "iam_principal" } -/// ==> increment counter /iam/policy/backend_debug_access_count -/// {iam_principal=[value of IAMContext.principal]} -/// -/// At this time we do not support multiple field names (though this may be -/// supported in the future). +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CounterOptions { - /// The field value to attribute. - pub field: Option, - /// The metric to update. - pub metric: Option, +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, } -impl Part for CounterOptions {} +impl Part for AuditLogConfig {} /// Request message for restarting a Data Fusion instance. @@ -480,30 +480,59 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -512,44 +541,6 @@ pub struct Expr { impl Part for Expr {} -/// Provides the configuration for logging a type of permissions. -/// Example: -/// -/// ````text -/// { -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// "exempted_members": [ -/// "user:foo@gmail.com" -/// ] -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// } -/// ] -/// } -/// ```` -/// -/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of - /// permission. - /// Follows the same format of Binding.members. - #[serde(rename="exemptedMembers")] - pub exempted_members: Option>, - /// The log type that this config enables. - #[serde(rename="logType")] - pub log_type: Option, -} - -impl Part for AuditLogConfig {} - - /// Network configuration for a Data Fusion instance. These configurations /// are used for peering with the customer network. Configurations are optional /// when a public Data Fusion instance is to be created. However, providing @@ -567,50 +558,17 @@ pub struct NetworkConfig { #[serde(rename="ipAllocation")] pub ip_allocation: Option, /// Name of the network in the customer project with which the Tenant Project - /// will be peered for executing pipelines. + /// will be peered for executing pipelines. In case of shared VPC where the + /// network resides in another host project the network should specified in + /// the form of projects/{host-project-id}/global/networks/{network} pub network: Option, } impl Part for NetworkConfig {} -/// A rule to be applied in a Policy. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Rule { - /// If one or more 'not_in' clauses are specified, the rule matches - /// if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. - /// The format for in and not_in entries can be found at in the Local IAM - /// documentation (see go/local-iam#features). - #[serde(rename="notIn")] - pub not_in: Option>, - /// Human-readable description of the rule. - pub description: Option, - /// If one or more 'in' clauses are specified, the rule matches if - /// the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. - #[serde(rename="in")] - pub in_: Option>, - /// Required - pub action: Option, - /// Additional restrictions that must be met. All conditions must pass for the - /// rule to match. - pub conditions: Option>, - /// The config returned to callers of tech.iam.IAM.CheckPolicy for any entries - /// that match the LOG action. - #[serde(rename="logConfig")] - pub log_config: Option>, - /// A permission is a string of form '..' - /// (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, - /// and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. - pub permissions: Option>, -} - -impl Part for Rule {} - - /// Represents a Data Fusion instance. +/// Next available ID: 23 /// /// # Activities /// @@ -626,7 +584,7 @@ pub struct Instance { /// Output only. The time the instance was last updated. #[serde(rename="updateTime")] pub update_time: Option, - /// An optional description of this instance. + /// Optional. An optional description of this instance. pub description: Option, /// Specifies whether the Data Fusion instance should be private. If set to /// true, all Data Fusion nodes will have private IP addresses and will not be @@ -634,19 +592,27 @@ pub struct Instance { #[serde(rename="privateInstance")] pub private_instance: Option, /// The resource labels for instance to use to annotate any related underlying - /// resources such as GCE VMs. The character '=' is not allowed to be used - /// within the labels. + /// resources such as Compute Engine VMs. The character '=' is not allowed to + /// be used within the labels. pub labels: Option>, /// Option to enable Stackdriver Logging. #[serde(rename="enableStackdriverLogging")] pub enable_stackdriver_logging: Option, + /// Output only. Endpoint on which the REST APIs is accessible. + #[serde(rename="apiEndpoint")] + pub api_endpoint: Option, + /// List of accelerators enabled for this CDF instance. + pub accelerators: Option>, + /// Output only. Cloud Storage bucket generated by Data Fusion in the customer project. + #[serde(rename="gcsBucket")] + pub gcs_bucket: Option, + /// Output only. The time the instance was created. + #[serde(rename="createTime")] + pub create_time: Option, /// Output only. Additional information about the current state of this Data /// Fusion instance if available. #[serde(rename="stateMessage")] pub state_message: Option, - /// Output only. The time the instance was created. - #[serde(rename="createTime")] - pub create_time: Option, /// Display name for an instance. #[serde(rename="displayName")] pub display_name: Option, @@ -666,14 +632,17 @@ pub struct Instance { /// Fusion instance is to be created. #[serde(rename="networkConfig")] pub network_config: Option, - /// Output only. Endpoint on which the Data Fusion UI and REST APIs are - /// accessible. + /// Output only. Endpoint on which the Data Fusion UI is accessible. #[serde(rename="serviceEndpoint")] pub service_endpoint: Option, /// Output only. The current state of this Data Fusion instance. pub state: Option, - /// Output only. Current version of the Data Fusion. + /// Current version of Data Fusion. pub version: Option, + /// Available versions that the instance can be upgraded to using + /// UpdateInstanceRequest. + #[serde(rename="availableVersion")] + pub available_version: Option>, /// Required. Instance type. #[serde(rename="type")] pub type_: Option, @@ -686,25 +655,18 @@ impl RequestValue for Instance {} impl ResponseResult for Instance {} -/// Request message for `TestIamPermissions` method. +/// The Data Fusion version. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations instances test iam permissions projects](struct.ProjectLocationInstanceTestIamPermissionCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. Permissions with - /// wildcards (such as '*' or 'storage.*') are not allowed. For more - /// information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - pub permissions: Option>, +pub struct Version { + /// The version number of the Data Fusion instance, such as '6.0.1.0'. + #[serde(rename="versionNumber")] + pub version_number: Option, } -impl RequestValue for TestIamPermissionsRequest {} +impl Part for Version {} /// The response message for Locations.ListLocations. @@ -762,37 +724,50 @@ pub struct Location { impl ResponseResult for Location {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -800,15 +775,21 @@ impl ResponseResult for Location {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -822,8 +803,6 @@ pub struct Policy { /// Specifies cloud audit logging configuration for this policy. #[serde(rename="auditConfigs")] pub audit_configs: Option>, - /// Deprecated. - pub version: Option, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. /// It is strongly suggested that systems make use of the `etag` in the @@ -832,25 +811,37 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// If more than one rule is specified, the rules are applied in the following - /// manner: - /// - All matching LOG rules are always applied. - /// - If any DENY/DENY_WITH_LOG rule matches, permission is denied. - /// Logging will be applied if one or more matching rule requires logging. - /// - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is - /// granted. - /// Logging will be applied if one or more matching rule requires logging. - /// - Otherwise, if no rule applies, permission is denied. - pub rules: Option>, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// no description provided - #[serde(rename="iamOwned")] - pub iam_owned: Option, + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. + pub version: Option, } impl ResponseResult for Policy {} @@ -881,6 +872,27 @@ pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} +/// Request message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations instances test iam permissions projects](struct.ProjectLocationInstanceTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. Permissions with + /// wildcards (such as '*' or 'storage.*') are not allowed. For more + /// information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + /// The `Status` type defines a logical error model that is suitable for /// different programming environments, including REST APIs and RPC APIs. It is /// used by [gRPC](https://github.com/grpc). Each `Status` message contains @@ -947,18 +959,18 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// Authorization-related information used by Cloud Audit Logging. +/// Identifies Data Fusion accelerators for an instance. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuthorizationLoggingOptions { - /// The type of the permission that was checked. - #[serde(rename="permissionType")] - pub permission_type: Option, +pub struct Accelerator { + /// The type of an accelator for a CDF instance. + #[serde(rename="acceleratorType")] + pub accelerator_type: Option, } -impl Part for AuthorizationLoggingOptions {} +impl Part for Accelerator {} /// Associates `members` with a `role`. @@ -985,7 +997,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -994,6 +1006,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1005,21 +1037,6 @@ pub struct Binding { impl Part for Binding {} -/// Write a Data Access (Gin) log -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DataAccessOptions { - /// Whether Gin logging should happen in a fail-closed manner at the caller. - /// This is relevant only in the LocalIAM implementation, for now. - #[serde(rename="logMode")] - pub log_mode: Option, -} - -impl Part for DataAccessOptions {} - - /// Request message for upgrading a Data Fusion instance. /// To change the instance properties, instance update should be used. /// @@ -1057,7 +1074,7 @@ impl RequestValue for UpgradeInstanceRequest {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1069,7 +1086,7 @@ impl RequestValue for UpgradeInstanceRequest {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1077,7 +1094,7 @@ impl RequestValue for UpgradeInstanceRequest {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1086,16 +1103,13 @@ impl RequestValue for UpgradeInstanceRequest {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AuditConfig { - /// no description provided - #[serde(rename="exemptedMembers")] - pub exempted_members: Option>, /// The configuration for logging of each type of permission. #[serde(rename="auditLogConfigs")] pub audit_log_configs: Option>, @@ -1169,64 +1183,6 @@ pub struct Operation { impl ResponseResult for Operation {} -/// Write a Cloud Audit log -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CloudAuditOptions { - /// The log_name to populate in the Cloud Audit Record. - #[serde(rename="logName")] - pub log_name: Option, - /// Information used by the Cloud Audit Logging pipeline. - #[serde(rename="authorizationLoggingOptions")] - pub authorization_logging_options: Option, -} - -impl Part for CloudAuditOptions {} - - -/// Specifies what kind of log the caller must write -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogConfig { - /// Counter options. - pub counter: Option, - /// Data access options. - #[serde(rename="dataAccess")] - pub data_access: Option, - /// Cloud audit options. - #[serde(rename="cloudAudit")] - pub cloud_audit: Option, -} - -impl Part for LogConfig {} - - -/// A condition to be met. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Condition { - /// Trusted attributes supplied by the IAM system. - pub iam: Option, - /// Trusted attributes supplied by any service that owns resources and uses - /// the IAM system for access control. - pub sys: Option, - /// The objects of the condition. - pub values: Option>, - /// Trusted attributes discharged by the service. - pub svc: Option, - /// An operator to apply the subject with. - pub op: Option, -} - -impl Part for Condition {} - - // ################### // MethodBuilders ### @@ -1313,6 +1269,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -1389,6 +1347,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _name: name.to_string(), _page_token: Default::default(), _page_size: Default::default(), + _include_unrevealed_locations: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1457,6 +1416,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectLocationInstanceGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2127,6 +2087,8 @@ impl<'a, C, A> ProjectLocationOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationOperationCancelCall<'a, C, A> where C: BorrowMut _name: String, _page_token: Option, _page_size: Option, + _include_unrevealed_locations: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -3008,7 +2972,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("name", self._name.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -3016,10 +2980,13 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> { + self._include_unrevealed_locations = Some(new_value); + self + } /// The standard list filter. /// /// Sets the *filter* query property to the given value. @@ -3262,7 +3237,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationInstanceTestIamPermissionCall<'a, C, A> where C: B /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_instances_get_iam_policy("resource") +/// .options_requested_policy_version(-61) /// .doit(); /// # } /// ``` @@ -3849,6 +3825,7 @@ pub struct ProjectLocationInstanceGetIamPolicyCall<'a, C, A> hub: &'a DataFusion, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3871,9 +3848,12 @@ impl<'a, C, A> ProjectLocationInstanceGetIamPolicyCall<'a, C, A> where C: Borrow }; dlg.begin(MethodInfo { id: "datafusion.projects.locations.instances.getIamPolicy", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3999,6 +3979,20 @@ impl<'a, C, A> ProjectLocationInstanceGetIamPolicyCall<'a, C, A> where C: Borrow self._resource = new_value.to_string(); self } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationInstanceGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4096,7 +4090,7 @@ impl<'a, C, A> ProjectLocationInstanceGetIamPolicyCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_instances_create(req, "parent") -/// .instance_id("no") +/// .instance_id("justo") /// .doit(); /// # } /// ``` @@ -4391,9 +4385,9 @@ impl<'a, C, A> ProjectLocationInstanceCreateCall<'a, C, A> where C: BorrowMut ProjectLocationOperationListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Dataproc (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dataproc1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dataproc1] path = "../dataproc1" -version = "1.0.12+20190620" +version = "1.0.13+20200323" diff --git a/gen/dataproc1-cli/README.md b/gen/dataproc1-cli/README.md index 0c9a1b0881..8d3cd57403 100644 --- a/gen/dataproc1-cli/README.md +++ b/gen/dataproc1-cli/README.md @@ -25,14 +25,19 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Dataproc* API at revision *20190620*. The CLI is at version *1.0.12*. +This documentation was generated from the *Dataproc* API at revision *20200323*. The CLI is at version *1.0.13*. ```bash dataproc1 [options] projects + locations-autoscaling-policies-create (-r )... [-p ]... [-o ] + locations-autoscaling-policies-delete [-p ]... [-o ] + locations-autoscaling-policies-get [-p ]... [-o ] locations-autoscaling-policies-get-iam-policy (-r )... [-p ]... [-o ] + locations-autoscaling-policies-list [-p ]... [-o ] locations-autoscaling-policies-set-iam-policy (-r )... [-p ]... [-o ] locations-autoscaling-policies-test-iam-permissions (-r )... [-p ]... [-o ] + locations-autoscaling-policies-update (-r )... [-p ]... [-o ] locations-workflow-templates-create (-r )... [-p ]... [-o ] locations-workflow-templates-delete [-p ]... [-o ] locations-workflow-templates-get [-p ]... [-o ] @@ -43,9 +48,14 @@ dataproc1 [options] locations-workflow-templates-set-iam-policy (-r )... [-p ]... [-o ] locations-workflow-templates-test-iam-permissions (-r )... [-p ]... [-o ] locations-workflow-templates-update (-r )... [-p ]... [-o ] + regions-autoscaling-policies-create (-r )... [-p ]... [-o ] + regions-autoscaling-policies-delete [-p ]... [-o ] + regions-autoscaling-policies-get [-p ]... [-o ] regions-autoscaling-policies-get-iam-policy (-r )... [-p ]... [-o ] + regions-autoscaling-policies-list [-p ]... [-o ] regions-autoscaling-policies-set-iam-policy (-r )... [-p ]... [-o ] regions-autoscaling-policies-test-iam-permissions (-r )... [-p ]... [-o ] + regions-autoscaling-policies-update (-r )... [-p ]... [-o ] regions-clusters-create (-r )... [-p ]... [-o ] regions-clusters-delete [-p ]... [-o ] regions-clusters-diagnose (-r )... [-p ]... [-o ] @@ -63,6 +73,7 @@ dataproc1 [options] regions-jobs-patch (-r )... [-p ]... [-o ] regions-jobs-set-iam-policy (-r )... [-p ]... [-o ] regions-jobs-submit (-r )... [-p ]... [-o ] + regions-jobs-submit-as-operation (-r )... [-p ]... [-o ] regions-jobs-test-iam-permissions (-r )... [-p ]... [-o ] regions-operations-cancel [-p ]... [-o ] regions-operations-delete [-p ]... [-o ] diff --git a/gen/dataproc1-cli/mkdocs.yml b/gen/dataproc1-cli/mkdocs.yml index 923cd686a7..97af22301f 100644 --- a/gen/dataproc1-cli/mkdocs.yml +++ b/gen/dataproc1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Dataproc v1.0.12+20190620 +site_name: Dataproc v1.0.13+20200323 site_url: http://byron.github.io/google-apis-rs/google-dataproc1-cli site_description: A complete library to interact with Dataproc (protocol v1) @@ -9,9 +9,14 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['projects_locations-autoscaling-policies-create.md', 'Projects', 'Locations Autoscaling Policies Create'] +- ['projects_locations-autoscaling-policies-delete.md', 'Projects', 'Locations Autoscaling Policies Delete'] +- ['projects_locations-autoscaling-policies-get.md', 'Projects', 'Locations Autoscaling Policies Get'] - ['projects_locations-autoscaling-policies-get-iam-policy.md', 'Projects', 'Locations Autoscaling Policies Get Iam Policy'] +- ['projects_locations-autoscaling-policies-list.md', 'Projects', 'Locations Autoscaling Policies List'] - ['projects_locations-autoscaling-policies-set-iam-policy.md', 'Projects', 'Locations Autoscaling Policies Set Iam Policy'] - ['projects_locations-autoscaling-policies-test-iam-permissions.md', 'Projects', 'Locations Autoscaling Policies Test Iam Permissions'] +- ['projects_locations-autoscaling-policies-update.md', 'Projects', 'Locations Autoscaling Policies Update'] - ['projects_locations-workflow-templates-create.md', 'Projects', 'Locations Workflow Templates Create'] - ['projects_locations-workflow-templates-delete.md', 'Projects', 'Locations Workflow Templates Delete'] - ['projects_locations-workflow-templates-get.md', 'Projects', 'Locations Workflow Templates Get'] @@ -22,9 +27,14 @@ pages: - ['projects_locations-workflow-templates-set-iam-policy.md', 'Projects', 'Locations Workflow Templates Set Iam Policy'] - ['projects_locations-workflow-templates-test-iam-permissions.md', 'Projects', 'Locations Workflow Templates Test Iam Permissions'] - ['projects_locations-workflow-templates-update.md', 'Projects', 'Locations Workflow Templates Update'] +- ['projects_regions-autoscaling-policies-create.md', 'Projects', 'Regions Autoscaling Policies Create'] +- ['projects_regions-autoscaling-policies-delete.md', 'Projects', 'Regions Autoscaling Policies Delete'] +- ['projects_regions-autoscaling-policies-get.md', 'Projects', 'Regions Autoscaling Policies Get'] - ['projects_regions-autoscaling-policies-get-iam-policy.md', 'Projects', 'Regions Autoscaling Policies Get Iam Policy'] +- ['projects_regions-autoscaling-policies-list.md', 'Projects', 'Regions Autoscaling Policies List'] - ['projects_regions-autoscaling-policies-set-iam-policy.md', 'Projects', 'Regions Autoscaling Policies Set Iam Policy'] - ['projects_regions-autoscaling-policies-test-iam-permissions.md', 'Projects', 'Regions Autoscaling Policies Test Iam Permissions'] +- ['projects_regions-autoscaling-policies-update.md', 'Projects', 'Regions Autoscaling Policies Update'] - ['projects_regions-clusters-create.md', 'Projects', 'Regions Clusters Create'] - ['projects_regions-clusters-delete.md', 'Projects', 'Regions Clusters Delete'] - ['projects_regions-clusters-diagnose.md', 'Projects', 'Regions Clusters Diagnose'] @@ -42,6 +52,7 @@ pages: - ['projects_regions-jobs-patch.md', 'Projects', 'Regions Jobs Patch'] - ['projects_regions-jobs-set-iam-policy.md', 'Projects', 'Regions Jobs Set Iam Policy'] - ['projects_regions-jobs-submit.md', 'Projects', 'Regions Jobs Submit'] +- ['projects_regions-jobs-submit-as-operation.md', 'Projects', 'Regions Jobs Submit As Operation'] - ['projects_regions-jobs-test-iam-permissions.md', 'Projects', 'Regions Jobs Test Iam Permissions'] - ['projects_regions-operations-cancel.md', 'Projects', 'Regions Operations Cancel'] - ['projects_regions-operations-delete.md', 'Projects', 'Regions Operations Delete'] diff --git a/gen/dataproc1-cli/src/main.rs b/gen/dataproc1-cli/src/main.rs index 8a9bca99f0..e3e37ce51a 100644 --- a/gen/dataproc1-cli/src/main.rs +++ b/gen/dataproc1-cli/src/main.rs @@ -46,6 +46,208 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _projects_locations_autoscaling_policies_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "secondary-worker-config.min-instances" => Some(("secondaryWorkerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.weight" => Some(("secondaryWorkerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.max-instances" => Some(("secondaryWorkerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.min-instances" => Some(("workerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.weight" => Some(("workerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.max-instances" => Some(("workerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-factor" => Some(("basicAlgorithm.yarnConfig.scaleDownFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleUpMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleDownMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-factor" => Some(("basicAlgorithm.yarnConfig.scaleUpFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.graceful-decommission-timeout" => Some(("basicAlgorithm.yarnConfig.gracefulDecommissionTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.cooldown-period" => Some(("basicAlgorithm.cooldownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic-algorithm", "cooldown-period", "graceful-decommission-timeout", "id", "max-instances", "min-instances", "name", "scale-down-factor", "scale-down-min-worker-fraction", "scale-up-factor", "scale-up-min-worker-fraction", "secondary-worker-config", "weight", "worker-config", "yarn-config"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AutoscalingPolicy = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_autoscaling_policies_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_autoscaling_policies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_autoscaling_policies_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_autoscaling_policies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_autoscaling_policies_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_autoscaling_policies_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -69,8 +271,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -130,6 +333,65 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_autoscaling_policies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_autoscaling_policies_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_autoscaling_policies_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -301,6 +563,104 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_autoscaling_policies_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "secondary-worker-config.min-instances" => Some(("secondaryWorkerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.weight" => Some(("secondaryWorkerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.max-instances" => Some(("secondaryWorkerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.min-instances" => Some(("workerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.weight" => Some(("workerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.max-instances" => Some(("workerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-factor" => Some(("basicAlgorithm.yarnConfig.scaleDownFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleUpMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleDownMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-factor" => Some(("basicAlgorithm.yarnConfig.scaleUpFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.graceful-decommission-timeout" => Some(("basicAlgorithm.yarnConfig.gracefulDecommissionTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.cooldown-period" => Some(("basicAlgorithm.cooldownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic-algorithm", "cooldown-period", "graceful-decommission-timeout", "id", "max-instances", "min-instances", "name", "scale-down-factor", "scale-down-min-worker-fraction", "scale-up-factor", "scale-up-min-worker-fraction", "secondary-worker-config", "weight", "worker-config", "yarn-config"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AutoscalingPolicy = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_autoscaling_policies_update(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_workflow_templates_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -329,11 +689,18 @@ impl<'n> Engine<'n> { "placement.cluster-selector.cluster-labels" => Some(("placement.clusterSelector.clusterLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.cluster-name" => Some(("placement.managedCluster.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.labels" => Some(("placement.managedCluster.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-time" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-start-time" => Some(("placement.managedCluster.config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.image-version" => Some(("placement.managedCluster.config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.optional-components" => Some(("placement.managedCluster.config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.software-config.properties" => Some(("placement.managedCluster.config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.config.config-bucket" => Some(("placement.managedCluster.config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.internal-ip-only" => Some(("placement.managedCluster.config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.values" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.key" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.network-uri" => Some(("placement.managedCluster.config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.tags" => Some(("placement.managedCluster.config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.service-account" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -341,39 +708,47 @@ impl<'n> Engine<'n> { "placement.managed-cluster.config.gce-cluster-config.subnetwork-uri" => Some(("placement.managedCluster.config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.service-account-scopes" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.metadata" => Some(("placement.managedCluster.config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.autoscaling-config.policy-uri" => Some(("placement.managedCluster.config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.preemptibility" => Some(("placement.managedCluster.config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.machine-type-uri" => Some(("placement.managedCluster.config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.instance-names" => Some(("placement.managedCluster.config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.worker-config.image-uri" => Some(("placement.managedCluster.config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.encryption-config.gce-pd-kms-key-name" => Some(("placement.managedCluster.config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.preemptibility" => Some(("placement.managedCluster.config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.machine-type-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.instance-names" => Some(("placement.managedCluster.config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.secondary-worker-config.image-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.preemptibility" => Some(("placement.managedCluster.config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.machine-type-uri" => Some(("placement.managedCluster.config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.instance-names" => Some(("placement.managedCluster.config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.master-config.image-uri" => Some(("placement.managedCluster.config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.min-cpu-platform" => Some(("placement.managedCluster.config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.truststore-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.security-config.kerberos-config.realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.key-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.enable-kerberos" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -392,7 +767,7 @@ impl<'n> Engine<'n> { "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "version", "worker-config", "zone", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "consume-reservation-type", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "min-cpu-platform", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "policy-uri", "preemptibility", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "values", "version", "worker-config", "zone", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -587,8 +962,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -763,11 +1139,18 @@ impl<'n> Engine<'n> { "placement.cluster-selector.cluster-labels" => Some(("placement.clusterSelector.clusterLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.cluster-name" => Some(("placement.managedCluster.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.labels" => Some(("placement.managedCluster.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-time" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-start-time" => Some(("placement.managedCluster.config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.image-version" => Some(("placement.managedCluster.config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.optional-components" => Some(("placement.managedCluster.config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.software-config.properties" => Some(("placement.managedCluster.config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.config.config-bucket" => Some(("placement.managedCluster.config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.internal-ip-only" => Some(("placement.managedCluster.config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.values" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.key" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.network-uri" => Some(("placement.managedCluster.config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.tags" => Some(("placement.managedCluster.config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.service-account" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -775,39 +1158,47 @@ impl<'n> Engine<'n> { "placement.managed-cluster.config.gce-cluster-config.subnetwork-uri" => Some(("placement.managedCluster.config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.service-account-scopes" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.metadata" => Some(("placement.managedCluster.config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.autoscaling-config.policy-uri" => Some(("placement.managedCluster.config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.preemptibility" => Some(("placement.managedCluster.config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.machine-type-uri" => Some(("placement.managedCluster.config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.instance-names" => Some(("placement.managedCluster.config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.worker-config.image-uri" => Some(("placement.managedCluster.config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.encryption-config.gce-pd-kms-key-name" => Some(("placement.managedCluster.config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.preemptibility" => Some(("placement.managedCluster.config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.machine-type-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.instance-names" => Some(("placement.managedCluster.config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.secondary-worker-config.image-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.preemptibility" => Some(("placement.managedCluster.config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.machine-type-uri" => Some(("placement.managedCluster.config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.instance-names" => Some(("placement.managedCluster.config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.master-config.image-uri" => Some(("placement.managedCluster.config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.min-cpu-platform" => Some(("placement.managedCluster.config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.truststore-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.security-config.kerberos-config.realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.key-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.enable-kerberos" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -826,7 +1217,7 @@ impl<'n> Engine<'n> { "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "version", "worker-config", "zone", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "consume-reservation-type", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "min-cpu-platform", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "policy-uri", "preemptibility", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "values", "version", "worker-config", "zone", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1148,11 +1539,18 @@ impl<'n> Engine<'n> { "placement.cluster-selector.cluster-labels" => Some(("placement.clusterSelector.clusterLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.cluster-name" => Some(("placement.managedCluster.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.labels" => Some(("placement.managedCluster.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-time" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-start-time" => Some(("placement.managedCluster.config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.image-version" => Some(("placement.managedCluster.config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.optional-components" => Some(("placement.managedCluster.config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.software-config.properties" => Some(("placement.managedCluster.config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.config.config-bucket" => Some(("placement.managedCluster.config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.internal-ip-only" => Some(("placement.managedCluster.config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.values" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.key" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.network-uri" => Some(("placement.managedCluster.config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.tags" => Some(("placement.managedCluster.config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.service-account" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1160,39 +1558,47 @@ impl<'n> Engine<'n> { "placement.managed-cluster.config.gce-cluster-config.subnetwork-uri" => Some(("placement.managedCluster.config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.service-account-scopes" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.metadata" => Some(("placement.managedCluster.config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.autoscaling-config.policy-uri" => Some(("placement.managedCluster.config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.preemptibility" => Some(("placement.managedCluster.config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.machine-type-uri" => Some(("placement.managedCluster.config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.instance-names" => Some(("placement.managedCluster.config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.worker-config.image-uri" => Some(("placement.managedCluster.config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.encryption-config.gce-pd-kms-key-name" => Some(("placement.managedCluster.config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.preemptibility" => Some(("placement.managedCluster.config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.machine-type-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.instance-names" => Some(("placement.managedCluster.config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.secondary-worker-config.image-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.preemptibility" => Some(("placement.managedCluster.config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.machine-type-uri" => Some(("placement.managedCluster.config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.instance-names" => Some(("placement.managedCluster.config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.master-config.image-uri" => Some(("placement.managedCluster.config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.min-cpu-platform" => Some(("placement.managedCluster.config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.truststore-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.security-config.kerberos-config.realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.key-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.enable-kerberos" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1211,7 +1617,7 @@ impl<'n> Engine<'n> { "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "version", "worker-config", "zone", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "consume-reservation-type", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "min-cpu-platform", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "policy-uri", "preemptibility", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "values", "version", "worker-config", "zone", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1271,6 +1677,208 @@ impl<'n> Engine<'n> { } } + fn _projects_regions_autoscaling_policies_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "secondary-worker-config.min-instances" => Some(("secondaryWorkerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.weight" => Some(("secondaryWorkerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.max-instances" => Some(("secondaryWorkerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.min-instances" => Some(("workerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.weight" => Some(("workerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.max-instances" => Some(("workerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-factor" => Some(("basicAlgorithm.yarnConfig.scaleDownFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleUpMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleDownMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-factor" => Some(("basicAlgorithm.yarnConfig.scaleUpFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.graceful-decommission-timeout" => Some(("basicAlgorithm.yarnConfig.gracefulDecommissionTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.cooldown-period" => Some(("basicAlgorithm.cooldownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic-algorithm", "cooldown-period", "graceful-decommission-timeout", "id", "max-instances", "min-instances", "name", "scale-down-factor", "scale-down-min-worker-fraction", "scale-up-factor", "scale-up-min-worker-fraction", "secondary-worker-config", "weight", "worker-config", "yarn-config"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AutoscalingPolicy = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().regions_autoscaling_policies_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_regions_autoscaling_policies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().regions_autoscaling_policies_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_regions_autoscaling_policies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().regions_autoscaling_policies_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_regions_autoscaling_policies_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1294,8 +1902,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1355,6 +1964,65 @@ impl<'n> Engine<'n> { } } + fn _projects_regions_autoscaling_policies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().regions_autoscaling_policies_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_regions_autoscaling_policies_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1526,6 +2194,104 @@ impl<'n> Engine<'n> { } } + fn _projects_regions_autoscaling_policies_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "secondary-worker-config.min-instances" => Some(("secondaryWorkerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.weight" => Some(("secondaryWorkerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "secondary-worker-config.max-instances" => Some(("secondaryWorkerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.min-instances" => Some(("workerConfig.minInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.weight" => Some(("workerConfig.weight", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "worker-config.max-instances" => Some(("workerConfig.maxInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-factor" => Some(("basicAlgorithm.yarnConfig.scaleDownFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleUpMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-down-min-worker-fraction" => Some(("basicAlgorithm.yarnConfig.scaleDownMinWorkerFraction", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.scale-up-factor" => Some(("basicAlgorithm.yarnConfig.scaleUpFactor", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "basic-algorithm.yarn-config.graceful-decommission-timeout" => Some(("basicAlgorithm.yarnConfig.gracefulDecommissionTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "basic-algorithm.cooldown-period" => Some(("basicAlgorithm.cooldownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["basic-algorithm", "cooldown-period", "graceful-decommission-timeout", "id", "max-instances", "min-instances", "name", "scale-down-factor", "scale-down-min-worker-fraction", "scale-up-factor", "scale-up-min-worker-fraction", "secondary-worker-config", "weight", "worker-config", "yarn-config"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AutoscalingPolicy = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().regions_autoscaling_policies_update(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_regions_clusters_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1559,11 +2325,18 @@ impl<'n> Engine<'n> { "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "metrics.yarn-metrics" => Some(("metrics.yarnMetrics", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "metrics.hdfs-metrics" => Some(("metrics.hdfsMetrics", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "config.lifecycle-config.auto-delete-time" => Some(("config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.lifecycle-config.idle-delete-ttl" => Some(("config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.lifecycle-config.auto-delete-ttl" => Some(("config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.lifecycle-config.idle-start-time" => Some(("config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.software-config.image-version" => Some(("config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.software-config.optional-components" => Some(("config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.software-config.properties" => Some(("config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "config.config-bucket" => Some(("config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.internal-ip-only" => Some(("config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.gce-cluster-config.reservation-affinity.values" => Some(("config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.gce-cluster-config.reservation-affinity.key" => Some(("config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.network-uri" => Some(("config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.tags" => Some(("config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.gce-cluster-config.service-account" => Some(("config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1571,39 +2344,47 @@ impl<'n> Engine<'n> { "config.gce-cluster-config.subnetwork-uri" => Some(("config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.service-account-scopes" => Some(("config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.gce-cluster-config.metadata" => Some(("config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.autoscaling-config.policy-uri" => Some(("config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.worker-config.preemptibility" => Some(("config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.machine-type-uri" => Some(("config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.instance-names" => Some(("config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-template-name" => Some(("config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-group-manager-name" => Some(("config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.worker-config.min-cpu-platform" => Some(("config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.disk-config.boot-disk-type" => Some(("config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.encryption-config.gce-pd-kms-key-name" => Some(("config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.secondary-worker-config.preemptibility" => Some(("config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.machine-type-uri" => Some(("config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.instance-names" => Some(("config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.secondary-worker-config.min-cpu-platform" => Some(("config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.boot-disk-type" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.master-config.preemptibility" => Some(("config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.machine-type-uri" => Some(("config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.instance-names" => Some(("config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-template-name" => Some(("config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-group-manager-name" => Some(("config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.master-config.min-cpu-platform" => Some(("config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.disk-config.boot-disk-type" => Some(("config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.truststore-password-uri" => Some(("config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.security-config.kerberos-config.realm" => Some(("config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.key-password-uri" => Some(("config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.enable-kerberos" => Some(("config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1617,7 +2398,7 @@ impl<'n> Engine<'n> { "config.security-config.kerberos-config.kdc-db-key-uri" => Some(("config.securityConfig.kerberosConfig.kdcDbKeyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.keystore-uri" => Some(("config.securityConfig.kerberosConfig.keystoreUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-name", "cluster-uuid", "config", "config-bucket", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "detail", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "optional-components", "project-id", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "worker-config", "yarn-metrics", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-name", "cluster-uuid", "config", "config-bucket", "consume-reservation-type", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "detail", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "hdfs-metrics", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "min-cpu-platform", "network-uri", "num-instances", "num-local-ssds", "optional-components", "policy-uri", "preemptibility", "project-id", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "values", "worker-config", "yarn-metrics", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1899,8 +2680,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2055,11 +2837,18 @@ impl<'n> Engine<'n> { "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "metrics.yarn-metrics" => Some(("metrics.yarnMetrics", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "metrics.hdfs-metrics" => Some(("metrics.hdfsMetrics", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "config.lifecycle-config.auto-delete-time" => Some(("config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.lifecycle-config.idle-delete-ttl" => Some(("config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.lifecycle-config.auto-delete-ttl" => Some(("config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.lifecycle-config.idle-start-time" => Some(("config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.software-config.image-version" => Some(("config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.software-config.optional-components" => Some(("config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.software-config.properties" => Some(("config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "config.config-bucket" => Some(("config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.internal-ip-only" => Some(("config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.gce-cluster-config.reservation-affinity.values" => Some(("config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.gce-cluster-config.reservation-affinity.key" => Some(("config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.network-uri" => Some(("config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.tags" => Some(("config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.gce-cluster-config.service-account" => Some(("config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2067,39 +2856,47 @@ impl<'n> Engine<'n> { "config.gce-cluster-config.subnetwork-uri" => Some(("config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.service-account-scopes" => Some(("config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.gce-cluster-config.metadata" => Some(("config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.autoscaling-config.policy-uri" => Some(("config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.worker-config.preemptibility" => Some(("config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.machine-type-uri" => Some(("config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.instance-names" => Some(("config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-template-name" => Some(("config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-group-manager-name" => Some(("config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.worker-config.min-cpu-platform" => Some(("config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.disk-config.boot-disk-type" => Some(("config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.encryption-config.gce-pd-kms-key-name" => Some(("config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.secondary-worker-config.preemptibility" => Some(("config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.machine-type-uri" => Some(("config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.instance-names" => Some(("config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.secondary-worker-config.min-cpu-platform" => Some(("config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.boot-disk-type" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.master-config.preemptibility" => Some(("config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.machine-type-uri" => Some(("config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.instance-names" => Some(("config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-template-name" => Some(("config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-group-manager-name" => Some(("config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.master-config.min-cpu-platform" => Some(("config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.disk-config.boot-disk-type" => Some(("config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.truststore-password-uri" => Some(("config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.security-config.kerberos-config.realm" => Some(("config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.key-password-uri" => Some(("config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.enable-kerberos" => Some(("config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2113,7 +2910,7 @@ impl<'n> Engine<'n> { "config.security-config.kerberos-config.kdc-db-key-uri" => Some(("config.securityConfig.kerberosConfig.kdcDbKeyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.security-config.kerberos-config.keystore-uri" => Some(("config.securityConfig.kerberosConfig.keystoreUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-name", "cluster-uuid", "config", "config-bucket", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "detail", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "optional-components", "project-id", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "worker-config", "yarn-metrics", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-name", "cluster-uuid", "config", "config-bucket", "consume-reservation-type", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "detail", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "hdfs-metrics", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "min-cpu-platform", "network-uri", "num-instances", "num-local-ssds", "optional-components", "policy-uri", "preemptibility", "project-id", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "values", "worker-config", "yarn-metrics", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2565,8 +3362,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2738,6 +3536,12 @@ impl<'n> Engine<'n> { "pig-job.properties" => Some(("pigJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.cluster-name" => Some(("placement.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.cluster-uuid" => Some(("placement.clusterUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spark-r-job.logging-config.driver-log-levels" => Some(("sparkRJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spark-r-job.args" => Some(("sparkRJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-r-job.properties" => Some(("sparkRJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spark-r-job.file-uris" => Some(("sparkRJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-r-job.archive-uris" => Some(("sparkRJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-r-job.main-r-file-uri" => Some(("sparkRJob.mainRFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference.project-id" => Some(("reference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference.job-id" => Some(("reference.jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spark-sql-job.query-file-uri" => Some(("sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2748,7 +3552,17 @@ impl<'n> Engine<'n> { "spark-sql-job.properties" => Some(("sparkSqlJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "driver-output-resource-uri" => Some(("driverOutputResourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-uuid" => Some(("jobUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "driver-control-files-uri" => Some(("driverControlFilesUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "done" => Some(("done", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "presto-job.query-file-uri" => Some(("prestoJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "presto-job.output-format" => Some(("prestoJob.outputFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "presto-job.logging-config.driver-log-levels" => Some(("prestoJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "presto-job.client-tags" => Some(("prestoJob.clientTags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "presto-job.query-list.queries" => Some(("prestoJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "presto-job.continue-on-failure" => Some(("prestoJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "presto-job.properties" => Some(("prestoJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "scheduling.max-failures-per-hour" => Some(("scheduling.maxFailuresPerHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "spark-job.args" => Some(("sparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "spark-job.logging-config.driver-log-levels" => Some(("sparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "spark-job.jar-file-uris" => Some(("sparkJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2757,8 +3571,6 @@ impl<'n> Engine<'n> { "spark-job.archive-uris" => Some(("sparkJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "spark-job.main-jar-file-uri" => Some(("sparkJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spark-job.properties" => Some(("sparkJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "job-uuid" => Some(("jobUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "scheduling.max-failures-per-hour" => Some(("scheduling.maxFailuresPerHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "pyspark-job.main-python-file-uri" => Some(("pysparkJob.mainPythonFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "pyspark-job.args" => Some(("pysparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "pyspark-job.logging-config.driver-log-levels" => Some(("pysparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -2774,7 +3586,7 @@ impl<'n> Engine<'n> { "hive-job.continue-on-failure" => Some(("hiveJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "hive-job.properties" => Some(("hiveJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job-id", "job-uuid", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "max-failures-per-hour", "pig-job", "placement", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "scheduling", "script-variables", "spark-job", "spark-sql-job", "state", "state-start-time", "status", "substate"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "client-tags", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "done", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job-id", "job-uuid", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "main-r-file-uri", "max-failures-per-hour", "output-format", "pig-job", "placement", "presto-job", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "scheduling", "script-variables", "spark-job", "spark-r-job", "spark-sql-job", "state", "state-start-time", "status", "substate"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2968,6 +3780,12 @@ impl<'n> Engine<'n> { "job.pig-job.properties" => Some(("job.pigJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.placement.cluster-name" => Some(("job.placement.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.placement.cluster-uuid" => Some(("job.placement.clusterUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-r-job.logging-config.driver-log-levels" => Some(("job.sparkRJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-r-job.args" => Some(("job.sparkRJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-r-job.properties" => Some(("job.sparkRJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-r-job.file-uris" => Some(("job.sparkRJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-r-job.archive-uris" => Some(("job.sparkRJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-r-job.main-r-file-uri" => Some(("job.sparkRJob.mainRFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.reference.project-id" => Some(("job.reference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.reference.job-id" => Some(("job.reference.jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.spark-sql-job.query-file-uri" => Some(("job.sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2978,7 +3796,17 @@ impl<'n> Engine<'n> { "job.spark-sql-job.properties" => Some(("job.sparkSqlJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.labels" => Some(("job.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.driver-output-resource-uri" => Some(("job.driverOutputResourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.job-uuid" => Some(("job.jobUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.driver-control-files-uri" => Some(("job.driverControlFilesUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.done" => Some(("job.done", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job.presto-job.query-file-uri" => Some(("job.prestoJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.presto-job.output-format" => Some(("job.prestoJob.outputFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.presto-job.logging-config.driver-log-levels" => Some(("job.prestoJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.presto-job.client-tags" => Some(("job.prestoJob.clientTags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.presto-job.query-list.queries" => Some(("job.prestoJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.presto-job.continue-on-failure" => Some(("job.prestoJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job.presto-job.properties" => Some(("job.prestoJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.scheduling.max-failures-per-hour" => Some(("job.scheduling.maxFailuresPerHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "job.spark-job.args" => Some(("job.sparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "job.spark-job.logging-config.driver-log-levels" => Some(("job.sparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.spark-job.jar-file-uris" => Some(("job.sparkJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2987,8 +3815,6 @@ impl<'n> Engine<'n> { "job.spark-job.archive-uris" => Some(("job.sparkJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "job.spark-job.main-jar-file-uri" => Some(("job.sparkJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.spark-job.properties" => Some(("job.sparkJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "job.job-uuid" => Some(("job.jobUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job.scheduling.max-failures-per-hour" => Some(("job.scheduling.maxFailuresPerHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "job.pyspark-job.main-python-file-uri" => Some(("job.pysparkJob.mainPythonFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.pyspark-job.args" => Some(("job.pysparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "job.pyspark-job.logging-config.driver-log-levels" => Some(("job.pysparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -3005,7 +3831,7 @@ impl<'n> Engine<'n> { "job.hive-job.properties" => Some(("job.hiveJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "request-id" => Some(("requestId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job", "job-id", "job-uuid", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "max-failures-per-hour", "pig-job", "placement", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "request-id", "scheduling", "script-variables", "spark-job", "spark-sql-job", "state", "state-start-time", "status", "substate"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "client-tags", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "done", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job", "job-id", "job-uuid", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "main-r-file-uri", "max-failures-per-hour", "output-format", "pig-job", "placement", "presto-job", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "request-id", "scheduling", "script-variables", "spark-job", "spark-r-job", "spark-sql-job", "state", "state-start-time", "status", "substate"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3065,6 +3891,161 @@ impl<'n> Engine<'n> { } } + fn _projects_regions_jobs_submit_as_operation(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "job.status.state" => Some(("job.status.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.status.state-start-time" => Some(("job.status.stateStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.status.details" => Some(("job.status.details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.status.substate" => Some(("job.status.substate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.hadoop-job.args" => Some(("job.hadoopJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.logging-config.driver-log-levels" => Some(("job.hadoopJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.hadoop-job.jar-file-uris" => Some(("job.hadoopJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.file-uris" => Some(("job.hadoopJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.main-class" => Some(("job.hadoopJob.mainClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.hadoop-job.archive-uris" => Some(("job.hadoopJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.main-jar-file-uri" => Some(("job.hadoopJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.hadoop-job.properties" => Some(("job.hadoopJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.pig-job.query-file-uri" => Some(("job.pigJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.pig-job.script-variables" => Some(("job.pigJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.pig-job.logging-config.driver-log-levels" => Some(("job.pigJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.pig-job.jar-file-uris" => Some(("job.pigJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.pig-job.query-list.queries" => Some(("job.pigJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.pig-job.continue-on-failure" => Some(("job.pigJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job.pig-job.properties" => Some(("job.pigJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.placement.cluster-name" => Some(("job.placement.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.placement.cluster-uuid" => Some(("job.placement.clusterUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-r-job.logging-config.driver-log-levels" => Some(("job.sparkRJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-r-job.args" => Some(("job.sparkRJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-r-job.properties" => Some(("job.sparkRJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-r-job.file-uris" => Some(("job.sparkRJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-r-job.archive-uris" => Some(("job.sparkRJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-r-job.main-r-file-uri" => Some(("job.sparkRJob.mainRFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.reference.project-id" => Some(("job.reference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.reference.job-id" => Some(("job.reference.jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-sql-job.query-file-uri" => Some(("job.sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-sql-job.script-variables" => Some(("job.sparkSqlJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-sql-job.logging-config.driver-log-levels" => Some(("job.sparkSqlJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-sql-job.jar-file-uris" => Some(("job.sparkSqlJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-sql-job.query-list.queries" => Some(("job.sparkSqlJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-sql-job.properties" => Some(("job.sparkSqlJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.labels" => Some(("job.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.driver-output-resource-uri" => Some(("job.driverOutputResourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.job-uuid" => Some(("job.jobUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.driver-control-files-uri" => Some(("job.driverControlFilesUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.done" => Some(("job.done", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job.presto-job.query-file-uri" => Some(("job.prestoJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.presto-job.output-format" => Some(("job.prestoJob.outputFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.presto-job.logging-config.driver-log-levels" => Some(("job.prestoJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.presto-job.client-tags" => Some(("job.prestoJob.clientTags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.presto-job.query-list.queries" => Some(("job.prestoJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.presto-job.continue-on-failure" => Some(("job.prestoJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job.presto-job.properties" => Some(("job.prestoJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.scheduling.max-failures-per-hour" => Some(("job.scheduling.maxFailuresPerHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job.spark-job.args" => Some(("job.sparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-job.logging-config.driver-log-levels" => Some(("job.sparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-job.jar-file-uris" => Some(("job.sparkJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-job.file-uris" => Some(("job.sparkJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-job.main-class" => Some(("job.sparkJob.mainClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-job.archive-uris" => Some(("job.sparkJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-job.main-jar-file-uri" => Some(("job.sparkJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-job.properties" => Some(("job.sparkJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.pyspark-job.main-python-file-uri" => Some(("job.pysparkJob.mainPythonFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.pyspark-job.args" => Some(("job.pysparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.pyspark-job.logging-config.driver-log-levels" => Some(("job.pysparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.pyspark-job.jar-file-uris" => Some(("job.pysparkJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.pyspark-job.file-uris" => Some(("job.pysparkJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.pyspark-job.archive-uris" => Some(("job.pysparkJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.pyspark-job.python-file-uris" => Some(("job.pysparkJob.pythonFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.pyspark-job.properties" => Some(("job.pysparkJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.hive-job.query-file-uri" => Some(("job.hiveJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.hive-job.script-variables" => Some(("job.hiveJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.hive-job.jar-file-uris" => Some(("job.hiveJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hive-job.query-list.queries" => Some(("job.hiveJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hive-job.continue-on-failure" => Some(("job.hiveJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job.hive-job.properties" => Some(("job.hiveJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "request-id" => Some(("requestId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "client-tags", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "done", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job", "job-id", "job-uuid", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "main-r-file-uri", "max-failures-per-hour", "output-format", "pig-job", "placement", "presto-job", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "request-id", "scheduling", "script-variables", "spark-job", "spark-r-job", "spark-sql-job", "state", "state-start-time", "status", "substate"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SubmitJobRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().regions_jobs_submit_as_operation(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("region").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_regions_jobs_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3329,8 +4310,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3651,11 +4633,18 @@ impl<'n> Engine<'n> { "placement.cluster-selector.cluster-labels" => Some(("placement.clusterSelector.clusterLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.cluster-name" => Some(("placement.managedCluster.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.labels" => Some(("placement.managedCluster.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-time" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-start-time" => Some(("placement.managedCluster.config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.image-version" => Some(("placement.managedCluster.config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.optional-components" => Some(("placement.managedCluster.config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.software-config.properties" => Some(("placement.managedCluster.config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.config.config-bucket" => Some(("placement.managedCluster.config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.internal-ip-only" => Some(("placement.managedCluster.config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.values" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.key" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.network-uri" => Some(("placement.managedCluster.config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.tags" => Some(("placement.managedCluster.config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.service-account" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3663,39 +4652,47 @@ impl<'n> Engine<'n> { "placement.managed-cluster.config.gce-cluster-config.subnetwork-uri" => Some(("placement.managedCluster.config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.service-account-scopes" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.metadata" => Some(("placement.managedCluster.config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.autoscaling-config.policy-uri" => Some(("placement.managedCluster.config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.preemptibility" => Some(("placement.managedCluster.config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.machine-type-uri" => Some(("placement.managedCluster.config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.instance-names" => Some(("placement.managedCluster.config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.worker-config.image-uri" => Some(("placement.managedCluster.config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.encryption-config.gce-pd-kms-key-name" => Some(("placement.managedCluster.config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.preemptibility" => Some(("placement.managedCluster.config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.machine-type-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.instance-names" => Some(("placement.managedCluster.config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.secondary-worker-config.image-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.preemptibility" => Some(("placement.managedCluster.config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.machine-type-uri" => Some(("placement.managedCluster.config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.instance-names" => Some(("placement.managedCluster.config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.master-config.image-uri" => Some(("placement.managedCluster.config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.min-cpu-platform" => Some(("placement.managedCluster.config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.truststore-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.security-config.kerberos-config.realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.key-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.enable-kerberos" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3714,7 +4711,7 @@ impl<'n> Engine<'n> { "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "version", "worker-config", "zone", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "consume-reservation-type", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "min-cpu-platform", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "policy-uri", "preemptibility", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "values", "version", "worker-config", "zone", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3909,8 +4906,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4085,11 +5083,18 @@ impl<'n> Engine<'n> { "placement.cluster-selector.cluster-labels" => Some(("placement.clusterSelector.clusterLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.cluster-name" => Some(("placement.managedCluster.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.labels" => Some(("placement.managedCluster.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-time" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-start-time" => Some(("placement.managedCluster.config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.image-version" => Some(("placement.managedCluster.config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.optional-components" => Some(("placement.managedCluster.config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.software-config.properties" => Some(("placement.managedCluster.config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.config.config-bucket" => Some(("placement.managedCluster.config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.internal-ip-only" => Some(("placement.managedCluster.config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.values" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.key" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.network-uri" => Some(("placement.managedCluster.config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.tags" => Some(("placement.managedCluster.config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.service-account" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4097,39 +5102,47 @@ impl<'n> Engine<'n> { "placement.managed-cluster.config.gce-cluster-config.subnetwork-uri" => Some(("placement.managedCluster.config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.service-account-scopes" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.metadata" => Some(("placement.managedCluster.config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.autoscaling-config.policy-uri" => Some(("placement.managedCluster.config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.preemptibility" => Some(("placement.managedCluster.config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.machine-type-uri" => Some(("placement.managedCluster.config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.instance-names" => Some(("placement.managedCluster.config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.worker-config.image-uri" => Some(("placement.managedCluster.config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.encryption-config.gce-pd-kms-key-name" => Some(("placement.managedCluster.config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.preemptibility" => Some(("placement.managedCluster.config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.machine-type-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.instance-names" => Some(("placement.managedCluster.config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.secondary-worker-config.image-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.preemptibility" => Some(("placement.managedCluster.config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.machine-type-uri" => Some(("placement.managedCluster.config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.instance-names" => Some(("placement.managedCluster.config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.master-config.image-uri" => Some(("placement.managedCluster.config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.min-cpu-platform" => Some(("placement.managedCluster.config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.truststore-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.security-config.kerberos-config.realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.key-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.enable-kerberos" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4148,7 +5161,7 @@ impl<'n> Engine<'n> { "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "version", "worker-config", "zone", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "consume-reservation-type", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "min-cpu-platform", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "policy-uri", "preemptibility", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "values", "version", "worker-config", "zone", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4470,11 +5483,18 @@ impl<'n> Engine<'n> { "placement.cluster-selector.cluster-labels" => Some(("placement.clusterSelector.clusterLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.cluster-name" => Some(("placement.managedCluster.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.labels" => Some(("placement.managedCluster.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-time" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.idleDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.auto-delete-ttl" => Some(("placement.managedCluster.config.lifecycleConfig.autoDeleteTtl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.lifecycle-config.idle-start-time" => Some(("placement.managedCluster.config.lifecycleConfig.idleStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.image-version" => Some(("placement.managedCluster.config.softwareConfig.imageVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.software-config.optional-components" => Some(("placement.managedCluster.config.softwareConfig.optionalComponents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.software-config.properties" => Some(("placement.managedCluster.config.softwareConfig.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "placement.managed-cluster.config.config-bucket" => Some(("placement.managedCluster.config.configBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.internal-ip-only" => Some(("placement.managedCluster.config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.values" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.values", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.key" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.gce-cluster-config.reservation-affinity.consume-reservation-type" => Some(("placement.managedCluster.config.gceClusterConfig.reservationAffinity.consumeReservationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.network-uri" => Some(("placement.managedCluster.config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.tags" => Some(("placement.managedCluster.config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.service-account" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4482,39 +5502,47 @@ impl<'n> Engine<'n> { "placement.managed-cluster.config.gce-cluster-config.subnetwork-uri" => Some(("placement.managedCluster.config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.gce-cluster-config.service-account-scopes" => Some(("placement.managedCluster.config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.gce-cluster-config.metadata" => Some(("placement.managedCluster.config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.autoscaling-config.policy-uri" => Some(("placement.managedCluster.config.autoscalingConfig.policyUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.preemptibility" => Some(("placement.managedCluster.config.workerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.machine-type-uri" => Some(("placement.managedCluster.config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.instance-names" => Some(("placement.managedCluster.config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.worker-config.image-uri" => Some(("placement.managedCluster.config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.worker-config.is-preemptible" => Some(("placement.managedCluster.config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.workerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.worker-config.num-instances" => Some(("placement.managedCluster.config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.encryption-config.gce-pd-kms-key-name" => Some(("placement.managedCluster.config.encryptionConfig.gcePdKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.preemptibility" => Some(("placement.managedCluster.config.secondaryWorkerConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.machine-type-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.instance-names" => Some(("placement.managedCluster.config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.secondary-worker-config.image-uri" => Some(("placement.managedCluster.config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.secondary-worker-config.is-preemptible" => Some(("placement.managedCluster.config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.min-cpu-platform" => Some(("placement.managedCluster.config.secondaryWorkerConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.secondary-worker-config.num-instances" => Some(("placement.managedCluster.config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.preemptibility" => Some(("placement.managedCluster.config.masterConfig.preemptibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.machine-type-uri" => Some(("placement.managedCluster.config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.instance-names" => Some(("placement.managedCluster.config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "placement.managed-cluster.config.master-config.image-uri" => Some(("placement.managedCluster.config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-template-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.managed-group-config.instance-group-manager-name" => Some(("placement.managedCluster.config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "placement.managed-cluster.config.master-config.is-preemptible" => Some(("placement.managedCluster.config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.min-cpu-platform" => Some(("placement.managedCluster.config.masterConfig.minCpuPlatform", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.num-local-ssds" => Some(("placement.managedCluster.config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-type" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.master-config.disk-config.boot-disk-size-gb" => Some(("placement.managedCluster.config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.master-config.num-instances" => Some(("placement.managedCluster.config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.truststore-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.truststorePasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustRealm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.managed-cluster.config.security-config.kerberos-config.realm" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.realm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.key-password-uri" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.keyPasswordUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.enable-kerberos" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.enableKerberos", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "placement.managed-cluster.config.security-config.kerberos-config.cross-realm-trust-admin-server" => Some(("placement.managedCluster.config.securityConfig.kerberosConfig.crossRealmTrustAdminServer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4533,7 +5561,7 @@ impl<'n> Engine<'n> { "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "properties", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "version", "worker-config", "zone", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-delete-time", "auto-delete-ttl", "autoscaling-config", "boot-disk-size-gb", "boot-disk-type", "cluster-labels", "cluster-name", "cluster-selector", "config", "config-bucket", "consume-reservation-type", "create-time", "cross-realm-trust-admin-server", "cross-realm-trust-kdc", "cross-realm-trust-realm", "cross-realm-trust-shared-password-uri", "disk-config", "enable-kerberos", "encryption-config", "gce-cluster-config", "gce-pd-kms-key-name", "id", "idle-delete-ttl", "idle-start-time", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "kdc-db-key-uri", "kerberos-config", "key", "key-password-uri", "keystore-password-uri", "keystore-uri", "kms-key-uri", "labels", "lifecycle-config", "machine-type-uri", "managed-cluster", "managed-group-config", "master-config", "metadata", "min-cpu-platform", "name", "network-uri", "num-instances", "num-local-ssds", "optional-components", "placement", "policy-uri", "preemptibility", "properties", "realm", "reservation-affinity", "root-principal-password-uri", "secondary-worker-config", "security-config", "service-account", "service-account-scopes", "software-config", "subnetwork-uri", "tags", "tgt-lifetime-hours", "truststore-password-uri", "truststore-uri", "update-time", "values", "version", "worker-config", "zone", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4600,15 +5628,30 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { + ("locations-autoscaling-policies-create", Some(opt)) => { + call_result = self._projects_locations_autoscaling_policies_create(opt, dry_run, &mut err); + }, + ("locations-autoscaling-policies-delete", Some(opt)) => { + call_result = self._projects_locations_autoscaling_policies_delete(opt, dry_run, &mut err); + }, + ("locations-autoscaling-policies-get", Some(opt)) => { + call_result = self._projects_locations_autoscaling_policies_get(opt, dry_run, &mut err); + }, ("locations-autoscaling-policies-get-iam-policy", Some(opt)) => { call_result = self._projects_locations_autoscaling_policies_get_iam_policy(opt, dry_run, &mut err); }, + ("locations-autoscaling-policies-list", Some(opt)) => { + call_result = self._projects_locations_autoscaling_policies_list(opt, dry_run, &mut err); + }, ("locations-autoscaling-policies-set-iam-policy", Some(opt)) => { call_result = self._projects_locations_autoscaling_policies_set_iam_policy(opt, dry_run, &mut err); }, ("locations-autoscaling-policies-test-iam-permissions", Some(opt)) => { call_result = self._projects_locations_autoscaling_policies_test_iam_permissions(opt, dry_run, &mut err); }, + ("locations-autoscaling-policies-update", Some(opt)) => { + call_result = self._projects_locations_autoscaling_policies_update(opt, dry_run, &mut err); + }, ("locations-workflow-templates-create", Some(opt)) => { call_result = self._projects_locations_workflow_templates_create(opt, dry_run, &mut err); }, @@ -4639,15 +5682,30 @@ impl<'n> Engine<'n> { ("locations-workflow-templates-update", Some(opt)) => { call_result = self._projects_locations_workflow_templates_update(opt, dry_run, &mut err); }, + ("regions-autoscaling-policies-create", Some(opt)) => { + call_result = self._projects_regions_autoscaling_policies_create(opt, dry_run, &mut err); + }, + ("regions-autoscaling-policies-delete", Some(opt)) => { + call_result = self._projects_regions_autoscaling_policies_delete(opt, dry_run, &mut err); + }, + ("regions-autoscaling-policies-get", Some(opt)) => { + call_result = self._projects_regions_autoscaling_policies_get(opt, dry_run, &mut err); + }, ("regions-autoscaling-policies-get-iam-policy", Some(opt)) => { call_result = self._projects_regions_autoscaling_policies_get_iam_policy(opt, dry_run, &mut err); }, + ("regions-autoscaling-policies-list", Some(opt)) => { + call_result = self._projects_regions_autoscaling_policies_list(opt, dry_run, &mut err); + }, ("regions-autoscaling-policies-set-iam-policy", Some(opt)) => { call_result = self._projects_regions_autoscaling_policies_set_iam_policy(opt, dry_run, &mut err); }, ("regions-autoscaling-policies-test-iam-permissions", Some(opt)) => { call_result = self._projects_regions_autoscaling_policies_test_iam_permissions(opt, dry_run, &mut err); }, + ("regions-autoscaling-policies-update", Some(opt)) => { + call_result = self._projects_regions_autoscaling_policies_update(opt, dry_run, &mut err); + }, ("regions-clusters-create", Some(opt)) => { call_result = self._projects_regions_clusters_create(opt, dry_run, &mut err); }, @@ -4699,6 +5757,9 @@ impl<'n> Engine<'n> { ("regions-jobs-submit", Some(opt)) => { call_result = self._projects_regions_jobs_submit(opt, dry_run, &mut err); }, + ("regions-jobs-submit-as-operation", Some(opt)) => { + call_result = self._projects_regions_jobs_submit_as_operation(opt, dry_run, &mut err); + }, ("regions-jobs-test-iam-permissions", Some(opt)) => { call_result = self._projects_regions_jobs_test_iam_permissions(opt, dry_run, &mut err); }, @@ -4844,7 +5905,85 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'locations-autoscaling-policies-get-iam-policy', 'locations-autoscaling-policies-set-iam-policy', 'locations-autoscaling-policies-test-iam-permissions', 'locations-workflow-templates-create', 'locations-workflow-templates-delete', 'locations-workflow-templates-get', 'locations-workflow-templates-get-iam-policy', 'locations-workflow-templates-instantiate', 'locations-workflow-templates-instantiate-inline', 'locations-workflow-templates-list', 'locations-workflow-templates-set-iam-policy', 'locations-workflow-templates-test-iam-permissions', 'locations-workflow-templates-update', 'regions-autoscaling-policies-get-iam-policy', 'regions-autoscaling-policies-set-iam-policy', 'regions-autoscaling-policies-test-iam-permissions', 'regions-clusters-create', 'regions-clusters-delete', 'regions-clusters-diagnose', 'regions-clusters-get', 'regions-clusters-get-iam-policy', 'regions-clusters-list', 'regions-clusters-patch', 'regions-clusters-set-iam-policy', 'regions-clusters-test-iam-permissions', 'regions-jobs-cancel', 'regions-jobs-delete', 'regions-jobs-get', 'regions-jobs-get-iam-policy', 'regions-jobs-list', 'regions-jobs-patch', 'regions-jobs-set-iam-policy', 'regions-jobs-submit', 'regions-jobs-test-iam-permissions', 'regions-operations-cancel', 'regions-operations-delete', 'regions-operations-get', 'regions-operations-get-iam-policy', 'regions-operations-list', 'regions-operations-set-iam-policy', 'regions-operations-test-iam-permissions', 'regions-workflow-templates-create', 'regions-workflow-templates-delete', 'regions-workflow-templates-get', 'regions-workflow-templates-get-iam-policy', 'regions-workflow-templates-instantiate', 'regions-workflow-templates-instantiate-inline', 'regions-workflow-templates-list', 'regions-workflow-templates-set-iam-policy', 'regions-workflow-templates-test-iam-permissions' and 'regions-workflow-templates-update'", vec![ + ("projects", "methods: 'locations-autoscaling-policies-create', 'locations-autoscaling-policies-delete', 'locations-autoscaling-policies-get', 'locations-autoscaling-policies-get-iam-policy', 'locations-autoscaling-policies-list', 'locations-autoscaling-policies-set-iam-policy', 'locations-autoscaling-policies-test-iam-permissions', 'locations-autoscaling-policies-update', 'locations-workflow-templates-create', 'locations-workflow-templates-delete', 'locations-workflow-templates-get', 'locations-workflow-templates-get-iam-policy', 'locations-workflow-templates-instantiate', 'locations-workflow-templates-instantiate-inline', 'locations-workflow-templates-list', 'locations-workflow-templates-set-iam-policy', 'locations-workflow-templates-test-iam-permissions', 'locations-workflow-templates-update', 'regions-autoscaling-policies-create', 'regions-autoscaling-policies-delete', 'regions-autoscaling-policies-get', 'regions-autoscaling-policies-get-iam-policy', 'regions-autoscaling-policies-list', 'regions-autoscaling-policies-set-iam-policy', 'regions-autoscaling-policies-test-iam-permissions', 'regions-autoscaling-policies-update', 'regions-clusters-create', 'regions-clusters-delete', 'regions-clusters-diagnose', 'regions-clusters-get', 'regions-clusters-get-iam-policy', 'regions-clusters-list', 'regions-clusters-patch', 'regions-clusters-set-iam-policy', 'regions-clusters-test-iam-permissions', 'regions-jobs-cancel', 'regions-jobs-delete', 'regions-jobs-get', 'regions-jobs-get-iam-policy', 'regions-jobs-list', 'regions-jobs-patch', 'regions-jobs-set-iam-policy', 'regions-jobs-submit', 'regions-jobs-submit-as-operation', 'regions-jobs-test-iam-permissions', 'regions-operations-cancel', 'regions-operations-delete', 'regions-operations-get', 'regions-operations-get-iam-policy', 'regions-operations-list', 'regions-operations-set-iam-policy', 'regions-operations-test-iam-permissions', 'regions-workflow-templates-create', 'regions-workflow-templates-delete', 'regions-workflow-templates-get', 'regions-workflow-templates-get-iam-policy', 'regions-workflow-templates-instantiate', 'regions-workflow-templates-instantiate-inline', 'regions-workflow-templates-list', 'regions-workflow-templates-set-iam-policy', 'regions-workflow-templates-test-iam-permissions' and 'regions-workflow-templates-update'", vec![ + ("locations-autoscaling-policies-create", + Some(r##"Creates new autoscaling policy."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-autoscaling-policies-delete", + Some(r##"Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-autoscaling-policies-get", + Some(r##"Retrieves autoscaling policy."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("locations-autoscaling-policies-get-iam-policy", Some(r##"Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-get-iam-policy", @@ -4867,6 +6006,30 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-autoscaling-policies-list", + Some(r##"Lists autoscaling policies in the project."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4874,7 +6037,7 @@ fn main() { Some(false)), ]), ("locations-autoscaling-policies-set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-set-iam-policy", vec![ (Some(r##"resource"##), @@ -4923,6 +6086,36 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-autoscaling-policies-update", + Some(r##"Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-autoscaling-policies-update", + vec![ + (Some(r##"name"##), + None, + Some(r##"Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4935,7 +6128,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}"##), + Some(r##"Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), Some(true), Some(false)), @@ -4963,7 +6158,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -4985,7 +6182,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -5030,12 +6229,14 @@ fn main() { Some(false)), ]), ("locations-workflow-templates-instantiate", - Some(r##"Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty."##), + Some(r##"Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-workflow-templates-instantiate", vec![ (Some(r##"name"##), None, - Some(r##"Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -5058,12 +6259,14 @@ fn main() { Some(false)), ]), ("locations-workflow-templates-instantiate-inline", - Some(r##"Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty."##), + Some(r##"Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-workflow-templates-instantiate-inline", vec![ (Some(r##"parent"##), None, - Some(r##"Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}"##), + Some(r##"Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), Some(true), Some(false)), @@ -5091,7 +6294,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}"##), + Some(r##"Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), Some(true), Some(false)), @@ -5108,7 +6313,7 @@ fn main() { Some(false)), ]), ("locations-workflow-templates-set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_locations-workflow-templates-set-iam-policy", vec![ (Some(r##"resource"##), @@ -5169,7 +6374,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -5185,6 +6392,84 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("regions-autoscaling-policies-create", + Some(r##"Creates new autoscaling policy."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-autoscaling-policies-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("regions-autoscaling-policies-delete", + Some(r##"Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-autoscaling-policies-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("regions-autoscaling-policies-get", + Some(r##"Retrieves autoscaling policy."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-autoscaling-policies-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -5213,6 +6498,30 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("regions-autoscaling-policies-list", + Some(r##"Lists autoscaling policies in the project."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-autoscaling-policies-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -5220,7 +6529,7 @@ fn main() { Some(false)), ]), ("regions-autoscaling-policies-set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-autoscaling-policies-set-iam-policy", vec![ (Some(r##"resource"##), @@ -5269,6 +6578,36 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("regions-autoscaling-policies-update", + Some(r##"Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-autoscaling-policies-update", + vec![ + (Some(r##"name"##), + None, + Some(r##"Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -5276,7 +6615,7 @@ fn main() { Some(false)), ]), ("regions-clusters-create", - Some(r##"Creates a cluster in a project."##), + Some(r##"Creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata)."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-create", vec![ (Some(r##"project-id"##), @@ -5287,7 +6626,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5310,7 +6649,7 @@ fn main() { Some(false)), ]), ("regions-clusters-delete", - Some(r##"Deletes a cluster in a project."##), + Some(r##"Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata)."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-delete", vec![ (Some(r##"project-id"##), @@ -5321,7 +6660,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5344,7 +6683,7 @@ fn main() { Some(false)), ]), ("regions-clusters-diagnose", - Some(r##"Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation."##), + Some(r##"Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, Operation.response contains DiagnoseClusterResults (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults)."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-diagnose", vec![ (Some(r##"project-id"##), @@ -5355,7 +6694,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5395,7 +6734,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5446,7 +6785,7 @@ fn main() { Some(false)), ]), ("regions-clusters-list", - Some(r##"Lists all regions/{region}/clusters in a project."##), + Some(r##"Lists all regions/{region}/clusters in a project alphabetically."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-list", vec![ (Some(r##"project-id"##), @@ -5457,7 +6796,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5474,7 +6813,7 @@ fn main() { Some(false)), ]), ("regions-clusters-patch", - Some(r##"Updates a cluster in a project."##), + Some(r##"Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata)."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-patch", vec![ (Some(r##"project-id"##), @@ -5485,7 +6824,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5514,7 +6853,7 @@ fn main() { Some(false)), ]), ("regions-clusters-set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-set-iam-policy", vec![ (Some(r##"resource"##), @@ -5570,7 +6909,7 @@ fn main() { Some(false)), ]), ("regions-jobs-cancel", - Some(r##"Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get."##), + Some(r##"Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get)."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-jobs-cancel", vec![ (Some(r##"project-id"##), @@ -5581,7 +6920,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5621,7 +6960,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5655,7 +6994,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5717,7 +7056,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5745,7 +7084,7 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5774,7 +7113,7 @@ fn main() { Some(false)), ]), ("regions-jobs-set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-jobs-set-iam-policy", vec![ (Some(r##"resource"##), @@ -5813,7 +7152,41 @@ fn main() { (Some(r##"region"##), None, - Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Dataproc region in which to handle the request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("regions-jobs-submit-as-operation", + Some(r##"Submits job to a cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-jobs-submit-as-operation", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Required. The ID of the Google Cloud Platform project that the job belongs to."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Required. The Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -5980,7 +7353,7 @@ fn main() { Some(false)), ]), ("regions-operations-set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-operations-set-iam-policy", vec![ (Some(r##"resource"##), @@ -6041,7 +7414,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}"##), + Some(r##"Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), Some(true), Some(false)), @@ -6069,7 +7444,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -6091,7 +7468,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -6136,12 +7515,14 @@ fn main() { Some(false)), ]), ("regions-workflow-templates-instantiate", - Some(r##"Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty."##), + Some(r##"Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-workflow-templates-instantiate", vec![ (Some(r##"name"##), None, - Some(r##"Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -6164,12 +7545,14 @@ fn main() { Some(false)), ]), ("regions-workflow-templates-instantiate-inline", - Some(r##"Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty."##), + Some(r##"Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-workflow-templates-instantiate-inline", vec![ (Some(r##"parent"##), None, - Some(r##"Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}"##), + Some(r##"Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), Some(true), Some(false)), @@ -6197,7 +7580,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}"##), + Some(r##"Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}"##), Some(true), Some(false)), @@ -6214,7 +7599,7 @@ fn main() { Some(false)), ]), ("regions-workflow-templates-set-iam-policy", - Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy."##), + Some(r##"Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-workflow-templates-set-iam-policy", vec![ (Some(r##"resource"##), @@ -6275,7 +7660,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}"##), + Some(r##"Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}"##), Some(true), Some(false)), @@ -6303,7 +7690,7 @@ fn main() { let mut app = App::new("dataproc1") .author("Sebastian Thiel ") - .version("1.0.12+20190620") + .version("1.0.13+20200323") .about("Manages Hadoop-based clusters and jobs on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dataproc1_cli") .arg(Arg::with_name("url") diff --git a/gen/dataproc1/Cargo.toml b/gen/dataproc1/Cargo.toml index 50ee8c5c11..c52ac10cfd 100644 --- a/gen/dataproc1/Cargo.toml +++ b/gen/dataproc1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dataproc1" -version = "1.0.12+20190620" +version = "1.0.13+20200323" authors = ["Sebastian Thiel "] description = "A complete library to interact with Dataproc (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dataproc1" homepage = "https://cloud.google.com/dataproc/" -documentation = "https://docs.rs/google-dataproc1/1.0.12+20190620" +documentation = "https://docs.rs/google-dataproc1/1.0.13+20200323" license = "MIT" keywords = ["dataproc", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dataproc1/README.md b/gen/dataproc1/README.md index 048cd997e8..f27cb980d1 100644 --- a/gen/dataproc1/README.md +++ b/gen/dataproc1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-dataproc1` library allows access to all features of the *Google Dataproc* service. -This documentation was generated from *Dataproc* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Dataproc* crate version *1.0.13+20200323*, where *20200323* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Dataproc* *v1* API can be found at the [official documentation site](https://cloud.google.com/dataproc/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.Dataproc.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.Dataproc.html) ... * projects - * [*locations autoscaling policies get iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationAutoscalingPolicyGetIamPolicyCall.html), [*locations autoscaling policies set iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html), [*locations autoscaling policies test iam permissions*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationAutoscalingPolicyTestIamPermissionCall.html), [*locations workflow templates create*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateCreateCall.html), [*locations workflow templates delete*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateDeleteCall.html), [*locations workflow templates get*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateGetCall.html), [*locations workflow templates get iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateGetIamPolicyCall.html), [*locations workflow templates instantiate*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateInstantiateCall.html), [*locations workflow templates instantiate inline*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html), [*locations workflow templates list*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateListCall.html), [*locations workflow templates set iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html), [*locations workflow templates test iam permissions*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateTestIamPermissionCall.html), [*locations workflow templates update*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectLocationWorkflowTemplateUpdateCall.html), [*regions autoscaling policies get iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionAutoscalingPolicyGetIamPolicyCall.html), [*regions autoscaling policies set iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html), [*regions autoscaling policies test iam permissions*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionAutoscalingPolicyTestIamPermissionCall.html), [*regions clusters create*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterGetCall.html), [*regions clusters get iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterGetIamPolicyCall.html), [*regions clusters list*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterPatchCall.html), [*regions clusters set iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterSetIamPolicyCall.html), [*regions clusters test iam permissions*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionClusterTestIamPermissionCall.html), [*regions jobs cancel*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobGetCall.html), [*regions jobs get iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobGetIamPolicyCall.html), [*regions jobs list*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobListCall.html), [*regions jobs patch*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobPatchCall.html), [*regions jobs set iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobSetIamPolicyCall.html), [*regions jobs submit*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobSubmitCall.html), [*regions jobs test iam permissions*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionJobTestIamPermissionCall.html), [*regions operations cancel*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionOperationGetCall.html), [*regions operations get iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionOperationGetIamPolicyCall.html), [*regions operations list*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionOperationListCall.html), [*regions operations set iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionOperationSetIamPolicyCall.html), [*regions operations test iam permissions*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionOperationTestIamPermissionCall.html), [*regions workflow templates create*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateCreateCall.html), [*regions workflow templates delete*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateDeleteCall.html), [*regions workflow templates get*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateGetCall.html), [*regions workflow templates get iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateGetIamPolicyCall.html), [*regions workflow templates instantiate*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateInstantiateCall.html), [*regions workflow templates instantiate inline*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html), [*regions workflow templates list*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateListCall.html), [*regions workflow templates set iam policy*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html), [*regions workflow templates test iam permissions*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateTestIamPermissionCall.html) and [*regions workflow templates update*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.ProjectRegionWorkflowTemplateUpdateCall.html) + * [*locations autoscaling policies create*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicyCreateCall.html), [*locations autoscaling policies delete*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicyDeleteCall.html), [*locations autoscaling policies get*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicyGetCall.html), [*locations autoscaling policies get iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicyGetIamPolicyCall.html), [*locations autoscaling policies list*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicyListCall.html), [*locations autoscaling policies set iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html), [*locations autoscaling policies test iam permissions*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicyTestIamPermissionCall.html), [*locations autoscaling policies update*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationAutoscalingPolicyUpdateCall.html), [*locations workflow templates create*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateCreateCall.html), [*locations workflow templates delete*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateDeleteCall.html), [*locations workflow templates get*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateGetCall.html), [*locations workflow templates get iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateGetIamPolicyCall.html), [*locations workflow templates instantiate*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateInstantiateCall.html), [*locations workflow templates instantiate inline*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html), [*locations workflow templates list*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateListCall.html), [*locations workflow templates set iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html), [*locations workflow templates test iam permissions*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateTestIamPermissionCall.html), [*locations workflow templates update*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectLocationWorkflowTemplateUpdateCall.html), [*regions autoscaling policies create*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicyCreateCall.html), [*regions autoscaling policies delete*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicyDeleteCall.html), [*regions autoscaling policies get*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicyGetCall.html), [*regions autoscaling policies get iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicyGetIamPolicyCall.html), [*regions autoscaling policies list*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicyListCall.html), [*regions autoscaling policies set iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html), [*regions autoscaling policies test iam permissions*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicyTestIamPermissionCall.html), [*regions autoscaling policies update*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionAutoscalingPolicyUpdateCall.html), [*regions clusters create*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterGetCall.html), [*regions clusters get iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterGetIamPolicyCall.html), [*regions clusters list*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterPatchCall.html), [*regions clusters set iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterSetIamPolicyCall.html), [*regions clusters test iam permissions*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionClusterTestIamPermissionCall.html), [*regions jobs cancel*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobGetCall.html), [*regions jobs get iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobGetIamPolicyCall.html), [*regions jobs list*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobListCall.html), [*regions jobs patch*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobPatchCall.html), [*regions jobs set iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobSetIamPolicyCall.html), [*regions jobs submit*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobSubmitCall.html), [*regions jobs submit as operation*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobSubmitAsOperationCall.html), [*regions jobs test iam permissions*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionJobTestIamPermissionCall.html), [*regions operations cancel*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionOperationGetCall.html), [*regions operations get iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionOperationGetIamPolicyCall.html), [*regions operations list*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionOperationListCall.html), [*regions operations set iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionOperationSetIamPolicyCall.html), [*regions operations test iam permissions*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionOperationTestIamPermissionCall.html), [*regions workflow templates create*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateCreateCall.html), [*regions workflow templates delete*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateDeleteCall.html), [*regions workflow templates get*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateGetCall.html), [*regions workflow templates get iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateGetIamPolicyCall.html), [*regions workflow templates instantiate*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateInstantiateCall.html), [*regions workflow templates instantiate inline*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html), [*regions workflow templates list*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateListCall.html), [*regions workflow templates set iam policy*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html), [*regions workflow templates test iam permissions*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateTestIamPermissionCall.html) and [*regions workflow templates update*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.ProjectRegionWorkflowTemplateUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/struct.Dataproc.html)** +* **[Hub](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/struct.Dataproc.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -143,17 +143,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -163,29 +163,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dataproc1/1.0.12+20190620/google_dataproc1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dataproc1/1.0.13+20200323/google_dataproc1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dataproc1/src/lib.rs b/gen/dataproc1/src/lib.rs index 19a44679d0..2048502dad 100644 --- a/gen/dataproc1/src/lib.rs +++ b/gen/dataproc1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Dataproc* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Dataproc* crate version *1.0.13+20200323*, where *20200323* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Dataproc* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/dataproc/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Dataproc.html) ... //! //! * projects -//! * [*locations autoscaling policies get iam policy*](struct.ProjectLocationAutoscalingPolicyGetIamPolicyCall.html), [*locations autoscaling policies set iam policy*](struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html), [*locations autoscaling policies test iam permissions*](struct.ProjectLocationAutoscalingPolicyTestIamPermissionCall.html), [*locations workflow templates create*](struct.ProjectLocationWorkflowTemplateCreateCall.html), [*locations workflow templates delete*](struct.ProjectLocationWorkflowTemplateDeleteCall.html), [*locations workflow templates get*](struct.ProjectLocationWorkflowTemplateGetCall.html), [*locations workflow templates get iam policy*](struct.ProjectLocationWorkflowTemplateGetIamPolicyCall.html), [*locations workflow templates instantiate*](struct.ProjectLocationWorkflowTemplateInstantiateCall.html), [*locations workflow templates instantiate inline*](struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html), [*locations workflow templates list*](struct.ProjectLocationWorkflowTemplateListCall.html), [*locations workflow templates set iam policy*](struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html), [*locations workflow templates test iam permissions*](struct.ProjectLocationWorkflowTemplateTestIamPermissionCall.html), [*locations workflow templates update*](struct.ProjectLocationWorkflowTemplateUpdateCall.html), [*regions autoscaling policies get iam policy*](struct.ProjectRegionAutoscalingPolicyGetIamPolicyCall.html), [*regions autoscaling policies set iam policy*](struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html), [*regions autoscaling policies test iam permissions*](struct.ProjectRegionAutoscalingPolicyTestIamPermissionCall.html), [*regions clusters create*](struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](struct.ProjectRegionClusterGetCall.html), [*regions clusters get iam policy*](struct.ProjectRegionClusterGetIamPolicyCall.html), [*regions clusters list*](struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](struct.ProjectRegionClusterPatchCall.html), [*regions clusters set iam policy*](struct.ProjectRegionClusterSetIamPolicyCall.html), [*regions clusters test iam permissions*](struct.ProjectRegionClusterTestIamPermissionCall.html), [*regions jobs cancel*](struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](struct.ProjectRegionJobGetCall.html), [*regions jobs get iam policy*](struct.ProjectRegionJobGetIamPolicyCall.html), [*regions jobs list*](struct.ProjectRegionJobListCall.html), [*regions jobs patch*](struct.ProjectRegionJobPatchCall.html), [*regions jobs set iam policy*](struct.ProjectRegionJobSetIamPolicyCall.html), [*regions jobs submit*](struct.ProjectRegionJobSubmitCall.html), [*regions jobs test iam permissions*](struct.ProjectRegionJobTestIamPermissionCall.html), [*regions operations cancel*](struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](struct.ProjectRegionOperationGetCall.html), [*regions operations get iam policy*](struct.ProjectRegionOperationGetIamPolicyCall.html), [*regions operations list*](struct.ProjectRegionOperationListCall.html), [*regions operations set iam policy*](struct.ProjectRegionOperationSetIamPolicyCall.html), [*regions operations test iam permissions*](struct.ProjectRegionOperationTestIamPermissionCall.html), [*regions workflow templates create*](struct.ProjectRegionWorkflowTemplateCreateCall.html), [*regions workflow templates delete*](struct.ProjectRegionWorkflowTemplateDeleteCall.html), [*regions workflow templates get*](struct.ProjectRegionWorkflowTemplateGetCall.html), [*regions workflow templates get iam policy*](struct.ProjectRegionWorkflowTemplateGetIamPolicyCall.html), [*regions workflow templates instantiate*](struct.ProjectRegionWorkflowTemplateInstantiateCall.html), [*regions workflow templates instantiate inline*](struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html), [*regions workflow templates list*](struct.ProjectRegionWorkflowTemplateListCall.html), [*regions workflow templates set iam policy*](struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html), [*regions workflow templates test iam permissions*](struct.ProjectRegionWorkflowTemplateTestIamPermissionCall.html) and [*regions workflow templates update*](struct.ProjectRegionWorkflowTemplateUpdateCall.html) +//! * [*locations autoscaling policies create*](struct.ProjectLocationAutoscalingPolicyCreateCall.html), [*locations autoscaling policies delete*](struct.ProjectLocationAutoscalingPolicyDeleteCall.html), [*locations autoscaling policies get*](struct.ProjectLocationAutoscalingPolicyGetCall.html), [*locations autoscaling policies get iam policy*](struct.ProjectLocationAutoscalingPolicyGetIamPolicyCall.html), [*locations autoscaling policies list*](struct.ProjectLocationAutoscalingPolicyListCall.html), [*locations autoscaling policies set iam policy*](struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html), [*locations autoscaling policies test iam permissions*](struct.ProjectLocationAutoscalingPolicyTestIamPermissionCall.html), [*locations autoscaling policies update*](struct.ProjectLocationAutoscalingPolicyUpdateCall.html), [*locations workflow templates create*](struct.ProjectLocationWorkflowTemplateCreateCall.html), [*locations workflow templates delete*](struct.ProjectLocationWorkflowTemplateDeleteCall.html), [*locations workflow templates get*](struct.ProjectLocationWorkflowTemplateGetCall.html), [*locations workflow templates get iam policy*](struct.ProjectLocationWorkflowTemplateGetIamPolicyCall.html), [*locations workflow templates instantiate*](struct.ProjectLocationWorkflowTemplateInstantiateCall.html), [*locations workflow templates instantiate inline*](struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html), [*locations workflow templates list*](struct.ProjectLocationWorkflowTemplateListCall.html), [*locations workflow templates set iam policy*](struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html), [*locations workflow templates test iam permissions*](struct.ProjectLocationWorkflowTemplateTestIamPermissionCall.html), [*locations workflow templates update*](struct.ProjectLocationWorkflowTemplateUpdateCall.html), [*regions autoscaling policies create*](struct.ProjectRegionAutoscalingPolicyCreateCall.html), [*regions autoscaling policies delete*](struct.ProjectRegionAutoscalingPolicyDeleteCall.html), [*regions autoscaling policies get*](struct.ProjectRegionAutoscalingPolicyGetCall.html), [*regions autoscaling policies get iam policy*](struct.ProjectRegionAutoscalingPolicyGetIamPolicyCall.html), [*regions autoscaling policies list*](struct.ProjectRegionAutoscalingPolicyListCall.html), [*regions autoscaling policies set iam policy*](struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html), [*regions autoscaling policies test iam permissions*](struct.ProjectRegionAutoscalingPolicyTestIamPermissionCall.html), [*regions autoscaling policies update*](struct.ProjectRegionAutoscalingPolicyUpdateCall.html), [*regions clusters create*](struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](struct.ProjectRegionClusterGetCall.html), [*regions clusters get iam policy*](struct.ProjectRegionClusterGetIamPolicyCall.html), [*regions clusters list*](struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](struct.ProjectRegionClusterPatchCall.html), [*regions clusters set iam policy*](struct.ProjectRegionClusterSetIamPolicyCall.html), [*regions clusters test iam permissions*](struct.ProjectRegionClusterTestIamPermissionCall.html), [*regions jobs cancel*](struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](struct.ProjectRegionJobGetCall.html), [*regions jobs get iam policy*](struct.ProjectRegionJobGetIamPolicyCall.html), [*regions jobs list*](struct.ProjectRegionJobListCall.html), [*regions jobs patch*](struct.ProjectRegionJobPatchCall.html), [*regions jobs set iam policy*](struct.ProjectRegionJobSetIamPolicyCall.html), [*regions jobs submit*](struct.ProjectRegionJobSubmitCall.html), [*regions jobs submit as operation*](struct.ProjectRegionJobSubmitAsOperationCall.html), [*regions jobs test iam permissions*](struct.ProjectRegionJobTestIamPermissionCall.html), [*regions operations cancel*](struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](struct.ProjectRegionOperationGetCall.html), [*regions operations get iam policy*](struct.ProjectRegionOperationGetIamPolicyCall.html), [*regions operations list*](struct.ProjectRegionOperationListCall.html), [*regions operations set iam policy*](struct.ProjectRegionOperationSetIamPolicyCall.html), [*regions operations test iam permissions*](struct.ProjectRegionOperationTestIamPermissionCall.html), [*regions workflow templates create*](struct.ProjectRegionWorkflowTemplateCreateCall.html), [*regions workflow templates delete*](struct.ProjectRegionWorkflowTemplateDeleteCall.html), [*regions workflow templates get*](struct.ProjectRegionWorkflowTemplateGetCall.html), [*regions workflow templates get iam policy*](struct.ProjectRegionWorkflowTemplateGetIamPolicyCall.html), [*regions workflow templates instantiate*](struct.ProjectRegionWorkflowTemplateInstantiateCall.html), [*regions workflow templates instantiate inline*](struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html), [*regions workflow templates list*](struct.ProjectRegionWorkflowTemplateListCall.html), [*regions workflow templates set iam policy*](struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html), [*regions workflow templates test iam permissions*](struct.ProjectRegionWorkflowTemplateTestIamPermissionCall.html) and [*regions workflow templates update*](struct.ProjectRegionWorkflowTemplateUpdateCall.html) //! //! //! @@ -342,7 +342,7 @@ impl<'a, C, A> Dataproc Dataproc { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://dataproc.googleapis.com/".to_string(), _root_url: "https://dataproc.googleapis.com/".to_string(), } @@ -353,7 +353,7 @@ impl<'a, C, A> Dataproc } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -381,7 +381,7 @@ impl<'a, C, A> Dataproc // ############ // SCHEMAS ### // ########## -/// A Cloud Dataproc job for running Apache Spark SQL (http://spark.apache.org/sql/) queries. +/// A Dataproc job for running Apache Spark SQL (http://spark.apache.org/sql/) queries. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -402,203 +402,86 @@ pub struct SparkSqlJob { /// A list of queries. #[serde(rename="queryList")] pub query_list: Option, - /// Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. + /// Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Dataproc API may be overwritten. pub properties: Option>, } impl Part for SparkSqlJob {} -/// Job scheduling options. +/// A Dataproc job for running Apache Hadoop MapReduce (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop YARN (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobScheduling { - /// Optional. Maximum number of times per hour a driver may be restarted as a result of driver terminating with non-zero code before job is reported failed.A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window.Maximum value is 10. - #[serde(rename="maxFailuresPerHour")] - pub max_failures_per_hour: Option, +pub struct HadoopJob { + /// Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks. + #[serde(rename="jarFileUris")] + pub jar_file_uris: Option>, + /// Optional. The runtime log config for job execution. + #[serde(rename="loggingConfig")] + pub logging_config: Option, + /// Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a collision may occur that causes an incorrect job submission. + pub args: Option>, + /// Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for naively parallel tasks. + #[serde(rename="fileUris")] + pub file_uris: Option>, + /// The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris. + #[serde(rename="mainClass")] + pub main_class: Option, + /// Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, or .zip. + #[serde(rename="archiveUris")] + pub archive_uris: Option>, + /// The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' + #[serde(rename="mainJarFileUri")] + pub main_jar_file_uri: Option, + /// Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code. + pub properties: Option>, } -impl Part for JobScheduling {} +impl Part for HadoopJob {} -/// Optional. The config settings for Compute Engine resources in an instance group, such as a master or worker group. +/// Basic algorithm for autoscaling. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InstanceGroupConfig { - /// Optional. Specifies that this instance group contains preemptible instances. - #[serde(rename="isPreemptible")] - pub is_preemptible: Option, - /// Optional. The Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples: - /// https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 - /// projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 - /// n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc Auto Zone Placement feature, you must use the short name of the machine type resource, for example, n1-standard-2. - #[serde(rename="machineTypeUri")] - pub machine_type_uri: Option, - /// Output only. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group. - #[serde(rename="instanceNames")] - pub instance_names: Option>, - /// Optional. The Compute Engine image resource used for cluster instances. It can be specified or may be inferred from SoftwareConfig.image_version. - #[serde(rename="imageUri")] - pub image_uri: Option, - /// Optional. The Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be changed before final release. - pub accelerators: Option>, - /// Output only. The config for Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. - #[serde(rename="managedGroupConfig")] - pub managed_group_config: Option, - /// Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1. - #[serde(rename="numInstances")] - pub num_instances: Option, - /// Optional. Disk option config settings. - #[serde(rename="diskConfig")] - pub disk_config: Option, +pub struct BasicAutoscalingAlgorithm { + /// Required. YARN autoscaling configuration. + #[serde(rename="yarnConfig")] + pub yarn_config: Option, + /// Optional. Duration between scaling events. A scaling period starts after the update operation from the previous event has completed.Bounds: 2m, 1d. Default: 2m. + #[serde(rename="cooldownPeriod")] + pub cooldown_period: Option, } -impl Part for InstanceGroupConfig {} +impl Part for BasicAutoscalingAlgorithm {} -/// A configurable parameter that replaces one or more fields in the template. Parameterizable fields: - Labels - File uris - Job properties - Job arguments - Script variables - Main class (in HadoopJob and SparkJob) - Zone (in ClusterSelector) -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TemplateParameter { - /// Required. Paths to all fields that the parameter replaces. A field is allowed to appear in at most one parameter's list of field paths.A field path is similar in syntax to a google.protobuf.FieldMask. For example, a field path that references the zone field of a workflow template's cluster selector would be specified as placement.clusterSelector.zone.Also, field paths can reference fields using the following syntax: - /// Values in maps can be referenced by key: - /// labels'key' - /// placement.clusterSelector.clusterLabels'key' - /// placement.managedCluster.labels'key' - /// placement.clusterSelector.clusterLabels'key' - /// jobs'step-id'.labels'key' - /// Jobs in the jobs list can be referenced by step-id: - /// jobs'step-id'.hadoopJob.mainJarFileUri - /// jobs'step-id'.hiveJob.queryFileUri - /// jobs'step-id'.pySparkJob.mainPythonFileUri - /// jobs'step-id'.hadoopJob.jarFileUris0 - /// jobs'step-id'.hadoopJob.archiveUris0 - /// jobs'step-id'.hadoopJob.fileUris0 - /// jobs'step-id'.pySparkJob.pythonFileUris0 - /// Items in repeated fields can be referenced by a zero-based index: - /// jobs'step-id'.sparkJob.args0 - /// Other examples: - /// jobs'step-id'.hadoopJob.properties'key' - /// jobs'step-id'.hadoopJob.args0 - /// jobs'step-id'.hiveJob.scriptVariables'key' - /// jobs'step-id'.hadoopJob.mainJarFileUri - /// placement.clusterSelector.zoneIt may not be possible to parameterize maps and repeated fields in their entirety since only individual map values and individual items in repeated fields can be referenced. For example, the following field paths are invalid: - /// placement.clusterSelector.clusterLabels - /// jobs'step-id'.sparkJob.args - pub fields: Option>, - /// Optional. Validation rules to be applied to this parameter's value. - pub validation: Option, - /// Optional. Brief description of the parameter. Must not exceed 1024 characters. - pub description: Option, - /// Required. Parameter name. The parameter name is used as the key, and paired with the parameter value, which are passed to the template when the template is instantiated. The name must contain only capital letters (A-Z), numbers (0-9), and underscores (_), and must not start with a number. The maximum length is 40 characters. - pub name: Option, -} - -impl Part for TemplateParameter {} - - -/// A YARN application created by a job. Application information is a subset of org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.Beta Feature: This report is available for testing purposes only. It may be changed before final release. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct YarnApplication { - /// Required. The numerical progress of the application, from 1 to 100. - pub progress: Option, - /// Required. The application state. - pub state: Option, - /// Required. The application name. - pub name: Option, - /// Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the internal hostname, and requires a proxy server for resolution and, possibly, access. - #[serde(rename="trackingUrl")] - pub tracking_url: Option, -} - -impl Part for YarnApplication {} - - -/// Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.A Policy consists of a list of bindings. A binding binds a list of members to a role, where the members can be user accounts, Google groups, Google domains, and service accounts. A role is a named list of permissions defined by IAM.JSON Example -/// { -/// "bindings": [ -/// { -/// "role": "roles/owner", -/// "members": [ -/// "user:mike@example.com", -/// "group:admins@example.com", -/// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" -/// ] -/// }, -/// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); /// } -/// ] -/// } -/// YAML Example -/// bindings: -/// -/// * members: -/// * user:mike@example.com -/// * group:admins@example.com -/// * domain:google.com -/// * serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner -/// * members: -/// * user:sean@example.com -/// role: roles/viewer -/// For a description of IAM and its features, see the IAM developer's guide (https://cloud.google.com/iam/docs). +/// The JSON representation for Empty is empty JSON object {}. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [regions clusters get iam policy projects](struct.ProjectRegionClusterGetIamPolicyCall.html) (response) -/// * [regions workflow templates set iam policy projects](struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html) (response) -/// * [regions clusters set iam policy projects](struct.ProjectRegionClusterSetIamPolicyCall.html) (response) -/// * [regions workflow templates get iam policy projects](struct.ProjectRegionWorkflowTemplateGetIamPolicyCall.html) (response) -/// * [regions jobs get iam policy projects](struct.ProjectRegionJobGetIamPolicyCall.html) (response) -/// * [locations autoscaling policies set iam policy projects](struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html) (response) -/// * [locations autoscaling policies get iam policy projects](struct.ProjectLocationAutoscalingPolicyGetIamPolicyCall.html) (response) -/// * [regions autoscaling policies get iam policy projects](struct.ProjectRegionAutoscalingPolicyGetIamPolicyCall.html) (response) -/// * [regions operations get iam policy projects](struct.ProjectRegionOperationGetIamPolicyCall.html) (response) -/// * [regions operations set iam policy projects](struct.ProjectRegionOperationSetIamPolicyCall.html) (response) -/// * [locations workflow templates set iam policy projects](struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html) (response) -/// * [regions jobs set iam policy projects](struct.ProjectRegionJobSetIamPolicyCall.html) (response) -/// * [locations workflow templates get iam policy projects](struct.ProjectLocationWorkflowTemplateGetIamPolicyCall.html) (response) -/// * [regions autoscaling policies set iam policy projects](struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html) (response) -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Policy { - /// Associates a list of members to a role. bindings with no members will result in an error. - pub bindings: Option>, - /// etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy.If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten blindly. - pub etag: Option, - /// Deprecated. - pub version: Option, -} - -impl ResponseResult for Policy {} - - -/// Security related configuration, including Kerberos. -/// -/// This type is not used in any activity, and only used as *part* of another schema. +/// * [locations autoscaling policies delete projects](struct.ProjectLocationAutoscalingPolicyDeleteCall.html) (response) +/// * [regions operations cancel projects](struct.ProjectRegionOperationCancelCall.html) (response) +/// * [regions autoscaling policies delete projects](struct.ProjectRegionAutoscalingPolicyDeleteCall.html) (response) +/// * [regions operations delete projects](struct.ProjectRegionOperationDeleteCall.html) (response) +/// * [regions workflow templates delete projects](struct.ProjectRegionWorkflowTemplateDeleteCall.html) (response) +/// * [regions jobs delete projects](struct.ProjectRegionJobDeleteCall.html) (response) +/// * [locations workflow templates delete projects](struct.ProjectLocationWorkflowTemplateDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SecurityConfig { - /// Kerberos related configuration. - #[serde(rename="kerberosConfig")] - pub kerberos_config: Option, -} +pub struct Empty { _never_set: Option } -impl Part for SecurityConfig {} +impl ResponseResult for Empty {} /// The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details.You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors). @@ -668,6 +551,9 @@ pub struct GceClusterConfig { /// Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each instance. This internal_ip_only restriction can only be enabled for subnetwork enabled networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses. #[serde(rename="internalIpOnly")] pub internal_ip_only: Option, + /// Optional. Reservation Affinity for consuming Zonal reservation. + #[serde(rename="reservationAffinity")] + pub reservation_affinity: Option, /// Optional. The Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor subnetwork_uri is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see Using Subnetworks for more information).A full URL, partial URI, or short name are valid. Examples: /// https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default /// projects/[project_id]/regions/global/default @@ -676,12 +562,10 @@ pub struct GceClusterConfig { pub network_uri: Option, /// The Compute Engine tags to add to all instances (see Tagging instances). pub tags: Option>, - /// Optional. The service account of the instances. Defaults to the default Compute Engine service account. Custom service accounts need permissions equivalent to the following IAM roles: - /// roles/logging.logWriter - /// roles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: [account_id]@[project_id].iam.gserviceaccount.com + /// Optional. The Dataproc service account (also see VM Data Plane identity) used by Dataproc cluster VM instances to access Google Cloud Platform services.If not specified, the Compute Engine default service account is used. #[serde(rename="serviceAccount")] pub service_account: Option, - /// Optional. The zone where the Compute Engine cluster will be located. On a create request, it is required in the "global" region. If omitted in a non-global Cloud Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be present.A full URL, partial URI, or short name are valid. Examples: + /// Optional. The zone where the Compute Engine cluster will be located. On a create request, it is required in the "global" region. If omitted in a non-global Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be present.A full URL, partial URI, or short name are valid. Examples: /// https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] /// projects/[project_id]/zones/[zone] /// us-central1-f @@ -710,41 +594,27 @@ pub struct GceClusterConfig { impl Part for GceClusterConfig {} -/// Specifies the type and number of accelerator cards attached to the instances of an instance. See GPUs on Compute Engine. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AcceleratorConfig { - /// The number of the accelerator cards of this type exposed to this instance. - #[serde(rename="acceleratorCount")] - pub accelerator_count: Option, - /// Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Compute Engine AcceleratorTypes.Examples: - /// https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 - /// projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 - /// nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud Dataproc Auto Zone Placement feature, you must use the short name of the accelerator type resource, for example, nvidia-tesla-k80. - #[serde(rename="acceleratorTypeUri")] - pub accelerator_type_uri: Option, -} - -impl Part for AcceleratorConfig {} - - /// The cluster config. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClusterConfig { + /// Optional. Lifecycle setting for the cluster. + #[serde(rename="lifecycleConfig")] + pub lifecycle_config: Option, /// Optional. The config settings for software inside the cluster. #[serde(rename="softwareConfig")] pub software_config: Option, - /// Optional. A Google Cloud Storage bucket used to stage job dependencies, config files, and job driver console output. If you do not specify a staging bucket, Cloud Dataproc will determine a Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Google Compute Engine zone where your cluster is deployed, and then create and manage this project-level, per-location bucket (see Cloud Dataproc staging bucket). + /// Optional. A Cloud Storage bucket used to stage job dependencies, config files, and job driver console output. If you do not specify a staging bucket, Cloud Dataproc will determine a Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Compute Engine zone where your cluster is deployed, and then create and manage this project-level, per-location bucket (see Dataproc staging bucket). #[serde(rename="configBucket")] pub config_bucket: Option, /// Optional. The shared Compute Engine config settings for all instances in a cluster. #[serde(rename="gceClusterConfig")] pub gce_cluster_config: Option, + /// Optional. Autoscaling config for the policy associated with the cluster. Cluster does not autoscale if this field is unset. + #[serde(rename="autoscalingConfig")] + pub autoscaling_config: Option, /// Optional. The Compute Engine config settings for worker instances in a cluster. #[serde(rename="workerConfig")] pub worker_config: Option, @@ -776,25 +646,46 @@ pub struct ClusterConfig { impl Part for ClusterConfig {} -/// A request to submit a job. +/// The config settings for Compute Engine resources in an instance group, such as a master or worker group. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [regions jobs submit projects](struct.ProjectRegionJobSubmitCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SubmitJobRequest { - /// Required. The job resource. - pub job: Option, - /// Optional. A unique id used to identify the request. If the server receives two SubmitJobRequest requests with the same id, then the second request will be ignored and the first Job created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - #[serde(rename="requestId")] - pub request_id: Option, +pub struct InstanceGroupConfig { + /// Output only. Specifies that this instance group contains preemptible instances. + #[serde(rename="isPreemptible")] + pub is_preemptible: Option, + /// Optional. Specifies the preemptibility of the instance group.The default value for master and worker groups is NON_PREEMPTIBLE. This default cannot be changed.The default value for secondary instances is PREEMPTIBLE. + pub preemptibility: Option, + /// Optional. The Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples: + /// https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + /// projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + /// n1-standard-2Auto Zone Exception: If you are using the Dataproc Auto Zone Placement feature, you must use the short name of the machine type resource, for example, n1-standard-2. + #[serde(rename="machineTypeUri")] + pub machine_type_uri: Option, + /// Output only. The list of instance names. Dataproc derives the names from cluster_name, num_instances, and the instance group. + #[serde(rename="instanceNames")] + pub instance_names: Option>, + /// Optional. The Compute Engine image resource used for cluster instances. It can be specified or may be inferred from SoftwareConfig.image_version. + #[serde(rename="imageUri")] + pub image_uri: Option, + /// Optional. The Compute Engine accelerator configuration for these instances. + pub accelerators: Option>, + /// Output only. The config for Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. + #[serde(rename="managedGroupConfig")] + pub managed_group_config: Option, + /// Optional. Specifies the minimum cpu platform for the Instance Group. See Dataproc→Minimum CPU Platform. + #[serde(rename="minCpuPlatform")] + pub min_cpu_platform: Option, + /// Optional. Disk option config settings. + #[serde(rename="diskConfig")] + pub disk_config: Option, + /// Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1. + #[serde(rename="numInstances")] + pub num_instances: Option, } -impl RequestValue for SubmitJobRequest {} +impl Part for InstanceGroupConfig {} /// A list of queries to run on a cluster. @@ -839,151 +730,35 @@ pub struct DiskConfig { impl Part for DiskConfig {} -/// A Cloud Dataproc workflow template resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations workflow templates create projects](struct.ProjectLocationWorkflowTemplateCreateCall.html) (request|response) -/// * [regions workflow templates create projects](struct.ProjectRegionWorkflowTemplateCreateCall.html) (request|response) -/// * [regions workflow templates instantiate inline projects](struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html) (request) -/// * [regions workflow templates update projects](struct.ProjectRegionWorkflowTemplateUpdateCall.html) (request|response) -/// * [locations workflow templates instantiate inline projects](struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html) (request) -/// * [locations workflow templates get projects](struct.ProjectLocationWorkflowTemplateGetCall.html) (response) -/// * [locations workflow templates update projects](struct.ProjectLocationWorkflowTemplateUpdateCall.html) (request|response) -/// * [regions workflow templates get projects](struct.ProjectRegionWorkflowTemplateGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct WorkflowTemplate { - /// Output only. The time template was last updated. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Required. The Directed Acyclic Graph of Jobs to submit. - pub jobs: Option>, - /// Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - pub name: Option, - /// Optional. Template parameters whose values are substituted into the template. Values for parameters must be provided when the template is instantiated. - pub parameters: Option>, - /// Optional. The labels to associate with this template. These labels will be propagated to all jobs and clusters created by the workflow instance.Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be associated with a template. - pub labels: Option>, - /// Output only. The time template was created. - #[serde(rename="createTime")] - pub create_time: Option, - /// Optional. Used to perform a consistent read-modify-write.This field should be left blank for a CreateWorkflowTemplate request. It is required for an UpdateWorkflowTemplate request, and must match the current server version. A typical update template flow would fetch the current template with a GetWorkflowTemplate request, which will return the current template with the version field filled in with the current server version. The user updates other fields in the template, then returns it as part of the UpdateWorkflowTemplate request. - pub version: Option, - /// Required. WorkflowTemplate scheduling information. - pub placement: Option, - /// Required. The template id.The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters. - pub id: Option, -} - -impl RequestValue for WorkflowTemplate {} -impl ResponseResult for WorkflowTemplate {} - - -/// A Cloud Dataproc job resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [regions jobs submit projects](struct.ProjectRegionJobSubmitCall.html) (response) -/// * [regions jobs get projects](struct.ProjectRegionJobGetCall.html) (response) -/// * [regions jobs patch projects](struct.ProjectRegionJobPatchCall.html) (request|response) -/// * [regions jobs cancel projects](struct.ProjectRegionJobCancelCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Job { - /// Output only. The job status. Additional application-specific status information may be contained in the type_job and yarn_applications fields. - pub status: Option, - /// Job is a Hadoop job. - #[serde(rename="hadoopJob")] - pub hadoop_job: Option, - /// Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job. - pub labels: Option>, - /// Output only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It may be changed before final release. - #[serde(rename="yarnApplications")] - pub yarn_applications: Option>, - /// Optional. The fully qualified reference to the job, which can be used to obtain the equivalent REST path of the job resource. If this property is not specified when a job is created, the server generates a job_id. - pub reference: Option, - /// Job is a Pig job. - #[serde(rename="pigJob")] - pub pig_job: Option, - /// Output only. A URI pointing to the location of the stdout of the job's driver program. - #[serde(rename="driverOutputResourceUri")] - pub driver_output_resource_uri: Option, - /// Job is a Spark job. - #[serde(rename="sparkJob")] - pub spark_job: Option, - /// Output only. A UUID that uniquely identifies a job within the project over time. This is in contrast to a user-settable reference.job_id that may be reused over time. - #[serde(rename="jobUuid")] - pub job_uuid: Option, - /// Optional. Job scheduling configuration. - pub scheduling: Option, - /// Output only. The previous job status. - #[serde(rename="statusHistory")] - pub status_history: Option>, - /// Job is a SparkSql job. - #[serde(rename="sparkSqlJob")] - pub spark_sql_job: Option, - /// Required. Job information, including how, when, and where to run the job. - pub placement: Option, - /// Output only. If present, the location of miscellaneous control files which may be used as part of job setup and handling. If not present, control files may be placed in the same location as driver_output_uri. - #[serde(rename="driverControlFilesUri")] - pub driver_control_files_uri: Option, - /// Job is a Pyspark job. - #[serde(rename="pysparkJob")] - pub pyspark_job: Option, - /// Job is a Hive job. - #[serde(rename="hiveJob")] - pub hive_job: Option, -} - -impl RequestValue for Job {} -impl ResponseResult for Job {} - - -/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: -/// service Foo { -/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -/// } -/// The JSON representation for Empty is empty JSON object {}. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [regions workflow templates delete projects](struct.ProjectRegionWorkflowTemplateDeleteCall.html) (response) -/// * [regions jobs delete projects](struct.ProjectRegionJobDeleteCall.html) (response) -/// * [regions operations cancel projects](struct.ProjectRegionOperationCancelCall.html) (response) -/// * [locations workflow templates delete projects](struct.ProjectLocationWorkflowTemplateDeleteCall.html) (response) -/// * [regions operations delete projects](struct.ProjectRegionOperationDeleteCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Empty { _never_set: Option } - -impl ResponseResult for Empty {} - - -/// Specifies workflow execution target.Either managed_cluster or cluster_selector is required. +/// A Dataproc job for running Presto (https://prestosql.io/) queries /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct WorkflowTemplatePlacement { - /// Optional. A selector that chooses target cluster for jobs based on metadata.The selector is evaluated at the time each job is submitted. - #[serde(rename="clusterSelector")] - pub cluster_selector: Option, - /// Optional. A cluster that is managed by the workflow. - #[serde(rename="managedCluster")] - pub managed_cluster: Option, +pub struct PrestoJob { + /// The HCFS URI of the script that contains SQL queries. + #[serde(rename="queryFileUri")] + pub query_file_uri: Option, + /// Optional. The format in which query output will be displayed. See the Presto documentation for supported output formats + #[serde(rename="outputFormat")] + pub output_format: Option, + /// Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries. + #[serde(rename="continueOnFailure")] + pub continue_on_failure: Option, + /// Optional. The runtime log config for job execution. + #[serde(rename="loggingConfig")] + pub logging_config: Option, + /// Optional. Presto client tags to attach to this query + #[serde(rename="clientTags")] + pub client_tags: Option>, + /// A list of queries. + #[serde(rename="queryList")] + pub query_list: Option, + /// Optional. A mapping of property names to values. Used to set Presto session properties (https://prestodb.io/docs/current/sql/set-session.html) Equivalent to using the --session flag in the Presto CLI + pub properties: Option>, } -impl Part for WorkflowTemplatePlacement {} +impl Part for PrestoJob {} /// Specifies the resources used to actively manage an instance group. @@ -1003,85 +778,13 @@ pub struct ManagedGroupConfig { impl Part for ManagedGroupConfig {} -/// A job executed by the workflow. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OrderedJob { - /// Job is a Hadoop job. - #[serde(rename="hadoopJob")] - pub hadoop_job: Option, - /// Required. The step id. The id must be unique among all jobs within the template.The step id is used as prefix for job id, as job goog-dataproc-workflow-step-id label, and in prerequisiteStepIds field from other steps.The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters. - #[serde(rename="stepId")] - pub step_id: Option, - /// Job is a SparkSql job. - #[serde(rename="sparkSqlJob")] - pub spark_sql_job: Option, - /// Optional. The optional list of prerequisite job step_ids. If not specified, the job will start at the beginning of workflow. - #[serde(rename="prerequisiteStepIds")] - pub prerequisite_step_ids: Option>, - /// Job is a Pig job. - #[serde(rename="pigJob")] - pub pig_job: Option, - /// Optional. The labels to associate with this job.Label keys must be between 1 and 63 characters long, and must conform to the following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and 63 characters long, and must conform to the following regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be associated with a given job. - pub labels: Option>, - /// Job is a Spark job. - #[serde(rename="sparkJob")] - pub spark_job: Option, - /// Optional. Job scheduling configuration. - pub scheduling: Option, - /// Job is a Pyspark job. - #[serde(rename="pysparkJob")] - pub pyspark_job: Option, - /// Job is a Hive job. - #[serde(rename="hiveJob")] - pub hive_job: Option, -} - -impl Part for OrderedJob {} - - -/// A Cloud Dataproc job for running Apache PySpark (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) applications on YARN. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PySparkJob { - /// Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file. - #[serde(rename="mainPythonFileUri")] - pub main_python_file_uri: Option, - /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks. - #[serde(rename="jarFileUris")] - pub jar_file_uris: Option>, - /// Optional. The runtime log config for job execution. - #[serde(rename="loggingConfig")] - pub logging_config: Option, - /// Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission. - pub args: Option>, - /// Optional. HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks. - #[serde(rename="fileUris")] - pub file_uris: Option>, - /// Optional. HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip. - #[serde(rename="archiveUris")] - pub archive_uris: Option>, - /// Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip. - #[serde(rename="pythonFileUris")] - pub python_file_uris: Option>, - /// Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. - pub properties: Option>, -} - -impl Part for PySparkJob {} - - /// Specifies an executable to run on a fully configured node and a timeout period for executable completion. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NodeInitializationAction { - /// Optional. Amount of time executable has to complete. Default is 10 minutes. Cluster creation fails with an explanatory error message (the name of the executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period. + /// Optional. Amount of time executable has to complete. Default is 10 minutes (see JSON representation of Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)).Cluster creation fails with an explanatory error message (the name of the executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period. #[serde(rename="executionTimeout")] pub execution_timeout: Option, /// Required. Cloud Storage URI of executable file. @@ -1092,28 +795,6 @@ pub struct NodeInitializationAction { impl Part for NodeInitializationAction {} -/// A response to a request to list workflow templates in a project. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations workflow templates list projects](struct.ProjectLocationWorkflowTemplateListCall.html) (response) -/// * [regions workflow templates list projects](struct.ProjectRegionWorkflowTemplateListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListWorkflowTemplatesResponse { - /// Output only. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent ListWorkflowTemplatesRequest. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Output only. WorkflowTemplates list. - pub templates: Option>, -} - -impl ResponseResult for ListWorkflowTemplatesResponse {} - - /// Request message for GetIamPolicy method. /// /// # Activities @@ -1130,57 +811,39 @@ impl ResponseResult for ListWorkflowTemplatesResponse {} /// * [locations workflow templates get iam policy projects](struct.ProjectLocationWorkflowTemplateGetIamPolicyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } +pub struct GetIamPolicyRequest { + /// OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy. This field is only used by Cloud IAM. + pub options: Option, +} impl RequestValue for GetIamPolicyRequest {} -/// Request message for SetIamPolicy method. +/// A Dataproc job for running Apache SparkR (https://spark.apache.org/docs/latest/sparkr.html) applications on YARN. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [regions workflow templates set iam policy projects](struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html) (request) -/// * [regions clusters set iam policy projects](struct.ProjectRegionClusterSetIamPolicyCall.html) (request) -/// * [locations autoscaling policies set iam policy projects](struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html) (request) -/// * [regions operations set iam policy projects](struct.ProjectRegionOperationSetIamPolicyCall.html) (request) -/// * [locations workflow templates set iam policy projects](struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html) (request) -/// * [regions jobs set iam policy projects](struct.ProjectRegionJobSetIamPolicyCall.html) (request) -/// * [regions autoscaling policies set iam policy projects](struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. - pub policy: Option, +pub struct SparkRJob { + /// Optional. HCFS URIs of files to be copied to the working directory of R drivers and distributed tasks. Useful for naively parallel tasks. + #[serde(rename="fileUris")] + pub file_uris: Option>, + /// Optional. The runtime log config for job execution. + #[serde(rename="loggingConfig")] + pub logging_config: Option, + /// Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip. + #[serde(rename="archiveUris")] + pub archive_uris: Option>, + /// Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission. + pub args: Option>, + /// Required. The HCFS URI of the main R file to use as the driver. Must be a .R file. + #[serde(rename="mainRFileUri")] + pub main_r_file_uri: Option, + /// Optional. A mapping of property names to values, used to configure SparkR. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. + pub properties: Option>, } -impl RequestValue for SetIamPolicyRequest {} - - -/// Request message for TestIamPermissions method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [regions workflow templates test iam permissions projects](struct.ProjectRegionWorkflowTemplateTestIamPermissionCall.html) (request) -/// * [regions operations test iam permissions projects](struct.ProjectRegionOperationTestIamPermissionCall.html) (request) -/// * [regions clusters test iam permissions projects](struct.ProjectRegionClusterTestIamPermissionCall.html) (request) -/// * [locations autoscaling policies test iam permissions projects](struct.ProjectLocationAutoscalingPolicyTestIamPermissionCall.html) (request) -/// * [regions autoscaling policies test iam permissions projects](struct.ProjectRegionAutoscalingPolicyTestIamPermissionCall.html) (request) -/// * [locations workflow templates test iam permissions projects](struct.ProjectLocationWorkflowTemplateTestIamPermissionCall.html) (request) -/// * [regions jobs test iam permissions projects](struct.ProjectRegionJobTestIamPermissionCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestIamPermissionsRequest { - /// The set of permissions to check for the resource. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - pub permissions: Option>, -} - -impl RequestValue for TestIamPermissionsRequest {} +impl Part for SparkRJob {} /// A request to instantiate a workflow template. @@ -1207,6 +870,912 @@ pub struct InstantiateWorkflowTemplateRequest { impl RequestValue for InstantiateWorkflowTemplateRequest {} +/// Specifies the cluster auto-delete schedule configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LifecycleConfig { + /// Optional. The time when cluster will be auto-deleted (see JSON representation of Timestamp (https://developers.google.com/protocol-buffers/docs/proto3#json)). + #[serde(rename="autoDeleteTime")] + pub auto_delete_time: Option, + /// Optional. The duration to keep the cluster alive while idling (when no jobs are running). Passing this threshold will cause the cluster to be deleted. Minimum value is 10 minutes; maximum value is 14 days (see JSON representation of Duration (https://developers.google.com/protocol-buffers/docs/proto3#json). + #[serde(rename="idleDeleteTtl")] + pub idle_delete_ttl: Option, + /// Optional. The lifetime duration of cluster. The cluster will be auto-deleted at the end of this period. Minimum value is 10 minutes; maximum value is 14 days (see JSON representation of Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)). + #[serde(rename="autoDeleteTtl")] + pub auto_delete_ttl: Option, + /// Output only. The time when cluster became idle (most recent job finished) and became eligible for deletion due to idleness (see JSON representation of Timestamp (https://developers.google.com/protocol-buffers/docs/proto3#json)). + #[serde(rename="idleStartTime")] + pub idle_start_time: Option, +} + +impl Part for LifecycleConfig {} + + +/// Specifies workflow execution target.Either managed_cluster or cluster_selector is required. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkflowTemplatePlacement { + /// Optional. A selector that chooses target cluster for jobs based on metadata.The selector is evaluated at the time each job is submitted. + #[serde(rename="clusterSelector")] + pub cluster_selector: Option, + /// A cluster that is managed by the workflow. + #[serde(rename="managedCluster")] + pub managed_cluster: Option, +} + +impl Part for WorkflowTemplatePlacement {} + + +/// A list of jobs in a project. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions jobs list projects](struct.ProjectRegionJobListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListJobsResponse { + /// Optional. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent ListJobsRequest. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Output only. Jobs list. + pub jobs: Option>, +} + +impl ResponseResult for ListJobsResponse {} + + +/// A response to a request to list autoscaling policies in a project. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations autoscaling policies list projects](struct.ProjectLocationAutoscalingPolicyListCall.html) (response) +/// * [regions autoscaling policies list projects](struct.ProjectRegionAutoscalingPolicyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAutoscalingPoliciesResponse { + /// Output only. This token is included in the response if there are more results to fetch. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Output only. Autoscaling policies list. + pub policies: Option>, +} + +impl ResponseResult for ListAutoscalingPoliciesResponse {} + + +/// Dataproc job config. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct JobPlacement { + /// Required. The name of the cluster where the job will be submitted. + #[serde(rename="clusterName")] + pub cluster_name: Option, + /// Output only. A cluster UUID generated by the Dataproc service when the job is submitted. + #[serde(rename="clusterUuid")] + pub cluster_uuid: Option, +} + +impl Part for JobPlacement {} + + +/// A Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HiveJob { + /// The HCFS URI of the script that contains Hive queries. + #[serde(rename="queryFileUri")] + pub query_file_uri: Option, + /// Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name="value";). + #[serde(rename="scriptVariables")] + pub script_variables: Option>, + /// Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries. + #[serde(rename="continueOnFailure")] + pub continue_on_failure: Option, + /// Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. + #[serde(rename="jarFileUris")] + pub jar_file_uris: Option>, + /// A list of queries. + #[serde(rename="queryList")] + pub query_list: Option, + /// Optional. A mapping of property names and values, used to configure Hive. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and classes in user code. + pub properties: Option>, +} + +impl Part for HiveJob {} + + +/// A selector that chooses target cluster for jobs based on metadata. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClusterSelector { + /// Required. The cluster labels. Cluster must have all labels to match. + #[serde(rename="clusterLabels")] + pub cluster_labels: Option>, + /// Optional. The zone where workflow process executes. This parameter does not affect the selection of the cluster.If unspecified, the zone of the first cluster matching the selector is used. + pub zone: Option, +} + +impl Part for ClusterSelector {} + + +/// Specifies the selection and config of software inside the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SoftwareConfig { + /// Optional. The version of software inside the cluster. It must be one of the supported Dataproc Versions, such as "1.2" (including a subminor version, such as "1.2.29"), or the "preview" version. If unspecified, it defaults to the latest Debian version. + #[serde(rename="imageVersion")] + pub image_version: Option, + /// Optional. The set of components to activate on the cluster. + #[serde(rename="optionalComponents")] + pub optional_components: Option>, + /// Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, for example core:hadoop.tmp.dir. The following are supported prefixes and their mappings: + /// capacity-scheduler: capacity-scheduler.xml + /// core: core-site.xml + /// distcp: distcp-default.xml + /// hdfs: hdfs-site.xml + /// hive: hive-site.xml + /// mapred: mapred-site.xml + /// pig: pig.properties + /// spark: spark-defaults.conf + /// yarn: yarn-site.xmlFor more information, see Cluster properties. + pub properties: Option>, +} + +impl Part for SoftwareConfig {} + + +/// Configuration for the size bounds of an instance group, including its proportional size to other groups. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstanceGroupAutoscalingPolicyConfig { + /// Optional. Minimum number of instances for this group.Primary workers - Bounds: 2, max_instances. Default: 2. Secondary workers - Bounds: 0, max_instances. Default: 0. + #[serde(rename="minInstances")] + pub min_instances: Option, + /// Required. Maximum number of instances for this group. Required for primary workers. Note that by default, clusters will not use secondary workers. Required for secondary workers if the minimum secondary instances is set.Primary workers - Bounds: [min_instances, ). Secondary workers - Bounds: [min_instances, ). Default: 0. + #[serde(rename="maxInstances")] + pub max_instances: Option, + /// Optional. Weight for the instance group, which is used to determine the fraction of total workers in the cluster from this instance group. For example, if primary workers have weight 2, and secondary workers have weight 1, the cluster will have approximately 2 primary workers for each secondary worker.The cluster may not reach the specified balance if constrained by min/max bounds or other autoscaling settings. For example, if max_instances for secondary workers is 0, then only primary workers will be added. The cluster can also be out of balance when created.If weight is not set on any instance group, the cluster will default to equal weight for all groups: the cluster will attempt to maintain an equal number of workers in each group within the configured size bounds for each group. If weight is set for one group only, the cluster will default to zero weight on the unset group. For example if weight is set only on primary workers, the cluster will use primary workers only and no secondary workers. + pub weight: Option, +} + +impl Part for InstanceGroupAutoscalingPolicyConfig {} + + +/// Associates members with a role. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner. + pub role: Option, + /// The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. members can have the following values: + /// allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account. + /// allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account. + /// user:{emailid}: An email address that represents a specific Google account. For example, alice@example.com . + /// serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com. + /// group:{emailid}: An email address that represents a Google group. For example, admins@example.com. + /// deleted:user:{emailid}?uid={uniqueid}: An email address (plus unique identifier) representing a user that has been recently deleted. For example, alice@example.com?uid=123456789012345678901. If the user is recovered, this value reverts to user:{emailid} and the recovered user retains the role in the binding. + /// deleted:serviceAccount:{emailid}?uid={uniqueid}: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901. If the service account is undeleted, this value reverts to serviceAccount:{emailid} and the undeleted service account retains the role in the binding. + /// deleted:group:{emailid}?uid={uniqueid}: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, admins@example.com?uid=123456789012345678901. If the group is recovered, this value reverts to group:{emailid} and the recovered group retains the role in the binding. + /// domain:{domain}: The G Suite domain (primary) that represents all the users of that domain. For example, google.com or example.com. + pub members: Option>, +} + +impl Part for Binding {} + + +/// Cluster that is managed by the workflow. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedCluster { + /// Required. The cluster name prefix. A unique cluster name will be formed by appending a random suffix.The name must contain only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must begin with a letter. Cannot begin or end with hyphen. Must consist of between 2 and 35 characters. + #[serde(rename="clusterName")] + pub cluster_name: Option, + /// Optional. The labels to associate with this cluster.Label keys must be between 1 and 63 characters long, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and 63 characters long, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be associated with a given cluster. + pub labels: Option>, + /// Required. The cluster configuration. + pub config: Option, +} + +impl Part for ManagedCluster {} + + +/// Describes the identifying information, config, and status of a cluster of Compute Engine instances. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions clusters patch projects](struct.ProjectRegionClusterPatchCall.html) (request) +/// * [regions clusters create projects](struct.ProjectRegionClusterCreateCall.html) (request) +/// * [regions clusters get projects](struct.ProjectRegionClusterGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Cluster { + /// Output only. Cluster status. + pub status: Option, + /// Output only. A cluster UUID (Unique Universal Identifier). Dataproc generates this value when it creates the cluster. + #[serde(rename="clusterUuid")] + pub cluster_uuid: Option, + /// Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused. + #[serde(rename="clusterName")] + pub cluster_name: Option, + /// Required. The Google Cloud Platform project ID that the cluster belongs to. + #[serde(rename="projectId")] + pub project_id: Option, + /// Optional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster. + pub labels: Option>, + /// Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release. + pub metrics: Option, + /// Output only. The previous cluster status. + #[serde(rename="statusHistory")] + pub status_history: Option>, + /// Required. The cluster config. Note that Dataproc may set default values, and values may change when clusters are updated. + pub config: Option, +} + +impl RequestValue for Cluster {} +impl ResponseResult for Cluster {} + + +/// Configuration for parameter validation. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ParameterValidation { + /// Validation based on regular expressions. + pub regex: Option, + /// Validation based on a list of allowed values. + pub values: Option, +} + +impl Part for ParameterValidation {} + + +/// A Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SparkJob { + /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks. + #[serde(rename="jarFileUris")] + pub jar_file_uris: Option>, + /// Optional. The runtime log config for job execution. + #[serde(rename="loggingConfig")] + pub logging_config: Option, + /// Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission. + pub args: Option>, + /// Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks. + #[serde(rename="fileUris")] + pub file_uris: Option>, + /// The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris. + #[serde(rename="mainClass")] + pub main_class: Option, + /// Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip. + #[serde(rename="archiveUris")] + pub archive_uris: Option>, + /// The HCFS URI of the jar file that contains the main class. + #[serde(rename="mainJarFileUri")] + pub main_jar_file_uri: Option, + /// Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. + pub properties: Option>, +} + +impl Part for SparkJob {} + + +/// Encryption settings for the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EncryptionConfig { + /// Optional. The Cloud KMS key name to use for PD disk encryption for all instances in the cluster. + #[serde(rename="gcePdKmsKeyName")] + pub gce_pd_kms_key_name: Option, +} + +impl Part for EncryptionConfig {} + + +/// This resource represents a long-running operation that is the result of a network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions workflow templates instantiate projects](struct.ProjectRegionWorkflowTemplateInstantiateCall.html) (response) +/// * [regions clusters patch projects](struct.ProjectRegionClusterPatchCall.html) (response) +/// * [regions operations get projects](struct.ProjectRegionOperationGetCall.html) (response) +/// * [regions clusters delete projects](struct.ProjectRegionClusterDeleteCall.html) (response) +/// * [regions clusters diagnose projects](struct.ProjectRegionClusterDiagnoseCall.html) (response) +/// * [regions clusters create projects](struct.ProjectRegionClusterCreateCall.html) (response) +/// * [regions jobs submit as operation projects](struct.ProjectRegionJobSubmitAsOperationCall.html) (response) +/// * [locations workflow templates instantiate inline projects](struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html) (response) +/// * [regions workflow templates instantiate inline projects](struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html) (response) +/// * [locations workflow templates instantiate projects](struct.ProjectLocationWorkflowTemplateInstantiateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. + pub done: Option, + /// The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for Operation {} + + +/// Job scheduling options. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct JobScheduling { + /// Optional. Maximum number of times per hour a driver may be restarted as a result of driver terminating with non-zero code before job is reported failed.A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window.Maximum value is 10. + #[serde(rename="maxFailuresPerHour")] + pub max_failures_per_hour: Option, +} + +impl Part for JobScheduling {} + + +/// Autoscaling Policy config associated with the cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoscalingConfig { + /// Optional. The autoscaling policy used by the cluster.Only resource names including projectid and location (region) are valid. Examples: + /// https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id] + /// projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]Note that the policy must be in the same project and Dataproc region. + #[serde(rename="policyUri")] + pub policy_uri: Option, +} + +impl Part for AutoscalingConfig {} + + +/// Basic autoscaling configurations for YARN. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BasicYarnAutoscalingConfig { + /// Required. Fraction of average pending memory in the last cooldown period for which to remove workers. A scale-down factor of 1 will result in scaling down so that there is no available memory remaining after the update (more aggressive scaling). A scale-down factor of 0 disables removing workers, which can be beneficial for autoscaling a single job.Bounds: 0.0, 1.0. + #[serde(rename="scaleDownFactor")] + pub scale_down_factor: Option, + /// Required. Timeout for YARN graceful decommissioning of Node Managers. Specifies the duration to wait for jobs to complete before forcefully removing workers (and potentially interrupting jobs). Only applicable to downscaling operations.Bounds: 0s, 1d. + #[serde(rename="gracefulDecommissionTimeout")] + pub graceful_decommission_timeout: Option, + /// Optional. Minimum scale-down threshold as a fraction of total cluster size before scaling occurs. For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler must recommend at least a 2 worker scale-down for the cluster to scale. A threshold of 0 means the autoscaler will scale down on any recommended change.Bounds: 0.0, 1.0. Default: 0.0. + #[serde(rename="scaleDownMinWorkerFraction")] + pub scale_down_min_worker_fraction: Option, + /// Required. Fraction of average pending memory in the last cooldown period for which to add workers. A scale-up factor of 1.0 will result in scaling up so that there is no pending memory remaining after the update (more aggressive scaling). A scale-up factor closer to 0 will result in a smaller magnitude of scaling up (less aggressive scaling).Bounds: 0.0, 1.0. + #[serde(rename="scaleUpFactor")] + pub scale_up_factor: Option, + /// Optional. Minimum scale-up threshold as a fraction of total cluster size before scaling occurs. For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler must recommend at least a 2-worker scale-up for the cluster to scale. A threshold of 0 means the autoscaler will scale up on any recommended change.Bounds: 0.0, 1.0. Default: 0.0. + #[serde(rename="scaleUpMinWorkerFraction")] + pub scale_up_min_worker_fraction: Option, +} + +impl Part for BasicYarnAutoscalingConfig {} + + +/// Request message for SetIamPolicy method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions workflow templates set iam policy projects](struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html) (request) +/// * [regions clusters set iam policy projects](struct.ProjectRegionClusterSetIamPolicyCall.html) (request) +/// * [locations autoscaling policies set iam policy projects](struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html) (request) +/// * [regions operations set iam policy projects](struct.ProjectRegionOperationSetIamPolicyCall.html) (request) +/// * [locations workflow templates set iam policy projects](struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html) (request) +/// * [regions jobs set iam policy projects](struct.ProjectRegionJobSetIamPolicyCall.html) (request) +/// * [regions autoscaling policies set iam policy projects](struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. + pub policy: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// A configurable parameter that replaces one or more fields in the template. Parameterizable fields: - Labels - File uris - Job properties - Job arguments - Script variables - Main class (in HadoopJob and SparkJob) - Zone (in ClusterSelector) +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TemplateParameter { + /// Required. Paths to all fields that the parameter replaces. A field is allowed to appear in at most one parameter's list of field paths.A field path is similar in syntax to a google.protobuf.FieldMask. For example, a field path that references the zone field of a workflow template's cluster selector would be specified as placement.clusterSelector.zone.Also, field paths can reference fields using the following syntax: + /// Values in maps can be referenced by key: + /// labels'key' + /// placement.clusterSelector.clusterLabels'key' + /// placement.managedCluster.labels'key' + /// placement.clusterSelector.clusterLabels'key' + /// jobs'step-id'.labels'key' + /// Jobs in the jobs list can be referenced by step-id: + /// jobs'step-id'.hadoopJob.mainJarFileUri + /// jobs'step-id'.hiveJob.queryFileUri + /// jobs'step-id'.pySparkJob.mainPythonFileUri + /// jobs'step-id'.hadoopJob.jarFileUris0 + /// jobs'step-id'.hadoopJob.archiveUris0 + /// jobs'step-id'.hadoopJob.fileUris0 + /// jobs'step-id'.pySparkJob.pythonFileUris0 + /// Items in repeated fields can be referenced by a zero-based index: + /// jobs'step-id'.sparkJob.args0 + /// Other examples: + /// jobs'step-id'.hadoopJob.properties'key' + /// jobs'step-id'.hadoopJob.args0 + /// jobs'step-id'.hiveJob.scriptVariables'key' + /// jobs'step-id'.hadoopJob.mainJarFileUri + /// placement.clusterSelector.zoneIt may not be possible to parameterize maps and repeated fields in their entirety since only individual map values and individual items in repeated fields can be referenced. For example, the following field paths are invalid: + /// placement.clusterSelector.clusterLabels + /// jobs'step-id'.sparkJob.args + pub fields: Option>, + /// Optional. Validation rules to be applied to this parameter's value. + pub validation: Option, + /// Optional. Brief description of the parameter. Must not exceed 1024 characters. + pub description: Option, + /// Required. Parameter name. The parameter name is used as the key, and paired with the parameter value, which are passed to the template when the template is instantiated. The name must contain only capital letters (A-Z), numbers (0-9), and underscores (_), and must not start with a number. The maximum length is 40 characters. + pub name: Option, +} + +impl Part for TemplateParameter {} + + +/// A YARN application created by a job. Application information is a subset of org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.Beta Feature: This report is available for testing purposes only. It may be changed before final release. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct YarnApplication { + /// Required. The numerical progress of the application, from 1 to 100. + pub progress: Option, + /// Required. The application state. + pub state: Option, + /// Required. The application name. + pub name: Option, + /// Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the internal hostname, and requires a proxy server for resolution and, possibly, access. + #[serde(rename="trackingUrl")] + pub tracking_url: Option, +} + +impl Part for YarnApplication {} + + +/// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.A Policy is a collection of bindings. A binding binds one or more members to a single role. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions; each role can be an IAM predefined role or a user-created custom role.Optionally, a binding can specify a condition, which is a logical expression that allows access to a resource only if the expression evaluates to true. A condition can add constraints based on attributes of the request, the resource, or both.JSON example: +/// { +/// "bindings": [ +/// { +/// "role": "roles/resourcemanager.organizationAdmin", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +/// ] +/// }, +/// { +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } +/// } +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 +/// } +/// YAML example: +/// bindings: +/// +/// * members: +/// * user:mike@example.com +/// * group:admins@example.com +/// * domain:google.com +/// * serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin +/// * members: +/// * user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// * etag: BwWWja0YfJA= +/// * version: 3 +/// For a description of IAM and its features, see the IAM documentation (https://cloud.google.com/iam/docs/). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions clusters get iam policy projects](struct.ProjectRegionClusterGetIamPolicyCall.html) (response) +/// * [regions workflow templates set iam policy projects](struct.ProjectRegionWorkflowTemplateSetIamPolicyCall.html) (response) +/// * [regions clusters set iam policy projects](struct.ProjectRegionClusterSetIamPolicyCall.html) (response) +/// * [regions workflow templates get iam policy projects](struct.ProjectRegionWorkflowTemplateGetIamPolicyCall.html) (response) +/// * [regions jobs get iam policy projects](struct.ProjectRegionJobGetIamPolicyCall.html) (response) +/// * [locations autoscaling policies set iam policy projects](struct.ProjectLocationAutoscalingPolicySetIamPolicyCall.html) (response) +/// * [locations autoscaling policies get iam policy projects](struct.ProjectLocationAutoscalingPolicyGetIamPolicyCall.html) (response) +/// * [regions autoscaling policies get iam policy projects](struct.ProjectRegionAutoscalingPolicyGetIamPolicyCall.html) (response) +/// * [regions operations get iam policy projects](struct.ProjectRegionOperationGetIamPolicyCall.html) (response) +/// * [regions operations set iam policy projects](struct.ProjectRegionOperationSetIamPolicyCall.html) (response) +/// * [locations workflow templates set iam policy projects](struct.ProjectLocationWorkflowTemplateSetIamPolicyCall.html) (response) +/// * [regions jobs set iam policy projects](struct.ProjectRegionJobSetIamPolicyCall.html) (response) +/// * [locations workflow templates get iam policy projects](struct.ProjectLocationWorkflowTemplateGetIamPolicyCall.html) (response) +/// * [regions autoscaling policies set iam policy projects](struct.ProjectRegionAutoscalingPolicySetIamPolicyCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Associates a list of members to a role. Optionally, may specify a condition that determines how and when the bindings are applied. Each of the bindings must contain at least one member. + pub bindings: Option>, + /// etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy.Important: If you use IAM Conditions, you must include the etag field whenever you call setIamPolicy. If you omit this field, then IAM allows you to overwrite a version 3 policy with a version 1 policy, and all of the conditions in the version 3 policy are lost. + pub etag: Option, + /// Specifies the format of the policy.Valid values are 0, 1, and 3. Requests that specify an invalid value are rejected.Any operation that affects conditional role bindings must specify version 3. This requirement applies to the following operations: + /// Getting a policy that includes a conditional role binding + /// Adding a conditional role binding to a policy + /// Changing a conditional role binding in a policy + /// Removing any role binding, with or without a condition, from a policy that includes conditionsImportant: If you use IAM Conditions, you must include the etag field whenever you call setIamPolicy. If you omit this field, then IAM allows you to overwrite a version 3 policy with a version 1 policy, and all of the conditions in the version 3 policy are lost.If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. + pub version: Option, +} + +impl ResponseResult for Policy {} + + +/// Security related configuration, including Kerberos. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityConfig { + /// Kerberos related configuration. + #[serde(rename="kerberosConfig")] + pub kerberos_config: Option, +} + +impl Part for SecurityConfig {} + + +/// The runtime logging config of the job. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LoggingConfig { + /// The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' + #[serde(rename="driverLogLevels")] + pub driver_log_levels: Option>, +} + +impl Part for LoggingConfig {} + + +/// Specifies the type and number of accelerator cards attached to the instances of an instance. See GPUs on Compute Engine. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorConfig { + /// The number of the accelerator cards of this type exposed to this instance. + #[serde(rename="acceleratorCount")] + pub accelerator_count: Option, + /// Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Compute Engine AcceleratorTypes.Examples: + /// https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 + /// projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 + /// nvidia-tesla-k80Auto Zone Exception: If you are using the Dataproc Auto Zone Placement feature, you must use the short name of the accelerator type resource, for example, nvidia-tesla-k80. + #[serde(rename="acceleratorTypeUri")] + pub accelerator_type_uri: Option, +} + +impl Part for AcceleratorConfig {} + + +/// A request to submit a job. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions jobs submit as operation projects](struct.ProjectRegionJobSubmitAsOperationCall.html) (request) +/// * [regions jobs submit projects](struct.ProjectRegionJobSubmitCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SubmitJobRequest { + /// Required. The job resource. + pub job: Option, + /// Optional. A unique id used to identify the request. If the server receives two SubmitJobRequest requests with the same id, then the second request will be ignored and the first Job created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + #[serde(rename="requestId")] + pub request_id: Option, +} + +impl RequestValue for SubmitJobRequest {} + + +/// A Dataproc workflow template resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations workflow templates create projects](struct.ProjectLocationWorkflowTemplateCreateCall.html) (request|response) +/// * [regions workflow templates create projects](struct.ProjectRegionWorkflowTemplateCreateCall.html) (request|response) +/// * [regions workflow templates instantiate inline projects](struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html) (request) +/// * [regions workflow templates update projects](struct.ProjectRegionWorkflowTemplateUpdateCall.html) (request|response) +/// * [locations workflow templates instantiate inline projects](struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html) (request) +/// * [locations workflow templates get projects](struct.ProjectLocationWorkflowTemplateGetCall.html) (response) +/// * [locations workflow templates update projects](struct.ProjectLocationWorkflowTemplateUpdateCall.html) (request|response) +/// * [regions workflow templates get projects](struct.ProjectRegionWorkflowTemplateGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WorkflowTemplate { + /// Output only. The time template was last updated. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Required. The Directed Acyclic Graph of Jobs to submit. + pub jobs: Option>, + /// Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} + pub name: Option, + /// Optional. emplate parameters whose values are substituted into the template. Values for parameters must be provided when the template is instantiated. + pub parameters: Option>, + /// Optional. The labels to associate with this template. These labels will be propagated to all jobs and clusters created by the workflow instance.Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be associated with a template. + pub labels: Option>, + /// Output only. The time template was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Optional. Used to perform a consistent read-modify-write.This field should be left blank for a CreateWorkflowTemplate request. It is required for an UpdateWorkflowTemplate request, and must match the current server version. A typical update template flow would fetch the current template with a GetWorkflowTemplate request, which will return the current template with the version field filled in with the current server version. The user updates other fields in the template, then returns it as part of the UpdateWorkflowTemplate request. + pub version: Option, + /// Required. WorkflowTemplate scheduling information. + pub placement: Option, + /// no description provided + pub id: Option, +} + +impl RequestValue for WorkflowTemplate {} +impl ResponseResult for WorkflowTemplate {} + + +/// A Dataproc job resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions jobs submit projects](struct.ProjectRegionJobSubmitCall.html) (response) +/// * [regions jobs get projects](struct.ProjectRegionJobGetCall.html) (response) +/// * [regions jobs patch projects](struct.ProjectRegionJobPatchCall.html) (request|response) +/// * [regions jobs cancel projects](struct.ProjectRegionJobCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Job { + /// Output only. The job status. Additional application-specific status information may be contained in the type_job and yarn_applications fields. + pub status: Option, + /// Optional. Job is a Hadoop job. + #[serde(rename="hadoopJob")] + pub hadoop_job: Option, + /// Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job. + pub labels: Option>, + /// Optional. The fully qualified reference to the job, which can be used to obtain the equivalent REST path of the job resource. If this property is not specified when a job is created, the server generates a job_id. + pub reference: Option, + /// Optional. Job is a Pig job. + #[serde(rename="pigJob")] + pub pig_job: Option, + /// Optional. Job is a Presto job. + #[serde(rename="prestoJob")] + pub presto_job: Option, + /// Output only. A URI pointing to the location of the stdout of the job's driver program. + #[serde(rename="driverOutputResourceUri")] + pub driver_output_resource_uri: Option, + /// Output only. Indicates whether the job is completed. If the value is false, the job is still in progress. If true, the job is completed, and status.state field will indicate if it was successful, failed, or cancelled. + pub done: Option, + /// Output only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It may be changed before final release. + #[serde(rename="yarnApplications")] + pub yarn_applications: Option>, + /// Optional. Job scheduling configuration. + pub scheduling: Option, + /// Required. Job information, including how, when, and where to run the job. + pub placement: Option, + /// Output only. The previous job status. + #[serde(rename="statusHistory")] + pub status_history: Option>, + /// Optional. Job is a SparkSql job. + #[serde(rename="sparkSqlJob")] + pub spark_sql_job: Option, + /// Output only. A UUID that uniquely identifies a job within the project over time. This is in contrast to a user-settable reference.job_id that may be reused over time. + #[serde(rename="jobUuid")] + pub job_uuid: Option, + /// Optional. Job is a SparkR job. + #[serde(rename="sparkRJob")] + pub spark_r_job: Option, + /// Output only. If present, the location of miscellaneous control files which may be used as part of job setup and handling. If not present, control files may be placed in the same location as driver_output_uri. + #[serde(rename="driverControlFilesUri")] + pub driver_control_files_uri: Option, + /// Optional. Job is a Spark job. + #[serde(rename="sparkJob")] + pub spark_job: Option, + /// Optional. Job is a PySpark job. + #[serde(rename="pysparkJob")] + pub pyspark_job: Option, + /// Optional. Job is a Hive job. + #[serde(rename="hiveJob")] + pub hive_job: Option, +} + +impl RequestValue for Job {} +impl ResponseResult for Job {} + + +/// A job executed by the workflow. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OrderedJob { + /// no description provided + #[serde(rename="hadoopJob")] + pub hadoop_job: Option, + /// Optional. The labels to associate with this job.Label keys must be between 1 and 63 characters long, and must conform to the following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and 63 characters long, and must conform to the following regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be associated with a given job. + pub labels: Option>, + /// Spark R job + #[serde(rename="sparkRJob")] + pub spark_r_job: Option, + /// no description provided + #[serde(rename="sparkSqlJob")] + pub spark_sql_job: Option, + /// Optional. The optional list of prerequisite job step_ids. If not specified, the job will start at the beginning of workflow. + #[serde(rename="prerequisiteStepIds")] + pub prerequisite_step_ids: Option>, + /// no description provided + #[serde(rename="pigJob")] + pub pig_job: Option, + /// Required. The step id. The id must be unique among all jobs within the template.The step id is used as prefix for job id, as job goog-dataproc-workflow-step-id label, and in prerequisiteStepIds field from other steps.The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters. + #[serde(rename="stepId")] + pub step_id: Option, + /// no description provided + #[serde(rename="sparkJob")] + pub spark_job: Option, + /// Presto job + #[serde(rename="prestoJob")] + pub presto_job: Option, + /// Optional. Job scheduling configuration. + pub scheduling: Option, + /// no description provided + #[serde(rename="pysparkJob")] + pub pyspark_job: Option, + /// no description provided + #[serde(rename="hiveJob")] + pub hive_job: Option, +} + +impl Part for OrderedJob {} + + +/// A Dataproc job for running Apache PySpark (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) applications on YARN. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PySparkJob { + /// Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file. + #[serde(rename="mainPythonFileUri")] + pub main_python_file_uri: Option, + /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks. + #[serde(rename="jarFileUris")] + pub jar_file_uris: Option>, + /// Optional. The runtime log config for job execution. + #[serde(rename="loggingConfig")] + pub logging_config: Option, + /// Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission. + pub args: Option>, + /// Optional. HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks. + #[serde(rename="fileUris")] + pub file_uris: Option>, + /// Optional. HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip. + #[serde(rename="archiveUris")] + pub archive_uris: Option>, + /// Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip. + #[serde(rename="pythonFileUris")] + pub python_file_uris: Option>, + /// Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. + pub properties: Option>, +} + +impl Part for PySparkJob {} + + +/// A response to a request to list workflow templates in a project. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations workflow templates list projects](struct.ProjectLocationWorkflowTemplateListCall.html) (response) +/// * [regions workflow templates list projects](struct.ProjectRegionWorkflowTemplateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListWorkflowTemplatesResponse { + /// Output only. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent ListWorkflowTemplatesRequest. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Output only. WorkflowTemplates list. + pub templates: Option>, +} + +impl ResponseResult for ListWorkflowTemplatesResponse {} + + +/// Request message for TestIamPermissions method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [regions workflow templates test iam permissions projects](struct.ProjectRegionWorkflowTemplateTestIamPermissionCall.html) (request) +/// * [regions operations test iam permissions projects](struct.ProjectRegionOperationTestIamPermissionCall.html) (request) +/// * [regions clusters test iam permissions projects](struct.ProjectRegionClusterTestIamPermissionCall.html) (request) +/// * [locations autoscaling policies test iam permissions projects](struct.ProjectLocationAutoscalingPolicyTestIamPermissionCall.html) (request) +/// * [regions autoscaling policies test iam permissions projects](struct.ProjectRegionAutoscalingPolicyTestIamPermissionCall.html) (request) +/// * [locations workflow templates test iam permissions projects](struct.ProjectLocationWorkflowTemplateTestIamPermissionCall.html) (request) +/// * [regions jobs test iam permissions projects](struct.ProjectRegionJobTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsRequest { + /// The set of permissions to check for the resource. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + /// Specifies Kerberos related configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1222,6 +1791,8 @@ pub struct KerberosConfig { /// Optional. The remote realm the Dataproc on-cluster KDC will trust, should the user enable cross realm trust. #[serde(rename="crossRealmTrustRealm")] pub cross_realm_trust_realm: Option, + /// Optional. The name of the on-cluster Kerberos realm. If not specified, the uppercased domain of hostnames will be the realm. + pub realm: Option, /// Optional. The Cloud Storage URI of a KMS encrypted file containing the password to the user provided key. For the self-signed certificate, this password is generated by Dataproc. #[serde(rename="keyPasswordUri")] pub key_password_uri: Option, @@ -1260,23 +1831,35 @@ pub struct KerberosConfig { impl Part for KerberosConfig {} -/// Represents an expression text. Example: -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" -/// +/// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec.Example (Comparison): +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// Example (Equality): +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// Example (Logic): +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// Example (Data Manipulation): +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + /// Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in Common Expression Language syntax.The application context of the containing message determines which well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + /// Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + /// Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. pub title: Option, } @@ -1319,28 +1902,7 @@ pub struct ListClustersResponse { impl ResponseResult for ListClustersResponse {} -/// A list of jobs in a project. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [regions jobs list projects](struct.ProjectRegionJobListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListJobsResponse { - /// Optional. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token in a subsequent ListJobsRequest. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Output only. Jobs list. - pub jobs: Option>, -} - -impl ResponseResult for ListJobsResponse {} - - -/// Cloud Dataproc job status. +/// Dataproc job status. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1351,7 +1913,7 @@ pub struct JobStatus { /// Output only. The time when this state was entered. #[serde(rename="stateStartTime")] pub state_start_time: Option, - /// Output only. Optional job state details, such as an error description if the state is ERROR. + /// Optional. Output only. Job state details, such as an error description if the state is ERROR. pub details: Option, /// Output only. Additional state information, which includes status reported by the agent. pub substate: Option, @@ -1360,49 +1922,24 @@ pub struct JobStatus { impl Part for JobStatus {} -/// Cloud Dataproc job config. +/// The status of a cluster and its instances. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct JobPlacement { - /// Required. The name of the cluster where the job will be submitted. - #[serde(rename="clusterName")] - pub cluster_name: Option, - /// Output only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted. - #[serde(rename="clusterUuid")] - pub cluster_uuid: Option, +pub struct ClusterStatus { + /// Output only. The cluster's state. + pub state: Option, + /// Output only. Time when this state was entered (see JSON representation of Timestamp (https://developers.google.com/protocol-buffers/docs/proto3#json)). + #[serde(rename="stateStartTime")] + pub state_start_time: Option, + /// Optional. Output only. Details of cluster's state. + pub detail: Option, + /// Output only. Additional state information that includes status reported by the agent. + pub substate: Option, } -impl Part for JobPlacement {} - - -/// Encryption settings for the cluster. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EncryptionConfig { - /// Optional. The Cloud KMS key name to use for PD disk encryption for all instances in the cluster. - #[serde(rename="gcePdKmsKeyName")] - pub gce_pd_kms_key_name: Option, -} - -impl Part for EncryptionConfig {} - - -/// The runtime logging config of the job. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LoggingConfig { - /// The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' - #[serde(rename="driverLogLevels")] - pub driver_log_levels: Option>, -} - -impl Part for LoggingConfig {} +impl Part for ClusterStatus {} /// Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release. @@ -1422,34 +1959,6 @@ pub struct ClusterMetrics { impl Part for ClusterMetrics {} -/// A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HiveJob { - /// The HCFS URI of the script that contains Hive queries. - #[serde(rename="queryFileUri")] - pub query_file_uri: Option, - /// Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name="value";). - #[serde(rename="scriptVariables")] - pub script_variables: Option>, - /// Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries. - #[serde(rename="continueOnFailure")] - pub continue_on_failure: Option, - /// Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. - #[serde(rename="jarFileUris")] - pub jar_file_uris: Option>, - /// A list of queries. - #[serde(rename="queryList")] - pub query_list: Option, - /// Optional. A mapping of property names and values, used to configure Hive. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and classes in user code. - pub properties: Option>, -} - -impl Part for HiveJob {} - - /// Validation based on regular expressions. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1463,81 +1972,22 @@ pub struct RegexValidation { impl Part for RegexValidation {} -/// A Cloud Dataproc job for running Apache Hadoop MapReduce (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop YARN (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). +/// Reservation Affinity for consuming Zonal reservation. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HadoopJob { - /// Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks. - #[serde(rename="jarFileUris")] - pub jar_file_uris: Option>, - /// Optional. The runtime log config for job execution. - #[serde(rename="loggingConfig")] - pub logging_config: Option, - /// Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a collision may occur that causes an incorrect job submission. - pub args: Option>, - /// Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for naively parallel tasks. - #[serde(rename="fileUris")] - pub file_uris: Option>, - /// The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris. - #[serde(rename="mainClass")] - pub main_class: Option, - /// Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, or .zip. - #[serde(rename="archiveUris")] - pub archive_uris: Option>, - /// The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' - #[serde(rename="mainJarFileUri")] - pub main_jar_file_uri: Option, - /// Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code. - pub properties: Option>, +pub struct ReservationAffinity { + /// Optional. Corresponds to the label values of reservation resource. + pub values: Option>, + /// Optional. Type of reservation to consume + #[serde(rename="consumeReservationType")] + pub consume_reservation_type: Option, + /// Optional. Corresponds to the label key of reservation resource. + pub key: Option, } -impl Part for HadoopJob {} - - -/// A selector that chooses target cluster for jobs based on metadata. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ClusterSelector { - /// Required. The cluster labels. Cluster must have all labels to match. - #[serde(rename="clusterLabels")] - pub cluster_labels: Option>, - /// Optional. The zone where workflow process executes. This parameter does not affect the selection of the cluster.If unspecified, the zone of the first cluster matching the selector is used. - pub zone: Option, -} - -impl Part for ClusterSelector {} - - -/// Specifies the selection and config of software inside the cluster. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SoftwareConfig { - /// Optional. The version of software inside the cluster. It must be one of the supported Cloud Dataproc Versions, such as "1.2" (including a subminor version, such as "1.2.29"), or the "preview" version. If unspecified, it defaults to the latest Debian version. - #[serde(rename="imageVersion")] - pub image_version: Option, - /// The set of optional components to activate on the cluster. - #[serde(rename="optionalComponents")] - pub optional_components: Option>, - /// Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, for example core:hadoop.tmp.dir. The following are supported prefixes and their mappings: - /// capacity-scheduler: capacity-scheduler.xml - /// core: core-site.xml - /// distcp: distcp-default.xml - /// hdfs: hdfs-site.xml - /// hive: hive-site.xml - /// mapred: mapred-site.xml - /// pig: pig.properties - /// spark: spark-defaults.conf - /// yarn: yarn-site.xmlFor more information, see Cluster properties. - pub properties: Option>, -} - -impl Part for SoftwareConfig {} +impl Part for ReservationAffinity {} /// The response message for Operations.ListOperations. @@ -1561,7 +2011,21 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN. +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + +/// A Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1585,193 +2049,48 @@ pub struct PigJob { /// A list of queries. #[serde(rename="queryList")] pub query_list: Option, - /// Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code. + /// Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Dataproc API may be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code. pub properties: Option>, } impl Part for PigJob {} -/// Associates members with a role. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Binding { - /// Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner. - pub role: Option, - /// The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. - pub condition: Option, - /// Specifies the identities requesting access for a Cloud Platform resource. members can have the following values: - /// allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account. - /// allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account. - /// user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com . - /// serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com. - /// group:{emailid}: An email address that represents a Google group. For example, admins@example.com. - /// domain:{domain}: The G Suite domain (primary) that represents all the users of that domain. For example, google.com or example.com. - pub members: Option>, -} - -impl Part for Binding {} - - -/// Cluster that is managed by the workflow. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ManagedCluster { - /// Required. The cluster name prefix. A unique cluster name will be formed by appending a random suffix.The name must contain only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must begin with a letter. Cannot begin or end with hyphen. Must consist of between 2 and 35 characters. - #[serde(rename="clusterName")] - pub cluster_name: Option, - /// Optional. The labels to associate with this cluster.Label keys must be between 1 and 63 characters long, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and 63 characters long, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be associated with a given cluster. - pub labels: Option>, - /// Required. The cluster configuration. - pub config: Option, -} - -impl Part for ManagedCluster {} - - -/// Describes the identifying information, config, and status of a cluster of Compute Engine instances. +/// Describes an autoscaling policy for Dataproc cluster autoscaler. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [regions clusters patch projects](struct.ProjectRegionClusterPatchCall.html) (request) -/// * [regions clusters create projects](struct.ProjectRegionClusterCreateCall.html) (request) -/// * [regions clusters get projects](struct.ProjectRegionClusterGetCall.html) (response) +/// * [locations autoscaling policies update projects](struct.ProjectLocationAutoscalingPolicyUpdateCall.html) (request|response) +/// * [locations autoscaling policies get projects](struct.ProjectLocationAutoscalingPolicyGetCall.html) (response) +/// * [regions autoscaling policies get projects](struct.ProjectRegionAutoscalingPolicyGetCall.html) (response) +/// * [locations autoscaling policies create projects](struct.ProjectLocationAutoscalingPolicyCreateCall.html) (request|response) +/// * [regions autoscaling policies update projects](struct.ProjectRegionAutoscalingPolicyUpdateCall.html) (request|response) +/// * [regions autoscaling policies create projects](struct.ProjectRegionAutoscalingPolicyCreateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Cluster { - /// Output only. Cluster status. - pub status: Option, - /// Output only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster. - #[serde(rename="clusterUuid")] - pub cluster_uuid: Option, - /// Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused. - #[serde(rename="clusterName")] - pub cluster_name: Option, - /// Required. The Google Cloud Platform project ID that the cluster belongs to. - #[serde(rename="projectId")] - pub project_id: Option, - /// Optional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster. - pub labels: Option>, - /// Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release. - pub metrics: Option, - /// Output only. The previous cluster status. - #[serde(rename="statusHistory")] - pub status_history: Option>, - /// Required. The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated. - pub config: Option, -} - -impl RequestValue for Cluster {} -impl ResponseResult for Cluster {} - - -/// Configuration for parameter validation. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ParameterValidation { - /// Validation based on regular expressions. - pub regex: Option, - /// Validation based on a list of allowed values. - pub values: Option, -} - -impl Part for ParameterValidation {} - - -/// A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SparkJob { - /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks. - #[serde(rename="jarFileUris")] - pub jar_file_uris: Option>, - /// Optional. The runtime log config for job execution. - #[serde(rename="loggingConfig")] - pub logging_config: Option, - /// Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission. - pub args: Option>, - /// Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks. - #[serde(rename="fileUris")] - pub file_uris: Option>, - /// The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris. - #[serde(rename="mainClass")] - pub main_class: Option, - /// Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip. - #[serde(rename="archiveUris")] - pub archive_uris: Option>, - /// The HCFS URI of the jar file that contains the main class. - #[serde(rename="mainJarFileUri")] - pub main_jar_file_uri: Option, - /// Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Cloud Dataproc API may be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. - pub properties: Option>, -} - -impl Part for SparkJob {} - - -/// The status of a cluster and its instances. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ClusterStatus { - /// Output only. The cluster's state. - pub state: Option, - /// Output only. Time when this state was entered. - #[serde(rename="stateStartTime")] - pub state_start_time: Option, - /// Output only. Optional details of cluster's state. - pub detail: Option, - /// Output only. Additional state information that includes status reported by the agent. - pub substate: Option, -} - -impl Part for ClusterStatus {} - - -/// This resource represents a long-running operation that is the result of a network API call. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [regions workflow templates instantiate projects](struct.ProjectRegionWorkflowTemplateInstantiateCall.html) (response) -/// * [regions clusters patch projects](struct.ProjectRegionClusterPatchCall.html) (response) -/// * [regions operations get projects](struct.ProjectRegionOperationGetCall.html) (response) -/// * [regions clusters delete projects](struct.ProjectRegionClusterDeleteCall.html) (response) -/// * [regions clusters diagnose projects](struct.ProjectRegionClusterDiagnoseCall.html) (response) -/// * [regions clusters create projects](struct.ProjectRegionClusterCreateCall.html) (response) -/// * [locations workflow templates instantiate inline projects](struct.ProjectLocationWorkflowTemplateInstantiateInlineCall.html) (response) -/// * [regions workflow templates instantiate inline projects](struct.ProjectRegionWorkflowTemplateInstantiateInlineCall.html) (response) -/// * [locations workflow templates instantiate projects](struct.ProjectLocationWorkflowTemplateInstantiateCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Operation { - /// The error result of the operation in case of failure or cancellation. - pub error: Option, - /// If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. - pub done: Option, - /// The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse. - pub response: Option>, - /// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}. +pub struct AutoscalingPolicy { + /// no description provided + #[serde(rename="basicAlgorithm")] + pub basic_algorithm: Option, + /// Optional. Describes how the autoscaler will operate for secondary workers. + #[serde(rename="secondaryWorkerConfig")] + pub secondary_worker_config: Option, + /// Required. Describes how the autoscaler will operate for primary workers. + #[serde(rename="workerConfig")] + pub worker_config: Option, + /// Required. The policy id.The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with underscore or hyphen. Must consist of between 3 and 50 characters. + pub id: Option, + /// Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} pub name: Option, - /// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. - pub metadata: Option>, } -impl ResponseResult for Operation {} +impl RequestValue for AutoscalingPolicy {} +impl ResponseResult for AutoscalingPolicy {} /// Validation based on a list of allowed values. @@ -1831,7 +2150,7 @@ impl RequestValue for CancelJobRequest {} /// ::default(), None); /// let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `locations_autoscaling_policies_get_iam_policy(...)`, `locations_autoscaling_policies_set_iam_policy(...)`, `locations_autoscaling_policies_test_iam_permissions(...)`, `locations_workflow_templates_create(...)`, `locations_workflow_templates_delete(...)`, `locations_workflow_templates_get(...)`, `locations_workflow_templates_get_iam_policy(...)`, `locations_workflow_templates_instantiate(...)`, `locations_workflow_templates_instantiate_inline(...)`, `locations_workflow_templates_list(...)`, `locations_workflow_templates_set_iam_policy(...)`, `locations_workflow_templates_test_iam_permissions(...)`, `locations_workflow_templates_update(...)`, `regions_autoscaling_policies_get_iam_policy(...)`, `regions_autoscaling_policies_set_iam_policy(...)`, `regions_autoscaling_policies_test_iam_permissions(...)`, `regions_clusters_create(...)`, `regions_clusters_delete(...)`, `regions_clusters_diagnose(...)`, `regions_clusters_get(...)`, `regions_clusters_get_iam_policy(...)`, `regions_clusters_list(...)`, `regions_clusters_patch(...)`, `regions_clusters_set_iam_policy(...)`, `regions_clusters_test_iam_permissions(...)`, `regions_jobs_cancel(...)`, `regions_jobs_delete(...)`, `regions_jobs_get(...)`, `regions_jobs_get_iam_policy(...)`, `regions_jobs_list(...)`, `regions_jobs_patch(...)`, `regions_jobs_set_iam_policy(...)`, `regions_jobs_submit(...)`, `regions_jobs_test_iam_permissions(...)`, `regions_operations_cancel(...)`, `regions_operations_delete(...)`, `regions_operations_get(...)`, `regions_operations_get_iam_policy(...)`, `regions_operations_list(...)`, `regions_operations_set_iam_policy(...)`, `regions_operations_test_iam_permissions(...)`, `regions_workflow_templates_create(...)`, `regions_workflow_templates_delete(...)`, `regions_workflow_templates_get(...)`, `regions_workflow_templates_get_iam_policy(...)`, `regions_workflow_templates_instantiate(...)`, `regions_workflow_templates_instantiate_inline(...)`, `regions_workflow_templates_list(...)`, `regions_workflow_templates_set_iam_policy(...)`, `regions_workflow_templates_test_iam_permissions(...)` and `regions_workflow_templates_update(...)` +/// // like `locations_autoscaling_policies_create(...)`, `locations_autoscaling_policies_delete(...)`, `locations_autoscaling_policies_get(...)`, `locations_autoscaling_policies_get_iam_policy(...)`, `locations_autoscaling_policies_list(...)`, `locations_autoscaling_policies_set_iam_policy(...)`, `locations_autoscaling_policies_test_iam_permissions(...)`, `locations_autoscaling_policies_update(...)`, `locations_workflow_templates_create(...)`, `locations_workflow_templates_delete(...)`, `locations_workflow_templates_get(...)`, `locations_workflow_templates_get_iam_policy(...)`, `locations_workflow_templates_instantiate(...)`, `locations_workflow_templates_instantiate_inline(...)`, `locations_workflow_templates_list(...)`, `locations_workflow_templates_set_iam_policy(...)`, `locations_workflow_templates_test_iam_permissions(...)`, `locations_workflow_templates_update(...)`, `regions_autoscaling_policies_create(...)`, `regions_autoscaling_policies_delete(...)`, `regions_autoscaling_policies_get(...)`, `regions_autoscaling_policies_get_iam_policy(...)`, `regions_autoscaling_policies_list(...)`, `regions_autoscaling_policies_set_iam_policy(...)`, `regions_autoscaling_policies_test_iam_permissions(...)`, `regions_autoscaling_policies_update(...)`, `regions_clusters_create(...)`, `regions_clusters_delete(...)`, `regions_clusters_diagnose(...)`, `regions_clusters_get(...)`, `regions_clusters_get_iam_policy(...)`, `regions_clusters_list(...)`, `regions_clusters_patch(...)`, `regions_clusters_set_iam_policy(...)`, `regions_clusters_test_iam_permissions(...)`, `regions_jobs_cancel(...)`, `regions_jobs_delete(...)`, `regions_jobs_get(...)`, `regions_jobs_get_iam_policy(...)`, `regions_jobs_list(...)`, `regions_jobs_patch(...)`, `regions_jobs_set_iam_policy(...)`, `regions_jobs_submit(...)`, `regions_jobs_submit_as_operation(...)`, `regions_jobs_test_iam_permissions(...)`, `regions_operations_cancel(...)`, `regions_operations_delete(...)`, `regions_operations_get(...)`, `regions_operations_get_iam_policy(...)`, `regions_operations_list(...)`, `regions_operations_set_iam_policy(...)`, `regions_operations_test_iam_permissions(...)`, `regions_workflow_templates_create(...)`, `regions_workflow_templates_delete(...)`, `regions_workflow_templates_get(...)`, `regions_workflow_templates_get_iam_policy(...)`, `regions_workflow_templates_instantiate(...)`, `regions_workflow_templates_instantiate_inline(...)`, `regions_workflow_templates_list(...)`, `regions_workflow_templates_set_iam_policy(...)`, `regions_workflow_templates_test_iam_permissions(...)` and `regions_workflow_templates_update(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1865,6 +2184,48 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists autoscaling policies in the project. + /// + /// # Arguments + /// + /// * `parent` - Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + pub fn locations_autoscaling_policies_list(&self, parent: &str) -> ProjectLocationAutoscalingPolicyListCall<'a, C, A> { + ProjectLocationAutoscalingPolicyListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates new autoscaling policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + pub fn locations_autoscaling_policies_create(&self, request: AutoscalingPolicy, parent: &str) -> ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> { + ProjectLocationAutoscalingPolicyCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the resource representation for a cluster in a project. @@ -1872,7 +2233,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_get(&self, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterGetCall<'a, C, A> { ProjectRegionClusterGetCall { @@ -1911,7 +2272,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// * `parent` - Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} pub fn locations_workflow_templates_list(&self, parent: &str) -> ProjectLocationWorkflowTemplateListCall<'a, C, A> { ProjectLocationWorkflowTemplateListCall { hub: self.hub, @@ -1947,7 +2310,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// * `parent` - Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} pub fn regions_workflow_templates_list(&self, parent: &str) -> ProjectRegionWorkflowTemplateListCall<'a, C, A> { ProjectRegionWorkflowTemplateListCall { hub: self.hub, @@ -1962,7 +2327,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// @@ -1985,7 +2350,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn locations_workflow_templates_get(&self, name: &str) -> ProjectLocationWorkflowTemplateGetCall<'a, C, A> { ProjectLocationWorkflowTemplateGetCall { hub: self.hub, @@ -2005,7 +2372,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `jobId` - Required. The job ID. pub fn regions_jobs_patch(&self, request: Job, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobPatchCall<'a, C, A> { ProjectRegionJobPatchCall { @@ -2046,7 +2413,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn regions_workflow_templates_delete(&self, name: &str) -> ProjectRegionWorkflowTemplateDeleteCall<'a, C, A> { ProjectRegionWorkflowTemplateDeleteCall { hub: self.hub, @@ -2060,12 +2429,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty. + /// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn regions_workflow_templates_instantiate(&self, request: InstantiateWorkflowTemplateRequest, name: &str) -> ProjectRegionWorkflowTemplateInstantiateCall<'a, C, A> { ProjectRegionWorkflowTemplateInstantiateCall { hub: self.hub, @@ -2098,7 +2469,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// @@ -2122,7 +2493,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// * `parent` - Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} pub fn locations_workflow_templates_create(&self, request: WorkflowTemplate, parent: &str) -> ProjectLocationWorkflowTemplateCreateCall<'a, C, A> { ProjectLocationWorkflowTemplateCreateCall { hub: self.hub, @@ -2155,13 +2528,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a cluster in a project. + /// Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). /// /// # Arguments /// /// * `request` - No description provided. /// * `projectId` - Required. The ID of the Google Cloud Platform project the cluster belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_patch(&self, request: Cluster, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterPatchCall<'a, C, A> { ProjectRegionClusterPatchCall { @@ -2198,17 +2571,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + /// Creates new autoscaling policy. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - pub fn locations_autoscaling_policies_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { - ProjectLocationAutoscalingPolicyGetIamPolicyCall { + /// * `parent` - Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + pub fn regions_autoscaling_policies_create(&self, request: AutoscalingPolicy, parent: &str) -> ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> { + ProjectRegionAutoscalingPolicyCreateCall { hub: self.hub, _request: request, - _resource: resource.to_string(), + _parent: parent.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2223,7 +2598,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. pub fn regions_jobs_submit(&self, request: SubmitJobRequest, project_id: &str, region: &str) -> ProjectRegionJobSubmitCall<'a, C, A> { ProjectRegionJobSubmitCall { hub: self.hub, @@ -2238,13 +2613,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a cluster in a project. + /// Creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). /// /// # Arguments /// /// * `request` - No description provided. /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. pub fn regions_clusters_create(&self, request: Cluster, project_id: &str, region: &str) -> ProjectRegionClusterCreateCall<'a, C, A> { ProjectRegionClusterCreateCall { hub: self.hub, @@ -2260,7 +2635,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// @@ -2279,12 +2654,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty. + /// Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// * `parent` - Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} pub fn locations_workflow_templates_instantiate_inline(&self, request: WorkflowTemplate, parent: &str) -> ProjectLocationWorkflowTemplateInstantiateInlineCall<'a, C, A> { ProjectLocationWorkflowTemplateInstantiateInlineCall { hub: self.hub, @@ -2304,7 +2681,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn locations_workflow_templates_update(&self, request: WorkflowTemplate, name: &str) -> ProjectLocationWorkflowTemplateUpdateCall<'a, C, A> { ProjectLocationWorkflowTemplateUpdateCall { hub: self.hub, @@ -2318,7 +2697,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// @@ -2337,12 +2716,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty. + /// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn locations_workflow_templates_instantiate(&self, request: InstantiateWorkflowTemplateRequest, name: &str) -> ProjectLocationWorkflowTemplateInstantiateCall<'a, C, A> { ProjectLocationWorkflowTemplateInstantiateCall { hub: self.hub, @@ -2375,12 +2756,12 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all regions/{region}/clusters in a project. + /// Lists all regions/{region}/clusters in a project alphabetically. /// /// # Arguments /// /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. pub fn regions_clusters_list(&self, project_id: &str, region: &str) -> ProjectRegionClusterListCall<'a, C, A> { ProjectRegionClusterListCall { hub: self.hub, @@ -2402,7 +2783,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. pub fn regions_jobs_list(&self, project_id: &str, region: &str) -> ProjectRegionJobListCall<'a, C, A> { ProjectRegionJobListCall { hub: self.hub, @@ -2457,13 +2838,32 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation. + /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + pub fn locations_autoscaling_policies_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { + ProjectLocationAutoscalingPolicyGetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, Operation.response contains DiagnoseClusterResults (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). /// /// # Arguments /// /// * `request` - No description provided. /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_diagnose(&self, request: DiagnoseClusterRequest, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterDiagnoseCall<'a, C, A> { ProjectRegionClusterDiagnoseCall { @@ -2485,7 +2885,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn regions_workflow_templates_update(&self, request: WorkflowTemplate, name: &str) -> ProjectRegionWorkflowTemplateUpdateCall<'a, C, A> { ProjectRegionWorkflowTemplateUpdateCall { hub: self.hub, @@ -2499,7 +2901,47 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters. + /// + /// # Arguments + /// + /// * `name` - Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + pub fn locations_autoscaling_policies_delete(&self, name: &str) -> ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> { + ProjectLocationAutoscalingPolicyDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Submits job to a cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. + /// * `region` - Required. The Dataproc region in which to handle the request. + pub fn regions_jobs_submit_as_operation(&self, request: SubmitJobRequest, project_id: &str, region: &str) -> ProjectRegionJobSubmitAsOperationCall<'a, C, A> { + ProjectRegionJobSubmitAsOperationCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _region: region.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// @@ -2542,7 +2984,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn locations_workflow_templates_delete(&self, name: &str) -> ProjectLocationWorkflowTemplateDeleteCall<'a, C, A> { ProjectLocationWorkflowTemplateDeleteCall { hub: self.hub, @@ -2556,7 +3000,49 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + pub fn regions_autoscaling_policies_update(&self, request: AutoscalingPolicy, name: &str) -> ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> { + ProjectRegionAutoscalingPolicyUpdateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + pub fn locations_autoscaling_policies_update(&self, request: AutoscalingPolicy, name: &str) -> ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> { + ProjectLocationAutoscalingPolicyUpdateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// @@ -2573,6 +3059,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves autoscaling policy. + /// + /// # Arguments + /// + /// * `name` - Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + pub fn locations_autoscaling_policies_get(&self, name: &str) -> ProjectLocationAutoscalingPolicyGetCall<'a, C, A> { + ProjectLocationAutoscalingPolicyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. @@ -2592,6 +3097,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves autoscaling policy. + /// + /// # Arguments + /// + /// * `name` - Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + pub fn regions_autoscaling_policies_get(&self, name: &str) -> ProjectRegionAutoscalingPolicyGetCall<'a, C, A> { + ProjectRegionAutoscalingPolicyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. @@ -2618,7 +3142,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `jobId` - Required. The job ID. pub fn regions_jobs_get(&self, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobGetCall<'a, C, A> { ProjectRegionJobGetCall { @@ -2632,6 +3156,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters. + /// + /// # Arguments + /// + /// * `name` - Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + pub fn regions_autoscaling_policies_delete(&self, name: &str) -> ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> { + ProjectRegionAutoscalingPolicyDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. @@ -2653,12 +3196,12 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a cluster in a project. + /// Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). /// /// # Arguments /// /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_delete(&self, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterDeleteCall<'a, C, A> { ProjectRegionClusterDeleteCall { @@ -2676,12 +3219,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty. + /// Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// * `parent` - Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} pub fn regions_workflow_templates_instantiate_inline(&self, request: WorkflowTemplate, parent: &str) -> ProjectRegionWorkflowTemplateInstantiateInlineCall<'a, C, A> { ProjectRegionWorkflowTemplateInstantiateInlineCall { hub: self.hub, @@ -2713,6 +3258,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists autoscaling policies in the project. + /// + /// # Arguments + /// + /// * `parent` - Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + pub fn regions_autoscaling_policies_list(&self, parent: &str) -> ProjectRegionAutoscalingPolicyListCall<'a, C, A> { + ProjectRegionAutoscalingPolicyListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. @@ -2757,7 +3323,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// * `name` - Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} pub fn regions_workflow_templates_get(&self, name: &str) -> ProjectRegionWorkflowTemplateGetCall<'a, C, A> { ProjectRegionWorkflowTemplateGetCall { hub: self.hub, @@ -2776,7 +3344,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// * `parent` - Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} pub fn regions_workflow_templates_create(&self, request: WorkflowTemplate, parent: &str) -> ProjectRegionWorkflowTemplateCreateCall<'a, C, A> { ProjectRegionWorkflowTemplateCreateCall { hub: self.hub, @@ -2795,7 +3365,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `jobId` - Required. The job ID. pub fn regions_jobs_delete(&self, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobDeleteCall<'a, C, A> { ProjectRegionJobDeleteCall { @@ -2811,7 +3381,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified resource. Replaces any existing policy. + /// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// @@ -2830,13 +3400,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get. + /// Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). /// /// # Arguments /// /// * `request` - No description provided. /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `region` - Required. The Dataproc region in which to handle the request. /// * `jobId` - Required. The job ID. pub fn regions_jobs_cancel(&self, request: CancelJobRequest, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobCancelCall<'a, C, A> { ProjectRegionJobCancelCall { @@ -3139,6 +3709,561 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateTestIamPermissionCall<'a, C, A> wher } +/// Lists autoscaling policies in the project. +/// +/// A builder for the *locations.autoscalingPolicies.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_autoscaling_policies_list("parent") +/// .page_token("dolores") +/// .page_size(-63) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAutoscalingPolicyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAutoscalingPolicyListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAutoscalingPolicyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAutoscalingPoliciesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.locations.autoscalingPolicies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/autoscalingPolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The page token, returned by a previous call, to request the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAutoscalingPolicyListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAutoscalingPolicyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAutoscalingPolicyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAutoscalingPolicyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates new autoscaling policy. +/// +/// A builder for the *locations.autoscalingPolicies.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// use dataproc1::AutoscalingPolicy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AutoscalingPolicy::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_autoscaling_policies_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _request: AutoscalingPolicy, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalingPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.locations.autoscalingPolicies.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/autoscalingPolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AutoscalingPolicy) -> ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAutoscalingPolicyCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the resource representation for a cluster in a project. /// /// A builder for the *regions.clusters.get* method supported by a *project* resource. @@ -3324,7 +4449,7 @@ impl<'a, C, A> ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut ProjectRegionOperationTestIamPermissionCall<'a, C, A> where C: Bo /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_workflow_templates_list("parent") -/// .page_token("justo") -/// .page_size(-1) +/// .page_token("sea") +/// .page_size(-90) /// .doit(); /// # } /// ``` @@ -3871,7 +4996,9 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateListCall<'a, C, A> where C: Borrow } - /// Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} /// /// Sets the *parent* path property to the given value. /// @@ -4234,8 +5361,8 @@ impl<'a, C, A> ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut ProjectRegionWorkflowTemplateListCall<'a, C, A> where C: BorrowMu } - /// Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} /// /// Sets the *parent* path property to the given value. /// @@ -4478,7 +5607,7 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateListCall<'a, C, A> where C: BorrowMu } -/// Sets the access control policy on the specified resource. Replaces any existing policy. +/// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *regions.operations.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -4785,7 +5914,7 @@ impl<'a, C, A> ProjectRegionOperationSetIamPolicyCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_workflow_templates_get("name") -/// .version(-95) +/// .version(-21) /// .doit(); /// # } /// ``` @@ -4937,7 +6066,9 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateGetCall<'a, C, A> where C: BorrowM } - /// Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -4947,7 +6078,7 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateGetCall<'a, C, A> where C: BorrowM self._name = new_value.to_string(); self } - /// Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version. + /// Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version. /// /// Sets the *version* query property to the given value. pub fn version(mut self, new_value: i32) -> ProjectLocationWorkflowTemplateGetCall<'a, C, A> { @@ -5051,7 +6182,7 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateGetCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_jobs_patch(req, "projectId", "region", "jobId") -/// .update_mask("justo") +/// .update_mask("diam") /// .doit(); /// # } /// ``` @@ -5238,7 +6369,7 @@ impl<'a, C, A> ProjectRegionJobPatchCall<'a, C, A> where C: BorrowMut ProjectRegionJobTestIamPermissionCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_workflow_templates_delete("name") -/// .version(-17) +/// .version(-21) /// .doit(); /// # } /// ``` @@ -5787,7 +6918,9 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateDeleteCall<'a, C, A> where C: Borrow } - /// Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -5867,7 +7000,7 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateDeleteCall<'a, C, A> where C: Borrow } -/// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty. +/// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. /// /// A builder for the *regions.workflowTemplates.instantiate* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -6073,7 +7206,9 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateInstantiateCall<'a, C, A> where C: B self._request = new_value; self } - /// Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -6425,7 +7560,7 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateTestIamPermissionCall<'a, C, A> wh } -/// Sets the access control policy on the specified resource. Replaces any existing policy. +/// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *regions.clusters.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -6910,7 +8045,9 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateCreateCall<'a, C, A> where C: Borr self._request = new_value; self } - /// Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} /// /// Sets the *parent* path property to the given value. /// @@ -7262,7 +8399,7 @@ impl<'a, C, A> ProjectRegionClusterTestIamPermissionCall<'a, C, A> where C: Borr } -/// Updates a cluster in a project. +/// Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). /// /// A builder for the *regions.clusters.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -7296,9 +8433,9 @@ impl<'a, C, A> ProjectRegionClusterTestIamPermissionCall<'a, C, A> where C: Borr /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_clusters_patch(req, "projectId", "region", "clusterName") -/// .update_mask("eos") -/// .request_id("erat") -/// .graceful_decommission_timeout("sadipscing") +/// .update_mask("eirmod") +/// .request_id("elitr") +/// .graceful_decommission_timeout("amet") /// .doit(); /// # } /// ``` @@ -7493,7 +8630,7 @@ impl<'a, C, A> ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMutNote: Currently, only the following fields can be updated:
          Mask Purpose
          labels Update labels
          config.worker_config.num_instances Resize primary worker group
          config.secondary_worker_config.num_instances Resize secondary worker group
          + /// Note: Currently, only the following fields can be updated:
          Mask Purpose
          labels Update labels
          config.worker_config.num_instances Resize primary worker group
          config.secondary_worker_config.num_instances Resize secondary worker group
          config.autoscaling_config.policy_uriUse, stop using, or change autoscaling policies
          /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> ProjectRegionClusterPatchCall<'a, C, A> { @@ -7543,7 +8680,7 @@ impl<'a, C, A> ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> { @@ -7861,9 +8998,9 @@ impl<'a, C, A> ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut +pub struct ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dataproc, - _request: GetIamPolicyRequest, - _resource: String, + _request: AutoscalingPolicy, + _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalingPolicy)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -7924,11 +9061,11 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dataproc.projects.locations.autoscalingPolicies.getIamPolicy", + dlg.begin(MethodInfo { id: "dataproc.projects.regions.autoscalingPolicies.create", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7940,12 +9077,12 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + let mut url = self.hub._base_url.clone() + "v1/{+parent}/autoscalingPolicies"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -7960,7 +9097,7 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8063,18 +9200,20 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { + pub fn request(mut self, new_value: AutoscalingPolicy) -> ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + /// Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} /// - /// Sets the *resource* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> { + self._parent = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -8083,7 +9222,7 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8108,7 +9247,7 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8128,7 +9267,7 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectRegionAutoscalingPolicyCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8354,7 +9493,7 @@ impl<'a, C, A> ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut ProjectLocationWorkflowTemplateSetIamPolicyCall<'a, C, A> where C } -/// Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty. +/// Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. /// /// A builder for the *locations.workflowTemplates.instantiateInline* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -9039,7 +10178,7 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateSetIamPolicyCall<'a, C, A> where C /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_workflow_templates_instantiate_inline(req, "parent") -/// .request_id("aliquyam") +/// .request_id("et") /// .doit(); /// # } /// ``` @@ -9216,7 +10355,9 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateInstantiateInlineCall<'a, C, A> wh self._request = new_value; self } - /// Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} /// /// Sets the *parent* path property to the given value. /// @@ -9502,7 +10643,9 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateUpdateCall<'a, C, A> where C: Borr self._request = new_value; self } - /// Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -9575,7 +10718,7 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateUpdateCall<'a, C, A> where C: Borr } -/// Sets the access control policy on the specified resource. Replaces any existing policy. +/// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *regions.autoscalingPolicies.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -9854,7 +10997,7 @@ impl<'a, C, A> ProjectRegionAutoscalingPolicySetIamPolicyCall<'a, C, A> where C: } -/// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata.On successful completion, Operation.response will be Empty. +/// Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty. /// /// A builder for the *locations.workflowTemplates.instantiate* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -10060,7 +11203,9 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateInstantiateCall<'a, C, A> where C: self._request = new_value; self } - /// Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -10412,7 +11557,7 @@ impl<'a, C, A> ProjectRegionClusterGetIamPolicyCall<'a, C, A> where C: BorrowMut } -/// Lists all regions/{region}/clusters in a project. +/// Lists all regions/{region}/clusters in a project alphabetically. /// /// A builder for the *regions.clusters.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -10440,9 +11585,9 @@ impl<'a, C, A> ProjectRegionClusterGetIamPolicyCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_clusters_list("projectId", "region") -/// .page_token("eirmod") -/// .page_size(-58) -/// .filter("et") +/// .page_token("et") +/// .page_size(-45) +/// .filter("ut") /// .doit(); /// # } /// ``` @@ -10610,7 +11755,7 @@ impl<'a, C, A> ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> where C: BorrowMut ProjectRegionOperationCancelCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GetIamPolicyRequest::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_autoscaling_policies_get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.locations.autoscalingPolicies.getIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAutoscalingPolicyGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, Operation.response contains DiagnoseClusterResults (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). /// /// A builder for the *regions.clusters.diagnose* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -11763,7 +13187,7 @@ impl<'a, C, A> ProjectRegionClusterDiagnoseCall<'a, C, A> where C: BorrowMut ProjectRegionWorkflowTemplateUpdateCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -12125,7 +13551,544 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateUpdateCall<'a, C, A> where C: Borrow } -/// Sets the access control policy on the specified resource. Replaces any existing policy. +/// Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters. +/// +/// A builder for the *locations.autoscalingPolicies.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_autoscaling_policies_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.locations.autoscalingPolicies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAutoscalingPolicyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Submits job to a cluster. +/// +/// A builder for the *regions.jobs.submitAsOperation* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// use dataproc1::SubmitJobRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SubmitJobRequest::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().regions_jobs_submit_as_operation(req, "projectId", "region") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRegionJobSubmitAsOperationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _request: SubmitJobRequest, + _project_id: String, + _region: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRegionJobSubmitAsOperationCall<'a, C, A> {} + +impl<'a, C, A> ProjectRegionJobSubmitAsOperationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.regions.jobs.submitAsOperation", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("projectId", self._project_id.to_string())); + params.push(("region", self._region.to_string())); + for &field in ["alt", "projectId", "region"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/regions/{region}/jobs:submitAsOperation"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{region}", "region")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["region", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SubmitJobRequest) -> ProjectRegionJobSubmitAsOperationCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The ID of the Google Cloud Platform project that the job belongs to. + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectRegionJobSubmitAsOperationCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Required. The Dataproc region in which to handle the request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ProjectRegionJobSubmitAsOperationCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectRegionJobSubmitAsOperationCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRegionJobSubmitAsOperationCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRegionJobSubmitAsOperationCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *locations.autoscalingPolicies.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -12432,9 +14395,9 @@ impl<'a, C, A> ProjectLocationAutoscalingPolicySetIamPolicyCall<'a, C, A> where /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_operations_list("name") -/// .page_token("justo") -/// .page_size(-52) -/// .filter("vero") +/// .page_token("sadipscing") +/// .page_size(-88) +/// .filter("consetetur") /// .doit(); /// # } /// ``` @@ -12716,7 +14679,7 @@ impl<'a, C, A> ProjectRegionOperationListCall<'a, C, A> where C: BorrowMut ProjectLocationWorkflowTemplateDeleteCall<'a, C, A> where C: Borr } - /// Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -12948,7 +14913,569 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateDeleteCall<'a, C, A> where C: Borr } -/// Sets the access control policy on the specified resource. Replaces any existing policy. +/// Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. +/// +/// A builder for the *regions.autoscalingPolicies.update* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// use dataproc1::AutoscalingPolicy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AutoscalingPolicy::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().regions_autoscaling_policies_update(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _request: AutoscalingPolicy, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalingPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.regions.autoscalingPolicies.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AutoscalingPolicy) -> ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRegionAutoscalingPolicyUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements. +/// +/// A builder for the *locations.autoscalingPolicies.update* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// use dataproc1::AutoscalingPolicy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AutoscalingPolicy::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_autoscaling_policies_update(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _request: AutoscalingPolicy, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalingPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.locations.autoscalingPolicies.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AutoscalingPolicy) -> ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAutoscalingPolicyUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any existing policy.Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *regions.workflowTemplates.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -13227,6 +15754,256 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateSetIamPolicyCall<'a, C, A> where C: } +/// Retrieves autoscaling policy. +/// +/// A builder for the *locations.autoscalingPolicies.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_autoscaling_policies_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAutoscalingPolicyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAutoscalingPolicyGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAutoscalingPolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalingPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.locations.autoscalingPolicies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAutoscalingPolicyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAutoscalingPolicyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAutoscalingPolicyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAutoscalingPolicyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. /// /// A builder for the *regions.workflowTemplates.getIamPolicy* method supported by a *project* resource. @@ -13506,6 +16283,256 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateGetIamPolicyCall<'a, C, A> where C: } +/// Retrieves autoscaling policy. +/// +/// A builder for the *regions.autoscalingPolicies.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().regions_autoscaling_policies_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRegionAutoscalingPolicyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRegionAutoscalingPolicyGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectRegionAutoscalingPolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AutoscalingPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.regions.autoscalingPolicies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRegionAutoscalingPolicyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectRegionAutoscalingPolicyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRegionAutoscalingPolicyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRegionAutoscalingPolicyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. /// /// A builder for the *locations.autoscalingPolicies.testIamPermissions* method supported by a *project* resource. @@ -13970,7 +16997,7 @@ impl<'a, C, A> ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().regions_autoscaling_policies_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.regions.autoscalingPolicies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} + /// For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id} + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRegionAutoscalingPolicyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. /// /// A builder for the *locations.workflowTemplates.getIamPolicy* method supported by a *project* resource. @@ -14332,7 +17609,7 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateGetIamPolicyCall<'a, C, A> where C } -/// Deletes a cluster in a project. +/// Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). /// /// A builder for the *regions.clusters.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -14360,8 +17637,8 @@ impl<'a, C, A> ProjectLocationWorkflowTemplateGetIamPolicyCall<'a, C, A> where C /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_clusters_delete("projectId", "region", "clusterName") -/// .request_id("et") -/// .cluster_uuid("clita") +/// .request_id("rebum.") +/// .cluster_uuid("dolore") /// .doit(); /// # } /// ``` @@ -14527,7 +17804,7 @@ impl<'a, C, A> ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionWorkflowTemplateInstantiateInlineCall<'a, C, A> wher self._request = new_value; self } - /// Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location} /// /// Sets the *parent* path property to the given value. /// @@ -15194,6 +18473,280 @@ impl<'a, C, A> ProjectRegionAutoscalingPolicyTestIamPermissionCall<'a, C, A> whe } +/// Lists autoscaling policies in the project. +/// +/// A builder for the *regions.autoscalingPolicies.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dataproc1 as dataproc1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dataproc1::Dataproc; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().regions_autoscaling_policies_list("parent") +/// .page_token("eirmod") +/// .page_size(-46) +/// .doit(); +/// # } +/// ``` +pub struct ProjectRegionAutoscalingPolicyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRegionAutoscalingPolicyListCall<'a, C, A> {} + +impl<'a, C, A> ProjectRegionAutoscalingPolicyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAutoscalingPoliciesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.regions.autoscalingPolicies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/autoscalingPolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location} + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectRegionAutoscalingPolicyListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The page token, returned by a previous call, to request the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectRegionAutoscalingPolicyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectRegionAutoscalingPolicyListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectRegionAutoscalingPolicyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRegionAutoscalingPolicyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRegionAutoscalingPolicyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. /// /// A builder for the *regions.autoscalingPolicies.getIamPolicy* method supported by a *project* resource. @@ -15780,7 +19333,7 @@ impl<'a, C, A> ProjectRegionOperationGetIamPolicyCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().regions_workflow_templates_get("name") -/// .version(-27) +/// .version(-62) /// .doit(); /// # } /// ``` @@ -15932,7 +19485,9 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateGetCall<'a, C, A> where C: BorrowMut } - /// Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + /// For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id} /// /// Sets the *name* path property to the given value. /// @@ -15942,7 +19497,7 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateGetCall<'a, C, A> where C: BorrowMut self._name = new_value.to_string(); self } - /// Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version. + /// Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version. /// /// Sets the *version* query property to the given value. pub fn version(mut self, new_value: i32) -> ProjectRegionWorkflowTemplateGetCall<'a, C, A> { @@ -16218,7 +19773,9 @@ impl<'a, C, A> ProjectRegionWorkflowTemplateCreateCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + /// Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. + /// For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} + /// For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location} /// /// Sets the *parent* path property to the given value. /// @@ -16476,7 +20033,7 @@ impl<'a, C, A> ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionJobSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with datastore (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-datastore1] path = "../datastore1" -version = "1.0.12+20190421" +version = "1.0.13+20200311" diff --git a/gen/datastore1-cli/README.md b/gen/datastore1-cli/README.md index 52f6e96cd8..92ea000345 100644 --- a/gen/datastore1-cli/README.md +++ b/gen/datastore1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *datastore* API at revision *20190421*. The CLI is at version *1.0.12*. +This documentation was generated from the *datastore* API at revision *20200311*. The CLI is at version *1.0.13*. ```bash datastore1 [options] @@ -35,6 +35,8 @@ datastore1 [options] commit (-r )... [-p ]... [-o ] export (-r )... [-p ]... [-o ] import (-r )... [-p ]... [-o ] + indexes-create (-r )... [-p ]... [-o ] + indexes-delete [-p ]... [-o ] indexes-get [-p ]... [-o ] indexes-list [-p ]... [-o ] lookup (-r )... [-p ]... [-o ] diff --git a/gen/datastore1-cli/mkdocs.yml b/gen/datastore1-cli/mkdocs.yml index 61f2ff00b9..e20447ab9a 100644 --- a/gen/datastore1-cli/mkdocs.yml +++ b/gen/datastore1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: datastore v1.0.12+20190421 +site_name: datastore v1.0.13+20200311 site_url: http://byron.github.io/google-apis-rs/google-datastore1-cli site_description: A complete library to interact with datastore (protocol v1) @@ -14,6 +14,8 @@ pages: - ['projects_commit.md', 'Projects', 'Commit'] - ['projects_export.md', 'Projects', 'Export'] - ['projects_import.md', 'Projects', 'Import'] +- ['projects_indexes-create.md', 'Projects', 'Indexes Create'] +- ['projects_indexes-delete.md', 'Projects', 'Indexes Delete'] - ['projects_indexes-get.md', 'Projects', 'Indexes Get'] - ['projects_indexes-list.md', 'Projects', 'Indexes List'] - ['projects_lookup.md', 'Projects', 'Lookup'] diff --git a/gen/datastore1-cli/src/main.rs b/gen/datastore1-cli/src/main.rs index 4815008ff5..54b64cf9ed 100644 --- a/gen/datastore1-cli/src/main.rs +++ b/gen/datastore1-cli/src/main.rs @@ -477,6 +477,147 @@ impl<'n> Engine<'n> { } } + fn _projects_indexes_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "ancestor" => Some(("ancestor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "index-id" => Some(("indexId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["ancestor", "index-id", "kind", "project-id", "state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleDatastoreAdminV1Index = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().indexes_create(request, opt.value_of("project-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_indexes_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().indexes_delete(opt.value_of("project-id").unwrap_or(""), opt.value_of("index-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_indexes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().indexes_get(opt.value_of("project-id").unwrap_or(""), opt.value_of("index-id").unwrap_or("")); @@ -1199,6 +1340,12 @@ impl<'n> Engine<'n> { ("import", Some(opt)) => { call_result = self._projects_import(opt, dry_run, &mut err); }, + ("indexes-create", Some(opt)) => { + call_result = self._projects_indexes_create(opt, dry_run, &mut err); + }, + ("indexes-delete", Some(opt)) => { + call_result = self._projects_indexes_delete(opt, dry_run, &mut err); + }, ("indexes-get", Some(opt)) => { call_result = self._projects_indexes_get(opt, dry_run, &mut err); }, @@ -1320,7 +1467,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'allocate-ids', 'begin-transaction', 'commit', 'export', 'import', 'indexes-get', 'indexes-list', 'lookup', 'operations-cancel', 'operations-delete', 'operations-get', 'operations-list', 'reserve-ids', 'rollback' and 'run-query'", vec![ + ("projects", "methods: 'allocate-ids', 'begin-transaction', 'commit', 'export', 'import', 'indexes-create', 'indexes-delete', 'indexes-get', 'indexes-list', 'lookup', 'operations-cancel', 'operations-delete', 'operations-get', 'operations-list', 'reserve-ids', 'rollback' and 'run-query'", vec![ ("allocate-ids", Some(r##"Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted."##), @@ -1328,7 +1475,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -1356,7 +1503,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -1385,7 +1532,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -1420,7 +1567,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"Project ID against which to make the request."##), + Some(r##"Required. Project ID against which to make the request."##), Some(true), Some(false)), @@ -1449,6 +1596,46 @@ fn main() { created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore."##), "Details at http://byron.github.io/google-apis-rs/google_datastore1_cli/projects_import", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Required. Project ID against which to make the request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("indexes-create", + Some(r##"Creates the specified index. + A newly created index's initial state is `CREATING`. On completion of the + returned google.longrunning.Operation, the state will be `READY`. + If the index already exists, the call will return an `ALREADY_EXISTS` + status. + + During index creation, the process could result in an error, in which + case the index will move to the `ERROR` state. The process can be recovered + by fixing the data that caused the error, removing the index with + delete, then + re-creating the index with create. + + Indexes with a single property cannot be created."##), + "Details at http://byron.github.io/google-apis-rs/google_datastore1_cli/projects_indexes-create", vec![ (Some(r##"project-id"##), None, @@ -1468,6 +1655,43 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("indexes-delete", + Some(r##"Deletes an existing index. + An index can only be deleted if it is in a `READY` or `ERROR` state. On + successful execution of the request, the index will be in a `DELETING` + state. And on completion of the + returned google.longrunning.Operation, the index will be removed. + + During index deletion, the process could result in an error, in which + case the index will move to the `ERROR` state. The process can be recovered + by fixing the data that caused the error, followed by calling + delete again."##), + "Details at http://byron.github.io/google-apis-rs/google_datastore1_cli/projects_indexes-delete", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Project ID against which to make the request."##), + Some(true), + Some(false)), + + (Some(r##"index-id"##), + None, + Some(r##"The resource ID of the index to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1532,7 +1756,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -1672,7 +1896,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -1700,7 +1924,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -1728,7 +1952,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -1756,7 +1980,7 @@ fn main() { let mut app = App::new("datastore1") .author("Sebastian Thiel ") - .version("1.0.12+20190421") + .version("1.0.13+20200311") .about("Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_datastore1_cli") diff --git a/gen/datastore1/Cargo.toml b/gen/datastore1/Cargo.toml index 9cddf7663c..c116ba8138 100644 --- a/gen/datastore1/Cargo.toml +++ b/gen/datastore1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-datastore1" -version = "1.0.12+20190421" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with datastore (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1" homepage = "https://cloud.google.com/datastore/" -documentation = "https://docs.rs/google-datastore1/1.0.12+20190421" +documentation = "https://docs.rs/google-datastore1/1.0.13+20200311" license = "MIT" keywords = ["datastore", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/datastore1/README.md b/gen/datastore1/README.md index 3c4623bac1..a075d609f9 100644 --- a/gen/datastore1/README.md +++ b/gen/datastore1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-datastore1` library allows access to all features of the *Google datastore* service. -This documentation was generated from *datastore* crate version *1.0.12+20190421*, where *20190421* is the exact revision of the *datastore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *datastore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *datastore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *datastore* *v1* API can be found at the [official documentation site](https://cloud.google.com/datastore/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.Datastore.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.Datastore.html) ... * projects - * [*allocate ids*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectAllocateIdCall.html), [*begin transaction*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectBeginTransactionCall.html), [*commit*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectCommitCall.html), [*export*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectExportCall.html), [*import*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectImportCall.html), [*indexes get*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectIndexeGetCall.html), [*indexes list*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectIndexeListCall.html), [*lookup*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectLookupCall.html), [*operations cancel*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectOperationCancelCall.html), [*operations delete*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectOperationListCall.html), [*reserve ids*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectReserveIdCall.html), [*rollback*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectRollbackCall.html) and [*run query*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.ProjectRunQueryCall.html) + * [*allocate ids*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectAllocateIdCall.html), [*begin transaction*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectBeginTransactionCall.html), [*commit*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectCommitCall.html), [*export*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectExportCall.html), [*import*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectImportCall.html), [*indexes create*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectIndexeCreateCall.html), [*indexes delete*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectIndexeDeleteCall.html), [*indexes get*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectIndexeGetCall.html), [*indexes list*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectIndexeListCall.html), [*lookup*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectLookupCall.html), [*operations cancel*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectOperationCancelCall.html), [*operations delete*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectOperationListCall.html), [*reserve ids*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectReserveIdCall.html), [*rollback*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectRollbackCall.html) and [*run query*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.ProjectRunQueryCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/struct.Datastore.html)** +* **[Hub](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/struct.Datastore.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.Part.html)** + * **[Parts](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,8 +47,10 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().export(...).doit() +let r = hub.projects().indexes_create(...).doit() +let r = hub.projects().indexes_delete(...).doit() let r = hub.projects().operations_get(...).doit() +let r = hub.projects().export(...).doit() let r = hub.projects().import(...).doit() ``` @@ -83,7 +85,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_datastore1 as datastore1; -use datastore1::GoogleDatastoreAdminV1ExportEntitiesRequest; +use datastore1::GoogleDatastoreAdminV1Index; use datastore1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -104,12 +106,12 @@ let mut hub = Datastore::new(hyper::Client::with_connector(hyper::net::HttpsConn // 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 = GoogleDatastoreAdminV1ExportEntitiesRequest::default(); +let mut req = GoogleDatastoreAdminV1Index::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().export(req, "projectId") +let result = hub.projects().indexes_create(req, "projectId") .doit(); match result { @@ -132,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-datastore1/1.0.12+20190421/google_datastore1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-datastore1/1.0.13+20200311/google_datastore1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/datastore1/src/lib.rs b/gen/datastore1/src/lib.rs index 0721cfe7de..001d889836 100644 --- a/gen/datastore1/src/lib.rs +++ b/gen/datastore1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *datastore* crate version *1.0.12+20190421*, where *20190421* is the exact revision of the *datastore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *datastore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *datastore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *datastore* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/datastore/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Datastore.html) ... //! //! * projects -//! * [*allocate ids*](struct.ProjectAllocateIdCall.html), [*begin transaction*](struct.ProjectBeginTransactionCall.html), [*commit*](struct.ProjectCommitCall.html), [*export*](struct.ProjectExportCall.html), [*import*](struct.ProjectImportCall.html), [*indexes get*](struct.ProjectIndexeGetCall.html), [*indexes list*](struct.ProjectIndexeListCall.html), [*lookup*](struct.ProjectLookupCall.html), [*operations cancel*](struct.ProjectOperationCancelCall.html), [*operations delete*](struct.ProjectOperationDeleteCall.html), [*operations get*](struct.ProjectOperationGetCall.html), [*operations list*](struct.ProjectOperationListCall.html), [*reserve ids*](struct.ProjectReserveIdCall.html), [*rollback*](struct.ProjectRollbackCall.html) and [*run query*](struct.ProjectRunQueryCall.html) +//! * [*allocate ids*](struct.ProjectAllocateIdCall.html), [*begin transaction*](struct.ProjectBeginTransactionCall.html), [*commit*](struct.ProjectCommitCall.html), [*export*](struct.ProjectExportCall.html), [*import*](struct.ProjectImportCall.html), [*indexes create*](struct.ProjectIndexeCreateCall.html), [*indexes delete*](struct.ProjectIndexeDeleteCall.html), [*indexes get*](struct.ProjectIndexeGetCall.html), [*indexes list*](struct.ProjectIndexeListCall.html), [*lookup*](struct.ProjectLookupCall.html), [*operations cancel*](struct.ProjectOperationCancelCall.html), [*operations delete*](struct.ProjectOperationDeleteCall.html), [*operations get*](struct.ProjectOperationGetCall.html), [*operations list*](struct.ProjectOperationListCall.html), [*reserve ids*](struct.ProjectReserveIdCall.html), [*rollback*](struct.ProjectRollbackCall.html) and [*run query*](struct.ProjectRunQueryCall.html) //! //! //! @@ -47,8 +47,10 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().export(...).doit() +//! let r = hub.projects().indexes_create(...).doit() +//! let r = hub.projects().indexes_delete(...).doit() //! let r = hub.projects().operations_get(...).doit() +//! let r = hub.projects().export(...).doit() //! let r = hub.projects().import(...).doit() //! ``` //! @@ -83,7 +85,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_datastore1 as datastore1; -//! use datastore1::GoogleDatastoreAdminV1ExportEntitiesRequest; +//! use datastore1::GoogleDatastoreAdminV1Index; //! use datastore1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -105,12 +107,12 @@ //! // 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 = GoogleDatastoreAdminV1ExportEntitiesRequest::default(); +//! let mut req = GoogleDatastoreAdminV1Index::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().export(req, "projectId") +//! let result = hub.projects().indexes_create(req, "projectId") //! .doit(); //! //! match result { @@ -270,7 +272,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_datastore1 as datastore1; -/// use datastore1::GoogleDatastoreAdminV1ExportEntitiesRequest; +/// use datastore1::GoogleDatastoreAdminV1Index; /// use datastore1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -292,12 +294,12 @@ impl Default for Scope { /// // 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 = GoogleDatastoreAdminV1ExportEntitiesRequest::default(); +/// let mut req = GoogleDatastoreAdminV1Index::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().export(req, "projectId") +/// let result = hub.projects().indexes_create(req, "projectId") /// .doit(); /// /// match result { @@ -335,7 +337,7 @@ impl<'a, C, A> Datastore Datastore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://datastore.googleapis.com/".to_string(), _root_url: "https://datastore.googleapis.com/".to_string(), } @@ -346,7 +348,7 @@ impl<'a, C, A> Datastore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -388,7 +390,7 @@ impl<'a, C, A> Datastore pub struct GoogleDatastoreAdminV1ImportEntitiesRequest { /// Client-assigned labels. pub labels: Option>, - /// The full resource URL of the external storage location. Currently, only + /// Required. The full resource URL of the external storage location. Currently, only /// Google Cloud Storage is supported. So input_url should be of the form: /// `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where /// `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is @@ -455,11 +457,9 @@ impl Part for PartitionId {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleDatastoreAdminV1IndexedProperty { - /// The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. - /// Required. + /// Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. pub direction: Option, - /// The property name to index. - /// Required. + /// Required. The property name to index. pub name: Option, } @@ -477,7 +477,7 @@ impl Part for GoogleDatastoreAdminV1IndexedProperty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LookupRequest { - /// Keys of entities to look up. + /// Required. Keys of entities to look up. pub keys: Option>, /// The options for this lookup request. #[serde(rename="readOptions")] @@ -516,7 +516,7 @@ impl ResponseResult for BeginTransactionResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AllocateIdsRequest { - /// A list of keys with incomplete key paths for which to allocate IDs. + /// Required. A list of keys with incomplete key paths for which to allocate IDs. /// No key may be reserved/read-only. pub keys: Option>, } @@ -591,32 +591,28 @@ impl ResponseResult for RunQueryResponse {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [indexes create projects](struct.ProjectIndexeCreateCall.html) (request) /// * [indexes get projects](struct.ProjectIndexeGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleDatastoreAdminV1Index { - /// The entity kind to which this index applies. - /// Required. + /// Required. The entity kind to which this index applies. pub kind: Option, - /// Project ID. - /// Output only. + /// Output only. Project ID. #[serde(rename="projectId")] pub project_id: Option, - /// The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. - /// Required. + /// Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. pub ancestor: Option, - /// The resource ID of the index. - /// Output only. + /// Output only. The resource ID of the index. #[serde(rename="indexId")] pub index_id: Option, - /// The state of the index. - /// Output only. + /// Output only. The state of the index. pub state: Option, - /// An ordered sequence of property names and their index attributes. - /// Required. + /// Required. An ordered sequence of property names and their index attributes. pub properties: Option>, } +impl RequestValue for GoogleDatastoreAdminV1Index {} impl ResponseResult for GoogleDatastoreAdminV1Index {} @@ -662,58 +658,14 @@ impl ResponseResult for Empty {} /// The `Status` type defines a logical error model that is suitable for /// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](https://github.com/grpc). The error model is designed to be: +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. /// -/// * Simple to use and understand for most users -/// * Flexible enough to meet unexpected needs -/// -/// # Overview -/// -/// The `Status` message contains three pieces of data: error code, error -/// message, and error details. The error code should be an enum value of -/// google.rpc.Code, but it may accept additional error codes if needed. The -/// error message should be a developer-facing English message that helps -/// developers *understand* and *resolve* the error. If a localized user-facing -/// error message is needed, put the localized message in the error details or -/// localize it in the client. The optional error details may contain arbitrary -/// information about the error. There is a predefined set of error detail types -/// in the package `google.rpc` that can be used for common error conditions. -/// -/// # Language mapping -/// -/// The `Status` message is the logical representation of the error model, but it -/// is not necessarily the actual wire format. When the `Status` message is -/// exposed in different client libraries and different wire protocols, it can be -/// mapped differently. For example, it will likely be mapped to some exceptions -/// in Java, but more likely mapped to some error codes in C. -/// -/// # Other uses -/// -/// The error model and the `Status` message can be used in a variety of -/// environments, either with or without APIs, to provide a -/// consistent developer experience across different environments. -/// -/// Example uses of this error model include: -/// -/// * Partial errors. If a service needs to return partial errors to the client, -/// it may embed the `Status` in the normal response to indicate the partial -/// errors. -/// -/// * Workflow errors. A typical workflow has multiple steps. Each step may -/// have a `Status` message for error reporting. -/// -/// * Batch operations. If a client uses batch request and batch response, the -/// `Status` message should be used directly inside batch response, one for -/// each error sub-response. -/// -/// * Asynchronous operations. If an API call embeds asynchronous operation -/// results in its response, the status of those operations should be -/// represented directly using the `Status` message. -/// -/// * Logging. If some API errors are stored in logs, the message `Status` could -/// be used directly after any stripping needed for security/privacy reasons. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Status { /// A developer-facing error message, which should be in English. Any @@ -964,7 +916,7 @@ impl Part for MutationResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleDatastoreAdminV1ExportEntitiesRequest { - /// Location for the export metadata and data files. + /// Required. Location for the export metadata and data files. /// /// The full resource URL of the external storage location. Currently, only /// Google Cloud Storage is supported. So output_url_prefix should be of the @@ -1026,7 +978,7 @@ impl Part for TransactionOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReserveIdsRequest { - /// A list of keys with complete key paths whose numeric IDs should not be + /// Required. A list of keys with complete key paths whose numeric IDs should not be /// auto-allocated. pub keys: Option>, /// If not empty, the ID of the database against which to make the request. @@ -1371,8 +1323,10 @@ impl Part for ReadWrite {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [export projects](struct.ProjectExportCall.html) (response) +/// * [indexes create projects](struct.ProjectIndexeCreateCall.html) (response) +/// * [indexes delete projects](struct.ProjectIndexeDeleteCall.html) (response) /// * [operations get projects](struct.ProjectOperationGetCall.html) (response) +/// * [export projects](struct.ProjectExportCall.html) (response) /// * [import projects](struct.ProjectImportCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1394,7 +1348,7 @@ pub struct GoogleLongrunningOperation { pub response: Option>, /// The server-assigned name, which is only unique within the same service that /// originally returns it. If you use the default HTTP mapping, the - /// `name` should have the format of `operations/some/unique/name`. + /// `name` should be a resource name ending with `operations/{unique_id}`. pub name: Option, /// Service-specific metadata associated with the operation. It typically /// contains progress information and common metadata such as create time. @@ -1484,7 +1438,7 @@ impl Part for Entity {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RollbackRequest { - /// The transaction identifier, returned by a call to + /// Required. The transaction identifier, returned by a call to /// Datastore.BeginTransaction. pub transaction: Option, } @@ -1676,7 +1630,7 @@ impl Part for Mutation {} /// ::default(), None); /// let mut hub = Datastore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `allocate_ids(...)`, `begin_transaction(...)`, `commit(...)`, `export(...)`, `import(...)`, `indexes_get(...)`, `indexes_list(...)`, `lookup(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)`, `reserve_ids(...)`, `rollback(...)` and `run_query(...)` +/// // like `allocate_ids(...)`, `begin_transaction(...)`, `commit(...)`, `export(...)`, `import(...)`, `indexes_create(...)`, `indexes_delete(...)`, `indexes_get(...)`, `indexes_list(...)`, `lookup(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)`, `reserve_ids(...)`, `rollback(...)` and `run_query(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1722,21 +1676,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Exports a copy of all or a subset of entities from Google Cloud Datastore - /// to another storage system, such as Google Cloud Storage. Recent updates to - /// entities may not be reflected in the export. The export occurs in the - /// background and its progress can be monitored and managed via the - /// Operation resource that is created. The output of an export may only be - /// used once the associated operation is done. If an export operation is - /// cancelled before completion it may leave partial data behind in Google - /// Cloud Storage. + /// Creates the specified index. + /// A newly created index's initial state is `CREATING`. On completion of the + /// returned google.longrunning.Operation, the state will be `READY`. + /// If the index already exists, the call will return an `ALREADY_EXISTS` + /// status. + /// + /// During index creation, the process could result in an error, in which + /// case the index will move to the `ERROR` state. The process can be recovered + /// by fixing the data that caused the error, removing the index with + /// delete, then + /// re-creating the index with create. + /// + /// Indexes with a single property cannot be created. /// /// # Arguments /// /// * `request` - No description provided. /// * `projectId` - Project ID against which to make the request. - pub fn export(&self, request: GoogleDatastoreAdminV1ExportEntitiesRequest, project_id: &str) -> ProjectExportCall<'a, C, A> { - ProjectExportCall { + pub fn indexes_create(&self, request: GoogleDatastoreAdminV1Index, project_id: &str) -> ProjectIndexeCreateCall<'a, C, A> { + ProjectIndexeCreateCall { hub: self.hub, _request: request, _project_id: project_id.to_string(), @@ -1753,7 +1712,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn run_query(&self, request: RunQueryRequest, project_id: &str) -> ProjectRunQueryCall<'a, C, A> { ProjectRunQueryCall { hub: self.hub, @@ -1773,7 +1732,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn reserve_ids(&self, request: ReserveIdsRequest, project_id: &str) -> ProjectReserveIdCall<'a, C, A> { ProjectReserveIdCall { hub: self.hub, @@ -1785,6 +1744,32 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Exports a copy of all or a subset of entities from Google Cloud Datastore + /// to another storage system, such as Google Cloud Storage. Recent updates to + /// entities may not be reflected in the export. The export occurs in the + /// background and its progress can be monitored and managed via the + /// Operation resource that is created. The output of an export may only be + /// used once the associated operation is done. If an export operation is + /// cancelled before completion it may leave partial data behind in Google + /// Cloud Storage. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Required. Project ID against which to make the request. + pub fn export(&self, request: GoogleDatastoreAdminV1ExportEntitiesRequest, project_id: &str) -> ProjectExportCall<'a, C, A> { + ProjectExportCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Looks up entities by key. @@ -1792,7 +1777,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn lookup(&self, request: LookupRequest, project_id: &str) -> ProjectLookupCall<'a, C, A> { ProjectLookupCall { hub: self.hub, @@ -1812,7 +1797,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn commit(&self, request: CommitRequest, project_id: &str) -> ProjectCommitCall<'a, C, A> { ProjectCommitCall { hub: self.hub, @@ -1832,7 +1817,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn allocate_ids(&self, request: AllocateIdsRequest, project_id: &str) -> ProjectAllocateIdCall<'a, C, A> { ProjectAllocateIdCall { hub: self.hub, @@ -1909,6 +1894,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Begins a new transaction. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Required. The ID of the project against which to make the request. + pub fn begin_transaction(&self, request: BeginTransactionRequest, project_id: &str) -> ProjectBeginTransactionCall<'a, C, A> { + ProjectBeginTransactionCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets an index. @@ -1952,17 +1956,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Begins a new transaction. + /// Deletes an existing index. + /// An index can only be deleted if it is in a `READY` or `ERROR` state. On + /// successful execution of the request, the index will be in a `DELETING` + /// state. And on completion of the + /// returned google.longrunning.Operation, the index will be removed. + /// + /// During index deletion, the process could result in an error, in which + /// case the index will move to the `ERROR` state. The process can be recovered + /// by fixing the data that caused the error, followed by calling + /// delete again. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. - pub fn begin_transaction(&self, request: BeginTransactionRequest, project_id: &str) -> ProjectBeginTransactionCall<'a, C, A> { - ProjectBeginTransactionCall { + /// * `projectId` - Project ID against which to make the request. + /// * `indexId` - The resource ID of the index to delete. + pub fn indexes_delete(&self, project_id: &str, index_id: &str) -> ProjectIndexeDeleteCall<'a, C, A> { + ProjectIndexeDeleteCall { hub: self.hub, - _request: request, _project_id: project_id.to_string(), + _index_id: index_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1976,7 +1989,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn rollback(&self, request: RollbackRequest, project_id: &str) -> ProjectRollbackCall<'a, C, A> { ProjectRollbackCall { hub: self.hub, @@ -1999,7 +2012,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - Project ID against which to make the request. + /// * `projectId` - Required. Project ID against which to make the request. pub fn import(&self, request: GoogleDatastoreAdminV1ImportEntitiesRequest, project_id: &str) -> ProjectImportCall<'a, C, A> { ProjectImportCall { hub: self.hub, @@ -2313,16 +2326,21 @@ impl<'a, C, A> ProjectOperationListCall<'a, C, A> where C: BorrowMut ProjectOperationListCall<'a, C, A> where C: BorrowMut ProjectOperationListCall<'a, C, A> where C: BorrowMut +pub struct ProjectIndexeCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Datastore, - _request: GoogleDatastoreAdminV1ExportEntitiesRequest, + _request: GoogleDatastoreAdminV1Index, _project_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectExportCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectIndexeCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectIndexeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -2382,7 +2400,7 @@ impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "datastore.projects.export", + dlg.begin(MethodInfo { id: "datastore.projects.indexes.create", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("projectId", self._project_id.to_string())); @@ -2398,7 +2416,7 @@ impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}:export"; + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/indexes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2518,7 +2536,7 @@ impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleDatastoreAdminV1ExportEntitiesRequest) -> ProjectExportCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleDatastoreAdminV1Index) -> ProjectIndexeCreateCall<'a, C, A> { self._request = new_value; self } @@ -2528,7 +2546,7 @@ impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project_id(mut self, new_value: &str) -> ProjectExportCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectIndexeCreateCall<'a, C, A> { self._project_id = new_value.to_string(); self } @@ -2538,7 +2556,7 @@ impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExportCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectIndexeCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2563,7 +2581,7 @@ impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectExportCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectIndexeCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2583,7 +2601,7 @@ impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectExportCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectIndexeCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2797,7 +2815,7 @@ impl<'a, C, A> ProjectRunQueryCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -3073,7 +3091,7 @@ impl<'a, C, A> ProjectReserveIdCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -3146,6 +3164,288 @@ impl<'a, C, A> ProjectReserveIdCall<'a, C, A> where C: BorrowMut, } +/// Exports a copy of all or a subset of entities from Google Cloud Datastore +/// to another storage system, such as Google Cloud Storage. Recent updates to +/// entities may not be reflected in the export. The export occurs in the +/// background and its progress can be monitored and managed via the +/// Operation resource that is created. The output of an export may only be +/// used once the associated operation is done. If an export operation is +/// cancelled before completion it may leave partial data behind in Google +/// Cloud Storage. +/// +/// A builder for the *export* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_datastore1 as datastore1; +/// use datastore1::GoogleDatastoreAdminV1ExportEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use datastore1::Datastore; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Datastore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleDatastoreAdminV1ExportEntitiesRequest::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().export(req, "projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Datastore, + _request: GoogleDatastoreAdminV1ExportEntitiesRequest, + _project_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExportCall<'a, C, A> {} + +impl<'a, C, A> ProjectExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "datastore.projects.export", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}:export"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleDatastoreAdminV1ExportEntitiesRequest) -> ProjectExportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Project ID against which to make the request. + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectExportCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectExportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Looks up entities by key. /// /// A builder for the *lookup* method supported by a *project* resource. @@ -3348,7 +3648,7 @@ impl<'a, C, A> ProjectLookupCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -3624,7 +3924,7 @@ impl<'a, C, A> ProjectCommitCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -3900,7 +4200,7 @@ impl<'a, C, A> ProjectAllocateIdCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -4731,6 +5031,281 @@ impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Datastore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BeginTransactionRequest::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().begin_transaction(req, "projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBeginTransactionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Datastore, + _request: BeginTransactionRequest, + _project_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBeginTransactionCall<'a, C, A> {} + +impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BeginTransactionResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "datastore.projects.beginTransaction", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}:beginTransaction"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BeginTransactionRequest) -> ProjectBeginTransactionCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The ID of the project against which to make the request. + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectBeginTransactionCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBeginTransactionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBeginTransactionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBeginTransactionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets an index. /// /// A builder for the *indexes.get* method supported by a *project* resource. @@ -5017,9 +5592,9 @@ impl<'a, C, A> ProjectIndexeGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().indexes_list("projectId") -/// .page_token("ea") -/// .page_size(-61) -/// .filter("justo") +/// .page_token("justo") +/// .page_size(-21) +/// .filter("et") /// .doit(); /// # } /// ``` @@ -5269,9 +5844,18 @@ impl<'a, C, A> ProjectIndexeListCall<'a, C, A> where C: BorrowMut } -/// Begins a new transaction. +/// Deletes an existing index. +/// An index can only be deleted if it is in a `READY` or `ERROR` state. On +/// successful execution of the request, the index will be in a `DELETING` +/// state. And on completion of the +/// returned google.longrunning.Operation, the index will be removed. +/// +/// During index deletion, the process could result in an error, in which +/// case the index will move to the `ERROR` state. The process can be recovered +/// by fixing the data that caused the error, followed by calling +/// delete again. /// -/// A builder for the *beginTransaction* method supported by a *project* resource. +/// A builder for the *indexes.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -5283,7 +5867,6 @@ impl<'a, C, A> ProjectIndexeListCall<'a, C, A> where C: BorrowMut /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_datastore1 as datastore1; -/// use datastore1::BeginTransactionRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -5294,36 +5877,31 @@ impl<'a, C, A> ProjectIndexeListCall<'a, C, A> where C: BorrowMut /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Datastore::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BeginTransactionRequest::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().begin_transaction(req, "projectId") +/// let result = hub.projects().indexes_delete("projectId", "indexId") /// .doit(); /// # } /// ``` -pub struct ProjectBeginTransactionCall<'a, C, A> +pub struct ProjectIndexeDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Datastore, - _request: BeginTransactionRequest, _project_id: String, + _index_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectBeginTransactionCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectIndexeDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectIndexeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, BeginTransactionResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -5331,11 +5909,12 @@ impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "datastore.projects.beginTransaction", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "datastore.projects.indexes.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("projectId", self._project_id.to_string())); - for &field in ["alt", "projectId"].iter() { + params.push(("indexId", self._index_id.to_string())); + for &field in ["alt", "projectId", "indexId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5347,12 +5926,12 @@ impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -5363,8 +5942,8 @@ impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["projectId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["indexId", "projectId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5376,17 +5955,6 @@ impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut ProjectBeginTransactionCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the project against which to make the request. + /// Project ID against which to make the request. /// /// Sets the *project id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project_id(mut self, new_value: &str) -> ProjectBeginTransactionCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectIndexeDeleteCall<'a, C, A> { self._project_id = new_value.to_string(); self } + /// The resource ID of the index to delete. + /// + /// Sets the *index id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn index_id(mut self, new_value: &str) -> ProjectIndexeDeleteCall<'a, C, A> { + self._index_id = new_value.to_string(); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBeginTransactionCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectIndexeDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5512,7 +6077,7 @@ impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectBeginTransactionCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectIndexeDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5532,7 +6097,7 @@ impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectBeginTransactionCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectIndexeDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5746,7 +6311,7 @@ impl<'a, C, A> ProjectRollbackCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -6025,7 +6590,7 @@ impl<'a, C, A> ProjectImportCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Project ID against which to make the request. + /// Required. Project ID against which to make the request. /// /// Sets the *project id* path property to the given value. /// diff --git a/gen/datastore1_beta3-cli/Cargo.toml b/gen/datastore1_beta3-cli/Cargo.toml index 783d3fd1b5..b8d66b0864 100644 --- a/gen/datastore1_beta3-cli/Cargo.toml +++ b/gen/datastore1_beta3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-datastore1_beta3-cli" -version = "1.0.12+20190421" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with datastore (protocol v1beta3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1_beta3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-datastore1_beta3] path = "../datastore1_beta3" -version = "1.0.12+20190421" +version = "1.0.13+20200311" diff --git a/gen/datastore1_beta3-cli/README.md b/gen/datastore1_beta3-cli/README.md index 24a088bac8..65382bcdff 100644 --- a/gen/datastore1_beta3-cli/README.md +++ b/gen/datastore1_beta3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *datastore* API at revision *20190421*. The CLI is at version *1.0.12*. +This documentation was generated from the *datastore* API at revision *20200311*. The CLI is at version *1.0.13*. ```bash datastore1-beta3 [options] diff --git a/gen/datastore1_beta3-cli/mkdocs.yml b/gen/datastore1_beta3-cli/mkdocs.yml index 40a868162a..df418741d3 100644 --- a/gen/datastore1_beta3-cli/mkdocs.yml +++ b/gen/datastore1_beta3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: datastore v1.0.12+20190421 +site_name: datastore v1.0.13+20200311 site_url: http://byron.github.io/google-apis-rs/google-datastore1_beta3-cli site_description: A complete library to interact with datastore (protocol v1beta3) diff --git a/gen/datastore1_beta3-cli/src/main.rs b/gen/datastore1_beta3-cli/src/main.rs index 3d3f1c31cd..b0117360db 100644 --- a/gen/datastore1_beta3-cli/src/main.rs +++ b/gen/datastore1_beta3-cli/src/main.rs @@ -796,7 +796,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -824,7 +824,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -853,7 +853,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -881,7 +881,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -910,7 +910,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -938,7 +938,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -966,7 +966,7 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the project against which to make the request."##), + Some(r##"Required. The ID of the project against which to make the request."##), Some(true), Some(false)), @@ -994,7 +994,7 @@ fn main() { let mut app = App::new("datastore1-beta3") .author("Sebastian Thiel ") - .version("1.0.12+20190421") + .version("1.0.13+20200311") .about("Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_datastore1_beta3_cli") diff --git a/gen/datastore1_beta3/Cargo.toml b/gen/datastore1_beta3/Cargo.toml index 89a828ea5f..54c5847712 100644 --- a/gen/datastore1_beta3/Cargo.toml +++ b/gen/datastore1_beta3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-datastore1_beta3" -version = "1.0.12+20190421" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with datastore (protocol v1beta3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/datastore1_beta3" homepage = "https://cloud.google.com/datastore/" -documentation = "https://docs.rs/google-datastore1_beta3/1.0.12+20190421" +documentation = "https://docs.rs/google-datastore1_beta3/1.0.13+20200311" license = "MIT" keywords = ["datastore", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/datastore1_beta3/README.md b/gen/datastore1_beta3/README.md index c9234ee212..a5405279ef 100644 --- a/gen/datastore1_beta3/README.md +++ b/gen/datastore1_beta3/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-datastore1_beta3` library allows access to all features of the *Google datastore* service. -This documentation was generated from *datastore* crate version *1.0.12+20190421*, where *20190421* is the exact revision of the *datastore:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *datastore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *datastore:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *datastore* *v1_beta3* API can be found at the [official documentation site](https://cloud.google.com/datastore/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.Datastore.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.Datastore.html) ... * projects - * [*allocate ids*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.ProjectAllocateIdCall.html), [*begin transaction*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.ProjectBeginTransactionCall.html), [*commit*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.ProjectCommitCall.html), [*lookup*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.ProjectLookupCall.html), [*reserve ids*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.ProjectReserveIdCall.html), [*rollback*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.ProjectRollbackCall.html) and [*run query*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.ProjectRunQueryCall.html) + * [*allocate ids*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.ProjectAllocateIdCall.html), [*begin transaction*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.ProjectBeginTransactionCall.html), [*commit*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.ProjectCommitCall.html), [*lookup*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.ProjectLookupCall.html), [*reserve ids*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.ProjectReserveIdCall.html), [*rollback*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.ProjectRollbackCall.html) and [*run query*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.ProjectRunQueryCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/struct.Datastore.html)** +* **[Hub](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/struct.Datastore.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.Part.html)** + * **[Parts](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-datastore1_beta3/1.0.12+20190421/google_datastore1_beta3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-datastore1_beta3/1.0.13+20200311/google_datastore1_beta3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/datastore1_beta3/src/lib.rs b/gen/datastore1_beta3/src/lib.rs index 84cc35b137..23d479fd23 100644 --- a/gen/datastore1_beta3/src/lib.rs +++ b/gen/datastore1_beta3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *datastore* crate version *1.0.12+20190421*, where *20190421* is the exact revision of the *datastore:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *datastore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *datastore:v1beta3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *datastore* *v1_beta3* API can be found at the //! [official documentation site](https://cloud.google.com/datastore/). @@ -333,7 +333,7 @@ impl<'a, C, A> Datastore Datastore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://datastore.googleapis.com/".to_string(), _root_url: "https://datastore.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> Datastore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -418,7 +418,7 @@ impl Part for PartitionId {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LookupRequest { - /// Keys of entities to look up. + /// Required. Keys of entities to look up. pub keys: Option>, /// The options for this lookup request. #[serde(rename="readOptions")] @@ -457,7 +457,7 @@ impl ResponseResult for BeginTransactionResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AllocateIdsRequest { - /// A list of keys with incomplete key paths for which to allocate IDs. + /// Required. A list of keys with incomplete key paths for which to allocate IDs. /// No key may be reserved/read-only. pub keys: Option>, } @@ -781,7 +781,7 @@ impl Part for MutationResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReserveIdsRequest { - /// A list of keys with complete key paths whose numeric IDs should not be + /// Required. A list of keys with complete key paths whose numeric IDs should not be /// auto-allocated. pub keys: Option>, /// If not empty, the ID of the database against which to make the request. @@ -1153,7 +1153,7 @@ impl Part for Entity {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RollbackRequest { - /// The transaction identifier, returned by a call to + /// Required. The transaction identifier, returned by a call to /// Datastore.BeginTransaction. pub transaction: Option, } @@ -1340,7 +1340,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn run_query(&self, request: RunQueryRequest, project_id: &str) -> ProjectRunQueryCall<'a, C, A> { ProjectRunQueryCall { hub: self.hub, @@ -1360,7 +1360,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn reserve_ids(&self, request: ReserveIdsRequest, project_id: &str) -> ProjectReserveIdCall<'a, C, A> { ProjectReserveIdCall { hub: self.hub, @@ -1379,7 +1379,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn lookup(&self, request: LookupRequest, project_id: &str) -> ProjectLookupCall<'a, C, A> { ProjectLookupCall { hub: self.hub, @@ -1399,7 +1399,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn commit(&self, request: CommitRequest, project_id: &str) -> ProjectCommitCall<'a, C, A> { ProjectCommitCall { hub: self.hub, @@ -1419,7 +1419,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn allocate_ids(&self, request: AllocateIdsRequest, project_id: &str) -> ProjectAllocateIdCall<'a, C, A> { ProjectAllocateIdCall { hub: self.hub, @@ -1438,7 +1438,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn rollback(&self, request: RollbackRequest, project_id: &str) -> ProjectRollbackCall<'a, C, A> { ProjectRollbackCall { hub: self.hub, @@ -1457,7 +1457,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The ID of the project against which to make the request. + /// * `projectId` - Required. The ID of the project against which to make the request. pub fn begin_transaction(&self, request: BeginTransactionRequest, project_id: &str) -> ProjectBeginTransactionCall<'a, C, A> { ProjectBeginTransactionCall { hub: self.hub, @@ -1680,7 +1680,7 @@ impl<'a, C, A> ProjectRunQueryCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -1956,7 +1956,7 @@ impl<'a, C, A> ProjectReserveIdCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -2231,7 +2231,7 @@ impl<'a, C, A> ProjectLookupCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -2507,7 +2507,7 @@ impl<'a, C, A> ProjectCommitCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -2783,7 +2783,7 @@ impl<'a, C, A> ProjectAllocateIdCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -3058,7 +3058,7 @@ impl<'a, C, A> ProjectRollbackCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the project against which to make the request. + /// Required. The ID of the project against which to make the request. /// /// Sets the *project id* path property to the given value. /// @@ -3333,7 +3333,7 @@ impl<'a, C, A> ProjectBeginTransactionCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Deployment Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-deploymentmanager2] path = "../deploymentmanager2" -version = "1.0.12+20181207" +version = "1.0.13+20181207" diff --git a/gen/deploymentmanager2-cli/README.md b/gen/deploymentmanager2-cli/README.md index a130e6a92c..4d6b9151b9 100644 --- a/gen/deploymentmanager2-cli/README.md +++ b/gen/deploymentmanager2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Deployment Manager* API at revision *20181207*. The CLI is at version *1.0.12*. +This documentation was generated from the *Deployment Manager* API at revision *20181207*. The CLI is at version *1.0.13*. ```bash deploymentmanager2 [options] diff --git a/gen/deploymentmanager2-cli/mkdocs.yml b/gen/deploymentmanager2-cli/mkdocs.yml index 343909db9e..5ef01577e1 100644 --- a/gen/deploymentmanager2-cli/mkdocs.yml +++ b/gen/deploymentmanager2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Deployment Manager v1.0.12+20181207 +site_name: Deployment Manager v1.0.13+20181207 site_url: http://byron.github.io/google-apis-rs/google-deploymentmanager2-cli site_description: A complete library to interact with Deployment Manager (protocol v2) diff --git a/gen/deploymentmanager2-cli/src/main.rs b/gen/deploymentmanager2-cli/src/main.rs index b5737d090a..d16070d397 100644 --- a/gen/deploymentmanager2-cli/src/main.rs +++ b/gen/deploymentmanager2-cli/src/main.rs @@ -2139,7 +2139,7 @@ fn main() { let mut app = App::new("deploymentmanager2") .author("Sebastian Thiel ") - .version("1.0.12+20181207") + .version("1.0.13+20181207") .about("Declares, configures, and deploys complex solutions on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_deploymentmanager2_cli") .arg(Arg::with_name("url") diff --git a/gen/deploymentmanager2/Cargo.toml b/gen/deploymentmanager2/Cargo.toml index eb815edfe8..b9ac167a9b 100644 --- a/gen/deploymentmanager2/Cargo.toml +++ b/gen/deploymentmanager2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-deploymentmanager2" -version = "1.0.12+20181207" +version = "1.0.13+20181207" authors = ["Sebastian Thiel "] description = "A complete library to interact with Deployment Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2" homepage = "https://cloud.google.com/deployment-manager/" -documentation = "https://docs.rs/google-deploymentmanager2/1.0.12+20181207" +documentation = "https://docs.rs/google-deploymentmanager2/1.0.13+20181207" license = "MIT" keywords = ["deploymentmanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/deploymentmanager2/README.md b/gen/deploymentmanager2/README.md index edcb7bd484..02b65940c8 100644 --- a/gen/deploymentmanager2/README.md +++ b/gen/deploymentmanager2/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-deploymentmanager2` library allows access to all features of the *Google Deployment Manager* service. -This documentation was generated from *Deployment Manager* crate version *1.0.12+20181207*, where *20181207* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Deployment Manager* crate version *1.0.13+20181207*, where *20181207* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Deployment Manager* *v2* API can be found at the [official documentation site](https://cloud.google.com/deployment-manager/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentManager.html) ... -* [deployments](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.Deployment.html) - * [*cancel preview*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentCancelPreviewCall.html), [*delete*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentGetCall.html), [*get iam policy*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentGetIamPolicyCall.html), [*insert*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentPatchCall.html), [*set iam policy*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentSetIamPolicyCall.html), [*stop*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentStopCall.html), [*test iam permissions*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentTestIamPermissionCall.html) and [*update*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentUpdateCall.html) -* [manifests](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.Manifest.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.ManifestListCall.html) -* [operations](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.Operation.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.OperationListCall.html) -* [resources](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.ResourceType.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.ResourceListCall.html) -* [types](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.Type.html) - * [*list*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.TypeListCall.html) +* [deployments](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.Deployment.html) + * [*cancel preview*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentCancelPreviewCall.html), [*delete*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentGetCall.html), [*get iam policy*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentGetIamPolicyCall.html), [*insert*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentPatchCall.html), [*set iam policy*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentSetIamPolicyCall.html), [*stop*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentStopCall.html), [*test iam permissions*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentTestIamPermissionCall.html) and [*update*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentUpdateCall.html) +* [manifests](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.Manifest.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.ManifestListCall.html) +* [operations](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.Operation.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.OperationListCall.html) +* [resources](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.ResourceType.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.ResourceListCall.html) +* [types](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.Type.html) + * [*list*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.TypeListCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/struct.DeploymentManager.html)** +* **[Hub](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/struct.DeploymentManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.Part.html)** + * **[Parts](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -151,17 +151,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -171,29 +171,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-deploymentmanager2/1.0.12+20181207/google_deploymentmanager2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-deploymentmanager2/1.0.13+20181207/google_deploymentmanager2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/deploymentmanager2/src/lib.rs b/gen/deploymentmanager2/src/lib.rs index 57e5042b50..44412a97a0 100644 --- a/gen/deploymentmanager2/src/lib.rs +++ b/gen/deploymentmanager2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Deployment Manager* crate version *1.0.12+20181207*, where *20181207* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Deployment Manager* crate version *1.0.13+20181207*, where *20181207* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Deployment Manager* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/deployment-manager/). @@ -365,7 +365,7 @@ impl<'a, C, A> DeploymentManager DeploymentManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/deploymentmanager/v2/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -388,7 +388,7 @@ impl<'a, C, A> DeploymentManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/deploymentmanager2_beta2-cli/Cargo.toml b/gen/deploymentmanager2_beta2-cli/Cargo.toml index 66edeb8157..4f990f03bc 100644 --- a/gen/deploymentmanager2_beta2-cli/Cargo.toml +++ b/gen/deploymentmanager2_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-deploymentmanager2_beta2-cli" -version = "1.0.12+20160201" +version = "1.0.13+20160201" authors = ["Sebastian Thiel "] description = "A complete library to interact with Deployment Manager (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-deploymentmanager2_beta2] path = "../deploymentmanager2_beta2" -version = "1.0.12+20160201" +version = "1.0.13+20160201" diff --git a/gen/deploymentmanager2_beta2-cli/README.md b/gen/deploymentmanager2_beta2-cli/README.md index ab24c9de26..26e9dd1d3a 100644 --- a/gen/deploymentmanager2_beta2-cli/README.md +++ b/gen/deploymentmanager2_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Deployment Manager* API at revision *20160201*. The CLI is at version *1.0.12*. +This documentation was generated from the *Deployment Manager* API at revision *20160201*. The CLI is at version *1.0.13*. ```bash deploymentmanager2-beta2 [options] diff --git a/gen/deploymentmanager2_beta2-cli/mkdocs.yml b/gen/deploymentmanager2_beta2-cli/mkdocs.yml index 6ae1f7293b..95d26a215e 100644 --- a/gen/deploymentmanager2_beta2-cli/mkdocs.yml +++ b/gen/deploymentmanager2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Deployment Manager v1.0.12+20160201 +site_name: Deployment Manager v1.0.13+20160201 site_url: http://byron.github.io/google-apis-rs/google-deploymentmanager2_beta2-cli site_description: A complete library to interact with Deployment Manager (protocol v2beta2) diff --git a/gen/deploymentmanager2_beta2-cli/src/main.rs b/gen/deploymentmanager2_beta2-cli/src/main.rs index 027503878c..9612c252e4 100644 --- a/gen/deploymentmanager2_beta2-cli/src/main.rs +++ b/gen/deploymentmanager2_beta2-cli/src/main.rs @@ -1479,7 +1479,7 @@ fn main() { let mut app = App::new("deploymentmanager2-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20160201") + .version("1.0.13+20160201") .about("The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_deploymentmanager2_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/deploymentmanager2_beta2/Cargo.toml b/gen/deploymentmanager2_beta2/Cargo.toml index 67f82552e4..be214bdafa 100644 --- a/gen/deploymentmanager2_beta2/Cargo.toml +++ b/gen/deploymentmanager2_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-deploymentmanager2_beta2" -version = "1.0.12+20160201" +version = "1.0.13+20160201" authors = ["Sebastian Thiel "] description = "A complete library to interact with Deployment Manager (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/deploymentmanager2_beta2" homepage = "https://developers.google.com/deployment-manager/" -documentation = "https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201" +documentation = "https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201" license = "MIT" keywords = ["deploymentmanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/deploymentmanager2_beta2/README.md b/gen/deploymentmanager2_beta2/README.md index bb3dde9ea2..741bcfe37f 100644 --- a/gen/deploymentmanager2_beta2/README.md +++ b/gen/deploymentmanager2_beta2/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-deploymentmanager2_beta2` library allows access to all features of the *Google Deployment Manager* service. -This documentation was generated from *Deployment Manager* crate version *1.0.12+20160201*, where *20160201* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Deployment Manager* crate version *1.0.13+20160201*, where *20160201* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Deployment Manager* *v2_beta2* API can be found at the [official documentation site](https://developers.google.com/deployment-manager/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentManager.html) ... -* [deployments](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.Deployment.html) - * [*delete*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentGetCall.html), [*insert*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentPatchCall.html) and [*update*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentUpdateCall.html) -* [manifests](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.Manifest.html) - * [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.ManifestListCall.html) -* [operations](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.Operation.html) - * [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.OperationListCall.html) -* [resources](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.ResourceType.html) - * [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.ResourceListCall.html) -* [types](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.Type.html) - * [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.TypeListCall.html) +* [deployments](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.Deployment.html) + * [*delete*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentGetCall.html), [*insert*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentPatchCall.html) and [*update*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentUpdateCall.html) +* [manifests](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.Manifest.html) + * [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.ManifestListCall.html) +* [operations](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.Operation.html) + * [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.OperationListCall.html) +* [resources](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.ResourceType.html) + * [*get*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.ResourceListCall.html) +* [types](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.Type.html) + * [*list*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.TypeListCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/struct.DeploymentManager.html)** +* **[Hub](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/struct.DeploymentManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -146,17 +146,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -166,29 +166,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-deploymentmanager2_beta2/1.0.12+20160201/google_deploymentmanager2_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-deploymentmanager2_beta2/1.0.13+20160201/google_deploymentmanager2_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/deploymentmanager2_beta2/src/lib.rs b/gen/deploymentmanager2_beta2/src/lib.rs index 506ffc9d33..6efddcbdda 100644 --- a/gen/deploymentmanager2_beta2/src/lib.rs +++ b/gen/deploymentmanager2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Deployment Manager* crate version *1.0.12+20160201*, where *20160201* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Deployment Manager* crate version *1.0.13+20160201*, where *20160201* is the exact revision of the *deploymentmanager:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Deployment Manager* *v2_beta2* API can be found at the //! [official documentation site](https://developers.google.com/deployment-manager/). @@ -360,7 +360,7 @@ impl<'a, C, A> DeploymentManager DeploymentManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/deploymentmanager/v2beta2/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -383,7 +383,7 @@ impl<'a, C, A> DeploymentManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dfareporting2d8-cli/Cargo.toml b/gen/dfareporting2d8-cli/Cargo.toml index 3354f08e00..a1bde877ee 100644 --- a/gen/dfareporting2d8-cli/Cargo.toml +++ b/gen/dfareporting2d8-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2d8-cli" -version = "1.0.12+20180830" +version = "1.0.13+20180830" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.8)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d8-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dfareporting2d8] path = "../dfareporting2d8" -version = "1.0.12+20180830" +version = "1.0.13+20180830" diff --git a/gen/dfareporting2d8-cli/README.md b/gen/dfareporting2d8-cli/README.md index 8cc65783f5..1018cf36da 100644 --- a/gen/dfareporting2d8-cli/README.md +++ b/gen/dfareporting2d8-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dfareporting* API at revision *20180830*. The CLI is at version *1.0.12*. +This documentation was generated from the *dfareporting* API at revision *20180830*. The CLI is at version *1.0.13*. ```bash dfareporting2d8 [options] diff --git a/gen/dfareporting2d8-cli/mkdocs.yml b/gen/dfareporting2d8-cli/mkdocs.yml index 3d3bdcb794..4e6e17435b 100644 --- a/gen/dfareporting2d8-cli/mkdocs.yml +++ b/gen/dfareporting2d8-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.12+20180830 +site_name: dfareporting v1.0.13+20180830 site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d8-cli site_description: A complete library to interact with dfareporting (protocol v2.8) diff --git a/gen/dfareporting2d8-cli/src/main.rs b/gen/dfareporting2d8-cli/src/main.rs index 2cc83d8ed8..40ed969906 100644 --- a/gen/dfareporting2d8-cli/src/main.rs +++ b/gen/dfareporting2d8-cli/src/main.rs @@ -23769,7 +23769,7 @@ fn main() { let mut app = App::new("dfareporting2d8") .author("Sebastian Thiel ") - .version("1.0.12+20180830") + .version("1.0.13+20180830") .about("Manages your DoubleClick Campaign Manager ad campaigns and reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting2d8_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting2d8/Cargo.toml b/gen/dfareporting2d8/Cargo.toml index a4cc9b20a1..a3146c8623 100644 --- a/gen/dfareporting2d8/Cargo.toml +++ b/gen/dfareporting2d8/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting2d8" -version = "1.0.12+20180830" +version = "1.0.13+20180830" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.8)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d8" homepage = "https://developers.google.com/doubleclick-advertisers/" -documentation = "https://docs.rs/google-dfareporting2d8/1.0.12+20180830" +documentation = "https://docs.rs/google-dfareporting2d8/1.0.13+20180830" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dfareporting2d8/README.md b/gen/dfareporting2d8/README.md index aaa729f4fc..adc4e44a2c 100644 --- a/gen/dfareporting2d8/README.md +++ b/gen/dfareporting2d8/README.md @@ -5,144 +5,144 @@ DO NOT EDIT ! --> The `google-dfareporting2d8` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.12+20180830*, where *20180830* is the exact revision of the *dfareporting:v2.8* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *dfareporting* crate version *1.0.13+20180830*, where *20180830* is the exact revision of the *dfareporting:v2.8* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *dfareporting* *v2d8* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGroupUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ConversionBatchupdateCall.html) -* [countries](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DimensionValueQueryCall.html) -* [directory site contacts](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DirectorySiteContact.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DirectorySiteContactListCall.html) -* [directory sites](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.InventoryItemListCall.html) -* [landing pages](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LandingPage.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LandingPageUpdateCall.html) -* [languages](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Language.html) - * [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.LanguageListCall.html) -* [metros](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.MetroListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetableRemarketingListListCall.html) -* [targeting templates](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetingTemplate.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.TargetingTemplateUpdateCall.html) -* [user profiles](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.UserRoleUpdateCall.html) -* [video formats](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.VideoFormat.html) - * [*get*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.VideoFormatListCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGroupUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ConversionBatchupdateCall.html) +* [countries](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.InventoryItemListCall.html) +* [landing pages](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LandingPage.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LandingPageUpdateCall.html) +* [languages](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.VideoFormatListCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.ReportFileGetCall.html) @@ -150,17 +150,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -265,17 +265,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -285,29 +285,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dfareporting2d8/1.0.12+20180830/google_dfareporting2d8/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting2d8/1.0.13+20180830/google_dfareporting2d8/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dfareporting2d8/src/lib.rs b/gen/dfareporting2d8/src/lib.rs index cb9bdb809e..e91974825e 100644 --- a/gen/dfareporting2d8/src/lib.rs +++ b/gen/dfareporting2d8/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dfareporting* crate version *1.0.12+20180830*, where *20180830* is the exact revision of the *dfareporting:v2.8* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *dfareporting* crate version *1.0.13+20180830*, where *20180830* is the exact revision of the *dfareporting:v2.8* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *dfareporting* *v2d8* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/). @@ -471,7 +471,7 @@ impl<'a, C, A> Dfareporting Dfareporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/dfareporting/v2.8/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -659,7 +659,7 @@ impl<'a, C, A> Dfareporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dfareporting3-cli/Cargo.toml b/gen/dfareporting3-cli/Cargo.toml index 3b26592d5b..c7aaaabb50 100644 --- a/gen/dfareporting3-cli/Cargo.toml +++ b/gen/dfareporting3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting3-cli" -version = "1.0.12+20180830" +version = "1.0.13+20180830" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v3.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dfareporting3] path = "../dfareporting3" -version = "1.0.12+20180830" +version = "1.0.13+20180830" diff --git a/gen/dfareporting3-cli/README.md b/gen/dfareporting3-cli/README.md index 9808523a0b..8bd9caa890 100644 --- a/gen/dfareporting3-cli/README.md +++ b/gen/dfareporting3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dfareporting* API at revision *20180830*. The CLI is at version *1.0.12*. +This documentation was generated from the *dfareporting* API at revision *20180830*. The CLI is at version *1.0.13*. ```bash dfareporting3 [options] diff --git a/gen/dfareporting3-cli/mkdocs.yml b/gen/dfareporting3-cli/mkdocs.yml index b028829438..902c332da2 100644 --- a/gen/dfareporting3-cli/mkdocs.yml +++ b/gen/dfareporting3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.12+20180830 +site_name: dfareporting v1.0.13+20180830 site_url: http://byron.github.io/google-apis-rs/google-dfareporting3-cli site_description: A complete library to interact with dfareporting (protocol v3.0) diff --git a/gen/dfareporting3-cli/src/main.rs b/gen/dfareporting3-cli/src/main.rs index 9bf9f01a1d..68ca286021 100644 --- a/gen/dfareporting3-cli/src/main.rs +++ b/gen/dfareporting3-cli/src/main.rs @@ -23698,7 +23698,7 @@ fn main() { let mut app = App::new("dfareporting3") .author("Sebastian Thiel ") - .version("1.0.12+20180830") + .version("1.0.13+20180830") .about("Manages your DoubleClick Campaign Manager ad campaigns and reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting3_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting3/Cargo.toml b/gen/dfareporting3/Cargo.toml index a62a72c687..1a61eb5055 100644 --- a/gen/dfareporting3/Cargo.toml +++ b/gen/dfareporting3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting3" -version = "1.0.12+20180830" +version = "1.0.13+20180830" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v3.0)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3" homepage = "https://developers.google.com/doubleclick-advertisers/" -documentation = "https://docs.rs/google-dfareporting3/1.0.12+20180830" +documentation = "https://docs.rs/google-dfareporting3/1.0.13+20180830" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dfareporting3/README.md b/gen/dfareporting3/README.md index dbaf7fcd11..52a6a2a7d3 100644 --- a/gen/dfareporting3/README.md +++ b/gen/dfareporting3/README.md @@ -5,144 +5,144 @@ DO NOT EDIT ! --> The `google-dfareporting3` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.12+20180830*, where *20180830* is the exact revision of the *dfareporting:v3.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *dfareporting* crate version *1.0.13+20180830*, where *20180830* is the exact revision of the *dfareporting:v3.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *dfareporting* *v3* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGroupUpdateCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGroupUpdateCall.html) * advertiser landing pages - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserLandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserLandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserLandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserLandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserLandingPageUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ConversionBatchupdateCall.html) -* [countries](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DimensionValueQueryCall.html) -* [directory site contacts](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DirectorySiteContact.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DirectorySiteContactListCall.html) -* [directory sites](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.InventoryItemListCall.html) -* [languages](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Language.html) - * [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.LanguageListCall.html) -* [metros](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.MetroListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetableRemarketingListListCall.html) -* [targeting templates](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetingTemplate.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.TargetingTemplateUpdateCall.html) -* [user profiles](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.UserRoleUpdateCall.html) -* [video formats](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.VideoFormat.html) - * [*get*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.VideoFormatListCall.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserLandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserLandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserLandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserLandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserLandingPageUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ConversionBatchupdateCall.html) +* [countries](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.InventoryItemListCall.html) +* [languages](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.VideoFormatListCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.ReportFileGetCall.html) @@ -150,17 +150,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -265,17 +265,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -285,29 +285,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dfareporting3/1.0.12+20180830/google_dfareporting3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting3/1.0.13+20180830/google_dfareporting3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dfareporting3/src/lib.rs b/gen/dfareporting3/src/lib.rs index c353f7a7a4..de75c80f36 100644 --- a/gen/dfareporting3/src/lib.rs +++ b/gen/dfareporting3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dfareporting* crate version *1.0.12+20180830*, where *20180830* is the exact revision of the *dfareporting:v3.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *dfareporting* crate version *1.0.13+20180830*, where *20180830* is the exact revision of the *dfareporting:v3.0* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *dfareporting* *v3* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/). @@ -471,7 +471,7 @@ impl<'a, C, A> Dfareporting Dfareporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/dfareporting/v3.0/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -659,7 +659,7 @@ impl<'a, C, A> Dfareporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dfareporting3d2-cli/Cargo.toml b/gen/dfareporting3d2-cli/Cargo.toml index 118eafd186..c612443c5e 100644 --- a/gen/dfareporting3d2-cli/Cargo.toml +++ b/gen/dfareporting3d2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting3d2-cli" -version = "1.0.12+20190531" +version = "1.0.13+20190531" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v3.2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3d2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dfareporting3d2] path = "../dfareporting3d2" -version = "1.0.12+20190531" +version = "1.0.13+20190531" diff --git a/gen/dfareporting3d2-cli/README.md b/gen/dfareporting3d2-cli/README.md index bb1d58ea9c..3558061f44 100644 --- a/gen/dfareporting3d2-cli/README.md +++ b/gen/dfareporting3d2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dfareporting* API at revision *20190531*. The CLI is at version *1.0.12*. +This documentation was generated from the *dfareporting* API at revision *20190531*. The CLI is at version *1.0.13*. ```bash dfareporting3d2 [options] diff --git a/gen/dfareporting3d2-cli/mkdocs.yml b/gen/dfareporting3d2-cli/mkdocs.yml index 33c765ad40..cbddd96156 100644 --- a/gen/dfareporting3d2-cli/mkdocs.yml +++ b/gen/dfareporting3d2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.12+20190531 +site_name: dfareporting v1.0.13+20190531 site_url: http://byron.github.io/google-apis-rs/google-dfareporting3d2-cli site_description: A complete library to interact with dfareporting (protocol v3.2) diff --git a/gen/dfareporting3d2-cli/src/main.rs b/gen/dfareporting3d2-cli/src/main.rs index c8cce2e6fb..a260e7b6f9 100644 --- a/gen/dfareporting3d2-cli/src/main.rs +++ b/gen/dfareporting3d2-cli/src/main.rs @@ -23888,7 +23888,7 @@ fn main() { let mut app = App::new("dfareporting3d2") .author("Sebastian Thiel ") - .version("1.0.12+20190531") + .version("1.0.13+20190531") .about("Manages your DoubleClick Campaign Manager ad campaigns and reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting3d2_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting3d2/Cargo.toml b/gen/dfareporting3d2/Cargo.toml index a4260fe86a..8e6ff177fe 100644 --- a/gen/dfareporting3d2/Cargo.toml +++ b/gen/dfareporting3d2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting3d2" -version = "1.0.12+20190531" +version = "1.0.13+20190531" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v3.2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3d2" homepage = "https://developers.google.com/doubleclick-advertisers/" -documentation = "https://docs.rs/google-dfareporting3d2/1.0.12+20190531" +documentation = "https://docs.rs/google-dfareporting3d2/1.0.13+20190531" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dfareporting3d2/README.md b/gen/dfareporting3d2/README.md index a2de4b8366..a2d162c4aa 100644 --- a/gen/dfareporting3d2/README.md +++ b/gen/dfareporting3d2/README.md @@ -5,146 +5,146 @@ DO NOT EDIT ! --> The `google-dfareporting3d2` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.12+20190531*, where *20190531* is the exact revision of the *dfareporting:v3.2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *dfareporting* crate version *1.0.13+20190531*, where *20190531* is the exact revision of the *dfareporting:v3.2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *dfareporting* *v3d2* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGroupUpdateCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGroupUpdateCall.html) * advertiser landing pages - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserLandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ConversionBatchupdateCall.html) -* [countries](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DimensionValueQueryCall.html) -* [directory site contacts](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DirectorySiteContact.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DirectorySiteContactListCall.html) -* [directory sites](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.InventoryItemListCall.html) -* [languages](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Language.html) - * [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.LanguageListCall.html) -* [metros](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.MetroListCall.html) -* [mobile apps](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.MobileApp.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.MobileAppGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.MobileAppListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetableRemarketingListListCall.html) -* [targeting templates](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetingTemplate.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.TargetingTemplateUpdateCall.html) -* [user profiles](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.UserRoleUpdateCall.html) -* [video formats](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.VideoFormat.html) - * [*get*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.VideoFormatListCall.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserLandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserLandingPageUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ConversionBatchupdateCall.html) +* [countries](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.InventoryItemListCall.html) +* [languages](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.MetroListCall.html) +* [mobile apps](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.MobileApp.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.MobileAppGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.MobileAppListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.VideoFormatListCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.ReportFileGetCall.html) @@ -152,17 +152,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -267,17 +267,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -287,29 +287,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dfareporting3d2/1.0.12+20190531/google_dfareporting3d2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting3d2/1.0.13+20190531/google_dfareporting3d2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dfareporting3d2/src/lib.rs b/gen/dfareporting3d2/src/lib.rs index f505bd20e2..901b7775ab 100644 --- a/gen/dfareporting3d2/src/lib.rs +++ b/gen/dfareporting3d2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dfareporting* crate version *1.0.12+20190531*, where *20190531* is the exact revision of the *dfareporting:v3.2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *dfareporting* crate version *1.0.13+20190531*, where *20190531* is the exact revision of the *dfareporting:v3.2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *dfareporting* *v3d2* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/). @@ -473,7 +473,7 @@ impl<'a, C, A> Dfareporting Dfareporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/dfareporting/v3.2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -664,7 +664,7 @@ impl<'a, C, A> Dfareporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dfareporting3d3-cli/Cargo.toml b/gen/dfareporting3d3-cli/Cargo.toml index 9765033308..a42dc12ebf 100644 --- a/gen/dfareporting3d3-cli/Cargo.toml +++ b/gen/dfareporting3d3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting3d3-cli" -version = "1.0.12+20190531" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v3.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3d3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dfareporting3d3] path = "../dfareporting3d3" -version = "1.0.12+20190531" +version = "1.0.13+20200326" diff --git a/gen/dfareporting3d3-cli/README.md b/gen/dfareporting3d3-cli/README.md index c4c1e79c65..9fc3825025 100644 --- a/gen/dfareporting3d3-cli/README.md +++ b/gen/dfareporting3d3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dfareporting* API at revision *20190531*. The CLI is at version *1.0.12*. +This documentation was generated from the *dfareporting* API at revision *20200326*. The CLI is at version *1.0.13*. ```bash dfareporting3d3 [options] diff --git a/gen/dfareporting3d3-cli/mkdocs.yml b/gen/dfareporting3d3-cli/mkdocs.yml index e797e394ba..ffa649b18d 100644 --- a/gen/dfareporting3d3-cli/mkdocs.yml +++ b/gen/dfareporting3d3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.12+20190531 +site_name: dfareporting v1.0.13+20200326 site_url: http://byron.github.io/google-apis-rs/google-dfareporting3d3-cli site_description: A complete library to interact with dfareporting (protocol v3.3) diff --git a/gen/dfareporting3d3-cli/src/main.rs b/gen/dfareporting3d3-cli/src/main.rs index cd0da62b02..b40332a048 100644 --- a/gen/dfareporting3d3-cli/src/main.rs +++ b/gen/dfareporting3d3-cli/src/main.rs @@ -22537,12 +22537,12 @@ fn main() { Some(true)), ]), ("files-get", - Some(r##"Retrieves a report file. This method supports media download."##), + Some(r##"Retrieves a report file by its report ID and file ID. This method supports media download."##), "Details at http://byron.github.io/google-apis-rs/google_dfareporting3d3_cli/reports_files-get", vec![ (Some(r##"profile-id"##), None, - Some(r##"The DFA profile ID."##), + Some(r##"The DFA user profile ID."##), Some(true), Some(false)), @@ -22576,13 +22576,13 @@ fn main() { vec![ (Some(r##"profile-id"##), None, - Some(r##"The DFA profile ID."##), + Some(r##"The DFA user profile ID."##), Some(true), Some(false)), (Some(r##"report-id"##), None, - Some(r##"The ID of the parent report."##), + Some(r##"The ID of the report."##), Some(true), Some(false)), @@ -23712,7 +23712,7 @@ fn main() { let mut app = App::new("dfareporting3d3") .author("Sebastian Thiel ") - .version("1.0.12+20190531") + .version("1.0.13+20200326") .about("Manages your DoubleClick Campaign Manager ad campaigns and reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting3d3_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting3d3/Cargo.toml b/gen/dfareporting3d3/Cargo.toml index 0ae30b3e71..9bd6d32735 100644 --- a/gen/dfareporting3d3/Cargo.toml +++ b/gen/dfareporting3d3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting3d3" -version = "1.0.12+20190531" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v3.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting3d3" homepage = "https://developers.google.com/doubleclick-advertisers/" -documentation = "https://docs.rs/google-dfareporting3d3/1.0.12+20190531" +documentation = "https://docs.rs/google-dfareporting3d3/1.0.13+20200326" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dfareporting3d3/README.md b/gen/dfareporting3d3/README.md index 631ad546c0..9efff5a9be 100644 --- a/gen/dfareporting3d3/README.md +++ b/gen/dfareporting3d3/README.md @@ -5,144 +5,144 @@ DO NOT EDIT ! --> The `google-dfareporting3d3` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.12+20190531*, where *20190531* is the exact revision of the *dfareporting:v3.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *dfareporting* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *dfareporting:v3.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *dfareporting* *v3d3* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGroupUpdateCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGroupUpdateCall.html) * advertiser landing pages - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserLandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserLandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserLandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserLandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserLandingPageUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ConversionBatchupdateCall.html) -* [countries](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DimensionValueQueryCall.html) -* [directory sites](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.InventoryItemListCall.html) -* [languages](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Language.html) - * [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.LanguageListCall.html) -* [metros](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.MetroListCall.html) -* [mobile apps](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.MobileApp.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.MobileAppGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.MobileAppListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetableRemarketingListListCall.html) -* [targeting templates](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetingTemplate.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.TargetingTemplateUpdateCall.html) -* [user profiles](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.UserRoleUpdateCall.html) -* [video formats](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.VideoFormat.html) - * [*get*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.VideoFormatListCall.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserLandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserLandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserLandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserLandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserLandingPageUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ConversionBatchinsertCall.html) and [*batchupdate*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ConversionBatchupdateCall.html) +* [countries](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DimensionValueQueryCall.html) +* [directory sites](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.InventoryItemListCall.html) +* [languages](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.MetroListCall.html) +* [mobile apps](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.MobileApp.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.MobileAppGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.MobileAppListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.VideoFormatListCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.ReportFileGetCall.html) @@ -150,17 +150,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -265,17 +265,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -285,29 +285,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dfareporting3d3/1.0.12+20190531/google_dfareporting3d3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting3d3/1.0.13+20200326/google_dfareporting3d3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dfareporting3d3/src/lib.rs b/gen/dfareporting3d3/src/lib.rs index f810262a32..cd4d354761 100644 --- a/gen/dfareporting3d3/src/lib.rs +++ b/gen/dfareporting3d3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dfareporting* crate version *1.0.12+20190531*, where *20190531* is the exact revision of the *dfareporting:v3.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *dfareporting* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *dfareporting:v3.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *dfareporting* *v3d3* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/). @@ -471,7 +471,7 @@ impl<'a, C, A> Dfareporting Dfareporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/dfareporting/v3.3/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -659,7 +659,7 @@ impl<'a, C, A> Dfareporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -747,7 +747,7 @@ pub struct Conversion { /// Whether this particular request may come from a user under the age of 13, under COPPA compliance. #[serde(rename="childDirectedTreatment")] pub child_directed_treatment: Option, - /// A list of the alphanumeric encrypted user IDs. Any user ID with exposure prior to the conversion timestamp will be used in the inserted conversion. If no such user ID is found then the conversion will be rejected with NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo should also be specified. This field may only be used when calling batchinsert; it is not supported by batchupdate. This field is mutually exclusive with encryptedUserId, matchId, mobileDeviceId and gclid. This or encryptedUserId or matchId or mobileDeviceId or gclid is a required field. + /// A list of the alphanumeric encrypted user IDs. Any user ID with exposure prior to the conversion timestamp will be used in the inserted conversion. If no such user ID is found then the conversion will be rejected with INVALID_ARGUMENT error. When set, encryptionInfo should also be specified. This field may only be used when calling batchinsert; it is not supported by batchupdate. This field is mutually exclusive with encryptedUserId, matchId, mobileDeviceId and gclid. This or encryptedUserId or matchId or mobileDeviceId or gclid is a required field. #[serde(rename="encryptedUserIdCandidates")] pub encrypted_user_id_candidates: Option>, /// Custom floodlight variables. @@ -974,7 +974,7 @@ pub struct UserRolePermissionGroupsListResponse { impl ResponseResult for UserRolePermissionGroupsListResponse {} -/// Represents the list of File resources. +/// There is no detailed description. /// /// # Activities /// @@ -989,11 +989,11 @@ pub struct FileList { /// Continuation token used to page through files. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. The page token is only valid for a limited amount of time and should not be persisted. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// The files returned in this response. + /// no description provided pub items: Option>, - /// The kind of list this is, in this case dfareporting#fileList. + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#fileList". pub kind: Option, - /// The eTag of this response for caching purposes. + /// Etag of this resource. pub etag: Option, } @@ -1638,7 +1638,8 @@ pub struct Account { /// - "47" for BGN /// - "48" for HRK /// - "49" for MXN - /// - "50" for NGN + /// - "50" for NGN + /// - "51" for EGP #[serde(rename="currencyId")] pub currency_id: Option, /// Reporting configuration of this account. @@ -2130,17 +2131,17 @@ impl Part for TagSetting {} pub struct File { /// The status of the report file. pub status: Option, - /// The kind of resource this is, in this case dfareporting#file. + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#file". pub kind: Option, /// The output format of the report. Only available once the file is available. pub format: Option, - /// The date range for which the file has report data. The date range will always be the absolute date range for which the report is run. + /// no description provided #[serde(rename="dateRange")] pub date_range: Option, /// The filename of the file. #[serde(rename="fileName")] pub file_name: Option, - /// The eTag of this response for caching purposes. + /// Etag of this resource. pub etag: Option, /// The ID of the report this file was generated from. #[serde(rename="reportId")] @@ -2969,9 +2970,9 @@ impl Part for DefaultClickThroughEventTagProperties {} pub struct UserProfileList { /// The user profiles returned in this response. pub items: Option>, - /// The kind of list this is, in this case dfareporting#userProfileList. + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userProfileList". pub kind: Option, - /// The eTag of this response for caching purposes. + /// Etag of this resource. pub etag: Option, } @@ -4279,7 +4280,26 @@ pub struct ReportsConfiguration { /// - "10" for "Asia/Dubai" /// - "11" for "America/Los_Angeles" /// - "12" for "Pacific/Auckland" - /// - "13" for "America/Sao_Paulo" + /// - "13" for "America/Sao_Paulo" + /// - "16" for "America/Asuncion" + /// - "17" for "America/Chicago" + /// - "18" for "America/Denver" + /// - "19" for "America/St_Johns" + /// - "20" for "Asia/Dhaka" + /// - "21" for "Asia/Jakarta" + /// - "22" for "Asia/Kabul" + /// - "23" for "Asia/Karachi" + /// - "24" for "Asia/Calcutta" + /// - "25" for "Asia/Pyongyang" + /// - "26" for "Asia/Rangoon" + /// - "27" for "Atlantic/Cape_Verde" + /// - "28" for "Atlantic/South_Georgia" + /// - "29" for "Australia/Adelaide" + /// - "30" for "Australia/Lord_Howe" + /// - "31" for "Europe/Moscow" + /// - "32" for "Pacific/Kiritimati" + /// - "35" for "Pacific/Norfolk" + /// - "36" for "Pacific/Tongatapu" #[serde(rename="reportGenerationTimeZoneId")] pub report_generation_time_zone_id: Option, /// Default lookback windows for new advertisers in this account. @@ -4334,7 +4354,7 @@ pub struct UserRolePermissionsListResponse { impl ResponseResult for UserRolePermissionsListResponse {} -/// Represents a UserProfile resource. +/// A UserProfile resource lets you list all DFA user profiles that are associated with a Google user account. The profile_id needs to be specified in other API requests.  /// /// # Activities /// @@ -4349,7 +4369,7 @@ pub struct UserProfile { /// The user name. #[serde(rename="userName")] pub user_name: Option, - /// The kind of resource this is, in this case dfareporting#userProfile. + /// Identifies what kind of resource this is. Value: the fixed string "dfareporting#userProfile". pub kind: Option, /// The sub account ID this profile belongs to if applicable. #[serde(rename="subAccountId")] @@ -4357,7 +4377,7 @@ pub struct UserProfile { /// The account name this profile belongs to. #[serde(rename="accountName")] pub account_name: Option, - /// The eTag of this response for caching purposes. + /// Etag of this resource. pub etag: Option, /// The sub account name this profile belongs to if applicable. #[serde(rename="subAccountName")] @@ -4948,7 +4968,7 @@ pub struct CreativeAssetMetadata { /// List of feature dependencies for the creative asset that are detected by Campaign Manager. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. #[serde(rename="detectedFeatures")] pub detected_features: Option>, - /// List of detected click tags for assets. This is a read-only auto-generated field. + /// List of detected click tags for assets. This is a read-only, auto-generated field. This field is empty for a rich media asset. #[serde(rename="clickTags")] pub click_tags: Option>, /// Rules validated during code generation that generated a warning. This is a read-only, auto-generated field. @@ -9064,8 +9084,8 @@ impl<'a, C, A> ReportMethods<'a, C, A> { /// /// # Arguments /// - /// * `profileId` - The DFA profile ID. - /// * `reportId` - The ID of the parent report. + /// * `profileId` - The DFA user profile ID. + /// * `reportId` - The ID of the report. pub fn files_list(&self, profile_id: &str, report_id: &str) -> ReportFileListCall<'a, C, A> { ReportFileListCall { hub: self.hub, @@ -9161,11 +9181,11 @@ impl<'a, C, A> ReportMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a report file. This method supports media download. + /// Retrieves a report file by its report ID and file ID. This method supports media download. /// /// # Arguments /// - /// * `profileId` - The DFA profile ID. + /// * `profileId` - The DFA user profile ID. /// * `reportId` - The ID of the report. /// * `fileId` - The ID of the report file. pub fn files_get(&self, profile_id: &str, report_id: &str, file_id: &str) -> ReportFileGetCall<'a, C, A> { @@ -23128,7 +23148,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: self._object_ids.push(new_value.to_string()); self } - /// Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + /// Select only change logs whose change time is after the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. /// /// Sets the *min change time* query property to the given value. pub fn min_change_time(mut self, new_value: &str) -> ChangeLogListCall<'a, C, A> { @@ -25021,7 +25041,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A } - /// The DFA profile ID. + /// The DFA user profile ID. /// /// Sets the *profile id* path property to the given value. /// @@ -25031,7 +25051,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A self._profile_id = new_value.to_string(); self } - /// The ID of the parent report. + /// The ID of the report. /// /// Sets the *report id* path property to the given value. /// @@ -26205,7 +26225,7 @@ impl<'a, C, A> ReportGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Retrieves a report file. This method supports media download. +/// Retrieves a report file by its report ID and file ID. This method supports media download. /// /// This method supports **media download**. To enable it, adjust the builder like this: /// `.param("alt", "media")`. @@ -26401,7 +26421,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: } - /// The DFA profile ID. + /// The DFA user profile ID. /// /// Sets the *profile id* path property to the given value. /// diff --git a/gen/dialogflow2-cli/Cargo.toml b/gen/dialogflow2-cli/Cargo.toml index 0e55135708..e11520d2dc 100644 --- a/gen/dialogflow2-cli/Cargo.toml +++ b/gen/dialogflow2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dialogflow2-cli" -version = "1.0.12+20190629" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Dialogflow (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dialogflow2] path = "../dialogflow2" -version = "1.0.12+20190629" +version = "1.0.13+20200408" diff --git a/gen/dialogflow2-cli/README.md b/gen/dialogflow2-cli/README.md index 27201966f1..4fde111212 100644 --- a/gen/dialogflow2-cli/README.md +++ b/gen/dialogflow2-cli/README.md @@ -25,12 +25,11 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Dialogflow* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *Dialogflow* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash dialogflow2 [options] projects - agent (-r )... [-p ]... [-o ] agent-entity-types-batch-delete (-r )... [-p ]... [-o ] agent-entity-types-batch-update (-r )... [-p ]... [-o ] agent-entity-types-create (-r )... [-p ]... [-o ] @@ -41,7 +40,21 @@ dialogflow2 [options] agent-entity-types-get [-p ]... [-o ] agent-entity-types-list [-p ]... [-o ] agent-entity-types-patch (-r )... [-p ]... [-o ] + agent-environments-users-sessions-contexts-create (-r )... [-p ]... [-o ] + agent-environments-users-sessions-contexts-delete [-p ]... [-o ] + agent-environments-users-sessions-contexts-get [-p ]... [-o ] + agent-environments-users-sessions-contexts-list [-p ]... [-o ] + agent-environments-users-sessions-contexts-patch (-r )... [-p ]... [-o ] + agent-environments-users-sessions-delete-contexts [-p ]... [-o ] + agent-environments-users-sessions-detect-intent (-r )... [-p ]... [-o ] + agent-environments-users-sessions-entity-types-create (-r )... [-p ]... [-o ] + agent-environments-users-sessions-entity-types-delete [-p ]... [-o ] + agent-environments-users-sessions-entity-types-get [-p ]... [-o ] + agent-environments-users-sessions-entity-types-list [-p ]... [-o ] + agent-environments-users-sessions-entity-types-patch (-r )... [-p ]... [-o ] agent-export (-r )... [-p ]... [-o ] + agent-get-fulfillment [-p ]... [-o ] + agent-get-validation-result [-p ]... [-o ] agent-import (-r )... [-p ]... [-o ] agent-intents-batch-delete (-r )... [-p ]... [-o ] agent-intents-batch-update (-r )... [-p ]... [-o ] @@ -65,9 +78,16 @@ dialogflow2 [options] agent-sessions-entity-types-list [-p ]... [-o ] agent-sessions-entity-types-patch (-r )... [-p ]... [-o ] agent-train (-r )... [-p ]... [-o ] + agent-update-fulfillment (-r )... [-p ]... [-o ] delete-agent [-p ]... [-o ] get-agent [-p ]... [-o ] + locations-operations-cancel [-p ]... [-o ] + locations-operations-get [-p ]... [-o ] + locations-operations-list [-p ]... [-o ] + operations-cancel [-p ]... [-o ] operations-get [-p ]... [-o ] + operations-list [-p ]... [-o ] + set-agent (-r )... [-p ]... [-o ] dialogflow2 --help Configuration: diff --git a/gen/dialogflow2-cli/mkdocs.yml b/gen/dialogflow2-cli/mkdocs.yml index 2ea37959d3..a6a2c059f9 100644 --- a/gen/dialogflow2-cli/mkdocs.yml +++ b/gen/dialogflow2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Dialogflow v1.0.12+20190629 +site_name: Dialogflow v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-dialogflow2-cli site_description: A complete library to interact with Dialogflow (protocol v2) @@ -9,7 +9,6 @@ site_dir: build_html pages: - ['index.md', 'Home'] -- ['projects_agent.md', 'Projects', 'Agent'] - ['projects_agent-entity-types-batch-delete.md', 'Projects', 'Agent Entity Types Batch Delete'] - ['projects_agent-entity-types-batch-update.md', 'Projects', 'Agent Entity Types Batch Update'] - ['projects_agent-entity-types-create.md', 'Projects', 'Agent Entity Types Create'] @@ -20,7 +19,21 @@ pages: - ['projects_agent-entity-types-get.md', 'Projects', 'Agent Entity Types Get'] - ['projects_agent-entity-types-list.md', 'Projects', 'Agent Entity Types List'] - ['projects_agent-entity-types-patch.md', 'Projects', 'Agent Entity Types Patch'] +- ['projects_agent-environments-users-sessions-contexts-create.md', 'Projects', 'Agent Environments Users Sessions Contexts Create'] +- ['projects_agent-environments-users-sessions-contexts-delete.md', 'Projects', 'Agent Environments Users Sessions Contexts Delete'] +- ['projects_agent-environments-users-sessions-contexts-get.md', 'Projects', 'Agent Environments Users Sessions Contexts Get'] +- ['projects_agent-environments-users-sessions-contexts-list.md', 'Projects', 'Agent Environments Users Sessions Contexts List'] +- ['projects_agent-environments-users-sessions-contexts-patch.md', 'Projects', 'Agent Environments Users Sessions Contexts Patch'] +- ['projects_agent-environments-users-sessions-delete-contexts.md', 'Projects', 'Agent Environments Users Sessions Delete Contexts'] +- ['projects_agent-environments-users-sessions-detect-intent.md', 'Projects', 'Agent Environments Users Sessions Detect Intent'] +- ['projects_agent-environments-users-sessions-entity-types-create.md', 'Projects', 'Agent Environments Users Sessions Entity Types Create'] +- ['projects_agent-environments-users-sessions-entity-types-delete.md', 'Projects', 'Agent Environments Users Sessions Entity Types Delete'] +- ['projects_agent-environments-users-sessions-entity-types-get.md', 'Projects', 'Agent Environments Users Sessions Entity Types Get'] +- ['projects_agent-environments-users-sessions-entity-types-list.md', 'Projects', 'Agent Environments Users Sessions Entity Types List'] +- ['projects_agent-environments-users-sessions-entity-types-patch.md', 'Projects', 'Agent Environments Users Sessions Entity Types Patch'] - ['projects_agent-export.md', 'Projects', 'Agent Export'] +- ['projects_agent-get-fulfillment.md', 'Projects', 'Agent Get Fulfillment'] +- ['projects_agent-get-validation-result.md', 'Projects', 'Agent Get Validation Result'] - ['projects_agent-import.md', 'Projects', 'Agent Import'] - ['projects_agent-intents-batch-delete.md', 'Projects', 'Agent Intents Batch Delete'] - ['projects_agent-intents-batch-update.md', 'Projects', 'Agent Intents Batch Update'] @@ -44,9 +57,16 @@ pages: - ['projects_agent-sessions-entity-types-list.md', 'Projects', 'Agent Sessions Entity Types List'] - ['projects_agent-sessions-entity-types-patch.md', 'Projects', 'Agent Sessions Entity Types Patch'] - ['projects_agent-train.md', 'Projects', 'Agent Train'] +- ['projects_agent-update-fulfillment.md', 'Projects', 'Agent Update Fulfillment'] - ['projects_delete-agent.md', 'Projects', 'Delete Agent'] - ['projects_get-agent.md', 'Projects', 'Get Agent'] +- ['projects_locations-operations-cancel.md', 'Projects', 'Locations Operations Cancel'] +- ['projects_locations-operations-get.md', 'Projects', 'Locations Operations Get'] +- ['projects_locations-operations-list.md', 'Projects', 'Locations Operations List'] +- ['projects_operations-cancel.md', 'Projects', 'Operations Cancel'] - ['projects_operations-get.md', 'Projects', 'Operations Get'] +- ['projects_operations-list.md', 'Projects', 'Operations List'] +- ['projects_set-agent.md', 'Projects', 'Set Agent'] theme: readthedocs diff --git a/gen/dialogflow2-cli/src/main.rs b/gen/dialogflow2-cli/src/main.rs index cb789ef6ec..24aefd86dc 100644 --- a/gen/dialogflow2-cli/src/main.rs +++ b/gen/dialogflow2-cli/src/main.rs @@ -46,106 +46,6 @@ struct Engine<'n> { impl<'n> Engine<'n> { - fn _projects_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::GoogleCloudDialogflowV2Agent = json::value::from_value(object).unwrap(); - let mut call = self.hub.projects().agent(request, opt.value_of("parent").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "update-mask" => { - call = call.update_mask(value.unwrap_or("")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["update-mask"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _projects_agent_entity_types_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -344,9 +244,10 @@ impl<'n> Engine<'n> { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "kind", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -863,9 +764,10 @@ impl<'n> Engine<'n> { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "kind", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -932,6 +834,847 @@ impl<'n> Engine<'n> { } } + fn _projects_agent_environments_users_sessions_contexts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_environments_users_sessions_contexts_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_environments_users_sessions_contexts_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_environments_users_sessions_contexts_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_environments_users_sessions_contexts_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_contexts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_environments_users_sessions_contexts_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_environments_users_sessions_delete_contexts(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.sample-rate-hertz" => Some(("outputAudioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "output-audio-config.audio-encoding" => Some(("outputAudioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.effects-profile-id" => Some(("outputAudioConfig.synthesizeSpeechConfig.effectsProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "output-audio-config.synthesize-speech-config.voice.ssml-gender" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.ssmlGender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.voice.name" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2DetectIntentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_environments_users_sessions_detect_intent(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_environments_users_sessions_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_environments_users_sessions_entity_types_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_agent_export(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1017,6 +1760,114 @@ impl<'n> Engine<'n> { } } + fn _projects_agent_get_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_get_fulfillment(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_get_validation_result(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_get_validation_result(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_agent_import(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2230,6 +3081,7 @@ impl<'n> Engine<'n> { "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2237,8 +3089,10 @@ impl<'n> Engine<'n> { "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -2246,7 +3100,7 @@ impl<'n> Engine<'n> { "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "event", "geo-location", "input-audio", "language-code", "latitude", "longitude", "model-variant", "name", "output-audio-config", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2729,6 +3583,102 @@ impl<'n> Engine<'n> { } } + fn _projects_agent_update_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.is-cloud-function" => Some(("genericWebService.isCloudFunction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "generic-web-service.request-headers" => Some(("genericWebService.requestHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "generic-web-service.username" => Some(("genericWebService.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.password" => Some(("genericWebService.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.uri" => Some(("genericWebService.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "enabled", "generic-web-service", "is-cloud-function", "name", "password", "request-headers", "uri", "username"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2Fulfillment = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_update_fulfillment(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_delete_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().delete_agent(opt.value_of("parent").unwrap_or("")); @@ -2833,6 +3783,224 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().operations_get(opt.value_of("name").unwrap_or("")); @@ -2885,6 +4053,168 @@ impl<'n> Engine<'n> { } } + fn _projects_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_set_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2Agent = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().set_agent(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); @@ -2892,9 +4222,6 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { - ("agent", Some(opt)) => { - call_result = self._projects_agent(opt, dry_run, &mut err); - }, ("agent-entity-types-batch-delete", Some(opt)) => { call_result = self._projects_agent_entity_types_batch_delete(opt, dry_run, &mut err); }, @@ -2925,9 +4252,51 @@ impl<'n> Engine<'n> { ("agent-entity-types-patch", Some(opt)) => { call_result = self._projects_agent_entity_types_patch(opt, dry_run, &mut err); }, + ("agent-environments-users-sessions-contexts-create", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_contexts_create(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-contexts-delete", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_contexts_delete(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-contexts-get", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_contexts_get(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-contexts-list", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_contexts_list(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-contexts-patch", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_contexts_patch(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-delete-contexts", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_delete_contexts(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-detect-intent", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_detect_intent(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-entity-types-create", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_entity_types_create(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-entity-types-delete", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_entity_types_delete(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-entity-types-get", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_entity_types_get(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-entity-types-list", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_entity_types_list(opt, dry_run, &mut err); + }, + ("agent-environments-users-sessions-entity-types-patch", Some(opt)) => { + call_result = self._projects_agent_environments_users_sessions_entity_types_patch(opt, dry_run, &mut err); + }, ("agent-export", Some(opt)) => { call_result = self._projects_agent_export(opt, dry_run, &mut err); }, + ("agent-get-fulfillment", Some(opt)) => { + call_result = self._projects_agent_get_fulfillment(opt, dry_run, &mut err); + }, + ("agent-get-validation-result", Some(opt)) => { + call_result = self._projects_agent_get_validation_result(opt, dry_run, &mut err); + }, ("agent-import", Some(opt)) => { call_result = self._projects_agent_import(opt, dry_run, &mut err); }, @@ -2997,15 +4366,36 @@ impl<'n> Engine<'n> { ("agent-train", Some(opt)) => { call_result = self._projects_agent_train(opt, dry_run, &mut err); }, + ("agent-update-fulfillment", Some(opt)) => { + call_result = self._projects_agent_update_fulfillment(opt, dry_run, &mut err); + }, ("delete-agent", Some(opt)) => { call_result = self._projects_delete_agent(opt, dry_run, &mut err); }, ("get-agent", Some(opt)) => { call_result = self._projects_get_agent(opt, dry_run, &mut err); }, + ("locations-operations-cancel", Some(opt)) => { + call_result = self._projects_locations_operations_cancel(opt, dry_run, &mut err); + }, + ("locations-operations-get", Some(opt)) => { + call_result = self._projects_locations_operations_get(opt, dry_run, &mut err); + }, + ("locations-operations-list", Some(opt)) => { + call_result = self._projects_locations_operations_list(opt, dry_run, &mut err); + }, + ("operations-cancel", Some(opt)) => { + call_result = self._projects_operations_cancel(opt, dry_run, &mut err); + }, ("operations-get", Some(opt)) => { call_result = self._projects_operations_get(opt, dry_run, &mut err); }, + ("operations-list", Some(opt)) => { + call_result = self._projects_operations_list(opt, dry_run, &mut err); + }, + ("set-agent", Some(opt)) => { + call_result = self._projects_set_agent(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("projects".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -3097,36 +4487,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'agent', 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-export', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'delete-agent', 'get-agent' and 'operations-get'", vec![ - ("agent", - Some(r##"Creates/updates the specified agent."##), - "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent", - vec![ - (Some(r##"parent"##), - None, - Some(r##"Required. The project of this agent. - Format: `projects/`."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), + ("projects", "methods: 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-environments-users-sessions-contexts-create', 'agent-environments-users-sessions-contexts-delete', 'agent-environments-users-sessions-contexts-get', 'agent-environments-users-sessions-contexts-list', 'agent-environments-users-sessions-contexts-patch', 'agent-environments-users-sessions-delete-contexts', 'agent-environments-users-sessions-detect-intent', 'agent-environments-users-sessions-entity-types-create', 'agent-environments-users-sessions-entity-types-delete', 'agent-environments-users-sessions-entity-types-get', 'agent-environments-users-sessions-entity-types-list', 'agent-environments-users-sessions-entity-types-patch', 'agent-export', 'agent-get-fulfillment', 'agent-get-validation-result', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'agent-update-fulfillment', 'delete-agent', 'get-agent', 'locations-operations-cancel', 'locations-operations-get', 'locations-operations-list', 'operations-cancel', 'operations-get', 'operations-list' and 'set-agent'", vec![ ("agent-entity-types-batch-delete", Some(r##"Deletes entity types in the specified agent. @@ -3275,6 +4636,7 @@ fn main() { ("agent-entity-types-entities-batch-delete", Some(r##"Deletes entities in the specified entity type. + Operation "##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-entity-types-entities-batch-delete", vec![ @@ -3308,6 +4670,7 @@ fn main() { method does not affect entities in the entity type that aren't explicitly specified in the request. + Operation "##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-entity-types-entities-batch-update", vec![ @@ -3407,6 +4770,408 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-contexts-create", + Some(r##"Creates a context. + + If the specified context already exists, overrides the context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-contexts-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a context for. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-contexts-delete", + Some(r##"Deletes the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-contexts-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context to delete. Format: + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-contexts-get", + Some(r##"Retrieves the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-contexts-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context. Format: + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-contexts-list", + Some(r##"Returns the list of all contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-contexts-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all contexts from. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-contexts-patch", + Some(r##"Updates the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-contexts-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of the context. Format: + `projects//agent/sessions//contexts/`, + or `projects//agent/environments//users//sessions//contexts/`. + + The `Context ID` is always converted to lowercase, may only contain + characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. + + The following context names are reserved for internal use by Dialogflow. + You should not use these contexts or create contexts with these names: + + * `__system_counters__` + * `*_id_dialog_context` + * `*_dialog_params_size`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-delete-contexts", + Some(r##"Deletes all active contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-delete-contexts", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the session to delete all contexts from. Format: + `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + If `Environment ID` is not specified we assume default 'draft' environment. + If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-detect-intent", + Some(r##"Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-detect-intent", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The name of the session this query is sent to. Format: + `projects//agent/sessions/`, or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we are using + "-". It's up to the API caller to choose an appropriate `Session ID` and + `User Id`. They can be a random number or some type of user and session + identifiers (preferably hashed). The length of the `Session ID` and + `User ID` must not exceed 36 characters."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-entity-types-create", + Some(r##"Creates a session entity type. + + If the specified session entity type already exists, overrides the session + entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-entity-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a session entity type for. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-entity-types-delete", + Some(r##"Deletes the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-entity-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type to delete. Format: + `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-entity-types-get", + Some(r##"Retrieves the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-entity-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the session entity type. Format: + `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-entity-types-list", + Some(r##"Returns the list of all session entity types in the specified session. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-entity-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all session entity types from. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-environments-users-sessions-entity-types-patch", + Some(r##"Updates the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-environments-users-sessions-entity-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of this session entity type. Format: + `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. + + `` must be the display name of an existing entity + type in the same agent that will be overridden or supplemented."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3438,6 +5203,53 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-get-fulfillment", + Some(r##"Retrieves the fulfillment."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-get-fulfillment", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the fulfillment. + Format: `projects//agent/fulfillment`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-get-validation-result", + Some(r##"Gets agent validation result. Agent validation is performed during + training time and is updated automatically when training is completed."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-get-validation-result", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3646,7 +5458,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique identifier of this intent. + Some(r##"Optional. The unique identifier of this intent. Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Format: `projects//agent/intents/`."##), @@ -3743,7 +5555,11 @@ fn main() { (Some(r##"parent"##), None, Some(r##"Required. The session to create a context for. - Format: `projects//agent/sessions/`."##), + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -3772,7 +5588,11 @@ fn main() { (Some(r##"name"##), None, Some(r##"Required. The name of the context to delete. Format: - `projects//agent/sessions//contexts/`."##), + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -3795,7 +5615,11 @@ fn main() { (Some(r##"name"##), None, Some(r##"Required. The name of the context. Format: - `projects//agent/sessions//contexts/`."##), + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -3818,7 +5642,11 @@ fn main() { (Some(r##"parent"##), None, Some(r##"Required. The session to list all contexts from. - Format: `projects//agent/sessions/`."##), + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -3841,10 +5669,22 @@ fn main() { (Some(r##"name"##), None, Some(r##"Required. The unique identifier of the context. Format: - `projects//agent/sessions//contexts/`. + `projects//agent/sessions//contexts/`, + or `projects//agent/environments//users//sessions//contexts/`. The `Context ID` is always converted to lowercase, may only contain - characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long."##), + characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. + + The following context names are reserved for internal use by Dialogflow. + You should not use these contexts or create contexts with these names: + + * `__system_counters__` + * `*_id_dialog_context` + * `*_dialog_params_size`"##), Some(true), Some(false)), @@ -3873,7 +5713,11 @@ fn main() { (Some(r##"parent"##), None, Some(r##"Required. The name of the session to delete all contexts from. Format: - `projects//agent/sessions/`."##), + `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + If `Environment ID` is not specified we assume default 'draft' environment. + If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -3899,10 +5743,14 @@ fn main() { (Some(r##"session"##), None, Some(r##"Required. The name of the session this query is sent to. Format: - `projects//agent/sessions/`. It's up to the API - caller to choose an appropriate session ID. It can be a random number or - some type of user identifier (preferably hashed). The length of the session - ID must not exceed 36 bytes."##), + `projects//agent/sessions/`, or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we are using + "-". It's up to the API caller to choose an appropriate `Session ID` and + `User Id`. They can be a random number or some type of user and session + identifiers (preferably hashed). The length of the `Session ID` and + `User ID` must not exceed 36 characters."##), Some(true), Some(false)), @@ -3928,13 +5776,21 @@ fn main() { Some(r##"Creates a session entity type. If the specified session entity type already exists, overrides the session - entity type."##), + entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-sessions-entity-types-create", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to create a session entity type for. - Format: `projects//agent/sessions/`."##), + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -3957,14 +5813,22 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-delete", - Some(r##"Deletes the specified session entity type."##), + Some(r##"Deletes the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-sessions-entity-types-delete", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/`."##), + Display Name>` or `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -3981,14 +5845,22 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-get", - Some(r##"Retrieves the specified session entity type."##), + Some(r##"Retrieves the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-sessions-entity-types-get", vec![ (Some(r##"name"##), None, Some(r##"Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/`."##), + Display Name>` or `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -4005,13 +5877,21 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-list", - Some(r##"Returns the list of all session entity types in the specified session."##), + Some(r##"Returns the list of all session entity types in the specified session. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-sessions-entity-types-list", vec![ (Some(r##"parent"##), None, Some(r##"Required. The session to list all session entity types from. - Format: `projects//agent/sessions/`."##), + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), Some(true), Some(false)), @@ -4028,14 +5908,22 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-patch", - Some(r##"Updates the specified session entity type."##), + Some(r##"Updates the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-sessions-entity-types-patch", vec![ (Some(r##"name"##), None, Some(r##"Required. The unique identifier of this session entity type. Format: `projects//agent/sessions//entityTypes/`. + Display Name>`, or `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. `` must be the display name of an existing entity type in the same agent that will be overridden or supplemented."##), @@ -4085,6 +5973,35 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-update-fulfillment", + Some(r##"Updates the fulfillment."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_agent-update-fulfillment", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of the fulfillment. + Format: `projects//agent/fulfillment`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4131,6 +6048,123 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_locations-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_locations-operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_locations-operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4155,6 +6189,66 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-agent", + Some(r##"Creates/updates the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_cli/projects_set-agent", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project of this agent. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4167,7 +6261,7 @@ fn main() { let mut app = App::new("dialogflow2") .author("Sebastian Thiel ") - .version("1.0.12+20190629") + .version("1.0.13+20200408") .about("Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dialogflow2_cli") .arg(Arg::with_name("url") diff --git a/gen/dialogflow2/Cargo.toml b/gen/dialogflow2/Cargo.toml index d3aacdb832..2ecbed07dc 100644 --- a/gen/dialogflow2/Cargo.toml +++ b/gen/dialogflow2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dialogflow2" -version = "1.0.12+20190629" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Dialogflow (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2" homepage = "https://cloud.google.com/dialogflow/" -documentation = "https://docs.rs/google-dialogflow2/1.0.12+20190629" +documentation = "https://docs.rs/google-dialogflow2/1.0.13+20200408" license = "MIT" keywords = ["dialogflow", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dialogflow2/README.md b/gen/dialogflow2/README.md index 1bfe3609b8..e6625f8293 100644 --- a/gen/dialogflow2/README.md +++ b/gen/dialogflow2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-dialogflow2` library allows access to all features of the *Google Dialogflow* service. -This documentation was generated from *Dialogflow* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *dialogflow:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Dialogflow* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *dialogflow:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Dialogflow* *v2* API can be found at the [official documentation site](https://cloud.google.com/dialogflow/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.Dialogflow.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.Dialogflow.html) ... * projects - * [*agent*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentCall.html), [*agent entity types batch delete*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentEntityTypePatchCall.html), [*agent export*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentExportCall.html), [*agent import*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentImportCall.html), [*agent intents batch delete*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentIntentGetCall.html), [*agent intents list*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentIntentListCall.html), [*agent intents patch*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentIntentPatchCall.html), [*agent restore*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentRestoreCall.html), [*agent search*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectAgentTrainCall.html), [*delete agent*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectDeleteAgentCall.html), [*get agent*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectGetAgentCall.html) and [*operations get*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.ProjectOperationGetCall.html) + * [*agent entity types batch delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEntityTypePatchCall.html), [*agent environments users sessions contexts create*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html), [*agent environments users sessions contexts delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html), [*agent environments users sessions contexts get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionContextGetCall.html), [*agent environments users sessions contexts list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionContextListCall.html), [*agent environments users sessions contexts patch*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html), [*agent environments users sessions delete contexts*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html), [*agent environments users sessions detect intent*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html), [*agent environments users sessions entity types create*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*agent environments users sessions entity types delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*agent environments users sessions entity types get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html), [*agent environments users sessions entity types list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html), [*agent environments users sessions entity types patch*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html), [*agent export*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentExportCall.html), [*agent get fulfillment*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentGetFulfillmentCall.html), [*agent get validation result*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentGetValidationResultCall.html), [*agent import*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentImportCall.html), [*agent intents batch delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentIntentGetCall.html), [*agent intents list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentIntentListCall.html), [*agent intents patch*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentIntentPatchCall.html), [*agent restore*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentRestoreCall.html), [*agent search*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentTrainCall.html), [*agent update fulfillment*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectAgentUpdateFulfillmentCall.html), [*delete agent*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectDeleteAgentCall.html), [*get agent*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectGetAgentCall.html), [*locations operations cancel*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectLocationOperationListCall.html), [*operations cancel*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectOperationCancelCall.html), [*operations get*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectOperationListCall.html) and [*set agent*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.ProjectSetAgentCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/struct.Dialogflow.html)** +* **[Hub](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/struct.Dialogflow.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.Part.html)** + * **[Parts](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -50,11 +50,12 @@ Or specifically ... let r = hub.projects().agent_restore(...).doit() let r = hub.projects().agent_intents_batch_delete(...).doit() let r = hub.projects().agent_entity_types_batch_delete(...).doit() -let r = hub.projects().agent_import(...).doit() +let r = hub.projects().agent_train(...).doit() let r = hub.projects().agent_export(...).doit() let r = hub.projects().agent_entity_types_batch_update(...).doit() -let r = hub.projects().agent_train(...).doit() +let r = hub.projects().agent_import(...).doit() let r = hub.projects().agent_intents_batch_update(...).doit() +let r = hub.projects().locations_operations_get(...).doit() let r = hub.projects().agent_entity_types_entities_batch_update(...).doit() let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() let r = hub.projects().operations_get(...).doit() @@ -141,17 +142,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -161,29 +162,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dialogflow2/1.0.12+20190629/google_dialogflow2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dialogflow2/1.0.13+20200408/google_dialogflow2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dialogflow2/src/lib.rs b/gen/dialogflow2/src/lib.rs index 895fe7fd02..30bac6275c 100644 --- a/gen/dialogflow2/src/lib.rs +++ b/gen/dialogflow2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Dialogflow* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *dialogflow:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Dialogflow* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *dialogflow:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Dialogflow* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/dialogflow/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Dialogflow.html) ... //! //! * projects -//! * [*agent*](struct.ProjectAgentCall.html), [*agent entity types batch delete*](struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](struct.ProjectAgentEntityTypePatchCall.html), [*agent export*](struct.ProjectAgentExportCall.html), [*agent import*](struct.ProjectAgentImportCall.html), [*agent intents batch delete*](struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](struct.ProjectAgentIntentGetCall.html), [*agent intents list*](struct.ProjectAgentIntentListCall.html), [*agent intents patch*](struct.ProjectAgentIntentPatchCall.html), [*agent restore*](struct.ProjectAgentRestoreCall.html), [*agent search*](struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](struct.ProjectAgentTrainCall.html), [*delete agent*](struct.ProjectDeleteAgentCall.html), [*get agent*](struct.ProjectGetAgentCall.html) and [*operations get*](struct.ProjectOperationGetCall.html) +//! * [*agent entity types batch delete*](struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](struct.ProjectAgentEntityTypePatchCall.html), [*agent environments users sessions contexts create*](struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html), [*agent environments users sessions contexts delete*](struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html), [*agent environments users sessions contexts get*](struct.ProjectAgentEnvironmentUserSessionContextGetCall.html), [*agent environments users sessions contexts list*](struct.ProjectAgentEnvironmentUserSessionContextListCall.html), [*agent environments users sessions contexts patch*](struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html), [*agent environments users sessions delete contexts*](struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html), [*agent environments users sessions detect intent*](struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html), [*agent environments users sessions entity types create*](struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*agent environments users sessions entity types delete*](struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*agent environments users sessions entity types get*](struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html), [*agent environments users sessions entity types list*](struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html), [*agent environments users sessions entity types patch*](struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html), [*agent export*](struct.ProjectAgentExportCall.html), [*agent get fulfillment*](struct.ProjectAgentGetFulfillmentCall.html), [*agent get validation result*](struct.ProjectAgentGetValidationResultCall.html), [*agent import*](struct.ProjectAgentImportCall.html), [*agent intents batch delete*](struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](struct.ProjectAgentIntentGetCall.html), [*agent intents list*](struct.ProjectAgentIntentListCall.html), [*agent intents patch*](struct.ProjectAgentIntentPatchCall.html), [*agent restore*](struct.ProjectAgentRestoreCall.html), [*agent search*](struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](struct.ProjectAgentTrainCall.html), [*agent update fulfillment*](struct.ProjectAgentUpdateFulfillmentCall.html), [*delete agent*](struct.ProjectDeleteAgentCall.html), [*get agent*](struct.ProjectGetAgentCall.html), [*locations operations cancel*](struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html), [*locations operations list*](struct.ProjectLocationOperationListCall.html), [*operations cancel*](struct.ProjectOperationCancelCall.html), [*operations get*](struct.ProjectOperationGetCall.html), [*operations list*](struct.ProjectOperationListCall.html) and [*set agent*](struct.ProjectSetAgentCall.html) //! //! //! @@ -50,11 +50,12 @@ //! let r = hub.projects().agent_restore(...).doit() //! let r = hub.projects().agent_intents_batch_delete(...).doit() //! let r = hub.projects().agent_entity_types_batch_delete(...).doit() -//! let r = hub.projects().agent_import(...).doit() +//! let r = hub.projects().agent_train(...).doit() //! let r = hub.projects().agent_export(...).doit() //! let r = hub.projects().agent_entity_types_batch_update(...).doit() -//! let r = hub.projects().agent_train(...).doit() +//! let r = hub.projects().agent_import(...).doit() //! let r = hub.projects().agent_intents_batch_update(...).doit() +//! let r = hub.projects().locations_operations_get(...).doit() //! let r = hub.projects().agent_entity_types_entities_batch_update(...).doit() //! let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() //! let r = hub.projects().operations_get(...).doit() @@ -344,7 +345,7 @@ impl<'a, C, A> Dialogflow Dialogflow { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://dialogflow.googleapis.com/".to_string(), _root_url: "https://dialogflow.googleapis.com/".to_string(), } @@ -355,7 +356,7 @@ impl<'a, C, A> Dialogflow } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -383,103 +384,68 @@ impl<'a, C, A> Dialogflow // ############ // SCHEMAS ### // ########## -/// The request to detect user's intent. +/// Represents configuration for a generic web service. +/// Dialogflow supports two mechanisms for authentications: +/// - Basic authentication with username and password. +/// - Authentication with additional authentication headers. +/// More information could be found at: +/// https://cloud.google.com/dialogflow/docs/fulfillment-configure. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2FulfillmentGenericWebService { + /// Optional. Indicates if generic web service is created through Cloud Functions + /// integration. Defaults to false. + #[serde(rename="isCloudFunction")] + pub is_cloud_function: Option, + /// Optional. The HTTP request headers to send together with fulfillment requests. + #[serde(rename="requestHeaders")] + pub request_headers: Option>, + /// Optional. The user name for HTTP Basic authentication. + pub username: Option, + /// Optional. The password for HTTP Basic authentication. + pub password: Option, + /// Required. The fulfillment URI for receiving POST requests. + pub uri: Option, +} + +impl Part for GoogleCloudDialogflowV2FulfillmentGenericWebService {} + + +/// The request message for EntityTypes.BatchUpdateEntityTypes. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (request) +/// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2DetectIntentRequest { - /// Optional. The natural language speech audio to be processed. This field - /// should be populated iff `query_input` is set to an input audio config. - /// A single request can contain up to 1 minute of speech audio data. - #[serde(rename="inputAudio")] - pub input_audio: Option, - /// Optional. Instructs the speech synthesizer how to generate the output - /// audio. If this field is not set and agent-level speech synthesizer is not - /// configured, no output audio is generated. - #[serde(rename="outputAudioConfig")] - pub output_audio_config: Option, - /// Required. The input specification. It can be set to: - /// - /// 1. an audio config - /// which instructs the speech recognizer how to process the speech audio, - /// - /// 1. a conversational query in the form of text, or - /// - /// 1. an event that specifies which intent to trigger. - #[serde(rename="queryInput")] - pub query_input: Option, - /// Optional. The parameters of this query. - #[serde(rename="queryParams")] - pub query_params: Option, +pub struct GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest { + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + #[serde(rename="languageCode")] + pub language_code: Option, + /// The URI to a Google Cloud Storage file containing entity types to update + /// or create. The file format can either be a serialized proto (of + /// EntityBatch type) or a JSON object. Note: The URI must start with + /// "gs://". + #[serde(rename="entityTypeBatchUri")] + pub entity_type_batch_uri: Option, + /// The collection of entity types to update or create. + #[serde(rename="entityTypeBatchInline")] + pub entity_type_batch_inline: Option, + /// Optional. The mask to control which fields get updated. + #[serde(rename="updateMask")] + pub update_mask: Option, } -impl RequestValue for GoogleCloudDialogflowV2DetectIntentRequest {} - - -/// Corresponds to the `Response` field in the Dialogflow console. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessage { - /// The voice and text-only responses for Actions on Google. - #[serde(rename="simpleResponses")] - pub simple_responses: Option, - /// The quick replies response. - #[serde(rename="quickReplies")] - pub quick_replies: Option, - /// The link out suggestion chip for Actions on Google. - #[serde(rename="linkOutSuggestion")] - pub link_out_suggestion: Option, - /// The text response. - pub text: Option, - /// The image response. - pub image: Option, - /// The suggestion chips for Actions on Google. - pub suggestions: Option, - /// Optional. The platform that this message is intended for. - pub platform: Option, - /// The basic card response for Actions on Google. - #[serde(rename="basicCard")] - pub basic_card: Option, - /// The carousel card response for Actions on Google. - #[serde(rename="carouselSelect")] - pub carousel_select: Option, - /// The list card response for Actions on Google. - #[serde(rename="listSelect")] - pub list_select: Option, - /// Returns a response containing a custom, platform-specific payload. - /// See the Intent.Message.Platform type for a description of the - /// structure that may be required for your platform. - pub payload: Option>, - /// The card response. - pub card: Option, -} - -impl Part for GoogleCloudDialogflowV2IntentMessage {} - - -/// The collection of simple response candidates. -/// This message in `QueryResult.fulfillment_messages` and -/// `WebhookResponse.fulfillment_messages` should contain only one -/// `SimpleResponse`. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageSimpleResponses { - /// Required. The list of simple responses. - #[serde(rename="simpleResponses")] - pub simple_responses: Option>, -} - -impl Part for GoogleCloudDialogflowV2IntentMessageSimpleResponses {} +impl RequestValue for GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest {} /// Represents the query input. It can contain either: @@ -520,7 +486,8 @@ pub struct GoogleCloudDialogflowV2VoiceSelectionParams { #[serde(rename="ssmlGender")] pub ssml_gender: Option, /// Optional. The name of the voice. If not set, the service will choose a - /// voice based on the other parameters such as language_code and gender. + /// voice based on the other parameters such as language_code and + /// ssml_gender. pub name: Option, } @@ -543,6 +510,1029 @@ pub struct GoogleCloudDialogflowV2IntentMessageBasicCardButton { impl Part for GoogleCloudDialogflowV2IntentMessageBasicCardButton {} +/// This message is a wrapper around a collection of intents. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentBatch { + /// A collection of intents. + pub intents: Option>, +} + +impl Part for GoogleCloudDialogflowV2IntentBatch {} + + +/// The card for presenting a carousel of options to select from. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageCarouselSelect { + /// Required. Carousel items. + pub items: Option>, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageCarouselSelect {} + + +/// The request to detect user's intent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent environments users sessions detect intent projects](struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html) (request) +/// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2DetectIntentRequest { + /// The natural language speech audio to be processed. This field + /// should be populated iff `query_input` is set to an input audio config. + /// A single request can contain up to 1 minute of speech audio data. + #[serde(rename="inputAudio")] + pub input_audio: Option, + /// Instructs the speech synthesizer how to generate the output + /// audio. If this field is not set and agent-level speech synthesizer is not + /// configured, no output audio is generated. + #[serde(rename="outputAudioConfig")] + pub output_audio_config: Option, + /// Mask for output_audio_config indicating which settings in this + /// request-level config should override speech synthesizer settings defined at + /// agent-level. + /// + /// If unspecified or empty, output_audio_config replaces the agent-level + /// config in its entirety. + #[serde(rename="outputAudioConfigMask")] + pub output_audio_config_mask: Option, + /// Required. The input specification. It can be set to: + /// + /// 1. an audio config + /// which instructs the speech recognizer how to process the speech audio, + /// + /// 1. a conversational query in the form of text, or + /// + /// 1. an event that specifies which intent to trigger. + #[serde(rename="queryInput")] + pub query_input: Option, + /// The parameters of this query. + #[serde(rename="queryParams")] + pub query_params: Option, +} + +impl RequestValue for GoogleCloudDialogflowV2DetectIntentRequest {} + + +/// The simple response message containing speech or text. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageSimpleResponse { + /// One of text_to_speech or ssml must be provided. Structured spoken + /// response to the user in the SSML format. Mutually exclusive with + /// text_to_speech. + pub ssml: Option, + /// One of text_to_speech or ssml must be provided. The plain text of the + /// speech output. Mutually exclusive with ssml. + #[serde(rename="textToSpeech")] + pub text_to_speech: Option, + /// Optional. The text to display. + #[serde(rename="displayText")] + pub display_text: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageSimpleResponse {} + + +/// The message returned from the DetectIntent method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent environments users sessions detect intent projects](struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html) (response) +/// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2DetectIntentResponse { + /// The audio data bytes encoded as specified in the request. + /// Note: The output audio is generated based on the values of default platform + /// text responses found in the `query_result.fulfillment_messages` field. If + /// multiple default text responses exist, they will be concatenated when + /// generating audio. If no default platform text responses exist, the + /// generated audio content will be empty. + #[serde(rename="outputAudio")] + pub output_audio: Option, + /// The config used by the speech synthesizer to generate the output audio. + #[serde(rename="outputAudioConfig")] + pub output_audio_config: Option, + /// Specifies the status of the webhook request. + #[serde(rename="webhookStatus")] + pub webhook_status: Option, + /// The unique identifier of the response. It can be used to + /// locate a response in the training example set or for reporting issues. + #[serde(rename="responseId")] + pub response_id: Option, + /// The selected results of the conversational query or event processing. + /// See `alternative_query_results` for additional potential results. + #[serde(rename="queryResult")] + pub query_result: Option, +} + +impl ResponseResult for GoogleCloudDialogflowV2DetectIntentResponse {} + + +/// The request message for EntityTypes.BatchDeleteEntities. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2BatchDeleteEntitiesRequest { + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. The reference `values` of the entities to delete. Note that + /// these are not fully-qualified names, i.e. they don't start with + /// `projects/`. + #[serde(rename="entityValues")] + pub entity_values: Option>, +} + +impl RequestValue for GoogleCloudDialogflowV2BatchDeleteEntitiesRequest {} + + +/// Configuration of how speech should be synthesized. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2SynthesizeSpeechConfig { + /// Optional. An identifier which selects 'audio effects' profiles that are + /// applied on (post synthesized) text to speech. Effects are applied on top of + /// each other in the order they are given. + #[serde(rename="effectsProfileId")] + pub effects_profile_id: Option>, + /// Optional. The desired voice of the synthesized audio. + pub voice: Option, + /// Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + /// native speed supported by the specific voice. 2.0 is twice as fast, and + /// 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + /// other values < 0.25 or > 4.0 will return an error. + #[serde(rename="speakingRate")] + pub speaking_rate: Option, + /// Optional. Volume gain (in dB) of the normal native volume supported by the + /// specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + /// 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + /// will play at approximately half the amplitude of the normal native signal + /// amplitude. A value of +6.0 (dB) will play at approximately twice the + /// amplitude of the normal native signal amplitude. We strongly recommend not + /// to exceed +10 (dB) as there's usually no effective increase in loudness for + /// any value greater than that. + #[serde(rename="volumeGainDb")] + pub volume_gain_db: Option, + /// Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + /// semitones from the original pitch. -20 means decrease 20 semitones from the + /// original pitch. + pub pitch: Option, +} + +impl Part for GoogleCloudDialogflowV2SynthesizeSpeechConfig {} + + +/// An object representing a latitude/longitude pair. This is expressed as a pair +/// of doubles representing degrees latitude and degrees longitude. Unless +/// specified otherwise, this must conform to the +/// WGS84 +/// standard. Values must be within normalized ranges. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleTypeLatLng { + /// The latitude in degrees. It must be in the range [-90.0, +90.0]. + pub latitude: Option, + /// The longitude in degrees. It must be in the range [-180.0, +180.0]. + pub longitude: Option, +} + +impl Part for GoogleTypeLatLng {} + + +/// Configures the types of sentiment analysis to perform. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2SentimentAnalysisRequestConfig { + /// Instructs the service to perform sentiment analysis on + /// `query_text`. If not provided, sentiment analysis is not performed on + /// `query_text`. + #[serde(rename="analyzeQueryTextSentiment")] + pub analyze_query_text_sentiment: Option, +} + +impl Part for GoogleCloudDialogflowV2SentimentAnalysisRequestConfig {} + + +/// Actions on Google action to open a given url. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction { + /// Required. URL + pub url: Option, + /// Optional. Specifies the type of viewer that is used when opening + /// the URL. Defaults to opening via web browser. + #[serde(rename="urlTypeHint")] + pub url_type_hint: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction {} + + +/// The response message for SessionEntityTypes.ListSessionEntityTypes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent environments users sessions entity types list projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html) (response) +/// * [agent sessions entity types list projects](struct.ProjectAgentSessionEntityTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2ListSessionEntityTypesResponse { + /// Token to retrieve the next page of results, or empty if there are no + /// more results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of session entity types. There will be a maximum number of items + /// returned based on the page_size field in the request. + #[serde(rename="sessionEntityTypes")] + pub session_entity_types: Option>, +} + +impl ResponseResult for GoogleCloudDialogflowV2ListSessionEntityTypesResponse {} + + +/// Represents the natural language text to be processed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2TextInput { + /// Required. The language of this conversational query. See [Language + /// Support](https://cloud.google.com/dialogflow/docs/reference/language) + /// for a list of the currently supported language codes. Note that queries in + /// the same session do not necessarily need to specify the same language. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. The UTF-8 encoded natural language text to be processed. + /// Text length must not exceed 256 characters. + pub text: Option, +} + +impl Part for GoogleCloudDialogflowV2TextInput {} + + +/// Hints for the speech recognizer to help with recognition in a specific +/// conversation state. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2SpeechContext { + /// Optional. A list of strings containing words and phrases that the speech + /// recognizer should recognize with higher likelihood. + /// + /// This list can be used to: + /// * improve accuracy for words and phrases you expect the user to say, + /// e.g. typical commands for your Dialogflow agent + /// * add additional words to the speech recognizer vocabulary + /// * ... + /// + /// See the [Cloud Speech + /// documentation](https://cloud.google.com/speech-to-text/quotas) for usage + /// limits. + pub phrases: Option>, + /// Optional. Boost for this context compared to other contexts: + /// * If the boost is positive, Dialogflow will increase the probability that + /// the phrases in this context are recognized over similar sounding phrases. + /// * If the boost is unspecified or non-positive, Dialogflow will not apply + /// any boost. + /// + /// Dialogflow recommends that you use boosts in the range (0, 20] and that you + /// find a value that fits your use case with binary search. + pub boost: Option, +} + +impl Part for GoogleCloudDialogflowV2SpeechContext {} + + +/// Represents the output of agent validation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent get validation result projects](struct.ProjectAgentGetValidationResultCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2ValidationResult { + /// Contains all validation errors. + #[serde(rename="validationErrors")] + pub validation_errors: Option>, +} + +impl ResponseResult for GoogleCloudDialogflowV2ValidationResult {} + + +/// The request message for Agents.ExportAgent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent export projects](struct.ProjectAgentExportCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2ExportAgentRequest { + /// Required. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) + /// URI to export the agent to. + /// The format of this URI must be `gs:///`. + /// If left unspecified, the serialized agent is returned inline. + #[serde(rename="agentUri")] + pub agent_uri: Option, +} + +impl RequestValue for GoogleCloudDialogflowV2ExportAgentRequest {} + + +/// The request message for Agents.TrainAgent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent train projects](struct.ProjectAgentTrainCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2TrainAgentRequest { _never_set: Option } + +impl RequestValue for GoogleCloudDialogflowV2TrainAgentRequest {} + + +/// The response message for Intents.ListIntents. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent intents list projects](struct.ProjectAgentIntentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2ListIntentsResponse { + /// Token to retrieve the next page of results, or empty if there are no + /// more results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of agent intents. There will be a maximum number of items + /// returned based on the page_size field in the request. + pub intents: Option>, +} + +impl ResponseResult for GoogleCloudDialogflowV2ListIntentsResponse {} + + +/// Instructs the speech recognizer how to process the audio content. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2InputAudioConfig { + /// Required. The language of the supplied audio. Dialogflow does not do + /// translations. See [Language + /// Support](https://cloud.google.com/dialogflow/docs/reference/language) + /// for a list of the currently supported language codes. Note that queries in + /// the same session do not necessarily need to specify the same language. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. Audio encoding of the audio content to process. + #[serde(rename="audioEncoding")] + pub audio_encoding: Option, + /// A list of strings containing words and phrases that the speech + /// recognizer should recognize with higher likelihood. + /// + /// See [the Cloud Speech + /// documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + /// for more details. + /// + /// This field is deprecated. Please use [speech_contexts]() instead. If you + /// specify both [phrase_hints]() and [speech_contexts](), Dialogflow will + /// treat the [phrase_hints]() as a single additional [SpeechContext](). + #[serde(rename="phraseHints")] + pub phrase_hints: Option>, + /// If `true`, Dialogflow returns SpeechWordInfo in + /// StreamingRecognitionResult with information about the recognized speech + /// words, e.g. start and end time offsets. If false or unspecified, Speech + /// doesn't return any word-level information. + #[serde(rename="enableWordInfo")] + pub enable_word_info: Option, + /// Required. Sample rate (in Hertz) of the audio content sent in the query. + /// Refer to + /// [Cloud Speech API + /// documentation](https://cloud.google.com/speech-to-text/docs/basics) for + /// more details. + #[serde(rename="sampleRateHertz")] + pub sample_rate_hertz: Option, + /// Which variant of the Speech model to use. + #[serde(rename="modelVariant")] + pub model_variant: Option, + /// Which Speech model to select for the given request. Select the + /// model best suited to your domain to get best results. If a model is not + /// explicitly specified, then we auto-select a model based on the parameters + /// in the InputAudioConfig. + /// If enhanced speech model is enabled for the agent and an enhanced + /// version of the specified model for the language does not exist, then the + /// speech is recognized using the standard version of the specified model. + /// Refer to + /// [Cloud Speech API + /// documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + /// for more details. + pub model: Option, + /// Context information to assist speech recognition. + /// + /// See [the Cloud Speech + /// documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + /// for more details. + #[serde(rename="speechContexts")] + pub speech_contexts: Option>, + /// If `false` (default), recognition does not cease until the + /// client closes the stream. + /// If `true`, the recognizer will detect a single spoken utterance in input + /// audio. Recognition ceases when it detects the audio's voice has + /// stopped or paused. In this case, once a detected intent is received, the + /// client should close the stream and start a new request with a new stream as + /// needed. + /// Note: This setting is relevant only for streaming methods. + /// Note: When specified, InputAudioConfig.single_utterance takes precedence + /// over StreamingDetectIntentRequest.single_utterance. + #[serde(rename="singleUtterance")] + pub single_utterance: Option, +} + +impl Part for GoogleCloudDialogflowV2InputAudioConfig {} + + +/// The result of sentiment analysis as configured by +/// `sentiment_analysis_request_config`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2SentimentAnalysisResult { + /// The sentiment analysis result for `query_text`. + #[serde(rename="queryTextSentiment")] + pub query_text_sentiment: Option, +} + +impl Part for GoogleCloudDialogflowV2SentimentAnalysisResult {} + + +/// Represents the result of conversational query or event processing. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2QueryResult { + /// The collection of rich messages to present to the user. + #[serde(rename="fulfillmentMessages")] + pub fulfillment_messages: Option>, + /// The text to be pronounced to the user or shown on the screen. + /// Note: This is a legacy field, `fulfillment_messages` should be preferred. + #[serde(rename="fulfillmentText")] + pub fulfillment_text: Option, + /// This field is set to: + /// + /// - `false` if the matched intent has required parameters and not all of + /// the required parameter values have been collected. + /// - `true` if all required parameter values have been collected, or if the + /// matched intent doesn't contain any required parameters. + #[serde(rename="allRequiredParamsPresent")] + pub all_required_params_present: Option, + /// The collection of extracted parameters. + pub parameters: Option>, + /// The language that was triggered during intent detection. + /// See [Language + /// Support](https://cloud.google.com/dialogflow/docs/reference/language) + /// for a list of the currently supported language codes. + #[serde(rename="languageCode")] + pub language_code: Option, + /// The Speech recognition confidence between 0.0 and 1.0. A higher number + /// indicates an estimated greater likelihood that the recognized words are + /// correct. The default of 0.0 is a sentinel value indicating that confidence + /// was not set. + /// + /// This field is not guaranteed to be accurate or set. In particular this + /// field isn't set for StreamingDetectIntent since the streaming endpoint has + /// separate confidence estimates per portion of the audio in + /// StreamingRecognitionResult. + #[serde(rename="speechRecognitionConfidence")] + pub speech_recognition_confidence: Option, + /// The intent detection confidence. Values range from 0.0 + /// (completely uncertain) to 1.0 (completely certain). + /// This value is for informational purpose only and is only used to + /// help match the best intent within the classification threshold. + /// This value may change for the same end-user expression at any time due to a + /// model retraining or change in implementation. + /// If there are `multiple knowledge_answers` messages, this value is set to + /// the greatest `knowledgeAnswers.match_confidence` value in the list. + #[serde(rename="intentDetectionConfidence")] + pub intent_detection_confidence: Option, + /// The action name from the matched intent. + pub action: Option, + /// The intent that matched the conversational query. Some, not + /// all fields are filled in this message, including but not limited to: + /// `name`, `display_name`, `end_interaction` and `is_fallback`. + pub intent: Option, + /// The sentiment analysis result, which depends on the + /// `sentiment_analysis_request_config` specified in the request. + #[serde(rename="sentimentAnalysisResult")] + pub sentiment_analysis_result: Option, + /// Free-form diagnostic information for the associated detect intent request. + /// The fields of this data can change without notice, so you should not write + /// code that depends on its structure. + /// The data may contain: + /// + /// - webhook call latency + /// - webhook errors + #[serde(rename="diagnosticInfo")] + pub diagnostic_info: Option>, + /// The original conversational query text: + /// + /// - If natural language text was provided as input, `query_text` contains + /// a copy of the input. + /// - If natural language speech audio was provided as input, `query_text` + /// contains the speech recognition result. If speech recognizer produced + /// multiple alternatives, a particular one is picked. + /// - If automatic spell correction is enabled, `query_text` will contain the + /// corrected user input. + #[serde(rename="queryText")] + pub query_text: Option, + /// The collection of output contexts. If applicable, + /// `output_contexts.parameters` contains entries with name + /// `.original` containing the original parameter values + /// before the query. + #[serde(rename="outputContexts")] + pub output_contexts: Option>, + /// If the query was fulfilled by a webhook call, this field is set to the + /// value of the `source` field returned in the webhook response. + #[serde(rename="webhookSource")] + pub webhook_source: Option, + /// If the query was fulfilled by a webhook call, this field is set to the + /// value of the `payload` field returned in the webhook response. + #[serde(rename="webhookPayload")] + pub webhook_payload: Option>, +} + +impl Part for GoogleCloudDialogflowV2QueryResult {} + + +/// Additional info about the select item for when it is triggered in a +/// dialog. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageSelectItemInfo { + /// Optional. A list of synonyms that can also be used to trigger this + /// item in dialog. + pub synonyms: Option>, + /// Required. A unique key that will be sent back to the agent if this + /// response is given. + pub key: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageSelectItemInfo {} + + +/// Column properties for TableCard. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageColumnProperties { + /// Required. Column heading. + pub header: Option, + /// Optional. Defines text alignment for all cells in this column. + #[serde(rename="horizontalAlignment")] + pub horizontal_alignment: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageColumnProperties {} + + +/// The sentiment, such as positive/negative feeling or association, for a unit +/// of analysis, such as the query text. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2Sentiment { + /// A non-negative number in the [0, +inf) range, which represents the absolute + /// magnitude of sentiment, regardless of score (positive or negative). + pub magnitude: Option, + /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + /// sentiment). + pub score: Option, +} + +impl Part for GoogleCloudDialogflowV2Sentiment {} + + +/// Response media object for media content card. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject { + /// Required. Url where the media is stored. + #[serde(rename="contentUrl")] + pub content_url: Option, + /// Optional. Icon to display above media content. + pub icon: Option, + /// Optional. Description of media card. + pub description: Option, + /// Optional. Image to display above media content. + #[serde(rename="largeImage")] + pub large_image: Option, + /// Required. Name of media card. + pub name: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject {} + + +/// The card for presenting a list of options to select from. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageListSelect { + /// Required. List items. + pub items: Option>, + /// Optional. Subtitle of the list. + pub subtitle: Option, + /// Optional. The overall title of the list. + pub title: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageListSelect {} + + +/// The basic card message. Useful for displaying information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageBasicCard { + /// Optional. The collection of card buttons. + pub buttons: Option>, + /// Required, unless image is present. The body text of the card. + #[serde(rename="formattedText")] + pub formatted_text: Option, + /// Optional. The image for the card. + pub image: Option, + /// Optional. The subtitle of the card. + pub subtitle: Option, + /// Optional. The title of the card. + pub title: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageBasicCard {} + + +/// Opens the given URI. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { + /// Required. The HTTP or HTTPS scheme URI. + pub uri: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction {} + + +/// The media content card for Actions on Google. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageMediaContent { + /// Required. List of media objects. + #[serde(rename="mediaObjects")] + pub media_objects: Option>, + /// Optional. What type of media is the content (ie "audio"). + #[serde(rename="mediaType")] + pub media_type: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageMediaContent {} + + +/// Represents a conversational agent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set agent projects](struct.ProjectSetAgentCall.html) (request|response) +/// * [get agent projects](struct.ProjectGetAgentCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2Agent { + /// Optional. The URI of the agent's avatar. + /// Avatars are used throughout the Dialogflow console and in the self-hosted + /// [Web + /// Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + /// integration. + #[serde(rename="avatarUri")] + pub avatar_uri: Option, + /// Required. The name of this agent. + #[serde(rename="displayName")] + pub display_name: Option, + /// Optional. The description of this agent. + /// The maximum length is 500 characters. If exceeded, the request is rejected. + pub description: Option, + /// Required. The project of this agent. + /// Format: `projects/`. + pub parent: Option, + /// Required. The default language of the agent as a language tag. See + /// [Language + /// Support](https://cloud.google.com/dialogflow/docs/reference/language) + /// for a list of the currently supported language codes. This field cannot be + /// set by the `Update` method. + #[serde(rename="defaultLanguageCode")] + pub default_language_code: Option, + /// Optional. API version displayed in Dialogflow console. If not specified, + /// V2 API is assumed. Clients are free to query different service endpoints + /// for different API versions. However, bots connectors and webhook calls will + /// follow the specified API version. + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Optional. Determines whether this agent should log conversation queries. + #[serde(rename="enableLogging")] + pub enable_logging: Option, + /// Optional. Determines how intents are detected from user queries. + #[serde(rename="matchMode")] + pub match_mode: Option, + /// Optional. The list of all languages supported by this agent (except for the + /// `default_language_code`). + #[serde(rename="supportedLanguageCodes")] + pub supported_language_codes: Option>, + /// Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + pub tier: Option, + /// Required. The time zone of this agent from the + /// [time zone database](https://www.iana.org/time-zones), e.g., + /// America/New_York, Europe/Paris. + #[serde(rename="timeZone")] + pub time_zone: Option, + /// Optional. To filter out false positive results and still get variety in + /// matched natural language inputs for your agent, you can tune the machine + /// learning classification threshold. If the returned score value is less than + /// the threshold value, then a fallback intent will be triggered or, if there + /// are no fallback intents defined, no intent will be triggered. The score + /// values range from 0.0 (completely uncertain) to 1.0 (completely certain). + /// If set to 0.0, the default of 0.3 is used. + #[serde(rename="classificationThreshold")] + pub classification_threshold: Option, +} + +impl RequestValue for GoogleCloudDialogflowV2Agent {} +impl ResponseResult for GoogleCloudDialogflowV2Agent {} + + +/// An item in the list. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageListSelectItem { + /// Required. Additional information about this option. + pub info: Option, + /// Optional. The image to display. + pub image: Option, + /// Optional. The main text describing the item. + pub description: Option, + /// Required. The title of the list item. + pub title: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageListSelectItem {} + + +/// Table card for Actions on Google. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageTableCard { + /// Optional. List of buttons for the card. + pub buttons: Option>, + /// Optional. Rows in this table of data. + pub rows: Option>, + /// Optional. Subtitle to the title. + pub subtitle: Option, + /// Required. Title of the card. + pub title: Option, + /// Optional. Image which should be displayed on the card. + pub image: Option, + /// Optional. Display properties for the columns in this table. + #[serde(rename="columnProperties")] + pub column_properties: Option>, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageTableCard {} + + +/// Represents a single followup intent in the chain. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentFollowupIntentInfo { + /// The unique identifier of the followup intent. + /// Format: `projects//agent/intents/`. + #[serde(rename="followupIntentName")] + pub followup_intent_name: Option, + /// The unique identifier of the followup intent's parent. + /// Format: `projects//agent/intents/`. + #[serde(rename="parentFollowupIntentName")] + pub parent_followup_intent_name: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentFollowupIntentInfo {} + + +/// Represents an example that the agent is trained on. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentTrainingPhrase { + /// Required. The ordered list of training phrase parts. + /// The parts are concatenated in order to form the training phrase. + /// + /// Note: The API does not automatically annotate training phrases like the + /// Dialogflow Console does. + /// + /// Note: Do not forget to include whitespace at part boundaries, + /// so the training phrase is well formatted when the parts are concatenated. + /// + /// If the training phrase does not need to be annotated with parameters, + /// you just need a single part with only the Part.text field set. + /// + /// If you want to annotate the training phrase, you must create multiple + /// parts, where the fields of each part are populated in one of two ways: + /// + /// * `Part.text` is set to a part of the phrase that has no parameters. + /// * `Part.text` is set to a part of the phrase that you want to annotate, + /// and the `entity_type`, `alias`, and `user_defined` fields are all + /// set. + pub parts: Option>, + /// Required. The type of the training phrase. + #[serde(rename="type")] + pub type_: Option, + /// Output only. The unique identifier of this training phrase. + pub name: Option, + /// Optional. Indicates how many times this example was added to + /// the intent. Each time a developer adds an existing sample by editing an + /// intent or training, this counter is increased. + #[serde(rename="timesAddedCount")] + pub times_added_count: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentTrainingPhrase {} + + +/// The text response message. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageText { + /// Optional. The collection of the agent's responses. + pub text: Option>, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageText {} + + +/// A rich response message. +/// Corresponds to the intent `Response` field in the Dialogflow console. +/// For more information, see +/// [Rich response +/// messages](https://cloud.google.com/dialogflow/docs/intents-rich-messages). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessage { + /// The voice and text-only responses for Actions on Google. + #[serde(rename="simpleResponses")] + pub simple_responses: Option, + /// The quick replies response. + #[serde(rename="quickReplies")] + pub quick_replies: Option, + /// The link out suggestion chip for Actions on Google. + #[serde(rename="linkOutSuggestion")] + pub link_out_suggestion: Option, + /// The text response. + pub text: Option, + /// The image response. + pub image: Option, + /// The media content card for Actions on Google. + #[serde(rename="mediaContent")] + pub media_content: Option, + /// The suggestion chips for Actions on Google. + pub suggestions: Option, + /// Optional. The platform that this message is intended for. + pub platform: Option, + /// Browse carousel card for Actions on Google. + #[serde(rename="browseCarouselCard")] + pub browse_carousel_card: Option, + /// The basic card response for Actions on Google. + #[serde(rename="basicCard")] + pub basic_card: Option, + /// Table card for Actions on Google. + #[serde(rename="tableCard")] + pub table_card: Option, + /// The carousel card response for Actions on Google. + #[serde(rename="carouselSelect")] + pub carousel_select: Option, + /// The list card response for Actions on Google. + #[serde(rename="listSelect")] + pub list_select: Option, + /// A custom platform-specific response. + pub payload: Option>, + /// The card response. + pub card: Option, +} + +impl Part for GoogleCloudDialogflowV2IntentMessage {} + + +/// The collection of simple response candidates. +/// This message in `QueryResult.fulfillment_messages` and +/// `WebhookResponse.fulfillment_messages` should contain only one +/// `SimpleResponse`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2IntentMessageSimpleResponses { + /// Required. The list of simple responses. + #[serde(rename="simpleResponses")] + pub simple_responses: Option>, +} + +impl Part for GoogleCloudDialogflowV2IntentMessageSimpleResponses {} + + +/// Whether fulfillment is enabled for the specific feature. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2FulfillmentFeature { + /// The type of the feature that enabled for fulfillment. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for GoogleCloudDialogflowV2FulfillmentFeature {} + + /// Represents a part of a training phrase. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -570,109 +1560,6 @@ pub struct GoogleCloudDialogflowV2IntentTrainingPhrasePart { impl Part for GoogleCloudDialogflowV2IntentTrainingPhrasePart {} -/// Represents an intent. -/// Intents convert a number of user expressions or patterns into an action. An -/// action is an extraction of a user command or sentence semantics. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent intents get projects](struct.ProjectAgentIntentGetCall.html) (response) -/// * [agent intents create projects](struct.ProjectAgentIntentCreateCall.html) (request|response) -/// * [agent intents patch projects](struct.ProjectAgentIntentPatchCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2Intent { - /// Optional. Indicates whether webhooks are enabled for the intent. - #[serde(rename="webhookState")] - pub webhook_state: Option, - /// Optional. The list of platforms for which the first responses will be - /// copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). - #[serde(rename="defaultResponsePlatforms")] - pub default_response_platforms: Option>, - /// Optional. The name of the action associated with the intent. - /// Note: The action name must not contain whitespaces. - pub action: Option, - /// Optional. The collection of contexts that are activated when the intent - /// is matched. Context messages in this collection should not set the - /// parameters field. Setting the `lifespan_count` to 0 will reset the context - /// when the intent is matched. - /// Format: `projects//agent/sessions/-/contexts/`. - #[serde(rename="outputContexts")] - pub output_contexts: Option>, - /// Optional. Indicates whether this is a fallback intent. - #[serde(rename="isFallback")] - pub is_fallback: Option, - /// Optional. Indicates whether Machine Learning is disabled for the intent. - /// Note: If `ml_diabled` setting is set to true, then this intent is not - /// taken into account during inference in `ML ONLY` match mode. Also, - /// auto-markup in the UI is turned off. - #[serde(rename="mlDisabled")] - pub ml_disabled: Option, - /// Required. The name of this intent. - #[serde(rename="displayName")] - pub display_name: Option, - /// The unique identifier of this intent. - /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents - /// methods. - /// Format: `projects//agent/intents/`. - pub name: Option, - /// Optional. The collection of parameters associated with the intent. - pub parameters: Option>, - /// Read-only after creation. The unique identifier of the parent intent in the - /// chain of followup intents. You can set this field when creating an intent, - /// for example with CreateIntent or BatchUpdateIntents, in order to - /// make this intent a followup intent. - /// - /// It identifies the parent followup intent. - /// Format: `projects//agent/intents/`. - #[serde(rename="parentFollowupIntentName")] - pub parent_followup_intent_name: Option, - /// Read-only. Information about all followup intents that have this intent as - /// a direct or indirect parent. We populate this field only in the output. - #[serde(rename="followupIntentInfo")] - pub followup_intent_info: Option>, - /// Optional. The collection of examples that the agent is - /// trained on. - #[serde(rename="trainingPhrases")] - pub training_phrases: Option>, - /// Optional. The collection of rich messages corresponding to the - /// `Response` field in the Dialogflow console. - pub messages: Option>, - /// Optional. The priority of this intent. Higher numbers represent higher - /// priorities. If this is zero or unspecified, we use the default - /// priority 500000. - /// - /// Negative numbers mean that the intent is disabled. - pub priority: Option, - /// Read-only. The unique identifier of the root intent in the chain of - /// followup intents. It identifies the correct followup intents chain for - /// this intent. We populate this field only in the output. - /// - /// Format: `projects//agent/intents/`. - #[serde(rename="rootFollowupIntentName")] - pub root_followup_intent_name: Option, - /// Optional. The list of context names required for this intent to be - /// triggered. - /// Format: `projects//agent/sessions/-/contexts/`. - #[serde(rename="inputContextNames")] - pub input_context_names: Option>, - /// Optional. Indicates whether to delete all contexts in the current - /// session when this intent is matched. - #[serde(rename="resetContexts")] - pub reset_contexts: Option, - /// Optional. The collection of event names that trigger the intent. - /// If the collection of input contexts is not empty, all of the contexts must - /// be present in the active user session for an event to trigger this intent. - pub events: Option>, -} - -impl RequestValue for GoogleCloudDialogflowV2Intent {} -impl ResponseResult for GoogleCloudDialogflowV2Intent {} - - /// The request message for EntityTypes.BatchCreateEntities. /// /// # Activities @@ -686,12 +1573,11 @@ impl ResponseResult for GoogleCloudDialogflowV2Intent {} pub struct GoogleCloudDialogflowV2BatchCreateEntitiesRequest { /// Required. The entities to create. pub entities: Option>, - /// Optional. The language of entity synonyms defined in `entities`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, } @@ -699,30 +1585,47 @@ pub struct GoogleCloudDialogflowV2BatchCreateEntitiesRequest { impl RequestValue for GoogleCloudDialogflowV2BatchCreateEntitiesRequest {} -/// This message is a wrapper around a collection of intents. +/// The response message for EntityTypes.ListEntityTypes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types list projects](struct.ProjectAgentEntityTypeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2ListEntityTypesResponse { + /// Token to retrieve the next page of results, or empty if there are no + /// more results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of agent entity types. There will be a maximum number of items + /// returned based on the page_size field in the request. + #[serde(rename="entityTypes")] + pub entity_types: Option>, +} + +impl ResponseResult for GoogleCloudDialogflowV2ListEntityTypesResponse {} + + +/// An item in the carousel. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentBatch { - /// A collection of intents. - pub intents: Option>, +pub struct GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { + /// Required. Additional info about the option item. + pub info: Option, + /// Optional. The image to display. + pub image: Option, + /// Optional. The body text of the card. + pub description: Option, + /// Required. Title of the carousel item. + pub title: Option, } -impl Part for GoogleCloudDialogflowV2IntentBatch {} - - -/// The card for presenting a carousel of options to select from. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageCarouselSelect { - /// Required. Carousel items. - pub items: Option>, -} - -impl Part for GoogleCloudDialogflowV2IntentMessageCarouselSelect {} +impl Part for GoogleCloudDialogflowV2IntentMessageCarouselSelectItem {} /// An **entity entry** for an associated entity type. @@ -745,7 +1648,7 @@ pub struct GoogleCloudDialogflowV2EntityTypeEntity { /// /// For `KIND_MAP` entity types: /// - /// * A canonical value to be used in place of synonyms. + /// * A reference value to be used in place of synonyms. /// /// For `KIND_LIST` entity types: /// @@ -843,313 +1746,70 @@ pub struct GoogleCloudDialogflowV2IntentParameter { impl Part for GoogleCloudDialogflowV2IntentParameter {} -/// The quick replies response message. +/// Row of TableCard. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageQuickReplies { - /// Optional. The collection of quick replies. - #[serde(rename="quickReplies")] - pub quick_replies: Option>, - /// Optional. The title of the collection of quick replies. - pub title: Option, +pub struct GoogleCloudDialogflowV2IntentMessageTableCardRow { + /// Optional. List of cells that make up this row. + pub cells: Option>, + /// Optional. Whether to add a visual divider after this row. + #[serde(rename="dividerAfter")] + pub divider_after: Option, } -impl Part for GoogleCloudDialogflowV2IntentMessageQuickReplies {} +impl Part for GoogleCloudDialogflowV2IntentMessageTableCardRow {} -/// An item in the carousel. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { - /// Required. Additional info about the option item. - pub info: Option, - /// Optional. The image to display. - pub image: Option, - /// Optional. The body text of the card. - pub description: Option, - /// Required. Title of the carousel item. - pub title: Option, -} - -impl Part for GoogleCloudDialogflowV2IntentMessageCarouselSelectItem {} - - -/// The message returned from the DetectIntent method. +/// The response message for Contexts.ListContexts. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (response) +/// * [agent environments users sessions contexts list projects](struct.ProjectAgentEnvironmentUserSessionContextListCall.html) (response) +/// * [agent sessions contexts list projects](struct.ProjectAgentSessionContextListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2DetectIntentResponse { - /// The audio data bytes encoded as specified in the request. - /// Note: The output audio is generated based on the values of default platform - /// text responses found in the `query_result.fulfillment_messages` field. If - /// multiple default text responses exist, they will be concatenated when - /// generating audio. If no default platform text responses exist, the - /// generated audio content will be empty. - #[serde(rename="outputAudio")] - pub output_audio: Option, - /// The config used by the speech synthesizer to generate the output audio. - #[serde(rename="outputAudioConfig")] - pub output_audio_config: Option, - /// Specifies the status of the webhook request. - #[serde(rename="webhookStatus")] - pub webhook_status: Option, - /// The unique identifier of the response. It can be used to - /// locate a response in the training example set or for reporting issues. - #[serde(rename="responseId")] - pub response_id: Option, - /// The selected results of the conversational query or event processing. - /// See `alternative_query_results` for additional potential results. - #[serde(rename="queryResult")] - pub query_result: Option, +pub struct GoogleCloudDialogflowV2ListContextsResponse { + /// The list of contexts. There will be a maximum number of items + /// returned based on the page_size field in the request. + pub contexts: Option>, + /// Token to retrieve the next page of results, or empty if there are no + /// more results in the list. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, } -impl ResponseResult for GoogleCloudDialogflowV2DetectIntentResponse {} +impl ResponseResult for GoogleCloudDialogflowV2ListContextsResponse {} -/// The request message for EntityTypes.BatchDeleteEntities. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2BatchDeleteEntitiesRequest { - /// Optional. The language of entity synonyms defined in `entities`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - #[serde(rename="languageCode")] - pub language_code: Option, - /// Required. The canonical `values` of the entities to delete. Note that - /// these are not fully-qualified names, i.e. they don't start with - /// `projects/`. - #[serde(rename="entityValues")] - pub entity_values: Option>, -} - -impl RequestValue for GoogleCloudDialogflowV2BatchDeleteEntitiesRequest {} - - -/// Optional. Contains information about a button. +/// Instructs the speech synthesizer on how to generate the output audio content. +/// If this audio config is supplied in a request, it overrides all existing +/// text-to-speech settings applied to the agent. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageCardButton { - /// Optional. The text to show on the button. - pub text: Option, - /// Optional. The text to send back to the Dialogflow API or a URI to - /// open. - pub postback: Option, -} - -impl Part for GoogleCloudDialogflowV2IntentMessageCardButton {} - - -/// Instructs the speech recognizer how to process the audio content. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2InputAudioConfig { - /// Required. The language of the supplied audio. Dialogflow does not do - /// translations. See [Language - /// Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. Note that queries in - /// the same session do not necessarily need to specify the same language. - #[serde(rename="languageCode")] - pub language_code: Option, - /// Required. Audio encoding of the audio content to process. +pub struct GoogleCloudDialogflowV2OutputAudioConfig { + /// Required. Audio encoding of the synthesized audio content. #[serde(rename="audioEncoding")] pub audio_encoding: Option, - /// Optional. Which variant of the Speech model to use. - #[serde(rename="modelVariant")] - pub model_variant: Option, - /// Optional. A list of strings containing words and phrases that the speech - /// recognizer should recognize with higher likelihood. - /// - /// See [the Cloud Speech - /// documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - /// for more details. - #[serde(rename="phraseHints")] - pub phrase_hints: Option>, - /// Required. Sample rate (in Hertz) of the audio content sent in the query. - /// Refer to - /// [Cloud Speech API - /// documentation](https://cloud.google.com/speech-to-text/docs/basics) for - /// more details. + /// The synthesis sample rate (in hertz) for this audio. If not + /// provided, then the synthesizer will use the default sample rate based on + /// the audio encoding. If this is different from the voice's natural sample + /// rate, then the synthesizer will honor this request by converting to the + /// desired sample rate (which might result in worse audio quality). #[serde(rename="sampleRateHertz")] pub sample_rate_hertz: Option, - /// Optional. If `false` (default), recognition does not cease until the - /// client closes the stream. - /// If `true`, the recognizer will detect a single spoken utterance in input - /// audio. Recognition ceases when it detects the audio's voice has - /// stopped or paused. In this case, once a detected intent is received, the - /// client should close the stream and start a new request with a new stream as - /// needed. - /// Note: This setting is relevant only for streaming methods. - /// Note: When specified, InputAudioConfig.single_utterance takes precedence - /// over StreamingDetectIntentRequest.single_utterance. - #[serde(rename="singleUtterance")] - pub single_utterance: Option, + /// Configuration of how speech should be synthesized. + #[serde(rename="synthesizeSpeechConfig")] + pub synthesize_speech_config: Option, } -impl Part for GoogleCloudDialogflowV2InputAudioConfig {} - - -/// Configuration of how speech should be synthesized. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2SynthesizeSpeechConfig { - /// Optional. An identifier which selects 'audio effects' profiles that are - /// applied on (post synthesized) text to speech. Effects are applied on top of - /// each other in the order they are given. - #[serde(rename="effectsProfileId")] - pub effects_profile_id: Option>, - /// Optional. The desired voice of the synthesized audio. - pub voice: Option, - /// Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal - /// native speed supported by the specific voice. 2.0 is twice as fast, and - /// 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any - /// other values < 0.25 or > 4.0 will return an error. - #[serde(rename="speakingRate")] - pub speaking_rate: Option, - /// Optional. Volume gain (in dB) of the normal native volume supported by the - /// specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - /// 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - /// will play at approximately half the amplitude of the normal native signal - /// amplitude. A value of +6.0 (dB) will play at approximately twice the - /// amplitude of the normal native signal amplitude. We strongly recommend not - /// to exceed +10 (dB) as there's usually no effective increase in loudness for - /// any value greater than that. - #[serde(rename="volumeGainDb")] - pub volume_gain_db: Option, - /// Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - /// semitones from the original pitch. -20 means decrease 20 semitones from the - /// original pitch. - pub pitch: Option, -} - -impl Part for GoogleCloudDialogflowV2SynthesizeSpeechConfig {} - - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. A typical example is to use it as the request -/// or the response type of an API method. For instance: -/// -/// ````text -/// service Foo { -/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -/// } -/// ```` -/// -/// The JSON representation for `Empty` is empty JSON object `{}`. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent sessions delete contexts projects](struct.ProjectAgentSessionDeleteContextCall.html) (response) -/// * [delete agent projects](struct.ProjectDeleteAgentCall.html) (response) -/// * [agent entity types delete projects](struct.ProjectAgentEntityTypeDeleteCall.html) (response) -/// * [agent sessions contexts delete projects](struct.ProjectAgentSessionContextDeleteCall.html) (response) -/// * [agent sessions entity types delete projects](struct.ProjectAgentSessionEntityTypeDeleteCall.html) (response) -/// * [agent intents delete projects](struct.ProjectAgentIntentDeleteCall.html) (response) -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleProtobufEmpty { _never_set: Option } - -impl ResponseResult for GoogleProtobufEmpty {} - - -/// The request message for EntityTypes.BatchUpdateEntityTypes. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest { - /// Optional. The language of entity synonyms defined in `entity_types`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - #[serde(rename="languageCode")] - pub language_code: Option, - /// The URI to a Google Cloud Storage file containing entity types to update - /// or create. The file format can either be a serialized proto (of - /// EntityBatch type) or a JSON object. Note: The URI must start with - /// "gs://". - #[serde(rename="entityTypeBatchUri")] - pub entity_type_batch_uri: Option, - /// The collection of entity types to update or create. - #[serde(rename="entityTypeBatchInline")] - pub entity_type_batch_inline: Option, - /// Optional. The mask to control which fields get updated. - #[serde(rename="updateMask")] - pub update_mask: Option, -} - -impl RequestValue for GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest {} - - -/// The request message for Agents.ImportAgent. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent import projects](struct.ProjectAgentImportCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2ImportAgentRequest { - /// The URI to a Google Cloud Storage file containing the agent to import. - /// Note: The URI must start with "gs://". - #[serde(rename="agentUri")] - pub agent_uri: Option, - /// The agent to import. - /// - /// Example for how to import an agent via the command line: - /// - ///
          curl \
          -    ///   'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\
          -    ///    -X POST \
          -    ///    -H 'Authorization: Bearer '$(gcloud auth application-default
          -    ///    print-access-token) \
          -    ///    -H 'Accept: application/json' \
          -    ///    -H 'Content-Type: application/json' \
          -    ///    --compressed \
          -    ///    --data-binary "{
          -    ///       'agentContent': '$(cat <agent zip file> | base64 -w 0)'
          -    ///    }"
          - #[serde(rename="agentContent")] - pub agent_content: Option, -} - -impl RequestValue for GoogleCloudDialogflowV2ImportAgentRequest {} +impl Part for GoogleCloudDialogflowV2OutputAudioConfig {} /// Represents a context. @@ -1160,24 +1820,50 @@ impl RequestValue for GoogleCloudDialogflowV2ImportAgentRequest {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent sessions contexts get projects](struct.ProjectAgentSessionContextGetCall.html) (response) +/// * [agent environments users sessions contexts patch projects](struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html) (request|response) +/// * [agent environments users sessions contexts create projects](struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html) (request|response) +/// * [agent environments users sessions contexts get projects](struct.ProjectAgentEnvironmentUserSessionContextGetCall.html) (response) /// * [agent sessions contexts create projects](struct.ProjectAgentSessionContextCreateCall.html) (request|response) /// * [agent sessions contexts patch projects](struct.ProjectAgentSessionContextPatchCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2Context { /// Required. The unique identifier of the context. Format: - /// `projects//agent/sessions//contexts/`. + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. /// /// The `Context ID` is always converted to lowercase, may only contain - /// characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long. + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` pub name: Option, /// Optional. The collection of parameters associated with this context. - /// Refer to [this - /// doc](https://cloud.google.com/dialogflow/docs/intents-actions-parameters) - /// for syntax. + /// + /// Depending on your protocol or client library language, this is a + /// map, associative array, symbol table, dictionary, or JSON object + /// composed of a collection of (MapKey, MapValue) pairs: + /// + /// * MapKey type: string + /// * MapKey value: parameter name + /// * MapValue type: + /// * If parameter's entity type is a composite entity: map + /// * Else: string + /// * MapValue value: + /// * If parameter's entity type is a composite entity: + /// map from composite entity property names to property values + /// * Else: parameter value pub parameters: Option>, /// Optional. The number of conversational query requests after which the - /// context expires. If set to `0` (the default) the context expires + /// context expires. The default is `0`. If set to `0`, the context expires /// immediately. Contexts expire automatically after 20 minutes if there /// are no matching queries. #[serde(rename="lifespanCount")] @@ -1204,12 +1890,11 @@ pub struct GoogleCloudDialogflowV2BatchUpdateEntitiesRequest { /// Optional. The mask to control which fields get updated. #[serde(rename="updateMask")] pub update_mask: Option, - /// Optional. The language of entity synonyms defined in `entities`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, } @@ -1217,25 +1902,6 @@ pub struct GoogleCloudDialogflowV2BatchUpdateEntitiesRequest { impl RequestValue for GoogleCloudDialogflowV2BatchUpdateEntitiesRequest {} -/// An object representing a latitude/longitude pair. This is expressed as a pair -/// of doubles representing degrees latitude and degrees longitude. Unless -/// specified otherwise, this must conform to the -/// WGS84 -/// standard. Values must be within normalized ranges. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleTypeLatLng { - /// The latitude in degrees. It must be in the range [-90.0, +90.0]. - pub latitude: Option, - /// The longitude in degrees. It must be in the range [-180.0, +180.0]. - pub longitude: Option, -} - -impl Part for GoogleTypeLatLng {} - - /// The request message for Agents.RestoreAgent. /// /// # Activities @@ -1251,21 +1917,7 @@ pub struct GoogleCloudDialogflowV2RestoreAgentRequest { /// Note: The URI must start with "gs://". #[serde(rename="agentUri")] pub agent_uri: Option, - /// The agent to restore. - /// - /// Example for how to restore an agent via the command line: - /// - ///
          curl \
          -    ///   'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:restore\
          -    ///    -X POST \
          -    ///    -H 'Authorization: Bearer '$(gcloud auth application-default
          -    ///    print-access-token) \
          -    ///    -H 'Accept: application/json' \
          -    ///    -H 'Content-Type: application/json' \
          -    ///    --compressed \
          -    ///    --data-binary "{
          -    ///        'agentContent': '$(cat <agent zip file> | base64 -w 0)'
          -    ///    }"
          + /// Zip compressed raw byte content for agent. #[serde(rename="agentContent")] pub agent_content: Option, } @@ -1273,24 +1925,10 @@ pub struct GoogleCloudDialogflowV2RestoreAgentRequest { impl RequestValue for GoogleCloudDialogflowV2RestoreAgentRequest {} -/// The suggestion chip message that the user can tap to quickly post a reply -/// to the conversation. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageSuggestion { - /// Required. The text shown the in the suggestion chip. - pub title: Option, -} - -impl Part for GoogleCloudDialogflowV2IntentMessageSuggestion {} - - /// Represents a session entity type. /// -/// Extends or replaces a developer entity type at the user session level (we -/// refer to the entity types defined at the agent level as "developer entity +/// Extends or replaces a custom entity type at the user session level (we +/// refer to the entity types defined at the agent level as "custom entity /// types"). /// /// Note: session entity types apply to all queries, regardless of the language. @@ -1300,6 +1938,9 @@ impl Part for GoogleCloudDialogflowV2IntentMessageSuggestion {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [agent environments users sessions entity types get projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html) (response) +/// * [agent environments users sessions entity types create projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html) (request|response) +/// * [agent environments users sessions entity types patch projects](struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html) (request|response) /// * [agent sessions entity types patch projects](struct.ProjectAgentSessionEntityTypePatchCall.html) (request|response) /// * [agent sessions entity types create projects](struct.ProjectAgentSessionEntityTypeCreateCall.html) (request|response) /// * [agent sessions entity types get projects](struct.ProjectAgentSessionEntityTypeGetCall.html) (response) @@ -1311,13 +1952,17 @@ pub struct GoogleCloudDialogflowV2SessionEntityType { pub entities: Option>, /// Required. The unique identifier of this session entity type. Format: /// `projects//agent/sessions//entityTypes/`. + /// Display Name>`, or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// `` must be the display name of an existing entity /// type in the same agent that will be overridden or supplemented. pub name: Option, /// Required. Indicates whether the additional data should override or - /// supplement the developer entity type definition. + /// supplement the custom entity type definition. #[serde(rename="entityOverrideMode")] pub entity_override_mode: Option, } @@ -1326,7 +1971,7 @@ impl RequestValue for GoogleCloudDialogflowV2SessionEntityType {} impl ResponseResult for GoogleCloudDialogflowV2SessionEntityType {} -/// The request message for Intents.BatchUpdateIntents. +/// There is no detailed description. /// /// # Activities /// @@ -1337,12 +1982,11 @@ impl ResponseResult for GoogleCloudDialogflowV2SessionEntityType {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2BatchUpdateIntentsRequest { - /// Optional. The language of training phrases, parameters and rich messages - /// defined in `intents`. If not specified, the agent's default language is - /// used. [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, /// The URI to a Google Cloud Storage file containing intents to update or @@ -1364,68 +2008,171 @@ pub struct GoogleCloudDialogflowV2BatchUpdateIntentsRequest { impl RequestValue for GoogleCloudDialogflowV2BatchUpdateIntentsRequest {} -/// Configures the types of sentiment analysis to perform. +/// The suggestion chip message that the user can tap to quickly post a reply +/// to the conversation. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2SentimentAnalysisRequestConfig { - /// Optional. Instructs the service to perform sentiment analysis on - /// `query_text`. If not provided, sentiment analysis is not performed on - /// `query_text`. - #[serde(rename="analyzeQueryTextSentiment")] - pub analyze_query_text_sentiment: Option, +pub struct GoogleCloudDialogflowV2IntentMessageSuggestion { + /// Required. The text shown the in the suggestion chip. + pub title: Option, } -impl Part for GoogleCloudDialogflowV2SentimentAnalysisRequestConfig {} +impl Part for GoogleCloudDialogflowV2IntentMessageSuggestion {} -/// The response message for EntityTypes.ListEntityTypes. +/// Represents a fulfillment. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent entity types list projects](struct.ProjectAgentEntityTypeListCall.html) (response) +/// * [agent get fulfillment projects](struct.ProjectAgentGetFulfillmentCall.html) (response) +/// * [agent update fulfillment projects](struct.ProjectAgentUpdateFulfillmentCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2ListEntityTypesResponse { - /// Token to retrieve the next page of results, or empty if there are no - /// more results in the list. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of agent entity types. There will be a maximum number of items - /// returned based on the page_size field in the request. +pub struct GoogleCloudDialogflowV2Fulfillment { + /// Optional. The human-readable name of the fulfillment, unique within the agent. + #[serde(rename="displayName")] + pub display_name: Option, + /// Optional. Whether fulfillment is enabled. + pub enabled: Option, + /// Optional. The field defines whether the fulfillment is enabled for certain features. + pub features: Option>, + /// Configuration for a generic web service. + #[serde(rename="genericWebService")] + pub generic_web_service: Option, + /// Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub name: Option, +} + +impl RequestValue for GoogleCloudDialogflowV2Fulfillment {} +impl ResponseResult for GoogleCloudDialogflowV2Fulfillment {} + + +/// This message is a wrapper around a collection of entity types. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2EntityTypeBatch { + /// A collection of entity types. #[serde(rename="entityTypes")] pub entity_types: Option>, } -impl ResponseResult for GoogleCloudDialogflowV2ListEntityTypesResponse {} +impl Part for GoogleCloudDialogflowV2EntityTypeBatch {} -/// The response message for SessionEntityTypes.ListSessionEntityTypes. +/// Represents an intent. +/// Intents convert a number of user expressions or patterns into an action. An +/// action is an extraction of a user command or sentence semantics. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent sessions entity types list projects](struct.ProjectAgentSessionEntityTypeListCall.html) (response) +/// * [agent intents get projects](struct.ProjectAgentIntentGetCall.html) (response) +/// * [agent intents create projects](struct.ProjectAgentIntentCreateCall.html) (request|response) +/// * [agent intents patch projects](struct.ProjectAgentIntentPatchCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2ListSessionEntityTypesResponse { - /// Token to retrieve the next page of results, or empty if there are no - /// more results in the list. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of session entity types. There will be a maximum number of items - /// returned based on the page_size field in the request. - #[serde(rename="sessionEntityTypes")] - pub session_entity_types: Option>, +pub struct GoogleCloudDialogflowV2Intent { + /// Optional. Indicates whether webhooks are enabled for the intent. + #[serde(rename="webhookState")] + pub webhook_state: Option, + /// Optional. The list of platforms for which the first responses will be + /// copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + #[serde(rename="defaultResponsePlatforms")] + pub default_response_platforms: Option>, + /// Optional. The name of the action associated with the intent. + /// Note: The action name must not contain whitespaces. + pub action: Option, + /// Optional. The collection of contexts that are activated when the intent + /// is matched. Context messages in this collection should not set the + /// parameters field. Setting the `lifespan_count` to 0 will reset the context + /// when the intent is matched. + /// Format: `projects//agent/sessions/-/contexts/`. + #[serde(rename="outputContexts")] + pub output_contexts: Option>, + /// Optional. Indicates whether this is a fallback intent. + #[serde(rename="isFallback")] + pub is_fallback: Option, + /// Optional. Indicates whether Machine Learning is disabled for the intent. + /// Note: If `ml_disabled` setting is set to true, then this intent is not + /// taken into account during inference in `ML ONLY` match mode. Also, + /// auto-markup in the UI is turned off. + #[serde(rename="mlDisabled")] + pub ml_disabled: Option, + /// Required. The name of this intent. + #[serde(rename="displayName")] + pub display_name: Option, + /// Optional. The unique identifier of this intent. + /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + /// methods. + /// Format: `projects//agent/intents/`. + pub name: Option, + /// Optional. The collection of parameters associated with the intent. + pub parameters: Option>, + /// Read-only after creation. The unique identifier of the parent intent in the + /// chain of followup intents. You can set this field when creating an intent, + /// for example with CreateIntent or + /// BatchUpdateIntents, in order to make this + /// intent a followup intent. + /// + /// It identifies the parent followup intent. + /// Format: `projects//agent/intents/`. + #[serde(rename="parentFollowupIntentName")] + pub parent_followup_intent_name: Option, + /// Read-only. Information about all followup intents that have this intent as + /// a direct or indirect parent. We populate this field only in the output. + #[serde(rename="followupIntentInfo")] + pub followup_intent_info: Option>, + /// Optional. The collection of examples that the agent is + /// trained on. + #[serde(rename="trainingPhrases")] + pub training_phrases: Option>, + /// Optional. The collection of rich messages corresponding to the + /// `Response` field in the Dialogflow console. + pub messages: Option>, + /// Optional. The priority of this intent. Higher numbers represent higher + /// priorities. + /// + /// - If the supplied value is unspecified or 0, the service + /// translates the value to 500,000, which corresponds to the + /// `Normal` priority in the console. + /// - If the supplied value is negative, the intent is ignored + /// in runtime detect intent requests. + pub priority: Option, + /// Read-only. The unique identifier of the root intent in the chain of + /// followup intents. It identifies the correct followup intents chain for + /// this intent. We populate this field only in the output. + /// + /// Format: `projects//agent/intents/`. + #[serde(rename="rootFollowupIntentName")] + pub root_followup_intent_name: Option, + /// Optional. The list of context names required for this intent to be + /// triggered. + /// Format: `projects//agent/sessions/-/contexts/`. + #[serde(rename="inputContextNames")] + pub input_context_names: Option>, + /// Optional. Indicates whether to delete all contexts in the current + /// session when this intent is matched. + #[serde(rename="resetContexts")] + pub reset_contexts: Option, + /// Optional. The collection of event names that trigger the intent. + /// If the collection of input contexts is not empty, all of the contexts must + /// be present in the active user session for an event to trigger this intent. + /// Event names are limited to 150 characters. + pub events: Option>, } -impl ResponseResult for GoogleCloudDialogflowV2ListSessionEntityTypesResponse {} +impl RequestValue for GoogleCloudDialogflowV2Intent {} +impl ResponseResult for GoogleCloudDialogflowV2Intent {} /// Events allow for matching intents by event name instead of the natural @@ -1446,56 +2193,13 @@ pub struct GoogleCloudDialogflowV2EventInput { pub language_code: Option, /// Required. The unique identifier of the event. pub name: Option, - /// Optional. The collection of parameters associated with the event. + /// The collection of parameters associated with the event. pub parameters: Option>, } impl Part for GoogleCloudDialogflowV2EventInput {} -/// The response message for Contexts.ListContexts. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent sessions contexts list projects](struct.ProjectAgentSessionContextListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2ListContextsResponse { - /// The list of contexts. There will be a maximum number of items - /// returned based on the page_size field in the request. - pub contexts: Option>, - /// Token to retrieve the next page of results, or empty if there are no - /// more results in the list. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, -} - -impl ResponseResult for GoogleCloudDialogflowV2ListContextsResponse {} - - -/// Represents the natural language text to be processed. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2TextInput { - /// Required. The language of this conversational query. See [Language - /// Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. Note that queries in - /// the same session do not necessarily need to specify the same language. - #[serde(rename="languageCode")] - pub language_code: Option, - /// Required. The UTF-8 encoded natural language text to be processed. - /// Text length must not exceed 256 characters. - pub text: Option, -} - -impl Part for GoogleCloudDialogflowV2TextInput {} - - /// The card response message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1516,174 +2220,67 @@ pub struct GoogleCloudDialogflowV2IntentMessageCard { impl Part for GoogleCloudDialogflowV2IntentMessageCard {} -/// The request message for Agents.ExportAgent. +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent export projects](struct.ProjectAgentExportCall.html) (request) -/// +/// * [locations operations cancel projects](struct.ProjectLocationOperationCancelCall.html) (response) +/// * [agent environments users sessions contexts delete projects](struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html) (response) +/// * [agent environments users sessions entity types delete projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html) (response) +/// * [agent sessions delete contexts projects](struct.ProjectAgentSessionDeleteContextCall.html) (response) +/// * [delete agent projects](struct.ProjectDeleteAgentCall.html) (response) +/// * [agent entity types delete projects](struct.ProjectAgentEntityTypeDeleteCall.html) (response) +/// * [agent sessions contexts delete projects](struct.ProjectAgentSessionContextDeleteCall.html) (response) +/// * [agent sessions entity types delete projects](struct.ProjectAgentSessionEntityTypeDeleteCall.html) (response) +/// * [agent intents delete projects](struct.ProjectAgentIntentDeleteCall.html) (response) +/// * [operations cancel projects](struct.ProjectOperationCancelCall.html) (response) +/// * [agent environments users sessions delete contexts projects](struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2ExportAgentRequest { - /// Optional. The - /// [Google Cloud Storage](https://cloud.google.com/storage/docs/) - /// URI to export the agent to. - /// The format of this URI must be `gs:///`. - /// If left unspecified, the serialized agent is returned inline. - #[serde(rename="agentUri")] - pub agent_uri: Option, -} +pub struct GoogleProtobufEmpty { _never_set: Option } -impl RequestValue for GoogleCloudDialogflowV2ExportAgentRequest {} +impl ResponseResult for GoogleProtobufEmpty {} -/// The request message for Agents.TrainAgent. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent train projects](struct.ProjectAgentTrainCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2TrainAgentRequest { _never_set: Option } - -impl RequestValue for GoogleCloudDialogflowV2TrainAgentRequest {} - - -/// Instructs the speech synthesizer on how to generate the output audio content. +/// Cell of TableCardRow. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2OutputAudioConfig { - /// Required. Audio encoding of the synthesized audio content. - #[serde(rename="audioEncoding")] - pub audio_encoding: Option, - /// Optional. The synthesis sample rate (in hertz) for this audio. If not - /// provided, then the synthesizer will use the default sample rate based on - /// the audio encoding. If this is different from the voice's natural sample - /// rate, then the synthesizer will honor this request by converting to the - /// desired sample rate (which might result in worse audio quality). - #[serde(rename="sampleRateHertz")] - pub sample_rate_hertz: Option, - /// Optional. Configuration of how speech should be synthesized. - #[serde(rename="synthesizeSpeechConfig")] - pub synthesize_speech_config: Option, +pub struct GoogleCloudDialogflowV2IntentMessageTableCardCell { + /// Required. Text in this cell. + pub text: Option, } -impl Part for GoogleCloudDialogflowV2OutputAudioConfig {} +impl Part for GoogleCloudDialogflowV2IntentMessageTableCardCell {} -/// The suggestion chip message that allows the user to jump out to the app -/// or website associated with this agent. +/// Contains information about a button. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { - /// Required. The URI of the app or site to open when the user taps the - /// suggestion chip. - pub uri: Option, - /// Required. The name of the app or site this chip is linking to. - #[serde(rename="destinationName")] - pub destination_name: Option, +pub struct GoogleCloudDialogflowV2IntentMessageCardButton { + /// Optional. The text to show on the button. + pub text: Option, + /// Optional. The text to send back to the Dialogflow API or a URI to + /// open. + pub postback: Option, } -impl Part for GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion {} - - -/// Represents an entity type. -/// Entity types serve as a tool for extracting parameter values from natural -/// language queries. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent entity types get projects](struct.ProjectAgentEntityTypeGetCall.html) (response) -/// * [agent entity types patch projects](struct.ProjectAgentEntityTypePatchCall.html) (request|response) -/// * [agent entity types create projects](struct.ProjectAgentEntityTypeCreateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2EntityType { - /// Optional. Indicates whether the entity type can be automatically - /// expanded. - #[serde(rename="autoExpansionMode")] - pub auto_expansion_mode: Option, - /// Optional. The collection of entity entries associated with the entity type. - pub entities: Option>, - /// Required. Indicates the kind of entity type. - pub kind: Option, - /// Required. The name of the entity type. - #[serde(rename="displayName")] - pub display_name: Option, - /// The unique identifier of the entity type. - /// Required for EntityTypes.UpdateEntityType and - /// EntityTypes.BatchUpdateEntityTypes methods. - /// Format: `projects//agent/entityTypes/`. - pub name: Option, -} - -impl RequestValue for GoogleCloudDialogflowV2EntityType {} -impl ResponseResult for GoogleCloudDialogflowV2EntityType {} - - -/// The response message for Intents.ListIntents. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent intents list projects](struct.ProjectAgentIntentListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2ListIntentsResponse { - /// Token to retrieve the next page of results, or empty if there are no - /// more results in the list. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of agent intents. There will be a maximum number of items - /// returned based on the page_size field in the request. - pub intents: Option>, -} - -impl ResponseResult for GoogleCloudDialogflowV2ListIntentsResponse {} - - -/// The result of sentiment analysis as configured by -/// `sentiment_analysis_request_config`. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2SentimentAnalysisResult { - /// The sentiment analysis result for `query_text`. - #[serde(rename="queryTextSentiment")] - pub query_text_sentiment: Option, -} - -impl Part for GoogleCloudDialogflowV2SentimentAnalysisResult {} - - -/// The card for presenting a list of options to select from. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageListSelect { - /// Required. List items. - pub items: Option>, - /// Optional. The overall title of the list. - pub title: Option, -} - -impl Part for GoogleCloudDialogflowV2IntentMessageListSelect {} +impl Part for GoogleCloudDialogflowV2IntentMessageCardButton {} /// The `Status` type defines a logical error model that is suitable for @@ -1712,207 +2309,101 @@ pub struct GoogleRpcStatus { impl Part for GoogleRpcStatus {} -/// Additional info about the select item for when it is triggered in a -/// dialog. +/// Browse Carousel Card for Actions on Google. +/// https://developers.google.com/actions/assistant/responses#browsing_carousel /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageSelectItemInfo { - /// Optional. A list of synonyms that can also be used to trigger this - /// item in dialog. - pub synonyms: Option>, - /// Required. A unique key that will be sent back to the agent if this - /// response is given. - pub key: Option, +pub struct GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard { + /// Required. List of items in the Browse Carousel Card. Minimum of two + /// items, maximum of ten. + pub items: Option>, + /// Optional. Settings for displaying the image. Applies to every image in + /// items. + #[serde(rename="imageDisplayOptions")] + pub image_display_options: Option, } -impl Part for GoogleCloudDialogflowV2IntentMessageSelectItemInfo {} +impl Part for GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard {} -/// The collection of suggestions. +/// The quick replies response message. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageSuggestions { - /// Required. The list of suggested replies. - pub suggestions: Option>, -} - -impl Part for GoogleCloudDialogflowV2IntentMessageSuggestions {} - - -/// The sentiment, such as positive/negative feeling or association, for a unit -/// of analysis, such as the query text. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2Sentiment { - /// A non-negative number in the [0, +inf) range, which represents the absolute - /// magnitude of sentiment, regardless of score (positive or negative). - pub magnitude: Option, - /// Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - /// sentiment). - pub score: Option, -} - -impl Part for GoogleCloudDialogflowV2Sentiment {} - - -/// Represents the result of conversational query or event processing. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2QueryResult { - /// The collection of rich messages to present to the user. - #[serde(rename="fulfillmentMessages")] - pub fulfillment_messages: Option>, - /// The text to be pronounced to the user or shown on the screen. - /// Note: This is a legacy field, `fulfillment_messages` should be preferred. - #[serde(rename="fulfillmentText")] - pub fulfillment_text: Option, - /// This field is set to: - /// - /// - `false` if the matched intent has required parameters and not all of - /// the required parameter values have been collected. - /// - `true` if all required parameter values have been collected, or if the - /// matched intent doesn't contain any required parameters. - #[serde(rename="allRequiredParamsPresent")] - pub all_required_params_present: Option, - /// The collection of extracted parameters. - pub parameters: Option>, - /// The language that was triggered during intent detection. - /// See [Language - /// Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. - #[serde(rename="languageCode")] - pub language_code: Option, - /// The Speech recognition confidence between 0.0 and 1.0. A higher number - /// indicates an estimated greater likelihood that the recognized words are - /// correct. The default of 0.0 is a sentinel value indicating that confidence - /// was not set. - /// - /// This field is not guaranteed to be accurate or set. In particular this - /// field isn't set for StreamingDetectIntent since the streaming endpoint has - /// separate confidence estimates per portion of the audio in - /// StreamingRecognitionResult. - #[serde(rename="speechRecognitionConfidence")] - pub speech_recognition_confidence: Option, - /// The intent detection confidence. Values range from 0.0 - /// (completely uncertain) to 1.0 (completely certain). - /// If there are `multiple knowledge_answers` messages, this value is set to - /// the greatest `knowledgeAnswers.match_confidence` value in the list. - #[serde(rename="intentDetectionConfidence")] - pub intent_detection_confidence: Option, - /// The action name from the matched intent. - pub action: Option, - /// The intent that matched the conversational query. Some, not - /// all fields are filled in this message, including but not limited to: - /// `name`, `display_name` and `webhook_state`. - pub intent: Option, - /// The sentiment analysis result, which depends on the - /// `sentiment_analysis_request_config` specified in the request. - #[serde(rename="sentimentAnalysisResult")] - pub sentiment_analysis_result: Option, - /// The free-form diagnostic info. For example, this field could contain - /// webhook call latency. The string keys of the Struct's fields map can change - /// without notice. - #[serde(rename="diagnosticInfo")] - pub diagnostic_info: Option>, - /// The original conversational query text: - /// - /// - If natural language text was provided as input, `query_text` contains - /// a copy of the input. - /// - If natural language speech audio was provided as input, `query_text` - /// contains the speech recognition result. If speech recognizer produced - /// multiple alternatives, a particular one is picked. - /// - If automatic spell correction is enabled, `query_text` will contain the - /// corrected user input. - #[serde(rename="queryText")] - pub query_text: Option, - /// The collection of output contexts. If applicable, - /// `output_contexts.parameters` contains entries with name - /// `.original` containing the original parameter values - /// before the query. - #[serde(rename="outputContexts")] - pub output_contexts: Option>, - /// If the query was fulfilled by a webhook call, this field is set to the - /// value of the `source` field returned in the webhook response. - #[serde(rename="webhookSource")] - pub webhook_source: Option, - /// If the query was fulfilled by a webhook call, this field is set to the - /// value of the `payload` field returned in the webhook response. - #[serde(rename="webhookPayload")] - pub webhook_payload: Option>, -} - -impl Part for GoogleCloudDialogflowV2QueryResult {} - - -/// The basic card message. Useful for displaying information. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageBasicCard { - /// Optional. The collection of card buttons. - pub buttons: Option>, - /// Required, unless image is present. The body text of the card. - #[serde(rename="formattedText")] - pub formatted_text: Option, - /// Optional. The image for the card. - pub image: Option, - /// Optional. The subtitle of the card. - pub subtitle: Option, - /// Optional. The title of the card. +pub struct GoogleCloudDialogflowV2IntentMessageQuickReplies { + /// Optional. The collection of quick replies. + #[serde(rename="quickReplies")] + pub quick_replies: Option>, + /// Optional. The title of the collection of quick replies. pub title: Option, } -impl Part for GoogleCloudDialogflowV2IntentMessageBasicCard {} +impl Part for GoogleCloudDialogflowV2IntentMessageQuickReplies {} -/// Represents an example that the agent is trained on. +/// The response message for Operations.ListOperations. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [operations list projects](struct.ProjectOperationListCall.html) (response) +/// * [locations operations list projects](struct.ProjectLocationOperationListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentTrainingPhrase { - /// Required. The ordered list of training phrase parts. - /// The parts are concatenated in order to form the training phrase. - /// - /// Note: The API does not automatically annotate training phrases like the - /// Dialogflow Console does. - /// - /// Note: Do not forget to include whitespace at part boundaries, - /// so the training phrase is well formatted when the parts are concatenated. - /// - /// If the training phrase does not need to be annotated with parameters, - /// you just need a single part with only the Part.text field set. - /// - /// If you want to annotate the training phrase, you must create multiple - /// parts, where the fields of each part are populated in one of two ways: - /// - /// * `Part.text` is set to a part of the phrase that has no parameters. - /// * `Part.text` is set to a part of the phrase that you want to annotate, - /// and the `entity_type`, `alias`, and `user_defined` fields are all - /// set. - pub parts: Option>, - /// Required. The type of the training phrase. - #[serde(rename="type")] - pub type_: Option, - /// Output only. The unique identifier of this training phrase. - pub name: Option, - /// Optional. Indicates how many times this example was added to - /// the intent. Each time a developer adds an existing sample by editing an - /// intent or training, this counter is increased. - #[serde(rename="timesAddedCount")] - pub times_added_count: Option, +pub struct GoogleLongrunningListOperationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, } -impl Part for GoogleCloudDialogflowV2IntentTrainingPhrase {} +impl ResponseResult for GoogleLongrunningListOperationsResponse {} + + +/// Represents an entity type. +/// Entity types serve as a tool for extracting parameter values from natural +/// language queries. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types get projects](struct.ProjectAgentEntityTypeGetCall.html) (response) +/// * [agent entity types patch projects](struct.ProjectAgentEntityTypePatchCall.html) (request|response) +/// * [agent entity types create projects](struct.ProjectAgentEntityTypeCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2EntityType { + /// Optional. Indicates whether the entity type can be automatically + /// expanded. + #[serde(rename="autoExpansionMode")] + pub auto_expansion_mode: Option, + /// Optional. The collection of entity entries associated with the entity type. + pub entities: Option>, + /// Required. Indicates the kind of entity type. + pub kind: Option, + /// Required. The name of the entity type. + #[serde(rename="displayName")] + pub display_name: Option, + /// Optional. Enables fuzzy entity extraction during classification. + #[serde(rename="enableFuzzyExtraction")] + pub enable_fuzzy_extraction: Option, + /// The unique identifier of the entity type. + /// Required for EntityTypes.UpdateEntityType and + /// EntityTypes.BatchUpdateEntityTypes methods. + /// Format: `projects//agent/entityTypes/`. + pub name: Option, +} + +impl RequestValue for GoogleCloudDialogflowV2EntityType {} +impl ResponseResult for GoogleCloudDialogflowV2EntityType {} /// The image response message. @@ -1933,36 +2424,59 @@ pub struct GoogleCloudDialogflowV2IntentMessageImage { impl Part for GoogleCloudDialogflowV2IntentMessageImage {} +/// The request message for EntityTypes.BatchDeleteEntityTypes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent entity types batch delete projects](struct.ProjectAgentEntityTypeBatchDeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest { + /// Required. The names entity types to delete. All names must point to the + /// same agent as `parent`. + #[serde(rename="entityTypeNames")] + pub entity_type_names: Option>, +} + +impl RequestValue for GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest {} + + /// Represents the parameters of the conversational query. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2QueryParameters { - /// Optional. The geo location of this conversational query. + /// The geo location of this conversational query. #[serde(rename="geoLocation")] pub geo_location: Option, - /// Optional. The collection of contexts to be activated before this query is + /// The collection of contexts to be activated before this query is /// executed. pub contexts: Option>, - /// Optional. Configures the type of sentiment analysis to perform. If not + /// Configures the type of sentiment analysis to perform. If not /// provided, sentiment analysis is not performed. #[serde(rename="sentimentAnalysisRequestConfig")] pub sentiment_analysis_request_config: Option, - /// Optional. The time zone of this conversational query from the + /// The time zone of this conversational query from the /// [time zone database](https://www.iana.org/time-zones), e.g., /// America/New_York, Europe/Paris. If not provided, the time zone specified in /// agent settings is used. #[serde(rename="timeZone")] pub time_zone: Option, - /// Optional. Specifies whether to delete all contexts in the current session + /// Specifies whether to delete all contexts in the current session /// before the new ones are activated. #[serde(rename="resetContexts")] pub reset_contexts: Option, - /// Optional. This field can be used to pass custom data into the webhook - /// associated with the agent. Arbitrary JSON objects are supported. + /// This field can be used to pass custom data to your webhook. + /// Arbitrary JSON objects are supported. + /// If supplied, the value is used to populate the + /// `WebhookRequest.original_detect_intent_request.payload` + /// field sent to your webhook. pub payload: Option>, - /// Optional. Additional session entity types to replace or extend developer + /// Additional session entity types to replace or extend developer /// entity types with. The entity synonyms apply to all languages and persist /// for the session of this query. #[serde(rename="sessionEntityTypes")] @@ -1972,39 +2486,58 @@ pub struct GoogleCloudDialogflowV2QueryParameters { impl Part for GoogleCloudDialogflowV2QueryParameters {} -/// The simple response message containing speech or text. +/// Represents a single validation error. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageSimpleResponse { - /// One of text_to_speech or ssml must be provided. Structured spoken - /// response to the user in the SSML format. Mutually exclusive with - /// text_to_speech. - pub ssml: Option, - /// One of text_to_speech or ssml must be provided. The plain text of the - /// speech output. Mutually exclusive with ssml. - #[serde(rename="textToSpeech")] - pub text_to_speech: Option, - /// Optional. The text to display. - #[serde(rename="displayText")] - pub display_text: Option, +pub struct GoogleCloudDialogflowV2ValidationError { + /// The detailed error messsage. + #[serde(rename="errorMessage")] + pub error_message: Option, + /// The severity of the error. + pub severity: Option, + /// The names of the entries that the error is associated with. + /// Format: + /// + /// - "projects//agent", if the error is associated with the entire + /// agent. + /// - "projects//agent/intents/", if the error is + /// associated with certain intents. + /// - "projects//agent/intents//trainingPhrases/", if the + /// error is associated with certain intent training phrases. + /// - "projects//agent/intents//parameters/", if the error is associated with certain intent parameters. + /// - "projects//agent/entities/", if the error is + /// associated with certain entities. + pub entries: Option>, } -impl Part for GoogleCloudDialogflowV2IntentMessageSimpleResponse {} +impl Part for GoogleCloudDialogflowV2ValidationError {} -/// Opens the given URI. +/// The request message for Agents.ImportAgent. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent import projects](struct.ProjectAgentImportCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { - /// Required. The HTTP or HTTPS scheme URI. - pub uri: Option, +pub struct GoogleCloudDialogflowV2ImportAgentRequest { + /// The URI to a Google Cloud Storage file containing the agent to import. + /// Note: The URI must start with "gs://". + #[serde(rename="agentUri")] + pub agent_uri: Option, + /// Zip compressed raw byte content for agent. + #[serde(rename="agentContent")] + pub agent_content: Option, } -impl Part for GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction {} +impl RequestValue for GoogleCloudDialogflowV2ImportAgentRequest {} /// This resource represents a long-running operation that is the result of a @@ -2018,11 +2551,12 @@ impl Part for GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { /// * [agent restore projects](struct.ProjectAgentRestoreCall.html) (response) /// * [agent intents batch delete projects](struct.ProjectAgentIntentBatchDeleteCall.html) (response) /// * [agent entity types batch delete projects](struct.ProjectAgentEntityTypeBatchDeleteCall.html) (response) -/// * [agent import projects](struct.ProjectAgentImportCall.html) (response) +/// * [agent train projects](struct.ProjectAgentTrainCall.html) (response) /// * [agent export projects](struct.ProjectAgentExportCall.html) (response) /// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (response) -/// * [agent train projects](struct.ProjectAgentTrainCall.html) (response) +/// * [agent import projects](struct.ProjectAgentImportCall.html) (response) /// * [agent intents batch update projects](struct.ProjectAgentIntentBatchUpdateCall.html) (response) +/// * [locations operations get projects](struct.ProjectLocationOperationGetCall.html) (response) /// * [agent entity types entities batch update projects](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html) (response) /// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (response) /// * [operations get projects](struct.ProjectOperationGetCall.html) (response) @@ -2059,162 +2593,59 @@ pub struct GoogleLongrunningOperation { impl ResponseResult for GoogleLongrunningOperation {} -/// Represents a conversational agent. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent projects](struct.ProjectAgentCall.html) (request|response) -/// * [get agent projects](struct.ProjectGetAgentCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2Agent { - /// Optional. The URI of the agent's avatar. - /// Avatars are used throughout the Dialogflow console and in the self-hosted - /// [Web - /// Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) - /// integration. - #[serde(rename="avatarUri")] - pub avatar_uri: Option, - /// Required. The name of this agent. - #[serde(rename="displayName")] - pub display_name: Option, - /// Optional. The description of this agent. - /// The maximum length is 500 characters. If exceeded, the request is rejected. - pub description: Option, - /// Required. The project of this agent. - /// Format: `projects/`. - pub parent: Option, - /// Required. The default language of the agent as a language tag. See - /// [Language - /// Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. This field cannot be - /// set by the `Update` method. - #[serde(rename="defaultLanguageCode")] - pub default_language_code: Option, - /// Optional. API version displayed in Dialogflow console. If not specified, - /// V2 API is assumed. Clients are free to query different service endpoints - /// for different API versions. However, bots connectors and webhook calls will - /// follow the specified API version. - #[serde(rename="apiVersion")] - pub api_version: Option, - /// Optional. Determines whether this agent should log conversation queries. - #[serde(rename="enableLogging")] - pub enable_logging: Option, - /// Optional. Determines how intents are detected from user queries. - #[serde(rename="matchMode")] - pub match_mode: Option, - /// Optional. The list of all languages supported by this agent (except for the - /// `default_language_code`). - #[serde(rename="supportedLanguageCodes")] - pub supported_language_codes: Option>, - /// Optional. The agent tier. If not specified, TIER_STANDARD is assumed. - pub tier: Option, - /// Required. The time zone of this agent from the - /// [time zone database](https://www.iana.org/time-zones), e.g., - /// America/New_York, Europe/Paris. - #[serde(rename="timeZone")] - pub time_zone: Option, - /// Optional. To filter out false positive results and still get variety in - /// matched natural language inputs for your agent, you can tune the machine - /// learning classification threshold. If the returned score value is less than - /// the threshold value, then a fallback intent will be triggered or, if there - /// are no fallback intents defined, no intent will be triggered. The score - /// values range from 0.0 (completely uncertain) to 1.0 (completely certain). - /// If set to 0.0, the default of 0.3 is used. - #[serde(rename="classificationThreshold")] - pub classification_threshold: Option, -} - -impl RequestValue for GoogleCloudDialogflowV2Agent {} -impl ResponseResult for GoogleCloudDialogflowV2Agent {} - - -/// This message is a wrapper around a collection of entity types. +/// Browsing carousel tile /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2EntityTypeBatch { - /// A collection of entity types. - #[serde(rename="entityTypes")] - pub entity_types: Option>, -} - -impl Part for GoogleCloudDialogflowV2EntityTypeBatch {} - - -/// An item in the list. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageListSelectItem { - /// Required. Additional information about this option. - pub info: Option, - /// Optional. The image to display. +pub struct GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem { + /// Optional. Hero image for the carousel item. pub image: Option, - /// Optional. The main text describing the item. + /// Optional. Text that appears at the bottom of the Browse Carousel + /// Card. Maximum of one line of text. + pub footer: Option, + /// Optional. Description of the carousel item. Maximum of four lines of + /// text. pub description: Option, - /// Required. The title of the list item. + /// Required. Action to present to the user. + #[serde(rename="openUriAction")] + pub open_uri_action: Option, + /// Required. Title of the carousel item. Maximum of two lines of text. pub title: Option, } -impl Part for GoogleCloudDialogflowV2IntentMessageListSelectItem {} +impl Part for GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem {} -/// Represents a single followup intent in the chain. +/// The collection of suggestions. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentFollowupIntentInfo { - /// The unique identifier of the followup intent. - /// Format: `projects//agent/intents/`. - #[serde(rename="followupIntentName")] - pub followup_intent_name: Option, - /// The unique identifier of the followup intent's parent. - /// Format: `projects//agent/intents/`. - #[serde(rename="parentFollowupIntentName")] - pub parent_followup_intent_name: Option, +pub struct GoogleCloudDialogflowV2IntentMessageSuggestions { + /// Required. The list of suggested replies. + pub suggestions: Option>, } -impl Part for GoogleCloudDialogflowV2IntentFollowupIntentInfo {} +impl Part for GoogleCloudDialogflowV2IntentMessageSuggestions {} -/// The request message for EntityTypes.BatchDeleteEntityTypes. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [agent entity types batch delete projects](struct.ProjectAgentEntityTypeBatchDeleteCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest { - /// Required. The names entity types to delete. All names must point to the - /// same agent as `parent`. - #[serde(rename="entityTypeNames")] - pub entity_type_names: Option>, -} - -impl RequestValue for GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest {} - - -/// The text response message. +/// The suggestion chip message that allows the user to jump out to the app +/// or website associated with this agent. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2IntentMessageText { - /// Optional. The collection of the agent's responses. - pub text: Option>, +pub struct GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { + /// Required. The URI of the app or site to open when the user taps the + /// suggestion chip. + pub uri: Option, + /// Required. The name of the app or site this chip is linking to. + #[serde(rename="destinationName")] + pub destination_name: Option, } -impl Part for GoogleCloudDialogflowV2IntentMessageText {} +impl Part for GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion {} @@ -2246,7 +2677,7 @@ impl Part for GoogleCloudDialogflowV2IntentMessageText {} /// ::default(), None); /// let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `agent(...)`, `agent_entity_types_batch_delete(...)`, `agent_entity_types_batch_update(...)`, `agent_entity_types_create(...)`, `agent_entity_types_delete(...)`, `agent_entity_types_entities_batch_create(...)`, `agent_entity_types_entities_batch_delete(...)`, `agent_entity_types_entities_batch_update(...)`, `agent_entity_types_get(...)`, `agent_entity_types_list(...)`, `agent_entity_types_patch(...)`, `agent_export(...)`, `agent_import(...)`, `agent_intents_batch_delete(...)`, `agent_intents_batch_update(...)`, `agent_intents_create(...)`, `agent_intents_delete(...)`, `agent_intents_get(...)`, `agent_intents_list(...)`, `agent_intents_patch(...)`, `agent_restore(...)`, `agent_search(...)`, `agent_sessions_contexts_create(...)`, `agent_sessions_contexts_delete(...)`, `agent_sessions_contexts_get(...)`, `agent_sessions_contexts_list(...)`, `agent_sessions_contexts_patch(...)`, `agent_sessions_delete_contexts(...)`, `agent_sessions_detect_intent(...)`, `agent_sessions_entity_types_create(...)`, `agent_sessions_entity_types_delete(...)`, `agent_sessions_entity_types_get(...)`, `agent_sessions_entity_types_list(...)`, `agent_sessions_entity_types_patch(...)`, `agent_train(...)`, `delete_agent(...)`, `get_agent(...)` and `operations_get(...)` +/// // like `agent_entity_types_batch_delete(...)`, `agent_entity_types_batch_update(...)`, `agent_entity_types_create(...)`, `agent_entity_types_delete(...)`, `agent_entity_types_entities_batch_create(...)`, `agent_entity_types_entities_batch_delete(...)`, `agent_entity_types_entities_batch_update(...)`, `agent_entity_types_get(...)`, `agent_entity_types_list(...)`, `agent_entity_types_patch(...)`, `agent_environments_users_sessions_contexts_create(...)`, `agent_environments_users_sessions_contexts_delete(...)`, `agent_environments_users_sessions_contexts_get(...)`, `agent_environments_users_sessions_contexts_list(...)`, `agent_environments_users_sessions_contexts_patch(...)`, `agent_environments_users_sessions_delete_contexts(...)`, `agent_environments_users_sessions_detect_intent(...)`, `agent_environments_users_sessions_entity_types_create(...)`, `agent_environments_users_sessions_entity_types_delete(...)`, `agent_environments_users_sessions_entity_types_get(...)`, `agent_environments_users_sessions_entity_types_list(...)`, `agent_environments_users_sessions_entity_types_patch(...)`, `agent_export(...)`, `agent_get_fulfillment(...)`, `agent_get_validation_result(...)`, `agent_import(...)`, `agent_intents_batch_delete(...)`, `agent_intents_batch_update(...)`, `agent_intents_create(...)`, `agent_intents_delete(...)`, `agent_intents_get(...)`, `agent_intents_list(...)`, `agent_intents_patch(...)`, `agent_restore(...)`, `agent_search(...)`, `agent_sessions_contexts_create(...)`, `agent_sessions_contexts_delete(...)`, `agent_sessions_contexts_get(...)`, `agent_sessions_contexts_list(...)`, `agent_sessions_contexts_patch(...)`, `agent_sessions_delete_contexts(...)`, `agent_sessions_detect_intent(...)`, `agent_sessions_entity_types_create(...)`, `agent_sessions_entity_types_delete(...)`, `agent_sessions_entity_types_get(...)`, `agent_sessions_entity_types_list(...)`, `agent_sessions_entity_types_patch(...)`, `agent_train(...)`, `agent_update_fulfillment(...)`, `delete_agent(...)`, `get_agent(...)`, `locations_operations_cancel(...)`, `locations_operations_get(...)`, `locations_operations_list(...)`, `operations_cancel(...)`, `operations_get(...)`, `operations_list(...)` and `set_agent(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2263,16 +2694,48 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all active contexts in the specified session. + /// Returns the list of all session entity types in the specified session. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. /// /// # Arguments /// - /// * `parent` - Required. The name of the session to delete all contexts from. Format: - /// `projects//agent/sessions/`. - pub fn agent_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { - ProjectAgentSessionDeleteContextCall { + /// * `parent` - Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_entity_types_list(&self, parent: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + ProjectAgentSessionEntityTypeListCall { hub: self.hub, _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_contexts_delete(&self, name: &str) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionContextDeleteCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2283,12 +2746,20 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Updates the specified session entity type. /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// /// # Arguments /// /// * `request` - No description provided. /// * `name` - Required. The unique identifier of this session entity type. Format: /// `projects//agent/sessions//entityTypes/`. + /// Display Name>`, or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// `` must be the display name of an existing entity /// type in the same agent that will be overridden or supplemented. pub fn agent_sessions_entity_types_patch(&self, request: GoogleCloudDialogflowV2SessionEntityType, name: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { @@ -2303,6 +2774,74 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_entity_types_delete(&self, name: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_contexts_get(&self, name: &str) -> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionContextGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn locations_operations_get(&self, name: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + ProjectLocationOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates/Creates multiple entity types in the specified agent. @@ -2325,6 +2864,30 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_contexts_list(&self, parent: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + ProjectAgentSessionContextListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Trains the specified agent. @@ -2371,20 +2934,39 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates multiple new entities in the specified entity type. - /// - /// Operation + /// Creates/updates the specified agent. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The name of the entity type to create entities in. Format: - /// `projects//agent/entityTypes/`. - pub fn agent_entity_types_entities_batch_create(&self, request: GoogleCloudDialogflowV2BatchCreateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { - ProjectAgentEntityTypeEntityBatchCreateCall { + /// * `parent` - Required. The project of this agent. + /// Format: `projects/`. + pub fn set_agent(&self, request: GoogleCloudDialogflowV2Agent, parent: &str) -> ProjectSetAgentCall<'a, C, A> { + ProjectSetAgentCall { hub: self.hub, _request: request, _parent: parent.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets agent validation result. Agent validation is performed during + /// training time and is updated automatically when training is completed. + /// + /// # Arguments + /// + /// * `parent` - Required. The project that the agent is associated with. + /// Format: `projects/`. + pub fn agent_get_validation_result(&self, parent: &str) -> ProjectAgentGetValidationResultCall<'a, C, A> { + ProjectAgentGetValidationResultCall { + hub: self.hub, + _parent: parent.to_string(), + _language_code: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2427,10 +3009,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `session` - Required. The name of the session this query is sent to. Format: - /// `projects//agent/sessions/`. It's up to the API - /// caller to choose an appropriate session ID. It can be a random number or - /// some type of user identifier (preferably hashed). The length of the session - /// ID must not exceed 36 bytes. + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. pub fn agent_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2DetectIntentRequest, session: &str) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { ProjectAgentSessionDetectIntentCall { hub: self.hub, @@ -2444,18 +3030,79 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates/updates the specified agent. + /// Updates the specified context. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The project of this agent. - /// Format: `projects/`. - pub fn agent(&self, request: GoogleCloudDialogflowV2Agent, parent: &str) -> ProjectAgentCall<'a, C, A> { - ProjectAgentCall { + /// * `name` - Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` + pub fn agent_environments_users_sessions_contexts_patch(&self, request: GoogleCloudDialogflowV2Context, name: &str) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionContextPatchCall { hub: self.hub, _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The project that the agent to fetch is associated with. + /// Format: `projects/`. + pub fn get_agent(&self, parent: &str) -> ProjectGetAgentCall<'a, C, A> { + ProjectGetAgentCall { + hub: self.hub, _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. + pub fn agent_environments_users_sessions_entity_types_patch(&self, request: GoogleCloudDialogflowV2SessionEntityType, name: &str) -> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2487,24 +3134,45 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Imports the specified agent from a ZIP file. - /// - /// Uploads new intents and entity types without deleting the existing ones. - /// Intents and entity types with the same name are replaced with the new - /// versions from ImportAgentRequest. - /// - /// Operation + /// Retrieves the fulfillment. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `parent` - Required. The project that the agent to import is associated with. - /// Format: `projects/`. - pub fn agent_import(&self, request: GoogleCloudDialogflowV2ImportAgentRequest, parent: &str) -> ProjectAgentImportCall<'a, C, A> { - ProjectAgentImportCall { + /// * `name` - Required. The name of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub fn agent_get_fulfillment(&self, name: &str) -> ProjectAgentGetFulfillmentCall<'a, C, A> { + ProjectAgentGetFulfillmentCall { hub: self.hub, - _request: request, - _parent: parent.to_string(), + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn locations_operations_list(&self, name: &str) -> ProjectLocationOperationListCall<'a, C, A> { + ProjectLocationOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2539,6 +3207,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// method does not affect entities in the entity type that aren't explicitly /// specified in the request. /// + /// /// Operation /// /// # Arguments @@ -2564,11 +3233,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// If the specified session entity type already exists, overrides the session /// entity type. /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// /// # Arguments /// /// * `request` - No description provided. /// * `parent` - Required. The session to create a session entity type for. - /// Format: `projects//agent/sessions/`. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. pub fn agent_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2SessionEntityType, parent: &str) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { ProjectAgentSessionEntityTypeCreateCall { hub: self.hub, @@ -2582,17 +3259,65 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a context. + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. /// - /// If the specified context already exists, overrides the context. + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn operations_cancel(&self, name: &str) -> ProjectOperationCancelCall<'a, C, A> { + ProjectOperationCancelCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all active contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified we assume default 'draft' environment. + /// If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionDeleteContextCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates multiple new entities in the specified entity type. + /// + /// Operation /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The session to create a context for. - /// Format: `projects//agent/sessions/`. - pub fn agent_sessions_contexts_create(&self, request: GoogleCloudDialogflowV2Context, parent: &str) -> ProjectAgentSessionContextCreateCall<'a, C, A> { - ProjectAgentSessionContextCreateCall { + /// * `parent` - Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. + pub fn agent_entity_types_entities_batch_create(&self, request: GoogleCloudDialogflowV2BatchCreateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + ProjectAgentEntityTypeEntityBatchCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), @@ -2604,59 +3329,50 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the list of all session entity types in the specified session. + /// Updates the specified intent. /// /// # Arguments /// - /// * `parent` - Required. The session to list all session entity types from. - /// Format: `projects//agent/sessions/`. - pub fn agent_sessions_entity_types_list(&self, parent: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { - ProjectAgentSessionEntityTypeListCall { + /// * `request` - No description provided. + /// * `name` - Optional. The unique identifier of this intent. + /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + /// methods. + /// Format: `projects//agent/intents/`. + pub fn agent_intents_patch(&self, request: GoogleCloudDialogflowV2Intent, name: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + ProjectAgentIntentPatchCall { hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the list of all contexts in the specified session. - /// - /// # Arguments - /// - /// * `parent` - Required. The session to list all contexts from. - /// Format: `projects//agent/sessions/`. - pub fn agent_sessions_contexts_list(&self, parent: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { - ProjectAgentSessionContextListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the list of all entity types in the specified agent. - /// - /// # Arguments - /// - /// * `parent` - Required. The agent to list all entity types from. - /// Format: `projects//agent`. - pub fn agent_entity_types_list(&self, parent: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - ProjectAgentEntityTypeListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_entity_types_get(&self, name: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypeGetCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2685,6 +3401,143 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a session entity type. + /// + /// If the specified session entity type already exists, overrides the session + /// entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2SessionEntityType, parent: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_contexts_get(&self, name: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { + ProjectAgentSessionContextGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all session entity types in the specified session. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_entity_types_list(&self, parent: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Processes a natural language query and returns structured, actionable data + /// as a result. This method is not idempotent, because it may cause contexts + /// and session entity types to be updated, which in turn might affect + /// results of future queries. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + pub fn agent_environments_users_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2DetectIntentRequest, session: &str) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionDetectIntentCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a context. + /// + /// If the specified context already exists, overrides the context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_contexts_create(&self, request: GoogleCloudDialogflowV2Context, parent: &str) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionContextCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the specified entity type. @@ -2709,6 +3562,30 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_contexts_list(&self, parent: &str) -> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionContextListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes the specified entity type. @@ -2731,11 +3608,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Retrieves the specified session entity type. /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// /// # Arguments /// /// * `name` - Required. The name of the session entity type. Format: /// `projects//agent/sessions//entityTypes/`. + /// Display Name>` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. pub fn agent_sessions_entity_types_get(&self, name: &str) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { ProjectAgentSessionEntityTypeGetCall { hub: self.hub, @@ -2790,6 +3675,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Deletes entities in the specified entity type. /// + /// /// Operation /// /// # Arguments @@ -2816,9 +3702,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `name` - Required. The unique identifier of the context. Format: - /// `projects//agent/sessions//contexts/`. + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. /// The `Context ID` is always converted to lowercase, may only contain - /// characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long. + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` pub fn agent_sessions_contexts_patch(&self, request: GoogleCloudDialogflowV2Context, name: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { ProjectAgentSessionContextPatchCall { hub: self.hub, @@ -2833,14 +3728,43 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the specified context. + /// Updates the fulfillment. /// /// # Arguments /// - /// * `name` - Required. The name of the context. Format: - /// `projects//agent/sessions//contexts/`. - pub fn agent_sessions_contexts_get(&self, name: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { - ProjectAgentSessionContextGetCall { + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub fn agent_update_fulfillment(&self, request: GoogleCloudDialogflowV2Fulfillment, name: &str) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + ProjectAgentUpdateFulfillmentCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn locations_operations_cancel(&self, name: &str) -> ProjectLocationOperationCancelCall<'a, C, A> { + ProjectLocationOperationCancelCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -2849,6 +3773,54 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes all active contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified we assume default 'draft' environment. + /// If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + ProjectAgentSessionDeleteContextCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Imports the specified agent from a ZIP file. + /// + /// Uploads new intents and entity types without deleting the existing ones. + /// Intents and entity types with the same name are replaced with the new + /// versions from ImportAgentRequest. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to import is associated with. + /// Format: `projects/`. + pub fn agent_import(&self, request: GoogleCloudDialogflowV2ImportAgentRequest, parent: &str) -> ProjectAgentImportCall<'a, C, A> { + ProjectAgentImportCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the latest state of a long-running operation. Clients can use this @@ -2908,15 +3880,23 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the specified agent. + /// Creates a context. + /// + /// If the specified context already exists, overrides the context. /// /// # Arguments /// - /// * `parent` - Required. The project that the agent to fetch is associated with. - /// Format: `projects/`. - pub fn get_agent(&self, parent: &str) -> ProjectGetAgentCall<'a, C, A> { - ProjectGetAgentCall { + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_contexts_create(&self, request: GoogleCloudDialogflowV2Context, parent: &str) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + ProjectAgentSessionContextCreateCall { hub: self.hub, + _request: request, _parent: parent.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -2931,7 +3911,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `name` - Required. The name of the context to delete. Format: - /// `projects//agent/sessions//contexts/`. + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. pub fn agent_sessions_contexts_delete(&self, name: &str) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { ProjectAgentSessionContextDeleteCall { hub: self.hub, @@ -2966,23 +3950,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified intent. + /// Returns the list of all entity types in the specified agent. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `name` - The unique identifier of this intent. - /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents - /// methods. - /// Format: `projects//agent/intents/`. - pub fn agent_intents_patch(&self, request: GoogleCloudDialogflowV2Intent, name: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - ProjectAgentIntentPatchCall { + /// * `parent` - Required. The agent to list all entity types from. + /// Format: `projects//agent`. + pub fn agent_entity_types_list(&self, parent: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + ProjectAgentEntityTypeListCall { hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _language_code: Default::default(), - _intent_view: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2993,11 +3973,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Deletes the specified session entity type. /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// /// # Arguments /// /// * `name` - Required. The name of the entity type to delete. Format: /// `projects//agent/sessions//entityTypes/`. + /// Display Name>` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. pub fn agent_sessions_entity_types_delete(&self, name: &str) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { ProjectAgentSessionEntityTypeDeleteCall { hub: self.hub, @@ -3074,6 +4062,35 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn operations_list(&self, name: &str) -> ProjectOperationListCall<'a, C, A> { + ProjectOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -3084,9 +4101,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Deletes all active contexts in the specified session. +/// Returns the list of all session entity types in the specified session. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. /// -/// A builder for the *agent.sessions.deleteContexts* method supported by a *project* resource. +/// A builder for the *agent.sessions.entityTypes.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -3111,27 +4132,31 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // 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().agent_sessions_delete_contexts("parent") +/// let result = hub.projects().agent_sessions_entity_types_list("parent") +/// .page_token("et") +/// .page_size(-18) /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionDeleteContextCall<'a, C, A> +pub struct ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, _parent: String, + _page_token: Option, + _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentSessionDeleteContextCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeListCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListSessionEntityTypesResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -3140,11 +4165,17 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.deleteContexts", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3156,7 +4187,7 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/entityTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3190,6 +4221,274 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified context. +/// +/// A builder for the *agent.environments.users.sessions.contexts.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_contexts_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + loop { let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { Ok(token) => token, @@ -3259,15 +4558,19 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut } - /// Required. The name of the session to delete all contexts from. Format: - /// `projects//agent/sessions/`. + /// Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -3276,7 +4579,7 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3301,7 +4604,7 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3321,7 +4624,7 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3334,6 +4637,10 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut /// Updates the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. /// /// A builder for the *agent.sessions.entityTypes.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3367,7 +4674,7 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_sessions_entity_types_patch(req, "name") -/// .update_mask("dolores") +/// .update_mask("takimata") /// .doit(); /// # } /// ``` @@ -3546,7 +4853,11 @@ impl<'a, C, A> ProjectAgentSessionEntityTypePatchCall<'a, C, A> where C: BorrowM } /// Required. The unique identifier of this session entity type. Format: /// `projects//agent/sessions//entityTypes/`. + /// Display Name>`, or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// `` must be the display name of an existing entity /// type in the same agent that will be overridden or supplemented. @@ -3629,6 +4940,767 @@ impl<'a, C, A> ProjectAgentSessionEntityTypePatchCall<'a, C, A> where C: BorrowM } +/// Deletes the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.environments.users.sessions.entityTypes.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified context. +/// +/// A builder for the *agent.environments.users.sessions.contexts.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_contexts_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *locations.operations.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates/Creates multiple entity types in the specified agent. /// /// Operation @@ -3911,6 +5983,284 @@ impl<'a, C, A> ProjectAgentEntityTypeBatchUpdateCall<'a, C, A> where C: BorrowMu } +/// Returns the list of all contexts in the specified session. +/// +/// A builder for the *agent.sessions.contexts.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_contexts_list("parent") +/// .page_token("nonumy") +/// .page_size(-19) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListContextsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Trains the specified agent. /// /// Operation @@ -4475,11 +6825,9 @@ impl<'a, C, A> ProjectAgentIntentBatchUpdateCall<'a, C, A> where C: BorrowMut +/// Creates/updates the specified agent. /// -/// A builder for the *agent.entityTypes.entities.batchCreate* method supported by a *project* resource. +/// A builder for the *setAgent* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4491,7 +6839,7 @@ impl<'a, C, A> ProjectAgentIntentBatchUpdateCall<'a, C, A> where C: BorrowMut ProjectAgentIntentBatchUpdateCall<'a, C, A> where C: BorrowMut +pub struct ProjectSetAgentCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2BatchCreateEntitiesRequest, + _request: GoogleCloudDialogflowV2Agent, _parent: String, + _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectSetAgentCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectSetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Agent)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -4540,11 +6890,14 @@ impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: Bo Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchCreate", + dlg.begin(MethodInfo { id: "dialogflow.projects.setAgent", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "parent", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4556,7 +6909,7 @@ impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/entities:batchCreate"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/agent"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4679,28 +7032,35 @@ impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: Bo /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2BatchCreateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2Agent) -> ProjectSetAgentCall<'a, C, A> { self._request = new_value; self } - /// Required. The name of the entity type to create entities in. Format: - /// `projects//agent/entityTypes/`. + /// Required. The project of this agent. + /// Format: `projects/`. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectSetAgentCall<'a, C, A> { self._parent = new_value.to_string(); self } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectSetAgentCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetAgentCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4725,7 +7085,7 @@ impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: Bo /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectSetAgentCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4745,7 +7105,273 @@ impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: Bo /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectSetAgentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets agent validation result. Agent validation is performed during +/// training time and is updated automatically when training is completed. +/// +/// A builder for the *agent.getValidationResult* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_get_validation_result("parent") +/// .language_code("justo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentGetValidationResultCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentGetValidationResultCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentGetValidationResultCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ValidationResult)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.getValidationResult", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/agent/validationResult"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project that the agent is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentGetValidationResultCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The language for which you want a validation result. If not + /// specified, the agent's default language is used. [Many + /// languages](https://cloud.google.com/dialogflow/docs/reference/language) + /// are supported. Note: languages must be enabled in the agent before they can + /// be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentGetValidationResultCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentGetValidationResultCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentGetValidationResultCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentGetValidationResultCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5252,10 +7878,14 @@ impl<'a, C, A> ProjectAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut< self } /// Required. The name of the session this query is sent to. Format: - /// `projects//agent/sessions/`. It's up to the API - /// caller to choose an appropriate session ID. It can be a random number or - /// some type of user identifier (preferably hashed). The length of the session - /// ID must not exceed 36 bytes. + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. /// /// Sets the *session* path property to the given value. /// @@ -5328,9 +7958,9 @@ impl<'a, C, A> ProjectAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut< } -/// Creates/updates the specified agent. +/// Updates the specified context. /// -/// A builder for the *agent* method supported by a *project* resource. +/// A builder for the *agent.environments.users.sessions.contexts.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -5342,7 +7972,7 @@ impl<'a, C, A> ProjectAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut< /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_dialogflow2 as dialogflow2; -/// use dialogflow2::GoogleCloudDialogflowV2Agent; +/// use dialogflow2::GoogleCloudDialogflowV2Context; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -5356,35 +7986,35 @@ impl<'a, C, A> ProjectAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut< /// // 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 = GoogleCloudDialogflowV2Agent::default(); +/// let mut req = GoogleCloudDialogflowV2Context::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().agent(req, "parent") -/// .update_mask("sea") +/// let result = hub.projects().agent_environments_users_sessions_contexts_patch(req, "name") +/// .update_mask("diam") /// .doit(); /// # } /// ``` -pub struct ProjectAgentCall<'a, C, A> +pub struct ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2Agent, - _parent: String, + _request: GoogleCloudDialogflowV2Context, + _name: String, _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Agent)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Context)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -5393,14 +8023,14 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.patch", + http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); + params.push(("name", self._name.to_string())); if let Some(value) = self._update_mask { params.push(("updateMask", value.to_string())); } - for &field in ["alt", "parent", "updateMask"].iter() { + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5412,12 +8042,12 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/agent"; + let mut url = self.hub._base_url.clone() + "v2/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+name}", "name")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -5432,7 +8062,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5474,7 +8104,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -5535,25 +8165,40 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2Agent) -> ProjectAgentCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2Context) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { self._request = new_value; self } - /// Required. The project of this agent. - /// Format: `projects/`. + /// Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { + self._name = new_value.to_string(); self } /// Optional. The mask to control which fields get updated. /// /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } @@ -5563,7 +8208,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5588,7 +8233,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5608,7 +8253,560 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified agent. +/// +/// A builder for the *getAgent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().get_agent("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetAgentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetAgentCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Agent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.getAgent", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/agent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project that the agent to fetch is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectGetAgentCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetAgentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGetAgentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetAgentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.environments.users.sessions.entityTypes.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// use dialogflow2::GoogleCloudDialogflowV2SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2SessionEntityType::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().agent_environments_users_sessions_entity_types_patch(req, "name") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2SessionEntityType, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2SessionEntityType) -> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5902,15 +9100,9 @@ impl<'a, C, A> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> where C: BorrowMu } -/// Imports the specified agent from a ZIP file. -/// -/// Uploads new intents and entity types without deleting the existing ones. -/// Intents and entity types with the same name are replaced with the new -/// versions from ImportAgentRequest. -/// -/// Operation +/// Retrieves the fulfillment. /// -/// A builder for the *agent.import* method supported by a *project* resource. +/// A builder for the *agent.getFulfillment* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -5922,7 +9114,6 @@ impl<'a, C, A> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> where C: BorrowMu /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_dialogflow2 as dialogflow2; -/// use dialogflow2::GoogleCloudDialogflowV2ImportAgentRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -5933,36 +9124,30 @@ impl<'a, C, A> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> where C: BorrowMu /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2ImportAgentRequest::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().agent_import(req, "parent") +/// let result = hub.projects().agent_get_fulfillment("name") /// .doit(); /// # } /// ``` -pub struct ProjectAgentImportCall<'a, C, A> +pub struct ProjectAgentGetFulfillmentCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2ImportAgentRequest, - _parent: String, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentImportCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentGetFulfillmentCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentGetFulfillmentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Fulfillment)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -5971,11 +9156,11 @@ impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.import", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.getFulfillment", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5987,12 +9172,12 @@ impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut ProjectAgentImportCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -6019,17 +9204,6 @@ impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut ProjectAgentImportCall<'a, C, A> where C: BorrowMut ProjectAgentImportCall<'a, C, A> where C: BorrowMut/agent/fulfillment`. /// - /// Sets the *request* property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2ImportAgentRequest) -> ProjectAgentImportCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The project that the agent to import is associated with. - /// Format: `projects/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentImportCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ProjectAgentGetFulfillmentCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -6131,7 +9292,7 @@ impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut ProjectAgentImportCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentGetFulfillmentCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6156,7 +9317,7 @@ impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentImportCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentGetFulfillmentCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6176,7 +9337,300 @@ impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentImportCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentGetFulfillmentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// A builder for the *locations.operations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_operations_list("name") +/// .page_token("Lorem") +/// .page_size(-75) +/// .filter("erat") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6216,10 +9670,10 @@ impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut ProjectAgentIntentListCall<'a, C, A> where C: BorrowMut ProjectAgentIntentListCall<'a, C, A> { @@ -6495,6 +9948,7 @@ impl<'a, C, A> ProjectAgentIntentListCall<'a, C, A> where C: BorrowMut /// /// A builder for the *agent.entityTypes.entities.batchUpdate* method supported by a *project* resource. @@ -6779,6 +10233,10 @@ impl<'a, C, A> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> where C: Bo /// /// If the specified session entity type already exists, overrides the session /// entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. /// /// A builder for the *agent.sessions.entityTypes.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -6985,7 +10443,11 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> where C: Borrow self } /// Required. The session to create a session entity type for. - /// Format: `projects//agent/sessions/`. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// Sets the *parent* path property to the given value. /// @@ -7058,11 +10520,18 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> where C: Borrow } -/// Creates a context. -/// -/// If the specified context already exists, overrides the context. +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. /// -/// A builder for the *agent.sessions.contexts.create* method supported by a *project* resource. +/// A builder for the *operations.cancel* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -7074,7 +10543,510 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> where C: Borrow /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_dialogflow2 as dialogflow2; -/// use dialogflow2::GoogleCloudDialogflowV2Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectOperationCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all active contexts in the specified session. +/// +/// A builder for the *agent.environments.users.sessions.deleteContexts* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_delete_contexts("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.deleteContexts", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified we assume default 'draft' environment. + /// If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates multiple new entities in the specified entity type. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.entities.batchCreate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// use dialogflow2::GoogleCloudDialogflowV2BatchCreateEntitiesRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -7088,33 +11060,33 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> where C: Borrow /// // 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 = GoogleCloudDialogflowV2Context::default(); +/// let mut req = GoogleCloudDialogflowV2BatchCreateEntitiesRequest::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().agent_sessions_contexts_create(req, "parent") +/// let result = hub.projects().agent_entity_types_entities_batch_create(req, "parent") /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionContextCreateCall<'a, C, A> +pub struct ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2Context, + _request: GoogleCloudDialogflowV2BatchCreateEntitiesRequest, _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentSessionContextCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Context)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -7123,7 +11095,7 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.create", + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchCreate", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -7139,7 +11111,7 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/entities:batchCreate"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7262,18 +11234,18 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2Context) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2BatchCreateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { self._request = new_value; self } - /// Required. The session to create a context for. - /// Format: `projects//agent/sessions/`. + /// Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } @@ -7283,7 +11255,7 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7308,7 +11280,7 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -7328,7 +11300,7 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -7340,9 +11312,9 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut } -/// Returns the list of all session entity types in the specified session. +/// Updates the specified intent. /// -/// A builder for the *agent.sessions.entityTypes.list* method supported by a *project* resource. +/// A builder for the *agent.intents.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -7354,6 +11326,7 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_dialogflow2 as dialogflow2; +/// use dialogflow2::GoogleCloudDialogflowV2Intent; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -7364,584 +11337,42 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. +/// // 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 result = hub.projects().agent_sessions_entity_types_list("parent") -/// .page_token("diam") -/// .page_size(-55) -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionEntityTypeListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeListCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListSessionEntityTypesResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/entityTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The session to list all session entity types from. - /// Format: `projects//agent/sessions/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. The next_page_token value returned from a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 100 and at most 1000. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the list of all contexts in the specified session. -/// -/// A builder for the *agent.sessions.contexts.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2 as dialogflow2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2::Dialogflow; +/// let mut req = GoogleCloudDialogflowV2Intent::default(); /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // 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().agent_sessions_contexts_list("parent") -/// .page_token("et") -/// .page_size(-70) +/// let result = hub.projects().agent_intents_patch(req, "name") +/// .update_mask("accusam") +/// .language_code("Lorem") +/// .intent_view("sea") /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionContextListCall<'a, C, A> +pub struct ProjectAgentIntentPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionContextListCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListContextsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The session to list all contexts from. - /// Format: `projects//agent/sessions/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. The next_page_token value returned from a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 100 and at most 1000. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionContextListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the list of all entity types in the specified agent. -/// -/// A builder for the *agent.entityTypes.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2 as dialogflow2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_entity_types_list("parent") -/// .page_token("sea") -/// .page_size(-55) -/// .language_code("eos") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypeListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, + _request: GoogleCloudDialogflowV2Intent, + _name: String, + _update_mask: Option, _language_code: Option, + _intent_view: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentIntentPatchCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListEntityTypesResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Intent)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -7950,20 +11381,20 @@ impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); } if let Some(value) = self._language_code { params.push(("languageCode", value.to_string())); } - for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode"].iter() { + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "languageCode", "intentView"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7975,12 +11406,12 @@ impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2Intent) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. The unique identifier of this intent. + /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + /// methods. + /// Format: `projects//agent/intents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.environments.users.sessions.entityTypes.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_entity_types_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8078,42 +11813,20 @@ impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut/agent`. + /// Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. The next_page_token value returned from a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 100 and at most 1000. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional. The language to list entity synonyms for. If not specified, - /// the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -8122,7 +11835,7 @@ impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8147,7 +11860,7 @@ impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentEntityTypeListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8167,7 +11880,7 @@ impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentEntityTypeListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8461,6 +12174,1408 @@ impl<'a, C, A> ProjectAgentIntentBatchDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2SessionEntityType::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().agent_environments_users_sessions_entity_types_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2SessionEntityType, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2SessionEntityType) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified context. +/// +/// A builder for the *agent.sessions.contexts.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_contexts_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all session entity types in the specified session. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.environments.users.sessions.entityTypes.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_entity_types_list("parent") +/// .page_token("et") +/// .page_size(-46) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListSessionEntityTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Processes a natural language query and returns structured, actionable data +/// as a result. This method is not idempotent, because it may cause contexts +/// and session entity types to be updated, which in turn might affect +/// results of future queries. +/// +/// A builder for the *agent.environments.users.sessions.detectIntent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// use dialogflow2::GoogleCloudDialogflowV2DetectIntentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2DetectIntentRequest::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().agent_environments_users_sessions_detect_intent(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2DetectIntentRequest, + _session: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2DetectIntentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.detectIntent", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+session}:detectIntent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2DetectIntentRequest) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + /// + /// Sets the *session* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn session(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._session = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a context. +/// +/// If the specified context already exists, overrides the context. +/// +/// A builder for the *agent.environments.users.sessions.contexts.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// use dialogflow2::GoogleCloudDialogflowV2Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2Context::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().agent_environments_users_sessions_contexts_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2Context, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2Context) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the specified entity type. /// /// A builder for the *agent.entityTypes.patch* method supported by a *project* resource. @@ -8495,8 +13610,8 @@ impl<'a, C, A> ProjectAgentIntentBatchDeleteCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypePatchCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypePatchCall<'a, C, A> { @@ -8772,6 +13886,284 @@ impl<'a, C, A> ProjectAgentEntityTypePatchCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_contexts_list("parent") +/// .page_token("dolor") +/// .page_size(-48) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListContextsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes the specified entity type. /// /// A builder for the *agent.entityTypes.delete* method supported by a *project* resource. @@ -9022,6 +14414,10 @@ impl<'a, C, A> ProjectAgentEntityTypeDeleteCall<'a, C, A> where C: BorrowMut ProjectAgentSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut /// Required. The name of the session entity type. Format: /// `projects//agent/sessions//entityTypes/`. + /// Display Name>` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// Sets the *name* path property to the given value. /// @@ -9305,7 +14705,7 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_entity_types_create(req, "parent") -/// .language_code("labore") +/// .language_code("voluptua.") /// .doit(); /// # } /// ``` @@ -9493,12 +14893,11 @@ impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeCreateCall<'a, C, A> { @@ -9596,7 +14995,7 @@ impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeGetCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeGetCall<'a, C, A> { @@ -9836,6 +15234,7 @@ impl<'a, C, A> ProjectAgentEntityTypeGetCall<'a, C, A> where C: BorrowMut /// /// A builder for the *agent.entityTypes.entities.batchDelete* method supported by a *project* resource. @@ -10150,7 +15549,7 @@ impl<'a, C, A> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> where C: Bo /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_sessions_contexts_patch(req, "name") -/// .update_mask("accusam") +/// .update_mask("vero") /// .doit(); /// # } /// ``` @@ -10328,10 +15727,22 @@ impl<'a, C, A> ProjectAgentSessionContextPatchCall<'a, C, A> where C: BorrowMut< self } /// Required. The unique identifier of the context. Format: - /// `projects//agent/sessions//contexts/`. + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. /// /// The `Context ID` is always converted to lowercase, may only contain - /// characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long. + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` /// /// Sets the *name* path property to the given value. /// @@ -10411,9 +15822,311 @@ impl<'a, C, A> ProjectAgentSessionContextPatchCall<'a, C, A> where C: BorrowMut< } -/// Retrieves the specified context. +/// Updates the fulfillment. /// -/// A builder for the *agent.sessions.contexts.get* method supported by a *project* resource. +/// A builder for the *agent.updateFulfillment* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// use dialogflow2::GoogleCloudDialogflowV2Fulfillment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2Fulfillment::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().agent_update_fulfillment(req, "name") +/// .update_mask("rebum.") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentUpdateFulfillmentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2Fulfillment, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentUpdateFulfillmentCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentUpdateFulfillmentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Fulfillment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.updateFulfillment", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2Fulfillment) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. The mask to control which fields get updated. If the mask is not + /// present, all fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. +/// +/// A builder for the *locations.operations.cancel* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -10438,11 +16151,11 @@ impl<'a, C, A> ProjectAgentSessionContextPatchCall<'a, C, A> where C: BorrowMut< /// // 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().agent_sessions_contexts_get("name") +/// let result = hub.projects().locations_operations_cancel("name") /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionContextGetCall<'a, C, A> +pub struct ProjectLocationOperationCancelCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, @@ -10452,13 +16165,13 @@ pub struct ProjectAgentSessionContextGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentSessionContextGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationOperationCancelCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationOperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Context)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -10467,8 +16180,8 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.operations.cancel", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); for &field in ["alt", "name"].iter() { @@ -10483,7 +16196,7 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut/agent/sessions//contexts/`. + /// The name of the operation resource to be cancelled. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationCancelCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -10603,7 +16315,7 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationCancelCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -10628,7 +16340,7 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationCancelCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -10648,7 +16360,546 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all active contexts in the specified session. +/// +/// A builder for the *agent.sessions.deleteContexts* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_delete_contexts("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionDeleteContextCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionDeleteContextCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.deleteContexts", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified we assume default 'draft' environment. + /// If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Imports the specified agent from a ZIP file. +/// +/// Uploads new intents and entity types without deleting the existing ones. +/// Intents and entity types with the same name are replaced with the new +/// versions from ImportAgentRequest. +/// +/// Operation +/// +/// A builder for the *agent.import* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2 as dialogflow2; +/// use dialogflow2::GoogleCloudDialogflowV2ImportAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2ImportAgentRequest::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().agent_import(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2ImportAgentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentImportCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/agent:import"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2ImportAgentRequest) -> ProjectAgentImportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to import is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentImportCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentImportCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11187,8 +17438,8 @@ impl<'a, C, A> ProjectDeleteAgentCall<'a, C, A> where C: BorrowMut ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut ProjectAgentIntentGetCall<'a, C, A> { @@ -11437,9 +17687,11 @@ impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2Context::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().get_agent("parent") +/// let result = hub.projects().agent_sessions_contexts_create(req, "parent") /// .doit(); /// # } /// ``` -pub struct ProjectGetAgentCall<'a, C, A> +pub struct ProjectAgentSessionContextCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2Context, _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectGetAgentCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Agent)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Context)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -11493,9 +17752,9 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.getAgent", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); for &field in ["alt", "parent"].iter() { if self._additional_params.contains_key(field) { @@ -11509,7 +17768,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/agent"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/contexts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11541,6 +17800,17 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -11557,11 +17827,15 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -11612,14 +17886,27 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, } - /// Required. The project that the agent to fetch is associated with. - /// Format: `projects/`. + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2Context) -> ProjectAgentSessionContextCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectGetAgentCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionContextCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } @@ -11629,7 +17916,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetAgentCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -11654,7 +17941,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectGetAgentCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -11674,7 +17961,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectGetAgentCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11862,7 +18149,11 @@ impl<'a, C, A> ProjectAgentSessionContextDeleteCall<'a, C, A> where C: BorrowMut /// Required. The name of the context to delete. Format: - /// `projects//agent/sessions//contexts/`. + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// Sets the *name* path property to the given value. /// @@ -12217,9 +18508,9 @@ impl<'a, C, A> ProjectAgentExportCall<'a, C, A> where C: BorrowMut ProjectAgentExportCall<'a, C, A> where C: BorrowMut ProjectAgentExportCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2Intent::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().agent_intents_patch(req, "name") -/// .update_mask("consetetur") -/// .language_code("ut") -/// .intent_view("ea") +/// let result = hub.projects().agent_entity_types_list("parent") +/// .page_token("consetetur") +/// .page_size(-58) +/// .language_code("nonumy") /// .doit(); /// # } /// ``` -pub struct ProjectAgentIntentPatchCall<'a, C, A> +pub struct ProjectAgentEntityTypeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2Intent, - _name: String, - _update_mask: Option, + _parent: String, + _page_token: Option, + _page_size: Option, _language_code: Option, - _intent_view: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentIntentPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeListCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2Intent)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2ListEntityTypesResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -12286,20 +18570,20 @@ impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); } if let Some(value) = self._language_code { params.push(("languageCode", value.to_string())); } - if let Some(value) = self._intent_view { - params.push(("intentView", value.to_string())); - } - for &field in ["alt", "name", "updateMask", "languageCode", "intentView"].iter() { + for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12311,12 +18595,12 @@ impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -12343,17 +18627,6 @@ impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut/agent`. /// - /// Sets the *request* property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2Intent) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._request = new_value; + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); self } - /// The unique identifier of this intent. - /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents - /// methods. - /// Format: `projects//agent/intents/`. + /// Optional. The next_page_token value returned from a previous list request. /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._name = new_value.to_string(); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); self } - /// Optional. The mask to control which fields get updated. + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); self } - /// Optional. The language of training phrases, parameters and rich messages - /// defined in `intent`. If not specified, the agent's default language is - /// used. [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). /// /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { self._language_code = Some(new_value.to_string()); self } - /// Optional. The resource view to apply to the returned intent. - /// - /// Sets the *intent view* query property to the given value. - pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._intent_view = Some(new_value.to_string()); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12508,7 +18766,7 @@ impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentIntentPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -12528,7 +18786,7 @@ impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentIntentPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -12541,6 +18799,10 @@ impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> where C: Borrow /// Required. The name of the entity type to delete. Format: /// `projects//agent/sessions//entityTypes/`. + /// Display Name>` or `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// Sets the *name* path property to the given value. /// @@ -12824,8 +19090,8 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_search("parent") -/// .page_token("dolor") -/// .page_size(-48) +/// .page_token("takimata") +/// .page_size(-27) /// .doit(); /// # } /// ``` @@ -12992,7 +19258,7 @@ impl<'a, C, A> ProjectAgentSearchCall<'a, C, A> where C: BorrowMut ProjectAgentSearchCall<'a, C, A> { @@ -13354,8 +19620,8 @@ impl<'a, C, A> ProjectAgentIntentDeleteCall<'a, C, A> where C: BorrowMut ProjectAgentIntentCreateCall<'a, C, A> where C: BorrowMut ProjectAgentIntentCreateCall<'a, C, A> { @@ -13629,3 +19894,296 @@ impl<'a, C, A> ProjectAgentIntentCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().operations_list("name") +/// .page_token("dolore") +/// .page_size(-41) +/// .filter("sed") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/dialogflow2_beta1-cli/Cargo.toml b/gen/dialogflow2_beta1-cli/Cargo.toml index 1c451b61e3..a5dfeb7842 100644 --- a/gen/dialogflow2_beta1-cli/Cargo.toml +++ b/gen/dialogflow2_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dialogflow2_beta1-cli" -version = "1.0.12+20190629" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Dialogflow (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dialogflow2_beta1] path = "../dialogflow2_beta1" -version = "1.0.12+20190629" +version = "1.0.13+20200408" diff --git a/gen/dialogflow2_beta1-cli/README.md b/gen/dialogflow2_beta1-cli/README.md index 1c617ed29a..863f50eaa2 100644 --- a/gen/dialogflow2_beta1-cli/README.md +++ b/gen/dialogflow2_beta1-cli/README.md @@ -25,12 +25,11 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Dialogflow* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *Dialogflow* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash dialogflow2-beta1 [options] projects - agent (-r )... [-p ]... [-o ] agent-entity-types-batch-delete (-r )... [-p ]... [-o ] agent-entity-types-batch-update (-r )... [-p ]... [-o ] agent-entity-types-create (-r )... [-p ]... [-o ] @@ -54,6 +53,8 @@ dialogflow2-beta1 [options] agent-environments-users-sessions-entity-types-list [-p ]... [-o ] agent-environments-users-sessions-entity-types-patch (-r )... [-p ]... [-o ] agent-export (-r )... [-p ]... [-o ] + agent-get-fulfillment [-p ]... [-o ] + agent-get-validation-result [-p ]... [-o ] agent-import (-r )... [-p ]... [-o ] agent-intents-batch-delete (-r )... [-p ]... [-o ] agent-intents-batch-update (-r )... [-p ]... [-o ] @@ -88,6 +89,7 @@ dialogflow2-beta1 [options] agent-sessions-entity-types-list [-p ]... [-o ] agent-sessions-entity-types-patch (-r )... [-p ]... [-o ] agent-train (-r )... [-p ]... [-o ] + agent-update-fulfillment (-r )... [-p ]... [-o ] delete-agent [-p ]... [-o ] get-agent [-p ]... [-o ] knowledge-bases-create (-r )... [-p ]... [-o ] @@ -101,7 +103,63 @@ dialogflow2-beta1 [options] knowledge-bases-get [-p ]... [-o ] knowledge-bases-list [-p ]... [-o ] knowledge-bases-patch (-r )... [-p ]... [-o ] + locations-agent-entity-types-batch-delete (-r )... [-p ]... [-o ] + locations-agent-entity-types-batch-update (-r )... [-p ]... [-o ] + locations-agent-entity-types-create (-r )... [-p ]... [-o ] + locations-agent-entity-types-delete [-p ]... [-o ] + locations-agent-entity-types-entities-batch-create (-r )... [-p ]... [-o ] + locations-agent-entity-types-entities-batch-delete (-r )... [-p ]... [-o ] + locations-agent-entity-types-entities-batch-update (-r )... [-p ]... [-o ] + locations-agent-entity-types-get [-p ]... [-o ] + locations-agent-entity-types-list [-p ]... [-o ] + locations-agent-entity-types-patch (-r )... [-p ]... [-o ] + locations-agent-environments-users-sessions-contexts-create (-r )... [-p ]... [-o ] + locations-agent-environments-users-sessions-contexts-delete [-p ]... [-o ] + locations-agent-environments-users-sessions-contexts-get [-p ]... [-o ] + locations-agent-environments-users-sessions-contexts-list [-p ]... [-o ] + locations-agent-environments-users-sessions-contexts-patch (-r )... [-p ]... [-o ] + locations-agent-environments-users-sessions-delete-contexts [-p ]... [-o ] + locations-agent-environments-users-sessions-detect-intent (-r )... [-p ]... [-o ] + locations-agent-environments-users-sessions-entity-types-create (-r )... [-p ]... [-o ] + locations-agent-environments-users-sessions-entity-types-delete [-p ]... [-o ] + locations-agent-environments-users-sessions-entity-types-get [-p ]... [-o ] + locations-agent-environments-users-sessions-entity-types-list [-p ]... [-o ] + locations-agent-environments-users-sessions-entity-types-patch (-r )... [-p ]... [-o ] + locations-agent-export (-r )... [-p ]... [-o ] + locations-agent-fulfillment (-r )... [-p ]... [-o ] + locations-agent-get-fulfillment [-p ]... [-o ] + locations-agent-import (-r )... [-p ]... [-o ] + locations-agent-intents-batch-delete (-r )... [-p ]... [-o ] + locations-agent-intents-batch-update (-r )... [-p ]... [-o ] + locations-agent-intents-create (-r )... [-p ]... [-o ] + locations-agent-intents-delete [-p ]... [-o ] + locations-agent-intents-get [-p ]... [-o ] + locations-agent-intents-list [-p ]... [-o ] + locations-agent-intents-patch (-r )... [-p ]... [-o ] + locations-agent-restore (-r )... [-p ]... [-o ] + locations-agent-sessions-contexts-create (-r )... [-p ]... [-o ] + locations-agent-sessions-contexts-delete [-p ]... [-o ] + locations-agent-sessions-contexts-get [-p ]... [-o ] + locations-agent-sessions-contexts-list [-p ]... [-o ] + locations-agent-sessions-contexts-patch (-r )... [-p ]... [-o ] + locations-agent-sessions-delete-contexts [-p ]... [-o ] + locations-agent-sessions-detect-intent (-r )... [-p ]... [-o ] + locations-agent-sessions-entity-types-create (-r )... [-p ]... [-o ] + locations-agent-sessions-entity-types-delete [-p ]... [-o ] + locations-agent-sessions-entity-types-get [-p ]... [-o ] + locations-agent-sessions-entity-types-list [-p ]... [-o ] + locations-agent-sessions-entity-types-patch (-r )... [-p ]... [-o ] + locations-agent-train (-r )... [-p ]... [-o ] + locations-delete-agent [-p ]... [-o ] + locations-get-agent [-p ]... [-o ] + locations-operations-cancel [-p ]... [-o ] + locations-operations-get [-p ]... [-o ] + locations-operations-list [-p ]... [-o ] + locations-set-agent (-r )... [-p ]... [-o ] + operations-cancel [-p ]... [-o ] operations-get [-p ]... [-o ] + operations-list [-p ]... [-o ] + set-agent (-r )... [-p ]... [-o ] dialogflow2-beta1 --help Configuration: diff --git a/gen/dialogflow2_beta1-cli/mkdocs.yml b/gen/dialogflow2_beta1-cli/mkdocs.yml index f9544e5bb8..2aa9aa0c0f 100644 --- a/gen/dialogflow2_beta1-cli/mkdocs.yml +++ b/gen/dialogflow2_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Dialogflow v1.0.12+20190629 +site_name: Dialogflow v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-dialogflow2_beta1-cli site_description: A complete library to interact with Dialogflow (protocol v2beta1) @@ -9,7 +9,6 @@ site_dir: build_html pages: - ['index.md', 'Home'] -- ['projects_agent.md', 'Projects', 'Agent'] - ['projects_agent-entity-types-batch-delete.md', 'Projects', 'Agent Entity Types Batch Delete'] - ['projects_agent-entity-types-batch-update.md', 'Projects', 'Agent Entity Types Batch Update'] - ['projects_agent-entity-types-create.md', 'Projects', 'Agent Entity Types Create'] @@ -33,6 +32,8 @@ pages: - ['projects_agent-environments-users-sessions-entity-types-list.md', 'Projects', 'Agent Environments Users Sessions Entity Types List'] - ['projects_agent-environments-users-sessions-entity-types-patch.md', 'Projects', 'Agent Environments Users Sessions Entity Types Patch'] - ['projects_agent-export.md', 'Projects', 'Agent Export'] +- ['projects_agent-get-fulfillment.md', 'Projects', 'Agent Get Fulfillment'] +- ['projects_agent-get-validation-result.md', 'Projects', 'Agent Get Validation Result'] - ['projects_agent-import.md', 'Projects', 'Agent Import'] - ['projects_agent-intents-batch-delete.md', 'Projects', 'Agent Intents Batch Delete'] - ['projects_agent-intents-batch-update.md', 'Projects', 'Agent Intents Batch Update'] @@ -67,6 +68,7 @@ pages: - ['projects_agent-sessions-entity-types-list.md', 'Projects', 'Agent Sessions Entity Types List'] - ['projects_agent-sessions-entity-types-patch.md', 'Projects', 'Agent Sessions Entity Types Patch'] - ['projects_agent-train.md', 'Projects', 'Agent Train'] +- ['projects_agent-update-fulfillment.md', 'Projects', 'Agent Update Fulfillment'] - ['projects_delete-agent.md', 'Projects', 'Delete Agent'] - ['projects_get-agent.md', 'Projects', 'Get Agent'] - ['projects_knowledge-bases-create.md', 'Projects', 'Knowledge Bases Create'] @@ -80,7 +82,63 @@ pages: - ['projects_knowledge-bases-get.md', 'Projects', 'Knowledge Bases Get'] - ['projects_knowledge-bases-list.md', 'Projects', 'Knowledge Bases List'] - ['projects_knowledge-bases-patch.md', 'Projects', 'Knowledge Bases Patch'] +- ['projects_locations-agent-entity-types-batch-delete.md', 'Projects', 'Locations Agent Entity Types Batch Delete'] +- ['projects_locations-agent-entity-types-batch-update.md', 'Projects', 'Locations Agent Entity Types Batch Update'] +- ['projects_locations-agent-entity-types-create.md', 'Projects', 'Locations Agent Entity Types Create'] +- ['projects_locations-agent-entity-types-delete.md', 'Projects', 'Locations Agent Entity Types Delete'] +- ['projects_locations-agent-entity-types-entities-batch-create.md', 'Projects', 'Locations Agent Entity Types Entities Batch Create'] +- ['projects_locations-agent-entity-types-entities-batch-delete.md', 'Projects', 'Locations Agent Entity Types Entities Batch Delete'] +- ['projects_locations-agent-entity-types-entities-batch-update.md', 'Projects', 'Locations Agent Entity Types Entities Batch Update'] +- ['projects_locations-agent-entity-types-get.md', 'Projects', 'Locations Agent Entity Types Get'] +- ['projects_locations-agent-entity-types-list.md', 'Projects', 'Locations Agent Entity Types List'] +- ['projects_locations-agent-entity-types-patch.md', 'Projects', 'Locations Agent Entity Types Patch'] +- ['projects_locations-agent-environments-users-sessions-contexts-create.md', 'Projects', 'Locations Agent Environments Users Sessions Contexts Create'] +- ['projects_locations-agent-environments-users-sessions-contexts-delete.md', 'Projects', 'Locations Agent Environments Users Sessions Contexts Delete'] +- ['projects_locations-agent-environments-users-sessions-contexts-get.md', 'Projects', 'Locations Agent Environments Users Sessions Contexts Get'] +- ['projects_locations-agent-environments-users-sessions-contexts-list.md', 'Projects', 'Locations Agent Environments Users Sessions Contexts List'] +- ['projects_locations-agent-environments-users-sessions-contexts-patch.md', 'Projects', 'Locations Agent Environments Users Sessions Contexts Patch'] +- ['projects_locations-agent-environments-users-sessions-delete-contexts.md', 'Projects', 'Locations Agent Environments Users Sessions Delete Contexts'] +- ['projects_locations-agent-environments-users-sessions-detect-intent.md', 'Projects', 'Locations Agent Environments Users Sessions Detect Intent'] +- ['projects_locations-agent-environments-users-sessions-entity-types-create.md', 'Projects', 'Locations Agent Environments Users Sessions Entity Types Create'] +- ['projects_locations-agent-environments-users-sessions-entity-types-delete.md', 'Projects', 'Locations Agent Environments Users Sessions Entity Types Delete'] +- ['projects_locations-agent-environments-users-sessions-entity-types-get.md', 'Projects', 'Locations Agent Environments Users Sessions Entity Types Get'] +- ['projects_locations-agent-environments-users-sessions-entity-types-list.md', 'Projects', 'Locations Agent Environments Users Sessions Entity Types List'] +- ['projects_locations-agent-environments-users-sessions-entity-types-patch.md', 'Projects', 'Locations Agent Environments Users Sessions Entity Types Patch'] +- ['projects_locations-agent-export.md', 'Projects', 'Locations Agent Export'] +- ['projects_locations-agent-fulfillment.md', 'Projects', 'Locations Agent Fulfillment'] +- ['projects_locations-agent-get-fulfillment.md', 'Projects', 'Locations Agent Get Fulfillment'] +- ['projects_locations-agent-import.md', 'Projects', 'Locations Agent Import'] +- ['projects_locations-agent-intents-batch-delete.md', 'Projects', 'Locations Agent Intents Batch Delete'] +- ['projects_locations-agent-intents-batch-update.md', 'Projects', 'Locations Agent Intents Batch Update'] +- ['projects_locations-agent-intents-create.md', 'Projects', 'Locations Agent Intents Create'] +- ['projects_locations-agent-intents-delete.md', 'Projects', 'Locations Agent Intents Delete'] +- ['projects_locations-agent-intents-get.md', 'Projects', 'Locations Agent Intents Get'] +- ['projects_locations-agent-intents-list.md', 'Projects', 'Locations Agent Intents List'] +- ['projects_locations-agent-intents-patch.md', 'Projects', 'Locations Agent Intents Patch'] +- ['projects_locations-agent-restore.md', 'Projects', 'Locations Agent Restore'] +- ['projects_locations-agent-sessions-contexts-create.md', 'Projects', 'Locations Agent Sessions Contexts Create'] +- ['projects_locations-agent-sessions-contexts-delete.md', 'Projects', 'Locations Agent Sessions Contexts Delete'] +- ['projects_locations-agent-sessions-contexts-get.md', 'Projects', 'Locations Agent Sessions Contexts Get'] +- ['projects_locations-agent-sessions-contexts-list.md', 'Projects', 'Locations Agent Sessions Contexts List'] +- ['projects_locations-agent-sessions-contexts-patch.md', 'Projects', 'Locations Agent Sessions Contexts Patch'] +- ['projects_locations-agent-sessions-delete-contexts.md', 'Projects', 'Locations Agent Sessions Delete Contexts'] +- ['projects_locations-agent-sessions-detect-intent.md', 'Projects', 'Locations Agent Sessions Detect Intent'] +- ['projects_locations-agent-sessions-entity-types-create.md', 'Projects', 'Locations Agent Sessions Entity Types Create'] +- ['projects_locations-agent-sessions-entity-types-delete.md', 'Projects', 'Locations Agent Sessions Entity Types Delete'] +- ['projects_locations-agent-sessions-entity-types-get.md', 'Projects', 'Locations Agent Sessions Entity Types Get'] +- ['projects_locations-agent-sessions-entity-types-list.md', 'Projects', 'Locations Agent Sessions Entity Types List'] +- ['projects_locations-agent-sessions-entity-types-patch.md', 'Projects', 'Locations Agent Sessions Entity Types Patch'] +- ['projects_locations-agent-train.md', 'Projects', 'Locations Agent Train'] +- ['projects_locations-delete-agent.md', 'Projects', 'Locations Delete Agent'] +- ['projects_locations-get-agent.md', 'Projects', 'Locations Get Agent'] +- ['projects_locations-operations-cancel.md', 'Projects', 'Locations Operations Cancel'] +- ['projects_locations-operations-get.md', 'Projects', 'Locations Operations Get'] +- ['projects_locations-operations-list.md', 'Projects', 'Locations Operations List'] +- ['projects_locations-set-agent.md', 'Projects', 'Locations Set Agent'] +- ['projects_operations-cancel.md', 'Projects', 'Operations Cancel'] - ['projects_operations-get.md', 'Projects', 'Operations Get'] +- ['projects_operations-list.md', 'Projects', 'Operations List'] +- ['projects_set-agent.md', 'Projects', 'Set Agent'] theme: readthedocs diff --git a/gen/dialogflow2_beta1-cli/src/main.rs b/gen/dialogflow2_beta1-cli/src/main.rs index 0f38e69679..0ca11bb0ff 100644 --- a/gen/dialogflow2_beta1-cli/src/main.rs +++ b/gen/dialogflow2_beta1-cli/src/main.rs @@ -46,106 +46,6 @@ struct Engine<'n> { impl<'n> Engine<'n> { - fn _projects_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::GoogleCloudDialogflowV2beta1Agent = json::value::from_value(object).unwrap(); - let mut call = self.hub.projects().agent(request, opt.value_of("parent").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "update-mask" => { - call = call.update_mask(value.unwrap_or("")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["update-mask"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _projects_agent_entity_types_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -344,9 +244,10 @@ impl<'n> Engine<'n> { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "kind", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -863,9 +764,10 @@ impl<'n> Engine<'n> { "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "kind", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1355,6 +1257,7 @@ impl<'n> Engine<'n> { "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1367,14 +1270,15 @@ impl<'n> Engine<'n> { "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1858,6 +1762,114 @@ impl<'n> Engine<'n> { } } + fn _projects_agent_get_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_get_fulfillment(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_agent_get_validation_result(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().agent_get_validation_result(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_agent_import(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2530,10 +2542,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3021,8 +3034,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "gcs-source.uri" => Some(("gcsSource.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["gcs-source", "uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3216,10 +3230,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3851,6 +3866,7 @@ impl<'n> Engine<'n> { "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3863,14 +3879,15 @@ impl<'n> Engine<'n> { "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4353,6 +4370,102 @@ impl<'n> Engine<'n> { } } + fn _projects_agent_update_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.is-cloud-function" => Some(("genericWebService.isCloudFunction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "generic-web-service.request-headers" => Some(("genericWebService.requestHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "generic-web-service.username" => Some(("genericWebService.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.password" => Some(("genericWebService.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.uri" => Some(("genericWebService.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "enabled", "generic-web-service", "is-cloud-function", "name", "password", "request-headers", "uri", "username"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Fulfillment = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().agent_update_fulfillment(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_delete_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().delete_agent(opt.value_of("parent").unwrap_or("")); @@ -4480,10 +4593,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4971,8 +5085,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "gcs-source.uri" => Some(("gcsSource.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["gcs-source", "uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5166,10 +5281,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "language-code", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5233,6 +5349,3954 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_agent_entity_types_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "entity-type-names" => Some(("entityTypeNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-names"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_entity_types_batch_delete(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-type-batch-uri" => Some(("entityTypeBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-type-batch-uri", "language-code", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_entity_types_batch_update(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1EntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_entity_types_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_entity_types_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_entities_batch_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_entity_types_entities_batch_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_entities_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-values" => Some(("entityValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-values", "language-code"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_entity_types_entities_batch_delete(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_entities_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["language-code", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_entity_types_entities_batch_update(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_entity_types_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_entity_types_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size", "language-code"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "auto-expansion-mode" => Some(("autoExpansionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-fuzzy-extraction" => Some(("enableFuzzyExtraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-expansion-mode", "display-name", "enable-fuzzy-extraction", "kind", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1EntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_entity_types_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code", "update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_contexts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_contexts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_environments_users_sessions_contexts_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_environments_users_sessions_delete_contexts(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.sample-rate-hertz" => Some(("outputAudioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "output-audio-config.audio-encoding" => Some(("outputAudioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.effects-profile-id" => Some(("outputAudioConfig.synthesizeSpeechConfig.effectsProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "output-audio-config.synthesize-speech-config.voice.ssml-gender" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.ssmlGender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.voice.name" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1DetectIntentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_environments_users_sessions_detect_intent(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_environments_users_sessions_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_environments_users_sessions_entity_types_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_export(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1ExportAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_export(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.is-cloud-function" => Some(("genericWebService.isCloudFunction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "generic-web-service.request-headers" => Some(("genericWebService.requestHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "generic-web-service.username" => Some(("genericWebService.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.password" => Some(("genericWebService.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "generic-web-service.uri" => Some(("genericWebService.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "enabled", "generic-web-service", "is-cloud-function", "name", "password", "request-headers", "uri", "username"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Fulfillment = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_fulfillment(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_get_fulfillment(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_get_fulfillment(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_import(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1ImportAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_import(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_intents_batch_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_intents_batch_delete(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_intents_batch_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intent-batch-uri" => Some(("intentBatchUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "intent-view" => Some(("intentView", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["intent-batch-uri", "intent-view", "language-code", "update-mask"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_intents_batch_update(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_intents_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ml-disabled" => Some(("mlDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-interaction" => Some(("endInteraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "end-interaction", "events", "input-context-names", "is-fallback", "ml-disabled", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Intent = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_intents_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "intent-view" => { + call = call.intent_view(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code", "intent-view"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_intents_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_intents_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_intents_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_intents_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "intent-view" => { + call = call.intent_view(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code", "intent-view"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_intents_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_intents_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "intent-view" => { + call = call.intent_view(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "intent-view", "page-size", "language-code"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_intents_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "is-fallback" => Some(("isFallback", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "ml-disabled" => Some(("mlDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-interaction" => Some(("endInteraction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "reset-contexts" => Some(("resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "webhook-state" => Some(("webhookState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-followup-intent-name" => Some(("parentFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-response-platforms" => Some(("defaultResponsePlatforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "priority" => Some(("priority", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "root-followup-intent-name" => Some(("rootFollowupIntentName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "input-context-names" => Some(("inputContextNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "ml-enabled" => Some(("mlEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "events" => Some(("events", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "default-response-platforms", "display-name", "end-interaction", "events", "input-context-names", "is-fallback", "ml-disabled", "ml-enabled", "name", "parent-followup-intent-name", "priority", "reset-contexts", "root-followup-intent-name", "webhook-state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Intent = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_intents_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "intent-view" => { + call = call.intent_view(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["language-code", "update-mask", "intent-view"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_restore(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "agent-uri" => Some(("agentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "agent-content" => Some(("agentContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["agent-content", "agent-uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1RestoreAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_restore(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_contexts_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_sessions_contexts_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_contexts_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_sessions_contexts_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_contexts_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_sessions_contexts_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_contexts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_sessions_contexts_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_contexts_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifespan-count" => Some(("lifespanCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["lifespan-count", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Context = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_sessions_contexts_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_delete_contexts(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_sessions_delete_contexts(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_detect_intent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "input-audio" => Some(("inputAudio", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.sample-rate-hertz" => Some(("outputAudioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "output-audio-config.audio-encoding" => Some(("outputAudioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.effects-profile-id" => Some(("outputAudioConfig.synthesizeSpeechConfig.effectsProfileId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "output-audio-config.synthesize-speech-config.voice.ssml-gender" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.ssmlGender", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.voice.name" => Some(("outputAudioConfig.synthesizeSpeechConfig.voice.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.speaking-rate" => Some(("outputAudioConfig.synthesizeSpeechConfig.speakingRate", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.volume-gain-db" => Some(("outputAudioConfig.synthesizeSpeechConfig.volumeGainDb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config.synthesize-speech-config.pitch" => Some(("outputAudioConfig.synthesizeSpeechConfig.pitch", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "output-audio-config-mask" => Some(("outputAudioConfigMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.language-code" => Some(("queryInput.text.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.text.text" => Some(("queryInput.text.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.language-code" => Some(("queryInput.event.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.event.name" => Some(("queryInput.event.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.language-code" => Some(("queryInput.audioConfig.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.audio-encoding" => Some(("queryInput.audioConfig.audioEncoding", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.phrase-hints" => Some(("queryInput.audioConfig.phraseHints", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-input.audio-config.enable-word-info" => Some(("queryInput.audioConfig.enableWordInfo", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-input.audio-config.sample-rate-hertz" => Some(("queryInput.audioConfig.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "query-input.audio-config.model-variant" => Some(("queryInput.audioConfig.modelVariant", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.model" => Some(("queryInput.audioConfig.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-input.audio-config.single-utterance" => Some(("queryInput.audioConfig.singleUtterance", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.geo-location.latitude" => Some(("queryParams.geoLocation.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.geo-location.longitude" => Some(("queryParams.geoLocation.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "query-params.sentiment-analysis-request-config.analyze-query-text-sentiment" => Some(("queryParams.sentimentAnalysisRequestConfig.analyzeQueryTextSentiment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.webhook-headers" => Some(("queryParams.webhookHeaders", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "query-params.knowledge-base-names" => Some(("queryParams.knowledgeBaseNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "query-params.reset-contexts" => Some(("queryParams.resetContexts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "query-params.time-zone" => Some(("queryParams.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["analyze-query-text-sentiment", "audio-config", "audio-encoding", "effects-profile-id", "enable-word-info", "event", "geo-location", "input-audio", "knowledge-base-names", "language-code", "latitude", "longitude", "model", "model-variant", "name", "output-audio-config", "output-audio-config-mask", "phrase-hints", "pitch", "query-input", "query-params", "reset-contexts", "sample-rate-hertz", "sentiment-analysis-request-config", "single-utterance", "speaking-rate", "ssml-gender", "synthesize-speech-config", "text", "time-zone", "voice", "volume-gain-db", "webhook-headers"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1DetectIntentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_sessions_detect_intent(request, opt.value_of("session").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_entity_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_sessions_entity_types_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_entity_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_sessions_entity_types_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_entity_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_sessions_entity_types_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_entity_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_agent_sessions_entity_types_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_sessions_entity_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "entity-override-mode" => Some(("entityOverrideMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["entity-override-mode", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1SessionEntityType = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_sessions_entity_types_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_agent_train(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1TrainAgentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_agent_train(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_delete_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_delete_agent(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_get_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_get_agent(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_set_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Agent = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_set_agent(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().operations_get(opt.value_of("name").unwrap_or("")); @@ -5285,6 +9349,168 @@ impl<'n> Engine<'n> { } } + fn _projects_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_set_agent(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "avatar-uri" => Some(("avatarUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-language-code" => Some(("defaultLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "match-mode" => Some(("matchMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "supported-language-codes" => Some(("supportedLanguageCodes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "time-zone" => Some(("timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "classification-threshold" => Some(("classificationThreshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["api-version", "avatar-uri", "classification-threshold", "default-language-code", "description", "display-name", "enable-logging", "match-mode", "parent", "supported-language-codes", "tier", "time-zone"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudDialogflowV2beta1Agent = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().set_agent(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); @@ -5292,9 +9518,6 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { - ("agent", Some(opt)) => { - call_result = self._projects_agent(opt, dry_run, &mut err); - }, ("agent-entity-types-batch-delete", Some(opt)) => { call_result = self._projects_agent_entity_types_batch_delete(opt, dry_run, &mut err); }, @@ -5364,6 +9587,12 @@ impl<'n> Engine<'n> { ("agent-export", Some(opt)) => { call_result = self._projects_agent_export(opt, dry_run, &mut err); }, + ("agent-get-fulfillment", Some(opt)) => { + call_result = self._projects_agent_get_fulfillment(opt, dry_run, &mut err); + }, + ("agent-get-validation-result", Some(opt)) => { + call_result = self._projects_agent_get_validation_result(opt, dry_run, &mut err); + }, ("agent-import", Some(opt)) => { call_result = self._projects_agent_import(opt, dry_run, &mut err); }, @@ -5466,6 +9695,9 @@ impl<'n> Engine<'n> { ("agent-train", Some(opt)) => { call_result = self._projects_agent_train(opt, dry_run, &mut err); }, + ("agent-update-fulfillment", Some(opt)) => { + call_result = self._projects_agent_update_fulfillment(opt, dry_run, &mut err); + }, ("delete-agent", Some(opt)) => { call_result = self._projects_delete_agent(opt, dry_run, &mut err); }, @@ -5505,9 +9737,177 @@ impl<'n> Engine<'n> { ("knowledge-bases-patch", Some(opt)) => { call_result = self._projects_knowledge_bases_patch(opt, dry_run, &mut err); }, + ("locations-agent-entity-types-batch-delete", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_batch_delete(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-batch-update", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_batch_update(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-create", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_create(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-delete", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_delete(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-entities-batch-create", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_entities_batch_create(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-entities-batch-delete", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_entities_batch_delete(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-entities-batch-update", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_entities_batch_update(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-get", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_get(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-list", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_list(opt, dry_run, &mut err); + }, + ("locations-agent-entity-types-patch", Some(opt)) => { + call_result = self._projects_locations_agent_entity_types_patch(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-contexts-create", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_contexts_create(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-contexts-delete", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_contexts_delete(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-contexts-get", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_contexts_get(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-contexts-list", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_contexts_list(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-contexts-patch", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_contexts_patch(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-delete-contexts", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_delete_contexts(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-detect-intent", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_detect_intent(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-entity-types-create", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_entity_types_create(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-entity-types-delete", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_entity_types_delete(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-entity-types-get", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_entity_types_get(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-entity-types-list", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_entity_types_list(opt, dry_run, &mut err); + }, + ("locations-agent-environments-users-sessions-entity-types-patch", Some(opt)) => { + call_result = self._projects_locations_agent_environments_users_sessions_entity_types_patch(opt, dry_run, &mut err); + }, + ("locations-agent-export", Some(opt)) => { + call_result = self._projects_locations_agent_export(opt, dry_run, &mut err); + }, + ("locations-agent-fulfillment", Some(opt)) => { + call_result = self._projects_locations_agent_fulfillment(opt, dry_run, &mut err); + }, + ("locations-agent-get-fulfillment", Some(opt)) => { + call_result = self._projects_locations_agent_get_fulfillment(opt, dry_run, &mut err); + }, + ("locations-agent-import", Some(opt)) => { + call_result = self._projects_locations_agent_import(opt, dry_run, &mut err); + }, + ("locations-agent-intents-batch-delete", Some(opt)) => { + call_result = self._projects_locations_agent_intents_batch_delete(opt, dry_run, &mut err); + }, + ("locations-agent-intents-batch-update", Some(opt)) => { + call_result = self._projects_locations_agent_intents_batch_update(opt, dry_run, &mut err); + }, + ("locations-agent-intents-create", Some(opt)) => { + call_result = self._projects_locations_agent_intents_create(opt, dry_run, &mut err); + }, + ("locations-agent-intents-delete", Some(opt)) => { + call_result = self._projects_locations_agent_intents_delete(opt, dry_run, &mut err); + }, + ("locations-agent-intents-get", Some(opt)) => { + call_result = self._projects_locations_agent_intents_get(opt, dry_run, &mut err); + }, + ("locations-agent-intents-list", Some(opt)) => { + call_result = self._projects_locations_agent_intents_list(opt, dry_run, &mut err); + }, + ("locations-agent-intents-patch", Some(opt)) => { + call_result = self._projects_locations_agent_intents_patch(opt, dry_run, &mut err); + }, + ("locations-agent-restore", Some(opt)) => { + call_result = self._projects_locations_agent_restore(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-contexts-create", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_contexts_create(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-contexts-delete", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_contexts_delete(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-contexts-get", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_contexts_get(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-contexts-list", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_contexts_list(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-contexts-patch", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_contexts_patch(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-delete-contexts", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_delete_contexts(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-detect-intent", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_detect_intent(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-entity-types-create", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_entity_types_create(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-entity-types-delete", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_entity_types_delete(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-entity-types-get", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_entity_types_get(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-entity-types-list", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_entity_types_list(opt, dry_run, &mut err); + }, + ("locations-agent-sessions-entity-types-patch", Some(opt)) => { + call_result = self._projects_locations_agent_sessions_entity_types_patch(opt, dry_run, &mut err); + }, + ("locations-agent-train", Some(opt)) => { + call_result = self._projects_locations_agent_train(opt, dry_run, &mut err); + }, + ("locations-delete-agent", Some(opt)) => { + call_result = self._projects_locations_delete_agent(opt, dry_run, &mut err); + }, + ("locations-get-agent", Some(opt)) => { + call_result = self._projects_locations_get_agent(opt, dry_run, &mut err); + }, + ("locations-operations-cancel", Some(opt)) => { + call_result = self._projects_locations_operations_cancel(opt, dry_run, &mut err); + }, + ("locations-operations-get", Some(opt)) => { + call_result = self._projects_locations_operations_get(opt, dry_run, &mut err); + }, + ("locations-operations-list", Some(opt)) => { + call_result = self._projects_locations_operations_list(opt, dry_run, &mut err); + }, + ("locations-set-agent", Some(opt)) => { + call_result = self._projects_locations_set_agent(opt, dry_run, &mut err); + }, + ("operations-cancel", Some(opt)) => { + call_result = self._projects_operations_cancel(opt, dry_run, &mut err); + }, ("operations-get", Some(opt)) => { call_result = self._projects_operations_get(opt, dry_run, &mut err); }, + ("operations-list", Some(opt)) => { + call_result = self._projects_operations_list(opt, dry_run, &mut err); + }, + ("set-agent", Some(opt)) => { + call_result = self._projects_set_agent(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("projects".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -5599,36 +9999,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'agent', 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-environments-users-sessions-contexts-create', 'agent-environments-users-sessions-contexts-delete', 'agent-environments-users-sessions-contexts-get', 'agent-environments-users-sessions-contexts-list', 'agent-environments-users-sessions-contexts-patch', 'agent-environments-users-sessions-delete-contexts', 'agent-environments-users-sessions-detect-intent', 'agent-environments-users-sessions-entity-types-create', 'agent-environments-users-sessions-entity-types-delete', 'agent-environments-users-sessions-entity-types-get', 'agent-environments-users-sessions-entity-types-list', 'agent-environments-users-sessions-entity-types-patch', 'agent-export', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-knowledge-bases-create', 'agent-knowledge-bases-delete', 'agent-knowledge-bases-documents-create', 'agent-knowledge-bases-documents-delete', 'agent-knowledge-bases-documents-get', 'agent-knowledge-bases-documents-list', 'agent-knowledge-bases-documents-patch', 'agent-knowledge-bases-documents-reload', 'agent-knowledge-bases-get', 'agent-knowledge-bases-list', 'agent-knowledge-bases-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'delete-agent', 'get-agent', 'knowledge-bases-create', 'knowledge-bases-delete', 'knowledge-bases-documents-create', 'knowledge-bases-documents-delete', 'knowledge-bases-documents-get', 'knowledge-bases-documents-list', 'knowledge-bases-documents-patch', 'knowledge-bases-documents-reload', 'knowledge-bases-get', 'knowledge-bases-list', 'knowledge-bases-patch' and 'operations-get'", vec![ - ("agent", - Some(r##"Creates/updates the specified agent."##), - "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent", - vec![ - (Some(r##"parent"##), - None, - Some(r##"Required. The project of this agent. - Format: `projects/`."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), + ("projects", "methods: 'agent-entity-types-batch-delete', 'agent-entity-types-batch-update', 'agent-entity-types-create', 'agent-entity-types-delete', 'agent-entity-types-entities-batch-create', 'agent-entity-types-entities-batch-delete', 'agent-entity-types-entities-batch-update', 'agent-entity-types-get', 'agent-entity-types-list', 'agent-entity-types-patch', 'agent-environments-users-sessions-contexts-create', 'agent-environments-users-sessions-contexts-delete', 'agent-environments-users-sessions-contexts-get', 'agent-environments-users-sessions-contexts-list', 'agent-environments-users-sessions-contexts-patch', 'agent-environments-users-sessions-delete-contexts', 'agent-environments-users-sessions-detect-intent', 'agent-environments-users-sessions-entity-types-create', 'agent-environments-users-sessions-entity-types-delete', 'agent-environments-users-sessions-entity-types-get', 'agent-environments-users-sessions-entity-types-list', 'agent-environments-users-sessions-entity-types-patch', 'agent-export', 'agent-get-fulfillment', 'agent-get-validation-result', 'agent-import', 'agent-intents-batch-delete', 'agent-intents-batch-update', 'agent-intents-create', 'agent-intents-delete', 'agent-intents-get', 'agent-intents-list', 'agent-intents-patch', 'agent-knowledge-bases-create', 'agent-knowledge-bases-delete', 'agent-knowledge-bases-documents-create', 'agent-knowledge-bases-documents-delete', 'agent-knowledge-bases-documents-get', 'agent-knowledge-bases-documents-list', 'agent-knowledge-bases-documents-patch', 'agent-knowledge-bases-documents-reload', 'agent-knowledge-bases-get', 'agent-knowledge-bases-list', 'agent-knowledge-bases-patch', 'agent-restore', 'agent-search', 'agent-sessions-contexts-create', 'agent-sessions-contexts-delete', 'agent-sessions-contexts-get', 'agent-sessions-contexts-list', 'agent-sessions-contexts-patch', 'agent-sessions-delete-contexts', 'agent-sessions-detect-intent', 'agent-sessions-entity-types-create', 'agent-sessions-entity-types-delete', 'agent-sessions-entity-types-get', 'agent-sessions-entity-types-list', 'agent-sessions-entity-types-patch', 'agent-train', 'agent-update-fulfillment', 'delete-agent', 'get-agent', 'knowledge-bases-create', 'knowledge-bases-delete', 'knowledge-bases-documents-create', 'knowledge-bases-documents-delete', 'knowledge-bases-documents-get', 'knowledge-bases-documents-list', 'knowledge-bases-documents-patch', 'knowledge-bases-documents-reload', 'knowledge-bases-get', 'knowledge-bases-list', 'knowledge-bases-patch', 'locations-agent-entity-types-batch-delete', 'locations-agent-entity-types-batch-update', 'locations-agent-entity-types-create', 'locations-agent-entity-types-delete', 'locations-agent-entity-types-entities-batch-create', 'locations-agent-entity-types-entities-batch-delete', 'locations-agent-entity-types-entities-batch-update', 'locations-agent-entity-types-get', 'locations-agent-entity-types-list', 'locations-agent-entity-types-patch', 'locations-agent-environments-users-sessions-contexts-create', 'locations-agent-environments-users-sessions-contexts-delete', 'locations-agent-environments-users-sessions-contexts-get', 'locations-agent-environments-users-sessions-contexts-list', 'locations-agent-environments-users-sessions-contexts-patch', 'locations-agent-environments-users-sessions-delete-contexts', 'locations-agent-environments-users-sessions-detect-intent', 'locations-agent-environments-users-sessions-entity-types-create', 'locations-agent-environments-users-sessions-entity-types-delete', 'locations-agent-environments-users-sessions-entity-types-get', 'locations-agent-environments-users-sessions-entity-types-list', 'locations-agent-environments-users-sessions-entity-types-patch', 'locations-agent-export', 'locations-agent-fulfillment', 'locations-agent-get-fulfillment', 'locations-agent-import', 'locations-agent-intents-batch-delete', 'locations-agent-intents-batch-update', 'locations-agent-intents-create', 'locations-agent-intents-delete', 'locations-agent-intents-get', 'locations-agent-intents-list', 'locations-agent-intents-patch', 'locations-agent-restore', 'locations-agent-sessions-contexts-create', 'locations-agent-sessions-contexts-delete', 'locations-agent-sessions-contexts-get', 'locations-agent-sessions-contexts-list', 'locations-agent-sessions-contexts-patch', 'locations-agent-sessions-delete-contexts', 'locations-agent-sessions-detect-intent', 'locations-agent-sessions-entity-types-create', 'locations-agent-sessions-entity-types-delete', 'locations-agent-sessions-entity-types-get', 'locations-agent-sessions-entity-types-list', 'locations-agent-sessions-entity-types-patch', 'locations-agent-train', 'locations-delete-agent', 'locations-get-agent', 'locations-operations-cancel', 'locations-operations-get', 'locations-operations-list', 'locations-set-agent', 'operations-cancel', 'operations-get', 'operations-list' and 'set-agent'", vec![ ("agent-entity-types-batch-delete", Some(r##"Deletes entity types in the specified agent. @@ -6046,7 +10417,14 @@ fn main() { characters in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not specified, we assume default 'draft' - environment. If `User ID` is not specified, we assume default '-' user."##), + environment. If `User ID` is not specified, we assume default '-' user. + + The following context names are reserved for internal use by Dialogflow. + You should not use these contexts or create contexts with these names: + + * `__system_counters__` + * `*_id_dialog_context` + * `*_dialog_params_size`"##), Some(true), Some(false)), @@ -6137,7 +10515,11 @@ fn main() { Some(r##"Creates a session entity type. If the specified session entity type already exists, overrides the - session entity type."##), + session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-create", vec![ (Some(r##"parent"##), @@ -6170,7 +10552,11 @@ fn main() { Some(false)), ]), ("agent-environments-users-sessions-entity-types-delete", - Some(r##"Deletes the specified session entity type."##), + Some(r##"Deletes the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-delete", vec![ (Some(r##"name"##), @@ -6197,7 +10583,11 @@ fn main() { Some(false)), ]), ("agent-environments-users-sessions-entity-types-get", - Some(r##"Retrieves the specified session entity type."##), + Some(r##"Retrieves the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-get", vec![ (Some(r##"name"##), @@ -6224,7 +10614,11 @@ fn main() { Some(false)), ]), ("agent-environments-users-sessions-entity-types-list", - Some(r##"Returns the list of all session entity types in the specified session."##), + Some(r##"Returns the list of all session entity types in the specified session. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-list", vec![ (Some(r##"parent"##), @@ -6251,7 +10645,11 @@ fn main() { Some(false)), ]), ("agent-environments-users-sessions-entity-types-patch", - Some(r##"Updates the specified session entity type."##), + Some(r##"Updates the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-environments-users-sessions-entity-types-patch", vec![ (Some(r##"name"##), @@ -6313,6 +10711,53 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-get-fulfillment", + Some(r##"Retrieves the fulfillment."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-get-fulfillment", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the fulfillment. + Format: `projects//agent/fulfillment`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-get-validation-result", + Some(r##"Gets agent validation result. Agent validation is performed during + training time and is updated automatically when training is completed."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-get-validation-result", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6610,10 +11055,7 @@ fn main() { Some(r##"Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-create", vec![ (Some(r##"parent"##), @@ -6645,10 +11087,7 @@ fn main() { Some(r##"Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-delete", vec![ (Some(r##"name"##), @@ -6728,10 +11167,7 @@ fn main() { Some(r##"Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-patch", vec![ (Some(r##"name"##), @@ -6768,10 +11204,7 @@ fn main() { may be side effects because of internal implementation changes. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-knowledge-bases-documents-reload", vec![ (Some(r##"name"##), @@ -7080,7 +11513,14 @@ fn main() { characters in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not specified, we assume default 'draft' - environment. If `User ID` is not specified, we assume default '-' user."##), + environment. If `User ID` is not specified, we assume default '-' user. + + The following context names are reserved for internal use by Dialogflow. + You should not use these contexts or create contexts with these names: + + * `__system_counters__` + * `*_id_dialog_context` + * `*_dialog_params_size`"##), Some(true), Some(false)), @@ -7171,7 +11611,11 @@ fn main() { Some(r##"Creates a session entity type. If the specified session entity type already exists, overrides the - session entity type."##), + session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-create", vec![ (Some(r##"parent"##), @@ -7204,7 +11648,11 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-delete", - Some(r##"Deletes the specified session entity type."##), + Some(r##"Deletes the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-delete", vec![ (Some(r##"name"##), @@ -7231,7 +11679,11 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-get", - Some(r##"Retrieves the specified session entity type."##), + Some(r##"Retrieves the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-get", vec![ (Some(r##"name"##), @@ -7258,7 +11710,11 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-list", - Some(r##"Returns the list of all session entity types in the specified session."##), + Some(r##"Returns the list of all session entity types in the specified session. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-list", vec![ (Some(r##"parent"##), @@ -7285,7 +11741,11 @@ fn main() { Some(false)), ]), ("agent-sessions-entity-types-patch", - Some(r##"Updates the specified session entity type."##), + Some(r##"Updates the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-sessions-entity-types-patch", vec![ (Some(r##"name"##), @@ -7347,6 +11807,35 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("agent-update-fulfillment", + Some(r##"Updates the fulfillment."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_agent-update-fulfillment", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of the fulfillment. + Format: `projects//agent/fulfillment`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7461,10 +11950,7 @@ fn main() { Some(r##"Creates a new document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-create", vec![ (Some(r##"parent"##), @@ -7496,10 +11982,7 @@ fn main() { Some(r##"Deletes the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-delete", vec![ (Some(r##"name"##), @@ -7579,10 +12062,7 @@ fn main() { Some(r##"Updates the specified document. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-patch", vec![ (Some(r##"name"##), @@ -7619,10 +12099,7 @@ fn main() { may be side effects because of internal implementation changes. Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - only use `projects.knowledgeBases.documents`. - - Operation "##), + only use `projects.knowledgeBases.documents`."##), "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_knowledge-bases-documents-reload", vec![ (Some(r##"name"##), @@ -7730,6 +12207,1662 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-batch-delete", + Some(r##"Deletes entity types in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-batch-delete", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to delete all entities types for. Format: + `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-batch-update", + Some(r##"Updates/Creates multiple entity types in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-batch-update", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to update or create entity types in. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-create", + Some(r##"Creates an entity type in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to create a entity type for. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-delete", + Some(r##"Deletes the specified entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type to delete. + Format: `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-entities-batch-create", + Some(r##"Creates multiple new entities in the specified entity type. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-entities-batch-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the entity type to create entities in. Format: + `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-entities-batch-delete", + Some(r##"Deletes entities in the specified entity type. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-entities-batch-delete", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the entity type to delete entries for. Format: + `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-entities-batch-update", + Some(r##"Updates or creates multiple entities in the specified entity type. This + method does not affect entities in the entity type that aren't explicitly + specified in the request. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-entities-batch-update", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the entity type to update or create entities in. + Format: `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-get", + Some(r##"Retrieves the specified entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type. + Format: `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-list", + Some(r##"Returns the list of all entity types in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to list all entity types from. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-entity-types-patch", + Some(r##"Updates the specified entity type."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-entity-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The unique identifier of the entity type. + Required for EntityTypes.UpdateEntityType and + EntityTypes.BatchUpdateEntityTypes methods. + Format: `projects//agent/entityTypes/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-contexts-create", + Some(r##"Creates a context. + + If the specified context already exists, overrides the context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a context for. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we assume + default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-contexts-delete", + Some(r##"Deletes the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context to delete. Format: + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + not specified, we assume default 'draft' environment. If `User ID` is not + specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-contexts-get", + Some(r##"Retrieves the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context. Format: + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + not specified, we assume default 'draft' environment. If `User ID` is not + specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-contexts-list", + Some(r##"Returns the list of all contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all contexts from. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we assume + default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-contexts-patch", + Some(r##"Updates the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-contexts-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of the context. Format: + `projects//agent/sessions//contexts/`, + or `projects//agent/environments//users//sessions//contexts/`. + + The `Context ID` is always converted to lowercase, may only contain + characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. + + The following context names are reserved for internal use by Dialogflow. + You should not use these contexts or create contexts with these names: + + * `__system_counters__` + * `*_id_dialog_context` + * `*_dialog_params_size`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-delete-contexts", + Some(r##"Deletes all active contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-delete-contexts", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the session to delete all contexts from. Format: + `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-detect-intent", + Some(r##"Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-detect-intent", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The name of the session this query is sent to. Format: + `projects//agent/sessions/`, or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we are using + "-". It's up to the API caller to choose an appropriate `Session ID` and + `User Id`. They can be a random number or some type of user and session + identifiers (preferably hashed). The length of the `Session ID` and + `User ID` must not exceed 36 characters."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-entity-types-create", + Some(r##"Creates a session entity type. + + If the specified session entity type already exists, overrides the + session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a session entity type for. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we assume + default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-entity-types-delete", + Some(r##"Deletes the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type to delete. Format: + `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-entity-types-get", + Some(r##"Retrieves the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the session entity type. Format: + `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-entity-types-list", + Some(r##"Returns the list of all session entity types in the specified session. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all session entity types from. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-environments-users-sessions-entity-types-patch", + Some(r##"Updates the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-environments-users-sessions-entity-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of this session entity type. Format: + `projects//agent/sessions//entityTypes/`, or + `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. + + `` must be the display name of an existing entity + type in the same agent that will be overridden or supplemented."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-export", + Some(r##"Exports the specified agent to a ZIP file. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-export", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to export is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-fulfillment", + Some(r##"Updates the fulfillment."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-fulfillment", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of the fulfillment. + Format: `projects//agent/fulfillment`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-get-fulfillment", + Some(r##"Retrieves the fulfillment."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-get-fulfillment", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the fulfillment. + Format: `projects//agent/fulfillment`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-import", + Some(r##"Imports the specified agent from a ZIP file. + + Uploads new intents and entity types without deleting the existing ones. + Intents and entity types with the same name are replaced with the new + versions from ImportAgentRequest. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-import", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to import is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-intents-batch-delete", + Some(r##"Deletes intents in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-batch-delete", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to delete all entities types for. Format: + `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-intents-batch-update", + Some(r##"Updates/Creates multiple intents in the specified agent. + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-batch-update", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the agent to update or create intents in. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-intents-create", + Some(r##"Creates an intent in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to create a intent for. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-intents-delete", + Some(r##"Deletes the specified intent and its direct or indirect followup intents."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the intent to delete. If this intent has direct or + indirect followup intents, we also delete them. + + Format: `projects//agent/intents/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-intents-get", + Some(r##"Retrieves the specified intent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the intent. + Format: `projects//agent/intents/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-intents-list", + Some(r##"Returns the list of all intents in the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The agent to list all intents from. + Format: `projects//agent`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-intents-patch", + Some(r##"Updates the specified intent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-intents-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The unique identifier of this intent. + Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + methods. + Format: `projects//agent/intents/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-restore", + Some(r##"Restores the specified agent from a ZIP file. + + Replaces the current agent version with a new one. All the intents and + entity types in the older version are deleted. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-restore", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to restore is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-contexts-create", + Some(r##"Creates a context. + + If the specified context already exists, overrides the context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a context for. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we assume + default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-contexts-delete", + Some(r##"Deletes the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context to delete. Format: + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + not specified, we assume default 'draft' environment. If `User ID` is not + specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-contexts-get", + Some(r##"Retrieves the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the context. Format: + `projects//agent/sessions//contexts/` + or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + not specified, we assume default 'draft' environment. If `User ID` is not + specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-contexts-list", + Some(r##"Returns the list of all contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all contexts from. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we assume + default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-contexts-patch", + Some(r##"Updates the specified context."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-contexts-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of the context. Format: + `projects//agent/sessions//contexts/`, + or `projects//agent/environments//users//sessions//contexts/`. + + The `Context ID` is always converted to lowercase, may only contain + characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. + + The following context names are reserved for internal use by Dialogflow. + You should not use these contexts or create contexts with these names: + + * `__system_counters__` + * `*_id_dialog_context` + * `*_dialog_params_size`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-delete-contexts", + Some(r##"Deletes all active contexts in the specified session."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-delete-contexts", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the session to delete all contexts from. Format: + `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-detect-intent", + Some(r##"Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-detect-intent", + vec![ + (Some(r##"session"##), + None, + Some(r##"Required. The name of the session this query is sent to. Format: + `projects//agent/sessions/`, or + `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we are using + "-". It's up to the API caller to choose an appropriate `Session ID` and + `User Id`. They can be a random number or some type of user and session + identifiers (preferably hashed). The length of the `Session ID` and + `User ID` must not exceed 36 characters."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-entity-types-create", + Some(r##"Creates a session entity type. + + If the specified session entity type already exists, overrides the + session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to create a session entity type for. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. If `Environment ID` is not specified, we assume + default 'draft' environment. If `User ID` is not specified, we assume + default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-entity-types-delete", + Some(r##"Deletes the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the entity type to delete. Format: + `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-entity-types-get", + Some(r##"Retrieves the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the session entity type. Format: + `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-entity-types-list", + Some(r##"Returns the list of all session entity types in the specified session. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The session to list all session entity types from. + Format: `projects//agent/sessions/` or + `projects//agent/environments//users// + sessions/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-sessions-entity-types-patch", + Some(r##"Updates the specified session entity type. + + This method doesn't work with Google Assistant integration. + Contact Dialogflow support if you need to use session entities + with Google Assistant integration."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-sessions-entity-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The unique identifier of this session entity type. Format: + `projects//agent/sessions//entityTypes/`, or + `projects//agent/environments//users//sessions//entityTypes/`. + If `Environment ID` is not specified, we assume default 'draft' + environment. If `User ID` is not specified, we assume default '-' user. + + `` must be the display name of an existing entity + type in the same agent that will be overridden or supplemented."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-agent-train", + Some(r##"Trains the specified agent. + + + Operation "##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-agent-train", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to train is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-delete-agent", + Some(r##"Deletes the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-delete-agent", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to delete is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-get-agent", + Some(r##"Retrieves the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-get-agent", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project that the agent to fetch is associated with. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-set-agent", + Some(r##"Creates/updates the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_locations-set-agent", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project of this agent. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7754,6 +13887,66 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-agent", + Some(r##"Creates/updates the specified agent."##), + "Details at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli/projects_set-agent", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project of this agent. + Format: `projects/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7766,7 +13959,7 @@ fn main() { let mut app = App::new("dialogflow2-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190629") + .version("1.0.13+20200408") .about("Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dialogflow2_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/dialogflow2_beta1/Cargo.toml b/gen/dialogflow2_beta1/Cargo.toml index 23c31924e8..72e157b88f 100644 --- a/gen/dialogflow2_beta1/Cargo.toml +++ b/gen/dialogflow2_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dialogflow2_beta1" -version = "1.0.12+20190629" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Dialogflow (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dialogflow2_beta1" homepage = "https://cloud.google.com/dialogflow/" -documentation = "https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629" +documentation = "https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408" license = "MIT" keywords = ["dialogflow", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dialogflow2_beta1/README.md b/gen/dialogflow2_beta1/README.md index a3c4cea45d..f620f73dfa 100644 --- a/gen/dialogflow2_beta1/README.md +++ b/gen/dialogflow2_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-dialogflow2_beta1` library allows access to all features of the *Google Dialogflow* service. -This documentation was generated from *Dialogflow* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *dialogflow:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Dialogflow* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *dialogflow:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Dialogflow* *v2_beta1* API can be found at the [official documentation site](https://cloud.google.com/dialogflow/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.Dialogflow.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.Dialogflow.html) ... * projects - * [*agent*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentCall.html), [*agent entity types batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEntityTypePatchCall.html), [*agent environments users sessions contexts create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html), [*agent environments users sessions contexts delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html), [*agent environments users sessions contexts get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextGetCall.html), [*agent environments users sessions contexts list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextListCall.html), [*agent environments users sessions contexts patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html), [*agent environments users sessions delete contexts*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html), [*agent environments users sessions detect intent*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html), [*agent environments users sessions entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*agent environments users sessions entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*agent environments users sessions entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html), [*agent environments users sessions entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html), [*agent environments users sessions entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html), [*agent export*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentExportCall.html), [*agent import*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentImportCall.html), [*agent intents batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentIntentGetCall.html), [*agent intents list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentIntentListCall.html), [*agent intents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentIntentPatchCall.html), [*agent knowledge bases create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseCreateCall.html), [*agent knowledge bases delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDeleteCall.html), [*agent knowledge bases documents create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentCreateCall.html), [*agent knowledge bases documents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentDeleteCall.html), [*agent knowledge bases documents get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentGetCall.html), [*agent knowledge bases documents list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentListCall.html), [*agent knowledge bases documents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentPatchCall.html), [*agent knowledge bases documents reload*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentReloadCall.html), [*agent knowledge bases get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseGetCall.html), [*agent knowledge bases list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseListCall.html), [*agent knowledge bases patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBasePatchCall.html), [*agent restore*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentRestoreCall.html), [*agent search*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectAgentTrainCall.html), [*delete agent*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectDeleteAgentCall.html), [*get agent*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectGetAgentCall.html), [*knowledge bases create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseCreateCall.html), [*knowledge bases delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDeleteCall.html), [*knowledge bases documents create*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentCreateCall.html), [*knowledge bases documents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentDeleteCall.html), [*knowledge bases documents get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentGetCall.html), [*knowledge bases documents list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentListCall.html), [*knowledge bases documents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentPatchCall.html), [*knowledge bases documents reload*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentReloadCall.html), [*knowledge bases get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseGetCall.html), [*knowledge bases list*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseListCall.html), [*knowledge bases patch*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectKnowledgeBasePatchCall.html) and [*operations get*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.ProjectOperationGetCall.html) + * [*agent entity types batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEntityTypePatchCall.html), [*agent environments users sessions contexts create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html), [*agent environments users sessions contexts delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html), [*agent environments users sessions contexts get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextGetCall.html), [*agent environments users sessions contexts list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextListCall.html), [*agent environments users sessions contexts patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html), [*agent environments users sessions delete contexts*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html), [*agent environments users sessions detect intent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html), [*agent environments users sessions entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*agent environments users sessions entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*agent environments users sessions entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html), [*agent environments users sessions entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html), [*agent environments users sessions entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html), [*agent export*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentExportCall.html), [*agent get fulfillment*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentGetFulfillmentCall.html), [*agent get validation result*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentGetValidationResultCall.html), [*agent import*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentImportCall.html), [*agent intents batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentIntentGetCall.html), [*agent intents list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentIntentListCall.html), [*agent intents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentIntentPatchCall.html), [*agent knowledge bases create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseCreateCall.html), [*agent knowledge bases delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDeleteCall.html), [*agent knowledge bases documents create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentCreateCall.html), [*agent knowledge bases documents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentDeleteCall.html), [*agent knowledge bases documents get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentGetCall.html), [*agent knowledge bases documents list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentListCall.html), [*agent knowledge bases documents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentPatchCall.html), [*agent knowledge bases documents reload*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseDocumentReloadCall.html), [*agent knowledge bases get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseGetCall.html), [*agent knowledge bases list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBaseListCall.html), [*agent knowledge bases patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentKnowledgeBasePatchCall.html), [*agent restore*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentRestoreCall.html), [*agent search*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentTrainCall.html), [*agent update fulfillment*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectAgentUpdateFulfillmentCall.html), [*delete agent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectDeleteAgentCall.html), [*get agent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectGetAgentCall.html), [*knowledge bases create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseCreateCall.html), [*knowledge bases delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDeleteCall.html), [*knowledge bases documents create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentCreateCall.html), [*knowledge bases documents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentDeleteCall.html), [*knowledge bases documents get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentGetCall.html), [*knowledge bases documents list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentListCall.html), [*knowledge bases documents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentPatchCall.html), [*knowledge bases documents reload*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseDocumentReloadCall.html), [*knowledge bases get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseGetCall.html), [*knowledge bases list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBaseListCall.html), [*knowledge bases patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectKnowledgeBasePatchCall.html), [*locations agent entity types batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeBatchDeleteCall.html), [*locations agent entity types batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeBatchUpdateCall.html), [*locations agent entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeCreateCall.html), [*locations agent entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeDeleteCall.html), [*locations agent entity types entities batch create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeEntityBatchCreateCall.html), [*locations agent entity types entities batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeEntityBatchDeleteCall.html), [*locations agent entity types entities batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeEntityBatchUpdateCall.html), [*locations agent entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeGetCall.html), [*locations agent entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypeListCall.html), [*locations agent entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEntityTypePatchCall.html), [*locations agent environments users sessions contexts create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionContextCreateCall.html), [*locations agent environments users sessions contexts delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionContextDeleteCall.html), [*locations agent environments users sessions contexts get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionContextGetCall.html), [*locations agent environments users sessions contexts list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionContextListCall.html), [*locations agent environments users sessions contexts patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionContextPatchCall.html), [*locations agent environments users sessions delete contexts*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionDeleteContextCall.html), [*locations agent environments users sessions detect intent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionDetectIntentCall.html), [*locations agent environments users sessions entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*locations agent environments users sessions entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*locations agent environments users sessions entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall.html), [*locations agent environments users sessions entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall.html), [*locations agent environments users sessions entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall.html), [*locations agent export*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentExportCall.html), [*locations agent fulfillment*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentFulfillmentCall.html), [*locations agent get fulfillment*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentGetFulfillmentCall.html), [*locations agent import*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentImportCall.html), [*locations agent intents batch delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentIntentBatchDeleteCall.html), [*locations agent intents batch update*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentIntentBatchUpdateCall.html), [*locations agent intents create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentIntentCreateCall.html), [*locations agent intents delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentIntentDeleteCall.html), [*locations agent intents get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentIntentGetCall.html), [*locations agent intents list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentIntentListCall.html), [*locations agent intents patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentIntentPatchCall.html), [*locations agent restore*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentRestoreCall.html), [*locations agent sessions contexts create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionContextCreateCall.html), [*locations agent sessions contexts delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionContextDeleteCall.html), [*locations agent sessions contexts get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionContextGetCall.html), [*locations agent sessions contexts list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionContextListCall.html), [*locations agent sessions contexts patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionContextPatchCall.html), [*locations agent sessions delete contexts*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionDeleteContextCall.html), [*locations agent sessions detect intent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionDetectIntentCall.html), [*locations agent sessions entity types create*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionEntityTypeCreateCall.html), [*locations agent sessions entity types delete*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionEntityTypeDeleteCall.html), [*locations agent sessions entity types get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionEntityTypeGetCall.html), [*locations agent sessions entity types list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionEntityTypeListCall.html), [*locations agent sessions entity types patch*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentSessionEntityTypePatchCall.html), [*locations agent train*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationAgentTrainCall.html), [*locations delete agent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationDeleteAgentCall.html), [*locations get agent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationGetAgentCall.html), [*locations operations cancel*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationOperationListCall.html), [*locations set agent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectLocationSetAgentCall.html), [*operations cancel*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectOperationCancelCall.html), [*operations get*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectOperationListCall.html) and [*set agent*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.ProjectSetAgentCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/struct.Dialogflow.html)** +* **[Hub](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/struct.Dialogflow.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,26 +47,38 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.projects().locations_agent_entity_types_batch_delete(...).doit() +let r = hub.projects().agent_knowledge_bases_documents_delete(...).doit() +let r = hub.projects().locations_agent_entity_types_batch_update(...).doit() +let r = hub.projects().agent_intents_batch_update(...).doit() +let r = hub.projects().locations_agent_restore(...).doit() +let r = hub.projects().locations_agent_entity_types_entities_batch_create(...).doit() let r = hub.projects().agent_restore(...).doit() -let r = hub.projects().agent_train(...).doit() +let r = hub.projects().locations_agent_train(...).doit() let r = hub.projects().agent_knowledge_bases_documents_patch(...).doit() -let r = hub.projects().agent_intents_batch_delete(...).doit() let r = hub.projects().knowledge_bases_documents_create(...).doit() -let r = hub.projects().knowledge_bases_documents_patch(...).doit() -let r = hub.projects().knowledge_bases_documents_delete(...).doit() -let r = hub.projects().agent_export(...).doit() let r = hub.projects().agent_entity_types_batch_delete(...).doit() let r = hub.projects().agent_import(...).doit() -let r = hub.projects().agent_knowledge_bases_documents_delete(...).doit() -let r = hub.projects().agent_entity_types_batch_update(...).doit() -let r = hub.projects().agent_knowledge_bases_documents_create(...).doit() -let r = hub.projects().agent_knowledge_bases_documents_reload(...).doit() -let r = hub.projects().agent_intents_batch_update(...).doit() +let r = hub.projects().agent_export(...).doit() +let r = hub.projects().locations_agent_entity_types_entities_batch_update(...).doit() let r = hub.projects().agent_entity_types_entities_batch_update(...).doit() -let r = hub.projects().knowledge_bases_documents_reload(...).doit() -let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() let r = hub.projects().operations_get(...).doit() let r = hub.projects().agent_entity_types_entities_batch_create(...).doit() +let r = hub.projects().agent_knowledge_bases_documents_reload(...).doit() +let r = hub.projects().locations_agent_intents_batch_update(...).doit() +let r = hub.projects().locations_agent_entity_types_entities_batch_delete(...).doit() +let r = hub.projects().agent_intents_batch_delete(...).doit() +let r = hub.projects().locations_agent_import(...).doit() +let r = hub.projects().locations_agent_export(...).doit() +let r = hub.projects().locations_operations_get(...).doit() +let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() +let r = hub.projects().locations_agent_intents_batch_delete(...).doit() +let r = hub.projects().agent_knowledge_bases_documents_create(...).doit() +let r = hub.projects().knowledge_bases_documents_patch(...).doit() +let r = hub.projects().knowledge_bases_documents_delete(...).doit() +let r = hub.projects().agent_train(...).doit() +let r = hub.projects().agent_entity_types_batch_update(...).doit() +let r = hub.projects().knowledge_bases_documents_reload(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -150,17 +162,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -170,29 +182,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dialogflow2_beta1/1.0.12+20190629/google_dialogflow2_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dialogflow2_beta1/1.0.13+20200408/google_dialogflow2_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dialogflow2_beta1/src/lib.rs b/gen/dialogflow2_beta1/src/lib.rs index fda0bea720..4c63d571ca 100644 --- a/gen/dialogflow2_beta1/src/lib.rs +++ b/gen/dialogflow2_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Dialogflow* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *dialogflow:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Dialogflow* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *dialogflow:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Dialogflow* *v2_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/dialogflow/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Dialogflow.html) ... //! //! * projects -//! * [*agent*](struct.ProjectAgentCall.html), [*agent entity types batch delete*](struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](struct.ProjectAgentEntityTypePatchCall.html), [*agent environments users sessions contexts create*](struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html), [*agent environments users sessions contexts delete*](struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html), [*agent environments users sessions contexts get*](struct.ProjectAgentEnvironmentUserSessionContextGetCall.html), [*agent environments users sessions contexts list*](struct.ProjectAgentEnvironmentUserSessionContextListCall.html), [*agent environments users sessions contexts patch*](struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html), [*agent environments users sessions delete contexts*](struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html), [*agent environments users sessions detect intent*](struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html), [*agent environments users sessions entity types create*](struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*agent environments users sessions entity types delete*](struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*agent environments users sessions entity types get*](struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html), [*agent environments users sessions entity types list*](struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html), [*agent environments users sessions entity types patch*](struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html), [*agent export*](struct.ProjectAgentExportCall.html), [*agent import*](struct.ProjectAgentImportCall.html), [*agent intents batch delete*](struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](struct.ProjectAgentIntentGetCall.html), [*agent intents list*](struct.ProjectAgentIntentListCall.html), [*agent intents patch*](struct.ProjectAgentIntentPatchCall.html), [*agent knowledge bases create*](struct.ProjectAgentKnowledgeBaseCreateCall.html), [*agent knowledge bases delete*](struct.ProjectAgentKnowledgeBaseDeleteCall.html), [*agent knowledge bases documents create*](struct.ProjectAgentKnowledgeBaseDocumentCreateCall.html), [*agent knowledge bases documents delete*](struct.ProjectAgentKnowledgeBaseDocumentDeleteCall.html), [*agent knowledge bases documents get*](struct.ProjectAgentKnowledgeBaseDocumentGetCall.html), [*agent knowledge bases documents list*](struct.ProjectAgentKnowledgeBaseDocumentListCall.html), [*agent knowledge bases documents patch*](struct.ProjectAgentKnowledgeBaseDocumentPatchCall.html), [*agent knowledge bases documents reload*](struct.ProjectAgentKnowledgeBaseDocumentReloadCall.html), [*agent knowledge bases get*](struct.ProjectAgentKnowledgeBaseGetCall.html), [*agent knowledge bases list*](struct.ProjectAgentKnowledgeBaseListCall.html), [*agent knowledge bases patch*](struct.ProjectAgentKnowledgeBasePatchCall.html), [*agent restore*](struct.ProjectAgentRestoreCall.html), [*agent search*](struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](struct.ProjectAgentTrainCall.html), [*delete agent*](struct.ProjectDeleteAgentCall.html), [*get agent*](struct.ProjectGetAgentCall.html), [*knowledge bases create*](struct.ProjectKnowledgeBaseCreateCall.html), [*knowledge bases delete*](struct.ProjectKnowledgeBaseDeleteCall.html), [*knowledge bases documents create*](struct.ProjectKnowledgeBaseDocumentCreateCall.html), [*knowledge bases documents delete*](struct.ProjectKnowledgeBaseDocumentDeleteCall.html), [*knowledge bases documents get*](struct.ProjectKnowledgeBaseDocumentGetCall.html), [*knowledge bases documents list*](struct.ProjectKnowledgeBaseDocumentListCall.html), [*knowledge bases documents patch*](struct.ProjectKnowledgeBaseDocumentPatchCall.html), [*knowledge bases documents reload*](struct.ProjectKnowledgeBaseDocumentReloadCall.html), [*knowledge bases get*](struct.ProjectKnowledgeBaseGetCall.html), [*knowledge bases list*](struct.ProjectKnowledgeBaseListCall.html), [*knowledge bases patch*](struct.ProjectKnowledgeBasePatchCall.html) and [*operations get*](struct.ProjectOperationGetCall.html) +//! * [*agent entity types batch delete*](struct.ProjectAgentEntityTypeBatchDeleteCall.html), [*agent entity types batch update*](struct.ProjectAgentEntityTypeBatchUpdateCall.html), [*agent entity types create*](struct.ProjectAgentEntityTypeCreateCall.html), [*agent entity types delete*](struct.ProjectAgentEntityTypeDeleteCall.html), [*agent entity types entities batch create*](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html), [*agent entity types entities batch delete*](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html), [*agent entity types entities batch update*](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html), [*agent entity types get*](struct.ProjectAgentEntityTypeGetCall.html), [*agent entity types list*](struct.ProjectAgentEntityTypeListCall.html), [*agent entity types patch*](struct.ProjectAgentEntityTypePatchCall.html), [*agent environments users sessions contexts create*](struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html), [*agent environments users sessions contexts delete*](struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html), [*agent environments users sessions contexts get*](struct.ProjectAgentEnvironmentUserSessionContextGetCall.html), [*agent environments users sessions contexts list*](struct.ProjectAgentEnvironmentUserSessionContextListCall.html), [*agent environments users sessions contexts patch*](struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html), [*agent environments users sessions delete contexts*](struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html), [*agent environments users sessions detect intent*](struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html), [*agent environments users sessions entity types create*](struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*agent environments users sessions entity types delete*](struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*agent environments users sessions entity types get*](struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html), [*agent environments users sessions entity types list*](struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html), [*agent environments users sessions entity types patch*](struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html), [*agent export*](struct.ProjectAgentExportCall.html), [*agent get fulfillment*](struct.ProjectAgentGetFulfillmentCall.html), [*agent get validation result*](struct.ProjectAgentGetValidationResultCall.html), [*agent import*](struct.ProjectAgentImportCall.html), [*agent intents batch delete*](struct.ProjectAgentIntentBatchDeleteCall.html), [*agent intents batch update*](struct.ProjectAgentIntentBatchUpdateCall.html), [*agent intents create*](struct.ProjectAgentIntentCreateCall.html), [*agent intents delete*](struct.ProjectAgentIntentDeleteCall.html), [*agent intents get*](struct.ProjectAgentIntentGetCall.html), [*agent intents list*](struct.ProjectAgentIntentListCall.html), [*agent intents patch*](struct.ProjectAgentIntentPatchCall.html), [*agent knowledge bases create*](struct.ProjectAgentKnowledgeBaseCreateCall.html), [*agent knowledge bases delete*](struct.ProjectAgentKnowledgeBaseDeleteCall.html), [*agent knowledge bases documents create*](struct.ProjectAgentKnowledgeBaseDocumentCreateCall.html), [*agent knowledge bases documents delete*](struct.ProjectAgentKnowledgeBaseDocumentDeleteCall.html), [*agent knowledge bases documents get*](struct.ProjectAgentKnowledgeBaseDocumentGetCall.html), [*agent knowledge bases documents list*](struct.ProjectAgentKnowledgeBaseDocumentListCall.html), [*agent knowledge bases documents patch*](struct.ProjectAgentKnowledgeBaseDocumentPatchCall.html), [*agent knowledge bases documents reload*](struct.ProjectAgentKnowledgeBaseDocumentReloadCall.html), [*agent knowledge bases get*](struct.ProjectAgentKnowledgeBaseGetCall.html), [*agent knowledge bases list*](struct.ProjectAgentKnowledgeBaseListCall.html), [*agent knowledge bases patch*](struct.ProjectAgentKnowledgeBasePatchCall.html), [*agent restore*](struct.ProjectAgentRestoreCall.html), [*agent search*](struct.ProjectAgentSearchCall.html), [*agent sessions contexts create*](struct.ProjectAgentSessionContextCreateCall.html), [*agent sessions contexts delete*](struct.ProjectAgentSessionContextDeleteCall.html), [*agent sessions contexts get*](struct.ProjectAgentSessionContextGetCall.html), [*agent sessions contexts list*](struct.ProjectAgentSessionContextListCall.html), [*agent sessions contexts patch*](struct.ProjectAgentSessionContextPatchCall.html), [*agent sessions delete contexts*](struct.ProjectAgentSessionDeleteContextCall.html), [*agent sessions detect intent*](struct.ProjectAgentSessionDetectIntentCall.html), [*agent sessions entity types create*](struct.ProjectAgentSessionEntityTypeCreateCall.html), [*agent sessions entity types delete*](struct.ProjectAgentSessionEntityTypeDeleteCall.html), [*agent sessions entity types get*](struct.ProjectAgentSessionEntityTypeGetCall.html), [*agent sessions entity types list*](struct.ProjectAgentSessionEntityTypeListCall.html), [*agent sessions entity types patch*](struct.ProjectAgentSessionEntityTypePatchCall.html), [*agent train*](struct.ProjectAgentTrainCall.html), [*agent update fulfillment*](struct.ProjectAgentUpdateFulfillmentCall.html), [*delete agent*](struct.ProjectDeleteAgentCall.html), [*get agent*](struct.ProjectGetAgentCall.html), [*knowledge bases create*](struct.ProjectKnowledgeBaseCreateCall.html), [*knowledge bases delete*](struct.ProjectKnowledgeBaseDeleteCall.html), [*knowledge bases documents create*](struct.ProjectKnowledgeBaseDocumentCreateCall.html), [*knowledge bases documents delete*](struct.ProjectKnowledgeBaseDocumentDeleteCall.html), [*knowledge bases documents get*](struct.ProjectKnowledgeBaseDocumentGetCall.html), [*knowledge bases documents list*](struct.ProjectKnowledgeBaseDocumentListCall.html), [*knowledge bases documents patch*](struct.ProjectKnowledgeBaseDocumentPatchCall.html), [*knowledge bases documents reload*](struct.ProjectKnowledgeBaseDocumentReloadCall.html), [*knowledge bases get*](struct.ProjectKnowledgeBaseGetCall.html), [*knowledge bases list*](struct.ProjectKnowledgeBaseListCall.html), [*knowledge bases patch*](struct.ProjectKnowledgeBasePatchCall.html), [*locations agent entity types batch delete*](struct.ProjectLocationAgentEntityTypeBatchDeleteCall.html), [*locations agent entity types batch update*](struct.ProjectLocationAgentEntityTypeBatchUpdateCall.html), [*locations agent entity types create*](struct.ProjectLocationAgentEntityTypeCreateCall.html), [*locations agent entity types delete*](struct.ProjectLocationAgentEntityTypeDeleteCall.html), [*locations agent entity types entities batch create*](struct.ProjectLocationAgentEntityTypeEntityBatchCreateCall.html), [*locations agent entity types entities batch delete*](struct.ProjectLocationAgentEntityTypeEntityBatchDeleteCall.html), [*locations agent entity types entities batch update*](struct.ProjectLocationAgentEntityTypeEntityBatchUpdateCall.html), [*locations agent entity types get*](struct.ProjectLocationAgentEntityTypeGetCall.html), [*locations agent entity types list*](struct.ProjectLocationAgentEntityTypeListCall.html), [*locations agent entity types patch*](struct.ProjectLocationAgentEntityTypePatchCall.html), [*locations agent environments users sessions contexts create*](struct.ProjectLocationAgentEnvironmentUserSessionContextCreateCall.html), [*locations agent environments users sessions contexts delete*](struct.ProjectLocationAgentEnvironmentUserSessionContextDeleteCall.html), [*locations agent environments users sessions contexts get*](struct.ProjectLocationAgentEnvironmentUserSessionContextGetCall.html), [*locations agent environments users sessions contexts list*](struct.ProjectLocationAgentEnvironmentUserSessionContextListCall.html), [*locations agent environments users sessions contexts patch*](struct.ProjectLocationAgentEnvironmentUserSessionContextPatchCall.html), [*locations agent environments users sessions delete contexts*](struct.ProjectLocationAgentEnvironmentUserSessionDeleteContextCall.html), [*locations agent environments users sessions detect intent*](struct.ProjectLocationAgentEnvironmentUserSessionDetectIntentCall.html), [*locations agent environments users sessions entity types create*](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall.html), [*locations agent environments users sessions entity types delete*](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall.html), [*locations agent environments users sessions entity types get*](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall.html), [*locations agent environments users sessions entity types list*](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall.html), [*locations agent environments users sessions entity types patch*](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall.html), [*locations agent export*](struct.ProjectLocationAgentExportCall.html), [*locations agent fulfillment*](struct.ProjectLocationAgentFulfillmentCall.html), [*locations agent get fulfillment*](struct.ProjectLocationAgentGetFulfillmentCall.html), [*locations agent import*](struct.ProjectLocationAgentImportCall.html), [*locations agent intents batch delete*](struct.ProjectLocationAgentIntentBatchDeleteCall.html), [*locations agent intents batch update*](struct.ProjectLocationAgentIntentBatchUpdateCall.html), [*locations agent intents create*](struct.ProjectLocationAgentIntentCreateCall.html), [*locations agent intents delete*](struct.ProjectLocationAgentIntentDeleteCall.html), [*locations agent intents get*](struct.ProjectLocationAgentIntentGetCall.html), [*locations agent intents list*](struct.ProjectLocationAgentIntentListCall.html), [*locations agent intents patch*](struct.ProjectLocationAgentIntentPatchCall.html), [*locations agent restore*](struct.ProjectLocationAgentRestoreCall.html), [*locations agent sessions contexts create*](struct.ProjectLocationAgentSessionContextCreateCall.html), [*locations agent sessions contexts delete*](struct.ProjectLocationAgentSessionContextDeleteCall.html), [*locations agent sessions contexts get*](struct.ProjectLocationAgentSessionContextGetCall.html), [*locations agent sessions contexts list*](struct.ProjectLocationAgentSessionContextListCall.html), [*locations agent sessions contexts patch*](struct.ProjectLocationAgentSessionContextPatchCall.html), [*locations agent sessions delete contexts*](struct.ProjectLocationAgentSessionDeleteContextCall.html), [*locations agent sessions detect intent*](struct.ProjectLocationAgentSessionDetectIntentCall.html), [*locations agent sessions entity types create*](struct.ProjectLocationAgentSessionEntityTypeCreateCall.html), [*locations agent sessions entity types delete*](struct.ProjectLocationAgentSessionEntityTypeDeleteCall.html), [*locations agent sessions entity types get*](struct.ProjectLocationAgentSessionEntityTypeGetCall.html), [*locations agent sessions entity types list*](struct.ProjectLocationAgentSessionEntityTypeListCall.html), [*locations agent sessions entity types patch*](struct.ProjectLocationAgentSessionEntityTypePatchCall.html), [*locations agent train*](struct.ProjectLocationAgentTrainCall.html), [*locations delete agent*](struct.ProjectLocationDeleteAgentCall.html), [*locations get agent*](struct.ProjectLocationGetAgentCall.html), [*locations operations cancel*](struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html), [*locations operations list*](struct.ProjectLocationOperationListCall.html), [*locations set agent*](struct.ProjectLocationSetAgentCall.html), [*operations cancel*](struct.ProjectOperationCancelCall.html), [*operations get*](struct.ProjectOperationGetCall.html), [*operations list*](struct.ProjectOperationListCall.html) and [*set agent*](struct.ProjectSetAgentCall.html) //! //! //! @@ -47,26 +47,38 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.projects().locations_agent_entity_types_batch_delete(...).doit() +//! let r = hub.projects().agent_knowledge_bases_documents_delete(...).doit() +//! let r = hub.projects().locations_agent_entity_types_batch_update(...).doit() +//! let r = hub.projects().agent_intents_batch_update(...).doit() +//! let r = hub.projects().locations_agent_restore(...).doit() +//! let r = hub.projects().locations_agent_entity_types_entities_batch_create(...).doit() //! let r = hub.projects().agent_restore(...).doit() -//! let r = hub.projects().agent_train(...).doit() +//! let r = hub.projects().locations_agent_train(...).doit() //! let r = hub.projects().agent_knowledge_bases_documents_patch(...).doit() -//! let r = hub.projects().agent_intents_batch_delete(...).doit() //! let r = hub.projects().knowledge_bases_documents_create(...).doit() -//! let r = hub.projects().knowledge_bases_documents_patch(...).doit() -//! let r = hub.projects().knowledge_bases_documents_delete(...).doit() -//! let r = hub.projects().agent_export(...).doit() //! let r = hub.projects().agent_entity_types_batch_delete(...).doit() //! let r = hub.projects().agent_import(...).doit() -//! let r = hub.projects().agent_knowledge_bases_documents_delete(...).doit() -//! let r = hub.projects().agent_entity_types_batch_update(...).doit() -//! let r = hub.projects().agent_knowledge_bases_documents_create(...).doit() -//! let r = hub.projects().agent_knowledge_bases_documents_reload(...).doit() -//! let r = hub.projects().agent_intents_batch_update(...).doit() +//! let r = hub.projects().agent_export(...).doit() +//! let r = hub.projects().locations_agent_entity_types_entities_batch_update(...).doit() //! let r = hub.projects().agent_entity_types_entities_batch_update(...).doit() -//! let r = hub.projects().knowledge_bases_documents_reload(...).doit() -//! let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() //! let r = hub.projects().operations_get(...).doit() //! let r = hub.projects().agent_entity_types_entities_batch_create(...).doit() +//! let r = hub.projects().agent_knowledge_bases_documents_reload(...).doit() +//! let r = hub.projects().locations_agent_intents_batch_update(...).doit() +//! let r = hub.projects().locations_agent_entity_types_entities_batch_delete(...).doit() +//! let r = hub.projects().agent_intents_batch_delete(...).doit() +//! let r = hub.projects().locations_agent_import(...).doit() +//! let r = hub.projects().locations_agent_export(...).doit() +//! let r = hub.projects().locations_operations_get(...).doit() +//! let r = hub.projects().agent_entity_types_entities_batch_delete(...).doit() +//! let r = hub.projects().locations_agent_intents_batch_delete(...).doit() +//! let r = hub.projects().agent_knowledge_bases_documents_create(...).doit() +//! let r = hub.projects().knowledge_bases_documents_patch(...).doit() +//! let r = hub.projects().knowledge_bases_documents_delete(...).doit() +//! let r = hub.projects().agent_train(...).doit() +//! let r = hub.projects().agent_entity_types_batch_update(...).doit() +//! let r = hub.projects().knowledge_bases_documents_reload(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -354,7 +366,7 @@ impl<'a, C, A> Dialogflow Dialogflow { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://dialogflow.googleapis.com/".to_string(), _root_url: "https://dialogflow.googleapis.com/".to_string(), } @@ -365,7 +377,7 @@ impl<'a, C, A> Dialogflow } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -393,30 +405,28 @@ impl<'a, C, A> Dialogflow // ############ // SCHEMAS ### // ########## -/// Carousel Rich Business Messaging (RBM) rich card. -/// -/// Rich cards allow you to respond to users with more vivid content, e.g. -/// with media and suggestions. -/// -/// For more details about RBM rich cards, please see: -/// https://developers.google.com/rcs-business-messaging/rbm/guides/build/send-messages#rich-cards. -/// If you want to show a single card with more control over the layout, -/// please use RbmStandaloneCard instead. +/// Rich Business Messaging (RBM) Card content /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard { - /// Required. The cards in the carousel. A carousel must have at least - /// 2 cards and at most 10. - #[serde(rename="cardContents")] - pub card_contents: Option>, - /// Required. The width of the cards in the carousel. - #[serde(rename="cardWidth")] - pub card_width: Option, +pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent { + /// Optional. However at least one of the title, description or media must + /// be set. Media (image, GIF or a video) to include in the card. + pub media: Option, + /// Optional. List of suggestions to include in the card. + pub suggestions: Option>, + /// Optional. Description of the card (at most 2000 bytes). + /// + /// At least one of the title, description or media must be set. + pub description: Option, + /// Optional. Title of the card (at most 200 bytes). + /// + /// At least one of the title, description or media must be set. + pub title: Option, } -impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard {} +impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent {} /// Plays audio from a file in Telephony Gateway. @@ -460,19 +470,22 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessage { /// https://jibe.google.com/business-messaging. #[serde(rename="rbmText")] pub rbm_text: Option, - /// Rich Business Messaging (RBM) carousel rich card response. - #[serde(rename="rbmCarouselRichCard")] - pub rbm_carousel_rich_card: Option, + /// Returns a text response. + pub text: Option, /// Displays an image. pub image: Option, /// Synthesizes speech in Telephony Gateway. #[serde(rename="telephonySynthesizeSpeech")] pub telephony_synthesize_speech: Option, - /// Displays suggestion chips for Actions on Google. - pub suggestions: Option, + /// Rich Business Messaging (RBM) carousel rich card response. + #[serde(rename="rbmCarouselRichCard")] + pub rbm_carousel_rich_card: Option, /// Displays a link out suggestion chip for Actions on Google. #[serde(rename="linkOutSuggestion")] pub link_out_suggestion: Option, + /// Browse carousel card for Actions on Google. + #[serde(rename="browseCarouselCard")] + pub browse_carousel_card: Option, /// Displays a basic card for Actions on Google. #[serde(rename="basicCard")] pub basic_card: Option, @@ -482,9 +495,7 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessage { /// Displays a list card for Actions on Google. #[serde(rename="listSelect")] pub list_select: Option, - /// Returns a response containing a custom, platform-specific payload. - /// See the Intent.Message.Platform type for a description of the - /// structure that may be required for your platform. + /// A custom platform-specific response. pub payload: Option>, /// Displays a card. pub card: Option, @@ -499,11 +510,17 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessage { pub rbm_standalone_rich_card: Option, /// Optional. The platform that this message is intended for. pub platform: Option, - /// Returns a text response. - pub text: Option, + /// The media content card for Actions on Google. + #[serde(rename="mediaContent")] + pub media_content: Option, + /// Displays suggestion chips for Actions on Google. + pub suggestions: Option, /// Transfers the call in Telephony Gateway. #[serde(rename="telephonyTransferCall")] pub telephony_transfer_call: Option, + /// Table card for Actions on Google. + #[serde(rename="tableCard")] + pub table_card: Option, } impl Part for GoogleCloudDialogflowV2beta1IntentMessage {} @@ -569,28 +586,71 @@ impl RequestValue for GoogleCloudDialogflowV2beta1Document {} impl ResponseResult for GoogleCloudDialogflowV2beta1Document {} -/// Rich Business Messaging (RBM) Card content +/// Represents an example that the agent is trained on. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent { - /// Optional. However at least one of the title, description or media must - /// be set. Media (image, GIF or a video) to include in the card. - pub media: Option, - /// Optional. List of suggestions to include in the card. - pub suggestions: Option>, - /// Optional. Description of the card (at most 2000 bytes). +pub struct GoogleCloudDialogflowV2beta1IntentTrainingPhrase { + /// Required. The ordered list of training phrase parts. + /// The parts are concatenated in order to form the training phrase. /// - /// At least one of the title, description or media must be set. - pub description: Option, - /// Optional. Title of the card (at most 200 bytes). + /// Note: The API does not automatically annotate training phrases like the + /// Dialogflow Console does. /// - /// At least one of the title, description or media must be set. - pub title: Option, + /// Note: Do not forget to include whitespace at part boundaries, + /// so the training phrase is well formatted when the parts are concatenated. + /// + /// If the training phrase does not need to be annotated with parameters, + /// you just need a single part with only the Part.text field set. + /// + /// If you want to annotate the training phrase, you must create multiple + /// parts, where the fields of each part are populated in one of two ways: + /// + /// * `Part.text` is set to a part of the phrase that has no parameters. + /// * `Part.text` is set to a part of the phrase that you want to annotate, + /// and the `entity_type`, `alias`, and `user_defined` fields are all + /// set. + pub parts: Option>, + /// Required. The type of the training phrase. + #[serde(rename="type")] + pub type_: Option, + /// Output only. The unique identifier of this training phrase. + pub name: Option, + /// Optional. Indicates how many times this example was added to + /// the intent. Each time a developer adds an existing sample by editing an + /// intent or training, this counter is increased. + #[serde(rename="timesAddedCount")] + pub times_added_count: Option, } -impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent {} +impl Part for GoogleCloudDialogflowV2beta1IntentTrainingPhrase {} + + +/// Carousel Rich Business Messaging (RBM) rich card. +/// +/// Rich cards allow you to respond to users with more vivid content, e.g. +/// with media and suggestions. +/// +/// For more details about RBM rich cards, please see: +/// https://developers.google.com/rcs-business-messaging/rbm/guides/build/send-messages#rich-cards. +/// If you want to show a single card with more control over the layout, +/// please use RbmStandaloneCard instead. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard { + /// Required. The cards in the carousel. A carousel must have at least + /// 2 cards and at most 10. + #[serde(rename="cardContents")] + pub card_contents: Option>, + /// Required. The width of the cards in the carousel. + #[serde(rename="cardWidth")] + pub card_width: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard {} /// Represents intent parameters. @@ -637,7 +697,43 @@ pub struct GoogleCloudDialogflowV2beta1IntentParameter { impl Part for GoogleCloudDialogflowV2beta1IntentParameter {} +/// Hints for the speech recognizer to help with recognition in a specific +/// conversation state. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1SpeechContext { + /// Optional. A list of strings containing words and phrases that the speech + /// recognizer should recognize with higher likelihood. + /// + /// This list can be used to: + /// * improve accuracy for words and phrases you expect the user to say, + /// e.g. typical commands for your Dialogflow agent + /// * add additional words to the speech recognizer vocabulary + /// * ... + /// + /// See the [Cloud Speech + /// documentation](https://cloud.google.com/speech-to-text/quotas) for usage + /// limits. + pub phrases: Option>, + /// Optional. Boost for this context compared to other contexts: + /// * If the boost is positive, Dialogflow will increase the probability that + /// the phrases in this context are recognized over similar sounding phrases. + /// * If the boost is unspecified or non-positive, Dialogflow will not apply + /// any boost. + /// + /// Dialogflow recommends that you use boosts in the range (0, 20] and that you + /// find a value that fits your use case with binary search. + pub boost: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1SpeechContext {} + + /// Instructs the speech synthesizer how to generate the output audio content. +/// If this audio config is supplied in a request, it overrides all existing +/// text-to-speech settings applied to the agent. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -646,14 +742,14 @@ pub struct GoogleCloudDialogflowV2beta1OutputAudioConfig { /// Required. Audio encoding of the synthesized audio content. #[serde(rename="audioEncoding")] pub audio_encoding: Option, - /// Optional. The synthesis sample rate (in hertz) for this audio. If not + /// The synthesis sample rate (in hertz) for this audio. If not /// provided, then the synthesizer will use the default sample rate based on /// the audio encoding. If this is different from the voice's natural sample /// rate, then the synthesizer will honor this request by converting to the /// desired sample rate (which might result in worse audio quality). #[serde(rename="sampleRateHertz")] pub sample_rate_hertz: Option, - /// Optional. Configuration of how speech should be synthesized. + /// Configuration of how speech should be synthesized. #[serde(rename="synthesizeSpeechConfig")] pub synthesize_speech_config: Option, } @@ -661,50 +757,54 @@ pub struct GoogleCloudDialogflowV2beta1OutputAudioConfig { impl Part for GoogleCloudDialogflowV2beta1OutputAudioConfig {} -/// Represents the parameters of the conversational query. +/// Actions on Google action to open a given url. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1QueryParameters { - /// Optional. The geo location of this conversational query. - #[serde(rename="geoLocation")] - pub geo_location: Option, - /// Optional. The collection of contexts to be activated before this query is - /// executed. - pub contexts: Option>, - /// Optional. KnowledgeBases to get alternative results from. If not set, the - /// KnowledgeBases enabled in the agent (through UI) will be used. - /// Format: `projects//knowledgeBases/`. - #[serde(rename="knowledgeBaseNames")] - pub knowledge_base_names: Option>, - /// Optional. Configures the type of sentiment analysis to perform. If not - /// provided, sentiment analysis is not performed. - /// Note: Sentiment Analysis is only currently available for Enterprise Edition - /// agents. - #[serde(rename="sentimentAnalysisRequestConfig")] - pub sentiment_analysis_request_config: Option, - /// Optional. Specifies whether to delete all contexts in the current session - /// before the new ones are activated. - #[serde(rename="resetContexts")] - pub reset_contexts: Option, - /// Optional. The time zone of this conversational query from the - /// [time zone database](https://www.iana.org/time-zones), e.g., - /// America/New_York, Europe/Paris. If not provided, the time zone specified in - /// agent settings is used. - #[serde(rename="timeZone")] - pub time_zone: Option, - /// Optional. This field can be used to pass custom data into the webhook - /// associated with the agent. Arbitrary JSON objects are supported. - pub payload: Option>, - /// Optional. Additional session entity types to replace or extend developer - /// entity types with. The entity synonyms apply to all languages and persist - /// for the session of this query. - #[serde(rename="sessionEntityTypes")] - pub session_entity_types: Option>, +pub struct GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction { + /// Required. URL + pub url: Option, + /// Optional. Specifies the type of viewer that is used when opening + /// the URL. Defaults to opening via web browser. + #[serde(rename="urlTypeHint")] + pub url_type_hint: Option, } -impl Part for GoogleCloudDialogflowV2beta1QueryParameters {} +impl Part for GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction {} + + +/// Represents a fulfillment. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations agent get fulfillment projects](struct.ProjectLocationAgentGetFulfillmentCall.html) (response) +/// * [locations agent fulfillment projects](struct.ProjectLocationAgentFulfillmentCall.html) (request|response) +/// * [agent get fulfillment projects](struct.ProjectAgentGetFulfillmentCall.html) (response) +/// * [agent update fulfillment projects](struct.ProjectAgentUpdateFulfillmentCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1Fulfillment { + /// Optional. The human-readable name of the fulfillment, unique within the agent. + #[serde(rename="displayName")] + pub display_name: Option, + /// Optional. Whether fulfillment is enabled. + pub enabled: Option, + /// Optional. The field defines whether the fulfillment is enabled for certain features. + pub features: Option>, + /// Configuration for a generic web service. + #[serde(rename="genericWebService")] + pub generic_web_service: Option, + /// Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub name: Option, +} + +impl RequestValue for GoogleCloudDialogflowV2beta1Fulfillment {} +impl ResponseResult for GoogleCloudDialogflowV2beta1Fulfillment {} /// The request message for Agents.TrainAgent. @@ -714,6 +814,7 @@ impl Part for GoogleCloudDialogflowV2beta1QueryParameters {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent train projects](struct.ProjectLocationAgentTrainCall.html) (request) /// * [agent train projects](struct.ProjectAgentTrainCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -722,6 +823,37 @@ pub struct GoogleCloudDialogflowV2beta1TrainAgentRequest { _never_set: Option, + /// The severity of the error. + pub severity: Option, + /// The names of the entries that the error is associated with. + /// Format: + /// + /// - "projects//agent", if the error is associated with the entire + /// agent. + /// - "projects//agent/intents/", if the error is + /// associated with certain intents. + /// - "projects//agent/intents//trainingPhrases/", if the + /// error is associated with certain intent training phrases. + /// - "projects//agent/intents//parameters/", if the error is associated with certain intent parameters. + /// - "projects//agent/entities/", if the error is + /// associated with certain entities. + pub entries: Option>, +} + +impl Part for GoogleCloudDialogflowV2beta1ValidationError {} + + /// Standalone Rich Business Messaging (RBM) rich card. /// /// Rich cards allow you to respond to users with more vivid content, e.g. @@ -760,9 +892,12 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent intents patch projects](struct.ProjectLocationAgentIntentPatchCall.html) (request|response) +/// * [agent intents patch projects](struct.ProjectAgentIntentPatchCall.html) (request|response) +/// * [locations agent intents create projects](struct.ProjectLocationAgentIntentCreateCall.html) (request|response) /// * [agent intents get projects](struct.ProjectAgentIntentGetCall.html) (response) /// * [agent intents create projects](struct.ProjectAgentIntentCreateCall.html) (request|response) -/// * [agent intents patch projects](struct.ProjectAgentIntentPatchCall.html) (request|response) +/// * [locations agent intents get projects](struct.ProjectLocationAgentIntentGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1Intent { @@ -822,8 +957,9 @@ pub struct GoogleCloudDialogflowV2beta1Intent { pub parameters: Option>, /// Read-only after creation. The unique identifier of the parent intent in the /// chain of followup intents. You can set this field when creating an intent, - /// for example with CreateIntent or BatchUpdateIntents, in order to - /// make this intent a followup intent. + /// for example with CreateIntent or + /// BatchUpdateIntents, in order to make this + /// intent a followup intent. /// /// It identifies the parent followup intent. /// Format: `projects//agent/intents/`. @@ -840,11 +976,14 @@ pub struct GoogleCloudDialogflowV2beta1Intent { /// Optional. The collection of rich messages corresponding to the /// `Response` field in the Dialogflow console. pub messages: Option>, - /// Optional. The priority of this intent. Higher numbers represent higher - /// priorities. If this is zero or unspecified, we use the default - /// priority 500000. + /// The priority of this intent. Higher numbers represent higher + /// priorities. /// - /// Negative numbers mean that the intent is disabled. + /// - If the supplied value is unspecified or 0, the service + /// translates the value to 500,000, which corresponds to the + /// `Normal` priority in the console. + /// - If the supplied value is negative, the intent is ignored + /// in runtime detect intent requests. pub priority: Option, /// Read-only. The unique identifier of the root intent in the chain of /// followup intents. It identifies the correct followup intents chain for @@ -865,6 +1004,7 @@ pub struct GoogleCloudDialogflowV2beta1Intent { /// Optional. The collection of event names that trigger the intent. /// If the collection of input contexts is not empty, all of the contexts must /// be present in the active user session for an event to trigger this intent. + /// Event names are limited to 150 characters. pub events: Option>, } @@ -880,17 +1020,17 @@ impl ResponseResult for GoogleCloudDialogflowV2beta1Intent {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent entity types entities batch create projects](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html) (request) +/// * [locations agent entity types entities batch create projects](struct.ProjectLocationAgentEntityTypeEntityBatchCreateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest { /// Required. The entities to create. pub entities: Option>, - /// Optional. The language of entity synonyms defined in `entities`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, } @@ -898,45 +1038,24 @@ pub struct GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest { impl RequestValue for GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest {} -/// Represents an example that the agent is trained on. +/// Represents the natural language text to be processed. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1IntentTrainingPhrase { - /// Required. The ordered list of training phrase parts. - /// The parts are concatenated in order to form the training phrase. - /// - /// Note: The API does not automatically annotate training phrases like the - /// Dialogflow Console does. - /// - /// Note: Do not forget to include whitespace at part boundaries, - /// so the training phrase is well formatted when the parts are concatenated. - /// - /// If the training phrase does not need to be annotated with parameters, - /// you just need a single part with only the Part.text field set. - /// - /// If you want to annotate the training phrase, you must create multiple - /// parts, where the fields of each part are populated in one of two ways: - /// - /// * `Part.text` is set to a part of the phrase that has no parameters. - /// * `Part.text` is set to a part of the phrase that you want to annotate, - /// and the `entity_type`, `alias`, and `user_defined` fields are all - /// set. - pub parts: Option>, - /// Required. The type of the training phrase. - #[serde(rename="type")] - pub type_: Option, - /// Output only. The unique identifier of this training phrase. - pub name: Option, - /// Optional. Indicates how many times this example was added to - /// the intent. Each time a developer adds an existing sample by editing an - /// intent or training, this counter is increased. - #[serde(rename="timesAddedCount")] - pub times_added_count: Option, +pub struct GoogleCloudDialogflowV2beta1TextInput { + /// Required. The language of this conversational query. See [Language + /// Support](https://cloud.google.com/dialogflow/docs/reference/language) + /// for a list of the currently supported language codes. Note that queries in + /// the same session do not necessarily need to specify the same language. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Required. The UTF-8 encoded natural language text to be processed. + /// Text length must not exceed 256 characters. + pub text: Option, } -impl Part for GoogleCloudDialogflowV2beta1IntentTrainingPhrase {} +impl Part for GoogleCloudDialogflowV2beta1TextInput {} /// An object representing a latitude/longitude pair. This is expressed as a pair @@ -976,6 +1095,29 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggest impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial {} +/// Response media object for media content card. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject { + /// Required. Url where the media is stored. + #[serde(rename="contentUrl")] + pub content_url: Option, + /// Optional. Icon to display above media content. + pub icon: Option, + /// Optional. Description of media card. + pub description: Option, + /// Optional. Image to display above media content. + #[serde(rename="largeImage")] + pub large_image: Option, + /// Required. Name of media card. + pub name: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject {} + + /// This message is a wrapper around a collection of entity types. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -998,20 +1140,30 @@ impl Part for GoogleCloudDialogflowV2beta1EntityTypeBatch {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent environments users sessions detect intent projects](struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html) (request) +/// * [locations agent sessions detect intent projects](struct.ProjectLocationAgentSessionDetectIntentCall.html) (request) +/// * [locations agent environments users sessions detect intent projects](struct.ProjectLocationAgentEnvironmentUserSessionDetectIntentCall.html) (request) /// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1DetectIntentRequest { - /// Optional. The natural language speech audio to be processed. This field + /// The natural language speech audio to be processed. This field /// should be populated iff `query_input` is set to an input audio config. /// A single request can contain up to 1 minute of speech audio data. #[serde(rename="inputAudio")] pub input_audio: Option, - /// Optional. Instructs the speech synthesizer how to generate the output + /// Instructs the speech synthesizer how to generate the output /// audio. If this field is not set and agent-level speech synthesizer is not /// configured, no output audio is generated. #[serde(rename="outputAudioConfig")] pub output_audio_config: Option, + /// Mask for output_audio_config indicating which settings in this + /// request-level config should override speech synthesizer settings defined at + /// agent-level. + /// + /// If unspecified or empty, output_audio_config replaces the agent-level + /// config in its entirety. + #[serde(rename="outputAudioConfigMask")] + pub output_audio_config_mask: Option, /// Required. The input specification. It can be set to: /// /// 1. an audio config @@ -1022,7 +1174,7 @@ pub struct GoogleCloudDialogflowV2beta1DetectIntentRequest { /// 1. an event that specifies which intent to trigger. #[serde(rename="queryInput")] pub query_input: Option, - /// Optional. The parameters of this query. + /// The parameters of this query. #[serde(rename="queryParams")] pub query_params: Option, } @@ -1030,6 +1182,63 @@ pub struct GoogleCloudDialogflowV2beta1DetectIntentRequest { impl RequestValue for GoogleCloudDialogflowV2beta1DetectIntentRequest {} +/// Rich Business Messaging (RBM) suggestion. Suggestions allow user to +/// easily select/click a predefined response or perform an action (like +/// opening a web uri). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion { + /// Predefined client side actions that user can choose + pub action: Option, + /// Predefined replies for user to select instead of typing + pub reply: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion {} + + +/// Column properties for TableCard. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageColumnProperties { + /// Required. Column heading. + pub header: Option, + /// Optional. Defines text alignment for all cells in this column. + #[serde(rename="horizontalAlignment")] + pub horizontal_alignment: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageColumnProperties {} + + +/// Browsing carousel tile +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem { + /// Optional. Hero image for the carousel item. + pub image: Option, + /// Optional. Text that appears at the bottom of the Browse Carousel + /// Card. Maximum of one line of text. + pub footer: Option, + /// Optional. Description of the carousel item. Maximum of four lines of + /// text. + pub description: Option, + /// Required. Action to present to the user. + #[serde(rename="openUriAction")] + pub open_uri_action: Option, + /// Required. Title of the carousel item. Maximum of two lines of text. + pub title: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem {} + + /// The card response message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1050,6 +1259,20 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageCard { impl Part for GoogleCloudDialogflowV2beta1IntentMessageCard {} +/// Whether fulfillment is enabled for the specific feature. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1FulfillmentFeature { + /// The type of the feature that enabled for fulfillment. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1FulfillmentFeature {} + + /// The card for presenting a carousel of options to select from. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1081,6 +1304,24 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { impl Part for GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo {} +/// Contains basic configuration for a sub-agent. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1SubAgent { + /// Optional. The unique identifier (`environment name` in dialogflow console) + /// of this sub-agent environment. Assumes draft environment if `environment` + /// is not set. + pub environment: Option, + /// Required. The project of this agent. + /// Format: `projects/`. + pub project: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1SubAgent {} + + /// The request message for Agents.ExportAgent. /// /// # Activities @@ -1088,6 +1329,7 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent export projects](struct.ProjectLocationAgentExportCall.html) (request) /// * [agent export projects](struct.ProjectAgentExportCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1104,6 +1346,30 @@ pub struct GoogleCloudDialogflowV2beta1ExportAgentRequest { impl RequestValue for GoogleCloudDialogflowV2beta1ExportAgentRequest {} +/// Table card for Actions on Google. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageTableCard { + /// Optional. List of buttons for the card. + pub buttons: Option>, + /// Optional. Rows in this table of data. + pub rows: Option>, + /// Optional. Subtitle to the title. + pub subtitle: Option, + /// Required. Title of the card. + pub title: Option, + /// Optional. Image which should be displayed on the card. + pub image: Option, + /// Optional. Display properties for the columns in this table. + #[serde(rename="columnProperties")] + pub column_properties: Option>, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageTableCard {} + + /// The response message for EntityTypes.ListEntityTypes. /// /// # Activities @@ -1111,6 +1377,7 @@ impl RequestValue for GoogleCloudDialogflowV2beta1ExportAgentRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent entity types list projects](struct.ProjectLocationAgentEntityTypeListCall.html) (response) /// * [agent entity types list projects](struct.ProjectAgentEntityTypeListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1135,6 +1402,7 @@ impl ResponseResult for GoogleCloudDialogflowV2beta1ListEntityTypesResponse {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent entity types batch delete projects](struct.ProjectLocationAgentEntityTypeBatchDeleteCall.html) (request) /// * [agent entity types batch delete projects](struct.ProjectAgentEntityTypeBatchDeleteCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1148,6 +1416,23 @@ pub struct GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest { impl RequestValue for GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest {} +/// The media content card for Actions on Google. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageMediaContent { + /// Required. List of media objects. + #[serde(rename="mediaObjects")] + pub media_objects: Option>, + /// Optional. What type of media is the content (ie "audio"). + #[serde(rename="mediaType")] + pub media_type: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageMediaContent {} + + /// Opens the user's default web browser app to the specified uri /// (https://goo.gl/6GLJD2). If the user has an app installed that is /// registered as the default handler for the URL, then this app will be @@ -1209,6 +1494,7 @@ impl Part for GoogleCloudDialogflowV2beta1QueryInput {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent import projects](struct.ProjectAgentImportCall.html) (request) +/// * [locations agent import projects](struct.ProjectLocationAgentImportCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1ImportAgentRequest { @@ -1216,21 +1502,7 @@ pub struct GoogleCloudDialogflowV2beta1ImportAgentRequest { /// Note: The URI must start with "gs://". #[serde(rename="agentUri")] pub agent_uri: Option, - /// The agent to import. - /// - /// Example for how to import an agent via the command line: - /// - ///
          curl \
          -    ///   'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:import\
          -    ///    -X POST \
          -    ///    -H 'Authorization: Bearer '$(gcloud auth application-default
          -    ///    print-access-token) \
          -    ///    -H 'Accept: application/json' \
          -    ///    -H 'Content-Type: application/json' \
          -    ///    --compressed \
          -    ///    --data-binary "{
          -    ///       'agentContent': '$(cat <agent zip file> | base64 -w 0)'
          -    ///    }"
          + /// Zip compressed raw byte content for agent. #[serde(rename="agentContent")] pub agent_content: Option, } @@ -1238,6 +1510,22 @@ pub struct GoogleCloudDialogflowV2beta1ImportAgentRequest { impl RequestValue for GoogleCloudDialogflowV2beta1ImportAgentRequest {} +/// Row of TableCard. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageTableCardRow { + /// Optional. List of cells that make up this row. + pub cells: Option>, + /// Optional. Whether to add a visual divider after this row. + #[serde(rename="dividerAfter")] + pub divider_after: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageTableCardRow {} + + /// Rich Business Messaging (RBM) text response with suggestions. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1254,33 +1542,6 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmText { impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmText {} -/// Rich Business Messaging (RBM) suggested client-side action that the user -/// can choose from the card. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction { - /// Text to display alongside the action. - pub text: Option, - /// Suggested client side action: Dial a phone number - pub dial: Option, - /// Opaque payload that the Dialogflow receives in a user event - /// when the user taps the suggested action. This data will be also - /// forwarded to webhook to allow performing custom business logic. - #[serde(rename="postbackData")] - pub postback_data: Option, - /// Suggested client side action: Open a URI on device - #[serde(rename="openUrl")] - pub open_url: Option, - /// Suggested client side action: Share user location - #[serde(rename="shareLocation")] - pub share_location: Option, -} - -impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction {} - - /// Represents the result of querying a Knowledge base. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1294,44 +1555,56 @@ pub struct GoogleCloudDialogflowV2beta1KnowledgeAnswers { impl Part for GoogleCloudDialogflowV2beta1KnowledgeAnswers {} -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. A typical example is to use it as the request -/// or the response type of an API method. For instance: +/// Rich Business Messaging (RBM) Media displayed in Cards +/// The following media-types are currently supported: /// -/// ````text -/// service Foo { -/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -/// } -/// ```` +/// Image Types /// -/// The JSON representation for `Empty` is empty JSON object `{}`. +/// * image/jpeg +/// * image/jpg' +/// * image/gif +/// * image/png /// -/// # Activities +/// Video Types /// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// * video/h263 +/// * video/m4v +/// * video/mp4 +/// * video/mpeg +/// * video/mpeg4 +/// * video/webm +/// +/// This type is not used in any activity, and only used as *part* of another schema. /// -/// * [agent environments users sessions contexts delete projects](struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html) (response) -/// * [agent environments users sessions entity types delete projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html) (response) -/// * [agent sessions delete contexts projects](struct.ProjectAgentSessionDeleteContextCall.html) (response) -/// * [agent knowledge bases delete projects](struct.ProjectAgentKnowledgeBaseDeleteCall.html) (response) -/// * [agent entity types delete projects](struct.ProjectAgentEntityTypeDeleteCall.html) (response) -/// * [delete agent projects](struct.ProjectDeleteAgentCall.html) (response) -/// * [agent sessions contexts delete projects](struct.ProjectAgentSessionContextDeleteCall.html) (response) -/// * [knowledge bases delete projects](struct.ProjectKnowledgeBaseDeleteCall.html) (response) -/// * [agent sessions entity types delete projects](struct.ProjectAgentSessionEntityTypeDeleteCall.html) (response) -/// * [agent environments users sessions delete contexts projects](struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html) (response) -/// * [agent intents delete projects](struct.ProjectAgentIntentDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleProtobufEmpty { _never_set: Option } +pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia { + /// Required. Publicly reachable URI of the file. The RBM platform + /// determines the MIME type of the file from the content-type field in + /// the HTTP headers when the platform fetches the file. The content-type + /// field must be present and accurate in the HTTP response from the URL. + #[serde(rename="fileUri")] + pub file_uri: Option, + /// Optional. Publicly reachable URI of the thumbnail.If you don't + /// provide a thumbnail URI, the RBM platform displays a blank + /// placeholder thumbnail until the user's device downloads the file. + /// Depending on the user's setting, the file may not download + /// automatically and may require the user to tap a download button. + #[serde(rename="thumbnailUri")] + pub thumbnail_uri: Option, + /// Required for cards with vertical orientation. The height of the media + /// within a rich card with a vertical layout. (https://goo.gl/NeFCjz). + /// For a standalone card with horizontal layout, height is not + /// customizable, and this field is ignored. + pub height: Option, +} -impl ResponseResult for GoogleProtobufEmpty {} +impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia {} /// Represents a session entity type. /// -/// Extends or replaces a developer entity type at the user session level (we -/// refer to the entity types defined at the agent level as "developer entity +/// Extends or replaces a custom entity type at the user session level (we +/// refer to the entity types defined at the agent level as "custom entity /// types"). /// /// Note: session entity types apply to all queries, regardless of the language. @@ -1341,12 +1614,18 @@ impl ResponseResult for GoogleProtobufEmpty {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent environments users sessions entity types get projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html) (response) +/// * [locations agent environments users sessions entity types patch projects](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall.html) (request|response) /// * [agent environments users sessions entity types create projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeCreateCall.html) (request|response) -/// * [agent environments users sessions entity types patch projects](struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html) (request|response) -/// * [agent sessions entity types patch projects](struct.ProjectAgentSessionEntityTypePatchCall.html) (request|response) -/// * [agent sessions entity types create projects](struct.ProjectAgentSessionEntityTypeCreateCall.html) (request|response) +/// * [locations agent environments users sessions entity types create projects](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall.html) (request|response) /// * [agent sessions entity types get projects](struct.ProjectAgentSessionEntityTypeGetCall.html) (response) +/// * [agent environments users sessions entity types get projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeGetCall.html) (response) +/// * [agent environments users sessions entity types patch projects](struct.ProjectAgentEnvironmentUserSessionEntityTypePatchCall.html) (request|response) +/// * [locations agent environments users sessions entity types get projects](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall.html) (response) +/// * [agent sessions entity types patch projects](struct.ProjectAgentSessionEntityTypePatchCall.html) (request|response) +/// * [locations agent sessions entity types patch projects](struct.ProjectLocationAgentSessionEntityTypePatchCall.html) (request|response) +/// * [agent sessions entity types create projects](struct.ProjectAgentSessionEntityTypeCreateCall.html) (request|response) +/// * [locations agent sessions entity types get projects](struct.ProjectLocationAgentSessionEntityTypeGetCall.html) (response) +/// * [locations agent sessions entity types create projects](struct.ProjectLocationAgentSessionEntityTypeCreateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1SessionEntityType { @@ -1365,7 +1644,7 @@ pub struct GoogleCloudDialogflowV2beta1SessionEntityType { /// type in the same agent that will be overridden or supplemented. pub name: Option, /// Required. Indicates whether the additional data should override or - /// supplement the developer entity type definition. + /// supplement the custom entity type definition. #[serde(rename="entityOverrideMode")] pub entity_override_mode: Option, } @@ -1374,25 +1653,6 @@ impl RequestValue for GoogleCloudDialogflowV2beta1SessionEntityType {} impl ResponseResult for GoogleCloudDialogflowV2beta1SessionEntityType {} -/// An item in the carousel. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { - /// Required. Additional info about the option item. - pub info: Option, - /// Optional. The image to display. - pub image: Option, - /// Optional. The body text of the card. - pub description: Option, - /// Required. Title of the carousel item. - pub title: Option, -} - -impl Part for GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem {} - - /// Description of which voice to use for speech synthesis. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1407,7 +1667,8 @@ pub struct GoogleCloudDialogflowV2beta1VoiceSelectionParams { #[serde(rename="ssmlGender")] pub ssml_gender: Option, /// Optional. The name of the voice. If not set, the service will choose a - /// voice based on the other parameters such as language_code and gender. + /// voice based on the other parameters such as language_code and + /// ssml_gender. pub name: Option, } @@ -1422,18 +1683,18 @@ impl Part for GoogleCloudDialogflowV2beta1VoiceSelectionParams {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (request) +/// * [locations agent entity types entities batch delete projects](struct.ProjectLocationAgentEntityTypeEntityBatchDeleteCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest { - /// Optional. The language of entity synonyms defined in `entities`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, - /// Required. The canonical `values` of the entities to delete. Note that + /// Required. The reference `values` of the entities to delete. Note that /// these are not fully-qualified names, i.e. they don't start with /// `projects/`. #[serde(rename="entityValues")] @@ -1480,31 +1741,46 @@ pub struct GoogleCloudDialogflowV2beta1EventInput { pub language_code: Option, /// Required. The unique identifier of the event. pub name: Option, - /// Optional. The collection of parameters associated with the event. + /// The collection of parameters associated with the event. pub parameters: Option>, } impl Part for GoogleCloudDialogflowV2beta1EventInput {} -/// Represents the natural language text to be processed. +/// Browse Carousel Card for Actions on Google. +/// https://developers.google.com/actions/assistant/responses#browsing_carousel /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1TextInput { - /// Required. The language of this conversational query. See [Language - /// Support](https://cloud.google.com/dialogflow/docs/reference/language) - /// for a list of the currently supported language codes. Note that queries in - /// the same session do not necessarily need to specify the same language. - #[serde(rename="languageCode")] - pub language_code: Option, - /// Required. The UTF-8 encoded natural language text to be processed. - /// Text length must not exceed 256 characters. - pub text: Option, +pub struct GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard { + /// Required. List of items in the Browse Carousel Card. Minimum of two + /// items, maximum of ten. + pub items: Option>, + /// Optional. Settings for displaying the image. Applies to every image in + /// items. + #[serde(rename="imageDisplayOptions")] + pub image_display_options: Option, } -impl Part for GoogleCloudDialogflowV2beta1TextInput {} +impl Part for GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard {} + + +/// Google Cloud Storage location for single input. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1GcsSource { + /// Required. The Google Cloud Storage URIs for the inputs. A URI is of the + /// form: + /// gs://bucket/object-prefix-or-name + /// Whether a prefix or name is used depends on the use case. + pub uri: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1GcsSource {} /// The result of sentiment analysis as configured by @@ -1548,15 +1824,15 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageImage {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (request) +/// * [locations agent entity types batch update projects](struct.ProjectLocationAgentEntityTypeBatchUpdateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest { - /// Optional. The language of entity synonyms defined in `entity_types`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, /// The URI to a Google Cloud Storage file containing entity types to update @@ -1635,6 +1911,11 @@ impl Part for GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1KnowledgeBase { + /// Language which represents the KnowledgeBase. When the KnowledgeBase is + /// created/updated, this is populated for all non en-us languages. If not + /// populated, the default language en-us applies. + #[serde(rename="languageCode")] + pub language_code: Option, /// Required. The display name of the knowledge base. The name must be 1024 /// bytes or less; otherwise, the creation request fails. #[serde(rename="displayName")] @@ -1649,21 +1930,23 @@ impl RequestValue for GoogleCloudDialogflowV2beta1KnowledgeBase {} impl ResponseResult for GoogleCloudDialogflowV2beta1KnowledgeBase {} -/// Rich Business Messaging (RBM) suggestion. Suggestions allow user to -/// easily select/click a predefined response or perform an action (like -/// opening a web uri). +/// Represents the output of agent validation. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [agent get validation result projects](struct.ProjectAgentGetValidationResultCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion { - /// Predefined client side actions that user can choose - pub action: Option, - /// Predefined replies for user to select instead of typing - pub reply: Option, +pub struct GoogleCloudDialogflowV2beta1ValidationResult { + /// Contains all validation errors. + #[serde(rename="validationErrors")] + pub validation_errors: Option>, } -impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion {} +impl ResponseResult for GoogleCloudDialogflowV2beta1ValidationResult {} /// Response message for Documents.ListDocuments. @@ -1721,7 +2004,7 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageSuggestions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig { - /// Optional. Instructs the service to perform sentiment analysis on + /// Instructs the service to perform sentiment analysis on /// `query_text`. If not provided, sentiment analysis is not performed on /// `query_text`. #[serde(rename="analyzeQueryTextSentiment")] @@ -1738,8 +2021,10 @@ impl Part for GoogleCloudDialogflowV2beta1SentimentAnalysisRequestConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent projects](struct.ProjectAgentCall.html) (request|response) +/// * [locations get agent projects](struct.ProjectLocationGetAgentCall.html) (response) +/// * [locations set agent projects](struct.ProjectLocationSetAgentCall.html) (request|response) /// * [get agent projects](struct.ProjectGetAgentCall.html) (response) +/// * [set agent projects](struct.ProjectSetAgentCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1Agent { @@ -1813,9 +2098,12 @@ impl ResponseResult for GoogleCloudDialogflowV2beta1Agent {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [agent entity types get projects](struct.ProjectAgentEntityTypeGetCall.html) (response) +/// * [locations agent entity types create projects](struct.ProjectLocationAgentEntityTypeCreateCall.html) (request|response) /// * [agent entity types patch projects](struct.ProjectAgentEntityTypePatchCall.html) (request|response) +/// * [locations agent entity types patch projects](struct.ProjectLocationAgentEntityTypePatchCall.html) (request|response) +/// * [agent entity types get projects](struct.ProjectAgentEntityTypeGetCall.html) (response) /// * [agent entity types create projects](struct.ProjectAgentEntityTypeCreateCall.html) (request|response) +/// * [locations agent entity types get projects](struct.ProjectLocationAgentEntityTypeGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1EntityType { @@ -1830,6 +2118,9 @@ pub struct GoogleCloudDialogflowV2beta1EntityType { /// Required. The name of the entity type. #[serde(rename="displayName")] pub display_name: Option, + /// Optional. Enables fuzzy entity extraction during classification. + #[serde(rename="enableFuzzyExtraction")] + pub enable_fuzzy_extraction: Option, /// The unique identifier of the entity type. /// Required for EntityTypes.UpdateEntityType and /// EntityTypes.BatchUpdateEntityTypes methods. @@ -1869,6 +2160,19 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggest impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation {} +/// Cell of TableCardRow. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageTableCardCell { + /// Required. Text in this cell. + pub text: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageTableCardCell {} + + /// Request message for Documents.ReloadDocument. /// /// # Activities @@ -1880,7 +2184,12 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSugg /// * [agent knowledge bases documents reload projects](struct.ProjectAgentKnowledgeBaseDocumentReloadCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1ReloadDocumentRequest { _never_set: Option } +pub struct GoogleCloudDialogflowV2beta1ReloadDocumentRequest { + /// Optional. The path for a Cloud Storage source file for reloading document content. + /// If not provided, the Document's existing source will be reloaded. + #[serde(rename="gcsSource")] + pub gcs_source: Option, +} impl RequestValue for GoogleCloudDialogflowV2beta1ReloadDocumentRequest {} @@ -1915,6 +2224,8 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageBasicCard {} pub struct GoogleCloudDialogflowV2beta1IntentMessageListSelect { /// Required. List items. pub items: Option>, + /// Optional. Subtitle of the list. + pub subtitle: Option, /// Optional. The overall title of the list. pub title: Option, } @@ -1929,16 +2240,16 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageListSelect {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent intents batch update projects](struct.ProjectLocationAgentIntentBatchUpdateCall.html) (request) /// * [agent intents batch update projects](struct.ProjectAgentIntentBatchUpdateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest { - /// Optional. The language of training phrases, parameters and rich messages - /// defined in `intents`. If not specified, the agent's default language is - /// used. [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, /// The URI to a Google Cloud Storage file containing intents to update or @@ -1968,6 +2279,7 @@ impl RequestValue for GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent entity types entities batch update projects](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html) (request) +/// * [locations agent entity types entities batch update projects](struct.ProjectLocationAgentEntityTypeEntityBatchUpdateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest { @@ -1976,12 +2288,11 @@ pub struct GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest { /// Optional. The mask to control which fields get updated. #[serde(rename="updateMask")] pub update_mask: Option, - /// Optional. The language of entity synonyms defined in `entities`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). #[serde(rename="languageCode")] pub language_code: Option, } @@ -1989,42 +2300,31 @@ pub struct GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest { impl RequestValue for GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest {} -/// Configuration of how speech should be synthesized. +/// Rich Business Messaging (RBM) suggested client-side action that the user +/// can choose from the card. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig { - /// Optional. An identifier which selects 'audio effects' profiles that are - /// applied on (post synthesized) text to speech. Effects are applied on top of - /// each other in the order they are given. - #[serde(rename="effectsProfileId")] - pub effects_profile_id: Option>, - /// Optional. The desired voice of the synthesized audio. - pub voice: Option, - /// Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal - /// native speed supported by the specific voice. 2.0 is twice as fast, and - /// 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any - /// other values < 0.25 or > 4.0 will return an error. - #[serde(rename="speakingRate")] - pub speaking_rate: Option, - /// Optional. Volume gain (in dB) of the normal native volume supported by the - /// specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - /// 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - /// will play at approximately half the amplitude of the normal native signal - /// amplitude. A value of +6.0 (dB) will play at approximately twice the - /// amplitude of the normal native signal amplitude. We strongly recommend not - /// to exceed +10 (dB) as there's usually no effective increase in loudness for - /// any value greater than that. - #[serde(rename="volumeGainDb")] - pub volume_gain_db: Option, - /// Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - /// semitones from the original pitch. -20 means decrease 20 semitones from the - /// original pitch. - pub pitch: Option, +pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction { + /// Text to display alongside the action. + pub text: Option, + /// Suggested client side action: Dial a phone number + pub dial: Option, + /// Opaque payload that the Dialogflow receives in a user event + /// when the user taps the suggested action. This data will be also + /// forwarded to webhook to allow performing custom business logic. + #[serde(rename="postbackData")] + pub postback_data: Option, + /// Suggested client side action: Open a URI on device + #[serde(rename="openUrl")] + pub open_url: Option, + /// Suggested client side action: Share user location + #[serde(rename="shareLocation")] + pub share_location: Option, } -impl Part for GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig {} +impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction {} /// The response message for Agents.SearchAgents. @@ -2101,6 +2401,71 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageCardButton { impl Part for GoogleCloudDialogflowV2beta1IntentMessageCardButton {} +/// Represents the parameters of the conversational query. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1QueryParameters { + /// The geo location of this conversational query. + #[serde(rename="geoLocation")] + pub geo_location: Option, + /// The collection of contexts to be activated before this query is + /// executed. + pub contexts: Option>, + /// This field can be used to pass HTTP headers for a webhook + /// call. These headers will be sent to webhook alone with the headers that + /// have been configured through Dialogflow web console. The headers defined + /// within this field will overwrite the headers configured through Dialogflow + /// console if there is a conflict. Header names are case-insensitive. + /// Google's specified headers are not allowed. Including: "Host", + /// "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding", + /// "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc. + #[serde(rename="webhookHeaders")] + pub webhook_headers: Option>, + /// KnowledgeBases to get alternative results from. If not set, the + /// KnowledgeBases enabled in the agent (through UI) will be used. + /// Format: `projects//knowledgeBases/`. + #[serde(rename="knowledgeBaseNames")] + pub knowledge_base_names: Option>, + /// This field can be used to pass custom data to your webhook. + /// Arbitrary JSON objects are supported. + /// If supplied, the value is used to populate the + /// `WebhookRequest.original_detect_intent_request.payload` + /// field sent to your webhook. + pub payload: Option>, + /// Configures the type of sentiment analysis to perform. If not + /// provided, sentiment analysis is not performed. + /// Note: Sentiment Analysis is only currently available for Enterprise Edition + /// agents. + #[serde(rename="sentimentAnalysisRequestConfig")] + pub sentiment_analysis_request_config: Option, + /// Specifies whether to delete all contexts in the current session + /// before the new ones are activated. + #[serde(rename="resetContexts")] + pub reset_contexts: Option, + /// The time zone of this conversational query from the + /// [time zone database](https://www.iana.org/time-zones), e.g., + /// America/New_York, Europe/Paris. If not provided, the time zone specified in + /// agent settings is used. + #[serde(rename="timeZone")] + pub time_zone: Option, + /// For mega agent query, directly specify which sub agents to query. + /// If any specified sub agent is not linked to the mega agent, an error will + /// be returned. If empty, Dialogflow will decide which sub agents to query. + /// If specified for a non-mega-agent query, will be silently ignored. + #[serde(rename="subAgents")] + pub sub_agents: Option>, + /// Additional session entity types to replace or extend developer + /// entity types with. The entity synonyms apply to all languages and persist + /// for the session of this query. + #[serde(rename="sessionEntityTypes")] + pub session_entity_types: Option>, +} + +impl Part for GoogleCloudDialogflowV2beta1QueryParameters {} + + /// The response message for Intents.ListIntents. /// /// # Activities @@ -2108,6 +2473,7 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageCardButton {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent intents list projects](struct.ProjectLocationAgentIntentListCall.html) (response) /// * [agent intents list projects](struct.ProjectAgentIntentListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2217,6 +2583,8 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent environments users sessions entity types list projects](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall.html) (response) +/// * [locations agent sessions entity types list projects](struct.ProjectLocationAgentSessionEntityTypeListCall.html) (response) /// * [agent environments users sessions entity types list projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeListCall.html) (response) /// * [agent sessions entity types list projects](struct.ProjectAgentSessionEntityTypeListCall.html) (response) /// @@ -2265,15 +2633,19 @@ pub struct GoogleCloudDialogflowV2beta1InputAudioConfig { /// Required. Audio encoding of the audio content to process. #[serde(rename="audioEncoding")] pub audio_encoding: Option, - /// Optional. A list of strings containing words and phrases that the speech + /// A list of strings containing words and phrases that the speech /// recognizer should recognize with higher likelihood. /// /// See [the Cloud Speech /// documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) /// for more details. + /// + /// This field is deprecated. Please use [speech_contexts]() instead. If you + /// specify both [phrase_hints]() and [speech_contexts](), Dialogflow will + /// treat the [phrase_hints]() as a single additional [SpeechContext](). #[serde(rename="phraseHints")] pub phrase_hints: Option>, - /// Optional. If `true`, Dialogflow returns SpeechWordInfo in + /// If `true`, Dialogflow returns SpeechWordInfo in /// StreamingRecognitionResult with information about the recognized speech /// words, e.g. start and end time offsets. If false or unspecified, Speech /// doesn't return any word-level information. @@ -2286,10 +2658,10 @@ pub struct GoogleCloudDialogflowV2beta1InputAudioConfig { /// more details. #[serde(rename="sampleRateHertz")] pub sample_rate_hertz: Option, - /// Optional. Which variant of the Speech model to use. + /// Which variant of the Speech model to use. #[serde(rename="modelVariant")] pub model_variant: Option, - /// Optional. Which Speech model to select for the given request. Select the + /// Which Speech model to select for the given request. Select the /// model best suited to your domain to get best results. If a model is not /// explicitly specified, then we auto-select a model based on the parameters /// in the InputAudioConfig. @@ -2301,7 +2673,14 @@ pub struct GoogleCloudDialogflowV2beta1InputAudioConfig { /// documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) /// for more details. pub model: Option, - /// Optional. If `false` (default), recognition does not cease until the + /// Context information to assist speech recognition. + /// + /// See [the Cloud Speech + /// documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + /// for more details. + #[serde(rename="speechContexts")] + pub speech_contexts: Option>, + /// If `false` (default), recognition does not cease until the /// client closes the stream. /// If `true`, the recognizer will detect a single spoken utterance in input /// audio. Recognition ceases when it detects the audio's voice has @@ -2344,6 +2723,7 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent intents batch delete projects](struct.ProjectAgentIntentBatchDeleteCall.html) (request) +/// * [locations agent intents batch delete projects](struct.ProjectLocationAgentIntentBatchDeleteCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest { @@ -2362,6 +2742,8 @@ impl RequestValue for GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent environments users sessions contexts list projects](struct.ProjectLocationAgentEnvironmentUserSessionContextListCall.html) (response) +/// * [locations agent sessions contexts list projects](struct.ProjectLocationAgentSessionContextListCall.html) (response) /// * [agent environments users sessions contexts list projects](struct.ProjectAgentEnvironmentUserSessionContextListCall.html) (response) /// * [agent sessions contexts list projects](struct.ProjectAgentSessionContextListCall.html) (response) /// @@ -2379,6 +2761,44 @@ pub struct GoogleCloudDialogflowV2beta1ListContextsResponse { impl ResponseResult for GoogleCloudDialogflowV2beta1ListContextsResponse {} +/// Configuration of how speech should be synthesized. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig { + /// Optional. An identifier which selects 'audio effects' profiles that are + /// applied on (post synthesized) text to speech. Effects are applied on top of + /// each other in the order they are given. + #[serde(rename="effectsProfileId")] + pub effects_profile_id: Option>, + /// Optional. The desired voice of the synthesized audio. + pub voice: Option, + /// Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + /// native speed supported by the specific voice. 2.0 is twice as fast, and + /// 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + /// other values < 0.25 or > 4.0 will return an error. + #[serde(rename="speakingRate")] + pub speaking_rate: Option, + /// Optional. Volume gain (in dB) of the normal native volume supported by the + /// specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + /// 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + /// will play at approximately half the amplitude of the normal native signal + /// amplitude. A value of +6.0 (dB) will play at approximately twice the + /// amplitude of the normal native signal amplitude. We strongly recommend not + /// to exceed +10 (dB) as there's usually no effective increase in loudness for + /// any value greater than that. + #[serde(rename="volumeGainDb")] + pub volume_gain_db: Option, + /// Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + /// semitones from the original pitch. -20 means decrease 20 semitones from the + /// original pitch. + pub pitch: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1SynthesizeSpeechConfig {} + + /// Rich Business Messaging (RBM) suggested reply that the user can click /// instead of typing in their own response. /// @@ -2425,6 +2845,25 @@ pub struct GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { impl Part for GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart {} +/// An item in the carousel. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { + /// Required. Additional info about the option item. + pub info: Option, + /// Optional. The image to display. + pub image: Option, + /// Optional. The body text of the card. + pub description: Option, + /// Required. Title of the carousel item. + pub title: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem {} + + /// Represents the result of conversational query or event processing. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2456,11 +2895,15 @@ pub struct GoogleCloudDialogflowV2beta1QueryResult { pub action: Option, /// The intent that matched the conversational query. Some, not /// all fields are filled in this message, including but not limited to: - /// `name`, `display_name` and `webhook_state`. + /// `name`, `display_name`, `end_interaction` and `is_fallback`. pub intent: Option, - /// The free-form diagnostic info. For example, this field could contain - /// webhook call latency. The string keys of the Struct's fields map can change - /// without notice. + /// Free-form diagnostic information for the associated detect intent request. + /// The fields of this data can change without notice, so you should not write + /// code that depends on its structure. + /// The data may contain: + /// + /// - webhook call latency + /// - webhook errors #[serde(rename="diagnosticInfo")] pub diagnostic_info: Option>, /// The collection of output contexts. If applicable, @@ -2496,6 +2939,10 @@ pub struct GoogleCloudDialogflowV2beta1QueryResult { pub speech_recognition_confidence: Option, /// The intent detection confidence. Values range from 0.0 /// (completely uncertain) to 1.0 (completely certain). + /// This value is for informational purpose only and is only used to + /// help match the best intent within the classification threshold. + /// This value may change for the same end-user expression at any time due to a + /// model retraining or change in implementation. /// If there are `multiple knowledge_answers` messages, this value is set to /// the greatest `knowledgeAnswers.match_confidence` value in the list. #[serde(rename="intentDetectionConfidence")] @@ -2528,6 +2975,8 @@ impl Part for GoogleCloudDialogflowV2beta1QueryResult {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent environments users sessions detect intent projects](struct.ProjectAgentEnvironmentUserSessionDetectIntentCall.html) (response) +/// * [locations agent sessions detect intent projects](struct.ProjectLocationAgentSessionDetectIntentCall.html) (response) +/// * [locations agent environments users sessions detect intent projects](struct.ProjectLocationAgentEnvironmentUserSessionDetectIntentCall.html) (response) /// * [agent sessions detect intent projects](struct.ProjectAgentSessionDetectIntentCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2595,6 +3044,35 @@ pub struct GoogleRpcStatus { impl Part for GoogleRpcStatus {} +/// Represents configuration for a generic web service. +/// Dialogflow supports two mechanisms for authentications: +/// - Basic authentication with username and password. +/// - Authentication with additional authentication headers. +/// More information could be found at: +/// https://cloud.google.com/dialogflow/docs/fulfillment-configure. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudDialogflowV2beta1FulfillmentGenericWebService { + /// Optional. Indicates if generic web service is created through Cloud Functions + /// integration. Defaults to false. + #[serde(rename="isCloudFunction")] + pub is_cloud_function: Option, + /// Optional. The HTTP request headers to send together with fulfillment requests. + #[serde(rename="requestHeaders")] + pub request_headers: Option>, + /// Optional. The user name for HTTP Basic authentication. + pub username: Option, + /// Optional. The password for HTTP Basic authentication. + pub password: Option, + /// Required. The fulfillment URI for receiving POST requests. + pub uri: Option, +} + +impl Part for GoogleCloudDialogflowV2beta1FulfillmentGenericWebService {} + + /// The button object that appears at the bottom of a card. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2611,6 +3089,28 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { impl Part for GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton {} +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [operations list projects](struct.ProjectOperationListCall.html) (response) +/// * [locations operations list projects](struct.ProjectLocationOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunningListOperationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, +} + +impl ResponseResult for GoogleLongrunningListOperationsResponse {} + + /// The text response message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2624,50 +3124,49 @@ pub struct GoogleCloudDialogflowV2beta1IntentMessageText { impl Part for GoogleCloudDialogflowV2beta1IntentMessageText {} -/// Rich Business Messaging (RBM) Media displayed in Cards -/// The following media-types are currently supported: +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: /// -/// ## Image Types +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` /// -/// image/jpeg -/// image/jpg' -/// image/gif -/// image/png +/// The JSON representation for `Empty` is empty JSON object `{}`. /// -/// ## Video Types +/// # Activities /// -/// video/h263 -/// video/m4v -/// video/mp4 -/// video/mpeg -/// video/mpeg4 -/// video/webm -/// -/// This type is not used in any activity, and only used as *part* of another schema. +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [agent environments users sessions contexts delete projects](struct.ProjectAgentEnvironmentUserSessionContextDeleteCall.html) (response) +/// * [agent environments users sessions entity types delete projects](struct.ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall.html) (response) +/// * [agent sessions delete contexts projects](struct.ProjectAgentSessionDeleteContextCall.html) (response) +/// * [agent knowledge bases delete projects](struct.ProjectAgentKnowledgeBaseDeleteCall.html) (response) +/// * [locations agent sessions contexts delete projects](struct.ProjectLocationAgentSessionContextDeleteCall.html) (response) +/// * [locations agent entity types delete projects](struct.ProjectLocationAgentEntityTypeDeleteCall.html) (response) +/// * [knowledge bases delete projects](struct.ProjectKnowledgeBaseDeleteCall.html) (response) +/// * [locations delete agent projects](struct.ProjectLocationDeleteAgentCall.html) (response) +/// * [operations cancel projects](struct.ProjectOperationCancelCall.html) (response) +/// * [locations agent sessions entity types delete projects](struct.ProjectLocationAgentSessionEntityTypeDeleteCall.html) (response) +/// * [locations agent environments users sessions entity types delete projects](struct.ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall.html) (response) +/// * [locations agent intents delete projects](struct.ProjectLocationAgentIntentDeleteCall.html) (response) +/// * [agent entity types delete projects](struct.ProjectAgentEntityTypeDeleteCall.html) (response) +/// * [locations agent environments users sessions delete contexts projects](struct.ProjectLocationAgentEnvironmentUserSessionDeleteContextCall.html) (response) +/// * [agent environments users sessions delete contexts projects](struct.ProjectAgentEnvironmentUserSessionDeleteContextCall.html) (response) +/// * [locations operations cancel projects](struct.ProjectLocationOperationCancelCall.html) (response) +/// * [locations agent environments users sessions contexts delete projects](struct.ProjectLocationAgentEnvironmentUserSessionContextDeleteCall.html) (response) +/// * [delete agent projects](struct.ProjectDeleteAgentCall.html) (response) +/// * [agent sessions contexts delete projects](struct.ProjectAgentSessionContextDeleteCall.html) (response) +/// * [agent sessions entity types delete projects](struct.ProjectAgentSessionEntityTypeDeleteCall.html) (response) +/// * [locations agent sessions delete contexts projects](struct.ProjectLocationAgentSessionDeleteContextCall.html) (response) +/// * [agent intents delete projects](struct.ProjectAgentIntentDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia { - /// Required. Publicly reachable URI of the file. The RBM platform - /// determines the MIME type of the file from the content-type field in - /// the HTTP headers when the platform fetches the file. The content-type - /// field must be present and accurate in the HTTP response from the URL. - #[serde(rename="fileUri")] - pub file_uri: Option, - /// Optional. Publicly reachable URI of the thumbnail.If you don't - /// provide a thumbnail URI, the RBM platform displays a blank - /// placeholder thumbnail until the user's device downloads the file. - /// Depending on the user's setting, the file may not download - /// automatically and may require the user to tap a download button. - #[serde(rename="thumbnailUri")] - pub thumbnail_uri: Option, - /// Required for cards with vertical orientation. The height of the media - /// within a rich card with a vertical layout. (https://goo.gl/NeFCjz). - /// For a standalone card with horizontal layout, height is not - /// customizable, and this field is ignored. - pub height: Option, -} +pub struct GoogleProtobufEmpty { _never_set: Option } -impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia {} +impl ResponseResult for GoogleProtobufEmpty {} /// Represents a context. @@ -2678,11 +3177,17 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [agent sessions contexts get projects](struct.ProjectAgentSessionContextGetCall.html) (response) -/// * [agent environments users sessions contexts patch projects](struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html) (request|response) -/// * [agent environments users sessions contexts create projects](struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html) (request|response) -/// * [agent environments users sessions contexts get projects](struct.ProjectAgentEnvironmentUserSessionContextGetCall.html) (response) -/// * [agent sessions contexts create projects](struct.ProjectAgentSessionContextCreateCall.html) (request|response) /// * [agent sessions contexts patch projects](struct.ProjectAgentSessionContextPatchCall.html) (request|response) +/// * [locations agent environments users sessions contexts patch projects](struct.ProjectLocationAgentEnvironmentUserSessionContextPatchCall.html) (request|response) +/// * [agent environments users sessions contexts get projects](struct.ProjectAgentEnvironmentUserSessionContextGetCall.html) (response) +/// * [agent environments users sessions contexts create projects](struct.ProjectAgentEnvironmentUserSessionContextCreateCall.html) (request|response) +/// * [locations agent environments users sessions contexts get projects](struct.ProjectLocationAgentEnvironmentUserSessionContextGetCall.html) (response) +/// * [locations agent environments users sessions contexts create projects](struct.ProjectLocationAgentEnvironmentUserSessionContextCreateCall.html) (request|response) +/// * [locations agent sessions contexts create projects](struct.ProjectLocationAgentSessionContextCreateCall.html) (request|response) +/// * [locations agent sessions contexts patch projects](struct.ProjectLocationAgentSessionContextPatchCall.html) (request|response) +/// * [agent environments users sessions contexts patch projects](struct.ProjectAgentEnvironmentUserSessionContextPatchCall.html) (request|response) +/// * [agent sessions contexts create projects](struct.ProjectAgentSessionContextCreateCall.html) (request|response) +/// * [locations agent sessions contexts get projects](struct.ProjectLocationAgentSessionContextGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudDialogflowV2beta1Context { @@ -2696,14 +3201,32 @@ pub struct GoogleCloudDialogflowV2beta1Context { /// /// If `Environment ID` is not specified, we assume default 'draft' /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` pub name: Option, /// Optional. The collection of parameters associated with this context. - /// Refer to [this - /// doc](https://cloud.google.com/dialogflow/docs/intents-actions-parameters) - /// for syntax. + /// + /// Depending on your protocol or client library language, this is a + /// map, associative array, symbol table, dictionary, or JSON object + /// composed of a collection of (MapKey, MapValue) pairs: + /// + /// * MapKey type: string + /// * MapKey value: parameter name + /// * MapValue type: + /// * If parameter's entity type is a composite entity: map + /// * Else: string + /// * MapValue value: + /// * If parameter's entity type is a composite entity: + /// map from composite entity property names to property values + /// * Else: parameter value pub parameters: Option>, /// Optional. The number of conversational query requests after which the - /// context expires. If set to `0` (the default) the context expires + /// context expires. The default is `0`. If set to `0`, the context expires /// immediately. Contexts expire automatically after 20 minutes if there /// are no matching queries. #[serde(rename="lifespanCount")] @@ -2722,26 +3245,38 @@ impl ResponseResult for GoogleCloudDialogflowV2beta1Context {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent entity types batch delete projects](struct.ProjectLocationAgentEntityTypeBatchDeleteCall.html) (response) +/// * [agent knowledge bases documents delete projects](struct.ProjectAgentKnowledgeBaseDocumentDeleteCall.html) (response) +/// * [locations agent entity types batch update projects](struct.ProjectLocationAgentEntityTypeBatchUpdateCall.html) (response) +/// * [agent intents batch update projects](struct.ProjectAgentIntentBatchUpdateCall.html) (response) +/// * [locations agent restore projects](struct.ProjectLocationAgentRestoreCall.html) (response) +/// * [locations agent entity types entities batch create projects](struct.ProjectLocationAgentEntityTypeEntityBatchCreateCall.html) (response) /// * [agent restore projects](struct.ProjectAgentRestoreCall.html) (response) -/// * [agent train projects](struct.ProjectAgentTrainCall.html) (response) +/// * [locations agent train projects](struct.ProjectLocationAgentTrainCall.html) (response) /// * [agent knowledge bases documents patch projects](struct.ProjectAgentKnowledgeBaseDocumentPatchCall.html) (response) -/// * [agent intents batch delete projects](struct.ProjectAgentIntentBatchDeleteCall.html) (response) /// * [knowledge bases documents create projects](struct.ProjectKnowledgeBaseDocumentCreateCall.html) (response) -/// * [knowledge bases documents patch projects](struct.ProjectKnowledgeBaseDocumentPatchCall.html) (response) -/// * [knowledge bases documents delete projects](struct.ProjectKnowledgeBaseDocumentDeleteCall.html) (response) -/// * [agent export projects](struct.ProjectAgentExportCall.html) (response) /// * [agent entity types batch delete projects](struct.ProjectAgentEntityTypeBatchDeleteCall.html) (response) /// * [agent import projects](struct.ProjectAgentImportCall.html) (response) -/// * [agent knowledge bases documents delete projects](struct.ProjectAgentKnowledgeBaseDocumentDeleteCall.html) (response) -/// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (response) -/// * [agent knowledge bases documents create projects](struct.ProjectAgentKnowledgeBaseDocumentCreateCall.html) (response) -/// * [agent knowledge bases documents reload projects](struct.ProjectAgentKnowledgeBaseDocumentReloadCall.html) (response) -/// * [agent intents batch update projects](struct.ProjectAgentIntentBatchUpdateCall.html) (response) +/// * [agent export projects](struct.ProjectAgentExportCall.html) (response) +/// * [locations agent entity types entities batch update projects](struct.ProjectLocationAgentEntityTypeEntityBatchUpdateCall.html) (response) /// * [agent entity types entities batch update projects](struct.ProjectAgentEntityTypeEntityBatchUpdateCall.html) (response) -/// * [knowledge bases documents reload projects](struct.ProjectKnowledgeBaseDocumentReloadCall.html) (response) -/// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (response) /// * [operations get projects](struct.ProjectOperationGetCall.html) (response) /// * [agent entity types entities batch create projects](struct.ProjectAgentEntityTypeEntityBatchCreateCall.html) (response) +/// * [agent knowledge bases documents reload projects](struct.ProjectAgentKnowledgeBaseDocumentReloadCall.html) (response) +/// * [locations agent intents batch update projects](struct.ProjectLocationAgentIntentBatchUpdateCall.html) (response) +/// * [locations agent entity types entities batch delete projects](struct.ProjectLocationAgentEntityTypeEntityBatchDeleteCall.html) (response) +/// * [agent intents batch delete projects](struct.ProjectAgentIntentBatchDeleteCall.html) (response) +/// * [locations agent import projects](struct.ProjectLocationAgentImportCall.html) (response) +/// * [locations agent export projects](struct.ProjectLocationAgentExportCall.html) (response) +/// * [locations operations get projects](struct.ProjectLocationOperationGetCall.html) (response) +/// * [agent entity types entities batch delete projects](struct.ProjectAgentEntityTypeEntityBatchDeleteCall.html) (response) +/// * [locations agent intents batch delete projects](struct.ProjectLocationAgentIntentBatchDeleteCall.html) (response) +/// * [agent knowledge bases documents create projects](struct.ProjectAgentKnowledgeBaseDocumentCreateCall.html) (response) +/// * [knowledge bases documents patch projects](struct.ProjectKnowledgeBaseDocumentPatchCall.html) (response) +/// * [knowledge bases documents delete projects](struct.ProjectKnowledgeBaseDocumentDeleteCall.html) (response) +/// * [agent train projects](struct.ProjectAgentTrainCall.html) (response) +/// * [agent entity types batch update projects](struct.ProjectAgentEntityTypeBatchUpdateCall.html) (response) +/// * [knowledge bases documents reload projects](struct.ProjectKnowledgeBaseDocumentReloadCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleLongrunningOperation { @@ -2781,6 +3316,7 @@ impl ResponseResult for GoogleLongrunningOperation {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations agent restore projects](struct.ProjectLocationAgentRestoreCall.html) (request) /// * [agent restore projects](struct.ProjectAgentRestoreCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2789,21 +3325,7 @@ pub struct GoogleCloudDialogflowV2beta1RestoreAgentRequest { /// Note: The URI must start with "gs://". #[serde(rename="agentUri")] pub agent_uri: Option, - /// The agent to restore. - /// - /// Example for how to restore an agent via the command line: - /// - ///
          curl \
          -    ///   'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:restore\
          -    ///    -X POST \
          -    ///    -H 'Authorization: Bearer '$(gcloud auth application-default
          -    ///    print-access-token) \
          -    ///    -H 'Accept: application/json' \
          -    ///    -H 'Content-Type: application/json' \
          -    ///    --compressed \
          -    ///    --data-binary "{
          -    ///        'agentContent': '$(cat <agent zip file> | base64 -w 0)'
          -    ///    }"
          + /// Zip compressed raw byte content for agent. #[serde(rename="agentContent")] pub agent_content: Option, } @@ -2831,7 +3353,7 @@ pub struct GoogleCloudDialogflowV2beta1EntityTypeEntity { /// /// For `KIND_MAP` entity types: /// - /// * A canonical value to be used in place of synonyms. + /// * A reference value to be used in place of synonyms. /// /// For `KIND_LIST` entity types: /// @@ -2888,7 +3410,7 @@ impl Part for GoogleCloudDialogflowV2beta1IntentMessageQuickReplies {} /// ::default(), None); /// let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `agent(...)`, `agent_entity_types_batch_delete(...)`, `agent_entity_types_batch_update(...)`, `agent_entity_types_create(...)`, `agent_entity_types_delete(...)`, `agent_entity_types_entities_batch_create(...)`, `agent_entity_types_entities_batch_delete(...)`, `agent_entity_types_entities_batch_update(...)`, `agent_entity_types_get(...)`, `agent_entity_types_list(...)`, `agent_entity_types_patch(...)`, `agent_environments_users_sessions_contexts_create(...)`, `agent_environments_users_sessions_contexts_delete(...)`, `agent_environments_users_sessions_contexts_get(...)`, `agent_environments_users_sessions_contexts_list(...)`, `agent_environments_users_sessions_contexts_patch(...)`, `agent_environments_users_sessions_delete_contexts(...)`, `agent_environments_users_sessions_detect_intent(...)`, `agent_environments_users_sessions_entity_types_create(...)`, `agent_environments_users_sessions_entity_types_delete(...)`, `agent_environments_users_sessions_entity_types_get(...)`, `agent_environments_users_sessions_entity_types_list(...)`, `agent_environments_users_sessions_entity_types_patch(...)`, `agent_export(...)`, `agent_import(...)`, `agent_intents_batch_delete(...)`, `agent_intents_batch_update(...)`, `agent_intents_create(...)`, `agent_intents_delete(...)`, `agent_intents_get(...)`, `agent_intents_list(...)`, `agent_intents_patch(...)`, `agent_knowledge_bases_create(...)`, `agent_knowledge_bases_delete(...)`, `agent_knowledge_bases_documents_create(...)`, `agent_knowledge_bases_documents_delete(...)`, `agent_knowledge_bases_documents_get(...)`, `agent_knowledge_bases_documents_list(...)`, `agent_knowledge_bases_documents_patch(...)`, `agent_knowledge_bases_documents_reload(...)`, `agent_knowledge_bases_get(...)`, `agent_knowledge_bases_list(...)`, `agent_knowledge_bases_patch(...)`, `agent_restore(...)`, `agent_search(...)`, `agent_sessions_contexts_create(...)`, `agent_sessions_contexts_delete(...)`, `agent_sessions_contexts_get(...)`, `agent_sessions_contexts_list(...)`, `agent_sessions_contexts_patch(...)`, `agent_sessions_delete_contexts(...)`, `agent_sessions_detect_intent(...)`, `agent_sessions_entity_types_create(...)`, `agent_sessions_entity_types_delete(...)`, `agent_sessions_entity_types_get(...)`, `agent_sessions_entity_types_list(...)`, `agent_sessions_entity_types_patch(...)`, `agent_train(...)`, `delete_agent(...)`, `get_agent(...)`, `knowledge_bases_create(...)`, `knowledge_bases_delete(...)`, `knowledge_bases_documents_create(...)`, `knowledge_bases_documents_delete(...)`, `knowledge_bases_documents_get(...)`, `knowledge_bases_documents_list(...)`, `knowledge_bases_documents_patch(...)`, `knowledge_bases_documents_reload(...)`, `knowledge_bases_get(...)`, `knowledge_bases_list(...)`, `knowledge_bases_patch(...)` and `operations_get(...)` +/// // like `agent_entity_types_batch_delete(...)`, `agent_entity_types_batch_update(...)`, `agent_entity_types_create(...)`, `agent_entity_types_delete(...)`, `agent_entity_types_entities_batch_create(...)`, `agent_entity_types_entities_batch_delete(...)`, `agent_entity_types_entities_batch_update(...)`, `agent_entity_types_get(...)`, `agent_entity_types_list(...)`, `agent_entity_types_patch(...)`, `agent_environments_users_sessions_contexts_create(...)`, `agent_environments_users_sessions_contexts_delete(...)`, `agent_environments_users_sessions_contexts_get(...)`, `agent_environments_users_sessions_contexts_list(...)`, `agent_environments_users_sessions_contexts_patch(...)`, `agent_environments_users_sessions_delete_contexts(...)`, `agent_environments_users_sessions_detect_intent(...)`, `agent_environments_users_sessions_entity_types_create(...)`, `agent_environments_users_sessions_entity_types_delete(...)`, `agent_environments_users_sessions_entity_types_get(...)`, `agent_environments_users_sessions_entity_types_list(...)`, `agent_environments_users_sessions_entity_types_patch(...)`, `agent_export(...)`, `agent_get_fulfillment(...)`, `agent_get_validation_result(...)`, `agent_import(...)`, `agent_intents_batch_delete(...)`, `agent_intents_batch_update(...)`, `agent_intents_create(...)`, `agent_intents_delete(...)`, `agent_intents_get(...)`, `agent_intents_list(...)`, `agent_intents_patch(...)`, `agent_knowledge_bases_create(...)`, `agent_knowledge_bases_delete(...)`, `agent_knowledge_bases_documents_create(...)`, `agent_knowledge_bases_documents_delete(...)`, `agent_knowledge_bases_documents_get(...)`, `agent_knowledge_bases_documents_list(...)`, `agent_knowledge_bases_documents_patch(...)`, `agent_knowledge_bases_documents_reload(...)`, `agent_knowledge_bases_get(...)`, `agent_knowledge_bases_list(...)`, `agent_knowledge_bases_patch(...)`, `agent_restore(...)`, `agent_search(...)`, `agent_sessions_contexts_create(...)`, `agent_sessions_contexts_delete(...)`, `agent_sessions_contexts_get(...)`, `agent_sessions_contexts_list(...)`, `agent_sessions_contexts_patch(...)`, `agent_sessions_delete_contexts(...)`, `agent_sessions_detect_intent(...)`, `agent_sessions_entity_types_create(...)`, `agent_sessions_entity_types_delete(...)`, `agent_sessions_entity_types_get(...)`, `agent_sessions_entity_types_list(...)`, `agent_sessions_entity_types_patch(...)`, `agent_train(...)`, `agent_update_fulfillment(...)`, `delete_agent(...)`, `get_agent(...)`, `knowledge_bases_create(...)`, `knowledge_bases_delete(...)`, `knowledge_bases_documents_create(...)`, `knowledge_bases_documents_delete(...)`, `knowledge_bases_documents_get(...)`, `knowledge_bases_documents_list(...)`, `knowledge_bases_documents_patch(...)`, `knowledge_bases_documents_reload(...)`, `knowledge_bases_get(...)`, `knowledge_bases_list(...)`, `knowledge_bases_patch(...)`, `locations_agent_entity_types_batch_delete(...)`, `locations_agent_entity_types_batch_update(...)`, `locations_agent_entity_types_create(...)`, `locations_agent_entity_types_delete(...)`, `locations_agent_entity_types_entities_batch_create(...)`, `locations_agent_entity_types_entities_batch_delete(...)`, `locations_agent_entity_types_entities_batch_update(...)`, `locations_agent_entity_types_get(...)`, `locations_agent_entity_types_list(...)`, `locations_agent_entity_types_patch(...)`, `locations_agent_environments_users_sessions_contexts_create(...)`, `locations_agent_environments_users_sessions_contexts_delete(...)`, `locations_agent_environments_users_sessions_contexts_get(...)`, `locations_agent_environments_users_sessions_contexts_list(...)`, `locations_agent_environments_users_sessions_contexts_patch(...)`, `locations_agent_environments_users_sessions_delete_contexts(...)`, `locations_agent_environments_users_sessions_detect_intent(...)`, `locations_agent_environments_users_sessions_entity_types_create(...)`, `locations_agent_environments_users_sessions_entity_types_delete(...)`, `locations_agent_environments_users_sessions_entity_types_get(...)`, `locations_agent_environments_users_sessions_entity_types_list(...)`, `locations_agent_environments_users_sessions_entity_types_patch(...)`, `locations_agent_export(...)`, `locations_agent_fulfillment(...)`, `locations_agent_get_fulfillment(...)`, `locations_agent_import(...)`, `locations_agent_intents_batch_delete(...)`, `locations_agent_intents_batch_update(...)`, `locations_agent_intents_create(...)`, `locations_agent_intents_delete(...)`, `locations_agent_intents_get(...)`, `locations_agent_intents_list(...)`, `locations_agent_intents_patch(...)`, `locations_agent_restore(...)`, `locations_agent_sessions_contexts_create(...)`, `locations_agent_sessions_contexts_delete(...)`, `locations_agent_sessions_contexts_get(...)`, `locations_agent_sessions_contexts_list(...)`, `locations_agent_sessions_contexts_patch(...)`, `locations_agent_sessions_delete_contexts(...)`, `locations_agent_sessions_detect_intent(...)`, `locations_agent_sessions_entity_types_create(...)`, `locations_agent_sessions_entity_types_delete(...)`, `locations_agent_sessions_entity_types_get(...)`, `locations_agent_sessions_entity_types_list(...)`, `locations_agent_sessions_entity_types_patch(...)`, `locations_agent_train(...)`, `locations_delete_agent(...)`, `locations_get_agent(...)`, `locations_operations_cancel(...)`, `locations_operations_get(...)`, `locations_operations_list(...)`, `locations_set_agent(...)`, `operations_cancel(...)`, `operations_get(...)`, `operations_list(...)` and `set_agent(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2905,17 +3427,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the list of all knowledge bases of the specified agent. + /// Returns the list of all session entity types in the specified session. /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. /// /// # Arguments /// - /// * `parent` - Required. The project to list of knowledge bases for. - /// Format: `projects/`. - pub fn knowledge_bases_list(&self, parent: &str) -> ProjectKnowledgeBaseListCall<'a, C, A> { - ProjectKnowledgeBaseListCall { + /// * `parent` - Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn locations_agent_environments_users_sessions_entity_types_list(&self, parent: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall { hub: self.hub, _parent: parent.to_string(), _page_token: Default::default(), @@ -2928,20 +3455,20 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified context. + /// Deletes entity types in the specified agent. + /// + /// Operation /// /// # Arguments /// - /// * `name` - Required. The name of the context to delete. Format: - /// `projects//agent/sessions//contexts/` - /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. - pub fn agent_environments_users_sessions_contexts_delete(&self, name: &str) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { - ProjectAgentEnvironmentUserSessionContextDeleteCall { + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + pub fn locations_agent_entity_types_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest, parent: &str) -> ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> { + ProjectLocationAgentEntityTypeBatchDeleteCall { hub: self.hub, - _name: name.to_string(), + _request: request, + _parent: parent.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2950,18 +3477,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified session entity type. + /// Retrieves the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. /// /// # Arguments /// - /// * `name` - Required. The name of the entity type to delete. Format: + /// * `name` - Required. The name of the session entity type. Format: /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_environments_users_sessions_entity_types_delete(&self, name: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { - ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall { + pub fn agent_environments_users_sessions_entity_types_get(&self, name: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypeGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -2970,52 +3501,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The knowledge base resource name. - /// The name must be empty when creating a knowledge base. - /// Format: `projects//knowledgeBases/`. - pub fn agent_knowledge_bases_patch(&self, request: GoogleCloudDialogflowV2beta1KnowledgeBase, name: &str) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { - ProjectAgentKnowledgeBasePatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates an entity type in the specified agent. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The agent to create a entity type for. - /// Format: `projects//agent`. - pub fn agent_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1EntityType, parent: &str) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { - ProjectAgentEntityTypeCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _language_code: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves the specified context. @@ -3040,73 +3525,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. + /// Returns the list of all entity types in the specified agent. /// /// # Arguments /// - /// * `name` - Required. The name of the knowledge base to delete. - /// Format: `projects//knowledgeBases/`. - pub fn agent_knowledge_bases_delete(&self, name: &str) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { - ProjectAgentKnowledgeBaseDeleteCall { + /// * `parent` - Required. The agent to list all entity types from. + /// Format: `projects//agent`. + pub fn locations_agent_entity_types_list(&self, parent: &str) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> { + ProjectLocationAgentEntityTypeListCall { hub: self.hub, - _name: name.to_string(), - _force: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. - /// - /// Operation - /// - /// # Arguments - /// - /// * `name` - The name of the document to delete. - /// Format: `projects//knowledgeBases//documents/`. - pub fn agent_knowledge_bases_documents_delete(&self, name: &str) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> { - ProjectAgentKnowledgeBaseDocumentDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified session entity type. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Required. The unique identifier of this session entity type. Format: - /// `projects//agent/sessions//entityTypes/`, or - /// `projects//agent/environments//users//sessions//entityTypes/`. - /// If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// `` must be the display name of an existing entity - /// type in the same agent that will be overridden or supplemented. - pub fn agent_sessions_entity_types_patch(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, name: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { - ProjectAgentSessionEntityTypePatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _language_code: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3158,33 +3589,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Imports the specified agent from a ZIP file. - /// - /// Uploads new intents and entity types without deleting the existing ones. - /// Intents and entity types with the same name are replaced with the new - /// versions from ImportAgentRequest. - /// - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The project that the agent to import is associated with. - /// Format: `projects/`. - pub fn agent_import(&self, request: GoogleCloudDialogflowV2beta1ImportAgentRequest, parent: &str) -> ProjectAgentImportCall<'a, C, A> { - ProjectAgentImportCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates/Creates multiple intents in the specified agent. @@ -3207,28 +3611,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes intents in the specified agent. - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The name of the agent to delete all entities types for. Format: - /// `projects//agent`. - pub fn agent_intents_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest, parent: &str) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { - ProjectAgentIntentBatchDeleteCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves the specified knowledge base. @@ -3250,6 +3632,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates multiple new entities in the specified entity type. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. + pub fn locations_agent_entity_types_entities_batch_create(&self, request: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest, parent: &str) -> ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + ProjectLocationAgentEntityTypeEntityBatchCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Restores the specified agent from a ZIP file. @@ -3278,80 +3682,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified document. + /// Trains the specified agent. /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. /// - /// Operation + /// Operation /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The document resource name. - /// The name must be empty when creating a document. - /// Format: `projects//knowledgeBases//documents/`. - pub fn agent_knowledge_bases_documents_patch(&self, request: GoogleCloudDialogflowV2beta1Document, name: &str) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { - ProjectAgentKnowledgeBaseDocumentPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Processes a natural language query and returns structured, actionable data - /// as a result. This method is not idempotent, because it may cause contexts - /// and session entity types to be updated, which in turn might affect - /// results of future queries. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `session` - Required. The name of the session this query is sent to. Format: - /// `projects//agent/sessions/`, or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we are using - /// "-". It's up to the API caller to choose an appropriate `Session ID` and - /// `User Id`. They can be a random number or some type of user and session - /// identifiers (preferably hashed). The length of the `Session ID` and - /// `User ID` must not exceed 36 characters. - pub fn agent_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2beta1DetectIntentRequest, session: &str) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { - ProjectAgentSessionDetectIntentCall { - hub: self.hub, - _request: request, - _session: session.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The knoweldge base to create a document for. - /// Format: `projects//knowledgeBases/`. - pub fn knowledge_bases_documents_create(&self, request: GoogleCloudDialogflowV2beta1Document, parent: &str) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { - ProjectKnowledgeBaseDocumentCreateCall { + /// * `parent` - Required. The project that the agent to train is associated with. + /// Format: `projects/`. + pub fn locations_agent_train(&self, request: GoogleCloudDialogflowV2beta1TrainAgentRequest, parent: &str) -> ProjectLocationAgentTrainCall<'a, C, A> { + ProjectLocationAgentTrainCall { hub: self.hub, _request: request, _parent: parent.to_string(), @@ -3361,28 +3703,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified context. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the context to delete. Format: - /// `projects//agent/sessions//contexts/` - /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. - pub fn agent_sessions_contexts_delete(&self, name: &str) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { - ProjectAgentSessionContextDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates the specified context. @@ -3398,6 +3718,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. /// If `Environment ID` is not specified, we assume default 'draft' /// environment. If `User ID` is not specified, we assume default '-' user. + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` pub fn agent_environments_users_sessions_contexts_patch(&self, request: GoogleCloudDialogflowV2beta1Context, name: &str) -> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { ProjectAgentEnvironmentUserSessionContextPatchCall { hub: self.hub, @@ -3412,16 +3737,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the specified agent. + /// Returns the list of all contexts in the specified session. /// /// # Arguments /// - /// * `parent` - Required. The project that the agent to fetch is associated with. - /// Format: `projects/`. - pub fn get_agent(&self, parent: &str) -> ProjectGetAgentCall<'a, C, A> { - ProjectGetAgentCall { + /// * `parent` - Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn locations_agent_environments_users_sessions_contexts_list(&self, parent: &str) -> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionContextListCall { hub: self.hub, _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3432,6 +3763,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Updates the specified session entity type. /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// /// # Arguments /// /// * `request` - No description provided. @@ -3458,18 +3793,29 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates/updates the specified agent. + /// Updates the specified context. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The project of this agent. - /// Format: `projects/`. - pub fn agent(&self, request: GoogleCloudDialogflowV2beta1Agent, parent: &str) -> ProjectAgentCall<'a, C, A> { - ProjectAgentCall { + /// * `name` - Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` + pub fn locations_agent_sessions_contexts_patch(&self, request: GoogleCloudDialogflowV2beta1Context, name: &str) -> ProjectLocationAgentSessionContextPatchCall<'a, C, A> { + ProjectLocationAgentSessionContextPatchCall { hub: self.hub, _request: request, - _parent: parent.to_string(), + _name: name.to_string(), _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -3479,208 +3825,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes entity types in the specified agent. - /// - /// Operation + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `parent` - Required. The name of the agent to delete all entities types for. Format: - /// `projects//agent`. - pub fn agent_entity_types_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest, parent: &str) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { - ProjectAgentEntityTypeBatchDeleteCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the knowledge base to delete. - /// Format: `projects//knowledgeBases/`. - pub fn knowledge_bases_delete(&self, name: &str) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { - ProjectKnowledgeBaseDeleteCall { - hub: self.hub, - _name: name.to_string(), - _force: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the list of all knowledge bases of the specified agent. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. - /// - /// # Arguments - /// - /// * `parent` - Required. The project to list of knowledge bases for. - /// Format: `projects/`. - pub fn agent_knowledge_bases_list(&self, parent: &str) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { - ProjectAgentKnowledgeBaseListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Exports the specified agent to a ZIP file. - /// - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The project that the agent to export is associated with. - /// Format: `projects/`. - pub fn agent_export(&self, request: GoogleCloudDialogflowV2beta1ExportAgentRequest, parent: &str) -> ProjectAgentExportCall<'a, C, A> { - ProjectAgentExportCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Reloads the specified document from its specified source, content_uri or - /// content. The previously loaded content of the document will be deleted. - /// Note: Even when the content of the document has not changed, there still - /// may be side effects because of internal implementation changes. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The name of the document to reload. - /// Format: `projects//knowledgeBases//documents/` - pub fn agent_knowledge_bases_documents_reload(&self, request: GoogleCloudDialogflowV2beta1ReloadDocumentRequest, name: &str) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { - ProjectAgentKnowledgeBaseDocumentReloadCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the list of all intents in the specified agent. - /// - /// # Arguments - /// - /// * `parent` - Required. The agent to list all intents from. - /// Format: `projects//agent`. - pub fn agent_intents_list(&self, parent: &str) -> ProjectAgentIntentListCall<'a, C, A> { - ProjectAgentIntentListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _language_code: Default::default(), - _intent_view: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates or creates multiple entities in the specified entity type. This - /// method does not affect entities in the entity type that aren't explicitly - /// specified in the request. - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The name of the entity type to update or create entities in. - /// Format: `projects//agent/entityTypes/`. - pub fn agent_entity_types_entities_batch_update(&self, request: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { - ProjectAgentEntityTypeEntityBatchUpdateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a session entity type. - /// - /// If the specified session entity type already exists, overrides the - /// session entity type. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The session to create a session entity type for. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users// - /// sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. - pub fn agent_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, parent: &str) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { - ProjectAgentSessionEntityTypeCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the latest state of a long-running operation. Clients can use this - /// method to poll the operation result at intervals as recommended by the API - /// service. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource. - pub fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, C, A> { - ProjectOperationGetCall { + /// * `name` - The name of the operation resource to be cancelled. + pub fn operations_cancel(&self, name: &str) -> ProjectOperationCancelCall<'a, C, A> { + ProjectOperationCancelCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -3691,41 +3851,30 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all active contexts in the specified session. + /// Updates the specified session entity type. /// - /// # Arguments - /// - /// * `parent` - Required. The name of the session to delete all contexts from. Format: - /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_environments_users_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { - ProjectAgentEnvironmentUserSessionDeleteContextCall { - hub: self.hub, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates multiple new entities in the specified entity type. - /// - /// Operation + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The name of the entity type to create entities in. Format: - /// `projects//agent/entityTypes/`. - pub fn agent_entity_types_entities_batch_create(&self, request: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { - ProjectAgentEntityTypeEntityBatchCreateCall { + /// * `name` - Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or + /// `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. + pub fn locations_agent_environments_users_sessions_entity_types_patch(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, name: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall { hub: self.hub, _request: request, - _parent: parent.to_string(), + _name: name.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3734,39 +3883,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the list of all entity types in the specified agent. + /// Deletes the specified context. /// /// # Arguments /// - /// * `parent` - Required. The agent to list all entity types from. - /// Format: `projects//agent`. - pub fn agent_entity_types_list(&self, parent: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - ProjectAgentEntityTypeListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _language_code: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the document to retrieve. - /// Format `projects//knowledgeBases//documents/`. - pub fn agent_knowledge_bases_documents_get(&self, name: &str) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> { - ProjectAgentKnowledgeBaseDocumentGetCall { + /// * `name` - Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + pub fn locations_agent_sessions_contexts_delete(&self, name: &str) -> ProjectLocationAgentSessionContextDeleteCall<'a, C, A> { + ProjectLocationAgentSessionContextDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -3775,58 +3903,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the knowledge base to retrieve. - /// Format `projects//knowledgeBases/`. - pub fn knowledge_bases_get(&self, name: &str) -> ProjectKnowledgeBaseGetCall<'a, C, A> { - ProjectKnowledgeBaseGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a session entity type. - /// - /// If the specified session entity type already exists, overrides the - /// session entity type. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The session to create a session entity type for. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users// - /// sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. - pub fn agent_environments_users_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, parent: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { - ProjectAgentEnvironmentUserSessionEntityTypeCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns the list of all session entity types in the specified session. /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// /// # Arguments /// /// * `parent` - Required. The session to list all session entity types from. @@ -3847,86 +3931,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Processes a natural language query and returns structured, actionable data - /// as a result. This method is not idempotent, because it may cause contexts - /// and session entity types to be updated, which in turn might affect - /// results of future queries. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `session` - Required. The name of the session this query is sent to. Format: - /// `projects//agent/sessions/`, or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we are using - /// "-". It's up to the API caller to choose an appropriate `Session ID` and - /// `User Id`. They can be a random number or some type of user and session - /// identifiers (preferably hashed). The length of the `Session ID` and - /// `User ID` must not exceed 36 characters. - pub fn agent_environments_users_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2beta1DetectIntentRequest, session: &str) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { - ProjectAgentEnvironmentUserSessionDetectIntentCall { - hub: self.hub, - _request: request, - _session: session.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a context. - /// - /// If the specified context already exists, overrides the context. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The session to create a context for. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. - pub fn agent_environments_users_sessions_contexts_create(&self, request: GoogleCloudDialogflowV2beta1Context, parent: &str) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { - ProjectAgentEnvironmentUserSessionContextCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified entity type. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The unique identifier of the entity type. - /// Required for EntityTypes.UpdateEntityType and - /// EntityTypes.BatchUpdateEntityTypes methods. - /// Format: `projects//agent/entityTypes/`. - pub fn agent_entity_types_patch(&self, request: GoogleCloudDialogflowV2beta1EntityType, name: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { - ProjectAgentEntityTypePatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _language_code: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns the list of all contexts in the specified session. @@ -3953,80 +3957,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified entity type. + /// Returns the list of all contexts in the specified session. /// /// # Arguments /// - /// * `name` - Required. The name of the entity type to delete. - /// Format: `projects//agent/entityTypes/`. - pub fn agent_entity_types_delete(&self, name: &str) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { - ProjectAgentEntityTypeDeleteCall { + /// * `parent` - Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn agent_sessions_contexts_list(&self, parent: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + ProjectAgentSessionContextListCall { hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the specified session entity type. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the session entity type. Format: - /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_sessions_entity_types_get(&self, name: &str) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { - ProjectAgentSessionEntityTypeGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the document to retrieve. - /// Format `projects//knowledgeBases//documents/`. - pub fn knowledge_bases_documents_get(&self, name: &str) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> { - ProjectKnowledgeBaseDocumentGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the specified intent. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the intent. - /// Format: `projects//agent/intents/`. - pub fn agent_intents_get(&self, name: &str) -> ProjectAgentIntentGetCall<'a, C, A> { - ProjectAgentIntentGetCall { - hub: self.hub, - _name: name.to_string(), - _language_code: Default::default(), - _intent_view: Default::default(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4054,47 +4000,24 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes entities in the specified entity type. + /// Retrieves the specified session entity type. /// - /// Operation + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `parent` - Required. The name of the entity type to delete entries for. Format: - /// `projects//agent/entityTypes/`. - pub fn agent_entity_types_entities_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { - ProjectAgentEntityTypeEntityBatchDeleteCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified context. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Required. The unique identifier of the context. Format: - /// `projects//agent/sessions//contexts/`, - /// or `projects//agent/environments//users//sessions//contexts/`. - /// The `Context ID` is always converted to lowercase, may only contain - /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. - /// If `Environment ID` is not specified, we assume default 'draft' + /// * `name` - Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_sessions_contexts_patch(&self, request: GoogleCloudDialogflowV2beta1Context, name: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { - ProjectAgentSessionContextPatchCall { + pub fn locations_agent_sessions_entity_types_get(&self, name: &str) -> ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> { + ProjectLocationAgentSessionEntityTypeGetCall { hub: self.hub, - _request: request, _name: name.to_string(), - _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4103,21 +4026,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new document. + /// Creates a session entity type. /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. + /// If the specified session entity type already exists, overrides the + /// session entity type. /// - /// Operation + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The knoweldge base to create a document for. - /// Format: `projects//knowledgeBases/`. - pub fn agent_knowledge_bases_documents_create(&self, request: GoogleCloudDialogflowV2beta1Document, parent: &str) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { - ProjectAgentKnowledgeBaseDocumentCreateCall { + /// * `parent` - Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn locations_agent_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, parent: &str) -> ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> { + ProjectLocationAgentSessionEntityTypeCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), @@ -4127,78 +4055,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves the specified context. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the context. Format: - /// `projects//agent/sessions//contexts/` - /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. - pub fn agent_sessions_contexts_get(&self, name: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { - ProjectAgentSessionContextGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes all active contexts in the specified session. - /// - /// # Arguments - /// - /// * `parent` - Required. The name of the session to delete all contexts from. Format: - /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { - ProjectAgentSessionDeleteContextCall { - hub: self.hub, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified document. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The document resource name. - /// The name must be empty when creating a document. - /// Format: `projects//knowledgeBases//documents/`. - pub fn knowledge_bases_documents_patch(&self, request: GoogleCloudDialogflowV2beta1Document, name: &str) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { - ProjectKnowledgeBaseDocumentPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns the list of all documents of the knowledge base. @@ -4229,9 +4085,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; /// only use `projects.knowledgeBases.documents`. /// - /// Operation - /// /// # Arguments /// /// * `name` - The name of the document to delete. @@ -4273,6 +4126,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + pub fn locations_agent_environments_users_sessions_contexts_delete(&self, name: &str) -> ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionContextDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes the specified agent. @@ -4291,146 +4166,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Trains the specified agent. - /// - /// - /// Operation - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The project that the agent to train is associated with. - /// Format: `projects/`. - pub fn agent_train(&self, request: GoogleCloudDialogflowV2beta1TrainAgentRequest, parent: &str) -> ProjectAgentTrainCall<'a, C, A> { - ProjectAgentTrainCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the list of all session entity types in the specified session. - /// - /// # Arguments - /// - /// * `parent` - Required. The session to list all session entity types from. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users// - /// sessions/`. - /// If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_sessions_entity_types_list(&self, parent: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { - ProjectAgentSessionEntityTypeListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the specified session entity type. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the session entity type. Format: - /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_environments_users_sessions_entity_types_get(&self, name: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { - ProjectAgentEnvironmentUserSessionEntityTypeGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The knowledge base resource name. - /// The name must be empty when creating a knowledge base. - /// Format: `projects//knowledgeBases/`. - pub fn knowledge_bases_patch(&self, request: GoogleCloudDialogflowV2beta1KnowledgeBase, name: &str) -> ProjectKnowledgeBasePatchCall<'a, C, A> { - ProjectKnowledgeBasePatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases` resource is deprecated; - /// only use `projects.knowledgeBases`. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The project to create a knowledge base for. - /// Format: `projects/`. - pub fn knowledge_bases_create(&self, request: GoogleCloudDialogflowV2beta1KnowledgeBase, parent: &str) -> ProjectKnowledgeBaseCreateCall<'a, C, A> { - ProjectKnowledgeBaseCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the list of all documents of the knowledge base. - /// - /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - /// only use `projects.knowledgeBases.documents`. - /// - /// # Arguments - /// - /// * `parent` - Required. The knowledge base to list all documents for. - /// Format: `projects//knowledgeBases/`. - pub fn agent_knowledge_bases_documents_list(&self, parent: &str) -> ProjectAgentKnowledgeBaseDocumentListCall<'a, C, A> { - ProjectAgentKnowledgeBaseDocumentListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates the specified intent. @@ -4456,28 +4191,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified session entity type. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the entity type to delete. Format: - /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - pub fn agent_sessions_entity_types_delete(&self, name: &str) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { - ProjectAgentSessionEntityTypeDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns the list of agents. @@ -4504,6 +4217,1514 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes all active contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionDeleteContextCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified intent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The unique identifier of this intent. + /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + /// methods. + /// Format: `projects//agent/intents/`. + pub fn locations_agent_intents_patch(&self, request: GoogleCloudDialogflowV2beta1Intent, name: &str) -> ProjectLocationAgentIntentPatchCall<'a, C, A> { + ProjectLocationAgentIntentPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all knowledge bases of the specified agent. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `parent` - Required. The project to list of knowledge bases for. + /// Format: `projects/`. + pub fn knowledge_bases_list(&self, parent: &str) -> ProjectKnowledgeBaseListCall<'a, C, A> { + ProjectKnowledgeBaseListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified knowledge base. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The knowledge base resource name. + /// The name must be empty when creating a knowledge base. + /// Format: `projects//knowledgeBases/`. + pub fn agent_knowledge_bases_patch(&self, request: GoogleCloudDialogflowV2beta1KnowledgeBase, name: &str) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { + ProjectAgentKnowledgeBasePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all active contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_delete_contexts(&self, parent: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + ProjectAgentSessionDeleteContextCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified document. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `name` - The name of the document to delete. + /// Format: `projects//knowledgeBases//documents/`. + pub fn agent_knowledge_bases_documents_delete(&self, name: &str) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> { + ProjectAgentKnowledgeBaseDocumentDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a context. + /// + /// If the specified context already exists, overrides the context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn locations_agent_sessions_contexts_create(&self, request: GoogleCloudDialogflowV2beta1Context, parent: &str) -> ProjectLocationAgentSessionContextCreateCall<'a, C, A> { + ProjectLocationAgentSessionContextCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the fulfillment. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub fn locations_agent_get_fulfillment(&self, name: &str) -> ProjectLocationAgentGetFulfillmentCall<'a, C, A> { + ProjectLocationAgentGetFulfillmentCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates/updates the specified agent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project of this agent. + /// Format: `projects/`. + pub fn set_agent(&self, request: GoogleCloudDialogflowV2beta1Agent, parent: &str) -> ProjectSetAgentCall<'a, C, A> { + ProjectSetAgentCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes entity types in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + pub fn agent_entity_types_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest, parent: &str) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { + ProjectAgentEntityTypeBatchDeleteCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Imports the specified agent from a ZIP file. + /// + /// Uploads new intents and entity types without deleting the existing ones. + /// Intents and entity types with the same name are replaced with the new + /// versions from ImportAgentRequest. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to import is associated with. + /// Format: `projects/`. + pub fn agent_import(&self, request: GoogleCloudDialogflowV2beta1ImportAgentRequest, parent: &str) -> ProjectAgentImportCall<'a, C, A> { + ProjectAgentImportCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all knowledge bases of the specified agent. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `parent` - Required. The project to list of knowledge bases for. + /// Format: `projects/`. + pub fn agent_knowledge_bases_list(&self, parent: &str) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { + ProjectAgentKnowledgeBaseListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a knowledge base. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project to create a knowledge base for. + /// Format: `projects/`. + pub fn knowledge_bases_create(&self, request: GoogleCloudDialogflowV2beta1KnowledgeBase, parent: &str) -> ProjectKnowledgeBaseCreateCall<'a, C, A> { + ProjectKnowledgeBaseCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates or creates multiple entities in the specified entity type. This + /// method does not affect entities in the entity type that aren't explicitly + /// specified in the request. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to update or create entities in. + /// Format: `projects//agent/entityTypes/`. + pub fn locations_agent_entity_types_entities_batch_update(&self, request: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest, parent: &str) -> ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + ProjectLocationAgentEntityTypeEntityBatchUpdateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates or creates multiple entities in the specified entity type. This + /// method does not affect entities in the entity type that aren't explicitly + /// specified in the request. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to update or create entities in. + /// Format: `projects//agent/entityTypes/`. + pub fn agent_entity_types_entities_batch_update(&self, request: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + ProjectAgentEntityTypeEntityBatchUpdateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the fulfillment. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub fn locations_agent_fulfillment(&self, request: GoogleCloudDialogflowV2beta1Fulfillment, name: &str) -> ProjectLocationAgentFulfillmentCall<'a, C, A> { + ProjectLocationAgentFulfillmentCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all session entity types in the specified session. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_entity_types_list(&self, parent: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + ProjectAgentSessionEntityTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates/Creates multiple intents in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to update or create intents in. + /// Format: `projects//agent`. + pub fn locations_agent_intents_batch_update(&self, request: GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest, parent: &str) -> ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> { + ProjectLocationAgentIntentBatchUpdateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified knowledge base. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the knowledge base to retrieve. + /// Format `projects//knowledgeBases/`. + pub fn knowledge_bases_get(&self, name: &str) -> ProjectKnowledgeBaseGetCall<'a, C, A> { + ProjectKnowledgeBaseGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified intent and its direct or indirect followup intents. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the intent to delete. If this intent has direct or + /// indirect followup intents, we also delete them. + /// Format: `projects//agent/intents/`. + pub fn locations_agent_intents_delete(&self, name: &str) -> ProjectLocationAgentIntentDeleteCall<'a, C, A> { + ProjectLocationAgentIntentDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a session entity type. + /// + /// If the specified session entity type already exists, overrides the + /// session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn locations_agent_environments_users_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, parent: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Processes a natural language query and returns structured, actionable data + /// as a result. This method is not idempotent, because it may cause contexts + /// and session entity types to be updated, which in turn might affect + /// results of future queries. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + pub fn agent_environments_users_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2beta1DetectIntentRequest, session: &str) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionDetectIntentCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified entity type. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The unique identifier of the entity type. + /// Required for EntityTypes.UpdateEntityType and + /// EntityTypes.BatchUpdateEntityTypes methods. + /// Format: `projects//agent/entityTypes/`. + pub fn agent_entity_types_patch(&self, request: GoogleCloudDialogflowV2beta1EntityType, name: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + ProjectAgentEntityTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified entity type. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. + /// Format: `projects//agent/entityTypes/`. + pub fn agent_entity_types_delete(&self, name: &str) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { + ProjectAgentEntityTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Exports the specified agent to a ZIP file. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to export is associated with. + /// Format: `projects/`. + pub fn locations_agent_export(&self, request: GoogleCloudDialogflowV2beta1ExportAgentRequest, parent: &str) -> ProjectLocationAgentExportCall<'a, C, A> { + ProjectLocationAgentExportCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes intents in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + pub fn locations_agent_intents_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest, parent: &str) -> ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> { + ProjectLocationAgentIntentBatchDeleteCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` + pub fn agent_sessions_contexts_patch(&self, request: GoogleCloudDialogflowV2beta1Context, name: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + ProjectAgentSessionContextPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn locations_operations_cancel(&self, name: &str) -> ProjectLocationOperationCancelCall<'a, C, A> { + ProjectLocationOperationCancelCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an entity type in the specified agent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The agent to create a entity type for. + /// Format: `projects//agent`. + pub fn locations_agent_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1EntityType, parent: &str) -> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> { + ProjectLocationAgentEntityTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified document. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The document resource name. + /// The name must be empty when creating a document. + /// Format: `projects//knowledgeBases//documents/`. + pub fn knowledge_bases_documents_patch(&self, request: GoogleCloudDialogflowV2beta1Document, name: &str) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { + ProjectKnowledgeBaseDocumentPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Trains the specified agent. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to train is associated with. + /// Format: `projects/`. + pub fn agent_train(&self, request: GoogleCloudDialogflowV2beta1TrainAgentRequest, parent: &str) -> ProjectAgentTrainCall<'a, C, A> { + ProjectAgentTrainCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + pub fn agent_sessions_contexts_delete(&self, name: &str) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { + ProjectAgentSessionContextDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified intent. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the intent. + /// Format: `projects//agent/intents/`. + pub fn agent_intents_get(&self, name: &str) -> ProjectAgentIntentGetCall<'a, C, A> { + ProjectAgentIntentGetCall { + hub: self.hub, + _name: name.to_string(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all active contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn locations_agent_sessions_delete_contexts(&self, parent: &str) -> ProjectLocationAgentSessionDeleteContextCall<'a, C, A> { + ProjectLocationAgentSessionDeleteContextCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all session entity types in the specified session. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn locations_agent_sessions_entity_types_list(&self, parent: &str) -> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> { + ProjectLocationAgentSessionEntityTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + pub fn locations_agent_sessions_contexts_get(&self, name: &str) -> ProjectLocationAgentSessionContextGetCall<'a, C, A> { + ProjectLocationAgentSessionContextGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + pub fn agent_environments_users_sessions_contexts_delete(&self, name: &str) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionContextDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_environments_users_sessions_entity_types_delete(&self, name: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates/updates the specified agent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project of this agent. + /// Format: `projects/`. + pub fn locations_set_agent(&self, request: GoogleCloudDialogflowV2beta1Agent, parent: &str) -> ProjectLocationSetAgentCall<'a, C, A> { + ProjectLocationSetAgentCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or + /// `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. + pub fn agent_sessions_entity_types_patch(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, name: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + ProjectAgentSessionEntityTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates/Creates multiple entity types in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to update or create entity types in. + /// Format: `projects//agent`. + pub fn locations_agent_entity_types_batch_update(&self, request: GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest, parent: &str) -> ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> { + ProjectLocationAgentEntityTypeBatchUpdateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified intent. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the intent. + /// Format: `projects//agent/intents/`. + pub fn locations_agent_intents_get(&self, name: &str) -> ProjectLocationAgentIntentGetCall<'a, C, A> { + ProjectLocationAgentIntentGetCall { + hub: self.hub, + _name: name.to_string(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Processes a natural language query and returns structured, actionable data + /// as a result. This method is not idempotent, because it may cause contexts + /// and session entity types to be updated, which in turn might affect + /// results of future queries. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + pub fn agent_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2beta1DetectIntentRequest, session: &str) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { + ProjectAgentSessionDetectIntentCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new document. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The knoweldge base to create a document for. + /// Format: `projects//knowledgeBases/`. + pub fn knowledge_bases_documents_create(&self, request: GoogleCloudDialogflowV2beta1Document, parent: &str) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { + ProjectKnowledgeBaseDocumentCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified knowledge base. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the knowledge base to delete. + /// Format: `projects//knowledgeBases/`. + pub fn knowledge_bases_delete(&self, name: &str) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { + ProjectKnowledgeBaseDeleteCall { + hub: self.hub, + _name: name.to_string(), + _force: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn locations_operations_list(&self, name: &str) -> ProjectLocationOperationListCall<'a, C, A> { + ProjectLocationOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified entity type. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type. + /// Format: `projects//agent/entityTypes/`. + pub fn locations_agent_entity_types_get(&self, name: &str) -> ProjectLocationAgentEntityTypeGetCall<'a, C, A> { + ProjectLocationAgentEntityTypeGetCall { + hub: self.hub, + _name: name.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, C, A> { + ProjectOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The project that the agent to fetch is associated with. + /// Format: `projects/`. + pub fn get_agent(&self, parent: &str) -> ProjectGetAgentCall<'a, C, A> { + ProjectGetAgentCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn locations_agent_environments_users_sessions_entity_types_delete(&self, name: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets agent validation result. Agent validation is performed during + /// training time and is updated automatically when training is completed. + /// + /// # Arguments + /// + /// * `parent` - Required. The project that the agent is associated with. + /// Format: `projects/`. + pub fn agent_get_validation_result(&self, parent: &str) -> ProjectAgentGetValidationResultCall<'a, C, A> { + ProjectAgentGetValidationResultCall { + hub: self.hub, + _parent: parent.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a session entity type. + /// + /// If the specified session entity type already exists, overrides the + /// session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn agent_environments_users_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, parent: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionEntityTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + pub fn agent_sessions_contexts_get(&self, name: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { + ProjectAgentSessionContextGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a context. + /// + /// If the specified context already exists, overrides the context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn agent_environments_users_sessions_contexts_create(&self, request: GoogleCloudDialogflowV2beta1Context, parent: &str) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + ProjectAgentEnvironmentUserSessionContextCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified entity type. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The unique identifier of the entity type. + /// Required for EntityTypes.UpdateEntityType and + /// EntityTypes.BatchUpdateEntityTypes methods. + /// Format: `projects//agent/entityTypes/`. + pub fn locations_agent_entity_types_patch(&self, request: GoogleCloudDialogflowV2beta1EntityType, name: &str) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> { + ProjectLocationAgentEntityTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a context. + /// + /// If the specified context already exists, overrides the context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn locations_agent_environments_users_sessions_contexts_create(&self, request: GoogleCloudDialogflowV2beta1Context, parent: &str) -> ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionContextCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all active contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn locations_agent_environments_users_sessions_delete_contexts(&self, parent: &str) -> ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionDeleteContextCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all contexts in the specified session. + /// + /// # Arguments + /// + /// * `parent` - Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn locations_agent_sessions_contexts_list(&self, parent: &str) -> ProjectLocationAgentSessionContextListCall<'a, C, A> { + ProjectLocationAgentSessionContextListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an entity type in the specified agent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The agent to create a entity type for. + /// Format: `projects//agent`. + pub fn agent_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1EntityType, parent: &str) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + ProjectAgentEntityTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes entities in the specified entity type. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to delete entries for. Format: + /// `projects//agent/entityTypes/`. + pub fn agent_entity_types_entities_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + ProjectAgentEntityTypeEntityBatchDeleteCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new document. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The knoweldge base to create a document for. + /// Format: `projects//knowledgeBases/`. + pub fn agent_knowledge_bases_documents_create(&self, request: GoogleCloudDialogflowV2beta1Document, parent: &str) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { + ProjectAgentKnowledgeBaseDocumentCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified knowledge base. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The knowledge base resource name. + /// The name must be empty when creating a knowledge base. + /// Format: `projects//knowledgeBases/`. + pub fn knowledge_bases_patch(&self, request: GoogleCloudDialogflowV2beta1KnowledgeBase, name: &str) -> ProjectKnowledgeBasePatchCall<'a, C, A> { + ProjectKnowledgeBasePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn locations_agent_environments_users_sessions_entity_types_get(&self, name: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all documents of the knowledge base. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `parent` - Required. The knowledge base to list all documents for. + /// Format: `projects//knowledgeBases/`. + pub fn agent_knowledge_bases_documents_list(&self, parent: &str) -> ProjectAgentKnowledgeBaseDocumentListCall<'a, C, A> { + ProjectAgentKnowledgeBaseDocumentListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes the specified intent and its direct or indirect followup intents. @@ -4523,6 +5744,222 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Processes a natural language query and returns structured, actionable data + /// as a result. This method is not idempotent, because it may cause contexts + /// and session entity types to be updated, which in turn might affect + /// results of future queries. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `session` - Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + pub fn locations_agent_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2beta1DetectIntentRequest, session: &str) -> ProjectLocationAgentSessionDetectIntentCall<'a, C, A> { + ProjectLocationAgentSessionDetectIntentCall { + hub: self.hub, + _request: request, + _session: session.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified knowledge base. + /// + /// Note: The `projects.agent.knowledgeBases` resource is deprecated; + /// only use `projects.knowledgeBases`. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the knowledge base to delete. + /// Format: `projects//knowledgeBases/`. + pub fn agent_knowledge_bases_delete(&self, name: &str) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { + ProjectAgentKnowledgeBaseDeleteCall { + hub: self.hub, + _name: name.to_string(), + _force: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Restores the specified agent from a ZIP file. + /// + /// Replaces the current agent version with a new one. All the intents and + /// entity types in the older version are deleted. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to restore is associated with. + /// Format: `projects/`. + pub fn locations_agent_restore(&self, request: GoogleCloudDialogflowV2beta1RestoreAgentRequest, parent: &str) -> ProjectLocationAgentRestoreCall<'a, C, A> { + ProjectLocationAgentRestoreCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes entities in the specified entity type. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to delete entries for. Format: + /// `projects//agent/entityTypes/`. + pub fn locations_agent_entity_types_entities_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest, parent: &str) -> ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + ProjectLocationAgentEntityTypeEntityBatchDeleteCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an intent in the specified agent. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The agent to create a intent for. + /// Format: `projects//agent`. + pub fn locations_agent_intents_create(&self, request: GoogleCloudDialogflowV2beta1Intent, parent: &str) -> ProjectLocationAgentIntentCreateCall<'a, C, A> { + ProjectLocationAgentIntentCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified document. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The document resource name. + /// The name must be empty when creating a document. + /// Format: `projects//knowledgeBases//documents/`. + pub fn agent_knowledge_bases_documents_patch(&self, request: GoogleCloudDialogflowV2beta1Document, name: &str) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { + ProjectAgentKnowledgeBaseDocumentPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified context. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` + pub fn locations_agent_environments_users_sessions_contexts_patch(&self, request: GoogleCloudDialogflowV2beta1Context, name: &str) -> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionContextPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified entity type. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. + /// Format: `projects//agent/entityTypes/`. + pub fn locations_agent_entity_types_delete(&self, name: &str) -> ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> { + ProjectLocationAgentEntityTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The project that the agent to delete is associated with. + /// Format: `projects/`. + pub fn locations_delete_agent(&self, parent: &str) -> ProjectLocationDeleteAgentCall<'a, C, A> { + ProjectLocationDeleteAgentCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Reloads the specified document from its specified source, content_uri or @@ -4533,8 +5970,503 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; /// only use `projects.knowledgeBases.documents`. /// - /// Operation + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the document to reload. + /// Format: `projects//knowledgeBases//documents/` + pub fn agent_knowledge_bases_documents_reload(&self, request: GoogleCloudDialogflowV2beta1ReloadDocumentRequest, name: &str) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { + ProjectAgentKnowledgeBaseDocumentReloadCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all intents in the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The agent to list all intents from. + /// Format: `projects//agent`. + pub fn agent_intents_list(&self, parent: &str) -> ProjectAgentIntentListCall<'a, C, A> { + ProjectAgentIntentListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn locations_agent_sessions_entity_types_delete(&self, name: &str) -> ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> { + ProjectLocationAgentSessionEntityTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a session entity type. + /// + /// If the specified session entity type already exists, overrides the + /// session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + pub fn agent_sessions_entity_types_create(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, parent: &str) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { + ProjectAgentSessionEntityTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates multiple new entities in the specified entity type. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. + pub fn agent_entity_types_entities_batch_create(&self, request: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest, parent: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + ProjectAgentEntityTypeEntityBatchCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all intents in the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The agent to list all intents from. + /// Format: `projects//agent`. + pub fn locations_agent_intents_list(&self, parent: &str) -> ProjectLocationAgentIntentListCall<'a, C, A> { + ProjectLocationAgentIntentListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _language_code: Default::default(), + _intent_view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified document. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the document to retrieve. + /// Format `projects//knowledgeBases//documents/`. + pub fn agent_knowledge_bases_documents_get(&self, name: &str) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> { + ProjectAgentKnowledgeBaseDocumentGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes intents in the specified agent. + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + pub fn agent_intents_batch_delete(&self, request: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest, parent: &str) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { + ProjectAgentIntentBatchDeleteCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the fulfillment. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub fn agent_get_fulfillment(&self, name: &str) -> ProjectAgentGetFulfillmentCall<'a, C, A> { + ProjectAgentGetFulfillmentCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified context. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + pub fn locations_agent_environments_users_sessions_contexts_get(&self, name: &str) -> ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionContextGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Imports the specified agent from a ZIP file. + /// + /// Uploads new intents and entity types without deleting the existing ones. + /// Intents and entity types with the same name are replaced with the new + /// versions from ImportAgentRequest. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to import is associated with. + /// Format: `projects/`. + pub fn locations_agent_import(&self, request: GoogleCloudDialogflowV2beta1ImportAgentRequest, parent: &str) -> ProjectLocationAgentImportCall<'a, C, A> { + ProjectLocationAgentImportCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified document. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the document to retrieve. + /// Format `projects//knowledgeBases//documents/`. + pub fn knowledge_bases_documents_get(&self, name: &str) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> { + ProjectKnowledgeBaseDocumentGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn locations_operations_get(&self, name: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + ProjectLocationOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the fulfillment. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + pub fn agent_update_fulfillment(&self, request: GoogleCloudDialogflowV2beta1Fulfillment, name: &str) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + ProjectAgentUpdateFulfillmentCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The project that the agent to fetch is associated with. + /// Format: `projects/`. + pub fn locations_get_agent(&self, parent: &str) -> ProjectLocationGetAgentCall<'a, C, A> { + ProjectLocationGetAgentCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_entity_types_get(&self, name: &str) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { + ProjectAgentSessionEntityTypeGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn operations_list(&self, name: &str) -> ProjectOperationListCall<'a, C, A> { + ProjectOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Exports the specified agent to a ZIP file. + /// + /// + /// Operation + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project that the agent to export is associated with. + /// Format: `projects/`. + pub fn agent_export(&self, request: GoogleCloudDialogflowV2beta1ExportAgentRequest, parent: &str) -> ProjectAgentExportCall<'a, C, A> { + ProjectAgentExportCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the list of all entity types in the specified agent. + /// + /// # Arguments + /// + /// * `parent` - Required. The agent to list all entity types from. + /// Format: `projects//agent`. + pub fn agent_entity_types_list(&self, parent: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + ProjectAgentEntityTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + pub fn agent_sessions_entity_types_delete(&self, name: &str) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { + ProjectAgentSessionEntityTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified session entity type. + /// + /// This method doesn't work with Google Assistant integration. + /// Contact Dialogflow support if you need to use session entities + /// with Google Assistant integration. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or + /// `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. + pub fn locations_agent_sessions_entity_types_patch(&self, request: GoogleCloudDialogflowV2beta1SessionEntityType, name: &str) -> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> { + ProjectLocationAgentSessionEntityTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reloads the specified document from its specified source, content_uri or + /// content. The previously loaded content of the document will be deleted. + /// Note: Even when the content of the document has not changed, there still + /// may be side effects because of internal implementation changes. + /// + /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + /// only use `projects.knowledgeBases.documents`. /// /// # Arguments /// @@ -4577,22 +6509,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the list of all contexts in the specified session. + /// Processes a natural language query and returns structured, actionable data + /// as a result. This method is not idempotent, because it may cause contexts + /// and session entity types to be updated, which in turn might affect + /// results of future queries. /// /// # Arguments /// - /// * `parent` - Required. The session to list all contexts from. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. - pub fn agent_sessions_contexts_list(&self, parent: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { - ProjectAgentSessionContextListCall { + /// * `request` - No description provided. + /// * `session` - Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + pub fn locations_agent_environments_users_sessions_detect_intent(&self, request: GoogleCloudDialogflowV2beta1DetectIntentRequest, session: &str) -> ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + ProjectLocationAgentEnvironmentUserSessionDetectIntentCall { hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _request: request, + _session: session.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4608,12 +6546,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Returns the list of all knowledge bases of the specified agent. +/// Returns the list of all session entity types in the specified session. /// -/// Note: The `projects.agent.knowledgeBases` resource is deprecated; -/// only use `projects.knowledgeBases`. +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. /// -/// A builder for the *knowledgeBases.list* method supported by a *project* resource. +/// A builder for the *locations.agent.environments.users.sessions.entityTypes.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4638,13 +6577,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // 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().knowledge_bases_list("parent") +/// let result = hub.projects().locations_agent_environments_users_sessions_entity_types_list("parent") /// .page_token("accusam") /// .page_size(-8) /// .doit(); /// # } /// ``` -pub struct ProjectKnowledgeBaseListCall<'a, C, A> +pub struct ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, @@ -4656,13 +6595,13 @@ pub struct ProjectKnowledgeBaseListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> {} -impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -4671,7 +6610,7 @@ impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.list", + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.list", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -4693,7 +6632,7 @@ impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut`. + /// Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectKnowledgeBaseListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { self._parent = new_value.to_string(); self } /// Optional. The next_page_token value returned from a previous list request. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectKnowledgeBaseListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } /// Optional. The maximum number of items to return in a single page. By - /// default 10 and at most 100. + /// default 100 and at most 1000. /// /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectKnowledgeBaseListCall<'a, C, A> { + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { self._page_size = Some(new_value); self } @@ -4828,7 +6771,7 @@ impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBaseListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4853,7 +6796,7 @@ impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectKnowledgeBaseListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4873,7 +6816,7 @@ impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectKnowledgeBaseListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4885,9 +6828,11 @@ impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut /// -/// A builder for the *agent.environments.users.sessions.contexts.delete* method supported by a *project* resource. +/// A builder for the *locations.agent.entityTypes.batchDelete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4899,516 +6844,7 @@ impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_environments_users_sessions_contexts_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the context to delete. Format: - /// `projects//agent/sessions//contexts/` - /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified session entity type. -/// -/// A builder for the *agent.environments.users.sessions.entityTypes.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_environments_users_sessions_entity_types_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the entity type to delete. Format: - /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified knowledge base. -/// -/// Note: The `projects.agent.knowledgeBases` resource is deprecated; -/// only use `projects.knowledgeBases`. -/// -/// A builder for the *agent.knowledgeBases.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1KnowledgeBase; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -5422,330 +6858,33 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> /// // 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 = GoogleCloudDialogflowV2beta1KnowledgeBase::default(); +/// let mut req = GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest::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().agent_knowledge_bases_patch(req, "name") -/// .update_mask("labore") +/// let result = hub.projects().locations_agent_entity_types_batch_delete(req, "parent") /// .doit(); /// # } /// ``` -pub struct ProjectAgentKnowledgeBasePatchCall<'a, C, A> +pub struct ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1KnowledgeBase, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBasePatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1KnowledgeBase)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1KnowledgeBase) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The knowledge base resource name. - /// The name must be empty when creating a knowledge base. - /// Format: `projects//knowledgeBases/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional. Not specified means `update all`. - /// Currently, only `display_name` can be updated, an InvalidArgument will be - /// returned for attempting to update other fields. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates an entity type in the specified agent. -/// -/// A builder for the *agent.entityTypes.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1EntityType; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1EntityType::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().agent_entity_types_create(req, "parent") -/// .language_code("nonumy") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypeCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1EntityType, + _request: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest, _parent: String, - _language_code: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1EntityType)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -5754,14 +6893,11 @@ impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.create", + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.batchDelete", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - for &field in ["alt", "parent", "languageCode"].iter() { + for &field in ["alt", "parent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5773,7 +6909,7 @@ impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeCreateCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest) -> ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> { self._request = new_value; self } - /// Required. The agent to create a entity type for. - /// Format: `projects//agent`. + /// Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// Optional. The language of entity synonyms defined in `entity_type`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5954,7 +7078,7 @@ impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentEntityTypeCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5974,7 +7098,264 @@ impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentEntityTypeCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.environments.users.sessions.entityTypes.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_entity_types_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6239,12 +7620,9 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> where } -/// Deletes the specified knowledge base. -/// -/// Note: The `projects.agent.knowledgeBases` resource is deprecated; -/// only use `projects.knowledgeBases`. +/// Returns the list of all entity types in the specified agent. /// -/// A builder for the *agent.knowledgeBases.delete* method supported by a *project* resource. +/// A builder for the *locations.agent.entityTypes.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -6269,29 +7647,33 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextGetCall<'a, C, A> where /// // 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().agent_knowledge_bases_delete("name") -/// .force(false) +/// let result = hub.projects().locations_agent_entity_types_list("parent") +/// .page_token("sea") +/// .page_size(-90) +/// .language_code("dolores") /// .doit(); /// # } /// ``` -pub struct ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> +pub struct ProjectLocationAgentEntityTypeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _name: String, - _force: Option, + _parent: String, + _page_token: Option, + _page_size: Option, + _language_code: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeListCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListEntityTypesResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -6300,14 +7682,20 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._force { - params.push(("force", value.to_string())); + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); } - for &field in ["alt", "name", "force"].iter() { + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6319,12 +7707,12 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+name}", "name")].iter() { + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -6339,7 +7727,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -6369,7 +7757,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -6422,23 +7810,41 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< } - /// Required. The name of the knowledge base to delete. - /// Format: `projects//knowledgeBases/`. + /// Required. The agent to list all entity types from. + /// Format: `projects//agent`. /// - /// Sets the *name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); self } - /// Optional. Force deletes the knowledge base. When set to true, any documents - /// in the knowledge base are also deleted. + /// Optional. The next_page_token value returned from a previous list request. /// - /// Sets the *force* query property to the given value. - pub fn force(mut self, new_value: bool) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { - self._force = Some(new_value); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -6447,7 +7853,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6472,7 +7878,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6492,563 +7898,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut< /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified document. -/// -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -/// -/// Operation -/// -/// A builder for the *agent.knowledgeBases.documents.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_knowledge_bases_documents_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the document to delete. - /// Format: `projects//knowledgeBases//documents/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified session entity type. -/// -/// A builder for the *agent.sessions.entityTypes.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_sessions_entity_types_patch(req, "name") -/// .update_mask("no") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionEntityTypePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1SessionEntityType, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypePatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The unique identifier of this session entity type. Format: - /// `projects//agent/sessions//entityTypes/`, or - /// `projects//agent/environments//users//sessions//entityTypes/`. - /// If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// - /// `` must be the display name of an existing entity - /// type in the same agent that will be overridden or supplemented. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional. The mask to control which fields get updated. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -7625,293 +8475,6 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseCreateCall<'a, C, A> where C: BorrowMut< } -/// Imports the specified agent from a ZIP file. -/// -/// Uploads new intents and entity types without deleting the existing ones. -/// Intents and entity types with the same name are replaced with the new -/// versions from ImportAgentRequest. -/// -/// -/// Operation -/// -/// A builder for the *agent.import* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1ImportAgentRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ImportAgentRequest::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().agent_import(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentImportCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1ImportAgentRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentImportCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.import", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:import"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ImportAgentRequest) -> ProjectAgentImportCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The project that the agent to import is associated with. - /// Format: `projects/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentImportCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentImportCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentImportCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentImportCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates/Creates multiple intents in the specified agent. /// /// Operation @@ -8194,288 +8757,6 @@ impl<'a, C, A> ProjectAgentIntentBatchUpdateCall<'a, C, A> where C: BorrowMut -/// -/// A builder for the *agent.intents.batchDelete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest::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().agent_intents_batch_delete(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentIntentBatchDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentIntentBatchDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentIntentBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.batchDelete", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents:batchDelete"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the agent to delete all entities types for. Format: - /// `projects//agent`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Retrieves the specified knowledge base. /// /// Note: The `projects.agent.knowledgeBases` resource is deprecated; @@ -8728,6 +9009,288 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseGetCall<'a, C, A> where C: BorrowMut +/// +/// A builder for the *locations.agent.entityTypes.entities.batchCreate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest::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_agent_entity_types_entities_batch_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.entities.batchCreate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchCreate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest) -> ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Restores the specified agent from a ZIP file. /// /// Replaces the current agent version with a new one. All the intents and @@ -9014,15 +9577,12 @@ impl<'a, C, A> ProjectAgentRestoreCall<'a, C, A> where C: BorrowMut +/// Operation /// -/// A builder for the *agent.knowledgeBases.documents.patch* method supported by a *project* resource. +/// A builder for the *locations.agent.train* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -9034,7 +9594,7 @@ impl<'a, C, A> ProjectAgentRestoreCall<'a, C, A> where C: BorrowMut ProjectAgentRestoreCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationAgentTrainCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Document, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The document resource name. - /// The name must be empty when creating a document. - /// Format: `projects//knowledgeBases//documents/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional. Not specified means `update all`. - /// Currently, only `display_name` can be updated, an InvalidArgument will be - /// returned for attempting to update other fields. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Processes a natural language query and returns structured, actionable data -/// as a result. This method is not idempotent, because it may cause contexts -/// and session entity types to be updated, which in turn might affect -/// results of future queries. -/// -/// A builder for the *agent.sessions.detectIntent* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1DetectIntentRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1DetectIntentRequest::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().agent_sessions_detect_intent(req, "session") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionDetectIntentCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1DetectIntentRequest, - _session: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionDetectIntentCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1DetectIntentResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.detectIntent", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("session", self._session.to_string())); - for &field in ["alt", "session"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+session}:detectIntent"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+session}", "session")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["session"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1DetectIntentRequest) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the session this query is sent to. Format: - /// `projects//agent/sessions/`, or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we are using - /// "-". It's up to the API caller to choose an appropriate `Session ID` and - /// `User Id`. They can be a random number or some type of user and session - /// identifiers (preferably hashed). The length of the `Session ID` and - /// `User ID` must not exceed 36 characters. - /// - /// Sets the *session* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn session(mut self, new_value: &str) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { - self._session = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionDetectIntentCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDetectIntentCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new document. -/// -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -/// -/// Operation -/// -/// A builder for the *knowledgeBases.documents.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Document; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Document::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().knowledge_bases_documents_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Document, + _request: GoogleCloudDialogflowV2beta1TrainAgentRequest, _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentTrainCall<'a, C, A> {} -impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentTrainCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -9675,7 +9643,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowM Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.documents.create", + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.train", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -9691,7 +9659,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/documents"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:train"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9814,18 +9782,18 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowM /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1TrainAgentRequest) -> ProjectLocationAgentTrainCall<'a, C, A> { self._request = new_value; self } - /// Required. The knoweldge base to create a document for. - /// Format: `projects//knowledgeBases/`. + /// Required. The project that the agent to train is associated with. + /// Format: `projects/`. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentTrainCall<'a, C, A> { self._parent = new_value.to_string(); self } @@ -9835,7 +9803,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowM /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentTrainCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -9860,7 +9828,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowM /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentTrainCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -9880,260 +9848,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowM /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified context. -/// -/// A builder for the *agent.sessions.contexts.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_sessions_contexts_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionContextDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionContextDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionContextDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the context to delete. Format: - /// `projects//agent/sessions//contexts/` - /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentTrainCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -10179,7 +9894,7 @@ impl<'a, C, A> ProjectAgentSessionContextDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_environments_users_sessions_contexts_patch(req, "name") -/// .update_mask("erat") +/// .update_mask("et") /// .doit(); /// # } /// ``` @@ -10366,6 +10081,13 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> wher /// /// If `Environment ID` is not specified, we assume default 'draft' /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` /// /// Sets the *name* path property to the given value. /// @@ -10445,9 +10167,9 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> wher } -/// Retrieves the specified agent. +/// Returns the list of all contexts in the specified session. /// -/// A builder for the *getAgent* method supported by a *project* resource. +/// A builder for the *locations.agent.environments.users.sessions.contexts.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -10472,27 +10194,31 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextPatchCall<'a, C, A> wher /// // 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().get_agent("parent") +/// let result = hub.projects().locations_agent_environments_users_sessions_contexts_list("parent") +/// .page_token("ipsum") +/// .page_size(-5) /// .doit(); /// # } /// ``` -pub struct ProjectGetAgentCall<'a, C, A> +pub struct ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, _parent: String, + _page_token: Option, + _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectGetAgentCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> {} -impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Agent)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListContextsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -10501,11 +10227,17 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.getAgent", + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.contexts.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10517,7 +10249,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10620,24 +10352,43 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, } - /// Required. The project that the agent to fetch is associated with. - /// Format: `projects/`. + /// Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectGetAgentCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> { self._parent = new_value.to_string(); self } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetAgentCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -10662,7 +10413,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectGetAgentCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -10682,7 +10433,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectGetAgentCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionContextListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -10695,6 +10446,10 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, /// Updates the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. /// /// A builder for the *agent.environments.users.sessions.entityTypes.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -10728,7 +10483,7 @@ impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_environments_users_sessions_entity_types_patch(req, "name") -/// .update_mask("eirmod") +/// .update_mask("duo") /// .doit(); /// # } /// ``` @@ -10994,9 +10749,9 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> w } -/// Creates/updates the specified agent. +/// Updates the specified context. /// -/// A builder for the *agent* method supported by a *project* resource. +/// A builder for the *locations.agent.sessions.contexts.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -11008,7 +10763,7 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> w /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Agent; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -11022,35 +10777,35 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> w /// // 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 = GoogleCloudDialogflowV2beta1Agent::default(); +/// let mut req = GoogleCloudDialogflowV2beta1Context::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().agent(req, "parent") -/// .update_mask("amet") +/// let result = hub.projects().locations_agent_sessions_contexts_patch(req, "name") +/// .update_mask("sea") /// .doit(); /// # } /// ``` -pub struct ProjectAgentCall<'a, C, A> +pub struct ProjectLocationAgentSessionContextPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Agent, - _parent: String, + _request: GoogleCloudDialogflowV2beta1Context, + _name: String, _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionContextPatchCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentSessionContextPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Agent)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -11059,14 +10814,14 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.contexts.patch", + http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); + params.push(("name", self._name.to_string())); if let Some(value) = self._update_mask { params.push(("updateMask", value.to_string())); } - for &field in ["alt", "parent", "updateMask"].iter() { + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11078,12 +10833,12 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+name}", "name")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -11098,7 +10853,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -11140,7 +10895,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -11201,25 +10956,40 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Agent) -> ProjectAgentCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectLocationAgentSessionContextPatchCall<'a, C, A> { self._request = new_value; self } - /// Required. The project of this agent. - /// Format: `projects/`. + /// Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentSessionContextPatchCall<'a, C, A> { + self._name = new_value.to_string(); self } /// Optional. The mask to control which fields get updated. /// /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationAgentSessionContextPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } @@ -11229,7 +10999,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionContextPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -11254,7 +11024,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionContextPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -11274,7 +11044,7 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionContextPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11286,294 +11056,18 @@ impl<'a, C, A> ProjectAgentCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes entity types in the specified agent. -/// -/// Operation +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. /// -/// A builder for the *agent.entityTypes.batchDelete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest::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().agent_entity_types_batch_delete(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.batchDelete", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes:batchDelete"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the agent to delete all entities types for. Format: - /// `projects//agent`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified knowledge base. -/// -/// Note: The `projects.agent.knowledgeBases` resource is deprecated; -/// only use `projects.knowledgeBases`. -/// -/// A builder for the *knowledgeBases.delete* method supported by a *project* resource. +/// A builder for the *operations.cancel* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -11598,25 +11092,23 @@ impl<'a, C, A> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> where C: BorrowMu /// // 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().knowledge_bases_delete("name") -/// .force(true) +/// let result = hub.projects().operations_cancel("name") /// .doit(); /// # } /// ``` -pub struct ProjectKnowledgeBaseDeleteCall<'a, C, A> +pub struct ProjectOperationCancelCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, _name: String, - _force: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectOperationCancelCall<'a, C, A> {} -impl<'a, C, A> ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -11629,14 +11121,11 @@ impl<'a, C, A> ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "dialogflow.projects.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); - if let Some(value) = self._force { - params.push(("force", value.to_string())); - } - for &field in ["alt", "name", "force"].iter() { + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11648,7 +11137,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut/knowledgeBases/`. + /// The name of the operation resource to be cancelled. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectOperationCancelCall<'a, C, A> { self._name = new_value.to_string(); self } - /// Optional. Force deletes the knowledge base. When set to true, any documents - /// in the knowledge base are also deleted. - /// - /// Sets the *force* query property to the given value. - pub fn force(mut self, new_value: bool) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { - self._force = Some(new_value); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectOperationCancelCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -11801,7 +11281,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectOperationCancelCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -11821,7 +11301,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectOperationCancelCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11833,12 +11313,13 @@ impl<'a, C, A> ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_knowledge_bases_list("parent") -/// .page_token("invidunt") -/// .page_size(-82) +/// let result = hub.projects().locations_agent_environments_users_sessions_entity_types_patch(req, "name") +/// .update_mask("erat") /// .doit(); /// # } /// ``` -pub struct ProjectAgentKnowledgeBaseListCall<'a, C, A> +pub struct ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, + _request: GoogleCloudDialogflowV2beta1SessionEntityType, + _name: String, + _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentKnowledgeBaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -11896,1730 +11382,14 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.list", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.patch", + http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/knowledgeBases"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The project to list of knowledge bases for. - /// Format: `projects/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. The next_page_token value returned from a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 10 and at most 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Exports the specified agent to a ZIP file. -/// -/// -/// Operation -/// -/// A builder for the *agent.export* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1ExportAgentRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ExportAgentRequest::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().agent_export(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentExportCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1ExportAgentRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentExportCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.export", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:export"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ExportAgentRequest) -> ProjectAgentExportCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The project that the agent to export is associated with. - /// Format: `projects/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentExportCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentExportCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentExportCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentExportCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Reloads the specified document from its specified source, content_uri or -/// content. The previously loaded content of the document will be deleted. -/// Note: Even when the content of the document has not changed, there still -/// may be side effects because of internal implementation changes. -/// -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -/// -/// Operation -/// -/// A builder for the *agent.knowledgeBases.documents.reload* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1ReloadDocumentRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ReloadDocumentRequest::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().agent_knowledge_bases_documents_reload(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1ReloadDocumentRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.reload", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}:reload"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ReloadDocumentRequest) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the document to reload. - /// Format: `projects//knowledgeBases//documents/` - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the list of all intents in the specified agent. -/// -/// A builder for the *agent.intents.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_intents_list("parent") -/// .page_token("et") -/// .page_size(-70) -/// .language_code("et") -/// .intent_view("eirmod") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentIntentListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, - _language_code: Option, - _intent_view: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentIntentListCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentIntentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListIntentsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - if let Some(value) = self._intent_view { - params.push(("intentView", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode", "intentView"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The agent to list all intents from. - /// Format: `projects//agent`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. The next_page_token value returned from a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 100 and at most 1000. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentIntentListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional. The language to list training phrases, parameters and rich - /// messages for. If not specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } - /// Optional. The resource view to apply to the returned intent. - /// - /// Sets the *intent view* query property to the given value. - pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { - self._intent_view = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates or creates multiple entities in the specified entity type. This -/// method does not affect entities in the entity type that aren't explicitly -/// specified in the request. -/// -/// Operation -/// -/// A builder for the *agent.entityTypes.entities.batchUpdate* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest::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().agent_entity_types_entities_batch_update(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchUpdate", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchUpdate"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the entity type to update or create entities in. - /// Format: `projects//agent/entityTypes/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a session entity type. -/// -/// If the specified session entity type already exists, overrides the -/// session entity type. -/// -/// A builder for the *agent.sessions.entityTypes.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_sessions_entity_types_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionEntityTypeCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1SessionEntityType, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The session to create a session entity type for. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users// - /// sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the latest state of a long-running operation. Clients can use this -/// method to poll the operation result at intervals as recommended by the API -/// service. -/// -/// A builder for the *operations.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().operations_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectOperationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectOperationGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.operations.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13663,6 +11433,17 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut ProjectOperationGetCall<'a, C, A> where C: BorrowMut ProjectOperationGetCall<'a, C, A> where C: BorrowMut ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or + /// `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectOperationGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { self._name = new_value.to_string(); self } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectOperationGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13775,7 +11585,7 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectOperationGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13795,7 +11605,7 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectOperationGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypePatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13807,9 +11617,9 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut ProjectOperationGetCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationAgentSessionContextDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _parent: String, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionContextDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentSessionContextDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -13863,11 +11673,11 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> whe Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.deleteContexts", + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.contexts.delete", http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13879,12 +11689,12 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> whe params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+name}", "name")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -13899,7 +11709,7 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> whe } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -13982,843 +11792,18 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> whe } - /// Required. The name of the session to delete all contexts from. Format: - /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates multiple new entities in the specified entity type. -/// -/// Operation -/// -/// A builder for the *agent.entityTypes.entities.batchCreate* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest::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().agent_entity_types_entities_batch_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchCreate", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchCreate"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the entity type to create entities in. Format: - /// `projects//agent/entityTypes/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the list of all entity types in the specified agent. -/// -/// A builder for the *agent.entityTypes.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_entity_types_list("parent") -/// .page_token("ea") -/// .page_size(-80) -/// .language_code("dolor") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypeListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, - _language_code: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeListCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListEntityTypesResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The agent to list all entity types from. - /// Format: `projects//agent`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. The next_page_token value returned from a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 100 and at most 1000. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional. The language to list entity synonyms for. If not specified, - /// the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the specified document. -/// -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -/// -/// A builder for the *agent.knowledgeBases.documents.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_knowledge_bases_documents_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Document)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the document to retrieve. - /// Format `projects//knowledgeBases//documents/`. + /// Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentSessionContextDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -14828,7 +11813,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> where C: Borro /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionContextDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -14853,7 +11838,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> where C: Borro /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionContextDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -14873,546 +11858,7 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> where C: Borro /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the specified knowledge base. -/// -/// Note: The `projects.agent.knowledgeBases` resource is deprecated; -/// only use `projects.knowledgeBases`. -/// -/// A builder for the *knowledgeBases.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().knowledge_bases_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectKnowledgeBaseGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectKnowledgeBaseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1KnowledgeBase)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the knowledge base to retrieve. - /// Format `projects//knowledgeBases/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a session entity type. -/// -/// If the specified session entity type already exists, overrides the -/// session entity type. -/// -/// A builder for the *agent.environments.users.sessions.entityTypes.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_environments_users_sessions_entity_types_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1SessionEntityType, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The session to create a session entity type for. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users// - /// sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionContextDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -15425,6 +11871,10 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> /// Returns the list of all session entity types in the specified session. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. /// /// A builder for the *agent.environments.users.sessions.entityTypes.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -15452,8 +11902,8 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_environments_users_sessions_entity_types_list("parent") -/// .page_token("amet.") -/// .page_size(-27) +/// .page_token("eirmod") +/// .page_size(-43) /// .doit(); /// # } /// ``` @@ -15702,893 +12152,6 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeListCall<'a, C, A> wh } -/// Processes a natural language query and returns structured, actionable data -/// as a result. This method is not idempotent, because it may cause contexts -/// and session entity types to be updated, which in turn might affect -/// results of future queries. -/// -/// A builder for the *agent.environments.users.sessions.detectIntent* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1DetectIntentRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1DetectIntentRequest::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().agent_environments_users_sessions_detect_intent(req, "session") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1DetectIntentRequest, - _session: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1DetectIntentResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.detectIntent", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("session", self._session.to_string())); - for &field in ["alt", "session"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+session}:detectIntent"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+session}", "session")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["session"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1DetectIntentRequest) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the session this query is sent to. Format: - /// `projects//agent/sessions/`, or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we are using - /// "-". It's up to the API caller to choose an appropriate `Session ID` and - /// `User Id`. They can be a random number or some type of user and session - /// identifiers (preferably hashed). The length of the `Session ID` and - /// `User ID` must not exceed 36 characters. - /// - /// Sets the *session* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn session(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { - self._session = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a context. -/// -/// If the specified context already exists, overrides the context. -/// -/// A builder for the *agent.environments.users.sessions.contexts.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Context::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().agent_environments_users_sessions_contexts_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Context, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The session to create a context for. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified entity type. -/// -/// A builder for the *agent.entityTypes.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1EntityType; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1EntityType::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().agent_entity_types_patch(req, "name") -/// .update_mask("sit") -/// .language_code("vero") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1EntityType, - _name: String, - _update_mask: Option, - _language_code: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypePatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1EntityType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - for &field in ["alt", "name", "updateMask", "languageCode"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1EntityType) -> ProjectAgentEntityTypePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The unique identifier of the entity type. - /// Required for EntityTypes.UpdateEntityType and - /// EntityTypes.BatchUpdateEntityTypes methods. - /// Format: `projects//agent/entityTypes/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional. The mask to control which fields get updated. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// Optional. The language of entity synonyms defined in `entity_type`. If not - /// specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns the list of all contexts in the specified session. /// /// A builder for the *agent.environments.users.sessions.contexts.list* method supported by a *project* resource. @@ -16617,8 +12180,8 @@ impl<'a, C, A> ProjectAgentEntityTypePatchCall<'a, C, A> where C: BorrowMut ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> where } -/// Deletes the specified entity type. +/// Returns the list of all contexts in the specified session. /// -/// A builder for the *agent.entityTypes.delete* method supported by a *project* resource. +/// A builder for the *agent.sessions.contexts.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -16894,27 +12457,31 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextListCall<'a, C, A> where /// // 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().agent_entity_types_delete("name") +/// let result = hub.projects().agent_sessions_contexts_list("parent") +/// .page_token("dolore") +/// .page_size(-37) /// .doit(); /// # } /// ``` -pub struct ProjectAgentEntityTypeDeleteCall<'a, C, A> +pub struct ProjectAgentSessionContextListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _name: String, + _parent: String, + _page_token: Option, + _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextListCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListContextsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -16923,776 +12490,17 @@ impl<'a, C, A> ProjectAgentEntityTypeDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the entity type to delete. - /// Format: `projects//agent/entityTypes/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the specified session entity type. -/// -/// A builder for the *agent.sessions.entityTypes.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_sessions_entity_types_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionEntityTypeGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the session entity type. Format: - /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the specified document. -/// -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -/// -/// A builder for the *knowledgeBases.documents.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().knowledge_bases_documents_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectKnowledgeBaseDocumentGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDocumentGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Document)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.documents.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the document to retrieve. - /// Format `projects//knowledgeBases//documents/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the specified intent. -/// -/// A builder for the *agent.intents.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_intents_get("name") -/// .language_code("consetetur") -/// .intent_view("dolore") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentIntentGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _language_code: Option, - _intent_view: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentIntentGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Intent)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.get", + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.list", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); } - if let Some(value) = self._intent_view { - params.push(("intentView", value.to_string())); + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); } - for &field in ["alt", "name", "languageCode", "intentView"].iter() { + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17704,12 +12512,12 @@ impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -17807,34 +12615,34 @@ impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut/agent/intents/`. + /// Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. /// - /// Sets the *name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._parent = new_value.to_string(); self } - /// Optional. The language to retrieve training phrases, parameters and rich - /// messages for. If not specified, the agent's default language is used. - /// [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. + /// Optional. The next_page_token value returned from a previous list request. /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); self } - /// Optional. The resource view to apply to the returned intent. + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. /// - /// Sets the *intent view* query property to the given value. - pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { - self._intent_view = Some(new_value.to_string()); + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionContextListCall<'a, C, A> { + self._page_size = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -17843,7 +12651,7 @@ impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut ProjectAgentIntentGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -17868,7 +12676,7 @@ impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentIntentGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -17888,7 +12696,7 @@ impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentIntentGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -17928,7 +12736,7 @@ impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeGetCall<'a, C, A> where C: BorrowMut ProjectAgentEntityTypeGetCall<'a, C, A> { @@ -18166,877 +12973,13 @@ impl<'a, C, A> ProjectAgentEntityTypeGetCall<'a, C, A> where C: BorrowMut +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. /// -/// A builder for the *agent.entityTypes.entities.batchDelete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest::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().agent_entity_types_entities_batch_delete(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchDelete", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchDelete"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the entity type to delete entries for. Format: - /// `projects//agent/entityTypes/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified context. -/// -/// A builder for the *agent.sessions.contexts.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Context::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().agent_sessions_contexts_patch(req, "name") -/// .update_mask("clita") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionContextPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Context, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionContextPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionContextPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectAgentSessionContextPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The unique identifier of the context. Format: - /// `projects//agent/sessions//contexts/`, - /// or `projects//agent/environments//users//sessions//contexts/`. - /// - /// The `Context ID` is always converted to lowercase, may only contain - /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. - /// - /// If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional. The mask to control which fields get updated. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new document. -/// -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -/// -/// Operation -/// -/// A builder for the *agent.knowledgeBases.documents.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Document; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Document::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().agent_knowledge_bases_documents_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Document, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/documents"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The knoweldge base to create a document for. - /// Format: `projects//knowledgeBases/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves the specified context. -/// -/// A builder for the *agent.sessions.contexts.get* method supported by a *project* resource. +/// A builder for the *locations.agent.sessions.entityTypes.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -19061,11 +13004,11 @@ impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> where C: Bo /// // 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().agent_sessions_contexts_get("name") +/// let result = hub.projects().locations_agent_sessions_entity_types_get("name") /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionContextGetCall<'a, C, A> +pub struct ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, @@ -19075,13 +13018,13 @@ pub struct ProjectAgentSessionContextGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentSessionContextGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -19090,7 +13033,7 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.get", + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.entityTypes.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -19209,18 +13152,18 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut/agent/sessions//contexts/` - /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is - /// not specified, we assume default 'draft' environment. If `User ID` is not - /// specified, we assume default '-' user. + /// Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -19230,7 +13173,7 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -19255,7 +13198,7 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -19275,7 +13218,7 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionEntityTypeGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -19287,9 +13230,16 @@ impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_sessions_delete_contexts("parent") +/// let result = hub.projects().locations_agent_sessions_entity_types_create(req, "parent") /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionDeleteContextCall<'a, C, A> +pub struct ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1SessionEntityType, _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentSessionDeleteContextCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -19343,9 +13300,9 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.deleteContexts", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.entityTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); for &field in ["alt", "parent"].iter() { if self._additional_params.contains_key(field) { @@ -19359,7 +13316,7 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -19391,276 +13348,6 @@ impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the session to delete all contexts from. Format: - /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified document. -/// -/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; -/// only use `projects.knowledgeBases.documents`. -/// -/// Operation -/// -/// A builder for the *knowledgeBases.documents.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Document; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Document::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().knowledge_bases_documents_patch(req, "name") -/// .update_mask("sanctus") -/// .doit(); -/// # } -/// ``` -pub struct ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Document, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.documents.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); let mut request_value_reader = { @@ -19691,7 +13378,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMu request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -19752,30 +13439,23 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMu /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> { self._request = new_value; self } - /// The document resource name. - /// The name must be empty when creating a document. - /// Format: `projects//knowledgeBases//documents/`. + /// Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. /// - /// Sets the *name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional. Not specified means `update all`. - /// Currently, only `display_name` can be updated, an InvalidArgument will be - /// returned for attempting to update other fields. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -19784,7 +13464,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMu /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -19809,7 +13489,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMu /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -19829,7 +13509,7 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMu /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionEntityTypeCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -19872,8 +13552,8 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().knowledge_bases_documents_list("parent") -/// .page_token("At") -/// .page_size(-86) +/// .page_token("duo") +/// .page_size(-21) /// .doit(); /// # } /// ``` @@ -20122,9 +13802,6 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentListCall<'a, C, A> where C: BorrowMut /// /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; /// only use `projects.knowledgeBases.documents`. -/// -/// Operation /// /// A builder for the *knowledgeBases.documents.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -20660,6 +14337,259 @@ impl<'a, C, A> ProjectAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut } +/// Deletes the specified context. +/// +/// A builder for the *locations.agent.environments.users.sessions.contexts.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_environments_users_sessions_contexts_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.contexts.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes the specified agent. /// /// A builder for the *deleteAgent* method supported by a *project* resource. @@ -20909,12 +14839,9 @@ impl<'a, C, A> ProjectDeleteAgentCall<'a, C, A> where C: BorrowMut +/// Updates the specified intent. /// -/// A builder for the *agent.train* method supported by a *project* resource. +/// A builder for the *agent.intents.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -20926,7 +14853,7 @@ impl<'a, C, A> ProjectDeleteAgentCall<'a, C, A> where C: BorrowMut ProjectDeleteAgentCall<'a, C, A> where C: BorrowMut +pub struct ProjectAgentIntentPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1TrainAgentRequest, - _parent: String, + _request: GoogleCloudDialogflowV2beta1Intent, + _name: String, + _update_mask: Option, + _language_code: Option, + _intent_view: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentTrainCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentIntentPatchCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Intent)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -20975,11 +14908,20 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.train", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "languageCode", "intentView"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -20991,12 +14933,12 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:train"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+name}", "name")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -21011,7 +14953,7 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -21053,7 +14995,7 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -21114,19 +15056,46 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1TrainAgentRequest) -> ProjectAgentTrainCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Intent) -> ProjectAgentIntentPatchCall<'a, C, A> { self._request = new_value; self } - /// Required. The project that the agent to train is associated with. - /// Format: `projects/`. + /// The unique identifier of this intent. + /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + /// methods. + /// Format: `projects//agent/intents/`. /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentTrainCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -21135,7 +15104,7 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentTrainCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -21160,7 +15129,7 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentTrainCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -21180,7 +15149,7 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentTrainCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -21192,9 +15161,15 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut } -/// Returns the list of all session entity types in the specified session. +/// Returns the list of agents. +/// +/// Since there is at most one conversational agent per project, this method is +/// useful primarily for listing all agents across projects the caller has +/// access to. One can achieve that with a wildcard project collection id "-". +/// Refer to [List +/// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). /// -/// A builder for the *agent.sessions.entityTypes.list* method supported by a *project* resource. +/// A builder for the *agent.search* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -21219,13 +15194,13 @@ impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut /// // 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().agent_sessions_entity_types_list("parent") -/// .page_token("nonumy") -/// .page_size(-29) +/// let result = hub.projects().agent_search("parent") +/// .page_token("dolor") +/// .page_size(-48) /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionEntityTypeListCall<'a, C, A> +pub struct ProjectAgentSearchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, @@ -21237,13 +15212,13 @@ pub struct ProjectAgentSessionEntityTypeListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentSearchCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SearchAgentsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -21252,7 +15227,7 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.list", + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.search", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -21274,7 +15249,7 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:search"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -21377,25 +15352,21 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu } - /// Required. The session to list all session entity types from. - /// Format: `projects//agent/sessions/` or - /// `projects//agent/environments//users// - /// sessions/`. - /// If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. + /// Required. The project to list agents from. + /// Format: `projects/`. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectAgentSearchCall<'a, C, A> { self._parent = new_value.to_string(); self } /// Optional. The next_page_token value returned from a previous list request. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSearchCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } @@ -21403,7 +15374,7 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu /// default 100 and at most 1000. /// /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSearchCall<'a, C, A> { self._page_size = Some(new_value); self } @@ -21413,7 +15384,7 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSearchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -21438,7 +15409,7 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentSearchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -21458,7 +15429,7 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentSearchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -21470,9 +15441,9 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu } -/// Retrieves the specified session entity type. +/// Deletes all active contexts in the specified session. /// -/// A builder for the *agent.environments.users.sessions.entityTypes.get* method supported by a *project* resource. +/// A builder for the *agent.environments.users.sessions.deleteContexts* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -21497,27 +15468,27 @@ impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMu /// // 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().agent_environments_users_sessions_entity_types_get("name") +/// let result = hub.projects().agent_environments_users_sessions_delete_contexts("parent") /// .doit(); /// # } /// ``` -pub struct ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> +pub struct ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _name: String, + _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -21526,11 +15497,285 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.deleteContexts", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified intent. +/// +/// A builder for the *locations.agent.intents.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Intent; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Intent::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_agent_intents_patch(req, "name") +/// .update_mask("consetetur") +/// .language_code("amet.") +/// .intent_view("voluptua.") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentIntentPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Intent, + _name: String, + _update_mask: Option, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentIntentPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentIntentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Intent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.intents.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "languageCode", "intentView"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -21574,6 +15819,319 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Intent) -> ProjectLocationAgentIntentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The unique identifier of this intent. + /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents + /// methods. + /// Format: `projects//agent/intents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentIntentPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationAgentIntentPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentIntentPatchCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectLocationAgentIntentPatchCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentIntentPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentIntentPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentIntentPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all knowledge bases of the specified agent. +/// +/// Note: The `projects.agent.knowledgeBases` resource is deprecated; +/// only use `projects.knowledgeBases`. +/// +/// A builder for the *knowledgeBases.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().knowledge_bases_list("parent") +/// .page_token("gubergren") +/// .page_size(-20) +/// .doit(); +/// # } +/// ``` +pub struct ProjectKnowledgeBaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseListCall<'a, C, A> {} + +impl<'a, C, A> ProjectKnowledgeBaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/knowledgeBases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + loop { @@ -21645,19 +16203,30 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe } - /// Required. The name of the session entity type. Format: - /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. + /// Required. The project to list of knowledge bases for. + /// Format: `projects/`. /// - /// Sets the *name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectKnowledgeBaseListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectKnowledgeBaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 10 and at most 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectKnowledgeBaseListCall<'a, C, A> { + self._page_size = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -21666,7 +16235,7 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -21691,7 +16260,7 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -21711,7 +16280,7 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -21728,7 +16297,7 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe /// Note: The `projects.agent.knowledgeBases` resource is deprecated; /// only use `projects.knowledgeBases`. /// -/// A builder for the *knowledgeBases.patch* method supported by a *project* resource. +/// A builder for the *agent.knowledgeBases.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -21759,12 +16328,12 @@ impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> whe /// // 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().knowledge_bases_patch(req, "name") -/// .update_mask("eirmod") +/// let result = hub.projects().agent_knowledge_bases_patch(req, "name") +/// .update_mask("vero") /// .doit(); /// # } /// ``` -pub struct ProjectKnowledgeBasePatchCall<'a, C, A> +pub struct ProjectAgentKnowledgeBasePatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, @@ -21776,9 +16345,9 @@ pub struct ProjectKnowledgeBasePatchCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectKnowledgeBasePatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBasePatchCall<'a, C, A> {} -impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectAgentKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -21791,7 +16360,7 @@ impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.patch", + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.patch", http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -21933,7 +16502,7 @@ impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBasePatchCall<'a, C, A> { + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1KnowledgeBase) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { self._request = new_value; self } @@ -21945,7 +16514,7 @@ impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBasePatchCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -21954,7 +16523,7 @@ impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBasePatchCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } @@ -21964,7 +16533,7 @@ impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut ProjectKnowledgeBasePatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -21989,7 +16558,7 @@ impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectKnowledgeBasePatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -22009,7 +16578,2185 @@ impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectKnowledgeBasePatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBasePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all active contexts in the specified session. +/// +/// A builder for the *agent.sessions.deleteContexts* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_delete_contexts("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionDeleteContextCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionDeleteContextCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.deleteContexts", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionDeleteContextCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDeleteContextCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified document. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. +/// +/// A builder for the *agent.knowledgeBases.documents.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_knowledge_bases_documents_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the document to delete. + /// Format: `projects//knowledgeBases//documents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a context. +/// +/// If the specified context already exists, overrides the context. +/// +/// A builder for the *locations.agent.sessions.contexts.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Context::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_agent_sessions_contexts_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionContextCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Context, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionContextCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.contexts.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectLocationAgentSessionContextCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentSessionContextCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionContextCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionContextCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionContextCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the fulfillment. +/// +/// A builder for the *locations.agent.getFulfillment* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_get_fulfillment("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentGetFulfillmentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentGetFulfillmentCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentGetFulfillmentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Fulfillment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.getFulfillment", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the fulfillment. + /// Format: `projects//agent/fulfillment`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentGetFulfillmentCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentGetFulfillmentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentGetFulfillmentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentGetFulfillmentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates/updates the specified agent. +/// +/// A builder for the *setAgent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Agent; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Agent::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().set_agent(req, "parent") +/// .update_mask("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSetAgentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Agent, + _parent: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSetAgentCall<'a, C, A> {} + +impl<'a, C, A> ProjectSetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Agent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.setAgent", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "parent", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Agent) -> ProjectSetAgentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project of this agent. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectSetAgentCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectSetAgentCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSetAgentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSetAgentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSetAgentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes entity types in the specified agent. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.batchDelete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest::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().agent_entity_types_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.batchDelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes:batchDelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Imports the specified agent from a ZIP file. +/// +/// Uploads new intents and entity types without deleting the existing ones. +/// Intents and entity types with the same name are replaced with the new +/// versions from ImportAgentRequest. +/// +/// +/// Operation +/// +/// A builder for the *agent.import* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1ImportAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ImportAgentRequest::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().agent_import(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1ImportAgentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentImportCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:import"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ImportAgentRequest) -> ProjectAgentImportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to import is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentImportCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentImportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all knowledge bases of the specified agent. +/// +/// Note: The `projects.agent.knowledgeBases` resource is deprecated; +/// only use `projects.knowledgeBases`. +/// +/// A builder for the *agent.knowledgeBases.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_knowledge_bases_list("parent") +/// .page_token("duo") +/// .page_size(-82) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentKnowledgeBaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentKnowledgeBaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/knowledgeBases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project to list of knowledge bases for. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 10 and at most 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -22304,6 +19051,13853 @@ impl<'a, C, A> ProjectKnowledgeBaseCreateCall<'a, C, A> where C: BorrowMut +/// +/// A builder for the *locations.agent.entityTypes.entities.batchUpdate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest::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_agent_entity_types_entities_batch_update(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.entities.batchUpdate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchUpdate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest) -> ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to update or create entities in. + /// Format: `projects//agent/entityTypes/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates or creates multiple entities in the specified entity type. This +/// method does not affect entities in the entity type that aren't explicitly +/// specified in the request. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.entities.batchUpdate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest::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().agent_entity_types_entities_batch_update(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchUpdate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchUpdate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to update or create entities in. + /// Format: `projects//agent/entityTypes/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the fulfillment. +/// +/// A builder for the *locations.agent.fulfillment* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Fulfillment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Fulfillment::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_agent_fulfillment(req, "name") +/// .update_mask("takimata") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentFulfillmentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Fulfillment, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentFulfillmentCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentFulfillmentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Fulfillment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.fulfillment", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Fulfillment) -> ProjectLocationAgentFulfillmentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentFulfillmentCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. The mask to control which fields get updated. If the mask is not + /// present, all fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationAgentFulfillmentCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentFulfillmentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentFulfillmentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentFulfillmentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all session entity types in the specified session. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.sessions.entityTypes.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_entity_types_list("parent") +/// .page_token("kasd") +/// .page_size(-7) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates/Creates multiple intents in the specified agent. +/// +/// Operation +/// +/// A builder for the *locations.agent.intents.batchUpdate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest::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_agent_intents_batch_update(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.intents.batchUpdate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents:batchUpdate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest) -> ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to update or create intents in. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentIntentBatchUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified knowledge base. +/// +/// Note: The `projects.agent.knowledgeBases` resource is deprecated; +/// only use `projects.knowledgeBases`. +/// +/// A builder for the *knowledgeBases.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().knowledge_bases_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectKnowledgeBaseGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectKnowledgeBaseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1KnowledgeBase)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the knowledge base to retrieve. + /// Format `projects//knowledgeBases/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified intent and its direct or indirect followup intents. +/// +/// A builder for the *locations.agent.intents.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_intents_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentIntentDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentIntentDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentIntentDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.intents.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the intent to delete. If this intent has direct or + /// indirect followup intents, we also delete them. + /// + /// Format: `projects//agent/intents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentIntentDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentIntentDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentIntentDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentIntentDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a session entity type. +/// +/// If the specified session entity type already exists, overrides the +/// session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *locations.agent.environments.users.sessions.entityTypes.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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_agent_environments_users_sessions_entity_types_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1SessionEntityType, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Processes a natural language query and returns structured, actionable data +/// as a result. This method is not idempotent, because it may cause contexts +/// and session entity types to be updated, which in turn might affect +/// results of future queries. +/// +/// A builder for the *agent.environments.users.sessions.detectIntent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1DetectIntentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1DetectIntentRequest::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().agent_environments_users_sessions_detect_intent(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1DetectIntentRequest, + _session: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1DetectIntentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.detectIntent", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+session}:detectIntent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1DetectIntentRequest) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + /// + /// Sets the *session* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn session(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._session = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified entity type. +/// +/// A builder for the *agent.entityTypes.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1EntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1EntityType::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().agent_entity_types_patch(req, "name") +/// .update_mask("rebum.") +/// .language_code("dolore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1EntityType, + _name: String, + _update_mask: Option, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1EntityType) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The unique identifier of the entity type. + /// Required for EntityTypes.UpdateEntityType and + /// EntityTypes.BatchUpdateEntityTypes methods. + /// Format: `projects//agent/entityTypes/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified entity type. +/// +/// A builder for the *agent.entityTypes.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type to delete. + /// Format: `projects//agent/entityTypes/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Exports the specified agent to a ZIP file. +/// +/// +/// Operation +/// +/// A builder for the *locations.agent.export* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1ExportAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ExportAgentRequest::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_agent_export(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentExportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1ExportAgentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentExportCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.export", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:export"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ExportAgentRequest) -> ProjectLocationAgentExportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to export is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentExportCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentExportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentExportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentExportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes intents in the specified agent. +/// +/// Operation +/// +/// A builder for the *locations.agent.intents.batchDelete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest::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_agent_intents_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.intents.batchDelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents:batchDelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest) -> ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentIntentBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified context. +/// +/// A builder for the *agent.sessions.contexts.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Context::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().agent_sessions_contexts_patch(req, "name") +/// .update_mask("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Context, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. +/// +/// A builder for the *locations.operations.cancel* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an entity type in the specified agent. +/// +/// A builder for the *locations.agent.entityTypes.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1EntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1EntityType::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_agent_entity_types_create(req, "parent") +/// .language_code("sed") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1EntityType, + _parent: String, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1EntityType) -> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The agent to create a entity type for. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified document. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. +/// +/// A builder for the *knowledgeBases.documents.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Document; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Document::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().knowledge_bases_documents_patch(req, "name") +/// .update_mask("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Document, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.documents.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The document resource name. + /// The name must be empty when creating a document. + /// Format: `projects//knowledgeBases//documents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. Not specified means `update all`. + /// Currently, only `display_name` can be updated, an InvalidArgument will be + /// returned for attempting to update other fields. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseDocumentPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Trains the specified agent. +/// +/// +/// Operation +/// +/// A builder for the *agent.train* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1TrainAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1TrainAgentRequest::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().agent_train(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentTrainCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1TrainAgentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentTrainCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentTrainCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.train", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:train"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1TrainAgentRequest) -> ProjectAgentTrainCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to train is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentTrainCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentTrainCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentTrainCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentTrainCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified context. +/// +/// A builder for the *agent.sessions.contexts.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_contexts_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified intent. +/// +/// A builder for the *agent.intents.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_intents_get("name") +/// .language_code("sea") +/// .intent_view("labore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Intent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "name", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the intent. + /// Format: `projects//agent/intents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentGetCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all active contexts in the specified session. +/// +/// A builder for the *locations.agent.sessions.deleteContexts* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_sessions_delete_contexts("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionDeleteContextCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionDeleteContextCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.deleteContexts", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentSessionDeleteContextCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionDeleteContextCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionDeleteContextCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionDeleteContextCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all session entity types in the specified session. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *locations.agent.sessions.entityTypes.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_sessions_entity_types_list("parent") +/// .page_token("dolores") +/// .page_size(-98) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.entityTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The session to list all session entity types from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionEntityTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified context. +/// +/// A builder for the *locations.agent.sessions.contexts.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_sessions_contexts_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionContextGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionContextGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.contexts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentSessionContextGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionContextGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionContextGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionContextGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified context. +/// +/// A builder for the *agent.environments.users.sessions.contexts.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_contexts_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context to delete. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.environments.users.sessions.entityTypes.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_environments_users_sessions_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates/updates the specified agent. +/// +/// A builder for the *locations.setAgent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Agent; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Agent::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_set_agent(req, "parent") +/// .update_mask("amet") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationSetAgentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Agent, + _parent: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationSetAgentCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationSetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Agent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.setAgent", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "parent", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Agent) -> ProjectLocationSetAgentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project of this agent. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationSetAgentCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationSetAgentCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationSetAgentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationSetAgentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationSetAgentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.sessions.entityTypes.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_sessions_entity_types_patch(req, "name") +/// .update_mask("clita") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1SessionEntityType, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or + /// `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates/Creates multiple entity types in the specified agent. +/// +/// Operation +/// +/// A builder for the *locations.agent.entityTypes.batchUpdate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest::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_agent_entity_types_batch_update(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.batchUpdate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes:batchUpdate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest) -> ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to update or create entity types in. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeBatchUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified intent. +/// +/// A builder for the *locations.agent.intents.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_intents_get("name") +/// .language_code("est") +/// .intent_view("clita") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentIntentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentIntentGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentIntentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Intent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.intents.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "name", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the intent. + /// Format: `projects//agent/intents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentIntentGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentIntentGetCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectLocationAgentIntentGetCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentIntentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentIntentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentIntentGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Processes a natural language query and returns structured, actionable data +/// as a result. This method is not idempotent, because it may cause contexts +/// and session entity types to be updated, which in turn might affect +/// results of future queries. +/// +/// A builder for the *agent.sessions.detectIntent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1DetectIntentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1DetectIntentRequest::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().agent_sessions_detect_intent(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionDetectIntentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1DetectIntentRequest, + _session: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionDetectIntentCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1DetectIntentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.detectIntent", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+session}:detectIntent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1DetectIntentRequest) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + /// + /// Sets the *session* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn session(mut self, new_value: &str) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { + self._session = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionDetectIntentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionDetectIntentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionDetectIntentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new document. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. +/// +/// A builder for the *knowledgeBases.documents.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Document; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Document::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().knowledge_bases_documents_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Document, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.documents.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/documents"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The knoweldge base to create a document for. + /// Format: `projects//knowledgeBases/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseDocumentCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified knowledge base. +/// +/// Note: The `projects.agent.knowledgeBases` resource is deprecated; +/// only use `projects.knowledgeBases`. +/// +/// A builder for the *knowledgeBases.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().knowledge_bases_delete("name") +/// .force(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectKnowledgeBaseDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _force: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._force { + params.push(("force", value.to_string())); + } + for &field in ["alt", "name", "force"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the knowledge base to delete. + /// Format: `projects//knowledgeBases/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. Force deletes the knowledge base. When set to true, any documents + /// in the knowledge base are also deleted. + /// + /// Sets the *force* query property to the given value. + pub fn force(mut self, new_value: bool) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { + self._force = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// A builder for the *locations.operations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_operations_list("name") +/// .page_token("duo") +/// .page_size(-93) +/// .filter("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified entity type. +/// +/// A builder for the *locations.agent.entityTypes.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_entity_types_get("name") +/// .language_code("ea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "name", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type. + /// Format: `projects//agent/entityTypes/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeGetCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *operations.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified agent. +/// +/// A builder for the *getAgent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().get_agent("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetAgentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetAgentCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Agent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.getAgent", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project that the agent to fetch is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectGetAgentCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetAgentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGetAgentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetAgentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *locations.agent.environments.users.sessions.entityTypes.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_environments_users_sessions_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets agent validation result. Agent validation is performed during +/// training time and is updated automatically when training is completed. +/// +/// A builder for the *agent.getValidationResult* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_get_validation_result("parent") +/// .language_code("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentGetValidationResultCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentGetValidationResultCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentGetValidationResultCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ValidationResult)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.getValidationResult", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent/validationResult"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project that the agent is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentGetValidationResultCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The language for which you want a validation result. If not + /// specified, the agent's default language is used. [Many + /// languages](https://cloud.google.com/dialogflow/docs/reference/language) + /// are supported. Note: languages must be enabled in the agent before they can + /// be used. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentGetValidationResultCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentGetValidationResultCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentGetValidationResultCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentGetValidationResultCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a session entity type. +/// +/// If the specified session entity type already exists, overrides the +/// session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.environments.users.sessions.entityTypes.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_environments_users_sessions_entity_types_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1SessionEntityType, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.entityTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionEntityTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified context. +/// +/// A builder for the *agent.sessions.contexts.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_contexts_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionContextGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionContextGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentSessionContextGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionContextGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionContextGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a context. +/// +/// If the specified context already exists, overrides the context. +/// +/// A builder for the *agent.environments.users.sessions.contexts.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Context::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().agent_environments_users_sessions_contexts_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Context, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.environments.users.sessions.contexts.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified entity type. +/// +/// A builder for the *locations.agent.entityTypes.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1EntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1EntityType::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_agent_entity_types_patch(req, "name") +/// .update_mask("eirmod") +/// .language_code("At") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1EntityType, + _name: String, + _update_mask: Option, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "name", "updateMask", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1EntityType) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The unique identifier of the entity type. + /// Required for EntityTypes.UpdateEntityType and + /// EntityTypes.BatchUpdateEntityTypes methods. + /// Format: `projects//agent/entityTypes/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a context. +/// +/// If the specified context already exists, overrides the context. +/// +/// A builder for the *locations.agent.environments.users.sessions.contexts.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Context::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_agent_environments_users_sessions_contexts_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Context, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.contexts.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a context for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionContextCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all active contexts in the specified session. +/// +/// A builder for the *locations.agent.environments.users.sessions.deleteContexts* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_environments_users_sessions_delete_contexts("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.deleteContexts", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session to delete all contexts from. Format: + /// `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionDeleteContextCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all contexts in the specified session. +/// +/// A builder for the *locations.agent.sessions.contexts.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_sessions_contexts_list("parent") +/// .page_token("sit") +/// .page_size(-8) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionContextListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionContextListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListContextsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.contexts.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/contexts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The session to list all contexts from. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentSessionContextListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAgentSessionContextListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAgentSessionContextListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionContextListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionContextListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionContextListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an entity type in the specified agent. +/// +/// A builder for the *agent.entityTypes.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1EntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1EntityType::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().agent_entity_types_create(req, "parent") +/// .language_code("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1EntityType, + _parent: String, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1EntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1EntityType) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The agent to create a entity type for. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes entities in the specified entity type. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.entities.batchDelete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest::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().agent_entity_types_entities_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchDelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchDelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to delete entries for. Format: + /// `projects//agent/entityTypes/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new document. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. +/// +/// A builder for the *agent.knowledgeBases.documents.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Document; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Document::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().agent_knowledge_bases_documents_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Document, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/documents"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The knoweldge base to create a document for. + /// Format: `projects//knowledgeBases/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified knowledge base. +/// +/// Note: The `projects.agent.knowledgeBases` resource is deprecated; +/// only use `projects.knowledgeBases`. +/// +/// A builder for the *knowledgeBases.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1KnowledgeBase; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1KnowledgeBase::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().knowledge_bases_patch(req, "name") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectKnowledgeBasePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1KnowledgeBase, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectKnowledgeBasePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectKnowledgeBasePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1KnowledgeBase)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1KnowledgeBase) -> ProjectKnowledgeBasePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The knowledge base resource name. + /// The name must be empty when creating a knowledge base. + /// Format: `projects//knowledgeBases/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBasePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. Not specified means `update all`. + /// Currently, only `display_name` can be updated, an InvalidArgument will be + /// returned for attempting to update other fields. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectKnowledgeBasePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBasePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBasePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBasePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *locations.agent.environments.users.sessions.entityTypes.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_environments_users_sessions_entity_types_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.entityTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionEntityTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns the list of all documents of the knowledge base. /// /// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; @@ -22335,8 +32929,8 @@ impl<'a, C, A> ProjectKnowledgeBaseCreateCall<'a, C, A> where C: BorrowMut ProjectAgentKnowledgeBaseDocumentListCall<'a, C, A> where C: Borr } -/// Updates the specified intent. -/// -/// A builder for the *agent.intents.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Intent; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Intent::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().agent_intents_patch(req, "name") -/// .update_mask("aliquyam") -/// .language_code("eos") -/// .intent_view("tempor") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentIntentPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _request: GoogleCloudDialogflowV2beta1Intent, - _name: String, - _update_mask: Option, - _language_code: Option, - _intent_view: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentIntentPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentIntentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Intent)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - if let Some(value) = self._intent_view { - params.push(("intentView", value.to_string())); - } - for &field in ["alt", "name", "updateMask", "languageCode", "intentView"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Intent) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The unique identifier of this intent. - /// Required for Intents.UpdateIntent and Intents.BatchUpdateIntents - /// methods. - /// Format: `projects//agent/intents/`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Optional. The mask to control which fields get updated. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// Optional. The language of training phrases, parameters and rich messages - /// defined in `intent`. If not specified, the agent's default language is - /// used. [Many - /// languages](https://cloud.google.com/dialogflow/docs/reference/language) - /// are supported. Note: languages must be enabled in the agent before they can - /// be used. - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } - /// Optional. The resource view to apply to the returned intent. - /// - /// Sets the *intent view* query property to the given value. - pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._intent_view = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified session entity type. -/// -/// A builder for the *agent.sessions.entityTypes.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_sessions_entity_types_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the entity type to delete. Format: - /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' - /// environment. If `User ID` is not specified, we assume default '-' user. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns the list of agents. -/// -/// Since there is at most one conversational agent per project, this method is -/// useful primarily for listing all agents across projects the caller has -/// access to. One can achieve that with a wildcard project collection id "-". -/// Refer to [List -/// Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). -/// -/// A builder for the *agent.search* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dialogflow2_beta1::Dialogflow; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().agent_search("parent") -/// .page_token("ipsum") -/// .page_size(-31) -/// .doit(); -/// # } -/// ``` -pub struct ProjectAgentSearchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAgentSearchCall<'a, C, A> {} - -impl<'a, C, A> ProjectAgentSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SearchAgentsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.search", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:search"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The project to list agents from. - /// Format: `projects/`. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSearchCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. The next_page_token value returned from a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentSearchCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 100 and at most 1000. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentSearchCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSearchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAgentSearchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAgentSearchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Deletes the specified intent and its direct or indirect followup intents. /// /// A builder for the *agent.intents.delete* method supported by a *project* resource. @@ -23688,6 +33426,2541 @@ impl<'a, C, A> ProjectAgentIntentDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1DetectIntentRequest::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_agent_sessions_detect_intent(req, "session") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionDetectIntentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1DetectIntentRequest, + _session: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionDetectIntentCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1DetectIntentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.detectIntent", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+session}:detectIntent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+session}", "session")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["session"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1DetectIntentRequest) -> ProjectLocationAgentSessionDetectIntentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. + /// + /// Sets the *session* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn session(mut self, new_value: &str) -> ProjectLocationAgentSessionDetectIntentCall<'a, C, A> { + self._session = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionDetectIntentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionDetectIntentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionDetectIntentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified knowledge base. +/// +/// Note: The `projects.agent.knowledgeBases` resource is deprecated; +/// only use `projects.knowledgeBases`. +/// +/// A builder for the *agent.knowledgeBases.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_knowledge_bases_delete("name") +/// .force(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _force: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._force { + params.push(("force", value.to_string())); + } + for &field in ["alt", "name", "force"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the knowledge base to delete. + /// Format: `projects//knowledgeBases/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. Force deletes the knowledge base. When set to true, any documents + /// in the knowledge base are also deleted. + /// + /// Sets the *force* query property to the given value. + pub fn force(mut self, new_value: bool) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { + self._force = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Restores the specified agent from a ZIP file. +/// +/// Replaces the current agent version with a new one. All the intents and +/// entity types in the older version are deleted. +/// +/// +/// Operation +/// +/// A builder for the *locations.agent.restore* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1RestoreAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1RestoreAgentRequest::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_agent_restore(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentRestoreCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1RestoreAgentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentRestoreCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentRestoreCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.restore", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:restore"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1RestoreAgentRequest) -> ProjectLocationAgentRestoreCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to restore is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentRestoreCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentRestoreCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentRestoreCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentRestoreCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes entities in the specified entity type. +/// +/// Operation +/// +/// A builder for the *locations.agent.entityTypes.entities.batchDelete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest::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_agent_entity_types_entities_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.entities.batchDelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchDelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest) -> ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to delete entries for. Format: + /// `projects//agent/entityTypes/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeEntityBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an intent in the specified agent. +/// +/// A builder for the *locations.agent.intents.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Intent; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Intent::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_agent_intents_create(req, "parent") +/// .language_code("dolor") +/// .intent_view("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentIntentCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Intent, + _parent: String, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentIntentCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentIntentCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Intent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.intents.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "parent", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Intent) -> ProjectLocationAgentIntentCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The agent to create a intent for. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentIntentCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentIntentCreateCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectLocationAgentIntentCreateCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentIntentCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentIntentCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentIntentCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified document. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. +/// +/// A builder for the *agent.knowledgeBases.documents.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Document; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Document::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().agent_knowledge_bases_documents_patch(req, "name") +/// .update_mask("vero") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Document, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Document) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The document resource name. + /// The name must be empty when creating a document. + /// Format: `projects//knowledgeBases//documents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. Not specified means `update all`. + /// Currently, only `display_name` can be updated, an InvalidArgument will be + /// returned for attempting to update other fields. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified context. +/// +/// A builder for the *locations.agent.environments.users.sessions.contexts.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Context; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Context::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_agent_environments_users_sessions_contexts_patch(req, "name") +/// .update_mask("sed") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Context, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.contexts.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Context) -> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of the context. Format: + /// `projects//agent/sessions//contexts/`, + /// or `projects//agent/environments//users//sessions//contexts/`. + /// + /// The `Context ID` is always converted to lowercase, may only contain + /// characters in a-zA-Z0-9_-% and may be at most 250 bytes long. + /// + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// The following context names are reserved for internal use by Dialogflow. + /// You should not use these contexts or create contexts with these names: + /// + /// * `__system_counters__` + /// * `*_id_dialog_context` + /// * `*_dialog_params_size` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionContextPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified entity type. +/// +/// A builder for the *locations.agent.entityTypes.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.entityTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type to delete. + /// Format: `projects//agent/entityTypes/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEntityTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified agent. +/// +/// A builder for the *locations.deleteAgent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_delete_agent("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDeleteAgentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDeleteAgentCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDeleteAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.deleteAgent", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project that the agent to delete is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDeleteAgentCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDeleteAgentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDeleteAgentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDeleteAgentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Reloads the specified document from its specified source, content_uri or /// content. The previously loaded content of the document will be deleted. /// Note: Even when the content of the document has not changed, there still @@ -23695,9 +35968,5780 @@ impl<'a, C, A> ProjectAgentIntentDeleteCall<'a, C, A> where C: BorrowMut +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ReloadDocumentRequest::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().agent_knowledge_bases_documents_reload(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1ReloadDocumentRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.reload", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}:reload"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ReloadDocumentRequest) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the document to reload. + /// Format: `projects//knowledgeBases//documents/` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentReloadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all intents in the specified agent. +/// +/// A builder for the *agent.intents.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_intents_list("parent") +/// .page_token("vero") +/// .page_size(-99) +/// .language_code("takimata") +/// .intent_view("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListIntentsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The agent to list all intents from. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentIntentListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectAgentIntentListCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *locations.agent.sessions.entityTypes.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_sessions_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.entityTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionEntityTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a session entity type. +/// +/// If the specified session entity type already exists, overrides the +/// session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.sessions.entityTypes.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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().agent_sessions_entity_types_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1SessionEntityType, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The session to create a session entity type for. + /// Format: `projects//agent/sessions/` or + /// `projects//agent/environments//users// + /// sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we assume + /// default '-' user. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates multiple new entities in the specified entity type. +/// +/// Operation +/// +/// A builder for the *agent.entityTypes.entities.batchCreate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest::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().agent_entity_types_entities_batch_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.entities.batchCreate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entities:batchCreate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the entity type to create entities in. Format: + /// `projects//agent/entityTypes/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeEntityBatchCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all intents in the specified agent. +/// +/// A builder for the *locations.agent.intents.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_intents_list("parent") +/// .page_token("invidunt") +/// .page_size(-15) +/// .language_code("labore") +/// .intent_view("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentIntentListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _language_code: Option, + _intent_view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentIntentListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentIntentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListIntentsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.intents.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._intent_view { + params.push(("intentView", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode", "intentView"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The agent to list all intents from. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentIntentListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAgentIntentListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAgentIntentListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectLocationAgentIntentListCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// Optional. The resource view to apply to the returned intent. + /// + /// Sets the *intent view* query property to the given value. + pub fn intent_view(mut self, new_value: &str) -> ProjectLocationAgentIntentListCall<'a, C, A> { + self._intent_view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentIntentListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentIntentListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentIntentListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified document. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. +/// +/// A builder for the *agent.knowledgeBases.documents.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_knowledge_bases_documents_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Document)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.knowledgeBases.documents.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the document to retrieve. + /// Format `projects//knowledgeBases//documents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentKnowledgeBaseDocumentGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes intents in the specified agent. +/// +/// Operation +/// +/// A builder for the *agent.intents.batchDelete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest::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().agent_intents_batch_delete(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentIntentBatchDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentIntentBatchDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentIntentBatchDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.intents.batchDelete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/intents:batchDelete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the agent to delete all entities types for. Format: + /// `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentIntentBatchDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the fulfillment. +/// +/// A builder for the *agent.getFulfillment* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_get_fulfillment("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentGetFulfillmentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentGetFulfillmentCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentGetFulfillmentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Fulfillment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.getFulfillment", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the fulfillment. + /// Format: `projects//agent/fulfillment`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentGetFulfillmentCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentGetFulfillmentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentGetFulfillmentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentGetFulfillmentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified context. +/// +/// A builder for the *locations.agent.environments.users.sessions.contexts.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_agent_environments_users_sessions_contexts_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Context)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.contexts.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the context. Format: + /// `projects//agent/sessions//contexts/` + /// or `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is + /// not specified, we assume default 'draft' environment. If `User ID` is not + /// specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionContextGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Imports the specified agent from a ZIP file. +/// +/// Uploads new intents and entity types without deleting the existing ones. +/// Intents and entity types with the same name are replaced with the new +/// versions from ImportAgentRequest. +/// +/// +/// Operation +/// +/// A builder for the *locations.agent.import* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1ImportAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ImportAgentRequest::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_agent_import(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1ImportAgentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentImportCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:import"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ImportAgentRequest) -> ProjectLocationAgentImportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to import is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAgentImportCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentImportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified document. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. +/// +/// A builder for the *knowledgeBases.documents.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().knowledge_bases_documents_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectKnowledgeBaseDocumentGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectKnowledgeBaseDocumentGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Document)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.knowledgeBases.documents.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the document to retrieve. + /// Format `projects//knowledgeBases//documents/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectKnowledgeBaseDocumentGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *locations.operations.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the fulfillment. +/// +/// A builder for the *agent.updateFulfillment* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1Fulfillment; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1Fulfillment::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().agent_update_fulfillment(req, "name") +/// .update_mask("accusam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentUpdateFulfillmentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1Fulfillment, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentUpdateFulfillmentCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentUpdateFulfillmentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Fulfillment)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.updateFulfillment", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1Fulfillment) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of the fulfillment. + /// Format: `projects//agent/fulfillment`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. The mask to control which fields get updated. If the mask is not + /// present, all fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentUpdateFulfillmentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified agent. +/// +/// A builder for the *locations.getAgent* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_get_agent("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationGetAgentCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationGetAgentCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationGetAgentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1Agent)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.getAgent", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project that the agent to fetch is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationGetAgentCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationGetAgentCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationGetAgentCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationGetAgentCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.sessions.entityTypes.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_entity_types_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the session entity type. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// A builder for the *operations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().operations_list("name") +/// .page_token("aliquyam") +/// .page_size(-94) +/// .filter("ea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Exports the specified agent to a ZIP file. +/// +/// +/// Operation +/// +/// A builder for the *agent.export* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1ExportAgentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1ExportAgentRequest::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().agent_export(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentExportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1ExportAgentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentExportCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunningOperation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.export", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/agent:export"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1ExportAgentRequest) -> ProjectAgentExportCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project that the agent to export is associated with. + /// Format: `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentExportCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentExportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentExportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentExportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of all entity types in the specified agent. +/// +/// A builder for the *agent.entityTypes.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_entity_types_list("parent") +/// .page_token("sed") +/// .page_size(-99) +/// .language_code("sanctus") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentEntityTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _parent: String, + _page_token: Option, + _page_size: Option, + _language_code: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentEntityTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentEntityTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListEntityTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.entityTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/entityTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The agent to list all entity types from. + /// Format: `projects//agent`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The next_page_token value returned from a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of items to return in a single page. By + /// default 100 and at most 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Optional. The language used to access language-specific data. + /// If not specified, the agent's default language is used. + /// For more information, see + /// [Multilingual intent and entity + /// data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentEntityTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentEntityTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentEntityTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *agent.sessions.entityTypes.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().agent_sessions_entity_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.entityTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the entity type to delete. Format: + /// `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAgentSessionEntityTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the specified session entity type. +/// +/// This method doesn't work with Google Assistant integration. +/// Contact Dialogflow support if you need to use session entities +/// with Google Assistant integration. +/// +/// A builder for the *locations.agent.sessions.entityTypes.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dialogflow2_beta1 as dialogflow2_beta1; +/// use dialogflow2_beta1::GoogleCloudDialogflowV2beta1SessionEntityType; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dialogflow2_beta1::Dialogflow; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1SessionEntityType::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_agent_sessions_entity_types_patch(req, "name") +/// .update_mask("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dialogflow, + _request: GoogleCloudDialogflowV2beta1SessionEntityType, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1SessionEntityType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.sessions.entityTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1SessionEntityType) -> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The unique identifier of this session entity type. Format: + /// `projects//agent/sessions//entityTypes/`, or + /// `projects//agent/environments//users//sessions//entityTypes/`. + /// If `Environment ID` is not specified, we assume default 'draft' + /// environment. If `User ID` is not specified, we assume default '-' user. + /// + /// `` must be the display name of an existing entity + /// type in the same agent that will be overridden or supplemented. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. The mask to control which fields get updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentSessionEntityTypePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reloads the specified document from its specified source, content_uri or +/// content. The previously loaded content of the document will be deleted. +/// Note: Even when the content of the document has not changed, there still +/// may be side effects because of internal implementation changes. +/// +/// Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; +/// only use `projects.knowledgeBases.documents`. /// /// A builder for the *knowledgeBases.documents.reload* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -24012,8 +42056,8 @@ impl<'a, C, A> ProjectKnowledgeBaseDocumentReloadCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().agent_intents_create(req, "parent") -/// .language_code("ut") -/// .intent_view("justo") +/// .language_code("labore") +/// .intent_view("gubergren") /// .doit(); /// # } /// ``` @@ -24205,12 +42249,11 @@ impl<'a, C, A> ProjectAgentIntentCreateCall<'a, C, A> where C: BorrowMut ProjectAgentIntentCreateCall<'a, C, A> { @@ -24287,9 +42330,12 @@ impl<'a, C, A> ProjectAgentIntentCreateCall<'a, C, A> where C: BorrowMut ProjectAgentIntentCreateCall<'a, C, A> where C: BorrowMut ProjectAgentIntentCreateCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Dialogflow::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudDialogflowV2beta1DetectIntentRequest::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().agent_sessions_contexts_list("parent") -/// .page_token("amet") -/// .page_size(-23) +/// let result = hub.projects().locations_agent_environments_users_sessions_detect_intent(req, "session") /// .doit(); /// # } /// ``` -pub struct ProjectAgentSessionContextListCall<'a, C, A> +pub struct ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dialogflow, - _parent: String, - _page_token: Option, - _page_size: Option, + _request: GoogleCloudDialogflowV2beta1DetectIntentRequest, + _session: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAgentSessionContextListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> {} -impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1ListContextsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudDialogflowV2beta1DetectIntentResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -24347,17 +42396,11 @@ impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dialogflow.projects.agent.sessions.contexts.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + dlg.begin(MethodInfo { id: "dialogflow.projects.locations.agent.environments.users.sessions.detectIntent", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("session", self._session.to_string())); + for &field in ["alt", "session"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -24369,12 +42412,12 @@ impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["session"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -24401,6 +42444,17 @@ impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut/agent/sessions/` or - /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - /// default 'draft' environment. If `User ID` is not specified, we assume - /// default '-' user. /// - /// Sets the *parent* path property to the given value. + /// Sets the *request* property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn request(mut self, new_value: GoogleCloudDialogflowV2beta1DetectIntentRequest) -> ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._request = new_value; self } - /// Optional. The next_page_token value returned from a previous list request. + /// Required. The name of the session this query is sent to. Format: + /// `projects//agent/sessions/`, or + /// `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + /// default 'draft' environment. If `User ID` is not specified, we are using + /// "-". It's up to the API caller to choose an appropriate `Session ID` and + /// `User Id`. They can be a random number or some type of user and session + /// identifiers (preferably hashed). The length of the `Session ID` and + /// `User ID` must not exceed 36 characters. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectAgentSessionContextListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of items to return in a single page. By - /// default 100 and at most 1000. + /// Sets the *session* path property to the given value. /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectAgentSessionContextListCall<'a, C, A> { - self._page_size = Some(new_value); + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn session(mut self, new_value: &str) -> ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { + self._session = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -24508,7 +42563,7 @@ impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut ProjectAgentSessionContextListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -24533,7 +42588,7 @@ impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAgentSessionContextListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -24553,7 +42608,7 @@ impl<'a, C, A> ProjectAgentSessionContextListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAgentSessionContextListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationAgentEnvironmentUserSessionDetectIntentCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/digitalassetlinks1-cli/Cargo.toml b/gen/digitalassetlinks1-cli/Cargo.toml index 8f1448b7c4..e199f44288 100644 --- a/gen/digitalassetlinks1-cli/Cargo.toml +++ b/gen/digitalassetlinks1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-digitalassetlinks1-cli" -version = "1.0.12+20190619" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with digitalassetlinks (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/digitalassetlinks1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-digitalassetlinks1] path = "../digitalassetlinks1" -version = "1.0.12+20190619" +version = "1.0.13+20200331" diff --git a/gen/digitalassetlinks1-cli/README.md b/gen/digitalassetlinks1-cli/README.md index 783c2c0813..3f4af648a0 100644 --- a/gen/digitalassetlinks1-cli/README.md +++ b/gen/digitalassetlinks1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *digitalassetlinks* API at revision *20190619*. The CLI is at version *1.0.12*. +This documentation was generated from the *digitalassetlinks* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash digitalassetlinks1 [options] diff --git a/gen/digitalassetlinks1-cli/mkdocs.yml b/gen/digitalassetlinks1-cli/mkdocs.yml index 0ab24855ab..55c81f03da 100644 --- a/gen/digitalassetlinks1-cli/mkdocs.yml +++ b/gen/digitalassetlinks1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: digitalassetlinks v1.0.12+20190619 +site_name: digitalassetlinks v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-digitalassetlinks1-cli site_description: A complete library to interact with digitalassetlinks (protocol v1) diff --git a/gen/digitalassetlinks1-cli/src/main.rs b/gen/digitalassetlinks1-cli/src/main.rs index b582d9026c..eac70c41c4 100644 --- a/gen/digitalassetlinks1-cli/src/main.rs +++ b/gen/digitalassetlinks1-cli/src/main.rs @@ -371,7 +371,7 @@ fn main() { let mut app = App::new("digitalassetlinks1") .author("Sebastian Thiel ") - .version("1.0.12+20190619") + .version("1.0.13+20200331") .about("Discovers relationships between online assets such as websites or mobile apps.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_digitalassetlinks1_cli") .arg(Arg::with_name("folder") diff --git a/gen/digitalassetlinks1/Cargo.toml b/gen/digitalassetlinks1/Cargo.toml index cdf3d05fa1..45200fe415 100644 --- a/gen/digitalassetlinks1/Cargo.toml +++ b/gen/digitalassetlinks1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-digitalassetlinks1" -version = "1.0.12+20190619" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with digitalassetlinks (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/digitalassetlinks1" homepage = "https://developers.google.com/digital-asset-links/" -documentation = "https://docs.rs/google-digitalassetlinks1/1.0.12+20190619" +documentation = "https://docs.rs/google-digitalassetlinks1/1.0.13+20200331" license = "MIT" keywords = ["digitalassetlinks", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/digitalassetlinks1/README.md b/gen/digitalassetlinks1/README.md index c4ac499100..1548cc3354 100644 --- a/gen/digitalassetlinks1/README.md +++ b/gen/digitalassetlinks1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-digitalassetlinks1` library allows access to all features of the *Google digitalassetlinks* service. -This documentation was generated from *digitalassetlinks* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *digitalassetlinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *digitalassetlinks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *digitalassetlinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *digitalassetlinks* *v1* API can be found at the [official documentation site](https://developers.google.com/digital-asset-links/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/struct.Digitalassetlinks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/struct.Digitalassetlinks.html) ... * assetlinks - * [*check*](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/struct.AssetlinkCheckCall.html) -* [statements](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/struct.Statement.html) - * [*list*](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/struct.StatementListCall.html) + * [*check*](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/struct.AssetlinkCheckCall.html) +* [statements](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/struct.Statement.html) + * [*list*](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/struct.StatementListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/struct.Digitalassetlinks.html)** +* **[Hub](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/struct.Digitalassetlinks.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.Part.html)** + * **[Parts](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-digitalassetlinks1/1.0.12+20190619/google_digitalassetlinks1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-digitalassetlinks1/1.0.13+20200331/google_digitalassetlinks1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/digitalassetlinks1/src/lib.rs b/gen/digitalassetlinks1/src/lib.rs index ef288310a9..99edcb04d9 100644 --- a/gen/digitalassetlinks1/src/lib.rs +++ b/gen/digitalassetlinks1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *digitalassetlinks* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *digitalassetlinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *digitalassetlinks* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *digitalassetlinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *digitalassetlinks* *v1* API can be found at the //! [official documentation site](https://developers.google.com/digital-asset-links/). @@ -311,7 +311,7 @@ impl<'a, C, A> Digitalassetlinks Digitalassetlinks { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://digitalassetlinks.googleapis.com/".to_string(), _root_url: "https://digitalassetlinks.googleapis.com/".to_string(), } @@ -325,7 +325,7 @@ impl<'a, C, A> Digitalassetlinks } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/discovery1-cli/Cargo.toml b/gen/discovery1-cli/Cargo.toml index 15104f4dd3..014cd90020 100644 --- a/gen/discovery1-cli/Cargo.toml +++ b/gen/discovery1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-discovery1-cli" -version = "1.0.12+20190619" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with discovery (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/discovery1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-discovery1] path = "../discovery1" -version = "1.0.12+20190619" +version = "1.0.13+20200402" diff --git a/gen/discovery1-cli/README.md b/gen/discovery1-cli/README.md index b20082bee0..583d012263 100644 --- a/gen/discovery1-cli/README.md +++ b/gen/discovery1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *discovery* API at revision *20190619*. The CLI is at version *1.0.12*. +This documentation was generated from the *discovery* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash discovery1 [options] diff --git a/gen/discovery1-cli/mkdocs.yml b/gen/discovery1-cli/mkdocs.yml index 5a567cdf94..58767c40ff 100644 --- a/gen/discovery1-cli/mkdocs.yml +++ b/gen/discovery1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: discovery v1.0.12+20190619 +site_name: discovery v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-discovery1-cli site_description: A complete library to interact with discovery (protocol v1) diff --git a/gen/discovery1-cli/src/main.rs b/gen/discovery1-cli/src/main.rs index 42016f37ba..2fe55fd093 100644 --- a/gen/discovery1-cli/src/main.rs +++ b/gen/discovery1-cli/src/main.rs @@ -303,7 +303,7 @@ fn main() { let mut app = App::new("discovery1") .author("Sebastian Thiel ") - .version("1.0.12+20190619") + .version("1.0.13+20200402") .about("Provides information about other Google APIs, such as what APIs are available, the resource, and method details for each API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_discovery1_cli") .arg(Arg::with_name("folder") diff --git a/gen/discovery1/Cargo.toml b/gen/discovery1/Cargo.toml index ddc6358c64..50c0becb7f 100644 --- a/gen/discovery1/Cargo.toml +++ b/gen/discovery1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-discovery1" -version = "1.0.12+20190619" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with discovery (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/discovery1" homepage = "https://developers.google.com/discovery/" -documentation = "https://docs.rs/google-discovery1/1.0.12+20190619" +documentation = "https://docs.rs/google-discovery1/1.0.13+20200402" license = "MIT" keywords = ["discovery", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/discovery1/README.md b/gen/discovery1/README.md index b96c741075..73225e3ebb 100644 --- a/gen/discovery1/README.md +++ b/gen/discovery1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-discovery1` library allows access to all features of the *Google discovery* service. -This documentation was generated from *discovery* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *discovery* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *discovery* *v1* API can be found at the [official documentation site](https://developers.google.com/discovery/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/struct.Discovery.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/struct.Discovery.html) ... * apis - * [*get rest*](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/struct.ApiGetRestCall.html) and [*list*](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/struct.ApiListCall.html) + * [*get rest*](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/struct.ApiGetRestCall.html) and [*list*](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/struct.ApiListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/struct.Discovery.html)** +* **[Hub](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/struct.Discovery.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.Part.html)** + * **[Parts](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -124,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -144,29 +144,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-discovery1/1.0.12+20190619/google_discovery1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-discovery1/1.0.13+20200402/google_discovery1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/discovery1/src/lib.rs b/gen/discovery1/src/lib.rs index 1efd585512..c88a2bf611 100644 --- a/gen/discovery1/src/lib.rs +++ b/gen/discovery1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *discovery* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *discovery* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *discovery:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *discovery* *v1* API can be found at the //! [official documentation site](https://developers.google.com/discovery/). @@ -295,7 +295,7 @@ impl<'a, C, A> Discovery Discovery { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/discovery/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -306,7 +306,7 @@ impl<'a, C, A> Discovery } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dlp2-cli/Cargo.toml b/gen/dlp2-cli/Cargo.toml index f6af72767a..dcc7641e22 100644 --- a/gen/dlp2-cli/Cargo.toml +++ b/gen/dlp2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dlp2-cli" -version = "1.0.12+20190629" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with DLP (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dlp2] path = "../dlp2" -version = "1.0.12+20190629" +version = "1.0.13+20200405" diff --git a/gen/dlp2-cli/README.md b/gen/dlp2-cli/README.md index 0a55caec98..13c618933a 100644 --- a/gen/dlp2-cli/README.md +++ b/gen/dlp2-cli/README.md @@ -25,12 +25,14 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *DLP* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *DLP* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash dlp2 [options] info-types list [-p ]... [-o ] + locations + info-types-list [-p ]... [-o ] organizations deidentify-templates-create (-r )... [-p ]... [-o ] deidentify-templates-delete [-p ]... [-o ] @@ -42,6 +44,21 @@ dlp2 [options] inspect-templates-get [-p ]... [-o ] inspect-templates-list [-p ]... [-o ] inspect-templates-patch (-r )... [-p ]... [-o ] + locations-deidentify-templates-create (-r )... [-p ]... [-o ] + locations-deidentify-templates-delete [-p ]... [-o ] + locations-deidentify-templates-get [-p ]... [-o ] + locations-deidentify-templates-list [-p ]... [-o ] + locations-deidentify-templates-patch (-r )... [-p ]... [-o ] + locations-inspect-templates-create (-r )... [-p ]... [-o ] + locations-inspect-templates-delete [-p ]... [-o ] + locations-inspect-templates-get [-p ]... [-o ] + locations-inspect-templates-list [-p ]... [-o ] + locations-inspect-templates-patch (-r )... [-p ]... [-o ] + locations-stored-info-types-create (-r )... [-p ]... [-o ] + locations-stored-info-types-delete [-p ]... [-o ] + locations-stored-info-types-get [-p ]... [-o ] + locations-stored-info-types-list [-p ]... [-o ] + locations-stored-info-types-patch (-r )... [-p ]... [-o ] stored-info-types-create (-r )... [-p ]... [-o ] stored-info-types-delete [-p ]... [-o ] stored-info-types-get [-p ]... [-o ] @@ -73,7 +90,39 @@ dlp2 [options] job-triggers-get [-p ]... [-o ] job-triggers-list [-p ]... [-o ] job-triggers-patch (-r )... [-p ]... [-o ] - locations-content-deidentify (-r )... [-p ]... [-o ] + locations-content-deidentify (-r )... [-p ]... [-o ] + locations-content-inspect (-r )... [-p ]... [-o ] + locations-content-reidentify (-r )... [-p ]... [-o ] + locations-deidentify-templates-create (-r )... [-p ]... [-o ] + locations-deidentify-templates-delete [-p ]... [-o ] + locations-deidentify-templates-get [-p ]... [-o ] + locations-deidentify-templates-list [-p ]... [-o ] + locations-deidentify-templates-patch (-r )... [-p ]... [-o ] + locations-dlp-jobs-cancel (-r )... [-p ]... [-o ] + locations-dlp-jobs-create (-r )... [-p ]... [-o ] + locations-dlp-jobs-delete [-p ]... [-o ] + locations-dlp-jobs-finish (-r )... [-p ]... [-o ] + locations-dlp-jobs-get [-p ]... [-o ] + locations-dlp-jobs-hybrid-inspect (-r )... [-p ]... [-o ] + locations-dlp-jobs-list [-p ]... [-o ] + locations-image-redact (-r )... [-p ]... [-o ] + locations-inspect-templates-create (-r )... [-p ]... [-o ] + locations-inspect-templates-delete [-p ]... [-o ] + locations-inspect-templates-get [-p ]... [-o ] + locations-inspect-templates-list [-p ]... [-o ] + locations-inspect-templates-patch (-r )... [-p ]... [-o ] + locations-job-triggers-activate (-r )... [-p ]... [-o ] + locations-job-triggers-create (-r )... [-p ]... [-o ] + locations-job-triggers-delete [-p ]... [-o ] + locations-job-triggers-get [-p ]... [-o ] + locations-job-triggers-hybrid-inspect (-r )... [-p ]... [-o ] + locations-job-triggers-list [-p ]... [-o ] + locations-job-triggers-patch (-r )... [-p ]... [-o ] + locations-stored-info-types-create (-r )... [-p ]... [-o ] + locations-stored-info-types-delete [-p ]... [-o ] + locations-stored-info-types-get [-p ]... [-o ] + locations-stored-info-types-list [-p ]... [-o ] + locations-stored-info-types-patch (-r )... [-p ]... [-o ] stored-info-types-create (-r )... [-p ]... [-o ] stored-info-types-delete [-p ]... [-o ] stored-info-types-get [-p ]... [-o ] diff --git a/gen/dlp2-cli/mkdocs.yml b/gen/dlp2-cli/mkdocs.yml index 5f463f4dac..773555f88a 100644 --- a/gen/dlp2-cli/mkdocs.yml +++ b/gen/dlp2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: DLP v1.0.12+20190629 +site_name: DLP v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-dlp2-cli site_description: A complete library to interact with DLP (protocol v2) @@ -10,6 +10,7 @@ site_dir: build_html pages: - ['index.md', 'Home'] - ['info-types_list.md', 'Info Types', 'List'] +- ['locations_info-types-list.md', 'Locations', 'Info Types List'] - ['organizations_deidentify-templates-create.md', 'Organizations', 'Deidentify Templates Create'] - ['organizations_deidentify-templates-delete.md', 'Organizations', 'Deidentify Templates Delete'] - ['organizations_deidentify-templates-get.md', 'Organizations', 'Deidentify Templates Get'] @@ -20,6 +21,21 @@ pages: - ['organizations_inspect-templates-get.md', 'Organizations', 'Inspect Templates Get'] - ['organizations_inspect-templates-list.md', 'Organizations', 'Inspect Templates List'] - ['organizations_inspect-templates-patch.md', 'Organizations', 'Inspect Templates Patch'] +- ['organizations_locations-deidentify-templates-create.md', 'Organizations', 'Locations Deidentify Templates Create'] +- ['organizations_locations-deidentify-templates-delete.md', 'Organizations', 'Locations Deidentify Templates Delete'] +- ['organizations_locations-deidentify-templates-get.md', 'Organizations', 'Locations Deidentify Templates Get'] +- ['organizations_locations-deidentify-templates-list.md', 'Organizations', 'Locations Deidentify Templates List'] +- ['organizations_locations-deidentify-templates-patch.md', 'Organizations', 'Locations Deidentify Templates Patch'] +- ['organizations_locations-inspect-templates-create.md', 'Organizations', 'Locations Inspect Templates Create'] +- ['organizations_locations-inspect-templates-delete.md', 'Organizations', 'Locations Inspect Templates Delete'] +- ['organizations_locations-inspect-templates-get.md', 'Organizations', 'Locations Inspect Templates Get'] +- ['organizations_locations-inspect-templates-list.md', 'Organizations', 'Locations Inspect Templates List'] +- ['organizations_locations-inspect-templates-patch.md', 'Organizations', 'Locations Inspect Templates Patch'] +- ['organizations_locations-stored-info-types-create.md', 'Organizations', 'Locations Stored Info Types Create'] +- ['organizations_locations-stored-info-types-delete.md', 'Organizations', 'Locations Stored Info Types Delete'] +- ['organizations_locations-stored-info-types-get.md', 'Organizations', 'Locations Stored Info Types Get'] +- ['organizations_locations-stored-info-types-list.md', 'Organizations', 'Locations Stored Info Types List'] +- ['organizations_locations-stored-info-types-patch.md', 'Organizations', 'Locations Stored Info Types Patch'] - ['organizations_stored-info-types-create.md', 'Organizations', 'Stored Info Types Create'] - ['organizations_stored-info-types-delete.md', 'Organizations', 'Stored Info Types Delete'] - ['organizations_stored-info-types-get.md', 'Organizations', 'Stored Info Types Get'] @@ -51,6 +67,38 @@ pages: - ['projects_job-triggers-list.md', 'Projects', 'Job Triggers List'] - ['projects_job-triggers-patch.md', 'Projects', 'Job Triggers Patch'] - ['projects_locations-content-deidentify.md', 'Projects', 'Locations Content Deidentify'] +- ['projects_locations-content-inspect.md', 'Projects', 'Locations Content Inspect'] +- ['projects_locations-content-reidentify.md', 'Projects', 'Locations Content Reidentify'] +- ['projects_locations-deidentify-templates-create.md', 'Projects', 'Locations Deidentify Templates Create'] +- ['projects_locations-deidentify-templates-delete.md', 'Projects', 'Locations Deidentify Templates Delete'] +- ['projects_locations-deidentify-templates-get.md', 'Projects', 'Locations Deidentify Templates Get'] +- ['projects_locations-deidentify-templates-list.md', 'Projects', 'Locations Deidentify Templates List'] +- ['projects_locations-deidentify-templates-patch.md', 'Projects', 'Locations Deidentify Templates Patch'] +- ['projects_locations-dlp-jobs-cancel.md', 'Projects', 'Locations Dlp Jobs Cancel'] +- ['projects_locations-dlp-jobs-create.md', 'Projects', 'Locations Dlp Jobs Create'] +- ['projects_locations-dlp-jobs-delete.md', 'Projects', 'Locations Dlp Jobs Delete'] +- ['projects_locations-dlp-jobs-finish.md', 'Projects', 'Locations Dlp Jobs Finish'] +- ['projects_locations-dlp-jobs-get.md', 'Projects', 'Locations Dlp Jobs Get'] +- ['projects_locations-dlp-jobs-hybrid-inspect.md', 'Projects', 'Locations Dlp Jobs Hybrid Inspect'] +- ['projects_locations-dlp-jobs-list.md', 'Projects', 'Locations Dlp Jobs List'] +- ['projects_locations-image-redact.md', 'Projects', 'Locations Image Redact'] +- ['projects_locations-inspect-templates-create.md', 'Projects', 'Locations Inspect Templates Create'] +- ['projects_locations-inspect-templates-delete.md', 'Projects', 'Locations Inspect Templates Delete'] +- ['projects_locations-inspect-templates-get.md', 'Projects', 'Locations Inspect Templates Get'] +- ['projects_locations-inspect-templates-list.md', 'Projects', 'Locations Inspect Templates List'] +- ['projects_locations-inspect-templates-patch.md', 'Projects', 'Locations Inspect Templates Patch'] +- ['projects_locations-job-triggers-activate.md', 'Projects', 'Locations Job Triggers Activate'] +- ['projects_locations-job-triggers-create.md', 'Projects', 'Locations Job Triggers Create'] +- ['projects_locations-job-triggers-delete.md', 'Projects', 'Locations Job Triggers Delete'] +- ['projects_locations-job-triggers-get.md', 'Projects', 'Locations Job Triggers Get'] +- ['projects_locations-job-triggers-hybrid-inspect.md', 'Projects', 'Locations Job Triggers Hybrid Inspect'] +- ['projects_locations-job-triggers-list.md', 'Projects', 'Locations Job Triggers List'] +- ['projects_locations-job-triggers-patch.md', 'Projects', 'Locations Job Triggers Patch'] +- ['projects_locations-stored-info-types-create.md', 'Projects', 'Locations Stored Info Types Create'] +- ['projects_locations-stored-info-types-delete.md', 'Projects', 'Locations Stored Info Types Delete'] +- ['projects_locations-stored-info-types-get.md', 'Projects', 'Locations Stored Info Types Get'] +- ['projects_locations-stored-info-types-list.md', 'Projects', 'Locations Stored Info Types List'] +- ['projects_locations-stored-info-types-patch.md', 'Projects', 'Locations Stored Info Types Patch'] - ['projects_stored-info-types-create.md', 'Projects', 'Stored Info Types Create'] - ['projects_stored-info-types-delete.md', 'Projects', 'Stored Info Types Delete'] - ['projects_stored-info-types-get.md', 'Projects', 'Stored Info Types Get'] diff --git a/gen/dlp2-cli/src/main.rs b/gen/dlp2-cli/src/main.rs index 2953b573e5..fd0a90b47f 100644 --- a/gen/dlp2-cli/src/main.rs +++ b/gen/dlp2-cli/src/main.rs @@ -49,6 +49,68 @@ impl<'n> Engine<'n> { fn _info_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.info_types().list(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, + "language-code" => { + call = call.language_code(value.unwrap_or("")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "language-code", "location-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _locations_info_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.locations().info_types_list(opt.value_of("location-id").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { @@ -133,9 +195,10 @@ impl<'n> Engine<'n> { "deidentify-template.description" => Some(("deidentifyTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deidentify-template.name" => Some(("deidentifyTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deidentify-template.create-time" => Some(("deidentifyTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "name", "template-id", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "location-id", "name", "template-id", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -314,6 +377,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -327,7 +393,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "location-id", "page-size"].iter().map(|v|*v)); v } )); } } @@ -474,6 +540,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template.update-time" => Some(("inspectTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template.display-name" => Some(("inspectTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template.description" => Some(("inspectTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -487,7 +554,7 @@ impl<'n> Engine<'n> { "inspect-template.name" => Some(("inspectTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "template-id", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "template-id", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -666,6 +733,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -679,7 +749,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "location-id", "page-size"].iter().map(|v|*v)); v } )); } } @@ -809,6 +879,1073 @@ impl<'n> Engine<'n> { } } + fn _organizations_locations_deidentify_templates_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "deidentify-template.update-time" => Some(("deidentifyTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.display-name" => Some(("deidentifyTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.description" => Some(("deidentifyTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.name" => Some(("deidentifyTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.create-time" => Some(("deidentifyTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "location-id", "name", "template-id", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateDeidentifyTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().locations_deidentify_templates_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_deidentify_templates_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_deidentify_templates_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_deidentify_templates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_deidentify_templates_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_deidentify_templates_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_deidentify_templates_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_deidentify_templates_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "deidentify-template.update-time" => Some(("deidentifyTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.display-name" => Some(("deidentifyTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.description" => Some(("deidentifyTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.name" => Some(("deidentifyTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.create-time" => Some(("deidentifyTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "name", "update-mask", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().locations_deidentify_templates_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_inspect_templates_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.update-time" => Some(("inspectTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.display-name" => Some(("inspectTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.description" => Some(("inspectTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.exclude-info-types" => Some(("inspectTemplate.inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.content-options" => Some(("inspectTemplate.inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-template.inspect-config.include-quote" => Some(("inspectTemplate.inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-request" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-item" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.min-likelihood" => Some(("inspectTemplate.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.create-time" => Some(("inspectTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.name" => Some(("inspectTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "template-id", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateInspectTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().locations_inspect_templates_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_inspect_templates_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_inspect_templates_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_inspect_templates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_inspect_templates_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_inspect_templates_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_inspect_templates_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_inspect_templates_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "inspect-template.update-time" => Some(("inspectTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.display-name" => Some(("inspectTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.description" => Some(("inspectTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.exclude-info-types" => Some(("inspectTemplate.inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.content-options" => Some(("inspectTemplate.inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-template.inspect-config.include-quote" => Some(("inspectTemplate.inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-request" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-item" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.min-likelihood" => Some(("inspectTemplate.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.create-time" => Some(("inspectTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.name" => Some(("inspectTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "update-mask", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2UpdateInspectTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().locations_inspect_templates_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_stored_info_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "stored-info-type-id" => Some(("storedInfoTypeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.project-id" => Some(("config.largeCustomDictionary.bigQueryField.table.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.table-id" => Some(("config.largeCustomDictionary.bigQueryField.table.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "location-id", "name", "output-path", "path", "pattern", "project-id", "regex", "stored-info-type-id", "table", "table-id", "url", "word-list", "words"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateStoredInfoTypeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().locations_stored_info_types_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_stored_info_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_stored_info_types_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_stored_info_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_stored_info_types_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_stored_info_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_stored_info_types_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_stored_info_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.project-id" => Some(("config.largeCustomDictionary.bigQueryField.table.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.table-id" => Some(("config.largeCustomDictionary.bigQueryField.table.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "name", "output-path", "path", "pattern", "project-id", "regex", "table", "table-id", "update-mask", "url", "word-list", "words"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().locations_stored_info_types_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _organizations_stored_info_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -832,9 +1969,14 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "stored-info-type-id" => Some(("storedInfoTypeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -842,7 +1984,7 @@ impl<'n> Engine<'n> { "config.large-custom-dictionary.big-query-field.table.table-id" => Some(("config.largeCustomDictionary.bigQueryField.table.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "config", "dataset-id", "description", "display-name", "field", "large-custom-dictionary", "name", "output-path", "path", "project-id", "stored-info-type-id", "table", "table-id", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "location-id", "name", "output-path", "path", "pattern", "project-id", "regex", "stored-info-type-id", "table", "table-id", "url", "word-list", "words"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1021,6 +2163,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1034,7 +2179,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "location-id", "page-size"].iter().map(|v|*v)); v } )); } } @@ -1091,8 +2236,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1101,7 +2250,7 @@ impl<'n> Engine<'n> { "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "config", "dataset-id", "description", "display-name", "field", "large-custom-dictionary", "name", "output-path", "path", "project-id", "table", "table-id", "update-mask", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "name", "output-path", "path", "pattern", "project-id", "regex", "table", "table-id", "update-mask", "url", "word-list", "words"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1188,16 +2337,16 @@ impl<'n> Engine<'n> { "item.byte-item.type" => Some(("item.byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "item.byte-item.data" => Some(("item.byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "item.value" => Some(("item.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-config.exclude-info-types" => Some(("inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "inspect-config.content-options" => Some(("inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "inspect-config.limits.max-findings-per-request" => Some(("inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inspect-config.limits.max-findings-per-item" => Some(("inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "deidentify-template-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "deidentify-template-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1280,6 +2429,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "item.byte-item.type" => Some(("item.byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "item.byte-item.data" => Some(("item.byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "item.value" => Some(("item.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1291,7 +2441,7 @@ impl<'n> Engine<'n> { "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1384,9 +2534,10 @@ impl<'n> Engine<'n> { "inspect-config.limits.max-findings-per-request" => Some(("inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inspect-config.limits.max-findings-per-item" => Some(("inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "reidentify-template-name", "type", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "reidentify-template-name", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1474,9 +2625,10 @@ impl<'n> Engine<'n> { "deidentify-template.description" => Some(("deidentifyTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deidentify-template.name" => Some(("deidentifyTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deidentify-template.create-time" => Some(("deidentifyTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "name", "template-id", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "location-id", "name", "template-id", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1655,6 +2807,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1668,7 +2823,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "location-id", "page-size"].iter().map(|v|*v)); v } )); } } @@ -1909,19 +3064,23 @@ impl<'n> Engine<'n> { "risk-job.source-table.table-id" => Some(("riskJob.sourceTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "risk-job.source-table.dataset-id" => Some(("riskJob.sourceTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-id" => Some(("jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.timespan-config.timestamp-field.name" => Some(("inspectJob.storageConfig.timespanConfig.timestampField.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.timespan-config.end-time" => Some(("inspectJob.storageConfig.timespanConfig.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.timespan-config.start-time" => Some(("inspectJob.storageConfig.timespanConfig.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.timespan-config.enable-auto-population-of-timespan-config" => Some(("inspectJob.storageConfig.timespanConfig.enableAutoPopulationOfTimespanConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-job.storage-config.datastore-options.kind.name" => Some(("inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.big-query-options.sample-method" => Some(("inspectJob.storageConfig.bigQueryOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.big-query-options.rows-limit-percent" => Some(("inspectJob.storageConfig.bigQueryOptions.rowsLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inspect-job.storage-config.big-query-options.rows-limit" => Some(("inspectJob.storageConfig.bigQueryOptions.rowsLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.big-query-options.table-reference.project-id" => Some(("inspectJob.storageConfig.bigQueryOptions.tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.big-query-options.table-reference.table-id" => Some(("inspectJob.storageConfig.bigQueryOptions.tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.big-query-options.table-reference.dataset-id" => Some(("inspectJob.storageConfig.bigQueryOptions.tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "inspect-job.storage-config.datastore-options.kind.name" => Some(("inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.hybrid-options.labels" => Some(("inspectJob.storageConfig.hybridOptions.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "inspect-job.storage-config.hybrid-options.required-finding-label-keys" => Some(("inspectJob.storageConfig.hybridOptions.requiredFindingLabelKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-job.storage-config.hybrid-options.description" => Some(("inspectJob.storageConfig.hybridOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file" => Some(("inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.cloud-storage-options.sample-method" => Some(("inspectJob.storageConfig.cloudStorageOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.storage-config.cloud-storage-options.file-set.url" => Some(("inspectJob.storageConfig.cloudStorageOptions.fileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1939,7 +3098,7 @@ impl<'n> Engine<'n> { "inspect-job.inspect-config.min-likelihood" => Some(("inspectJob.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-job.inspect-template-name" => Some(("inspectJob.inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "categorical-stats-config", "cloud-storage-options", "content-options", "dataset-id", "datastore-options", "delta-presence-estimation-config", "enable-auto-population-of-timespan-config", "end-time", "entity-id", "exclude-info-types", "exclude-regex", "field", "file-set", "file-types", "files-limit-percent", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-id", "k-anonymity-config", "k-map-estimation-config", "kind", "l-diversity-config", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "numerical-stats-config", "partition-id", "privacy-metric", "project-id", "regex-file-set", "region-code", "risk-job", "rows-limit", "rows-limit-percent", "sample-method", "sensitive-attribute", "source-table", "start-time", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "categorical-stats-config", "cloud-storage-options", "content-options", "dataset-id", "datastore-options", "delta-presence-estimation-config", "description", "enable-auto-population-of-timespan-config", "end-time", "entity-id", "exclude-info-types", "exclude-regex", "field", "file-set", "file-types", "files-limit-percent", "hybrid-options", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-id", "k-anonymity-config", "k-map-estimation-config", "kind", "l-diversity-config", "labels", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "numerical-stats-config", "partition-id", "privacy-metric", "project-id", "regex-file-set", "region-code", "required-finding-label-keys", "risk-job", "rows-limit", "rows-limit-percent", "sample-method", "sensitive-attribute", "source-table", "start-time", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2121,6 +3280,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -2137,7 +3299,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "type", "filter", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-size", "filter", "page-token", "location-id", "type"].iter().map(|v|*v)); v } )); } } @@ -2196,6 +3358,7 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "byte-item.type" => Some(("byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "byte-item.data" => Some(("byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-config.exclude-info-types" => Some(("inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "inspect-config.content-options" => Some(("inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2204,7 +3367,7 @@ impl<'n> Engine<'n> { "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-findings" => Some(("includeFindings", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-findings", "include-quote", "inspect-config", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-findings", "include-quote", "inspect-config", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2287,6 +3450,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template.update-time" => Some(("inspectTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template.display-name" => Some(("inspectTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-template.description" => Some(("inspectTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2300,7 +3464,7 @@ impl<'n> Engine<'n> { "inspect-template.name" => Some(("inspectTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "template-id", "update-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "template-id", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2479,6 +3643,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2492,7 +3659,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "location-id", "page-size"].iter().map(|v|*v)); v } )); } } @@ -2730,6 +3897,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "trigger-id" => Some(("triggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.status" => Some(("jobTrigger.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.update-time" => Some(("jobTrigger.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.display-name" => Some(("jobTrigger.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2738,15 +3906,18 @@ impl<'n> Engine<'n> { "job-trigger.inspect-job.storage-config.timespan-config.end-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.timespan-config.start-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.timespan-config.enable-auto-population-of-timespan-config" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.enableAutoPopulationOfTimespanConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.kind.name" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.rows-limit-percent" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.rows-limit" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.table-reference.project-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.table-reference.table-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.table-reference.dataset-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-trigger.inspect-job.storage-config.datastore-options.kind.name" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-trigger.inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-trigger.inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.hybrid-options.labels" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job-trigger.inspect-job.storage-config.hybrid-options.required-finding-label-keys" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.requiredFindingLabelKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.hybrid-options.description" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.cloud-storage-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.url" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2767,7 +3938,7 @@ impl<'n> Engine<'n> { "job-trigger.create-time" => Some(("jobTrigger.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.name" => Some(("jobTrigger.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "cloud-storage-options", "content-options", "create-time", "dataset-id", "datastore-options", "description", "display-name", "enable-auto-population-of-timespan-config", "end-time", "exclude-info-types", "exclude-regex", "file-set", "file-types", "files-limit-percent", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-trigger", "kind", "last-run-time", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "partition-id", "project-id", "regex-file-set", "rows-limit", "rows-limit-percent", "sample-method", "start-time", "status", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "trigger-id", "update-time", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "cloud-storage-options", "content-options", "create-time", "dataset-id", "datastore-options", "description", "display-name", "enable-auto-population-of-timespan-config", "end-time", "exclude-info-types", "exclude-regex", "file-set", "file-types", "files-limit-percent", "hybrid-options", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-trigger", "kind", "labels", "last-run-time", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "partition-id", "project-id", "regex-file-set", "required-finding-label-keys", "rows-limit", "rows-limit-percent", "sample-method", "start-time", "status", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "trigger-id", "update-time", "url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2946,6 +4117,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -2962,7 +4136,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "location-id", "filter", "page-size"].iter().map(|v|*v)); v } )); } } @@ -3027,15 +4201,18 @@ impl<'n> Engine<'n> { "job-trigger.inspect-job.storage-config.timespan-config.end-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.timespan-config.start-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.timespan-config.enable-auto-population-of-timespan-config" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.enableAutoPopulationOfTimespanConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.kind.name" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.rows-limit-percent" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.rows-limit" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.table-reference.project-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.table-reference.table-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.big-query-options.table-reference.dataset-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-trigger.inspect-job.storage-config.datastore-options.kind.name" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-trigger.inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-trigger.inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.hybrid-options.labels" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job-trigger.inspect-job.storage-config.hybrid-options.required-finding-label-keys" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.requiredFindingLabelKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.hybrid-options.description" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.cloud-storage-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.url" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3057,7 +4234,7 @@ impl<'n> Engine<'n> { "job-trigger.name" => Some(("jobTrigger.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "cloud-storage-options", "content-options", "create-time", "dataset-id", "datastore-options", "description", "display-name", "enable-auto-population-of-timespan-config", "end-time", "exclude-info-types", "exclude-regex", "file-set", "file-types", "files-limit-percent", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-trigger", "kind", "last-run-time", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "partition-id", "project-id", "regex-file-set", "rows-limit", "rows-limit-percent", "sample-method", "start-time", "status", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "update-mask", "update-time", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "cloud-storage-options", "content-options", "create-time", "dataset-id", "datastore-options", "description", "display-name", "enable-auto-population-of-timespan-config", "end-time", "exclude-info-types", "exclude-regex", "file-set", "file-types", "files-limit-percent", "hybrid-options", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-trigger", "kind", "labels", "last-run-time", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "partition-id", "project-id", "regex-file-set", "required-finding-label-keys", "rows-limit", "rows-limit-percent", "sample-method", "start-time", "status", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "update-mask", "update-time", "url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3144,16 +4321,16 @@ impl<'n> Engine<'n> { "item.byte-item.type" => Some(("item.byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "item.byte-item.data" => Some(("item.byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "item.value" => Some(("item.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inspect-config.exclude-info-types" => Some(("inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "inspect-config.content-options" => Some(("inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "inspect-config.limits.max-findings-per-request" => Some(("inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inspect-config.limits.max-findings-per-item" => Some(("inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "deidentify-template-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type", "value"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "deidentify-template-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type", "value"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3163,7 +4340,2522 @@ impl<'n> Engine<'n> { } } let mut request: api::GooglePrivacyDlpV2DeidentifyContentRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.projects().locations_content_deidentify(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location").unwrap_or("")); + let mut call = self.hub.projects().locations_content_deidentify(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_content_inspect(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "item.byte-item.type" => Some(("item.byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "item.byte-item.data" => Some(("item.byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "item.value" => Some(("item.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-config.exclude-info-types" => Some(("inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.content-options" => Some(("inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.limits.max-findings-per-request" => Some(("inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.limits.max-findings-per-item" => Some(("inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type", "value"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2InspectContentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_content_inspect(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_content_reidentify(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "item.byte-item.type" => Some(("item.byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "item.byte-item.data" => Some(("item.byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "item.value" => Some(("item.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reidentify-template-name" => Some(("reidentifyTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-config.exclude-info-types" => Some(("inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.content-options" => Some(("inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.limits.max-findings-per-request" => Some(("inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.limits.max-findings-per-item" => Some(("inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template-name" => Some(("inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-quote", "inspect-config", "inspect-template-name", "item", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "reidentify-template-name", "type", "value"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2ReidentifyContentRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_content_reidentify(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_deidentify_templates_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "deidentify-template.update-time" => Some(("deidentifyTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.display-name" => Some(("deidentifyTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.description" => Some(("deidentifyTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.name" => Some(("deidentifyTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.create-time" => Some(("deidentifyTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "location-id", "name", "template-id", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateDeidentifyTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_deidentify_templates_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_deidentify_templates_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_deidentify_templates_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_deidentify_templates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_deidentify_templates_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_deidentify_templates_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_deidentify_templates_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_deidentify_templates_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "deidentify-template.update-time" => Some(("deidentifyTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.display-name" => Some(("deidentifyTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.description" => Some(("deidentifyTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.name" => Some(("deidentifyTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deidentify-template.create-time" => Some(("deidentifyTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deidentify-template", "description", "display-name", "name", "update-mask", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_deidentify_templates_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_dlp_jobs_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CancelDlpJobRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_dlp_jobs_cancel(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_dlp_jobs_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "risk-job.privacy-metric.numerical-stats-config.field.name" => Some(("riskJob.privacyMetric.numericalStatsConfig.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.privacy-metric.k-map-estimation-config.region-code" => Some(("riskJob.privacyMetric.kMapEstimationConfig.regionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.privacy-metric.l-diversity-config.sensitive-attribute.name" => Some(("riskJob.privacyMetric.lDiversityConfig.sensitiveAttribute.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.privacy-metric.k-anonymity-config.entity-id.field.name" => Some(("riskJob.privacyMetric.kAnonymityConfig.entityId.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.privacy-metric.categorical-stats-config.field.name" => Some(("riskJob.privacyMetric.categoricalStatsConfig.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.privacy-metric.delta-presence-estimation-config.region-code" => Some(("riskJob.privacyMetric.deltaPresenceEstimationConfig.regionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.source-table.project-id" => Some(("riskJob.sourceTable.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.source-table.table-id" => Some(("riskJob.sourceTable.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "risk-job.source-table.dataset-id" => Some(("riskJob.sourceTable.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-id" => Some(("jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.timespan-config.timestamp-field.name" => Some(("inspectJob.storageConfig.timespanConfig.timestampField.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.timespan-config.end-time" => Some(("inspectJob.storageConfig.timespanConfig.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.timespan-config.start-time" => Some(("inspectJob.storageConfig.timespanConfig.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.timespan-config.enable-auto-population-of-timespan-config" => Some(("inspectJob.storageConfig.timespanConfig.enableAutoPopulationOfTimespanConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-job.storage-config.datastore-options.kind.name" => Some(("inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.big-query-options.sample-method" => Some(("inspectJob.storageConfig.bigQueryOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.big-query-options.rows-limit-percent" => Some(("inspectJob.storageConfig.bigQueryOptions.rowsLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-job.storage-config.big-query-options.rows-limit" => Some(("inspectJob.storageConfig.bigQueryOptions.rowsLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.big-query-options.table-reference.project-id" => Some(("inspectJob.storageConfig.bigQueryOptions.tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.big-query-options.table-reference.table-id" => Some(("inspectJob.storageConfig.bigQueryOptions.tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.big-query-options.table-reference.dataset-id" => Some(("inspectJob.storageConfig.bigQueryOptions.tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.hybrid-options.labels" => Some(("inspectJob.storageConfig.hybridOptions.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "inspect-job.storage-config.hybrid-options.required-finding-label-keys" => Some(("inspectJob.storageConfig.hybridOptions.requiredFindingLabelKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-job.storage-config.hybrid-options.description" => Some(("inspectJob.storageConfig.hybridOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file" => Some(("inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.cloud-storage-options.sample-method" => Some(("inspectJob.storageConfig.cloudStorageOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.cloud-storage-options.file-set.url" => Some(("inspectJob.storageConfig.cloudStorageOptions.fileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.exclude-regex" => Some(("inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.excludeRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.bucket-name" => Some(("inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.include-regex" => Some(("inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.includeRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-job.storage-config.cloud-storage-options.files-limit-percent" => Some(("inspectJob.storageConfig.cloudStorageOptions.filesLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file-percent" => Some(("inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFilePercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-job.storage-config.cloud-storage-options.file-types" => Some(("inspectJob.storageConfig.cloudStorageOptions.fileTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-job.inspect-config.exclude-info-types" => Some(("inspectJob.inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-job.inspect-config.content-options" => Some(("inspectJob.inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-job.inspect-config.include-quote" => Some(("inspectJob.inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-job.inspect-config.limits.max-findings-per-request" => Some(("inspectJob.inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-job.inspect-config.limits.max-findings-per-item" => Some(("inspectJob.inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-job.inspect-config.min-likelihood" => Some(("inspectJob.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-job.inspect-template-name" => Some(("inspectJob.inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "categorical-stats-config", "cloud-storage-options", "content-options", "dataset-id", "datastore-options", "delta-presence-estimation-config", "description", "enable-auto-population-of-timespan-config", "end-time", "entity-id", "exclude-info-types", "exclude-regex", "field", "file-set", "file-types", "files-limit-percent", "hybrid-options", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-id", "k-anonymity-config", "k-map-estimation-config", "kind", "l-diversity-config", "labels", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "numerical-stats-config", "partition-id", "privacy-metric", "project-id", "regex-file-set", "region-code", "required-finding-label-keys", "risk-job", "rows-limit", "rows-limit-percent", "sample-method", "sensitive-attribute", "source-table", "start-time", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateDlpJobRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_dlp_jobs_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_dlp_jobs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_dlp_jobs_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_dlp_jobs_finish(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2FinishDlpJobRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_dlp_jobs_finish(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_dlp_jobs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_dlp_jobs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_dlp_jobs_hybrid_inspect(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "hybrid-item.finding-details.file-offset" => Some(("hybridItem.findingDetails.fileOffset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.labels" => Some(("hybridItem.findingDetails.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "hybrid-item.finding-details.row-offset" => Some(("hybridItem.findingDetails.rowOffset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.update-time" => Some(("hybridItem.findingDetails.containerDetails.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.project-id" => Some(("hybridItem.findingDetails.containerDetails.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.root-path" => Some(("hybridItem.findingDetails.containerDetails.rootPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.version" => Some(("hybridItem.findingDetails.containerDetails.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.relative-path" => Some(("hybridItem.findingDetails.containerDetails.relativePath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.full-path" => Some(("hybridItem.findingDetails.containerDetails.fullPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.type" => Some(("hybridItem.findingDetails.containerDetails.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.item.byte-item.type" => Some(("hybridItem.item.byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.item.byte-item.data" => Some(("hybridItem.item.byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.item.value" => Some(("hybridItem.item.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "container-details", "data", "file-offset", "finding-details", "full-path", "hybrid-item", "item", "labels", "project-id", "relative-path", "root-path", "row-offset", "type", "update-time", "value", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2HybridInspectDlpJobRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_dlp_jobs_hybrid_inspect(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_dlp_jobs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_dlp_jobs_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "type" => { + call = call.type_(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "type", "filter", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_image_redact(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "byte-item.type" => Some(("byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "byte-item.data" => Some(("byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-config.exclude-info-types" => Some(("inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.content-options" => Some(("inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-config.include-quote" => Some(("inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-config.limits.max-findings-per-request" => Some(("inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.limits.max-findings-per-item" => Some(("inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-config.min-likelihood" => Some(("inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-findings" => Some(("includeFindings", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "content-options", "data", "exclude-info-types", "include-findings", "include-quote", "inspect-config", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "type"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2RedactImageRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_image_redact(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_inspect_templates_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.update-time" => Some(("inspectTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.display-name" => Some(("inspectTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.description" => Some(("inspectTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.exclude-info-types" => Some(("inspectTemplate.inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.content-options" => Some(("inspectTemplate.inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-template.inspect-config.include-quote" => Some(("inspectTemplate.inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-request" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-item" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.min-likelihood" => Some(("inspectTemplate.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.create-time" => Some(("inspectTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.name" => Some(("inspectTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "template-id", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateInspectTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_inspect_templates_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_inspect_templates_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_inspect_templates_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_inspect_templates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_inspect_templates_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_inspect_templates_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_inspect_templates_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_inspect_templates_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "inspect-template.update-time" => Some(("inspectTemplate.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.display-name" => Some(("inspectTemplate.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.description" => Some(("inspectTemplate.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.exclude-info-types" => Some(("inspectTemplate.inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.content-options" => Some(("inspectTemplate.inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "inspect-template.inspect-config.include-quote" => Some(("inspectTemplate.inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-request" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.limits.max-findings-per-item" => Some(("inspectTemplate.inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "inspect-template.inspect-config.min-likelihood" => Some(("inspectTemplate.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.create-time" => Some(("inspectTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "inspect-template.name" => Some(("inspectTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-options", "create-time", "description", "display-name", "exclude-info-types", "include-quote", "inspect-config", "inspect-template", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "update-mask", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2UpdateInspectTemplateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_inspect_templates_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_job_triggers_activate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2ActivateJobTriggerRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_job_triggers_activate(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_job_triggers_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "trigger-id" => Some(("triggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.status" => Some(("jobTrigger.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.update-time" => Some(("jobTrigger.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.display-name" => Some(("jobTrigger.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.description" => Some(("jobTrigger.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.timestamp-field.name" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.timestampField.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.end-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.start-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.enable-auto-population-of-timespan-config" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.enableAutoPopulationOfTimespanConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.kind.name" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.rows-limit-percent" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.rows-limit" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.table-reference.project-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.table-reference.table-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.table-reference.dataset-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.hybrid-options.labels" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job-trigger.inspect-job.storage-config.hybrid-options.required-finding-label-keys" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.requiredFindingLabelKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.hybrid-options.description" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.url" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.exclude-regex" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.excludeRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.bucket-name" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.include-regex" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.includeRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.files-limit-percent" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.filesLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file-percent" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFilePercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-types" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.inspect-config.exclude-info-types" => Some(("jobTrigger.inspectJob.inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.content-options" => Some(("jobTrigger.inspectJob.inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.inspect-config.include-quote" => Some(("jobTrigger.inspectJob.inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.limits.max-findings-per-request" => Some(("jobTrigger.inspectJob.inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.limits.max-findings-per-item" => Some(("jobTrigger.inspectJob.inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.min-likelihood" => Some(("jobTrigger.inspectJob.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-template-name" => Some(("jobTrigger.inspectJob.inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.last-run-time" => Some(("jobTrigger.lastRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.create-time" => Some(("jobTrigger.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.name" => Some(("jobTrigger.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "cloud-storage-options", "content-options", "create-time", "dataset-id", "datastore-options", "description", "display-name", "enable-auto-population-of-timespan-config", "end-time", "exclude-info-types", "exclude-regex", "file-set", "file-types", "files-limit-percent", "hybrid-options", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-trigger", "kind", "labels", "last-run-time", "limits", "location-id", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "partition-id", "project-id", "regex-file-set", "required-finding-label-keys", "rows-limit", "rows-limit-percent", "sample-method", "start-time", "status", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "trigger-id", "update-time", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateJobTriggerRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_job_triggers_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_job_triggers_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_job_triggers_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_job_triggers_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_job_triggers_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_job_triggers_hybrid_inspect(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "hybrid-item.finding-details.file-offset" => Some(("hybridItem.findingDetails.fileOffset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.labels" => Some(("hybridItem.findingDetails.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "hybrid-item.finding-details.row-offset" => Some(("hybridItem.findingDetails.rowOffset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.update-time" => Some(("hybridItem.findingDetails.containerDetails.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.project-id" => Some(("hybridItem.findingDetails.containerDetails.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.root-path" => Some(("hybridItem.findingDetails.containerDetails.rootPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.version" => Some(("hybridItem.findingDetails.containerDetails.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.relative-path" => Some(("hybridItem.findingDetails.containerDetails.relativePath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.full-path" => Some(("hybridItem.findingDetails.containerDetails.fullPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.finding-details.container-details.type" => Some(("hybridItem.findingDetails.containerDetails.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.item.byte-item.type" => Some(("hybridItem.item.byteItem.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.item.byte-item.data" => Some(("hybridItem.item.byteItem.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hybrid-item.item.value" => Some(("hybridItem.item.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["byte-item", "container-details", "data", "file-offset", "finding-details", "full-path", "hybrid-item", "item", "labels", "project-id", "relative-path", "root-path", "row-offset", "type", "update-time", "value", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2HybridInspectJobTriggerRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_job_triggers_hybrid_inspect(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_job_triggers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_job_triggers_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_job_triggers_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "job-trigger.status" => Some(("jobTrigger.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.update-time" => Some(("jobTrigger.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.display-name" => Some(("jobTrigger.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.description" => Some(("jobTrigger.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.timestamp-field.name" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.timestampField.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.end-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.start-time" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.timespan-config.enable-auto-population-of-timespan-config" => Some(("jobTrigger.inspectJob.storageConfig.timespanConfig.enableAutoPopulationOfTimespanConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.kind.name" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.kind.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.project-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.datastore-options.partition-id.namespace-id" => Some(("jobTrigger.inspectJob.storageConfig.datastoreOptions.partitionId.namespaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.rows-limit-percent" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.rows-limit" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.rowsLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.table-reference.project-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.table-reference.table-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.big-query-options.table-reference.dataset-id" => Some(("jobTrigger.inspectJob.storageConfig.bigQueryOptions.tableReference.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.hybrid-options.labels" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job-trigger.inspect-job.storage-config.hybrid-options.required-finding-label-keys" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.requiredFindingLabelKeys", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.hybrid-options.description" => Some(("jobTrigger.inspectJob.storageConfig.hybridOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.sample-method" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.sampleMethod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.url" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.exclude-regex" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.excludeRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.bucket-name" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-set.regex-file-set.include-regex" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileSet.regexFileSet.includeRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.files-limit-percent" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.filesLimitPercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.bytes-limit-per-file-percent" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFilePercent", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.storage-config.cloud-storage-options.file-types" => Some(("jobTrigger.inspectJob.storageConfig.cloudStorageOptions.fileTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.inspect-config.exclude-info-types" => Some(("jobTrigger.inspectJob.inspectConfig.excludeInfoTypes", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.content-options" => Some(("jobTrigger.inspectJob.inspectConfig.contentOptions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-trigger.inspect-job.inspect-config.include-quote" => Some(("jobTrigger.inspectJob.inspectConfig.includeQuote", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.limits.max-findings-per-request" => Some(("jobTrigger.inspectJob.inspectConfig.limits.maxFindingsPerRequest", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.limits.max-findings-per-item" => Some(("jobTrigger.inspectJob.inspectConfig.limits.maxFindingsPerItem", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-config.min-likelihood" => Some(("jobTrigger.inspectJob.inspectConfig.minLikelihood", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.inspect-job.inspect-template-name" => Some(("jobTrigger.inspectJob.inspectTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.last-run-time" => Some(("jobTrigger.lastRunTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.create-time" => Some(("jobTrigger.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-trigger.name" => Some(("jobTrigger.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-options", "bucket-name", "bytes-limit-per-file", "bytes-limit-per-file-percent", "cloud-storage-options", "content-options", "create-time", "dataset-id", "datastore-options", "description", "display-name", "enable-auto-population-of-timespan-config", "end-time", "exclude-info-types", "exclude-regex", "file-set", "file-types", "files-limit-percent", "hybrid-options", "include-quote", "include-regex", "inspect-config", "inspect-job", "inspect-template-name", "job-trigger", "kind", "labels", "last-run-time", "limits", "max-findings-per-item", "max-findings-per-request", "min-likelihood", "name", "namespace-id", "partition-id", "project-id", "regex-file-set", "required-finding-label-keys", "rows-limit", "rows-limit-percent", "sample-method", "start-time", "status", "storage-config", "table-id", "table-reference", "timespan-config", "timestamp-field", "update-mask", "update-time", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2UpdateJobTriggerRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_job_triggers_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_stored_info_types_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "stored-info-type-id" => Some(("storedInfoTypeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.project-id" => Some(("config.largeCustomDictionary.bigQueryField.table.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.table-id" => Some(("config.largeCustomDictionary.bigQueryField.table.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "location-id", "name", "output-path", "path", "pattern", "project-id", "regex", "stored-info-type-id", "table", "table-id", "url", "word-list", "words"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2CreateStoredInfoTypeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_stored_info_types_create(request, opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_stored_info_types_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_stored_info_types_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_stored_info_types_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_stored_info_types_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_stored_info_types_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_stored_info_types_list(opt.value_of("parent").unwrap_or(""), opt.value_of("location-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_stored_info_types_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.project-id" => Some(("config.largeCustomDictionary.bigQueryField.table.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.table-id" => Some(("config.largeCustomDictionary.bigQueryField.table.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "name", "output-path", "path", "pattern", "project-id", "regex", "table", "table-id", "update-mask", "url", "word-list", "words"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_stored_info_types_patch(request, opt.value_of("name").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { @@ -3236,9 +6928,14 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "stored-info-type-id" => Some(("storedInfoTypeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3246,7 +6943,7 @@ impl<'n> Engine<'n> { "config.large-custom-dictionary.big-query-field.table.table-id" => Some(("config.largeCustomDictionary.bigQueryField.table.tableId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "config", "dataset-id", "description", "display-name", "field", "large-custom-dictionary", "name", "output-path", "path", "project-id", "stored-info-type-id", "table", "table-id", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "location-id", "name", "output-path", "path", "pattern", "project-id", "regex", "stored-info-type-id", "table", "table-id", "url", "word-list", "words"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3425,6 +7122,9 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "location-id" => { + call = call.location_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3438,7 +7138,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "location-id", "page-size"].iter().map(|v|*v)); v } )); } } @@ -3495,8 +7195,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "config.regex.pattern" => Some(("config.regex.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.regex.group-indexes" => Some(("config.regex.groupIndexes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), "config.display-name" => Some(("config.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.description" => Some(("config.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dictionary.word-list.words" => Some(("config.dictionary.wordList.words", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dictionary.cloud-storage-path.path" => Some(("config.dictionary.cloudStoragePath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.output-path.path" => Some(("config.largeCustomDictionary.outputPath.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.cloud-storage-file-set.url" => Some(("config.largeCustomDictionary.cloudStorageFileSet.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.large-custom-dictionary.big-query-field.field.name" => Some(("config.largeCustomDictionary.bigQueryField.field.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3505,7 +7209,7 @@ impl<'n> Engine<'n> { "config.large-custom-dictionary.big-query-field.table.dataset-id" => Some(("config.largeCustomDictionary.bigQueryField.table.datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "config", "dataset-id", "description", "display-name", "field", "large-custom-dictionary", "name", "output-path", "path", "project-id", "table", "table-id", "update-mask", "url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["big-query-field", "cloud-storage-file-set", "cloud-storage-path", "config", "dataset-id", "description", "dictionary", "display-name", "field", "group-indexes", "large-custom-dictionary", "name", "output-path", "path", "pattern", "project-id", "regex", "table", "table-id", "update-mask", "url", "word-list", "words"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3581,6 +7285,17 @@ impl<'n> Engine<'n> { } } }, + ("locations", Some(opt)) => { + match opt.subcommand() { + ("info-types-list", Some(opt)) => { + call_result = self._locations_info_types_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("locations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("organizations", Some(opt)) => { match opt.subcommand() { ("deidentify-templates-create", Some(opt)) => { @@ -3613,6 +7328,51 @@ impl<'n> Engine<'n> { ("inspect-templates-patch", Some(opt)) => { call_result = self._organizations_inspect_templates_patch(opt, dry_run, &mut err); }, + ("locations-deidentify-templates-create", Some(opt)) => { + call_result = self._organizations_locations_deidentify_templates_create(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-delete", Some(opt)) => { + call_result = self._organizations_locations_deidentify_templates_delete(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-get", Some(opt)) => { + call_result = self._organizations_locations_deidentify_templates_get(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-list", Some(opt)) => { + call_result = self._organizations_locations_deidentify_templates_list(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-patch", Some(opt)) => { + call_result = self._organizations_locations_deidentify_templates_patch(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-create", Some(opt)) => { + call_result = self._organizations_locations_inspect_templates_create(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-delete", Some(opt)) => { + call_result = self._organizations_locations_inspect_templates_delete(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-get", Some(opt)) => { + call_result = self._organizations_locations_inspect_templates_get(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-list", Some(opt)) => { + call_result = self._organizations_locations_inspect_templates_list(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-patch", Some(opt)) => { + call_result = self._organizations_locations_inspect_templates_patch(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-create", Some(opt)) => { + call_result = self._organizations_locations_stored_info_types_create(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-delete", Some(opt)) => { + call_result = self._organizations_locations_stored_info_types_delete(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-get", Some(opt)) => { + call_result = self._organizations_locations_stored_info_types_get(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-list", Some(opt)) => { + call_result = self._organizations_locations_stored_info_types_list(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-patch", Some(opt)) => { + call_result = self._organizations_locations_stored_info_types_patch(opt, dry_run, &mut err); + }, ("stored-info-types-create", Some(opt)) => { call_result = self._organizations_stored_info_types_create(opt, dry_run, &mut err); }, @@ -3714,6 +7474,102 @@ impl<'n> Engine<'n> { ("locations-content-deidentify", Some(opt)) => { call_result = self._projects_locations_content_deidentify(opt, dry_run, &mut err); }, + ("locations-content-inspect", Some(opt)) => { + call_result = self._projects_locations_content_inspect(opt, dry_run, &mut err); + }, + ("locations-content-reidentify", Some(opt)) => { + call_result = self._projects_locations_content_reidentify(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-create", Some(opt)) => { + call_result = self._projects_locations_deidentify_templates_create(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-delete", Some(opt)) => { + call_result = self._projects_locations_deidentify_templates_delete(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-get", Some(opt)) => { + call_result = self._projects_locations_deidentify_templates_get(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-list", Some(opt)) => { + call_result = self._projects_locations_deidentify_templates_list(opt, dry_run, &mut err); + }, + ("locations-deidentify-templates-patch", Some(opt)) => { + call_result = self._projects_locations_deidentify_templates_patch(opt, dry_run, &mut err); + }, + ("locations-dlp-jobs-cancel", Some(opt)) => { + call_result = self._projects_locations_dlp_jobs_cancel(opt, dry_run, &mut err); + }, + ("locations-dlp-jobs-create", Some(opt)) => { + call_result = self._projects_locations_dlp_jobs_create(opt, dry_run, &mut err); + }, + ("locations-dlp-jobs-delete", Some(opt)) => { + call_result = self._projects_locations_dlp_jobs_delete(opt, dry_run, &mut err); + }, + ("locations-dlp-jobs-finish", Some(opt)) => { + call_result = self._projects_locations_dlp_jobs_finish(opt, dry_run, &mut err); + }, + ("locations-dlp-jobs-get", Some(opt)) => { + call_result = self._projects_locations_dlp_jobs_get(opt, dry_run, &mut err); + }, + ("locations-dlp-jobs-hybrid-inspect", Some(opt)) => { + call_result = self._projects_locations_dlp_jobs_hybrid_inspect(opt, dry_run, &mut err); + }, + ("locations-dlp-jobs-list", Some(opt)) => { + call_result = self._projects_locations_dlp_jobs_list(opt, dry_run, &mut err); + }, + ("locations-image-redact", Some(opt)) => { + call_result = self._projects_locations_image_redact(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-create", Some(opt)) => { + call_result = self._projects_locations_inspect_templates_create(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-delete", Some(opt)) => { + call_result = self._projects_locations_inspect_templates_delete(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-get", Some(opt)) => { + call_result = self._projects_locations_inspect_templates_get(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-list", Some(opt)) => { + call_result = self._projects_locations_inspect_templates_list(opt, dry_run, &mut err); + }, + ("locations-inspect-templates-patch", Some(opt)) => { + call_result = self._projects_locations_inspect_templates_patch(opt, dry_run, &mut err); + }, + ("locations-job-triggers-activate", Some(opt)) => { + call_result = self._projects_locations_job_triggers_activate(opt, dry_run, &mut err); + }, + ("locations-job-triggers-create", Some(opt)) => { + call_result = self._projects_locations_job_triggers_create(opt, dry_run, &mut err); + }, + ("locations-job-triggers-delete", Some(opt)) => { + call_result = self._projects_locations_job_triggers_delete(opt, dry_run, &mut err); + }, + ("locations-job-triggers-get", Some(opt)) => { + call_result = self._projects_locations_job_triggers_get(opt, dry_run, &mut err); + }, + ("locations-job-triggers-hybrid-inspect", Some(opt)) => { + call_result = self._projects_locations_job_triggers_hybrid_inspect(opt, dry_run, &mut err); + }, + ("locations-job-triggers-list", Some(opt)) => { + call_result = self._projects_locations_job_triggers_list(opt, dry_run, &mut err); + }, + ("locations-job-triggers-patch", Some(opt)) => { + call_result = self._projects_locations_job_triggers_patch(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-create", Some(opt)) => { + call_result = self._projects_locations_stored_info_types_create(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-delete", Some(opt)) => { + call_result = self._projects_locations_stored_info_types_delete(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-get", Some(opt)) => { + call_result = self._projects_locations_stored_info_types_get(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-list", Some(opt)) => { + call_result = self._projects_locations_stored_info_types_list(opt, dry_run, &mut err); + }, + ("locations-stored-info-types-patch", Some(opt)) => { + call_result = self._projects_locations_stored_info_types_patch(opt, dry_run, &mut err); + }, ("stored-info-types-create", Some(opt)) => { call_result = self._projects_stored_info_types_create(opt, dry_run, &mut err); }, @@ -3841,7 +7697,35 @@ fn main() { ]), ]), - ("organizations", "methods: 'deidentify-templates-create', 'deidentify-templates-delete', 'deidentify-templates-get', 'deidentify-templates-list', 'deidentify-templates-patch', 'inspect-templates-create', 'inspect-templates-delete', 'inspect-templates-get', 'inspect-templates-list', 'inspect-templates-patch', 'stored-info-types-create', 'stored-info-types-delete', 'stored-info-types-get', 'stored-info-types-list' and 'stored-info-types-patch'", vec![ + ("locations", "methods: 'info-types-list'", vec![ + ("info-types-list", + Some(r##"Returns a list of the sensitive information types that the DLP API + supports. See https://cloud.google.com/dlp/docs/infotypes-reference to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/locations_info-types-list", + vec![ + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to list info types. Reserved for future + extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("organizations", "methods: 'deidentify-templates-create', 'deidentify-templates-delete', 'deidentify-templates-get', 'deidentify-templates-list', 'deidentify-templates-patch', 'inspect-templates-create', 'inspect-templates-delete', 'inspect-templates-get', 'inspect-templates-list', 'inspect-templates-patch', 'locations-deidentify-templates-create', 'locations-deidentify-templates-delete', 'locations-deidentify-templates-get', 'locations-deidentify-templates-list', 'locations-deidentify-templates-patch', 'locations-inspect-templates-create', 'locations-inspect-templates-delete', 'locations-inspect-templates-get', 'locations-inspect-templates-list', 'locations-inspect-templates-patch', 'locations-stored-info-types-create', 'locations-stored-info-types-delete', 'locations-stored-info-types-get', 'locations-stored-info-types-list', 'locations-stored-info-types-patch', 'stored-info-types-create', 'stored-info-types-delete', 'stored-info-types-get', 'stored-info-types-list' and 'stored-info-types-patch'", vec![ ("deidentify-templates-create", Some(r##"Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. @@ -3851,7 +7735,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -3882,7 +7766,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and deidentify template to be deleted, + Some(r##"Required. Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342."##), Some(true), @@ -3908,7 +7792,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and deidentify template to be read, for + Some(r##"Required. Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342."##), Some(true), @@ -3934,7 +7818,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -3959,7 +7843,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of organization and deidentify template to be updated, for + Some(r##"Required. Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342."##), Some(true), @@ -3991,7 +7875,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4021,7 +7905,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and inspectTemplate to be deleted, for + Some(r##"Required. Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342."##), Some(true), @@ -4046,7 +7930,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and inspectTemplate to be read, for + Some(r##"Required. Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342."##), Some(true), @@ -4071,7 +7955,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4095,7 +7979,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of organization and inspectTemplate to be updated, for + Some(r##"Required. Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342."##), Some(true), @@ -4113,6 +7997,466 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-create", + Some(r##"Creates a DeidentifyTemplate for re-using frequently used configuration + for de-identifying content, images, and storage. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-deidentify-templates-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store the deidentification template. Reserved + for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-delete", + Some(r##"Deletes a DeidentifyTemplate. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-deidentify-templates-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and deidentify template to be deleted, + for example `organizations/433245324/deidentifyTemplates/432452342` or + projects/project-id/deidentifyTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-get", + Some(r##"Gets a DeidentifyTemplate. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-deidentify-templates-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and deidentify template to be read, for + example `organizations/433245324/deidentifyTemplates/432452342` or + projects/project-id/deidentifyTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-list", + Some(r##"Lists DeidentifyTemplates. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-deidentify-templates-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where deidentifications templates will be retrieved + from. Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-patch", + Some(r##"Updates the DeidentifyTemplate. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-deidentify-templates-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of organization and deidentify template to be updated, for + example `organizations/433245324/deidentifyTemplates/432452342` or + projects/project-id/deidentifyTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-create", + Some(r##"Creates an InspectTemplate for re-using frequently used configuration + for inspecting content, images, and storage. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-inspect-templates-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store the inspection template. Reserved for + future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-delete", + Some(r##"Deletes an InspectTemplate. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-inspect-templates-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and inspectTemplate to be deleted, for + example `organizations/433245324/inspectTemplates/432452342` or + projects/project-id/inspectTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-get", + Some(r##"Gets an InspectTemplate. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-inspect-templates-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and inspectTemplate to be read, for + example `organizations/433245324/inspectTemplates/432452342` or + projects/project-id/inspectTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-list", + Some(r##"Lists InspectTemplates. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-inspect-templates-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where inspection templates will be retrieved from. + Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-patch", + Some(r##"Updates the InspectTemplate. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-inspect-templates-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of organization and inspectTemplate to be updated, for + example `organizations/433245324/inspectTemplates/432452342` or + projects/project-id/inspectTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-create", + Some(r##"Creates a pre-built stored infoType to be used for inspection. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-stored-info-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store the stored infoType. Reserved for + future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-delete", + Some(r##"Deletes a stored infoType. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-stored-info-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and storedInfoType to be deleted, for + example `organizations/433245324/storedInfoTypes/432452342` or + projects/project-id/storedInfoTypes/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-get", + Some(r##"Gets a stored infoType. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-stored-info-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and storedInfoType to be read, for + example `organizations/433245324/storedInfoTypes/432452342` or + projects/project-id/storedInfoTypes/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-list", + Some(r##"Lists stored infoTypes. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-stored-info-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where stored infoTypes will be retrieved from. + Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-patch", + Some(r##"Updates the stored infoType by creating a new version. The existing version + will continue to be used until the new version is ready. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/organizations_locations-stored-info-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of organization and storedInfoType to be updated, for + example `organizations/433245324/storedInfoTypes/432452342` or + projects/project-id/storedInfoTypes/432452342."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4127,7 +8471,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4158,7 +8502,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and storedInfoType to be deleted, for + Some(r##"Required. Resource name of the organization and storedInfoType to be deleted, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342."##), Some(true), @@ -4184,7 +8528,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and storedInfoType to be read, for + Some(r##"Required. Resource name of the organization and storedInfoType to be read, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342."##), Some(true), @@ -4210,7 +8554,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4236,7 +8580,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of organization and storedInfoType to be updated, for + Some(r##"Required. Resource name of organization and storedInfoType to be updated, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342."##), Some(true), @@ -4262,7 +8606,7 @@ fn main() { ]), ]), - ("projects", "methods: 'content-deidentify', 'content-inspect', 'content-reidentify', 'deidentify-templates-create', 'deidentify-templates-delete', 'deidentify-templates-get', 'deidentify-templates-list', 'deidentify-templates-patch', 'dlp-jobs-cancel', 'dlp-jobs-create', 'dlp-jobs-delete', 'dlp-jobs-get', 'dlp-jobs-list', 'image-redact', 'inspect-templates-create', 'inspect-templates-delete', 'inspect-templates-get', 'inspect-templates-list', 'inspect-templates-patch', 'job-triggers-activate', 'job-triggers-create', 'job-triggers-delete', 'job-triggers-get', 'job-triggers-list', 'job-triggers-patch', 'locations-content-deidentify', 'stored-info-types-create', 'stored-info-types-delete', 'stored-info-types-get', 'stored-info-types-list' and 'stored-info-types-patch'", vec![ + ("projects", "methods: 'content-deidentify', 'content-inspect', 'content-reidentify', 'deidentify-templates-create', 'deidentify-templates-delete', 'deidentify-templates-get', 'deidentify-templates-list', 'deidentify-templates-patch', 'dlp-jobs-cancel', 'dlp-jobs-create', 'dlp-jobs-delete', 'dlp-jobs-get', 'dlp-jobs-list', 'image-redact', 'inspect-templates-create', 'inspect-templates-delete', 'inspect-templates-get', 'inspect-templates-list', 'inspect-templates-patch', 'job-triggers-activate', 'job-triggers-create', 'job-triggers-delete', 'job-triggers-get', 'job-triggers-list', 'job-triggers-patch', 'locations-content-deidentify', 'locations-content-inspect', 'locations-content-reidentify', 'locations-deidentify-templates-create', 'locations-deidentify-templates-delete', 'locations-deidentify-templates-get', 'locations-deidentify-templates-list', 'locations-deidentify-templates-patch', 'locations-dlp-jobs-cancel', 'locations-dlp-jobs-create', 'locations-dlp-jobs-delete', 'locations-dlp-jobs-finish', 'locations-dlp-jobs-get', 'locations-dlp-jobs-hybrid-inspect', 'locations-dlp-jobs-list', 'locations-image-redact', 'locations-inspect-templates-create', 'locations-inspect-templates-delete', 'locations-inspect-templates-get', 'locations-inspect-templates-list', 'locations-inspect-templates-patch', 'locations-job-triggers-activate', 'locations-job-triggers-create', 'locations-job-triggers-delete', 'locations-job-triggers-get', 'locations-job-triggers-hybrid-inspect', 'locations-job-triggers-list', 'locations-job-triggers-patch', 'locations-stored-info-types-create', 'locations-stored-info-types-delete', 'locations-stored-info-types-get', 'locations-stored-info-types-list', 'locations-stored-info-types-patch', 'stored-info-types-create', 'stored-info-types-delete', 'stored-info-types-get', 'stored-info-types-list' and 'stored-info-types-patch'", vec![ ("content-deidentify", Some(r##"De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. @@ -4343,7 +8687,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name."##), + Some(r##"Required. The parent resource name."##), Some(true), Some(false)), @@ -4374,7 +8718,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4405,7 +8749,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and deidentify template to be deleted, + Some(r##"Required. Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342."##), Some(true), @@ -4431,7 +8775,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and deidentify template to be read, for + Some(r##"Required. Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342."##), Some(true), @@ -4457,7 +8801,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4482,7 +8826,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of organization and deidentify template to be updated, for + Some(r##"Required. Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342."##), Some(true), @@ -4516,7 +8860,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the DlpJob resource to be cancelled."##), + Some(r##"Required. The name of the DlpJob resource to be cancelled."##), Some(true), Some(false)), @@ -4550,7 +8894,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id."##), + Some(r##"Required. The parent resource name, for example projects/my-project-id."##), Some(true), Some(false)), @@ -4582,7 +8926,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the DlpJob resource to be deleted."##), + Some(r##"Required. The name of the DlpJob resource to be deleted."##), Some(true), Some(false)), @@ -4606,7 +8950,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the DlpJob resource."##), + Some(r##"Required. The name of the DlpJob resource."##), Some(true), Some(false)), @@ -4630,7 +8974,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id."##), + Some(r##"Required. The parent resource name, for example projects/my-project-id."##), Some(true), Some(false)), @@ -4689,7 +9033,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4719,7 +9063,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and inspectTemplate to be deleted, for + Some(r##"Required. Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342."##), Some(true), @@ -4744,7 +9088,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and inspectTemplate to be read, for + Some(r##"Required. Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342."##), Some(true), @@ -4769,7 +9113,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -4793,7 +9137,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of organization and inspectTemplate to be updated, for + Some(r##"Required. Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342."##), Some(true), @@ -4824,7 +9168,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the trigger to activate, for example + Some(r##"Required. Resource name of the trigger to activate, for example `projects/dlp-test-project/jobTriggers/53234423`."##), Some(true), Some(false)), @@ -4855,7 +9199,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id."##), + Some(r##"Required. The parent resource name, for example projects/my-project-id."##), Some(true), Some(false)), @@ -4884,7 +9228,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the project and the triggeredJob, for example + Some(r##"Required. Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`."##), Some(true), Some(false)), @@ -4908,7 +9252,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the project and the triggeredJob, for example + Some(r##"Required. Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`."##), Some(true), Some(false)), @@ -4932,7 +9276,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example `projects/my-project-id`."##), + Some(r##"Required. The parent resource name, for example `projects/my-project-id`."##), Some(true), Some(false)), @@ -4955,7 +9299,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the project and the triggeredJob, for example + Some(r##"Required. Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`."##), Some(true), Some(false)), @@ -4995,7 +9339,7 @@ fn main() { Some(true), Some(false)), - (Some(r##"location"##), + (Some(r##"location-id"##), None, Some(r##"The geographic location to process de-identification. Reserved for future extensions."##), @@ -5014,6 +9358,1021 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-content-inspect", + Some(r##"Finds potentially sensitive info in content. + This method has limits on input size, processing time, and output size. + + When no InfoTypes or CustomInfoTypes are specified in this request, the + system will automatically choose what detectors to run. By default this may + be all types, but may change over time as detectors are updated. + + For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images + and https://cloud.google.com/dlp/docs/inspecting-text,"##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-content-inspect", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent resource name, for example projects/my-project-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to process content inspection. Reserved for future + extensions. + When inspecting images location is restricted to 'global', 'us', 'asia', + and 'europe'."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-content-reidentify", + Some(r##"Re-identifies content that has been de-identified. + See + https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example + to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-content-reidentify", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to process content reidentification. Reserved for + future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-create", + Some(r##"Creates a DeidentifyTemplate for re-using frequently used configuration + for de-identifying content, images, and storage. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-deidentify-templates-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store the deidentification template. Reserved + for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-delete", + Some(r##"Deletes a DeidentifyTemplate. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-deidentify-templates-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and deidentify template to be deleted, + for example `organizations/433245324/deidentifyTemplates/432452342` or + projects/project-id/deidentifyTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-get", + Some(r##"Gets a DeidentifyTemplate. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-deidentify-templates-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and deidentify template to be read, for + example `organizations/433245324/deidentifyTemplates/432452342` or + projects/project-id/deidentifyTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-list", + Some(r##"Lists DeidentifyTemplates. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-deidentify-templates-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where deidentifications templates will be retrieved + from. Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-deidentify-templates-patch", + Some(r##"Updates the DeidentifyTemplate. + See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-deidentify-templates-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of organization and deidentify template to be updated, for + example `organizations/433245324/deidentifyTemplates/432452342` or + projects/project-id/deidentifyTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-dlp-jobs-cancel", + Some(r##"Starts asynchronous cancellation on a long-running DlpJob. The server + makes a best effort to cancel the DlpJob, but success is not + guaranteed. + See https://cloud.google.com/dlp/docs/inspecting-storage and + https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-dlp-jobs-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the DlpJob resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-dlp-jobs-create", + Some(r##"Creates a new job to inspect storage or calculate risk metrics. + See https://cloud.google.com/dlp/docs/inspecting-storage and + https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + + When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the + system will automatically choose what detectors to run. By default this may + be all types, but may change over time as detectors are updated."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-dlp-jobs-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store and process the job. Reserved for + future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-dlp-jobs-delete", + Some(r##"Deletes a long-running DlpJob. This method indicates that the client is + no longer interested in the DlpJob result. The job will be cancelled if + possible. + See https://cloud.google.com/dlp/docs/inspecting-storage and + https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-dlp-jobs-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the DlpJob resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-dlp-jobs-finish", + Some(r##"Finish a running hybrid DlpJob. Triggers the finalization steps and running + of any enabled actions that have not yet run. + Early access feature is in a pre-release state and might change or have + limited support. For more information, see + https://cloud.google.com/products#product-launch-stages."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-dlp-jobs-finish", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the DlpJob resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-dlp-jobs-get", + Some(r##"Gets the latest state of a long-running DlpJob. + See https://cloud.google.com/dlp/docs/inspecting-storage and + https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-dlp-jobs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the DlpJob resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-dlp-jobs-hybrid-inspect", + Some(r##"Inspect hybrid content and store findings to a job. + To review the findings inspect the job. Inspection will occur + asynchronously. + Early access feature is in a pre-release state and might change or have + limited support. For more information, see + https://cloud.google.com/products#product-launch-stages."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-dlp-jobs-hybrid-inspect", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the job to execute a hybrid inspect on, for example + `projects/dlp-test-project/dlpJob/53234423`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-dlp-jobs-list", + Some(r##"Lists DlpJobs that match the specified filter in the request. + See https://cloud.google.com/dlp/docs/inspecting-storage and + https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-dlp-jobs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where jobs will be retrieved from. + Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-image-redact", + Some(r##"Redacts potentially sensitive info from an image. + This method has limits on input size, processing time, and output size. + See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to + learn more. + + When no InfoTypes or CustomInfoTypes are specified in this request, the + system will automatically choose what detectors to run. By default this may + be all types, but may change over time as detectors are updated."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-image-redact", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent resource name, for example projects/my-project-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to process the request. Reserved for future + extensions. + Location is restricted to 'global', 'us', 'asia', and 'europe'."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-create", + Some(r##"Creates an InspectTemplate for re-using frequently used configuration + for inspecting content, images, and storage. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-inspect-templates-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store the inspection template. Reserved for + future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-delete", + Some(r##"Deletes an InspectTemplate. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-inspect-templates-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and inspectTemplate to be deleted, for + example `organizations/433245324/inspectTemplates/432452342` or + projects/project-id/inspectTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-get", + Some(r##"Gets an InspectTemplate. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-inspect-templates-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and inspectTemplate to be read, for + example `organizations/433245324/inspectTemplates/432452342` or + projects/project-id/inspectTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-list", + Some(r##"Lists InspectTemplates. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-inspect-templates-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where inspection templates will be retrieved from. + Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-inspect-templates-patch", + Some(r##"Updates the InspectTemplate. + See https://cloud.google.com/dlp/docs/creating-templates to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-inspect-templates-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of organization and inspectTemplate to be updated, for + example `organizations/433245324/inspectTemplates/432452342` or + projects/project-id/inspectTemplates/432452342."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-job-triggers-activate", + Some(r##"Activate a job trigger. Causes the immediate execute of a trigger + instead of waiting on the trigger event to occur."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-job-triggers-activate", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the trigger to activate, for example + `projects/dlp-test-project/jobTriggers/53234423`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-job-triggers-create", + Some(r##"Creates a job trigger to run DLP actions such as scanning storage for + sensitive information on a set schedule. + See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-job-triggers-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store the job trigger. Reserved for + future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-job-triggers-delete", + Some(r##"Deletes a job trigger. + See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-job-triggers-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the project and the triggeredJob, for example + `projects/dlp-test-project/jobTriggers/53234423`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-job-triggers-get", + Some(r##"Gets a job trigger. + See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-job-triggers-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the project and the triggeredJob, for example + `projects/dlp-test-project/jobTriggers/53234423`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-job-triggers-hybrid-inspect", + Some(r##"Inspect hybrid content and store findings to a trigger. The inspection + will be processed asynchronously. To review the findings monitor the + jobs within the trigger. + Early access feature is in a pre-release state and might change or have + limited support. For more information, see + https://cloud.google.com/products#product-launch-stages."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-job-triggers-hybrid-inspect", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the trigger to execute a hybrid inspect on, for example + `projects/dlp-test-project/jobTriggers/53234423`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-job-triggers-list", + Some(r##"Lists job triggers. + See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-job-triggers-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example `projects/my-project-id`."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where job triggers will be retrieved from. + Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-job-triggers-patch", + Some(r##"Updates a job trigger. + See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-job-triggers-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the project and the triggeredJob, for example + `projects/dlp-test-project/jobTriggers/53234423`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-create", + Some(r##"Creates a pre-built stored infoType to be used for inspection. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-stored-info-types-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location to store the stored infoType. Reserved for + future extensions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-delete", + Some(r##"Deletes a stored infoType. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-stored-info-types-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and storedInfoType to be deleted, for + example `organizations/433245324/storedInfoTypes/432452342` or + projects/project-id/storedInfoTypes/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-get", + Some(r##"Gets a stored infoType. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-stored-info-types-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the organization and storedInfoType to be read, for + example `organizations/433245324/storedInfoTypes/432452342` or + projects/project-id/storedInfoTypes/432452342."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-list", + Some(r##"Lists stored infoTypes. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-stored-info-types-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource name, for example projects/my-project-id or + organizations/my-org-id."##), + Some(true), + Some(false)), + + (Some(r##"location-id"##), + None, + Some(r##"The geographic location where stored infoTypes will be retrieved from. + Use `-` for all locations. Reserved for future extensions."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-stored-info-types-patch", + Some(r##"Updates the stored infoType by creating a new version. The existing version + will continue to be used until the new version is ready. + See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + learn more."##), + "Details at http://byron.github.io/google-apis-rs/google_dlp2_cli/projects_locations-stored-info-types-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of organization and storedInfoType to be updated, for + example `organizations/433245324/storedInfoTypes/432452342` or + projects/project-id/storedInfoTypes/432452342."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -5028,7 +10387,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -5059,7 +10418,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and storedInfoType to be deleted, for + Some(r##"Required. Resource name of the organization and storedInfoType to be deleted, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342."##), Some(true), @@ -5085,7 +10444,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the organization and storedInfoType to be read, for + Some(r##"Required. Resource name of the organization and storedInfoType to be read, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342."##), Some(true), @@ -5111,7 +10470,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name, for example projects/my-project-id or + Some(r##"Required. The parent resource name, for example projects/my-project-id or organizations/my-org-id."##), Some(true), Some(false)), @@ -5137,7 +10496,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of organization and storedInfoType to be updated, for + Some(r##"Required. Resource name of organization and storedInfoType to be updated, for example `organizations/433245324/storedInfoTypes/432452342` or projects/project-id/storedInfoTypes/432452342."##), Some(true), @@ -5167,7 +10526,7 @@ fn main() { let mut app = App::new("dlp2") .author("Sebastian Thiel ") - .version("1.0.12+20190629") + .version("1.0.13+20200405") .about("Provides methods for detection, risk analysis, and de-identification of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dlp2_cli") .arg(Arg::with_name("url") diff --git a/gen/dlp2/Cargo.toml b/gen/dlp2/Cargo.toml index b768894acd..98af157e4e 100644 --- a/gen/dlp2/Cargo.toml +++ b/gen/dlp2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dlp2" -version = "1.0.12+20190629" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with DLP (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2" homepage = "https://cloud.google.com/dlp/docs/" -documentation = "https://docs.rs/google-dlp2/1.0.12+20190629" +documentation = "https://docs.rs/google-dlp2/1.0.13+20200405" license = "MIT" keywords = ["dlp", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dlp2/README.md b/gen/dlp2/README.md index d7ce204629..1ecd549e83 100644 --- a/gen/dlp2/README.md +++ b/gen/dlp2/README.md @@ -5,20 +5,22 @@ DO NOT EDIT ! --> The `google-dlp2` library allows access to all features of the *Google DLP* service. -This documentation was generated from *DLP* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *dlp:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *DLP* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *dlp:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *DLP* *v2* API can be found at the [official documentation site](https://cloud.google.com/dlp/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.DLP.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.DLP.html) ... * info types - * [*list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.InfoTypeListCall.html) + * [*list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.InfoTypeListCall.html) +* locations + * [*info types list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.LocationInfoTypeListCall.html) * organizations - * [*deidentify templates create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationDeidentifyTemplateGetCall.html), [*deidentify templates list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationDeidentifyTemplateListCall.html), [*deidentify templates patch*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationDeidentifyTemplatePatchCall.html), [*inspect templates create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationInspectTemplateCreateCall.html), [*inspect templates delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationInspectTemplateDeleteCall.html), [*inspect templates get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationInspectTemplateGetCall.html), [*inspect templates list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationInspectTemplateListCall.html), [*inspect templates patch*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationInspectTemplatePatchCall.html), [*stored info types create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationStoredInfoTypeCreateCall.html), [*stored info types delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationStoredInfoTypeDeleteCall.html), [*stored info types get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationStoredInfoTypeGetCall.html), [*stored info types list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationStoredInfoTypeListCall.html) and [*stored info types patch*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.OrganizationStoredInfoTypePatchCall.html) + * [*deidentify templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationDeidentifyTemplateGetCall.html), [*deidentify templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationDeidentifyTemplateListCall.html), [*deidentify templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationDeidentifyTemplatePatchCall.html), [*inspect templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationInspectTemplateCreateCall.html), [*inspect templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationInspectTemplateDeleteCall.html), [*inspect templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationInspectTemplateGetCall.html), [*inspect templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationInspectTemplateListCall.html), [*inspect templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationInspectTemplatePatchCall.html), [*locations deidentify templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationDeidentifyTemplateCreateCall.html), [*locations deidentify templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationDeidentifyTemplateDeleteCall.html), [*locations deidentify templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationDeidentifyTemplateGetCall.html), [*locations deidentify templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationDeidentifyTemplateListCall.html), [*locations deidentify templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationDeidentifyTemplatePatchCall.html), [*locations inspect templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationInspectTemplateCreateCall.html), [*locations inspect templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationInspectTemplateDeleteCall.html), [*locations inspect templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationInspectTemplateGetCall.html), [*locations inspect templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationInspectTemplateListCall.html), [*locations inspect templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationInspectTemplatePatchCall.html), [*locations stored info types create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationStoredInfoTypeCreateCall.html), [*locations stored info types delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationStoredInfoTypeDeleteCall.html), [*locations stored info types get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationStoredInfoTypeGetCall.html), [*locations stored info types list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationStoredInfoTypeListCall.html), [*locations stored info types patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationLocationStoredInfoTypePatchCall.html), [*stored info types create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationStoredInfoTypeCreateCall.html), [*stored info types delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationStoredInfoTypeDeleteCall.html), [*stored info types get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationStoredInfoTypeGetCall.html), [*stored info types list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationStoredInfoTypeListCall.html) and [*stored info types patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.OrganizationStoredInfoTypePatchCall.html) * projects - * [*content deidentify*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectContentDeidentifyCall.html), [*content inspect*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectContentInspectCall.html), [*content reidentify*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectContentReidentifyCall.html), [*deidentify templates create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDeidentifyTemplateGetCall.html), [*deidentify templates list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDeidentifyTemplateListCall.html), [*deidentify templates patch*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDeidentifyTemplatePatchCall.html), [*dlp jobs cancel*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDlpJobCancelCall.html), [*dlp jobs create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDlpJobCreateCall.html), [*dlp jobs delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDlpJobDeleteCall.html), [*dlp jobs get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDlpJobGetCall.html), [*dlp jobs list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectDlpJobListCall.html), [*image redact*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectImageRedactCall.html), [*inspect templates create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectInspectTemplateCreateCall.html), [*inspect templates delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectInspectTemplateDeleteCall.html), [*inspect templates get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectInspectTemplateGetCall.html), [*inspect templates list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectInspectTemplateListCall.html), [*inspect templates patch*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectInspectTemplatePatchCall.html), [*job triggers activate*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectJobTriggerActivateCall.html), [*job triggers create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectJobTriggerCreateCall.html), [*job triggers delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectJobTriggerDeleteCall.html), [*job triggers get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectJobTriggerGetCall.html), [*job triggers list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectJobTriggerListCall.html), [*job triggers patch*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectJobTriggerPatchCall.html), [*locations content deidentify*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectLocationContentDeidentifyCall.html), [*stored info types create*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectStoredInfoTypeCreateCall.html), [*stored info types delete*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectStoredInfoTypeDeleteCall.html), [*stored info types get*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectStoredInfoTypeGetCall.html), [*stored info types list*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectStoredInfoTypeListCall.html) and [*stored info types patch*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.ProjectStoredInfoTypePatchCall.html) + * [*content deidentify*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectContentDeidentifyCall.html), [*content inspect*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectContentInspectCall.html), [*content reidentify*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectContentReidentifyCall.html), [*deidentify templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDeidentifyTemplateGetCall.html), [*deidentify templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDeidentifyTemplateListCall.html), [*deidentify templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDeidentifyTemplatePatchCall.html), [*dlp jobs cancel*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDlpJobCancelCall.html), [*dlp jobs create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDlpJobCreateCall.html), [*dlp jobs delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDlpJobDeleteCall.html), [*dlp jobs get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDlpJobGetCall.html), [*dlp jobs list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectDlpJobListCall.html), [*image redact*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectImageRedactCall.html), [*inspect templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectInspectTemplateCreateCall.html), [*inspect templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectInspectTemplateDeleteCall.html), [*inspect templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectInspectTemplateGetCall.html), [*inspect templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectInspectTemplateListCall.html), [*inspect templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectInspectTemplatePatchCall.html), [*job triggers activate*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectJobTriggerActivateCall.html), [*job triggers create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectJobTriggerCreateCall.html), [*job triggers delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectJobTriggerDeleteCall.html), [*job triggers get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectJobTriggerGetCall.html), [*job triggers list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectJobTriggerListCall.html), [*job triggers patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectJobTriggerPatchCall.html), [*locations content deidentify*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationContentDeidentifyCall.html), [*locations content inspect*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationContentInspectCall.html), [*locations content reidentify*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationContentReidentifyCall.html), [*locations deidentify templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDeidentifyTemplateCreateCall.html), [*locations deidentify templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDeidentifyTemplateDeleteCall.html), [*locations deidentify templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDeidentifyTemplateGetCall.html), [*locations deidentify templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDeidentifyTemplateListCall.html), [*locations deidentify templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDeidentifyTemplatePatchCall.html), [*locations dlp jobs cancel*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDlpJobCancelCall.html), [*locations dlp jobs create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDlpJobCreateCall.html), [*locations dlp jobs delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDlpJobDeleteCall.html), [*locations dlp jobs finish*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDlpJobFinishCall.html), [*locations dlp jobs get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDlpJobGetCall.html), [*locations dlp jobs hybrid inspect*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDlpJobHybridInspectCall.html), [*locations dlp jobs list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationDlpJobListCall.html), [*locations image redact*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationImageRedactCall.html), [*locations inspect templates create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationInspectTemplateCreateCall.html), [*locations inspect templates delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationInspectTemplateDeleteCall.html), [*locations inspect templates get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationInspectTemplateGetCall.html), [*locations inspect templates list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationInspectTemplateListCall.html), [*locations inspect templates patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationInspectTemplatePatchCall.html), [*locations job triggers activate*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationJobTriggerActivateCall.html), [*locations job triggers create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationJobTriggerCreateCall.html), [*locations job triggers delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationJobTriggerDeleteCall.html), [*locations job triggers get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationJobTriggerGetCall.html), [*locations job triggers hybrid inspect*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationJobTriggerHybridInspectCall.html), [*locations job triggers list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationJobTriggerListCall.html), [*locations job triggers patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationJobTriggerPatchCall.html), [*locations stored info types create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationStoredInfoTypeCreateCall.html), [*locations stored info types delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationStoredInfoTypeDeleteCall.html), [*locations stored info types get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationStoredInfoTypeGetCall.html), [*locations stored info types list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationStoredInfoTypeListCall.html), [*locations stored info types patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectLocationStoredInfoTypePatchCall.html), [*stored info types create*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectStoredInfoTypeCreateCall.html), [*stored info types delete*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectStoredInfoTypeDeleteCall.html), [*stored info types get*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectStoredInfoTypeGetCall.html), [*stored info types list*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectStoredInfoTypeListCall.html) and [*stored info types patch*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.ProjectStoredInfoTypePatchCall.html) @@ -27,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/struct.DLP.html)** +* **[Hub](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/struct.DLP.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.Part.html)** + * **[Parts](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -52,14 +54,24 @@ Or specifically ... ```ignore let r = hub.projects().deidentify_templates_delete(...).doit() -let r = hub.projects().inspect_templates_delete(...).doit() -let r = hub.projects().job_triggers_delete(...).doit() +let r = hub.organizations().locations_deidentify_templates_delete(...).doit() +let r = hub.projects().locations_stored_info_types_delete(...).doit() +let r = hub.organizations().locations_inspect_templates_delete(...).doit() +let r = hub.projects().locations_deidentify_templates_delete(...).doit() +let r = hub.projects().locations_dlp_jobs_finish(...).doit() let r = hub.projects().dlp_jobs_cancel(...).doit() let r = hub.projects().stored_info_types_delete(...).doit() +let r = hub.organizations().locations_stored_info_types_delete(...).doit() +let r = hub.projects().job_triggers_delete(...).doit() let r = hub.organizations().stored_info_types_delete(...).doit() +let r = hub.projects().locations_dlp_jobs_delete(...).doit() +let r = hub.projects().locations_dlp_jobs_cancel(...).doit() let r = hub.organizations().deidentify_templates_delete(...).doit() let r = hub.projects().dlp_jobs_delete(...).doit() +let r = hub.projects().inspect_templates_delete(...).doit() +let r = hub.projects().locations_job_triggers_delete(...).doit() let r = hub.organizations().inspect_templates_delete(...).doit() +let r = hub.projects().locations_inspect_templates_delete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -93,7 +105,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_dlp2 as dlp2; -use dlp2::GooglePrivacyDlpV2CancelDlpJobRequest; +use dlp2::GooglePrivacyDlpV2FinishDlpJobRequest; use dlp2::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -114,12 +126,12 @@ let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector: // 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 = GooglePrivacyDlpV2CancelDlpJobRequest::default(); +let mut req = GooglePrivacyDlpV2FinishDlpJobRequest::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().dlp_jobs_cancel(req, "name") +let result = hub.projects().locations_dlp_jobs_finish(req, "name") .doit(); match result { @@ -142,17 +154,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -162,29 +174,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dlp2/1.0.12+20190629/google_dlp2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dlp2/1.0.13+20200405/google_dlp2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dlp2/src/lib.rs b/gen/dlp2/src/lib.rs index 7508933c20..f57a7065f9 100644 --- a/gen/dlp2/src/lib.rs +++ b/gen/dlp2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *DLP* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *dlp:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *DLP* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *dlp:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *DLP* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/dlp/docs/). @@ -13,10 +13,12 @@ //! //! * info types //! * [*list*](struct.InfoTypeListCall.html) +//! * locations +//! * [*info types list*](struct.LocationInfoTypeListCall.html) //! * organizations -//! * [*deidentify templates create*](struct.OrganizationDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](struct.OrganizationDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](struct.OrganizationDeidentifyTemplateGetCall.html), [*deidentify templates list*](struct.OrganizationDeidentifyTemplateListCall.html), [*deidentify templates patch*](struct.OrganizationDeidentifyTemplatePatchCall.html), [*inspect templates create*](struct.OrganizationInspectTemplateCreateCall.html), [*inspect templates delete*](struct.OrganizationInspectTemplateDeleteCall.html), [*inspect templates get*](struct.OrganizationInspectTemplateGetCall.html), [*inspect templates list*](struct.OrganizationInspectTemplateListCall.html), [*inspect templates patch*](struct.OrganizationInspectTemplatePatchCall.html), [*stored info types create*](struct.OrganizationStoredInfoTypeCreateCall.html), [*stored info types delete*](struct.OrganizationStoredInfoTypeDeleteCall.html), [*stored info types get*](struct.OrganizationStoredInfoTypeGetCall.html), [*stored info types list*](struct.OrganizationStoredInfoTypeListCall.html) and [*stored info types patch*](struct.OrganizationStoredInfoTypePatchCall.html) +//! * [*deidentify templates create*](struct.OrganizationDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](struct.OrganizationDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](struct.OrganizationDeidentifyTemplateGetCall.html), [*deidentify templates list*](struct.OrganizationDeidentifyTemplateListCall.html), [*deidentify templates patch*](struct.OrganizationDeidentifyTemplatePatchCall.html), [*inspect templates create*](struct.OrganizationInspectTemplateCreateCall.html), [*inspect templates delete*](struct.OrganizationInspectTemplateDeleteCall.html), [*inspect templates get*](struct.OrganizationInspectTemplateGetCall.html), [*inspect templates list*](struct.OrganizationInspectTemplateListCall.html), [*inspect templates patch*](struct.OrganizationInspectTemplatePatchCall.html), [*locations deidentify templates create*](struct.OrganizationLocationDeidentifyTemplateCreateCall.html), [*locations deidentify templates delete*](struct.OrganizationLocationDeidentifyTemplateDeleteCall.html), [*locations deidentify templates get*](struct.OrganizationLocationDeidentifyTemplateGetCall.html), [*locations deidentify templates list*](struct.OrganizationLocationDeidentifyTemplateListCall.html), [*locations deidentify templates patch*](struct.OrganizationLocationDeidentifyTemplatePatchCall.html), [*locations inspect templates create*](struct.OrganizationLocationInspectTemplateCreateCall.html), [*locations inspect templates delete*](struct.OrganizationLocationInspectTemplateDeleteCall.html), [*locations inspect templates get*](struct.OrganizationLocationInspectTemplateGetCall.html), [*locations inspect templates list*](struct.OrganizationLocationInspectTemplateListCall.html), [*locations inspect templates patch*](struct.OrganizationLocationInspectTemplatePatchCall.html), [*locations stored info types create*](struct.OrganizationLocationStoredInfoTypeCreateCall.html), [*locations stored info types delete*](struct.OrganizationLocationStoredInfoTypeDeleteCall.html), [*locations stored info types get*](struct.OrganizationLocationStoredInfoTypeGetCall.html), [*locations stored info types list*](struct.OrganizationLocationStoredInfoTypeListCall.html), [*locations stored info types patch*](struct.OrganizationLocationStoredInfoTypePatchCall.html), [*stored info types create*](struct.OrganizationStoredInfoTypeCreateCall.html), [*stored info types delete*](struct.OrganizationStoredInfoTypeDeleteCall.html), [*stored info types get*](struct.OrganizationStoredInfoTypeGetCall.html), [*stored info types list*](struct.OrganizationStoredInfoTypeListCall.html) and [*stored info types patch*](struct.OrganizationStoredInfoTypePatchCall.html) //! * projects -//! * [*content deidentify*](struct.ProjectContentDeidentifyCall.html), [*content inspect*](struct.ProjectContentInspectCall.html), [*content reidentify*](struct.ProjectContentReidentifyCall.html), [*deidentify templates create*](struct.ProjectDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](struct.ProjectDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](struct.ProjectDeidentifyTemplateGetCall.html), [*deidentify templates list*](struct.ProjectDeidentifyTemplateListCall.html), [*deidentify templates patch*](struct.ProjectDeidentifyTemplatePatchCall.html), [*dlp jobs cancel*](struct.ProjectDlpJobCancelCall.html), [*dlp jobs create*](struct.ProjectDlpJobCreateCall.html), [*dlp jobs delete*](struct.ProjectDlpJobDeleteCall.html), [*dlp jobs get*](struct.ProjectDlpJobGetCall.html), [*dlp jobs list*](struct.ProjectDlpJobListCall.html), [*image redact*](struct.ProjectImageRedactCall.html), [*inspect templates create*](struct.ProjectInspectTemplateCreateCall.html), [*inspect templates delete*](struct.ProjectInspectTemplateDeleteCall.html), [*inspect templates get*](struct.ProjectInspectTemplateGetCall.html), [*inspect templates list*](struct.ProjectInspectTemplateListCall.html), [*inspect templates patch*](struct.ProjectInspectTemplatePatchCall.html), [*job triggers activate*](struct.ProjectJobTriggerActivateCall.html), [*job triggers create*](struct.ProjectJobTriggerCreateCall.html), [*job triggers delete*](struct.ProjectJobTriggerDeleteCall.html), [*job triggers get*](struct.ProjectJobTriggerGetCall.html), [*job triggers list*](struct.ProjectJobTriggerListCall.html), [*job triggers patch*](struct.ProjectJobTriggerPatchCall.html), [*locations content deidentify*](struct.ProjectLocationContentDeidentifyCall.html), [*stored info types create*](struct.ProjectStoredInfoTypeCreateCall.html), [*stored info types delete*](struct.ProjectStoredInfoTypeDeleteCall.html), [*stored info types get*](struct.ProjectStoredInfoTypeGetCall.html), [*stored info types list*](struct.ProjectStoredInfoTypeListCall.html) and [*stored info types patch*](struct.ProjectStoredInfoTypePatchCall.html) +//! * [*content deidentify*](struct.ProjectContentDeidentifyCall.html), [*content inspect*](struct.ProjectContentInspectCall.html), [*content reidentify*](struct.ProjectContentReidentifyCall.html), [*deidentify templates create*](struct.ProjectDeidentifyTemplateCreateCall.html), [*deidentify templates delete*](struct.ProjectDeidentifyTemplateDeleteCall.html), [*deidentify templates get*](struct.ProjectDeidentifyTemplateGetCall.html), [*deidentify templates list*](struct.ProjectDeidentifyTemplateListCall.html), [*deidentify templates patch*](struct.ProjectDeidentifyTemplatePatchCall.html), [*dlp jobs cancel*](struct.ProjectDlpJobCancelCall.html), [*dlp jobs create*](struct.ProjectDlpJobCreateCall.html), [*dlp jobs delete*](struct.ProjectDlpJobDeleteCall.html), [*dlp jobs get*](struct.ProjectDlpJobGetCall.html), [*dlp jobs list*](struct.ProjectDlpJobListCall.html), [*image redact*](struct.ProjectImageRedactCall.html), [*inspect templates create*](struct.ProjectInspectTemplateCreateCall.html), [*inspect templates delete*](struct.ProjectInspectTemplateDeleteCall.html), [*inspect templates get*](struct.ProjectInspectTemplateGetCall.html), [*inspect templates list*](struct.ProjectInspectTemplateListCall.html), [*inspect templates patch*](struct.ProjectInspectTemplatePatchCall.html), [*job triggers activate*](struct.ProjectJobTriggerActivateCall.html), [*job triggers create*](struct.ProjectJobTriggerCreateCall.html), [*job triggers delete*](struct.ProjectJobTriggerDeleteCall.html), [*job triggers get*](struct.ProjectJobTriggerGetCall.html), [*job triggers list*](struct.ProjectJobTriggerListCall.html), [*job triggers patch*](struct.ProjectJobTriggerPatchCall.html), [*locations content deidentify*](struct.ProjectLocationContentDeidentifyCall.html), [*locations content inspect*](struct.ProjectLocationContentInspectCall.html), [*locations content reidentify*](struct.ProjectLocationContentReidentifyCall.html), [*locations deidentify templates create*](struct.ProjectLocationDeidentifyTemplateCreateCall.html), [*locations deidentify templates delete*](struct.ProjectLocationDeidentifyTemplateDeleteCall.html), [*locations deidentify templates get*](struct.ProjectLocationDeidentifyTemplateGetCall.html), [*locations deidentify templates list*](struct.ProjectLocationDeidentifyTemplateListCall.html), [*locations deidentify templates patch*](struct.ProjectLocationDeidentifyTemplatePatchCall.html), [*locations dlp jobs cancel*](struct.ProjectLocationDlpJobCancelCall.html), [*locations dlp jobs create*](struct.ProjectLocationDlpJobCreateCall.html), [*locations dlp jobs delete*](struct.ProjectLocationDlpJobDeleteCall.html), [*locations dlp jobs finish*](struct.ProjectLocationDlpJobFinishCall.html), [*locations dlp jobs get*](struct.ProjectLocationDlpJobGetCall.html), [*locations dlp jobs hybrid inspect*](struct.ProjectLocationDlpJobHybridInspectCall.html), [*locations dlp jobs list*](struct.ProjectLocationDlpJobListCall.html), [*locations image redact*](struct.ProjectLocationImageRedactCall.html), [*locations inspect templates create*](struct.ProjectLocationInspectTemplateCreateCall.html), [*locations inspect templates delete*](struct.ProjectLocationInspectTemplateDeleteCall.html), [*locations inspect templates get*](struct.ProjectLocationInspectTemplateGetCall.html), [*locations inspect templates list*](struct.ProjectLocationInspectTemplateListCall.html), [*locations inspect templates patch*](struct.ProjectLocationInspectTemplatePatchCall.html), [*locations job triggers activate*](struct.ProjectLocationJobTriggerActivateCall.html), [*locations job triggers create*](struct.ProjectLocationJobTriggerCreateCall.html), [*locations job triggers delete*](struct.ProjectLocationJobTriggerDeleteCall.html), [*locations job triggers get*](struct.ProjectLocationJobTriggerGetCall.html), [*locations job triggers hybrid inspect*](struct.ProjectLocationJobTriggerHybridInspectCall.html), [*locations job triggers list*](struct.ProjectLocationJobTriggerListCall.html), [*locations job triggers patch*](struct.ProjectLocationJobTriggerPatchCall.html), [*locations stored info types create*](struct.ProjectLocationStoredInfoTypeCreateCall.html), [*locations stored info types delete*](struct.ProjectLocationStoredInfoTypeDeleteCall.html), [*locations stored info types get*](struct.ProjectLocationStoredInfoTypeGetCall.html), [*locations stored info types list*](struct.ProjectLocationStoredInfoTypeListCall.html), [*locations stored info types patch*](struct.ProjectLocationStoredInfoTypePatchCall.html), [*stored info types create*](struct.ProjectStoredInfoTypeCreateCall.html), [*stored info types delete*](struct.ProjectStoredInfoTypeDeleteCall.html), [*stored info types get*](struct.ProjectStoredInfoTypeGetCall.html), [*stored info types list*](struct.ProjectStoredInfoTypeListCall.html) and [*stored info types patch*](struct.ProjectStoredInfoTypePatchCall.html) //! //! //! @@ -52,14 +54,24 @@ //! //! ```ignore //! let r = hub.projects().deidentify_templates_delete(...).doit() -//! let r = hub.projects().inspect_templates_delete(...).doit() -//! let r = hub.projects().job_triggers_delete(...).doit() +//! let r = hub.organizations().locations_deidentify_templates_delete(...).doit() +//! let r = hub.projects().locations_stored_info_types_delete(...).doit() +//! let r = hub.organizations().locations_inspect_templates_delete(...).doit() +//! let r = hub.projects().locations_deidentify_templates_delete(...).doit() +//! let r = hub.projects().locations_dlp_jobs_finish(...).doit() //! let r = hub.projects().dlp_jobs_cancel(...).doit() //! let r = hub.projects().stored_info_types_delete(...).doit() +//! let r = hub.organizations().locations_stored_info_types_delete(...).doit() +//! let r = hub.projects().job_triggers_delete(...).doit() //! let r = hub.organizations().stored_info_types_delete(...).doit() +//! let r = hub.projects().locations_dlp_jobs_delete(...).doit() +//! let r = hub.projects().locations_dlp_jobs_cancel(...).doit() //! let r = hub.organizations().deidentify_templates_delete(...).doit() //! let r = hub.projects().dlp_jobs_delete(...).doit() +//! let r = hub.projects().inspect_templates_delete(...).doit() +//! let r = hub.projects().locations_job_triggers_delete(...).doit() //! let r = hub.organizations().inspect_templates_delete(...).doit() +//! let r = hub.projects().locations_inspect_templates_delete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -93,7 +105,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_dlp2 as dlp2; -//! use dlp2::GooglePrivacyDlpV2CancelDlpJobRequest; +//! use dlp2::GooglePrivacyDlpV2FinishDlpJobRequest; //! use dlp2::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -115,12 +127,12 @@ //! // 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 = GooglePrivacyDlpV2CancelDlpJobRequest::default(); +//! let mut req = GooglePrivacyDlpV2FinishDlpJobRequest::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().dlp_jobs_cancel(req, "name") +//! let result = hub.projects().locations_dlp_jobs_finish(req, "name") //! .doit(); //! //! match result { @@ -276,7 +288,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_dlp2 as dlp2; -/// use dlp2::GooglePrivacyDlpV2CancelDlpJobRequest; +/// use dlp2::GooglePrivacyDlpV2FinishDlpJobRequest; /// use dlp2::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -298,12 +310,12 @@ impl Default for Scope { /// // 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 = GooglePrivacyDlpV2CancelDlpJobRequest::default(); +/// let mut req = GooglePrivacyDlpV2FinishDlpJobRequest::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().dlp_jobs_cancel(req, "name") +/// let result = hub.projects().locations_dlp_jobs_finish(req, "name") /// .doit(); /// /// match result { @@ -341,7 +353,7 @@ impl<'a, C, A> DLP DLP { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://dlp.googleapis.com/".to_string(), _root_url: "https://dlp.googleapis.com/".to_string(), } @@ -350,6 +362,9 @@ impl<'a, C, A> DLP pub fn info_types(&'a self) -> InfoTypeMethods<'a, C, A> { InfoTypeMethods { hub: &self } } + pub fn locations(&'a self) -> LocationMethods<'a, C, A> { + LocationMethods { hub: &self } + } pub fn organizations(&'a self) -> OrganizationMethods<'a, C, A> { OrganizationMethods { hub: &self } } @@ -358,7 +373,7 @@ impl<'a, C, A> DLP } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -386,7 +401,7 @@ impl<'a, C, A> DLP // ############ // SCHEMAS ### // ########## -/// There is no detailed description. +/// Controls what and how to inspect for findings. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -420,15 +435,20 @@ impl Part for GooglePrivacyDlpV2InspectJobConfig {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [dlp jobs create projects](struct.ProjectDlpJobCreateCall.html) (request) +/// * [locations dlp jobs create projects](struct.ProjectLocationDlpJobCreateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2CreateDlpJobRequest { - /// no description provided + /// Set to choose what metric to calculate. #[serde(rename="riskJob")] pub risk_job: Option, - /// no description provided + /// Set to control what and how to inspect. #[serde(rename="inspectJob")] pub inspect_job: Option, + /// The geographic location to store and process the job. Reserved for + /// future extensions. + #[serde(rename="locationId")] + pub location_id: Option, /// The job id can contain uppercase and lowercase letters, /// numbers, and hyphens; that is, it must match the regular /// expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 @@ -449,22 +469,28 @@ impl RequestValue for GooglePrivacyDlpV2CreateDlpJobRequest {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [image redact projects](struct.ProjectImageRedactCall.html) (request) +/// * [locations image redact projects](struct.ProjectLocationImageRedactCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2RedactImageRequest { /// The content must be PNG, JPEG, SVG or BMP. #[serde(rename="byteItem")] pub byte_item: Option, + /// The geographic location to process the request. Reserved for future + /// extensions. + /// Location is restricted to 'global', 'us', 'asia', and 'europe'. + #[serde(rename="locationId")] + pub location_id: Option, /// Configuration for the inspector. #[serde(rename="inspectConfig")] pub inspect_config: Option, + /// The configuration for specifying what content to redact from images. + #[serde(rename="imageRedactionConfigs")] + pub image_redaction_configs: Option>, /// Whether the response should include findings along with the redacted /// image. #[serde(rename="includeFindings")] pub include_findings: Option, - /// The configuration for specifying what content to redact from images. - #[serde(rename="imageRedactionConfigs")] - pub image_redaction_configs: Option>, } impl RequestValue for GooglePrivacyDlpV2RedactImageRequest {} @@ -485,6 +511,10 @@ pub struct GooglePrivacyDlpV2DeidentifyConfig { /// a column within a table. #[serde(rename="recordTransformations")] pub record_transformations: Option, + /// Mode for handling transformation errors. If left unspecified, the default + /// mode is `TransformationErrorHandling.ThrowError`. + #[serde(rename="transformationErrorHandling")] + pub transformation_error_handling: Option, } impl Part for GooglePrivacyDlpV2DeidentifyConfig {} @@ -498,6 +528,8 @@ impl Part for GooglePrivacyDlpV2DeidentifyConfig {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [stored info types list organizations](struct.OrganizationStoredInfoTypeListCall.html) (response) +/// * [locations stored info types list projects](struct.ProjectLocationStoredInfoTypeListCall.html) (response) +/// * [locations stored info types list organizations](struct.OrganizationLocationStoredInfoTypeListCall.html) (response) /// * [stored info types list projects](struct.ProjectStoredInfoTypeListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -553,6 +585,23 @@ pub struct GooglePrivacyDlpV2InspectionRule { impl Part for GooglePrivacyDlpV2InspectionRule {} +/// An individual hybrid item to inspect. Will be stored temporarily during +/// processing. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2HybridContentItem { + /// Supplementary information that will be added to each finding. + #[serde(rename="findingDetails")] + pub finding_details: Option, + /// The item to inspect. + pub item: Option, +} + +impl Part for GooglePrivacyDlpV2HybridContentItem {} + + /// Replaces an identifier with a surrogate using Format Preserving Encryption /// (FPE) with the FFX mode of operation; however when used in the /// `ReidentifyContent` API method, it serves the opposite function by reversing @@ -571,19 +620,19 @@ impl Part for GooglePrivacyDlpV2InspectionRule {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig { - /// The key used by the encryption algorithm. [required] + /// Required. The key used by the encryption algorithm. #[serde(rename="cryptoKey")] pub crypto_key: Option, /// This is supported by mapping these to the alphanumeric characters /// that the FFX mode natively supports. This happens before/after /// encryption/decryption. /// Each character listed must appear only once. - /// Number of characters must be in the range [2, 62]. + /// Number of characters must be in the range [2, 95]. /// This must be encoded as ASCII. /// The order of characters does not matter. #[serde(rename="customAlphabet")] pub custom_alphabet: Option, - /// The native way to select the alphabet. Must be in the range [2, 62]. + /// The native way to select the alphabet. Must be in the range [2, 95]. pub radix: Option, /// The 'tweak', a context may be used for higher security since the same /// identifier in two different contexts won't be given the same surrogate. If @@ -633,7 +682,7 @@ pub struct GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig { /// ⧝MY_TOKEN_TYPE #[serde(rename="surrogateInfoType")] pub surrogate_info_type: Option, - /// no description provided + /// Common alphabets. #[serde(rename="commonAlphabet")] pub common_alphabet: Option, } @@ -647,7 +696,7 @@ impl Part for GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2QuasiId { - /// Identifies the column. [required] + /// Required. Identifies the column. pub field: Option, /// A column can be tagged with a custom tag. In this case, the user must /// indicate an auxiliary table that contains statistical information on @@ -669,40 +718,47 @@ pub struct GooglePrivacyDlpV2QuasiId { impl Part for GooglePrivacyDlpV2QuasiId {} -/// Configuration of the timespan of the items to include in scanning. -/// Currently only supported when inspecting Google Cloud Storage and BigQuery. +/// Configuration to control jobs where the content being inspected is outside +/// of Google Cloud Platform. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2TimespanConfig { - /// Specification of the field containing the timestamp of scanned items. - /// Used for data sources like Datastore or BigQuery. - /// If not specified for BigQuery, table last modification timestamp - /// is checked against given time span. - /// The valid data types of the timestamp field are: - /// for BigQuery - timestamp, date, datetime; - /// for Datastore - timestamp. - /// Datastore entity will be scanned if the timestamp property does not exist - /// or its value is empty or invalid. - #[serde(rename="timestampField")] - pub timestamp_field: Option, - /// Exclude files or rows newer than this value. - /// If set to zero, no upper time limit is applied. - #[serde(rename="endTime")] - pub end_time: Option, - /// Exclude files or rows older than this value. - #[serde(rename="startTime")] - pub start_time: Option, - /// When the job is started by a JobTrigger we will automatically figure out - /// a valid start_time to avoid scanning files that have not been modified - /// since the last time the JobTrigger executed. This will be based on the - /// time of the execution of the last run of the JobTrigger. - #[serde(rename="enableAutoPopulationOfTimespanConfig")] - pub enable_auto_population_of_timespan_config: Option, +pub struct GooglePrivacyDlpV2HybridOptions { + /// If the container is a table, additional information to make findings + /// meaningful such as the columns that are primary keys. + #[serde(rename="tableOptions")] + pub table_options: Option, + /// To organize findings, these labels will be added to each finding. + /// + /// Label keys must be between 1 and 63 characters long and must conform + /// to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + /// + /// Label values must be between 0 and 63 characters long and must conform + /// to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + /// + /// No more than 10 labels can be associated with a given finding. + /// + /// Examples: + /// * `"environment" : "production"` + /// * `"pipeline" : "etl"` + pub labels: Option>, + /// These are labels that each inspection request must include within their + /// 'finding_labels' map. Request may contain others, but any missing one of + /// these will be rejected. + /// + /// Label keys must be between 1 and 63 characters long and must conform + /// to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + /// + /// No more than 10 keys can be required. + #[serde(rename="requiredFindingLabelKeys")] + pub required_finding_label_keys: Option>, + /// A short description of where the data is coming from. Will be stored once + /// in the job. 256 max length. + pub description: Option, } -impl Part for GooglePrivacyDlpV2TimespanConfig {} +impl Part for GooglePrivacyDlpV2HybridOptions {} /// Request message for UpdateInspectTemplate. @@ -712,6 +768,8 @@ impl Part for GooglePrivacyDlpV2TimespanConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations inspect templates patch projects](struct.ProjectLocationInspectTemplatePatchCall.html) (request) +/// * [locations inspect templates patch organizations](struct.OrganizationLocationInspectTemplatePatchCall.html) (request) /// * [inspect templates patch projects](struct.ProjectInspectTemplatePatchCall.html) (request) /// * [inspect templates patch organizations](struct.OrganizationInspectTemplatePatchCall.html) (request) /// @@ -776,7 +834,7 @@ pub struct GooglePrivacyDlpV2CryptoDeterministicConfig { /// The key used by the encryption function. #[serde(rename="cryptoKey")] pub crypto_key: Option, - /// Optional. A context may be used for higher security and maintaining + /// A context may be used for higher security and maintaining /// referential integrity such that the same identifier in two different /// contexts will be given a distinct surrogate. The context is appended to /// plaintext value being encrypted. On decryption the provided context is @@ -799,7 +857,7 @@ pub struct GooglePrivacyDlpV2CryptoDeterministicConfig { /// This annotation will be applied to the surrogate by prefixing it with /// the name of the custom info type followed by the number of /// characters comprising the surrogate. The following scheme defines the - /// format: (): + /// format: {info type name}({surrogate character count}):{surrogate} /// /// For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and /// the surrogate is 'abc', the full replacement value @@ -809,6 +867,11 @@ pub struct GooglePrivacyDlpV2CryptoDeterministicConfig { /// custom info type 'Surrogate'. This facilitates reversal of the /// surrogate when it occurs in free text. /// + /// Note: For record transformations where the entire cell in a table is being + /// transformed, surrogates are not mandatory. Surrogates are used to denote + /// the location of the token and are necessary for re-identification in free + /// form text. + /// /// In order for inspection to work properly, the name of this info type must /// not occur naturally anywhere in your data; otherwise, inspection may either /// @@ -821,7 +884,7 @@ pub struct GooglePrivacyDlpV2CryptoDeterministicConfig { /// that are highly improbable to exist in your data. /// For example, assuming your data is entered from a regular ASCII keyboard, /// the symbol with the hex code point 29DD might be used like so: - /// ⧝MY_TOKEN_TYPE + /// ⧝MY_TOKEN_TYPE. #[serde(rename="surrogateInfoType")] pub surrogate_info_type: Option, } @@ -829,26 +892,23 @@ pub struct GooglePrivacyDlpV2CryptoDeterministicConfig { impl Part for GooglePrivacyDlpV2CryptoDeterministicConfig {} -/// This is a data encryption key (DEK) (as opposed to -/// a key encryption key (KEK) stored by KMS). -/// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate -/// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot -/// unwrap the data crypto key. +/// Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the +/// results of the DlpJob will be applied to the entry for the resource scanned +/// in Cloud Data Catalog. Any labels previously written by another DlpJob will +/// be deleted. InfoType naming patterns are strictly enforced when using this +/// feature. Note that the findings will be persisted in Cloud Data Catalog +/// storage and are governed by Data Catalog service-specific policy, see +/// https://cloud.google.com/terms/service-terms +/// Only a single instance of this action can be specified and only allowed if +/// all resources being scanned are BigQuery tables. +/// Compatible with: Inspect /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2CryptoKey { - /// no description provided - #[serde(rename="kmsWrapped")] - pub kms_wrapped: Option, - /// no description provided - pub unwrapped: Option, - /// no description provided - pub transient: Option, -} +pub struct GooglePrivacyDlpV2PublishFindingsToCloudDataCatalog { _never_set: Option } -impl Part for GooglePrivacyDlpV2CryptoKey {} +impl Part for GooglePrivacyDlpV2PublishFindingsToCloudDataCatalog {} /// Response message for ListInspectTemplates. @@ -859,7 +919,9 @@ impl Part for GooglePrivacyDlpV2CryptoKey {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [inspect templates list projects](struct.ProjectInspectTemplateListCall.html) (response) +/// * [locations inspect templates list organizations](struct.OrganizationLocationInspectTemplateListCall.html) (response) /// * [inspect templates list organizations](struct.OrganizationInspectTemplateListCall.html) (response) +/// * [locations inspect templates list projects](struct.ProjectLocationInspectTemplateListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2ListInspectTemplatesResponse { @@ -885,7 +947,7 @@ pub struct GooglePrivacyDlpV2RecordKey { #[serde(rename="bigQueryKey")] pub big_query_key: Option, /// Values of identifying columns in the given row. Order of values matches - /// the order of field identifiers specified in the scanning request. + /// the order of `identifying_fields` specified in the scanning request. #[serde(rename="idValues")] pub id_values: Option>, /// no description provided @@ -908,14 +970,13 @@ impl Part for GooglePrivacyDlpV2RecordKey {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2AuxiliaryTable { - /// Auxiliary table location. [required] + /// Required. Auxiliary table location. pub table: Option, - /// The relative frequency column must contain a floating-point number + /// Required. The relative frequency column must contain a floating-point number /// between 0 and 1 (inclusive). Null values are assumed to be zero. - /// [required] #[serde(rename="relativeFrequency")] pub relative_frequency: Option, - /// Quasi-identifier columns. [required] + /// Required. Quasi-identifier columns. #[serde(rename="quasiIds")] pub quasi_ids: Option>, } @@ -946,6 +1007,7 @@ impl Part for GooglePrivacyDlpV2ValueFrequency {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [job triggers activate projects](struct.ProjectJobTriggerActivateCall.html) (request) +/// * [locations job triggers activate projects](struct.ProjectLocationJobTriggerActivateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2ActivateJobTriggerRequest { _never_set: Option } @@ -980,6 +1042,7 @@ impl Part for GooglePrivacyDlpV2PublishToPubSub {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [info types list locations](struct.LocationInfoTypeListCall.html) (response) /// * [list info types](struct.InfoTypeListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1044,6 +1107,31 @@ pub struct GooglePrivacyDlpV2KAnonymityResult { impl Part for GooglePrivacyDlpV2KAnonymityResult {} +/// Configuration to control the number of findings returned. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2FindingLimits { + /// Max number of findings that will be returned per request/job. + /// When set within `InspectContentRequest`, the maximum returned is 2000 + /// regardless if this is set higher. + #[serde(rename="maxFindingsPerRequest")] + pub max_findings_per_request: Option, + /// Configuration of findings limit given for specified infoTypes. + #[serde(rename="maxFindingsPerInfoType")] + pub max_findings_per_info_type: Option>, + /// Max number of findings that will be returned for each item scanned. + /// When set within `InspectJobConfig`, + /// the maximum returned is 2000 regardless if this is set higher. + /// When set within `InspectContentRequest`, this field is ignored. + #[serde(rename="maxFindingsPerItem")] + pub max_findings_per_item: Option, +} + +impl Part for GooglePrivacyDlpV2FindingLimits {} + + /// Bounding box encompassing detected text within an image. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1110,7 +1198,7 @@ pub struct GooglePrivacyDlpV2ImageRedactionConfig { impl Part for GooglePrivacyDlpV2ImageRedactionConfig {} -/// There is no detailed description. +/// Histogram of value frequencies in the column. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1153,39 +1241,17 @@ pub struct GooglePrivacyDlpV2ByteContentItem { impl Part for GooglePrivacyDlpV2ByteContentItem {} -/// The field type of `value` and `field` do not need to match to be -/// considered equal, but not all comparisons are possible. -/// EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types, -/// but all other comparisons are invalid with incompatible types. -/// A `value` of type: -/// -/// - `string` can be compared against all other types -/// - `boolean` can only be compared against other booleans -/// - `integer` can be compared against doubles or a string if the string value -/// can be parsed as an integer. -/// - `double` can be compared against integers or a string if the string can -/// be parsed as a double. -/// - `Timestamp` can be compared against strings in RFC 3339 date string -/// format. -/// - `TimeOfDay` can be compared against timestamps and strings in the format -/// of 'HH:mm:ss'. -/// -/// If we fail to compare do to type mismatch, a warning will be given and -/// the condition will evaluate to false. +/// Enable Stackdriver metric dlp.googleapis.com/finding_count. This +/// will publish a metric to stack driver on each infotype requested and +/// how many findings were found for it. CustomDetectors will be bucketed +/// as 'Custom' under the Stackdriver label 'info_type'. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2Condition { - /// Operator used to compare the field or infoType to the value. [required] - pub operator: Option, - /// Field within the record this condition is evaluated against. [required] - pub field: Option, - /// Value to compare against. [Required, except for `EXISTS` tests.] - pub value: Option, -} +pub struct GooglePrivacyDlpV2PublishToStackdriver { _never_set: Option } -impl Part for GooglePrivacyDlpV2Condition {} +impl Part for GooglePrivacyDlpV2PublishToStackdriver {} /// An entity in a dataset is a field or set of fields that correspond to a @@ -1213,6 +1279,7 @@ impl Part for GooglePrivacyDlpV2EntityId {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [image redact projects](struct.ProjectImageRedactCall.html) (response) +/// * [locations image redact projects](struct.ProjectLocationImageRedactCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2RedactImageResponse { @@ -1242,16 +1309,22 @@ impl ResponseResult for GooglePrivacyDlpV2RedactImageResponse {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [inspect templates get projects](struct.ProjectInspectTemplateGetCall.html) (response) -/// * [inspect templates get organizations](struct.OrganizationInspectTemplateGetCall.html) (response) +/// * [locations inspect templates patch projects](struct.ProjectLocationInspectTemplatePatchCall.html) (response) +/// * [locations inspect templates get projects](struct.ProjectLocationInspectTemplateGetCall.html) (response) +/// * [locations inspect templates get organizations](struct.OrganizationLocationInspectTemplateGetCall.html) (response) /// * [inspect templates patch projects](struct.ProjectInspectTemplatePatchCall.html) (response) -/// * [inspect templates patch organizations](struct.OrganizationInspectTemplatePatchCall.html) (response) +/// * [locations inspect templates patch organizations](struct.OrganizationLocationInspectTemplatePatchCall.html) (response) /// * [inspect templates create projects](struct.ProjectInspectTemplateCreateCall.html) (response) /// * [inspect templates create organizations](struct.OrganizationInspectTemplateCreateCall.html) (response) +/// * [inspect templates get projects](struct.ProjectInspectTemplateGetCall.html) (response) +/// * [inspect templates patch organizations](struct.OrganizationInspectTemplatePatchCall.html) (response) +/// * [locations inspect templates create organizations](struct.OrganizationLocationInspectTemplateCreateCall.html) (response) +/// * [locations inspect templates create projects](struct.ProjectLocationInspectTemplateCreateCall.html) (response) +/// * [inspect templates get organizations](struct.OrganizationInspectTemplateGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2InspectTemplate { - /// The last update timestamp of a inspectTemplate, output only field. + /// Output only. The last update timestamp of an inspectTemplate. #[serde(rename="updateTime")] pub update_time: Option, /// Display name (max 256 chars). @@ -1262,20 +1335,37 @@ pub struct GooglePrivacyDlpV2InspectTemplate { /// The core content of the template. Configuration of the scanning process. #[serde(rename="inspectConfig")] pub inspect_config: Option, - /// The creation timestamp of a inspectTemplate, output only field. + /// Output only. The creation timestamp of an inspectTemplate. #[serde(rename="createTime")] pub create_time: Option, - /// The template name. Output only. + /// Output only. The template name. /// /// The template will have one of the following formats: /// `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR - /// `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID` + /// `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`; pub name: Option, } impl ResponseResult for GooglePrivacyDlpV2InspectTemplate {} +/// Metadata Location +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2MetadataLocation { + /// Type of metadata containing the finding. + #[serde(rename="type")] + pub type_: Option, + /// Storage metadata. + #[serde(rename="storageLabel")] + pub storage_label: Option, +} + +impl Part for GooglePrivacyDlpV2MetadataLocation {} + + /// A quasi-identifier column has a custom_tag, used to know which column /// in the data corresponds to which column in the statistical model. /// @@ -1283,9 +1373,9 @@ impl ResponseResult for GooglePrivacyDlpV2InspectTemplate {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2QuasiIdField { - /// no description provided + /// Identifies the column. pub field: Option, - /// no description provided + /// A auxiliary field. #[serde(rename="customTag")] pub custom_tag: Option, } @@ -1313,7 +1403,7 @@ impl Part for GooglePrivacyDlpV2TableLocation {} /// the user for simple bucketing strategies. /// /// The transformed value will be a hyphenated string of -/// -, i.e if lower_bound = 10 and upper_bound = 20 +/// {lower_bound}-{upper_bound}, i.e if lower_bound = 10 and upper_bound = 20 /// all values that are within this bucket will be replaced with "10-20". /// /// This can be used on data of type: double, long. @@ -1328,21 +1418,20 @@ impl Part for GooglePrivacyDlpV2TableLocation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2FixedSizeBucketingConfig { - /// Lower bound value of buckets. All values less than `lower_bound` are + /// Required. Lower bound value of buckets. All values less than `lower_bound` are /// grouped together into a single bucket; for example if `lower_bound` = 10, - /// then all values less than 10 are replaced with the value “-10”. [Required]. + /// then all values less than 10 are replaced with the value “-10”. #[serde(rename="lowerBound")] pub lower_bound: Option, - /// Upper bound value of buckets. All values greater than upper_bound are + /// Required. Upper bound value of buckets. All values greater than upper_bound are /// grouped together into a single bucket; for example if `upper_bound` = 89, /// then all values greater than 89 are replaced with the value “89+”. - /// [Required]. #[serde(rename="upperBound")] pub upper_bound: Option, - /// Size of each bucket (except for minimum and maximum buckets). So if + /// Required. Size of each bucket (except for minimum and maximum buckets). So if /// `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the /// following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, - /// 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + /// 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. #[serde(rename="bucketSize")] pub bucket_size: Option, } @@ -1357,9 +1446,11 @@ impl Part for GooglePrivacyDlpV2FixedSizeBucketingConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2QuasiIdentifierField { - /// no description provided + /// Identifies the column. pub field: Option, - /// no description provided + /// A column can be tagged with a custom tag. In this case, the user must + /// indicate an auxiliary table that contains statistical information on + /// the possible values of this column (below). #[serde(rename="customTag")] pub custom_tag: Option, } @@ -1374,7 +1465,7 @@ impl Part for GooglePrivacyDlpV2QuasiIdentifierField {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2UnwrappedCryptoKey { - /// A 128/192/256 bit key. [required] + /// Required. A 128/192/256 bit key. pub key: Option, } @@ -1423,8 +1514,9 @@ pub struct GooglePrivacyDlpV2DeidentifyContentRequest { pub deidentify_config: Option, /// The geographic location to process de-identification. Reserved for future /// extensions. - pub location: Option, - /// Optional template to use. Any configuration directly specified in + #[serde(rename="locationId")] + pub location_id: Option, + /// Template to use. Any configuration directly specified in /// deidentify_config will override those set in the template. Singular fields /// that are set in this request will replace their corresponding fields in the /// template. Repeated fields are appended. Singular sub-messages and groups @@ -1436,7 +1528,7 @@ pub struct GooglePrivacyDlpV2DeidentifyContentRequest { /// inspect_template_name argument. #[serde(rename="inspectConfig")] pub inspect_config: Option, - /// Optional template to use. Any configuration directly specified in + /// Template to use. Any configuration directly specified in /// inspect_config will override those set in the template. Singular fields /// that are set in this request will replace their corresponding fields in the /// template. Repeated fields are appended. Singular sub-messages and groups @@ -1448,37 +1540,54 @@ pub struct GooglePrivacyDlpV2DeidentifyContentRequest { impl RequestValue for GooglePrivacyDlpV2DeidentifyContentRequest {} -/// Represents a piece of potentially sensitive content. +/// Represents a container that may contain DLP findings. +/// Examples of a container include a file, table, or database record. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2Finding { - /// Contains data parsed from quotes. Only populated if include_quote was set - /// to true and a supported infoType was requested. Currently supported - /// infoTypes: DATE, DATE_OF_BIRTH and TIME. - #[serde(rename="quoteInfo")] - pub quote_info: Option, - /// The type of content that might have been found. - /// Provided if `excluded_types` is false. - #[serde(rename="infoType")] - pub info_type: Option, - /// Where the content was found. - pub location: Option, - /// The content that was found. Even if the content is not textual, it - /// may be converted to a textual representation here. - /// Provided if `include_quote` is true and the finding is - /// less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes - /// in length, the quote may be omitted. - pub quote: Option, - /// Confidence of how likely it is that the `info_type` is correct. - pub likelihood: Option, - /// Timestamp when finding was detected. - #[serde(rename="createTime")] - pub create_time: Option, +pub struct GooglePrivacyDlpV2Container { + /// Findings container modification timestamp, if applicable. + /// For Google Cloud Storage contains last file modification timestamp. + /// For BigQuery table contains last_modified_time property. + /// For Datastore - not populated. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Findings container version, if available + /// ("generation" for Google Cloud Storage). + pub version: Option, + /// Project where the finding was found. + /// Can be different from the project that owns the finding. + #[serde(rename="projectId")] + pub project_id: Option, + /// The rest of the path after the root. + /// Examples: + /// - For BigQuery table `project_id:dataset_id.table_id`, the relative path is + /// `table_id` + /// - Google Cloud Storage file `gs://bucket/folder/filename.txt`, the relative + /// path is `folder/filename.txt` + #[serde(rename="relativePath")] + pub relative_path: Option, + /// A string representation of the full container name. + /// Examples: + /// - BigQuery: 'Project:DataSetId.TableId' + /// - Google Cloud Storage: 'gs://Bucket/folders/filename.txt' + #[serde(rename="fullPath")] + pub full_path: Option, + /// Container type, for example BigQuery or Google Cloud Storage. + #[serde(rename="type")] + pub type_: Option, + /// The root of the container. + /// Examples: + /// - For BigQuery table `project_id:dataset_id.table_id`, the root is + /// `dataset_id` + /// - For Google Cloud Storage file `gs://bucket/folder/filename.txt`, the root + /// is `gs://bucket` + #[serde(rename="rootPath")] + pub root_path: Option, } -impl Part for GooglePrivacyDlpV2Finding {} +impl Part for GooglePrivacyDlpV2Container {} /// A collection of conditions. @@ -1487,7 +1596,7 @@ impl Part for GooglePrivacyDlpV2Finding {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2Conditions { - /// no description provided + /// A collection of conditions. pub conditions: Option>, } @@ -1506,14 +1615,13 @@ impl Part for GooglePrivacyDlpV2Conditions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2StatisticalTable { - /// Auxiliary table location. [required] + /// Required. Auxiliary table location. pub table: Option, - /// The relative frequency column must contain a floating-point number + /// Required. The relative frequency column must contain a floating-point number /// between 0 and 1 (inclusive). Null values are assumed to be zero. - /// [required] #[serde(rename="relativeFrequency")] pub relative_frequency: Option, - /// Quasi-identifier columns. [required] + /// Required. Quasi-identifier columns. #[serde(rename="quasiIds")] pub quasi_ids: Option>, } @@ -1527,22 +1635,22 @@ impl Part for GooglePrivacyDlpV2StatisticalTable {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2PrivacyMetric { - /// no description provided + /// Numerical stats #[serde(rename="numericalStatsConfig")] pub numerical_stats_config: Option, - /// no description provided + /// k-map #[serde(rename="kMapEstimationConfig")] pub k_map_estimation_config: Option, - /// no description provided + /// delta-presence #[serde(rename="deltaPresenceEstimationConfig")] pub delta_presence_estimation_config: Option, - /// no description provided + /// Categorical stats #[serde(rename="categoricalStatsConfig")] pub categorical_stats_config: Option, - /// no description provided + /// l-diversity #[serde(rename="lDiversityConfig")] pub l_diversity_config: Option, - /// no description provided + /// K-anonymity #[serde(rename="kAnonymityConfig")] pub k_anonymity_config: Option, } @@ -1575,13 +1683,26 @@ pub struct GooglePrivacyDlpV2InfoType { /// creating a CustomInfoType, or one of the names listed /// at https://cloud.google.com/dlp/docs/infotypes-reference when specifying /// a built-in type. InfoType names should conform to the pattern - /// [a-zA-Z0-9_]{1,64}. + /// `[a-zA-Z0-9_]{1,64}`. pub name: Option, } impl Part for GooglePrivacyDlpV2InfoType {} +/// Skips the data without modifying it if the requested transformation would +/// cause an error. For example, if a `DateShift` transformation were applied +/// an an IP address, this mode would leave the IP address unchanged in the +/// response. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2LeaveUntransformed { _never_set: Option } + +impl Part for GooglePrivacyDlpV2LeaveUntransformed {} + + /// Result of the numerical stats computation. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1612,8 +1733,8 @@ impl Part for GooglePrivacyDlpV2NumericalStatsResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2InfoTypeTransformations { - /// Transformation for each infoType. Cannot specify more than one - /// for a given infoType. [required] + /// Required. Transformation for each infoType. Cannot specify more than one + /// for a given infoType. pub transformations: Option>, } @@ -1631,26 +1752,27 @@ impl Part for GooglePrivacyDlpV2InfoTypeTransformations {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2CharacterMaskConfig { - /// When masking a string, items in this list will be skipped when replacing. - /// For example, if your string is 555-555-5555 and you ask us to skip `-` and - /// mask 5 chars with * we would produce ***-*55-5555. + /// When masking a string, items in this list will be skipped when replacing + /// characters. For example, if the input string is `555-555-5555` and you + /// instruct Cloud DLP to skip `-` and mask 5 characters with `*`, Cloud DLP + /// returns `***-**5-5555`. #[serde(rename="charactersToIgnore")] pub characters_to_ignore: Option>, /// Number of characters to mask. If not set, all matching chars will be /// masked. Skipped characters do not count towards this tally. #[serde(rename="numberToMask")] pub number_to_mask: Option, - /// Character to mask the sensitive values—for example, "*" for an - /// alphabetic string such as name, or "0" for a numeric string such as ZIP - /// code or credit card number. String must have length 1. If not supplied, we - /// will default to "*" for strings, 0 for digits. + /// Character to use to mask the sensitive values—for example, `*` for an + /// alphabetic string such as a name, or `0` for a numeric string such as ZIP + /// code or credit card number. This string must have a length of 1. If not + /// supplied, this value defaults to `*` for strings, and `0` for digits. #[serde(rename="maskingCharacter")] pub masking_character: Option, /// Mask characters in reverse order. For example, if `masking_character` is - /// '0', number_to_mask is 14, and `reverse_order` is false, then - /// 1234-5678-9012-3456 -> 00000000000000-3456 - /// If `masking_character` is '*', `number_to_mask` is 3, and `reverse_order` - /// is true, then 12345 -> 12*** + /// `0`, `number_to_mask` is `14`, and `reverse_order` is `false`, then the + /// input string `1234-5678-9012-3456` is masked as `00000000000000-3456`. + /// If `masking_character` is `*`, `number_to_mask` is `3`, and `reverse_order` + /// is `true`, then the string `12345` is masked as `12***`. #[serde(rename="reverseOrder")] pub reverse_order: Option, } @@ -1665,9 +1787,9 @@ impl Part for GooglePrivacyDlpV2CharacterMaskConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2SummaryResult { - /// no description provided + /// Number of transformations counted by this result. pub count: Option, - /// no description provided + /// Outcome of the transformation. pub code: Option, /// A place for warnings or errors to show up if a transformation didn't /// work as expected. @@ -1677,6 +1799,31 @@ pub struct GooglePrivacyDlpV2SummaryResult { impl Part for GooglePrivacyDlpV2SummaryResult {} +/// Statistics related to processing hybrid inspect requests. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2HybridInspectStatistics { + /// The number of hybrid inspection requests aborted because the job ran + /// out of quota or was ended before they could be processed. + #[serde(rename="abortedCount")] + pub aborted_count: Option, + /// The number of hybrid requests currently being processed. Only populated + /// when called via method `getDlpJob`. + /// A burst of traffic may cause hybrid inspect requests to be enqueued. + /// Processing will take place as quickly as possible, but resource limitations + /// may impact how long a request is enqueued for. + #[serde(rename="pendingCount")] + pub pending_count: Option, + /// The number of hybrid inspection requests processed within this job. + #[serde(rename="processedCount")] + pub processed_count: Option, +} + +impl Part for GooglePrivacyDlpV2HybridInspectStatistics {} + + /// If set, the detailed findings will be persisted to the specified /// OutputStorageConfig. Only a single instance of this action can be /// specified. @@ -1686,7 +1833,7 @@ impl Part for GooglePrivacyDlpV2SummaryResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2SaveFindings { - /// no description provided + /// Location to store findings outside of DLP. #[serde(rename="outputConfig")] pub output_config: Option, } @@ -1788,7 +1935,7 @@ pub struct GooglePrivacyDlpV2TransformationSummary { /// The specific suppression option these stats apply to. #[serde(rename="recordSuppress")] pub record_suppress: Option, - /// no description provided + /// Collection of all transformations that took place or had an error. pub results: Option>, /// The specific transformation these stats apply to. pub transformation: Option, @@ -1806,23 +1953,22 @@ impl Part for GooglePrivacyDlpV2TransformationSummary {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2DateShiftConfig { /// Causes the shift to be computed based on this key and the context. This - /// results in the same shift for the same context and crypto_key. + /// results in the same shift for the same context and crypto_key. If + /// set, must also set context. Can only be applied to table items. #[serde(rename="cryptoKey")] pub crypto_key: Option, - /// For example, -5 means shift date to at most 5 days back in the past. - /// [Required] + /// Required. For example, -5 means shift date to at most 5 days back in the past. #[serde(rename="lowerBoundDays")] pub lower_bound_days: Option, - /// Range of shift in days. Actual shift will be selected at random within this + /// Required. Range of shift in days. Actual shift will be selected at random within this /// range (inclusive ends). Negative means shift to earlier in time. Must not /// be more than 365250 days (1000 years) each direction. /// /// For example, 3 means shift date to at most 3 days into the future. - /// [Required] #[serde(rename="upperBoundDays")] pub upper_bound_days: Option, /// Points to the field that contains the context, for example, an entity id. - /// If set, must also set method. If set, shift will be consistent for the + /// If set, must also set cryptoKey. If set, shift will be consistent for the /// given context. pub context: Option, } @@ -1842,26 +1988,39 @@ pub struct GooglePrivacyDlpV2RedactConfig { _never_set: Option } impl Part for GooglePrivacyDlpV2RedactConfig {} -/// Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the -/// results of the DlpJob will be applied to the entry for the resource scanned -/// in Cloud Data Catalog. Any labels previously written by another DlpJob will -/// be deleted. InfoType naming patterns are strictly enforced when using this -/// feature. Note that the findings will be persisted in Cloud Data Catalog -/// storage and are governed by Data Catalog service-specific policy, see -/// https://cloud.google.com/terms/service-terms -/// Only a single instance of this action can be specified and only allowed if -/// all resources being scanned are BigQuery tables. -/// Compatible with: Inspect +/// This is a data encryption key (DEK) (as opposed to +/// a key encryption key (KEK) stored by KMS). +/// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate +/// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot +/// unwrap the data crypto key. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2PublishFindingsToCloudDataCatalog { _never_set: Option } +pub struct GooglePrivacyDlpV2CryptoKey { + /// Kms wrapped key + #[serde(rename="kmsWrapped")] + pub kms_wrapped: Option, + /// Unwrapped crypto key + pub unwrapped: Option, + /// Transient crypto key + pub transient: Option, +} -impl Part for GooglePrivacyDlpV2PublishFindingsToCloudDataCatalog {} +impl Part for GooglePrivacyDlpV2CryptoKey {} -/// There is no detailed description. +/// Throw an error and fail the request when a transformation error occurs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2ThrowError { _never_set: Option } + +impl Part for GooglePrivacyDlpV2ThrowError {} + + +/// Snapshot of the inspection configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1871,7 +2030,7 @@ pub struct GooglePrivacyDlpV2RequestedOptions { /// this run. #[serde(rename="snapshotInspectTemplate")] pub snapshot_inspect_template: Option, - /// no description provided + /// Inspect config. #[serde(rename="jobConfig")] pub job_config: Option, } @@ -1879,6 +2038,25 @@ pub struct GooglePrivacyDlpV2RequestedOptions { impl Part for GooglePrivacyDlpV2RequestedOptions {} +/// Message defining a custom regular expression. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2Regex { + /// Pattern defining the regular expression. Its syntax + /// (https://github.com/google/re2/wiki/Syntax) can be found under the + /// google/re2 repository on GitHub. + pub pattern: Option, + /// The index of the submatch to extract as findings. When not + /// specified, the entire match is returned. No more than 3 may be included. + #[serde(rename="groupIndexes")] + pub group_indexes: Option>, +} + +impl Part for GooglePrivacyDlpV2Regex {} + + /// Options defining a data set within Google Cloud Datastore. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1917,37 +2095,37 @@ impl Part for GooglePrivacyDlpV2Range {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2PrimitiveTransformation { - /// no description provided + /// Mask #[serde(rename="characterMaskConfig")] pub character_mask_config: Option, - /// no description provided + /// Deterministic Crypto #[serde(rename="cryptoDeterministicConfig")] pub crypto_deterministic_config: Option, - /// no description provided + /// Bucketing #[serde(rename="bucketingConfig")] pub bucketing_config: Option, - /// no description provided + /// Redact #[serde(rename="redactConfig")] pub redact_config: Option, - /// no description provided + /// Fixed size bucketing #[serde(rename="fixedSizeBucketingConfig")] pub fixed_size_bucketing_config: Option, - /// no description provided + /// Time extraction #[serde(rename="timePartConfig")] pub time_part_config: Option, - /// no description provided + /// Crypto #[serde(rename="cryptoHashConfig")] pub crypto_hash_config: Option, - /// no description provided + /// Date Shift #[serde(rename="dateShiftConfig")] pub date_shift_config: Option, - /// no description provided + /// Replace with infotype #[serde(rename="replaceWithInfoTypeConfig")] pub replace_with_info_type_config: Option, - /// no description provided + /// Ffx-Fpe #[serde(rename="cryptoReplaceFfxFpeConfig")] pub crypto_replace_ffx_fpe_config: Option, - /// no description provided + /// Replace #[serde(rename="replaceConfig")] pub replace_config: Option, } @@ -1977,13 +2155,13 @@ pub struct GooglePrivacyDlpV2InfoTypeDescription { impl Part for GooglePrivacyDlpV2InfoTypeDescription {} -/// There is no detailed description. +/// Values of the row. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2Row { - /// no description provided + /// Individual cells. pub values: Option>, } @@ -1997,6 +2175,7 @@ impl Part for GooglePrivacyDlpV2Row {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations job triggers list projects](struct.ProjectLocationJobTriggerListCall.html) (response) /// * [job triggers list projects](struct.ProjectJobTriggerListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2032,8 +2211,11 @@ pub struct GooglePrivacyDlpV2BigQueryOptions { /// no description provided #[serde(rename="sampleMethod")] pub sample_method: Option, - /// References to fields uniquely identifying rows within the table. - /// Nested fields in the format, like `person.birthdate.year`, are allowed. + /// Table fields that may uniquely identify a row within the table. When + /// `actions.saveFindings.outputConfig.table` is specified, the values of + /// columns specified here are available in the output table under + /// `location.content_locations.record_location.record_key.id_values`. Nested + /// fields such as `person.birthdate.year` are allowed. #[serde(rename="identifyingFields")] pub identifying_fields: Option>, /// Complete BigQuery table reference. @@ -2058,8 +2240,10 @@ impl Part for GooglePrivacyDlpV2BigQueryOptions {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [stored info types patch organizations](struct.OrganizationStoredInfoTypePatchCall.html) (request) /// * [stored info types patch projects](struct.ProjectStoredInfoTypePatchCall.html) (request) +/// * [stored info types patch organizations](struct.OrganizationStoredInfoTypePatchCall.html) (request) +/// * [locations stored info types patch projects](struct.ProjectLocationStoredInfoTypePatchCall.html) (request) +/// * [locations stored info types patch organizations](struct.OrganizationLocationStoredInfoTypePatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2UpdateStoredInfoTypeRequest { @@ -2099,12 +2283,18 @@ impl Part for GooglePrivacyDlpV2DetectionRule {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [inspect templates create projects](struct.ProjectInspectTemplateCreateCall.html) (request) /// * [inspect templates create organizations](struct.OrganizationInspectTemplateCreateCall.html) (request) +/// * [inspect templates create projects](struct.ProjectInspectTemplateCreateCall.html) (request) +/// * [locations inspect templates create organizations](struct.OrganizationLocationInspectTemplateCreateCall.html) (request) +/// * [locations inspect templates create projects](struct.ProjectLocationInspectTemplateCreateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2CreateInspectTemplateRequest { - /// The InspectTemplate to create. + /// The geographic location to store the inspection template. Reserved for + /// future extensions. + #[serde(rename="locationId")] + pub location_id: Option, + /// Required. The InspectTemplate to create. #[serde(rename="inspectTemplate")] pub inspect_template: Option, /// The template id can contain uppercase and lowercase letters, @@ -2124,16 +2314,22 @@ impl RequestValue for GooglePrivacyDlpV2CreateInspectTemplateRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2StorageConfig { + /// Hybrid inspection options. + /// Early access feature is in a pre-release state and might change or have + /// limited support. For more information, see + /// https://cloud.google.com/products#product-launch-stages. + #[serde(rename="hybridOptions")] + pub hybrid_options: Option, + /// Google Cloud Datastore options. + #[serde(rename="datastoreOptions")] + pub datastore_options: Option, + /// BigQuery options. + #[serde(rename="bigQueryOptions")] + pub big_query_options: Option, /// no description provided #[serde(rename="timespanConfig")] pub timespan_config: Option, - /// BigQuery options specification. - #[serde(rename="bigQueryOptions")] - pub big_query_options: Option, - /// Google Cloud Datastore options specification. - #[serde(rename="datastoreOptions")] - pub datastore_options: Option, - /// Google Cloud Storage options specification. + /// Google Cloud Storage options. #[serde(rename="cloudStorageOptions")] pub cloud_storage_options: Option, } @@ -2141,18 +2337,34 @@ pub struct GooglePrivacyDlpV2StorageConfig { impl Part for GooglePrivacyDlpV2StorageConfig {} -/// Replace each input value with a given `Value`. +/// The transformation to apply to the field. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2ReplaceValueConfig { - /// Value to replace it with. - #[serde(rename="newValue")] - pub new_value: Option, +pub struct GooglePrivacyDlpV2FieldTransformation { + /// Required. Input field(s) to apply the transformation to. + pub fields: Option>, + /// Apply the transformation to the entire field. + #[serde(rename="primitiveTransformation")] + pub primitive_transformation: Option, + /// Only apply the transformation if the condition evaluates to true for the + /// given `RecordCondition`. The conditions are allowed to reference fields + /// that are not used in the actual transformation. + /// + /// Example Use Cases: + /// + /// - Apply a different bucket transformation to an age column if the zip code + /// column for the same record is within a specific range. + /// - Redact a field if the date of birth field is greater than 85. + pub condition: Option, + /// Treat the contents of the field as free text, and selectively + /// transform content that matches an `InfoType`. + #[serde(rename="infoTypeTransformations")] + pub info_type_transformations: Option, } -impl Part for GooglePrivacyDlpV2ReplaceValueConfig {} +impl Part for GooglePrivacyDlpV2FieldTransformation {} /// A transformation to apply to text that is identified as a specific @@ -2162,7 +2374,7 @@ impl Part for GooglePrivacyDlpV2ReplaceValueConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2InfoTypeTransformation { - /// Primitive transformation to apply to the infoType. [required] + /// Required. Primitive transformation to apply to the infoType. #[serde(rename="primitiveTransformation")] pub primitive_transformation: Option, /// InfoTypes to apply the transformation to. An empty list will cause @@ -2186,7 +2398,7 @@ pub struct GooglePrivacyDlpV2InspectConfig { /// When true, excludes type information of the findings. #[serde(rename="excludeInfoTypes")] pub exclude_info_types: Option, - /// no description provided + /// Configuration to control the number of findings returned. pub limits: Option, /// Only returns findings equal or above this threshold. The default is /// POSSIBLE. @@ -2218,10 +2430,9 @@ pub struct GooglePrivacyDlpV2InspectConfig { /// system may automatically choose what detectors to run. By default this may /// be all types, but may change over time as detectors are updated. /// - /// The special InfoType name "ALL_BASIC" can be used to trigger all detectors, - /// but may change over time as new InfoTypes are added. If you need precise - /// control and predictability as to what detectors are run you should specify - /// specific InfoTypes listed in the reference. + /// If you need precise control and predictability as to what detectors are + /// run you should specify specific InfoTypes listed in the reference, + /// otherwise a default list will be used, which may change over time. #[serde(rename="infoTypes")] pub info_types: Option>, } @@ -2229,6 +2440,47 @@ pub struct GooglePrivacyDlpV2InspectConfig { impl Part for GooglePrivacyDlpV2InspectConfig {} +/// Configuration of the timespan of the items to include in scanning. +/// Currently only supported when inspecting Google Cloud Storage and BigQuery. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2TimespanConfig { + /// Specification of the field containing the timestamp of scanned items. + /// Used for data sources like Datastore and BigQuery. + /// + /// For BigQuery: + /// Required to filter out rows based on the given start and + /// end times. If not specified and the table was modified between the given + /// start and end times, the entire table will be scanned. + /// The valid data types of the timestamp field are: `INTEGER`, `DATE`, + /// `TIMESTAMP`, or `DATETIME` BigQuery column. + /// + /// For Datastore. + /// Valid data types of the timestamp field are: `TIMESTAMP`. + /// Datastore entity will be scanned if the timestamp property does not + /// exist or its value is empty or invalid. + #[serde(rename="timestampField")] + pub timestamp_field: Option, + /// Exclude files or rows newer than this value. + /// If set to zero, no upper time limit is applied. + #[serde(rename="endTime")] + pub end_time: Option, + /// Exclude files or rows older than this value. + #[serde(rename="startTime")] + pub start_time: Option, + /// When the job is started by a JobTrigger we will automatically figure out + /// a valid start_time to avoid scanning files that have not been modified + /// since the last time the JobTrigger executed. This will be based on the + /// time of the execution of the last run of the JobTrigger. + #[serde(rename="enableAutoPopulationOfTimespanConfig")] + pub enable_auto_population_of_timespan_config: Option, +} + +impl Part for GooglePrivacyDlpV2TimespanConfig {} + + /// The results of an inspect DataSource job. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2290,15 +2542,15 @@ impl Part for GooglePrivacyDlpV2InspectResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2DateTime { - /// One or more of the following must be set. All fields are optional, but - /// when set must be valid date or time values. + /// One or more of the following must be set. + /// Must be a valid date or time value. pub date: Option, - /// no description provided + /// Day of week #[serde(rename="dayOfWeek")] pub day_of_week: Option, - /// no description provided + /// Time of day pub time: Option, - /// no description provided + /// Time zone #[serde(rename="timeZone")] pub time_zone: Option, } @@ -2333,13 +2585,16 @@ pub struct GooglePrivacyDlpV2Action { /// Save resulting findings in a provided location. #[serde(rename="saveFindings")] pub save_findings: Option, - /// Enable email notification to project owners and editors on job's + /// Enable email notification for project owners and editors on job's /// completion/failure. #[serde(rename="jobNotificationEmails")] pub job_notification_emails: Option, /// Publish summary to Cloud Security Command Center (Alpha). #[serde(rename="publishSummaryToCscc")] pub publish_summary_to_cscc: Option, + /// Enable Stackdriver metric dlp.googleapis.com/finding_count. + #[serde(rename="publishToStackdriver")] + pub publish_to_stackdriver: Option, /// Publish findings to Cloud Datahub. #[serde(rename="publishFindingsToCloudDataCatalog")] pub publish_findings_to_cloud_data_catalog: Option, @@ -2360,8 +2615,11 @@ pub struct GooglePrivacyDlpV2BigQueryKey { /// Complete BigQuery table reference. #[serde(rename="tableReference")] pub table_reference: Option, - /// Absolute number of the row from the beginning of the table at the time - /// of scanning. + /// Row number inferred at the time the table was scanned. This value is + /// nondeterministic, cannot be queried, and may be null for inspection + /// jobs. To locate findings within a table, specify + /// `inspect_job.storage_config.big_query_options.identifying_fields` in + /// `CreateDlpJobRequest`. #[serde(rename="rowNumber")] pub row_number: Option, } @@ -2401,8 +2659,10 @@ impl Part for GooglePrivacyDlpV2BigQueryTable {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [deidentify templates patch organizations](struct.OrganizationDeidentifyTemplatePatchCall.html) (request) +/// * [locations deidentify templates patch projects](struct.ProjectLocationDeidentifyTemplatePatchCall.html) (request) +/// * [locations deidentify templates patch organizations](struct.OrganizationLocationDeidentifyTemplatePatchCall.html) (request) /// * [deidentify templates patch projects](struct.ProjectDeidentifyTemplatePatchCall.html) (request) +/// * [deidentify templates patch organizations](struct.OrganizationDeidentifyTemplatePatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest { @@ -2445,10 +2705,11 @@ impl Part for GooglePrivacyDlpV2BucketingConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2CharsToIgnore { - /// no description provided + /// Common characters to not transform when masking. Useful to avoid removing + /// punctuation. #[serde(rename="commonCharactersToIgnore")] pub common_characters_to_ignore: Option, - /// no description provided + /// Characters to not transform when masking. #[serde(rename="charactersToSkip")] pub characters_to_skip: Option, } @@ -2486,12 +2747,18 @@ impl Part for GooglePrivacyDlpV2PartitionId {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations stored info types get projects](struct.ProjectLocationStoredInfoTypeGetCall.html) (response) /// * [stored info types get organizations](struct.OrganizationStoredInfoTypeGetCall.html) (response) +/// * [stored info types create projects](struct.ProjectStoredInfoTypeCreateCall.html) (response) /// * [stored info types get projects](struct.ProjectStoredInfoTypeGetCall.html) (response) /// * [stored info types patch organizations](struct.OrganizationStoredInfoTypePatchCall.html) (response) -/// * [stored info types create projects](struct.ProjectStoredInfoTypeCreateCall.html) (response) +/// * [locations stored info types patch projects](struct.ProjectLocationStoredInfoTypePatchCall.html) (response) +/// * [locations stored info types get organizations](struct.OrganizationLocationStoredInfoTypeGetCall.html) (response) +/// * [locations stored info types create organizations](struct.OrganizationLocationStoredInfoTypeCreateCall.html) (response) +/// * [locations stored info types create projects](struct.ProjectLocationStoredInfoTypeCreateCall.html) (response) /// * [stored info types patch projects](struct.ProjectStoredInfoTypePatchCall.html) (response) /// * [stored info types create organizations](struct.OrganizationStoredInfoTypeCreateCall.html) (response) +/// * [locations stored info types patch organizations](struct.OrganizationLocationStoredInfoTypePatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2StoredInfoType { @@ -2509,6 +2776,19 @@ pub struct GooglePrivacyDlpV2StoredInfoType { impl ResponseResult for GooglePrivacyDlpV2StoredInfoType {} +/// Storage metadata label to indicate which metadata entry contains findings. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2StorageMetadataLabel { + /// no description provided + pub key: Option, +} + +impl Part for GooglePrivacyDlpV2StorageMetadataLabel {} + + /// Replace each matching finding with the name of the info_type. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2525,25 +2805,25 @@ impl Part for GooglePrivacyDlpV2ReplaceWithInfoTypeConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails { - /// no description provided + /// Numerical stats result #[serde(rename="numericalStatsResult")] pub numerical_stats_result: Option, - /// no description provided + /// K-map result #[serde(rename="kMapEstimationResult")] pub k_map_estimation_result: Option, - /// no description provided + /// K-anonymity result #[serde(rename="kAnonymityResult")] pub k_anonymity_result: Option, - /// no description provided + /// L-divesity result #[serde(rename="lDiversityResult")] pub l_diversity_result: Option, /// Privacy metric to compute. #[serde(rename="requestedPrivacyMetric")] pub requested_privacy_metric: Option, - /// no description provided + /// Categorical stats result #[serde(rename="categoricalStatsResult")] pub categorical_stats_result: Option, - /// no description provided + /// Delta-presence result #[serde(rename="deltaPresenceEstimationResult")] pub delta_presence_estimation_result: Option, /// Input dataset to compute metrics over. @@ -2561,6 +2841,7 @@ impl Part for GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations job triggers create projects](struct.ProjectLocationJobTriggerCreateCall.html) (request) /// * [job triggers create projects](struct.ProjectJobTriggerCreateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2571,7 +2852,11 @@ pub struct GooglePrivacyDlpV2CreateJobTriggerRequest { /// characters. Can be empty to allow the system to generate one. #[serde(rename="triggerId")] pub trigger_id: Option, - /// The JobTrigger to create. + /// The geographic location to store the job trigger. Reserved for + /// future extensions. + #[serde(rename="locationId")] + pub location_id: Option, + /// Required. The JobTrigger to create. #[serde(rename="jobTrigger")] pub job_trigger: Option, } @@ -2635,6 +2920,7 @@ impl Part for GooglePrivacyDlpV2KMapEstimationHistogramBucket {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations content reidentify projects](struct.ProjectLocationContentReidentifyCall.html) (response) /// * [content reidentify projects](struct.ProjectContentReidentifyCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2681,7 +2967,7 @@ pub struct GooglePrivacyDlpV2Bucket { impl Part for GooglePrivacyDlpV2Bucket {} -/// There is no detailed description. +/// Histogram of k-anonymity equivalence classes. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -2727,6 +3013,20 @@ pub struct GooglePrivacyDlpV2LDiversityConfig { impl Part for GooglePrivacyDlpV2LDiversityConfig {} +/// Replace each input value with a given `Value`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2ReplaceValueConfig { + /// Value to replace it with. + #[serde(rename="newValue")] + pub new_value: Option, +} + +impl Part for GooglePrivacyDlpV2ReplaceValueConfig {} + + /// Message representing a single file or path in Cloud Storage. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2741,6 +3041,17 @@ pub struct GooglePrivacyDlpV2CloudStoragePath { impl Part for GooglePrivacyDlpV2CloudStoragePath {} +/// Job trigger option for hybrid jobs. Jobs must be manually created +/// and finished. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2Manual { _never_set: Option } + +impl Part for GooglePrivacyDlpV2Manual {} + + /// Set of files to scan. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2811,7 +3122,6 @@ impl Part for GooglePrivacyDlpV2LikelihoodAdjustment {} /// Details information about an error encountered during job execution or /// the results of an unsuccessful activation of the JobTrigger. -/// Output only field. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -2819,7 +3129,7 @@ impl Part for GooglePrivacyDlpV2LikelihoodAdjustment {} pub struct GooglePrivacyDlpV2Error { /// The times the error occurred. pub timestamps: Option>, - /// no description provided + /// Detailed error codes and messages. pub details: Option, } @@ -2834,6 +3144,7 @@ impl Part for GooglePrivacyDlpV2Error {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [content inspect projects](struct.ProjectContentInspectCall.html) (response) +/// * [locations content inspect projects](struct.ProjectLocationContentInspectCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2InspectContentResponse { @@ -2852,9 +3163,9 @@ impl ResponseResult for GooglePrivacyDlpV2InspectContentResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2Table { - /// no description provided + /// Headers of the table. pub headers: Option>, - /// no description provided + /// Rows of the table. pub rows: Option>, } @@ -2883,6 +3194,7 @@ impl Part for GooglePrivacyDlpV2QuoteInfo {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [job triggers patch projects](struct.ProjectJobTriggerPatchCall.html) (request) +/// * [locations job triggers patch projects](struct.ProjectLocationJobTriggerPatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2UpdateJobTriggerRequest { @@ -2927,6 +3239,7 @@ pub struct GooglePrivacyDlpV2OutputStorageConfig { /// If unspecified, then all available columns will be used for a new table or /// an (existing) table with no schema, and no changes will be made to an /// existing table that has a schema. + /// Only for use with external storage. #[serde(rename="outputSchema")] pub output_schema: Option, } @@ -2942,49 +3255,115 @@ impl Part for GooglePrivacyDlpV2OutputStorageConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [job triggers create projects](struct.ProjectJobTriggerCreateCall.html) (response) /// * [job triggers get projects](struct.ProjectJobTriggerGetCall.html) (response) /// * [job triggers patch projects](struct.ProjectJobTriggerPatchCall.html) (response) +/// * [locations job triggers get projects](struct.ProjectLocationJobTriggerGetCall.html) (response) +/// * [locations job triggers create projects](struct.ProjectLocationJobTriggerCreateCall.html) (response) +/// * [locations job triggers patch projects](struct.ProjectLocationJobTriggerPatchCall.html) (response) +/// * [job triggers create projects](struct.ProjectJobTriggerCreateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2JobTrigger { - /// A status for this trigger. [required] + /// Required. A status for this trigger. pub status: Option, - /// The last update timestamp of a triggeredJob, output only field. + /// Output only. The last update timestamp of a triggeredJob. #[serde(rename="updateTime")] pub update_time: Option, - /// A stream of errors encountered when the trigger was activated. Repeated + /// Output only. A stream of errors encountered when the trigger was activated. Repeated /// errors may result in the JobTrigger automatically being paused. /// Will return the last 100 errors. Whenever the JobTrigger is modified - /// this list will be cleared. Output only field. + /// this list will be cleared. pub errors: Option>, /// Display name (max 100 chars) #[serde(rename="displayName")] pub display_name: Option, /// User provided description (max 256 chars) pub description: Option, - /// no description provided + /// For inspect jobs, a snapshot of the configuration. #[serde(rename="inspectJob")] pub inspect_job: Option, /// A list of triggers which will be OR'ed together. Only one in the list /// needs to trigger for a job to be started. The list may contain only /// a single Schedule trigger and must have at least one object. pub triggers: Option>, - /// The timestamp of the last time this trigger executed, output only field. + /// Output only. The timestamp of the last time this trigger executed. #[serde(rename="lastRunTime")] pub last_run_time: Option, - /// The creation timestamp of a triggeredJob, output only field. + /// Output only. The creation timestamp of a triggeredJob. #[serde(rename="createTime")] pub create_time: Option, /// Unique resource name for the triggeredJob, assigned by the service when the /// triggeredJob is created, for example - /// `projects/dlp-test-project/triggeredJobs/53234423`. + /// `projects/dlp-test-project/jobTriggers/53234423`. pub name: Option, } impl ResponseResult for GooglePrivacyDlpV2JobTrigger {} +/// Represents a piece of potentially sensitive content. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2Finding { + /// The type of content that might have been found. + /// Provided if `excluded_types` is false. + #[serde(rename="infoType")] + pub info_type: Option, + /// Resource name in format + /// projects/{project}/locations/{location}/findings/{finding} Populated only + /// when viewing persisted findings. + pub name: Option, + /// The content that was found. Even if the content is not textual, it + /// may be converted to a textual representation here. + /// Provided if `include_quote` is true and the finding is + /// less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes + /// in length, the quote may be omitted. + pub quote: Option, + /// The labels associated with this `Finding`. + /// + /// Label keys must be between 1 and 63 characters long and must conform + /// to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + /// + /// Label values must be between 0 and 63 characters long and must conform + /// to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + /// + /// No more than 10 labels can be associated with a given finding. + /// + /// Examples: + /// * `"environment" : "production"` + /// * `"pipeline" : "etl"` + pub labels: Option>, + /// The job that stored the finding. + #[serde(rename="jobName")] + pub job_name: Option, + /// Contains data parsed from quotes. Only populated if include_quote was set + /// to true and a supported infoType was requested. Currently supported + /// infoTypes: DATE, DATE_OF_BIRTH and TIME. + #[serde(rename="quoteInfo")] + pub quote_info: Option, + /// Time the job started that produced this finding. + #[serde(rename="jobCreateTime")] + pub job_create_time: Option, + /// Where the content was found. + pub location: Option, + /// Job trigger name, if applicable, for this finding. + #[serde(rename="triggerName")] + pub trigger_name: Option, + /// The job that stored the finding. + #[serde(rename="resourceName")] + pub resource_name: Option, + /// Confidence of how likely it is that the `info_type` is correct. + pub likelihood: Option, + /// Timestamp when finding was detected. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl Part for GooglePrivacyDlpV2Finding {} + + /// A reference to a StoredInfoType to use with scanning. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3025,29 +3404,47 @@ pub struct GooglePrivacyDlpV2Schedule { impl Part for GooglePrivacyDlpV2Schedule {} -/// There is no detailed description. +/// How to handle transformation errors during de-identification. A +/// transformation error occurs when the requested transformation is incompatible +/// with the data. For example, trying to de-identify an IP address using a +/// `DateShift` transformation would result in a transformation error, since date +/// info cannot be extracted from an IP address. +/// Information about any incompatible transformations, and how they were +/// handled, is returned in the response as part of the +/// `TransformationOverviews`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2FindingLimits { - /// Max number of findings that will be returned per request/job. - /// When set within `InspectContentRequest`, the maximum returned is 2000 - /// regardless if this is set higher. - #[serde(rename="maxFindingsPerRequest")] - pub max_findings_per_request: Option, - /// Configuration of findings limit given for specified infoTypes. - #[serde(rename="maxFindingsPerInfoType")] - pub max_findings_per_info_type: Option>, - /// Max number of findings that will be returned for each item scanned. - /// When set within `InspectDataSourceRequest`, - /// the maximum returned is 2000 regardless if this is set higher. - /// When set within `InspectContentRequest`, this field is ignored. - #[serde(rename="maxFindingsPerItem")] - pub max_findings_per_item: Option, +pub struct GooglePrivacyDlpV2TransformationErrorHandling { + /// Throw an error + #[serde(rename="throwError")] + pub throw_error: Option, + /// Ignore errors + #[serde(rename="leaveUntransformed")] + pub leave_untransformed: Option, } -impl Part for GooglePrivacyDlpV2FindingLimits {} +impl Part for GooglePrivacyDlpV2TransformationErrorHandling {} + + +/// Request to search for potentially sensitive info in a custom location. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations dlp jobs hybrid inspect projects](struct.ProjectLocationDlpJobHybridInspectCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2HybridInspectDlpJobRequest { + /// The item to inspect. + #[serde(rename="hybridItem")] + pub hybrid_item: Option, +} + +impl RequestValue for GooglePrivacyDlpV2HybridInspectDlpJobRequest {} /// Include to use an existing data crypto key wrapped by KMS. @@ -3060,10 +3457,10 @@ impl Part for GooglePrivacyDlpV2FindingLimits {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2KmsWrappedCryptoKey { - /// The resource name of the KMS CryptoKey to use for unwrapping. [required] + /// Required. The resource name of the KMS CryptoKey to use for unwrapping. #[serde(rename="cryptoKeyName")] pub crypto_key_name: Option, - /// The wrapped data crypto key. [required] + /// Required. The wrapped data crypto key. #[serde(rename="wrappedKey")] pub wrapped_key: Option, } @@ -3099,12 +3496,36 @@ pub struct GooglePrivacyDlpV2ImageLocation { impl Part for GooglePrivacyDlpV2ImageLocation {} +/// Request to search for potentially sensitive info in a custom location. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations job triggers hybrid inspect projects](struct.ProjectLocationJobTriggerHybridInspectCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2HybridInspectJobTriggerRequest { + /// The item to inspect. + #[serde(rename="hybridItem")] + pub hybrid_item: Option, +} + +impl RequestValue for GooglePrivacyDlpV2HybridInspectJobTriggerRequest {} + + /// What event needs to occur for a new job to be started. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2Trigger { + /// For use with hybrid jobs. Jobs must be manually created and finished. + /// Early access feature is in a pre-release state and might change or have + /// limited support. For more information, see + /// https://cloud.google.com/products#product-launch-stages. + pub manual: Option, /// Create a job on a repeating basis based on the elapse of time. pub schedule: Option, } @@ -3141,7 +3562,7 @@ pub struct GooglePrivacyDlpV2StoredInfoTypeStats { impl Part for GooglePrivacyDlpV2StoredInfoTypeStats {} -/// There is no detailed description. +/// Time zone of the date time object. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -3183,7 +3604,9 @@ impl Part for GooglePrivacyDlpV2CryptoHashConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations deidentify templates list projects](struct.ProjectLocationDeidentifyTemplateListCall.html) (response) /// * [deidentify templates list organizations](struct.OrganizationDeidentifyTemplateListCall.html) (response) +/// * [locations deidentify templates list organizations](struct.OrganizationLocationDeidentifyTemplateListCall.html) (response) /// * [deidentify templates list projects](struct.ProjectDeidentifyTemplateListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -3224,53 +3647,21 @@ pub struct GoogleTypeTimeOfDay { impl Part for GoogleTypeTimeOfDay {} -/// Message defining a custom regular expression. +/// Instructions regarding the table content being inspected. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2Regex { - /// Pattern defining the regular expression. Its syntax - /// (https://github.com/google/re2/wiki/Syntax) can be found under the - /// google/re2 repository on GitHub. - pub pattern: Option, - /// The index of the submatch to extract as findings. When not - /// specified, the entire match is returned. No more than 3 may be included. - #[serde(rename="groupIndexes")] - pub group_indexes: Option>, +pub struct GooglePrivacyDlpV2TableOptions { + /// The columns that are the primary keys for table objects included in + /// ContentItem. A copy of this cell's value will stored alongside alongside + /// each finding so that the finding can be traced to the specific row it came + /// from. No more than 3 may be provided. + #[serde(rename="identifyingFields")] + pub identifying_fields: Option>, } -impl Part for GooglePrivacyDlpV2Regex {} - - -/// The transformation to apply to the field. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GooglePrivacyDlpV2FieldTransformation { - /// Input field(s) to apply the transformation to. [required] - pub fields: Option>, - /// Apply the transformation to the entire field. - #[serde(rename="primitiveTransformation")] - pub primitive_transformation: Option, - /// Only apply the transformation if the condition evaluates to true for the - /// given `RecordCondition`. The conditions are allowed to reference fields - /// that are not used in the actual transformation. [optional] - /// - /// Example Use Cases: - /// - /// - Apply a different bucket transformation to an age column if the zip code - /// column for the same record is within a specific range. - /// - Redact a field if the date of birth field is greater than 85. - pub condition: Option, - /// Treat the contents of the field as free text, and selectively - /// transform content that matches an `InfoType`. - #[serde(rename="infoTypeTransformations")] - pub info_type_transformations: Option, -} - -impl Part for GooglePrivacyDlpV2FieldTransformation {} +impl Part for GooglePrivacyDlpV2TableOptions {} /// A condition for determining whether a transformation should be applied to @@ -3328,13 +3719,8 @@ impl Part for GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2Location { - /// Zero-based byte offsets delimiting the finding. - /// These are relative to the finding's containing element. - /// Note that when the content is not textual, this references - /// the UTF-8 encoded textual representation of the content. - /// Omitted if content is an image. - #[serde(rename="byteRange")] - pub byte_range: Option, + /// Information about the container where this finding occurred, if available. + pub container: Option, /// Unicode character offsets delimiting the finding. /// These are relative to the finding's containing element. /// Provided when the content is text. @@ -3344,12 +3730,20 @@ pub struct GooglePrivacyDlpV2Location { /// within the file or record. #[serde(rename="contentLocations")] pub content_locations: Option>, + /// Zero-based byte offsets delimiting the finding. + /// These are relative to the finding's containing element. + /// Note that when the content is not textual, this references + /// the UTF-8 encoded textual representation of the content. + /// Omitted if content is an image. + #[serde(rename="byteRange")] + pub byte_range: Option, } impl Part for GooglePrivacyDlpV2Location {} -/// Findings container location data. +/// Precise location of the finding within a document, record, image, or metadata +/// container. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -3359,14 +3753,17 @@ pub struct GooglePrivacyDlpV2ContentLocation { /// The top level name is the source file name or table name. Names of some /// common storage containers are formatted as follows: /// - /// * BigQuery tables: `:.` - /// * Cloud Storage files: `gs:///` - /// * Datastore namespace: + /// * BigQuery tables: `{project_id}:{dataset_id}.{table_id}` + /// * Cloud Storage files: `gs://{bucket}/{path}` + /// * Datastore namespace: {namespace} /// /// Nested names could be absent if the embedded object has no string /// identifier (for an example an image contained within a document). #[serde(rename="containerName")] pub container_name: Option, + /// Location within the metadata for inspected content. + #[serde(rename="metadataLocation")] + pub metadata_location: Option, /// Findings container version, if available /// ("generation" for Google Cloud Storage). #[serde(rename="containerVersion")] @@ -3398,13 +3795,14 @@ impl Part for GooglePrivacyDlpV2ContentLocation {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations content reidentify projects](struct.ProjectLocationContentReidentifyCall.html) (request) /// * [content reidentify projects](struct.ProjectContentReidentifyCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2ReidentifyContentRequest { /// The item to re-identify. Will be treated as text. pub item: Option, - /// Optional template to use. References an instance of `DeidentifyTemplate`. + /// Template to use. References an instance of `DeidentifyTemplate`. /// Any configuration directly specified in `reidentify_config` or /// `inspect_config` will override those set in the template. Singular fields /// that are set in this request will replace their corresponding fields in the @@ -3412,16 +3810,10 @@ pub struct GooglePrivacyDlpV2ReidentifyContentRequest { /// are recursively merged. #[serde(rename="reidentifyTemplateName")] pub reidentify_template_name: Option, - /// Configuration for the inspector. - #[serde(rename="inspectConfig")] - pub inspect_config: Option, - /// Optional template to use. Any configuration directly specified in - /// `inspect_config` will override those set in the template. Singular fields - /// that are set in this request will replace their corresponding fields in the - /// template. Repeated fields are appended. Singular sub-messages and groups - /// are recursively merged. - #[serde(rename="inspectTemplateName")] - pub inspect_template_name: Option, + /// The geographic location to process content reidentification. Reserved for + /// future extensions. + #[serde(rename="locationId")] + pub location_id: Option, /// Configuration for the re-identification of the content item. /// This field shares the same proto message type that is used for /// de-identification, however its usage here is for the reversal of the @@ -3430,9 +3822,20 @@ pub struct GooglePrivacyDlpV2ReidentifyContentRequest { /// reverse. This requires that only reversible transformations /// be provided here. The reversible transformations are: /// + /// - `CryptoDeterministicConfig` /// - `CryptoReplaceFfxFpeConfig` #[serde(rename="reidentifyConfig")] pub reidentify_config: Option, + /// Configuration for the inspector. + #[serde(rename="inspectConfig")] + pub inspect_config: Option, + /// Template to use. Any configuration directly specified in + /// `inspect_config` will override those set in the template. Singular fields + /// that are set in this request will replace their corresponding fields in the + /// template. Repeated fields are appended. Singular sub-messages and groups + /// are recursively merged. + #[serde(rename="inspectTemplateName")] + pub inspect_template_name: Option, } impl RequestValue for GooglePrivacyDlpV2ReidentifyContentRequest {} @@ -3457,7 +3860,7 @@ impl Part for GooglePrivacyDlpV2KindExpression {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2KAnonymityConfig { - /// Optional message indicating that multiple rows might be associated to a + /// Message indicating that multiple rows might be associated to a /// single individual. If the same entity_id is associated to multiple /// quasi-identifier tuples over distinct rows, we consider the entire /// collection of tuples as the composite quasi-identifier. This collection @@ -3505,12 +3908,12 @@ impl Part for GooglePrivacyDlpV2CloudStorageFileSet {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2DeltaPresenceEstimationConfig { /// ISO 3166-1 alpha-2 region code to use in the statistical modeling. - /// Required if no column is tagged with a region-specific InfoType (like + /// Set if no column is tagged with a region-specific InfoType (like /// US_ZIP_5) or a region code. #[serde(rename="regionCode")] pub region_code: Option, - /// Fields considered to be quasi-identifiers. No two fields can have the - /// same tag. [required] + /// Required. Fields considered to be quasi-identifiers. No two fields can have the + /// same tag. #[serde(rename="quasiIds")] pub quasi_ids: Option>, /// Several auxiliary tables can be used in the analysis. Each custom_tag @@ -3539,10 +3942,12 @@ pub struct GooglePrivacyDlpV2StoredInfoTypeVersion { /// anomalies detected in the storedInfoType data that render it unusable. Only /// the five most recent errors will be displayed, with the most recent error /// appearing first. - ///

          For example, some of the data for stored custom dictionaries is put in + /// + /// For example, some of the data for stored custom dictionaries is put in /// the user's Google Cloud Storage bucket, and if this data is modified or /// deleted by the user or another system, the dictionary becomes invalid. - ///

          If any errors occur, fix the problem indicated by the error message and + /// + /// If any errors occur, fix the problem indicated by the error message and /// use the UpdateStoredInfoType API method to create another version of the /// storedInfoType to continue using it, reusing the same `config` if it was /// not the source of the error. @@ -3564,19 +3969,18 @@ impl Part for GooglePrivacyDlpV2StoredInfoTypeVersion {} /// using publicly available data (like the US Census), or using a custom /// statistical model (indicated as one or several BigQuery tables), or by /// extrapolating from the distribution of values in the input dataset. -/// A column with a semantic tag attached. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2KMapEstimationConfig { /// ISO 3166-1 alpha-2 region code to use in the statistical modeling. - /// Required if no column is tagged with a region-specific InfoType (like + /// Set if no column is tagged with a region-specific InfoType (like /// US_ZIP_5) or a region code. #[serde(rename="regionCode")] pub region_code: Option, - /// Fields considered to be quasi-identifiers. No two columns can have the - /// same tag. [required] + /// Required. Fields considered to be quasi-identifiers. No two columns can have the + /// same tag. #[serde(rename="quasiIds")] pub quasi_ids: Option>, /// Several auxiliary tables can be used in the analysis. Each custom_tag @@ -3621,28 +4025,28 @@ impl ResponseResult for GooglePrivacyDlpV2DeidentifyContentResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2Value { - /// no description provided + /// time of day #[serde(rename="timeValue")] pub time_value: Option, - /// no description provided + /// timestamp #[serde(rename="timestampValue")] pub timestamp_value: Option, - /// no description provided + /// day of week #[serde(rename="dayOfWeekValue")] pub day_of_week_value: Option, - /// no description provided + /// float #[serde(rename="floatValue")] pub float_value: Option, - /// no description provided + /// date #[serde(rename="dateValue")] pub date_value: Option, - /// no description provided + /// string #[serde(rename="stringValue")] pub string_value: Option, - /// no description provided + /// boolean #[serde(rename="booleanValue")] pub boolean_value: Option, - /// no description provided + /// integer #[serde(rename="integerValue")] pub integer_value: Option, } @@ -3697,6 +4101,55 @@ pub struct GooglePrivacyDlpV2KAnonymityEquivalenceClass { impl Part for GooglePrivacyDlpV2KAnonymityEquivalenceClass {} +/// Populate to associate additional data with each finding. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2HybridFindingDetails { + /// Offset in bytes of the line, from the beginning of the file, where the + /// finding is located. Populate if the item being scanned is only part of a + /// bigger item, such as a shard of a file and you want to track the absolute + /// position of the finding. + #[serde(rename="fileOffset")] + pub file_offset: Option, + /// If the container is a table, additional information to make findings + /// meaningful such as the columns that are primary keys. If not known ahead + /// of time, can also be set within each inspect hybrid call and the two + /// will be merged. Note that identifying_fields will only be stored to + /// BigQuery, and only if the BigQuery action has been included. + #[serde(rename="tableOptions")] + pub table_options: Option, + /// Labels to represent user provided metadata about the data being inspected. + /// If configured by the job, some key values may be required. + /// The labels associated with `Finding`'s produced by hybrid + /// inspection. + /// + /// Label keys must be between 1 and 63 characters long and must conform + /// to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + /// + /// Label values must be between 0 and 63 characters long and must conform + /// to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + /// + /// No more than 10 labels can be associated with a given finding. + /// + /// Examples: + /// * `"environment" : "production"` + /// * `"pipeline" : "etl"` + pub labels: Option>, + /// Offset of the row for tables. Populate if the row(s) being scanned are + /// part of a bigger dataset and you want to keep track of their absolute + /// position. + #[serde(rename="rowOffset")] + pub row_offset: Option, + /// Details about the container where the content being inspected is from. + #[serde(rename="containerDetails")] + pub container_details: Option, +} + +impl Part for GooglePrivacyDlpV2HybridFindingDetails {} + + /// Record key for a finding in Cloud Datastore. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3719,13 +4172,19 @@ impl Part for GooglePrivacyDlpV2DatastoreKey {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [deidentify templates create organizations](struct.OrganizationDeidentifyTemplateCreateCall.html) (request) +/// * [locations deidentify templates create organizations](struct.OrganizationLocationDeidentifyTemplateCreateCall.html) (request) /// * [deidentify templates create projects](struct.ProjectDeidentifyTemplateCreateCall.html) (request) +/// * [locations deidentify templates create projects](struct.ProjectLocationDeidentifyTemplateCreateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2CreateDeidentifyTemplateRequest { - /// The DeidentifyTemplate to create. + /// Required. The DeidentifyTemplate to create. #[serde(rename="deidentifyTemplate")] pub deidentify_template: Option, + /// The geographic location to store the deidentification template. Reserved + /// for future extensions. + #[serde(rename="locationId")] + pub location_id: Option, /// The template id can contain uppercase and lowercase letters, /// numbers, and hyphens; that is, it must match the regular /// expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 @@ -3744,19 +4203,25 @@ impl RequestValue for GooglePrivacyDlpV2CreateDeidentifyTemplateRequest {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations stored info types create organizations](struct.OrganizationLocationStoredInfoTypeCreateCall.html) (request) /// * [stored info types create projects](struct.ProjectStoredInfoTypeCreateCall.html) (request) /// * [stored info types create organizations](struct.OrganizationStoredInfoTypeCreateCall.html) (request) +/// * [locations stored info types create projects](struct.ProjectLocationStoredInfoTypeCreateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2CreateStoredInfoTypeRequest { + /// Required. Configuration of the storedInfoType to create. + pub config: Option, /// The storedInfoType ID can contain uppercase and lowercase letters, /// numbers, and hyphens; that is, it must match the regular /// expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 /// characters. Can be empty to allow the system to generate one. #[serde(rename="storedInfoTypeId")] pub stored_info_type_id: Option, - /// Configuration of the storedInfoType to create. - pub config: Option, + /// The geographic location to store the stored infoType. Reserved for + /// future extensions. + #[serde(rename="locationId")] + pub location_id: Option, } impl RequestValue for GooglePrivacyDlpV2CreateStoredInfoTypeRequest {} @@ -3768,7 +4233,7 @@ impl RequestValue for GooglePrivacyDlpV2CreateStoredInfoTypeRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2Expressions { - /// no description provided + /// Conditions to apply to the expression. pub conditions: Option, /// The operator to apply to the result of conditions. Default and currently /// only supported value is `AND`. @@ -3809,6 +4274,9 @@ pub struct GooglePrivacyDlpV2CloudStorageOptions { /// If empty, all files are scanned and available data format processors /// are applied. In addition, the binary content of the selected files /// is always scanned as well. + /// Images are scanned only as binary if the specified region + /// does not support image inspection and no file_types were specified. + /// Image inspection is restricted to 'global', 'us', 'asia', and 'europe'. #[serde(rename="fileTypes")] pub file_types: Option>, /// The set of one or more files to scan. @@ -4003,6 +4471,21 @@ pub struct GoogleRpcStatus { impl Part for GoogleRpcStatus {} +/// The request message for finishing a DLP hybrid job. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations dlp jobs finish projects](struct.ProjectLocationDlpJobFinishCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2FinishDlpJobRequest { _never_set: Option } + +impl RequestValue for GooglePrivacyDlpV2FinishDlpJobRequest {} + + /// Configuration for a risk analysis job. See /// https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more. /// @@ -4031,8 +4514,11 @@ impl Part for GooglePrivacyDlpV2RiskAnalysisJobConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [job triggers activate projects](struct.ProjectJobTriggerActivateCall.html) (response) +/// * [locations dlp jobs get projects](struct.ProjectLocationDlpJobGetCall.html) (response) +/// * [locations job triggers activate projects](struct.ProjectLocationJobTriggerActivateCall.html) (response) /// * [dlp jobs get projects](struct.ProjectDlpJobGetCall.html) (response) +/// * [locations dlp jobs create projects](struct.ProjectLocationDlpJobCreateCall.html) (response) +/// * [job triggers activate projects](struct.ProjectJobTriggerActivateCall.html) (response) /// * [dlp jobs create projects](struct.ProjectDlpJobCreateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -4077,6 +4563,7 @@ impl ResponseResult for GooglePrivacyDlpV2DlpJob {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations dlp jobs list projects](struct.ProjectLocationDlpJobListCall.html) (response) /// * [dlp jobs list projects](struct.ProjectDlpJobListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -4131,6 +4618,22 @@ pub struct GooglePrivacyDlpV2Dictionary { impl Part for GooglePrivacyDlpV2Dictionary {} +/// Quota exceeded errors will be thrown once quota has been met. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations dlp jobs hybrid inspect projects](struct.ProjectLocationDlpJobHybridInspectCall.html) (response) +/// * [locations job triggers hybrid inspect projects](struct.ProjectLocationJobTriggerHybridInspectCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2HybridInspectResponse { _never_set: Option } + +impl ResponseResult for GooglePrivacyDlpV2HybridInspectResponse {} + + /// Statistics regarding a specific InfoType. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4154,7 +4657,7 @@ impl Part for GooglePrivacyDlpV2InfoTypeStats {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2TimePartConfig { - /// no description provided + /// The part of the time to keep. #[serde(rename="partToExtract")] pub part_to_extract: Option, } @@ -4169,6 +4672,7 @@ impl Part for GooglePrivacyDlpV2TimePartConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations dlp jobs cancel projects](struct.ProjectLocationDlpJobCancelCall.html) (request) /// * [dlp jobs cancel projects](struct.ProjectDlpJobCancelCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -4193,6 +4697,12 @@ pub struct GooglePrivacyDlpV2Result { /// Total size in bytes that were processed. #[serde(rename="processedBytes")] pub processed_bytes: Option, + /// Statistics related to the processing of hybrid inspect. + /// Early access feature is in a pre-release state and might change or have + /// limited support. For more information, see + /// https://cloud.google.com/products#product-launch-stages. + #[serde(rename="hybridStats")] + pub hybrid_stats: Option, } impl Part for GooglePrivacyDlpV2Result {} @@ -4206,7 +4716,7 @@ impl Part for GooglePrivacyDlpV2Result {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2RecordTransformations { /// Configuration defining which records get suppressed entirely. Records that - /// match any suppression rule are omitted from the output [optional]. + /// match any suppression rule are omitted from the output. #[serde(rename="recordSuppressions")] pub record_suppressions: Option>, /// Transform the record by applying various field transformations. @@ -4217,13 +4727,13 @@ pub struct GooglePrivacyDlpV2RecordTransformations { impl Part for GooglePrivacyDlpV2RecordTransformations {} -/// There is no detailed description. +/// A column with a semantic tag attached. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2TaggedField { - /// Identifies the column. [required] + /// Required. Identifies the column. pub field: Option, /// A column can be tagged with a custom tag. In this case, the user must /// indicate an auxiliary table that contains statistical information on @@ -4252,7 +4762,7 @@ impl Part for GooglePrivacyDlpV2TaggedField {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2TransientCryptoKey { - /// Name of the key. [required] + /// Required. Name of the key. /// This is an arbitrary string used to differentiate different keys. /// A unique key is generated per name: two separate `TransientCryptoKey` /// protos share the same generated key if their names are the same. @@ -4282,14 +4792,24 @@ impl Part for GooglePrivacyDlpV2TransientCryptoKey {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [deidentify templates delete projects](struct.ProjectDeidentifyTemplateDeleteCall.html) (response) -/// * [inspect templates delete projects](struct.ProjectInspectTemplateDeleteCall.html) (response) -/// * [job triggers delete projects](struct.ProjectJobTriggerDeleteCall.html) (response) +/// * [locations deidentify templates delete organizations](struct.OrganizationLocationDeidentifyTemplateDeleteCall.html) (response) +/// * [locations stored info types delete projects](struct.ProjectLocationStoredInfoTypeDeleteCall.html) (response) +/// * [locations inspect templates delete organizations](struct.OrganizationLocationInspectTemplateDeleteCall.html) (response) +/// * [locations deidentify templates delete projects](struct.ProjectLocationDeidentifyTemplateDeleteCall.html) (response) +/// * [locations dlp jobs finish projects](struct.ProjectLocationDlpJobFinishCall.html) (response) /// * [dlp jobs cancel projects](struct.ProjectDlpJobCancelCall.html) (response) /// * [stored info types delete projects](struct.ProjectStoredInfoTypeDeleteCall.html) (response) +/// * [locations stored info types delete organizations](struct.OrganizationLocationStoredInfoTypeDeleteCall.html) (response) +/// * [job triggers delete projects](struct.ProjectJobTriggerDeleteCall.html) (response) /// * [stored info types delete organizations](struct.OrganizationStoredInfoTypeDeleteCall.html) (response) +/// * [locations dlp jobs delete projects](struct.ProjectLocationDlpJobDeleteCall.html) (response) +/// * [locations dlp jobs cancel projects](struct.ProjectLocationDlpJobCancelCall.html) (response) /// * [deidentify templates delete organizations](struct.OrganizationDeidentifyTemplateDeleteCall.html) (response) /// * [dlp jobs delete projects](struct.ProjectDlpJobDeleteCall.html) (response) +/// * [inspect templates delete projects](struct.ProjectInspectTemplateDeleteCall.html) (response) +/// * [locations job triggers delete projects](struct.ProjectLocationJobTriggerDeleteCall.html) (response) /// * [inspect templates delete organizations](struct.OrganizationInspectTemplateDeleteCall.html) (response) +/// * [locations inspect templates delete projects](struct.ProjectLocationInspectTemplateDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleProtobufEmpty { _never_set: Option } @@ -4340,7 +4860,7 @@ pub struct GoogleTypeDate { impl Part for GoogleTypeDate {} -/// There is no detailed description. +/// Histogram of l-diversity equivalence class sensitive value frequencies. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -4369,17 +4889,23 @@ pub struct GooglePrivacyDlpV2LDiversityHistogramBucket { impl Part for GooglePrivacyDlpV2LDiversityHistogramBucket {} -/// Configuration for a StoredInfoType. +/// Configuration for stored infoTypes. All fields and subfield are provided +/// by the user. For more information, see +/// https://cloud.google.com/dlp/docs/creating-custom-infotypes. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2StoredInfoTypeConfig { + /// Store regular expression-based StoredInfoType. + pub regex: Option, /// Display name of the StoredInfoType (max 256 characters). #[serde(rename="displayName")] pub display_name: Option, /// Description of the StoredInfoType (max 256 characters). pub description: Option, + /// Store dictionary-based CustomInfoType. + pub dictionary: Option, /// StoredInfoType where findings are defined by a dictionary of phrases. #[serde(rename="largeCustomDictionary")] pub large_custom_dictionary: Option, @@ -4405,7 +4931,42 @@ pub struct GooglePrivacyDlpV2CategoricalStatsConfig { impl Part for GooglePrivacyDlpV2CategoricalStatsConfig {} -/// The DeidentifyTemplates contains instructions on how to deidentify content. +/// The field type of `value` and `field` do not need to match to be +/// considered equal, but not all comparisons are possible. +/// EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types, +/// but all other comparisons are invalid with incompatible types. +/// A `value` of type: +/// +/// - `string` can be compared against all other types +/// - `boolean` can only be compared against other booleans +/// - `integer` can be compared against doubles or a string if the string value +/// can be parsed as an integer. +/// - `double` can be compared against integers or a string if the string can +/// be parsed as a double. +/// - `Timestamp` can be compared against strings in RFC 3339 date string +/// format. +/// - `TimeOfDay` can be compared against timestamps and strings in the format +/// of 'HH:mm:ss'. +/// +/// If we fail to compare do to type mismatch, a warning will be given and +/// the condition will evaluate to false. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GooglePrivacyDlpV2Condition { + /// Required. Operator used to compare the field or infoType to the value. + pub operator: Option, + /// Required. Field within the record this condition is evaluated against. + pub field: Option, + /// Value to compare against. [Mandatory, except for `EXISTS` tests.] + pub value: Option, +} + +impl Part for GooglePrivacyDlpV2Condition {} + + +/// DeidentifyTemplates contains instructions on how to de-identify content. /// See https://cloud.google.com/dlp/docs/concepts-templates to learn more. /// /// # Activities @@ -4413,16 +4974,22 @@ impl Part for GooglePrivacyDlpV2CategoricalStatsConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations deidentify templates get organizations](struct.OrganizationLocationDeidentifyTemplateGetCall.html) (response) +/// * [locations deidentify templates patch organizations](struct.OrganizationLocationDeidentifyTemplatePatchCall.html) (response) /// * [deidentify templates get projects](struct.ProjectDeidentifyTemplateGetCall.html) (response) -/// * [deidentify templates patch projects](struct.ProjectDeidentifyTemplatePatchCall.html) (response) -/// * [deidentify templates create projects](struct.ProjectDeidentifyTemplateCreateCall.html) (response) -/// * [deidentify templates get organizations](struct.OrganizationDeidentifyTemplateGetCall.html) (response) /// * [deidentify templates create organizations](struct.OrganizationDeidentifyTemplateCreateCall.html) (response) +/// * [locations deidentify templates get projects](struct.ProjectLocationDeidentifyTemplateGetCall.html) (response) +/// * [locations deidentify templates create projects](struct.ProjectLocationDeidentifyTemplateCreateCall.html) (response) +/// * [deidentify templates create projects](struct.ProjectDeidentifyTemplateCreateCall.html) (response) +/// * [deidentify templates patch projects](struct.ProjectDeidentifyTemplatePatchCall.html) (response) +/// * [deidentify templates get organizations](struct.OrganizationDeidentifyTemplateGetCall.html) (response) +/// * [locations deidentify templates patch projects](struct.ProjectLocationDeidentifyTemplatePatchCall.html) (response) +/// * [locations deidentify templates create organizations](struct.OrganizationLocationDeidentifyTemplateCreateCall.html) (response) /// * [deidentify templates patch organizations](struct.OrganizationDeidentifyTemplatePatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2DeidentifyTemplate { - /// The last update timestamp of a inspectTemplate, output only field. + /// Output only. The last update timestamp of an inspectTemplate. #[serde(rename="updateTime")] pub update_time: Option, /// Display name (max 256 chars). @@ -4433,10 +5000,10 @@ pub struct GooglePrivacyDlpV2DeidentifyTemplate { /// ///////////// // The core content of the template // /////////////// #[serde(rename="deidentifyConfig")] pub deidentify_config: Option, - /// The creation timestamp of a inspectTemplate, output only field. + /// Output only. The creation timestamp of an inspectTemplate. #[serde(rename="createTime")] pub create_time: Option, - /// The template name. Output only. + /// Output only. The template name. /// /// The template will have one of the following formats: /// `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR @@ -4605,22 +5172,29 @@ impl Part for GooglePrivacyDlpV2NumericalStatsConfig {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [content inspect projects](struct.ProjectContentInspectCall.html) (request) +/// * [locations content inspect projects](struct.ProjectLocationContentInspectCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GooglePrivacyDlpV2InspectContentRequest { /// The item to inspect. pub item: Option, - /// Configuration for the inspector. What specified here will override - /// the template referenced by the inspect_template_name argument. - #[serde(rename="inspectConfig")] - pub inspect_config: Option, - /// Optional template to use. Any configuration directly specified in + /// Template to use. Any configuration directly specified in /// inspect_config will override those set in the template. Singular fields /// that are set in this request will replace their corresponding fields in the /// template. Repeated fields are appended. Singular sub-messages and groups /// are recursively merged. #[serde(rename="inspectTemplateName")] pub inspect_template_name: Option, + /// Configuration for the inspector. What specified here will override + /// the template referenced by the inspect_template_name argument. + #[serde(rename="inspectConfig")] + pub inspect_config: Option, + /// The geographic location to process content inspection. Reserved for future + /// extensions. + /// When inspecting images location is restricted to 'global', 'us', 'asia', + /// and 'europe'. + #[serde(rename="locationId")] + pub location_id: Option, } impl RequestValue for GooglePrivacyDlpV2InspectContentRequest {} @@ -4655,7 +5229,7 @@ impl RequestValue for GooglePrivacyDlpV2InspectContentRequest {} /// ::default(), None); /// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `deidentify_templates_create(...)`, `deidentify_templates_delete(...)`, `deidentify_templates_get(...)`, `deidentify_templates_list(...)`, `deidentify_templates_patch(...)`, `inspect_templates_create(...)`, `inspect_templates_delete(...)`, `inspect_templates_get(...)`, `inspect_templates_list(...)`, `inspect_templates_patch(...)`, `stored_info_types_create(...)`, `stored_info_types_delete(...)`, `stored_info_types_get(...)`, `stored_info_types_list(...)` and `stored_info_types_patch(...)` +/// // like `deidentify_templates_create(...)`, `deidentify_templates_delete(...)`, `deidentify_templates_get(...)`, `deidentify_templates_list(...)`, `deidentify_templates_patch(...)`, `inspect_templates_create(...)`, `inspect_templates_delete(...)`, `inspect_templates_get(...)`, `inspect_templates_list(...)`, `inspect_templates_patch(...)`, `locations_deidentify_templates_create(...)`, `locations_deidentify_templates_delete(...)`, `locations_deidentify_templates_get(...)`, `locations_deidentify_templates_list(...)`, `locations_deidentify_templates_patch(...)`, `locations_inspect_templates_create(...)`, `locations_inspect_templates_delete(...)`, `locations_inspect_templates_get(...)`, `locations_inspect_templates_list(...)`, `locations_inspect_templates_patch(...)`, `locations_stored_info_types_create(...)`, `locations_stored_info_types_delete(...)`, `locations_stored_info_types_get(...)`, `locations_stored_info_types_list(...)`, `locations_stored_info_types_patch(...)`, `stored_info_types_create(...)`, `stored_info_types_delete(...)`, `stored_info_types_get(...)`, `stored_info_types_list(...)` and `stored_info_types_patch(...)` /// // to build up your call. /// let rb = hub.organizations(); /// # } @@ -4677,7 +5251,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the organization and inspectTemplate to be read, for + /// * `name` - Required. Resource name of the organization and inspectTemplate to be read, for /// example `organizations/433245324/inspectTemplates/432452342` or /// projects/project-id/inspectTemplates/432452342. pub fn inspect_templates_get(&self, name: &str) -> OrganizationInspectTemplateGetCall<'a, C, A> { @@ -4692,17 +5266,86 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a DeidentifyTemplate. + /// Deletes a stored infoType. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and storedInfoType to be deleted, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn locations_stored_info_types_delete(&self, name: &str) -> OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> { + OrganizationLocationStoredInfoTypeDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists stored infoTypes. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location where stored infoTypes will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + pub fn locations_stored_info_types_list(&self, parent: &str, location_id: &str) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> { + OrganizationLocationStoredInfoTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a pre-built stored infoType to be used for inspection. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn stored_info_types_create(&self, request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, parent: &str) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { + OrganizationStoredInfoTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a DeidentifyTemplate. /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn /// more. /// /// # Arguments /// - /// * `name` - Resource name of the organization and deidentify template to be deleted, - /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// * `name` - Required. Resource name of the organization and deidentify template to be read, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or /// projects/project-id/deidentifyTemplates/432452342. - pub fn deidentify_templates_delete(&self, name: &str) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> { - OrganizationDeidentifyTemplateDeleteCall { + pub fn locations_deidentify_templates_get(&self, name: &str) -> OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> { + OrganizationLocationDeidentifyTemplateGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -4721,13 +5364,16 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id or + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. - pub fn deidentify_templates_create(&self, request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, parent: &str) -> OrganizationDeidentifyTemplateCreateCall<'a, C, A> { - OrganizationDeidentifyTemplateCreateCall { + /// * `locationId` - The geographic location to store the deidentification template. Reserved + /// for future extensions. + pub fn locations_deidentify_templates_create(&self, request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, parent: &str, location_id: &str) -> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> { + OrganizationLocationDeidentifyTemplateCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), + _location_id: location_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4736,20 +5382,42 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the DeidentifyTemplate. - /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - /// more. + /// Lists stored infoTypes. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `name` - Resource name of organization and deidentify template to be updated, for - /// example `organizations/433245324/deidentifyTemplates/432452342` or - /// projects/project-id/deidentifyTemplates/432452342. - pub fn deidentify_templates_patch(&self, request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, name: &str) -> OrganizationDeidentifyTemplatePatchCall<'a, C, A> { - OrganizationDeidentifyTemplatePatchCall { + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn stored_info_types_list(&self, parent: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { + OrganizationStoredInfoTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _location_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a stored infoType. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and storedInfoType to be deleted, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn stored_info_types_delete(&self, name: &str) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> { + OrganizationStoredInfoTypeDeleteCall { hub: self.hub, - _request: request, _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -4766,10 +5434,172 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id or + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. - pub fn stored_info_types_create(&self, request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, parent: &str) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { - OrganizationStoredInfoTypeCreateCall { + /// * `locationId` - The geographic location to store the stored infoType. Reserved for + /// future extensions. + pub fn locations_stored_info_types_create(&self, request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, parent: &str, location_id: &str) -> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> { + OrganizationLocationStoredInfoTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn locations_deidentify_templates_delete(&self, name: &str) -> OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> { + OrganizationLocationDeidentifyTemplateDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the InspectTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn locations_inspect_templates_patch(&self, request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, name: &str) -> OrganizationLocationInspectTemplatePatchCall<'a, C, A> { + OrganizationLocationInspectTemplatePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the InspectTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn inspect_templates_patch(&self, request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, name: &str) -> OrganizationInspectTemplatePatchCall<'a, C, A> { + OrganizationInspectTemplatePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists InspectTemplates. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn inspect_templates_list(&self, parent: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + OrganizationInspectTemplateListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _location_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists DeidentifyTemplates. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn deidentify_templates_list(&self, parent: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { + OrganizationDeidentifyTemplateListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _location_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the stored infoType by creating a new version. The existing version + /// will continue to be used until the new version is ready. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and storedInfoType to be updated, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn locations_stored_info_types_patch(&self, request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, name: &str) -> OrganizationLocationStoredInfoTypePatchCall<'a, C, A> { + OrganizationLocationStoredInfoTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a DeidentifyTemplate for re-using frequently used configuration + /// for de-identifying content, images, and storage. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn deidentify_templates_create(&self, request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, parent: &str) -> OrganizationDeidentifyTemplateCreateCall<'a, C, A> { + OrganizationDeidentifyTemplateCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), @@ -4781,18 +5611,66 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a stored infoType. + /// Gets an InspectTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and inspectTemplate to be read, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn locations_inspect_templates_get(&self, name: &str) -> OrganizationLocationInspectTemplateGetCall<'a, C, A> { + OrganizationLocationInspectTemplateGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an InspectTemplate for re-using frequently used configuration + /// for inspecting content, images, and storage. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location to store the inspection template. Reserved for + /// future extensions. + pub fn locations_inspect_templates_create(&self, request: GooglePrivacyDlpV2CreateInspectTemplateRequest, parent: &str, location_id: &str) -> OrganizationLocationInspectTemplateCreateCall<'a, C, A> { + OrganizationLocationInspectTemplateCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the stored infoType by creating a new version. The existing version + /// will continue to be used until the new version is ready. /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to /// learn more. /// /// # Arguments /// - /// * `name` - Resource name of the organization and storedInfoType to be read, for + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and storedInfoType to be updated, for /// example `organizations/433245324/storedInfoTypes/432452342` or /// projects/project-id/storedInfoTypes/432452342. - pub fn stored_info_types_get(&self, name: &str) -> OrganizationStoredInfoTypeGetCall<'a, C, A> { - OrganizationStoredInfoTypeGetCall { + pub fn stored_info_types_patch(&self, request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, name: &str) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { + OrganizationStoredInfoTypePatchCall { hub: self.hub, + _request: request, _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -4807,7 +5685,162 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the organization and inspectTemplate to be deleted, for + /// * `name` - Required. Resource name of the organization and inspectTemplate to be deleted, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn locations_inspect_templates_delete(&self, name: &str) -> OrganizationLocationInspectTemplateDeleteCall<'a, C, A> { + OrganizationLocationInspectTemplateDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists DeidentifyTemplates. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location where deidentifications templates will be retrieved + /// from. Use `-` for all locations. Reserved for future extensions. + pub fn locations_deidentify_templates_list(&self, parent: &str, location_id: &str) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> { + OrganizationLocationDeidentifyTemplateListCall { + hub: self.hub, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a stored infoType. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and storedInfoType to be read, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn locations_stored_info_types_get(&self, name: &str) -> OrganizationLocationStoredInfoTypeGetCall<'a, C, A> { + OrganizationLocationStoredInfoTypeGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn deidentify_templates_delete(&self, name: &str) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> { + OrganizationDeidentifyTemplateDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and deidentify template to be updated, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn deidentify_templates_patch(&self, request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, name: &str) -> OrganizationDeidentifyTemplatePatchCall<'a, C, A> { + OrganizationDeidentifyTemplatePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a stored infoType. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and storedInfoType to be read, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn stored_info_types_get(&self, name: &str) -> OrganizationStoredInfoTypeGetCall<'a, C, A> { + OrganizationStoredInfoTypeGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and deidentify template to be updated, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn locations_deidentify_templates_patch(&self, request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, name: &str) -> OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> { + OrganizationLocationDeidentifyTemplatePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an InspectTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and inspectTemplate to be deleted, for /// example `organizations/433245324/inspectTemplates/432452342` or /// projects/project-id/inspectTemplates/432452342. pub fn inspect_templates_delete(&self, name: &str) -> OrganizationInspectTemplateDeleteCall<'a, C, A> { @@ -4829,7 +5862,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id or + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. pub fn inspect_templates_create(&self, request: GooglePrivacyDlpV2CreateInspectTemplateRequest, parent: &str) -> OrganizationInspectTemplateCreateCall<'a, C, A> { OrganizationInspectTemplateCreateCall { @@ -4842,28 +5875,6 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates the InspectTemplate. - /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Resource name of organization and inspectTemplate to be updated, for - /// example `organizations/433245324/inspectTemplates/432452342` or - /// projects/project-id/inspectTemplates/432452342. - pub fn inspect_templates_patch(&self, request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, name: &str) -> OrganizationInspectTemplatePatchCall<'a, C, A> { - OrganizationInspectTemplatePatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists InspectTemplates. @@ -4871,12 +5882,15 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The parent resource name, for example projects/my-project-id or + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. - pub fn inspect_templates_list(&self, parent: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { - OrganizationInspectTemplateListCall { + /// * `locationId` - The geographic location where inspection templates will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + pub fn locations_inspect_templates_list(&self, parent: &str, location_id: &str) -> OrganizationLocationInspectTemplateListCall<'a, C, A> { + OrganizationLocationInspectTemplateListCall { hub: self.hub, _parent: parent.to_string(), + _location_id: location_id.to_string(), _page_token: Default::default(), _page_size: Default::default(), _order_by: Default::default(), @@ -4886,50 +5900,6 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists stored infoTypes. - /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - /// learn more. - /// - /// # Arguments - /// - /// * `parent` - The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - pub fn stored_info_types_list(&self, parent: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { - OrganizationStoredInfoTypeListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _order_by: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes a stored infoType. - /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - /// learn more. - /// - /// # Arguments - /// - /// * `name` - Resource name of the organization and storedInfoType to be deleted, for - /// example `organizations/433245324/storedInfoTypes/432452342` or - /// projects/project-id/storedInfoTypes/432452342. - pub fn stored_info_types_delete(&self, name: &str) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> { - OrganizationStoredInfoTypeDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Gets a DeidentifyTemplate. @@ -4938,7 +5908,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the organization and deidentify template to be read, for + /// * `name` - Required. Resource name of the organization and deidentify template to be read, for /// example `organizations/433245324/deidentifyTemplates/432452342` or /// projects/project-id/deidentifyTemplates/432452342. pub fn deidentify_templates_get(&self, name: &str) -> OrganizationDeidentifyTemplateGetCall<'a, C, A> { @@ -4950,53 +5920,6 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Updates the stored infoType by creating a new version. The existing version - /// will continue to be used until the new version is ready. - /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - /// learn more. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Resource name of organization and storedInfoType to be updated, for - /// example `organizations/433245324/storedInfoTypes/432452342` or - /// projects/project-id/storedInfoTypes/432452342. - pub fn stored_info_types_patch(&self, request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, name: &str) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { - OrganizationStoredInfoTypePatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists DeidentifyTemplates. - /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - /// more. - /// - /// # Arguments - /// - /// * `parent` - The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - pub fn deidentify_templates_list(&self, parent: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { - OrganizationDeidentifyTemplateListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _order_by: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -5048,6 +5971,7 @@ impl<'a, C, A> InfoTypeMethods<'a, C, A> { pub fn list(&self) -> InfoTypeListCall<'a, C, A> { InfoTypeListCall { hub: self.hub, + _location_id: Default::default(), _language_code: Default::default(), _filter: Default::default(), _delegate: Default::default(), @@ -5083,7 +6007,7 @@ impl<'a, C, A> InfoTypeMethods<'a, C, A> { /// ::default(), None); /// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `content_deidentify(...)`, `content_inspect(...)`, `content_reidentify(...)`, `deidentify_templates_create(...)`, `deidentify_templates_delete(...)`, `deidentify_templates_get(...)`, `deidentify_templates_list(...)`, `deidentify_templates_patch(...)`, `dlp_jobs_cancel(...)`, `dlp_jobs_create(...)`, `dlp_jobs_delete(...)`, `dlp_jobs_get(...)`, `dlp_jobs_list(...)`, `image_redact(...)`, `inspect_templates_create(...)`, `inspect_templates_delete(...)`, `inspect_templates_get(...)`, `inspect_templates_list(...)`, `inspect_templates_patch(...)`, `job_triggers_activate(...)`, `job_triggers_create(...)`, `job_triggers_delete(...)`, `job_triggers_get(...)`, `job_triggers_list(...)`, `job_triggers_patch(...)`, `locations_content_deidentify(...)`, `stored_info_types_create(...)`, `stored_info_types_delete(...)`, `stored_info_types_get(...)`, `stored_info_types_list(...)` and `stored_info_types_patch(...)` +/// // like `content_deidentify(...)`, `content_inspect(...)`, `content_reidentify(...)`, `deidentify_templates_create(...)`, `deidentify_templates_delete(...)`, `deidentify_templates_get(...)`, `deidentify_templates_list(...)`, `deidentify_templates_patch(...)`, `dlp_jobs_cancel(...)`, `dlp_jobs_create(...)`, `dlp_jobs_delete(...)`, `dlp_jobs_get(...)`, `dlp_jobs_list(...)`, `image_redact(...)`, `inspect_templates_create(...)`, `inspect_templates_delete(...)`, `inspect_templates_get(...)`, `inspect_templates_list(...)`, `inspect_templates_patch(...)`, `job_triggers_activate(...)`, `job_triggers_create(...)`, `job_triggers_delete(...)`, `job_triggers_get(...)`, `job_triggers_list(...)`, `job_triggers_patch(...)`, `locations_content_deidentify(...)`, `locations_content_inspect(...)`, `locations_content_reidentify(...)`, `locations_deidentify_templates_create(...)`, `locations_deidentify_templates_delete(...)`, `locations_deidentify_templates_get(...)`, `locations_deidentify_templates_list(...)`, `locations_deidentify_templates_patch(...)`, `locations_dlp_jobs_cancel(...)`, `locations_dlp_jobs_create(...)`, `locations_dlp_jobs_delete(...)`, `locations_dlp_jobs_finish(...)`, `locations_dlp_jobs_get(...)`, `locations_dlp_jobs_hybrid_inspect(...)`, `locations_dlp_jobs_list(...)`, `locations_image_redact(...)`, `locations_inspect_templates_create(...)`, `locations_inspect_templates_delete(...)`, `locations_inspect_templates_get(...)`, `locations_inspect_templates_list(...)`, `locations_inspect_templates_patch(...)`, `locations_job_triggers_activate(...)`, `locations_job_triggers_create(...)`, `locations_job_triggers_delete(...)`, `locations_job_triggers_get(...)`, `locations_job_triggers_hybrid_inspect(...)`, `locations_job_triggers_list(...)`, `locations_job_triggers_patch(...)`, `locations_stored_info_types_create(...)`, `locations_stored_info_types_delete(...)`, `locations_stored_info_types_get(...)`, `locations_stored_info_types_list(...)`, `locations_stored_info_types_patch(...)`, `stored_info_types_create(...)`, `stored_info_types_delete(...)`, `stored_info_types_get(...)`, `stored_info_types_list(...)` and `stored_info_types_patch(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -5105,11 +6029,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the organization and inspectTemplate to be read, for + /// * `name` - Required. Resource name of the organization and inspectTemplate to be read, for /// example `organizations/433245324/inspectTemplates/432452342` or /// projects/project-id/inspectTemplates/432452342. - pub fn inspect_templates_get(&self, name: &str) -> ProjectInspectTemplateGetCall<'a, C, A> { - ProjectInspectTemplateGetCall { + pub fn locations_inspect_templates_get(&self, name: &str) -> ProjectLocationInspectTemplateGetCall<'a, C, A> { + ProjectLocationInspectTemplateGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -5126,7 +6050,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the organization and deidentify template to be read, for + /// * `name` - Required. Resource name of the organization and deidentify template to be read, for /// example `organizations/433245324/deidentifyTemplates/432452342` or /// projects/project-id/deidentifyTemplates/432452342. pub fn deidentify_templates_get(&self, name: &str) -> ProjectDeidentifyTemplateGetCall<'a, C, A> { @@ -5141,17 +6065,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the InspectTemplate. - /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// Finish a running hybrid DlpJob. Triggers the finalization steps and running + /// of any enabled actions that have not yet run. + /// Early access feature is in a pre-release state and might change or have + /// limited support. For more information, see + /// https://cloud.google.com/products#product-launch-stages. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Resource name of organization and inspectTemplate to be updated, for - /// example `organizations/433245324/inspectTemplates/432452342` or - /// projects/project-id/inspectTemplates/432452342. - pub fn inspect_templates_patch(&self, request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, name: &str) -> ProjectInspectTemplatePatchCall<'a, C, A> { - ProjectInspectTemplatePatchCall { + /// * `name` - Required. The name of the DlpJob resource to be cancelled. + pub fn locations_dlp_jobs_finish(&self, request: GooglePrivacyDlpV2FinishDlpJobRequest, name: &str) -> ProjectLocationDlpJobFinishCall<'a, C, A> { + ProjectLocationDlpJobFinishCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -5169,7 +6094,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the organization and storedInfoType to be deleted, for + /// * `name` - Required. Resource name of the organization and storedInfoType to be deleted, for /// example `organizations/433245324/storedInfoTypes/432452342` or /// projects/project-id/storedInfoTypes/432452342. pub fn stored_info_types_delete(&self, name: &str) -> ProjectStoredInfoTypeDeleteCall<'a, C, A> { @@ -5182,6 +6107,369 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Re-identifies content that has been de-identified. + /// See + /// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example + /// to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name. + /// * `locationId` - The geographic location to process content reidentification. Reserved for + /// future extensions. + pub fn locations_content_reidentify(&self, request: GooglePrivacyDlpV2ReidentifyContentRequest, parent: &str, location_id: &str) -> ProjectLocationContentReidentifyCall<'a, C, A> { + ProjectLocationContentReidentifyCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a job trigger. + /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the project and the triggeredJob, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + pub fn locations_job_triggers_get(&self, name: &str) -> ProjectLocationJobTriggerGetCall<'a, C, A> { + ProjectLocationJobTriggerGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists DlpJobs that match the specified filter in the request. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id. + /// * `locationId` - The geographic location where jobs will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + pub fn locations_dlp_jobs_list(&self, parent: &str, location_id: &str) -> ProjectLocationDlpJobListCall<'a, C, A> { + ProjectLocationDlpJobListCall { + hub: self.hub, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _type_: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inspect hybrid content and store findings to a job. + /// To review the findings inspect the job. Inspection will occur + /// asynchronously. + /// Early access feature is in a pre-release state and might change or have + /// limited support. For more information, see + /// https://cloud.google.com/products#product-launch-stages. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of the job to execute a hybrid inspect on, for example + /// `projects/dlp-test-project/dlpJob/53234423`. + pub fn locations_dlp_jobs_hybrid_inspect(&self, request: GooglePrivacyDlpV2HybridInspectDlpJobRequest, name: &str) -> ProjectLocationDlpJobHybridInspectCall<'a, C, A> { + ProjectLocationDlpJobHybridInspectCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates an InspectTemplate for re-using frequently used configuration + /// for inspecting content, images, and storage. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn inspect_templates_create(&self, request: GooglePrivacyDlpV2CreateInspectTemplateRequest, parent: &str) -> ProjectInspectTemplateCreateCall<'a, C, A> { + ProjectInspectTemplateCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists InspectTemplates. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location where inspection templates will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + pub fn locations_inspect_templates_list(&self, parent: &str, location_id: &str) -> ProjectLocationInspectTemplateListCall<'a, C, A> { + ProjectLocationInspectTemplateListCall { + hub: self.hub, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running DlpJob. This method indicates that the client is + /// no longer interested in the DlpJob result. The job will be cancelled if + /// possible. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the DlpJob resource to be deleted. + pub fn locations_dlp_jobs_delete(&self, name: &str) -> ProjectLocationDlpJobDeleteCall<'a, C, A> { + ProjectLocationDlpJobDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Activate a job trigger. Causes the immediate execute of a trigger + /// instead of waiting on the trigger event to occur. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of the trigger to activate, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + pub fn locations_job_triggers_activate(&self, request: GooglePrivacyDlpV2ActivateJobTriggerRequest, name: &str) -> ProjectLocationJobTriggerActivateCall<'a, C, A> { + ProjectLocationJobTriggerActivateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists InspectTemplates. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn inspect_templates_list(&self, parent: &str) -> ProjectInspectTemplateListCall<'a, C, A> { + ProjectInspectTemplateListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _location_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a job trigger to run DLP actions such as scanning storage for + /// sensitive information on a set schedule. + /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id. + /// * `locationId` - The geographic location to store the job trigger. Reserved for + /// future extensions. + pub fn locations_job_triggers_create(&self, request: GooglePrivacyDlpV2CreateJobTriggerRequest, parent: &str, location_id: &str) -> ProjectLocationJobTriggerCreateCall<'a, C, A> { + ProjectLocationJobTriggerCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn deidentify_templates_delete(&self, name: &str) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> { + ProjectDeidentifyTemplateDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a pre-built stored infoType to be used for inspection. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn stored_info_types_create(&self, request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, parent: &str) -> ProjectStoredInfoTypeCreateCall<'a, C, A> { + ProjectStoredInfoTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inspect hybrid content and store findings to a trigger. The inspection + /// will be processed asynchronously. To review the findings monitor the + /// jobs within the trigger. + /// Early access feature is in a pre-release state and might change or have + /// limited support. For more information, see + /// https://cloud.google.com/products#product-launch-stages. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of the trigger to execute a hybrid inspect on, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + pub fn locations_job_triggers_hybrid_inspect(&self, request: GooglePrivacyDlpV2HybridInspectJobTriggerRequest, name: &str) -> ProjectLocationJobTriggerHybridInspectCall<'a, C, A> { + ProjectLocationJobTriggerHybridInspectCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running DlpJob. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the DlpJob resource. + pub fn locations_dlp_jobs_get(&self, name: &str) -> ProjectLocationDlpJobGetCall<'a, C, A> { + ProjectLocationDlpJobGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and deidentify template to be read, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn locations_deidentify_templates_get(&self, name: &str) -> ProjectLocationDeidentifyTemplateGetCall<'a, C, A> { + ProjectLocationDeidentifyTemplateGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and deidentify template to be updated, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn deidentify_templates_patch(&self, request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, name: &str) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> { + ProjectDeidentifyTemplatePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a job trigger. @@ -5190,7 +6478,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Resource name of the project and the triggeredJob, for example + /// * `name` - Required. Resource name of the project and the triggeredJob, for example /// `projects/dlp-test-project/jobTriggers/53234423`. pub fn job_triggers_patch(&self, request: GooglePrivacyDlpV2UpdateJobTriggerRequest, name: &str) -> ProjectJobTriggerPatchCall<'a, C, A> { ProjectJobTriggerPatchCall { @@ -5218,14 +6506,336 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `parent` - The parent resource name, for example projects/my-project-id. - /// * `location` - The geographic location to process de-identification. Reserved for future - /// extensions. - pub fn locations_content_deidentify(&self, request: GooglePrivacyDlpV2DeidentifyContentRequest, parent: &str, location: &str) -> ProjectLocationContentDeidentifyCall<'a, C, A> { + /// * `locationId` - The geographic location to process de-identification. Reserved for future + /// extensions. + pub fn locations_content_deidentify(&self, request: GooglePrivacyDlpV2DeidentifyContentRequest, parent: &str, location_id: &str) -> ProjectLocationContentDeidentifyCall<'a, C, A> { ProjectLocationContentDeidentifyCall { hub: self.hub, _request: request, _parent: parent.to_string(), - _location: location.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists job triggers. + /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example `projects/my-project-id`. + /// * `locationId` - The geographic location where job triggers will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + pub fn locations_job_triggers_list(&self, parent: &str, location_id: &str) -> ProjectLocationJobTriggerListCall<'a, C, A> { + ProjectLocationJobTriggerListCall { + hub: self.hub, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new job to inspect storage or calculate risk metrics. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// + /// When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the + /// system will automatically choose what detectors to run. By default this may + /// be all types, but may change over time as detectors are updated. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id. + pub fn dlp_jobs_create(&self, request: GooglePrivacyDlpV2CreateDlpJobRequest, parent: &str) -> ProjectDlpJobCreateCall<'a, C, A> { + ProjectDlpJobCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the stored infoType by creating a new version. The existing version + /// will continue to be used until the new version is ready. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and storedInfoType to be updated, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn stored_info_types_patch(&self, request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, name: &str) -> ProjectStoredInfoTypePatchCall<'a, C, A> { + ProjectStoredInfoTypePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running DlpJob. The server + /// makes a best effort to cancel the DlpJob, but success is not + /// guaranteed. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the DlpJob resource to be cancelled. + pub fn dlp_jobs_cancel(&self, request: GooglePrivacyDlpV2CancelDlpJobRequest, name: &str) -> ProjectDlpJobCancelCall<'a, C, A> { + ProjectDlpJobCancelCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running DlpJob. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the DlpJob resource. + pub fn dlp_jobs_get(&self, name: &str) -> ProjectDlpJobGetCall<'a, C, A> { + ProjectDlpJobGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of organization and deidentify template to be updated, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn locations_deidentify_templates_patch(&self, request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, name: &str) -> ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> { + ProjectLocationDeidentifyTemplatePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a job trigger. + /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Resource name of the project and the triggeredJob, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + pub fn locations_job_triggers_patch(&self, request: GooglePrivacyDlpV2UpdateJobTriggerRequest, name: &str) -> ProjectLocationJobTriggerPatchCall<'a, C, A> { + ProjectLocationJobTriggerPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a pre-built stored infoType to be used for inspection. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location to store the stored infoType. Reserved for + /// future extensions. + pub fn locations_stored_info_types_create(&self, request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, parent: &str, location_id: &str) -> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> { + ProjectLocationStoredInfoTypeCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a DeidentifyTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + pub fn locations_deidentify_templates_delete(&self, name: &str) -> ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> { + ProjectLocationDeidentifyTemplateDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Re-identifies content that has been de-identified. + /// See + /// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example + /// to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name. + pub fn content_reidentify(&self, request: GooglePrivacyDlpV2ReidentifyContentRequest, parent: &str) -> ProjectContentReidentifyCall<'a, C, A> { + ProjectContentReidentifyCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Finds potentially sensitive info in content. + /// This method has limits on input size, processing time, and output size. + /// + /// When no InfoTypes or CustomInfoTypes are specified in this request, the + /// system will automatically choose what detectors to run. By default this may + /// be all types, but may change over time as detectors are updated. + /// + /// For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images + /// and https://cloud.google.com/dlp/docs/inspecting-text, + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The parent resource name, for example projects/my-project-id. + /// * `locationId` - The geographic location to process content inspection. Reserved for future + /// extensions. + /// When inspecting images location is restricted to 'global', 'us', 'asia', + /// and 'europe'. + pub fn locations_content_inspect(&self, request: GooglePrivacyDlpV2InspectContentRequest, parent: &str, location_id: &str) -> ProjectLocationContentInspectCall<'a, C, A> { + ProjectLocationContentInspectCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running DlpJob. This method indicates that the client is + /// no longer interested in the DlpJob result. The job will be cancelled if + /// possible. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the DlpJob resource to be deleted. + pub fn dlp_jobs_delete(&self, name: &str) -> ProjectDlpJobDeleteCall<'a, C, A> { + ProjectDlpJobDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a stored infoType. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and storedInfoType to be read, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn locations_stored_info_types_get(&self, name: &str) -> ProjectLocationStoredInfoTypeGetCall<'a, C, A> { + ProjectLocationStoredInfoTypeGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets an InspectTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and inspectTemplate to be read, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn inspect_templates_get(&self, name: &str) -> ProjectInspectTemplateGetCall<'a, C, A> { + ProjectInspectTemplateGetCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5266,7 +6876,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the organization and inspectTemplate to be deleted, for + /// * `name` - Required. Resource name of the organization and inspectTemplate to be deleted, for /// example `organizations/433245324/inspectTemplates/432452342` or /// projects/project-id/inspectTemplates/432452342. pub fn inspect_templates_delete(&self, name: &str) -> ProjectInspectTemplateDeleteCall<'a, C, A> { @@ -5281,21 +6891,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the DeidentifyTemplate. - /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - /// more. + /// Redacts potentially sensitive info from an image. + /// This method has limits on input size, processing time, and output size. + /// See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to + /// learn more. + /// + /// When no InfoTypes or CustomInfoTypes are specified in this request, the + /// system will automatically choose what detectors to run. By default this may + /// be all types, but may change over time as detectors are updated. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Resource name of organization and deidentify template to be updated, for - /// example `organizations/433245324/deidentifyTemplates/432452342` or - /// projects/project-id/deidentifyTemplates/432452342. - pub fn deidentify_templates_patch(&self, request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, name: &str) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> { - ProjectDeidentifyTemplatePatchCall { + /// * `parent` - The parent resource name, for example projects/my-project-id. + /// * `locationId` - The geographic location to process the request. Reserved for future + /// extensions. + /// Location is restricted to 'global', 'us', 'asia', and 'europe'. + pub fn locations_image_redact(&self, request: GooglePrivacyDlpV2RedactImageRequest, parent: &str, location_id: &str) -> ProjectLocationImageRedactCall<'a, C, A> { + ProjectLocationImageRedactCall { hub: self.hub, _request: request, - _name: name.to_string(), + _parent: parent.to_string(), + _location_id: location_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5309,7 +6926,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the project and the triggeredJob, for example + /// * `name` - Required. Resource name of the project and the triggeredJob, for example /// `projects/dlp-test-project/jobTriggers/53234423`. pub fn job_triggers_get(&self, name: &str) -> ProjectJobTriggerGetCall<'a, C, A> { ProjectJobTriggerGetCall { @@ -5323,87 +6940,20 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a stored infoType. - /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - /// learn more. - /// - /// # Arguments - /// - /// * `name` - Resource name of the organization and storedInfoType to be read, for - /// example `organizations/433245324/storedInfoTypes/432452342` or - /// projects/project-id/storedInfoTypes/432452342. - pub fn stored_info_types_get(&self, name: &str) -> ProjectStoredInfoTypeGetCall<'a, C, A> { - ProjectStoredInfoTypeGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates an InspectTemplate for re-using frequently used configuration - /// for inspecting content, images, and storage. + /// Updates the InspectTemplate. /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - pub fn inspect_templates_create(&self, request: GooglePrivacyDlpV2CreateInspectTemplateRequest, parent: &str) -> ProjectInspectTemplateCreateCall<'a, C, A> { - ProjectInspectTemplateCreateCall { + /// * `name` - Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn inspect_templates_patch(&self, request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, name: &str) -> ProjectInspectTemplatePatchCall<'a, C, A> { + ProjectInspectTemplatePatchCall { hub: self.hub, _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a job trigger to run DLP actions such as scanning storage for - /// sensitive information on a set schedule. - /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id. - pub fn job_triggers_create(&self, request: GooglePrivacyDlpV2CreateJobTriggerRequest, parent: &str) -> ProjectJobTriggerCreateCall<'a, C, A> { - ProjectJobTriggerCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new job to inspect storage or calculate risk metrics. - /// See https://cloud.google.com/dlp/docs/inspecting-storage and - /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - /// - /// When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the - /// system will automatically choose what detectors to run. By default this may - /// be all types, but may change over time as detectors are updated. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id. - pub fn dlp_jobs_create(&self, request: GooglePrivacyDlpV2CreateDlpJobRequest, parent: &str) -> ProjectDlpJobCreateCall<'a, C, A> { - ProjectDlpJobCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5420,11 +6970,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Resource name of organization and storedInfoType to be updated, for + /// * `name` - Required. Resource name of organization and storedInfoType to be updated, for /// example `organizations/433245324/storedInfoTypes/432452342` or /// projects/project-id/storedInfoTypes/432452342. - pub fn stored_info_types_patch(&self, request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, name: &str) -> ProjectStoredInfoTypePatchCall<'a, C, A> { - ProjectStoredInfoTypePatchCall { + pub fn locations_stored_info_types_patch(&self, request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, name: &str) -> ProjectLocationStoredInfoTypePatchCall<'a, C, A> { + ProjectLocationStoredInfoTypePatchCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -5444,13 +6994,16 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id or + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. - pub fn deidentify_templates_create(&self, request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, parent: &str) -> ProjectDeidentifyTemplateCreateCall<'a, C, A> { - ProjectDeidentifyTemplateCreateCall { + /// * `locationId` - The geographic location to store the deidentification template. Reserved + /// for future extensions. + pub fn locations_deidentify_templates_create(&self, request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, parent: &str, location_id: &str) -> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> { + ProjectLocationDeidentifyTemplateCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), + _location_id: location_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5459,22 +7012,51 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists DlpJobs that match the specified filter in the request. + /// Creates an InspectTemplate for re-using frequently used configuration + /// for inspecting content, images, and storage. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location to store the inspection template. Reserved for + /// future extensions. + pub fn locations_inspect_templates_create(&self, request: GooglePrivacyDlpV2CreateInspectTemplateRequest, parent: &str, location_id: &str) -> ProjectLocationInspectTemplateCreateCall<'a, C, A> { + ProjectLocationInspectTemplateCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new job to inspect storage or calculate risk metrics. /// See https://cloud.google.com/dlp/docs/inspecting-storage and /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. /// + /// When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the + /// system will automatically choose what detectors to run. By default this may + /// be all types, but may change over time as detectors are updated. + /// /// # Arguments /// - /// * `parent` - The parent resource name, for example projects/my-project-id. - pub fn dlp_jobs_list(&self, parent: &str) -> ProjectDlpJobListCall<'a, C, A> { - ProjectDlpJobListCall { + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id. + /// * `locationId` - The geographic location to store and process the job. Reserved for + /// future extensions. + pub fn locations_dlp_jobs_create(&self, request: GooglePrivacyDlpV2CreateDlpJobRequest, parent: &str, location_id: &str) -> ProjectLocationDlpJobCreateCall<'a, C, A> { + ProjectLocationDlpJobCreateCall { hub: self.hub, + _request: request, _parent: parent.to_string(), - _type_: Default::default(), - _page_token: Default::default(), - _page_size: Default::default(), - _order_by: Default::default(), - _filter: Default::default(), + _location_id: location_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5483,21 +7065,129 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists DeidentifyTemplates. - /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - /// more. + /// Activate a job trigger. Causes the immediate execute of a trigger + /// instead of waiting on the trigger event to occur. /// /// # Arguments /// - /// * `parent` - The parent resource name, for example projects/my-project-id or + /// * `request` - No description provided. + /// * `name` - Required. Resource name of the trigger to activate, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + pub fn job_triggers_activate(&self, request: GooglePrivacyDlpV2ActivateJobTriggerRequest, name: &str) -> ProjectJobTriggerActivateCall<'a, C, A> { + ProjectJobTriggerActivateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a job trigger. + /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the project and the triggeredJob, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + pub fn job_triggers_delete(&self, name: &str) -> ProjectJobTriggerDeleteCall<'a, C, A> { + ProjectJobTriggerDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists stored infoTypes. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. - pub fn deidentify_templates_list(&self, parent: &str) -> ProjectDeidentifyTemplateListCall<'a, C, A> { - ProjectDeidentifyTemplateListCall { + pub fn stored_info_types_list(&self, parent: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { + ProjectStoredInfoTypeListCall { hub: self.hub, _parent: parent.to_string(), _page_token: Default::default(), _page_size: Default::default(), _order_by: Default::default(), + _location_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an InspectTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and inspectTemplate to be deleted, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn locations_inspect_templates_delete(&self, name: &str) -> ProjectLocationInspectTemplateDeleteCall<'a, C, A> { + ProjectLocationInspectTemplateDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a stored infoType. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and storedInfoType to be read, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn stored_info_types_get(&self, name: &str) -> ProjectStoredInfoTypeGetCall<'a, C, A> { + ProjectStoredInfoTypeGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists stored infoTypes. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location where stored infoTypes will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + pub fn locations_stored_info_types_list(&self, parent: &str, location_id: &str) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> { + ProjectLocationStoredInfoTypeListCall { + hub: self.hub, + _parent: parent.to_string(), + _location_id: location_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5515,9 +7205,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the DlpJob resource to be cancelled. - pub fn dlp_jobs_cancel(&self, request: GooglePrivacyDlpV2CancelDlpJobRequest, name: &str) -> ProjectDlpJobCancelCall<'a, C, A> { - ProjectDlpJobCancelCall { + /// * `name` - Required. The name of the DlpJob resource to be cancelled. + pub fn locations_dlp_jobs_cancel(&self, request: GooglePrivacyDlpV2CancelDlpJobRequest, name: &str) -> ProjectLocationDlpJobCancelCall<'a, C, A> { + ProjectLocationDlpJobCancelCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -5529,20 +7219,23 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists InspectTemplates. - /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. + /// Lists DlpJobs that match the specified filter in the request. + /// See https://cloud.google.com/dlp/docs/inspecting-storage and + /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. /// /// # Arguments /// - /// * `parent` - The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - pub fn inspect_templates_list(&self, parent: &str) -> ProjectInspectTemplateListCall<'a, C, A> { - ProjectInspectTemplateListCall { + /// * `parent` - Required. The parent resource name, for example projects/my-project-id. + pub fn dlp_jobs_list(&self, parent: &str) -> ProjectDlpJobListCall<'a, C, A> { + ProjectDlpJobListCall { hub: self.hub, _parent: parent.to_string(), + _type_: Default::default(), _page_token: Default::default(), _page_size: Default::default(), _order_by: Default::default(), + _location_id: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5551,15 +7244,61 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the latest state of a long-running DlpJob. - /// See https://cloud.google.com/dlp/docs/inspecting-storage and - /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. + /// Creates a job trigger to run DLP actions such as scanning storage for + /// sensitive information on a set schedule. + /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. /// /// # Arguments /// - /// * `name` - The name of the DlpJob resource. - pub fn dlp_jobs_get(&self, name: &str) -> ProjectDlpJobGetCall<'a, C, A> { - ProjectDlpJobGetCall { + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id. + pub fn job_triggers_create(&self, request: GooglePrivacyDlpV2CreateJobTriggerRequest, parent: &str) -> ProjectJobTriggerCreateCall<'a, C, A> { + ProjectJobTriggerCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a DeidentifyTemplate for re-using frequently used configuration + /// for de-identifying content, images, and storage. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn deidentify_templates_create(&self, request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, parent: &str) -> ProjectDeidentifyTemplateCreateCall<'a, C, A> { + ProjectDeidentifyTemplateCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a stored infoType. + /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// learn more. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the organization and storedInfoType to be deleted, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + pub fn locations_stored_info_types_delete(&self, name: &str) -> ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> { + ProjectLocationStoredInfoTypeDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -5568,6 +7307,30 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists DeidentifyTemplates. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + pub fn deidentify_templates_list(&self, parent: &str) -> ProjectDeidentifyTemplateListCall<'a, C, A> { + ProjectDeidentifyTemplateListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _location_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// De-identifies potentially sensitive info from a ContentItem. @@ -5594,70 +7357,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Activate a job trigger. Causes the immediate execute of a trigger - /// instead of waiting on the trigger event to occur. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Resource name of the trigger to activate, for example - /// `projects/dlp-test-project/jobTriggers/53234423`. - pub fn job_triggers_activate(&self, request: GooglePrivacyDlpV2ActivateJobTriggerRequest, name: &str) -> ProjectJobTriggerActivateCall<'a, C, A> { - ProjectJobTriggerActivateCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes a DeidentifyTemplate. - /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - /// more. - /// - /// # Arguments - /// - /// * `name` - Resource name of the organization and deidentify template to be deleted, - /// for example `organizations/433245324/deidentifyTemplates/432452342` or - /// projects/project-id/deidentifyTemplates/432452342. - pub fn deidentify_templates_delete(&self, name: &str) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> { - ProjectDeidentifyTemplateDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a pre-built stored infoType to be used for inspection. - /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - /// learn more. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - pub fn stored_info_types_create(&self, request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, parent: &str) -> ProjectStoredInfoTypeCreateCall<'a, C, A> { - ProjectStoredInfoTypeCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes a job trigger. @@ -5665,10 +7364,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the project and the triggeredJob, for example + /// * `name` - Required. Resource name of the project and the triggeredJob, for example /// `projects/dlp-test-project/jobTriggers/53234423`. - pub fn job_triggers_delete(&self, name: &str) -> ProjectJobTriggerDeleteCall<'a, C, A> { - ProjectJobTriggerDeleteCall { + pub fn locations_job_triggers_delete(&self, name: &str) -> ProjectLocationJobTriggerDeleteCall<'a, C, A> { + ProjectLocationJobTriggerDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -5679,20 +7378,46 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Re-identifies content that has been de-identified. - /// See - /// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example - /// to learn more. + /// Updates the InspectTemplate. + /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name. - pub fn content_reidentify(&self, request: GooglePrivacyDlpV2ReidentifyContentRequest, parent: &str) -> ProjectContentReidentifyCall<'a, C, A> { - ProjectContentReidentifyCall { + /// * `name` - Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + pub fn locations_inspect_templates_patch(&self, request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, name: &str) -> ProjectLocationInspectTemplatePatchCall<'a, C, A> { + ProjectLocationInspectTemplatePatchCall { hub: self.hub, _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists DeidentifyTemplates. + /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn + /// more. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// * `locationId` - The geographic location where deidentifications templates will be retrieved + /// from. Use `-` for all locations. Reserved for future extensions. + pub fn locations_deidentify_templates_list(&self, parent: &str, location_id: &str) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> { + ProjectLocationDeidentifyTemplateListCall { + hub: self.hub, _parent: parent.to_string(), + _location_id: location_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5706,7 +7431,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The parent resource name, for example `projects/my-project-id`. + /// * `parent` - Required. The parent resource name, for example `projects/my-project-id`. pub fn job_triggers_list(&self, parent: &str) -> ProjectJobTriggerListCall<'a, C, A> { ProjectJobTriggerListCall { hub: self.hub, @@ -5714,6 +7439,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _page_token: Default::default(), _page_size: Default::default(), _order_by: Default::default(), + _location_id: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -5721,27 +7447,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes a long-running DlpJob. This method indicates that the client is - /// no longer interested in the DlpJob result. The job will be cancelled if - /// possible. - /// See https://cloud.google.com/dlp/docs/inspecting-storage and - /// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - /// - /// # Arguments - /// - /// * `name` - The name of the DlpJob resource to be deleted. - pub fn dlp_jobs_delete(&self, name: &str) -> ProjectDlpJobDeleteCall<'a, C, A> { - ProjectDlpJobDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Redacts potentially sensitive info from an image. @@ -5767,24 +7472,65 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } +} + + + +/// A builder providing access to all methods supported on *location* resources. +/// It is not used directly, but through the `DLP` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dlp2 as dlp2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dlp2::DLP; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `info_types_list(...)` +/// // to build up your call. +/// let rb = hub.locations(); +/// # } +/// ``` +pub struct LocationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, +} + +impl<'a, C, A> MethodsBuilder for LocationMethods<'a, C, A> {} + +impl<'a, C, A> LocationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists stored infoTypes. - /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + /// Returns a list of the sensitive information types that the DLP API + /// supports. See https://cloud.google.com/dlp/docs/infotypes-reference to /// learn more. /// /// # Arguments /// - /// * `parent` - The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - pub fn stored_info_types_list(&self, parent: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { - ProjectStoredInfoTypeListCall { + /// * `locationId` - The geographic location to list info types. Reserved for future + /// extensions. + pub fn info_types_list(&self, location_id: &str) -> LocationInfoTypeListCall<'a, C, A> { + LocationInfoTypeListCall { hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _order_by: Default::default(), + _location_id: location_id.to_string(), + _language_code: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5976,7 +7722,7 @@ impl<'a, C, A> OrganizationInspectTemplateGetCall<'a, C, A> where C: BorrowMut OrganizationInspectTemplateGetCall<'a, C, A> where C: BorrowMut OrganizationInspectTemplateGetCall<'a, C, A> where C: BorrowMut +pub struct OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, @@ -6094,9 +7840,9 @@ pub struct OrganizationDeidentifyTemplateDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrganizationDeidentifyTemplateDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> {} -impl<'a, C, A> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -6109,7 +7855,7 @@ impl<'a, C, A> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> where C: Borro Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.organizations.deidentifyTemplates.delete", + dlg.begin(MethodInfo { id: "dlp.organizations.locations.storedInfoTypes.delete", http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -6228,15 +7974,15 @@ impl<'a, C, A> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> where C: Borro } - /// Resource name of the organization and deidentify template to be deleted, - /// for example `organizations/433245324/deidentifyTemplates/432452342` or - /// projects/project-id/deidentifyTemplates/432452342. + /// Required. Resource name of the organization and storedInfoType to be deleted, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -6246,7 +7992,7 @@ impl<'a, C, A> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> where C: Borro /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6271,7 +8017,7 @@ impl<'a, C, A> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> where C: Borro /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6291,7 +8037,3741 @@ impl<'a, C, A> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> where C: Borro /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrganizationLocationStoredInfoTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists stored infoTypes. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *locations.storedInfoTypes.list* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_stored_info_types_list("parent", "locationId") +/// .page_token("accusam") +/// .page_size(-8) +/// .order_by("justo") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationStoredInfoTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _location_id: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationStoredInfoTypeListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationStoredInfoTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListStoredInfoTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.storedInfoTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + for &field in ["alt", "parent", "locationId", "pageToken", "pageSize", "orderBy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location where stored infoTypes will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListStoredInfoTypes`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc, display_name, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the most recent version of the + /// resource was created. + /// - `state`: corresponds to the state of the resource. + /// - `name`: corresponds to resource name. + /// - `display_name`: corresponds to info type's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationStoredInfoTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a pre-built stored infoType to be used for inspection. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *storedInfoTypes.create* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateStoredInfoTypeRequest::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.organizations().stored_info_types_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationStoredInfoTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateStoredInfoTypeRequest) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.get* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_deidentify_templates_get("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.deidentifyTemplates.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and deidentify template to be read, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationDeidentifyTemplateGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a DeidentifyTemplate for re-using frequently used configuration +/// for de-identifying content, images, and storage. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.create* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateDeidentifyTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateDeidentifyTemplateRequest::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.organizations().locations_deidentify_templates_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.deidentifyTemplates.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/deidentifyTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) -> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store the deidentification template. Reserved + /// for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationDeidentifyTemplateCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists stored infoTypes. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *storedInfoTypes.list* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().stored_info_types_list("parent") +/// .page_token("dolores") +/// .page_size(-61) +/// .order_by("sadipscing") +/// .location_id("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationStoredInfoTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _location_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypeListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationStoredInfoTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListStoredInfoTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._location_id { + params.push(("locationId", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListStoredInfoTypes`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationStoredInfoTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc, display_name, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the most recent version of the + /// resource was created. + /// - `state`: corresponds to the state of the resource. + /// - `name`: corresponds to resource name. + /// - `display_name`: corresponds to info type's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The geographic location where stored infoTypes will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* query property to the given value. + pub fn location_id(mut self, new_value: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a stored infoType. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *storedInfoTypes.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().stored_info_types_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationStoredInfoTypeDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypeDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationStoredInfoTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and storedInfoType to be deleted, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a pre-built stored infoType to be used for inspection. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *locations.storedInfoTypes.create* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateStoredInfoTypeRequest::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.organizations().locations_stored_info_types_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.storedInfoTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateStoredInfoTypeRequest) -> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store the stored infoType. Reserved for + /// future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationStoredInfoTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_deidentify_templates_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.deidentifyTemplates.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationDeidentifyTemplateDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the InspectTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *locations.inspectTemplates.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateInspectTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateInspectTemplateRequest::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.organizations().locations_inspect_templates_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationInspectTemplatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationInspectTemplatePatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationInspectTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.inspectTemplates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateInspectTemplateRequest) -> OrganizationLocationInspectTemplatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationInspectTemplatePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationInspectTemplatePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationInspectTemplatePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationInspectTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the InspectTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *inspectTemplates.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateInspectTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateInspectTemplateRequest::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.organizations().inspect_templates_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationInspectTemplatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationInspectTemplatePatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationInspectTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.inspectTemplates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateInspectTemplateRequest) -> OrganizationInspectTemplatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationInspectTemplatePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationInspectTemplatePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationInspectTemplatePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationInspectTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists InspectTemplates. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *inspectTemplates.list* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().inspect_templates_list("parent") +/// .page_token("ipsum") +/// .page_size(-5) +/// .order_by("et") +/// .location_id("duo") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationInspectTemplateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _location_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationInspectTemplateListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListInspectTemplatesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.inspectTemplates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._location_id { + params.push(("locationId", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/inspectTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListInspectTemplates`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationInspectTemplateListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc,update_time, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the template was created. + /// - `update_time`: corresponds to time the template was last updated. + /// - `name`: corresponds to template's name. + /// - `display_name`: corresponds to template's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The geographic location where inspection templates will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* query property to the given value. + pub fn location_id(mut self, new_value: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationInspectTemplateListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationInspectTemplateListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationInspectTemplateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists DeidentifyTemplates. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *deidentifyTemplates.list* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().deidentify_templates_list("parent") +/// .page_token("sea") +/// .page_size(-55) +/// .order_by("eos") +/// .location_id("erat") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationDeidentifyTemplateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _location_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationDeidentifyTemplateListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListDeidentifyTemplatesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.deidentifyTemplates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._location_id { + params.push(("locationId", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/deidentifyTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListDeidentifyTemplates`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc,update_time, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the template was created. + /// - `update_time`: corresponds to time the template was last updated. + /// - `name`: corresponds to template's name. + /// - `display_name`: corresponds to template's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The geographic location where deidentifications templates will be retrieved + /// from. Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* query property to the given value. + pub fn location_id(mut self, new_value: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationDeidentifyTemplateListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationDeidentifyTemplateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the stored infoType by creating a new version. The existing version +/// will continue to be used until the new version is ready. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *locations.storedInfoTypes.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateStoredInfoTypeRequest::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.organizations().locations_stored_info_types_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationStoredInfoTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationStoredInfoTypePatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationStoredInfoTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.storedInfoTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) -> OrganizationLocationStoredInfoTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and storedInfoType to be updated, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationStoredInfoTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationStoredInfoTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationStoredInfoTypePatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6512,7 +11992,7 @@ impl<'a, C, A> OrganizationDeidentifyTemplateCreateCall<'a, C, A> where C: Borro self._request = new_value; self } - /// The parent resource name, for example projects/my-project-id or + /// Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. /// /// Sets the *parent* path property to the given value. @@ -6586,6 +12066,1905 @@ impl<'a, C, A> OrganizationDeidentifyTemplateCreateCall<'a, C, A> where C: Borro } +/// Gets an InspectTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *locations.inspectTemplates.get* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_inspect_templates_get("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationInspectTemplateGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationInspectTemplateGetCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationInspectTemplateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.inspectTemplates.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and inspectTemplate to be read, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationInspectTemplateGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationInspectTemplateGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationInspectTemplateGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationInspectTemplateGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an InspectTemplate for re-using frequently used configuration +/// for inspecting content, images, and storage. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *locations.inspectTemplates.create* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateInspectTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateInspectTemplateRequest::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.organizations().locations_inspect_templates_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationInspectTemplateCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateInspectTemplateRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationInspectTemplateCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationInspectTemplateCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.inspectTemplates.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/inspectTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateInspectTemplateRequest) -> OrganizationLocationInspectTemplateCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationLocationInspectTemplateCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store the inspection template. Reserved for + /// future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> OrganizationLocationInspectTemplateCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationInspectTemplateCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationInspectTemplateCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationInspectTemplateCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the stored infoType by creating a new version. The existing version +/// will continue to be used until the new version is ready. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *storedInfoTypes.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateStoredInfoTypeRequest::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.organizations().stored_info_types_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationStoredInfoTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypePatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationStoredInfoTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and storedInfoType to be updated, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an InspectTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *locations.inspectTemplates.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_inspect_templates_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationInspectTemplateDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationInspectTemplateDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationInspectTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.inspectTemplates.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and inspectTemplate to be deleted, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationInspectTemplateDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationInspectTemplateDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationInspectTemplateDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationInspectTemplateDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists DeidentifyTemplates. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.list* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_deidentify_templates_list("parent", "locationId") +/// .page_token("invidunt") +/// .page_size(-82) +/// .order_by("accusam") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationDeidentifyTemplateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _location_id: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationDeidentifyTemplateListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListDeidentifyTemplatesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.deidentifyTemplates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + for &field in ["alt", "parent", "locationId", "pageToken", "pageSize", "orderBy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/deidentifyTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location where deidentifications templates will be retrieved + /// from. Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListDeidentifyTemplates`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc,update_time, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the template was created. + /// - `update_time`: corresponds to time the template was last updated. + /// - `name`: corresponds to template's name. + /// - `display_name`: corresponds to template's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationDeidentifyTemplateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a stored infoType. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *locations.storedInfoTypes.get* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_stored_info_types_get("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationStoredInfoTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationStoredInfoTypeGetCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.storedInfoTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and storedInfoType to be read, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationStoredInfoTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationStoredInfoTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationStoredInfoTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationStoredInfoTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *deidentifyTemplates.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().deidentify_templates_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationDeidentifyTemplateDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationDeidentifyTemplateDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.deidentifyTemplates.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationDeidentifyTemplateDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the DeidentifyTemplate. /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn /// more. @@ -6794,7 +14173,7 @@ impl<'a, C, A> OrganizationDeidentifyTemplatePatchCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// Resource name of organization and deidentify template to be updated, for + /// Required. Resource name of organization and deidentify template to be updated, for /// example `organizations/433245324/deidentifyTemplates/432452342` or /// projects/project-id/deidentifyTemplates/432452342. /// @@ -6869,288 +14248,6 @@ impl<'a, C, A> OrganizationDeidentifyTemplatePatchCall<'a, C, A> where C: Borrow } -/// Creates a pre-built stored infoType to be used for inspection. -/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to -/// learn more. -/// -/// A builder for the *storedInfoTypes.create* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// use dlp2::GooglePrivacyDlpV2CreateStoredInfoTypeRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateStoredInfoTypeRequest::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.organizations().stored_info_types_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationStoredInfoTypeCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypeCreateCall<'a, C, A> {} - -impl<'a, C, A> OrganizationStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/storedInfoTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateStoredInfoTypeRequest) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypeCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Gets a stored infoType. /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to /// learn more. @@ -7328,7 +14425,7 @@ impl<'a, C, A> OrganizationStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut OrganizationStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest::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.organizations().locations_deidentify_templates_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.organizations.locations.deidentifyTemplates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) -> OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and deidentify template to be updated, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationDeidentifyTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes an InspectTemplate. /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. /// @@ -7579,7 +14959,7 @@ impl<'a, C, A> OrganizationInspectTemplateDeleteCall<'a, C, A> where C: BorrowMu } - /// Resource name of the organization and inspectTemplate to be deleted, for + /// Required. Resource name of the organization and inspectTemplate to be deleted, for /// example `organizations/433245324/inspectTemplates/432452342` or /// projects/project-id/inspectTemplates/432452342. /// @@ -7862,7 +15242,7 @@ impl<'a, C, A> OrganizationInspectTemplateCreateCall<'a, C, A> where C: BorrowMu self._request = new_value; self } - /// The parent resource name, for example projects/my-project-id or + /// Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. /// /// Sets the *parent* path property to the given value. @@ -7936,292 +15316,10 @@ impl<'a, C, A> OrganizationInspectTemplateCreateCall<'a, C, A> where C: BorrowMu } -/// Updates the InspectTemplate. -/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. -/// -/// A builder for the *inspectTemplates.patch* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// use dlp2::GooglePrivacyDlpV2UpdateInspectTemplateRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateInspectTemplateRequest::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.organizations().inspect_templates_patch(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationInspectTemplatePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationInspectTemplatePatchCall<'a, C, A> {} - -impl<'a, C, A> OrganizationInspectTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.organizations.inspectTemplates.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateInspectTemplateRequest) -> OrganizationInspectTemplatePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Resource name of organization and inspectTemplate to be updated, for - /// example `organizations/433245324/inspectTemplates/432452342` or - /// projects/project-id/inspectTemplates/432452342. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OrganizationInspectTemplatePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationInspectTemplatePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationInspectTemplatePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationInspectTemplatePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists InspectTemplates. /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. /// -/// A builder for the *inspectTemplates.list* method supported by a *organization* resource. +/// A builder for the *locations.inspectTemplates.list* method supported by a *organization* resource. /// It is not used directly, but through a `OrganizationMethods` instance. /// /// # Example @@ -8246,18 +15344,19 @@ impl<'a, C, A> OrganizationInspectTemplatePatchCall<'a, C, A> where C: BorrowMut /// // 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.organizations().inspect_templates_list("parent") -/// .page_token("sea") -/// .page_size(-90) -/// .order_by("dolores") +/// let result = hub.organizations().locations_inspect_templates_list("parent", "locationId") +/// .page_token("et") +/// .page_size(-45) +/// .order_by("ut") /// .doit(); /// # } /// ``` -pub struct OrganizationInspectTemplateListCall<'a, C, A> +pub struct OrganizationLocationInspectTemplateListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, _parent: String, + _location_id: String, _page_token: Option, _page_size: Option, _order_by: Option, @@ -8266,9 +15365,9 @@ pub struct OrganizationInspectTemplateListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrganizationInspectTemplateListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrganizationLocationInspectTemplateListCall<'a, C, A> {} -impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrganizationLocationInspectTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -8281,10 +15380,11 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.organizations.inspectTemplates.list", + dlg.begin(MethodInfo { id: "dlp.organizations.locations.inspectTemplates.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -8294,7 +15394,7 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< if let Some(value) = self._order_by { params.push(("orderBy", value.to_string())); } - for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy"].iter() { + for &field in ["alt", "parent", "locationId", "pageToken", "pageSize", "orderBy"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8306,12 +15406,12 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/inspectTemplates"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/inspectTemplates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -8325,8 +15425,8 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< url = url.replace(find_this, &replace_with); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8409,34 +15509,45 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< } - /// The parent resource name, for example projects/my-project-id or + /// Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> OrganizationLocationInspectTemplateListCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// Optional page token to continue retrieval. Comes from previous call + /// The geographic location where inspection templates will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> OrganizationLocationInspectTemplateListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call /// to `ListInspectTemplates`. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> OrganizationLocationInspectTemplateListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional size of the page, can be limited by server. If zero server returns + /// Size of the page, can be limited by server. If zero server returns /// a page of max size 100. /// /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> OrganizationInspectTemplateListCall<'a, C, A> { + pub fn page_size(mut self, new_value: i32) -> OrganizationLocationInspectTemplateListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Optional comma separated list of fields to order by, + /// Comma separated list of fields to order by, /// followed by `asc` or `desc` postfix. This list is case-insensitive, /// default sorting order is ascending, redundant space characters are /// insignificant. @@ -8451,7 +15562,7 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< /// - `display_name`: corresponds to template's display name. /// /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> OrganizationInspectTemplateListCall<'a, C, A> { + pub fn order_by(mut self, new_value: &str) -> OrganizationLocationInspectTemplateListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } @@ -8461,7 +15572,7 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationInspectTemplateListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationInspectTemplateListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8486,7 +15597,7 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationInspectTemplateListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrganizationLocationInspectTemplateListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8506,561 +15617,7 @@ impl<'a, C, A> OrganizationInspectTemplateListCall<'a, C, A> where C: BorrowMut< /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationInspectTemplateListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists stored infoTypes. -/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to -/// learn more. -/// -/// A builder for the *storedInfoTypes.list* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.organizations().stored_info_types_list("parent") -/// .page_token("sadipscing") -/// .page_size(-31) -/// .order_by("ea") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationStoredInfoTypeListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _parent: String, - _page_token: Option, - _page_size: Option, - _order_by: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypeListCall<'a, C, A> {} - -impl<'a, C, A> OrganizationStoredInfoTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListStoredInfoTypesResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/storedInfoTypes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional page token to continue retrieval. Comes from previous call - /// to `ListStoredInfoTypes`. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional size of the page, can be limited by server. If zero server returns - /// a page of max size 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> OrganizationStoredInfoTypeListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional comma separated list of fields to order by, - /// followed by `asc` or `desc` postfix. This list is case-insensitive, - /// default sorting order is ascending, redundant space characters are - /// insignificant. - /// - /// Example: `name asc, display_name, create_time desc` - /// - /// Supported fields are: - /// - /// - `create_time`: corresponds to time the most recent version of the - /// resource was created. - /// - `state`: corresponds to the state of the resource. - /// - `name`: corresponds to resource name. - /// - `display_name`: corresponds to info type's display name. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> OrganizationStoredInfoTypeListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypeListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypeListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypeListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a stored infoType. -/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to -/// learn more. -/// -/// A builder for the *storedInfoTypes.delete* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.organizations().stored_info_types_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationStoredInfoTypeDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypeDeleteCall<'a, C, A> {} - -impl<'a, C, A> OrganizationStoredInfoTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Resource name of the organization and storedInfoType to be deleted, for - /// example `organizations/433245324/storedInfoTypes/432452342` or - /// projects/project-id/storedInfoTypes/432452342. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypeDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrganizationLocationInspectTemplateListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -9249,7 +15806,7 @@ impl<'a, C, A> OrganizationDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMu } - /// Resource name of the organization and deidentify template to be read, for + /// Required. Resource name of the organization and deidentify template to be read, for /// example `organizations/433245324/deidentifyTemplates/432452342` or /// projects/project-id/deidentifyTemplates/432452342. /// @@ -9324,591 +15881,6 @@ impl<'a, C, A> OrganizationDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMu } -/// Updates the stored infoType by creating a new version. The existing version -/// will continue to be used until the new version is ready. -/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to -/// learn more. -/// -/// A builder for the *storedInfoTypes.patch* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// use dlp2::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateStoredInfoTypeRequest::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.organizations().stored_info_types_patch(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationStoredInfoTypePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationStoredInfoTypePatchCall<'a, C, A> {} - -impl<'a, C, A> OrganizationStoredInfoTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.organizations.storedInfoTypes.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Resource name of organization and storedInfoType to be updated, for - /// example `organizations/433245324/storedInfoTypes/432452342` or - /// projects/project-id/storedInfoTypes/432452342. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationStoredInfoTypePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationStoredInfoTypePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationStoredInfoTypePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists DeidentifyTemplates. -/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn -/// more. -/// -/// A builder for the *deidentifyTemplates.list* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.organizations().deidentify_templates_list("parent") -/// .page_token("et") -/// .page_size(-41) -/// .order_by("ipsum") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationDeidentifyTemplateListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _parent: String, - _page_token: Option, - _page_size: Option, - _order_by: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationDeidentifyTemplateListCall<'a, C, A> {} - -impl<'a, C, A> OrganizationDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListDeidentifyTemplatesResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.organizations.deidentifyTemplates.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/deidentifyTemplates"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional page token to continue retrieval. Comes from previous call - /// to `ListDeidentifyTemplates`. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional size of the page, can be limited by server. If zero server returns - /// a page of max size 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional comma separated list of fields to order by, - /// followed by `asc` or `desc` postfix. This list is case-insensitive, - /// default sorting order is ascending, redundant space characters are - /// insignificant. - /// - /// Example: `name asc,update_time, create_time desc` - /// - /// Supported fields are: - /// - /// - `create_time`: corresponds to time the template was created. - /// - `update_time`: corresponds to time the template was last updated. - /// - `name`: corresponds to template's name. - /// - `display_name`: corresponds to template's display name. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationDeidentifyTemplateListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationDeidentifyTemplateListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationDeidentifyTemplateListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns a list of the sensitive information types that the DLP API /// supports. See https://cloud.google.com/dlp/docs/infotypes-reference to /// learn more. @@ -9939,8 +15911,9 @@ impl<'a, C, A> OrganizationDeidentifyTemplateListCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.info_types().list() -/// .language_code("Lorem") -/// .filter("et") +/// .location_id("sed") +/// .language_code("dolor") +/// .filter("dolor") /// .doit(); /// # } /// ``` @@ -9948,6 +15921,7 @@ pub struct InfoTypeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, + _location_id: Option, _language_code: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, @@ -9971,14 +15945,17 @@ impl<'a, C, A> InfoTypeListCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "dlp.infoTypes.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + if let Some(value) = self._location_id { + params.push(("locationId", value.to_string())); + } if let Some(value) = self._language_code { params.push(("languageCode", value.to_string())); } if let Some(value) = self._filter { params.push(("filter", value.to_string())); } - for &field in ["alt", "languageCode", "filter"].iter() { + for &field in ["alt", "locationId", "languageCode", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10069,7 +16046,15 @@ impl<'a, C, A> InfoTypeListCall<'a, C, A> where C: BorrowMut, A: } - /// Optional BCP-47 language code for localized infoType friendly + /// The geographic location to list info types. Reserved for future + /// extensions. + /// + /// Sets the *location id* query property to the given value. + pub fn location_id(mut self, new_value: &str) -> InfoTypeListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// BCP-47 language code for localized infoType friendly /// names. If omitted, or if localized strings are not available, /// en-US strings will be returned. /// @@ -10078,7 +16063,7 @@ impl<'a, C, A> InfoTypeListCall<'a, C, A> where C: BorrowMut, A: self._language_code = Some(new_value.to_string()); self } - /// Optional filter to only return infoTypes supported by certain parts of the + /// filter to only return infoTypes supported by certain parts of the /// API. Defaults to supported_by=INSPECT. /// /// Sets the *filter* query property to the given value. @@ -10152,7 +16137,7 @@ impl<'a, C, A> InfoTypeListCall<'a, C, A> where C: BorrowMut, A: /// Gets an InspectTemplate. /// See https://cloud.google.com/dlp/docs/creating-templates to learn more. /// -/// A builder for the *inspectTemplates.get* method supported by a *project* resource. +/// A builder for the *locations.inspectTemplates.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -10177,11 +16162,11 @@ impl<'a, C, A> InfoTypeListCall<'a, C, A> where C: BorrowMut, A: /// // 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().inspect_templates_get("name") +/// let result = hub.projects().locations_inspect_templates_get("name") /// .doit(); /// # } /// ``` -pub struct ProjectInspectTemplateGetCall<'a, C, A> +pub struct ProjectLocationInspectTemplateGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, @@ -10191,9 +16176,9 @@ pub struct ProjectInspectTemplateGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInspectTemplateGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationInspectTemplateGetCall<'a, C, A> {} -impl<'a, C, A> ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationInspectTemplateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -10206,7 +16191,7 @@ impl<'a, C, A> ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.get", + dlg.begin(MethodInfo { id: "dlp.projects.locations.inspectTemplates.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -10325,7 +16310,7 @@ impl<'a, C, A> ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationInspectTemplateGetCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -10343,7 +16328,7 @@ impl<'a, C, A> ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationInspectTemplateGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -10368,7 +16353,7 @@ impl<'a, C, A> ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInspectTemplateGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationInspectTemplateGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -10388,7 +16373,7 @@ impl<'a, C, A> ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInspectTemplateGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationInspectTemplateGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -10577,7 +16562,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationDlpJobFinishCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, - _request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, + _request: GooglePrivacyDlpV2FinishDlpJobRequest, _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInspectTemplatePatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDlpJobFinishCall<'a, C, A> {} -impl<'a, C, A> ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDlpJobFinishCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -10716,8 +16704,8 @@ impl<'a, C, A> ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.patch", - http_method: hyper::method::Method::Patch }); + dlg.begin(MethodInfo { id: "dlp.projects.locations.dlpJobs.finish", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); for &field in ["alt", "name"].iter() { @@ -10732,7 +16720,7 @@ impl<'a, C, A> ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectInspectTemplatePatchCall<'a, C, A> { + pub fn request(mut self, new_value: GooglePrivacyDlpV2FinishDlpJobRequest) -> ProjectLocationDlpJobFinishCall<'a, C, A> { self._request = new_value; self } - /// Resource name of organization and inspectTemplate to be updated, for - /// example `organizations/433245324/inspectTemplates/432452342` or - /// projects/project-id/inspectTemplates/432452342. + /// Required. The name of the DlpJob resource to be cancelled. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectInspectTemplatePatchCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationDlpJobFinishCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -10877,7 +16863,7 @@ impl<'a, C, A> ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectInspectTemplatePatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDlpJobFinishCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -10902,7 +16888,7 @@ impl<'a, C, A> ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInspectTemplatePatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDlpJobFinishCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -10922,7 +16908,7 @@ impl<'a, C, A> ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInspectTemplatePatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDlpJobFinishCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11111,7 +17097,7 @@ impl<'a, C, A> ProjectStoredInfoTypeDeleteCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2ReidentifyContentRequest::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_content_reidentify(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationContentReidentifyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2ReidentifyContentRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationContentReidentifyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationContentReidentifyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ReidentifyContentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.content.reidentify", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/content:reidentify"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2ReidentifyContentRequest) -> ProjectLocationContentReidentifyCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationContentReidentifyCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to process content reidentification. Reserved for + /// future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationContentReidentifyCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationContentReidentifyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationContentReidentifyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationContentReidentifyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a job trigger. +/// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. +/// +/// A builder for the *locations.jobTriggers.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_job_triggers_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationJobTriggerGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationJobTriggerGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationJobTriggerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2JobTrigger)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.jobTriggers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the project and the triggeredJob, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationJobTriggerGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationJobTriggerGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationJobTriggerGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationJobTriggerGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists DlpJobs that match the specified filter in the request. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *locations.dlpJobs.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_dlp_jobs_list("parent", "locationId") +/// .type_("vero") +/// .page_token("diam") +/// .page_size(-66) +/// .order_by("consetetur") +/// .filter("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDlpJobListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _location_id: String, + _type_: Option, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDlpJobListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDlpJobListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListDlpJobsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.dlpJobs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._type_ { + params.push(("type", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "locationId", "type", "pageToken", "pageSize", "orderBy", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/dlpJobs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location where jobs will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The type of job. Defaults to `DlpJobType.INSPECT` + /// + /// Sets the *type* query property to the given value. + pub fn type_(mut self, new_value: &str) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._type_ = Some(new_value.to_string()); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc, end_time asc, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the job was created. + /// - `end_time`: corresponds to time the job ended. + /// - `name`: corresponds to job's name. + /// - `state`: corresponds to `state` + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// Allows filtering. + /// + /// Supported syntax: + /// + /// * Filter expressions are made up of one or more restrictions. + /// * Restrictions can be combined by `AND` or `OR` logical operators. A + /// sequence of restrictions implicitly uses `AND`. + /// * A restriction has the form of `{field} {operator} {value}`. + /// * Supported fields/values for inspect jobs: + /// * `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED + /// * `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + /// * `trigger_name` - The resource name of the trigger that created job. + /// * 'end_time` - Corresponds to time the job finished. + /// * 'start_time` - Corresponds to time the job finished. + /// * Supported fields for risk analysis jobs: + /// * `state` - RUNNING|CANCELED|FINISHED|FAILED + /// * 'end_time` - Corresponds to time the job finished. + /// * 'start_time` - Corresponds to time the job finished. + /// * The operator must be `=` or `!=`. + /// + /// Examples: + /// + /// * inspected_storage = cloud_storage AND state = done + /// * inspected_storage = cloud_storage OR inspected_storage = bigquery + /// * inspected_storage = cloud_storage AND (state = done OR state = canceled) + /// * end_time > "2017-12-12T00:00:00+00:00" + /// + /// The length of this field should be no more than 500 characters. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDlpJobListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDlpJobListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDlpJobListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inspect hybrid content and store findings to a job. +/// To review the findings inspect the job. Inspection will occur +/// asynchronously. +/// Early access feature is in a pre-release state and might change or have +/// limited support. For more information, see +/// https://cloud.google.com/products#product-launch-stages. +/// +/// A builder for the *locations.dlpJobs.hybridInspect* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2HybridInspectDlpJobRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2HybridInspectDlpJobRequest::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_dlp_jobs_hybrid_inspect(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDlpJobHybridInspectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2HybridInspectDlpJobRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDlpJobHybridInspectCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDlpJobHybridInspectCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2HybridInspectResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.dlpJobs.hybridInspect", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}:hybridInspect"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2HybridInspectDlpJobRequest) -> ProjectLocationDlpJobHybridInspectCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the job to execute a hybrid inspect on, for example + /// `projects/dlp-test-project/dlpJob/53234423`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDlpJobHybridInspectCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDlpJobHybridInspectCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDlpJobHybridInspectCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDlpJobHybridInspectCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an InspectTemplate for re-using frequently used configuration +/// for inspecting content, images, and storage. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *inspectTemplates.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateInspectTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateInspectTemplateRequest::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().inspect_templates_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInspectTemplateCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateInspectTemplateRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInspectTemplateCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/inspectTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateInspectTemplateRequest) -> ProjectInspectTemplateCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectInspectTemplateCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInspectTemplateCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInspectTemplateCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInspectTemplateCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists InspectTemplates. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *locations.inspectTemplates.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_inspect_templates_list("parent", "locationId") +/// .page_token("dolore") +/// .page_size(-19) +/// .order_by("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationInspectTemplateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _location_id: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationInspectTemplateListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationInspectTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListInspectTemplatesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.inspectTemplates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + for &field in ["alt", "parent", "locationId", "pageToken", "pageSize", "orderBy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/inspectTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationInspectTemplateListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location where inspection templates will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationInspectTemplateListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListInspectTemplates`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationInspectTemplateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationInspectTemplateListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc,update_time, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the template was created. + /// - `update_time`: corresponds to time the template was last updated. + /// - `name`: corresponds to template's name. + /// - `display_name`: corresponds to template's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectLocationInspectTemplateListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationInspectTemplateListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationInspectTemplateListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationInspectTemplateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a long-running DlpJob. This method indicates that the client is +/// no longer interested in the DlpJob result. The job will be cancelled if +/// possible. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *locations.dlpJobs.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_dlp_jobs_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDlpJobDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDlpJobDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDlpJobDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.dlpJobs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the DlpJob resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDlpJobDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDlpJobDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDlpJobDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDlpJobDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Activate a job trigger. Causes the immediate execute of a trigger +/// instead of waiting on the trigger event to occur. +/// +/// A builder for the *locations.jobTriggers.activate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2ActivateJobTriggerRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2ActivateJobTriggerRequest::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_job_triggers_activate(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationJobTriggerActivateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2ActivateJobTriggerRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationJobTriggerActivateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationJobTriggerActivateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.jobTriggers.activate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}:activate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2ActivateJobTriggerRequest) -> ProjectLocationJobTriggerActivateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the trigger to activate, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationJobTriggerActivateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationJobTriggerActivateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationJobTriggerActivateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationJobTriggerActivateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists InspectTemplates. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *inspectTemplates.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().inspect_templates_list("parent") +/// .page_token("consetetur") +/// .page_size(-58) +/// .order_by("nonumy") +/// .location_id("kasd") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInspectTemplateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _location_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInspectTemplateListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInspectTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListInspectTemplatesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._location_id { + params.push(("locationId", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/inspectTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectInspectTemplateListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListInspectTemplates`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInspectTemplateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInspectTemplateListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc,update_time, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the template was created. + /// - `update_time`: corresponds to time the template was last updated. + /// - `name`: corresponds to template's name. + /// - `display_name`: corresponds to template's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectInspectTemplateListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The geographic location where inspection templates will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* query property to the given value. + pub fn location_id(mut self, new_value: &str) -> ProjectInspectTemplateListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInspectTemplateListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInspectTemplateListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInspectTemplateListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a job trigger to run DLP actions such as scanning storage for +/// sensitive information on a set schedule. +/// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. +/// +/// A builder for the *locations.jobTriggers.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateJobTriggerRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateJobTriggerRequest::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_job_triggers_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationJobTriggerCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateJobTriggerRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationJobTriggerCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationJobTriggerCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2JobTrigger)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.jobTriggers.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/jobTriggers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateJobTriggerRequest) -> ProjectLocationJobTriggerCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationJobTriggerCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store the job trigger. Reserved for + /// future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationJobTriggerCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationJobTriggerCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationJobTriggerCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationJobTriggerCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *deidentifyTemplates.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().deidentify_templates_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDeidentifyTemplateDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDeidentifyTemplateDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.deidentifyTemplates.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a pre-built stored infoType to be used for inspection. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *storedInfoTypes.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateStoredInfoTypeRequest::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().stored_info_types_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectStoredInfoTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectStoredInfoTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.storedInfoTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateStoredInfoTypeRequest) -> ProjectStoredInfoTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectStoredInfoTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectStoredInfoTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectStoredInfoTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectStoredInfoTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Inspect hybrid content and store findings to a trigger. The inspection +/// will be processed asynchronously. To review the findings monitor the +/// jobs within the trigger. +/// Early access feature is in a pre-release state and might change or have +/// limited support. For more information, see +/// https://cloud.google.com/products#product-launch-stages. +/// +/// A builder for the *locations.jobTriggers.hybridInspect* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2HybridInspectJobTriggerRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2HybridInspectJobTriggerRequest::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_job_triggers_hybrid_inspect(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationJobTriggerHybridInspectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2HybridInspectJobTriggerRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationJobTriggerHybridInspectCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationJobTriggerHybridInspectCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2HybridInspectResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.jobTriggers.hybridInspect", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}:hybridInspect"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2HybridInspectJobTriggerRequest) -> ProjectLocationJobTriggerHybridInspectCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the trigger to execute a hybrid inspect on, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationJobTriggerHybridInspectCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationJobTriggerHybridInspectCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationJobTriggerHybridInspectCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationJobTriggerHybridInspectCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running DlpJob. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *locations.dlpJobs.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_dlp_jobs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDlpJobGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDlpJobGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDlpJobGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.dlpJobs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the DlpJob resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDlpJobGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDlpJobGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDlpJobGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDlpJobGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_deidentify_templates_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDeidentifyTemplateGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDeidentifyTemplateGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDeidentifyTemplateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.deidentifyTemplates.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and deidentify template to be read, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDeidentifyTemplateGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDeidentifyTemplateGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDeidentifyTemplateGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *deidentifyTemplates.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest::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().deidentify_templates_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDeidentifyTemplatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDeidentifyTemplatePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.deidentifyTemplates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and deidentify template to be updated, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates a job trigger. /// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. /// @@ -11393,7 +21910,7 @@ impl<'a, C, A> ProjectJobTriggerPatchCall<'a, C, A> where C: BorrowMut ProjectJobTriggerPatchCall<'a, C, A> where C: BorrowMut hub: &'a DLP, _request: GooglePrivacyDlpV2DeidentifyContentRequest, _parent: String, - _location: String, + _location_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -11542,8 +22059,8 @@ impl<'a, C, A> ProjectLocationContentDeidentifyCall<'a, C, A> where C: BorrowMut http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - params.push(("location", self._location.to_string())); - for &field in ["alt", "parent", "location"].iter() { + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11555,12 +22072,12 @@ impl<'a, C, A> ProjectLocationContentDeidentifyCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{location}/content:deidentify"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/content:deidentify"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent"), ("{location}", "location")].iter() { + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -11575,7 +22092,7 @@ impl<'a, C, A> ProjectLocationContentDeidentifyCall<'a, C, A> where C: BorrowMut } { let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["location", "parent"].iter() { + for param_name in ["locationId", "parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -11695,12 +22212,12 @@ impl<'a, C, A> ProjectLocationContentDeidentifyCall<'a, C, A> where C: BorrowMut /// The geographic location to process de-identification. Reserved for future /// extensions. /// - /// Sets the *location* path property to the given value. + /// Sets the *location id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn location(mut self, new_value: &str) -> ProjectLocationContentDeidentifyCall<'a, C, A> { - self._location = new_value.to_string(); + pub fn location_id(mut self, new_value: &str) -> ProjectLocationContentDeidentifyCall<'a, C, A> { + self._location_id = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -11766,6 +22283,3907 @@ impl<'a, C, A> ProjectLocationContentDeidentifyCall<'a, C, A> where C: BorrowMut } +/// Lists job triggers. +/// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. +/// +/// A builder for the *locations.jobTriggers.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_job_triggers_list("parent", "locationId") +/// .page_token("eirmod") +/// .page_size(-46) +/// .order_by("labore") +/// .filter("sed") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationJobTriggerListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _location_id: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationJobTriggerListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationJobTriggerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListJobTriggersResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.jobTriggers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "locationId", "pageToken", "pageSize", "orderBy", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/jobTriggers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example `projects/my-project-id`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationJobTriggerListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location where job triggers will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationJobTriggerListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to ListJobTriggers. `order_by` field must not + /// change for subsequent calls. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationJobTriggerListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by a server. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationJobTriggerListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of triggeredJob fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc,update_time, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the JobTrigger was created. + /// - `update_time`: corresponds to time the JobTrigger was last updated. + /// - `last_run_time`: corresponds to the last time the JobTrigger ran. + /// - `name`: corresponds to JobTrigger's name. + /// - `display_name`: corresponds to JobTrigger's display name. + /// - `status`: corresponds to JobTrigger's status. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectLocationJobTriggerListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// Allows filtering. + /// + /// Supported syntax: + /// + /// * Filter expressions are made up of one or more restrictions. + /// * Restrictions can be combined by `AND` or `OR` logical operators. A + /// sequence of restrictions implicitly uses `AND`. + /// * A restriction has the form of `{field} {operator} {value}`. + /// * Supported fields/values for inspect jobs: + /// * `status` - HEALTHY|PAUSED|CANCELLED + /// * `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + /// * 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + /// quotation marks. Nanoseconds are ignored. + /// * 'error_count' - Number of errors that have occurred while running. + /// * The operator must be `=` or `!=` for status and inspected_storage. + /// + /// Examples: + /// + /// * inspected_storage = cloud_storage AND status = HEALTHY + /// * inspected_storage = cloud_storage OR inspected_storage = bigquery + /// * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + /// * last_run_time > "2017-12-12T00:00:00+00:00" + /// + /// The length of this field should be no more than 500 characters. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationJobTriggerListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationJobTriggerListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationJobTriggerListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationJobTriggerListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new job to inspect storage or calculate risk metrics. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the +/// system will automatically choose what detectors to run. By default this may +/// be all types, but may change over time as detectors are updated. +/// +/// A builder for the *dlpJobs.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateDlpJobRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateDlpJobRequest::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().dlp_jobs_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDlpJobCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateDlpJobRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDlpJobCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectDlpJobCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/dlpJobs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateDlpJobRequest) -> ProjectDlpJobCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectDlpJobCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDlpJobCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDlpJobCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the stored infoType by creating a new version. The existing version +/// will continue to be used until the new version is ready. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *storedInfoTypes.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateStoredInfoTypeRequest::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().stored_info_types_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectStoredInfoTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectStoredInfoTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectStoredInfoTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.storedInfoTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) -> ProjectStoredInfoTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and storedInfoType to be updated, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectStoredInfoTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectStoredInfoTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectStoredInfoTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectStoredInfoTypePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running DlpJob. The server +/// makes a best effort to cancel the DlpJob, but success is not +/// guaranteed. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *dlpJobs.cancel* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CancelDlpJobRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CancelDlpJobRequest::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().dlp_jobs_cancel(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDlpJobCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CancelDlpJobRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDlpJobCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectDlpJobCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CancelDlpJobRequest) -> ProjectDlpJobCancelCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the DlpJob resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDlpJobCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDlpJobCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDlpJobCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running DlpJob. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *dlpJobs.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().dlp_jobs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDlpJobGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDlpJobGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectDlpJobGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the DlpJob resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDlpJobGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDlpJobGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDlpJobGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest::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_deidentify_templates_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.deidentifyTemplates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) -> ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and deidentify template to be updated, for + /// example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDeidentifyTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a job trigger. +/// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. +/// +/// A builder for the *locations.jobTriggers.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateJobTriggerRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateJobTriggerRequest::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_job_triggers_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationJobTriggerPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateJobTriggerRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationJobTriggerPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationJobTriggerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2JobTrigger)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.jobTriggers.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateJobTriggerRequest) -> ProjectLocationJobTriggerPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the project and the triggeredJob, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationJobTriggerPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationJobTriggerPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationJobTriggerPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationJobTriggerPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a pre-built stored infoType to be used for inspection. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *locations.storedInfoTypes.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateStoredInfoTypeRequest::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_stored_info_types_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStoredInfoTypeCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStoredInfoTypeCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.storedInfoTypes.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateStoredInfoTypeRequest) -> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store the stored infoType. Reserved for + /// future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStoredInfoTypeCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a DeidentifyTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_deidentify_templates_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.deidentifyTemplates.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and deidentify template to be deleted, + /// for example `organizations/433245324/deidentifyTemplates/432452342` or + /// projects/project-id/deidentifyTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDeidentifyTemplateDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Re-identifies content that has been de-identified. +/// See +/// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example +/// to learn more. +/// +/// A builder for the *content.reidentify* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2ReidentifyContentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2ReidentifyContentRequest::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().content_reidentify(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectContentReidentifyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2ReidentifyContentRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectContentReidentifyCall<'a, C, A> {} + +impl<'a, C, A> ProjectContentReidentifyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ReidentifyContentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.content.reidentify", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/content:reidentify"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2ReidentifyContentRequest) -> ProjectContentReidentifyCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectContentReidentifyCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectContentReidentifyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectContentReidentifyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectContentReidentifyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Finds potentially sensitive info in content. +/// This method has limits on input size, processing time, and output size. +/// +/// When no InfoTypes or CustomInfoTypes are specified in this request, the +/// system will automatically choose what detectors to run. By default this may +/// be all types, but may change over time as detectors are updated. +/// +/// For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images +/// and https://cloud.google.com/dlp/docs/inspecting-text, +/// +/// A builder for the *locations.content.inspect* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2InspectContentRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2InspectContentRequest::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_content_inspect(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationContentInspectCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2InspectContentRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationContentInspectCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationContentInspectCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectContentResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.content.inspect", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/content:inspect"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2InspectContentRequest) -> ProjectLocationContentInspectCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent resource name, for example projects/my-project-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationContentInspectCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to process content inspection. Reserved for future + /// extensions. + /// When inspecting images location is restricted to 'global', 'us', 'asia', + /// and 'europe'. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationContentInspectCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationContentInspectCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationContentInspectCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationContentInspectCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a long-running DlpJob. This method indicates that the client is +/// no longer interested in the DlpJob result. The job will be cancelled if +/// possible. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *dlpJobs.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().dlp_jobs_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDlpJobDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDlpJobDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectDlpJobDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the DlpJob resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectDlpJobDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDlpJobDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDlpJobDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a stored infoType. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *locations.storedInfoTypes.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_stored_info_types_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStoredInfoTypeGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStoredInfoTypeGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.storedInfoTypes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and storedInfoType to be read, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStoredInfoTypeGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStoredInfoTypeGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStoredInfoTypeGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets an InspectTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *inspectTemplates.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().inspect_templates_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInspectTemplateGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInspectTemplateGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInspectTemplateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and inspectTemplate to be read, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInspectTemplateGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInspectTemplateGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInspectTemplateGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInspectTemplateGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Finds potentially sensitive info in content. /// This method has limits on input size, processing time, and output size. /// @@ -12229,7 +26647,7 @@ impl<'a, C, A> ProjectInspectTemplateDeleteCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateDeleteCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateDeleteCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateDeleteCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationImageRedactCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, - _request: GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest, - _name: String, + _request: GooglePrivacyDlpV2RedactImageRequest, + _parent: String, + _location_id: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectDeidentifyTemplatePatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationImageRedactCall<'a, C, A> {} -impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationImageRedactCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2RedactImageResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -12369,11 +26793,12 @@ impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.deidentifyTemplates.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + dlg.begin(MethodInfo { id: "dlp.projects.locations.image.redact", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12385,12 +26810,12 @@ impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -12447,7 +26872,7 @@ impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplatePatchCall<'a, C, A> { + pub fn request(mut self, new_value: GooglePrivacyDlpV2RedactImageRequest) -> ProjectLocationImageRedactCall<'a, C, A> { self._request = new_value; self } - /// Resource name of organization and deidentify template to be updated, for - /// example `organizations/433245324/deidentifyTemplates/432452342` or - /// projects/project-id/deidentifyTemplates/432452342. + /// The parent resource name, for example projects/my-project-id. /// - /// Sets the *name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectLocationImageRedactCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to process the request. Reserved for future + /// extensions. + /// Location is restricted to 'global', 'us', 'asia', and 'europe'. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationImageRedactCall<'a, C, A> { + self._location_id = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -12530,7 +26965,7 @@ impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplatePatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationImageRedactCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12555,7 +26990,7 @@ impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationImageRedactCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -12575,7 +27010,7 @@ impl<'a, C, A> ProjectDeidentifyTemplatePatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectDeidentifyTemplatePatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationImageRedactCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -12763,7 +27198,7 @@ impl<'a, C, A> ProjectJobTriggerGetCall<'a, C, A> where C: BorrowMut ProjectJobTriggerGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateInspectTemplateRequest::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().inspect_templates_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInspectTemplatePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInspectTemplatePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectInspectTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateInspectTemplateRequest) -> ProjectInspectTemplatePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInspectTemplatePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInspectTemplatePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInspectTemplatePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInspectTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the stored infoType by creating a new version. The existing version +/// will continue to be used until the new version is ready. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *locations.storedInfoTypes.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateStoredInfoTypeRequest::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_stored_info_types_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStoredInfoTypePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStoredInfoTypePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStoredInfoTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.storedInfoTypes.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) -> ProjectLocationStoredInfoTypePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of organization and storedInfoType to be updated, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStoredInfoTypePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStoredInfoTypePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStoredInfoTypePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStoredInfoTypePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a DeidentifyTemplate for re-using frequently used configuration +/// for de-identifying content, images, and storage. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateDeidentifyTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateDeidentifyTemplateRequest::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_deidentify_templates_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DeidentifyTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.deidentifyTemplates.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/deidentifyTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) -> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store the deidentification template. Reserved + /// for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDeidentifyTemplateCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an InspectTemplate for re-using frequently used configuration +/// for inspecting content, images, and storage. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *locations.inspectTemplates.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateInspectTemplateRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateInspectTemplateRequest::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_inspect_templates_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationInspectTemplateCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateInspectTemplateRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationInspectTemplateCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationInspectTemplateCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.inspectTemplates.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/inspectTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateInspectTemplateRequest) -> ProjectLocationInspectTemplateCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationInspectTemplateCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store the inspection template. Reserved for + /// future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationInspectTemplateCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationInspectTemplateCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationInspectTemplateCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationInspectTemplateCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new job to inspect storage or calculate risk metrics. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the +/// system will automatically choose what detectors to run. By default this may +/// be all types, but may change over time as detectors are updated. +/// +/// A builder for the *locations.dlpJobs.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CreateDlpJobRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateDlpJobRequest::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_dlp_jobs_create(req, "parent", "locationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDlpJobCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2CreateDlpJobRequest, + _parent: String, + _location_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDlpJobCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDlpJobCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.dlpJobs.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + for &field in ["alt", "parent", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/dlpJobs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateDlpJobRequest) -> ProjectLocationDlpJobCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent resource name, for example projects/my-project-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDlpJobCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location to store and process the job. Reserved for + /// future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationDlpJobCreateCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDlpJobCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDlpJobCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDlpJobCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Activate a job trigger. Causes the immediate execute of a trigger +/// instead of waiting on the trigger event to occur. +/// +/// A builder for the *jobTriggers.activate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2ActivateJobTriggerRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2ActivateJobTriggerRequest::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().job_triggers_activate(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobTriggerActivateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _request: GooglePrivacyDlpV2ActivateJobTriggerRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobTriggerActivateCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobTriggerActivateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.jobTriggers.activate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}:activate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GooglePrivacyDlpV2ActivateJobTriggerRequest) -> ProjectJobTriggerActivateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the trigger to activate, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectJobTriggerActivateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectJobTriggerActivateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobTriggerActivateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectJobTriggerActivateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a job trigger. +/// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. +/// +/// A builder for the *jobTriggers.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().job_triggers_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectJobTriggerDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectJobTriggerDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectJobTriggerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.jobTriggers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the project and the triggeredJob, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectJobTriggerDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectJobTriggerDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectJobTriggerDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectJobTriggerDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists stored infoTypes. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. +/// +/// A builder for the *storedInfoTypes.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().stored_info_types_list("parent") +/// .page_token("ea") +/// .page_size(-74) +/// .order_by("dolor") +/// .location_id("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectStoredInfoTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _location_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectStoredInfoTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListStoredInfoTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.storedInfoTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._location_id { + params.push(("locationId", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "locationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListStoredInfoTypes`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectStoredInfoTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc, display_name, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the most recent version of the + /// resource was created. + /// - `state`: corresponds to the state of the resource. + /// - `name`: corresponds to resource name. + /// - `display_name`: corresponds to info type's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The geographic location where stored infoTypes will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* query property to the given value. + pub fn location_id(mut self, new_value: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectStoredInfoTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectStoredInfoTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectStoredInfoTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an InspectTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. +/// +/// A builder for the *locations.inspectTemplates.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_inspect_templates_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationInspectTemplateDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationInspectTemplateDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationInspectTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.inspectTemplates.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the organization and inspectTemplate to be deleted, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationInspectTemplateDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationInspectTemplateDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationInspectTemplateDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationInspectTemplateDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets a stored infoType. /// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to /// learn more. @@ -13014,7 +30001,7 @@ impl<'a, C, A> ProjectStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_stored_info_types_list("parent", "locationId") +/// .page_token("clita") +/// .page_size(-37) +/// .order_by("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStoredInfoTypeListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _location_id: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStoredInfoTypeListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStoredInfoTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListStoredInfoTypesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.storedInfoTypes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + for &field in ["alt", "parent", "locationId", "pageToken", "pageSize", "orderBy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/storedInfoTypes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or + /// organizations/my-org-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The geographic location where stored infoTypes will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListStoredInfoTypes`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc, display_name, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the most recent version of the + /// resource was created. + /// - `state`: corresponds to the state of the resource. + /// - `name`: corresponds to resource name. + /// - `display_name`: corresponds to info type's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStoredInfoTypeListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Starts asynchronous cancellation on a long-running DlpJob. The server +/// makes a best effort to cancel the DlpJob, but success is not +/// guaranteed. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *locations.dlpJobs.cancel* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// use dlp2::GooglePrivacyDlpV2CancelDlpJobRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -13119,33 +30423,33 @@ impl<'a, C, A> ProjectStoredInfoTypeGetCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationDlpJobCancelCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, - _request: GooglePrivacyDlpV2CreateInspectTemplateRequest, - _parent: String, + _request: GooglePrivacyDlpV2CancelDlpJobRequest, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInspectTemplateCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDlpJobCancelCall<'a, C, A> {} -impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDlpJobCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -13154,11 +30458,11 @@ impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.create", + dlg.begin(MethodInfo { id: "dlp.projects.locations.dlpJobs.cancel", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13170,12 +30474,12 @@ impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -13293,19 +30597,18 @@ impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateCreateCall<'a, C, A> { + pub fn request(mut self, new_value: GooglePrivacyDlpV2CancelDlpJobRequest) -> ProjectLocationDlpJobCancelCall<'a, C, A> { self._request = new_value; self } - /// The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. + /// Required. The name of the DlpJob resource to be cancelled. /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectInspectTemplateCreateCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ProjectLocationDlpJobCancelCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -13314,7 +30617,7 @@ impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut ProjectInspectTemplateCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDlpJobCancelCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13339,7 +30642,7 @@ impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInspectTemplateCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDlpJobCancelCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13359,7 +30662,369 @@ impl<'a, C, A> ProjectInspectTemplateCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInspectTemplateCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDlpJobCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists DlpJobs that match the specified filter in the request. +/// See https://cloud.google.com/dlp/docs/inspecting-storage and +/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// +/// A builder for the *dlpJobs.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().dlp_jobs_list("parent") +/// .type_("et") +/// .page_token("sed") +/// .page_size(-47) +/// .order_by("takimata") +/// .location_id("elitr") +/// .filter("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDlpJobListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _type_: Option, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _location_id: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDlpJobListCall<'a, C, A> {} + +impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListDlpJobsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._type_ { + params.push(("type", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._location_id { + params.push(("locationId", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "type", "pageToken", "pageSize", "orderBy", "locationId", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/dlpJobs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The type of job. Defaults to `DlpJobType.INSPECT` + /// + /// Sets the *type* query property to the given value. + pub fn type_(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { + self._type_ = Some(new_value.to_string()); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectDlpJobListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc, end_time asc, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the job was created. + /// - `end_time`: corresponds to time the job ended. + /// - `name`: corresponds to job's name. + /// - `state`: corresponds to `state` + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The geographic location where jobs will be retrieved from. + /// Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* query property to the given value. + pub fn location_id(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// Allows filtering. + /// + /// Supported syntax: + /// + /// * Filter expressions are made up of one or more restrictions. + /// * Restrictions can be combined by `AND` or `OR` logical operators. A + /// sequence of restrictions implicitly uses `AND`. + /// * A restriction has the form of `{field} {operator} {value}`. + /// * Supported fields/values for inspect jobs: + /// * `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED + /// * `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + /// * `trigger_name` - The resource name of the trigger that created job. + /// * 'end_time` - Corresponds to time the job finished. + /// * 'start_time` - Corresponds to time the job finished. + /// * Supported fields for risk analysis jobs: + /// * `state` - RUNNING|CANCELED|FINISHED|FAILED + /// * 'end_time` - Corresponds to time the job finished. + /// * 'start_time` - Corresponds to time the job finished. + /// * The operator must be `=` or `!=`. + /// + /// Examples: + /// + /// * inspected_storage = cloud_storage AND state = done + /// * inspected_storage = cloud_storage OR inspected_storage = bigquery + /// * inspected_storage = cloud_storage AND (state = done OR state = canceled) + /// * end_time > "2017-12-12T00:00:00+00:00" + /// + /// The length of this field should be no more than 500 characters. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDlpJobListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDlpJobListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13579,7 +31244,7 @@ impl<'a, C, A> ProjectJobTriggerCreateCall<'a, C, A> where C: BorrowMut ProjectJobTriggerCreateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CreateDlpJobRequest::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().dlp_jobs_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectDlpJobCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2CreateDlpJobRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectDlpJobCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectDlpJobCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/dlpJobs"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2CreateDlpJobRequest) -> ProjectDlpJobCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The parent resource name, for example projects/my-project-id. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectDlpJobCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectDlpJobCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDlpJobCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the stored infoType by creating a new version. The existing version -/// will continue to be used until the new version is ready. -/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to -/// learn more. -/// -/// A builder for the *storedInfoTypes.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// use dlp2::GooglePrivacyDlpV2UpdateStoredInfoTypeRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2UpdateStoredInfoTypeRequest::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().stored_info_types_patch(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectStoredInfoTypePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectStoredInfoTypePatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectStoredInfoTypePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.storedInfoTypes.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) -> ProjectStoredInfoTypePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Resource name of organization and storedInfoType to be updated, for - /// example `organizations/433245324/storedInfoTypes/432452342` or - /// projects/project-id/storedInfoTypes/432452342. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectStoredInfoTypePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectStoredInfoTypePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectStoredInfoTypePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectStoredInfoTypePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates a DeidentifyTemplate for re-using frequently used configuration /// for de-identifying content, images, and storage. /// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn @@ -14430,7 +31526,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateCreateCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The parent resource name, for example projects/my-project-id or + /// Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. /// /// Sets the *parent* path property to the given value. @@ -14504,11 +31600,11 @@ impl<'a, C, A> ProjectDeidentifyTemplateCreateCall<'a, C, A> where C: BorrowMut< } -/// Lists DlpJobs that match the specified filter in the request. -/// See https://cloud.google.com/dlp/docs/inspecting-storage and -/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. +/// Deletes a stored infoType. +/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to +/// learn more. /// -/// A builder for the *dlpJobs.list* method supported by a *project* resource. +/// A builder for the *locations.storedInfoTypes.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -14533,37 +31629,27 @@ impl<'a, C, A> ProjectDeidentifyTemplateCreateCall<'a, C, A> where C: BorrowMut< /// // 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().dlp_jobs_list("parent") -/// .type_("Lorem") -/// .page_token("sea") -/// .page_size(-21) -/// .order_by("duo") -/// .filter("et") +/// let result = hub.projects().locations_stored_info_types_delete("name") /// .doit(); /// # } /// ``` -pub struct ProjectDlpJobListCall<'a, C, A> +pub struct ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, - _parent: String, - _type_: Option, - _page_token: Option, - _page_size: Option, - _order_by: Option, - _filter: Option, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectDlpJobListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListDlpJobsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -14572,26 +31658,11 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._type_ { - params.push(("type", value.to_string())); - } - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "parent", "type", "pageToken", "pageSize", "orderBy", "filter"].iter() { + dlg.begin(MethodInfo { id: "dlp.projects.locations.storedInfoTypes.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14603,12 +31674,12 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/dlpJobs"; + let mut url = self.hub._base_url.clone() + "v2/{+name}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+name}", "name")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -14623,7 +31694,7 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -14653,7 +31724,7 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -14706,88 +31777,16 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut } - /// The parent resource name, for example projects/my-project-id. + /// Required. Resource name of the organization and storedInfoType to be deleted, for + /// example `organizations/433245324/storedInfoTypes/432452342` or + /// projects/project-id/storedInfoTypes/432452342. /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The type of job. Defaults to `DlpJobType.INSPECT` - /// - /// Sets the *type* query property to the given value. - pub fn type_(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { - self._type_ = Some(new_value.to_string()); - self - } - /// The standard list page token. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The standard list page size. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectDlpJobListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional comma separated list of fields to order by, - /// followed by `asc` or `desc` postfix. This list is case-insensitive, - /// default sorting order is ascending, redundant space characters are - /// insignificant. - /// - /// Example: `name asc, end_time asc, create_time desc` - /// - /// Supported fields are: - /// - /// - `create_time`: corresponds to time the job was created. - /// - `end_time`: corresponds to time the job ended. - /// - `name`: corresponds to job's name. - /// - `state`: corresponds to `state` - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// Optional. Allows filtering. - /// - /// Supported syntax: - /// - /// * Filter expressions are made up of one or more restrictions. - /// * Restrictions can be combined by `AND` or `OR` logical operators. A - /// sequence of restrictions implicitly uses `AND`. - /// * A restriction has the form of ` `. - /// * Supported fields/values for inspect jobs: - /// * `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - /// * `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY - /// * `trigger_name` - The resource name of the trigger that created job. - /// * 'end_time` - Corresponds to time the job finished. - /// * 'start_time` - Corresponds to time the job finished. - /// * Supported fields for risk analysis jobs: - /// * `state` - RUNNING|CANCELED|FINISHED|FAILED - /// * 'end_time` - Corresponds to time the job finished. - /// * 'start_time` - Corresponds to time the job finished. - /// * The operator must be `=` or `!=`. - /// - /// Examples: - /// - /// * inspected_storage = cloud_storage AND state = done - /// * inspected_storage = cloud_storage OR inspected_storage = bigquery - /// * inspected_storage = cloud_storage AND (state = done OR state = canceled) - /// * end_time > "2017-12-12T00:00:00+00:00" - /// - /// The length of this field should be no more than 500 characters. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectDlpJobListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + pub fn name(mut self, new_value: &str) -> ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -14796,7 +31795,7 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -14821,7 +31820,7 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectDlpJobListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -14841,7 +31840,7 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDlpJobListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationStoredInfoTypeDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -14883,9 +31882,10 @@ impl<'a, C, A> ProjectDlpJobListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().deidentify_templates_list("parent") -/// .page_token("sanctus") -/// .page_size(-22) -/// .order_by("amet") +/// .page_token("ut") +/// .page_size(-37) +/// .order_by("amet.") +/// .location_id("ipsum") /// .doit(); /// # } /// ``` @@ -14897,6 +31897,7 @@ pub struct ProjectDeidentifyTemplateListCall<'a, C, A> _page_token: Option, _page_size: Option, _order_by: Option, + _location_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -14919,7 +31920,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -14930,7 +31931,10 @@ impl<'a, C, A> ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut ProjectDeidentifyTemplateListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -15154,839 +32166,6 @@ impl<'a, C, A> ProjectDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2CancelDlpJobRequest::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().dlp_jobs_cancel(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectDlpJobCancelCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2CancelDlpJobRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectDlpJobCancelCall<'a, C, A> {} - -impl<'a, C, A> ProjectDlpJobCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.cancel", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}:cancel"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2CancelDlpJobRequest) -> ProjectDlpJobCancelCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the DlpJob resource to be cancelled. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectDlpJobCancelCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobCancelCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectDlpJobCancelCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDlpJobCancelCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists InspectTemplates. -/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. -/// -/// A builder for the *inspectTemplates.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().inspect_templates_list("parent") -/// .page_token("ut") -/// .page_size(-16) -/// .order_by("sed") -/// .doit(); -/// # } -/// ``` -pub struct ProjectInspectTemplateListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _parent: String, - _page_token: Option, - _page_size: Option, - _order_by: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectInspectTemplateListCall<'a, C, A> {} - -impl<'a, C, A> ProjectInspectTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListInspectTemplatesResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.inspectTemplates.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/inspectTemplates"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The parent resource name, for example projects/my-project-id or - /// organizations/my-org-id. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectInspectTemplateListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional page token to continue retrieval. Comes from previous call - /// to `ListInspectTemplates`. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectInspectTemplateListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional size of the page, can be limited by server. If zero server returns - /// a page of max size 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectInspectTemplateListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional comma separated list of fields to order by, - /// followed by `asc` or `desc` postfix. This list is case-insensitive, - /// default sorting order is ascending, redundant space characters are - /// insignificant. - /// - /// Example: `name asc,update_time, create_time desc` - /// - /// Supported fields are: - /// - /// - `create_time`: corresponds to time the template was created. - /// - `update_time`: corresponds to time the template was last updated. - /// - `name`: corresponds to template's name. - /// - `display_name`: corresponds to template's display name. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ProjectInspectTemplateListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInspectTemplateListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectInspectTemplateListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectInspectTemplateListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the latest state of a long-running DlpJob. -/// See https://cloud.google.com/dlp/docs/inspecting-storage and -/// https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. -/// -/// A builder for the *dlpJobs.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().dlp_jobs_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectDlpJobGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectDlpJobGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectDlpJobGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DlpJob resource. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectDlpJobGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectDlpJobGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDlpJobGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// De-identifies potentially sensitive info from a ContentItem. /// This method has limits on input size and output size. /// See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to @@ -16273,292 +32452,10 @@ impl<'a, C, A> ProjectContentDeidentifyCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2ActivateJobTriggerRequest::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().job_triggers_activate(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectJobTriggerActivateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2ActivateJobTriggerRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectJobTriggerActivateCall<'a, C, A> {} - -impl<'a, C, A> ProjectJobTriggerActivateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2DlpJob)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.jobTriggers.activate", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}:activate"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2ActivateJobTriggerRequest) -> ProjectJobTriggerActivateCall<'a, C, A> { - self._request = new_value; - self - } - /// Resource name of the trigger to activate, for example - /// `projects/dlp-test-project/jobTriggers/53234423`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectJobTriggerActivateCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectJobTriggerActivateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectJobTriggerActivateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectJobTriggerActivateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a DeidentifyTemplate. -/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn -/// more. -/// -/// A builder for the *deidentifyTemplates.delete* method supported by a *project* resource. +/// A builder for the *locations.jobTriggers.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -16583,11 +32480,11 @@ impl<'a, C, A> ProjectJobTriggerActivateCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationJobTriggerDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, @@ -16597,9 +32494,9 @@ pub struct ProjectDeidentifyTemplateDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectDeidentifyTemplateDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationJobTriggerDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationJobTriggerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -16612,7 +32509,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.deidentifyTemplates.delete", + dlg.begin(MethodInfo { id: "dlp.projects.locations.jobTriggers.delete", http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -16731,15 +32628,14 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< } - /// Resource name of the organization and deidentify template to be deleted, - /// for example `organizations/433245324/deidentifyTemplates/432452342` or - /// projects/project-id/deidentifyTemplates/432452342. + /// Required. Resource name of the project and the triggeredJob, for example + /// `projects/dlp-test-project/jobTriggers/53234423`. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationJobTriggerDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -16749,7 +32645,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationJobTriggerDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -16774,7 +32670,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationJobTriggerDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -16794,7 +32690,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDeidentifyTemplateDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationJobTriggerDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -16806,11 +32702,10 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< } -/// Creates a pre-built stored infoType to be used for inspection. -/// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to -/// learn more. +/// Updates the InspectTemplate. +/// See https://cloud.google.com/dlp/docs/creating-templates to learn more. /// -/// A builder for the *storedInfoTypes.create* method supported by a *project* resource. +/// A builder for the *locations.inspectTemplates.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -16822,7 +32717,7 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_dlp2 as dlp2; -/// use dlp2::GooglePrivacyDlpV2CreateStoredInfoTypeRequest; +/// use dlp2::GooglePrivacyDlpV2UpdateInspectTemplateRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -16836,33 +32731,33 @@ impl<'a, C, A> ProjectDeidentifyTemplateDeleteCall<'a, C, A> where C: BorrowMut< /// // 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 = GooglePrivacyDlpV2CreateStoredInfoTypeRequest::default(); +/// let mut req = GooglePrivacyDlpV2UpdateInspectTemplateRequest::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().stored_info_types_create(req, "parent") +/// let result = hub.projects().locations_inspect_templates_patch(req, "name") /// .doit(); /// # } /// ``` -pub struct ProjectStoredInfoTypeCreateCall<'a, C, A> +pub struct ProjectLocationInspectTemplatePatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, - _request: GooglePrivacyDlpV2CreateStoredInfoTypeRequest, - _parent: String, + _request: GooglePrivacyDlpV2UpdateInspectTemplateRequest, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectStoredInfoTypeCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationInspectTemplatePatchCall<'a, C, A> {} -impl<'a, C, A> ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationInspectTemplatePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2StoredInfoType)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2InspectTemplate)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -16871,11 +32766,11 @@ impl<'a, C, A> ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.storedInfoTypes.create", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "dlp.projects.locations.inspectTemplates.patch", + http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16887,12 +32782,12 @@ impl<'a, C, A> ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -16949,7 +32844,7 @@ impl<'a, C, A> ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeCreateCall<'a, C, A> { + pub fn request(mut self, new_value: GooglePrivacyDlpV2UpdateInspectTemplateRequest) -> ProjectLocationInspectTemplatePatchCall<'a, C, A> { self._request = new_value; self } - /// The parent resource name, for example projects/my-project-id or + /// Required. Resource name of organization and inspectTemplate to be updated, for + /// example `organizations/433245324/inspectTemplates/432452342` or + /// projects/project-id/inspectTemplates/432452342. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationInspectTemplatePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationInspectTemplatePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationInspectTemplatePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationInspectTemplatePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists DeidentifyTemplates. +/// See https://cloud.google.com/dlp/docs/creating-templates-deid to learn +/// more. +/// +/// A builder for the *locations.deidentifyTemplates.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dlp2 as dlp2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dlp2::DLP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_deidentify_templates_list("parent", "locationId") +/// .page_token("sanctus") +/// .page_size(-27) +/// .order_by("dolor") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDeidentifyTemplateListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DLP, + _parent: String, + _location_id: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDeidentifyTemplateListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDeidentifyTemplateListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListDeidentifyTemplatesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dlp.projects.locations.deidentifyTemplates.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + for &field in ["alt", "parent", "locationId", "pageToken", "pageSize", "orderBy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/locations/{locationId}/deidentifyTemplates"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{locationId}", "locationId")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["locationId", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource name, for example projects/my-project-id or /// organizations/my-org-id. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectStoredInfoTypeCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> { self._parent = new_value.to_string(); self } + /// The geographic location where deidentifications templates will be retrieved + /// from. Use `-` for all locations. Reserved for future extensions. + /// + /// Sets the *location id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn location_id(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> { + self._location_id = new_value.to_string(); + self + } + /// Page token to continue retrieval. Comes from previous call + /// to `ListDeidentifyTemplates`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Size of the page, can be limited by server. If zero server returns + /// a page of max size 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma separated list of fields to order by, + /// followed by `asc` or `desc` postfix. This list is case-insensitive, + /// default sorting order is ascending, redundant space characters are + /// insignificant. + /// + /// Example: `name asc,update_time, create_time desc` + /// + /// Supported fields are: + /// + /// - `create_time`: corresponds to time the template was created. + /// - `update_time`: corresponds to time the template was last updated. + /// - `name`: corresponds to template's name. + /// - `display_name`: corresponds to template's display name. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectStoredInfoTypeCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -17056,7 +33266,7 @@ impl<'a, C, A> ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectStoredInfoTypeCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -17076,539 +33286,7 @@ impl<'a, C, A> ProjectStoredInfoTypeCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectStoredInfoTypeCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a job trigger. -/// See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. -/// -/// A builder for the *jobTriggers.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().job_triggers_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectJobTriggerDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectJobTriggerDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectJobTriggerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.jobTriggers.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Resource name of the project and the triggeredJob, for example - /// `projects/dlp-test-project/jobTriggers/53234423`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectJobTriggerDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectJobTriggerDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectJobTriggerDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectJobTriggerDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Re-identifies content that has been de-identified. -/// See -/// https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example -/// to learn more. -/// -/// A builder for the *content.reidentify* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_dlp2 as dlp2; -/// use dlp2::GooglePrivacyDlpV2ReidentifyContentRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use dlp2::DLP; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GooglePrivacyDlpV2ReidentifyContentRequest::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().content_reidentify(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectContentReidentifyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _request: GooglePrivacyDlpV2ReidentifyContentRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectContentReidentifyCall<'a, C, A> {} - -impl<'a, C, A> ProjectContentReidentifyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ReidentifyContentResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.content.reidentify", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/content:reidentify"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GooglePrivacyDlpV2ReidentifyContentRequest) -> ProjectContentReidentifyCall<'a, C, A> { - self._request = new_value; - self - } - /// The parent resource name. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectContentReidentifyCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectContentReidentifyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectContentReidentifyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectContentReidentifyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDeidentifyTemplateListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -17649,10 +33327,11 @@ impl<'a, C, A> ProjectContentReidentifyCall<'a, C, A> where C: BorrowMut _page_token: Option, _page_size: Option, _order_by: Option, + _location_id: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -17687,7 +33367,7 @@ impl<'a, C, A> ProjectJobTriggerListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -17698,10 +33378,13 @@ impl<'a, C, A> ProjectJobTriggerListCall<'a, C, A> where C: BorrowMut ProjectJobTriggerListCall<'a, C, A> where C: BorrowMut ProjectJobTriggerListCall<'a, C, A> where C: BorrowMut ProjectJobTriggerListCall<'a, C, A> where C: BorrowMut ProjectJobTriggerListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Optional comma separated list of triggeredJob fields to order by, + /// Comma separated list of triggeredJob fields to order by, /// followed by `asc` or `desc` postfix. This list is case-insensitive, /// default sorting order is ascending, redundant space characters are /// insignificant. @@ -17863,14 +33546,22 @@ impl<'a, C, A> ProjectJobTriggerListCall<'a, C, A> where C: BorrowMut ProjectJobTriggerListCall<'a, C, A> { + self._location_id = Some(new_value.to_string()); + self + } + /// Allows filtering. /// /// Supported syntax: /// /// * Filter expressions are made up of one or more restrictions. /// * Restrictions can be combined by `AND` or `OR` logical operators. A /// sequence of restrictions implicitly uses `AND`. - /// * A restriction has the form of ` `. + /// * A restriction has the form of `{field} {operator} {value}`. /// * Supported fields/values for inspect jobs: /// * `status` - HEALTHY|PAUSED|CANCELLED /// * `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY @@ -17956,258 +33647,6 @@ impl<'a, C, A> ProjectJobTriggerListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = DLP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().dlp_jobs_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectDlpJobDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DLP, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectDlpJobDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectDlpJobDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobufEmpty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "dlp.projects.dlpJobs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DlpJob resource to be deleted. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectDlpJobDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectDlpJobDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectDlpJobDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDlpJobDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Redacts potentially sensitive info from an image. /// This method has limits on input size, processing time, and output size. /// See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to @@ -18494,12 +33933,12 @@ impl<'a, C, A> ProjectImageRedactCall<'a, C, A> where C: BorrowMut ProjectImageRedactCall<'a, C, A> where C: BorrowMut +pub struct LocationInfoTypeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a DLP, - _parent: String, - _page_token: Option, - _page_size: Option, - _order_by: Option, + _location_id: String, + _language_code: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectStoredInfoTypeListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for LocationInfoTypeListCall<'a, C, A> {} -impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> LocationInfoTypeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListStoredInfoTypesResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + pub fn doit(mut self) -> Result<(hyper::client::Response, GooglePrivacyDlpV2ListInfoTypesResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -18558,20 +33994,17 @@ impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dlp.projects.storedInfoTypes.list", + dlg.begin(MethodInfo { id: "dlp.locations.infoTypes.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("locationId", self._location_id.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy"].iter() { + for &field in ["alt", "locationId", "languageCode", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -18583,27 +34016,24 @@ impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { - replace_with = value.to_string(); + replace_with = Some(value); break; } } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["locationId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -18686,51 +34116,32 @@ impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeListCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn location_id(mut self, new_value: &str) -> LocationInfoTypeListCall<'a, C, A> { + self._location_id = new_value.to_string(); self } - /// Optional page token to continue retrieval. Comes from previous call - /// to `ListStoredInfoTypes`. + /// BCP-47 language code for localized infoType friendly + /// names. If omitted, or if localized strings are not available, + /// en-US strings will be returned. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> LocationInfoTypeListCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); self } - /// Optional size of the page, can be limited by server. If zero server returns - /// a page of max size 100. + /// filter to only return infoTypes supported by certain parts of the + /// API. Defaults to supported_by=INSPECT. /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectStoredInfoTypeListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Optional comma separated list of fields to order by, - /// followed by `asc` or `desc` postfix. This list is case-insensitive, - /// default sorting order is ascending, redundant space characters are - /// insignificant. - /// - /// Example: `name asc, display_name, create_time desc` - /// - /// Supported fields are: - /// - /// - `create_time`: corresponds to time the most recent version of the - /// resource was created. - /// - `state`: corresponds to the state of the resource. - /// - `name`: corresponds to resource name. - /// - `display_name`: corresponds to info type's display name. - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ProjectStoredInfoTypeListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> LocationInfoTypeListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -18739,7 +34150,7 @@ impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut ProjectStoredInfoTypeListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LocationInfoTypeListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18764,7 +34175,7 @@ impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectStoredInfoTypeListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> LocationInfoTypeListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18784,7 +34195,7 @@ impl<'a, C, A> ProjectStoredInfoTypeListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectStoredInfoTypeListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> LocationInfoTypeListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/dlp2_beta1-cli/Cargo.toml b/gen/dlp2_beta1-cli/Cargo.toml index 9bcb25a464..0c6d740608 100644 --- a/gen/dlp2_beta1-cli/Cargo.toml +++ b/gen/dlp2_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dlp2_beta1-cli" -version = "1.0.12+20171205" +version = "1.0.13+20171205" authors = ["Sebastian Thiel "] description = "A complete library to interact with DLP (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dlp2_beta1] path = "../dlp2_beta1" -version = "1.0.12+20171205" +version = "1.0.13+20171205" diff --git a/gen/dlp2_beta1-cli/README.md b/gen/dlp2_beta1-cli/README.md index ec32aa2daa..4c53ce7b5b 100644 --- a/gen/dlp2_beta1-cli/README.md +++ b/gen/dlp2_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *DLP* API at revision *20171205*. The CLI is at version *1.0.12*. +This documentation was generated from the *DLP* API at revision *20171205*. The CLI is at version *1.0.13*. ```bash dlp2-beta1 [options] diff --git a/gen/dlp2_beta1-cli/mkdocs.yml b/gen/dlp2_beta1-cli/mkdocs.yml index 1131411e8b..3aa9500db4 100644 --- a/gen/dlp2_beta1-cli/mkdocs.yml +++ b/gen/dlp2_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: DLP v1.0.12+20171205 +site_name: DLP v1.0.13+20171205 site_url: http://byron.github.io/google-apis-rs/google-dlp2_beta1-cli site_description: A complete library to interact with DLP (protocol v2beta1) diff --git a/gen/dlp2_beta1-cli/src/main.rs b/gen/dlp2_beta1-cli/src/main.rs index 34bedb719a..15f2fd6164 100644 --- a/gen/dlp2_beta1-cli/src/main.rs +++ b/gen/dlp2_beta1-cli/src/main.rs @@ -1743,7 +1743,7 @@ fn main() { let mut app = App::new("dlp2-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20171205") + .version("1.0.13+20171205") .about("The Google Data Loss Prevention API provides methods for detection of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dlp2_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/dlp2_beta1/Cargo.toml b/gen/dlp2_beta1/Cargo.toml index bf046f836d..4de07cbd61 100644 --- a/gen/dlp2_beta1/Cargo.toml +++ b/gen/dlp2_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dlp2_beta1" -version = "1.0.12+20171205" +version = "1.0.13+20171205" authors = ["Sebastian Thiel "] description = "A complete library to interact with DLP (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dlp2_beta1" homepage = "https://cloud.google.com/dlp/docs/" -documentation = "https://docs.rs/google-dlp2_beta1/1.0.12+20171205" +documentation = "https://docs.rs/google-dlp2_beta1/1.0.13+20171205" license = "MIT" keywords = ["dlp", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dlp2_beta1/README.md b/gen/dlp2_beta1/README.md index ec366e4f52..2a0874e2fa 100644 --- a/gen/dlp2_beta1/README.md +++ b/gen/dlp2_beta1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-dlp2_beta1` library allows access to all features of the *Google DLP* service. -This documentation was generated from *DLP* crate version *1.0.12+20171205*, where *20171205* is the exact revision of the *dlp:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *DLP* crate version *1.0.13+20171205*, where *20171205* is the exact revision of the *dlp:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *DLP* *v2_beta1* API can be found at the [official documentation site](https://cloud.google.com/dlp/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.DLP.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.DLP.html) ... * content - * [*deidentify*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.ContentDeidentifyCall.html), [*inspect*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.ContentInspectCall.html) and [*redact*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.ContentRedactCall.html) + * [*deidentify*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.ContentDeidentifyCall.html), [*inspect*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.ContentInspectCall.html) and [*redact*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.ContentRedactCall.html) * data source - * [*analyze*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.DataSourceAnalyzeCall.html) + * [*analyze*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.DataSourceAnalyzeCall.html) * inspect - * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.InspectOperationCancelCall.html), [*operations create*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.InspectOperationCreateCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.InspectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.InspectOperationGetCall.html), [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.InspectOperationListCall.html) and [*results findings list*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.InspectResultFindingListCall.html) + * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.InspectOperationCancelCall.html), [*operations create*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.InspectOperationCreateCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.InspectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.InspectOperationGetCall.html), [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.InspectOperationListCall.html) and [*results findings list*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.InspectResultFindingListCall.html) * risk analysis - * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationCancelCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationGetCall.html) and [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationListCall.html) + * [*operations cancel*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationCancelCall.html), [*operations delete*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationDeleteCall.html), [*operations get*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationGetCall.html) and [*operations list*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.RiskAnalysiOperationListCall.html) * root categories - * [*info types list*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.RootCategoryInfoTypeListCall.html) and [*list*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.RootCategoryListCall.html) + * [*info types list*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.RootCategoryInfoTypeListCall.html) and [*list*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.RootCategoryListCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/struct.DLP.html)** +* **[Hub](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/struct.DLP.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -141,17 +141,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -161,29 +161,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dlp2_beta1/1.0.12+20171205/google_dlp2_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dlp2_beta1/1.0.13+20171205/google_dlp2_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dlp2_beta1/src/lib.rs b/gen/dlp2_beta1/src/lib.rs index 9b17c461cf..3a9b479c74 100644 --- a/gen/dlp2_beta1/src/lib.rs +++ b/gen/dlp2_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *DLP* crate version *1.0.12+20171205*, where *20171205* is the exact revision of the *dlp:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *DLP* crate version *1.0.13+20171205*, where *20171205* is the exact revision of the *dlp:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *DLP* *v2_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/dlp/docs/). @@ -340,7 +340,7 @@ impl<'a, C, A> DLP DLP { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://dlp.googleapis.com/".to_string(), _root_url: "https://dlp.googleapis.com/".to_string(), } @@ -363,7 +363,7 @@ impl<'a, C, A> DLP } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/dns1-cli/Cargo.toml b/gen/dns1-cli/Cargo.toml index 0c3c72f857..d29f133bdb 100644 --- a/gen/dns1-cli/Cargo.toml +++ b/gen/dns1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dns1-cli" -version = "1.0.12+20190625" +version = "1.0.13+20191205" authors = ["Sebastian Thiel "] description = "A complete library to interact with dns (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dns1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-dns1] path = "../dns1" -version = "1.0.12+20190625" +version = "1.0.13+20191205" diff --git a/gen/dns1-cli/README.md b/gen/dns1-cli/README.md index c914590473..07ff569e1b 100644 --- a/gen/dns1-cli/README.md +++ b/gen/dns1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dns* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *dns* API at revision *20191205*. The CLI is at version *1.0.13*. ```bash dns1 [options] @@ -46,6 +46,13 @@ dns1 [options] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] + policies + create (-r )... [-p ]... [-o ] + delete [-p ]... + get [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + update (-r )... [-p ]... [-o ] projects get [-p ]... [-o ] resource-record-sets diff --git a/gen/dns1-cli/mkdocs.yml b/gen/dns1-cli/mkdocs.yml index 26c2ab2c36..f1a59d0d41 100644 --- a/gen/dns1-cli/mkdocs.yml +++ b/gen/dns1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dns v1.0.12+20190625 +site_name: dns v1.0.13+20191205 site_url: http://byron.github.io/google-apis-rs/google-dns1-cli site_description: A complete library to interact with dns (protocol v1) @@ -22,6 +22,12 @@ pages: - ['managed-zones_list.md', 'Managed Zones', 'List'] - ['managed-zones_patch.md', 'Managed Zones', 'Patch'] - ['managed-zones_update.md', 'Managed Zones', 'Update'] +- ['policies_create.md', 'Policies', 'Create'] +- ['policies_delete.md', 'Policies', 'Delete'] +- ['policies_get.md', 'Policies', 'Get'] +- ['policies_list.md', 'Policies', 'List'] +- ['policies_patch.md', 'Policies', 'Patch'] +- ['policies_update.md', 'Policies', 'Update'] - ['projects_get.md', 'Projects', 'Get'] - ['resource-record-sets_list.md', 'Resource Record Sets', 'List'] diff --git a/gen/dns1-cli/src/main.rs b/gen/dns1-cli/src/main.rs index 62b286ecd8..41f29986e1 100644 --- a/gen/dns1-cli/src/main.rs +++ b/gen/dns1-cli/src/main.rs @@ -523,9 +523,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name-servers" => Some(("nameServers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "forwarding-config.kind" => Some(("forwardingConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "visibility" => Some(("visibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name-server-set" => Some(("nameServerSet", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -534,10 +535,14 @@ impl<'n> Engine<'n> { "dnssec-config.kind" => Some(("dnssecConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dnssec-config.state" => Some(("dnssecConfig.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dnssec-config.non-existence" => Some(("dnssecConfig.nonExistence", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.kind" => Some(("peeringConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.kind" => Some(("peeringConfig.targetNetwork.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.deactivate-time" => Some(("peeringConfig.targetNetwork.deactivateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.network-url" => Some(("peeringConfig.targetNetwork.networkUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "description", "dns-name", "dnssec-config", "id", "kind", "labels", "name", "name-server-set", "name-servers", "non-existence", "private-visibility-config", "state", "visibility"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "deactivate-time", "description", "dns-name", "dnssec-config", "forwarding-config", "id", "kind", "labels", "name", "name-server-set", "name-servers", "network-url", "non-existence", "peering-config", "private-visibility-config", "state", "target-network", "visibility"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -791,9 +796,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name-servers" => Some(("nameServers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "forwarding-config.kind" => Some(("forwardingConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "visibility" => Some(("visibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name-server-set" => Some(("nameServerSet", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -802,10 +808,14 @@ impl<'n> Engine<'n> { "dnssec-config.kind" => Some(("dnssecConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dnssec-config.state" => Some(("dnssecConfig.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dnssec-config.non-existence" => Some(("dnssecConfig.nonExistence", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.kind" => Some(("peeringConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.kind" => Some(("peeringConfig.targetNetwork.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.deactivate-time" => Some(("peeringConfig.targetNetwork.deactivateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.network-url" => Some(("peeringConfig.targetNetwork.networkUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "description", "dns-name", "dnssec-config", "id", "kind", "labels", "name", "name-server-set", "name-servers", "non-existence", "private-visibility-config", "state", "visibility"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "deactivate-time", "description", "dns-name", "dnssec-config", "forwarding-config", "id", "kind", "labels", "name", "name-server-set", "name-servers", "network-url", "non-existence", "peering-config", "private-visibility-config", "state", "target-network", "visibility"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -893,9 +903,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name-servers" => Some(("nameServers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "forwarding-config.kind" => Some(("forwardingConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "visibility" => Some(("visibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name-server-set" => Some(("nameServerSet", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -904,10 +915,14 @@ impl<'n> Engine<'n> { "dnssec-config.kind" => Some(("dnssecConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dnssec-config.state" => Some(("dnssecConfig.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dnssec-config.non-existence" => Some(("dnssecConfig.nonExistence", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.kind" => Some(("peeringConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.kind" => Some(("peeringConfig.targetNetwork.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.deactivate-time" => Some(("peeringConfig.targetNetwork.deactivateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "peering-config.target-network.network-url" => Some(("peeringConfig.targetNetwork.networkUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "description", "dns-name", "dnssec-config", "id", "kind", "labels", "name", "name-server-set", "name-servers", "non-existence", "private-visibility-config", "state", "visibility"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["creation-time", "deactivate-time", "description", "dns-name", "dnssec-config", "forwarding-config", "id", "kind", "labels", "name", "name-server-set", "name-servers", "network-url", "non-existence", "peering-config", "private-visibility-config", "state", "target-network", "visibility"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -971,6 +986,454 @@ impl<'n> Engine<'n> { } } + fn _policies_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "alternative-name-server-config.kind" => Some(("alternativeNameServerConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-inbound-forwarding" => Some(("enableInboundForwarding", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternative-name-server-config", "description", "enable-inbound-forwarding", "enable-logging", "id", "kind", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Policy = json::value::from_value(object).unwrap(); + let mut call = self.hub.policies().create(request, opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "client-operation-id" => { + call = call.client_operation_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["client-operation-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _policies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.policies().delete(opt.value_of("project").unwrap_or(""), opt.value_of("policy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "client-operation-id" => { + call = call.client_operation_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["client-operation-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok(mut response) => { + Ok(()) + } + } + } + } + + fn _policies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.policies().get(opt.value_of("project").unwrap_or(""), opt.value_of("policy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "client-operation-id" => { + call = call.client_operation_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["client-operation-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _policies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.policies().list(opt.value_of("project").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "max-results"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _policies_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "alternative-name-server-config.kind" => Some(("alternativeNameServerConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-inbound-forwarding" => Some(("enableInboundForwarding", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternative-name-server-config", "description", "enable-inbound-forwarding", "enable-logging", "id", "kind", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Policy = json::value::from_value(object).unwrap(); + let mut call = self.hub.policies().patch(request, opt.value_of("project").unwrap_or(""), opt.value_of("policy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "client-operation-id" => { + call = call.client_operation_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["client-operation-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _policies_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "alternative-name-server-config.kind" => Some(("alternativeNameServerConfig.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enable-inbound-forwarding" => Some(("enableInboundForwarding", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "enable-logging" => Some(("enableLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternative-name-server-config", "description", "enable-inbound-forwarding", "enable-logging", "id", "kind", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Policy = json::value::from_value(object).unwrap(); + let mut call = self.hub.policies().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("policy").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "client-operation-id" => { + call = call.client_operation_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["client-operation-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().get(opt.value_of("project").unwrap_or("")); @@ -1168,6 +1631,32 @@ impl<'n> Engine<'n> { } } }, + ("policies", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._policies_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._policies_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._policies_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._policies_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._policies_patch(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._policies_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("policies".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("projects", Some(opt)) => { match opt.subcommand() { ("get", Some(opt)) => { @@ -1672,6 +2161,177 @@ fn main() { ]), ]), + ("policies", "methods: 'create', 'delete', 'get', 'list', 'patch' and 'update'", vec![ + ("create", + Some(r##"Create a new Policy"##), + "Details at http://byron.github.io/google-apis-rs/google_dns1_cli/policies_create", + vec![ + (Some(r##"project"##), + None, + Some(r##"Identifies the project addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Delete a previously created Policy. Will fail if the policy is still being referenced by a network."##), + "Details at http://byron.github.io/google-apis-rs/google_dns1_cli/policies_delete", + vec![ + (Some(r##"project"##), + None, + Some(r##"Identifies the project addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"policy"##), + None, + Some(r##"User given friendly name of the policy addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + ]), + ("get", + Some(r##"Fetch the representation of an existing Policy."##), + "Details at http://byron.github.io/google-apis-rs/google_dns1_cli/policies_get", + vec![ + (Some(r##"project"##), + None, + Some(r##"Identifies the project addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"policy"##), + None, + Some(r##"User given friendly name of the policy addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"Enumerate all Policies associated with a project."##), + "Details at http://byron.github.io/google-apis-rs/google_dns1_cli/policies_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Identifies the project addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Apply a partial update to an existing Policy."##), + "Details at http://byron.github.io/google-apis-rs/google_dns1_cli/policies_patch", + vec![ + (Some(r##"project"##), + None, + Some(r##"Identifies the project addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"policy"##), + None, + Some(r##"User given friendly name of the policy addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update", + Some(r##"Update an existing Policy."##), + "Details at http://byron.github.io/google-apis-rs/google_dns1_cli/policies_update", + vec![ + (Some(r##"project"##), + None, + Some(r##"Identifies the project addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"policy"##), + None, + Some(r##"User given friendly name of the policy addressed by this request."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("projects", "methods: 'get'", vec![ ("get", Some(r##"Fetch the representation of an existing Project."##), @@ -1732,7 +2392,7 @@ fn main() { let mut app = App::new("dns1") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20191205") .about("Configures and serves authoritative DNS records.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dns1_cli") .arg(Arg::with_name("url") diff --git a/gen/dns1/Cargo.toml b/gen/dns1/Cargo.toml index a342d4d8f2..3a3b3e8945 100644 --- a/gen/dns1/Cargo.toml +++ b/gen/dns1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dns1" -version = "1.0.12+20190625" +version = "1.0.13+20191205" authors = ["Sebastian Thiel "] description = "A complete library to interact with dns (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dns1" homepage = "https://developers.google.com/cloud-dns" -documentation = "https://docs.rs/google-dns1/1.0.12+20190625" +documentation = "https://docs.rs/google-dns1/1.0.13+20191205" license = "MIT" keywords = ["dns", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/dns1/README.md b/gen/dns1/README.md index 3562ac201a..c3b97ed0d6 100644 --- a/gen/dns1/README.md +++ b/gen/dns1/README.md @@ -5,26 +5,28 @@ DO NOT EDIT ! --> The `google-dns1` library allows access to all features of the *Google dns* service. -This documentation was generated from *dns* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *dns* crate version *1.0.13+20191205*, where *20191205* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *dns* *v1* API can be found at the [official documentation site](https://developers.google.com/cloud-dns). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.Dns.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.Dns.html) ... -* [changes](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.Change.html) - * [*create*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ChangeCreateCall.html), [*get*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ChangeGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ChangeListCall.html) -* [dns keys](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.DnsKey.html) - * [*get*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.DnsKeyGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.DnsKeyListCall.html) +* [changes](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.Change.html) + * [*create*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ChangeCreateCall.html), [*get*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ChangeGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ChangeListCall.html) +* [dns keys](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.DnsKey.html) + * [*get*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.DnsKeyGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.DnsKeyListCall.html) * managed zone operations - * [*get*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZoneOperationGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZoneOperationListCall.html) -* [managed zones](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZone.html) - * [*create*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZoneCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZoneDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZoneGetCall.html), [*list*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZoneListCall.html), [*patch*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZonePatchCall.html) and [*update*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ManagedZoneUpdateCall.html) -* [projects](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.Project.html) - * [*get*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ProjectGetCall.html) -* [resource record sets](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ResourceRecordSet.html) - * [*list*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.ResourceRecordSetListCall.html) + * [*get*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZoneOperationGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZoneOperationListCall.html) +* [managed zones](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZone.html) + * [*create*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZoneCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZoneDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZoneGetCall.html), [*list*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZoneListCall.html), [*patch*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZonePatchCall.html) and [*update*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ManagedZoneUpdateCall.html) +* [policies](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.Policy.html) + * [*create*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.PolicyCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.PolicyDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.PolicyGetCall.html), [*list*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.PolicyListCall.html), [*patch*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.PolicyPatchCall.html) and [*update*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.PolicyUpdateCall.html) +* [projects](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.Project.html) + * [*get*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ProjectGetCall.html) +* [resource record sets](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ResourceRecordSet.html) + * [*list*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.ResourceRecordSetListCall.html) @@ -33,17 +35,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/struct.Dns.html)** +* **[Hub](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/struct.Dns.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -146,17 +148,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -166,29 +168,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dns1/1.0.12+20190625/google_dns1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dns1/1.0.13+20191205/google_dns1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dns1/src/lib.rs b/gen/dns1/src/lib.rs index 2c6b6d09ac..3788b593a9 100644 --- a/gen/dns1/src/lib.rs +++ b/gen/dns1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dns* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *dns* crate version *1.0.13+20191205*, where *20191205* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *dns* *v1* API can be found at the //! [official documentation site](https://developers.google.com/cloud-dns). @@ -19,6 +19,8 @@ //! * [*get*](struct.ManagedZoneOperationGetCall.html) and [*list*](struct.ManagedZoneOperationListCall.html) //! * [managed zones](struct.ManagedZone.html) //! * [*create*](struct.ManagedZoneCreateCall.html), [*delete*](struct.ManagedZoneDeleteCall.html), [*get*](struct.ManagedZoneGetCall.html), [*list*](struct.ManagedZoneListCall.html), [*patch*](struct.ManagedZonePatchCall.html) and [*update*](struct.ManagedZoneUpdateCall.html) +//! * [policies](struct.Policy.html) +//! * [*create*](struct.PolicyCreateCall.html), [*delete*](struct.PolicyDeleteCall.html), [*get*](struct.PolicyGetCall.html), [*list*](struct.PolicyListCall.html), [*patch*](struct.PolicyPatchCall.html) and [*update*](struct.PolicyUpdateCall.html) //! * [projects](struct.Project.html) //! * [*get*](struct.ProjectGetCall.html) //! * [resource record sets](struct.ResourceRecordSet.html) @@ -358,7 +360,7 @@ impl<'a, C, A> Dns Dns { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://dns.googleapis.com/dns/v1/projects/".to_string(), _root_url: "https://dns.googleapis.com/".to_string(), } @@ -376,6 +378,9 @@ impl<'a, C, A> Dns pub fn managed_zones(&'a self) -> ManagedZoneMethods<'a, C, A> { ManagedZoneMethods { hub: &self } } + pub fn policies(&'a self) -> PolicyMethods<'a, C, A> { + PolicyMethods { hub: &self } + } pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } @@ -384,7 +389,7 @@ impl<'a, C, A> Dns } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -449,6 +454,38 @@ pub struct ManagedZonePrivateVisibilityConfigNetwork { impl Part for ManagedZonePrivateVisibilityConfigNetwork {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PolicyNetwork { + /// Identifies what kind of resource this is. Value: the fixed string "dns#policyNetwork". + pub kind: Option, + /// The fully qualified URL of the VPC network to bind to. This should be formatted like https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + #[serde(rename="networkUrl")] + pub network_url: Option, +} + +impl Part for PolicyNetwork {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedZoneForwardingConfig { + /// Identifies what kind of resource this is. Value: the fixed string "dns#managedZoneForwardingConfig". + pub kind: Option, + /// List of target name servers to forward to. Cloud DNS will select the best available name server if more than one target is given. + #[serde(rename="targetNameServers")] + pub target_name_servers: Option>, +} + +impl Part for ManagedZoneForwardingConfig {} + + /// A unit of data that will be returned by the DNS servers. /// /// # Activities @@ -497,6 +534,9 @@ impl Resource for ResourceRecordSet {} pub struct ManagedZone { /// Identifies what kind of resource this is. Value: the fixed string "dns#managedZone". pub kind: Option, + /// The presence for this field indicates that outbound forwarding is enabled for this zone. The value of this field contains the set of destinations to forward to. + #[serde(rename="forwardingConfig")] + pub forwarding_config: Option, /// A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the managed zone's function. pub description: Option, /// Delegate your managed_zone to these virtual name servers; defined by the server (output only) @@ -520,6 +560,9 @@ pub struct ManagedZone { /// DNSSEC configuration. #[serde(rename="dnssecConfig")] pub dnssec_config: Option, + /// The presence of this field indicates that DNS Peering is enabled for this zone. The value of this field contains the network to peer with. + #[serde(rename="peeringConfig")] + pub peering_config: Option, /// Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most users will leave this field unset. #[serde(rename="nameServerSet")] pub name_server_set: Option, @@ -703,6 +746,45 @@ pub struct ManagedZonesListResponse { impl ResponseResult for ManagedZonesListResponse {} +/// A policy is a collection of DNS rules applied to one or more Virtual Private Cloud resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch policies](struct.PolicyPatchCall.html) (request) +/// * [create policies](struct.PolicyCreateCall.html) (request|response) +/// * [get policies](struct.PolicyGetCall.html) (response) +/// * [update policies](struct.PolicyUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. + #[serde(rename="alternativeNameServerConfig")] + pub alternative_name_server_config: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dns#policy". + pub kind: Option, + /// A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function. + pub description: Option, + /// Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address will be allocated from each of the sub-networks that are bound to this policy. + #[serde(rename="enableInboundForwarding")] + pub enable_inbound_forwarding: Option, + /// Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set. + #[serde(rename="enableLogging")] + pub enable_logging: Option, + /// Unique identifier for the resource; defined by the server (output only). + pub id: Option, + /// List of network names specifying networks to which this policy is applied. + pub networks: Option>, + /// User assigned name for this policy. + pub name: Option, +} + +impl RequestValue for Policy {} +impl ResponseResult for Policy {} + + /// There is no detailed description. /// /// # Activities @@ -738,12 +820,12 @@ impl ResponseResult for ResourceRecordSetsListResponse {} pub struct ManagedZoneDnsSecConfig { /// Identifies what kind of resource this is. Value: the fixed string "dns#managedZoneDnsSecConfig". pub kind: Option, - /// Specifies parameters that will be used for generating initial DnsKeys for this ManagedZone. Can only be changed while state is OFF. + /// Specifies parameters for generating initial DnsKeys for this ManagedZone. Can only be changed while the state is OFF. #[serde(rename="defaultKeySpecs")] pub default_key_specs: Option>, /// Specifies whether DNSSEC is enabled, and what mode it is in. pub state: Option, - /// Specifies the mechanism used to provide authenticated denial-of-existence responses. Can only be changed while state is OFF. + /// Specifies the mechanism for authenticated denial-of-existence responses. Can only be changed while the state is OFF. #[serde(rename="nonExistence")] pub non_existence: Option, } @@ -751,6 +833,26 @@ pub struct ManagedZoneDnsSecConfig { impl Part for ManagedZoneDnsSecConfig {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch policies](struct.PolicyPatchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PoliciesPatchResponse { + /// no description provided + pub policy: Option, + /// no description provided + pub header: Option, +} + +impl ResponseResult for PoliciesPatchResponse {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -768,6 +870,22 @@ pub struct OperationManagedZoneContext { impl Part for OperationManagedZoneContext {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PolicyAlternativeNameServerConfig { + /// Identifies what kind of resource this is. Value: the fixed string "dns#policyAlternativeNameServerConfig". + pub kind: Option, + /// Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. + #[serde(rename="targetNameServers")] + pub target_name_servers: Option>, +} + +impl Part for PolicyAlternativeNameServerConfig {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -789,6 +907,9 @@ impl Part for ManagedZonePrivateVisibilityConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Quota { + /// Maximum allowed number of networks per policy. + #[serde(rename="networksPerPolicy")] + pub networks_per_policy: Option, /// Identifies what kind of resource this is. Value: the fixed string "dns#quota". pub kind: Option, /// Maximum allowed number of managed zones which can be attached to a network. @@ -800,6 +921,9 @@ pub struct Quota { /// Maximum allowed number of ResourceRecords per ResourceRecordSet. #[serde(rename="resourceRecordsPerRrset")] pub resource_records_per_rrset: Option, + /// Maximum allowed number of target name servers per managed forwarding zone. + #[serde(rename="targetNameServersPerManagedZone")] + pub target_name_servers_per_managed_zone: Option, /// Maximum allowed number of DnsKeys per ManagedZone. #[serde(rename="dnsKeysPerManagedZone")] pub dns_keys_per_managed_zone: Option, @@ -809,9 +933,11 @@ pub struct Quota { /// Maximum allowed number of ResourceRecordSets to add per ChangesCreateRequest. #[serde(rename="rrsetAdditionsPerChange")] pub rrset_additions_per_change: Option, - /// DNSSEC algorithm and key length types that can be used for DnsKeys. - #[serde(rename="whitelistedKeySpecs")] - pub whitelisted_key_specs: Option>, + /// Maximum allowed number of policies per project. + pub policies: Option, + /// Maximum allowed number of alternative target name servers per policy. + #[serde(rename="targetNameServersPerPolicy")] + pub target_name_servers_per_policy: Option, /// Maximum allowed number of ResourceRecordSets to delete per ChangesCreateRequest. #[serde(rename="rrsetDeletionsPerChange")] pub rrset_deletions_per_change: Option, @@ -821,6 +947,9 @@ pub struct Quota { /// Maximum allowed number of networks to which a privately scoped zone can be attached. #[serde(rename="networksPerManagedZone")] pub networks_per_managed_zone: Option, + /// DNSSEC algorithm and key length types that can be used for DnsKeys. + #[serde(rename="whitelistedKeySpecs")] + pub whitelisted_key_specs: Option>, } impl Part for Quota {} @@ -842,6 +971,22 @@ pub struct DnsKeyDigest { impl Part for DnsKeyDigest {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PolicyAlternativeNameServerConfigTargetNameServer { + /// IPv4 address to forward to. + #[serde(rename="ipv4Address")] + pub ipv4_address: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dns#policyAlternativeNameServerConfigTargetNameServer". + pub kind: Option, +} + +impl Part for PolicyAlternativeNameServerConfigTargetNameServer {} + + /// The response to a request to enumerate Changes to a ResourceRecordSets collection. /// /// # Activities @@ -869,6 +1014,69 @@ pub struct ChangesListResponse { impl ResponseResult for ChangesListResponse {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedZoneForwardingConfigNameServerTarget { + /// IPv4 address of a target name server. + #[serde(rename="ipv4Address")] + pub ipv4_address: Option, + /// Identifies what kind of resource this is. Value: the fixed string "dns#managedZoneForwardingConfigNameServerTarget". + pub kind: Option, +} + +impl Part for ManagedZoneForwardingConfigNameServerTarget {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update policies](struct.PolicyUpdateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PoliciesUpdateResponse { + /// no description provided + pub policy: Option, + /// no description provided + pub header: Option, +} + +impl ResponseResult for PoliciesUpdateResponse {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list policies](struct.PolicyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PoliciesListResponse { + /// The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another list request using this value as your page token. + /// + /// In this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to retrieve a consistent snapshot of a collection larger than the maximum page size. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// no description provided + pub header: Option, + /// Type of resource. + pub kind: Option, + /// The policy resources. + pub policies: Option>, +} + +impl ResponseResult for PoliciesListResponse {} + + /// Elements common to every response. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -921,6 +1129,25 @@ pub struct Operation { impl ResponseResult for Operation {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedZonePeeringConfigTargetNetwork { + /// Identifies what kind of resource this is. Value: the fixed string "dns#managedZonePeeringConfigTargetNetwork". + pub kind: Option, + /// The time at which the zone was deactivated, in RFC 3339 date-time format. An empty string indicates that the peering connection is active. The producer network can deactivate a zone. The zone is automatically deactivated if the producer network that the zone targeted is deleted. Output only. + #[serde(rename="deactivateTime")] + pub deactivate_time: Option, + /// The fully qualified URL of the VPC network to forward queries to. This should be formatted like https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + #[serde(rename="networkUrl")] + pub network_url: Option, +} + +impl Part for ManagedZonePeeringConfigTargetNetwork {} + + /// A Change represents a set of ResourceRecordSet additions and deletions applied atomically to a ManagedZone. ResourceRecordSets within a ManagedZone are modified by creating a new Change element in the Changes collection. In turn the Changes collection also records the past modifications to the ResourceRecordSets in a ManagedZone. The current state of the ManagedZone is the sum effect of applying all Change elements in the Changes collection in sequence. /// /// # Activities @@ -957,11 +1184,92 @@ impl Resource for Change {} impl ResponseResult for Change {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManagedZonePeeringConfig { + /// Identifies what kind of resource this is. Value: the fixed string "dns#managedZonePeeringConfig". + pub kind: Option, + /// The network with which to peer. + #[serde(rename="targetNetwork")] + pub target_network: Option, +} + +impl Part for ManagedZonePeeringConfig {} + + // ################### // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *resourceRecordSet* resources. +/// It is not used directly, but through the `Dns` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_dns1 as dns1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use dns1::Dns; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.resource_record_sets(); +/// # } +/// ``` +pub struct ResourceRecordSetMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dns, +} + +impl<'a, C, A> MethodsBuilder for ResourceRecordSetMethods<'a, C, A> {} + +impl<'a, C, A> ResourceRecordSetMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Enumerate ResourceRecordSets that have been created but not yet deleted. + /// + /// # Arguments + /// + /// * `project` - Identifies the project addressed by this request. + /// * `managedZone` - Identifies the managed zone addressed by this request. Can be the managed zone name or id. + pub fn list(&self, project: &str, managed_zone: &str) -> ResourceRecordSetListCall<'a, C, A> { + ResourceRecordSetListCall { + hub: self.hub, + _project: project.to_string(), + _managed_zone: managed_zone.to_string(), + _type_: Default::default(), + _page_token: Default::default(), + _name: Default::default(), + _max_results: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *dnsKey* resources. /// It is not used directly, but through the `Dns` hub. /// @@ -1301,7 +1609,7 @@ impl<'a, C, A> ManagedZoneMethods<'a, C, A> { -/// A builder providing access to all methods supported on *resourceRecordSet* resources. +/// A builder providing access to all methods supported on *policy* resources. /// It is not used directly, but through the `Dns` hub. /// /// # Example @@ -1325,43 +1633,143 @@ impl<'a, C, A> ManagedZoneMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `list(...)` +/// // like `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` /// // to build up your call. -/// let rb = hub.resource_record_sets(); +/// let rb = hub.policies(); /// # } /// ``` -pub struct ResourceRecordSetMethods<'a, C, A> +pub struct PolicyMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Dns, } -impl<'a, C, A> MethodsBuilder for ResourceRecordSetMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for PolicyMethods<'a, C, A> {} -impl<'a, C, A> ResourceRecordSetMethods<'a, C, A> { +impl<'a, C, A> PolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Enumerate ResourceRecordSets that have been created but not yet deleted. + /// Create a new Policy + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Identifies the project addressed by this request. + pub fn create(&self, request: Policy, project: &str) -> PolicyCreateCall<'a, C, A> { + PolicyCreateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _client_operation_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a previously created Policy. Will fail if the policy is still being referenced by a network. /// /// # Arguments /// /// * `project` - Identifies the project addressed by this request. - /// * `managedZone` - Identifies the managed zone addressed by this request. Can be the managed zone name or id. - pub fn list(&self, project: &str, managed_zone: &str) -> ResourceRecordSetListCall<'a, C, A> { - ResourceRecordSetListCall { + /// * `policy` - User given friendly name of the policy addressed by this request. + pub fn delete(&self, project: &str, policy: &str) -> PolicyDeleteCall<'a, C, A> { + PolicyDeleteCall { + hub: self.hub, + _project: project.to_string(), + _policy: policy.to_string(), + _client_operation_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Apply a partial update to an existing Policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Identifies the project addressed by this request. + /// * `policy` - User given friendly name of the policy addressed by this request. + pub fn patch(&self, request: Policy, project: &str, policy: &str) -> PolicyPatchCall<'a, C, A> { + PolicyPatchCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _policy: policy.to_string(), + _client_operation_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Fetch the representation of an existing Policy. + /// + /// # Arguments + /// + /// * `project` - Identifies the project addressed by this request. + /// * `policy` - User given friendly name of the policy addressed by this request. + pub fn get(&self, project: &str, policy: &str) -> PolicyGetCall<'a, C, A> { + PolicyGetCall { + hub: self.hub, + _project: project.to_string(), + _policy: policy.to_string(), + _client_operation_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Enumerate all Policies associated with a project. + /// + /// # Arguments + /// + /// * `project` - Identifies the project addressed by this request. + pub fn list(&self, project: &str) -> PolicyListCall<'a, C, A> { + PolicyListCall { hub: self.hub, _project: project.to_string(), - _managed_zone: managed_zone.to_string(), - _type_: Default::default(), _page_token: Default::default(), - _name: Default::default(), _max_results: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Update an existing Policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - Identifies the project addressed by this request. + /// * `policy` - User given friendly name of the policy addressed by this request. + pub fn update(&self, request: Policy, project: &str, policy: &str) -> PolicyUpdateCall<'a, C, A> { + PolicyUpdateCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _policy: policy.to_string(), + _client_operation_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -1541,6 +1949,306 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# +/// Enumerate ResourceRecordSets that have been created but not yet deleted. +/// +/// A builder for the *list* method supported by a *resourceRecordSet* resource. +/// It is not used directly, but through a `ResourceRecordSetMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dns1 as dns1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dns1::Dns; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.resource_record_sets().list("project", "managedZone") +/// .type_("erat") +/// .page_token("labore") +/// .name("sea") +/// .max_results(-90) +/// .doit(); +/// # } +/// ``` +pub struct ResourceRecordSetListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dns, + _project: String, + _managed_zone: String, + _type_: Option, + _page_token: Option, + _name: Option, + _max_results: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ResourceRecordSetListCall<'a, C, A> {} + +impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ResourceRecordSetsListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dns.resourceRecordSets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("managedZone", self._managed_zone.to_string())); + if let Some(value) = self._type_ { + params.push(("type", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._name { + params.push(("name", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + for &field in ["alt", "project", "managedZone", "type", "pageToken", "name", "maxResults"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}/rrsets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{managedZone}", "managedZone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["managedZone", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Identifies the project addressed by this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Identifies the managed zone addressed by this request. Can be the managed zone name or id. + /// + /// Sets the *managed zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn managed_zone(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { + self._managed_zone = new_value.to_string(); + self + } + /// Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + /// + /// Sets the *type* query property to the given value. + pub fn type_(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { + self._type_ = Some(new_value.to_string()); + self + } + /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Restricts the list to return only records with this fully qualified domain name. + /// + /// Sets the *name* query property to the given value. + pub fn name(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { + self._name = Some(new_value.to_string()); + self + } + /// Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ResourceRecordSetListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ResourceRecordSetListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ResourceRecordSetListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::NdevClouddnReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ResourceRecordSetListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Fetch the representation of an existing DnsKey. /// /// A builder for the *get* method supported by a *dnsKey* resource. @@ -1569,8 +2277,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.dns_keys().get("project", "managedZone", "dnsKeyId") -/// .digest_type("labore") -/// .client_operation_id("sea") +/// .digest_type("aliquyam") +/// .client_operation_id("ea") /// .doit(); /// # } /// ``` @@ -1857,9 +2565,9 @@ impl<'a, C, A> DnsKeyGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.dns_keys().list("project", "managedZone") -/// .page_token("gubergren") -/// .max_results(-95) -/// .digest_type("aliquyam") +/// .page_token("justo") +/// .max_results(-34) +/// .digest_type("et") /// .doit(); /// # } /// ``` @@ -2145,9 +2853,9 @@ impl<'a, C, A> DnsKeyListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zone_operations().list("project", "managedZone") -/// .sort_by("justo") -/// .page_token("justo") -/// .max_results(-34) +/// .sort_by("Lorem") +/// .page_token("et") +/// .max_results(-70) /// .doit(); /// # } /// ``` @@ -2433,7 +3141,7 @@ impl<'a, C, A> ManagedZoneOperationListCall<'a, C, A> where C: BorrowMut ManagedZoneOperationGetCall<'a, C, A> where C: BorrowMut ManagedZoneUpdateCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zones().patch(req, "project", "managedZone") -/// .client_operation_id("eos") +/// .client_operation_id("amet") /// .doit(); /// # } /// ``` @@ -3305,7 +4013,7 @@ impl<'a, C, A> ManagedZonePatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zones().create(req, "project") -/// .client_operation_id("sadipscing") +/// .client_operation_id("labore") /// .doit(); /// # } /// ``` @@ -3582,7 +4290,7 @@ impl<'a, C, A> ManagedZoneCreateCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zones().delete("project", "managedZone") -/// .client_operation_id("elitr") +/// .client_operation_id("invidunt") /// .doit(); /// # } /// ``` @@ -3835,7 +4543,7 @@ impl<'a, C, A> ManagedZoneDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zones().get("project", "managedZone") -/// .client_operation_id("labore") +/// .client_operation_id("Lorem") /// .doit(); /// # } /// ``` @@ -4099,9 +4807,9 @@ impl<'a, C, A> ManagedZoneGetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.managed_zones().list("project") -/// .page_token("dolore") -/// .max_results(-37) -/// .dns_name("aliquyam") +/// .page_token("et") +/// .max_results(-70) +/// .dns_name("et") /// .doit(); /// # } /// ``` @@ -4347,10 +5055,293 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, } -/// Enumerate ResourceRecordSets that have been created but not yet deleted. +/// Create a new Policy /// -/// A builder for the *list* method supported by a *resourceRecordSet* resource. -/// It is not used directly, but through a `ResourceRecordSetMethods` instance. +/// A builder for the *create* method supported by a *policy* resource. +/// It is not used directly, but through a `PolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dns1 as dns1; +/// use dns1::Policy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dns1::Dns; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Policy::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.policies().create(req, "project") +/// .client_operation_id("sanctus") +/// .doit(); +/// # } +/// ``` +pub struct PolicyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dns, + _request: Policy, + _project: String, + _client_operation_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PolicyCreateCall<'a, C, A> {} + +impl<'a, C, A> PolicyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dns.policies.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._client_operation_id { + params.push(("clientOperationId", value.to_string())); + } + for &field in ["alt", "project", "clientOperationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/policies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Policy) -> PolicyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifies the project addressed by this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PolicyCreateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + /// + /// Sets the *client operation id* query property to the given value. + pub fn client_operation_id(mut self, new_value: &str) -> PolicyCreateCall<'a, C, A> { + self._client_operation_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PolicyCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PolicyCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PolicyCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a previously created Policy. Will fail if the policy is still being referenced by a network. +/// +/// A builder for the *delete* method supported by a *policy* resource. +/// It is not used directly, but through a `PolicyMethods` instance. /// /// # Example /// @@ -4374,36 +5365,30 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, /// // 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.resource_record_sets().list("project", "managedZone") -/// .type_("sea") -/// .page_token("et") -/// .name("duo") -/// .max_results(-21) +/// let result = hub.policies().delete("project", "policy") +/// .client_operation_id("et") /// .doit(); /// # } /// ``` -pub struct ResourceRecordSetListCall<'a, C, A> +pub struct PolicyDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Dns, _project: String, - _managed_zone: String, - _type_: Option, - _page_token: Option, - _name: Option, - _max_results: Option, + _policy: String, + _client_operation_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ResourceRecordSetListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for PolicyDeleteCall<'a, C, A> {} -impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> PolicyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ResourceRecordSetsListResponse)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -4411,24 +5396,15 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "dns.resourceRecordSets.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "dns.policies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("managedZone", self._managed_zone.to_string())); - if let Some(value) = self._type_ { - params.push(("type", value.to_string())); + params.push(("policy", self._policy.to_string())); + if let Some(value) = self._client_operation_id { + params.push(("clientOperationId", value.to_string())); } - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._name { - params.push(("name", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - for &field in ["alt", "project", "managedZone", "type", "pageToken", "name", "maxResults"].iter() { + for &field in ["project", "policy", "clientOperationId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4438,14 +5414,13 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -4457,7 +5432,556 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["managedZone", "project"].iter() { + for param_name in ["policy", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Identifies the project addressed by this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PolicyDeleteCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// User given friendly name of the policy addressed by this request. + /// + /// Sets the *policy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn policy(mut self, new_value: &str) -> PolicyDeleteCall<'a, C, A> { + self._policy = new_value.to_string(); + self + } + /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + /// + /// Sets the *client operation id* query property to the given value. + pub fn client_operation_id(mut self, new_value: &str) -> PolicyDeleteCall<'a, C, A> { + self._client_operation_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PolicyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PolicyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PolicyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Apply a partial update to an existing Policy. +/// +/// A builder for the *patch* method supported by a *policy* resource. +/// It is not used directly, but through a `PolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dns1 as dns1; +/// use dns1::Policy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dns1::Dns; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Policy::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.policies().patch(req, "project", "policy") +/// .client_operation_id("ea") +/// .doit(); +/// # } +/// ``` +pub struct PolicyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dns, + _request: Policy, + _project: String, + _policy: String, + _client_operation_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PolicyPatchCall<'a, C, A> {} + +impl<'a, C, A> PolicyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, PoliciesPatchResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dns.policies.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("policy", self._policy.to_string())); + if let Some(value) = self._client_operation_id { + params.push(("clientOperationId", value.to_string())); + } + for &field in ["alt", "project", "policy", "clientOperationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/policies/{policy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{policy}", "policy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["policy", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Policy) -> PolicyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifies the project addressed by this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PolicyPatchCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// User given friendly name of the policy addressed by this request. + /// + /// Sets the *policy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn policy(mut self, new_value: &str) -> PolicyPatchCall<'a, C, A> { + self._policy = new_value.to_string(); + self + } + /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + /// + /// Sets the *client operation id* query property to the given value. + pub fn client_operation_id(mut self, new_value: &str) -> PolicyPatchCall<'a, C, A> { + self._client_operation_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PolicyPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PolicyPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PolicyPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Fetch the representation of an existing Policy. +/// +/// A builder for the *get* method supported by a *policy* resource. +/// It is not used directly, but through a `PolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dns1 as dns1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dns1::Dns; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.policies().get("project", "policy") +/// .client_operation_id("dolor") +/// .doit(); +/// # } +/// ``` +pub struct PolicyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dns, + _project: String, + _policy: String, + _client_operation_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PolicyGetCall<'a, C, A> {} + +impl<'a, C, A> PolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dns.policies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("policy", self._policy.to_string())); + if let Some(value) = self._client_operation_id { + params.push(("clientOperationId", value.to_string())); + } + for &field in ["alt", "project", "policy", "clientOperationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/policies/{policy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{policy}", "policy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["policy", "project"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -4546,46 +6070,25 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut ResourceRecordSetListCall<'a, C, A> { + pub fn project(mut self, new_value: &str) -> PolicyGetCall<'a, C, A> { self._project = new_value.to_string(); self } - /// Identifies the managed zone addressed by this request. Can be the managed zone name or id. + /// User given friendly name of the policy addressed by this request. /// - /// Sets the *managed zone* path property to the given value. + /// Sets the *policy* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn managed_zone(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { - self._managed_zone = new_value.to_string(); + pub fn policy(mut self, new_value: &str) -> PolicyGetCall<'a, C, A> { + self._policy = new_value.to_string(); self } - /// Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. /// - /// Sets the *type* query property to the given value. - pub fn type_(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { - self._type_ = Some(new_value.to_string()); - self - } - /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Restricts the list to return only records with this fully qualified domain name. - /// - /// Sets the *name* query property to the given value. - pub fn name(mut self, new_value: &str) -> ResourceRecordSetListCall<'a, C, A> { - self._name = Some(new_value.to_string()); - self - } - /// Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> ResourceRecordSetListCall<'a, C, A> { - self._max_results = Some(new_value); + /// Sets the *client operation id* query property to the given value. + pub fn client_operation_id(mut self, new_value: &str) -> PolicyGetCall<'a, C, A> { + self._client_operation_id = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -4594,7 +6097,7 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut ResourceRecordSetListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PolicyGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4615,7 +6118,7 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ResourceRecordSetListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> PolicyGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4635,7 +6138,566 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ResourceRecordSetListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> PolicyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Enumerate all Policies associated with a project. +/// +/// A builder for the *list* method supported by a *policy* resource. +/// It is not used directly, but through a `PolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dns1 as dns1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dns1::Dns; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.policies().list("project") +/// .page_token("et") +/// .max_results(-96) +/// .doit(); +/// # } +/// ``` +pub struct PolicyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dns, + _project: String, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PolicyListCall<'a, C, A> {} + +impl<'a, C, A> PolicyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, PoliciesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dns.policies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/policies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Identifies the project addressed by this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PolicyListCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> PolicyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> PolicyListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PolicyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PolicyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::NdevClouddnReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PolicyListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update an existing Policy. +/// +/// A builder for the *update* method supported by a *policy* resource. +/// It is not used directly, but through a `PolicyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_dns1 as dns1; +/// use dns1::Policy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use dns1::Dns; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Dns::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Policy::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.policies().update(req, "project", "policy") +/// .client_operation_id("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct PolicyUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dns, + _request: Policy, + _project: String, + _policy: String, + _client_operation_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PolicyUpdateCall<'a, C, A> {} + +impl<'a, C, A> PolicyUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, PoliciesUpdateResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dns.policies.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("policy", self._policy.to_string())); + if let Some(value) = self._client_operation_id { + params.push(("clientOperationId", value.to_string())); + } + for &field in ["alt", "project", "policy", "clientOperationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "{project}/policies/{policy}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{policy}", "policy")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["policy", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Policy) -> PolicyUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifies the project addressed by this request. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> PolicyUpdateCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// User given friendly name of the policy addressed by this request. + /// + /// Sets the *policy* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn policy(mut self, new_value: &str) -> PolicyUpdateCall<'a, C, A> { + self._policy = new_value.to_string(); + self + } + /// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + /// + /// Sets the *client operation id* query property to the given value. + pub fn client_operation_id(mut self, new_value: &str) -> PolicyUpdateCall<'a, C, A> { + self._client_operation_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PolicyUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PolicyUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PolicyUpdateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4681,7 +6743,7 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut ChangeCreateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().list("project", "managedZone") -/// .sort_order("consetetur") -/// .sort_by("ut") -/// .page_token("ea") -/// .max_results(-80) +/// .sort_order("rebum.") +/// .sort_by("consetetur") +/// .page_token("sadipscing") +/// .max_results(-76) /// .doit(); /// # } /// ``` @@ -5270,7 +7332,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().get("project", "managedZone", "changeId") -/// .client_operation_id("et") +/// .client_operation_id("dolore") /// .doit(); /// # } /// ``` @@ -5546,7 +7608,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().get("project") -/// .client_operation_id("amet.") +/// .client_operation_id("aliquyam") /// .doit(); /// # } /// ``` diff --git a/gen/doubleclickbidmanager1-cli/Cargo.toml b/gen/doubleclickbidmanager1-cli/Cargo.toml index 729ecfebde..4672e2bca0 100644 --- a/gen/doubleclickbidmanager1-cli/Cargo.toml +++ b/gen/doubleclickbidmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclickbidmanager1-cli" -version = "1.0.12+20190618" +version = "1.0.13+20200316" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-doubleclickbidmanager1] path = "../doubleclickbidmanager1" -version = "1.0.12+20190618" +version = "1.0.13+20200316" diff --git a/gen/doubleclickbidmanager1-cli/README.md b/gen/doubleclickbidmanager1-cli/README.md index 9635d7d89b..472b5e3471 100644 --- a/gen/doubleclickbidmanager1-cli/README.md +++ b/gen/doubleclickbidmanager1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *DoubleClick Bid Manager* API at revision *20190618*. The CLI is at version *1.0.12*. +This documentation was generated from the *DoubleClick Bid Manager* API at revision *20200316*. The CLI is at version *1.0.13*. ```bash doubleclickbidmanager1 [options] diff --git a/gen/doubleclickbidmanager1-cli/mkdocs.yml b/gen/doubleclickbidmanager1-cli/mkdocs.yml index d12fedac11..b594896c6d 100644 --- a/gen/doubleclickbidmanager1-cli/mkdocs.yml +++ b/gen/doubleclickbidmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: DoubleClick Bid Manager v1.0.12+20190618 +site_name: DoubleClick Bid Manager v1.0.13+20200316 site_url: http://byron.github.io/google-apis-rs/google-doubleclickbidmanager1-cli site_description: A complete library to interact with DoubleClick Bid Manager (protocol v1) diff --git a/gen/doubleclickbidmanager1-cli/src/main.rs b/gen/doubleclickbidmanager1-cli/src/main.rs index 0e31454a4b..56bdaedb89 100644 --- a/gen/doubleclickbidmanager1-cli/src/main.rs +++ b/gen/doubleclickbidmanager1-cli/src/main.rs @@ -1045,7 +1045,7 @@ fn main() { let mut app = App::new("doubleclickbidmanager1") .author("Sebastian Thiel ") - .version("1.0.12+20190618") + .version("1.0.13+20200316") .about("API for viewing and managing your reports in DoubleClick Bid Manager.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_doubleclickbidmanager1_cli") .arg(Arg::with_name("url") diff --git a/gen/doubleclickbidmanager1/Cargo.toml b/gen/doubleclickbidmanager1/Cargo.toml index 17864a8ca9..5083ae1e2e 100644 --- a/gen/doubleclickbidmanager1/Cargo.toml +++ b/gen/doubleclickbidmanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-doubleclickbidmanager1" -version = "1.0.12+20190618" +version = "1.0.13+20200316" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1" homepage = "https://developers.google.com/bid-manager/" -documentation = "https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618" +documentation = "https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316" license = "MIT" keywords = ["doubleclickbidmanage", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/doubleclickbidmanager1/README.md b/gen/doubleclickbidmanager1/README.md index 60951d65fd..f090f89a74 100644 --- a/gen/doubleclickbidmanager1/README.md +++ b/gen/doubleclickbidmanager1/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-doubleclickbidmanager1` library allows access to all features of the *Google DoubleClick Bid Manager* service. -This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.13+20200316*, where *20200316* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/bid-manager/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html) ... * lineitems - * [*downloadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.LineitemDownloadlineitemCall.html) and [*uploadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.LineitemUploadlineitemCall.html) -* [queries](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.Query.html) - * [*createquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.QueryCreatequeryCall.html), [*deletequery*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.QueryDeletequeryCall.html), [*getquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.QueryGetqueryCall.html), [*listqueries*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.QueryListqueryCall.html) and [*runquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.QueryRunqueryCall.html) -* [reports](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.Report.html) - * [*listreports*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.ReportListreportCall.html) + * [*downloadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.LineitemDownloadlineitemCall.html) and [*uploadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.LineitemUploadlineitemCall.html) +* [queries](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.Query.html) + * [*createquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.QueryCreatequeryCall.html), [*deletequery*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.QueryDeletequeryCall.html), [*getquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.QueryGetqueryCall.html), [*listqueries*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.QueryListqueryCall.html) and [*runquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.QueryRunqueryCall.html) +* [reports](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.Report.html) + * [*listreports*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.ReportListreportCall.html) * sdf - * [*download*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.SdfDownloadCall.html) + * [*download*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.SdfDownloadCall.html) @@ -29,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html)** +* **[Hub](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-doubleclickbidmanager1/1.0.12+20190618/google_doubleclickbidmanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-doubleclickbidmanager1/1.0.13+20200316/google_doubleclickbidmanager1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/doubleclickbidmanager1/src/lib.rs b/gen/doubleclickbidmanager1/src/lib.rs index 6b6b8f1202..4aba644757 100644 --- a/gen/doubleclickbidmanager1/src/lib.rs +++ b/gen/doubleclickbidmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.12+20190618*, where *20190618* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.13+20200316*, where *20200316* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/bid-manager/). @@ -324,7 +324,7 @@ impl<'a, C, A> DoubleClickBidManager DoubleClickBidManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/doubleclickbidmanager/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> DoubleClickBidManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -693,7 +693,7 @@ pub struct DownloadRequest { /// - "LINE_ITEM" #[serde(rename="fileTypes")] pub file_types: Option>, - /// SDF Version (column names, types, order) in which the entities will be returned. Default to 3.1. + /// SDF Version (column names, types, order) in which the entities will be returned. Default to 5. pub version: Option, /// Filter type used to filter entities to fetch. PARTNER_ID and INVENTORY_SOURCE_ID may only be used when downloading inventory sources. #[serde(rename="filterType")] diff --git a/gen/doubleclicksearch2-cli/Cargo.toml b/gen/doubleclicksearch2-cli/Cargo.toml index 3b9136d4fa..c48ce831a7 100644 --- a/gen/doubleclicksearch2-cli/Cargo.toml +++ b/gen/doubleclicksearch2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclicksearch2-cli" -version = "1.0.12+20190625" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with doubleclicksearch (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-doubleclicksearch2] path = "../doubleclicksearch2" -version = "1.0.12+20190625" +version = "1.0.13+20200331" diff --git a/gen/doubleclicksearch2-cli/README.md b/gen/doubleclicksearch2-cli/README.md index fe2a102c46..05df4e0b6d 100644 --- a/gen/doubleclicksearch2-cli/README.md +++ b/gen/doubleclicksearch2-cli/README.md @@ -25,14 +25,13 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *doubleclicksearch* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *doubleclicksearch* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash doubleclicksearch2 [options] conversion get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] update-availability (-r )... [-p ]... [-o ] reports diff --git a/gen/doubleclicksearch2-cli/mkdocs.yml b/gen/doubleclicksearch2-cli/mkdocs.yml index d5960d9a9e..9e81cfd11a 100644 --- a/gen/doubleclicksearch2-cli/mkdocs.yml +++ b/gen/doubleclicksearch2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: doubleclicksearch v1.0.12+20190625 +site_name: doubleclicksearch v1.0.13+20200331 site_url: http://byron.github.io/google-apis-rs/google-doubleclicksearch2-cli site_description: A complete library to interact with doubleclicksearch (protocol v2) @@ -11,7 +11,6 @@ pages: - ['index.md', 'Home'] - ['conversion_get.md', 'Conversion', 'Get'] - ['conversion_insert.md', 'Conversion', 'Insert'] -- ['conversion_patch.md', 'Conversion', 'Patch'] - ['conversion_update.md', 'Conversion', 'Update'] - ['conversion_update-availability.md', 'Conversion', 'Update Availability'] - ['reports_generate.md', 'Reports', 'Generate'] diff --git a/gen/doubleclicksearch2-cli/src/main.rs b/gen/doubleclicksearch2-cli/src/main.rs index fca4d8c73d..7d008a3c7f 100644 --- a/gen/doubleclicksearch2-cli/src/main.rs +++ b/gen/doubleclicksearch2-cli/src/main.rs @@ -200,95 +200,6 @@ impl<'n> Engine<'n> { } } - fn _conversion_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["kind"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::ConversionList = json::value::from_value(object).unwrap(); - let end_date: i32 = arg_from_str(&opt.value_of("end-date").unwrap_or(""), err, "", "integer"); - let row_count: i32 = arg_from_str(&opt.value_of("row-count").unwrap_or(""), err, "", "integer"); - let start_date: i32 = arg_from_str(&opt.value_of("start-date").unwrap_or(""), err, "", "integer"); - let start_row: u32 = arg_from_str(&opt.value_of("start-row").unwrap_or(""), err, "", "integer"); - let mut call = self.hub.conversion().patch(request, opt.value_of("advertiser-id").unwrap_or(""), opt.value_of("agency-id").unwrap_or(""), end_date, opt.value_of("engine-account-id").unwrap_or(""), row_count, start_date, start_row); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _conversion_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -841,9 +752,6 @@ impl<'n> Engine<'n> { ("insert", Some(opt)) => { call_result = self._conversion_insert(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._conversion_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._conversion_update(opt, dry_run, &mut err); }, @@ -969,7 +877,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("conversion", "methods: 'get', 'insert', 'patch', 'update' and 'update-availability'", vec![ + ("conversion", "methods: 'get', 'insert', 'update' and 'update-availability'", vec![ ("get", Some(r##"Retrieves a list of conversions from a DoubleClick Search engine account."##), "Details at http://byron.github.io/google-apis-rs/google_doubleclicksearch2_cli/conversion_get", @@ -1044,70 +952,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates a batch of conversions in DoubleClick Search. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_doubleclicksearch2_cli/conversion_patch", - vec![ - (Some(r##"advertiser-id"##), - None, - Some(r##"Numeric ID of the advertiser."##), - Some(true), - Some(false)), - - (Some(r##"agency-id"##), - None, - Some(r##"Numeric ID of the agency."##), - Some(true), - Some(false)), - - (Some(r##"end-date"##), - None, - Some(r##"Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd."##), - Some(true), - Some(false)), - - (Some(r##"engine-account-id"##), - None, - Some(r##"Numeric ID of the engine account."##), - Some(true), - Some(false)), - - (Some(r##"row-count"##), - None, - Some(r##"The number of conversions to return per call."##), - Some(true), - Some(false)), - - (Some(r##"start-date"##), - None, - Some(r##"First date (inclusive) on which to retrieve conversions. Format is yyyymmdd."##), - Some(true), - Some(false)), - - (Some(r##"start-row"##), - None, - Some(r##"The 0-based starting index for retrieving conversions results."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1292,7 +1136,7 @@ fn main() { let mut app = App::new("doubleclicksearch2") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200331") .about("Reports and modifies your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions).") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_doubleclicksearch2_cli") .arg(Arg::with_name("url") diff --git a/gen/doubleclicksearch2/Cargo.toml b/gen/doubleclicksearch2/Cargo.toml index d32cd2627a..e7a433a5b3 100644 --- a/gen/doubleclicksearch2/Cargo.toml +++ b/gen/doubleclicksearch2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-doubleclicksearch2" -version = "1.0.12+20190625" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with doubleclicksearch (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclicksearch2" homepage = "https://developers.google.com/doubleclick-search/" -documentation = "https://docs.rs/google-doubleclicksearch2/1.0.12+20190625" +documentation = "https://docs.rs/google-doubleclicksearch2/1.0.13+20200331" license = "MIT" keywords = ["doubleclicksearch", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/doubleclicksearch2/README.md b/gen/doubleclicksearch2/README.md index 9da13850a9..e9c99de4a6 100644 --- a/gen/doubleclicksearch2/README.md +++ b/gen/doubleclicksearch2/README.md @@ -5,25 +5,25 @@ DO NOT EDIT ! --> The `google-doubleclicksearch2` library allows access to all features of the *Google doubleclicksearch* service. -This documentation was generated from *doubleclicksearch* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *doubleclicksearch* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *doubleclicksearch* *v2* API can be found at the [official documentation site](https://developers.google.com/doubleclick-search/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.Doubleclicksearch.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.Doubleclicksearch.html) ... -* [conversion](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.Conversion.html) - * [*get*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ConversionGetCall.html), [*insert*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ConversionInsertCall.html), [*patch*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ConversionPatchCall.html), [*update*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ConversionUpdateCall.html) and [*update availability*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ConversionUpdateAvailabilityCall.html) -* [reports](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.Report.html) - * [*generate*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ReportGenerateCall.html), [*get*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ReportGetCall.html), [*get file*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ReportGetFileCall.html) and [*request*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ReportRequestCall.html) -* [saved columns](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.SavedColumn.html) - * [*list*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.SavedColumnListCall.html) +* [conversion](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.Conversion.html) + * [*get*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ConversionGetCall.html), [*insert*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ConversionInsertCall.html), [*update*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ConversionUpdateCall.html) and [*update availability*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ConversionUpdateAvailabilityCall.html) +* [reports](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.Report.html) + * [*generate*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ReportGenerateCall.html), [*get*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ReportGetCall.html), [*get file*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ReportGetFileCall.html) and [*request*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ReportRequestCall.html) +* [saved columns](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.SavedColumn.html) + * [*list*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.SavedColumnListCall.html) Download supported by ... -* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.ReportGetFileCall.html) +* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.ReportGetFileCall.html) @@ -31,17 +31,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/struct.Doubleclicksearch.html)** +* **[Hub](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/struct.Doubleclicksearch.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.Part.html)** + * **[Parts](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-doubleclicksearch2/1.0.12+20190625/google_doubleclicksearch2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-doubleclicksearch2/1.0.13+20200331/google_doubleclicksearch2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/doubleclicksearch2/src/lib.rs b/gen/doubleclicksearch2/src/lib.rs index e7f1e3cde9..003cbf6e2a 100644 --- a/gen/doubleclicksearch2/src/lib.rs +++ b/gen/doubleclicksearch2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *doubleclicksearch* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *doubleclicksearch* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *doubleclicksearch* *v2* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-search/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Doubleclicksearch.html) ... //! //! * [conversion](struct.Conversion.html) -//! * [*get*](struct.ConversionGetCall.html), [*insert*](struct.ConversionInsertCall.html), [*patch*](struct.ConversionPatchCall.html), [*update*](struct.ConversionUpdateCall.html) and [*update availability*](struct.ConversionUpdateAvailabilityCall.html) +//! * [*get*](struct.ConversionGetCall.html), [*insert*](struct.ConversionInsertCall.html), [*update*](struct.ConversionUpdateCall.html) and [*update availability*](struct.ConversionUpdateAvailabilityCall.html) //! * [reports](struct.Report.html) //! * [*generate*](struct.ReportGenerateCall.html), [*get*](struct.ReportGetCall.html), [*get file*](struct.ReportGetFileCall.html) and [*request*](struct.ReportRequestCall.html) //! * [saved columns](struct.SavedColumn.html) @@ -328,7 +328,7 @@ impl<'a, C, A> Doubleclicksearch Doubleclicksearch { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/doubleclicksearch/v2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -345,7 +345,7 @@ impl<'a, C, A> Doubleclicksearch } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -524,7 +524,7 @@ pub struct ReportRow(Option>); impl Part for ReportRow {} -/// Asynchronous report only. Contains a list of generated report files once the report has succesfully completed. +/// Asynchronous report only. Contains a list of generated report files once the report has successfully completed. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -759,7 +759,7 @@ impl RequestValue for ReportRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Report { - /// Asynchronous report only. Contains a list of generated report files once the report has succesfully completed. + /// Asynchronous report only. Contains a list of generated report files once the report has successfully completed. pub files: Option>, /// Identifies this as a Report resource. Value: the fixed string doubleclicksearch#report. pub kind: Option, @@ -900,7 +900,6 @@ impl ResponseResult for UpdateAvailabilityResponse {} /// /// * [insert conversion](struct.ConversionInsertCall.html) (request|response) /// * [get conversion](struct.ConversionGetCall.html) (response) -/// * [patch conversion](struct.ConversionPatchCall.html) (request|response) /// * [update conversion](struct.ConversionUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -944,7 +943,7 @@ impl ResponseResult for ConversionList {} /// ::default(), None); /// let mut hub = Doubleclicksearch::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)`, `insert(...)`, `patch(...)`, `update(...)` and `update_availability(...)` +/// // like `get(...)`, `insert(...)`, `update(...)` and `update_availability(...)` /// // to build up your call. /// let rb = hub.conversion(); /// # } @@ -1026,37 +1025,6 @@ impl<'a, C, A> ConversionMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates a batch of conversions in DoubleClick Search. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `advertiserId` - Numeric ID of the advertiser. - /// * `agencyId` - Numeric ID of the agency. - /// * `endDate` - Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - /// * `engineAccountId` - Numeric ID of the engine account. - /// * `rowCount` - The number of conversions to return per call. - /// * `startDate` - First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - /// * `startRow` - The 0-based starting index for retrieving conversions results. - pub fn patch(&self, request: ConversionList, advertiser_id: &str, agency_id: &str, end_date: i32, engine_account_id: &str, row_count: i32, start_date: i32, start_row: u32) -> ConversionPatchCall<'a, C, A> { - ConversionPatchCall { - hub: self.hub, - _request: request, - _advertiser_id: advertiser_id.to_string(), - _agency_id: agency_id.to_string(), - _end_date: end_date, - _engine_account_id: engine_account_id.to_string(), - _row_count: row_count, - _start_date: start_date, - _start_row: start_row, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates a batch of conversions in DoubleClick Search. @@ -2092,328 +2060,6 @@ impl<'a, C, A> ConversionUpdateAvailabilityCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Doubleclicksearch::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ConversionList::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.conversion().patch(req, "advertiserId", "agencyId", -66, "engineAccountId", -21, -21, 67) -/// .doit(); -/// # } -/// ``` -pub struct ConversionPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Doubleclicksearch, - _request: ConversionList, - _advertiser_id: String, - _agency_id: String, - _end_date: i32, - _engine_account_id: String, - _row_count: i32, - _start_date: i32, - _start_row: u32, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ConversionPatchCall<'a, C, A> {} - -impl<'a, C, A> ConversionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ConversionList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "doubleclicksearch.conversion.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); - params.push(("advertiserId", self._advertiser_id.to_string())); - params.push(("agencyId", self._agency_id.to_string())); - params.push(("endDate", self._end_date.to_string())); - params.push(("engineAccountId", self._engine_account_id.to_string())); - params.push(("rowCount", self._row_count.to_string())); - params.push(("startDate", self._start_date.to_string())); - params.push(("startRow", self._start_row.to_string())); - for &field in ["alt", "advertiserId", "agencyId", "endDate", "engineAccountId", "rowCount", "startDate", "startRow"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "conversion"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ConversionList) -> ConversionPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Numeric ID of the advertiser. - /// - /// Sets the *advertiser id* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn advertiser_id(mut self, new_value: &str) -> ConversionPatchCall<'a, C, A> { - self._advertiser_id = new_value.to_string(); - self - } - /// Numeric ID of the agency. - /// - /// Sets the *agency id* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn agency_id(mut self, new_value: &str) -> ConversionPatchCall<'a, C, A> { - self._agency_id = new_value.to_string(); - self - } - /// Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - /// - /// Sets the *end date* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn end_date(mut self, new_value: i32) -> ConversionPatchCall<'a, C, A> { - self._end_date = new_value; - self - } - /// Numeric ID of the engine account. - /// - /// Sets the *engine account id* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn engine_account_id(mut self, new_value: &str) -> ConversionPatchCall<'a, C, A> { - self._engine_account_id = new_value.to_string(); - self - } - /// The number of conversions to return per call. - /// - /// Sets the *row count* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn row_count(mut self, new_value: i32) -> ConversionPatchCall<'a, C, A> { - self._row_count = new_value; - self - } - /// First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - /// - /// Sets the *start date* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn start_date(mut self, new_value: i32) -> ConversionPatchCall<'a, C, A> { - self._start_date = new_value; - self - } - /// The 0-based starting index for retrieving conversions results. - /// - /// Sets the *start row* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn start_row(mut self, new_value: u32) -> ConversionPatchCall<'a, C, A> { - self._start_row = new_value; - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ConversionPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ConversionPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ConversionPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates a batch of conversions in DoubleClick Search. /// /// A builder for the *update* method supported by a *conversion* resource. @@ -2934,7 +2580,7 @@ impl<'a, C, A> SavedColumnListCall<'a, C, A> where C: BorrowMut, /// // 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.reports().get_file("reportId", -5) +/// let result = hub.reports().get_file("reportId", -61) /// .doit(); /// # } /// ``` diff --git a/gen/drive2-cli/Cargo.toml b/gen/drive2-cli/Cargo.toml index 45405051e0..29d2ac5de7 100644 --- a/gen/drive2-cli/Cargo.toml +++ b/gen/drive2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive2-cli" -version = "1.0.12+20190620" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-drive2] path = "../drive2" -version = "1.0.12+20190620" +version = "1.0.13+20200326" diff --git a/gen/drive2-cli/README.md b/gen/drive2-cli/README.md index 3b33066a08..cbd0200959 100644 --- a/gen/drive2-cli/README.md +++ b/gen/drive2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *drive* API at revision *20190620*. The CLI is at version *1.0.12*. +This documentation was generated from the *drive* API at revision *20200326*. The CLI is at version *1.0.13*. ```bash drive2 [options] @@ -96,9 +96,6 @@ drive2 [options] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] - realtime - get [-p ]... [-o ] - update (-u (simple|resumable) -f [-m ]) [-p ]... replies delete [-p ]... get [-p ]... [-o ] diff --git a/gen/drive2-cli/mkdocs.yml b/gen/drive2-cli/mkdocs.yml index c0821dda16..5ef12a815e 100644 --- a/gen/drive2-cli/mkdocs.yml +++ b/gen/drive2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.12+20190620 +site_name: drive v1.0.13+20200326 site_url: http://byron.github.io/google-apis-rs/google-drive2-cli site_description: A complete library to interact with drive (protocol v2) @@ -65,8 +65,6 @@ pages: - ['properties_list.md', 'Properties', 'List'] - ['properties_patch.md', 'Properties', 'Patch'] - ['properties_update.md', 'Properties', 'Update'] -- ['realtime_get.md', 'Realtime', 'Get'] -- ['realtime_update.md', 'Realtime', 'Update'] - ['replies_delete.md', 'Replies', 'Delete'] - ['replies_get.md', 'Replies', 'Get'] - ['replies_insert.md', 'Replies', 'Insert'] diff --git a/gen/drive2-cli/src/main.rs b/gen/drive2-cli/src/main.rs index 2959886216..dcbca31815 100644 --- a/gen/drive2-cli/src/main.rs +++ b/gen/drive2-cli/src/main.rs @@ -670,6 +670,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -683,6 +686,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["enforce-single-parent"].iter().map(|v|*v)); v } )); } } @@ -808,6 +812,9 @@ impl<'n> Engine<'n> { "supports-all-drives" => { call = call.supports_all_drives(arg_from_str(value.unwrap_or("false"), err, "supports-all-drives", "boolean")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -821,7 +828,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["supports-team-drives", "supports-all-drives"].iter().map(|v|*v)); + v.extend(["enforce-single-parent", "supports-team-drives", "supports-all-drives"].iter().map(|v|*v)); v } )); } } @@ -1954,12 +1961,8 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-id" => Some(("shortcutDetails.targetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-mime-type" => Some(("shortcutDetails.targetMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "download-url" => Some(("downloadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1981,11 +1984,13 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-within-team-drive" => Some(("capabilities.canMoveChildrenWithinTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-modify-content" => Some(("capabilities.canModifyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-drive" => Some(("capabilities.canReadDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash-children" => Some(("capabilities.canTrashChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-my-drive-parent" => Some(("capabilities.canAddMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-within-drive" => Some(("capabilities.canMoveChildrenWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-item-within-drive" => Some(("capabilities.canMoveItemWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1995,6 +2000,7 @@ impl<'n> Engine<'n> { "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-out-of-drive" => Some(("capabilities.canMoveChildrenOutOfDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-my-drive-parent" => Some(("capabilities.canRemoveMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2042,6 +2048,12 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2082,7 +2094,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-add-my-drive-parent", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-modify-content", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-remove-my-drive-parent", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "shortcut-details", "spaces", "starred", "subject-distance", "target-id", "target-mime-type", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2120,6 +2132,9 @@ impl<'n> Engine<'n> { "ocr" => { call = call.ocr(arg_from_str(value.unwrap_or("false"), err, "ocr", "boolean")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, "convert" => { call = call.convert(arg_from_str(value.unwrap_or("false"), err, "convert", "boolean")); }, @@ -2136,7 +2151,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["convert", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "visibility", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["enforce-single-parent", "convert", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "visibility", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -2509,12 +2524,8 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-id" => Some(("shortcutDetails.targetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-mime-type" => Some(("shortcutDetails.targetMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "download-url" => Some(("downloadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2536,11 +2547,13 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-within-team-drive" => Some(("capabilities.canMoveChildrenWithinTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-modify-content" => Some(("capabilities.canModifyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-drive" => Some(("capabilities.canReadDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash-children" => Some(("capabilities.canTrashChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-my-drive-parent" => Some(("capabilities.canAddMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-within-drive" => Some(("capabilities.canMoveChildrenWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-item-within-drive" => Some(("capabilities.canMoveItemWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2550,6 +2563,7 @@ impl<'n> Engine<'n> { "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-out-of-drive" => Some(("capabilities.canMoveChildrenOutOfDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-my-drive-parent" => Some(("capabilities.canRemoveMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2597,6 +2611,12 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2637,7 +2657,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-add-my-drive-parent", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-modify-content", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-remove-my-drive-parent", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "shortcut-details", "spaces", "starred", "subject-distance", "target-id", "target-mime-type", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2678,6 +2698,9 @@ impl<'n> Engine<'n> { "ocr" => { call = call.ocr(arg_from_str(value.unwrap_or("false"), err, "ocr", "boolean")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, "convert" => { call = call.convert(arg_from_str(value.unwrap_or("false"), err, "convert", "boolean")); }, @@ -2694,7 +2717,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["convert", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "visibility", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["enforce-single-parent", "convert", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "visibility", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -2875,12 +2898,8 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-id" => Some(("shortcutDetails.targetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-mime-type" => Some(("shortcutDetails.targetMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "download-url" => Some(("downloadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2902,11 +2921,13 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-within-team-drive" => Some(("capabilities.canMoveChildrenWithinTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-modify-content" => Some(("capabilities.canModifyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-drive" => Some(("capabilities.canReadDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash-children" => Some(("capabilities.canTrashChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-my-drive-parent" => Some(("capabilities.canAddMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-within-drive" => Some(("capabilities.canMoveChildrenWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-item-within-drive" => Some(("capabilities.canMoveItemWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2916,6 +2937,7 @@ impl<'n> Engine<'n> { "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-out-of-drive" => Some(("capabilities.canMoveChildrenOutOfDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-my-drive-parent" => Some(("capabilities.canRemoveMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2963,6 +2985,12 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3003,7 +3031,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-add-my-drive-parent", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-modify-content", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-remove-my-drive-parent", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "shortcut-details", "spaces", "starred", "subject-distance", "target-id", "target-mime-type", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3056,6 +3084,9 @@ impl<'n> Engine<'n> { "modified-date-behavior" => { call = call.modified_date_behavior(value.unwrap_or("")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, "convert" => { call = call.convert(arg_from_str(value.unwrap_or("false"), err, "convert", "boolean")); }, @@ -3075,7 +3106,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["add-parents", "new-revision", "ocr", "remove-parents", "convert", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "set-modified-date", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["add-parents", "enforce-single-parent", "new-revision", "ocr", "remove-parents", "convert", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "set-modified-date", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -3334,12 +3365,8 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-id" => Some(("shortcutDetails.targetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-mime-type" => Some(("shortcutDetails.targetMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "download-url" => Some(("downloadUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3361,11 +3388,13 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-within-team-drive" => Some(("capabilities.canMoveChildrenWithinTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-modify-content" => Some(("capabilities.canModifyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-drive" => Some(("capabilities.canReadDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash-children" => Some(("capabilities.canTrashChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-my-drive-parent" => Some(("capabilities.canAddMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-within-drive" => Some(("capabilities.canMoveChildrenWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-item-within-drive" => Some(("capabilities.canMoveItemWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -3375,6 +3404,7 @@ impl<'n> Engine<'n> { "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-out-of-drive" => Some(("capabilities.canMoveChildrenOutOfDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-my-drive-parent" => Some(("capabilities.canRemoveMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -3422,6 +3452,12 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3462,7 +3498,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-add-my-drive-parent", "can-change-copy-requires-writer-permission", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-modify-content", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-remove-my-drive-parent", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "copy-requires-writer-permission", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "drive-id", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "permission-ids", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "shortcut-details", "spaces", "starred", "subject-distance", "target-id", "target-mime-type", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3515,6 +3551,9 @@ impl<'n> Engine<'n> { "modified-date-behavior" => { call = call.modified_date_behavior(value.unwrap_or("")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, "convert" => { call = call.convert(arg_from_str(value.unwrap_or("false"), err, "convert", "boolean")); }, @@ -3534,7 +3573,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["add-parents", "new-revision", "ocr", "remove-parents", "convert", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "set-modified-date", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["add-parents", "enforce-single-parent", "new-revision", "ocr", "remove-parents", "convert", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "pinned", "set-modified-date", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -3700,6 +3739,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3713,6 +3755,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["enforce-single-parent"].iter().map(|v|*v)); v } )); } } @@ -3839,6 +3882,9 @@ impl<'n> Engine<'n> { "supports-all-drives" => { call = call.supports_all_drives(arg_from_str(value.unwrap_or("false"), err, "supports-all-drives", "boolean")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3852,7 +3898,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["supports-team-drives", "supports-all-drives"].iter().map(|v|*v)); + v.extend(["enforce-single-parent", "supports-team-drives", "supports-all-drives"].iter().map(|v|*v)); v } )); } } @@ -4172,6 +4218,12 @@ impl<'n> Engine<'n> { "send-notification-emails" => { call = call.send_notification_emails(arg_from_str(value.unwrap_or("false"), err, "send-notification-emails", "boolean")); }, + "move-to-new-owners-root" => { + call = call.move_to_new_owners_root(arg_from_str(value.unwrap_or("false"), err, "move-to-new-owners-root", "boolean")); + }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, "email-message" => { call = call.email_message(value.unwrap_or("")); }, @@ -4188,7 +4240,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["email-message", "send-notification-emails", "use-domain-admin-access", "supports-team-drives", "supports-all-drives"].iter().map(|v|*v)); + v.extend(["move-to-new-owners-root", "enforce-single-parent", "supports-team-drives", "supports-all-drives", "send-notification-emails", "use-domain-admin-access", "email-message"].iter().map(|v|*v)); v } )); } } @@ -4956,119 +5008,6 @@ impl<'n> Engine<'n> { } } - fn _realtime_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut download_mode = false; - let mut call = self.hub.realtime().get(opt.value_of("file-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "revision" => { - call = call.revision(arg_from_str(value.unwrap_or("-0"), err, "revision", "integer")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - if key == "alt" && value.unwrap_or("unset") == "media" { - download_mode = true; - } - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["revision"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - if !download_mode { - } else { - io::copy(&mut response, &mut ostream).unwrap(); - ostream.flush().unwrap(); - } - Ok(()) - } - } - } - } - - fn _realtime_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.realtime().update(opt.value_of("file-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "base-revision" => { - call = call.base_revision(value.unwrap_or("")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["base-revision"].iter().map(|v|*v)); - v } )); - } - } - } - } - let vals = opt.values_of("mode").unwrap().collect::>(); - let protocol = calltype_from_str(vals[0], ["simple", "resumable"].iter().map(|&v| v.to_string()).collect(), err); - let mut input_file = input_file_from_opts(vals[1], err); - let mime_type = input_mime_from_opts(opt.value_of("mime").unwrap_or("application/octet-stream"), err); - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - match match protocol { - CallType::Upload(UploadProtocol::Simple) => call.upload(input_file.unwrap(), mime_type.unwrap()), - CallType::Upload(UploadProtocol::Resumable) => call.upload_resumable(input_file.unwrap(), mime_type.unwrap()), - CallType::Standard => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - Ok(()) - } - } - } - } - fn _replies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.replies().delete(opt.value_of("file-id").unwrap_or(""), opt.value_of("comment-id").unwrap_or(""), opt.value_of("reply-id").unwrap_or("")); @@ -6560,20 +6499,6 @@ impl<'n> Engine<'n> { } } }, - ("realtime", Some(opt)) => { - match opt.subcommand() { - ("get", Some(opt)) => { - call_result = self._realtime_get(opt, dry_run, &mut err); - }, - ("update", Some(opt)) => { - call_result = self._realtime_update(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("realtime".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("replies", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -7092,7 +7017,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates an existing comment. This method supports patch semantics."##), + Some(r##"Updates an existing comment."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/comments_patch", vec![ (Some(r##"file-id"##), @@ -8108,53 +8033,6 @@ fn main() { ]), ]), - ("realtime", "methods: 'get' and 'update'", vec![ - ("get", - Some(r##"Exports the contents of the Realtime API data model associated with this file as JSON."##), - "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/realtime_get", - vec![ - (Some(r##"file-id"##), - None, - Some(r##"The ID of the file that the Realtime API data model is associated with."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("update", - Some(r##"Overwrites the Realtime API data model associated with this file with the provided JSON data model."##), - "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/realtime_update", - vec![ - (Some(r##"file-id"##), - None, - Some(r##"The ID of the file that the Realtime API data model is associated with."##), - Some(true), - Some(false)), - - (Some(r##"mode"##), - Some(r##"u"##), - Some(r##"Specify the upload protocol (simple|resumable) and the file to upload"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ]), - ("replies", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", Some(r##"Deletes a reply."##), @@ -8281,7 +8159,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates an existing reply. This method supports patch semantics."##), + Some(r##"Updates an existing reply."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/replies_patch", vec![ (Some(r##"file-id"##), @@ -8436,7 +8314,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a revision. This method supports patch semantics."##), + Some(r##"Updates a revision."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/revisions_patch", vec![ (Some(r##"file-id"##), @@ -8622,7 +8500,7 @@ fn main() { let mut app = App::new("drive2") .author("Sebastian Thiel ") - .version("1.0.12+20190620") + .version("1.0.13+20200326") .about("Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_drive2_cli") .arg(Arg::with_name("url") diff --git a/gen/drive2/Cargo.toml b/gen/drive2/Cargo.toml index 66014792f3..bc04e0e1aa 100644 --- a/gen/drive2/Cargo.toml +++ b/gen/drive2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive2" -version = "1.0.12+20190620" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive2" homepage = "https://developers.google.com/drive/" -documentation = "https://docs.rs/google-drive2/1.0.12+20190620" +documentation = "https://docs.rs/google-drive2/1.0.13+20200326" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/drive2/README.md b/gen/drive2/README.md index 39bf4a5fda..19a26a36f9 100644 --- a/gen/drive2/README.md +++ b/gen/drive2/README.md @@ -5,66 +5,62 @@ DO NOT EDIT ! --> The `google-drive2` library allows access to all features of the *Google drive* service. -This documentation was generated from *drive* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *drive* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *drive* *v2* API can be found at the [official documentation site](https://developers.google.com/drive/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveHub.html) ... -* [about](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.About.html) - * [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.AboutGetCall.html) -* [apps](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.App.html) - * [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.AppGetCall.html) and [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.AppListCall.html) -* [changes](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.Change.html) - * [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChangeGetCall.html), [*get start page token*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChangeWatchCall.html) -* [channels](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.Channel.html) - * [*stop*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChannelStopCall.html) +* [about](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.About.html) + * [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.AboutGetCall.html) +* [apps](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.App.html) + * [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.AppGetCall.html) and [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.AppListCall.html) +* [changes](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.Change.html) + * [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChangeGetCall.html), [*get start page token*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChannelStopCall.html) * children - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChildrenDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChildrenGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChildrenInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChildrenListCall.html) -* [comments](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.Comment.html) - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.CommentListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.CommentPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.CommentUpdateCall.html) -* [drives](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.Drive.html) - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveGetCall.html), [*hide*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveHideCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveListCall.html), [*unhide*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveUnhideCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveUpdateCall.html) -* [files](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.File.html) - * [*copy*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileCopyCall.html), [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FilePatchCall.html), [*touch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileTouchCall.html), [*trash*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileTrashCall.html), [*untrash*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileUntrashCall.html), [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileWatchCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChildrenDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChildrenGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChildrenInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChildrenListCall.html) +* [comments](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.Comment.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.CommentListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.CommentPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.CommentUpdateCall.html) +* [drives](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.Drive.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveGetCall.html), [*hide*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveHideCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveListCall.html), [*unhide*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveUnhideCall.html) and [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveUpdateCall.html) +* [files](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.File.html) + * [*copy*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileCopyCall.html), [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FilePatchCall.html), [*touch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileTouchCall.html), [*trash*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileTrashCall.html), [*untrash*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileUntrashCall.html), [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileWatchCall.html) * parents - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ParentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ParentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ParentInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ParentListCall.html) -* [permissions](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.Permission.html) - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PermissionGetCall.html), [*get id for email*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PermissionGetIdForEmailCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PermissionInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PermissionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PermissionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PermissionUpdateCall.html) -* [properties](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.Property.html) - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PropertyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PropertyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PropertyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PropertyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PropertyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.PropertyUpdateCall.html) -* realtime - * [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RealtimeGetCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RealtimeUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ParentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ParentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ParentInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ParentListCall.html) +* [permissions](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.Permission.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PermissionGetCall.html), [*get id for email*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PermissionGetIdForEmailCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PermissionInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PermissionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PermissionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PermissionUpdateCall.html) +* [properties](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.Property.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PropertyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PropertyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PropertyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PropertyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PropertyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.PropertyUpdateCall.html) * replies - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ReplyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ReplyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ReplyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ReplyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ReplyUpdateCall.html) -* [revisions](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.Revision.html) - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RevisionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RevisionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RevisionUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ReplyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ReplyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ReplyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ReplyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.RevisionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.RevisionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.RevisionUpdateCall.html) * teamdrives - * [*delete*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.TeamdriveGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.TeamdriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.TeamdriveUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.TeamdriveGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.TeamdriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*update files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileUpdateCall.html) -* [*insert files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileInsertCall.html) -* [*update realtime*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RealtimeUpdateCall.html) +* [*update files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileUpdateCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileInsertCall.html) Download supported by ... -* [*watch files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileWatchCall.html) -* [*get realtime*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.RealtimeGetCall.html) -* [*get files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileGetCall.html) -* [*export files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileExportCall.html) +* [*watch files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileWatchCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileGetCall.html) +* [*export files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileExportCall.html) Subscription supported by ... -* [*watch files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileWatchCall.html) -* [*insert files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileInsertCall.html) -* [*get files*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.FileGetCall.html) -* [*watch changes*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChangeWatchCall.html) -* [*list changes*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.ChangeListCall.html) +* [*watch files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileWatchCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileInsertCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.FileGetCall.html) +* [*watch changes*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChangeWatchCall.html) +* [*list changes*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.ChangeListCall.html) @@ -72,17 +68,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/struct.DriveHub.html)** +* **[Hub](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/struct.DriveHub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -183,8 +179,9 @@ let result = hub.files().patch(req, "fileId") .ocr(false) .new_revision(true) .modified_date_behavior("sea") - .convert(false) - .add_parents("dolores") + .enforce_single_parent(false) + .convert(true) + .add_parents("gubergren") .doit(); match result { @@ -207,17 +204,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -227,29 +224,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-drive2/1.0.12+20190620/google_drive2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive2/1.0.13+20200326/google_drive2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/drive2/src/lib.rs b/gen/drive2/src/lib.rs index 9ae4130a5a..c11cdbcd9f 100644 --- a/gen/drive2/src/lib.rs +++ b/gen/drive2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *drive* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *drive* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *drive* *v2* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -33,8 +33,6 @@ //! * [*delete*](struct.PermissionDeleteCall.html), [*get*](struct.PermissionGetCall.html), [*get id for email*](struct.PermissionGetIdForEmailCall.html), [*insert*](struct.PermissionInsertCall.html), [*list*](struct.PermissionListCall.html), [*patch*](struct.PermissionPatchCall.html) and [*update*](struct.PermissionUpdateCall.html) //! * [properties](struct.Property.html) //! * [*delete*](struct.PropertyDeleteCall.html), [*get*](struct.PropertyGetCall.html), [*insert*](struct.PropertyInsertCall.html), [*list*](struct.PropertyListCall.html), [*patch*](struct.PropertyPatchCall.html) and [*update*](struct.PropertyUpdateCall.html) -//! * realtime -//! * [*get*](struct.RealtimeGetCall.html) and [*update*](struct.RealtimeUpdateCall.html) //! * replies //! * [*delete*](struct.ReplyDeleteCall.html), [*get*](struct.ReplyGetCall.html), [*insert*](struct.ReplyInsertCall.html), [*list*](struct.ReplyListCall.html), [*patch*](struct.ReplyPatchCall.html) and [*update*](struct.ReplyUpdateCall.html) //! * [revisions](struct.Revision.html) @@ -47,12 +45,10 @@ //! //! * [*update files*](struct.FileUpdateCall.html) //! * [*insert files*](struct.FileInsertCall.html) -//! * [*update realtime*](struct.RealtimeUpdateCall.html) //! //! Download supported by ... //! //! * [*watch files*](struct.FileWatchCall.html) -//! * [*get realtime*](struct.RealtimeGetCall.html) //! * [*get files*](struct.FileGetCall.html) //! * [*export files*](struct.FileExportCall.html) //! @@ -171,21 +167,22 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.files().patch(req, "fileId") -//! .use_content_as_indexable_text(false) -//! .update_viewed_date(true) -//! .timed_text_track_name("ea") -//! .timed_text_language("no") +//! .use_content_as_indexable_text(true) +//! .update_viewed_date(false) +//! .timed_text_track_name("no") +//! .timed_text_language("justo") //! .supports_team_drives(true) //! .supports_all_drives(true) //! .set_modified_date(true) -//! .remove_parents("et") -//! .pinned(true) -//! .ocr_language("ipsum") +//! .remove_parents("diam") +//! .pinned(false) +//! .ocr_language("Lorem") //! .ocr(true) -//! .new_revision(true) -//! .modified_date_behavior("duo") -//! .convert(true) -//! .add_parents("sea") +//! .new_revision(false) +//! .modified_date_behavior("aliquyam") +//! .enforce_single_parent(true) +//! .convert(false) +//! .add_parents("eos") //! .doit(); //! //! match result { @@ -402,20 +399,21 @@ impl Default for Scope { /// // Values shown here are possibly random and not representative ! /// let result = hub.files().patch(req, "fileId") /// .use_content_as_indexable_text(false) -/// .update_viewed_date(false) -/// .timed_text_track_name("sadipscing") -/// .timed_text_language("dolor") -/// .supports_team_drives(true) -/// .supports_all_drives(true) -/// .set_modified_date(false) -/// .remove_parents("no") +/// .update_viewed_date(true) +/// .timed_text_track_name("eirmod") +/// .timed_text_language("elitr") +/// .supports_team_drives(false) +/// .supports_all_drives(false) +/// .set_modified_date(true) +/// .remove_parents("eirmod") /// .pinned(true) -/// .ocr_language("eirmod") -/// .ocr(true) -/// .new_revision(true) -/// .modified_date_behavior("aliquyam") -/// .convert(false) -/// .add_parents("Lorem") +/// .ocr_language("invidunt") +/// .ocr(false) +/// .new_revision(false) +/// .modified_date_behavior("Lorem") +/// .enforce_single_parent(true) +/// .convert(true) +/// .add_parents("duo") /// .doit(); /// /// match result { @@ -453,7 +451,7 @@ impl<'a, C, A> DriveHub DriveHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/drive/v2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -492,9 +490,6 @@ impl<'a, C, A> DriveHub pub fn properties(&'a self) -> PropertyMethods<'a, C, A> { PropertyMethods { hub: &self } } - pub fn realtime(&'a self) -> RealtimeMethods<'a, C, A> { - RealtimeMethods { hub: &self } - } pub fn replies(&'a self) -> ReplyMethods<'a, C, A> { ReplyMethods { hub: &self } } @@ -506,7 +501,7 @@ impl<'a, C, A> DriveHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -778,7 +773,7 @@ pub struct PermissionPermissionDetails { /// Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. #[serde(rename="additionalRoles")] pub additional_roles: Option>, - /// The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. + /// The ID of the item from which this permission is inherited. This is an output-only field. #[serde(rename="inheritedFrom")] pub inherited_from: Option, } @@ -813,7 +808,7 @@ pub struct FileImageMediaMetadata { pub aperture: Option, /// The date and time the photo was taken (EXIF format timestamp). pub date: Option, - /// The rotation in clockwise degrees from the image's original orientation. + /// The number of clockwise 90 degree rotations applied from the image's original orientation. pub rotation: Option, /// The white balance mode used to create the photo. #[serde(rename="whiteBalance")] @@ -1154,6 +1149,24 @@ pub struct RevisionList { impl ResponseResult for RevisionList {} +/// Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileShortcutDetails { + /// The ID of the file that this shortcut points to. + #[serde(rename="targetId")] + pub target_id: Option, + /// The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. + #[serde(rename="targetMimeType")] + pub target_mime_type: Option, +} + +impl NestedType for FileShortcutDetails {} +impl Part for FileShortcutDetails {} + + /// A revision of a file. /// /// # Activities @@ -1192,7 +1205,7 @@ pub struct Revision { /// An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. #[serde(rename="md5Checksum")] pub md5_checksum: Option, - /// Short term download URL for the file. This will only be populated on files with content stored in Drive. + /// no description provided #[serde(rename="downloadUrl")] pub download_url: Option, /// This is always drive#revision. @@ -1200,7 +1213,7 @@ pub struct Revision { /// The last user to modify this revision. #[serde(rename="lastModifyingUser")] pub last_modifying_user: Option, - /// Whether this revision is pinned to prevent automatic purging. This will only be populated and can only be modified on files with content stored in Drive which are not Google Docs. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. + /// Whether this revision is pinned to prevent automatic purging. This will only be populated and can only be modified on files with content stored in Drive which are not Google Docs. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. pub pinned: Option, /// The ETag of the revision. pub etag: Option, @@ -1708,57 +1721,27 @@ pub struct FileCapabilities { /// Whether the current user can restore this file from trash. #[serde(rename="canUntrash")] pub can_untrash: Option, - /// Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. - #[serde(rename="canCopy")] - pub can_copy: Option, - /// Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. - #[serde(rename="canMoveItemWithinDrive")] - pub can_move_item_within_drive: Option, - /// Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. - #[serde(rename="canReadRevisions")] - pub can_read_revisions: Option, - /// Deprecated - use canMoveItemOutOfDrive instead. - #[serde(rename="canMoveItemIntoTeamDrive")] - pub can_move_item_into_team_drive: Option, /// Deprecated - use canMoveItemWithinDrive instead. #[serde(rename="canMoveItemWithinTeamDrive")] pub can_move_item_within_team_drive: Option, - /// Deprecated - use canMoveItemOutOfDrive instead. - #[serde(rename="canMoveItemOutOfTeamDrive")] - pub can_move_item_out_of_team_drive: Option, /// Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. #[serde(rename="canDeleteChildren")] pub can_delete_children: Option, - /// Whether the current user can change the copyRequiresWriterPermission restriction of this file. - #[serde(rename="canChangeCopyRequiresWriterPermission")] - pub can_change_copy_requires_writer_permission: Option, - /// Whether the current user can download this file. - #[serde(rename="canDownload")] - pub can_download: Option, /// Deprecated - use canMoveChildrenWithinDrive instead. #[serde(rename="canMoveChildrenWithinTeamDrive")] pub can_move_children_within_team_drive: Option, - /// Whether the current user can comment on this file. - #[serde(rename="canComment")] - pub can_comment: Option, /// Whether the current user can list the children of this folder. This is always false when the item is not a folder. #[serde(rename="canListChildren")] pub can_list_children: Option, /// Whether the current user can rename this file. #[serde(rename="canRename")] pub can_rename: Option, - /// Whether the current user can move this file to trash. - #[serde(rename="canTrash")] - pub can_trash: Option, - /// Whether the current user can delete this file. - #[serde(rename="canDelete")] - pub can_delete: Option, + /// Whether the current user can modify the content of this file. + #[serde(rename="canModifyContent")] + pub can_modify_content: Option, /// Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. #[serde(rename="canReadDrive")] pub can_read_drive: Option, - /// Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. - #[serde(rename="canMoveTeamDriveItem")] - pub can_move_team_drive_item: Option, /// Whether the current user can add children to this folder. This is always false when the item is not a folder. #[serde(rename="canAddChildren")] pub can_add_children: Option, @@ -1771,12 +1754,51 @@ pub struct FileCapabilities { /// Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. #[serde(rename="canTrashChildren")] pub can_trash_children: Option, - /// Whether the current user can edit this file. - #[serde(rename="canEdit")] - pub can_edit: Option, + /// Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. + #[serde(rename="canAddMyDriveParent")] + pub can_add_my_drive_parent: Option, + /// Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. + #[serde(rename="canMoveChildrenWithinDrive")] + pub can_move_children_within_drive: Option, + /// Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. + #[serde(rename="canReadRevisions")] + pub can_read_revisions: Option, + /// Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. + #[serde(rename="canMoveItemWithinDrive")] + pub can_move_item_within_drive: Option, + /// Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. + #[serde(rename="canCopy")] + pub can_copy: Option, + /// Deprecated - use canMoveItemOutOfDrive instead. + #[serde(rename="canMoveItemIntoTeamDrive")] + pub can_move_item_into_team_drive: Option, + /// Deprecated - use canMoveItemOutOfDrive instead. + #[serde(rename="canMoveItemOutOfTeamDrive")] + pub can_move_item_out_of_team_drive: Option, + /// Whether the current user can comment on this file. + #[serde(rename="canComment")] + pub can_comment: Option, /// Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. #[serde(rename="canMoveChildrenOutOfDrive")] pub can_move_children_out_of_drive: Option, + /// Whether the current user can move this file to trash. + #[serde(rename="canTrash")] + pub can_trash: Option, + /// Whether the current user can delete this file. + #[serde(rename="canDelete")] + pub can_delete: Option, + /// Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. + #[serde(rename="canRemoveMyDriveParent")] + pub can_remove_my_drive_parent: Option, + /// Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. + #[serde(rename="canMoveTeamDriveItem")] + pub can_move_team_drive_item: Option, + /// Whether the current user can download this file. + #[serde(rename="canDownload")] + pub can_download: Option, + /// Whether the current user can change the copyRequiresWriterPermission restriction of this file. + #[serde(rename="canChangeCopyRequiresWriterPermission")] + pub can_change_copy_requires_writer_permission: Option, /// Deprecated - use canMoveChildrenOutOfDrive instead. #[serde(rename="canMoveChildrenOutOfTeamDrive")] pub can_move_children_out_of_team_drive: Option, @@ -1786,9 +1808,9 @@ pub struct FileCapabilities { /// Deprecated - use canReadDrive instead. #[serde(rename="canReadTeamDrive")] pub can_read_team_drive: Option, - /// Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. - #[serde(rename="canMoveChildrenWithinDrive")] - pub can_move_children_within_drive: Option, + /// Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. + #[serde(rename="canEdit")] + pub can_edit: Option, } impl NestedType for FileCapabilities {} @@ -1894,7 +1916,7 @@ impl ResponseResult for FileList {} pub struct CommentReply { /// This is always drive#commentReply. pub kind: Option, - /// The user who wrote this reply. + /// The author of the reply. The author's email address and permission ID will not be populated. pub author: Option, /// Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed. pub deleted: Option, @@ -2049,7 +2071,7 @@ pub struct About { /// Deprecated - use driveThemes instead. #[serde(rename="teamDriveThemes")] pub team_drive_themes: Option>, - /// The total number of quota bytes. + /// The total number of quota bytes. This is only relevant when quotaType is LIMITED. #[serde(rename="quotaBytesTotal")] pub quota_bytes_total: Option, /// The number of remaining change ids, limited to no more than 2500. @@ -2251,7 +2273,7 @@ pub struct Comment { pub self_link: Option, /// This is always drive#comment. pub kind: Option, - /// The user who wrote this comment. + /// The author of the comment. The author's email address and permission ID will not be populated. pub author: Option, /// Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed. pub deleted: Option, @@ -2528,7 +2550,7 @@ pub struct File { /// The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files. #[serde(rename="fileExtension")] pub file_extension: Option, - /// Whether any users are granted file access directly on this file. This field is only populated for items in shared drives. + /// Whether there are permissions directly on this file. This field is only populated for items in shared drives. #[serde(rename="hasAugmentedPermissions")] pub has_augmented_permissions: Option, /// The list of permissions for users with access to this file. Not populated for items in shared drives. @@ -2555,6 +2577,9 @@ pub struct File { pub owned_by_me: Option, /// The ID of the file. pub id: Option, + /// Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. + #[serde(rename="shortcutDetails")] + pub shortcut_details: Option, /// Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files. #[serde(rename="downloadUrl")] pub download_url: Option, @@ -2761,6 +2786,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _pinned: Default::default(), _ocr_language: Default::default(), _ocr: Default::default(), + _enforce_single_parent: Default::default(), _convert: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2827,6 +2853,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _pinned: Default::default(), _ocr_language: Default::default(), _ocr: Default::default(), + _enforce_single_parent: Default::default(), _convert: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2969,6 +2996,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _ocr: Default::default(), _new_revision: Default::default(), _modified_date_behavior: Default::default(), + _enforce_single_parent: Default::default(), _convert: Default::default(), _add_parents: Default::default(), _delegate: Default::default(), @@ -3003,6 +3031,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _ocr: Default::default(), _new_revision: Default::default(), _modified_date_behavior: Default::default(), + _enforce_single_parent: Default::default(), _convert: Default::default(), _add_parents: Default::default(), _delegate: Default::default(), @@ -3169,84 +3198,6 @@ impl<'a, C, A> TeamdriveMethods<'a, C, A> { -/// A builder providing access to all methods supported on *realtime* resources. -/// It is not used directly, but through the `DriveHub` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_drive2 as drive2; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use drive2::DriveHub; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)` and `update(...)` -/// // to build up your call. -/// let rb = hub.realtime(); -/// # } -/// ``` -pub struct RealtimeMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DriveHub, -} - -impl<'a, C, A> MethodsBuilder for RealtimeMethods<'a, C, A> {} - -impl<'a, C, A> RealtimeMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Overwrites the Realtime API data model associated with this file with the provided JSON data model. - /// - /// # Arguments - /// - /// * `fileId` - The ID of the file that the Realtime API data model is associated with. - pub fn update(&self, file_id: &str) -> RealtimeUpdateCall<'a, C, A> { - RealtimeUpdateCall { - hub: self.hub, - _file_id: file_id.to_string(), - _base_revision: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Exports the contents of the Realtime API data model associated with this file as JSON. - /// - /// # Arguments - /// - /// * `fileId` - The ID of the file that the Realtime API data model is associated with. - pub fn get(&self, file_id: &str) -> RealtimeGetCall<'a, C, A> { - RealtimeGetCall { - hub: self.hub, - _file_id: file_id.to_string(), - _revision: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *app* resources. /// It is not used directly, but through the `DriveHub` hub. /// @@ -3586,7 +3537,7 @@ impl<'a, C, A> CommentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an existing comment. This method supports patch semantics. + /// Updates an existing comment. /// /// # Arguments /// @@ -3742,6 +3693,7 @@ impl<'a, C, A> ChildrenMethods<'a, C, A> { hub: self.hub, _folder_id: folder_id.to_string(), _child_id: child_id.to_string(), + _enforce_single_parent: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3763,6 +3715,7 @@ impl<'a, C, A> ChildrenMethods<'a, C, A> { _folder_id: folder_id.to_string(), _supports_team_drives: Default::default(), _supports_all_drives: Default::default(), + _enforce_single_parent: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3900,6 +3853,7 @@ impl<'a, C, A> ParentMethods<'a, C, A> { hub: self.hub, _file_id: file_id.to_string(), _parent_id: parent_id.to_string(), + _enforce_single_parent: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3921,6 +3875,7 @@ impl<'a, C, A> ParentMethods<'a, C, A> { _file_id: file_id.to_string(), _supports_team_drives: Default::default(), _supports_all_drives: Default::default(), + _enforce_single_parent: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3990,7 +3945,7 @@ impl<'a, C, A> ReplyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an existing reply. This method supports patch semantics. + /// Updates an existing reply. /// /// # Arguments /// @@ -4241,6 +4196,32 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Inserts a permission for a file or shared drive. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `fileId` - The ID for the file or shared drive. + pub fn insert(&self, request: Permission, file_id: &str) -> PermissionInsertCall<'a, C, A> { + PermissionInsertCall { + hub: self.hub, + _request: request, + _file_id: file_id.to_string(), + _use_domain_admin_access: Default::default(), + _supports_team_drives: Default::default(), + _supports_all_drives: Default::default(), + _send_notification_emails: Default::default(), + _move_to_new_owners_root: Default::default(), + _enforce_single_parent: Default::default(), + _email_message: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a permission using patch semantics. @@ -4337,30 +4318,6 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Inserts a permission for a file or shared drive. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `fileId` - The ID for the file or shared drive. - pub fn insert(&self, request: Permission, file_id: &str) -> PermissionInsertCall<'a, C, A> { - PermissionInsertCall { - hub: self.hub, - _request: request, - _file_id: file_id.to_string(), - _use_domain_admin_access: Default::default(), - _supports_team_drives: Default::default(), - _supports_all_drives: Default::default(), - _send_notification_emails: Default::default(), - _email_message: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns the permission ID for an email address. @@ -4554,6 +4511,25 @@ impl<'a, C, A> MethodsBuilder for PropertyMethods<'a, C, A> {} impl<'a, C, A> PropertyMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Adds a property to a file, or updates it if it already exists. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `fileId` - The ID of the file. + pub fn insert(&self, request: Property, file_id: &str) -> PropertyInsertCall<'a, C, A> { + PropertyInsertCall { + hub: self.hub, + _request: request, + _file_id: file_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a property. @@ -4574,25 +4550,6 @@ impl<'a, C, A> PropertyMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Adds a property to a file, or updates it if it already exists. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `fileId` - The ID of the file. - pub fn insert(&self, request: Property, file_id: &str) -> PropertyInsertCall<'a, C, A> { - PropertyInsertCall { - hub: self.hub, - _request: request, - _file_id: file_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists a file's properties. @@ -4716,27 +4673,6 @@ impl<'a, C, A> MethodsBuilder for RevisionMethods<'a, C, A> {} impl<'a, C, A> RevisionMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Updates a revision. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `fileId` - The ID for the file. - /// * `revisionId` - The ID for the revision. - pub fn patch(&self, request: Revision, file_id: &str, revision_id: &str) -> RevisionPatchCall<'a, C, A> { - RevisionPatchCall { - hub: self.hub, - _request: request, - _file_id: file_id.to_string(), - _revision_id: revision_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Gets a specific revision. @@ -4775,6 +4711,27 @@ impl<'a, C, A> RevisionMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates a revision. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `fileId` - The ID for the file. + /// * `revisionId` - The ID for the revision. + pub fn patch(&self, request: Revision, file_id: &str, revision_id: &str) -> RevisionPatchCall<'a, C, A> { + RevisionPatchCall { + hub: self.hub, + _request: request, + _file_id: file_id.to_string(), + _revision_id: revision_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a revision. @@ -4866,8 +4823,8 @@ impl<'a, C, A> RevisionMethods<'a, C, A> { /// .update_viewed_date(true) /// .supports_team_drives(false) /// .supports_all_drives(true) -/// .revision_id("eirmod") -/// .projection("sanctus") +/// .revision_id("amet") +/// .projection("et") /// .acknowledge_abuse(true) /// .doit(); /// # } @@ -5223,16 +5180,17 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().insert(req) -/// .visibility("amet") +/// .visibility("ut") /// .use_content_as_indexable_text(true) -/// .timed_text_track_name("consetetur") -/// .timed_text_language("ut") +/// .timed_text_track_name("sed") +/// .timed_text_language("dolor") /// .supports_team_drives(true) -/// .supports_all_drives(false) +/// .supports_all_drives(true) /// .pinned(true) -/// .ocr_language("dolor") -/// .ocr(true) -/// .convert(true) +/// .ocr_language("consetetur") +/// .ocr(false) +/// .enforce_single_parent(true) +/// .convert(false) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -5250,6 +5208,7 @@ pub struct FileInsertCall<'a, C, A> _pinned: Option, _ocr_language: Option, _ocr: Option, + _enforce_single_parent: Option, _convert: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -5273,7 +5232,7 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(13 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(14 + self._additional_params.len()); if let Some(value) = self._visibility { params.push(("visibility", value.to_string())); } @@ -5301,10 +5260,13 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._ocr { params.push(("ocr", value.to_string())); } + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } if let Some(value) = self._convert { params.push(("convert", value.to_string())); } - for &field in ["alt", "visibility", "useContentAsIndexableText", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "pinned", "ocrLanguage", "ocr", "convert"].iter() { + for &field in ["alt", "visibility", "useContentAsIndexableText", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "pinned", "ocrLanguage", "ocr", "enforceSingleParent", "convert"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5594,6 +5556,13 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa self._ocr = Some(new_value); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. Requests that specify more than one parent will fail. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> FileInsertCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// Whether to convert this file to the corresponding Google Docs format. /// /// Sets the *convert* query property to the given value. @@ -5688,8 +5657,8 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().untrash("fileId") -/// .supports_team_drives(false) -/// .supports_all_drives(true) +/// .supports_team_drives(true) +/// .supports_all_drives(false) /// .doit(); /// # } /// ``` @@ -5953,7 +5922,7 @@ impl<'a, C, A> FileUntrashCall<'a, C, A> where C: BorrowMut, A: o /// // Values shown here are possibly random and not representative ! /// let result = hub.files().delete("fileId") /// .supports_team_drives(true) -/// .supports_all_drives(true) +/// .supports_all_drives(false) /// .doit(); /// # } /// ``` @@ -6211,15 +6180,16 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().copy(req, "fileId") -/// .visibility("vero") -/// .timed_text_track_name("diam") -/// .timed_text_language("rebum.") -/// .supports_team_drives(true) -/// .supports_all_drives(true) +/// .visibility("sadipscing") +/// .timed_text_track_name("vero") +/// .timed_text_language("sadipscing") +/// .supports_team_drives(false) +/// .supports_all_drives(false) /// .pinned(false) -/// .ocr_language("sadipscing") +/// .ocr_language("duo") /// .ocr(false) -/// .convert(false) +/// .enforce_single_parent(true) +/// .convert(true) /// .doit(); /// # } /// ``` @@ -6237,6 +6207,7 @@ pub struct FileCopyCall<'a, C, A> _pinned: Option, _ocr_language: Option, _ocr: Option, + _enforce_single_parent: Option, _convert: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -6259,7 +6230,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "drive.files.copy", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(13 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(14 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._visibility { params.push(("visibility", value.to_string())); @@ -6285,10 +6256,13 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut if let Some(value) = self._ocr { params.push(("ocr", value.to_string())); } + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } if let Some(value) = self._convert { params.push(("convert", value.to_string())); } - for &field in ["alt", "fileId", "visibility", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "pinned", "ocrLanguage", "ocr", "convert"].iter() { + for &field in ["alt", "fileId", "visibility", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "pinned", "ocrLanguage", "ocr", "enforceSingleParent", "convert"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6490,6 +6464,13 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut self._ocr = Some(new_value); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. Requests that specify more than one parent will fail. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// Whether to convert this file to the corresponding Google Docs format. /// /// Sets the *convert* query property to the given value. @@ -7288,20 +7269,20 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().list() -/// .team_drive_id("clita") -/// .supports_team_drives(true) -/// .supports_all_drives(false) -/// .spaces("nonumy") -/// .q("kasd") -/// .projection("sanctus") -/// .page_token("takimata") -/// .order_by("At") -/// .max_results(-86) +/// .team_drive_id("sanctus") +/// .supports_team_drives(false) +/// .supports_all_drives(true) +/// .spaces("labore") +/// .q("invidunt") +/// .projection("ea") +/// .page_token("sadipscing") +/// .order_by("rebum.") +/// .max_results(-33) /// .include_team_drive_items(true) -/// .include_items_from_all_drives(false) -/// .drive_id("sadipscing") -/// .corpus("rebum.") -/// .corpora("dolore") +/// .include_items_from_all_drives(true) +/// .drive_id("aliquyam") +/// .corpus("sit") +/// .corpora("eirmod") /// .doit(); /// # } /// ``` @@ -7663,8 +7644,8 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().touch("fileId") -/// .supports_team_drives(true) -/// .supports_all_drives(false) +/// .supports_team_drives(false) +/// .supports_all_drives(true) /// .doit(); /// # } /// ``` @@ -7927,8 +7908,8 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().generate_ids() -/// .space("sit") -/// .max_results(-40) +/// .space("ea") +/// .max_results(-62) /// .doit(); /// # } /// ``` @@ -8165,21 +8146,22 @@ impl<'a, C, A> FileGenerateIdCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().update(req, "fileId") -/// .use_content_as_indexable_text(false) +/// .use_content_as_indexable_text(true) /// .update_viewed_date(true) -/// .timed_text_track_name("ea") -/// .timed_text_language("gubergren") +/// .timed_text_track_name("sea") +/// .timed_text_language("labore") /// .supports_team_drives(false) /// .supports_all_drives(true) -/// .set_modified_date(true) -/// .remove_parents("sea") -/// .pinned(false) -/// .ocr_language("ipsum") -/// .ocr(true) -/// .new_revision(false) -/// .modified_date_behavior("sit") +/// .set_modified_date(false) +/// .remove_parents("sit") +/// .pinned(true) +/// .ocr_language("ut") +/// .ocr(false) +/// .new_revision(true) +/// .modified_date_behavior("amet") +/// .enforce_single_parent(true) /// .convert(true) -/// .add_parents("ut") +/// .add_parents("diam") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -8202,6 +8184,7 @@ pub struct FileUpdateCall<'a, C, A> _ocr: Option, _new_revision: Option, _modified_date_behavior: Option, + _enforce_single_parent: Option, _convert: Option, _add_parents: Option, _delegate: Option<&'a mut dyn Delegate>, @@ -8226,7 +8209,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(19 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(20 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); @@ -8267,13 +8250,16 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._modified_date_behavior { params.push(("modifiedDateBehavior", value.to_string())); } + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } if let Some(value) = self._convert { params.push(("convert", value.to_string())); } if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "enforceSingleParent", "convert", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8622,6 +8608,13 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._modified_date_behavior = Some(new_value.to_string()); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item will be removed from all current folders and placed in the requested folder. Other requests that increase the number of parents will fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> FileUpdateCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// This parameter is deprecated and has no function. /// /// Sets the *convert* query property to the given value. @@ -8729,21 +8722,22 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().patch(req, "fileId") -/// .use_content_as_indexable_text(true) -/// .update_viewed_date(true) -/// .timed_text_track_name("accusam") -/// .timed_text_language("clita") -/// .supports_team_drives(false) -/// .supports_all_drives(false) +/// .use_content_as_indexable_text(false) +/// .update_viewed_date(false) +/// .timed_text_track_name("invidunt") +/// .timed_text_language("ut") +/// .supports_team_drives(true) +/// .supports_all_drives(true) /// .set_modified_date(false) -/// .remove_parents("clita") -/// .pinned(true) -/// .ocr_language("ut") -/// .ocr(true) +/// .remove_parents("duo") +/// .pinned(false) +/// .ocr_language("aliquyam") +/// .ocr(false) /// .new_revision(true) -/// .modified_date_behavior("voluptua.") +/// .modified_date_behavior("et") +/// .enforce_single_parent(true) /// .convert(true) -/// .add_parents("sed") +/// .add_parents("kasd") /// .doit(); /// # } /// ``` @@ -8766,6 +8760,7 @@ pub struct FilePatchCall<'a, C, A> _ocr: Option, _new_revision: Option, _modified_date_behavior: Option, + _enforce_single_parent: Option, _convert: Option, _add_parents: Option, _delegate: Option<&'a mut dyn Delegate>, @@ -8789,7 +8784,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "drive.files.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(19 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(20 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); @@ -8830,13 +8825,16 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._modified_date_behavior { params.push(("modifiedDateBehavior", value.to_string())); } + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } if let Some(value) = self._convert { params.push(("convert", value.to_string())); } if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "supportsAllDrives", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "enforceSingleParent", "convert", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9073,6 +9071,13 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau self._modified_date_behavior = Some(new_value.to_string()); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item will be removed from all current folders and placed in the requested folder. Other requests that increase the number of parents will fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> FilePatchCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// This parameter is deprecated and has no function. /// /// Sets the *convert* query property to the given value. @@ -9179,11 +9184,11 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().get("fileId") -/// .update_viewed_date(false) +/// .update_viewed_date(true) /// .supports_team_drives(true) /// .supports_all_drives(false) -/// .revision_id("dolor") -/// .projection("diam") +/// .revision_id("invidunt") +/// .projection("eirmod") /// .acknowledge_abuse(false) /// .doit(); /// # } @@ -9757,7 +9762,7 @@ impl<'a, C, A> TeamdriveInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().get("teamDriveId") -/// .use_domain_admin_access(true) +/// .use_domain_admin_access(false) /// .doit(); /// # } /// ``` @@ -10009,10 +10014,10 @@ impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().list() -/// .use_domain_admin_access(false) -/// .q("invidunt") -/// .page_token("eirmod") -/// .max_results(-77) +/// .use_domain_admin_access(true) +/// .q("takimata") +/// .page_token("elitr") +/// .max_results(-91) /// .doit(); /// # } /// ``` @@ -10499,7 +10504,7 @@ impl<'a, C, A> TeamdriveDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().update(req, "teamDriveId") -/// .use_domain_admin_access(false) +/// .use_domain_admin_access(true) /// .doit(); /// # } /// ``` @@ -10748,600 +10753,6 @@ impl<'a, C, A> TeamdriveUpdateCall<'a, C, A> where C: BorrowMut, } -/// Overwrites the Realtime API data model associated with this file with the provided JSON data model. -/// -/// A builder for the *update* method supported by a *realtime* resource. -/// It is not used directly, but through a `RealtimeMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive2 as drive2; -/// use std::fs; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive2::DriveHub; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `upload(...)`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.realtime().update("fileId") -/// .base_revision("takimata") -/// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); -/// # } -/// ``` -pub struct RealtimeUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DriveHub, - _file_id: String, - _base_revision: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RealtimeUpdateCall<'a, C, A> {} - -impl<'a, C, A> RealtimeUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - fn doit(mut self, mut reader: RS, reader_mime_type: mime::Mime, protocol: &'static str) -> Result - where RS: ReadSeek { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "drive.realtime.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("fileId", self._file_id.to_string())); - if let Some(value) = self._base_revision { - params.push(("baseRevision", value.to_string())); - } - for &field in ["fileId", "baseRevision"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let (mut url, upload_type) = - if protocol == "simple" { - (self.hub._root_url.clone() + "upload/drive/v2/files/{fileId}/realtime", "multipart") - } else if protocol == "resumable" { - (self.hub._root_url.clone() + "resumable/upload/drive/v2/files/{fileId}/realtime", "resumable") - } else { - unreachable!() - }; - params.push(("uploadType", upload_type.to_string())); - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{fileId}", "fileId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - let mut should_ask_dlg_for_url = false; - let mut upload_url_from_server; - let mut upload_url: Option = None; - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - if should_ask_dlg_for_url && (upload_url = dlg.upload_url()) == () && upload_url.is_some() { - should_ask_dlg_for_url = false; - upload_url_from_server = false; - let url = upload_url.as_ref().and_then(|s| Some(hyper::Url::parse(s).unwrap())).unwrap(); - hyper::client::Response::new(url, Box::new(cmn::DummyNetworkStream)).and_then(|mut res| { - res.status = hyper::status::StatusCode::Ok; - res.headers.set(Location(upload_url.as_ref().unwrap().clone())); - Ok(res) - }) - } else { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - if protocol == "simple" { - let size = reader.seek(io::SeekFrom::End(0)).unwrap(); - reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 10485760 { - return Err(Error::UploadSizeLimitExceeded(size, 10485760)) - } - req = req.header(ContentType(reader_mime_type.clone())) - .header(ContentLength(size)) - .body(&mut reader); - } - upload_url_from_server = true; - if protocol == "resumable" { - req = req.header(cmn::XUploadContentType(reader_mime_type.clone())); - } - - dlg.pre_request(); - req.send() - } - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - if protocol == "resumable" { - let size = reader.seek(io::SeekFrom::End(0)).unwrap(); - reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 10485760 { - return Err(Error::UploadSizeLimitExceeded(size, 10485760)) - } - let mut client = &mut *self.hub.client.borrow_mut(); - let upload_result = { - let url_str = &res.headers.get::().expect("Location header is part of protocol").0; - if upload_url_from_server { - dlg.store_upload_url(Some(url_str)); - } - - cmn::ResumableUploadHelper { - client: &mut client.borrow_mut(), - delegate: dlg, - start_at: if upload_url_from_server { Some(0) } else { None }, - auth: &mut *self.hub.auth.borrow_mut(), - user_agent: &self.hub._user_agent, - auth_header: auth_header.clone(), - url: url_str, - reader: &mut reader, - media_type: reader_mime_type.clone(), - content_length: size - }.upload() - }; - match upload_result { - None => { - dlg.finished(false); - return Err(Error::Cancelled) - } - Some(Err(err)) => { - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Some(Ok(upload_result)) => { - res = upload_result; - if !res.status.is_success() { - dlg.store_upload_url(None); - dlg.finished(false); - return Err(Error::Failure(res)) - } - } - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - /// Upload media all at once. - /// If the upload fails for whichever reason, all progress is lost. - /// - /// * *max size*: 10MB - /// * *multipart*: yes - /// * *valid mime types*: '*/*' - pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result - where RS: ReadSeek { - self.doit(stream, mime_type, "simple") - } - /// Upload media in a resumable fashion. - /// Even if the upload fails or is interrupted, it can be resumed for a - /// certain amount of time as the server maintains state temporarily. - /// - /// The delegate will be asked for an `upload_url()`, and if not provided, will be asked to store an upload URL - /// that was provided by the server, using `store_upload_url(...)`. The upload will be done in chunks, the delegate - /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using - /// `cancel_chunk_upload(...)`. - /// - /// * *max size*: 10MB - /// * *multipart*: yes - /// * *valid mime types*: '*/*' - pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result - where RS: ReadSeek { - self.doit(resumeable_stream, mime_type, "resumable") - } - - /// The ID of the file that the Realtime API data model is associated with. - /// - /// Sets the *file id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn file_id(mut self, new_value: &str) -> RealtimeUpdateCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// The revision of the model to diff the uploaded model against. If set, the uploaded model is diffed against the provided revision and those differences are merged with any changes made to the model after the provided revision. If not set, the uploaded model replaces the current model on the server. - /// - /// Sets the *base revision* query property to the given value. - pub fn base_revision(mut self, new_value: &str) -> RealtimeUpdateCall<'a, C, A> { - self._base_revision = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RealtimeUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RealtimeUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RealtimeUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Exports the contents of the Realtime API data model associated with this file as JSON. -/// -/// This method supports **media download**. To enable it, adjust the builder like this: -/// `.param("alt", "media")`. -/// -/// A builder for the *get* method supported by a *realtime* resource. -/// It is not used directly, but through a `RealtimeMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive2 as drive2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive2::DriveHub; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.realtime().get("fileId") -/// .revision(-91) -/// .doit(); -/// # } -/// ``` -pub struct RealtimeGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DriveHub, - _file_id: String, - _revision: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RealtimeGetCall<'a, C, A> {} - -impl<'a, C, A> RealtimeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "drive.realtime.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("fileId", self._file_id.to_string())); - if let Some(value) = self._revision { - params.push(("revision", value.to_string())); - } - for &field in ["fileId", "revision"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "files/{fileId}/realtime"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{fileId}", "fileId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the file that the Realtime API data model is associated with. - /// - /// Sets the *file id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn file_id(mut self, new_value: &str) -> RealtimeGetCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// The revision of the Realtime API data model to export. Revisions start at 1 (the initial empty data model) and are incremented with each change. If this parameter is excluded, the most recent data model will be returned. - /// - /// Sets the *revision* query property to the given value. - pub fn revision(mut self, new_value: i32) -> RealtimeGetCall<'a, C, A> { - self._revision = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RealtimeGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RealtimeGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RealtimeGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Gets a specific app. /// /// A builder for the *get* method supported by a *app* resource. @@ -11610,9 +11021,9 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.apps().list() -/// .language_code("Lorem") -/// .app_filter_mime_types("Lorem") -/// .app_filter_extensions("diam") +/// .language_code("ut") +/// .app_filter_mime_types("ut") +/// .app_filter_extensions("amet.") /// .doit(); /// # } /// ``` @@ -11859,7 +11270,7 @@ impl<'a, C, A> AppListCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.drives().update(req, "driveId") -/// .use_domain_admin_access(true) +/// .use_domain_admin_access(false) /// .doit(); /// # } /// ``` @@ -12856,9 +12267,9 @@ impl<'a, C, A> DriveInsertCall<'a, C, A> where C: BorrowMut, A: o /// // Values shown here are possibly random and not representative ! /// let result = hub.drives().list() /// .use_domain_admin_access(true) -/// .q("sea") -/// .page_token("ut") -/// .max_results(-39) +/// .q("sanctus") +/// .page_token("voluptua.") +/// .max_results(-99) /// .doit(); /// # } /// ``` @@ -13110,7 +12521,7 @@ impl<'a, C, A> DriveListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.drives().get("driveId") -/// .use_domain_admin_access(true) +/// .use_domain_admin_access(false) /// .doit(); /// # } /// ``` @@ -14350,7 +13761,7 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Updates an existing comment. This method supports patch semantics. +/// Updates an existing comment. /// /// A builder for the *patch* method supported by a *comment* resource. /// It is not used directly, but through a `CommentMethods` instance. @@ -14944,10 +14355,10 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("fileId") -/// .updated_min("takimata") -/// .page_token("et") -/// .max_results(-91) -/// .include_deleted(false) +/// .updated_min("et") +/// .page_token("sed") +/// .max_results(-10) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -15232,10 +14643,10 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.children().list("folderId") -/// .q("no") -/// .page_token("invidunt") -/// .order_by("rebum.") -/// .max_results(-86) +/// .q("labore") +/// .page_token("aliquyam") +/// .order_by("elitr") +/// .max_results(-46) /// .doit(); /// # } /// ``` @@ -15772,6 +15183,7 @@ impl<'a, C, A> ChildrenGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.children().delete("folderId", "childId") +/// .enforce_single_parent(false) /// .doit(); /// # } /// ``` @@ -15781,6 +15193,7 @@ pub struct ChildrenDeleteCall<'a, C, A> hub: &'a DriveHub, _folder_id: String, _child_id: String, + _enforce_single_parent: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -15802,10 +15215,13 @@ impl<'a, C, A> ChildrenDeleteCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "drive.children.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("folderId", self._folder_id.to_string())); params.push(("childId", self._child_id.to_string())); - for &field in ["folderId", "childId"].iter() { + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } + for &field in ["folderId", "childId", "enforceSingleParent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15926,6 +15342,13 @@ impl<'a, C, A> ChildrenDeleteCall<'a, C, A> where C: BorrowMut, A self._child_id = new_value.to_string(); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the item's last parent is removed, the item will be placed under its owner's root. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> ChildrenDeleteCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -16019,8 +15442,9 @@ impl<'a, C, A> ChildrenDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.children().insert(req, "folderId") -/// .supports_team_drives(false) -/// .supports_all_drives(true) +/// .supports_team_drives(true) +/// .supports_all_drives(false) +/// .enforce_single_parent(true) /// .doit(); /// # } /// ``` @@ -16032,6 +15456,7 @@ pub struct ChildrenInsertCall<'a, C, A> _folder_id: String, _supports_team_drives: Option, _supports_all_drives: Option, + _enforce_single_parent: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -16053,7 +15478,7 @@ impl<'a, C, A> ChildrenInsertCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "drive.children.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("folderId", self._folder_id.to_string())); if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); @@ -16061,7 +15486,10 @@ impl<'a, C, A> ChildrenInsertCall<'a, C, A> where C: BorrowMut, A if let Some(value) = self._supports_all_drives { params.push(("supportsAllDrives", value.to_string())); } - for &field in ["alt", "folderId", "supportsTeamDrives", "supportsAllDrives"].iter() { + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } + for &field in ["alt", "folderId", "supportsTeamDrives", "supportsAllDrives", "enforceSingleParent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16221,6 +15649,13 @@ impl<'a, C, A> ChildrenInsertCall<'a, C, A> where C: BorrowMut, A self._supports_all_drives = Some(new_value); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the child's owner makes the request, the child will be removed from all current folders and placed in the requested folder. Any other requests that increase the number of the child's parents will fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> ChildrenInsertCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -16775,6 +16210,7 @@ impl<'a, C, A> ParentListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.parents().delete("fileId", "parentId") +/// .enforce_single_parent(true) /// .doit(); /// # } /// ``` @@ -16784,6 +16220,7 @@ pub struct ParentDeleteCall<'a, C, A> hub: &'a DriveHub, _file_id: String, _parent_id: String, + _enforce_single_parent: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -16805,10 +16242,13 @@ impl<'a, C, A> ParentDeleteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.parents.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); params.push(("parentId", self._parent_id.to_string())); - for &field in ["fileId", "parentId"].iter() { + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } + for &field in ["fileId", "parentId", "enforceSingleParent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16929,6 +16369,13 @@ impl<'a, C, A> ParentDeleteCall<'a, C, A> where C: BorrowMut, A: self._parent_id = new_value.to_string(); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the item's last parent is removed, the item will be placed under its owner's root. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> ParentDeleteCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -17022,8 +16469,9 @@ impl<'a, C, A> ParentDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.parents().insert(req, "fileId") -/// .supports_team_drives(true) -/// .supports_all_drives(false) +/// .supports_team_drives(false) +/// .supports_all_drives(true) +/// .enforce_single_parent(false) /// .doit(); /// # } /// ``` @@ -17035,6 +16483,7 @@ pub struct ParentInsertCall<'a, C, A> _file_id: String, _supports_team_drives: Option, _supports_all_drives: Option, + _enforce_single_parent: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -17056,7 +16505,7 @@ impl<'a, C, A> ParentInsertCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.parents.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); @@ -17064,7 +16513,10 @@ impl<'a, C, A> ParentInsertCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._supports_all_drives { params.push(("supportsAllDrives", value.to_string())); } - for &field in ["alt", "fileId", "supportsTeamDrives", "supportsAllDrives"].iter() { + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } + for &field in ["alt", "fileId", "supportsTeamDrives", "supportsAllDrives", "enforceSingleParent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17224,6 +16676,13 @@ impl<'a, C, A> ParentInsertCall<'a, C, A> where C: BorrowMut, A: self._supports_all_drives = Some(new_value); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the child's owner makes the request, the child will be removed from all current folders and placed in the requested folder. Any other requests that increase the number of the child's parents will fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> ParentInsertCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -17535,7 +16994,7 @@ impl<'a, C, A> ParentGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Updates an existing reply. This method supports patch semantics. +/// Updates an existing reply. /// /// A builder for the *patch* method supported by a *reply* resource. /// It is not used directly, but through a `ReplyMethods` instance. @@ -18141,8 +17600,8 @@ impl<'a, C, A> ReplyInsertCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().list("fileId", "commentId") -/// .page_token("Lorem") -/// .max_results(-96) +/// .page_token("sadipscing") +/// .max_results(-73) /// .include_deleted(true) /// .doit(); /// # } @@ -19253,9 +18712,9 @@ impl<'a, C, A> ReplyUpdateCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.about().get() -/// .start_change_id("clita") -/// .max_change_id_count("eos") -/// .include_subscribed(false) +/// .start_change_id("eos") +/// .max_change_id_count("justo") +/// .include_subscribed(true) /// .doit(); /// # } /// ``` @@ -19496,9 +18955,9 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().delete("fileId", "permissionId") -/// .use_domain_admin_access(true) -/// .supports_team_drives(false) -/// .supports_all_drives(true) +/// .use_domain_admin_access(false) +/// .supports_team_drives(true) +/// .supports_all_drives(false) /// .doit(); /// # } /// ``` @@ -19745,6 +19204,361 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } +/// Inserts a permission for a file or shared drive. +/// +/// A builder for the *insert* method supported by a *permission* resource. +/// It is not used directly, but through a `PermissionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// use drive2::Permission; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::DriveHub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Permission::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.permissions().insert(req, "fileId") +/// .use_domain_admin_access(false) +/// .supports_team_drives(true) +/// .supports_all_drives(true) +/// .send_notification_emails(true) +/// .move_to_new_owners_root(false) +/// .enforce_single_parent(false) +/// .email_message("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct PermissionInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DriveHub, + _request: Permission, + _file_id: String, + _use_domain_admin_access: Option, + _supports_team_drives: Option, + _supports_all_drives: Option, + _send_notification_emails: Option, + _move_to_new_owners_root: Option, + _enforce_single_parent: Option, + _email_message: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PermissionInsertCall<'a, C, A> {} + +impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Permission)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.permissions.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(11 + self._additional_params.len()); + params.push(("fileId", self._file_id.to_string())); + if let Some(value) = self._use_domain_admin_access { + params.push(("useDomainAdminAccess", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + if let Some(value) = self._supports_all_drives { + params.push(("supportsAllDrives", value.to_string())); + } + if let Some(value) = self._send_notification_emails { + params.push(("sendNotificationEmails", value.to_string())); + } + if let Some(value) = self._move_to_new_owners_root { + params.push(("moveToNewOwnersRoot", value.to_string())); + } + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } + if let Some(value) = self._email_message { + params.push(("emailMessage", value.to_string())); + } + for &field in ["alt", "fileId", "useDomainAdminAccess", "supportsTeamDrives", "supportsAllDrives", "sendNotificationEmails", "moveToNewOwnersRoot", "enforceSingleParent", "emailMessage"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{fileId}", "fileId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["fileId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Permission) -> PermissionInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID for the file or shared drive. + /// + /// Sets the *file id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn file_id(mut self, new_value: &str) -> PermissionInsertCall<'a, C, A> { + self._file_id = new_value.to_string(); + self + } + /// Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. + /// + /// Sets the *use domain admin access* query property to the given value. + pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._use_domain_admin_access = Some(new_value); + self + } + /// Deprecated use supportsAllDrives instead. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } + /// Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. + /// + /// Sets the *supports all drives* query property to the given value. + pub fn supports_all_drives(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._supports_all_drives = Some(new_value); + self + } + /// Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner. + /// + /// Sets the *send notification emails* query property to the given value. + pub fn send_notification_emails(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._send_notification_emails = Some(new_value); + self + } + /// This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. When set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, when enforceSingleParent=true, parents are not changed. If set to false, when enforceSingleParent=false, existing parents are not changed; however, the file will be added to the new owner's My Drive root folder, unless it is already in the new owner's My Drive. + /// + /// Sets the *move to new owners root* query property to the given value. + pub fn move_to_new_owners_root(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._move_to_new_owners_root = Some(new_value); + self + } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. See moveToNewOwnersRoot for details. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } + /// A plain text custom message to include in notification emails. + /// + /// Sets the *email message* query property to the given value. + pub fn email_message(mut self, new_value: &str) -> PermissionInsertCall<'a, C, A> { + self._email_message = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PermissionInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PermissionInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PermissionInsertCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates a permission using patch semantics. /// /// A builder for the *patch* method supported by a *permission* resource. @@ -19781,9 +19595,9 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, /// let result = hub.permissions().patch(req, "fileId", "permissionId") /// .use_domain_admin_access(false) /// .transfer_ownership(false) -/// .supports_team_drives(false) +/// .supports_team_drives(true) /// .supports_all_drives(true) -/// .remove_expiration(false) +/// .remove_expiration(true) /// .doit(); /// # } /// ``` @@ -20116,11 +19930,11 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().list("fileId") -/// .use_domain_admin_access(false) -/// .supports_team_drives(true) -/// .supports_all_drives(true) -/// .page_token("accusam") -/// .max_results(-86) +/// .use_domain_admin_access(true) +/// .supports_team_drives(false) +/// .supports_all_drives(false) +/// .page_token("erat") +/// .max_results(-52) /// .doit(); /// # } /// ``` @@ -20422,11 +20236,11 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().update(req, "fileId", "permissionId") -/// .use_domain_admin_access(false) -/// .transfer_ownership(false) +/// .use_domain_admin_access(true) +/// .transfer_ownership(true) /// .supports_team_drives(false) -/// .supports_all_drives(false) -/// .remove_expiration(true) +/// .supports_all_drives(true) +/// .remove_expiration(false) /// .doit(); /// # } /// ``` @@ -21019,337 +20833,6 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: } -/// Inserts a permission for a file or shared drive. -/// -/// A builder for the *insert* method supported by a *permission* resource. -/// It is not used directly, but through a `PermissionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive2 as drive2; -/// use drive2::Permission; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive2::DriveHub; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Permission::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.permissions().insert(req, "fileId") -/// .use_domain_admin_access(true) -/// .supports_team_drives(false) -/// .supports_all_drives(true) -/// .send_notification_emails(false) -/// .email_message("et") -/// .doit(); -/// # } -/// ``` -pub struct PermissionInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DriveHub, - _request: Permission, - _file_id: String, - _use_domain_admin_access: Option, - _supports_team_drives: Option, - _supports_all_drives: Option, - _send_notification_emails: Option, - _email_message: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for PermissionInsertCall<'a, C, A> {} - -impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Permission)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "drive.permissions.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); - params.push(("fileId", self._file_id.to_string())); - if let Some(value) = self._use_domain_admin_access { - params.push(("useDomainAdminAccess", value.to_string())); - } - if let Some(value) = self._supports_team_drives { - params.push(("supportsTeamDrives", value.to_string())); - } - if let Some(value) = self._supports_all_drives { - params.push(("supportsAllDrives", value.to_string())); - } - if let Some(value) = self._send_notification_emails { - params.push(("sendNotificationEmails", value.to_string())); - } - if let Some(value) = self._email_message { - params.push(("emailMessage", value.to_string())); - } - for &field in ["alt", "fileId", "useDomainAdminAccess", "supportsTeamDrives", "supportsAllDrives", "sendNotificationEmails", "emailMessage"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{fileId}", "fileId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Permission) -> PermissionInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID for the file or shared drive. - /// - /// Sets the *file id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn file_id(mut self, new_value: &str) -> PermissionInsertCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. - /// - /// Sets the *use domain admin access* query property to the given value. - pub fn use_domain_admin_access(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { - self._use_domain_admin_access = Some(new_value); - self - } - /// Deprecated use supportsAllDrives instead. - /// - /// Sets the *supports team drives* query property to the given value. - pub fn supports_team_drives(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { - self._supports_team_drives = Some(new_value); - self - } - /// Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. - /// - /// Sets the *supports all drives* query property to the given value. - pub fn supports_all_drives(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { - self._supports_all_drives = Some(new_value); - self - } - /// Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner. - /// - /// Sets the *send notification emails* query property to the given value. - pub fn send_notification_emails(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { - self._send_notification_emails = Some(new_value); - self - } - /// A plain text custom message to include in notification emails. - /// - /// Sets the *email message* query property to the given value. - pub fn email_message(mut self, new_value: &str) -> PermissionInsertCall<'a, C, A> { - self._email_message = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PermissionInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> PermissionInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> PermissionInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns the permission ID for an email address. /// /// A builder for the *getIdForEmail* method supported by a *permission* resource. @@ -21618,10 +21101,10 @@ impl<'a, C, A> PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut ChangeListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().get("changeId") -/// .team_drive_id("sadipscing") +/// .team_drive_id("diam") /// .supports_team_drives(true) /// .supports_all_drives(false) -/// .drive_id("sit") +/// .drive_id("erat") /// .doit(); /// # } /// ``` @@ -22530,19 +22013,19 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().watch(req) -/// .team_drive_id("dolore") -/// .supports_team_drives(true) -/// .supports_all_drives(true) -/// .start_change_id("sit") -/// .spaces("ut") -/// .page_token("diam") -/// .max_results(-39) +/// .team_drive_id("dolores") +/// .supports_team_drives(false) +/// .supports_all_drives(false) +/// .start_change_id("clita") +/// .spaces("sed") +/// .page_token("dolores") +/// .max_results(-13) /// .include_team_drive_items(false) -/// .include_subscribed(false) -/// .include_items_from_all_drives(true) -/// .include_deleted(false) +/// .include_subscribed(true) +/// .include_items_from_all_drives(false) +/// .include_deleted(true) /// .include_corpus_removals(false) -/// .drive_id("clita") +/// .drive_id("labore") /// .doit(); /// # } /// ``` @@ -22890,259 +22373,6 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o } -/// Deletes a property. -/// -/// A builder for the *delete* method supported by a *property* resource. -/// It is not used directly, but through a `PropertyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive2 as drive2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive2::DriveHub; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.properties().delete("fileId", "propertyKey") -/// .visibility("clita") -/// .doit(); -/// # } -/// ``` -pub struct PropertyDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DriveHub, - _file_id: String, - _property_key: String, - _visibility: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for PropertyDeleteCall<'a, C, A> {} - -impl<'a, C, A> PropertyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "drive.properties.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("fileId", self._file_id.to_string())); - params.push(("propertyKey", self._property_key.to_string())); - if let Some(value) = self._visibility { - params.push(("visibility", value.to_string())); - } - for &field in ["fileId", "propertyKey", "visibility"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{fileId}", "fileId"), ("{propertyKey}", "propertyKey")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["propertyKey", "fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the file. - /// - /// Sets the *file id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn file_id(mut self, new_value: &str) -> PropertyDeleteCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// The key of the property. - /// - /// Sets the *property key* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn property_key(mut self, new_value: &str) -> PropertyDeleteCall<'a, C, A> { - self._property_key = new_value.to_string(); - self - } - /// The visibility of the property. - /// - /// Sets the *visibility* query property to the given value. - pub fn visibility(mut self, new_value: &str) -> PropertyDeleteCall<'a, C, A> { - self._visibility = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PropertyDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> PropertyDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> PropertyDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Adds a property to a file, or updates it if it already exists. /// /// A builder for the *insert* method supported by a *property* resource. @@ -23414,6 +22644,259 @@ impl<'a, C, A> PropertyInsertCall<'a, C, A> where C: BorrowMut, A } +/// Deletes a property. +/// +/// A builder for the *delete* method supported by a *property* resource. +/// It is not used directly, but through a `PropertyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::DriveHub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.properties().delete("fileId", "propertyKey") +/// .visibility("erat") +/// .doit(); +/// # } +/// ``` +pub struct PropertyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DriveHub, + _file_id: String, + _property_key: String, + _visibility: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PropertyDeleteCall<'a, C, A> {} + +impl<'a, C, A> PropertyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.properties.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("fileId", self._file_id.to_string())); + params.push(("propertyKey", self._property_key.to_string())); + if let Some(value) = self._visibility { + params.push(("visibility", value.to_string())); + } + for &field in ["fileId", "propertyKey", "visibility"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{fileId}", "fileId"), ("{propertyKey}", "propertyKey")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["propertyKey", "fileId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the file. + /// + /// Sets the *file id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn file_id(mut self, new_value: &str) -> PropertyDeleteCall<'a, C, A> { + self._file_id = new_value.to_string(); + self + } + /// The key of the property. + /// + /// Sets the *property key* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn property_key(mut self, new_value: &str) -> PropertyDeleteCall<'a, C, A> { + self._property_key = new_value.to_string(); + self + } + /// The visibility of the property. + /// + /// Sets the *visibility* query property to the given value. + pub fn visibility(mut self, new_value: &str) -> PropertyDeleteCall<'a, C, A> { + self._visibility = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PropertyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PropertyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PropertyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists a file's properties. /// /// A builder for the *list* method supported by a *property* resource. @@ -23688,7 +23171,7 @@ impl<'a, C, A> PropertyListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().update(req, "fileId", "propertyKey") -/// .visibility("sit") +/// .visibility("voluptua.") /// .doit(); /// # } /// ``` @@ -23983,7 +23466,7 @@ impl<'a, C, A> PropertyUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().patch(req, "fileId", "propertyKey") -/// .visibility("erat") +/// .visibility("labore") /// .doit(); /// # } /// ``` @@ -24272,7 +23755,7 @@ impl<'a, C, A> PropertyPatchCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().get("fileId", "propertyKey") -/// .visibility("et") +/// .visibility("dolor") /// .doit(); /// # } /// ``` @@ -24508,289 +23991,6 @@ impl<'a, C, A> PropertyGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Updates a revision. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *revision* resource. -/// It is not used directly, but through a `RevisionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive2 as drive2; -/// use drive2::Revision; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive2::DriveHub; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Revision::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.revisions().patch(req, "fileId", "revisionId") -/// .doit(); -/// # } -/// ``` -pub struct RevisionPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a DriveHub, - _request: Revision, - _file_id: String, - _revision_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RevisionPatchCall<'a, C, A> {} - -impl<'a, C, A> RevisionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Revision)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "drive.revisions.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("fileId", self._file_id.to_string())); - params.push(("revisionId", self._revision_id.to_string())); - for &field in ["alt", "fileId", "revisionId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{fileId}", "fileId"), ("{revisionId}", "revisionId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["revisionId", "fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Revision) -> RevisionPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID for the file. - /// - /// Sets the *file id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn file_id(mut self, new_value: &str) -> RevisionPatchCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// The ID for the revision. - /// - /// Sets the *revision id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn revision_id(mut self, new_value: &str) -> RevisionPatchCall<'a, C, A> { - self._revision_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RevisionPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RevisionPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RevisionPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Gets a specific revision. /// /// A builder for the *get* method supported by a *revision* resource. @@ -25284,6 +24484,289 @@ impl<'a, C, A> RevisionDeleteCall<'a, C, A> where C: BorrowMut, A } +/// Updates a revision. +/// +/// A builder for the *patch* method supported by a *revision* resource. +/// It is not used directly, but through a `RevisionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// use drive2::Revision; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::DriveHub; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = DriveHub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Revision::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.revisions().patch(req, "fileId", "revisionId") +/// .doit(); +/// # } +/// ``` +pub struct RevisionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a DriveHub, + _request: Revision, + _file_id: String, + _revision_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RevisionPatchCall<'a, C, A> {} + +impl<'a, C, A> RevisionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Revision)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.revisions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("fileId", self._file_id.to_string())); + params.push(("revisionId", self._revision_id.to_string())); + for &field in ["alt", "fileId", "revisionId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{fileId}", "fileId"), ("{revisionId}", "revisionId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["revisionId", "fileId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Revision) -> RevisionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID for the file. + /// + /// Sets the *file id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn file_id(mut self, new_value: &str) -> RevisionPatchCall<'a, C, A> { + self._file_id = new_value.to_string(); + self + } + /// The ID for the revision. + /// + /// Sets the *revision id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn revision_id(mut self, new_value: &str) -> RevisionPatchCall<'a, C, A> { + self._revision_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RevisionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RevisionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RevisionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates a revision. /// /// A builder for the *update* method supported by a *revision* resource. @@ -25595,8 +25078,8 @@ impl<'a, C, A> RevisionUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.revisions().list("fileId") -/// .page_token("takimata") -/// .max_results(-28) +/// .page_token("et") +/// .max_results(-96) /// .doit(); /// # } /// ``` diff --git a/gen/drive3-cli/Cargo.toml b/gen/drive3-cli/Cargo.toml index 8b8f546482..788cb1751f 100644 --- a/gen/drive3-cli/Cargo.toml +++ b/gen/drive3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-drive3-cli" -version = "1.0.12+20190620" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-drive3] path = "../drive3" -version = "1.0.12+20190620" +version = "1.0.13+20200326" diff --git a/gen/drive3-cli/README.md b/gen/drive3-cli/README.md index 0b790ea897..98dc915bdf 100644 --- a/gen/drive3-cli/README.md +++ b/gen/drive3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *drive* API at revision *20190620*. The CLI is at version *1.0.12*. +This documentation was generated from the *drive* API at revision *20200326*. The CLI is at version *1.0.13*. ```bash drive3 [options] diff --git a/gen/drive3-cli/mkdocs.yml b/gen/drive3-cli/mkdocs.yml index 1c0068039f..54a5874567 100644 --- a/gen/drive3-cli/mkdocs.yml +++ b/gen/drive3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.12+20190620 +site_name: drive v1.0.13+20200326 site_url: http://byron.github.io/google-apis-rs/google-drive3-cli site_description: A complete library to interact with drive (protocol v3) diff --git a/gen/drive3-cli/src/main.rs b/gen/drive3-cli/src/main.rs index 506ab42406..5739fedcb6 100644 --- a/gen/drive3-cli/src/main.rs +++ b/gen/drive3-cli/src/main.rs @@ -1379,7 +1379,8 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.photo-link" => Some(("sharingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-id" => Some(("shortcutDetails.targetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-mime-type" => Some(("shortcutDetails.targetMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.height" => Some(("videoMediaMetadata.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1398,10 +1399,12 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-within-team-drive" => Some(("capabilities.canMoveChildrenWithinTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-modify-content" => Some(("capabilities.canModifyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-drive" => Some(("capabilities.canReadDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash-children" => Some(("capabilities.canTrashChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-my-drive-parent" => Some(("capabilities.canAddMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-within-drive" => Some(("capabilities.canMoveChildrenWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-item-within-drive" => Some(("capabilities.canMoveItemWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1412,6 +1415,7 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-out-of-drive" => Some(("capabilities.canMoveChildrenOutOfDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-change-viewers-can-copy-content" => Some(("capabilities.canChangeViewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-my-drive-parent" => Some(("capabilities.canRemoveMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1427,7 +1431,7 @@ impl<'n> Engine<'n> { "shared-with-me-time" => Some(("sharedWithMeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "export-links" => Some(("exportLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "shared" => Some(("shared", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "copy-requires-writer-permission" => Some(("copyRequiresWriterPermission", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "viewers-can-copy-content" => Some(("viewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1465,6 +1469,7 @@ impl<'n> Engine<'n> { "image-media-metadata.white-balance" => Some(("imageMediaMetadata.whiteBalance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "copy-requires-writer-permission" => Some(("copyRequiresWriterPermission", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trashing-user.me" => Some(("trashingUser.me", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1485,7 +1490,7 @@ impl<'n> Engine<'n> { "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-copy-requires-writer-permission", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "content-hints", "copy-requires-writer-permission", "created-time", "description", "display-name", "drive-id", "duration-millis", "email-address", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-add-my-drive-parent", "can-change-copy-requires-writer-permission", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-modify-content", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-remove-my-drive-parent", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "content-hints", "copy-requires-writer-permission", "created-time", "description", "display-name", "drive-id", "duration-millis", "email-address", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "shortcut-details", "size", "spaces", "starred", "subject-distance", "target-id", "target-mime-type", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1514,6 +1519,9 @@ impl<'n> Engine<'n> { "ignore-default-visibility" => { call = call.ignore_default_visibility(arg_from_str(value.unwrap_or("false"), err, "ignore-default-visibility", "boolean")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1527,7 +1535,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["keep-revision-forever", "ignore-default-visibility", "ocr-language", "supports-team-drives", "supports-all-drives"].iter().map(|v|*v)); + v.extend(["enforce-single-parent", "keep-revision-forever", "ocr-language", "ignore-default-visibility", "supports-all-drives", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -1601,7 +1609,8 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.photo-link" => Some(("sharingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-id" => Some(("shortcutDetails.targetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-mime-type" => Some(("shortcutDetails.targetMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.height" => Some(("videoMediaMetadata.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1620,10 +1629,12 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-within-team-drive" => Some(("capabilities.canMoveChildrenWithinTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-modify-content" => Some(("capabilities.canModifyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-drive" => Some(("capabilities.canReadDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash-children" => Some(("capabilities.canTrashChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-my-drive-parent" => Some(("capabilities.canAddMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-within-drive" => Some(("capabilities.canMoveChildrenWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-item-within-drive" => Some(("capabilities.canMoveItemWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1634,6 +1645,7 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-out-of-drive" => Some(("capabilities.canMoveChildrenOutOfDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-change-viewers-can-copy-content" => Some(("capabilities.canChangeViewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-my-drive-parent" => Some(("capabilities.canRemoveMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1649,7 +1661,7 @@ impl<'n> Engine<'n> { "shared-with-me-time" => Some(("sharedWithMeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "export-links" => Some(("exportLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "shared" => Some(("shared", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "copy-requires-writer-permission" => Some(("copyRequiresWriterPermission", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "viewers-can-copy-content" => Some(("viewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1687,6 +1699,7 @@ impl<'n> Engine<'n> { "image-media-metadata.white-balance" => Some(("imageMediaMetadata.whiteBalance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "copy-requires-writer-permission" => Some(("copyRequiresWriterPermission", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trashing-user.me" => Some(("trashingUser.me", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1707,7 +1720,7 @@ impl<'n> Engine<'n> { "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-copy-requires-writer-permission", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "content-hints", "copy-requires-writer-permission", "created-time", "description", "display-name", "drive-id", "duration-millis", "email-address", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-add-my-drive-parent", "can-change-copy-requires-writer-permission", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-modify-content", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-remove-my-drive-parent", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "content-hints", "copy-requires-writer-permission", "created-time", "description", "display-name", "drive-id", "duration-millis", "email-address", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "shortcut-details", "size", "spaces", "starred", "subject-distance", "target-id", "target-mime-type", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1739,6 +1752,9 @@ impl<'n> Engine<'n> { "ignore-default-visibility" => { call = call.ignore_default_visibility(arg_from_str(value.unwrap_or("false"), err, "ignore-default-visibility", "boolean")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1752,7 +1768,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["keep-revision-forever", "use-content-as-indexable-text", "ocr-language", "ignore-default-visibility", "supports-all-drives", "supports-team-drives"].iter().map(|v|*v)); + v.extend(["enforce-single-parent", "keep-revision-forever", "use-content-as-indexable-text", "ocr-language", "ignore-default-visibility", "supports-all-drives", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -2204,7 +2220,8 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.photo-link" => Some(("sharingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-id" => Some(("shortcutDetails.targetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "shortcut-details.target-mime-type" => Some(("shortcutDetails.targetMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.height" => Some(("videoMediaMetadata.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2223,10 +2240,12 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-within-team-drive" => Some(("capabilities.canMoveChildrenWithinTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-modify-content" => Some(("capabilities.canModifyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-drive" => Some(("capabilities.canReadDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash-children" => Some(("capabilities.canTrashChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-my-drive-parent" => Some(("capabilities.canAddMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-children-within-drive" => Some(("capabilities.canMoveChildrenWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-item-within-drive" => Some(("capabilities.canMoveItemWithinDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2237,6 +2256,7 @@ impl<'n> Engine<'n> { "capabilities.can-move-children-out-of-drive" => Some(("capabilities.canMoveChildrenOutOfDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-change-viewers-can-copy-content" => Some(("capabilities.canChangeViewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-my-drive-parent" => Some(("capabilities.canRemoveMyDriveParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2252,7 +2272,7 @@ impl<'n> Engine<'n> { "shared-with-me-time" => Some(("sharedWithMeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "export-links" => Some(("exportLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "shared" => Some(("shared", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "copy-requires-writer-permission" => Some(("copyRequiresWriterPermission", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "size" => Some(("size", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "viewers-can-copy-content" => Some(("viewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2290,6 +2310,7 @@ impl<'n> Engine<'n> { "image-media-metadata.white-balance" => Some(("imageMediaMetadata.whiteBalance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "copy-requires-writer-permission" => Some(("copyRequiresWriterPermission", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trashing-user.me" => Some(("trashingUser.me", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2310,7 +2331,7 @@ impl<'n> Engine<'n> { "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-copy-requires-writer-permission", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "content-hints", "copy-requires-writer-permission", "created-time", "description", "display-name", "drive-id", "duration-millis", "email-address", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-add-my-drive-parent", "can-change-copy-requires-writer-permission", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-delete-children", "can-download", "can-edit", "can-list-children", "can-modify-content", "can-move-children-out-of-drive", "can-move-children-out-of-team-drive", "can-move-children-within-drive", "can-move-children-within-team-drive", "can-move-item-into-team-drive", "can-move-item-out-of-drive", "can-move-item-out-of-team-drive", "can-move-item-within-drive", "can-move-item-within-team-drive", "can-move-team-drive-item", "can-read-drive", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-remove-my-drive-parent", "can-rename", "can-share", "can-trash", "can-trash-children", "can-untrash", "capabilities", "color-space", "content-hints", "copy-requires-writer-permission", "created-time", "description", "display-name", "drive-id", "duration-millis", "email-address", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "permission-ids", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "shortcut-details", "size", "spaces", "starred", "subject-distance", "target-id", "target-mime-type", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2342,6 +2363,9 @@ impl<'n> Engine<'n> { "keep-revision-forever" => { call = call.keep_revision_forever(arg_from_str(value.unwrap_or("false"), err, "keep-revision-forever", "boolean")); }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, "add-parents" => { call = call.add_parents(value.unwrap_or("")); }, @@ -2358,7 +2382,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["add-parents", "keep-revision-forever", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "remove-parents"].iter().map(|v|*v)); + v.extend(["add-parents", "enforce-single-parent", "keep-revision-forever", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "supports-all-drives", "remove-parents"].iter().map(|v|*v)); v } )); } } @@ -2573,6 +2597,12 @@ impl<'n> Engine<'n> { "send-notification-email" => { call = call.send_notification_email(arg_from_str(value.unwrap_or("false"), err, "send-notification-email", "boolean")); }, + "move-to-new-owners-root" => { + call = call.move_to_new_owners_root(arg_from_str(value.unwrap_or("false"), err, "move-to-new-owners-root", "boolean")); + }, + "enforce-single-parent" => { + call = call.enforce_single_parent(arg_from_str(value.unwrap_or("false"), err, "enforce-single-parent", "boolean")); + }, "email-message" => { call = call.email_message(value.unwrap_or("")); }, @@ -2589,7 +2619,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["send-notification-email", "supports-team-drives", "supports-all-drives", "use-domain-admin-access", "transfer-ownership", "email-message"].iter().map(|v|*v)); + v.extend(["move-to-new-owners-root", "enforce-single-parent", "send-notification-email", "supports-team-drives", "supports-all-drives", "use-domain-admin-access", "transfer-ownership", "email-message"].iter().map(|v|*v)); v } )); } } @@ -5417,7 +5447,7 @@ fn main() { let mut app = App::new("drive3") .author("Sebastian Thiel ") - .version("1.0.12+20190620") + .version("1.0.13+20200326") .about("Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_drive3_cli") .arg(Arg::with_name("url") diff --git a/gen/drive3/Cargo.toml b/gen/drive3/Cargo.toml index 26c09db405..e4eb945325 100644 --- a/gen/drive3/Cargo.toml +++ b/gen/drive3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive3" -version = "1.0.12+20190620" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with drive (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/drive3" homepage = "https://developers.google.com/drive/" -documentation = "https://docs.rs/google-drive3/1.0.12+20190620" +documentation = "https://docs.rs/google-drive3/1.0.13+20200326" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/drive3/README.md b/gen/drive3/README.md index 5aa7aa0dc4..d710a4d841 100644 --- a/gen/drive3/README.md +++ b/gen/drive3/README.md @@ -5,55 +5,55 @@ DO NOT EDIT ! --> The `google-drive3` library allows access to all features of the *Google drive* service. -This documentation was generated from *drive* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *drive* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *drive* *v3* API can be found at the [official documentation site](https://developers.google.com/drive/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveHub.html) ... -* [about](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.About.html) - * [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.AboutGetCall.html) -* [changes](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.Change.html) - * [*get start page token*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ChangeWatchCall.html) -* [channels](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.Channel.html) - * [*stop*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ChannelStopCall.html) -* [comments](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.Comment.html) - * [*create*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.CommentCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.CommentGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.CommentListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.CommentUpdateCall.html) -* [drives](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.Drive.html) - * [*create*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveGetCall.html), [*hide*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveHideCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveListCall.html), [*unhide*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveUnhideCall.html) and [*update*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveUpdateCall.html) -* [files](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.File.html) - * [*copy*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileCopyCall.html), [*create*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileListCall.html), [*update*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileWatchCall.html) -* [permissions](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.Permission.html) - * [*create*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.PermissionCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.PermissionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.PermissionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.PermissionUpdateCall.html) -* [replies](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.Reply.html) - * [*create*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ReplyCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ReplyGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ReplyListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ReplyUpdateCall.html) -* [revisions](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.Revision.html) - * [*delete*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.RevisionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.RevisionUpdateCall.html) +* [about](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.About.html) + * [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.AboutGetCall.html) +* [changes](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.Change.html) + * [*get start page token*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ChannelStopCall.html) +* [comments](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.Comment.html) + * [*create*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.CommentCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.CommentGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.CommentListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.CommentUpdateCall.html) +* [drives](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.Drive.html) + * [*create*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveGetCall.html), [*hide*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveHideCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveListCall.html), [*unhide*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveUnhideCall.html) and [*update*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveUpdateCall.html) +* [files](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.File.html) + * [*copy*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileCopyCall.html), [*create*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileListCall.html), [*update*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileWatchCall.html) +* [permissions](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.Permission.html) + * [*create*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.PermissionCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.PermissionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.PermissionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.PermissionUpdateCall.html) +* [replies](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.Reply.html) + * [*create*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ReplyCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ReplyGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ReplyListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.RevisionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.RevisionUpdateCall.html) * teamdrives - * [*create*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.TeamdriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.TeamdriveGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.TeamdriveUpdateCall.html) + * [*create*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.TeamdriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.TeamdriveGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*update files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileUpdateCall.html) -* [*create files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileCreateCall.html) +* [*update files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileUpdateCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileCreateCall.html) Download supported by ... -* [*watch files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileWatchCall.html) -* [*export files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileExportCall.html) -* [*get revisions*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.RevisionGetCall.html) -* [*get files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileGetCall.html) +* [*watch files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileWatchCall.html) +* [*export files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileExportCall.html) +* [*get revisions*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.RevisionGetCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileGetCall.html) Subscription supported by ... -* [*watch files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileWatchCall.html) -* [*list changes*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ChangeListCall.html) -* [*create files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileCreateCall.html) -* [*get files*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.FileGetCall.html) -* [*watch changes*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.ChangeWatchCall.html) +* [*watch files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileWatchCall.html) +* [*list changes*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ChangeListCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileCreateCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.FileGetCall.html) +* [*watch changes*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.ChangeWatchCall.html) @@ -61,17 +61,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/struct.DriveHub.html)** +* **[Hub](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/struct.DriveHub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -184,17 +184,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -204,29 +204,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-drive3/1.0.12+20190620/google_drive3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive3/1.0.13+20200326/google_drive3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/drive3/src/lib.rs b/gen/drive3/src/lib.rs index beb93a3fc4..5f452a7cf4 100644 --- a/gen/drive3/src/lib.rs +++ b/gen/drive3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *drive* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *drive* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *drive* *v3* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -418,7 +418,7 @@ impl<'a, C, A> DriveHub DriveHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/drive/v3/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -456,7 +456,7 @@ impl<'a, C, A> DriveHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -506,7 +506,7 @@ pub struct Comment { /// The last time the comment or any of its replies was modified (RFC 3339 date-time). #[serde(rename="modifiedTime")] pub modified_time: Option, - /// The user who created the comment. + /// The author of the comment. The author's email address and permission ID will not be populated. pub author: Option, /// Whether the comment has been deleted. A deleted comment has no content. pub deleted: Option, @@ -947,7 +947,7 @@ pub struct FileImageMediaMetadata { pub lens: Option, /// The aperture used to create the photo (f-number). pub aperture: Option, - /// The rotation in clockwise degrees from the image's original orientation. + /// The number of clockwise 90 degree rotations applied from the image's original orientation. pub rotation: Option, /// The white balance mode used to create the photo. #[serde(rename="whiteBalance")] @@ -1031,7 +1031,7 @@ pub struct Reply { /// The last time the reply was modified (RFC 3339 date-time). #[serde(rename="modifiedTime")] pub modified_time: Option, - /// The user who created the reply. + /// The author of the reply. The author's email address and permission ID will not be populated. pub author: Option, /// Whether the reply has been deleted. A deleted reply has no content. pub deleted: Option, @@ -1217,6 +1217,24 @@ pub struct CommentList { impl ResponseResult for CommentList {} +/// Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileShortcutDetails { + /// The ID of the file that this shortcut points to. + #[serde(rename="targetId")] + pub target_id: Option, + /// The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. + #[serde(rename="targetMimeType")] + pub target_mime_type: Option, +} + +impl NestedType for FileShortcutDetails {} +impl Part for FileShortcutDetails {} + + /// Additional information about the content of the file. These fields are never populated in responses. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1317,7 +1335,11 @@ impl Part for DriveCapabilities {} pub struct Permission { /// The domain to which this permission refers. pub domain: Option, - /// A displayable name for users, groups or domains. + /// The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: + /// - user - User's full name, as defined for their Google account, such as "Joe Smith." + /// - group - Name of the Google Group, such as "The Company Administrators." + /// - domain - String domain name, such as "thecompany.com." + /// - anyone - No displayName is present. #[serde(rename="displayName")] pub display_name: Option, /// Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. @@ -1357,10 +1379,10 @@ pub struct Permission { /// - user /// - group /// - domain - /// - anyone + /// - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type. #[serde(rename="type")] pub type_: Option, - /// The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. + /// The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values. pub id: Option, } @@ -1381,60 +1403,27 @@ pub struct FileCapabilities { /// Whether the current user can restore this file from trash. #[serde(rename="canUntrash")] pub can_untrash: Option, - /// Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. - #[serde(rename="canCopy")] - pub can_copy: Option, - /// Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. - #[serde(rename="canMoveItemWithinDrive")] - pub can_move_item_within_drive: Option, - /// Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. - #[serde(rename="canReadRevisions")] - pub can_read_revisions: Option, - /// Deprecated - use canMoveItemOutOfDrive instead. - #[serde(rename="canMoveItemIntoTeamDrive")] - pub can_move_item_into_team_drive: Option, /// Deprecated - use canMoveItemWithinDrive instead. #[serde(rename="canMoveItemWithinTeamDrive")] pub can_move_item_within_team_drive: Option, - /// Deprecated - use canMoveItemOutOfDrive instead. - #[serde(rename="canMoveItemOutOfTeamDrive")] - pub can_move_item_out_of_team_drive: Option, /// Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. #[serde(rename="canDeleteChildren")] pub can_delete_children: Option, - /// Whether the current user can change the copyRequiresWriterPermission restriction of this file. - #[serde(rename="canChangeCopyRequiresWriterPermission")] - pub can_change_copy_requires_writer_permission: Option, - /// Whether the current user can download this file. - #[serde(rename="canDownload")] - pub can_download: Option, - /// Whether the current user can edit this file. - #[serde(rename="canEdit")] - pub can_edit: Option, /// Deprecated - use canMoveChildrenWithinDrive instead. #[serde(rename="canMoveChildrenWithinTeamDrive")] pub can_move_children_within_team_drive: Option, - /// Whether the current user can comment on this file. - #[serde(rename="canComment")] - pub can_comment: Option, /// Whether the current user can list the children of this folder. This is always false when the item is not a folder. #[serde(rename="canListChildren")] pub can_list_children: Option, /// Whether the current user can rename this file. #[serde(rename="canRename")] pub can_rename: Option, - /// Whether the current user can move this file to trash. - #[serde(rename="canTrash")] - pub can_trash: Option, - /// Whether the current user can delete this file. - #[serde(rename="canDelete")] - pub can_delete: Option, + /// Whether the current user can modify the content of this file. + #[serde(rename="canModifyContent")] + pub can_modify_content: Option, /// Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. #[serde(rename="canReadDrive")] pub can_read_drive: Option, - /// Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. - #[serde(rename="canMoveTeamDriveItem")] - pub can_move_team_drive_item: Option, /// Whether the current user can add children to this folder. This is always false when the item is not a folder. #[serde(rename="canAddChildren")] pub can_add_children: Option, @@ -1444,12 +1433,54 @@ pub struct FileCapabilities { /// Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. #[serde(rename="canTrashChildren")] pub can_trash_children: Option, - /// Deprecated - #[serde(rename="canChangeViewersCanCopyContent")] - pub can_change_viewers_can_copy_content: Option, + /// Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. + #[serde(rename="canAddMyDriveParent")] + pub can_add_my_drive_parent: Option, + /// Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. + #[serde(rename="canMoveChildrenWithinDrive")] + pub can_move_children_within_drive: Option, + /// Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. + #[serde(rename="canReadRevisions")] + pub can_read_revisions: Option, + /// Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. + #[serde(rename="canMoveItemWithinDrive")] + pub can_move_item_within_drive: Option, + /// Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. + #[serde(rename="canCopy")] + pub can_copy: Option, + /// Deprecated - use canMoveItemOutOfDrive instead. + #[serde(rename="canMoveItemIntoTeamDrive")] + pub can_move_item_into_team_drive: Option, + /// Deprecated - use canMoveItemOutOfDrive instead. + #[serde(rename="canMoveItemOutOfTeamDrive")] + pub can_move_item_out_of_team_drive: Option, + /// Whether the current user can comment on this file. + #[serde(rename="canComment")] + pub can_comment: Option, /// Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. #[serde(rename="canMoveChildrenOutOfDrive")] pub can_move_children_out_of_drive: Option, + /// Deprecated + #[serde(rename="canChangeViewersCanCopyContent")] + pub can_change_viewers_can_copy_content: Option, + /// Whether the current user can move this file to trash. + #[serde(rename="canTrash")] + pub can_trash: Option, + /// Whether the current user can delete this file. + #[serde(rename="canDelete")] + pub can_delete: Option, + /// Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. + #[serde(rename="canRemoveMyDriveParent")] + pub can_remove_my_drive_parent: Option, + /// Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. + #[serde(rename="canMoveTeamDriveItem")] + pub can_move_team_drive_item: Option, + /// Whether the current user can download this file. + #[serde(rename="canDownload")] + pub can_download: Option, + /// Whether the current user can change the copyRequiresWriterPermission restriction of this file. + #[serde(rename="canChangeCopyRequiresWriterPermission")] + pub can_change_copy_requires_writer_permission: Option, /// Deprecated - use canMoveChildrenOutOfDrive instead. #[serde(rename="canMoveChildrenOutOfTeamDrive")] pub can_move_children_out_of_team_drive: Option, @@ -1459,9 +1490,9 @@ pub struct FileCapabilities { /// Deprecated - use canReadDrive instead. #[serde(rename="canReadTeamDrive")] pub can_read_team_drive: Option, - /// Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. - #[serde(rename="canMoveChildrenWithinDrive")] - pub can_move_children_within_drive: Option, + /// Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. + #[serde(rename="canEdit")] + pub can_edit: Option, } impl NestedType for FileCapabilities {} @@ -1582,7 +1613,7 @@ pub struct PermissionPermissionDetails { /// - commenter /// - reader pub role: Option, - /// The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. + /// The ID of the item from which this permission is inherited. This is an output-only field. #[serde(rename="inheritedFrom")] pub inherited_from: Option, } @@ -1720,8 +1751,9 @@ pub struct File { /// The user who shared the file with the requesting user, if applicable. #[serde(rename="sharingUser")] pub sharing_user: Option, - /// The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. - pub size: Option, + /// Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. + #[serde(rename="shortcutDetails")] + pub shortcut_details: Option, /// Additional metadata about video media. This may not be available immediately upon upload. #[serde(rename="videoMediaMetadata")] pub video_media_metadata: Option, @@ -1757,9 +1789,8 @@ pub struct File { pub export_links: Option>, /// Whether the file has been shared. Not populated for items in shared drives. pub shared: Option, - /// Whether the options to copy, print, or download this file, should be disabled for readers and commenters. - #[serde(rename="copyRequiresWriterPermission")] - pub copy_requires_writer_permission: Option, + /// The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. + pub size: Option, /// The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. /// This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. #[serde(rename="fullFileExtension")] @@ -1807,6 +1838,9 @@ pub struct File { pub viewers_can_copy_content: Option, /// The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. pub owners: Option>, + /// Whether the options to copy, print, or download this file, should be disabled for readers and commenters. + #[serde(rename="copyRequiresWriterPermission")] + pub copy_requires_writer_permission: Option, /// The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. pub name: Option, /// A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. @@ -1831,7 +1865,7 @@ pub struct File { /// The final component of fullFileExtension. This is only available for files with binary content in Google Drive. #[serde(rename="fileExtension")] pub file_extension: Option, - /// Whether any users are granted file access directly on this file. This field is only populated for shared drive files. + /// Whether there are permissions directly on this file. This field is only populated for items in shared drives. #[serde(rename="hasAugmentedPermissions")] pub has_augmented_permissions: Option, /// Whether the user has starred the file. @@ -2102,6 +2136,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _ocr_language: Default::default(), _keep_revision_forever: Default::default(), _ignore_default_visibility: Default::default(), + _enforce_single_parent: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2176,6 +2211,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _ocr_language: Default::default(), _keep_revision_forever: Default::default(), _ignore_default_visibility: Default::default(), + _enforce_single_parent: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2201,6 +2237,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _remove_parents: Default::default(), _ocr_language: Default::default(), _keep_revision_forever: Default::default(), + _enforce_single_parent: Default::default(), _add_parents: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -3084,6 +3121,8 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { _supports_team_drives: Default::default(), _supports_all_drives: Default::default(), _send_notification_email: Default::default(), + _move_to_new_owners_root: Default::default(), + _enforce_single_parent: Default::default(), _email_message: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -4201,6 +4240,7 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// .ocr_language("et") /// .keep_revision_forever(true) /// .ignore_default_visibility(false) +/// .enforce_single_parent(true) /// .doit(); /// # } /// ``` @@ -4215,6 +4255,7 @@ pub struct FileCopyCall<'a, C, A> _ocr_language: Option, _keep_revision_forever: Option, _ignore_default_visibility: Option, + _enforce_single_parent: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4236,7 +4277,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "drive.files.copy", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._supports_team_drives { params.push(("supportsTeamDrives", value.to_string())); @@ -4253,7 +4294,10 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut if let Some(value) = self._ignore_default_visibility { params.push(("ignoreDefaultVisibility", value.to_string())); } - for &field in ["alt", "fileId", "supportsTeamDrives", "supportsAllDrives", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility"].iter() { + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } + for &field in ["alt", "fileId", "supportsTeamDrives", "supportsAllDrives", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility", "enforceSingleParent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4420,7 +4464,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut self._ocr_language = Some(new_value.to_string()); self } - /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. + /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. /// /// Sets the *keep revision forever* query property to the given value. pub fn keep_revision_forever(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { @@ -4434,6 +4478,13 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut self._ignore_default_visibility = Some(new_value); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. Requests that specify more than one parent will fail. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4717,19 +4768,19 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().list() -/// .team_drive_id("et") +/// .team_drive_id("amet") /// .supports_team_drives(true) /// .supports_all_drives(true) -/// .spaces("consetetur") -/// .q("ut") -/// .page_token("ea") -/// .page_size(-80) +/// .spaces("ut") +/// .q("ea") +/// .page_token("sed") +/// .page_size(-3) /// .order_by("dolor") /// .include_team_drive_items(true) /// .include_items_from_all_drives(true) -/// .drive_id("et") -/// .corpus("consetetur") -/// .corpora("amet.") +/// .drive_id("consetetur") +/// .corpus("amet.") +/// .corpora("voluptua.") /// .doit(); /// # } /// ``` @@ -5080,8 +5131,8 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().generate_ids() -/// .space("voluptua.") -/// .count(-56) +/// .space("Lorem") +/// .count(-11) /// .doit(); /// # } /// ``` @@ -5319,11 +5370,12 @@ impl<'a, C, A> FileGenerateIdCall<'a, C, A> where C: BorrowMut, A /// // Values shown here are possibly random and not representative ! /// let result = hub.files().create(req) /// .use_content_as_indexable_text(true) -/// .supports_team_drives(true) -/// .supports_all_drives(false) -/// .ocr_language("vero") -/// .keep_revision_forever(true) -/// .ignore_default_visibility(false) +/// .supports_team_drives(false) +/// .supports_all_drives(true) +/// .ocr_language("diam") +/// .keep_revision_forever(false) +/// .ignore_default_visibility(true) +/// .enforce_single_parent(true) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -5338,6 +5390,7 @@ pub struct FileCreateCall<'a, C, A> _ocr_language: Option, _keep_revision_forever: Option, _ignore_default_visibility: Option, + _enforce_single_parent: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5360,7 +5413,7 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.create", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); } @@ -5379,7 +5432,10 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._ignore_default_visibility { params.push(("ignoreDefaultVisibility", value.to_string())); } - for &field in ["alt", "useContentAsIndexableText", "supportsTeamDrives", "supportsAllDrives", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility"].iter() { + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } + for &field in ["alt", "useContentAsIndexableText", "supportsTeamDrives", "supportsAllDrives", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility", "enforceSingleParent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5634,7 +5690,7 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa self._ocr_language = Some(new_value.to_string()); self } - /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. + /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. /// /// Sets the *keep revision forever* query property to the given value. pub fn keep_revision_forever(mut self, new_value: bool) -> FileCreateCall<'a, C, A> { @@ -5648,6 +5704,13 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa self._ignore_default_visibility = Some(new_value); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. Requests that specify more than one parent will fail. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> FileCreateCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -5742,13 +5805,14 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().update(req, "fileId") -/// .use_content_as_indexable_text(true) +/// .use_content_as_indexable_text(false) /// .supports_team_drives(false) /// .supports_all_drives(false) -/// .remove_parents("invidunt") -/// .ocr_language("consetetur") +/// .remove_parents("dolore") +/// .ocr_language("duo") /// .keep_revision_forever(false) -/// .add_parents("duo") +/// .enforce_single_parent(true) +/// .add_parents("et") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -5764,6 +5828,7 @@ pub struct FileUpdateCall<'a, C, A> _remove_parents: Option, _ocr_language: Option, _keep_revision_forever: Option, + _enforce_single_parent: Option, _add_parents: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -5787,7 +5852,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.update", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(11 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(12 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); @@ -5807,10 +5872,13 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._keep_revision_forever { params.push(("keepRevisionForever", value.to_string())); } + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "supportsTeamDrives", "supportsAllDrives", "removeParents", "ocrLanguage", "keepRevisionForever", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "supportsTeamDrives", "supportsAllDrives", "removeParents", "ocrLanguage", "keepRevisionForever", "enforceSingleParent", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6103,13 +6171,20 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._ocr_language = Some(new_value.to_string()); self } - /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. + /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. /// /// Sets the *keep revision forever* query property to the given value. pub fn keep_revision_forever(mut self, new_value: bool) -> FileUpdateCall<'a, C, A> { self._keep_revision_forever = Some(new_value); self } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item will be removed from all current folders and placed in the requested folder. Other requests that increase the number of parents will fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> FileUpdateCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// A comma-separated list of parent IDs to add. /// /// Sets the *add parents* query property to the given value. @@ -6210,7 +6285,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// // Values shown here are possibly random and not representative ! /// let result = hub.files().get("fileId") /// .supports_team_drives(true) -/// .supports_all_drives(true) +/// .supports_all_drives(false) /// .acknowledge_abuse(true) /// .doit(); /// # } @@ -6501,7 +6576,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().get("teamDriveId") -/// .use_domain_admin_access(false) +/// .use_domain_admin_access(true) /// .doit(); /// # } /// ``` @@ -7004,9 +7079,9 @@ impl<'a, C, A> TeamdriveCreateCall<'a, C, A> where C: BorrowMut, /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().list() /// .use_domain_admin_access(true) -/// .q("sanctus") -/// .page_token("takimata") -/// .page_size(-27) +/// .q("labore") +/// .page_token("invidunt") +/// .page_size(-66) /// .doit(); /// # } /// ``` @@ -7493,7 +7568,7 @@ impl<'a, C, A> TeamdriveDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.teamdrives().update(req, "teamDriveId") -/// .use_domain_admin_access(false) +/// .use_domain_admin_access(true) /// .doit(); /// # } /// ``` @@ -8026,7 +8101,7 @@ impl<'a, C, A> DriveCreateCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.drives().update(req, "driveId") -/// .use_domain_admin_access(true) +/// .use_domain_admin_access(false) /// .doit(); /// # } /// ``` @@ -8772,10 +8847,10 @@ impl<'a, C, A> DriveDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.drives().list() -/// .use_domain_admin_access(false) -/// .q("sit") -/// .page_token("eirmod") -/// .page_size(-46) +/// .use_domain_admin_access(true) +/// .q("labore") +/// .page_token("sed") +/// .page_size(-16) /// .doit(); /// # } /// ``` @@ -9027,7 +9102,7 @@ impl<'a, C, A> DriveListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.drives().get("driveId") -/// .use_domain_admin_access(true) +/// .use_domain_admin_access(false) /// .doit(); /// # } /// ``` @@ -9760,7 +9835,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().get("fileId", "commentId") -/// .include_deleted(false) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -10578,10 +10653,10 @@ impl<'a, C, A> CommentCreateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("fileId") -/// .start_modified_time("sit") -/// .page_token("diam") -/// .page_size(-37) -/// .include_deleted(false) +/// .start_modified_time("justo") +/// .page_token("est") +/// .page_size(-46) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -11376,8 +11451,8 @@ impl<'a, C, A> ReplyCreateCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().list("fileId", "commentId") -/// .page_token("diam") -/// .page_size(-71) +/// .page_token("clita") +/// .page_size(-37) /// .include_deleted(false) /// .doit(); /// # } @@ -12695,9 +12770,9 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().delete("fileId", "permissionId") -/// .use_domain_admin_access(true) +/// .use_domain_admin_access(false) /// .supports_team_drives(true) -/// .supports_all_drives(false) +/// .supports_all_drives(true) /// .doit(); /// # } /// ``` @@ -12978,10 +13053,10 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().update(req, "fileId", "permissionId") -/// .use_domain_admin_access(true) +/// .use_domain_admin_access(false) /// .transfer_ownership(false) -/// .supports_team_drives(true) -/// .supports_all_drives(false) +/// .supports_team_drives(false) +/// .supports_all_drives(true) /// .remove_expiration(false) /// .doit(); /// # } @@ -13316,10 +13391,10 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().list("fileId") /// .use_domain_admin_access(true) -/// .supports_team_drives(false) -/// .supports_all_drives(true) -/// .page_token("takimata") -/// .page_size(-43) +/// .supports_team_drives(true) +/// .supports_all_drives(false) +/// .page_token("rebum.") +/// .page_size(-6) /// .doit(); /// # } /// ``` @@ -13617,7 +13692,7 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A /// let result = hub.permissions().get("fileId", "permissionId") /// .use_domain_admin_access(true) /// .supports_team_drives(true) -/// .supports_all_drives(true) +/// .supports_all_drives(false) /// .doit(); /// # } /// ``` @@ -13909,12 +13984,14 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().create(req, "fileId") -/// .use_domain_admin_access(true) -/// .transfer_ownership(false) -/// .supports_team_drives(false) -/// .supports_all_drives(false) +/// .use_domain_admin_access(false) +/// .transfer_ownership(true) +/// .supports_team_drives(true) +/// .supports_all_drives(true) /// .send_notification_email(true) -/// .email_message("sea") +/// .move_to_new_owners_root(true) +/// .enforce_single_parent(true) +/// .email_message("dolor") /// .doit(); /// # } /// ``` @@ -13929,6 +14006,8 @@ pub struct PermissionCreateCall<'a, C, A> _supports_team_drives: Option, _supports_all_drives: Option, _send_notification_email: Option, + _move_to_new_owners_root: Option, + _enforce_single_parent: Option, _email_message: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -13951,7 +14030,7 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "drive.permissions.create", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(12 + self._additional_params.len()); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_domain_admin_access { params.push(("useDomainAdminAccess", value.to_string())); @@ -13968,10 +14047,16 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._send_notification_email { params.push(("sendNotificationEmail", value.to_string())); } + if let Some(value) = self._move_to_new_owners_root { + params.push(("moveToNewOwnersRoot", value.to_string())); + } + if let Some(value) = self._enforce_single_parent { + params.push(("enforceSingleParent", value.to_string())); + } if let Some(value) = self._email_message { params.push(("emailMessage", value.to_string())); } - for &field in ["alt", "fileId", "useDomainAdminAccess", "transferOwnership", "supportsTeamDrives", "supportsAllDrives", "sendNotificationEmail", "emailMessage"].iter() { + for &field in ["alt", "fileId", "useDomainAdminAccess", "transferOwnership", "supportsTeamDrives", "supportsAllDrives", "sendNotificationEmail", "moveToNewOwnersRoot", "enforceSingleParent", "emailMessage"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14152,6 +14237,20 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, self._send_notification_email = Some(new_value); self } + /// This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. When set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, when enforceSingleParent=true, parents are not changed. If set to false, when enforceSingleParent=false, existing parents are not changed; however, the file will be added to the new owner's My Drive root folder, unless it is already in the new owner's My Drive. + /// + /// Sets the *move to new owners root* query property to the given value. + pub fn move_to_new_owners_root(mut self, new_value: bool) -> PermissionCreateCall<'a, C, A> { + self._move_to_new_owners_root = Some(new_value); + self + } + /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. See moveToNewOwnersRoot for details. + /// + /// Sets the *enforce single parent* query property to the given value. + pub fn enforce_single_parent(mut self, new_value: bool) -> PermissionCreateCall<'a, C, A> { + self._enforce_single_parent = Some(new_value); + self + } /// A plain text custom message to include in the notification email. /// /// Sets the *email message* query property to the given value. @@ -14246,17 +14345,17 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().list("pageToken") -/// .team_drive_id("eirmod") +/// .team_drive_id("et") /// .supports_team_drives(true) /// .supports_all_drives(true) -/// .spaces("dolor") +/// .spaces("sed") /// .restrict_to_my_drive(true) -/// .page_size(-85) +/// .page_size(-55) /// .include_team_drive_items(true) /// .include_removed(true) /// .include_items_from_all_drives(true) -/// .include_corpus_removals(true) -/// .drive_id("ipsum") +/// .include_corpus_removals(false) +/// .drive_id("takimata") /// .doit(); /// # } /// ``` @@ -14597,10 +14696,10 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().get_start_page_token() -/// .team_drive_id("justo") -/// .supports_team_drives(true) -/// .supports_all_drives(true) -/// .drive_id("dolor") +/// .team_drive_id("et") +/// .supports_team_drives(false) +/// .supports_all_drives(false) +/// .drive_id("sed") /// .doit(); /// # } /// ``` @@ -14858,16 +14957,16 @@ impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut RevisionDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.revisions().list("fileId") -/// .page_token("consetetur") -/// .page_size(-54) +/// .page_token("et") +/// .page_size(-65) /// .doit(); /// # } /// ``` diff --git a/gen/driveactivity2-cli/Cargo.toml b/gen/driveactivity2-cli/Cargo.toml index 9a3abf847e..a704a3bcac 100644 --- a/gen/driveactivity2-cli/Cargo.toml +++ b/gen/driveactivity2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-driveactivity2-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Drive Activity (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/driveactivity2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-driveactivity2] path = "../driveactivity2" -version = "1.0.12+20190702" +version = "1.0.13+20200407" diff --git a/gen/driveactivity2-cli/README.md b/gen/driveactivity2-cli/README.md index 5d2b1551df..24737f2f1a 100644 --- a/gen/driveactivity2-cli/README.md +++ b/gen/driveactivity2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Drive Activity* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Drive Activity* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash driveactivity2 [options] diff --git a/gen/driveactivity2-cli/mkdocs.yml b/gen/driveactivity2-cli/mkdocs.yml index 053f4f245c..a1775a3550 100644 --- a/gen/driveactivity2-cli/mkdocs.yml +++ b/gen/driveactivity2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Drive Activity v1.0.12+20190702 +site_name: Drive Activity v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-driveactivity2-cli site_description: A complete library to interact with Drive Activity (protocol v2) diff --git a/gen/driveactivity2-cli/src/main.rs b/gen/driveactivity2-cli/src/main.rs index a565fd2922..761d1210b9 100644 --- a/gen/driveactivity2-cli/src/main.rs +++ b/gen/driveactivity2-cli/src/main.rs @@ -265,7 +265,7 @@ fn main() { let mut app = App::new("driveactivity2") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200407") .about("Provides a historical view of activity in Google Drive.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_driveactivity2_cli") .arg(Arg::with_name("url") diff --git a/gen/driveactivity2/Cargo.toml b/gen/driveactivity2/Cargo.toml index 345f66ef8d..1880cf5f6a 100644 --- a/gen/driveactivity2/Cargo.toml +++ b/gen/driveactivity2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-driveactivity2" -version = "1.0.12+20190702" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Drive Activity (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/driveactivity2" homepage = "https://developers.google.com/drive/activity/" -documentation = "https://docs.rs/google-driveactivity2/1.0.12+20190702" +documentation = "https://docs.rs/google-driveactivity2/1.0.13+20200407" license = "MIT" keywords = ["driveactivity", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/driveactivity2/README.md b/gen/driveactivity2/README.md index a4ac48d38b..e1223bb93d 100644 --- a/gen/driveactivity2/README.md +++ b/gen/driveactivity2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-driveactivity2` library allows access to all features of the *Google Drive Activity* service. -This documentation was generated from *Drive Activity* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *driveactivity:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Drive Activity* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *driveactivity:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Drive Activity* *v2* API can be found at the [official documentation site](https://developers.google.com/drive/activity/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/struct.DriveActivityHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/struct.DriveActivityHub.html) ... * activity - * [*query*](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/struct.ActivityQueryCall.html) + * [*query*](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/struct.ActivityQueryCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/struct.DriveActivityHub.html)** +* **[Hub](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/struct.DriveActivityHub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.Part.html)** + * **[Parts](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-driveactivity2/1.0.12+20190702/google_driveactivity2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-driveactivity2/1.0.13+20200407/google_driveactivity2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/driveactivity2/src/lib.rs b/gen/driveactivity2/src/lib.rs index f24025e97b..9cf0ef38e4 100644 --- a/gen/driveactivity2/src/lib.rs +++ b/gen/driveactivity2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Drive Activity* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *driveactivity:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Drive Activity* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *driveactivity:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Drive Activity* *v2* API can be found at the //! [official documentation site](https://developers.google.com/drive/activity/). @@ -333,7 +333,7 @@ impl<'a, C, A> DriveActivityHub DriveActivityHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://driveactivity.googleapis.com/".to_string(), _root_url: "https://driveactivity.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> DriveActivityHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -662,6 +662,9 @@ impl Part for Permission {} pub struct Assignment { /// The sub-type of this event. pub subtype: Option, + /// The user to whom the comment was assigned. + #[serde(rename="assignedUser")] + pub assigned_user: Option, } impl Part for Assignment {} @@ -742,7 +745,8 @@ pub struct DriveItem { pub name: Option, /// The title of the Drive item. pub title: Option, - /// The Drive item is a folder. + /// The Drive item is a folder. Includes information about the type of + /// folder. #[serde(rename="driveFolder")] pub drive_folder: Option, /// The Drive item is a file. @@ -803,7 +807,8 @@ pub struct DriveItemReference { pub title: Option, /// This field is deprecated; please use the `driveFolder` field instead. pub folder: Option, - /// The Drive item is a folder. + /// The Drive item is a folder. Includes information about the type of + /// folder. #[serde(rename="driveFolder")] pub drive_folder: Option, } diff --git a/gen/factchecktools1_alpha1-cli/Cargo.toml b/gen/factchecktools1_alpha1-cli/Cargo.toml index 87e81838d5..3eb75e4040 100644 --- a/gen/factchecktools1_alpha1-cli/Cargo.toml +++ b/gen/factchecktools1_alpha1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-factchecktools1_alpha1-cli" -version = "1.0.12+20190703" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Fact Check Tools (protocol v1alpha1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/factchecktools1_alpha1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-factchecktools1_alpha1] path = "../factchecktools1_alpha1" -version = "1.0.12+20190703" +version = "1.0.13+20200409" diff --git a/gen/factchecktools1_alpha1-cli/README.md b/gen/factchecktools1_alpha1-cli/README.md index 6a03fd004a..d4aea77105 100644 --- a/gen/factchecktools1_alpha1-cli/README.md +++ b/gen/factchecktools1_alpha1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Fact Check Tools* API at revision *20190703*. The CLI is at version *1.0.12*. +This documentation was generated from the *Fact Check Tools* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash factchecktools1-alpha1 [options] diff --git a/gen/factchecktools1_alpha1-cli/mkdocs.yml b/gen/factchecktools1_alpha1-cli/mkdocs.yml index b0064213c2..fca8e96e71 100644 --- a/gen/factchecktools1_alpha1-cli/mkdocs.yml +++ b/gen/factchecktools1_alpha1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Fact Check Tools v1.0.12+20190703 +site_name: Fact Check Tools v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-factchecktools1_alpha1-cli site_description: A complete library to interact with Fact Check Tools (protocol v1alpha1) diff --git a/gen/factchecktools1_alpha1-cli/src/main.rs b/gen/factchecktools1_alpha1-cli/src/main.rs index 003c5631b6..0d13d4d047 100644 --- a/gen/factchecktools1_alpha1-cli/src/main.rs +++ b/gen/factchecktools1_alpha1-cli/src/main.rs @@ -737,7 +737,7 @@ fn main() { let mut app = App::new("factchecktools1-alpha1") .author("Sebastian Thiel ") - .version("1.0.12+20190703") + .version("1.0.13+20200409") .about("") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_factchecktools1_alpha1_cli") .arg(Arg::with_name("url") diff --git a/gen/factchecktools1_alpha1/Cargo.toml b/gen/factchecktools1_alpha1/Cargo.toml index 777e4db2f5..b41d2edd2f 100644 --- a/gen/factchecktools1_alpha1/Cargo.toml +++ b/gen/factchecktools1_alpha1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-factchecktools1_alpha1" -version = "1.0.12+20190703" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Fact Check Tools (protocol v1alpha1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/factchecktools1_alpha1" homepage = "https://developers.google.com/fact-check/tools/api/" -documentation = "https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703" +documentation = "https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409" license = "MIT" keywords = ["factchecktools", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/factchecktools1_alpha1/README.md b/gen/factchecktools1_alpha1/README.md index 4080a1858b..33b453e9ce 100644 --- a/gen/factchecktools1_alpha1/README.md +++ b/gen/factchecktools1_alpha1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-factchecktools1_alpha1` library allows access to all features of the *Google Fact Check Tools* service. -This documentation was generated from *Fact Check Tools* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *factchecktools:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Fact Check Tools* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *factchecktools:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Fact Check Tools* *v1_alpha1* API can be found at the [official documentation site](https://developers.google.com/fact-check/tools/api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.FactCheckTools.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.FactCheckTools.html) ... * claims - * [*search*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.ClaimSearchCall.html) + * [*search*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.ClaimSearchCall.html) * pages - * [*create*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.PageCreateCall.html), [*delete*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.PageDeleteCall.html), [*get*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.PageGetCall.html), [*list*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.PageListCall.html) and [*update*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.PageUpdateCall.html) + * [*create*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.PageCreateCall.html), [*delete*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.PageDeleteCall.html), [*get*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.PageGetCall.html), [*list*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.PageListCall.html) and [*update*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.PageUpdateCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/struct.FactCheckTools.html)** +* **[Hub](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/struct.FactCheckTools.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.Part.html)** + * **[Parts](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-factchecktools1_alpha1/1.0.12+20190703/google_factchecktools1_alpha1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-factchecktools1_alpha1/1.0.13+20200409/google_factchecktools1_alpha1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/factchecktools1_alpha1/src/lib.rs b/gen/factchecktools1_alpha1/src/lib.rs index c7adbc5d8c..c4cbdae295 100644 --- a/gen/factchecktools1_alpha1/src/lib.rs +++ b/gen/factchecktools1_alpha1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Fact Check Tools* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *factchecktools:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Fact Check Tools* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *factchecktools:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Fact Check Tools* *v1_alpha1* API can be found at the //! [official documentation site](https://developers.google.com/fact-check/tools/api/). @@ -333,7 +333,7 @@ impl<'a, C, A> FactCheckTools FactCheckTools { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://factchecktools.googleapis.com/".to_string(), _root_url: "https://factchecktools.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> FactCheckTools } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -588,11 +588,19 @@ impl ResponseResult for GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaim /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating { - /// For numeric ratings, the best value possible in the scale from worst to + /// Corresponds to `ClaimReview.reviewRating.ratingExplanation`. + #[serde(rename="ratingExplanation")] + pub rating_explanation: Option, + /// For numeric ratings, the worst value possible in the scale from worst to /// best.
          - /// Corresponds to `ClaimReview.reviewRating.bestRating`. - #[serde(rename="bestRating")] - pub best_rating: Option, + /// Corresponds to `ClaimReview.reviewRating.worstRating`. + #[serde(rename="worstRating")] + pub worst_rating: Option, + /// A numeric rating of this claim, in the range worstRating — bestRating + /// inclusive.
          + /// Corresponds to `ClaimReview.reviewRating.ratingValue`. + #[serde(rename="ratingValue")] + pub rating_value: Option, /// Corresponds to `ClaimReview.reviewRating.image`. #[serde(rename="imageUrl")] pub image_url: Option, @@ -600,16 +608,11 @@ pub struct GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating { /// Corresponds to `ClaimReview.reviewRating.alternateName`. #[serde(rename="textualRating")] pub textual_rating: Option, - /// A numeric rating of this claim, in the range worstRating — bestRating - /// inclusive.
          - /// Corresponds to `ClaimReview.reviewRating.ratingValue`. - #[serde(rename="ratingValue")] - pub rating_value: Option, - /// For numeric ratings, the worst value possible in the scale from worst to + /// For numeric ratings, the best value possible in the scale from worst to /// best.
          - /// Corresponds to `ClaimReview.reviewRating.worstRating`. - #[serde(rename="worstRating")] - pub worst_rating: Option, + /// Corresponds to `ClaimReview.reviewRating.bestRating`. + #[serde(rename="bestRating")] + pub best_rating: Option, } impl Part for GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating {} diff --git a/gen/fcm1-cli/Cargo.toml b/gen/fcm1-cli/Cargo.toml index 9e28e7be43..081c573a07 100644 --- a/gen/fcm1-cli/Cargo.toml +++ b/gen/fcm1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fcm1-cli" -version = "1.0.12+20190703" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Cloud Messaging (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fcm1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-fcm1] path = "../fcm1" -version = "1.0.12+20190703" +version = "1.0.13+20200406" diff --git a/gen/fcm1-cli/README.md b/gen/fcm1-cli/README.md index 077286d696..74eff27544 100644 --- a/gen/fcm1-cli/README.md +++ b/gen/fcm1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firebase Cloud Messaging* API at revision *20190703*. The CLI is at version *1.0.12*. +This documentation was generated from the *Firebase Cloud Messaging* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash fcm1 [options] diff --git a/gen/fcm1-cli/mkdocs.yml b/gen/fcm1-cli/mkdocs.yml index b1b8af6f4e..25c1e73888 100644 --- a/gen/fcm1-cli/mkdocs.yml +++ b/gen/fcm1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Cloud Messaging v1.0.12+20190703 +site_name: Firebase Cloud Messaging v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-fcm1-cli site_description: A complete library to interact with Firebase Cloud Messaging (protocol v1) diff --git a/gen/fcm1-cli/src/main.rs b/gen/fcm1-cli/src/main.rs index a8807b9f5d..6a52248a97 100644 --- a/gen/fcm1-cli/src/main.rs +++ b/gen/fcm1-cli/src/main.rs @@ -72,37 +72,59 @@ impl<'n> Engine<'n> { "message.name" => Some(("message.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.fcm-options.analytics-label" => Some(("message.fcmOptions.analyticsLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.notification.body" => Some(("message.notification.body", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.notification.image" => Some(("message.notification.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.notification.title" => Some(("message.notification.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.webpush.headers" => Some(("message.webpush.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "message.webpush.data" => Some(("message.webpush.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "message.webpush.fcm-options.link" => Some(("message.webpush.fcmOptions.link", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.webpush.fcm-options.analytics-label" => Some(("message.webpush.fcmOptions.analyticsLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.topic" => Some(("message.topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.token" => Some(("message.token", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.android.fcm-options.analytics-label" => Some(("message.android.fcmOptions.analyticsLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.android.notification.body" => Some(("message.android.notification.body", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.android.notification.body-loc-key" => Some(("message.android.notification.bodyLocKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.color" => Some(("message.android.notification.color", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.image" => Some(("message.android.notification.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.channel-id" => Some(("message.android.notification.channelId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.light-settings.color.blue" => Some(("message.android.notification.lightSettings.color.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "message.android.notification.light-settings.color.alpha" => Some(("message.android.notification.lightSettings.color.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "message.android.notification.light-settings.color.green" => Some(("message.android.notification.lightSettings.color.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "message.android.notification.light-settings.color.red" => Some(("message.android.notification.lightSettings.color.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "message.android.notification.light-settings.light-on-duration" => Some(("message.android.notification.lightSettings.lightOnDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.light-settings.light-off-duration" => Some(("message.android.notification.lightSettings.lightOffDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.sticky" => Some(("message.android.notification.sticky", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "message.android.notification.tag" => Some(("message.android.notification.tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.default-sound" => Some(("message.android.notification.defaultSound", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "message.android.notification.default-light-settings" => Some(("message.android.notification.defaultLightSettings", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "message.android.notification.body-loc-args" => Some(("message.android.notification.bodyLocArgs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "message.android.notification.title" => Some(("message.android.notification.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.android.notification.color" => Some(("message.android.notification.color", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.android.notification.channel-id" => Some(("message.android.notification.channelId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.android.notification.click-action" => Some(("message.android.notification.clickAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.notification-count" => Some(("message.android.notification.notificationCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "message.android.notification.body" => Some(("message.android.notification.body", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.event-time" => Some(("message.android.notification.eventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.local-only" => Some(("message.android.notification.localOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "message.android.notification.visibility" => Some(("message.android.notification.visibility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.android.notification.title-loc-key" => Some(("message.android.notification.titleLocKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.android.notification.sound" => Some(("message.android.notification.sound", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.android.notification.tag" => Some(("message.android.notification.tag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.android.notification.title-loc-args" => Some(("message.android.notification.titleLocArgs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "message.android.notification.ticker" => Some(("message.android.notification.ticker", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.android.notification.icon" => Some(("message.android.notification.icon", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.sound" => Some(("message.android.notification.sound", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.click-action" => Some(("message.android.notification.clickAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.title-loc-args" => Some(("message.android.notification.titleLocArgs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "message.android.notification.vibrate-timings" => Some(("message.android.notification.vibrateTimings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "message.android.notification.notification-priority" => Some(("message.android.notification.notificationPriority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.notification.default-vibrate-timings" => Some(("message.android.notification.defaultVibrateTimings", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "message.android.priority" => Some(("message.android.priority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.android.collapse-key" => Some(("message.android.collapseKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.android.direct-boot-ok" => Some(("message.android.directBootOk", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "message.android.ttl" => Some(("message.android.ttl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.android.restricted-package-name" => Some(("message.android.restrictedPackageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.android.data" => Some(("message.android.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "message.data" => Some(("message.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "message.apns.headers" => Some(("message.apns.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "message.apns.fcm-options.image" => Some(("message.apns.fcmOptions.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.apns.fcm-options.analytics-label" => Some(("message.apns.fcmOptions.analyticsLabel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.condition" => Some(("message.condition", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "validate-only" => Some(("validateOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["analytics-label", "android", "apns", "body", "body-loc-args", "body-loc-key", "channel-id", "click-action", "collapse-key", "color", "condition", "data", "fcm-options", "headers", "icon", "link", "message", "name", "notification", "priority", "restricted-package-name", "sound", "tag", "title", "title-loc-args", "title-loc-key", "token", "topic", "ttl", "validate-only", "webpush"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alpha", "analytics-label", "android", "apns", "blue", "body", "body-loc-args", "body-loc-key", "channel-id", "click-action", "collapse-key", "color", "condition", "data", "default-light-settings", "default-sound", "default-vibrate-timings", "direct-boot-ok", "event-time", "fcm-options", "green", "headers", "icon", "image", "light-off-duration", "light-on-duration", "light-settings", "link", "local-only", "message", "name", "notification", "notification-count", "notification-priority", "priority", "red", "restricted-package-name", "sound", "sticky", "tag", "ticker", "title", "title-loc-args", "title-loc-key", "token", "topic", "ttl", "validate-only", "vibrate-timings", "visibility", "webpush"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -302,7 +324,7 @@ fn main() { let mut app = App::new("fcm1") .author("Sebastian Thiel ") - .version("1.0.12+20190703") + .version("1.0.13+20200406") .about("FCM send API that provides a cross-platform messaging solution to reliably deliver messages at no cost.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fcm1_cli") .arg(Arg::with_name("url") diff --git a/gen/fcm1/Cargo.toml b/gen/fcm1/Cargo.toml index 5ef91902a0..59824b9c62 100644 --- a/gen/fcm1/Cargo.toml +++ b/gen/fcm1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-fcm1" -version = "1.0.12+20190703" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Cloud Messaging (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fcm1" homepage = "https://firebase.google.com/docs/cloud-messaging" -documentation = "https://docs.rs/google-fcm1/1.0.12+20190703" +documentation = "https://docs.rs/google-fcm1/1.0.13+20200406" license = "MIT" keywords = ["fcm", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/fcm1/README.md b/gen/fcm1/README.md index da5667fc6b..fff013a360 100644 --- a/gen/fcm1/README.md +++ b/gen/fcm1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-fcm1` library allows access to all features of the *Google Firebase Cloud Messaging* service. -This documentation was generated from *Firebase Cloud Messaging* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *fcm:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Firebase Cloud Messaging* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *fcm:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Firebase Cloud Messaging* *v1* API can be found at the [official documentation site](https://firebase.google.com/docs/cloud-messaging). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/struct.FirebaseCloudMessaging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/struct.FirebaseCloudMessaging.html) ... * projects - * [*messages send*](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/struct.ProjectMessageSendCall.html) + * [*messages send*](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/struct.ProjectMessageSendCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/struct.FirebaseCloudMessaging.html)** +* **[Hub](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/struct.FirebaseCloudMessaging.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.Part.html)** + * **[Parts](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-fcm1/1.0.12+20190703/google_fcm1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-fcm1/1.0.13+20200406/google_fcm1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/fcm1/src/lib.rs b/gen/fcm1/src/lib.rs index 370bc29b01..8e6d027e95 100644 --- a/gen/fcm1/src/lib.rs +++ b/gen/fcm1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Firebase Cloud Messaging* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *fcm:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Firebase Cloud Messaging* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *fcm:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Firebase Cloud Messaging* *v1* API can be found at the //! [official documentation site](https://firebase.google.com/docs/cloud-messaging). @@ -329,7 +329,7 @@ impl<'a, C, A> FirebaseCloudMessaging FirebaseCloudMessaging { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://fcm.googleapis.com/".to_string(), _root_url: "https://fcm.googleapis.com/".to_string(), } @@ -340,7 +340,7 @@ impl<'a, C, A> FirebaseCloudMessaging } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -382,6 +382,158 @@ pub struct FcmOptions { impl Part for FcmOptions {} +/// Represents a color in the RGBA color space. This representation is designed +/// for simplicity of conversion to/from color representations in various +/// languages over compactness; for example, the fields of this representation +/// can be trivially provided to the constructor of "java.awt.Color" in Java; it +/// can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha" +/// method in iOS; and, with just a little work, it can be easily formatted into +/// a CSS "rgba()" string in JavaScript, as well. +/// +/// Note: this proto does not carry information about the absolute color space +/// that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, +/// DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color +/// space. +/// +/// Example (Java): +/// +/// ````text +/// import com.google.type.Color; +/// +/// // ... +/// public static java.awt.Color fromProto(Color protocolor) { +/// float alpha = protocolor.hasAlpha() +/// ? protocolor.getAlpha().getValue() +/// : 1.0; +/// +/// return new java.awt.Color( +/// protocolor.getRed(), +/// protocolor.getGreen(), +/// protocolor.getBlue(), +/// alpha); +/// } +/// +/// public static Color toProto(java.awt.Color color) { +/// float red = (float) color.getRed(); +/// float green = (float) color.getGreen(); +/// float blue = (float) color.getBlue(); +/// float denominator = 255.0; +/// Color.Builder resultBuilder = +/// Color +/// .newBuilder() +/// .setRed(red / denominator) +/// .setGreen(green / denominator) +/// .setBlue(blue / denominator); +/// int alpha = color.getAlpha(); +/// if (alpha != 255) { +/// result.setAlpha( +/// FloatValue +/// .newBuilder() +/// .setValue(((float) alpha) / denominator) +/// .build()); +/// } +/// return resultBuilder.build(); +/// } +/// // ... +/// ```` +/// +/// Example (iOS / Obj-C): +/// +/// ````text +/// // ... +/// static UIColor* fromProto(Color* protocolor) { +/// float red = [protocolor red]; +/// float green = [protocolor green]; +/// float blue = [protocolor blue]; +/// FloatValue* alpha_wrapper = [protocolor alpha]; +/// float alpha = 1.0; +/// if (alpha_wrapper != nil) { +/// alpha = [alpha_wrapper value]; +/// } +/// return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; +/// } +/// +/// static Color* toProto(UIColor* color) { +/// CGFloat red, green, blue, alpha; +/// if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { +/// return nil; +/// } +/// Color* result = [[Color alloc] init]; +/// [result setRed:red]; +/// [result setGreen:green]; +/// [result setBlue:blue]; +/// if (alpha <= 0.9999) { +/// [result setAlpha:floatWrapperWithValue(alpha)]; +/// } +/// [result autorelease]; +/// return result; +/// } +/// // ... +/// ```` +/// +/// Example (JavaScript): +/// +/// ````text +/// // ... +/// +/// var protoToCssColor = function(rgb_color) { +/// var redFrac = rgb_color.red || 0.0; +/// var greenFrac = rgb_color.green || 0.0; +/// var blueFrac = rgb_color.blue || 0.0; +/// var red = Math.floor(redFrac * 255); +/// var green = Math.floor(greenFrac * 255); +/// var blue = Math.floor(blueFrac * 255); +/// +/// if (!('alpha' in rgb_color)) { +/// return rgbToCssColor_(red, green, blue); +/// } +/// +/// var alphaFrac = rgb_color.alpha.value || 0.0; +/// var rgbParams = [red, green, blue].join(','); +/// return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); +/// }; +/// +/// var rgbToCssColor_ = function(red, green, blue) { +/// var rgbNumber = new Number((red << 16) | (green << 8) | blue); +/// var hexString = rgbNumber.toString(16); +/// var missingZeros = 6 - hexString.length; +/// var resultBuilder = ['#']; +/// for (var i = 0; i < missingZeros; i++) { +/// resultBuilder.push('0'); +/// } +/// resultBuilder.push(hexString); +/// return resultBuilder.join(''); +/// }; +/// +/// // ... +/// ```` +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Color { + /// The amount of blue in the color as a value in the interval [0, 1]. + pub blue: Option, + /// The fraction of this color that should be applied to the pixel. That is, + /// the final pixel color is defined by the equation: + /// + /// pixel color = alpha * (this color) + (1.0 - alpha) * (background color) + /// + /// This means that a value of 1.0 corresponds to a solid color, whereas + /// a value of 0.0 corresponds to a completely transparent color. This + /// uses a wrapper message rather than a simple float scalar so that it is + /// possible to distinguish between a default value and the value being unset. + /// If omitted, this color object is to be rendered as a solid color + /// (as if the alpha value had been explicitly given with a value of 1.0). + pub alpha: Option, + /// The amount of green in the color as a value in the interval [0, 1]. + pub green: Option, + /// The amount of red in the color as a value in the interval [0, 1]. + pub red: Option, +} + +impl Part for Color {} + + /// Basic notification template to use across all platforms. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -390,6 +542,15 @@ impl Part for FcmOptions {} pub struct Notification { /// The notification's body text. pub body: Option, + /// Contains the URL of an image that is going to be downloaded on the device + /// and displayed in a notification. + /// JPEG, PNG, BMP have full support across platforms. Animated GIF and video + /// only work on iOS. WebP and HEIF have varying levels of support across + /// platforms and platform versions. + /// Android has 1MB image size limit. + /// Quota usage and implications/costs for hosting image on Firebase Storage: + /// https://firebase.google.com/pricing + pub image: Option, /// The notification's title. pub title: Option, } @@ -404,6 +565,11 @@ impl Part for Notification {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AndroidConfig { + /// Options for features provided by the FCM SDK for Android. + #[serde(rename="fcmOptions")] + pub fcm_options: Option, + /// Notification to send to android devices. + pub notification: Option, /// Message priority. Can take "normal" and "high" values. /// For more information, see [Setting the priority of a /// message](https://goo.gl/GjONJv). @@ -413,9 +579,11 @@ pub struct AndroidConfig { /// different collapse keys is allowed at any given time. #[serde(rename="collapseKey")] pub collapse_key: Option, - /// Options for features provided by the FCM SDK for Android. - #[serde(rename="fcmOptions")] - pub fcm_options: Option, + /// If set to true, messages will be allowed to be delivered to the app while + /// the device is in direct boot mode. See [Support Direct Boot + /// mode](https://developer.android.com/training/articles/direct-boot). + #[serde(rename="directBootOk")] + pub direct_boot_ok: Option, /// How long (in seconds) the message should be kept in FCM storage if the /// device is offline. The maximum time to live supported is 4 weeks, and the /// default value is 4 weeks if not set. Set it to 0 if want to send the @@ -428,20 +596,42 @@ pub struct AndroidConfig { /// be expressed in JSON format as "3.000000001s". The ttl will be rounded down /// to the nearest second. pub ttl: Option, - /// Notification to send to android devices. - pub notification: Option, - /// Arbitrary key/value payload. If present, it will override - /// google.firebase.fcm.v1.Message.data. - pub data: Option>, /// Package name of the application where the registration token must match in /// order to receive the message. #[serde(rename="restrictedPackageName")] pub restricted_package_name: Option, + /// Arbitrary key/value payload. If present, it will override + /// google.firebase.fcm.v1.Message.data. + pub data: Option>, } impl Part for AndroidConfig {} +/// Settings to control notification LED. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LightSettings { + /// Required. Set `color` of the LED with + /// [google.type.Color](https://github.com/googleapis/googleapis/blob/master/google/type/color.proto). + pub color: Option, + /// Required. Along with `light_off_duration`, define the blink rate of LED + /// flashes. Resolution defined by + /// [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) + #[serde(rename="lightOnDuration")] + pub light_on_duration: Option, + /// Required. Along with `light_on_duration `, define the blink rate of LED + /// flashes. Resolution defined by + /// [proto.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) + #[serde(rename="lightOffDuration")] + pub light_off_duration: Option, +} + +impl Part for LightSettings {} + + /// [Apple Push Notification Service](https://goo.gl/MXRTPa) specific options. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -449,11 +639,13 @@ impl Part for AndroidConfig {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ApnsConfig { /// HTTP request headers defined in Apple Push Notification Service. Refer to - /// [APNs request headers](https://goo.gl/C6Yhia) for - /// supported headers, e.g. "apns-priority": "10". + /// [APNs request + /// headers](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns) + /// for supported headers, e.g. "apns-priority": "10". pub headers: Option>, /// APNs payload as a JSON object, including both `aps` dictionary and custom - /// payload. See [Payload Key Reference](https://goo.gl/32Pl5W). + /// payload. See [Payload Key + /// Reference](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification). /// If present, it overrides google.firebase.fcm.v1.Notification.title /// and google.firebase.fcm.v1.Notification.body. pub payload: Option>, @@ -485,6 +677,10 @@ impl Part for AndroidFcmOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ApnsFcmOptions { + /// Contains the URL of an image that is going to be displayed in a + /// notification. If present, it will override + /// google.firebase.fcm.v1.Notification.image. + pub image: Option, /// Label associated with the message's analytics data. #[serde(rename="analyticsLabel")] pub analytics_label: Option, @@ -552,7 +748,8 @@ pub struct Message { /// Input only. Android specific options for messages sent through /// [FCM connection server](https://goo.gl/4GLdUl). pub android: Option, - /// Input only. Arbitrary key/value payload. + /// Input only. Arbitrary key/value payload. The key should not be a reserved + /// word ("from", "message_type", or any word starting with "google" or "gcm"). pub data: Option>, /// Input only. [Apple Push Notification Service](https://goo.gl/MXRTPa) /// specific options. @@ -579,17 +776,12 @@ pub struct AndroidNotification { /// See [String Resources](https://goo.gl/NdFZGI) for more information. #[serde(rename="bodyLocKey")] pub body_loc_key: Option, - /// Variable string values to be used in place of the format specifiers in - /// body_loc_key to use to localize the body text to the user's current - /// localization. - /// See [Formatting and Styling](https://goo.gl/MalYE3) for more information. - #[serde(rename="bodyLocArgs")] - pub body_loc_args: Option>, - /// The notification's title. If present, it will override - /// google.firebase.fcm.v1.Notification.title. - pub title: Option, /// The notification's icon color, expressed in #rrggbb format. pub color: Option, + /// Contains the URL of an image that is going to be displayed in a + /// notification. If present, it will override + /// google.firebase.fcm.v1.Notification.image. + pub image: Option, /// The [notification's channel /// id](https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels) /// (new in Android O). The app must create a channel with this channel ID @@ -599,31 +791,123 @@ pub struct AndroidNotification { /// manifest. #[serde(rename="channelId")] pub channel_id: Option, - /// The action associated with a user click on the notification. - /// If specified, an activity with a matching intent filter is launched when - /// a user clicks on the notification. - #[serde(rename="clickAction")] - pub click_action: Option, - /// The key to the title string in the app's string resources to use to - /// localize the title text to the user's current localization. - /// See [String Resources](https://goo.gl/NdFZGI) for more information. - #[serde(rename="titleLocKey")] - pub title_loc_key: Option, - /// The sound to play when the device receives the notification. - /// Supports "default" or the filename of a sound resource bundled in the app. - /// Sound files must reside in /res/raw/. - pub sound: Option, + /// Variable string values to be used in place of the format specifiers in + /// body_loc_key to use to localize the body text to the user's current + /// localization. + /// See [Formatting and Styling](https://goo.gl/MalYE3) for more information. + #[serde(rename="bodyLocArgs")] + pub body_loc_args: Option>, + /// Settings to control the notification's LED blinking rate and color if LED + /// is available on the device. The total blinking time is controlled by the + /// OS. + #[serde(rename="lightSettings")] + pub light_settings: Option, + /// When set to false or unset, the notification is automatically + /// dismissed when the user clicks it in the panel. When set to true, the + /// notification persists even when the user clicks it. + pub sticky: Option, /// Identifier used to replace existing notifications in the notification /// drawer. /// If not specified, each request creates a new notification. /// If specified and a notification with the same tag is already being shown, /// the new notification replaces the existing one in the notification drawer. pub tag: Option, + /// Set the + /// [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility) + /// of the notification. + pub visibility: Option, + /// The key to the title string in the app's string resources to use to + /// localize the title text to the user's current localization. + /// See [String Resources](https://goo.gl/NdFZGI) for more information. + #[serde(rename="titleLocKey")] + pub title_loc_key: Option, + /// If set to true, use the Android framework's default sound for the + /// notification. Default values are specified in + /// [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). + #[serde(rename="defaultSound")] + pub default_sound: Option, + /// If set to true, use the Android framework's default LED light settings for + /// the notification. Default values are specified in + /// [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). + /// If `default_light_settings` is set to true and `light_settings` is also + /// set, the user-specified `light_settings` is used instead of the + /// default value. + #[serde(rename="defaultLightSettings")] + pub default_light_settings: Option, + /// Sets the "ticker" text, which is sent to accessibility services. + /// Prior to API level 21 (`Lollipop`), sets the text that is displayed in the + /// status bar when the notification first arrives. + pub ticker: Option, /// The notification's icon. /// Sets the notification icon to myicon for drawable resource myicon. /// If you don't send this key in the request, FCM displays the launcher icon /// specified in your app manifest. pub icon: Option, + /// The sound to play when the device receives the notification. + /// Supports "default" or the filename of a sound resource bundled in the app. + /// Sound files must reside in /res/raw/. + pub sound: Option, + /// Set the time that the event in the notification occurred. Notifications in + /// the panel are sorted by this time. A point in time is represented using + /// [protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Timestamp). + #[serde(rename="eventTime")] + pub event_time: Option, + /// The notification's title. If present, it will override + /// google.firebase.fcm.v1.Notification.title. + pub title: Option, + /// Set whether or not this notification is relevant only to the current + /// device. Some notifications can be bridged to other devices for remote + /// display, such as a Wear OS watch. This hint can be set to recommend this + /// notification not be bridged. See [Wear OS + /// guides](https://developer.android.com/training/wearables/notifications/bridger#existing-method-of-preventing-bridging) + #[serde(rename="localOnly")] + pub local_only: Option, + /// The action associated with a user click on the notification. + /// If specified, an activity with a matching intent filter is launched when + /// a user clicks on the notification. + #[serde(rename="clickAction")] + pub click_action: Option, + /// Sets the number of items this notification represents. May be displayed as + /// a badge count for launchers that support badging.See [Notification + /// Badge](https://developer.android.com/training/notify-user/badges). + /// For example, this might be useful if you're using just one notification to + /// represent multiple new messages but you want the count here to represent + /// the number of total new messages. + /// If zero or unspecified, systems that support badging use the default, which + /// is to increment a number displayed on the long-press menu each time a new + /// notification arrives. + #[serde(rename="notificationCount")] + pub notification_count: Option, + /// Set the vibration pattern to use. Pass in an array of + /// [protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) + /// to turn on or off the vibrator. The first value indicates the `Duration` to + /// wait before turning the vibrator on. The next value indicates the + /// `Duration` to keep the vibrator on. Subsequent values alternate between + /// `Duration` to turn the vibrator off and to turn the vibrator on. + /// If `vibrate_timings` is set and `default_vibrate_timings` is set to `true`, + /// the default value is used instead of the user-specified `vibrate_timings`. + #[serde(rename="vibrateTimings")] + pub vibrate_timings: Option>, + /// Set the relative priority for this notification. Priority is an indication + /// of how much of the user's attention should be consumed by this + /// notification. Low-priority notifications may be hidden from the user in + /// certain situations, while the user might be interrupted for a + /// higher-priority notification. The effect of setting the same priorities may + /// differ slightly on different platforms. Note this priority differs from + /// `AndroidMessagePriority`. This priority is processed by the client after + /// the message has been delivered, whereas + /// [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority) + /// is an FCM concept that controls when the message is delivered. + #[serde(rename="notificationPriority")] + pub notification_priority: Option, + /// If set to true, use the Android framework's default vibrate pattern for the + /// notification. Default values are specified in + /// [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). + /// If `default_vibrate_timings` is set to true and `vibrate_timings` is also + /// set, the default value is used instead of the user-specified + /// `vibrate_timings`. + #[serde(rename="defaultVibrateTimings")] + pub default_vibrate_timings: Option, /// Variable string values to be used in place of the format specifiers in /// title_loc_key to use to localize the title text to the user's current /// localization. @@ -662,6 +946,9 @@ impl RequestValue for SendMessageRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct WebpushFcmOptions { + /// Label associated with the message's analytics data. + #[serde(rename="analyticsLabel")] + pub analytics_label: Option, /// The link to open when the user clicks on the notification. /// For all URL values, HTTPS is required. pub link: Option, diff --git a/gen/file1-cli/Cargo.toml b/gen/file1-cli/Cargo.toml index 7d8f65fe82..d5048d27c0 100644 --- a/gen/file1-cli/Cargo.toml +++ b/gen/file1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-file1-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Filestore (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/file1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-file1] path = "../file1" -version = "1.0.12+20190627" +version = "1.0.13+20200406" diff --git a/gen/file1-cli/README.md b/gen/file1-cli/README.md index cee16db9ae..fb38b58acb 100644 --- a/gen/file1-cli/README.md +++ b/gen/file1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Filestore* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Filestore* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash file1 [options] diff --git a/gen/file1-cli/mkdocs.yml b/gen/file1-cli/mkdocs.yml index 78c6e11d65..23e149c7de 100644 --- a/gen/file1-cli/mkdocs.yml +++ b/gen/file1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Filestore v1.0.12+20190627 +site_name: Cloud Filestore v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-file1-cli site_description: A complete library to interact with Cloud Filestore (protocol v1) diff --git a/gen/file1-cli/src/main.rs b/gen/file1-cli/src/main.rs index f5bf4b51fe..f480554036 100644 --- a/gen/file1-cli/src/main.rs +++ b/gen/file1-cli/src/main.rs @@ -471,6 +471,9 @@ impl<'n> Engine<'n> { "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, + "include-unrevealed-locations" => { + call = call.include_unrevealed_locations(arg_from_str(value.unwrap_or("false"), err, "include-unrevealed-locations", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -487,7 +490,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["filter", "page-token", "include-unrevealed-locations", "page-size"].iter().map(|v|*v)); v } )); } } @@ -1035,7 +1038,7 @@ fn main() { (Some(r##"name"##), None, Some(r##"Output only. The resource name of the instance, in the format - projects/{project_id}/locations/{location_id}/instances/{instance_id}."##), + projects/{project}/locations/{location}/instances/{instance}."##), Some(true), Some(false)), @@ -1202,7 +1205,7 @@ fn main() { let mut app = App::new("file1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200406") .about("The Cloud Filestore API is used for creating and managing cloud file servers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_file1_cli") .arg(Arg::with_name("url") diff --git a/gen/file1/Cargo.toml b/gen/file1/Cargo.toml index 9f639f9fb0..91b9725578 100644 --- a/gen/file1/Cargo.toml +++ b/gen/file1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-file1" -version = "1.0.12+20190627" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Filestore (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/file1" homepage = "https://cloud.google.com/filestore/" -documentation = "https://docs.rs/google-file1/1.0.12+20190627" +documentation = "https://docs.rs/google-file1/1.0.13+20200406" license = "MIT" keywords = ["file", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/file1/README.md b/gen/file1/README.md index 7062f4a197..440a57d0c7 100644 --- a/gen/file1/README.md +++ b/gen/file1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-file1` library allows access to all features of the *Google Cloud Filestore* service. -This documentation was generated from *Cloud Filestore* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *file:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Filestore* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *file:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Filestore* *v1* API can be found at the [official documentation site](https://cloud.google.com/filestore/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.CloudFilestore.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.CloudFilestore.html) ... * projects - * [*locations get*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances get*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationInstanceGetCall.html), [*locations instances list*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationInstancePatchCall.html), [*locations list*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.ProjectLocationOperationListCall.html) + * [*locations get*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances get*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationInstanceGetCall.html), [*locations instances list*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationInstancePatchCall.html), [*locations list*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.ProjectLocationOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-file1/1.0.12+20190627/google_file1/struct.CloudFilestore.html)** +* **[Hub](https://docs.rs/google-file1/1.0.13+20200406/google_file1/struct.CloudFilestore.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.Part.html)** + * **[Parts](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-file1/1.0.12+20190627/google_file1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-file1/1.0.13+20200406/google_file1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-file1/1.0.12+20190627/google_file1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-file1/1.0.13+20200406/google_file1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-file1/1.0.12+20190627/google_file1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-file1/1.0.13+20200406/google_file1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/file1/src/lib.rs b/gen/file1/src/lib.rs index bfc3e9129c..2b84438e5b 100644 --- a/gen/file1/src/lib.rs +++ b/gen/file1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Filestore* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *file:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Filestore* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *file:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Filestore* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/filestore/). @@ -334,7 +334,7 @@ impl<'a, C, A> CloudFilestore CloudFilestore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://file.googleapis.com/".to_string(), _root_url: "https://file.googleapis.com/".to_string(), } @@ -345,7 +345,7 @@ impl<'a, C, A> CloudFilestore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -449,7 +449,7 @@ impl Part for NetworkConfig {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Instance { /// Output only. The resource name of the instance, in the format - /// projects/{project_id}/locations/{location_id}/instances/{instance_id}. + /// projects/{project}/locations/{location}/instances/{instance}. pub name: Option, /// Resource labels to represent user provided metadata. pub labels: Option>, @@ -473,7 +473,7 @@ pub struct Instance { /// Output only. Additional information about the instance state, if available. #[serde(rename="statusMessage")] pub status_message: Option, - /// Optional. A description of the instance (2048 characters or less). + /// Optional. The description of the instance (2048 characters or less). pub description: Option, } @@ -808,6 +808,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _name: name.to_string(), _page_token: Default::default(), _page_size: Default::default(), + _include_unrevealed_locations: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -905,7 +906,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `name` - Output only. The resource name of the instance, in the format - /// projects/{project_id}/locations/{location_id}/instances/{instance_id}. + /// projects/{project}/locations/{location}/instances/{instance}. pub fn locations_instances_patch(&self, request: Instance, name: &str) -> ProjectLocationInstancePatchCall<'a, C, A> { ProjectLocationInstancePatchCall { hub: self.hub, @@ -1798,7 +1799,8 @@ impl<'a, C, A> ProjectLocationInstanceDeleteCall<'a, C, A> where C: BorrowMut _name: String, _page_token: Option, _page_size: Option, + _include_unrevealed_locations: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -1832,7 +1835,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("name", self._name.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -1840,10 +1843,13 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> { + self._include_unrevealed_locations = Some(new_value); + self + } /// The standard list filter. /// /// Sets the *filter* query property to the given value. @@ -3299,7 +3313,7 @@ impl<'a, C, A> ProjectLocationInstancePatchCall<'a, C, A> where C: BorrowMut ProjectLocationInstancePatchCall<'a, C, A> where C: BorrowMut ProjectLocationInstancePatchCall<'a, C, A> { @@ -3705,10 +3722,10 @@ impl<'a, C, A> ProjectLocationInstanceCreateCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Filestore (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/file1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-file1_beta1] path = "../file1_beta1" -version = "1.0.12+20190627" +version = "1.0.13+20200406" diff --git a/gen/file1_beta1-cli/README.md b/gen/file1_beta1-cli/README.md index d8f67ef885..b37fc2003e 100644 --- a/gen/file1_beta1-cli/README.md +++ b/gen/file1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Filestore* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Filestore* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash file1-beta1 [options] diff --git a/gen/file1_beta1-cli/mkdocs.yml b/gen/file1_beta1-cli/mkdocs.yml index fa305e4c0a..e03d998b4a 100644 --- a/gen/file1_beta1-cli/mkdocs.yml +++ b/gen/file1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Filestore v1.0.12+20190627 +site_name: Cloud Filestore v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-file1_beta1-cli site_description: A complete library to interact with Cloud Filestore (protocol v1beta1) diff --git a/gen/file1_beta1-cli/src/main.rs b/gen/file1_beta1-cli/src/main.rs index e1d3898b80..f102eea340 100644 --- a/gen/file1_beta1-cli/src/main.rs +++ b/gen/file1_beta1-cli/src/main.rs @@ -471,6 +471,9 @@ impl<'n> Engine<'n> { "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, + "include-unrevealed-locations" => { + call = call.include_unrevealed_locations(arg_from_str(value.unwrap_or("false"), err, "include-unrevealed-locations", "boolean")); + }, "filter" => { call = call.filter(value.unwrap_or("")); }, @@ -487,7 +490,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v.extend(["filter", "page-token", "include-unrevealed-locations", "page-size"].iter().map(|v|*v)); v } )); } } @@ -1202,7 +1205,7 @@ fn main() { let mut app = App::new("file1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200406") .about("The Cloud Filestore API is used for creating and managing cloud file servers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_file1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/file1_beta1/Cargo.toml b/gen/file1_beta1/Cargo.toml index b2dc373358..232577b89c 100644 --- a/gen/file1_beta1/Cargo.toml +++ b/gen/file1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-file1_beta1" -version = "1.0.12+20190627" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Filestore (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/file1_beta1" homepage = "https://cloud.google.com/filestore/" -documentation = "https://docs.rs/google-file1_beta1/1.0.12+20190627" +documentation = "https://docs.rs/google-file1_beta1/1.0.13+20200406" license = "MIT" keywords = ["file", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/file1_beta1/README.md b/gen/file1_beta1/README.md index 7a50f8f88d..ef6981fd1e 100644 --- a/gen/file1_beta1/README.md +++ b/gen/file1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-file1_beta1` library allows access to all features of the *Google Cloud Filestore* service. -This documentation was generated from *Cloud Filestore* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *file:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Filestore* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *file:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Filestore* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/filestore/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.CloudFilestore.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.CloudFilestore.html) ... * projects - * [*locations get*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances get*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationInstanceGetCall.html), [*locations instances list*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationInstancePatchCall.html), [*locations list*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.ProjectLocationOperationListCall.html) + * [*locations get*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances get*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationInstanceGetCall.html), [*locations instances list*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationInstancePatchCall.html), [*locations list*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.ProjectLocationOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/struct.CloudFilestore.html)** +* **[Hub](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/struct.CloudFilestore.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-file1_beta1/1.0.12+20190627/google_file1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-file1_beta1/1.0.13+20200406/google_file1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/file1_beta1/src/lib.rs b/gen/file1_beta1/src/lib.rs index c00fc4dd0d..dab92d63b9 100644 --- a/gen/file1_beta1/src/lib.rs +++ b/gen/file1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Filestore* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *file:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Filestore* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *file:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Filestore* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/filestore/). @@ -334,7 +334,7 @@ impl<'a, C, A> CloudFilestore CloudFilestore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://file.googleapis.com/".to_string(), _root_url: "https://file.googleapis.com/".to_string(), } @@ -345,7 +345,7 @@ impl<'a, C, A> CloudFilestore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -408,11 +408,11 @@ impl ResponseResult for ListInstancesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NetworkConfig { - /// A /29 CIDR block in one of the + /// A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the /// [internal IP address /// ranges](https://www.arin.net/knowledge/address_filters.html) that /// identifies the range of IP addresses reserved for this instance. For - /// example, 10.0.0.0/29 or 192.168.0.0/29. The range you specify can't overlap + /// example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap /// with either existing subnets or assigned IP address ranges for other Cloud /// Filestore instances in the selected VPC network. #[serde(rename="reservedIpRange")] @@ -473,7 +473,7 @@ pub struct Instance { /// Output only. Additional information about the instance state, if available. #[serde(rename="statusMessage")] pub status_message: Option, - /// Optional. A description of the instance (2048 characters or less). + /// Optional. The description of the instance (2048 characters or less). pub description: Option, } @@ -808,6 +808,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _name: name.to_string(), _page_token: Default::default(), _page_size: Default::default(), + _include_unrevealed_locations: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1798,7 +1799,8 @@ impl<'a, C, A> ProjectLocationInstanceDeleteCall<'a, C, A> where C: BorrowMut _name: String, _page_token: Option, _page_size: Option, + _include_unrevealed_locations: Option, _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -1832,7 +1835,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("name", self._name.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -1840,10 +1843,13 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> { + self._include_unrevealed_locations = Some(new_value); + self + } /// The standard list filter. /// /// Sets the *filter* query property to the given value. @@ -3312,7 +3326,10 @@ impl<'a, C, A> ProjectLocationInstancePatchCall<'a, C, A> where C: BorrowMut ProjectLocationInstancePatchCall<'a, C, A> { @@ -3705,10 +3722,10 @@ impl<'a, C, A> ProjectLocationInstanceCreateCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Firebase Management (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebase1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-firebase1_beta1] path = "../firebase1_beta1" -version = "1.0.12+20190703" +version = "1.0.13+20200407" diff --git a/gen/firebase1_beta1-cli/README.md b/gen/firebase1_beta1-cli/README.md index 29ae8d56fa..02bed0e556 100644 --- a/gen/firebase1_beta1-cli/README.md +++ b/gen/firebase1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firebase Management* API at revision *20190703*. The CLI is at version *1.0.12*. +This documentation was generated from the *Firebase Management* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash firebase1-beta1 [options] @@ -35,6 +35,7 @@ firebase1-beta1 [options] get [-p ]... [-o ] projects add-firebase (-r )... [-p ]... [-o ] + add-google-analytics (-r )... [-p ]... [-o ] android-apps-create (-r )... [-p ]... [-o ] android-apps-get [-p ]... [-o ] android-apps-get-config [-p ]... [-o ] @@ -47,6 +48,7 @@ firebase1-beta1 [options] default-location-finalize (-r )... [-p ]... [-o ] get [-p ]... [-o ] get-admin-sdk-config [-p ]... [-o ] + get-analytics-details [-p ]... [-o ] ios-apps-create (-r )... [-p ]... [-o ] ios-apps-get [-p ]... [-o ] ios-apps-get-config [-p ]... [-o ] @@ -54,6 +56,7 @@ firebase1-beta1 [options] ios-apps-patch (-r )... [-p ]... [-o ] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] + remove-analytics (-r )... [-p ]... [-o ] search-apps [-p ]... [-o ] web-apps-create (-r )... [-p ]... [-o ] web-apps-get [-p ]... [-o ] diff --git a/gen/firebase1_beta1-cli/mkdocs.yml b/gen/firebase1_beta1-cli/mkdocs.yml index c3a475b8c0..67dfd2b0bf 100644 --- a/gen/firebase1_beta1-cli/mkdocs.yml +++ b/gen/firebase1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Management v1.0.12+20190703 +site_name: Firebase Management v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-firebase1_beta1-cli site_description: A complete library to interact with Firebase Management (protocol v1beta1) @@ -12,6 +12,7 @@ pages: - ['available-projects_list.md', 'Available Projects', 'List'] - ['operations_get.md', 'Operations', 'Get'] - ['projects_add-firebase.md', 'Projects', 'Add Firebase'] +- ['projects_add-google-analytics.md', 'Projects', 'Add Google Analytics'] - ['projects_android-apps-create.md', 'Projects', 'Android Apps Create'] - ['projects_android-apps-get.md', 'Projects', 'Android Apps Get'] - ['projects_android-apps-get-config.md', 'Projects', 'Android Apps Get Config'] @@ -24,6 +25,7 @@ pages: - ['projects_default-location-finalize.md', 'Projects', 'Default Location Finalize'] - ['projects_get.md', 'Projects', 'Get'] - ['projects_get-admin-sdk-config.md', 'Projects', 'Get Admin Sdk Config'] +- ['projects_get-analytics-details.md', 'Projects', 'Get Analytics Details'] - ['projects_ios-apps-create.md', 'Projects', 'Ios Apps Create'] - ['projects_ios-apps-get.md', 'Projects', 'Ios Apps Get'] - ['projects_ios-apps-get-config.md', 'Projects', 'Ios Apps Get Config'] @@ -31,6 +33,7 @@ pages: - ['projects_ios-apps-patch.md', 'Projects', 'Ios Apps Patch'] - ['projects_list.md', 'Projects', 'List'] - ['projects_patch.md', 'Projects', 'Patch'] +- ['projects_remove-analytics.md', 'Projects', 'Remove Analytics'] - ['projects_search-apps.md', 'Projects', 'Search Apps'] - ['projects_web-apps-create.md', 'Projects', 'Web Apps Create'] - ['projects_web-apps-get.md', 'Projects', 'Web Apps Get'] diff --git a/gen/firebase1_beta1-cli/src/main.rs b/gen/firebase1_beta1-cli/src/main.rs index 14f83628f3..074cc7727a 100644 --- a/gen/firebase1_beta1-cli/src/main.rs +++ b/gen/firebase1_beta1-cli/src/main.rs @@ -244,6 +244,92 @@ impl<'n> Engine<'n> { } } + fn _projects_add_google_analytics(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "analytics-account-id" => Some(("analyticsAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "analytics-property-id" => Some(("analyticsPropertyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["analytics-account-id", "analytics-property-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AddGoogleAnalyticsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().add_google_analytics(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_android_apps_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1028,6 +1114,58 @@ impl<'n> Engine<'n> { } } + fn _projects_get_analytics_details(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().get_analytics_details(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_ios_apps_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1530,6 +1668,91 @@ impl<'n> Engine<'n> { } } + fn _projects_remove_analytics(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "analytics-property-id" => Some(("analyticsPropertyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["analytics-property-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RemoveAnalyticsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().remove_analytics(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_search_apps(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().search_apps(opt.value_of("parent").unwrap_or("")); @@ -1966,6 +2189,9 @@ impl<'n> Engine<'n> { ("add-firebase", Some(opt)) => { call_result = self._projects_add_firebase(opt, dry_run, &mut err); }, + ("add-google-analytics", Some(opt)) => { + call_result = self._projects_add_google_analytics(opt, dry_run, &mut err); + }, ("android-apps-create", Some(opt)) => { call_result = self._projects_android_apps_create(opt, dry_run, &mut err); }, @@ -2002,6 +2228,9 @@ impl<'n> Engine<'n> { ("get-admin-sdk-config", Some(opt)) => { call_result = self._projects_get_admin_sdk_config(opt, dry_run, &mut err); }, + ("get-analytics-details", Some(opt)) => { + call_result = self._projects_get_analytics_details(opt, dry_run, &mut err); + }, ("ios-apps-create", Some(opt)) => { call_result = self._projects_ios_apps_create(opt, dry_run, &mut err); }, @@ -2023,6 +2252,9 @@ impl<'n> Engine<'n> { ("patch", Some(opt)) => { call_result = self._projects_patch(opt, dry_run, &mut err); }, + ("remove-analytics", Some(opt)) => { + call_result = self._projects_remove_analytics(opt, dry_run, &mut err); + }, ("search-apps", Some(opt)) => { call_result = self._projects_search_apps(opt, dry_run, &mut err); }, @@ -2190,7 +2422,7 @@ fn main() { ]), ]), - ("projects", "methods: 'add-firebase', 'android-apps-create', 'android-apps-get', 'android-apps-get-config', 'android-apps-list', 'android-apps-patch', 'android-apps-sha-create', 'android-apps-sha-delete', 'android-apps-sha-list', 'available-locations-list', 'default-location-finalize', 'get', 'get-admin-sdk-config', 'ios-apps-create', 'ios-apps-get', 'ios-apps-get-config', 'ios-apps-list', 'ios-apps-patch', 'list', 'patch', 'search-apps', 'web-apps-create', 'web-apps-get', 'web-apps-get-config', 'web-apps-list' and 'web-apps-patch'", vec![ + ("projects", "methods: 'add-firebase', 'add-google-analytics', 'android-apps-create', 'android-apps-get', 'android-apps-get-config', 'android-apps-list', 'android-apps-patch', 'android-apps-sha-create', 'android-apps-sha-delete', 'android-apps-sha-list', 'available-locations-list', 'default-location-finalize', 'get', 'get-admin-sdk-config', 'get-analytics-details', 'ios-apps-create', 'ios-apps-get', 'ios-apps-get-config', 'ios-apps-list', 'ios-apps-patch', 'list', 'patch', 'remove-analytics', 'search-apps', 'web-apps-create', 'web-apps-get', 'web-apps-get-config', 'web-apps-list' and 'web-apps-patch'", vec![ ("add-firebase", Some(r##"Adds Firebase resources to the specified existing [Google Cloud Platform (GCP) `Project`] @@ -2216,8 +2448,6 @@ fn main() {
          This method does not modify any billing account information on the underlying GCP `Project`.
          -
          All fields listed in the [request body](#request-body) are required. -

          To call `AddFirebase`, a member must be an Editor or Owner for the existing GCP `Project`. Service accounts cannot call `AddFirebase`."##), "Details at http://byron.github.io/google-apis-rs/google_firebase1_beta1_cli/projects_add-firebase", @@ -2245,6 +2475,88 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("add-google-analytics", + Some(r##"Links a FirebaseProject with an existing + [Google Analytics account](http://www.google.com/analytics/). +
          +
          Using this call, you can either: +

            +
          • Specify an `analyticsAccountId` to provision a new Google Analytics + property within the specified account and associate the new property with + your `FirebaseProject`.
          • +
          • Specify an existing `analyticsPropertyId` to associate the property + with your `FirebaseProject`.
          • +
          +
          + Note that when you call `AddGoogleAnalytics`: +
            +
          1. The first check determines if any existing data streams in the + Google Analytics property correspond to any existing Firebase Apps in your + `FirebaseProject` (based on the `packageName` or `bundleId` associated with + the data stream). Then, as applicable, the data streams and apps are + linked. Note that this auto-linking only applies to Android Apps and iOS + Apps.
          2. +
          3. If no corresponding data streams are found for your Firebase Apps, + new data streams are provisioned in the Google Analytics property + for each of your Firebase Apps. Note that a new data stream is always + provisioned for a Web App even if it was previously associated with a + data stream in your Analytics property.
          4. +
          + Learn more about the hierarchy and structure of Google Analytics + accounts in the + [Analytics + documentation](https://support.google.com/analytics/answer/9303323). +
          +
          The result of this call is an [`Operation`](../../v1beta1/operations). + Poll the `Operation` to track the provisioning process by calling + GetOperation until + [`done`](../../v1beta1/operations#Operation.FIELDS.done) is `true`. When + `done` is `true`, the `Operation` has either succeeded or failed. If the + `Operation` succeeded, its + [`response`](../../v1beta1/operations#Operation.FIELDS.response) is set to + an AnalyticsDetails; if the `Operation` failed, its + [`error`](../../v1beta1/operations#Operation.FIELDS.error) is set to a + google.rpc.Status. +
          +
          To call `AddGoogleAnalytics`, a member must be an Owner for + the existing `FirebaseProject` and have the + [`Edit` permission](https://support.google.com/analytics/answer/2884495) + for the Google Analytics account. +
          +
          If a `FirebaseProject` already has Google Analytics enabled, and you + call `AddGoogleAnalytics` using an `analyticsPropertyId` that's different + from the currently associated property, then the call will fail. Analytics + may have already been enabled in the Firebase console or by specifying + `timeZone` and `regionCode` in the call to + [`AddFirebase`](../../v1beta1/projects/addFirebase)."##), + "Details at http://byron.github.io/google-apis-rs/google_firebase1_beta1_cli/projects_add-google-analytics", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent `FirebaseProject` to link to an existing Google Analytics + account, in the format: +
          projects/projectId"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2261,7 +2573,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent Project for which to list Apps, in the format: + Some(r##"The parent Project in which to create an App, in the format:
          projects/projectId"##), Some(true), Some(false)), @@ -2483,18 +2795,20 @@ fn main() { Some(r##"Returns a list of valid Google Cloud Platform (GCP) resource locations for the specified Project (including a FirebaseProject).
          -
          The default GCP resource location of a project defines the geographical - location where project resources, such as Cloud Firestore, will be - provisioned by default. +
          One of these locations can be selected as the Project's [_default_ GCP + resource location](https://firebase.google.com/docs/projects/locations), + which is the geographical location where project resources, such as Cloud + Firestore, will be provisioned by default. However, if the default GCP + resource location has already been set for the Project, then this setting + cannot be changed.
          -
          The returned list are the available - [GCP resource - locations](https://firebase.google.com/docs/projects/locations).
          -
          This call checks for any location restrictions for the specified - Project and, thus, might return a subset of all possible GCP resource - locations. To list all GCP resource locations (regardless of any - restrictions), call the endpoint without specifying a `projectId` (that is, - `/v1beta1/{parent=projects/-}/listAvailableLocations`). +
          This call checks for any possible + [location + restrictions](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations) + for the specified Project and, thus, might return a subset of all possible + GCP resource locations. To list all GCP resource locations (regardless of + any restrictions), call the endpoint without specifying a `projectId` (that + is, `/v1beta1/{parent=projects/-}/listAvailableLocations`).

          To call `ListAvailableLocations` with a specified project, a member must be at minimum a Viewer of the project. Calls without a specified @@ -2634,6 +2948,33 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-analytics-details", + Some(r##"Gets the Google Analytics details currently associated with a + FirebaseProject. +
          +
          If the `FirebaseProject` is not yet linked to Google Analytics, then + the response to `GetAnalyticsDetails` is NOT_FOUND."##), + "Details at http://byron.github.io/google-apis-rs/google_firebase1_beta1_cli/projects_get-analytics-details", + vec![ + (Some(r##"name"##), + None, + Some(r##"The fully qualified resource name, in the format: +
          projects/projectId/analyticsDetails"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2650,7 +2991,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent Project for which to list Apps, in the format: + Some(r##"The parent Project in which to create an App, in the format:
          projects/projectId"##), Some(true), Some(false)), @@ -2821,6 +3162,52 @@ fn main() { (Some(r##"name"##), None, Some(r##"The fully qualified resource name of the Project, in the format: +
          projects/projectId"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("remove-analytics", + Some(r##"Unlinks the specified `FirebaseProject` from its Google Analytics account. +
          +
          This call removes the association of the specified `FirebaseProject` + with its current Google Analytics property. However, this call does not + delete the Google Analytics resources, such as the Google Analytics + property or any data streams. +
          +
          These resources may be re-associated later to the `FirebaseProject` by + calling + [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics) and + specifying the same `analyticsPropertyId`. For Android Apps and iOS Apps, + this call re-links data streams with their corresponding apps. However, + for Web Apps, this call provisions a new data stream for each Web + App. +
          +
          To call `RemoveAnalytics`, a member must be an Owner for + the `FirebaseProject`."##), + "Details at http://byron.github.io/google-apis-rs/google_firebase1_beta1_cli/projects_remove-analytics", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The parent `FirebaseProject` to unlink from its Google Analytics account, + in the format:
          projects/projectId"##), Some(true), Some(false)), @@ -2881,7 +3268,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent Project for which to list Apps, in the format: + Some(r##"The parent Project in which to create an App, in the format:
          projects/projectId"##), Some(true), Some(false)), @@ -3019,7 +3406,7 @@ fn main() { let mut app = App::new("firebase1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190703") + .version("1.0.13+20200407") .about("The Firebase Management API enables programmatic setup and management of Firebase projects, including a project's Firebase resources and Firebase apps.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firebase1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/firebase1_beta1/Cargo.toml b/gen/firebase1_beta1/Cargo.toml index 5375598c53..a540854f71 100644 --- a/gen/firebase1_beta1/Cargo.toml +++ b/gen/firebase1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebase1_beta1" -version = "1.0.12+20190703" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Management (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebase1_beta1" homepage = "https://firebase.google.com" -documentation = "https://docs.rs/google-firebase1_beta1/1.0.12+20190703" +documentation = "https://docs.rs/google-firebase1_beta1/1.0.13+20200407" license = "MIT" keywords = ["firebase", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/firebase1_beta1/README.md b/gen/firebase1_beta1/README.md index 2867ee12e8..1fdce37601 100644 --- a/gen/firebase1_beta1/README.md +++ b/gen/firebase1_beta1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-firebase1_beta1` library allows access to all features of the *Google Firebase Management* service. -This documentation was generated from *Firebase Management* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *firebase:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Firebase Management* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *firebase:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Firebase Management* *v1_beta1* API can be found at the [official documentation site](https://firebase.google.com). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.FirebaseManagement.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.FirebaseManagement.html) ... * available projects - * [*list*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.AvailableProjectListCall.html) -* [operations](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.Operation.html) - * [*get*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.OperationGetCall.html) + * [*list*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.AvailableProjectListCall.html) +* [operations](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.Operation.html) + * [*get*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.OperationGetCall.html) * projects - * [*add firebase*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAddFirebaseCall.html), [*android apps create*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppCreateCall.html), [*android apps get*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppGetCall.html), [*android apps get config*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppGetConfigCall.html), [*android apps list*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppListCall.html), [*android apps patch*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppPatchCall.html), [*android apps sha create*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppShaCreateCall.html), [*android apps sha delete*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppShaDeleteCall.html), [*android apps sha list*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAndroidAppShaListCall.html), [*available locations list*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectAvailableLocationListCall.html), [*default location finalize*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectDefaultLocationFinalizeCall.html), [*get*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectGetCall.html), [*get admin sdk config*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectGetAdminSdkConfigCall.html), [*ios apps create*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectIosAppCreateCall.html), [*ios apps get*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectIosAppGetCall.html), [*ios apps get config*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectIosAppGetConfigCall.html), [*ios apps list*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectIosAppListCall.html), [*ios apps patch*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectIosAppPatchCall.html), [*list*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectListCall.html), [*patch*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectPatchCall.html), [*search apps*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectSearchAppCall.html), [*web apps create*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectWebAppCreateCall.html), [*web apps get*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectWebAppGetCall.html), [*web apps get config*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectWebAppGetConfigCall.html), [*web apps list*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectWebAppListCall.html) and [*web apps patch*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.ProjectWebAppPatchCall.html) + * [*add firebase*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAddFirebaseCall.html), [*add google analytics*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAddGoogleAnalyticCall.html), [*android apps create*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppCreateCall.html), [*android apps get*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppGetCall.html), [*android apps get config*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppGetConfigCall.html), [*android apps list*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppListCall.html), [*android apps patch*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppPatchCall.html), [*android apps sha create*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppShaCreateCall.html), [*android apps sha delete*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppShaDeleteCall.html), [*android apps sha list*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAndroidAppShaListCall.html), [*available locations list*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectAvailableLocationListCall.html), [*default location finalize*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectDefaultLocationFinalizeCall.html), [*get*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectGetCall.html), [*get admin sdk config*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectGetAdminSdkConfigCall.html), [*get analytics details*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectGetAnalyticsDetailCall.html), [*ios apps create*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectIosAppCreateCall.html), [*ios apps get*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectIosAppGetCall.html), [*ios apps get config*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectIosAppGetConfigCall.html), [*ios apps list*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectIosAppListCall.html), [*ios apps patch*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectIosAppPatchCall.html), [*list*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectListCall.html), [*patch*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectPatchCall.html), [*remove analytics*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectRemoveAnalyticCall.html), [*search apps*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectSearchAppCall.html), [*web apps create*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectWebAppCreateCall.html), [*web apps get*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectWebAppGetCall.html), [*web apps get config*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectWebAppGetConfigCall.html), [*web apps list*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectWebAppListCall.html) and [*web apps patch*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.ProjectWebAppPatchCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/struct.FirebaseManagement.html)** +* **[Hub](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/struct.FirebaseManagement.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -55,6 +55,7 @@ let r = hub.projects().add_firebase(...).doit() let r = hub.projects().default_location_finalize(...).doit() let r = hub.operations().get(...).doit() let r = hub.projects().ios_apps_create(...).doit() +let r = hub.projects().add_google_analytics(...).doit() let r = hub.projects().android_apps_create(...).doit() let r = hub.projects().web_apps_create(...).doit() ``` @@ -139,17 +140,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +160,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-firebase1_beta1/1.0.12+20190703/google_firebase1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firebase1_beta1/1.0.13+20200407/google_firebase1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/firebase1_beta1/src/lib.rs b/gen/firebase1_beta1/src/lib.rs index 52ba598ef3..ccc81f33cb 100644 --- a/gen/firebase1_beta1/src/lib.rs +++ b/gen/firebase1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Firebase Management* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *firebase:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Firebase Management* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *firebase:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Firebase Management* *v1_beta1* API can be found at the //! [official documentation site](https://firebase.google.com). @@ -16,7 +16,7 @@ //! * [operations](struct.Operation.html) //! * [*get*](struct.OperationGetCall.html) //! * projects -//! * [*add firebase*](struct.ProjectAddFirebaseCall.html), [*android apps create*](struct.ProjectAndroidAppCreateCall.html), [*android apps get*](struct.ProjectAndroidAppGetCall.html), [*android apps get config*](struct.ProjectAndroidAppGetConfigCall.html), [*android apps list*](struct.ProjectAndroidAppListCall.html), [*android apps patch*](struct.ProjectAndroidAppPatchCall.html), [*android apps sha create*](struct.ProjectAndroidAppShaCreateCall.html), [*android apps sha delete*](struct.ProjectAndroidAppShaDeleteCall.html), [*android apps sha list*](struct.ProjectAndroidAppShaListCall.html), [*available locations list*](struct.ProjectAvailableLocationListCall.html), [*default location finalize*](struct.ProjectDefaultLocationFinalizeCall.html), [*get*](struct.ProjectGetCall.html), [*get admin sdk config*](struct.ProjectGetAdminSdkConfigCall.html), [*ios apps create*](struct.ProjectIosAppCreateCall.html), [*ios apps get*](struct.ProjectIosAppGetCall.html), [*ios apps get config*](struct.ProjectIosAppGetConfigCall.html), [*ios apps list*](struct.ProjectIosAppListCall.html), [*ios apps patch*](struct.ProjectIosAppPatchCall.html), [*list*](struct.ProjectListCall.html), [*patch*](struct.ProjectPatchCall.html), [*search apps*](struct.ProjectSearchAppCall.html), [*web apps create*](struct.ProjectWebAppCreateCall.html), [*web apps get*](struct.ProjectWebAppGetCall.html), [*web apps get config*](struct.ProjectWebAppGetConfigCall.html), [*web apps list*](struct.ProjectWebAppListCall.html) and [*web apps patch*](struct.ProjectWebAppPatchCall.html) +//! * [*add firebase*](struct.ProjectAddFirebaseCall.html), [*add google analytics*](struct.ProjectAddGoogleAnalyticCall.html), [*android apps create*](struct.ProjectAndroidAppCreateCall.html), [*android apps get*](struct.ProjectAndroidAppGetCall.html), [*android apps get config*](struct.ProjectAndroidAppGetConfigCall.html), [*android apps list*](struct.ProjectAndroidAppListCall.html), [*android apps patch*](struct.ProjectAndroidAppPatchCall.html), [*android apps sha create*](struct.ProjectAndroidAppShaCreateCall.html), [*android apps sha delete*](struct.ProjectAndroidAppShaDeleteCall.html), [*android apps sha list*](struct.ProjectAndroidAppShaListCall.html), [*available locations list*](struct.ProjectAvailableLocationListCall.html), [*default location finalize*](struct.ProjectDefaultLocationFinalizeCall.html), [*get*](struct.ProjectGetCall.html), [*get admin sdk config*](struct.ProjectGetAdminSdkConfigCall.html), [*get analytics details*](struct.ProjectGetAnalyticsDetailCall.html), [*ios apps create*](struct.ProjectIosAppCreateCall.html), [*ios apps get*](struct.ProjectIosAppGetCall.html), [*ios apps get config*](struct.ProjectIosAppGetConfigCall.html), [*ios apps list*](struct.ProjectIosAppListCall.html), [*ios apps patch*](struct.ProjectIosAppPatchCall.html), [*list*](struct.ProjectListCall.html), [*patch*](struct.ProjectPatchCall.html), [*remove analytics*](struct.ProjectRemoveAnalyticCall.html), [*search apps*](struct.ProjectSearchAppCall.html), [*web apps create*](struct.ProjectWebAppCreateCall.html), [*web apps get*](struct.ProjectWebAppGetCall.html), [*web apps get config*](struct.ProjectWebAppGetConfigCall.html), [*web apps list*](struct.ProjectWebAppListCall.html) and [*web apps patch*](struct.ProjectWebAppPatchCall.html) //! //! //! @@ -55,6 +55,7 @@ //! let r = hub.projects().default_location_finalize(...).doit() //! let r = hub.operations().get(...).doit() //! let r = hub.projects().ios_apps_create(...).doit() +//! let r = hub.projects().add_google_analytics(...).doit() //! let r = hub.projects().android_apps_create(...).doit() //! let r = hub.projects().web_apps_create(...).doit() //! ``` @@ -350,7 +351,7 @@ impl<'a, C, A> FirebaseManagement FirebaseManagement { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://firebase.googleapis.com/".to_string(), _root_url: "https://firebase.googleapis.com/".to_string(), } @@ -367,7 +368,7 @@ impl<'a, C, A> FirebaseManagement } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -541,51 +542,55 @@ pub struct WebAppConfig { ///
          projectId.firebaseapp.com #[serde(rename="authDomain")] pub auth_domain: Option, + /// The unique Google-assigned identifier of the Google Analytics web stream + /// associated with the Firebase Web App. Firebase SDKs use this ID to interact + /// with Google Analytics APIs. + ///
          + ///
          This field is only present if the App is linked to a web stream in a + /// Google Analytics App + Web property. Learn more about this ID and Google + /// Analytics web streams in the [Analytics + /// documentation](https://support.google.com/analytics/topic/9303475). + ///
          + ///
          To generate a `measurementId` and link the Web App with a Google + /// Analytics web stream, call + /// [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics). + #[serde(rename="measurementId")] + pub measurement_id: Option, } impl ResponseResult for WebAppConfig {} -/// Details of a Firebase App for iOS. +/// There is no detailed description. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [ios apps create projects](struct.ProjectIosAppCreateCall.html) (request) -/// * [ios apps patch projects](struct.ProjectIosAppPatchCall.html) (request|response) -/// * [ios apps get projects](struct.ProjectIosAppGetCall.html) (response) +/// * [get analytics details projects](struct.ProjectGetAnalyticsDetailCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosApp { - /// The user-assigned display name of the App. - #[serde(rename="displayName")] - pub display_name: Option, - /// The fully qualified resource name of the App, in the format: - ///
          projects/projectId/iosApps/appId - pub name: Option, - /// The automatically generated Apple ID assigned to the App by Apple in the - /// iOS App Store. - #[serde(rename="appStoreId")] - pub app_store_id: Option, - /// Immutable. The globally unique, Firebase-assigned identifier of the App. +pub struct AnalyticsDetails { + /// The Analytics Property object associated with the specified + /// `FirebaseProject`. ///
          - ///
          This identifier should be treated as an opaque token, as the data - /// format is not specified. - #[serde(rename="appId")] - pub app_id: Option, - /// The globally unique, user-assigned ID of the parent Project for the App. - #[serde(rename="projectId")] - pub project_id: Option, - /// The canonical bundle ID of the iOS App as it would appear in the iOS - /// AppStore. - #[serde(rename="bundleId")] - pub bundle_id: Option, + ///
          This object contains the details of the Google Analytics property + /// associated with the specified `FirebaseProject`. + #[serde(rename="analyticsProperty")] + pub analytics_property: Option, + /// For Android Apps and iOS Apps: A map of `app` to `streamId` for each + /// Firebase App in the specified `FirebaseProject`. Each `app` and + /// `streamId` appears only once.
          + ///
          + /// For Web Apps: A map of `app` to `streamId` and `measurementId` for each + /// Firebase App in the specified `FirebaseProject`. Each `app`, `streamId`, + /// and `measurementId` appears only once. + #[serde(rename="streamMappings")] + pub stream_mappings: Option>, } -impl RequestValue for IosApp {} -impl ResponseResult for IosApp {} +impl ResponseResult for AnalyticsDetails {} /// There is no detailed description. @@ -617,36 +622,6 @@ pub struct ListAvailableProjectsResponse { impl ResponseResult for ListAvailableProjectsResponse {} -/// A reference to a Google Cloud Platform (GCP) `Project`. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProjectInfo { - /// The resource name of the GCP `Project` to which Firebase resources can be - /// added, in the format: - ///
          projects/projectId - pub project: Option, - /// The user-assigned display name of the GCP `Project`, for example: - /// My App - #[serde(rename="displayName")] - pub display_name: Option, - /// The ID of the project's default GCP resource location. The location is one - /// of the available - /// [GCP resource - /// locations](https://firebase.google.com/docs/projects/locations).

          - /// Not all projects will have this field populated. If it is not populated, it - /// means that the project does not yet have a default GCP resource location. - /// To set your project's default GCP resource location, call - /// [`FinalizeDefaultLocation`](../projects.defaultLocation/finalize) after you - /// add Firebase services to your project. - #[serde(rename="locationId")] - pub location_id: Option, -} - -impl Part for ProjectInfo {} - - /// There is no detailed description. /// /// # Activities @@ -675,64 +650,30 @@ pub struct ListAndroidAppsResponse { impl ResponseResult for ListAndroidAppsResponse {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [android apps sha list projects](struct.ProjectAndroidAppShaListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListShaCertificatesResponse { - /// The list of SHA certificates associated with the App. - pub certificates: Option>, -} - -impl ResponseResult for ListShaCertificatesResponse {} - - /// A GCP resource location that can be selected for a Project. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Location { - /// The ID of the default GCP resource location. It must be one of the - /// available - /// [GCP resource - /// locations](https://firebase.google.com/docs/projects/locations). + /// The ID of the GCP resource location. It will be one of the available [GCP + /// resource + /// locations](https://firebase.google.com/docs/projects/locations#types). #[serde(rename="locationId")] pub location_id: Option, + /// Indicates whether the GCP resource location is a [regional or + /// multi-regional + /// location](https://firebase.google.com/docs/projects/locations#types) + /// for data replication. + #[serde(rename="type")] + pub type_: Option, + /// Products and services that are available in the GCP resource location. + pub features: Option>, } impl Part for Location {} -/// Configuration metadata of a single Firebase App for Android. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [android apps get config projects](struct.ProjectAndroidAppGetConfigCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidAppConfig { - /// The contents of the JSON configuration file. - #[serde(rename="configFileContents")] - pub config_file_contents: Option, - /// The filename that the configuration artifact is typically saved as. - ///
          For example: `google-services.json` - #[serde(rename="configFilename")] - pub config_filename: Option, -} - -impl ResponseResult for AndroidAppConfig {} - - /// Details of a Firebase App for the web. /// /// # Activities @@ -770,78 +711,33 @@ impl RequestValue for WebApp {} impl ResponseResult for WebApp {} -/// Configuration metadata of a single Firebase App for iOS. +/// There is no detailed description. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [ios apps get config projects](struct.ProjectIosAppGetConfigCall.html) (response) +/// * [add google analytics projects](struct.ProjectAddGoogleAnalyticCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosAppConfig { - /// The content of the XML configuration file. - #[serde(rename="configFileContents")] - pub config_file_contents: Option, - /// The filename that the configuration artifact is typically saved as. - ///
          For example: `GoogleService-Info.plist` - #[serde(rename="configFilename")] - pub config_filename: Option, -} - -impl ResponseResult for IosAppConfig {} - - -/// A high-level summary of an App. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FirebaseAppInfo { - /// The platform of the Firebase App. - pub platform: Option, - /// The user-assigned display name of the Firebase App. - #[serde(rename="displayName")] - pub display_name: Option, - /// The fully qualified resource name of the Firebase App, in the format: - ///
          projects/projectId/iosApps/appId - /// or
          projects/projectId/androidApps/appId - /// - pub name: Option, - /// Immutable. The globally unique, Firebase-assigned identifier of the App. +pub struct AddGoogleAnalyticsRequest { + /// The ID for the existing + /// [Google Analytics account](http://www.google.com/analytics/) that you + /// want to link with your `FirebaseProject`. ///
          - ///
          This identifier should be treated as an opaque token, as the data - /// format is not specified. - #[serde(rename="appId")] - pub app_id: Option, + ///
          Specifying this field will provision a new Google Analytics + /// property in your Google Analytics account and associate the new property + /// with your `FirebaseProject`. + #[serde(rename="analyticsAccountId")] + pub analytics_account_id: Option, + /// The ID for the existing Google Analytics property that you want to + /// associate with your `FirebaseProject`. + #[serde(rename="analyticsPropertyId")] + pub analytics_property_id: Option, } -impl Part for FirebaseAppInfo {} - - -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. A typical example is to use it as the request -/// or the response type of an API method. For instance: -/// -/// ````text -/// service Foo { -/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -/// } -/// ```` -/// -/// The JSON representation for `Empty` is empty JSON object `{}`. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [android apps sha delete projects](struct.ProjectAndroidAppShaDeleteCall.html) (response) -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Empty { _never_set: Option } - -impl ResponseResult for Empty {} +impl RequestValue for AddGoogleAnalyticsRequest {} /// The `Status` type defines a logical error model that is suitable for @@ -944,6 +840,333 @@ impl RequestValue for AndroidApp {} impl ResponseResult for AndroidApp {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [ios apps list projects](struct.ProjectIosAppListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListIosAppsResponse { + /// If the result list is too large to fit in a single response, then a token + /// is returned. If the string is empty, then this response is the last page of + /// results. + ///
          + ///
          This token can be used in a subsequent call to `ListIosApps` to find + /// the next group of Apps. + ///
          + ///
          Page tokens are short-lived and should not be persisted. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of each IosApp that is in the parent Firebase Project. + pub apps: Option>, +} + +impl ResponseResult for ListIosAppsResponse {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [android apps sha delete projects](struct.ProjectAndroidAppShaDeleteCall.html) (response) +/// * [remove analytics projects](struct.ProjectRemoveAnalyticCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// Details of a Firebase App for iOS. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [ios apps create projects](struct.ProjectIosAppCreateCall.html) (request) +/// * [ios apps patch projects](struct.ProjectIosAppPatchCall.html) (request|response) +/// * [ios apps get projects](struct.ProjectIosAppGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IosApp { + /// The user-assigned display name of the App. + #[serde(rename="displayName")] + pub display_name: Option, + /// The fully qualified resource name of the App, in the format: + ///
          projects/projectId/iosApps/appId + pub name: Option, + /// The automatically generated Apple ID assigned to the App by Apple in the + /// iOS App Store. + #[serde(rename="appStoreId")] + pub app_store_id: Option, + /// Immutable. The globally unique, Firebase-assigned identifier of the App. + ///
          + ///
          This identifier should be treated as an opaque token, as the data + /// format is not specified. + #[serde(rename="appId")] + pub app_id: Option, + /// The globally unique, user-assigned ID of the parent Project for the App. + #[serde(rename="projectId")] + pub project_id: Option, + /// The canonical bundle ID of the iOS App as it would appear in the iOS + /// AppStore. + #[serde(rename="bundleId")] + pub bundle_id: Option, +} + +impl RequestValue for IosApp {} +impl ResponseResult for IosApp {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [default location finalize projects](struct.ProjectDefaultLocationFinalizeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FinalizeDefaultLocationRequest { + /// The ID of the default GCP resource location for the Project. The location + /// must be one of the available + /// [GCP resource + /// locations](https://firebase.google.com/docs/projects/locations). + #[serde(rename="locationId")] + pub location_id: Option, +} + +impl RequestValue for FinalizeDefaultLocationRequest {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [web apps list projects](struct.ProjectWebAppListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListWebAppsResponse { + /// If the result list is too large to fit in a single response, then a token + /// is returned. If the string is empty, then this response is the last page of + /// results. + ///
          + ///
          This token can be used in a subsequent call to `ListWebApps` to find + /// the next group of Apps. + ///
          + ///
          Page tokens are short-lived and should not be persisted. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of each WebApp that is in the parent Firebase Project. + pub apps: Option>, +} + +impl ResponseResult for ListWebAppsResponse {} + + +/// A mapping of a Firebase App to a Google Analytics data stream +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StreamMapping { + /// The fully qualified resource name of the Firebase App associated with the + /// Google Analytics data stream, in the format: + ///
          projects/projectId/androidApps/appId + /// or + /// projects/projectId/iosApps/appId + /// or + /// projects/projectId/webApps/appId + pub app: Option, + /// Applicable for Firebase Web Apps only.
          + ///
          The unique Google-assigned identifier of the Google Analytics web + /// stream associated with the Firebase Web App. Firebase SDKs use this ID to + /// interact with Google Analytics APIs. + ///
          + ///
          Learn more about this ID and Google Analytics web streams in the + /// [Analytics + /// documentation](https://support.google.com/analytics/topic/9303475). + #[serde(rename="measurementId")] + pub measurement_id: Option, + /// The unique Google-assigned identifier of the Google Analytics data stream + /// associated with the Firebase App. + ///
          + ///
          Learn more about Google Analytics data streams in the + /// [Analytics + /// documentation](https://support.google.com/analytics/answer/9303323). + #[serde(rename="streamId")] + pub stream_id: Option, +} + +impl Part for StreamMapping {} + + +/// Configuration metadata of a single Firebase App for Android. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [android apps get config projects](struct.ProjectAndroidAppGetConfigCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidAppConfig { + /// The contents of the JSON configuration file. + #[serde(rename="configFileContents")] + pub config_file_contents: Option, + /// The filename that the configuration artifact is typically saved as. + ///
          For example: `google-services.json` + #[serde(rename="configFilename")] + pub config_filename: Option, +} + +impl ResponseResult for AndroidAppConfig {} + + +/// A reference to a Google Cloud Platform (GCP) `Project`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProjectInfo { + /// The resource name of the GCP `Project` to which Firebase resources can be + /// added, in the format: + ///
          projects/projectId + pub project: Option, + /// The user-assigned display name of the GCP `Project`, for example: + /// My App + #[serde(rename="displayName")] + pub display_name: Option, + /// The ID of the project's default GCP resource location. The location is one + /// of the available + /// [GCP resource + /// locations](https://firebase.google.com/docs/projects/locations).

          + /// Not all projects will have this field populated. If it is not populated, it + /// means that the project does not yet have a default GCP resource location. + /// To set your project's default GCP resource location, call + /// [`FinalizeDefaultLocation`](../projects.defaultLocation/finalize) after you + /// add Firebase resources to your project. + #[serde(rename="locationId")] + pub location_id: Option, +} + +impl Part for ProjectInfo {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [android apps sha list projects](struct.ProjectAndroidAppShaListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListShaCertificatesResponse { + /// The list of SHA certificates associated with the App. + pub certificates: Option>, +} + +impl ResponseResult for ListShaCertificatesResponse {} + + +/// Configuration metadata of a single Firebase App for iOS. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [ios apps get config projects](struct.ProjectIosAppGetConfigCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IosAppConfig { + /// The content of the XML configuration file. + #[serde(rename="configFileContents")] + pub config_file_contents: Option, + /// The filename that the configuration artifact is typically saved as. + ///
          For example: `GoogleService-Info.plist` + #[serde(rename="configFilename")] + pub config_filename: Option, +} + +impl ResponseResult for IosAppConfig {} + + +/// A high-level summary of an App. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FirebaseAppInfo { + /// The platform of the Firebase App. + pub platform: Option, + /// The user-assigned display name of the Firebase App. + #[serde(rename="displayName")] + pub display_name: Option, + /// The fully qualified resource name of the Firebase App, in the format: + ///
          projects/projectId/iosApps/appId + /// or
          projects/projectId/androidApps/appId + /// + pub name: Option, + /// Immutable. The globally unique, Firebase-assigned identifier of the App. + ///
          + ///
          This identifier should be treated as an opaque token, as the data + /// format is not specified. + #[serde(rename="appId")] + pub app_id: Option, +} + +impl Part for FirebaseAppInfo {} + + +/// Details of a Google Analytics property +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AnalyticsProperty { + /// The display name of the Google Analytics property associated with the + /// specified `FirebaseProject`. + #[serde(rename="displayName")] + pub display_name: Option, + /// The globally unique, Google-assigned identifier of the Google Analytics + /// property associated with the specified `FirebaseProject`. + ///
          + ///
          If you called + /// [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics) to link + /// your `FirebaseProject` with a Google Analytics account, the value in this + /// `id` field is the same as the ID of the property either specified or + /// provisioned with that call to `AddGoogleAnalytics`. + pub id: Option, +} + +impl Part for AnalyticsProperty {} + + /// The default resources associated with a `FirebaseProject`. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1002,75 +1225,24 @@ impl Part for DefaultResources {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [ios apps list projects](struct.ProjectIosAppListCall.html) (response) +/// * [remove analytics projects](struct.ProjectRemoveAnalyticCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListIosAppsResponse { - /// If the result list is too large to fit in a single response, then a token - /// is returned. If the string is empty, then this response is the last page of - /// results. - ///
          - ///
          This token can be used in a subsequent call to `ListIosApps` to find - /// the next group of Apps. - ///
          - ///
          Page tokens are short-lived and should not be persisted. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of each IosApp that is in the parent Firebase Project. - pub apps: Option>, +pub struct RemoveAnalyticsRequest { + /// Optional. The ID of the Google Analytics property associated with the + /// specified `FirebaseProject`. + ///
            + ///
          • If not set, then the Google Analytics property that is currently + /// associated with the specified `FirebaseProject` is removed.
          • + ///
          • If set, and the specified `FirebaseProject` is currently associated + /// with a different Google Analytics property, then the response is a + /// `412 Precondition Failed` error.
          • + ///
          + #[serde(rename="analyticsPropertyId")] + pub analytics_property_id: Option, } -impl ResponseResult for ListIosAppsResponse {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [web apps list projects](struct.ProjectWebAppListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListWebAppsResponse { - /// If the result list is too large to fit in a single response, then a token - /// is returned. If the string is empty, then this response is the last page of - /// results. - ///
          - ///
          This token can be used in a subsequent call to `ListWebApps` to find - /// the next group of Apps. - ///
          - ///
          Page tokens are short-lived and should not be persisted. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of each WebApp that is in the parent Firebase Project. - pub apps: Option>, -} - -impl ResponseResult for ListWebAppsResponse {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [default location finalize projects](struct.ProjectDefaultLocationFinalizeCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FinalizeDefaultLocationRequest { - /// The ID of the default GCP resource location for the Project. The location - /// must be one of the available - /// [GCP resource - /// locations](https://firebase.google.com/docs/projects/locations). - #[serde(rename="locationId")] - pub location_id: Option, -} - -impl RequestValue for FinalizeDefaultLocationRequest {} +impl RequestValue for RemoveAnalyticsRequest {} /// All fields are required. @@ -1084,7 +1256,11 @@ impl RequestValue for FinalizeDefaultLocationRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AddFirebaseRequest { - /// The region code (CLDR) that the account will use for Firebase Analytics + /// Deprecated. Instead, to link your Project with a Google Analytics account, + /// call [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics) + /// after you add Firebase resources to your Project. + ///
          + ///
          The region code (CLDR) that the account will use for Firebase Analytics /// data. ///
          For example: US, GB, or DE ///
          @@ -1093,7 +1269,7 @@ pub struct AddFirebaseRequest { pub region_code: Option, /// Deprecated. Instead, to set your project's default GCP resource location, /// call [`FinalizeDefaultLocation`](../projects.defaultLocation/finalize) - /// after you add Firebase services to your project. + /// after you add Firebase resources to your project. ///
          ///
          The ID of the project's default GCP resource location. The location /// must be one of the available @@ -1101,7 +1277,11 @@ pub struct AddFirebaseRequest { /// locations](https://firebase.google.com/docs/projects/locations). #[serde(rename="locationId")] pub location_id: Option, - /// The time zone that the account will use for Firebase Analytics data. + /// Deprecated. Instead, to link your Project with a Google Analytics account, + /// call [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics) + /// after you add Firebase resources to your Project. + ///
          + ///
          The time zone that the account will use for Firebase Analytics data. ///
          For example: America/Los_Angeles or Africa/Abidjan #[serde(rename="timeZone")] pub time_zone: Option, @@ -1122,6 +1302,7 @@ impl RequestValue for AddFirebaseRequest {} /// * [default location finalize projects](struct.ProjectDefaultLocationFinalizeCall.html) (response) /// * [get operations](struct.OperationGetCall.html) (response) /// * [ios apps create projects](struct.ProjectIosAppCreateCall.html) (response) +/// * [add google analytics projects](struct.ProjectAddGoogleAnalyticCall.html) (response) /// * [android apps create projects](struct.ProjectAndroidAppCreateCall.html) (response) /// * [web apps create projects](struct.ProjectWebAppCreateCall.html) (response) /// @@ -1370,7 +1551,7 @@ impl<'a, C, A> AvailableProjectMethods<'a, C, A> { /// ::default(), None); /// let mut hub = FirebaseManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `add_firebase(...)`, `android_apps_create(...)`, `android_apps_get(...)`, `android_apps_get_config(...)`, `android_apps_list(...)`, `android_apps_patch(...)`, `android_apps_sha_create(...)`, `android_apps_sha_delete(...)`, `android_apps_sha_list(...)`, `available_locations_list(...)`, `default_location_finalize(...)`, `get(...)`, `get_admin_sdk_config(...)`, `ios_apps_create(...)`, `ios_apps_get(...)`, `ios_apps_get_config(...)`, `ios_apps_list(...)`, `ios_apps_patch(...)`, `list(...)`, `patch(...)`, `search_apps(...)`, `web_apps_create(...)`, `web_apps_get(...)`, `web_apps_get_config(...)`, `web_apps_list(...)` and `web_apps_patch(...)` +/// // like `add_firebase(...)`, `add_google_analytics(...)`, `android_apps_create(...)`, `android_apps_get(...)`, `android_apps_get_config(...)`, `android_apps_list(...)`, `android_apps_patch(...)`, `android_apps_sha_create(...)`, `android_apps_sha_delete(...)`, `android_apps_sha_list(...)`, `available_locations_list(...)`, `default_location_finalize(...)`, `get(...)`, `get_admin_sdk_config(...)`, `get_analytics_details(...)`, `ios_apps_create(...)`, `ios_apps_get(...)`, `ios_apps_get_config(...)`, `ios_apps_list(...)`, `ios_apps_patch(...)`, `list(...)`, `patch(...)`, `remove_analytics(...)`, `search_apps(...)`, `web_apps_create(...)`, `web_apps_get(...)`, `web_apps_get_config(...)`, `web_apps_list(...)` and `web_apps_patch(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1601,8 +1782,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ///
          This method does not modify any billing account information on the /// underlying GCP `Project`. ///
          - ///
          All fields listed in the [request body](#request-body) are required. - ///
          ///
          To call `AddFirebase`, a member must be an Editor or Owner for the /// existing GCP `Project`. Service accounts cannot call `AddFirebase`. /// @@ -1675,6 +1854,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets the Google Analytics details currently associated with a + /// FirebaseProject. + ///
          + ///
          If the `FirebaseProject` is not yet linked to Google Analytics, then + /// the response to `GetAnalyticsDetails` is NOT_FOUND. + /// + /// # Arguments + /// + /// * `name` - The fully qualified resource name, in the format: + ///
          projects/projectId/analyticsDetails + pub fn get_analytics_details(&self, name: &str) -> ProjectGetAnalyticsDetailCall<'a, C, A> { + ProjectGetAnalyticsDetailCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the attributes of the WebApp identified by the specified @@ -1721,6 +1922,79 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Links a FirebaseProject with an existing + /// [Google Analytics account](http://www.google.com/analytics/). + ///
          + ///
          Using this call, you can either: + ///
            + ///
          • Specify an `analyticsAccountId` to provision a new Google Analytics + /// property within the specified account and associate the new property with + /// your `FirebaseProject`.
          • + ///
          • Specify an existing `analyticsPropertyId` to associate the property + /// with your `FirebaseProject`.
          • + ///
          + ///
          + /// Note that when you call `AddGoogleAnalytics`: + ///
            + ///
          1. The first check determines if any existing data streams in the + /// Google Analytics property correspond to any existing Firebase Apps in your + /// `FirebaseProject` (based on the `packageName` or `bundleId` associated with + /// the data stream). Then, as applicable, the data streams and apps are + /// linked. Note that this auto-linking only applies to Android Apps and iOS + /// Apps.
          2. + ///
          3. If no corresponding data streams are found for your Firebase Apps, + /// new data streams are provisioned in the Google Analytics property + /// for each of your Firebase Apps. Note that a new data stream is always + /// provisioned for a Web App even if it was previously associated with a + /// data stream in your Analytics property.
          4. + ///
          + /// Learn more about the hierarchy and structure of Google Analytics + /// accounts in the + /// [Analytics + /// documentation](https://support.google.com/analytics/answer/9303323). + ///
          + ///
          The result of this call is an [`Operation`](../../v1beta1/operations). + /// Poll the `Operation` to track the provisioning process by calling + /// GetOperation until + /// [`done`](../../v1beta1/operations#Operation.FIELDS.done) is `true`. When + /// `done` is `true`, the `Operation` has either succeeded or failed. If the + /// `Operation` succeeded, its + /// [`response`](../../v1beta1/operations#Operation.FIELDS.response) is set to + /// an AnalyticsDetails; if the `Operation` failed, its + /// [`error`](../../v1beta1/operations#Operation.FIELDS.error) is set to a + /// google.rpc.Status. + ///
          + ///
          To call `AddGoogleAnalytics`, a member must be an Owner for + /// the existing `FirebaseProject` and have the + /// [`Edit` permission](https://support.google.com/analytics/answer/2884495) + /// for the Google Analytics account. + ///
          + ///
          If a `FirebaseProject` already has Google Analytics enabled, and you + /// call `AddGoogleAnalytics` using an `analyticsPropertyId` that's different + /// from the currently associated property, then the call will fail. Analytics + /// may have already been enabled in the Firebase console or by specifying + /// `timeZone` and `regionCode` in the call to + /// [`AddFirebase`](../../v1beta1/projects/addFirebase). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The parent `FirebaseProject` to link to an existing Google Analytics + /// account, in the format: + ///
          projects/projectId + pub fn add_google_analytics(&self, request: AddGoogleAnalyticsRequest, parent: &str) -> ProjectAddGoogleAnalyticCall<'a, C, A> { + ProjectAddGoogleAnalyticCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the IosApp identified by the specified resource name. @@ -1753,7 +2027,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent Project for which to list Apps, in the format: + /// * `parent` - The parent Project in which to create an App, in the format: ///
          projects/projectId pub fn web_apps_create(&self, request: WebApp, parent: &str) -> ProjectWebAppCreateCall<'a, C, A> { ProjectWebAppCreateCall { @@ -1814,18 +2088,20 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Returns a list of valid Google Cloud Platform (GCP) resource locations for /// the specified Project (including a FirebaseProject). ///
          - ///
          The default GCP resource location of a project defines the geographical - /// location where project resources, such as Cloud Firestore, will be - /// provisioned by default. + ///
          One of these locations can be selected as the Project's [_default_ GCP + /// resource location](https://firebase.google.com/docs/projects/locations), + /// which is the geographical location where project resources, such as Cloud + /// Firestore, will be provisioned by default. However, if the default GCP + /// resource location has already been set for the Project, then this setting + /// cannot be changed. ///
          - ///
          The returned list are the available - /// [GCP resource - /// locations](https://firebase.google.com/docs/projects/locations).
          - ///
          This call checks for any location restrictions for the specified - /// Project and, thus, might return a subset of all possible GCP resource - /// locations. To list all GCP resource locations (regardless of any - /// restrictions), call the endpoint without specifying a `projectId` (that is, - /// `/v1beta1/{parent=projects/-}/listAvailableLocations`). + ///
          This call checks for any possible + /// [location + /// restrictions](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations) + /// for the specified Project and, thus, might return a subset of all possible + /// GCP resource locations. To list all GCP resource locations (regardless of + /// any restrictions), call the endpoint without specifying a `projectId` (that + /// is, `/v1beta1/{parent=projects/-}/listAvailableLocations`). ///
          ///
          To call `ListAvailableLocations` with a specified project, a member /// must be at minimum a Viewer of the project. Calls without a specified @@ -1861,7 +2137,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent Project for which to list Apps, in the format: + /// * `parent` - The parent Project in which to create an App, in the format: ///
          projects/projectId pub fn ios_apps_create(&self, request: IosApp, parent: &str) -> ProjectIosAppCreateCall<'a, C, A> { ProjectIosAppCreateCall { @@ -1974,7 +2250,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent Project for which to list Apps, in the format: + /// * `parent` - The parent Project in which to create an App, in the format: ///
          projects/projectId pub fn android_apps_create(&self, request: AndroidApp, parent: &str) -> ProjectAndroidAppCreateCall<'a, C, A> { ProjectAndroidAppCreateCall { @@ -2053,6 +2329,43 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Unlinks the specified `FirebaseProject` from its Google Analytics account. + ///
          + ///
          This call removes the association of the specified `FirebaseProject` + /// with its current Google Analytics property. However, this call does not + /// delete the Google Analytics resources, such as the Google Analytics + /// property or any data streams. + ///
          + ///
          These resources may be re-associated later to the `FirebaseProject` by + /// calling + /// [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics) and + /// specifying the same `analyticsPropertyId`. For Android Apps and iOS Apps, + /// this call re-links data streams with their corresponding apps. However, + /// for Web Apps, this call provisions a new data stream for each Web + /// App. + ///
          + ///
          To call `RemoveAnalytics`, a member must be an Owner for + /// the `FirebaseProject`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The parent `FirebaseProject` to unlink from its Google Analytics account, + /// in the format: + ///
          projects/projectId + pub fn remove_analytics(&self, request: RemoveAnalyticsRequest, parent: &str) -> ProjectRemoveAnalyticCall<'a, C, A> { + ProjectRemoveAnalyticCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -4509,8 +4822,6 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o ///
          This method does not modify any billing account information on the /// underlying GCP `Project`. ///
          -///
          All fields listed in the [request body](#request-body) are required. -///
          ///
          To call `AddFirebase`, a member must be an Editor or Owner for the /// existing GCP `Project`. Service accounts cannot call `AddFirebase`. /// @@ -5363,6 +5674,259 @@ impl<'a, C, A> ProjectIosAppListCall<'a, C, A> where C: BorrowMut } +/// Gets the Google Analytics details currently associated with a +/// FirebaseProject. +///
          +///
          If the `FirebaseProject` is not yet linked to Google Analytics, then +/// the response to `GetAnalyticsDetails` is NOT_FOUND. +/// +/// A builder for the *getAnalyticsDetails* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebase1_beta1 as firebase1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebase1_beta1::FirebaseManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().get_analytics_details("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetAnalyticsDetailCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseManagement, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetAnalyticsDetailCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetAnalyticsDetailCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AnalyticsDetails)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebase.projects.getAnalyticsDetails", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The fully qualified resource name, in the format: + ///
          projects/projectId/analyticsDetails + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectGetAnalyticsDetailCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGetAnalyticsDetailCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGetAnalyticsDetailCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetAnalyticsDetailCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the attributes of the WebApp identified by the specified /// resource name. /// @@ -5398,7 +5962,7 @@ impl<'a, C, A> ProjectIosAppListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().web_apps_patch(req, "name") -/// .update_mask("et") +/// .update_mask("diam") /// .doit(); /// # } /// ``` @@ -5690,8 +6254,8 @@ impl<'a, C, A> ProjectWebAppPatchCall<'a, C, A> where C: BorrowMut ProjectWebAppListCall<'a, C, A> where C: BorrowMut } +/// Links a FirebaseProject with an existing +/// [Google Analytics account](http://www.google.com/analytics/). +///
          +///
          Using this call, you can either: +///
            +///
          • Specify an `analyticsAccountId` to provision a new Google Analytics +/// property within the specified account and associate the new property with +/// your `FirebaseProject`.
          • +///
          • Specify an existing `analyticsPropertyId` to associate the property +/// with your `FirebaseProject`.
          • +///
          +///
          +/// Note that when you call `AddGoogleAnalytics`: +///
            +///
          1. The first check determines if any existing data streams in the +/// Google Analytics property correspond to any existing Firebase Apps in your +/// `FirebaseProject` (based on the `packageName` or `bundleId` associated with +/// the data stream). Then, as applicable, the data streams and apps are +/// linked. Note that this auto-linking only applies to Android Apps and iOS +/// Apps.
          2. +///
          3. If no corresponding data streams are found for your Firebase Apps, +/// new data streams are provisioned in the Google Analytics property +/// for each of your Firebase Apps. Note that a new data stream is always +/// provisioned for a Web App even if it was previously associated with a +/// data stream in your Analytics property.
          4. +///
          +/// Learn more about the hierarchy and structure of Google Analytics +/// accounts in the +/// [Analytics +/// documentation](https://support.google.com/analytics/answer/9303323). +///
          +///
          The result of this call is an [`Operation`](../../v1beta1/operations). +/// Poll the `Operation` to track the provisioning process by calling +/// GetOperation until +/// [`done`](../../v1beta1/operations#Operation.FIELDS.done) is `true`. When +/// `done` is `true`, the `Operation` has either succeeded or failed. If the +/// `Operation` succeeded, its +/// [`response`](../../v1beta1/operations#Operation.FIELDS.response) is set to +/// an AnalyticsDetails; if the `Operation` failed, its +/// [`error`](../../v1beta1/operations#Operation.FIELDS.error) is set to a +/// google.rpc.Status. +///
          +///
          To call `AddGoogleAnalytics`, a member must be an Owner for +/// the existing `FirebaseProject` and have the +/// [`Edit` permission](https://support.google.com/analytics/answer/2884495) +/// for the Google Analytics account. +///
          +///
          If a `FirebaseProject` already has Google Analytics enabled, and you +/// call `AddGoogleAnalytics` using an `analyticsPropertyId` that's different +/// from the currently associated property, then the call will fail. Analytics +/// may have already been enabled in the Firebase console or by specifying +/// `timeZone` and `regionCode` in the call to +/// [`AddFirebase`](../../v1beta1/projects/addFirebase). +/// +/// A builder for the *addGoogleAnalytics* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebase1_beta1 as firebase1_beta1; +/// use firebase1_beta1::AddGoogleAnalyticsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebase1_beta1::FirebaseManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AddGoogleAnalyticsRequest::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().add_google_analytics(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAddGoogleAnalyticCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseManagement, + _request: AddGoogleAnalyticsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAddGoogleAnalyticCall<'a, C, A> {} + +impl<'a, C, A> ProjectAddGoogleAnalyticCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebase.projects.addGoogleAnalytics", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:addGoogleAnalytics"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AddGoogleAnalyticsRequest) -> ProjectAddGoogleAnalyticCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent `FirebaseProject` to link to an existing Google Analytics + /// account, in the format: + ///
          projects/projectId + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectAddGoogleAnalyticCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAddGoogleAnalyticCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAddGoogleAnalyticCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAddGoogleAnalyticCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the IosApp identified by the specified resource name. /// /// A builder for the *iosApps.get* method supported by a *project* resource. @@ -6402,7 +7299,7 @@ impl<'a, C, A> ProjectWebAppCreateCall<'a, C, A> where C: BorrowMutprojects/projectId /// /// Sets the *parent* path property to the given value. @@ -6550,7 +7447,7 @@ impl<'a, C, A> ProjectWebAppGetConfigCall<'a, C, A> where C: BorrowMut ProjectWebAppGetConfigCall<'a, C, A> where C: BorrowMut ProjectAndroidAppGetConfigCall<'a, C, A> where C: BorrowMut ProjectAndroidAppGetConfigCall<'a, C, A> where C: BorrowMut ProjectAndroidAppGetConfigCall<'a, C, A> where C: BorrowMut -///
          The default GCP resource location of a project defines the geographical -/// location where project resources, such as Cloud Firestore, will be -/// provisioned by default. +///
          One of these locations can be selected as the Project's [_default_ GCP +/// resource location](https://firebase.google.com/docs/projects/locations), +/// which is the geographical location where project resources, such as Cloud +/// Firestore, will be provisioned by default. However, if the default GCP +/// resource location has already been set for the Project, then this setting +/// cannot be changed. ///
          -///
          The returned list are the available -/// [GCP resource -/// locations](https://firebase.google.com/docs/projects/locations).
          -///
          This call checks for any location restrictions for the specified -/// Project and, thus, might return a subset of all possible GCP resource -/// locations. To list all GCP resource locations (regardless of any -/// restrictions), call the endpoint without specifying a `projectId` (that is, -/// `/v1beta1/{parent=projects/-}/listAvailableLocations`). +///
          This call checks for any possible +/// [location +/// restrictions](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations) +/// for the specified Project and, thus, might return a subset of all possible +/// GCP resource locations. To list all GCP resource locations (regardless of +/// any restrictions), call the endpoint without specifying a `projectId` (that +/// is, `/v1beta1/{parent=projects/-}/listAvailableLocations`). ///
          ///
          To call `ListAvailableLocations` with a specified project, a member /// must be at minimum a Viewer of the project. Calls without a specified @@ -7027,8 +7926,8 @@ impl<'a, C, A> ProjectAndroidAppGetConfigCall<'a, C, A> where C: BorrowMut ProjectIosAppCreateCall<'a, C, A> where C: BorrowMutprojects/projectId /// /// Sets the *parent* path property to the given value. @@ -8390,7 +9289,7 @@ impl<'a, C, A> ProjectAndroidAppShaCreateCall<'a, C, A> where C: BorrowMut ProjectAndroidAppCreateCall<'a, C, A> where C: BorrowMutprojects/projectId /// /// Sets the *parent* path property to the given value. @@ -9221,8 +10120,8 @@ impl<'a, C, A> ProjectGetAdminSdkConfigCall<'a, C, A> where C: BorrowMut ProjectIosAppGetConfigCall<'a, C, A> where C: BorrowMut ProjectIosAppGetConfigCall<'a, C, A> where C: BorrowMut ProjectIosAppGetConfigCall<'a, C, A> where C: BorrowMut +///
          This call removes the association of the specified `FirebaseProject` +/// with its current Google Analytics property. However, this call does not +/// delete the Google Analytics resources, such as the Google Analytics +/// property or any data streams. +///
          +///
          These resources may be re-associated later to the `FirebaseProject` by +/// calling +/// [`AddGoogleAnalytics`](../../v1beta1/projects/addGoogleAnalytics) and +/// specifying the same `analyticsPropertyId`. For Android Apps and iOS Apps, +/// this call re-links data streams with their corresponding apps. However, +/// for Web Apps, this call provisions a new data stream for each Web +/// App. +///
          +///
          To call `RemoveAnalytics`, a member must be an Owner for +/// the `FirebaseProject`. +/// +/// A builder for the *removeAnalytics* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebase1_beta1 as firebase1_beta1; +/// use firebase1_beta1::RemoveAnalyticsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebase1_beta1::FirebaseManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RemoveAnalyticsRequest::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().remove_analytics(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRemoveAnalyticCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseManagement, + _request: RemoveAnalyticsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRemoveAnalyticCall<'a, C, A> {} + +impl<'a, C, A> ProjectRemoveAnalyticCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebase.projects.removeAnalytics", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}:removeAnalytics"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RemoveAnalyticsRequest) -> ProjectRemoveAnalyticCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent `FirebaseProject` to unlink from its Google Analytics account, + /// in the format: + ///
          projects/projectId + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectRemoveAnalyticCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectRemoveAnalyticCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectRemoveAnalyticCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRemoveAnalyticCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/firebasedynamiclinks1-cli/Cargo.toml b/gen/firebasedynamiclinks1-cli/Cargo.toml index f04ffed4f2..d7598ca0a3 100644 --- a/gen/firebasedynamiclinks1-cli/Cargo.toml +++ b/gen/firebasedynamiclinks1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-firebasedynamiclinks1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200410" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Dynamic Links (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebasedynamiclinks1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-firebasedynamiclinks1] path = "../firebasedynamiclinks1" -version = "1.0.12+20190628" +version = "1.0.13+20200410" diff --git a/gen/firebasedynamiclinks1-cli/README.md b/gen/firebasedynamiclinks1-cli/README.md index 3ed69f2b47..e517b4f835 100644 --- a/gen/firebasedynamiclinks1-cli/README.md +++ b/gen/firebasedynamiclinks1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firebase Dynamic Links* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Firebase Dynamic Links* API at revision *20200410*. The CLI is at version *1.0.13*. ```bash firebasedynamiclinks1 [options] diff --git a/gen/firebasedynamiclinks1-cli/mkdocs.yml b/gen/firebasedynamiclinks1-cli/mkdocs.yml index f8c0c6bd53..32c236d6df 100644 --- a/gen/firebasedynamiclinks1-cli/mkdocs.yml +++ b/gen/firebasedynamiclinks1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Dynamic Links v1.0.12+20190628 +site_name: Firebase Dynamic Links v1.0.13+20200410 site_url: http://byron.github.io/google-apis-rs/google-firebasedynamiclinks1-cli site_description: A complete library to interact with Firebase Dynamic Links (protocol v1) diff --git a/gen/firebasedynamiclinks1-cli/src/main.rs b/gen/firebasedynamiclinks1-cli/src/main.rs index b43a0e3787..f568f53012 100644 --- a/gen/firebasedynamiclinks1-cli/src/main.rs +++ b/gen/firebasedynamiclinks1-cli/src/main.rs @@ -799,7 +799,7 @@ fn main() { let mut app = App::new("firebasedynamiclinks1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200410") .about("Programmatically creates and manages Firebase Dynamic Links.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firebasedynamiclinks1_cli") .arg(Arg::with_name("url") diff --git a/gen/firebasedynamiclinks1/Cargo.toml b/gen/firebasedynamiclinks1/Cargo.toml index 4a194b2297..1ba2bc7043 100644 --- a/gen/firebasedynamiclinks1/Cargo.toml +++ b/gen/firebasedynamiclinks1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebasedynamiclinks1" -version = "1.0.12+20190628" +version = "1.0.13+20200410" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Dynamic Links (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebasedynamiclinks1" homepage = "https://firebase.google.com/docs/dynamic-links/" -documentation = "https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628" +documentation = "https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410" license = "MIT" keywords = ["firebasedynamiclinks", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/firebasedynamiclinks1/README.md b/gen/firebasedynamiclinks1/README.md index 84a01576d7..5aeb2f8966 100644 --- a/gen/firebasedynamiclinks1/README.md +++ b/gen/firebasedynamiclinks1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-firebasedynamiclinks1` library allows access to all features of the *Google Firebase Dynamic Links* service. -This documentation was generated from *Firebase Dynamic Links* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Firebase Dynamic Links* crate version *1.0.13+20200410*, where *20200410* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Firebase Dynamic Links* *v1* API can be found at the [official documentation site](https://firebase.google.com/docs/dynamic-links/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... -* [managed short links](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.ManagedShortLink.html) - * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.ManagedShortLinkCreateCall.html) +* [managed short links](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.ManagedShortLink.html) + * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.ManagedShortLinkCreateCall.html) * short links - * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.ShortLinkCreateCall.html) + * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.ShortLinkCreateCall.html) Other activities are ... -* [get link stats](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.MethodGetLinkStatCall.html) -* [install attribution](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.MethodInstallAttributionCall.html) -* [reopen attribution](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.MethodReopenAttributionCall.html) +* [get link stats](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.MethodGetLinkStatCall.html) +* [install attribution](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.MethodInstallAttributionCall.html) +* [reopen attribution](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.MethodReopenAttributionCall.html) @@ -30,17 +30,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html)** +* **[Hub](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-firebasedynamiclinks1/1.0.12+20190628/google_firebasedynamiclinks1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firebasedynamiclinks1/1.0.13+20200410/google_firebasedynamiclinks1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/firebasedynamiclinks1/src/lib.rs b/gen/firebasedynamiclinks1/src/lib.rs index 7a364b4f15..bcbe2a1a88 100644 --- a/gen/firebasedynamiclinks1/src/lib.rs +++ b/gen/firebasedynamiclinks1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Firebase Dynamic Links* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Firebase Dynamic Links* crate version *1.0.13+20200410*, where *20200410* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Firebase Dynamic Links* *v1* API can be found at the //! [official documentation site](https://firebase.google.com/docs/dynamic-links/). @@ -336,7 +336,7 @@ impl<'a, C, A> FirebaseDynamicLinks FirebaseDynamicLinks { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), _root_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), } @@ -353,7 +353,7 @@ impl<'a, C, A> FirebaseDynamicLinks } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/firebasehosting1_beta1-cli/Cargo.toml b/gen/firebasehosting1_beta1-cli/Cargo.toml index 71ad7f71b7..5de5ceab6a 100644 --- a/gen/firebasehosting1_beta1-cli/Cargo.toml +++ b/gen/firebasehosting1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-firebasehosting1_beta1-cli" -version = "1.0.12+20190626" +version = "1.0.13+20200325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Hosting (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebasehosting1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-firebasehosting1_beta1] path = "../firebasehosting1_beta1" -version = "1.0.12+20190626" +version = "1.0.13+20200325" diff --git a/gen/firebasehosting1_beta1-cli/README.md b/gen/firebasehosting1_beta1-cli/README.md index 3172df91fa..0d07978261 100644 --- a/gen/firebasehosting1_beta1-cli/README.md +++ b/gen/firebasehosting1_beta1-cli/README.md @@ -25,11 +25,19 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firebase Hosting* API at revision *20190626*. The CLI is at version *1.0.12*. +This documentation was generated from the *Firebase Hosting* API at revision *20200325*. The CLI is at version *1.0.13*. ```bash firebasehosting1-beta1 [options] + projects + operations-get [-p ]... [-o ] + sites-channels-releases-create (-r )... [-p ]... [-o ] + sites-channels-releases-list [-p ]... [-o ] + sites-releases-create (-r )... [-p ]... [-o ] + sites-releases-list [-p ]... [-o ] sites + channels-releases-create (-r )... [-p ]... [-o ] + channels-releases-list [-p ]... [-o ] domains-create (-r )... [-p ]... [-o ] domains-delete [-p ]... [-o ] domains-get [-p ]... [-o ] @@ -39,9 +47,11 @@ firebasehosting1-beta1 [options] releases-create (-r )... [-p ]... [-o ] releases-list [-p ]... [-o ] update-config (-r )... [-p ]... [-o ] + versions-clone (-r )... [-p ]... [-o ] versions-create (-r )... [-p ]... [-o ] versions-delete [-p ]... [-o ] versions-files-list [-p ]... [-o ] + versions-list [-p ]... [-o ] versions-patch (-r )... [-p ]... [-o ] versions-populate-files (-r )... [-p ]... [-o ] firebasehosting1-beta1 --help diff --git a/gen/firebasehosting1_beta1-cli/mkdocs.yml b/gen/firebasehosting1_beta1-cli/mkdocs.yml index 134cd93c58..8f25acdb78 100644 --- a/gen/firebasehosting1_beta1-cli/mkdocs.yml +++ b/gen/firebasehosting1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Hosting v1.0.12+20190626 +site_name: Firebase Hosting v1.0.13+20200325 site_url: http://byron.github.io/google-apis-rs/google-firebasehosting1_beta1-cli site_description: A complete library to interact with Firebase Hosting (protocol v1beta1) @@ -9,6 +9,13 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['projects_operations-get.md', 'Projects', 'Operations Get'] +- ['projects_sites-channels-releases-create.md', 'Projects', 'Sites Channels Releases Create'] +- ['projects_sites-channels-releases-list.md', 'Projects', 'Sites Channels Releases List'] +- ['projects_sites-releases-create.md', 'Projects', 'Sites Releases Create'] +- ['projects_sites-releases-list.md', 'Projects', 'Sites Releases List'] +- ['sites_channels-releases-create.md', 'Sites', 'Channels Releases Create'] +- ['sites_channels-releases-list.md', 'Sites', 'Channels Releases List'] - ['sites_domains-create.md', 'Sites', 'Domains Create'] - ['sites_domains-delete.md', 'Sites', 'Domains Delete'] - ['sites_domains-get.md', 'Sites', 'Domains Get'] @@ -18,9 +25,11 @@ pages: - ['sites_releases-create.md', 'Sites', 'Releases Create'] - ['sites_releases-list.md', 'Sites', 'Releases List'] - ['sites_update-config.md', 'Sites', 'Update Config'] +- ['sites_versions-clone.md', 'Sites', 'Versions Clone'] - ['sites_versions-create.md', 'Sites', 'Versions Create'] - ['sites_versions-delete.md', 'Sites', 'Versions Delete'] - ['sites_versions-files-list.md', 'Sites', 'Versions Files List'] +- ['sites_versions-list.md', 'Sites', 'Versions List'] - ['sites_versions-patch.md', 'Sites', 'Versions Patch'] - ['sites_versions-populate-files.md', 'Sites', 'Versions Populate Files'] diff --git a/gen/firebasehosting1_beta1-cli/src/main.rs b/gen/firebasehosting1_beta1-cli/src/main.rs index 554dccc6af..aa94a42345 100644 --- a/gen/firebasehosting1_beta1-cli/src/main.rs +++ b/gen/firebasehosting1_beta1-cli/src/main.rs @@ -46,6 +46,574 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _projects_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_sites_channels_releases_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.status" => Some(("version.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-user.image-url" => Some(("version.deleteUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-user.email" => Some(("version.deleteUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.name" => Some(("version.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.version-bytes" => Some(("version.versionBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.labels" => Some(("version.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "version.finalize-user.image-url" => Some(("version.finalizeUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.finalize-user.email" => Some(("version.finalizeUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.finalize-time" => Some(("version.finalizeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-user.image-url" => Some(("version.createUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-user.email" => Some(("version.createUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.config.clean-urls" => Some(("version.config.cleanUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "version.config.trailing-slash-behavior" => Some(("version.config.trailingSlashBehavior", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.config.app-association" => Some(("version.config.appAssociation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.preview.active" => Some(("version.preview.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "version.preview.expire-time" => Some(("version.preview.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-time" => Some(("version.deleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-time" => Some(("version.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.file-count" => Some(("version.fileCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "release-user.image-url" => Some(("releaseUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "release-user.email" => Some(("releaseUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message" => Some(("message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "release-time" => Some(("releaseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["active", "app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "expire-time", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "message", "name", "preview", "release-time", "release-user", "status", "trailing-slash-behavior", "type", "version", "version-bytes"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Release = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().sites_channels_releases_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "version-name" => { + call = call.version_name(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["version-name"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_sites_channels_releases_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().sites_channels_releases_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_sites_releases_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.status" => Some(("version.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-user.image-url" => Some(("version.deleteUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-user.email" => Some(("version.deleteUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.name" => Some(("version.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.version-bytes" => Some(("version.versionBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.labels" => Some(("version.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "version.finalize-user.image-url" => Some(("version.finalizeUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.finalize-user.email" => Some(("version.finalizeUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.finalize-time" => Some(("version.finalizeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-user.image-url" => Some(("version.createUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-user.email" => Some(("version.createUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.config.clean-urls" => Some(("version.config.cleanUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "version.config.trailing-slash-behavior" => Some(("version.config.trailingSlashBehavior", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.config.app-association" => Some(("version.config.appAssociation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.preview.active" => Some(("version.preview.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "version.preview.expire-time" => Some(("version.preview.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-time" => Some(("version.deleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-time" => Some(("version.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.file-count" => Some(("version.fileCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "release-user.image-url" => Some(("releaseUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "release-user.email" => Some(("releaseUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message" => Some(("message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "release-time" => Some(("releaseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["active", "app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "expire-time", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "message", "name", "preview", "release-time", "release-user", "status", "trailing-slash-behavior", "type", "version", "version-bytes"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Release = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().sites_releases_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "version-name" => { + call = call.version_name(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["version-name"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_sites_releases_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().sites_releases_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sites_channels_releases_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.status" => Some(("version.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-user.image-url" => Some(("version.deleteUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-user.email" => Some(("version.deleteUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.name" => Some(("version.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.version-bytes" => Some(("version.versionBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.labels" => Some(("version.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "version.finalize-user.image-url" => Some(("version.finalizeUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.finalize-user.email" => Some(("version.finalizeUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.finalize-time" => Some(("version.finalizeTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-user.image-url" => Some(("version.createUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-user.email" => Some(("version.createUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.config.clean-urls" => Some(("version.config.cleanUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "version.config.trailing-slash-behavior" => Some(("version.config.trailingSlashBehavior", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.config.app-association" => Some(("version.config.appAssociation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.preview.active" => Some(("version.preview.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "version.preview.expire-time" => Some(("version.preview.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.delete-time" => Some(("version.deleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.create-time" => Some(("version.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.file-count" => Some(("version.fileCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "release-user.image-url" => Some(("releaseUser.imageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "release-user.email" => Some(("releaseUser.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message" => Some(("message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "release-time" => Some(("releaseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["active", "app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "expire-time", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "message", "name", "preview", "release-time", "release-user", "status", "trailing-slash-behavior", "type", "version", "version-bytes"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Release = json::value::from_value(object).unwrap(); + let mut call = self.hub.sites().channels_releases_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "version-name" => { + call = call.version_name(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["version-name"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _sites_channels_releases_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sites().channels_releases_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _sites_domains_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -499,6 +1067,8 @@ impl<'n> Engine<'n> { "version.config.clean-urls" => Some(("version.config.cleanUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "version.config.trailing-slash-behavior" => Some(("version.config.trailingSlashBehavior", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version.config.app-association" => Some(("version.config.appAssociation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version.preview.active" => Some(("version.preview.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "version.preview.expire-time" => Some(("version.preview.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version.delete-time" => Some(("version.deleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version.create-time" => Some(("version.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version.file-count" => Some(("version.fileCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -508,7 +1078,7 @@ impl<'n> Engine<'n> { "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "release-time" => Some(("releaseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "message", "name", "release-time", "release-user", "status", "trailing-slash-behavior", "type", "version", "version-bytes"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["active", "app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "expire-time", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "message", "name", "preview", "release-time", "release-user", "status", "trailing-slash-behavior", "type", "version", "version-bytes"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -720,6 +1290,91 @@ impl<'n> Engine<'n> { } } + fn _sites_versions_clone(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "source-version" => Some(("sourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "exclude.regexes" => Some(("exclude.regexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "include.regexes" => Some(("include.regexes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "finalize" => Some(("finalize", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["exclude", "finalize", "include", "regexes", "source-version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CloneVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.sites().versions_clone(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _sites_versions_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -757,11 +1412,13 @@ impl<'n> Engine<'n> { "config.clean-urls" => Some(("config.cleanUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.trailing-slash-behavior" => Some(("config.trailingSlashBehavior", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.app-association" => Some(("config.appAssociation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "preview.active" => Some(("preview.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "preview.expire-time" => Some(("preview.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "delete-time" => Some(("deleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-count" => Some(("fileCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "name", "status", "trailing-slash-behavior", "version-bytes"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["active", "app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "expire-time", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "name", "preview", "status", "trailing-slash-behavior", "version-bytes"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -942,6 +1599,65 @@ impl<'n> Engine<'n> { } } + fn _sites_versions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.sites().versions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _sites_versions_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -979,11 +1695,13 @@ impl<'n> Engine<'n> { "config.clean-urls" => Some(("config.cleanUrls", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.trailing-slash-behavior" => Some(("config.trailingSlashBehavior", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.app-association" => Some(("config.appAssociation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "preview.active" => Some(("preview.active", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "preview.expire-time" => Some(("preview.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "delete-time" => Some(("deleteTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-count" => Some(("fileCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "name", "status", "trailing-slash-behavior", "version-bytes"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["active", "app-association", "clean-urls", "config", "create-time", "create-user", "delete-time", "delete-user", "email", "expire-time", "file-count", "finalize-time", "finalize-user", "image-url", "labels", "name", "preview", "status", "trailing-slash-behavior", "version-bytes"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1137,8 +1855,37 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("projects", Some(opt)) => { + match opt.subcommand() { + ("operations-get", Some(opt)) => { + call_result = self._projects_operations_get(opt, dry_run, &mut err); + }, + ("sites-channels-releases-create", Some(opt)) => { + call_result = self._projects_sites_channels_releases_create(opt, dry_run, &mut err); + }, + ("sites-channels-releases-list", Some(opt)) => { + call_result = self._projects_sites_channels_releases_list(opt, dry_run, &mut err); + }, + ("sites-releases-create", Some(opt)) => { + call_result = self._projects_sites_releases_create(opt, dry_run, &mut err); + }, + ("sites-releases-list", Some(opt)) => { + call_result = self._projects_sites_releases_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("sites", Some(opt)) => { match opt.subcommand() { + ("channels-releases-create", Some(opt)) => { + call_result = self._sites_channels_releases_create(opt, dry_run, &mut err); + }, + ("channels-releases-list", Some(opt)) => { + call_result = self._sites_channels_releases_list(opt, dry_run, &mut err); + }, ("domains-create", Some(opt)) => { call_result = self._sites_domains_create(opt, dry_run, &mut err); }, @@ -1166,6 +1913,9 @@ impl<'n> Engine<'n> { ("update-config", Some(opt)) => { call_result = self._sites_update_config(opt, dry_run, &mut err); }, + ("versions-clone", Some(opt)) => { + call_result = self._sites_versions_clone(opt, dry_run, &mut err); + }, ("versions-create", Some(opt)) => { call_result = self._sites_versions_create(opt, dry_run, &mut err); }, @@ -1175,6 +1925,9 @@ impl<'n> Engine<'n> { ("versions-files-list", Some(opt)) => { call_result = self._sites_versions_files_list(opt, dry_run, &mut err); }, + ("versions-list", Some(opt)) => { + call_result = self._sites_versions_list(opt, dry_run, &mut err); + }, ("versions-patch", Some(opt)) => { call_result = self._sites_versions_patch(opt, dry_run, &mut err); }, @@ -1272,7 +2025,193 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("sites", "methods: 'domains-create', 'domains-delete', 'domains-get', 'domains-list', 'domains-update', 'get-config', 'releases-create', 'releases-list', 'update-config', 'versions-create', 'versions-delete', 'versions-files-list', 'versions-patch' and 'versions-populate-files'", vec![ + ("projects", "methods: 'operations-get', 'sites-channels-releases-create', 'sites-channels-releases-list', 'sites-releases-create' and 'sites-releases-list'", vec![ + ("operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/projects_operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("sites-channels-releases-create", + Some(r##"Creates a new release which makes the content of the specified version + actively display on the appropriate URL(s)."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/projects_sites-channels-releases-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The site that the release belongs to, in the format: + sites/site-name"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("sites-channels-releases-list", + Some(r##"Lists the releases that have been created on the specified site."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/projects_sites-channels-releases-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent for which to list files, in the format: + sites/site-name"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("sites-releases-create", + Some(r##"Creates a new release which makes the content of the specified version + actively display on the appropriate URL(s)."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/projects_sites-releases-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The site that the release belongs to, in the format: + sites/site-name"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("sites-releases-list", + Some(r##"Lists the releases that have been created on the specified site."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/projects_sites-releases-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent for which to list files, in the format: + sites/site-name"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("sites", "methods: 'channels-releases-create', 'channels-releases-list', 'domains-create', 'domains-delete', 'domains-get', 'domains-list', 'domains-update', 'get-config', 'releases-create', 'releases-list', 'update-config', 'versions-clone', 'versions-create', 'versions-delete', 'versions-files-list', 'versions-list', 'versions-patch' and 'versions-populate-files'", vec![ + ("channels-releases-create", + Some(r##"Creates a new release which makes the content of the specified version + actively display on the appropriate URL(s)."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/sites_channels-releases-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The site that the release belongs to, in the format: + sites/site-name"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("channels-releases-list", + Some(r##"Lists the releases that have been created on the specified site."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/sites_channels-releases-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent for which to list files, in the format: + sites/site-name"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("domains-create", Some(r##"Creates a domain mapping on the specified site."##), "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/sites_domains-create", @@ -1424,7 +2363,7 @@ fn main() { ]), ("releases-create", Some(r##"Creates a new release which makes the content of the specified version - actively display on the site."##), + actively display on the appropriate URL(s)."##), "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/sites_releases-create", vec![ (Some(r##"parent"##), @@ -1498,6 +2437,36 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("versions-clone", + Some(r##"Creates a new version on the target site using the content + of the specified version."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/sites_versions-clone", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The target site where the cloned version will reside, + in the format: `sites/{site}`"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1573,6 +2542,30 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("versions-list", + Some(r##"Lists the versions that have been created on the specified site. + Will include filtering in the future."##), + "Details at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli/sites_versions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent for which to list files, in the format: + sites/site-name"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1650,7 +2643,7 @@ fn main() { let mut app = App::new("firebasehosting1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190626") + .version("1.0.13+20200325") .about("The Firebase Hosting REST API enables programmatic and customizable deployments to your Firebase-hosted sites. Use this REST API to deploy new or updated hosting configurations and content files.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firebasehosting1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/firebasehosting1_beta1/Cargo.toml b/gen/firebasehosting1_beta1/Cargo.toml index 956cc3ea03..a83537bc59 100644 --- a/gen/firebasehosting1_beta1/Cargo.toml +++ b/gen/firebasehosting1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebasehosting1_beta1" -version = "1.0.12+20190626" +version = "1.0.13+20200325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Hosting (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebasehosting1_beta1" homepage = "https://firebase.google.com/docs/hosting/" -documentation = "https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626" +documentation = "https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325" license = "MIT" keywords = ["firebasehosting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/firebasehosting1_beta1/README.md b/gen/firebasehosting1_beta1/README.md index a16010f645..96adb4f5b5 100644 --- a/gen/firebasehosting1_beta1/README.md +++ b/gen/firebasehosting1_beta1/README.md @@ -5,16 +5,18 @@ DO NOT EDIT ! --> The `google-firebasehosting1_beta1` library allows access to all features of the *Google Firebase Hosting* service. -This documentation was generated from *Firebase Hosting* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *firebasehosting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Firebase Hosting* crate version *1.0.13+20200325*, where *20200325* is the exact revision of the *firebasehosting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Firebase Hosting* *v1_beta1* API can be found at the [official documentation site](https://firebase.google.com/docs/hosting/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.FirebaseHosting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.FirebaseHosting.html) ... +* projects + * [*operations get*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.ProjectOperationGetCall.html), [*sites channels releases create*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.ProjectSiteChannelReleaseCreateCall.html), [*sites channels releases list*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.ProjectSiteChannelReleaseListCall.html), [*sites releases create*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.ProjectSiteReleaseCreateCall.html) and [*sites releases list*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.ProjectSiteReleaseListCall.html) * sites - * [*domains create*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteDomainCreateCall.html), [*domains delete*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteDomainDeleteCall.html), [*domains get*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteDomainGetCall.html), [*domains list*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteDomainListCall.html), [*domains update*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteDomainUpdateCall.html), [*get config*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteGetConfigCall.html), [*releases create*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteReleaseCreateCall.html), [*releases list*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteReleaseListCall.html), [*update config*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteUpdateConfigCall.html), [*versions create*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteVersionCreateCall.html), [*versions delete*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteVersionDeleteCall.html), [*versions files list*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteVersionFileListCall.html), [*versions patch*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteVersionPatchCall.html) and [*versions populate files*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.SiteVersionPopulateFileCall.html) + * [*channels releases create*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteChannelReleaseCreateCall.html), [*channels releases list*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteChannelReleaseListCall.html), [*domains create*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteDomainCreateCall.html), [*domains delete*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteDomainDeleteCall.html), [*domains get*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteDomainGetCall.html), [*domains list*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteDomainListCall.html), [*domains update*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteDomainUpdateCall.html), [*get config*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteGetConfigCall.html), [*releases create*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteReleaseCreateCall.html), [*releases list*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteReleaseListCall.html), [*update config*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteUpdateConfigCall.html), [*versions clone*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteVersionCloneCall.html), [*versions create*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteVersionCreateCall.html), [*versions delete*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteVersionDeleteCall.html), [*versions files list*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteVersionFileListCall.html), [*versions list*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteVersionListCall.html), [*versions patch*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteVersionPatchCall.html) and [*versions populate files*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.SiteVersionPopulateFileCall.html) @@ -23,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/struct.FirebaseHosting.html)** +* **[Hub](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/struct.FirebaseHosting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,9 +49,10 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.sites().domains_get(...).doit() -let r = hub.sites().domains_update(...).doit() -let r = hub.sites().domains_create(...).doit() +let r = hub.sites().channels_releases_create(...).doit() +let r = hub.projects().sites_releases_create(...).doit() +let r = hub.projects().sites_channels_releases_create(...).doit() +let r = hub.sites().releases_create(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -83,7 +86,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -use firebasehosting1_beta1::Domain; +use firebasehosting1_beta1::Release; use firebasehosting1_beta1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -104,12 +107,13 @@ let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::Htt // 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 = Domain::default(); +let mut req = Release::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.sites().domains_update(req, "name") +let result = hub.sites().channels_releases_create(req, "parent") + .version_name("sit") .doit(); match result { @@ -132,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-firebasehosting1_beta1/1.0.12+20190626/google_firebasehosting1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firebasehosting1_beta1/1.0.13+20200325/google_firebasehosting1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/firebasehosting1_beta1/src/lib.rs b/gen/firebasehosting1_beta1/src/lib.rs index 77a97f00c1..91f6f519ba 100644 --- a/gen/firebasehosting1_beta1/src/lib.rs +++ b/gen/firebasehosting1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Firebase Hosting* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *firebasehosting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Firebase Hosting* crate version *1.0.13+20200325*, where *20200325* is the exact revision of the *firebasehosting:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Firebase Hosting* *v1_beta1* API can be found at the //! [official documentation site](https://firebase.google.com/docs/hosting/). @@ -11,8 +11,10 @@ //! //! Handle the following *Resources* with ease from the central [hub](struct.FirebaseHosting.html) ... //! +//! * projects +//! * [*operations get*](struct.ProjectOperationGetCall.html), [*sites channels releases create*](struct.ProjectSiteChannelReleaseCreateCall.html), [*sites channels releases list*](struct.ProjectSiteChannelReleaseListCall.html), [*sites releases create*](struct.ProjectSiteReleaseCreateCall.html) and [*sites releases list*](struct.ProjectSiteReleaseListCall.html) //! * sites -//! * [*domains create*](struct.SiteDomainCreateCall.html), [*domains delete*](struct.SiteDomainDeleteCall.html), [*domains get*](struct.SiteDomainGetCall.html), [*domains list*](struct.SiteDomainListCall.html), [*domains update*](struct.SiteDomainUpdateCall.html), [*get config*](struct.SiteGetConfigCall.html), [*releases create*](struct.SiteReleaseCreateCall.html), [*releases list*](struct.SiteReleaseListCall.html), [*update config*](struct.SiteUpdateConfigCall.html), [*versions create*](struct.SiteVersionCreateCall.html), [*versions delete*](struct.SiteVersionDeleteCall.html), [*versions files list*](struct.SiteVersionFileListCall.html), [*versions patch*](struct.SiteVersionPatchCall.html) and [*versions populate files*](struct.SiteVersionPopulateFileCall.html) +//! * [*channels releases create*](struct.SiteChannelReleaseCreateCall.html), [*channels releases list*](struct.SiteChannelReleaseListCall.html), [*domains create*](struct.SiteDomainCreateCall.html), [*domains delete*](struct.SiteDomainDeleteCall.html), [*domains get*](struct.SiteDomainGetCall.html), [*domains list*](struct.SiteDomainListCall.html), [*domains update*](struct.SiteDomainUpdateCall.html), [*get config*](struct.SiteGetConfigCall.html), [*releases create*](struct.SiteReleaseCreateCall.html), [*releases list*](struct.SiteReleaseListCall.html), [*update config*](struct.SiteUpdateConfigCall.html), [*versions clone*](struct.SiteVersionCloneCall.html), [*versions create*](struct.SiteVersionCreateCall.html), [*versions delete*](struct.SiteVersionDeleteCall.html), [*versions files list*](struct.SiteVersionFileListCall.html), [*versions list*](struct.SiteVersionListCall.html), [*versions patch*](struct.SiteVersionPatchCall.html) and [*versions populate files*](struct.SiteVersionPopulateFileCall.html) //! //! //! @@ -47,9 +49,10 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.sites().domains_get(...).doit() -//! let r = hub.sites().domains_update(...).doit() -//! let r = hub.sites().domains_create(...).doit() +//! let r = hub.sites().channels_releases_create(...).doit() +//! let r = hub.projects().sites_releases_create(...).doit() +//! let r = hub.projects().sites_channels_releases_create(...).doit() +//! let r = hub.sites().releases_create(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -83,7 +86,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -//! use firebasehosting1_beta1::Domain; +//! use firebasehosting1_beta1::Release; //! use firebasehosting1_beta1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -105,12 +108,13 @@ //! // 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 = Domain::default(); +//! let mut req = Release::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.sites().domains_update(req, "name") +//! let result = hub.sites().channels_releases_create(req, "parent") +//! .version_name("sed") //! .doit(); //! //! match result { @@ -278,7 +282,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// use firebasehosting1_beta1::Domain; +/// use firebasehosting1_beta1::Release; /// use firebasehosting1_beta1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -300,12 +304,13 @@ impl Default for Scope { /// // 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 = Domain::default(); +/// let mut req = Release::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.sites().domains_update(req, "name") +/// let result = hub.sites().channels_releases_create(req, "parent") +/// .version_name("dolores") /// .doit(); /// /// match result { @@ -343,18 +348,21 @@ impl<'a, C, A> FirebaseHosting FirebaseHosting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://firebasehosting.googleapis.com/".to_string(), _root_url: "https://firebasehosting.googleapis.com/".to_string(), } } + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { hub: &self } + } pub fn sites(&'a self) -> SiteMethods<'a, C, A> { SiteMethods { hub: &self } } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -390,8 +398,11 @@ impl<'a, C, A> FirebaseHosting /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Redirect { - /// Required. The user-supplied - /// [glob pattern](/docs/hosting/full-config#glob_pattern_matching) to match + /// The user-supplied RE2 regular expression to match against the request + /// URL path. + pub regex: Option, + /// The user-supplied [glob + /// pattern](/docs/hosting/full-config#glob_pattern_matching) to match /// against the request URL path. pub glob: Option, /// Required. The value to put in the HTTP location header of the response. @@ -469,41 +480,6 @@ pub struct CertDnsChallenge { impl Part for CertDnsChallenge {} -/// The intended behavior and status information of a domain. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [domains get sites](struct.SiteDomainGetCall.html) (response) -/// * [domains update sites](struct.SiteDomainUpdateCall.html) (request|response) -/// * [domains create sites](struct.SiteDomainCreateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Domain { - /// Output only. Additional status of the domain association. - pub status: Option, - /// If set, the domain should redirect with the provided parameters. - #[serde(rename="domainRedirect")] - pub domain_redirect: Option, - /// Required. The domain name of the association. - #[serde(rename="domainName")] - pub domain_name: Option, - /// Required. The site name of the association. - pub site: Option, - /// Output only. The time at which the domain was last updated. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Output only. Information about the provisioning of certificates and the - /// health of the DNS resolution for the domain. - pub provisioning: Option, -} - -impl RequestValue for Domain {} -impl ResponseResult for Domain {} - - /// A configured rewrite that directs requests to a Cloud Run service. If the /// Cloud Run service does not exist when setting or updating your Firebase /// Hosting configuration, then the request fails. Any errors from the Cloud Run @@ -525,53 +501,118 @@ pub struct CloudRunRewrite { impl Part for CloudRunRewrite {} -/// Represents an HTTP certificate challenge. +/// Contains metadata about the user who performed an action, such as creating +/// a release or finalizing a version. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CertHttpChallenge { - /// The URL path on which to serve the specified token to satisfy the - /// certificate challenge. - pub path: Option, - /// The token to serve at the specified URL path to satisfy the certificate - /// challenge. - pub token: Option, +pub struct ActingUser { + /// A profile image URL for the user. May not be present if the user has + /// changed their email address or deleted their account. + #[serde(rename="imageUrl")] + pub image_url: Option, + /// The email address of the user when the user performed the action. + pub email: Option, } -impl Part for CertHttpChallenge {} +impl Part for ActingUser {} -/// The configuration for how incoming requests to a site should be routed and -/// processed before serving content. The patterns are matched and applied -/// according to a specific -/// [priority order](/docs/hosting/full-config#hosting_priority_order). +/// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [versions files list sites](struct.SiteVersionFileListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ServingConfig { - /// Defines whether to drop the file extension from uploaded files. - #[serde(rename="cleanUrls")] - pub clean_urls: Option, - /// A list of custom response headers that are added to the content if the - /// request URL path matches the glob. - pub headers: Option>, - /// A list of globs that will cause the response to redirect to another - /// location. - pub redirects: Option>, - /// How to handle well known App Association files. - #[serde(rename="appAssociation")] - pub app_association: Option, - /// Defines how to handle a trailing slash in the URL path. - #[serde(rename="trailingSlashBehavior")] - pub trailing_slash_behavior: Option, - /// A list of rewrites that will act as if the service were given the - /// destination URL. - pub rewrites: Option>, +pub struct ListVersionFilesResponse { + /// The list path/hashes in the specified version. + pub files: Option>, + /// The pagination token, if more results exist. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, } -impl Part for ServingConfig {} +impl ResponseResult for ListVersionFilesResponse {} + + +/// A `Version` is the collection of configuration and +/// [static files](sites.versions.files) that determine how a site is displayed. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [versions create sites](struct.SiteVersionCreateCall.html) (request|response) +/// * [versions patch sites](struct.SiteVersionPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Version { + /// The deploy status of a version. + ///
          + ///
          For a successful deploy, call the + /// [`CreateVersion`](sites.versions/create) endpoint to make a new version + /// (`CREATED` status), + /// [upload all desired files](sites.versions/populateFiles) to the version, + /// then [update](sites.versions/patch) the version to the `FINALIZED` status. + ///
          + ///
          Note that if you leave the version in the `CREATED` state for more + /// than 12 hours, the system will automatically mark the version as + /// `ABANDONED`. + ///
          + ///
          You can also change the status of a version to `DELETED` by calling the + /// [`DeleteVersion`](sites.versions/delete) endpoint. + pub status: Option, + /// Output only. Identifies the user who `DELETED` the version. + #[serde(rename="deleteUser")] + pub delete_user: Option, + /// The unique identifier for a version, in the format: + /// sites/site-name/versions/versionID + /// This name is provided in the response body when you call the + /// [`CreateVersion`](../sites.versions/create) endpoint. + pub name: Option, + /// Output only. The total stored bytesize of the version. + ///
          This value is calculated after a version is `FINALIZED`. + #[serde(rename="versionBytes")] + pub version_bytes: Option, + /// The labels used for extra metadata and/or filtering. + pub labels: Option>, + /// Output only. Identifies the user who `FINALIZED` the version. + #[serde(rename="finalizeUser")] + pub finalize_user: Option, + /// Output only. The time at which the version was `FINALIZED`. + #[serde(rename="finalizeTime")] + pub finalize_time: Option, + /// Output only. The time at which the version was `DELETED`. + #[serde(rename="deleteTime")] + pub delete_time: Option, + /// Output only. Identifies the user who created the version. + #[serde(rename="createUser")] + pub create_user: Option, + /// Version preview configuration for the site version. This configuration + /// specfies whether previewing is enabled for this site version. Version + /// previews allow you to preview your site at a custom URL before + /// releasing it as the live version. + pub preview: Option, + /// The configuration for the behavior of the site. This configuration exists + /// in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file. + pub config: Option, + /// Output only. The time at which the version was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The total number of files associated with the version. + ///
          This value is calculated after a version is `FINALIZED`. + #[serde(rename="fileCount")] + pub file_count: Option, +} + +impl RequestValue for Version {} +impl ResponseResult for Version {} /// A `Release` is a particular @@ -583,11 +624,14 @@ impl Part for ServingConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [channels releases create sites](struct.SiteChannelReleaseCreateCall.html) (request|response) +/// * [sites releases create projects](struct.ProjectSiteReleaseCreateCall.html) (request|response) +/// * [sites channels releases create projects](struct.ProjectSiteChannelReleaseCreateCall.html) (request|response) /// * [releases create sites](struct.SiteReleaseCreateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Release { - /// Output only. The configuration and content that was released. + /// Output only. The configuration and content that was released. pub version: Option, /// Output only. The unique identifier for the release, in the format: /// sites/site-name/releases/releaseID @@ -635,24 +679,6 @@ pub struct ListDomainsResponse { impl ResponseResult for ListDomainsResponse {} -/// Contains metadata about the user who performed an action, such as creating -/// a release or finalizing a version. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ActingUser { - /// A profile image URL for the user. May not be present if the user has - /// changed their email address or deleted their account. - #[serde(rename="imageUrl")] - pub image_url: Option, - /// The email address of the user when the user performed the action. - pub email: Option, -} - -impl Part for ActingUser {} - - /// A generic empty message that you can re-use to avoid defining duplicated /// empty messages in your APIs. A typical example is to use it as the request /// or the response type of an API method. For instance: @@ -678,6 +704,72 @@ pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [sites channels releases list projects](struct.ProjectSiteChannelReleaseListCall.html) (response) +/// * [sites releases list projects](struct.ProjectSiteReleaseListCall.html) (response) +/// * [releases list sites](struct.SiteReleaseListCall.html) (response) +/// * [channels releases list sites](struct.SiteChannelReleaseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListReleasesResponse { + /// If there are additional releases remaining beyond the ones in this + /// response, then supply this token in the next + /// [`list`](../sites.versions.files/list) call to continue with the next set + /// of releases. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of hashes of files that still need to be uploaded, if any exist. + pub releases: Option>, +} + +impl ResponseResult for ListReleasesResponse {} + + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. It is +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. +/// +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// A representation of filter path. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PathFilter { + /// An array of regexes to filter by. + pub regexes: Option>, +} + +impl Part for PathFilter {} + + /// Defines the behavior of a domain-level redirect. Domain redirects preserve /// the path of the redirect but replace the requested domain with the one /// specified in the redirect configuration. @@ -697,28 +789,32 @@ pub struct DomainRedirect { impl Part for DomainRedirect {} -/// There is no detailed description. +/// The request sent to CloneVersion. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [releases list sites](struct.SiteReleaseListCall.html) (response) +/// * [versions clone sites](struct.SiteVersionCloneCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListReleasesResponse { - /// If there are additional releases remaining beyond the ones in this - /// response, then supply this token in the next - /// [`list`](../sites.versions.files/list) call to continue with the next set - /// of releases. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of hashes of files that still need to be uploaded, if any exist. - pub releases: Option>, +pub struct CloneVersionRequest { + /// Required. The name of the version to be cloned, in the format: + /// `sites/{site}/versions/{version}` + #[serde(rename="sourceVersion")] + pub source_version: Option, + /// If provided, only paths that do not match any of the regexes in this + /// list will be included in the new version. + pub exclude: Option, + /// If provided, only paths that match one or more regexes in this list + /// will be included in the new version. + pub include: Option, + /// If true, immediately finalize the version after cloning is complete. + pub finalize: Option, } -impl ResponseResult for ListReleasesResponse {} +impl RequestValue for CloneVersionRequest {} /// The current certificate provisioning status information for a domain. @@ -770,15 +866,18 @@ pub struct Rewrite { /// The function to proxy requests to. Must match the exported function /// name exactly. pub function: Option, + /// The user-supplied RE2 regular expression to match against the request + /// URL path. + pub regex: Option, + /// The request will be forwarded to Cloud Run. + pub run: Option, /// The URL path to rewrite the request to. pub path: Option, /// The request will be forwarded to Firebase Dynamic Links. #[serde(rename="dynamicLinks")] pub dynamic_links: Option, - /// The request will be forwarded to Cloud Run. - pub run: Option, - /// Required. The user-supplied - /// [glob pattern](/docs/hosting/full-config#glob_pattern_matching) to match + /// The user-supplied [glob + /// pattern](/docs/hosting/full-config#glob_pattern_matching) to match /// against the request URL path. pub glob: Option, } @@ -838,92 +937,23 @@ pub struct PopulateVersionFilesResponse { impl ResponseResult for PopulateVersionFilesResponse {} -/// A [`header`](/docs/hosting/full-config#headers) defines custom headers to -/// add to a response should the request URL path match the pattern. +/// Version preview configuration. If active and unexpired, +/// this version will be accessible via a custom URL even +/// if it is not the currently released version. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Header { - /// Required. The additional headers to add to the response. - pub headers: Option>, - /// Required. The user-supplied - /// [glob pattern](/docs/hosting/full-config#glob_pattern_matching) to match - /// against the request URL path. - pub glob: Option, +pub struct PreviewConfig { + /// If true, preview URLs are enabled for this version. + pub active: Option, + /// Indicates the expiration time for previewing this + /// version; preview URL requests received after this time will 404. + #[serde(rename="expireTime")] + pub expire_time: Option, } -impl Part for Header {} - - -/// A `Version` is the collection of configuration and -/// [static files](sites.versions.files) that determine how a site is displayed. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [versions create sites](struct.SiteVersionCreateCall.html) (request|response) -/// * [versions patch sites](struct.SiteVersionPatchCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Version { - /// The deploy status of a version. - ///
          - ///
          For a successful deploy, call the - /// [`CreateVersion`](sites.versions/create) endpoint to make a new version - /// (`CREATED` status), - /// [upload all desired files](sites.versions/populateFiles) to the version, - /// then [update](sites.versions/patch) the version to the `FINALIZED` status. - ///
          - ///
          Note that if you leave the version in the `CREATED` state for more - /// than 12 hours, the system will automatically mark the version as - /// `ABANDONED`. - ///
          - ///
          You can also change the status of a version to `DELETED` by calling the - /// [`DeleteVersion`](sites.versions/delete) endpoint. - pub status: Option, - /// Output only. Identifies the user who `DELETED` the version. - #[serde(rename="deleteUser")] - pub delete_user: Option, - /// The unique identifier for a version, in the format: - /// sites/site-name/versions/versionID - /// This name is provided in the response body when you call the - /// [`CreateVersion`](../sites.versions/create) endpoint. - pub name: Option, - /// Output only. The total stored bytesize of the version. - ///
          This value is calculated after a version is `FINALIZED`. - #[serde(rename="versionBytes")] - pub version_bytes: Option, - /// The labels used for extra metadata and/or filtering. - pub labels: Option>, - /// Output only. Identifies the user who `FINALIZED` the version. - #[serde(rename="finalizeUser")] - pub finalize_user: Option, - /// Output only. The time at which the version was `FINALIZED`. - #[serde(rename="finalizeTime")] - pub finalize_time: Option, - /// Output only. The time at which the version was `DELETED`. - #[serde(rename="deleteTime")] - pub delete_time: Option, - /// Output only. Identifies the user who created the version. - #[serde(rename="createUser")] - pub create_user: Option, - /// The configuration for the behavior of the site. This configuration exists - /// in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file. - pub config: Option, - /// Output only. The time at which the version was created. - #[serde(rename="createTime")] - pub create_time: Option, - /// Output only. The total number of files associated with the version. - ///
          This value is calculated after a version is `FINALIZED`. - #[serde(rename="fileCount")] - pub file_count: Option, -} - -impl RequestValue for Version {} -impl ResponseResult for Version {} +impl Part for PreviewConfig {} /// There is no detailed description. @@ -933,18 +963,165 @@ impl ResponseResult for Version {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [versions files list sites](struct.SiteVersionFileListCall.html) (response) +/// * [versions list sites](struct.SiteVersionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListVersionFilesResponse { - /// The list path/hashes in the specified version. - pub files: Option>, - /// The pagination token, if more results exist. +pub struct ListVersionsResponse { + /// The pagination token, if more results exist #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// The list of versions, if any exist. + pub versions: Option>, } -impl ResponseResult for ListVersionFilesResponse {} +impl ResponseResult for ListVersionsResponse {} + + +/// A [`header`](/docs/hosting/full-config#headers) defines custom headers to +/// add to a response should the request URL path match the pattern. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Header { + /// The user-supplied RE2 regular expression to match against the request + /// URL path. + pub regex: Option, + /// Required. The additional headers to add to the response. + pub headers: Option>, + /// The user-supplied [glob + /// pattern](/docs/hosting/full-config#glob_pattern_matching) to match + /// against the request URL path. + pub glob: Option, +} + +impl Part for Header {} + + +/// The configuration for how incoming requests to a site should be routed and +/// processed before serving content. The patterns are matched and applied +/// according to a specific +/// [priority order](/docs/hosting/full-config#hosting_priority_order). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServingConfig { + /// Defines whether to drop the file extension from uploaded files. + #[serde(rename="cleanUrls")] + pub clean_urls: Option, + /// A list of custom response headers that are added to the content if the + /// request URL path matches the glob. + pub headers: Option>, + /// A list of globs that will cause the response to redirect to another + /// location. + pub redirects: Option>, + /// How to handle well known App Association files. + #[serde(rename="appAssociation")] + pub app_association: Option, + /// Defines how to handle a trailing slash in the URL path. + #[serde(rename="trailingSlashBehavior")] + pub trailing_slash_behavior: Option, + /// A list of rewrites that will act as if the service were given the + /// destination URL. + pub rewrites: Option>, +} + +impl Part for ServingConfig {} + + +/// Represents an HTTP certificate challenge. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CertHttpChallenge { + /// The URL path on which to serve the specified token to satisfy the + /// certificate challenge. + pub path: Option, + /// The token to serve at the specified URL path to satisfy the certificate + /// challenge. + pub token: Option, +} + +impl Part for CertHttpChallenge {} + + +/// The intended behavior and status information of a domain. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [domains get sites](struct.SiteDomainGetCall.html) (response) +/// * [domains update sites](struct.SiteDomainUpdateCall.html) (request|response) +/// * [domains create sites](struct.SiteDomainCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Domain { + /// Output only. Additional status of the domain association. + pub status: Option, + /// If set, the domain should redirect with the provided parameters. + #[serde(rename="domainRedirect")] + pub domain_redirect: Option, + /// Required. The domain name of the association. + #[serde(rename="domainName")] + pub domain_name: Option, + /// Required. The site name of the association. + pub site: Option, + /// Output only. The time at which the domain was last updated. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Output only. Information about the provisioning of certificates and the + /// health of the DNS resolution for the domain. + pub provisioning: Option, +} + +impl RequestValue for Domain {} +impl ResponseResult for Domain {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [versions clone sites](struct.SiteVersionCloneCall.html) (response) +/// * [operations get projects](struct.ProjectOperationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should be a resource name ending with `operations/{unique_id}`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for Operation {} @@ -976,7 +1153,7 @@ impl ResponseResult for ListVersionFilesResponse {} /// ::default(), None); /// let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `domains_create(...)`, `domains_delete(...)`, `domains_get(...)`, `domains_list(...)`, `domains_update(...)`, `get_config(...)`, `releases_create(...)`, `releases_list(...)`, `update_config(...)`, `versions_create(...)`, `versions_delete(...)`, `versions_files_list(...)`, `versions_patch(...)` and `versions_populate_files(...)` +/// // like `channels_releases_create(...)`, `channels_releases_list(...)`, `domains_create(...)`, `domains_delete(...)`, `domains_get(...)`, `domains_list(...)`, `domains_update(...)`, `get_config(...)`, `releases_create(...)`, `releases_list(...)`, `update_config(...)`, `versions_clone(...)`, `versions_create(...)`, `versions_delete(...)`, `versions_files_list(...)`, `versions_list(...)`, `versions_patch(...)` and `versions_populate_files(...)` /// // to build up your call. /// let rb = hub.sites(); /// # } @@ -1014,13 +1191,186 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the existing domain mapping on the specified site. + /// Creates a new release which makes the content of the specified version + /// actively display on the appropriate URL(s). /// /// # Arguments /// - /// * `name` - Required. The name of the domain association to delete. - pub fn domains_delete(&self, name: &str) -> SiteDomainDeleteCall<'a, C, A> { - SiteDomainDeleteCall { + /// * `request` - No description provided. + /// * `parent` - The site that the release belongs to, in the format: + /// sites/site-name + pub fn channels_releases_create(&self, request: Release, parent: &str) -> SiteChannelReleaseCreateCall<'a, C, A> { + SiteChannelReleaseCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _version_name: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new release which makes the content of the specified version + /// actively display on the appropriate URL(s). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The site that the release belongs to, in the format: + /// sites/site-name + pub fn releases_create(&self, request: Release, parent: &str) -> SiteReleaseCreateCall<'a, C, A> { + SiteReleaseCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _version_name: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the releases that have been created on the specified site. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent for which to list files, in the format: + /// sites/site-name + pub fn channels_releases_list(&self, parent: &str) -> SiteChannelReleaseListCall<'a, C, A> { + SiteChannelReleaseListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Adds content files to a version. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The version to add files to, in the format: + /// sites/site-name/versions/versionID + pub fn versions_populate_files(&self, request: PopulateVersionFilesRequest, parent: &str) -> SiteVersionPopulateFileCall<'a, C, A> { + SiteVersionPopulateFileCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the Hosting metadata for a specific site. + /// + /// # Arguments + /// + /// * `name` - Required. The site for which to get the SiteConfig, in the format: + /// sites/site-name/config + pub fn get_config(&self, name: &str) -> SiteGetConfigCall<'a, C, A> { + SiteGetConfigCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified domain mapping, creating the mapping as if it does + /// not exist. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the domain association to update or create, if an + /// association doesn't already exist. + pub fn domains_update(&self, request: Domain, name: &str) -> SiteDomainUpdateCall<'a, C, A> { + SiteDomainUpdateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the versions that have been created on the specified site. + /// Will include filtering in the future. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent for which to list files, in the format: + /// sites/site-name + pub fn versions_list(&self, parent: &str) -> SiteVersionListCall<'a, C, A> { + SiteVersionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified metadata for a version. Note that this method will + /// fail with `FAILED_PRECONDITION` in the event of an invalid state + /// transition. The only valid transition for a version is currently from a + /// `CREATED` status to a `FINALIZED` status. + /// Use [`DeleteVersion`](../sites.versions/delete) to set the status of a + /// version to `DELETED`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The unique identifier for a version, in the format: + /// sites/site-name/versions/versionID + /// This name is provided in the response body when you call the + /// [`CreateVersion`](../sites.versions/create) endpoint. + pub fn versions_patch(&self, request: Version, name: &str) -> SiteVersionPatchCall<'a, C, A> { + SiteVersionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified version. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the version to be deleted, in the format: + /// sites/site-name/versions/versionID + pub fn versions_delete(&self, name: &str) -> SiteVersionDeleteCall<'a, C, A> { + SiteVersionDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1051,20 +1401,35 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new release which makes the content of the specified version - /// actively display on the site. + /// Creates a new version on the target site using the content + /// of the specified version. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The site that the release belongs to, in the format: - /// sites/site-name - pub fn releases_create(&self, request: Release, parent: &str) -> SiteReleaseCreateCall<'a, C, A> { - SiteReleaseCreateCall { + /// * `parent` - Required. The target site where the cloned version will reside, + /// in the format: `sites/{site}` + pub fn versions_clone(&self, request: CloneVersionRequest, parent: &str) -> SiteVersionCloneCall<'a, C, A> { + SiteVersionCloneCall { hub: self.hub, _request: request, _parent: parent.to_string(), - _version_name: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a domain mapping on the specified site. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the domain configuration to get. + pub fn domains_get(&self, name: &str) -> SiteDomainGetCall<'a, C, A> { + SiteDomainGetCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1133,34 +1498,6 @@ impl<'a, C, A> SiteMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates the specified metadata for a version. Note that this method will - /// fail with `FAILED_PRECONDITION` in the event of an invalid state - /// transition. The only valid transition for a version is currently from a - /// `CREATED` status to a `FINALIZED` status. - /// Use [`DeleteVersion`](../sites.versions/delete) to set the status of a - /// version to `DELETED`. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The unique identifier for a version, in the format: - /// sites/site-name/versions/versionID - /// This name is provided in the response body when you call the - /// [`CreateVersion`](../sites.versions/create) endpoint. - pub fn versions_patch(&self, request: Version, name: &str) -> SiteVersionPatchCall<'a, C, A> { - SiteVersionPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Sets the Hosting metadata for a specific site. @@ -1184,18 +1521,99 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds content files to a version. + /// Deletes the existing domain mapping on the specified site. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the domain association to delete. + pub fn domains_delete(&self, name: &str) -> SiteDomainDeleteCall<'a, C, A> { + SiteDomainDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `FirebaseHosting` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use firebasehosting1_beta1::FirebaseHosting; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `operations_get(...)`, `sites_channels_releases_create(...)`, `sites_channels_releases_list(...)`, `sites_releases_create(...)` and `sites_releases_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists the releases that have been created on the specified site. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent for which to list files, in the format: + /// sites/site-name + pub fn sites_channels_releases_list(&self, parent: &str) -> ProjectSiteChannelReleaseListCall<'a, C, A> { + ProjectSiteChannelReleaseListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new release which makes the content of the specified version + /// actively display on the appropriate URL(s). /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The version to add files to, in the format: - /// sites/site-name/versions/versionID - pub fn versions_populate_files(&self, request: PopulateVersionFilesRequest, parent: &str) -> SiteVersionPopulateFileCall<'a, C, A> { - SiteVersionPopulateFileCall { + /// * `parent` - The site that the release belongs to, in the format: + /// sites/site-name + pub fn sites_releases_create(&self, request: Release, parent: &str) -> ProjectSiteReleaseCreateCall<'a, C, A> { + ProjectSiteReleaseCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), + _version_name: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1204,14 +1622,15 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the Hosting metadata for a specific site. + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. /// /// # Arguments /// - /// * `name` - Required. The site for which to get the SiteConfig, in the format: - /// sites/site-name/config - pub fn get_config(&self, name: &str) -> SiteGetConfigCall<'a, C, A> { - SiteGetConfigCall { + /// * `name` - The name of the operation resource. + pub fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, C, A> { + ProjectOperationGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1222,54 +1641,40 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a domain mapping on the specified site. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the domain configuration to get. - pub fn domains_get(&self, name: &str) -> SiteDomainGetCall<'a, C, A> { - SiteDomainGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified version. - /// - /// # Arguments - /// - /// * `name` - Required. The name of the version to be deleted, in the format: - /// sites/site-name/versions/versionID - pub fn versions_delete(&self, name: &str) -> SiteVersionDeleteCall<'a, C, A> { - SiteVersionDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the specified domain mapping, creating the mapping as if it does - /// not exist. + /// Creates a new release which makes the content of the specified version + /// actively display on the appropriate URL(s). /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. The name of the domain association to update or create, if an - /// association doesn't already exist. - pub fn domains_update(&self, request: Domain, name: &str) -> SiteDomainUpdateCall<'a, C, A> { - SiteDomainUpdateCall { + /// * `parent` - The site that the release belongs to, in the format: + /// sites/site-name + pub fn sites_channels_releases_create(&self, request: Release, parent: &str) -> ProjectSiteChannelReleaseCreateCall<'a, C, A> { + ProjectSiteChannelReleaseCreateCall { hub: self.hub, _request: request, - _name: name.to_string(), + _parent: parent.to_string(), + _version_name: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the releases that have been created on the specified site. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent for which to list files, in the format: + /// sites/site-name + pub fn sites_releases_list(&self, parent: &str) -> ProjectSiteReleaseListCall<'a, C, A> { + ProjectSiteReleaseListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1313,9 +1718,9 @@ impl<'a, C, A> SiteMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.sites().versions_files_list("parent") -/// .status("et") -/// .page_token("dolores") -/// .page_size(-63) +/// .status("accusam") +/// .page_token("takimata") +/// .page_size(-70) /// .doit(); /// # } /// ``` @@ -1571,9 +1976,10 @@ impl<'a, C, A> SiteVersionFileListCall<'a, C, A> where C: BorrowMut SiteVersionFileListCall<'a, C, A> where C: BorrowMut SiteVersionFileListCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. +/// // 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 result = hub.sites().domains_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct SiteDomainDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a FirebaseHosting, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SiteDomainDeleteCall<'a, C, A> {} - -impl<'a, C, A> SiteDomainDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the domain association to delete. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> SiteDomainDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteDomainDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteDomainDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the releases that have been created on the specified site. -/// -/// A builder for the *releases.list* method supported by a *site* resource. -/// It is not used directly, but through a `SiteMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use firebasehosting1_beta1::FirebaseHosting; +/// let mut req = Release::default(); /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // 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.sites().releases_list("parent") -/// .page_token("justo") -/// .page_size(-1) +/// let result = hub.sites().channels_releases_create(req, "parent") +/// .version_name("erat") /// .doit(); /// # } /// ``` -pub struct SiteReleaseListCall<'a, C, A> +pub struct SiteChannelReleaseCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a FirebaseHosting, + _request: Release, _parent: String, - _page_token: Option, - _page_size: Option, + _version_name: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for SiteReleaseListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for SiteChannelReleaseCreateCall<'a, C, A> {} -impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> SiteChannelReleaseCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListReleasesResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Release)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -1879,17 +2042,14 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.releases.list", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "firebasehosting.sites.channels.releases.create", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); + if let Some(value) = self._version_name { + params.push(("versionName", value.to_string())); } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + for &field in ["alt", "parent", "versionName"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1903,7 +2063,7 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/releases"; if self._scopes.len() == 0 { - self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+parent}", "parent")].iter() { @@ -1933,6 +2093,17 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -1949,11 +2120,15 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -2004,29 +2179,37 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, } - /// Required. The parent for which to list files, in the format: + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Release) -> SiteChannelReleaseCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The site that the release belongs to, in the format: /// sites/site-name /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> SiteReleaseListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> SiteChannelReleaseCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// The next_page_token from a previous request, if provided. + /// The unique identifier for a version, in the format: + /// /sites/site-name/versions/versionID + /// The site-name in this version identifier must match the + /// site-name in the `parent` parameter. + ///
          + ///
          This query parameter must be empty if the `type` field in the + /// request body is `SITE_DISABLE`. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> SiteReleaseListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The page size to return. Defaults to 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> SiteReleaseListCall<'a, C, A> { - self._page_size = Some(new_value); + /// Sets the *version name* query property to the given value. + pub fn version_name(mut self, new_value: &str) -> SiteChannelReleaseCreateCall<'a, C, A> { + self._version_name = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -2035,7 +2218,7 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteReleaseListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteChannelReleaseCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2060,7 +2243,7 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteReleaseListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> SiteChannelReleaseCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2069,7 +2252,7 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::FirebaseReadonly`. + /// `Scope::CloudPlatform`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -2080,7 +2263,7 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteReleaseListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> SiteChannelReleaseCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -2093,7 +2276,7 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, /// Creates a new release which makes the content of the specified version -/// actively display on the site. +/// actively display on the appropriate URL(s). /// /// A builder for the *releases.create* method supported by a *site* resource. /// It is not used directly, but through a `SiteMethods` instance. @@ -2127,7 +2310,7 @@ impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.sites().releases_create(req, "parent") -/// .version_name("labore") +/// .version_name("sea") /// .doit(); /// # } /// ``` @@ -2391,289 +2574,9 @@ impl<'a, C, A> SiteReleaseCreateCall<'a, C, A> where C: BorrowMut } -/// Creates a domain mapping on the specified site. +/// Lists the releases that have been created on the specified site. /// -/// A builder for the *domains.create* method supported by a *site* resource. -/// It is not used directly, but through a `SiteMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// use firebasehosting1_beta1::Domain; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use firebasehosting1_beta1::FirebaseHosting; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Domain::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.sites().domains_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct SiteDomainCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a FirebaseHosting, - _request: Domain, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SiteDomainCreateCall<'a, C, A> {} - -impl<'a, C, A> SiteDomainCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Domain)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/domains"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Domain) -> SiteDomainCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The parent to create the domain association for, in the format: - /// sites/site-name - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> SiteDomainCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteDomainCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteDomainCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the domains for the specified site. -/// -/// A builder for the *domains.list* method supported by a *site* resource. +/// A builder for the *channels.releases.list* method supported by a *site* resource. /// It is not used directly, but through a `SiteMethods` instance. /// /// # Example @@ -2698,13 +2601,13 @@ impl<'a, C, A> SiteDomainCreateCall<'a, C, A> where C: BorrowMut, /// // 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.sites().domains_list("parent") +/// let result = hub.sites().channels_releases_list("parent") /// .page_token("dolores") /// .page_size(-61) /// .doit(); /// # } /// ``` -pub struct SiteDomainListCall<'a, C, A> +pub struct SiteChannelReleaseListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a FirebaseHosting, @@ -2716,13 +2619,13 @@ pub struct SiteDomainListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for SiteDomainListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for SiteChannelReleaseListCall<'a, C, A> {} -impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> SiteChannelReleaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListDomainsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListReleasesResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -2731,7 +2634,7 @@ impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.list", + dlg.begin(MethodInfo { id: "firebasehosting.sites.channels.releases.list", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -2753,7 +2656,7 @@ impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/domains"; + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/releases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); } @@ -2856,28 +2759,28 @@ impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A } - /// Required. The parent for which to list domains, in the format: + /// Required. The parent for which to list files, in the format: /// sites/site-name /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> SiteDomainListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> SiteChannelReleaseListCall<'a, C, A> { self._parent = new_value.to_string(); self } /// The next_page_token from a previous request, if provided. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> SiteDomainListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> SiteChannelReleaseListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The page size to return. Defaults to 50. + /// The page size to return. Defaults to 100. /// /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> SiteDomainListCall<'a, C, A> { + pub fn page_size(mut self, new_value: i32) -> SiteChannelReleaseListCall<'a, C, A> { self._page_size = Some(new_value); self } @@ -2887,7 +2790,7 @@ impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteChannelReleaseListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2912,7 +2815,7 @@ impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteDomainListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> SiteChannelReleaseListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2932,912 +2835,7 @@ impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteDomainListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new version for a site. -/// -/// A builder for the *versions.create* method supported by a *site* resource. -/// It is not used directly, but through a `SiteMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// use firebasehosting1_beta1::Version; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use firebasehosting1_beta1::FirebaseHosting; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Version::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.sites().versions_create(req, "parent") -/// .version_id("aliquyam") -/// .size_bytes("ea") -/// .doit(); -/// # } -/// ``` -pub struct SiteVersionCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a FirebaseHosting, - _request: Version, - _parent: String, - _version_id: Option, - _size_bytes: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SiteVersionCreateCall<'a, C, A> {} - -impl<'a, C, A> SiteVersionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Version)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._version_id { - params.push(("versionId", value.to_string())); - } - if let Some(value) = self._size_bytes { - params.push(("sizeBytes", value.to_string())); - } - for &field in ["alt", "parent", "versionId", "sizeBytes"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/versions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Version) -> SiteVersionCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The parent to create the version for, in the format: - /// sites/site-name - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> SiteVersionCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// A unique id for the new version. This is only specified for legacy version - /// creations. - /// - /// Sets the *version id* query property to the given value. - pub fn version_id(mut self, new_value: &str) -> SiteVersionCreateCall<'a, C, A> { - self._version_id = Some(new_value.to_string()); - self - } - /// The self-reported size of the version. This value is used for a pre-emptive - /// quota check for legacy version uploads. - /// - /// Sets the *size bytes* query property to the given value. - pub fn size_bytes(mut self, new_value: &str) -> SiteVersionCreateCall<'a, C, A> { - self._size_bytes = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteVersionCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteVersionCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates the specified metadata for a version. Note that this method will -/// fail with `FAILED_PRECONDITION` in the event of an invalid state -/// transition. The only valid transition for a version is currently from a -/// `CREATED` status to a `FINALIZED` status. -/// Use [`DeleteVersion`](../sites.versions/delete) to set the status of a -/// version to `DELETED`. -/// -/// A builder for the *versions.patch* method supported by a *site* resource. -/// It is not used directly, but through a `SiteMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// use firebasehosting1_beta1::Version; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use firebasehosting1_beta1::FirebaseHosting; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Version::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.sites().versions_patch(req, "name") -/// .update_mask("justo") -/// .doit(); -/// # } -/// ``` -pub struct SiteVersionPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a FirebaseHosting, - _request: Version, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SiteVersionPatchCall<'a, C, A> {} - -impl<'a, C, A> SiteVersionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Version)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Version) -> SiteVersionPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The unique identifier for a version, in the format: - /// sites/site-name/versions/versionID - /// This name is provided in the response body when you call the - /// [`CreateVersion`](../sites.versions/create) endpoint. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> SiteVersionPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// A set of field names from your [version](../sites.versions) that you want - /// to update. - ///
          A field will be overwritten if, and only if, it's in the mask. - ///
          If a mask is not provided then a default mask of only - /// [`status`](../sites.versions#Version.FIELDS.status) will be used. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> SiteVersionPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteVersionPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteVersionPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets the Hosting metadata for a specific site. -/// -/// A builder for the *updateConfig* method supported by a *site* resource. -/// It is not used directly, but through a `SiteMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// use firebasehosting1_beta1::SiteConfig; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use firebasehosting1_beta1::FirebaseHosting; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SiteConfig::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.sites().update_config(req, "name") -/// .update_mask("et") -/// .doit(); -/// # } -/// ``` -pub struct SiteUpdateConfigCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a FirebaseHosting, - _request: SiteConfig, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SiteUpdateConfigCall<'a, C, A> {} - -impl<'a, C, A> SiteUpdateConfigCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, SiteConfig)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.updateConfig", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: SiteConfig) -> SiteUpdateConfigCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The site for which to update the SiteConfig, in the format: - /// sites/site-name/config - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> SiteUpdateConfigCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// A set of field names from your [site configuration](../sites.SiteConfig) - /// that you want to update. - ///
          A field will be overwritten if, and only if, it's in the mask. - ///
          If a mask is not provided then a default mask of only - /// [`max_versions`](../sites.SiteConfig.max_versions) will be used. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> SiteUpdateConfigCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteUpdateConfigCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteUpdateConfigCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteUpdateConfigCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> SiteChannelReleaseListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4378,503 +3376,6 @@ impl<'a, C, A> SiteGetConfigCall<'a, C, A> where C: BorrowMut, A: } -/// Gets a domain mapping on the specified site. -/// -/// A builder for the *domains.get* method supported by a *site* resource. -/// It is not used directly, but through a `SiteMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use firebasehosting1_beta1::FirebaseHosting; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.sites().domains_get("name") -/// .doit(); -/// # } -/// ``` -pub struct SiteDomainGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a FirebaseHosting, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SiteDomainGetCall<'a, C, A> {} - -impl<'a, C, A> SiteDomainGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Domain)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the domain configuration to get. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> SiteDomainGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteDomainGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::FirebaseReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteDomainGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified version. -/// -/// A builder for the *versions.delete* method supported by a *site* resource. -/// It is not used directly, but through a `SiteMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use firebasehosting1_beta1::FirebaseHosting; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.sites().versions_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct SiteVersionDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a FirebaseHosting, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SiteVersionDeleteCall<'a, C, A> {} - -impl<'a, C, A> SiteVersionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The name of the version to be deleted, in the format: - /// sites/site-name/versions/versionID - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> SiteVersionDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SiteVersionDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SiteVersionDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates the specified domain mapping, creating the mapping as if it does /// not exist. /// @@ -5156,3 +3657,4388 @@ impl<'a, C, A> SiteDomainUpdateCall<'a, C, A> where C: BorrowMut, } +/// Lists the versions that have been created on the specified site. +/// Will include filtering in the future. +/// +/// A builder for the *versions.list* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.sites().versions_list("parent") +/// .page_token("justo") +/// .page_size(-21) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct SiteVersionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for SiteVersionListCall<'a, C, A> {} + +impl<'a, C, A> SiteVersionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListVersionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/versions"; + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent for which to list files, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> SiteVersionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token from a previous request, if provided. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SiteVersionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of versions to return. The service may return fewer than + /// this value. + /// If unspecified, at most 25 versions will be returned. + /// The maximum value is 100; values above 100 will be coerced to 100 + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> SiteVersionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The filter string used to return a subset of versions in the response. + /// Currently supported fields for filtering are: name, status, + /// and create_time. Filter processing will be implemented in accordance + /// with go/filtering. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> SiteVersionListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteVersionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Updates the specified metadata for a version. Note that this method will +/// fail with `FAILED_PRECONDITION` in the event of an invalid state +/// transition. The only valid transition for a version is currently from a +/// `CREATED` status to a `FINALIZED` status. +/// Use [`DeleteVersion`](../sites.versions/delete) to set the status of a +/// version to `DELETED`. +/// +/// A builder for the *versions.patch* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// use firebasehosting1_beta1::Version; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Version::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.sites().versions_patch(req, "name") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct SiteVersionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _request: Version, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteVersionPatchCall<'a, C, A> {} + +impl<'a, C, A> SiteVersionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Version)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Version) -> SiteVersionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The unique identifier for a version, in the format: + /// sites/site-name/versions/versionID + /// This name is provided in the response body when you call the + /// [`CreateVersion`](../sites.versions/create) endpoint. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> SiteVersionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// A set of field names from your [version](../sites.versions) that you want + /// to update. + ///
          A field will be overwritten if, and only if, it's in the mask. + ///
          If a mask is not provided then a default mask of only + /// [`status`](../sites.versions#Version.FIELDS.status) will be used. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> SiteVersionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteVersionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteVersionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified version. +/// +/// A builder for the *versions.delete* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.sites().versions_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct SiteVersionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteVersionDeleteCall<'a, C, A> {} + +impl<'a, C, A> SiteVersionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the version to be deleted, in the format: + /// sites/site-name/versions/versionID + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> SiteVersionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteVersionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteVersionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the releases that have been created on the specified site. +/// +/// A builder for the *releases.list* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.sites().releases_list("parent") +/// .page_token("et") +/// .page_size(-70) +/// .doit(); +/// # } +/// ``` +pub struct SiteReleaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteReleaseListCall<'a, C, A> {} + +impl<'a, C, A> SiteReleaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListReleasesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.releases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/releases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent for which to list files, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> SiteReleaseListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token from a previous request, if provided. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SiteReleaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The page size to return. Defaults to 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> SiteReleaseListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteReleaseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteReleaseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::FirebaseReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteReleaseListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new version on the target site using the content +/// of the specified version. +/// +/// A builder for the *versions.clone* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// use firebasehosting1_beta1::CloneVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = CloneVersionRequest::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.sites().versions_clone(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct SiteVersionCloneCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _request: CloneVersionRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for SiteVersionCloneCall<'a, C, A> {} + +impl<'a, C, A> SiteVersionCloneCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.clone", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/versions:clone"; + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CloneVersionRequest) -> SiteVersionCloneCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The target site where the cloned version will reside, + /// in the format: `sites/{site}` + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> SiteVersionCloneCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionCloneCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteVersionCloneCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Gets a domain mapping on the specified site. +/// +/// A builder for the *domains.get* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.sites().domains_get("name") +/// .doit(); +/// # } +/// ``` +pub struct SiteDomainGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteDomainGetCall<'a, C, A> {} + +impl<'a, C, A> SiteDomainGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Domain)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the domain configuration to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> SiteDomainGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteDomainGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::FirebaseReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteDomainGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a domain mapping on the specified site. +/// +/// A builder for the *domains.create* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// use firebasehosting1_beta1::Domain; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Domain::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.sites().domains_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct SiteDomainCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _request: Domain, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteDomainCreateCall<'a, C, A> {} + +impl<'a, C, A> SiteDomainCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Domain)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/domains"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Domain) -> SiteDomainCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent to create the domain association for, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> SiteDomainCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteDomainCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteDomainCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the domains for the specified site. +/// +/// A builder for the *domains.list* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.sites().domains_list("parent") +/// .page_token("erat") +/// .page_size(-95) +/// .doit(); +/// # } +/// ``` +pub struct SiteDomainListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteDomainListCall<'a, C, A> {} + +impl<'a, C, A> SiteDomainListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDomainsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/domains"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent for which to list domains, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> SiteDomainListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token from a previous request, if provided. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SiteDomainListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The page size to return. Defaults to 50. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> SiteDomainListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteDomainListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::FirebaseReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteDomainListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new version for a site. +/// +/// A builder for the *versions.create* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// use firebasehosting1_beta1::Version; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Version::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.sites().versions_create(req, "parent") +/// .version_id("eirmod") +/// .size_bytes("elitr") +/// .doit(); +/// # } +/// ``` +pub struct SiteVersionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _request: Version, + _parent: String, + _version_id: Option, + _size_bytes: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteVersionCreateCall<'a, C, A> {} + +impl<'a, C, A> SiteVersionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Version)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.versions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._version_id { + params.push(("versionId", value.to_string())); + } + if let Some(value) = self._size_bytes { + params.push(("sizeBytes", value.to_string())); + } + for &field in ["alt", "parent", "versionId", "sizeBytes"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/versions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Version) -> SiteVersionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The parent to create the version for, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> SiteVersionCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// A unique id for the new version. This is only specified for legacy version + /// creations. + /// + /// Sets the *version id* query property to the given value. + pub fn version_id(mut self, new_value: &str) -> SiteVersionCreateCall<'a, C, A> { + self._version_id = Some(new_value.to_string()); + self + } + /// The self-reported size of the version. This value is used for a pre-emptive + /// quota check for legacy version uploads. + /// + /// Sets the *size bytes* query property to the given value. + pub fn size_bytes(mut self, new_value: &str) -> SiteVersionCreateCall<'a, C, A> { + self._size_bytes = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteVersionCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteVersionCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteVersionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the Hosting metadata for a specific site. +/// +/// A builder for the *updateConfig* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// use firebasehosting1_beta1::SiteConfig; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SiteConfig::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.sites().update_config(req, "name") +/// .update_mask("no") +/// .doit(); +/// # } +/// ``` +pub struct SiteUpdateConfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _request: SiteConfig, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteUpdateConfigCall<'a, C, A> {} + +impl<'a, C, A> SiteUpdateConfigCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SiteConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.updateConfig", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SiteConfig) -> SiteUpdateConfigCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The site for which to update the SiteConfig, in the format: + /// sites/site-name/config + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> SiteUpdateConfigCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// A set of field names from your [site configuration](../sites.SiteConfig) + /// that you want to update. + ///
          A field will be overwritten if, and only if, it's in the mask. + ///
          If a mask is not provided then a default mask of only + /// [`max_versions`](../sites.SiteConfig.max_versions) will be used. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> SiteUpdateConfigCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteUpdateConfigCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteUpdateConfigCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteUpdateConfigCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the existing domain mapping on the specified site. +/// +/// A builder for the *domains.delete* method supported by a *site* resource. +/// It is not used directly, but through a `SiteMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.sites().domains_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct SiteDomainDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SiteDomainDeleteCall<'a, C, A> {} + +impl<'a, C, A> SiteDomainDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.sites.domains.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the domain association to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> SiteDomainDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SiteDomainDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SiteDomainDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SiteDomainDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the releases that have been created on the specified site. +/// +/// A builder for the *sites.channels.releases.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().sites_channels_releases_list("parent") +/// .page_token("dolore") +/// .page_size(-37) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSiteChannelReleaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSiteChannelReleaseListCall<'a, C, A> {} + +impl<'a, C, A> ProjectSiteChannelReleaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListReleasesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.projects.sites.channels.releases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/releases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent for which to list files, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectSiteChannelReleaseListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token from a previous request, if provided. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectSiteChannelReleaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The page size to return. Defaults to 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectSiteChannelReleaseListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSiteChannelReleaseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSiteChannelReleaseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::FirebaseReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSiteChannelReleaseListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new release which makes the content of the specified version +/// actively display on the appropriate URL(s). +/// +/// A builder for the *sites.releases.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// use firebasehosting1_beta1::Release; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Release::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().sites_releases_create(req, "parent") +/// .version_name("accusam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSiteReleaseCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _request: Release, + _parent: String, + _version_name: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSiteReleaseCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectSiteReleaseCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Release)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.projects.sites.releases.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._version_name { + params.push(("versionName", value.to_string())); + } + for &field in ["alt", "parent", "versionName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/releases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Release) -> ProjectSiteReleaseCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The site that the release belongs to, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectSiteReleaseCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The unique identifier for a version, in the format: + /// /sites/site-name/versions/versionID + /// The site-name in this version identifier must match the + /// site-name in the `parent` parameter. + ///
          + ///
          This query parameter must be empty if the `type` field in the + /// request body is `SITE_DISABLE`. + /// + /// Sets the *version name* query property to the given value. + pub fn version_name(mut self, new_value: &str) -> ProjectSiteReleaseCreateCall<'a, C, A> { + self._version_name = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSiteReleaseCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSiteReleaseCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSiteReleaseCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *operations.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.projects.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::FirebaseReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new release which makes the content of the specified version +/// actively display on the appropriate URL(s). +/// +/// A builder for the *sites.channels.releases.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// use firebasehosting1_beta1::Release; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Release::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().sites_channels_releases_create(req, "parent") +/// .version_name("et") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSiteChannelReleaseCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _request: Release, + _parent: String, + _version_name: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSiteChannelReleaseCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectSiteChannelReleaseCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Release)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.projects.sites.channels.releases.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._version_name { + params.push(("versionName", value.to_string())); + } + for &field in ["alt", "parent", "versionName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/releases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Release) -> ProjectSiteChannelReleaseCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The site that the release belongs to, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectSiteChannelReleaseCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The unique identifier for a version, in the format: + /// /sites/site-name/versions/versionID + /// The site-name in this version identifier must match the + /// site-name in the `parent` parameter. + ///
          + ///
          This query parameter must be empty if the `type` field in the + /// request body is `SITE_DISABLE`. + /// + /// Sets the *version name* query property to the given value. + pub fn version_name(mut self, new_value: &str) -> ProjectSiteChannelReleaseCreateCall<'a, C, A> { + self._version_name = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSiteChannelReleaseCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSiteChannelReleaseCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSiteChannelReleaseCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the releases that have been created on the specified site. +/// +/// A builder for the *sites.releases.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_firebasehosting1_beta1 as firebasehosting1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use firebasehosting1_beta1::FirebaseHosting; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = FirebaseHosting::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().sites_releases_list("parent") +/// .page_token("et") +/// .page_size(-40) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSiteReleaseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a FirebaseHosting, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSiteReleaseListCall<'a, C, A> {} + +impl<'a, C, A> ProjectSiteReleaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListReleasesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "firebasehosting.projects.sites.releases.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/releases"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::FirebaseReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent for which to list files, in the format: + /// sites/site-name + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectSiteReleaseListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token from a previous request, if provided. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectSiteReleaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The page size to return. Defaults to 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectSiteReleaseListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSiteReleaseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSiteReleaseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::FirebaseReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSiteReleaseListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/firebaseremoteconfig1-cli/Cargo.toml b/gen/firebaseremoteconfig1-cli/Cargo.toml index 29b5216c2c..4bae474c2b 100644 --- a/gen/firebaseremoteconfig1-cli/Cargo.toml +++ b/gen/firebaseremoteconfig1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-firebaseremoteconfig1-cli" -version = "1.0.12+20171129" +version = "1.0.13+20171129" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Remote Config (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebaseremoteconfig1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-firebaseremoteconfig1] path = "../firebaseremoteconfig1" -version = "1.0.12+20171129" +version = "1.0.13+20171129" diff --git a/gen/firebaseremoteconfig1-cli/README.md b/gen/firebaseremoteconfig1-cli/README.md index 92d8a53125..356340e070 100644 --- a/gen/firebaseremoteconfig1-cli/README.md +++ b/gen/firebaseremoteconfig1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firebase Remote Config* API at revision *20171129*. The CLI is at version *1.0.12*. +This documentation was generated from the *Firebase Remote Config* API at revision *20171129*. The CLI is at version *1.0.13*. ```bash firebaseremoteconfig1 [options] diff --git a/gen/firebaseremoteconfig1-cli/mkdocs.yml b/gen/firebaseremoteconfig1-cli/mkdocs.yml index 2db6e95983..1cafac64d0 100644 --- a/gen/firebaseremoteconfig1-cli/mkdocs.yml +++ b/gen/firebaseremoteconfig1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Remote Config v1.0.12+20171129 +site_name: Firebase Remote Config v1.0.13+20171129 site_url: http://byron.github.io/google-apis-rs/google-firebaseremoteconfig1-cli site_description: A complete library to interact with Firebase Remote Config (protocol v1) diff --git a/gen/firebaseremoteconfig1-cli/src/main.rs b/gen/firebaseremoteconfig1-cli/src/main.rs index 59d56d27ff..13fabee491 100644 --- a/gen/firebaseremoteconfig1-cli/src/main.rs +++ b/gen/firebaseremoteconfig1-cli/src/main.rs @@ -363,7 +363,7 @@ fn main() { let mut app = App::new("firebaseremoteconfig1") .author("Sebastian Thiel ") - .version("1.0.12+20171129") + .version("1.0.13+20171129") .about("Firebase Remote Config API allows the 3P clients to manage Remote Config conditions and parameters for Firebase applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firebaseremoteconfig1_cli") .arg(Arg::with_name("folder") diff --git a/gen/firebaseremoteconfig1/Cargo.toml b/gen/firebaseremoteconfig1/Cargo.toml index 555f342e45..808ea49a54 100644 --- a/gen/firebaseremoteconfig1/Cargo.toml +++ b/gen/firebaseremoteconfig1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebaseremoteconfig1" -version = "1.0.12+20171129" +version = "1.0.13+20171129" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firebase Remote Config (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firebaseremoteconfig1" homepage = "https://firebase.google.com/docs/remote-config/" -documentation = "https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129" +documentation = "https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129" license = "MIT" keywords = ["firebaseremoteconfig", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/firebaseremoteconfig1/README.md b/gen/firebaseremoteconfig1/README.md index 529b9f291e..2927d8ce6c 100644 --- a/gen/firebaseremoteconfig1/README.md +++ b/gen/firebaseremoteconfig1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-firebaseremoteconfig1` library allows access to all features of the *Google Firebase Remote Config* service. -This documentation was generated from *Firebase Remote Config* crate version *1.0.12+20171129*, where *20171129* is the exact revision of the *firebaseremoteconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Firebase Remote Config* crate version *1.0.13+20171129*, where *20171129* is the exact revision of the *firebaseremoteconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Firebase Remote Config* *v1* API can be found at the [official documentation site](https://firebase.google.com/docs/remote-config/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/struct.FirebaseRemoteConfig.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/struct.FirebaseRemoteConfig.html) ... * projects - * [*get remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/struct.ProjectGetRemoteConfigCall.html) and [*update remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/struct.ProjectUpdateRemoteConfigCall.html) + * [*get remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/struct.ProjectGetRemoteConfigCall.html) and [*update remote config*](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/struct.ProjectUpdateRemoteConfigCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/struct.FirebaseRemoteConfig.html)** +* **[Hub](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/struct.FirebaseRemoteConfig.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-firebaseremoteconfig1/1.0.12+20171129/google_firebaseremoteconfig1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firebaseremoteconfig1/1.0.13+20171129/google_firebaseremoteconfig1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/firebaseremoteconfig1/src/lib.rs b/gen/firebaseremoteconfig1/src/lib.rs index c77ca86a73..f3548465b8 100644 --- a/gen/firebaseremoteconfig1/src/lib.rs +++ b/gen/firebaseremoteconfig1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Firebase Remote Config* crate version *1.0.12+20171129*, where *20171129* is the exact revision of the *firebaseremoteconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Firebase Remote Config* crate version *1.0.13+20171129*, where *20171129* is the exact revision of the *firebaseremoteconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Firebase Remote Config* *v1* API can be found at the //! [official documentation site](https://firebase.google.com/docs/remote-config/). @@ -310,7 +310,7 @@ impl<'a, C, A> FirebaseRemoteConfig FirebaseRemoteConfig { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://firebaseremoteconfig.googleapis.com/".to_string(), _root_url: "https://firebaseremoteconfig.googleapis.com/".to_string(), } @@ -321,7 +321,7 @@ impl<'a, C, A> FirebaseRemoteConfig } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/firestore1-cli/Cargo.toml b/gen/firestore1-cli/Cargo.toml index 8c2a69429a..36584c5dd6 100644 --- a/gen/firestore1-cli/Cargo.toml +++ b/gen/firestore1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-firestore1-cli" -version = "1.0.12+20190419" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firestore (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-firestore1] path = "../firestore1" -version = "1.0.12+20190419" +version = "1.0.13+20200311" diff --git a/gen/firestore1-cli/README.md b/gen/firestore1-cli/README.md index 75c175ace2..47c164ea80 100644 --- a/gen/firestore1-cli/README.md +++ b/gen/firestore1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firestore* API at revision *20190419*. The CLI is at version *1.0.12*. +This documentation was generated from the *Firestore* API at revision *20200311*. The CLI is at version *1.0.13*. ```bash firestore1 [options] diff --git a/gen/firestore1-cli/mkdocs.yml b/gen/firestore1-cli/mkdocs.yml index 3724773289..5f20dd21be 100644 --- a/gen/firestore1-cli/mkdocs.yml +++ b/gen/firestore1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firestore v1.0.12+20190419 +site_name: Firestore v1.0.13+20200311 site_url: http://byron.github.io/google-apis-rs/google-firestore1-cli site_description: A complete library to interact with Firestore (protocol v1) diff --git a/gen/firestore1-cli/src/main.rs b/gen/firestore1-cli/src/main.rs index d0afbc59e9..165a0970b4 100644 --- a/gen/firestore1-cli/src/main.rs +++ b/gen/firestore1-cli/src/main.rs @@ -2356,7 +2356,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"A name of the form + Some(r##"Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`"##), Some(true), Some(false)), @@ -2384,7 +2384,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"A parent name of the form + Some(r##"Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`"##), Some(true), Some(false)), @@ -2474,7 +2474,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"A parent name of the form + Some(r##"Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`"##), Some(true), Some(false)), @@ -2503,7 +2503,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"A name of the form + Some(r##"Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`"##), Some(true), Some(false)), @@ -2526,7 +2526,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"A name of the form + Some(r##"Required. A name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`"##), Some(true), Some(false)), @@ -2549,7 +2549,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"A parent name of the form + Some(r##"Required. A parent name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`"##), Some(true), Some(false)), @@ -2575,7 +2575,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2604,7 +2604,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2633,7 +2633,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2662,7 +2662,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource. For example: + Some(r##"Required. The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`"##), Some(true), @@ -2670,7 +2670,7 @@ fn main() { (Some(r##"collection-id"##), None, - Some(r##"The collection ID, relative to `parent`, to list. For example: `chatrooms`."##), + Some(r##"Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`."##), Some(true), Some(false)), @@ -2698,7 +2698,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the Document to delete. In the format: + Some(r##"Required. The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`."##), Some(true), Some(false)), @@ -2721,7 +2721,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the Document to get. In the format: + Some(r##"Required. The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`."##), Some(true), Some(false)), @@ -2744,7 +2744,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name. In the format: + Some(r##"Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: @@ -2755,7 +2755,7 @@ fn main() { (Some(r##"collection-id"##), None, - Some(r##"The collection ID, relative to `parent`, to list. For example: `chatrooms` + Some(r##"Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`."##), Some(true), Some(false)), @@ -2778,7 +2778,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent document. In the format: + Some(r##"Required. The parent document. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`"##), @@ -2809,7 +2809,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2867,7 +2867,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2896,7 +2896,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name. In the format: + Some(r##"Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: @@ -2929,7 +2929,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message."##), Some(true), @@ -2966,7 +2966,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Database to export. Should be of the form: + Some(r##"Required. Database to export. Should be of the form: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2999,7 +2999,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Database to import into. Should be of the form: + Some(r##"Required. Database to import into. Should be of the form: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -3189,7 +3189,7 @@ fn main() { let mut app = App::new("firestore1") .author("Sebastian Thiel ") - .version("1.0.12+20190419") + .version("1.0.13+20200311") .about("Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firestore1_cli") diff --git a/gen/firestore1/Cargo.toml b/gen/firestore1/Cargo.toml index 25b3a1a187..2b92690761 100644 --- a/gen/firestore1/Cargo.toml +++ b/gen/firestore1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firestore1" -version = "1.0.12+20190419" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firestore (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1" homepage = "https://cloud.google.com/firestore" -documentation = "https://docs.rs/google-firestore1/1.0.12+20190419" +documentation = "https://docs.rs/google-firestore1/1.0.13+20200311" license = "MIT" keywords = ["firestore", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/firestore1/README.md b/gen/firestore1/README.md index 078b445e9e..77ba3ecfb2 100644 --- a/gen/firestore1/README.md +++ b/gen/firestore1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-firestore1` library allows access to all features of the *Google Firestore* service. -This documentation was generated from *Firestore* crate version *1.0.12+20190419*, where *20190419* is the exact revision of the *firestore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Firestore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *firestore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Firestore* *v1* API can be found at the [official documentation site](https://cloud.google.com/firestore). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.Firestore.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.Firestore.html) ... * projects - * [*databases collection groups fields get*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseCollectionGroupFieldGetCall.html), [*databases collection groups fields list*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseCollectionGroupFieldListCall.html), [*databases collection groups fields patch*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseCollectionGroupFieldPatchCall.html), [*databases collection groups indexes create*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeCreateCall.html), [*databases collection groups indexes delete*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeDeleteCall.html), [*databases collection groups indexes get*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeGetCall.html), [*databases collection groups indexes list*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeListCall.html), [*databases documents batch get*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentBatchGetCall.html), [*databases documents begin transaction*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentBeginTransactionCall.html), [*databases documents commit*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentCommitCall.html), [*databases documents create document*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentCreateDocumentCall.html), [*databases documents delete*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentDeleteCall.html), [*databases documents get*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentGetCall.html), [*databases documents list*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentListCall.html), [*databases documents list collection ids*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentListCollectionIdCall.html), [*databases documents listen*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentListenCall.html), [*databases documents patch*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentPatchCall.html), [*databases documents rollback*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentRollbackCall.html), [*databases documents run query*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentRunQueryCall.html), [*databases documents write*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseDocumentWriteCall.html), [*databases export documents*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseExportDocumentCall.html), [*databases import documents*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseImportDocumentCall.html), [*databases operations cancel*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseOperationCancelCall.html), [*databases operations delete*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseOperationDeleteCall.html), [*databases operations get*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseOperationGetCall.html), [*databases operations list*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectDatabaseOperationListCall.html), [*locations get*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectLocationGetCall.html) and [*locations list*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.ProjectLocationListCall.html) + * [*databases collection groups fields get*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseCollectionGroupFieldGetCall.html), [*databases collection groups fields list*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseCollectionGroupFieldListCall.html), [*databases collection groups fields patch*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseCollectionGroupFieldPatchCall.html), [*databases collection groups indexes create*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeCreateCall.html), [*databases collection groups indexes delete*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeDeleteCall.html), [*databases collection groups indexes get*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeGetCall.html), [*databases collection groups indexes list*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseCollectionGroupIndexeListCall.html), [*databases documents batch get*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentBatchGetCall.html), [*databases documents begin transaction*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentBeginTransactionCall.html), [*databases documents commit*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentCommitCall.html), [*databases documents create document*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentCreateDocumentCall.html), [*databases documents delete*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentDeleteCall.html), [*databases documents get*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentGetCall.html), [*databases documents list*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentListCall.html), [*databases documents list collection ids*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentListCollectionIdCall.html), [*databases documents listen*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentListenCall.html), [*databases documents patch*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentPatchCall.html), [*databases documents rollback*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentRollbackCall.html), [*databases documents run query*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentRunQueryCall.html), [*databases documents write*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseDocumentWriteCall.html), [*databases export documents*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseExportDocumentCall.html), [*databases import documents*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseImportDocumentCall.html), [*databases operations cancel*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseOperationCancelCall.html), [*databases operations delete*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseOperationDeleteCall.html), [*databases operations get*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseOperationGetCall.html), [*databases operations list*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectDatabaseOperationListCall.html), [*locations get*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectLocationGetCall.html) and [*locations list*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.ProjectLocationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/struct.Firestore.html)** +* **[Hub](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/struct.Firestore.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-firestore1/1.0.12+20190419/google_firestore1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firestore1/1.0.13+20200311/google_firestore1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/firestore1/src/lib.rs b/gen/firestore1/src/lib.rs index d47adab628..3dcd993b18 100644 --- a/gen/firestore1/src/lib.rs +++ b/gen/firestore1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Firestore* crate version *1.0.12+20190419*, where *20190419* is the exact revision of the *firestore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Firestore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *firestore:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Firestore* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/firestore). @@ -339,7 +339,7 @@ impl<'a, C, A> Firestore Firestore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://firestore.googleapis.com/".to_string(), _root_url: "https://firestore.googleapis.com/".to_string(), } @@ -350,7 +350,7 @@ impl<'a, C, A> Firestore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -447,14 +447,12 @@ pub struct GoogleFirestoreAdminV1Index { /// time, and that have the same collection id as this index. #[serde(rename="queryScope")] pub query_scope: Option, - /// Output only. - /// A server defined name for this index. + /// Output only. A server defined name for this index. /// The form of this name for composite indexes will be: /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` /// For single field indexes, this field will be empty. pub name: Option, - /// Output only. - /// The serving state of the index. + /// Output only. The serving state of the index. pub state: Option, } @@ -698,7 +696,8 @@ pub struct WriteResponse { /// This field is always set. #[serde(rename="streamToken")] pub stream_token: Option, - /// The time at which the commit occurred. + /// The time at which the commit occurred. Any read with an equal or greater + /// `read_time` is guaranteed to see the effects of the write. #[serde(rename="commitTime")] pub commit_time: Option, /// The ID of the stream. @@ -1087,7 +1086,7 @@ impl Part for DocumentRemove {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RollbackRequest { - /// The transaction to roll back. + /// Required. The transaction to roll back. pub transaction: Option, } @@ -1170,14 +1169,18 @@ impl ResponseResult for BeginTransactionResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Write { - /// A document name to delete. In the format: - /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - pub delete: Option, /// An optional precondition on the document. /// /// The write will fail if this is set and not met by the target document. #[serde(rename="currentDocument")] pub current_document: Option, + /// The transforms to perform after update. + /// + /// This field can be set only when the operation is `update`. If present, this + /// write is equivalent to performing `update` and `transform` to the same + /// document atomically and in order. + #[serde(rename="updateTransforms")] + pub update_transforms: Option>, /// The fields to update in this write. /// /// This field can be set only when the operation is `update`. @@ -1190,13 +1193,13 @@ pub struct Write { /// The field paths in this mask must not contain a reserved field name. #[serde(rename="updateMask")] pub update_mask: Option, - /// Applies a transformation to a document. - /// At most one `transform` per document is allowed in a given request. - /// An `update` cannot follow a `transform` on the same document in a given - /// request. - pub transform: Option, + /// A document name to delete. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub delete: Option, /// A document to write. pub update: Option, + /// Applies a transformation to a document. + pub transform: Option, } impl Part for Write {} @@ -1298,7 +1301,8 @@ pub struct CommitResponse { /// request. #[serde(rename="writeResults")] pub write_results: Option>, - /// The time at which the commit occurred. + /// The time at which the commit occurred. Any read with an equal or greater + /// `read_time` is guaranteed to see the effects of the commit. #[serde(rename="commitTime")] pub commit_time: Option, } @@ -1483,7 +1487,7 @@ pub struct BatchGetDocumentsRequest { /// given `database`. Duplicate names will be elided. pub documents: Option>, /// Reads documents as they were at the given time. - /// This may not be older than 60 seconds. + /// This may not be older than 270 seconds. #[serde(rename="readTime")] pub read_time: Option, } @@ -1493,58 +1497,14 @@ impl RequestValue for BatchGetDocumentsRequest {} /// The `Status` type defines a logical error model that is suitable for /// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](https://github.com/grpc). The error model is designed to be: +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. /// -/// * Simple to use and understand for most users -/// * Flexible enough to meet unexpected needs -/// -/// # Overview -/// -/// The `Status` message contains three pieces of data: error code, error -/// message, and error details. The error code should be an enum value of -/// google.rpc.Code, but it may accept additional error codes if needed. The -/// error message should be a developer-facing English message that helps -/// developers *understand* and *resolve* the error. If a localized user-facing -/// error message is needed, put the localized message in the error details or -/// localize it in the client. The optional error details may contain arbitrary -/// information about the error. There is a predefined set of error detail types -/// in the package `google.rpc` that can be used for common error conditions. -/// -/// # Language mapping -/// -/// The `Status` message is the logical representation of the error model, but it -/// is not necessarily the actual wire format. When the `Status` message is -/// exposed in different client libraries and different wire protocols, it can be -/// mapped differently. For example, it will likely be mapped to some exceptions -/// in Java, but more likely mapped to some error codes in C. -/// -/// # Other uses -/// -/// The error model and the `Status` message can be used in a variety of -/// environments, either with or without APIs, to provide a -/// consistent developer experience across different environments. -/// -/// Example uses of this error model include: -/// -/// * Partial errors. If a service needs to return partial errors to the client, -/// it may embed the `Status` in the normal response to indicate the partial -/// errors. -/// -/// * Workflow errors. A typical workflow has multiple steps. Each step may -/// have a `Status` message for error reporting. -/// -/// * Batch operations. If a client uses batch request and batch response, the -/// `Status` message should be used directly inside batch response, one for -/// each error sub-response. -/// -/// * Asynchronous operations. If an API call embeds asynchronous operation -/// results in its response, the status of those operations should be -/// represented directly using the `Status` message. -/// -/// * Logging. If some API errors are stored in logs, the message `Status` could -/// be used directly after any stripping needed for security/privacy reasons. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Status { /// A developer-facing error message, which should be in English. Any @@ -1578,14 +1538,8 @@ pub struct Target { /// Using a resume token with a different target is unsupported and may fail. #[serde(rename="resumeToken")] pub resume_token: Option, - /// A client provided target ID. - /// - /// If not set, the server will assign an ID for the target. - /// - /// Used for resuming a target without changing IDs. The IDs can either be - /// client-assigned or be server-assigned in a previous stream. All targets - /// with client provided IDs must be added before adding a target that needs - /// a server-assigned id. + /// The target ID that identifies the target on the stream. Must be a positive + /// number and non-zero. #[serde(rename="targetId")] pub target_id: Option, /// Start listening after a specific `read_time`. @@ -1765,7 +1719,7 @@ pub struct RunQueryRequest { #[serde(rename="structuredQuery")] pub structured_query: Option, /// Reads documents as they were at the given time. - /// This may not be older than 60 seconds. + /// This may not be older than 270 seconds. #[serde(rename="readTime")] pub read_time: Option, } @@ -1809,11 +1763,7 @@ pub struct TargetChange { /// /// If empty, the change applies to all targets. /// - /// For `target_change_type=ADD`, the order of the target IDs matches the order - /// of the requests to add the targets. This allows clients to unambiguously - /// associate server-assigned target IDs with added targets. - /// - /// For other states, the order of the target IDs is not defined. + /// The order of the target IDs is not defined. #[serde(rename="targetIds")] pub target_ids: Option>, /// The consistent `read_time` for the given `target_ids` (omitted when the @@ -1958,7 +1908,7 @@ pub struct GoogleLongrunningOperation { pub response: Option>, /// The server-assigned name, which is only unique within the same service that /// originally returns it. If you use the default HTTP mapping, the - /// `name` should have the format of `operations/some/unique/name`. + /// `name` should be a resource name ending with `operations/{unique_id}`. pub name: Option, /// Service-specific metadata associated with the operation. It typically /// contains progress information and common metadata such as create time. @@ -1995,14 +1945,12 @@ impl Part for LatLng {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleFirestoreAdminV1IndexConfig { - /// Output only. - /// When true, the `Field`'s index configuration is set from the + /// Output only. When true, the `Field`'s index configuration is set from the /// configuration specified by the `ancestor_field`. /// When false, the `Field`'s index configuration is defined explicitly. #[serde(rename="usesAncestorConfig")] pub uses_ancestor_config: Option, - /// Output only. - /// Specifies the resource name of the `Field` from which this field's + /// Output only. Specifies the resource name of the `Field` from which this field's /// index configuration is set (when `uses_ancestor_config` is true), /// or from which it *would* be set if this field had no index configuration /// (when `uses_ancestor_config` is false). @@ -2215,7 +2163,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_listen(&self, request: ListenRequest, database: &str) -> ProjectDatabaseDocumentListenCall<'a, C, A> { ProjectDatabaseDocumentListenCall { @@ -2235,7 +2183,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_rollback(&self, request: RollbackRequest, database: &str) -> ProjectDatabaseDocumentRollbackCall<'a, C, A> { ProjectDatabaseDocumentRollbackCall { @@ -2255,7 +2203,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_commit(&self, request: CommitRequest, database: &str) -> ProjectDatabaseDocumentCommitCall<'a, C, A> { ProjectDatabaseDocumentCommitCall { @@ -2291,7 +2239,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - A name of the form + /// * `name` - Required. A name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` pub fn databases_collection_groups_indexes_get(&self, name: &str) -> ProjectDatabaseCollectionGroupIndexeGetCall<'a, C, A> { ProjectDatabaseCollectionGroupIndexeGetCall { @@ -2357,7 +2305,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the Document to get. In the format: + /// * `name` - Required. The resource name of the Document to get. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. pub fn databases_documents_get(&self, name: &str) -> ProjectDatabaseDocumentGetCall<'a, C, A> { ProjectDatabaseDocumentGetCall { @@ -2379,7 +2327,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name. In the format: + /// * `parent` - Required. The parent resource name. In the format: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: @@ -2406,7 +2354,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_batch_get(&self, request: BatchGetDocumentsRequest, database: &str) -> ProjectDatabaseDocumentBatchGetCall<'a, C, A> { ProjectDatabaseDocumentBatchGetCall { @@ -2426,7 +2374,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_begin_transaction(&self, request: BeginTransactionRequest, database: &str) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> { ProjectDatabaseDocumentBeginTransactionCall { @@ -2446,7 +2394,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent document. In the format: + /// * `parent` - Required. The parent document. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` @@ -2520,7 +2468,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - A parent name of the form + /// * `parent` - Required. A parent name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` pub fn databases_collection_groups_indexes_list(&self, parent: &str) -> ProjectDatabaseCollectionGroupIndexeListCall<'a, C, A> { ProjectDatabaseCollectionGroupIndexeListCall { @@ -2541,7 +2489,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the Document to delete. In the format: + /// * `name` - Required. The resource name of the Document to delete. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. pub fn databases_documents_delete(&self, name: &str) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> { ProjectDatabaseDocumentDeleteCall { @@ -2561,7 +2509,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - A name of the form + /// * `name` - Required. A name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` pub fn databases_collection_groups_fields_get(&self, name: &str) -> ProjectDatabaseCollectionGroupFieldGetCall<'a, C, A> { ProjectDatabaseCollectionGroupFieldGetCall { @@ -2604,7 +2552,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Database to import into. Should be of the form: + /// * `name` - Required. Database to import into. Should be of the form: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_import_documents(&self, request: GoogleFirestoreAdminV1ImportDocumentsRequest, name: &str) -> ProjectDatabaseImportDocumentCall<'a, C, A> { ProjectDatabaseImportDocumentCall { @@ -2623,7 +2571,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - A name of the form + /// * `name` - Required. A name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` pub fn databases_collection_groups_indexes_delete(&self, name: &str) -> ProjectDatabaseCollectionGroupIndexeDeleteCall<'a, C, A> { ProjectDatabaseCollectionGroupIndexeDeleteCall { @@ -2668,7 +2616,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Database to export. Should be of the form: + /// * `name` - Required. Database to export. Should be of the form: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_export_documents(&self, request: GoogleFirestoreAdminV1ExportDocumentsRequest, name: &str) -> ProjectDatabaseExportDocumentCall<'a, C, A> { ProjectDatabaseExportDocumentCall { @@ -2692,7 +2640,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - A parent name of the form + /// * `parent` - Required. A parent name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` pub fn databases_collection_groups_fields_list(&self, parent: &str) -> ProjectDatabaseCollectionGroupFieldListCall<'a, C, A> { ProjectDatabaseCollectionGroupFieldListCall { @@ -2716,7 +2664,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - A parent name of the form + /// * `parent` - Required. A parent name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` pub fn databases_collection_groups_indexes_create(&self, request: GoogleFirestoreAdminV1Index, parent: &str) -> ProjectDatabaseCollectionGroupIndexeCreateCall<'a, C, A> { ProjectDatabaseCollectionGroupIndexeCreateCall { @@ -2736,10 +2684,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource. For example: + /// * `parent` - Required. The parent resource. For example: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - /// * `collectionId` - The collection ID, relative to `parent`, to list. For example: `chatrooms`. + /// * `collectionId` - Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. pub fn databases_documents_create_document(&self, request: Document, parent: &str, collection_id: &str) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { ProjectDatabaseDocumentCreateDocumentCall { hub: self.hub, @@ -2760,13 +2708,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The parent resource name. In the format: + /// * `parent` - Required. The parent resource name. In the format: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: /// `projects/my-project/databases/my-database/documents` or /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - /// * `collectionId` - The collection ID, relative to `parent`, to list. For example: `chatrooms` + /// * `collectionId` - Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` /// or `messages`. pub fn databases_documents_list(&self, parent: &str, collection_id: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { ProjectDatabaseDocumentListCall { @@ -2793,7 +2741,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// This is only required in the first message. pub fn databases_documents_write(&self, request: WriteRequest, database: &str) -> ProjectDatabaseDocumentWriteCall<'a, C, A> { @@ -3075,7 +3023,7 @@ impl<'a, C, A> ProjectDatabaseDocumentListenCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentRollbackCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The database name. In the format: + /// Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// /// Sets the *database* path property to the given value. @@ -3635,7 +3583,7 @@ impl<'a, C, A> ProjectDatabaseDocumentCommitCall<'a, C, A> where C: BorrowMut ProjectDatabaseCollectionGroupIndexeGetCall<'a, C, A> where C: Bo } - /// A name of the form + /// Required. A name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` /// /// Sets the *name* path property to the given value. @@ -4970,7 +4918,7 @@ impl<'a, C, A> ProjectDatabaseDocumentGetCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentGetCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentGetCall<'a, C, A> { @@ -5274,7 +5222,7 @@ impl<'a, C, A> ProjectDatabaseDocumentRunQueryCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The parent resource name. In the format: + /// Required. The parent resource name. In the format: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: @@ -5561,7 +5509,7 @@ impl<'a, C, A> ProjectDatabaseDocumentBatchGetCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The database name. In the format: + /// Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// /// Sets the *database* path property to the given value. @@ -5841,7 +5789,7 @@ impl<'a, C, A> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> where C: Bo self._request = new_value; self } - /// The database name. In the format: + /// Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// /// Sets the *database* path property to the given value. @@ -6121,7 +6069,7 @@ impl<'a, C, A> ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> where C: Bo self._request = new_value; self } - /// The parent document. In the format: + /// Required. The parent document. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` @@ -6716,7 +6664,7 @@ impl<'a, C, A> ProjectDatabaseCollectionGroupIndexeListCall<'a, C, A> where C: B } - /// A parent name of the form + /// Required. A parent name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` /// /// Sets the *parent* path property to the given value. @@ -6998,7 +6946,7 @@ impl<'a, C, A> ProjectDatabaseDocumentDeleteCall<'a, C, A> where C: BorrowMut ProjectDatabaseCollectionGroupFieldGetCall<'a, C, A> where C: Bor } - /// A name of the form + /// Required. A name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` /// /// Sets the *name* path property to the given value. @@ -7798,7 +7746,7 @@ impl<'a, C, A> ProjectDatabaseImportDocumentCall<'a, C, A> where C: BorrowMut ProjectDatabaseCollectionGroupIndexeDeleteCall<'a, C, A> where C: } - /// A name of the form + /// Required. A name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` /// /// Sets the *name* path property to the given value. @@ -8584,7 +8532,7 @@ impl<'a, C, A> ProjectDatabaseExportDocumentCall<'a, C, A> where C: BorrowMut ProjectDatabaseCollectionGroupFieldListCall<'a, C, A> where C: Bo } - /// A parent name of the form + /// Required. A parent name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` /// /// Sets the *parent* path property to the given value. @@ -9162,7 +9110,7 @@ impl<'a, C, A> ProjectDatabaseCollectionGroupIndexeCreateCall<'a, C, A> where C: self._request = new_value; self } - /// A parent name of the form + /// Required. A parent name of the form /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` /// /// Sets the *parent* path property to the given value. @@ -9456,7 +9404,7 @@ impl<'a, C, A> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> where C: Borr self._request = new_value; self } - /// The parent resource. For example: + /// Required. The parent resource. For example: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` /// @@ -9468,7 +9416,7 @@ impl<'a, C, A> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> where C: Borr self._parent = new_value.to_string(); self } - /// The collection ID, relative to `parent`, to list. For example: `chatrooms`. + /// Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. /// /// Sets the *collection id* path property to the given value. /// @@ -9773,7 +9721,7 @@ impl<'a, C, A> ProjectDatabaseDocumentListCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentListCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentListCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentListCall<'a, C, A> { @@ -10126,7 +10074,7 @@ impl<'a, C, A> ProjectDatabaseDocumentWriteCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Firestore (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-firestore1_beta1] path = "../firestore1_beta1" -version = "1.0.12+20190419" +version = "1.0.13+20200311" diff --git a/gen/firestore1_beta1-cli/README.md b/gen/firestore1_beta1-cli/README.md index 7048efc2ee..331019e95c 100644 --- a/gen/firestore1_beta1-cli/README.md +++ b/gen/firestore1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Firestore* API at revision *20190419*. The CLI is at version *1.0.12*. +This documentation was generated from the *Firestore* API at revision *20200311*. The CLI is at version *1.0.13*. ```bash firestore1-beta1 [options] diff --git a/gen/firestore1_beta1-cli/mkdocs.yml b/gen/firestore1_beta1-cli/mkdocs.yml index 298bb887ee..00ab1d322c 100644 --- a/gen/firestore1_beta1-cli/mkdocs.yml +++ b/gen/firestore1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firestore v1.0.12+20190419 +site_name: Firestore v1.0.13+20200311 site_url: http://byron.github.io/google-apis-rs/google-firestore1_beta1-cli site_description: A complete library to interact with Firestore (protocol v1beta1) diff --git a/gen/firestore1_beta1-cli/src/main.rs b/gen/firestore1_beta1-cli/src/main.rs index 40ccc64950..ed2b1dcd44 100644 --- a/gen/firestore1_beta1-cli/src/main.rs +++ b/gen/firestore1_beta1-cli/src/main.rs @@ -1762,7 +1762,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -1791,7 +1791,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -1820,7 +1820,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -1849,7 +1849,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource. For example: + Some(r##"Required. The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`"##), Some(true), @@ -1857,7 +1857,7 @@ fn main() { (Some(r##"collection-id"##), None, - Some(r##"The collection ID, relative to `parent`, to list. For example: `chatrooms`."##), + Some(r##"Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`."##), Some(true), Some(false)), @@ -1885,7 +1885,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the Document to delete. In the format: + Some(r##"Required. The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`."##), Some(true), Some(false)), @@ -1908,7 +1908,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the Document to get. In the format: + Some(r##"Required. The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`."##), Some(true), Some(false)), @@ -1931,7 +1931,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name. In the format: + Some(r##"Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: @@ -1942,7 +1942,7 @@ fn main() { (Some(r##"collection-id"##), None, - Some(r##"The collection ID, relative to `parent`, to list. For example: `chatrooms` + Some(r##"Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`."##), Some(true), Some(false)), @@ -1965,7 +1965,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent document. In the format: + Some(r##"Required. The parent document. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`"##), @@ -1996,7 +1996,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2054,7 +2054,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."##), Some(true), Some(false)), @@ -2083,7 +2083,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The parent resource name. In the format: + Some(r##"Required. The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: @@ -2116,7 +2116,7 @@ fn main() { vec![ (Some(r##"database"##), None, - Some(r##"The database name. In the format: + Some(r##"Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message."##), Some(true), @@ -2325,7 +2325,7 @@ fn main() { let mut app = App::new("firestore1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190419") + .version("1.0.13+20200311") .about("Accesses the NoSQL document database built for automatic scaling, high performance, and ease of application development. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_firestore1_beta1_cli") diff --git a/gen/firestore1_beta1/Cargo.toml b/gen/firestore1_beta1/Cargo.toml index aaf24b70ee..56d8ae7193 100644 --- a/gen/firestore1_beta1/Cargo.toml +++ b/gen/firestore1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firestore1_beta1" -version = "1.0.12+20190419" +version = "1.0.13+20200311" authors = ["Sebastian Thiel "] description = "A complete library to interact with Firestore (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/firestore1_beta1" homepage = "https://cloud.google.com/firestore" -documentation = "https://docs.rs/google-firestore1_beta1/1.0.12+20190419" +documentation = "https://docs.rs/google-firestore1_beta1/1.0.13+20200311" license = "MIT" keywords = ["firestore", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/firestore1_beta1/README.md b/gen/firestore1_beta1/README.md index 5028085c99..ee88edfe65 100644 --- a/gen/firestore1_beta1/README.md +++ b/gen/firestore1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-firestore1_beta1` library allows access to all features of the *Google Firestore* service. -This documentation was generated from *Firestore* crate version *1.0.12+20190419*, where *20190419* is the exact revision of the *firestore:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Firestore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *firestore:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Firestore* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/firestore). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.Firestore.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.Firestore.html) ... * projects - * [*databases documents batch get*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentBatchGetCall.html), [*databases documents begin transaction*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentBeginTransactionCall.html), [*databases documents commit*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentCommitCall.html), [*databases documents create document*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentCreateDocumentCall.html), [*databases documents delete*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentDeleteCall.html), [*databases documents get*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentGetCall.html), [*databases documents list*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentListCall.html), [*databases documents list collection ids*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentListCollectionIdCall.html), [*databases documents listen*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentListenCall.html), [*databases documents patch*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentPatchCall.html), [*databases documents rollback*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentRollbackCall.html), [*databases documents run query*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentRunQueryCall.html), [*databases documents write*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseDocumentWriteCall.html), [*databases export documents*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseExportDocumentCall.html), [*databases import documents*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseImportDocumentCall.html), [*databases indexes create*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseIndexeCreateCall.html), [*databases indexes delete*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseIndexeDeleteCall.html), [*databases indexes get*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseIndexeGetCall.html) and [*databases indexes list*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.ProjectDatabaseIndexeListCall.html) + * [*databases documents batch get*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentBatchGetCall.html), [*databases documents begin transaction*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentBeginTransactionCall.html), [*databases documents commit*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentCommitCall.html), [*databases documents create document*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentCreateDocumentCall.html), [*databases documents delete*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentDeleteCall.html), [*databases documents get*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentGetCall.html), [*databases documents list*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentListCall.html), [*databases documents list collection ids*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentListCollectionIdCall.html), [*databases documents listen*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentListenCall.html), [*databases documents patch*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentPatchCall.html), [*databases documents rollback*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentRollbackCall.html), [*databases documents run query*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentRunQueryCall.html), [*databases documents write*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseDocumentWriteCall.html), [*databases export documents*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseExportDocumentCall.html), [*databases import documents*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseImportDocumentCall.html), [*databases indexes create*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseIndexeCreateCall.html), [*databases indexes delete*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseIndexeDeleteCall.html), [*databases indexes get*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseIndexeGetCall.html) and [*databases indexes list*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.ProjectDatabaseIndexeListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/struct.Firestore.html)** +* **[Hub](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/struct.Firestore.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-firestore1_beta1/1.0.12+20190419/google_firestore1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firestore1_beta1/1.0.13+20200311/google_firestore1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/firestore1_beta1/src/lib.rs b/gen/firestore1_beta1/src/lib.rs index 8964bd4912..35d120466f 100644 --- a/gen/firestore1_beta1/src/lib.rs +++ b/gen/firestore1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Firestore* crate version *1.0.12+20190419*, where *20190419* is the exact revision of the *firestore:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Firestore* crate version *1.0.13+20200311*, where *20200311* is the exact revision of the *firestore:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Firestore* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/firestore). @@ -335,7 +335,7 @@ impl<'a, C, A> Firestore Firestore { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://firestore.googleapis.com/".to_string(), _root_url: "https://firestore.googleapis.com/".to_string(), } @@ -346,7 +346,7 @@ impl<'a, C, A> Firestore } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -636,58 +636,14 @@ impl ResponseResult for BatchGetDocumentsResponse {} /// The `Status` type defines a logical error model that is suitable for /// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](https://github.com/grpc). The error model is designed to be: +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. /// -/// * Simple to use and understand for most users -/// * Flexible enough to meet unexpected needs -/// -/// # Overview -/// -/// The `Status` message contains three pieces of data: error code, error -/// message, and error details. The error code should be an enum value of -/// google.rpc.Code, but it may accept additional error codes if needed. The -/// error message should be a developer-facing English message that helps -/// developers *understand* and *resolve* the error. If a localized user-facing -/// error message is needed, put the localized message in the error details or -/// localize it in the client. The optional error details may contain arbitrary -/// information about the error. There is a predefined set of error detail types -/// in the package `google.rpc` that can be used for common error conditions. -/// -/// # Language mapping -/// -/// The `Status` message is the logical representation of the error model, but it -/// is not necessarily the actual wire format. When the `Status` message is -/// exposed in different client libraries and different wire protocols, it can be -/// mapped differently. For example, it will likely be mapped to some exceptions -/// in Java, but more likely mapped to some error codes in C. -/// -/// # Other uses -/// -/// The error model and the `Status` message can be used in a variety of -/// environments, either with or without APIs, to provide a -/// consistent developer experience across different environments. -/// -/// Example uses of this error model include: -/// -/// * Partial errors. If a service needs to return partial errors to the client, -/// it may embed the `Status` in the normal response to indicate the partial -/// errors. -/// -/// * Workflow errors. A typical workflow has multiple steps. Each step may -/// have a `Status` message for error reporting. -/// -/// * Batch operations. If a client uses batch request and batch response, the -/// `Status` message should be used directly inside batch response, one for -/// each error sub-response. -/// -/// * Asynchronous operations. If an API call embeds asynchronous operation -/// results in its response, the status of those operations should be -/// represented directly using the `Status` message. -/// -/// * Logging. If some API errors are stored in logs, the message `Status` could -/// be used directly after any stripping needed for security/privacy reasons. +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Status { /// A developer-facing error message, which should be in English. Any @@ -911,7 +867,8 @@ pub struct WriteResponse { /// This field is always set. #[serde(rename="streamToken")] pub stream_token: Option, - /// The time at which the commit occurred. + /// The time at which the commit occurred. Any read with an equal or greater + /// `read_time` is guaranteed to see the effects of the write. #[serde(rename="commitTime")] pub commit_time: Option, /// The ID of the stream. @@ -1026,7 +983,8 @@ pub struct CommitResponse { /// request. #[serde(rename="writeResults")] pub write_results: Option>, - /// The time at which the commit occurred. + /// The time at which the commit occurred. Any read with an equal or greater + /// `read_time` is guaranteed to see the effects of the commit. #[serde(rename="commitTime")] pub commit_time: Option, } @@ -1051,14 +1009,8 @@ pub struct Target { /// Using a resume token with a different target is unsupported and may fail. #[serde(rename="resumeToken")] pub resume_token: Option, - /// A client provided target ID. - /// - /// If not set, the server will assign an ID for the target. - /// - /// Used for resuming a target without changing IDs. The IDs can either be - /// client-assigned or be server-assigned in a previous stream. All targets - /// with client provided IDs must be added before adding a target that needs - /// a server-assigned id. + /// The target ID that identifies the target on the stream. Must be a positive + /// number and non-zero. #[serde(rename="targetId")] pub target_id: Option, /// Start listening after a specific `read_time`. @@ -1399,7 +1351,7 @@ pub struct RunQueryRequest { #[serde(rename="structuredQuery")] pub structured_query: Option, /// Reads documents as they were at the given time. - /// This may not be older than 60 seconds. + /// This may not be older than 270 seconds. #[serde(rename="readTime")] pub read_time: Option, } @@ -1443,11 +1395,7 @@ pub struct TargetChange { /// /// If empty, the change applies to all targets. /// - /// For `target_change_type=ADD`, the order of the target IDs matches the order - /// of the requests to add the targets. This allows clients to unambiguously - /// associate server-assigned target IDs with added targets. - /// - /// For other states, the order of the target IDs is not defined. + /// The order of the target IDs is not defined. #[serde(rename="targetIds")] pub target_ids: Option>, /// The consistent `read_time` for the given `target_ids` (omitted when the @@ -1473,14 +1421,18 @@ impl Part for TargetChange {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Write { - /// A document name to delete. In the format: - /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - pub delete: Option, /// An optional precondition on the document. /// /// The write will fail if this is set and not met by the target document. #[serde(rename="currentDocument")] pub current_document: Option, + /// The transforms to perform after update. + /// + /// This field can be set only when the operation is `update`. If present, this + /// write is equivalent to performing `update` and `transform` to the same + /// document atomically and in order. + #[serde(rename="updateTransforms")] + pub update_transforms: Option>, /// The fields to update in this write. /// /// This field can be set only when the operation is `update`. @@ -1493,13 +1445,13 @@ pub struct Write { /// The field paths in this mask must not contain a reserved field name. #[serde(rename="updateMask")] pub update_mask: Option, - /// Applies a transformation to a document. - /// At most one `transform` per document is allowed in a given request. - /// An `update` cannot follow a `transform` on the same document in a given - /// request. - pub transform: Option, + /// A document name to delete. In the format: + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + pub delete: Option, /// A document to write. pub update: Option, + /// Applies a transformation to a document. + pub transform: Option, } impl Part for Write {} @@ -1634,7 +1586,7 @@ pub struct GoogleLongrunningOperation { pub response: Option>, /// The server-assigned name, which is only unique within the same service that /// originally returns it. If you use the default HTTP mapping, the - /// `name` should have the format of `operations/some/unique/name`. + /// `name` should be a resource name ending with `operations/{unique_id}`. pub name: Option, /// Service-specific metadata associated with the operation. It typically /// contains progress information and common metadata such as create time. @@ -1722,7 +1674,7 @@ pub struct BatchGetDocumentsRequest { /// given `database`. Duplicate names will be elided. pub documents: Option>, /// Reads documents as they were at the given time. - /// This may not be older than 60 seconds. + /// This may not be older than 270 seconds. #[serde(rename="readTime")] pub read_time: Option, } @@ -1741,7 +1693,7 @@ impl RequestValue for BatchGetDocumentsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RollbackRequest { - /// The transaction to roll back. + /// Required. The transaction to roll back. pub transaction: Option, } @@ -2003,10 +1955,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource. For example: + /// * `parent` - Required. The parent resource. For example: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - /// * `collectionId` - The collection ID, relative to `parent`, to list. For example: `chatrooms`. + /// * `collectionId` - Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. pub fn databases_documents_create_document(&self, request: Document, parent: &str, collection_id: &str) -> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> { ProjectDatabaseDocumentCreateDocumentCall { hub: self.hub, @@ -2060,7 +2012,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_rollback(&self, request: RollbackRequest, database: &str) -> ProjectDatabaseDocumentRollbackCall<'a, C, A> { ProjectDatabaseDocumentRollbackCall { @@ -2079,13 +2031,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The parent resource name. In the format: + /// * `parent` - Required. The parent resource name. In the format: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: /// `projects/my-project/databases/my-database/documents` or /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - /// * `collectionId` - The collection ID, relative to `parent`, to list. For example: `chatrooms` + /// * `collectionId` - Required. The collection ID, relative to `parent`, to list. For example: `chatrooms` /// or `messages`. pub fn databases_documents_list(&self, parent: &str, collection_id: &str) -> ProjectDatabaseDocumentListCall<'a, C, A> { ProjectDatabaseDocumentListCall { @@ -2129,7 +2081,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the Document to get. In the format: + /// * `name` - Required. The resource name of the Document to get. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. pub fn databases_documents_get(&self, name: &str) -> ProjectDatabaseDocumentGetCall<'a, C, A> { ProjectDatabaseDocumentGetCall { @@ -2151,7 +2103,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// This is only required in the first message. pub fn databases_documents_write(&self, request: WriteRequest, database: &str) -> ProjectDatabaseDocumentWriteCall<'a, C, A> { @@ -2172,7 +2124,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent resource name. In the format: + /// * `parent` - Required. The parent resource name. In the format: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: @@ -2247,7 +2199,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_batch_get(&self, request: BatchGetDocumentsRequest, database: &str) -> ProjectDatabaseDocumentBatchGetCall<'a, C, A> { ProjectDatabaseDocumentBatchGetCall { @@ -2267,7 +2219,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_begin_transaction(&self, request: BeginTransactionRequest, database: &str) -> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> { ProjectDatabaseDocumentBeginTransactionCall { @@ -2287,7 +2239,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The parent document. In the format: + /// * `parent` - Required. The parent document. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` @@ -2353,7 +2305,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the Document to delete. In the format: + /// * `name` - Required. The resource name of the Document to delete. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. pub fn databases_documents_delete(&self, name: &str) -> ProjectDatabaseDocumentDeleteCall<'a, C, A> { ProjectDatabaseDocumentDeleteCall { @@ -2374,7 +2326,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_commit(&self, request: CommitRequest, database: &str) -> ProjectDatabaseDocumentCommitCall<'a, C, A> { ProjectDatabaseDocumentCommitCall { @@ -2394,7 +2346,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `database` - The database name. In the format: + /// * `database` - Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. pub fn databases_documents_listen(&self, request: ListenRequest, database: &str) -> ProjectDatabaseDocumentListenCall<'a, C, A> { ProjectDatabaseDocumentListenCall { @@ -2920,7 +2872,7 @@ impl<'a, C, A> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> where C: Borr self._request = new_value; self } - /// The parent resource. For example: + /// Required. The parent resource. For example: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` /// @@ -2932,7 +2884,7 @@ impl<'a, C, A> ProjectDatabaseDocumentCreateDocumentCall<'a, C, A> where C: Borr self._parent = new_value.to_string(); self } - /// The collection ID, relative to `parent`, to list. For example: `chatrooms`. + /// Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. /// /// Sets the *collection id* path property to the given value. /// @@ -3521,7 +3473,7 @@ impl<'a, C, A> ProjectDatabaseDocumentRollbackCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The database name. In the format: + /// Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// /// Sets the *database* path property to the given value. @@ -3809,7 +3761,7 @@ impl<'a, C, A> ProjectDatabaseDocumentListCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentListCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentListCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentListCall<'a, C, A> { @@ -4397,7 +4349,7 @@ impl<'a, C, A> ProjectDatabaseDocumentGetCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentGetCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentGetCall<'a, C, A> { @@ -4701,7 +4653,7 @@ impl<'a, C, A> ProjectDatabaseDocumentWriteCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentRunQueryCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The parent resource name. In the format: + /// Required. The parent resource name. In the format: /// `projects/{project_id}/databases/{database_id}/documents` or /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: @@ -5891,7 +5843,7 @@ impl<'a, C, A> ProjectDatabaseDocumentBatchGetCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The database name. In the format: + /// Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// /// Sets the *database* path property to the given value. @@ -6171,7 +6123,7 @@ impl<'a, C, A> ProjectDatabaseDocumentBeginTransactionCall<'a, C, A> where C: Bo self._request = new_value; self } - /// The database name. In the format: + /// Required. The database name. In the format: /// `projects/{project_id}/databases/{database_id}`. /// /// Sets the *database* path property to the given value. @@ -6451,7 +6403,7 @@ impl<'a, C, A> ProjectDatabaseDocumentListCollectionIdCall<'a, C, A> where C: Bo self._request = new_value; self } - /// The parent document. In the format: + /// Required. The parent document. In the format: /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// For example: /// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` @@ -7248,7 +7200,7 @@ impl<'a, C, A> ProjectDatabaseDocumentDeleteCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentCommitCall<'a, C, A> where C: BorrowMut ProjectDatabaseDocumentListenCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with fitness (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-fitness1] path = "../fitness1" -version = "1.0.12+20190701" +version = "1.0.13+20200407" diff --git a/gen/fitness1-cli/README.md b/gen/fitness1-cli/README.md index d22211b70f..7240208ffc 100644 --- a/gen/fitness1-cli/README.md +++ b/gen/fitness1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *fitness* API at revision *20190701*. The CLI is at version *1.0.12*. +This documentation was generated from the *fitness* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash fitness1 [options] diff --git a/gen/fitness1-cli/mkdocs.yml b/gen/fitness1-cli/mkdocs.yml index 012656f04f..433e6dfd08 100644 --- a/gen/fitness1-cli/mkdocs.yml +++ b/gen/fitness1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fitness v1.0.12+20190701 +site_name: fitness v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-fitness1-cli site_description: A complete library to interact with fitness (protocol v1) diff --git a/gen/fitness1-cli/src/main.rs b/gen/fitness1-cli/src/main.rs index fa5c199520..d22d05b614 100644 --- a/gen/fitness1-cli/src/main.rs +++ b/gen/fitness1-cli/src/main.rs @@ -827,6 +827,9 @@ impl<'n> Engine<'n> { "end-time" => { call = call.end_time(value.unwrap_or("")); }, + "activity-type" => { + call = call.add_activity_type(arg_from_str(value.unwrap_or("-0"), err, "activity-type", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -840,7 +843,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "end-time", "include-deleted", "start-time"].iter().map(|v|*v)); + v.extend(["activity-type", "page-token", "end-time", "include-deleted", "start-time"].iter().map(|v|*v)); v } )); } } @@ -1110,7 +1113,17 @@ fn main() { let arg_data = [ ("users", "methods: 'data-sources-create', 'data-sources-data-point-changes-list', 'data-sources-datasets-delete', 'data-sources-datasets-get', 'data-sources-datasets-patch', 'data-sources-delete', 'data-sources-get', 'data-sources-list', 'data-sources-update', 'dataset-aggregate', 'sessions-delete', 'sessions-list' and 'sessions-update'", vec![ ("data-sources-create", - Some(r##"Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source fields reflected into the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types."##), + Some(r##"Creates a new data source that is unique across all data sources belonging to this user. + + A data source is a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point in every dataset inserted into or read from the Fitness API has an associated data source. + + Each data source produces a unique stream of dataset updates, with a unique data source identifier. Not all changes to data source affect the data stream ID, so that data collected by updated versions of the same application/device can still be considered to belong to the same data source. + + Data sources are identified using a string generated by the server, based on the contents of the source being created. The dataStreamId field should not be set when invoking this method. It will be automatically generated by the server with the correct format. If a dataStreamId is set, it must match the format that the server would generate. This format is a combination of some fields from the data source, and has a specific order. If it doesn't match, the request will fail with an error. + + Specifying a DataType which is not a known type (beginning with "com.google.") will create a DataSource with a custom data type. Custom data types are only readable by the application that created them. Custom data types are deprecated; use standard data types instead. + + In addition to the data source fields included in the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types."##), "Details at http://byron.github.io/google-apis-rs/google_fitness1_cli/users_data-sources-create", vec![ (Some(r##"user-id"##), @@ -1382,7 +1395,7 @@ fn main() { Some(false)), ]), ("dataset-aggregate", - Some(r##"Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request."##), + Some(r##"Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggregated into exactly one bucket type per request."##), "Details at http://byron.github.io/google-apis-rs/google_fitness1_cli/users_dataset-aggregate", vec![ (Some(r##"user-id"##), @@ -1493,7 +1506,7 @@ fn main() { let mut app = App::new("fitness1") .author("Sebastian Thiel ") - .version("1.0.12+20190701") + .version("1.0.13+20200407") .about("Stores and accesses user data in the fitness store from apps on any platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fitness1_cli") .arg(Arg::with_name("url") diff --git a/gen/fitness1/Cargo.toml b/gen/fitness1/Cargo.toml index 91f6d105e9..1a95a8d4d3 100644 --- a/gen/fitness1/Cargo.toml +++ b/gen/fitness1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-fitness1" -version = "1.0.12+20190701" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with fitness (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fitness1" homepage = "https://developers.google.com/fit/rest/" -documentation = "https://docs.rs/google-fitness1/1.0.12+20190701" +documentation = "https://docs.rs/google-fitness1/1.0.13+20200407" license = "MIT" keywords = ["fitness", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/fitness1/README.md b/gen/fitness1/README.md index de16071956..b5c617b253 100644 --- a/gen/fitness1/README.md +++ b/gen/fitness1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-fitness1` library allows access to all features of the *Google fitness* service. -This documentation was generated from *fitness* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *fitness* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *fitness* *v1* API can be found at the [official documentation site](https://developers.google.com/fit/rest/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.Fitness.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.Fitness.html) ... * users - * [*data sources create*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceCreateCall.html), [*data sources data point changes list*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceDataPointChangeListCall.html), [*data sources datasets delete*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceDeleteCall.html), [*data sources get*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceListCall.html), [*data sources update*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDataSourceUpdateCall.html), [*dataset aggregate*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserDatasetAggregateCall.html), [*sessions delete*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserSessionDeleteCall.html), [*sessions list*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserSessionListCall.html) and [*sessions update*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.UserSessionUpdateCall.html) + * [*data sources create*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceCreateCall.html), [*data sources data point changes list*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceDataPointChangeListCall.html), [*data sources datasets delete*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceDatasetDeleteCall.html), [*data sources datasets get*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceDatasetGetCall.html), [*data sources datasets patch*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceDatasetPatchCall.html), [*data sources delete*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceDeleteCall.html), [*data sources get*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceGetCall.html), [*data sources list*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceListCall.html), [*data sources update*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDataSourceUpdateCall.html), [*dataset aggregate*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserDatasetAggregateCall.html), [*sessions delete*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserSessionDeleteCall.html), [*sessions list*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserSessionListCall.html) and [*sessions update*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.UserSessionUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/struct.Fitness.html)** +* **[Hub](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/struct.Fitness.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.Part.html)** + * **[Parts](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-fitness1/1.0.12+20190701/google_fitness1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-fitness1/1.0.13+20200407/google_fitness1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/fitness1/src/lib.rs b/gen/fitness1/src/lib.rs index 6561df5c9c..7c866cd043 100644 --- a/gen/fitness1/src/lib.rs +++ b/gen/fitness1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *fitness* crate version *1.0.12+20190701*, where *20190701* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *fitness* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *fitness:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *fitness* *v1* API can be found at the //! [official documentation site](https://developers.google.com/fit/rest/). @@ -232,58 +232,58 @@ pub use cmn::*; /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// View body sensor information in Google Fit + /// See info about your body measurements and heart rate in Google Fit BodyRead, - /// View and store reproductive health data in Google Fit + /// See and add info about your reproductive health in Google Fit. I consent to Google sharing my reporductive health information with this app. ReproductiveHealthWrite, - /// View blood pressure data in Google Fit + /// See info about your blood pressure in Google Fit. I consent to Google sharing my blood pressure information with this app. BloodPressureRead, - /// View and store nutrition information in Google Fit + /// See and add to info about your nutrition in Google Fit NutritionWrite, - /// View and store blood glucose data in Google Fit + /// See and add info about your blood glucose to Google Fit. I consent to Google sharing my blood glucose information with this app. BloodGlucoseWrite, - /// View and store oxygen saturation data in Google Fit + /// See and add info about your oxygen saturation in Google Fit. I consent to Google sharing my oxygen saturation information with this app. OxygenSaturationWrite, - /// View and store your location data in Google Fit + /// See and add to your Google Fit location data LocationWrite, - /// View reproductive health data in Google Fit + /// See info about your reproductive health in Google Fit. I consent to Google sharing my reporductive health information with this app. ReproductiveHealthRead, - /// View and store body temperature data in Google Fit + /// See and add to info about your body temperature in Google Fit. I consent to Google sharing my body temperature information with this app. BodyTemperatureWrite, - /// View and store body sensor data in Google Fit + /// See and add info about your body measurements and heart rate to Google Fit BodyWrite, - /// View your activity information in Google Fit + /// Use Google Fit to see and store your physical activity data ActivityRead, - /// View your stored location data in Google Fit + /// See your Google Fit speed and distance data LocationRead, - /// View and store blood pressure data in Google Fit + /// See and add info about your blood pressure in Google Fit. I consent to Google sharing my blood pressure information with this app. BloodPressureWrite, - /// View body temperature data in Google Fit + /// See info about your body temperature in Google Fit. I consent to Google sharing my body temperature information with this app. BodyTemperatureRead, - /// View and store your activity information in Google Fit + /// See and add to your Google Fit physical activity data ActivityWrite, - /// View nutrition information in Google Fit + /// See info about your nutrition in Google Fit NutritionRead, - /// View blood glucose data in Google Fit + /// See info about your blood glucose in Google Fit. I consent to Google sharing my blood glucose information with this app. BloodGlucoseRead, - /// View oxygen saturation data in Google Fit + /// See info about your oxygen saturation in Google Fit. I consent to Google sharing my oxygen saturation information with this app. OxygenSaturationRead, } @@ -400,7 +400,7 @@ impl<'a, C, A> Fitness Fitness { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/fitness/v1/users/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -411,7 +411,7 @@ impl<'a, C, A> Fitness } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -445,10 +445,10 @@ impl<'a, C, A> Fitness /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AggregateBy { - /// A data source ID to aggregate. Mutually exclusive of dataTypeName. Only data from the specified data source ID will be included in the aggregation. The dataset in the response will have the same data source ID. + /// A data source ID to aggregate. Only data from the specified data source ID will be included in the aggregation. If specified, this data source must exist; the OAuth scopes in the supplied credentials must grant read access to this data type. The dataset in the response will have the same data source ID. Note: Data can be aggregated by either the dataTypeName or the dataSourceId, not both. #[serde(rename="dataSourceId")] pub data_source_id: Option, - /// The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single dataset for this data type name. The dataset will have a data source ID of derived:com.google.:com.google.android.gms:aggregated + /// The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single dataset for this data type name. The dataset will have a data source ID of derived::com.google.android.gms:aggregated. If the user has no data for this data type, an empty data set will be returned. Note: Data can be aggregated by either the dataTypeName or the dataSourceId, not both. #[serde(rename="dataTypeName")] pub data_type_name: Option, } @@ -567,7 +567,7 @@ impl Part for DataPoint {} /// Holder object for the value of a single field in a data point. /// -/// A field value has a particular format and is only ever set to one of an integer or a floating point value. LINT.IfChange +/// A field value has a particular format and is only ever set to one of an integer or a floating point value. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -862,6 +862,8 @@ pub struct Device { #[serde(rename="type")] pub type_: Option, /// The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form. + /// + /// The obfuscation preserves equality; that is, given two IDs, if id1 == id2, obfuscated(id1) == obfuscated(id2). pub uid: Option, /// Manufacturer of the product/hardware. pub manufacturer: Option, @@ -980,7 +982,7 @@ pub struct DataSource { /// /// When any of the optional fields that make up the data stream ID are absent, they will be omitted from the data stream ID. The minimum viable data stream ID would be: type:dataType.name:developer project number /// - /// Finally, the developer project number is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the developer project number in clear and normal form. + /// Finally, the developer project number and device UID are obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the developer project number in clear and normal form. This means a client will see a different set of data_stream_ids than another client with different credentials. #[serde(rename="dataStreamId")] pub data_stream_id: Option, /// A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. @@ -1038,7 +1040,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request. + /// Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggregated into exactly one bucket type per request. /// /// # Arguments /// @@ -1099,7 +1101,17 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source fields reflected into the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types. + /// Creates a new data source that is unique across all data sources belonging to this user. + /// + /// A data source is a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point in every dataset inserted into or read from the Fitness API has an associated data source. + /// + /// Each data source produces a unique stream of dataset updates, with a unique data source identifier. Not all changes to data source affect the data stream ID, so that data collected by updated versions of the same application/device can still be considered to belong to the same data source. + /// + /// Data sources are identified using a string generated by the server, based on the contents of the source being created. The dataStreamId field should not be set when invoking this method. It will be automatically generated by the server with the correct format. If a dataStreamId is set, it must match the format that the server would generate. This format is a combination of some fields from the data source, and has a specific order. If it doesn't match, the request will fail with an error. + /// + /// Specifying a DataType which is not a known type (beginning with "com.google.") will create a DataSource with a custom data type. Custom data types are only readable by the application that created them. Custom data types are deprecated; use standard data types instead. + /// + /// In addition to the data source fields included in the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types. /// /// # Arguments /// @@ -1240,6 +1252,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { _page_token: Default::default(), _include_deleted: Default::default(), _end_time: Default::default(), + _activity_type: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1316,7 +1329,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { // CallBuilders ### // ################# -/// Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request. +/// Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggregated into exactly one bucket type per request. /// /// A builder for the *dataset.aggregate* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. @@ -2127,7 +2140,17 @@ impl<'a, C, A> UserDataSourceDatasetGetCall<'a, C, A> where C: BorrowMut UserDataSourceUpdateCall<'a, C, A> where C: BorrowMut _page_token: Option, _include_deleted: Option, _end_time: Option, + _activity_type: Vec, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3837,7 +3862,7 @@ impl<'a, C, A> UserSessionListCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "fitness.users.sessions.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); params.push(("userId", self._user_id.to_string())); if let Some(value) = self._start_time { params.push(("startTime", value.to_string())); @@ -3851,7 +3876,12 @@ impl<'a, C, A> UserSessionListCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._end_time { params.push(("endTime", value.to_string())); } - for &field in ["alt", "userId", "startTime", "pageToken", "includeDeleted", "endTime"].iter() { + if self._activity_type.len() > 0 { + for f in self._activity_type.iter() { + params.push(("activityType", f.to_string())); + } + } + for &field in ["alt", "userId", "startTime", "pageToken", "includeDeleted", "endTime", "activityType"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4001,6 +4031,14 @@ impl<'a, C, A> UserSessionListCall<'a, C, A> where C: BorrowMut, self._end_time = Some(new_value.to_string()); self } + /// If non-empty, only sessions with these activity types should be returned. + /// + /// Append the given value to the *activity type* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_activity_type(mut self, new_value: i32) -> UserSessionListCall<'a, C, A> { + self._activity_type.push(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4094,7 +4132,7 @@ impl<'a, C, A> UserSessionListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().sessions_update(req, "userId", "sessionId") -/// .current_time_millis("elitr") +/// .current_time_millis("amet") /// .doit(); /// # } /// ``` @@ -4383,8 +4421,8 @@ impl<'a, C, A> UserSessionUpdateCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().data_sources_data_point_changes_list("userId", "dataSourceId") -/// .page_token("labore") -/// .limit(-39) +/// .page_token("eirmod") +/// .limit(-33) /// .doit(); /// # } /// ``` @@ -4659,7 +4697,7 @@ impl<'a, C, A> UserDataSourceDataPointChangeListCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().data_sources_list("userId") -/// .add_data_type_name("invidunt") +/// .add_data_type_name("aliquyam") /// .doit(); /// # } /// ``` diff --git a/gen/fusiontables2-cli/Cargo.toml b/gen/fusiontables2-cli/Cargo.toml index c160d417c2..e44a657ecf 100644 --- a/gen/fusiontables2-cli/Cargo.toml +++ b/gen/fusiontables2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-fusiontables2-cli" -version = "1.0.12+20171117" +version = "1.0.13+20171117" authors = ["Sebastian Thiel "] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-fusiontables2] path = "../fusiontables2" -version = "1.0.12+20171117" +version = "1.0.13+20171117" diff --git a/gen/fusiontables2-cli/README.md b/gen/fusiontables2-cli/README.md index c73973fb67..cb86aafa75 100644 --- a/gen/fusiontables2-cli/README.md +++ b/gen/fusiontables2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *fusiontables* API at revision *20171117*. The CLI is at version *1.0.12*. +This documentation was generated from the *fusiontables* API at revision *20171117*. The CLI is at version *1.0.13*. ```bash fusiontables2 [options] diff --git a/gen/fusiontables2-cli/mkdocs.yml b/gen/fusiontables2-cli/mkdocs.yml index 7faf4108d3..e0e1e3c0de 100644 --- a/gen/fusiontables2-cli/mkdocs.yml +++ b/gen/fusiontables2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fusiontables v1.0.12+20171117 +site_name: fusiontables v1.0.13+20171117 site_url: http://byron.github.io/google-apis-rs/google-fusiontables2-cli site_description: A complete library to interact with fusiontables (protocol v2) diff --git a/gen/fusiontables2-cli/src/main.rs b/gen/fusiontables2-cli/src/main.rs index 2b48679a9c..e7d1560879 100644 --- a/gen/fusiontables2-cli/src/main.rs +++ b/gen/fusiontables2-cli/src/main.rs @@ -3663,7 +3663,7 @@ fn main() { let mut app = App::new("fusiontables2") .author("Sebastian Thiel ") - .version("1.0.12+20171117") + .version("1.0.13+20171117") .about("API for working with Fusion Tables data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_fusiontables2_cli") .arg(Arg::with_name("url") diff --git a/gen/fusiontables2/Cargo.toml b/gen/fusiontables2/Cargo.toml index 3781b15c5c..53ed334d99 100644 --- a/gen/fusiontables2/Cargo.toml +++ b/gen/fusiontables2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-fusiontables2" -version = "1.0.12+20171117" +version = "1.0.13+20171117" authors = ["Sebastian Thiel "] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2" homepage = "https://developers.google.com/fusiontables" -documentation = "https://docs.rs/google-fusiontables2/1.0.12+20171117" +documentation = "https://docs.rs/google-fusiontables2/1.0.13+20171117" license = "MIT" keywords = ["fusiontables", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/fusiontables2/README.md b/gen/fusiontables2/README.md index 2c24761b40..2ab9658d30 100644 --- a/gen/fusiontables2/README.md +++ b/gen/fusiontables2/README.md @@ -5,38 +5,38 @@ DO NOT EDIT ! --> The `google-fusiontables2` library allows access to all features of the *Google fusiontables* service. -This documentation was generated from *fusiontables* crate version *1.0.12+20171117*, where *20171117* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *fusiontables* crate version *1.0.13+20171117*, where *20171117* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *fusiontables* *v2* API can be found at the [official documentation site](https://developers.google.com/fusiontables). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.Fusiontables.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.Fusiontables.html) ... -* [column](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.Column.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.ColumnDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.ColumnGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.ColumnInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.ColumnListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.ColumnPatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.ColumnUpdateCall.html) +* [column](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.Column.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.ColumnDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.ColumnGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.ColumnInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.ColumnListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.ColumnPatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.ColumnUpdateCall.html) * query - * [*sql*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.QuerySqlCall.html) and [*sql get*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.QuerySqlGetCall.html) + * [*sql*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.QuerySqlCall.html) and [*sql get*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.QuerySqlGetCall.html) * style - * [*delete*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.StyleDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.StyleGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.StyleInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.StyleListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.StylePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.StyleUpdateCall.html) -* [table](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.Table.html) - * [*copy*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableCopyCall.html), [*delete*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableGetCall.html), [*import rows*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableImportRowCall.html), [*import table*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableImportTableCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TablePatchCall.html), [*refetch sheet*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableRefetchSheetCall.html), [*replace rows*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableReplaceRowCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableUpdateCall.html) -* [task](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.Task.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TaskGetCall.html) and [*list*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TaskListCall.html) -* [template](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.Template.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TemplateInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TemplateListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TemplatePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TemplateUpdateCall.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.StyleDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.StyleGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.StyleInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.StyleListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.StylePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.StyleUpdateCall.html) +* [table](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.Table.html) + * [*copy*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableCopyCall.html), [*delete*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableGetCall.html), [*import rows*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableImportRowCall.html), [*import table*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableImportTableCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TablePatchCall.html), [*refetch sheet*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableRefetchSheetCall.html), [*replace rows*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableReplaceRowCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableUpdateCall.html) +* [task](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.Task.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TaskGetCall.html) and [*list*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TaskListCall.html) +* [template](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.Template.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TemplateInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TemplateListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TemplatePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TemplateUpdateCall.html) Upload supported by ... -* [*replace rows table*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableReplaceRowCall.html) -* [*import rows table*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableImportRowCall.html) -* [*import table table*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.TableImportTableCall.html) +* [*replace rows table*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableReplaceRowCall.html) +* [*import rows table*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableImportRowCall.html) +* [*import table table*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.TableImportTableCall.html) Download supported by ... -* [*sql get query*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.QuerySqlGetCall.html) -* [*sql query*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.QuerySqlCall.html) +* [*sql get query*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.QuerySqlGetCall.html) +* [*sql query*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.QuerySqlCall.html) @@ -44,17 +44,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/struct.Fusiontables.html)** +* **[Hub](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/struct.Fusiontables.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.Part.html)** + * **[Parts](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -153,17 +153,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -173,29 +173,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-fusiontables2/1.0.12+20171117/google_fusiontables2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-fusiontables2/1.0.13+20171117/google_fusiontables2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/fusiontables2/src/lib.rs b/gen/fusiontables2/src/lib.rs index 0baeee317c..aa7ef13425 100644 --- a/gen/fusiontables2/src/lib.rs +++ b/gen/fusiontables2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *fusiontables* crate version *1.0.12+20171117*, where *20171117* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *fusiontables* crate version *1.0.13+20171117*, where *20171117* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *fusiontables* *v2* API can be found at the //! [official documentation site](https://developers.google.com/fusiontables). @@ -353,7 +353,7 @@ impl<'a, C, A> Fusiontables Fusiontables { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/fusiontables/v2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -379,7 +379,7 @@ impl<'a, C, A> Fusiontables } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/games1-cli/Cargo.toml b/gen/games1-cli/Cargo.toml index c9ffd0f524..a787e9e15e 100644 --- a/gen/games1-cli/Cargo.toml +++ b/gen/games1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-games1-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-games1] path = "../games1" -version = "1.0.12+20190627" +version = "1.0.13+20200402" diff --git a/gen/games1-cli/README.md b/gen/games1-cli/README.md index a1839e1a44..deda48deeb 100644 --- a/gen/games1-cli/README.md +++ b/gen/games1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Games* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Games* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash games1 [options] @@ -58,11 +58,6 @@ games1 [options] pushtokens remove (-r )... [-p ]... update (-r )... [-p ]... - quest-milestones - claim [-p ]... - quests - accept [-p ]... [-o ] - list [-p ]... [-o ] revisions check [-p ]... [-o ] rooms diff --git a/gen/games1-cli/mkdocs.yml b/gen/games1-cli/mkdocs.yml index 42c83ed44d..fb799cd059 100644 --- a/gen/games1-cli/mkdocs.yml +++ b/gen/games1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games v1.0.12+20190627 +site_name: Games v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-games1-cli site_description: A complete library to interact with Games (protocol v1) @@ -30,9 +30,6 @@ pages: - ['players_list.md', 'Players', 'List'] - ['pushtokens_remove.md', 'Pushtokens', 'Remove'] - ['pushtokens_update.md', 'Pushtokens', 'Update'] -- ['quest-milestones_claim.md', 'Quest Milestones', 'Claim'] -- ['quests_accept.md', 'Quests', 'Accept'] -- ['quests_list.md', 'Quests', 'List'] - ['revisions_check.md', 'Revisions', 'Check'] - ['rooms_create.md', 'Rooms', 'Create'] - ['rooms_decline.md', 'Rooms', 'Decline'] diff --git a/gen/games1-cli/src/main.rs b/gen/games1-cli/src/main.rs index 5e3d84d799..da7b0c70e2 100644 --- a/gen/games1-cli/src/main.rs +++ b/gen/games1-cli/src/main.rs @@ -1365,168 +1365,6 @@ impl<'n> Engine<'n> { } } - fn _quest_milestones_claim(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.quest_milestones().claim(opt.value_of("quest-id").unwrap_or(""), opt.value_of("milestone-id").unwrap_or(""), opt.value_of("request-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - Ok(()) - } - } - } - } - - fn _quests_accept(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.quests().accept(opt.value_of("quest-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "language" => { - call = call.language(value.unwrap_or("")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["language"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _quests_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.quests().list(opt.value_of("player-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "page-token" => { - call = call.page_token(value.unwrap_or("")); - }, - "max-results" => { - call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); - }, - "language" => { - call = call.language(value.unwrap_or("")); - }, - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "language", "max-results"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _revisions_check(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.revisions().check(opt.value_of("client-revision").unwrap_or("")); @@ -3632,31 +3470,6 @@ impl<'n> Engine<'n> { } } }, - ("quest-milestones", Some(opt)) => { - match opt.subcommand() { - ("claim", Some(opt)) => { - call_result = self._quest_milestones_claim(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("quest-milestones".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, - ("quests", Some(opt)) => { - match opt.subcommand() { - ("accept", Some(opt)) => { - call_result = self._quests_accept(opt, dry_run, &mut err); - }, - ("list", Some(opt)) => { - call_result = self._quests_list(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("quests".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("revisions", Some(opt)) => { match opt.subcommand() { ("check", Some(opt)) => { @@ -4316,84 +4129,6 @@ fn main() { ]), ]), - ("quest-milestones", "methods: 'claim'", vec![ - ("claim", - Some(r##"Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user."##), - "Details at http://byron.github.io/google-apis-rs/google_games1_cli/quest-milestones_claim", - vec![ - (Some(r##"quest-id"##), - None, - Some(r##"The ID of the quest."##), - Some(true), - Some(false)), - - (Some(r##"milestone-id"##), - None, - Some(r##"The ID of the milestone."##), - Some(true), - Some(false)), - - (Some(r##"request-id"##), - None, - Some(r##"A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ]), - - ("quests", "methods: 'accept' and 'list'", vec![ - ("accept", - Some(r##"Indicates that the currently authorized user will participate in the quest."##), - "Details at http://byron.github.io/google-apis-rs/google_games1_cli/quests_accept", - vec![ - (Some(r##"quest-id"##), - None, - Some(r##"The ID of the quest."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("list", - Some(r##"Get a list of quests for your application and the currently authenticated player."##), - "Details at http://byron.github.io/google-apis-rs/google_games1_cli/quests_list", - vec![ - (Some(r##"player-id"##), - None, - Some(r##"A player ID. A value of me may be used in place of the authenticated player's ID."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ]), - ("revisions", "methods: 'check'", vec![ ("check", Some(r##"Checks whether the games client is out of date."##), @@ -5099,7 +4834,7 @@ fn main() { let mut app = App::new("games1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200402") .about("The API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_games1_cli") .arg(Arg::with_name("url") diff --git a/gen/games1/Cargo.toml b/gen/games1/Cargo.toml index 3b122915c9..e2b80e2964 100644 --- a/gen/games1/Cargo.toml +++ b/gen/games1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-games1" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/games1" homepage = "https://developers.google.com/games/services/" -documentation = "https://docs.rs/google-games1/1.0.12+20190627" +documentation = "https://docs.rs/google-games1/1.0.13+20200402" license = "MIT" keywords = ["games", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/games1/README.md b/gen/games1/README.md index 489dfffbea..2e5755f068 100644 --- a/gen/games1/README.md +++ b/gen/games1/README.md @@ -5,44 +5,40 @@ DO NOT EDIT ! --> The `google-games1` library allows access to all features of the *Google Games* service. -This documentation was generated from *Games* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Games* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Games* *v1* API can be found at the [official documentation site](https://developers.google.com/games/services/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Games.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.Games.html) ... -* [achievement definitions](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementDefinition.html) - * [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementDefinitionListCall.html) +* [achievement definitions](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementDefinition.html) + * [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementDefinitionListCall.html) * achievements - * [*increment*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementIncrementCall.html), [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementListCall.html), [*reveal*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementRevealCall.html), [*set steps at least*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementSetStepsAtLeastCall.html), [*unlock*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementUnlockCall.html) and [*update multiple*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.AchievementUpdateMultipleCall.html) -* [applications](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Application.html) - * [*get*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ApplicationGetCall.html), [*played*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ApplicationPlayedCall.html) and [*verify*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ApplicationVerifyCall.html) + * [*increment*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementIncrementCall.html), [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementListCall.html), [*reveal*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementRevealCall.html), [*set steps at least*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementSetStepsAtLeastCall.html), [*unlock*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementUnlockCall.html) and [*update multiple*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.AchievementUpdateMultipleCall.html) +* [applications](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.Application.html) + * [*get*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ApplicationGetCall.html), [*played*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ApplicationPlayedCall.html) and [*verify*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ApplicationVerifyCall.html) * events - * [*list by player*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.EventListByPlayerCall.html), [*list definitions*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.EventListDefinitionCall.html) and [*record*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.EventRecordCall.html) -* [leaderboards](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Leaderboard.html) - * [*get*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.LeaderboardGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.LeaderboardListCall.html) + * [*list by player*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.EventListByPlayerCall.html), [*list definitions*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.EventListDefinitionCall.html) and [*record*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.EventRecordCall.html) +* [leaderboards](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.Leaderboard.html) + * [*get*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.LeaderboardGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.LeaderboardListCall.html) * metagame - * [*get metagame config*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.MetagameGetMetagameConfigCall.html) and [*list categories by player*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.MetagameListCategoriesByPlayerCall.html) -* [players](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Player.html) - * [*get*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.PlayerGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.PlayerListCall.html) + * [*get metagame config*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.MetagameGetMetagameConfigCall.html) and [*list categories by player*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.MetagameListCategoriesByPlayerCall.html) +* [players](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.Player.html) + * [*get*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.PlayerGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.PlayerListCall.html) * pushtokens - * [*remove*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.PushtokenRemoveCall.html) and [*update*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.PushtokenUpdateCall.html) -* [quest milestones](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.QuestMilestone.html) - * [*claim*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.QuestMilestoneClaimCall.html) -* [quests](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Quest.html) - * [*accept*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.QuestAcceptCall.html) and [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.QuestListCall.html) + * [*remove*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.PushtokenRemoveCall.html) and [*update*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.PushtokenUpdateCall.html) * revisions - * [*check*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RevisionCheckCall.html) -* [rooms](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Room.html) - * [*create*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomDismisCall.html), [*get*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomGetCall.html), [*join*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomLeaveCall.html), [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomListCall.html) and [*report status*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.RoomReportStatuCall.html) + * [*check*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RevisionCheckCall.html) +* [rooms](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.Room.html) + * [*create*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomDismisCall.html), [*get*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomGetCall.html), [*join*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomLeaveCall.html), [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomListCall.html) and [*report status*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.RoomReportStatuCall.html) * scores - * [*get*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ScoreGetCall.html), [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ScoreListCall.html), [*list window*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ScoreListWindowCall.html), [*submit*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ScoreSubmitCall.html) and [*submit multiple*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.ScoreSubmitMultipleCall.html) -* [snapshots](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Snapshot.html) - * [*get*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.SnapshotGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.SnapshotListCall.html) + * [*get*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ScoreGetCall.html), [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ScoreListCall.html), [*list window*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ScoreListWindowCall.html), [*submit*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ScoreSubmitCall.html) and [*submit multiple*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.ScoreSubmitMultipleCall.html) +* [snapshots](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.Snapshot.html) + * [*get*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.SnapshotGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.SnapshotListCall.html) * turn based matches - * [*cancel*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheCancelCall.html), [*create*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheDismisCall.html), [*finish*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheFinishCall.html), [*get*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheGetCall.html), [*join*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheLeaveCall.html), [*leave turn*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheLeaveTurnCall.html), [*list*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheListCall.html), [*rematch*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheRematchCall.html), [*sync*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheSyncCall.html) and [*take turn*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.TurnBasedMatcheTakeTurnCall.html) + * [*cancel*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheCancelCall.html), [*create*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheDismisCall.html), [*finish*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheFinishCall.html), [*get*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheGetCall.html), [*join*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheLeaveCall.html), [*leave turn*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheLeaveTurnCall.html), [*list*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheListCall.html), [*rematch*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheRematchCall.html), [*sync*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheSyncCall.html) and [*take turn*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.TurnBasedMatcheTakeTurnCall.html) @@ -51,17 +47,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-games1/1.0.12+20190627/google_games1/struct.Games.html)** +* **[Hub](https://docs.rs/google-games1/1.0.13+20200402/google_games1/struct.Games.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.Part.html)** + * **[Parts](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -161,17 +157,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-games1/1.0.12+20190627/google_games1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-games1/1.0.13+20200402/google_games1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-games1/1.0.12+20190627/google_games1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-games1/1.0.13+20200402/google_games1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -181,29 +177,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-games1/1.0.12+20190627/google_games1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-games1/1.0.13+20200402/google_games1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/games1/src/lib.rs b/gen/games1/src/lib.rs index 0e88e04bc3..2f881726ca 100644 --- a/gen/games1/src/lib.rs +++ b/gen/games1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Games* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Games* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/). @@ -27,10 +27,6 @@ //! * [*get*](struct.PlayerGetCall.html) and [*list*](struct.PlayerListCall.html) //! * pushtokens //! * [*remove*](struct.PushtokenRemoveCall.html) and [*update*](struct.PushtokenUpdateCall.html) -//! * [quest milestones](struct.QuestMilestone.html) -//! * [*claim*](struct.QuestMilestoneClaimCall.html) -//! * [quests](struct.Quest.html) -//! * [*accept*](struct.QuestAcceptCall.html) and [*list*](struct.QuestListCall.html) //! * revisions //! * [*check*](struct.RevisionCheckCall.html) //! * [rooms](struct.Room.html) @@ -360,7 +356,7 @@ impl<'a, C, A> Games Games { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/games/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -390,12 +386,6 @@ impl<'a, C, A> Games pub fn pushtokens(&'a self) -> PushtokenMethods<'a, C, A> { PushtokenMethods { hub: &self } } - pub fn quest_milestones(&'a self) -> QuestMilestoneMethods<'a, C, A> { - QuestMilestoneMethods { hub: &self } - } - pub fn quests(&'a self) -> QuestMethods<'a, C, A> { - QuestMethods { hub: &self } - } pub fn revisions(&'a self) -> RevisionMethods<'a, C, A> { RevisionMethods { hub: &self } } @@ -413,7 +403,7 @@ impl<'a, C, A> Games } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -1010,74 +1000,6 @@ pub struct TurnBasedMatchCreateRequest { impl RequestValue for TurnBasedMatchCreateRequest {} -/// This is a JSON template for a Quest resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [accept quests](struct.QuestAcceptCall.html) (response) -/// * [list quests](struct.QuestListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Quest { - /// The description of the quest. - pub description: Option, - /// The banner image URL for the quest. - #[serde(rename="bannerUrl")] - pub banner_url: Option, - /// The timestamp at which the quest was last updated by the user in milliseconds since the epoch in UTC. Only present if the player has accepted the quest. - #[serde(rename="lastUpdatedTimestampMillis")] - pub last_updated_timestamp_millis: Option, - /// The timestamp at which the user accepted the quest in milliseconds since the epoch in UTC. Only present if the player has accepted the quest. - #[serde(rename="acceptedTimestampMillis")] - pub accepted_timestamp_millis: Option, - /// The icon image URL for the quest. - #[serde(rename="iconUrl")] - pub icon_url: Option, - /// The timestamp at which the user should be notified that the quest will end soon in milliseconds since the epoch in UTC. - #[serde(rename="notifyTimestampMillis")] - pub notify_timestamp_millis: Option, - /// The ID of the application this quest is part of. - #[serde(rename="applicationId")] - pub application_id: Option, - /// The ID of the quest. - pub id: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string games#quest. - pub kind: Option, - /// The quest milestones. - pub milestones: Option>, - /// The name of the quest. - pub name: Option, - /// The timestamp at which the quest becomes active in milliseconds since the epoch in UTC. - #[serde(rename="startTimestampMillis")] - pub start_timestamp_millis: Option, - /// The timestamp at which the quest ceases to be active in milliseconds since the epoch in UTC. - #[serde(rename="endTimestampMillis")] - pub end_timestamp_millis: Option, - /// The state of the quest. - /// Possible values are: - /// - "UPCOMING": The quest is upcoming. The user can see the quest, but cannot accept it until it is open. - /// - "OPEN": The quest is currently open and may be accepted at this time. - /// - "ACCEPTED": The user is currently participating in this quest. - /// - "COMPLETED": The user has completed the quest. - /// - "FAILED": The quest was attempted but was not completed before the deadline expired. - /// - "EXPIRED": The quest has expired and was not accepted. - /// - "DELETED": The quest should be deleted from the local database. - pub state: Option, - /// Indicates whether the banner image being returned is a default image, or is game-provided. - #[serde(rename="isDefaultBannerUrl")] - pub is_default_banner_url: Option, - /// Indicates whether the icon image being returned is a default image, or is game-provided. - #[serde(rename="isDefaultIconUrl")] - pub is_default_icon_url: Option, -} - -impl Resource for Quest {} -impl ResponseResult for Quest {} - - /// This is a JSON template for aggregate stats. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1592,36 +1514,31 @@ pub struct RoomLeaveDiagnostics { impl Part for RoomLeaveDiagnostics {} -/// This is a JSON template for a Quest Milestone resource. +/// This is a JSON template for a push token resource. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [claim quest milestones](struct.QuestMilestoneClaimCall.html) (none) +/// * [update pushtokens](struct.PushtokenUpdateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct QuestMilestone { - /// The current state of the milestone. - /// Possible values are: - /// - "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not yet been claimed. - /// - "CLAIMED" - The milestone is complete and has been claimed. - /// - "NOT_COMPLETED" - The milestone has not yet been completed. - /// - "NOT_STARTED" - The milestone is for a quest that has not yet been accepted. - pub state: Option, - /// The completion reward data of the milestone, represented as a Base64-encoded string. This is a developer-specified binary blob with size between 0 and 2 KB before encoding. - #[serde(rename="completionRewardData")] - pub completion_reward_data: Option, - /// The milestone ID. - pub id: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string games#questMilestone. +pub struct PushToken { + /// Uniquely identifies the type of this resource. Value is always the fixed string games#pushToken. pub kind: Option, - /// The criteria of the milestone. - pub criteria: Option>, + /// The revision of the client SDK used by your application, in the same format that's used by revisions.check. Used to send backward compatible messages. Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: + /// - IOS - Push token is for iOS + #[serde(rename="clientRevision")] + pub client_revision: Option, + /// Unique identifier for this push token. + pub id: Option, + /// The preferred language for notifications that are sent using this token. + pub language: Option, } -impl Resource for QuestMilestone {} +impl RequestValue for PushToken {} +impl Resource for PushToken {} /// This is a JSON template for a rematch response. @@ -1741,51 +1658,6 @@ pub struct Played { impl Part for Played {} -/// This is a JSON template for a Quest Criterion Contribution resource. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct QuestContribution { - /// The formatted value of the contribution as a string. Format depends on the configuration for the associated event definition in the Play Games Developer Console. - #[serde(rename="formattedValue")] - pub formatted_value: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string games#questContribution. - pub kind: Option, - /// The value of the contribution. - pub value: Option, -} - -impl Part for QuestContribution {} - - -/// This is a JSON template for a Quest Criterion resource. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct QuestCriterion { - /// The ID of the event the criterion corresponds to. - #[serde(rename="eventId")] - pub event_id: Option, - /// The total number of times the associated event must be incremented for the player to complete this quest. - #[serde(rename="completionContribution")] - pub completion_contribution: Option, - /// The value of the event associated with this quest at the time that the quest was accepted. This value may change if event increments that took place before the start of quest are uploaded after the quest starts. - /// There will be no initialPlayerProgress until the player has accepted the quest. - #[serde(rename="initialPlayerProgress")] - pub initial_player_progress: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string games#questCriterion. - pub kind: Option, - /// The number of increments the player has made toward the completion count event increments required to complete the quest. This value will not exceed the completion contribution. - /// There will be no currentContribution until the player has accepted the quest. - #[serde(rename="currentContribution")] - pub current_contribution: Option, -} - -impl Part for QuestCriterion {} - - /// This is a JSON template for a list of rooms. /// /// # Activities @@ -2146,9 +2018,12 @@ impl Part for PeerSessionDiagnostics {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProfileSettings { + /// Whether the player's friends list is visible to the game. + #[serde(rename="friendsListVisibility")] + pub friends_list_visibility: Option, /// Uniquely identifies the type of this resource. Value is always the fixed string games#profileSettings. pub kind: Option, - /// The player's current profile visibility. This field is visible to both 1P and 3P APIs. + /// no description provided #[serde(rename="profileVisible")] pub profile_visible: Option, } @@ -2156,27 +2031,22 @@ pub struct ProfileSettings { impl Part for ProfileSettings {} -/// This is a JSON template for a list of quest objects. +/// This is a JSON template for an event period update resource. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list quests](struct.QuestListCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct QuestListResponse { - /// Token corresponding to the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The quests. - pub items: Option>, - /// Uniquely identifies the type of this resource. Value is always the fixed string games#questListResponse. +pub struct EventPeriodUpdate { + /// Uniquely identifies the type of this resource. Value is always the fixed string games#eventPeriodUpdate. pub kind: Option, + /// The time period being covered by this update. + #[serde(rename="timePeriod")] + pub time_period: Option, + /// The updates being made for this time period. + pub updates: Option>, } -impl ResponseResult for QuestListResponse {} +impl Part for EventPeriodUpdate {} /// This is a JSON template for a ListByPlayer response. @@ -2262,33 +2132,6 @@ pub struct PlayerAchievementListResponse { impl ResponseResult for PlayerAchievementListResponse {} -/// This is a JSON template for a push token resource. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [update pushtokens](struct.PushtokenUpdateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PushToken { - /// Uniquely identifies the type of this resource. Value is always the fixed string games#pushToken. - pub kind: Option, - /// The revision of the client SDK used by your application, in the same format that's used by revisions.check. Used to send backward compatible messages. Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: - /// - IOS - Push token is for iOS - #[serde(rename="clientRevision")] - pub client_revision: Option, - /// Unique identifier for this push token. - pub id: Option, - /// The preferred language for notifications that are sent using this token. - pub language: Option, -} - -impl RequestValue for PushToken {} -impl Resource for PushToken {} - - /// This is a JSON template for a player leaderboard score object. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2681,24 +2524,6 @@ pub struct RoomP2PStatus { impl Part for RoomP2PStatus {} -/// This is a JSON template for an event period update resource. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventPeriodUpdate { - /// Uniquely identifies the type of this resource. Value is always the fixed string games#eventPeriodUpdate. - pub kind: Option, - /// The time period being covered by this update. - #[serde(rename="timePeriod")] - pub time_period: Option, - /// The updates being made for this time period. - pub updates: Option>, -} - -impl Part for EventPeriodUpdate {} - - /// This is a JSON template for a list of achievement update requests. /// /// # Activities @@ -3042,12 +2867,18 @@ pub struct Player { /// The url to the portrait mode player banner image. #[serde(rename="bannerUrlPortrait")] pub banner_url_portrait: Option, + /// no description provided + #[serde(rename="playerStattus")] + pub player_stattus: Option, /// The player's profile settings. Controls whether or not the player's profile is visible to other players. #[serde(rename="profileSettings")] pub profile_settings: Option, /// An object to represent Play Game experience information for the player. #[serde(rename="experienceInfo")] pub experience_info: Option, + /// The friend status of the given player, relative to the requester. This is unset if the player is not sharing their friends list with the game. + #[serde(rename="friendStatus")] + pub friend_status: Option, /// The url to the landscape mode player banner image. #[serde(rename="bannerUrlLandscape")] pub banner_url_landscape: Option, @@ -3270,6 +3101,24 @@ impl<'a, C, A> AchievementMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates multiple achievements for the currently authenticated player. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn update_multiple(&self, request: AchievementUpdateMultipleRequest) -> AchievementUpdateMultipleCall<'a, C, A> { + AchievementUpdateMultipleCall { + hub: self.hub, + _request: request, + _builtin_game_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified. @@ -3289,24 +3138,6 @@ impl<'a, C, A> AchievementMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates multiple achievements for the currently authenticated player. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn update_multiple(&self, request: AchievementUpdateMultipleRequest) -> AchievementUpdateMultipleCall<'a, C, A> { - AchievementUpdateMultipleCall { - hub: self.hub, - _request: request, - _builtin_game_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player. @@ -3576,7 +3407,7 @@ impl<'a, C, A> PlayerMethods<'a, C, A> { -/// A builder providing access to all methods supported on *quest* resources. +/// A builder providing access to all methods supported on *score* resources. /// It is not used directly, but through the `Games` hub. /// /// # Example @@ -3600,32 +3431,38 @@ impl<'a, C, A> PlayerMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `accept(...)` and `list(...)` +/// // like `get(...)`, `list(...)`, `list_window(...)`, `submit(...)` and `submit_multiple(...)` /// // to build up your call. -/// let rb = hub.quests(); +/// let rb = hub.scores(); /// # } /// ``` -pub struct QuestMethods<'a, C, A> +pub struct ScoreMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Games, } -impl<'a, C, A> MethodsBuilder for QuestMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for ScoreMethods<'a, C, A> {} -impl<'a, C, A> QuestMethods<'a, C, A> { +impl<'a, C, A> ScoreMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Indicates that the currently authorized user will participate in the quest. + /// Lists the scores in a leaderboard, starting from the top. /// /// # Arguments /// - /// * `questId` - The ID of the quest. - pub fn accept(&self, quest_id: &str) -> QuestAcceptCall<'a, C, A> { - QuestAcceptCall { + /// * `leaderboardId` - The ID of the leaderboard. + /// * `collection` - The collection of scores you're requesting. + /// * `timeSpan` - The time span for the scores and ranks you're requesting. + pub fn list(&self, leaderboard_id: &str, collection: &str, time_span: &str) -> ScoreListCall<'a, C, A> { + ScoreListCall { hub: self.hub, - _quest_id: quest_id.to_string(), + _leaderboard_id: leaderboard_id.to_string(), + _collection: collection.to_string(), + _time_span: time_span.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), _language: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -3635,15 +3472,86 @@ impl<'a, C, A> QuestMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get a list of quests for your application and the currently authenticated player. + /// Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. + /// NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'. /// /// # Arguments /// /// * `playerId` - A player ID. A value of me may be used in place of the authenticated player's ID. - pub fn list(&self, player_id: &str) -> QuestListCall<'a, C, A> { - QuestListCall { + /// * `leaderboardId` - The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. + /// * `timeSpan` - The time span for the scores and ranks you're requesting. + pub fn get(&self, player_id: &str, leaderboard_id: &str, time_span: &str) -> ScoreGetCall<'a, C, A> { + ScoreGetCall { hub: self.hub, _player_id: player_id.to_string(), + _leaderboard_id: leaderboard_id.to_string(), + _time_span: time_span.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _language: Default::default(), + _include_rank_type: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Submits a score to the specified leaderboard. + /// + /// # Arguments + /// + /// * `leaderboardId` - The ID of the leaderboard. + /// * `score` - The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. + pub fn submit(&self, leaderboard_id: &str, score: &str) -> ScoreSubmitCall<'a, C, A> { + ScoreSubmitCall { + hub: self.hub, + _leaderboard_id: leaderboard_id.to_string(), + _score: score.to_string(), + _score_tag: Default::default(), + _language: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Submits multiple scores to leaderboards. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn submit_multiple(&self, request: PlayerScoreSubmissionList) -> ScoreSubmitMultipleCall<'a, C, A> { + ScoreSubmitMultipleCall { + hub: self.hub, + _request: request, + _language: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the scores in a leaderboard around (and including) a player's score. + /// + /// # Arguments + /// + /// * `leaderboardId` - The ID of the leaderboard. + /// * `collection` - The collection of scores you're requesting. + /// * `timeSpan` - The time span for the scores and ranks you're requesting. + pub fn list_window(&self, leaderboard_id: &str, collection: &str, time_span: &str) -> ScoreListWindowCall<'a, C, A> { + ScoreListWindowCall { + hub: self.hub, + _leaderboard_id: leaderboard_id.to_string(), + _collection: collection.to_string(), + _time_span: time_span.to_string(), + _return_top_if_absent: Default::default(), + _results_above: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _language: Default::default(), @@ -3846,6 +3754,26 @@ impl<'a, C, A> TurnBasedMatcheMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `matchId` - The ID of the match. + pub fn finish(&self, request: TurnBasedMatchResults, match_id: &str) -> TurnBasedMatcheFinishCall<'a, C, A> { + TurnBasedMatcheFinishCall { + hub: self.hub, + _request: request, + _match_id: match_id.to_string(), + _language: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Create a turn-based match. @@ -3920,26 +3848,6 @@ impl<'a, C, A> TurnBasedMatcheMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `matchId` - The ID of the match. - pub fn finish(&self, request: TurnBasedMatchResults, match_id: &str) -> TurnBasedMatcheFinishCall<'a, C, A> { - TurnBasedMatcheFinishCall { - hub: self.hub, - _request: request, - _match_id: match_id.to_string(), - _language: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Leave a turn-based match when it is not the current player's turn, without canceling the match. @@ -4296,7 +4204,7 @@ impl<'a, C, A> RoomMethods<'a, C, A> { -/// A builder providing access to all methods supported on *score* resources. +/// A builder providing access to all methods supported on *achievementDefinition* resources. /// It is not used directly, but through the `Games` hub. /// /// # Example @@ -4320,127 +4228,27 @@ impl<'a, C, A> RoomMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)`, `list(...)`, `list_window(...)`, `submit(...)` and `submit_multiple(...)` +/// // like `list(...)` /// // to build up your call. -/// let rb = hub.scores(); +/// let rb = hub.achievement_definitions(); /// # } /// ``` -pub struct ScoreMethods<'a, C, A> +pub struct AchievementDefinitionMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Games, } -impl<'a, C, A> MethodsBuilder for ScoreMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for AchievementDefinitionMethods<'a, C, A> {} -impl<'a, C, A> ScoreMethods<'a, C, A> { +impl<'a, C, A> AchievementDefinitionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Submits a score to the specified leaderboard. - /// - /// # Arguments - /// - /// * `leaderboardId` - The ID of the leaderboard. - /// * `score` - The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. - pub fn submit(&self, leaderboard_id: &str, score: &str) -> ScoreSubmitCall<'a, C, A> { - ScoreSubmitCall { + /// Lists all the achievement definitions for your application. + pub fn list(&self) -> AchievementDefinitionListCall<'a, C, A> { + AchievementDefinitionListCall { hub: self.hub, - _leaderboard_id: leaderboard_id.to_string(), - _score: score.to_string(), - _score_tag: Default::default(), - _language: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the scores in a leaderboard, starting from the top. - /// - /// # Arguments - /// - /// * `leaderboardId` - The ID of the leaderboard. - /// * `collection` - The collection of scores you're requesting. - /// * `timeSpan` - The time span for the scores and ranks you're requesting. - pub fn list(&self, leaderboard_id: &str, collection: &str, time_span: &str) -> ScoreListCall<'a, C, A> { - ScoreListCall { - hub: self.hub, - _leaderboard_id: leaderboard_id.to_string(), - _collection: collection.to_string(), - _time_span: time_span.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _language: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. - /// NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'. - /// - /// # Arguments - /// - /// * `playerId` - A player ID. A value of me may be used in place of the authenticated player's ID. - /// * `leaderboardId` - The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. - /// * `timeSpan` - The time span for the scores and ranks you're requesting. - pub fn get(&self, player_id: &str, leaderboard_id: &str, time_span: &str) -> ScoreGetCall<'a, C, A> { - ScoreGetCall { - hub: self.hub, - _player_id: player_id.to_string(), - _leaderboard_id: leaderboard_id.to_string(), - _time_span: time_span.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _language: Default::default(), - _include_rank_type: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Submits multiple scores to leaderboards. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn submit_multiple(&self, request: PlayerScoreSubmissionList) -> ScoreSubmitMultipleCall<'a, C, A> { - ScoreSubmitMultipleCall { - hub: self.hub, - _request: request, - _language: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the scores in a leaderboard around (and including) a player's score. - /// - /// # Arguments - /// - /// * `leaderboardId` - The ID of the leaderboard. - /// * `collection` - The collection of scores you're requesting. - /// * `timeSpan` - The time span for the scores and ranks you're requesting. - pub fn list_window(&self, leaderboard_id: &str, collection: &str, time_span: &str) -> ScoreListWindowCall<'a, C, A> { - ScoreListWindowCall { - hub: self.hub, - _leaderboard_id: leaderboard_id.to_string(), - _collection: collection.to_string(), - _time_span: time_span.to_string(), - _return_top_if_absent: Default::default(), - _results_above: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _language: Default::default(), @@ -4529,70 +4337,6 @@ impl<'a, C, A> PushtokenMethods<'a, C, A> { -/// A builder providing access to all methods supported on *revision* resources. -/// It is not used directly, but through the `Games` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_games1 as games1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use games1::Games; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `check(...)` -/// // to build up your call. -/// let rb = hub.revisions(); -/// # } -/// ``` -pub struct RevisionMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, -} - -impl<'a, C, A> MethodsBuilder for RevisionMethods<'a, C, A> {} - -impl<'a, C, A> RevisionMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Checks whether the games client is out of date. - /// - /// # Arguments - /// - /// * `clientRevision` - The revision of the client SDK used by your application. Format: - /// [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: - /// - /// - "ANDROID" - Client is running the Android SDK. - /// - "IOS" - Client is running the iOS SDK. - /// - "WEB_APP" - Client is running as a Web App. - pub fn check(&self, client_revision: &str) -> RevisionCheckCall<'a, C, A> { - RevisionCheckCall { - hub: self.hub, - _client_revision: client_revision.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *event* resources. /// It is not used directly, but through the `Games` hub. /// @@ -4683,7 +4427,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { -/// A builder providing access to all methods supported on *questMilestone* resources. +/// A builder providing access to all methods supported on *revision* resources. /// It is not used directly, but through the `Games` hub. /// /// # Example @@ -4707,93 +4451,37 @@ impl<'a, C, A> EventMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `claim(...)` +/// // like `check(...)` /// // to build up your call. -/// let rb = hub.quest_milestones(); +/// let rb = hub.revisions(); /// # } /// ``` -pub struct QuestMilestoneMethods<'a, C, A> +pub struct RevisionMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Games, } -impl<'a, C, A> MethodsBuilder for QuestMilestoneMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for RevisionMethods<'a, C, A> {} -impl<'a, C, A> QuestMilestoneMethods<'a, C, A> { +impl<'a, C, A> RevisionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user. + /// Checks whether the games client is out of date. /// /// # Arguments /// - /// * `questId` - The ID of the quest. - /// * `milestoneId` - The ID of the milestone. - /// * `requestId` - A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly. - pub fn claim(&self, quest_id: &str, milestone_id: &str, request_id: &str) -> QuestMilestoneClaimCall<'a, C, A> { - QuestMilestoneClaimCall { + /// * `clientRevision` - The revision of the client SDK used by your application. Format: + /// [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: + /// + /// - "ANDROID" - Client is running the Android SDK. + /// - "IOS" - Client is running the iOS SDK. + /// - "WEB_APP" - Client is running as a Web App. + pub fn check(&self, client_revision: &str) -> RevisionCheckCall<'a, C, A> { + RevisionCheckCall { hub: self.hub, - _quest_id: quest_id.to_string(), - _milestone_id: milestone_id.to_string(), - _request_id: request_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *achievementDefinition* resources. -/// It is not used directly, but through the `Games` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_games1 as games1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use games1::Games; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `list(...)` -/// // to build up your call. -/// let rb = hub.achievement_definitions(); -/// # } -/// ``` -pub struct AchievementDefinitionMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, -} - -impl<'a, C, A> MethodsBuilder for AchievementDefinitionMethods<'a, C, A> {} - -impl<'a, C, A> AchievementDefinitionMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Lists all the achievement definitions for your application. - pub fn list(&self) -> AchievementDefinitionListCall<'a, C, A> { - AchievementDefinitionListCall { - hub: self.hub, - _page_token: Default::default(), - _max_results: Default::default(), - _language: Default::default(), + _client_revision: client_revision.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5361,6 +5049,256 @@ impl<'a, C, A> AchievementIncrementCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AchievementUpdateMultipleRequest::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.achievements().update_multiple(req) +/// .builtin_game_id("no") +/// .doit(); +/// # } +/// ``` +pub struct AchievementUpdateMultipleCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Games, + _request: AchievementUpdateMultipleRequest, + _builtin_game_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AchievementUpdateMultipleCall<'a, C, A> {} + +impl<'a, C, A> AchievementUpdateMultipleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AchievementUpdateMultipleResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "games.achievements.updateMultiple", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + if let Some(value) = self._builtin_game_id { + params.push(("builtinGameId", value.to_string())); + } + for &field in ["alt", "builtinGameId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "achievements/updateMultiple"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AchievementUpdateMultipleRequest) -> AchievementUpdateMultipleCall<'a, C, A> { + self._request = new_value; + self + } + /// Override used only by built-in games in Play Games application. + /// + /// Sets the *builtin game id* query property to the given value. + pub fn builtin_game_id(mut self, new_value: &str) -> AchievementUpdateMultipleCall<'a, C, A> { + self._builtin_game_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AchievementUpdateMultipleCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AchievementUpdateMultipleCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AchievementUpdateMultipleCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified. /// /// A builder for the *setStepsAtLeast* method supported by a *achievement* resource. @@ -5613,256 +5551,6 @@ impl<'a, C, A> AchievementSetStepsAtLeastCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AchievementUpdateMultipleRequest::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.achievements().update_multiple(req) -/// .builtin_game_id("justo") -/// .doit(); -/// # } -/// ``` -pub struct AchievementUpdateMultipleCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _request: AchievementUpdateMultipleRequest, - _builtin_game_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AchievementUpdateMultipleCall<'a, C, A> {} - -impl<'a, C, A> AchievementUpdateMultipleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AchievementUpdateMultipleResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.achievements.updateMultiple", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - if let Some(value) = self._builtin_game_id { - params.push(("builtinGameId", value.to_string())); - } - for &field in ["alt", "builtinGameId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "achievements/updateMultiple"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AchievementUpdateMultipleRequest) -> AchievementUpdateMultipleCall<'a, C, A> { - self._request = new_value; - self - } - /// Override used only by built-in games in Play Games application. - /// - /// Sets the *builtin game id* query property to the given value. - pub fn builtin_game_id(mut self, new_value: &str) -> AchievementUpdateMultipleCall<'a, C, A> { - self._builtin_game_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AchievementUpdateMultipleCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AchievementUpdateMultipleCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AchievementUpdateMultipleCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player. /// /// A builder for the *reveal* method supported by a *achievement* resource. @@ -7873,10 +7561,10 @@ impl<'a, C, A> PlayerGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Indicates that the currently authorized user will participate in the quest. +/// Lists the scores in a leaderboard, starting from the top. /// -/// A builder for the *accept* method supported by a *quest* resource. -/// It is not used directly, but through a `QuestMethods` instance. +/// A builder for the *list* method supported by a *score* resource. +/// It is not used directly, but through a `ScoreMethods` instance. /// /// # Example /// @@ -7900,29 +7588,35 @@ impl<'a, C, A> PlayerGetCall<'a, C, A> where C: BorrowMut, A: oau /// // 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.quests().accept("questId") -/// .language("dolore") +/// let result = hub.scores().list("leaderboardId", "collection", "timeSpan") +/// .page_token("aliquyam") +/// .max_results(-73) +/// .language("Lorem") /// .doit(); /// # } /// ``` -pub struct QuestAcceptCall<'a, C, A> +pub struct ScoreListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Games, - _quest_id: String, + _leaderboard_id: String, + _collection: String, + _time_span: String, + _page_token: Option, + _max_results: Option, _language: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for QuestAcceptCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ScoreListCall<'a, C, A> {} -impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Quest)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LeaderboardScores)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -7930,14 +7624,22 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "games.quests.accept", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("questId", self._quest_id.to_string())); + dlg.begin(MethodInfo { id: "games.scores.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("leaderboardId", self._leaderboard_id.to_string())); + params.push(("collection", self._collection.to_string())); + params.push(("timeSpan", self._time_span.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } if let Some(value) = self._language { params.push(("language", value.to_string())); } - for &field in ["alt", "questId", "language"].iter() { + for &field in ["alt", "leaderboardId", "collection", "timeSpan", "pageToken", "maxResults", "language"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7949,12 +7651,12 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "quests/{questId}/accept"; + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores/{collection}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{questId}", "questId")].iter() { + for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId"), ("{collection}", "collection")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -7965,8 +7667,8 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["questId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["collection", "leaderboardId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -7996,7 +7698,7 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -8049,20 +7751,54 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o } - /// The ID of the quest. + /// The ID of the leaderboard. /// - /// Sets the *quest id* path property to the given value. + /// Sets the *leaderboard id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn quest_id(mut self, new_value: &str) -> QuestAcceptCall<'a, C, A> { - self._quest_id = new_value.to_string(); + pub fn leaderboard_id(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { + self._leaderboard_id = new_value.to_string(); + self + } + /// The collection of scores you're requesting. + /// + /// Sets the *collection* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn collection(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { + self._collection = new_value.to_string(); + self + } + /// The time span for the scores and ranks you're requesting. + /// + /// Sets the *time span* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn time_span(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { + self._time_span = new_value.to_string(); + self + } + /// The token returned by the previous request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ScoreListCall<'a, C, A> { + self._max_results = Some(new_value); self } /// The preferred language to use for strings returned by this method. /// /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> QuestAcceptCall<'a, C, A> { + pub fn language(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { self._language = Some(new_value.to_string()); self } @@ -8072,7 +7808,7 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestAcceptCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8093,7 +7829,7 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestAcceptCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ScoreListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8113,7 +7849,7 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestAcceptCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ScoreListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8125,10 +7861,11 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o } -/// Get a list of quests for your application and the currently authenticated player. +/// Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. +/// NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'. /// -/// A builder for the *list* method supported by a *quest* resource. -/// It is not used directly, but through a `QuestMethods` instance. +/// A builder for the *get* method supported by a *score* resource. +/// It is not used directly, but through a `ScoreMethods` instance. /// /// # Example /// @@ -8152,33 +7889,37 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o /// // 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.quests().list("playerId") -/// .page_token("aliquyam") -/// .max_results(-73) -/// .language("Lorem") +/// let result = hub.scores().get("playerId", "leaderboardId", "timeSpan") +/// .page_token("et") +/// .max_results(-40) +/// .language("sanctus") +/// .include_rank_type("et") /// .doit(); /// # } /// ``` -pub struct QuestListCall<'a, C, A> +pub struct ScoreGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Games, _player_id: String, + _leaderboard_id: String, + _time_span: String, _page_token: Option, _max_results: Option, _language: Option, + _include_rank_type: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for QuestListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ScoreGetCall<'a, C, A> {} -impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ScoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, QuestListResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, PlayerLeaderboardScoreListResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -8186,10 +7927,12 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "games.quests.list", + dlg.begin(MethodInfo { id: "games.scores.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); params.push(("playerId", self._player_id.to_string())); + params.push(("leaderboardId", self._leaderboard_id.to_string())); + params.push(("timeSpan", self._time_span.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -8199,7 +7942,10 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._language { params.push(("language", value.to_string())); } - for &field in ["alt", "playerId", "pageToken", "maxResults", "language"].iter() { + if let Some(value) = self._include_rank_type { + params.push(("includeRankType", value.to_string())); + } + for &field in ["alt", "playerId", "leaderboardId", "timeSpan", "pageToken", "maxResults", "language", "includeRankType"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8211,12 +7957,12 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "players/{playerId}/quests"; + let mut url = self.hub._base_url.clone() + "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{playerId}", "playerId")].iter() { + for &(find_this, param_name) in [("{playerId}", "playerId"), ("{leaderboardId}", "leaderboardId"), ("{timeSpan}", "timeSpan")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -8227,8 +7973,8 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["playerId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["timeSpan", "leaderboardId", "playerId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8317,38 +8063,65 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn player_id(mut self, new_value: &str) -> QuestListCall<'a, C, A> { + pub fn player_id(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { self._player_id = new_value.to_string(); self } + /// The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. + /// + /// Sets the *leaderboard id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn leaderboard_id(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { + self._leaderboard_id = new_value.to_string(); + self + } + /// The time span for the scores and ranks you're requesting. + /// + /// Sets the *time span* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn time_span(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { + self._time_span = new_value.to_string(); + self + } /// The token returned by the previous request. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> QuestListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The maximum number of quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50). + /// The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> QuestListCall<'a, C, A> { + pub fn max_results(mut self, new_value: i32) -> ScoreGetCall<'a, C, A> { self._max_results = Some(new_value); self } /// The preferred language to use for strings returned by this method. /// /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> QuestListCall<'a, C, A> { + pub fn language(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { self._language = Some(new_value.to_string()); self } + /// The types of ranks to return. If the parameter is omitted, no ranks will be returned. + /// + /// Sets the *include rank type* query property to the given value. + pub fn include_rank_type(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { + self._include_rank_type = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8369,7 +8142,7 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ScoreGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8389,7 +8162,857 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ScoreGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Submits a score to the specified leaderboard. +/// +/// A builder for the *submit* method supported by a *score* resource. +/// It is not used directly, but through a `ScoreMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_games1 as games1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use games1::Games; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.scores().submit("leaderboardId", "score") +/// .score_tag("consetetur") +/// .language("ut") +/// .doit(); +/// # } +/// ``` +pub struct ScoreSubmitCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Games, + _leaderboard_id: String, + _score: String, + _score_tag: Option, + _language: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ScoreSubmitCall<'a, C, A> {} + +impl<'a, C, A> ScoreSubmitCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, PlayerScoreResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "games.scores.submit", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("leaderboardId", self._leaderboard_id.to_string())); + params.push(("score", self._score.to_string())); + if let Some(value) = self._score_tag { + params.push(("scoreTag", value.to_string())); + } + if let Some(value) = self._language { + params.push(("language", value.to_string())); + } + for &field in ["alt", "leaderboardId", "score", "scoreTag", "language"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["leaderboardId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the leaderboard. + /// + /// Sets the *leaderboard id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn leaderboard_id(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { + self._leaderboard_id = new_value.to_string(); + self + } + /// The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. + /// + /// Sets the *score* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn score(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { + self._score = new_value.to_string(); + self + } + /// Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. + /// + /// Sets the *score tag* query property to the given value. + pub fn score_tag(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { + self._score_tag = Some(new_value.to_string()); + self + } + /// The preferred language to use for strings returned by this method. + /// + /// Sets the *language* query property to the given value. + pub fn language(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { + self._language = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreSubmitCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ScoreSubmitCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ScoreSubmitCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Submits multiple scores to leaderboards. +/// +/// A builder for the *submitMultiple* method supported by a *score* resource. +/// It is not used directly, but through a `ScoreMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_games1 as games1; +/// use games1::PlayerScoreSubmissionList; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use games1::Games; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = PlayerScoreSubmissionList::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.scores().submit_multiple(req) +/// .language("ea") +/// .doit(); +/// # } +/// ``` +pub struct ScoreSubmitMultipleCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Games, + _request: PlayerScoreSubmissionList, + _language: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ScoreSubmitMultipleCall<'a, C, A> {} + +impl<'a, C, A> ScoreSubmitMultipleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, PlayerScoreListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "games.scores.submitMultiple", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + if let Some(value) = self._language { + params.push(("language", value.to_string())); + } + for &field in ["alt", "language"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "leaderboards/scores"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: PlayerScoreSubmissionList) -> ScoreSubmitMultipleCall<'a, C, A> { + self._request = new_value; + self + } + /// The preferred language to use for strings returned by this method. + /// + /// Sets the *language* query property to the given value. + pub fn language(mut self, new_value: &str) -> ScoreSubmitMultipleCall<'a, C, A> { + self._language = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreSubmitMultipleCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ScoreSubmitMultipleCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ScoreSubmitMultipleCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the scores in a leaderboard around (and including) a player's score. +/// +/// A builder for the *listWindow* method supported by a *score* resource. +/// It is not used directly, but through a `ScoreMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_games1 as games1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use games1::Games; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.scores().list_window("leaderboardId", "collection", "timeSpan") +/// .return_top_if_absent(true) +/// .results_above(-23) +/// .page_token("consetetur") +/// .max_results(-52) +/// .language("voluptua.") +/// .doit(); +/// # } +/// ``` +pub struct ScoreListWindowCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Games, + _leaderboard_id: String, + _collection: String, + _time_span: String, + _return_top_if_absent: Option, + _results_above: Option, + _page_token: Option, + _max_results: Option, + _language: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ScoreListWindowCall<'a, C, A> {} + +impl<'a, C, A> ScoreListWindowCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LeaderboardScores)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "games.scores.listWindow", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("leaderboardId", self._leaderboard_id.to_string())); + params.push(("collection", self._collection.to_string())); + params.push(("timeSpan", self._time_span.to_string())); + if let Some(value) = self._return_top_if_absent { + params.push(("returnTopIfAbsent", value.to_string())); + } + if let Some(value) = self._results_above { + params.push(("resultsAbove", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._language { + params.push(("language", value.to_string())); + } + for &field in ["alt", "leaderboardId", "collection", "timeSpan", "returnTopIfAbsent", "resultsAbove", "pageToken", "maxResults", "language"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/window/{collection}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId"), ("{collection}", "collection")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["collection", "leaderboardId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the leaderboard. + /// + /// Sets the *leaderboard id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn leaderboard_id(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { + self._leaderboard_id = new_value.to_string(); + self + } + /// The collection of scores you're requesting. + /// + /// Sets the *collection* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn collection(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { + self._collection = new_value.to_string(); + self + } + /// The time span for the scores and ranks you're requesting. + /// + /// Sets the *time span* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn time_span(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { + self._time_span = new_value.to_string(); + self + } + /// True if the top scores should be returned when the player is not in the leaderboard. Defaults to true. + /// + /// Sets the *return top if absent* query property to the given value. + pub fn return_top_if_absent(mut self, new_value: bool) -> ScoreListWindowCall<'a, C, A> { + self._return_top_if_absent = Some(new_value); + self + } + /// The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults. + /// + /// Sets the *results above* query property to the given value. + pub fn results_above(mut self, new_value: i32) -> ScoreListWindowCall<'a, C, A> { + self._results_above = Some(new_value); + self + } + /// The token returned by the previous request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ScoreListWindowCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// The preferred language to use for strings returned by this method. + /// + /// Sets the *language* query property to the given value. + pub fn language(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { + self._language = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreListWindowCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ScoreListWindowCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ScoreListWindowCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8429,7 +9052,7 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.snapshots().get("snapshotId") -/// .language("et") +/// .language("gubergren") /// .doit(); /// # } /// ``` @@ -8681,9 +9304,9 @@ impl<'a, C, A> SnapshotGetCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.snapshots().list("playerId") -/// .page_token("et") -/// .max_results(-40) -/// .language("sanctus") +/// .page_token("sit") +/// .max_results(-26) +/// .language("diam") /// .doit(); /// # } /// ``` @@ -9186,11 +9809,11 @@ impl<'a, C, A> TurnBasedMatcheDismisCall<'a, C, A> where C: BorrowMut TurnBasedMatcheSyncCall<'a, C, A> where C: BorrowMut TurnBasedMatcheDeclineCall<'a, C, A> where C: BorrowMut TurnBasedMatcheGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TurnBasedMatchResults::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.turn_based_matches().finish(req, "matchId") +/// .language("clita") +/// .doit(); +/// # } +/// ``` +pub struct TurnBasedMatcheFinishCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Games, + _request: TurnBasedMatchResults, + _match_id: String, + _language: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TurnBasedMatcheFinishCall<'a, C, A> {} + +impl<'a, C, A> TurnBasedMatcheFinishCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TurnBasedMatch)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "games.turnBasedMatches.finish", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("matchId", self._match_id.to_string())); + if let Some(value) = self._language { + params.push(("language", value.to_string())); + } + for &field in ["alt", "matchId", "language"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "turnbasedmatches/{matchId}/finish"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{matchId}", "matchId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["matchId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TurnBasedMatchResults) -> TurnBasedMatcheFinishCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the match. + /// + /// Sets the *match id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn match_id(mut self, new_value: &str) -> TurnBasedMatcheFinishCall<'a, C, A> { + self._match_id = new_value.to_string(); + self + } + /// The preferred language to use for strings returned by this method. + /// + /// Sets the *language* query property to the given value. + pub fn language(mut self, new_value: &str) -> TurnBasedMatcheFinishCall<'a, C, A> { + self._language = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TurnBasedMatcheFinishCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TurnBasedMatcheFinishCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TurnBasedMatcheFinishCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Create a turn-based match. /// /// A builder for the *create* method supported by a *turnBasedMatche* resource. @@ -10219,7 +11125,7 @@ impl<'a, C, A> TurnBasedMatcheCreateCall<'a, C, A> where C: BorrowMut TurnBasedMatcheJoinCall<'a, C, A> where C: BorrowMut TurnBasedMatcheCancelCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TurnBasedMatchResults::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.turn_based_matches().finish(req, "matchId") -/// .language("rebum.") -/// .doit(); -/// # } -/// ``` -pub struct TurnBasedMatcheFinishCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _request: TurnBasedMatchResults, - _match_id: String, - _language: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TurnBasedMatcheFinishCall<'a, C, A> {} - -impl<'a, C, A> TurnBasedMatcheFinishCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TurnBasedMatch)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.turnBasedMatches.finish", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("matchId", self._match_id.to_string())); - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - for &field in ["alt", "matchId", "language"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "turnbasedmatches/{matchId}/finish"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{matchId}", "matchId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["matchId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: TurnBasedMatchResults) -> TurnBasedMatcheFinishCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the match. - /// - /// Sets the *match id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn match_id(mut self, new_value: &str) -> TurnBasedMatcheFinishCall<'a, C, A> { - self._match_id = new_value.to_string(); - self - } - /// The preferred language to use for strings returned by this method. - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> TurnBasedMatcheFinishCall<'a, C, A> { - self._language = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TurnBasedMatcheFinishCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TurnBasedMatcheFinishCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TurnBasedMatcheFinishCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Leave a turn-based match when it is not the current player's turn, without canceling the match. /// /// A builder for the *leave* method supported by a *turnBasedMatche* resource. @@ -11259,7 +11882,7 @@ impl<'a, C, A> TurnBasedMatcheFinishCall<'a, C, A> where C: BorrowMut TurnBasedMatcheLeaveCall<'a, C, A> where C: BorrowMut TurnBasedMatcheListCall<'a, C, A> where C: BorrowMut TurnBasedMatcheTakeTurnCall<'a, C, A> where C: BorrowMut ApplicationVerifyCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.applications().get("applicationId") -/// .platform_type("nonumy") -/// .language("kasd") +/// .platform_type("gubergren") +/// .language("aliquyam") /// .doit(); /// # } /// ``` @@ -12829,7 +13452,7 @@ impl<'a, C, A> ApplicationGetCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.applications().played() -/// .builtin_game_id("sanctus") +/// .builtin_game_id("eos") /// .doit(); /// # } /// ``` @@ -13037,7 +13660,7 @@ impl<'a, C, A> ApplicationPlayedCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.rooms().get("roomId") -/// .language("At") +/// .language("sea") /// .doit(); /// # } /// ``` @@ -13295,7 +13918,7 @@ impl<'a, C, A> RoomGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.rooms().leave(req, "roomId") -/// .language("invidunt") +/// .language("ipsum") /// .doit(); /// # } /// ``` @@ -13572,9 +14195,9 @@ impl<'a, C, A> RoomLeaveCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.rooms().list() -/// .page_token("ea") -/// .max_results(-95) -/// .language("rebum.") +/// .page_token("aliquyam") +/// .max_results(-69) +/// .language("sit") /// .doit(); /// # } /// ``` @@ -13821,7 +14444,7 @@ impl<'a, C, A> RoomListCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.rooms().report_status(req, "roomId") -/// .language("nonumy") +/// .language("ut") /// .doit(); /// # } /// ``` @@ -14104,7 +14727,7 @@ impl<'a, C, A> RoomReportStatuCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.rooms().create(req) -/// .language("sed") +/// .language("justo") /// .doit(); /// # } /// ``` @@ -14348,7 +14971,7 @@ impl<'a, C, A> RoomCreateCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.rooms().decline("roomId") -/// .language("sit") +/// .language("amet") /// .doit(); /// # } /// ``` @@ -14835,7 +15458,7 @@ impl<'a, C, A> RoomDismisCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.rooms().join(req, "roomId") -/// .language("labore") +/// .language("diam") /// .doit(); /// # } /// ``` @@ -15084,10 +15707,10 @@ impl<'a, C, A> RoomJoinCall<'a, C, A> where C: BorrowMut, A: oaut } -/// Submits a score to the specified leaderboard. +/// Lists all the achievement definitions for your application. /// -/// A builder for the *submit* method supported by a *score* resource. -/// It is not used directly, but through a `ScoreMethods` instance. +/// A builder for the *list* method supported by a *achievementDefinition* resource. +/// It is not used directly, but through a `AchievementDefinitionMethods` instance. /// /// # Example /// @@ -15111,296 +15734,17 @@ impl<'a, C, A> RoomJoinCall<'a, C, A> where C: BorrowMut, A: oaut /// // 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.scores().submit("leaderboardId", "score") -/// .score_tag("gubergren") -/// .language("aliquyam") +/// let result = hub.achievement_definitions().list() +/// .page_token("justo") +/// .max_results(-57) +/// .language("clita") /// .doit(); /// # } /// ``` -pub struct ScoreSubmitCall<'a, C, A> +pub struct AchievementDefinitionListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Games, - _leaderboard_id: String, - _score: String, - _score_tag: Option, - _language: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ScoreSubmitCall<'a, C, A> {} - -impl<'a, C, A> ScoreSubmitCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, PlayerScoreResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.scores.submit", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("leaderboardId", self._leaderboard_id.to_string())); - params.push(("score", self._score.to_string())); - if let Some(value) = self._score_tag { - params.push(("scoreTag", value.to_string())); - } - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - for &field in ["alt", "leaderboardId", "score", "scoreTag", "language"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["leaderboardId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the leaderboard. - /// - /// Sets the *leaderboard id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn leaderboard_id(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { - self._leaderboard_id = new_value.to_string(); - self - } - /// The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. - /// - /// Sets the *score* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn score(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { - self._score = new_value.to_string(); - self - } - /// Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. - /// - /// Sets the *score tag* query property to the given value. - pub fn score_tag(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { - self._score_tag = Some(new_value.to_string()); - self - } - /// The preferred language to use for strings returned by this method. - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> ScoreSubmitCall<'a, C, A> { - self._language = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreSubmitCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ScoreSubmitCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ScoreSubmitCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the scores in a leaderboard, starting from the top. -/// -/// A builder for the *list* method supported by a *score* resource. -/// It is not used directly, but through a `ScoreMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_games1 as games1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use games1::Games; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.scores().list("leaderboardId", "collection", "timeSpan") -/// .page_token("labore") -/// .max_results(-54) -/// .language("aliquyam") -/// .doit(); -/// # } -/// ``` -pub struct ScoreListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _leaderboard_id: String, - _collection: String, - _time_span: String, _page_token: Option, _max_results: Option, _language: Option, @@ -15409,13 +15753,13 @@ pub struct ScoreListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ScoreListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AchievementDefinitionListCall<'a, C, A> {} -impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AchievementDefinitionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LeaderboardScores)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, AchievementDefinitionsListResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -15423,12 +15767,9 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "games.scores.list", + dlg.begin(MethodInfo { id: "games.achievementDefinitions.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("leaderboardId", self._leaderboard_id.to_string())); - params.push(("collection", self._collection.to_string())); - params.push(("timeSpan", self._time_span.to_string())); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } @@ -15438,7 +15779,7 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._language { params.push(("language", value.to_string())); } - for &field in ["alt", "leaderboardId", "collection", "timeSpan", "pageToken", "maxResults", "language"].iter() { + for &field in ["alt", "pageToken", "maxResults", "language"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15450,32 +15791,11 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores/{collection}"; + let mut url = self.hub._base_url.clone() + "achievements"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId"), ("{collection}", "collection")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["collection", "leaderboardId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } let url = hyper::Url::parse_with_params(&url, params).unwrap(); @@ -15550,54 +15870,24 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau } - /// The ID of the leaderboard. - /// - /// Sets the *leaderboard id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn leaderboard_id(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { - self._leaderboard_id = new_value.to_string(); - self - } - /// The collection of scores you're requesting. - /// - /// Sets the *collection* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn collection(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { - self._collection = new_value.to_string(); - self - } - /// The time span for the scores and ranks you're requesting. - /// - /// Sets the *time span* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn time_span(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { - self._time_span = new_value.to_string(); - self - } /// The token returned by the previous request. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> AchievementDefinitionListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + /// The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> ScoreListCall<'a, C, A> { + pub fn max_results(mut self, new_value: i32) -> AchievementDefinitionListCall<'a, C, A> { self._max_results = Some(new_value); self } /// The preferred language to use for strings returned by this method. /// /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> ScoreListCall<'a, C, A> { + pub fn language(mut self, new_value: &str) -> AchievementDefinitionListCall<'a, C, A> { self._language = Some(new_value.to_string()); self } @@ -15607,7 +15897,7 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AchievementDefinitionListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -15628,7 +15918,7 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ScoreListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AchievementDefinitionListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -15648,894 +15938,7 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ScoreListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. -/// NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'. -/// -/// A builder for the *get* method supported by a *score* resource. -/// It is not used directly, but through a `ScoreMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_games1 as games1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use games1::Games; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.scores().get("playerId", "leaderboardId", "timeSpan") -/// .page_token("ut") -/// .max_results(-70) -/// .language("est") -/// .include_rank_type("amet") -/// .doit(); -/// # } -/// ``` -pub struct ScoreGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _player_id: String, - _leaderboard_id: String, - _time_span: String, - _page_token: Option, - _max_results: Option, - _language: Option, - _include_rank_type: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ScoreGetCall<'a, C, A> {} - -impl<'a, C, A> ScoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, PlayerLeaderboardScoreListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.scores.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); - params.push(("playerId", self._player_id.to_string())); - params.push(("leaderboardId", self._leaderboard_id.to_string())); - params.push(("timeSpan", self._time_span.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - if let Some(value) = self._include_rank_type { - params.push(("includeRankType", value.to_string())); - } - for &field in ["alt", "playerId", "leaderboardId", "timeSpan", "pageToken", "maxResults", "language", "includeRankType"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{playerId}", "playerId"), ("{leaderboardId}", "leaderboardId"), ("{timeSpan}", "timeSpan")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["timeSpan", "leaderboardId", "playerId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// A player ID. A value of me may be used in place of the authenticated player's ID. - /// - /// Sets the *player id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn player_id(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { - self._player_id = new_value.to_string(); - self - } - /// The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. - /// - /// Sets the *leaderboard id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn leaderboard_id(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { - self._leaderboard_id = new_value.to_string(); - self - } - /// The time span for the scores and ranks you're requesting. - /// - /// Sets the *time span* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn time_span(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { - self._time_span = new_value.to_string(); - self - } - /// The token returned by the previous request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> ScoreGetCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// The preferred language to use for strings returned by this method. - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { - self._language = Some(new_value.to_string()); - self - } - /// The types of ranks to return. If the parameter is omitted, no ranks will be returned. - /// - /// Sets the *include rank type* query property to the given value. - pub fn include_rank_type(mut self, new_value: &str) -> ScoreGetCall<'a, C, A> { - self._include_rank_type = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ScoreGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ScoreGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Submits multiple scores to leaderboards. -/// -/// A builder for the *submitMultiple* method supported by a *score* resource. -/// It is not used directly, but through a `ScoreMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_games1 as games1; -/// use games1::PlayerScoreSubmissionList; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use games1::Games; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = PlayerScoreSubmissionList::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.scores().submit_multiple(req) -/// .language("accusam") -/// .doit(); -/// # } -/// ``` -pub struct ScoreSubmitMultipleCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _request: PlayerScoreSubmissionList, - _language: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ScoreSubmitMultipleCall<'a, C, A> {} - -impl<'a, C, A> ScoreSubmitMultipleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, PlayerScoreListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.scores.submitMultiple", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - for &field in ["alt", "language"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "leaderboards/scores"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: PlayerScoreSubmissionList) -> ScoreSubmitMultipleCall<'a, C, A> { - self._request = new_value; - self - } - /// The preferred language to use for strings returned by this method. - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> ScoreSubmitMultipleCall<'a, C, A> { - self._language = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreSubmitMultipleCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ScoreSubmitMultipleCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ScoreSubmitMultipleCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the scores in a leaderboard around (and including) a player's score. -/// -/// A builder for the *listWindow* method supported by a *score* resource. -/// It is not used directly, but through a `ScoreMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_games1 as games1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use games1::Games; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.scores().list_window("leaderboardId", "collection", "timeSpan") -/// .return_top_if_absent(false) -/// .results_above(-63) -/// .page_token("invidunt") -/// .max_results(-87) -/// .language("dolores") -/// .doit(); -/// # } -/// ``` -pub struct ScoreListWindowCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _leaderboard_id: String, - _collection: String, - _time_span: String, - _return_top_if_absent: Option, - _results_above: Option, - _page_token: Option, - _max_results: Option, - _language: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ScoreListWindowCall<'a, C, A> {} - -impl<'a, C, A> ScoreListWindowCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LeaderboardScores)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.scores.listWindow", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); - params.push(("leaderboardId", self._leaderboard_id.to_string())); - params.push(("collection", self._collection.to_string())); - params.push(("timeSpan", self._time_span.to_string())); - if let Some(value) = self._return_top_if_absent { - params.push(("returnTopIfAbsent", value.to_string())); - } - if let Some(value) = self._results_above { - params.push(("resultsAbove", value.to_string())); - } - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - for &field in ["alt", "leaderboardId", "collection", "timeSpan", "returnTopIfAbsent", "resultsAbove", "pageToken", "maxResults", "language"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/window/{collection}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId"), ("{collection}", "collection")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["collection", "leaderboardId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the leaderboard. - /// - /// Sets the *leaderboard id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn leaderboard_id(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { - self._leaderboard_id = new_value.to_string(); - self - } - /// The collection of scores you're requesting. - /// - /// Sets the *collection* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn collection(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { - self._collection = new_value.to_string(); - self - } - /// The time span for the scores and ranks you're requesting. - /// - /// Sets the *time span* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn time_span(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { - self._time_span = new_value.to_string(); - self - } - /// True if the top scores should be returned when the player is not in the leaderboard. Defaults to true. - /// - /// Sets the *return top if absent* query property to the given value. - pub fn return_top_if_absent(mut self, new_value: bool) -> ScoreListWindowCall<'a, C, A> { - self._return_top_if_absent = Some(new_value); - self - } - /// The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults. - /// - /// Sets the *results above* query property to the given value. - pub fn results_above(mut self, new_value: i32) -> ScoreListWindowCall<'a, C, A> { - self._results_above = Some(new_value); - self - } - /// The token returned by the previous request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> ScoreListWindowCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// The preferred language to use for strings returned by this method. - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> ScoreListWindowCall<'a, C, A> { - self._language = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ScoreListWindowCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ScoreListWindowCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ScoreListWindowCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> AchievementDefinitionListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -17001,230 +16404,6 @@ impl<'a, C, A> PushtokenUpdateCall<'a, C, A> where C: BorrowMut, } -/// Checks whether the games client is out of date. -/// -/// A builder for the *check* method supported by a *revision* resource. -/// It is not used directly, but through a `RevisionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_games1 as games1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use games1::Games; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.revisions().check("clientRevision") -/// .doit(); -/// # } -/// ``` -pub struct RevisionCheckCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _client_revision: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RevisionCheckCall<'a, C, A> {} - -impl<'a, C, A> RevisionCheckCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, RevisionCheckResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.revisions.check", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("clientRevision", self._client_revision.to_string())); - for &field in ["alt", "clientRevision"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "revisions/check"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The revision of the client SDK used by your application. Format: - /// [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: - /// - /// - "ANDROID" - Client is running the Android SDK. - /// - "IOS" - Client is running the iOS SDK. - /// - "WEB_APP" - Client is running as a Web App. - /// - /// Sets the *client revision* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn client_revision(mut self, new_value: &str) -> RevisionCheckCall<'a, C, A> { - self._client_revision = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RevisionCheckCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RevisionCheckCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RevisionCheckCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns a list of the event definitions in this application. /// /// A builder for the *listDefinitions* method supported by a *event* resource. @@ -17253,9 +16432,9 @@ impl<'a, C, A> RevisionCheckCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().list_definitions() -/// .page_token("voluptua.") -/// .max_results(-19) -/// .language("sed") +/// .page_token("invidunt") +/// .max_results(-87) +/// .language("dolores") /// .doit(); /// # } /// ``` @@ -17502,7 +16681,7 @@ impl<'a, C, A> EventListDefinitionCall<'a, C, A> where C: BorrowMut EventRecordCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.events().list_by_player() -/// .page_token("ea") -/// .max_results(-17) -/// .language("et") +/// .page_token("voluptua.") +/// .max_results(-19) +/// .language("sed") /// .doit(); /// # } /// ``` @@ -17961,10 +17140,10 @@ impl<'a, C, A> EventListByPlayerCall<'a, C, A> where C: BorrowMut } -/// Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user. +/// Checks whether the games client is out of date. /// -/// A builder for the *claim* method supported by a *questMilestone* resource. -/// It is not used directly, but through a `QuestMilestoneMethods` instance. +/// A builder for the *check* method supported by a *revision* resource. +/// It is not used directly, but through a `RevisionMethods` instance. /// /// # Example /// @@ -17988,29 +17167,27 @@ impl<'a, C, A> EventListByPlayerCall<'a, C, A> where C: BorrowMut /// // 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.quest_milestones().claim("questId", "milestoneId", "requestId") +/// let result = hub.revisions().check("clientRevision") /// .doit(); /// # } /// ``` -pub struct QuestMilestoneClaimCall<'a, C, A> +pub struct RevisionCheckCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Games, - _quest_id: String, - _milestone_id: String, - _request_id: String, + _client_revision: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for QuestMilestoneClaimCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for RevisionCheckCall<'a, C, A> {} -impl<'a, C, A> QuestMilestoneClaimCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> RevisionCheckCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, RevisionCheckResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -18018,275 +17195,11 @@ impl<'a, C, A> QuestMilestoneClaimCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "games.questMilestones.claim", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("questId", self._quest_id.to_string())); - params.push(("milestoneId", self._milestone_id.to_string())); - params.push(("requestId", self._request_id.to_string())); - for &field in ["questId", "milestoneId", "requestId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "quests/{questId}/milestones/{milestoneId}/claim"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{questId}", "questId"), ("{milestoneId}", "milestoneId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["milestoneId", "questId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the quest. - /// - /// Sets the *quest id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn quest_id(mut self, new_value: &str) -> QuestMilestoneClaimCall<'a, C, A> { - self._quest_id = new_value.to_string(); - self - } - /// The ID of the milestone. - /// - /// Sets the *milestone id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn milestone_id(mut self, new_value: &str) -> QuestMilestoneClaimCall<'a, C, A> { - self._milestone_id = new_value.to_string(); - self - } - /// A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly. - /// - /// Sets the *request id* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request_id(mut self, new_value: &str) -> QuestMilestoneClaimCall<'a, C, A> { - self._request_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestMilestoneClaimCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestMilestoneClaimCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestMilestoneClaimCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all the achievement definitions for your application. -/// -/// A builder for the *list* method supported by a *achievementDefinition* resource. -/// It is not used directly, but through a `AchievementDefinitionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_games1 as games1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use games1::Games; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Games::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.achievement_definitions().list() -/// .page_token("invidunt") -/// .max_results(-15) -/// .language("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct AchievementDefinitionListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Games, - _page_token: Option, - _max_results: Option, - _language: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AchievementDefinitionListCall<'a, C, A> {} - -impl<'a, C, A> AchievementDefinitionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AchievementDefinitionsListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "games.achievementDefinitions.list", + dlg.begin(MethodInfo { id: "games.revisions.check", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - for &field in ["alt", "pageToken", "maxResults", "language"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("clientRevision", self._client_revision.to_string())); + for &field in ["alt", "clientRevision"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -18298,7 +17211,7 @@ impl<'a, C, A> AchievementDefinitionListCall<'a, C, A> where C: BorrowMut AchievementDefinitionListCall<'a, C, A> where C: BorrowMut AchievementDefinitionListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. + /// Sets the *client revision* query property to the given value. /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> AchievementDefinitionListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// The preferred language to use for strings returned by this method. - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> AchievementDefinitionListCall<'a, C, A> { - self._language = Some(new_value.to_string()); + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn client_revision(mut self, new_value: &str) -> RevisionCheckCall<'a, C, A> { + self._client_revision = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -18404,7 +17311,7 @@ impl<'a, C, A> AchievementDefinitionListCall<'a, C, A> where C: BorrowMut AchievementDefinitionListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RevisionCheckCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18425,7 +17332,7 @@ impl<'a, C, A> AchievementDefinitionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AchievementDefinitionListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> RevisionCheckCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18445,7 +17352,7 @@ impl<'a, C, A> AchievementDefinitionListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> AchievementDefinitionListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> RevisionCheckCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/gamesconfiguration1_configuration-cli/Cargo.toml b/gen/gamesconfiguration1_configuration-cli/Cargo.toml index dc9df40062..60e5cf19b7 100644 --- a/gen/gamesconfiguration1_configuration-cli/Cargo.toml +++ b/gen/gamesconfiguration1_configuration-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-gamesconfiguration1_configuration-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Configuration (protocol v1configuration)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration-cli" -homepage = "https://developers.google.com/games/services" +homepage = "https://developers.google.com/games/" documentation = "http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli" license = "MIT" keywords = ["gamesConfiguration", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-gamesconfiguration1_configuration] path = "../gamesconfiguration1_configuration" -version = "1.0.12+20190627" +version = "1.0.13+20200402" diff --git a/gen/gamesconfiguration1_configuration-cli/README.md b/gen/gamesconfiguration1_configuration-cli/README.md index 61ed9e3c89..03dd74324d 100644 --- a/gen/gamesconfiguration1_configuration-cli/README.md +++ b/gen/gamesconfiguration1_configuration-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *Games Configuration* API can be found at the -[official documentation site](https://developers.google.com/games/services). +[official documentation site](https://developers.google.com/games/). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Games Configuration* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Games Configuration* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash gamesconfiguration1-configuration [options] @@ -34,16 +34,14 @@ gamesconfiguration1-configuration [options] get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] image-configurations - upload (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] + upload (-u simple -f [-m ]) [-p ]... [-o ] leaderboard-configurations delete [-p ]... get [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] gamesconfiguration1-configuration --help diff --git a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml index f8207b7797..886fef1eac 100644 --- a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml +++ b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Configuration v1.0.12+20190627 +site_name: Games Configuration v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-gamesconfiguration1_configuration-cli site_description: A complete library to interact with Games Configuration (protocol v1configuration) @@ -13,14 +13,12 @@ pages: - ['achievement-configurations_get.md', 'Achievement Configurations', 'Get'] - ['achievement-configurations_insert.md', 'Achievement Configurations', 'Insert'] - ['achievement-configurations_list.md', 'Achievement Configurations', 'List'] -- ['achievement-configurations_patch.md', 'Achievement Configurations', 'Patch'] - ['achievement-configurations_update.md', 'Achievement Configurations', 'Update'] - ['image-configurations_upload.md', 'Image Configurations', 'Upload'] - ['leaderboard-configurations_delete.md', 'Leaderboard Configurations', 'Delete'] - ['leaderboard-configurations_get.md', 'Leaderboard Configurations', 'Get'] - ['leaderboard-configurations_insert.md', 'Leaderboard Configurations', 'Insert'] - ['leaderboard-configurations_list.md', 'Leaderboard Configurations', 'List'] -- ['leaderboard-configurations_patch.md', 'Leaderboard Configurations', 'Patch'] - ['leaderboard-configurations_update.md', 'Leaderboard Configurations', 'Update'] theme: readthedocs diff --git a/gen/gamesconfiguration1_configuration-cli/src/main.rs b/gen/gamesconfiguration1_configuration-cli/src/main.rs index 787b7bf183..0dca5ac290 100644 --- a/gen/gamesconfiguration1_configuration-cli/src/main.rs +++ b/gen/gamesconfiguration1_configuration-cli/src/main.rs @@ -303,108 +303,6 @@ impl<'n> Engine<'n> { } } - fn _achievement_configurations_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "achievement-type" => Some(("achievementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "steps-to-unlock" => Some(("stepsToUnlock", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "initial-state" => Some(("initialState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "token" => Some(("token", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.kind" => Some(("draft.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.description.kind" => Some(("draft.description.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.icon-url" => Some(("draft.iconUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.point-value" => Some(("draft.pointValue", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "draft.sort-rank" => Some(("draft.sortRank", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "draft.name.kind" => Some(("draft.name.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.kind" => Some(("published.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.description.kind" => Some(("published.description.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.icon-url" => Some(("published.iconUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.point-value" => Some(("published.pointValue", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "published.sort-rank" => Some(("published.sortRank", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "published.name.kind" => Some(("published.name.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["achievement-type", "description", "draft", "icon-url", "id", "initial-state", "kind", "name", "point-value", "published", "sort-rank", "steps-to-unlock", "token"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::AchievementConfiguration = json::value::from_value(object).unwrap(); - let mut call = self.hub.achievement_configurations().patch(request, opt.value_of("achievement-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _achievement_configurations_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -532,7 +430,7 @@ impl<'n> Engine<'n> { } } let vals = opt.values_of("mode").unwrap().collect::>(); - let protocol = calltype_from_str(vals[0], ["simple", "resumable"].iter().map(|&v| v.to_string()).collect(), err); + let protocol = calltype_from_str(vals[0], ["simple"].iter().map(|&v| v.to_string()).collect(), err); let mut input_file = input_file_from_opts(vals[1], err); let mime_type = input_mime_from_opts(opt.value_of("mime").unwrap_or("application/octet-stream"), err); if dry_run { @@ -548,7 +446,6 @@ impl<'n> Engine<'n> { }; match match protocol { CallType::Upload(UploadProtocol::Simple) => call.upload(input_file.unwrap(), mime_type.unwrap()), - CallType::Upload(UploadProtocol::Resumable) => call.upload_resumable(input_file.unwrap(), mime_type.unwrap()), CallType::Standard => unreachable!() } { Err(api_err) => Err(DoitError::ApiError(api_err)), @@ -834,122 +731,6 @@ impl<'n> Engine<'n> { } } - fn _leaderboard_configurations_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "score-order" => Some(("scoreOrder", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "score-min" => Some(("scoreMin", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "token" => Some(("token", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "score-max" => Some(("scoreMax", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.currency-code" => Some(("published.scoreFormat.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.suffix.many.kind" => Some(("published.scoreFormat.suffix.many.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.suffix.two.kind" => Some(("published.scoreFormat.suffix.two.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.suffix.one.kind" => Some(("published.scoreFormat.suffix.one.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.suffix.few.kind" => Some(("published.scoreFormat.suffix.few.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.suffix.zero.kind" => Some(("published.scoreFormat.suffix.zero.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.suffix.other.kind" => Some(("published.scoreFormat.suffix.other.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.number-format-type" => Some(("published.scoreFormat.numberFormatType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.score-format.num-decimal-places" => Some(("published.scoreFormat.numDecimalPlaces", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "published.icon-url" => Some(("published.iconUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.kind" => Some(("published.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.name.kind" => Some(("published.name.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "published.sort-rank" => Some(("published.sortRank", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "draft.score-format.currency-code" => Some(("draft.scoreFormat.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.suffix.many.kind" => Some(("draft.scoreFormat.suffix.many.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.suffix.two.kind" => Some(("draft.scoreFormat.suffix.two.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.suffix.one.kind" => Some(("draft.scoreFormat.suffix.one.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.suffix.few.kind" => Some(("draft.scoreFormat.suffix.few.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.suffix.zero.kind" => Some(("draft.scoreFormat.suffix.zero.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.suffix.other.kind" => Some(("draft.scoreFormat.suffix.other.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.number-format-type" => Some(("draft.scoreFormat.numberFormatType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.score-format.num-decimal-places" => Some(("draft.scoreFormat.numDecimalPlaces", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "draft.icon-url" => Some(("draft.iconUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.kind" => Some(("draft.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.name.kind" => Some(("draft.name.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "draft.sort-rank" => Some(("draft.sortRank", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["currency-code", "draft", "few", "icon-url", "id", "kind", "many", "name", "num-decimal-places", "number-format-type", "one", "other", "published", "score-format", "score-max", "score-min", "score-order", "sort-rank", "suffix", "token", "two", "zero"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::LeaderboardConfiguration = json::value::from_value(object).unwrap(); - let mut call = self.hub.leaderboard_configurations().patch(request, opt.value_of("leaderboard-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _leaderboard_configurations_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1085,9 +866,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._achievement_configurations_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._achievement_configurations_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._achievement_configurations_update(opt, dry_run, &mut err); }, @@ -1122,9 +900,6 @@ impl<'n> Engine<'n> { ("list", Some(opt)) => { call_result = self._leaderboard_configurations_list(opt, dry_run, &mut err); }, - ("patch", Some(opt)) => { - call_result = self._leaderboard_configurations_patch(opt, dry_run, &mut err); - }, ("update", Some(opt)) => { call_result = self._leaderboard_configurations_update(opt, dry_run, &mut err); }, @@ -1189,12 +964,15 @@ impl<'n> Engine<'n> { let engine = Engine { opt: opt, hub: api::GamesConfiguration::new(client, auth), - gp: vec!["alt", "fields", "key", "oauth-token", "pretty-print", "quota-user", "user-ip"], + gp: vec!["$-xgafv", "access-token", "alt", "callback", "fields", "key", "oauth-token", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), ("oauth-token", "oauth_token"), ("pretty-print", "prettyPrint"), ("quota-user", "quotaUser"), - ("user-ip", "userIp"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), ] }; @@ -1217,7 +995,7 @@ fn main() { let mut exit_status = 0i32; let upload_value_names = ["mode", "file"]; let arg_data = [ - ("achievement-configurations", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("achievement-configurations", "methods: 'delete', 'get', 'insert', 'list' and 'update'", vec![ ("delete", Some(r##"Delete the achievement configuration with the given ID."##), "Details at http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli/achievement-configurations_delete", @@ -1300,34 +1078,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Update the metadata of the achievement configuration with the given ID. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli/achievement-configurations_patch", - vec![ - (Some(r##"achievement-id"##), - None, - Some(r##"The ID of the achievement used by this method."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1383,7 +1133,7 @@ fn main() { (Some(r##"mode"##), Some(r##"u"##), - Some(r##"Specify the upload protocol (simple|resumable) and the file to upload"##), + Some(r##"Specify the upload protocol (simple) and the file to upload"##), Some(true), Some(true)), @@ -1401,7 +1151,7 @@ fn main() { ]), ]), - ("leaderboard-configurations", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("leaderboard-configurations", "methods: 'delete', 'get', 'insert', 'list' and 'update'", vec![ ("delete", Some(r##"Delete the leaderboard configuration with the given ID."##), "Details at http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli/leaderboard-configurations_delete", @@ -1484,34 +1234,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Update the metadata of the leaderboard configuration with the given ID. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli/leaderboard-configurations_patch", - vec![ - (Some(r##"leaderboard-id"##), - None, - Some(r##"The ID of the leaderboard."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1552,8 +1274,8 @@ fn main() { let mut app = App::new("gamesconfiguration1-configuration") .author("Sebastian Thiel ") - .version("1.0.12+20190627") - .about("The Publishing API for Google Play Game Services.") + .version("1.0.13+20200402") + .about("The Google Play Game Services Publishing API allows developers to configure their games in Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gamesconfiguration1_configuration_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/gamesconfiguration1_configuration/Cargo.toml b/gen/gamesconfiguration1_configuration/Cargo.toml index 1f5b8d90a0..81c999bdf0 100644 --- a/gen/gamesconfiguration1_configuration/Cargo.toml +++ b/gen/gamesconfiguration1_configuration/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gamesconfiguration1_configuration" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Configuration (protocol v1configuration)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration" -homepage = "https://developers.google.com/games/services" -documentation = "https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627" +homepage = "https://developers.google.com/games/" +documentation = "https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402" license = "MIT" keywords = ["gamesConfiguration", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/gamesconfiguration1_configuration/README.md b/gen/gamesconfiguration1_configuration/README.md index 2a30dcabda..e1a5f4d081 100644 --- a/gen/gamesconfiguration1_configuration/README.md +++ b/gen/gamesconfiguration1_configuration/README.md @@ -5,25 +5,25 @@ DO NOT EDIT ! --> The `google-gamesconfiguration1_configuration` library allows access to all features of the *Google Games Configuration* service. -This documentation was generated from *Games Configuration* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Games Configuration* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Games Configuration* *v1_configuration* API can be found at the -[official documentation site](https://developers.google.com/games/services). +[official documentation site](https://developers.google.com/games/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html) ... -* [achievement configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.AchievementConfiguration.html) - * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.AchievementConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.AchievementConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.AchievementConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.AchievementConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.AchievementConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.AchievementConfigurationUpdateCall.html) -* [image configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.ImageConfiguration.html) - * [*upload*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) -* [leaderboard configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.LeaderboardConfiguration.html) - * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationUpdateCall.html) +* [achievement configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.AchievementConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.AchievementConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.AchievementConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.AchievementConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.AchievementConfigurationListCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.AchievementConfigurationUpdateCall.html) +* [image configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.ImageConfiguration.html) + * [*upload*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [leaderboard configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.LeaderboardConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationListCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationUpdateCall.html) Upload supported by ... -* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) @@ -31,17 +31,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html)** +* **[Hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -55,12 +55,11 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.achievement_configurations().list(...).doit() -let r = hub.achievement_configurations().update(...).doit() -let r = hub.achievement_configurations().insert(...).doit() let r = hub.achievement_configurations().get(...).doit() -let r = hub.achievement_configurations().patch(...).doit() +let r = hub.achievement_configurations().list(...).doit() +let r = hub.achievement_configurations().insert(...).doit() let r = hub.achievement_configurations().delete(...).doit() +let r = hub.achievement_configurations().update(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -139,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-gamesconfiguration1_configuration/1.0.12+20190627/google_gamesconfiguration1_configuration/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesconfiguration1_configuration/1.0.13+20200402/google_gamesconfiguration1_configuration/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/gamesconfiguration1_configuration/src/lib.rs b/gen/gamesconfiguration1_configuration/src/lib.rs index 733a3753f5..05b6e13433 100644 --- a/gen/gamesconfiguration1_configuration/src/lib.rs +++ b/gen/gamesconfiguration1_configuration/src/lib.rs @@ -2,21 +2,21 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Configuration* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Games Configuration* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Games Configuration* *v1_configuration* API can be found at the -//! [official documentation site](https://developers.google.com/games/services). +//! [official documentation site](https://developers.google.com/games/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/gamesconfiguration1_configuration). //! # Features //! //! Handle the following *Resources* with ease from the central [hub](struct.GamesConfiguration.html) ... //! //! * [achievement configurations](struct.AchievementConfiguration.html) -//! * [*delete*](struct.AchievementConfigurationDeleteCall.html), [*get*](struct.AchievementConfigurationGetCall.html), [*insert*](struct.AchievementConfigurationInsertCall.html), [*list*](struct.AchievementConfigurationListCall.html), [*patch*](struct.AchievementConfigurationPatchCall.html) and [*update*](struct.AchievementConfigurationUpdateCall.html) +//! * [*delete*](struct.AchievementConfigurationDeleteCall.html), [*get*](struct.AchievementConfigurationGetCall.html), [*insert*](struct.AchievementConfigurationInsertCall.html), [*list*](struct.AchievementConfigurationListCall.html) and [*update*](struct.AchievementConfigurationUpdateCall.html) //! * [image configurations](struct.ImageConfiguration.html) //! * [*upload*](struct.ImageConfigurationUploadCall.html) //! * [leaderboard configurations](struct.LeaderboardConfiguration.html) -//! * [*delete*](struct.LeaderboardConfigurationDeleteCall.html), [*get*](struct.LeaderboardConfigurationGetCall.html), [*insert*](struct.LeaderboardConfigurationInsertCall.html), [*list*](struct.LeaderboardConfigurationListCall.html), [*patch*](struct.LeaderboardConfigurationPatchCall.html) and [*update*](struct.LeaderboardConfigurationUpdateCall.html) +//! * [*delete*](struct.LeaderboardConfigurationDeleteCall.html), [*get*](struct.LeaderboardConfigurationGetCall.html), [*insert*](struct.LeaderboardConfigurationInsertCall.html), [*list*](struct.LeaderboardConfigurationListCall.html) and [*update*](struct.LeaderboardConfigurationUpdateCall.html) //! //! //! Upload supported by ... @@ -55,12 +55,11 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.achievement_configurations().list(...).doit() -//! let r = hub.achievement_configurations().update(...).doit() -//! let r = hub.achievement_configurations().insert(...).doit() //! let r = hub.achievement_configurations().get(...).doit() -//! let r = hub.achievement_configurations().patch(...).doit() +//! let r = hub.achievement_configurations().list(...).doit() +//! let r = hub.achievement_configurations().insert(...).doit() //! let r = hub.achievement_configurations().delete(...).doit() +//! let r = hub.achievement_configurations().update(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -334,8 +333,8 @@ impl<'a, C, A> GamesConfiguration GamesConfiguration { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), - _base_url: "https://www.googleapis.com/games/v1configuration/".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), + _base_url: "https://www.googleapis.com/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } } @@ -351,7 +350,7 @@ impl<'a, C, A> GamesConfiguration } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -359,7 +358,7 @@ impl<'a, C, A> GamesConfiguration } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/games/v1configuration/`. + /// It defaults to `https://www.googleapis.com/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -379,7 +378,7 @@ impl<'a, C, A> GamesConfiguration // ############ // SCHEMAS ### // ########## -/// This is a JSON template for a number format resource. +/// A number format resource. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -389,29 +388,29 @@ pub struct GamesNumberFormatConfiguration { #[serde(rename="currencyCode")] pub currency_code: Option, /// The formatting for the number. - /// Possible values are: - /// - "NUMERIC" - Numbers are formatted to have no digits or a fixed number of digits after the decimal point according to locale. An optional custom unit can be added. - /// - "TIME_DURATION" - Numbers are formatted to hours, minutes and seconds. - /// - "CURRENCY" - Numbers are formatted to currency according to locale. #[serde(rename="numberFormatType")] pub number_format_type: Option, /// The number of decimal places for number. Only used for NUMERIC format type. #[serde(rename="numDecimalPlaces")] pub num_decimal_places: Option, - /// An optional suffix for the NUMERIC format type. These strings follow the same plural rules as all Android string resources. + /// An optional suffix for the NUMERIC format type. These strings follow the + /// same + /// plural rules as all Android string resources. pub suffix: Option, } impl Part for GamesNumberFormatConfiguration {} -/// This is a JSON template for a localized string bundle resource. +/// A localized string bundle resource. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LocalizedStringBundle { - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#localizedStringBundle. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string gamesConfiguration#localizedStringBundle. pub kind: Option, /// The locale strings. pub translations: Option>, @@ -420,7 +419,7 @@ pub struct LocalizedStringBundle { impl Part for LocalizedStringBundle {} -/// This is a JSON template for a localized string resource. +/// A localized string resource. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -428,7 +427,8 @@ impl Part for LocalizedStringBundle {} pub struct LocalizedString { /// The locale string. pub locale: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#localizedString. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string gamesConfiguration#localizedString. pub kind: Option, /// The string value. pub value: Option, @@ -437,7 +437,7 @@ pub struct LocalizedString { impl Part for LocalizedString {} -/// This is a JSON template for a ListConfigurations response. +/// A ListConfigurations response. /// /// # Activities /// @@ -453,14 +453,16 @@ pub struct AchievementConfigurationListResponse { pub next_page_token: Option, /// The achievement configurations. pub items: Option>, - /// Uniquely identifies the type of this resource. Value is always the fixed string games#achievementConfigurationListResponse. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string + /// gamesConfiguration#achievementConfigurationListResponse. pub kind: Option, } impl ResponseResult for AchievementConfigurationListResponse {} -/// This is a JSON template for an image configuration resource. +/// An image configuration resource. /// /// # Activities /// @@ -476,7 +478,8 @@ pub struct ImageConfiguration { /// The resource ID of resource which the image belongs to. #[serde(rename="resourceId")] pub resource_id: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#imageConfiguration. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string gamesConfiguration#imageConfiguration. pub kind: Option, /// The image type for the image. #[serde(rename="imageType")] @@ -487,61 +490,62 @@ impl Resource for ImageConfiguration {} impl ResponseResult for ImageConfiguration {} -/// This is a JSON template for a number affix resource. +/// A number affix resource. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GamesNumberAffixConfiguration { - /// When the language requires special treatment of "small" numbers (as with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, or 14 in Polish). + /// When the language requires special treatment of "small" numbers (as with 2, + /// 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, or 14 in + /// Polish). pub few: Option, - /// When the language requires special treatment of the number 0 (as in Arabic). + /// When the language requires special treatment of the number 0 (as in + /// Arabic). pub zero: Option, - /// When the language does not require special treatment of the given quantity (as with all numbers in Chinese, or 42 in English). + /// When the language does not require special treatment of the given quantity + /// (as with all numbers in Chinese, or 42 in English). pub other: Option, - /// When the language requires special treatment of "large" numbers (as with numbers ending 11-99 in Maltese). + /// When the language requires special treatment of "large" numbers (as with + /// numbers ending 11-99 in Maltese). pub many: Option, - /// When the language requires special treatment of numbers like two (as with 2 in Welsh, or 102 in Slovenian). + /// When the language requires special treatment of numbers like two (as with 2 + /// in Welsh, or 102 in Slovenian). pub two: Option, - /// When the language requires special treatment of numbers like one (as with the number 1 in English and most other languages; in Russian, any number ending in 1 but not ending in 11 is in this class). + /// When the language requires special treatment of numbers like one (as with + /// the number 1 in English and most other languages; in Russian, any number + /// ending in 1 but not ending in 11 is in this class). pub one: Option, } impl Part for GamesNumberAffixConfiguration {} -/// This is a JSON template for an achievement configuration resource. +/// An achievement configuration resource. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list achievement configurations](struct.AchievementConfigurationListCall.html) (none) -/// * [update achievement configurations](struct.AchievementConfigurationUpdateCall.html) (request|response) -/// * [insert achievement configurations](struct.AchievementConfigurationInsertCall.html) (request|response) /// * [get achievement configurations](struct.AchievementConfigurationGetCall.html) (response) -/// * [patch achievement configurations](struct.AchievementConfigurationPatchCall.html) (request|response) +/// * [list achievement configurations](struct.AchievementConfigurationListCall.html) (none) +/// * [insert achievement configurations](struct.AchievementConfigurationInsertCall.html) (request|response) /// * [delete achievement configurations](struct.AchievementConfigurationDeleteCall.html) (none) +/// * [update achievement configurations](struct.AchievementConfigurationUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AchievementConfiguration { /// The type of the achievement. - /// Possible values are: - /// - "STANDARD" - Achievement is either locked or unlocked. - /// - "INCREMENTAL" - Achievement is incremental. #[serde(rename="achievementType")] pub achievement_type: Option, - /// Steps to unlock. Only applicable to incremental achievements. + /// Steps to unlock. Only applicable to incremental achievements. #[serde(rename="stepsToUnlock")] pub steps_to_unlock: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#achievementConfiguration. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string gamesConfiguration#achievementConfiguration. pub kind: Option, /// The initial state of the achievement. - /// Possible values are: - /// - "HIDDEN" - Achievement is hidden. - /// - "REVEALED" - Achievement is revealed. - /// - "UNLOCKED" - Achievement is unlocked. #[serde(rename="initialState")] pub initial_state: Option, /// The token for this resource. @@ -559,28 +563,25 @@ impl Resource for AchievementConfiguration {} impl ResponseResult for AchievementConfiguration {} -/// This is a JSON template for an leaderboard configuration resource. +/// An leaderboard configuration resource. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [insert leaderboard configurations](struct.LeaderboardConfigurationInsertCall.html) (request|response) -/// * [get leaderboard configurations](struct.LeaderboardConfigurationGetCall.html) (response) -/// * [patch leaderboard configurations](struct.LeaderboardConfigurationPatchCall.html) (request|response) /// * [list leaderboard configurations](struct.LeaderboardConfigurationListCall.html) (none) -/// * [update leaderboard configurations](struct.LeaderboardConfigurationUpdateCall.html) (request|response) +/// * [insert leaderboard configurations](struct.LeaderboardConfigurationInsertCall.html) (request|response) /// * [delete leaderboard configurations](struct.LeaderboardConfigurationDeleteCall.html) (none) +/// * [get leaderboard configurations](struct.LeaderboardConfigurationGetCall.html) (response) +/// * [update leaderboard configurations](struct.LeaderboardConfigurationUpdateCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LeaderboardConfiguration { - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#leaderboardConfiguration. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string gamesConfiguration#leaderboardConfiguration. pub kind: Option, - /// The type of the leaderboard. - /// Possible values are: - /// - "LARGER_IS_BETTER" - Larger scores posted are ranked higher. - /// - "SMALLER_IS_BETTER" - Smaller scores posted are ranked higher. + /// no description provided #[serde(rename="scoreOrder")] pub score_order: Option, /// Minimum score that can be posted to this leaderboard. @@ -604,7 +605,7 @@ impl Resource for LeaderboardConfiguration {} impl ResponseResult for LeaderboardConfiguration {} -/// This is a JSON template for a ListConfigurations response. +/// A ListConfigurations response. /// /// # Activities /// @@ -620,14 +621,16 @@ pub struct LeaderboardConfigurationListResponse { pub next_page_token: Option, /// The leaderboard configurations. pub items: Option>, - /// Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardConfigurationListResponse. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string + /// gamesConfiguration#leaderboardConfigurationListResponse. pub kind: Option, } impl ResponseResult for LeaderboardConfigurationListResponse {} -/// This is a JSON template for an achievement configuration detail. +/// An achievement configuration detail. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -636,7 +639,8 @@ pub struct AchievementConfigurationDetail { /// The icon url of this achievement. Writes to this field are ignored. #[serde(rename="iconUrl")] pub icon_url: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#achievementConfigurationDetail. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string gamesConfiguration#achievementConfigurationDetail. pub kind: Option, /// Localized strings for the achievement name. pub name: Option, @@ -653,7 +657,7 @@ pub struct AchievementConfigurationDetail { impl Part for AchievementConfigurationDetail {} -/// This is a JSON template for a leaderboard configuration detail. +/// A leaderboard configuration detail. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -665,7 +669,8 @@ pub struct LeaderboardConfigurationDetail { /// The icon url of this leaderboard. Writes to this field are ignored. #[serde(rename="iconUrl")] pub icon_url: Option, - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#leaderboardConfigurationDetail. + /// Uniquely identifies the type of this resource. Value is always the fixed + /// string gamesConfiguration#leaderboardConfigurationDetail. pub kind: Option, /// Localized strings for the leaderboard name. pub name: Option, @@ -767,7 +772,7 @@ impl<'a, C, A> ImageConfigurationMethods<'a, C, A> { /// ::default(), None); /// let mut hub = GamesConfiguration::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.achievement_configurations(); /// # } @@ -856,25 +861,6 @@ impl<'a, C, A> AchievementConfigurationMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Update the metadata of the achievement configuration with the given ID. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `achievementId` - The ID of the achievement used by this method. - pub fn patch(&self, request: AchievementConfiguration, achievement_id: &str) -> AchievementConfigurationPatchCall<'a, C, A> { - AchievementConfigurationPatchCall { - hub: self.hub, - _request: request, - _achievement_id: achievement_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Delete the achievement configuration with the given ID. @@ -919,7 +905,7 @@ impl<'a, C, A> AchievementConfigurationMethods<'a, C, A> { /// ::default(), None); /// let mut hub = GamesConfiguration::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.leaderboard_configurations(); /// # } @@ -955,13 +941,13 @@ impl<'a, C, A> LeaderboardConfigurationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves the metadata of the leaderboard configuration with the given ID. + /// Delete the leaderboard configuration with the given ID. /// /// # Arguments /// /// * `leaderboardId` - The ID of the leaderboard. - pub fn get(&self, leaderboard_id: &str) -> LeaderboardConfigurationGetCall<'a, C, A> { - LeaderboardConfigurationGetCall { + pub fn delete(&self, leaderboard_id: &str) -> LeaderboardConfigurationDeleteCall<'a, C, A> { + LeaderboardConfigurationDeleteCall { hub: self.hub, _leaderboard_id: leaderboard_id.to_string(), _delegate: Default::default(), @@ -970,25 +956,6 @@ impl<'a, C, A> LeaderboardConfigurationMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Update the metadata of the leaderboard configuration with the given ID. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `leaderboardId` - The ID of the leaderboard. - pub fn patch(&self, request: LeaderboardConfiguration, leaderboard_id: &str) -> LeaderboardConfigurationPatchCall<'a, C, A> { - LeaderboardConfigurationPatchCall { - hub: self.hub, - _request: request, - _leaderboard_id: leaderboard_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Update the metadata of the leaderboard configuration with the given ID. @@ -1008,6 +975,23 @@ impl<'a, C, A> LeaderboardConfigurationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves the metadata of the leaderboard configuration with the given ID. + /// + /// # Arguments + /// + /// * `leaderboardId` - The ID of the leaderboard. + pub fn get(&self, leaderboard_id: &str) -> LeaderboardConfigurationGetCall<'a, C, A> { + LeaderboardConfigurationGetCall { + hub: self.hub, + _leaderboard_id: leaderboard_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns a list of the leaderboard configurations in this application. @@ -1026,23 +1010,6 @@ impl<'a, C, A> LeaderboardConfigurationMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Delete the leaderboard configuration with the given ID. - /// - /// # Arguments - /// - /// * `leaderboardId` - The ID of the leaderboard. - pub fn delete(&self, leaderboard_id: &str) -> LeaderboardConfigurationDeleteCall<'a, C, A> { - LeaderboardConfigurationDeleteCall { - hub: self.hub, - _leaderboard_id: leaderboard_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -1131,8 +1098,6 @@ impl<'a, C, A> ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut = None; loop { let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { @@ -1185,38 +1147,23 @@ impl<'a, C, A> ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut 15728640 { - return Err(Error::UploadSizeLimitExceeded(size, 15728640)) - } - req = req.header(ContentType(reader_mime_type.clone())) - .header(ContentLength(size)) - .body(&mut reader); - } - upload_url_from_server = true; - if protocol == "resumable" { - req = req.header(cmn::XUploadContentType(reader_mime_type.clone())); - } - - dlg.pre_request(); - req.send() + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + if protocol == "simple" { + let size = reader.seek(io::SeekFrom::End(0)).unwrap(); + reader.seek(io::SeekFrom::Start(0)).unwrap(); + if size > 15728640 { + return Err(Error::UploadSizeLimitExceeded(size, 15728640)) } + req = req.header(ContentType(reader_mime_type.clone())) + .header(ContentLength(size)) + .body(&mut reader); + } + + dlg.pre_request(); + req.send() }; match req_result { @@ -1244,51 +1191,6 @@ impl<'a, C, A> ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut Err(Error::BadRequest(serr)) } } - if protocol == "resumable" { - let size = reader.seek(io::SeekFrom::End(0)).unwrap(); - reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 15728640 { - return Err(Error::UploadSizeLimitExceeded(size, 15728640)) - } - let mut client = &mut *self.hub.client.borrow_mut(); - let upload_result = { - let url_str = &res.headers.get::().expect("Location header is part of protocol").0; - if upload_url_from_server { - dlg.store_upload_url(Some(url_str)); - } - - cmn::ResumableUploadHelper { - client: &mut client.borrow_mut(), - delegate: dlg, - start_at: if upload_url_from_server { Some(0) } else { None }, - auth: &mut *self.hub.auth.borrow_mut(), - user_agent: &self.hub._user_agent, - auth_header: auth_header.clone(), - url: url_str, - reader: &mut reader, - media_type: reader_mime_type.clone(), - content_length: size - }.upload() - }; - match upload_result { - None => { - dlg.finished(false); - return Err(Error::Cancelled) - } - Some(Err(err)) => { - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Some(Ok(upload_result)) => { - res = upload_result; - if !res.status.is_success() { - dlg.store_upload_url(None); - dlg.finished(false); - return Err(Error::Failure(res)) - } - } - } - } let result_value = { let mut json_response = String::new(); res.read_to_string(&mut json_response).unwrap(); @@ -1311,29 +1213,13 @@ impl<'a, C, A> ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, ImageConfiguration)> where RS: ReadSeek { self.doit(stream, mime_type, "simple") } - /// Upload media in a resumable fashion. - /// Even if the upload fails or is interrupted, it can be resumed for a - /// certain amount of time as the server maintains state temporarily. - /// - /// The delegate will be asked for an `upload_url()`, and if not provided, will be asked to store an upload URL - /// that was provided by the server, using `store_upload_url(...)`. The upload will be done in chunks, the delegate - /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using - /// `cancel_chunk_upload(...)`. - /// - /// * *max size*: 15MB - /// * *multipart*: yes - /// * *valid mime types*: 'image/*' - pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, ImageConfiguration)> - where RS: ReadSeek { - self.doit(resumeable_stream, mime_type, "resumable") - } /// The ID of the resource used by this method. /// @@ -1375,13 +1261,17 @@ impl<'a, C, A> ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ImageConfigurationUploadCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -1495,7 +1385,7 @@ impl<'a, C, A> AchievementConfigurationListCall<'a, C, A> where C: BorrowMut AchievementConfigurationListCall<'a, C, A> where C: BorrowMutmaxResults. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> AchievementConfigurationListCall<'a, C, A> { @@ -1639,13 +1531,17 @@ impl<'a, C, A> AchievementConfigurationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AchievementConfigurationListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -1756,7 +1652,7 @@ impl<'a, C, A> AchievementConfigurationUpdateCall<'a, C, A> where C: BorrowMut AchievementConfigurationUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AchievementConfigurationUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2027,7 +1927,7 @@ impl<'a, C, A> AchievementConfigurationInsertCall<'a, C, A> where C: BorrowMut AchievementConfigurationInsertCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AchievementConfigurationInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2291,7 +2195,7 @@ impl<'a, C, A> AchievementConfigurationGetCall<'a, C, A> where C: BorrowMut AchievementConfigurationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AchievementConfigurationGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2460,277 +2368,6 @@ impl<'a, C, A> AchievementConfigurationGetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = GamesConfiguration::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AchievementConfiguration::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.achievement_configurations().patch(req, "achievementId") -/// .doit(); -/// # } -/// ``` -pub struct AchievementConfigurationPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesConfiguration, - _request: AchievementConfiguration, - _achievement_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AchievementConfigurationPatchCall<'a, C, A> {} - -impl<'a, C, A> AchievementConfigurationPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AchievementConfiguration)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesConfiguration.achievementConfigurations.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("achievementId", self._achievement_id.to_string())); - for &field in ["alt", "achievementId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "achievements/{achievementId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Androidpublisher.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{achievementId}", "achievementId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["achievementId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AchievementConfiguration) -> AchievementConfigurationPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the achievement used by this method. - /// - /// Sets the *achievement id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn achievement_id(mut self, new_value: &str) -> AchievementConfigurationPatchCall<'a, C, A> { - self._achievement_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AchievementConfigurationPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AchievementConfigurationPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Androidpublisher`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AchievementConfigurationPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Delete the achievement configuration with the given ID. /// /// A builder for the *delete* method supported by a *achievementConfiguration* resource. @@ -2801,7 +2438,7 @@ impl<'a, C, A> AchievementConfigurationDeleteCall<'a, C, A> where C: BorrowMut AchievementConfigurationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AchievementConfigurationDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3038,7 +2679,7 @@ impl<'a, C, A> LeaderboardConfigurationInsertCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationInsertCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> LeaderboardConfigurationInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3231,9 +2876,9 @@ impl<'a, C, A> LeaderboardConfigurationInsertCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationInsertCall<'a, C, A> where C: BorrowMut +pub struct LeaderboardConfigurationDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a GamesConfiguration, @@ -3272,13 +2917,13 @@ pub struct LeaderboardConfigurationGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for LeaderboardConfigurationGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for LeaderboardConfigurationDeleteCall<'a, C, A> {} -impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> LeaderboardConfigurationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LeaderboardConfiguration)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -3286,11 +2931,11 @@ impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "gamesConfiguration.leaderboardConfigurations.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "gamesConfiguration.leaderboardConfigurations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); params.push(("leaderboardId", self._leaderboard_id.to_string())); - for &field in ["alt", "leaderboardId"].iter() { + for &field in ["leaderboardId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3300,9 +2945,8 @@ impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut Err(Error::BadRequest(serr)) } } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -3408,7 +3042,7 @@ impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationGetCall<'a, C, A> { + pub fn leaderboard_id(mut self, new_value: &str) -> LeaderboardConfigurationDeleteCall<'a, C, A> { self._leaderboard_id = new_value.to_string(); self } @@ -3418,7 +3052,7 @@ impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LeaderboardConfigurationDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3432,14 +3066,18 @@ impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> LeaderboardConfigurationGetCall<'a, C, A> + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> LeaderboardConfigurationDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3459,278 +3097,7 @@ impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> LeaderboardConfigurationGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Update the metadata of the leaderboard configuration with the given ID. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *leaderboardConfiguration* resource. -/// It is not used directly, but through a `LeaderboardConfigurationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesconfiguration1_configuration as gamesconfiguration1_configuration; -/// use gamesconfiguration1_configuration::LeaderboardConfiguration; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesconfiguration1_configuration::GamesConfiguration; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesConfiguration::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LeaderboardConfiguration::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.leaderboard_configurations().patch(req, "leaderboardId") -/// .doit(); -/// # } -/// ``` -pub struct LeaderboardConfigurationPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesConfiguration, - _request: LeaderboardConfiguration, - _leaderboard_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for LeaderboardConfigurationPatchCall<'a, C, A> {} - -impl<'a, C, A> LeaderboardConfigurationPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LeaderboardConfiguration)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesConfiguration.leaderboardConfigurations.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("leaderboardId", self._leaderboard_id.to_string())); - for &field in ["alt", "leaderboardId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Androidpublisher.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["leaderboardId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LeaderboardConfiguration) -> LeaderboardConfigurationPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the leaderboard. - /// - /// Sets the *leaderboard id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn leaderboard_id(mut self, new_value: &str) -> LeaderboardConfigurationPatchCall<'a, C, A> { - self._leaderboard_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LeaderboardConfigurationPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> LeaderboardConfigurationPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Androidpublisher`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LeaderboardConfigurationPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> LeaderboardConfigurationDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -3820,7 +3187,7 @@ impl<'a, C, A> LeaderboardConfigurationUpdateCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> LeaderboardConfigurationUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4013,6 +3384,250 @@ impl<'a, C, A> LeaderboardConfigurationUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = GamesConfiguration::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.leaderboard_configurations().get("leaderboardId") +/// .doit(); +/// # } +/// ``` +pub struct LeaderboardConfigurationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a GamesConfiguration, + _leaderboard_id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LeaderboardConfigurationGetCall<'a, C, A> {} + +impl<'a, C, A> LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LeaderboardConfiguration)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gamesConfiguration.leaderboardConfigurations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("leaderboardId", self._leaderboard_id.to_string())); + for &field in ["alt", "leaderboardId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "games/v1configuration/leaderboards/{leaderboardId}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Androidpublisher.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["leaderboardId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the leaderboard. + /// + /// Sets the *leaderboard id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn leaderboard_id(mut self, new_value: &str) -> LeaderboardConfigurationGetCall<'a, C, A> { + self._leaderboard_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LeaderboardConfigurationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> LeaderboardConfigurationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Androidpublisher`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LeaderboardConfigurationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns a list of the leaderboard configurations in this application. /// /// A builder for the *list* method supported by a *leaderboardConfiguration* resource. @@ -4042,7 +3657,7 @@ impl<'a, C, A> LeaderboardConfigurationUpdateCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationListCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationListCall<'a, C, A> where C: BorrowMutmaxResults. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: i32) -> LeaderboardConfigurationListCall<'a, C, A> { @@ -4238,13 +3855,17 @@ impl<'a, C, A> LeaderboardConfigurationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> LeaderboardConfigurationListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4277,232 +3898,3 @@ impl<'a, C, A> LeaderboardConfigurationListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = GamesConfiguration::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.leaderboard_configurations().delete("leaderboardId") -/// .doit(); -/// # } -/// ``` -pub struct LeaderboardConfigurationDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesConfiguration, - _leaderboard_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for LeaderboardConfigurationDeleteCall<'a, C, A> {} - -impl<'a, C, A> LeaderboardConfigurationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesConfiguration.leaderboardConfigurations.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - params.push(("leaderboardId", self._leaderboard_id.to_string())); - for &field in ["leaderboardId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Androidpublisher.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{leaderboardId}", "leaderboardId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["leaderboardId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the leaderboard. - /// - /// Sets the *leaderboard id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn leaderboard_id(mut self, new_value: &str) -> LeaderboardConfigurationDeleteCall<'a, C, A> { - self._leaderboard_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LeaderboardConfigurationDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> LeaderboardConfigurationDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Androidpublisher`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LeaderboardConfigurationDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - diff --git a/gen/gamesmanagement1_management-cli/Cargo.toml b/gen/gamesmanagement1_management-cli/Cargo.toml index 91325a5cad..3411795bfe 100644 --- a/gen/gamesmanagement1_management-cli/Cargo.toml +++ b/gen/gamesmanagement1_management-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-gamesmanagement1_management-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Management (protocol v1management)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-gamesmanagement1_management] path = "../gamesmanagement1_management" -version = "1.0.12+20190627" +version = "1.0.13+20200402" diff --git a/gen/gamesmanagement1_management-cli/README.md b/gen/gamesmanagement1_management-cli/README.md index f1e968408a..29b5f31938 100644 --- a/gen/gamesmanagement1_management-cli/README.md +++ b/gen/gamesmanagement1_management-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Games Management* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Games Management* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash gamesmanagement1-management [options] @@ -46,12 +46,6 @@ gamesmanagement1-management [options] players hide [-p ]... unhide [-p ]... - quests - reset [-p ]... - reset-all [-p ]... - reset-all-for-all-players [-p ]... - reset-for-all-players [-p ]... - reset-multiple-for-all-players (-r )... [-p ]... rooms reset [-p ]... reset-for-all-players [-p ]... diff --git a/gen/gamesmanagement1_management-cli/mkdocs.yml b/gen/gamesmanagement1_management-cli/mkdocs.yml index c4685abc2e..607500c986 100644 --- a/gen/gamesmanagement1_management-cli/mkdocs.yml +++ b/gen/gamesmanagement1_management-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games Management v1.0.12+20190627 +site_name: Games Management v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-gamesmanagement1_management-cli site_description: A complete library to interact with Games Management (protocol v1management) @@ -22,11 +22,6 @@ pages: - ['events_reset-multiple-for-all-players.md', 'Events', 'Reset Multiple For All Players'] - ['players_hide.md', 'Players', 'Hide'] - ['players_unhide.md', 'Players', 'Unhide'] -- ['quests_reset.md', 'Quests', 'Reset'] -- ['quests_reset-all.md', 'Quests', 'Reset All'] -- ['quests_reset-all-for-all-players.md', 'Quests', 'Reset All For All Players'] -- ['quests_reset-for-all-players.md', 'Quests', 'Reset For All Players'] -- ['quests_reset-multiple-for-all-players.md', 'Quests', 'Reset Multiple For All Players'] - ['rooms_reset.md', 'Rooms', 'Reset'] - ['rooms_reset-for-all-players.md', 'Rooms', 'Reset For All Players'] - ['scores_reset.md', 'Scores', 'Reset'] diff --git a/gen/gamesmanagement1_management-cli/src/main.rs b/gen/gamesmanagement1_management-cli/src/main.rs index 1216a37ac5..0e9a83fba3 100644 --- a/gen/gamesmanagement1_management-cli/src/main.rs +++ b/gen/gamesmanagement1_management-cli/src/main.rs @@ -717,260 +717,6 @@ impl<'n> Engine<'n> { } } - fn _quests_reset(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.quests().reset(opt.value_of("quest-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - Ok(()) - } - } - } - } - - fn _quests_reset_all(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.quests().reset_all(); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - Ok(()) - } - } - } - } - - fn _quests_reset_all_for_all_players(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.quests().reset_all_for_all_players(); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - Ok(()) - } - } - } - } - - fn _quests_reset_for_all_players(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.quests().reset_for_all_players(opt.value_of("quest-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - Ok(()) - } - } - } - } - - fn _quests_reset_multiple_for_all_players(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "quest-ids" => Some(("quest_ids", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["kind", "quest-ids"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::QuestsResetMultipleForAllRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.quests().reset_multiple_for_all_players(request); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok(mut response) => { - Ok(()) - } - } - } - } - fn _rooms_reset(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.rooms().reset(); @@ -1493,29 +1239,6 @@ impl<'n> Engine<'n> { } } }, - ("quests", Some(opt)) => { - match opt.subcommand() { - ("reset", Some(opt)) => { - call_result = self._quests_reset(opt, dry_run, &mut err); - }, - ("reset-all", Some(opt)) => { - call_result = self._quests_reset_all(opt, dry_run, &mut err); - }, - ("reset-all-for-all-players", Some(opt)) => { - call_result = self._quests_reset_all_for_all_players(opt, dry_run, &mut err); - }, - ("reset-for-all-players", Some(opt)) => { - call_result = self._quests_reset_for_all_players(opt, dry_run, &mut err); - }, - ("reset-multiple-for-all-players", Some(opt)) => { - call_result = self._quests_reset_multiple_for_all_players(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("quests".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("rooms", Some(opt)) => { match opt.subcommand() { ("reset", Some(opt)) => { @@ -1759,7 +1482,7 @@ fn main() { ("events", "methods: 'reset', 'reset-all', 'reset-all-for-all-players', 'reset-for-all-players' and 'reset-multiple-for-all-players'", vec![ ("reset", - Some(r##"Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player that use the event will also be reset."##), + Some(r##"Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application."##), "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/events_reset", vec![ (Some(r##"event-id"##), @@ -1775,7 +1498,7 @@ fn main() { Some(true)), ]), ("reset-all", - Some(r##"Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player will also be reset."##), + Some(r##"Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application."##), "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/events_reset-all", vec![ (Some(r##"v"##), @@ -1785,7 +1508,7 @@ fn main() { Some(true)), ]), ("reset-all-for-all-players", - Some(r##"Resets all draft events for all players. This method is only available to user accounts for your developer console. All quests that use any of these events will also be reset."##), + Some(r##"Resets all draft events for all players. This method is only available to user accounts for your developer console."##), "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/events_reset-all-for-all-players", vec![ (Some(r##"v"##), @@ -1795,7 +1518,7 @@ fn main() { Some(true)), ]), ("reset-for-all-players", - Some(r##"Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset. All quests that use the event will also be reset."##), + Some(r##"Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset."##), "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/events_reset-for-all-players", vec![ (Some(r##"event-id"##), @@ -1811,7 +1534,7 @@ fn main() { Some(true)), ]), ("reset-multiple-for-all-players", - Some(r##"Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. All quests that use any of the events will also be reset."##), + Some(r##"Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset."##), "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/events_reset-multiple-for-all-players", vec![ (Some(r##"kv"##), @@ -1875,77 +1598,6 @@ fn main() { ]), ]), - ("quests", "methods: 'reset', 'reset-all', 'reset-all-for-all-players', 'reset-for-all-players' and 'reset-multiple-for-all-players'", vec![ - ("reset", - Some(r##"Resets all player progress on the quest with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application."##), - "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/quests_reset", - vec![ - (Some(r##"quest-id"##), - None, - Some(r##"The ID of the quest."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ("reset-all", - Some(r##"Resets all player progress on all quests for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application."##), - "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/quests_reset-all", - vec![ - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ("reset-all-for-all-players", - Some(r##"Resets all draft quests for all players. This method is only available to user accounts for your developer console."##), - "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/quests_reset-all-for-all-players", - vec![ - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ("reset-for-all-players", - Some(r##"Resets all player progress on the quest with the given ID for all players. This method is only available to user accounts for your developer console. Only draft quests can be reset."##), - "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/quests_reset-for-all-players", - vec![ - (Some(r##"quest-id"##), - None, - Some(r##"The ID of the quest."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ("reset-multiple-for-all-players", - Some(r##"Resets quests with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft quests may be reset."##), - "Details at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli/quests_reset-multiple-for-all-players", - vec![ - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ]), - ("rooms", "methods: 'reset' and 'reset-for-all-players'", vec![ ("reset", Some(r##"Reset all rooms for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application."##), @@ -2079,7 +1731,7 @@ fn main() { let mut app = App::new("gamesmanagement1-management") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200402") .about("The Management API for Google Play Game Services.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gamesmanagement1_management_cli") .arg(Arg::with_name("url") diff --git a/gen/gamesmanagement1_management/Cargo.toml b/gen/gamesmanagement1_management/Cargo.toml index 332ccafb4b..4093619d69 100644 --- a/gen/gamesmanagement1_management/Cargo.toml +++ b/gen/gamesmanagement1_management/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gamesmanagement1_management" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Games Management (protocol v1management)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gamesmanagement1_management" homepage = "https://developers.google.com/games/services" -documentation = "https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627" +documentation = "https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402" license = "MIT" keywords = ["gamesManagement", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/gamesmanagement1_management/README.md b/gen/gamesmanagement1_management/README.md index de6cb2c232..e62163fc65 100644 --- a/gen/gamesmanagement1_management/README.md +++ b/gen/gamesmanagement1_management/README.md @@ -5,30 +5,28 @@ DO NOT EDIT ! --> The `google-gamesmanagement1_management` library allows access to all features of the *Google Games Management* service. -This documentation was generated from *Games Management* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Games Management* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Games Management* *v1_management* API can be found at the [official documentation site](https://developers.google.com/games/services). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.GamesManagement.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.GamesManagement.html) ... * achievements - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.AchievementResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.AchievementResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.AchievementResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.AchievementResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.AchievementResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.AchievementResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.AchievementResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.AchievementResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.AchievementResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.AchievementResetMultipleForAllPlayerCall.html) * applications - * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) + * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) * events - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.EventResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.EventResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.EventResetMultipleForAllPlayerCall.html) -* [players](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.Player.html) - * [*hide*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.PlayerHideCall.html) and [*unhide*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.PlayerUnhideCall.html) -* quests - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.QuestResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.QuestResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.QuestResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.QuestResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.QuestResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.EventResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.EventResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.EventResetMultipleForAllPlayerCall.html) +* [players](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.Player.html) + * [*hide*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.PlayerHideCall.html) and [*unhide*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.PlayerUnhideCall.html) * rooms - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.RoomResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.RoomResetForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.RoomResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.RoomResetForAllPlayerCall.html) * scores - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.ScoreResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.ScoreResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.ScoreResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.ScoreResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.ScoreResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.ScoreResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.ScoreResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.ScoreResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.ScoreResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.ScoreResetMultipleForAllPlayerCall.html) * turn based matches - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.TurnBasedMatcheResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.TurnBasedMatcheResetForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.TurnBasedMatcheResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.TurnBasedMatcheResetForAllPlayerCall.html) @@ -37,17 +35,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/struct.GamesManagement.html)** +* **[Hub](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/struct.GamesManagement.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-gamesmanagement1_management/1.0.12+20190627/google_gamesmanagement1_management/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesmanagement1_management/1.0.13+20200402/google_gamesmanagement1_management/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/gamesmanagement1_management/src/lib.rs b/gen/gamesmanagement1_management/src/lib.rs index 8d858a700c..70b937a5bb 100644 --- a/gen/gamesmanagement1_management/src/lib.rs +++ b/gen/gamesmanagement1_management/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Games Management* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Games Management* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Games Management* *v1_management* API can be found at the //! [official documentation site](https://developers.google.com/games/services). @@ -19,8 +19,6 @@ //! * [*reset*](struct.EventResetCall.html), [*reset all*](struct.EventResetAllCall.html), [*reset all for all players*](struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](struct.EventResetMultipleForAllPlayerCall.html) //! * [players](struct.Player.html) //! * [*hide*](struct.PlayerHideCall.html) and [*unhide*](struct.PlayerUnhideCall.html) -//! * quests -//! * [*reset*](struct.QuestResetCall.html), [*reset all*](struct.QuestResetAllCall.html), [*reset all for all players*](struct.QuestResetAllForAllPlayerCall.html), [*reset for all players*](struct.QuestResetForAllPlayerCall.html) and [*reset multiple for all players*](struct.QuestResetMultipleForAllPlayerCall.html) //! * rooms //! * [*reset*](struct.RoomResetCall.html) and [*reset for all players*](struct.RoomResetForAllPlayerCall.html) //! * scores @@ -332,7 +330,7 @@ impl<'a, C, A> GamesManagement GamesManagement { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/games/v1management/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -350,9 +348,6 @@ impl<'a, C, A> GamesManagement pub fn players(&'a self) -> PlayerMethods<'a, C, A> { PlayerMethods { hub: &self } } - pub fn quests(&'a self) -> QuestMethods<'a, C, A> { - QuestMethods { hub: &self } - } pub fn rooms(&'a self) -> RoomMethods<'a, C, A> { RoomMethods { hub: &self } } @@ -364,7 +359,7 @@ impl<'a, C, A> GamesManagement } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -431,7 +426,7 @@ impl ResponseResult for AchievementResetResponse {} pub struct ProfileSettings { /// Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#profileSettings. pub kind: Option, - /// The player's current profile visibility. This field is visible to both 1P and 3P APIs. + /// no description provided #[serde(rename="profileVisible")] pub profile_visible: Option, } @@ -588,12 +583,18 @@ pub struct Player { /// The url to the portrait mode player banner image. #[serde(rename="bannerUrlPortrait")] pub banner_url_portrait: Option, + /// no description provided + #[serde(rename="playerStattus")] + pub player_stattus: Option, /// The player's profile settings. Controls whether or not the player's profile is visible to other players. #[serde(rename="profileSettings")] pub profile_settings: Option, /// An object to represent Play Game experience information for the player. #[serde(rename="experienceInfo")] pub experience_info: Option, + /// The friend status of the given player, relative to the requester. This is unset if the player is not sharing their friends list with the game. + #[serde(rename="friendStatus")] + pub friend_status: Option, /// The url to the landscape mode player banner image. #[serde(rename="bannerUrlLandscape")] pub banner_url_landscape: Option, @@ -607,26 +608,6 @@ pub struct Player { impl Resource for Player {} -/// This is a JSON template for multiple quests reset all request. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [reset multiple for all players quests](struct.QuestResetMultipleForAllPlayerCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct QuestsResetMultipleForAllRequest { - /// The IDs of quests to reset. - pub quest_ids: Option>, - /// Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#questsResetMultipleForAllRequest. - pub kind: Option, -} - -impl RequestValue for QuestsResetMultipleForAllRequest {} - - /// This is a JSON template for 1P/3P metadata about a user's level. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -957,123 +938,6 @@ impl<'a, C, A> PlayerMethods<'a, C, A> { -/// A builder providing access to all methods supported on *score* resources. -/// It is not used directly, but through the `GamesManagement` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use gamesmanagement1_management::GamesManagement; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `reset(...)`, `reset_all(...)`, `reset_all_for_all_players(...)`, `reset_for_all_players(...)` and `reset_multiple_for_all_players(...)` -/// // to build up your call. -/// let rb = hub.scores(); -/// # } -/// ``` -pub struct ScoreMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, -} - -impl<'a, C, A> MethodsBuilder for ScoreMethods<'a, C, A> {} - -impl<'a, C, A> ScoreMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Resets scores for the leaderboards with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft leaderboards may be reset. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn reset_multiple_for_all_players(&self, request: ScoresResetMultipleForAllRequest) -> ScoreResetMultipleForAllPlayerCall<'a, C, A> { - ScoreResetMultipleForAllPlayerCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Resets scores for all draft leaderboards for all players. This method is only available to user accounts for your developer console. - pub fn reset_all_for_all_players(&self) -> ScoreResetAllForAllPlayerCall<'a, C, A> { - ScoreResetAllForAllPlayerCall { - hub: self.hub, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Resets all scores for all leaderboards for the currently authenticated players. This method is only accessible to whitelisted tester accounts for your application. - pub fn reset_all(&self) -> ScoreResetAllCall<'a, C, A> { - ScoreResetAllCall { - hub: self.hub, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Resets scores for the leaderboard with the given ID for all players. This method is only available to user accounts for your developer console. Only draft leaderboards can be reset. - /// - /// # Arguments - /// - /// * `leaderboardId` - The ID of the leaderboard. - pub fn reset_for_all_players(&self, leaderboard_id: &str) -> ScoreResetForAllPlayerCall<'a, C, A> { - ScoreResetForAllPlayerCall { - hub: self.hub, - _leaderboard_id: leaderboard_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Resets scores for the leaderboard with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. - /// - /// # Arguments - /// - /// * `leaderboardId` - The ID of the leaderboard. - pub fn reset(&self, leaderboard_id: &str) -> ScoreResetCall<'a, C, A> { - ScoreResetCall { - hub: self.hub, - _leaderboard_id: leaderboard_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *turnBasedMatche* resources. /// It is not used directly, but through the `GamesManagement` hub. /// @@ -1267,7 +1131,7 @@ impl<'a, C, A> RoomMethods<'a, C, A> { -/// A builder providing access to all methods supported on *quest* resources. +/// A builder providing access to all methods supported on *score* resources. /// It is not used directly, but through the `GamesManagement` hub. /// /// # Example @@ -1293,40 +1157,28 @@ impl<'a, C, A> RoomMethods<'a, C, A> { /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `reset(...)`, `reset_all(...)`, `reset_all_for_all_players(...)`, `reset_for_all_players(...)` and `reset_multiple_for_all_players(...)` /// // to build up your call. -/// let rb = hub.quests(); +/// let rb = hub.scores(); /// # } /// ``` -pub struct QuestMethods<'a, C, A> +pub struct ScoreMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a GamesManagement, } -impl<'a, C, A> MethodsBuilder for QuestMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for ScoreMethods<'a, C, A> {} -impl<'a, C, A> QuestMethods<'a, C, A> { +impl<'a, C, A> ScoreMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets all draft quests for all players. This method is only available to user accounts for your developer console. - pub fn reset_all_for_all_players(&self) -> QuestResetAllForAllPlayerCall<'a, C, A> { - QuestResetAllForAllPlayerCall { - hub: self.hub, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Resets quests with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft quests may be reset. + /// Resets scores for the leaderboards with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft leaderboards may be reset. /// /// # Arguments /// /// * `request` - No description provided. - pub fn reset_multiple_for_all_players(&self, request: QuestsResetMultipleForAllRequest) -> QuestResetMultipleForAllPlayerCall<'a, C, A> { - QuestResetMultipleForAllPlayerCall { + pub fn reset_multiple_for_all_players(&self, request: ScoresResetMultipleForAllRequest) -> ScoreResetMultipleForAllPlayerCall<'a, C, A> { + ScoreResetMultipleForAllPlayerCall { hub: self.hub, _request: request, _delegate: Default::default(), @@ -1337,9 +1189,9 @@ impl<'a, C, A> QuestMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets all player progress on all quests for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. - pub fn reset_all(&self) -> QuestResetAllCall<'a, C, A> { - QuestResetAllCall { + /// Resets scores for all draft leaderboards for all players. This method is only available to user accounts for your developer console. + pub fn reset_all_for_all_players(&self) -> ScoreResetAllForAllPlayerCall<'a, C, A> { + ScoreResetAllForAllPlayerCall { hub: self.hub, _delegate: Default::default(), _scopes: Default::default(), @@ -1349,15 +1201,10 @@ impl<'a, C, A> QuestMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets all player progress on the quest with the given ID for all players. This method is only available to user accounts for your developer console. Only draft quests can be reset. - /// - /// # Arguments - /// - /// * `questId` - The ID of the quest. - pub fn reset_for_all_players(&self, quest_id: &str) -> QuestResetForAllPlayerCall<'a, C, A> { - QuestResetForAllPlayerCall { + /// Resets all scores for all leaderboards for the currently authenticated players. This method is only accessible to whitelisted tester accounts for your application. + pub fn reset_all(&self) -> ScoreResetAllCall<'a, C, A> { + ScoreResetAllCall { hub: self.hub, - _quest_id: quest_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1366,15 +1213,32 @@ impl<'a, C, A> QuestMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets all player progress on the quest with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. + /// Resets scores for the leaderboard with the given ID for all players. This method is only available to user accounts for your developer console. Only draft leaderboards can be reset. /// /// # Arguments /// - /// * `questId` - The ID of the quest. - pub fn reset(&self, quest_id: &str) -> QuestResetCall<'a, C, A> { - QuestResetCall { + /// * `leaderboardId` - The ID of the leaderboard. + pub fn reset_for_all_players(&self, leaderboard_id: &str) -> ScoreResetForAllPlayerCall<'a, C, A> { + ScoreResetForAllPlayerCall { hub: self.hub, - _quest_id: quest_id.to_string(), + _leaderboard_id: leaderboard_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Resets scores for the leaderboard with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. + /// + /// # Arguments + /// + /// * `leaderboardId` - The ID of the leaderboard. + pub fn reset(&self, leaderboard_id: &str) -> ScoreResetCall<'a, C, A> { + ScoreResetCall { + hub: self.hub, + _leaderboard_id: leaderboard_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1425,7 +1289,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets all draft events for all players. This method is only available to user accounts for your developer console. All quests that use any of these events will also be reset. + /// Resets all draft events for all players. This method is only available to user accounts for your developer console. pub fn reset_all_for_all_players(&self) -> EventResetAllForAllPlayerCall<'a, C, A> { EventResetAllForAllPlayerCall { hub: self.hub, @@ -1437,7 +1301,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player that use the event will also be reset. + /// Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. /// /// # Arguments /// @@ -1454,7 +1318,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player will also be reset. + /// Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. pub fn reset_all(&self) -> EventResetAllCall<'a, C, A> { EventResetAllCall { hub: self.hub, @@ -1466,7 +1330,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. All quests that use any of the events will also be reset. + /// Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. /// /// # Arguments /// @@ -1483,7 +1347,7 @@ impl<'a, C, A> EventMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset. All quests that use the event will also be reset. + /// Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset. /// /// # Arguments /// @@ -3088,6 +2952,1054 @@ impl<'a, C, A> PlayerUnhideCall<'a, C, A> where C: BorrowMut, A: } +/// Reset all turn-based match data for a user. This method is only accessible to whitelisted tester accounts for your application. +/// +/// A builder for the *reset* method supported by a *turnBasedMatche* resource. +/// It is not used directly, but through a `TurnBasedMatcheMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gamesmanagement1_management::GamesManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.turn_based_matches().reset() +/// .doit(); +/// # } +/// ``` +pub struct TurnBasedMatcheResetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a GamesManagement, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TurnBasedMatcheResetCall<'a, C, A> {} + +impl<'a, C, A> TurnBasedMatcheResetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gamesManagement.turnBasedMatches.reset", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); + for &field in [].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "turnbasedmatches/reset"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Game.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TurnBasedMatcheResetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TurnBasedMatcheResetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Game`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TurnBasedMatcheResetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes turn-based matches where the only match participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console. +/// +/// A builder for the *resetForAllPlayers* method supported by a *turnBasedMatche* resource. +/// It is not used directly, but through a `TurnBasedMatcheMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gamesmanagement1_management::GamesManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.turn_based_matches().reset_for_all_players() +/// .doit(); +/// # } +/// ``` +pub struct TurnBasedMatcheResetForAllPlayerCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a GamesManagement, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TurnBasedMatcheResetForAllPlayerCall<'a, C, A> {} + +impl<'a, C, A> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gamesManagement.turnBasedMatches.resetForAllPlayers", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); + for &field in [].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "turnbasedmatches/resetForAllPlayers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Game.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Game`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get the list of players hidden from the given application. This method is only available to user accounts for your developer console. +/// +/// A builder for the *listHidden* method supported by a *application* resource. +/// It is not used directly, but through a `ApplicationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gamesmanagement1_management::GamesManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.applications().list_hidden("applicationId") +/// .page_token("sea") +/// .max_results(-90) +/// .doit(); +/// # } +/// ``` +pub struct ApplicationListHiddenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a GamesManagement, + _application_id: String, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ApplicationListHiddenCall<'a, C, A> {} + +impl<'a, C, A> ApplicationListHiddenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HiddenPlayerList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gamesManagement.applications.listHidden", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("applicationId", self._application_id.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + for &field in ["alt", "applicationId", "pageToken", "maxResults"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "applications/{applicationId}/players/hidden"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Game.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{applicationId}", "applicationId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["applicationId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The application ID from the Google Play developer console. + /// + /// Sets the *application id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn application_id(mut self, new_value: &str) -> ApplicationListHiddenCall<'a, C, A> { + self._application_id = new_value.to_string(); + self + } + /// The token returned by the previous request. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ApplicationListHiddenCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> ApplicationListHiddenCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ApplicationListHiddenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ApplicationListHiddenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Game`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ApplicationListHiddenCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes rooms where the only room participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console. +/// +/// A builder for the *resetForAllPlayers* method supported by a *room* resource. +/// It is not used directly, but through a `RoomMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gamesmanagement1_management::GamesManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.rooms().reset_for_all_players() +/// .doit(); +/// # } +/// ``` +pub struct RoomResetForAllPlayerCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a GamesManagement, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RoomResetForAllPlayerCall<'a, C, A> {} + +impl<'a, C, A> RoomResetForAllPlayerCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gamesManagement.rooms.resetForAllPlayers", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); + for &field in [].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "rooms/resetForAllPlayers"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Game.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RoomResetForAllPlayerCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RoomResetForAllPlayerCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Game`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RoomResetForAllPlayerCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reset all rooms for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application. +/// +/// A builder for the *reset* method supported by a *room* resource. +/// It is not used directly, but through a `RoomMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gamesmanagement1_management::GamesManagement; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.rooms().reset() +/// .doit(); +/// # } +/// ``` +pub struct RoomResetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a GamesManagement, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for RoomResetCall<'a, C, A> {} + +impl<'a, C, A> RoomResetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gamesManagement.rooms.reset", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); + for &field in [].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "rooms/reset"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Game.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RoomResetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> RoomResetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Game`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> RoomResetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Resets scores for the leaderboards with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft leaderboards may be reset. /// /// A builder for the *resetMultipleForAllPlayers* method supported by a *score* resource. @@ -4187,2132 +5099,7 @@ impl<'a, C, A> ScoreResetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Reset all turn-based match data for a user. This method is only accessible to whitelisted tester accounts for your application. -/// -/// A builder for the *reset* method supported by a *turnBasedMatche* resource. -/// It is not used directly, but through a `TurnBasedMatcheMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.turn_based_matches().reset() -/// .doit(); -/// # } -/// ``` -pub struct TurnBasedMatcheResetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TurnBasedMatcheResetCall<'a, C, A> {} - -impl<'a, C, A> TurnBasedMatcheResetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.turnBasedMatches.reset", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "turnbasedmatches/reset"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TurnBasedMatcheResetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TurnBasedMatcheResetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TurnBasedMatcheResetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes turn-based matches where the only match participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console. -/// -/// A builder for the *resetForAllPlayers* method supported by a *turnBasedMatche* resource. -/// It is not used directly, but through a `TurnBasedMatcheMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.turn_based_matches().reset_for_all_players() -/// .doit(); -/// # } -/// ``` -pub struct TurnBasedMatcheResetForAllPlayerCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TurnBasedMatcheResetForAllPlayerCall<'a, C, A> {} - -impl<'a, C, A> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.turnBasedMatches.resetForAllPlayers", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "turnbasedmatches/resetForAllPlayers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TurnBasedMatcheResetForAllPlayerCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Get the list of players hidden from the given application. This method is only available to user accounts for your developer console. -/// -/// A builder for the *listHidden* method supported by a *application* resource. -/// It is not used directly, but through a `ApplicationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.applications().list_hidden("applicationId") -/// .page_token("dolores") -/// .max_results(-61) -/// .doit(); -/// # } -/// ``` -pub struct ApplicationListHiddenCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _application_id: String, - _page_token: Option, - _max_results: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ApplicationListHiddenCall<'a, C, A> {} - -impl<'a, C, A> ApplicationListHiddenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HiddenPlayerList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.applications.listHidden", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("applicationId", self._application_id.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - for &field in ["alt", "applicationId", "pageToken", "maxResults"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "applications/{applicationId}/players/hidden"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{applicationId}", "applicationId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["applicationId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The application ID from the Google Play developer console. - /// - /// Sets the *application id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn application_id(mut self, new_value: &str) -> ApplicationListHiddenCall<'a, C, A> { - self._application_id = new_value.to_string(); - self - } - /// The token returned by the previous request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ApplicationListHiddenCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: i32) -> ApplicationListHiddenCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ApplicationListHiddenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ApplicationListHiddenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ApplicationListHiddenCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes rooms where the only room participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console. -/// -/// A builder for the *resetForAllPlayers* method supported by a *room* resource. -/// It is not used directly, but through a `RoomMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.rooms().reset_for_all_players() -/// .doit(); -/// # } -/// ``` -pub struct RoomResetForAllPlayerCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RoomResetForAllPlayerCall<'a, C, A> {} - -impl<'a, C, A> RoomResetForAllPlayerCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.rooms.resetForAllPlayers", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "rooms/resetForAllPlayers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RoomResetForAllPlayerCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RoomResetForAllPlayerCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RoomResetForAllPlayerCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Reset all rooms for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application. -/// -/// A builder for the *reset* method supported by a *room* resource. -/// It is not used directly, but through a `RoomMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.rooms().reset() -/// .doit(); -/// # } -/// ``` -pub struct RoomResetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for RoomResetCall<'a, C, A> {} - -impl<'a, C, A> RoomResetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.rooms.reset", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "rooms/reset"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> RoomResetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> RoomResetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> RoomResetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Resets all draft quests for all players. This method is only available to user accounts for your developer console. -/// -/// A builder for the *resetAllForAllPlayers* method supported by a *quest* resource. -/// It is not used directly, but through a `QuestMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.quests().reset_all_for_all_players() -/// .doit(); -/// # } -/// ``` -pub struct QuestResetAllForAllPlayerCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for QuestResetAllForAllPlayerCall<'a, C, A> {} - -impl<'a, C, A> QuestResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.quests.resetAllForAllPlayers", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "quests/resetAllForAllPlayers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestResetAllForAllPlayerCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestResetAllForAllPlayerCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestResetAllForAllPlayerCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Resets quests with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft quests may be reset. -/// -/// A builder for the *resetMultipleForAllPlayers* method supported by a *quest* resource. -/// It is not used directly, but through a `QuestMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// use gamesmanagement1_management::QuestsResetMultipleForAllRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = QuestsResetMultipleForAllRequest::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.quests().reset_multiple_for_all_players(req) -/// .doit(); -/// # } -/// ``` -pub struct QuestResetMultipleForAllPlayerCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _request: QuestsResetMultipleForAllRequest, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for QuestResetMultipleForAllPlayerCall<'a, C, A> {} - -impl<'a, C, A> QuestResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.quests.resetMultipleForAllPlayers", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "quests/resetMultipleForAllPlayers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: QuestsResetMultipleForAllRequest) -> QuestResetMultipleForAllPlayerCall<'a, C, A> { - self._request = new_value; - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestResetMultipleForAllPlayerCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestResetMultipleForAllPlayerCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestResetMultipleForAllPlayerCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Resets all player progress on all quests for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. -/// -/// A builder for the *resetAll* method supported by a *quest* resource. -/// It is not used directly, but through a `QuestMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.quests().reset_all() -/// .doit(); -/// # } -/// ``` -pub struct QuestResetAllCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for QuestResetAllCall<'a, C, A> {} - -impl<'a, C, A> QuestResetAllCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.quests.resetAll", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(1 + self._additional_params.len()); - for &field in [].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "quests/reset"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestResetAllCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestResetAllCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestResetAllCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Resets all player progress on the quest with the given ID for all players. This method is only available to user accounts for your developer console. Only draft quests can be reset. -/// -/// A builder for the *resetForAllPlayers* method supported by a *quest* resource. -/// It is not used directly, but through a `QuestMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.quests().reset_for_all_players("questId") -/// .doit(); -/// # } -/// ``` -pub struct QuestResetForAllPlayerCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _quest_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for QuestResetForAllPlayerCall<'a, C, A> {} - -impl<'a, C, A> QuestResetForAllPlayerCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.quests.resetForAllPlayers", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - params.push(("questId", self._quest_id.to_string())); - for &field in ["questId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "quests/{questId}/resetForAllPlayers"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{questId}", "questId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["questId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the quest. - /// - /// Sets the *quest id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn quest_id(mut self, new_value: &str) -> QuestResetForAllPlayerCall<'a, C, A> { - self._quest_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestResetForAllPlayerCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestResetForAllPlayerCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestResetForAllPlayerCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Resets all player progress on the quest with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. -/// -/// A builder for the *reset* method supported by a *quest* resource. -/// It is not used directly, but through a `QuestMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_gamesmanagement1_management as gamesmanagement1_management; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use gamesmanagement1_management::GamesManagement; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = GamesManagement::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.quests().reset("questId") -/// .doit(); -/// # } -/// ``` -pub struct QuestResetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a GamesManagement, - _quest_id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for QuestResetCall<'a, C, A> {} - -impl<'a, C, A> QuestResetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "gamesManagement.quests.reset", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - params.push(("questId", self._quest_id.to_string())); - for &field in ["questId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "quests/{questId}/reset"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Game.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{questId}", "questId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["questId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the quest. - /// - /// Sets the *quest id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn quest_id(mut self, new_value: &str) -> QuestResetCall<'a, C, A> { - self._quest_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> QuestResetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> QuestResetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Game`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> QuestResetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Resets all draft events for all players. This method is only available to user accounts for your developer console. All quests that use any of these events will also be reset. +/// Resets all draft events for all players. This method is only available to user accounts for your developer console. /// /// A builder for the *resetAllForAllPlayers* method supported by a *event* resource. /// It is not used directly, but through a `EventMethods` instance. @@ -6508,7 +5295,7 @@ impl<'a, C, A> EventResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut EventResetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player will also be reset. +/// Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. /// /// A builder for the *resetAll* method supported by a *event* resource. /// It is not used directly, but through a `EventMethods` instance. @@ -6933,7 +5720,7 @@ impl<'a, C, A> EventResetAllCall<'a, C, A> where C: BorrowMut, A: } -/// Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. All quests that use any of the events will also be reset. +/// Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. /// /// A builder for the *resetMultipleForAllPlayers* method supported by a *event* resource. /// It is not used directly, but through a `EventMethods` instance. @@ -7160,7 +5947,7 @@ impl<'a, C, A> EventResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with gan (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gan1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-gan1_beta1] path = "../gan1_beta1" -version = "1.0.12+20130205" +version = "1.0.13+20130205" diff --git a/gen/gan1_beta1-cli/README.md b/gen/gan1_beta1-cli/README.md index 9211784b8d..b3e118dd69 100644 --- a/gen/gan1_beta1-cli/README.md +++ b/gen/gan1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *gan* API at revision *20130205*. The CLI is at version *1.0.12*. +This documentation was generated from the *gan* API at revision *20130205*. The CLI is at version *1.0.13*. ```bash gan1-beta1 [options] diff --git a/gen/gan1_beta1-cli/mkdocs.yml b/gen/gan1_beta1-cli/mkdocs.yml index 2436ab5238..1790891980 100644 --- a/gen/gan1_beta1-cli/mkdocs.yml +++ b/gen/gan1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: gan v1.0.12+20130205 +site_name: gan v1.0.13+20130205 site_url: http://byron.github.io/google-apis-rs/google-gan1_beta1-cli site_description: A complete library to interact with gan (protocol v1beta1) diff --git a/gen/gan1_beta1-cli/src/main.rs b/gen/gan1_beta1-cli/src/main.rs index 0223ba1e93..759ad24c67 100644 --- a/gen/gan1_beta1-cli/src/main.rs +++ b/gen/gan1_beta1-cli/src/main.rs @@ -1263,7 +1263,7 @@ fn main() { let mut app = App::new("gan1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20130205") + .version("1.0.13+20130205") .about("Lets you have programmatic access to your Google Affiliate Network data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_gan1_beta1_cli") .arg(Arg::with_name("folder") diff --git a/gen/gan1_beta1/Cargo.toml b/gen/gan1_beta1/Cargo.toml index 313d9b04a4..7cc150e25b 100644 --- a/gen/gan1_beta1/Cargo.toml +++ b/gen/gan1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gan1_beta1" -version = "1.0.12+20130205" +version = "1.0.13+20130205" authors = ["Sebastian Thiel "] description = "A complete library to interact with gan (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/gan1_beta1" homepage = "https://developers.google.com/affiliate-network/" -documentation = "https://docs.rs/google-gan1_beta1/1.0.12+20130205" +documentation = "https://docs.rs/google-gan1_beta1/1.0.13+20130205" license = "MIT" keywords = ["gan", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/gan1_beta1/README.md b/gen/gan1_beta1/README.md index b34390c198..ef4054f21f 100644 --- a/gen/gan1_beta1/README.md +++ b/gen/gan1_beta1/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-gan1_beta1` library allows access to all features of the *Google gan* service. -This documentation was generated from *gan* crate version *1.0.12+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *gan* crate version *1.0.13+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *gan* *v1_beta1* API can be found at the [official documentation site](https://developers.google.com/affiliate-network/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.Gan.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.Gan.html) ... -* [advertisers](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.Advertiser.html) - * [*get*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.AdvertiserGetCall.html) and [*list*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.AdvertiserListCall.html) -* [cc offers](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.CcOffer.html) - * [*list*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.CcOfferListCall.html) -* [events](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.Event.html) - * [*list*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.EventListCall.html) -* [links](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.Link.html) - * [*get*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.LinkGetCall.html), [*insert*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.LinkInsertCall.html) and [*list*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.LinkListCall.html) -* [publishers](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.Publisher.html) - * [*get*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.PublisherGetCall.html) and [*list*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.PublisherListCall.html) -* [reports](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.Report.html) - * [*get*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.ReportGetCall.html) +* [advertisers](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.Advertiser.html) + * [*get*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.AdvertiserGetCall.html) and [*list*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.AdvertiserListCall.html) +* [cc offers](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.CcOffer.html) + * [*list*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.CcOfferListCall.html) +* [events](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.Event.html) + * [*list*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.EventListCall.html) +* [links](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.Link.html) + * [*get*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.LinkGetCall.html), [*insert*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.LinkInsertCall.html) and [*list*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.LinkListCall.html) +* [publishers](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.Publisher.html) + * [*get*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.PublisherGetCall.html) and [*list*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.PublisherListCall.html) +* [reports](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.Report.html) + * [*get*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.ReportGetCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/struct.Gan.html)** +* **[Hub](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/struct.Gan.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -149,17 +149,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -169,29 +169,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-gan1_beta1/1.0.12+20130205/google_gan1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gan1_beta1/1.0.13+20130205/google_gan1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/gan1_beta1/src/lib.rs b/gen/gan1_beta1/src/lib.rs index 17a9af89af..db9ea63314 100644 --- a/gen/gan1_beta1/src/lib.rs +++ b/gen/gan1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *gan* crate version *1.0.12+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *gan* crate version *1.0.13+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *gan* *v1_beta1* API can be found at the //! [official documentation site](https://developers.google.com/affiliate-network/). @@ -333,7 +333,7 @@ impl<'a, C, A> Gan Gan { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/gan/v1beta1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -359,7 +359,7 @@ impl<'a, C, A> Gan } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/genomics1-cli/Cargo.toml b/gen/genomics1-cli/Cargo.toml index 8589e200fd..4776a06540 100644 --- a/gen/genomics1-cli/Cargo.toml +++ b/gen/genomics1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-genomics1-cli" -version = "1.0.12+20190704" +version = "1.0.13+20200316" authors = ["Sebastian Thiel "] description = "A complete library to interact with genomics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-genomics1] path = "../genomics1" -version = "1.0.12+20190704" +version = "1.0.13+20200316" diff --git a/gen/genomics1-cli/README.md b/gen/genomics1-cli/README.md index 9a09df705c..dc8bbe2e0f 100644 --- a/gen/genomics1-cli/README.md +++ b/gen/genomics1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *genomics* API at revision *20190704*. The CLI is at version *1.0.12*. +This documentation was generated from the *genomics* API at revision *20200316*. The CLI is at version *1.0.13*. ```bash genomics1 [options] diff --git a/gen/genomics1-cli/mkdocs.yml b/gen/genomics1-cli/mkdocs.yml index 8f3ab6aaa2..d28b7e442e 100644 --- a/gen/genomics1-cli/mkdocs.yml +++ b/gen/genomics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: genomics v1.0.12+20190704 +site_name: genomics v1.0.13+20200316 site_url: http://byron.github.io/google-apis-rs/google-genomics1-cli site_description: A complete library to interact with genomics (protocol v1) diff --git a/gen/genomics1-cli/src/main.rs b/gen/genomics1-cli/src/main.rs index 085a099a84..538da03316 100644 --- a/gen/genomics1-cli/src/main.rs +++ b/gen/genomics1-cli/src/main.rs @@ -446,7 +446,7 @@ fn main() { let mut app = App::new("genomics1") .author("Sebastian Thiel ") - .version("1.0.12+20190704") + .version("1.0.13+20200316") .about("Uploads, processes, queries, and searches Genomics data in the cloud.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_genomics1_cli") .arg(Arg::with_name("url") diff --git a/gen/genomics1/Cargo.toml b/gen/genomics1/Cargo.toml index 6c06c231be..c5123f61ae 100644 --- a/gen/genomics1/Cargo.toml +++ b/gen/genomics1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-genomics1" -version = "1.0.12+20190704" +version = "1.0.13+20200316" authors = ["Sebastian Thiel "] description = "A complete library to interact with genomics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1" homepage = "https://cloud.google.com/genomics" -documentation = "https://docs.rs/google-genomics1/1.0.12+20190704" +documentation = "https://docs.rs/google-genomics1/1.0.13+20200316" license = "MIT" keywords = ["genomics", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/genomics1/README.md b/gen/genomics1/README.md index 5fb946c9d9..8a1b24706e 100644 --- a/gen/genomics1/README.md +++ b/gen/genomics1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-genomics1` library allows access to all features of the *Google genomics* service. -This documentation was generated from *genomics* crate version *1.0.12+20190704*, where *20190704* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *genomics* crate version *1.0.13+20200316*, where *20200316* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *genomics* *v1* API can be found at the [official documentation site](https://cloud.google.com/genomics). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/struct.Genomics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/struct.Genomics.html) ... -* [operations](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/struct.OperationListCall.html) +* [operations](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/struct.OperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/struct.Genomics.html)** +* **[Hub](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/struct.Genomics.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.Part.html)** + * **[Parts](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -129,17 +129,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -149,29 +149,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-genomics1/1.0.12+20190704/google_genomics1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-genomics1/1.0.13+20200316/google_genomics1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/genomics1/src/lib.rs b/gen/genomics1/src/lib.rs index 8d8fd07696..f1ae9b8cfc 100644 --- a/gen/genomics1/src/lib.rs +++ b/gen/genomics1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *genomics* crate version *1.0.12+20190704*, where *20190704* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *genomics* crate version *1.0.13+20200316*, where *20200316* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *genomics* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/genomics). @@ -329,7 +329,7 @@ impl<'a, C, A> Genomics Genomics { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://genomics.googleapis.com/".to_string(), _root_url: "https://genomics.googleapis.com/".to_string(), } @@ -340,7 +340,7 @@ impl<'a, C, A> Genomics } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/groupsmigration1-cli/Cargo.toml b/gen/groupsmigration1-cli/Cargo.toml index 985fd2674b..5ad5c7edc2 100644 --- a/gen/groupsmigration1-cli/Cargo.toml +++ b/gen/groupsmigration1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupsmigration1-cli" -version = "1.0.12+20181126" +version = "1.0.13+20181126" authors = ["Sebastian Thiel "] description = "A complete library to interact with Groups Migration (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-groupsmigration1] path = "../groupsmigration1" -version = "1.0.12+20181126" +version = "1.0.13+20181126" diff --git a/gen/groupsmigration1-cli/README.md b/gen/groupsmigration1-cli/README.md index 800cc0629f..fede9970fe 100644 --- a/gen/groupsmigration1-cli/README.md +++ b/gen/groupsmigration1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Groups Migration* API at revision *20181126*. The CLI is at version *1.0.12*. +This documentation was generated from the *Groups Migration* API at revision *20181126*. The CLI is at version *1.0.13*. ```bash groupsmigration1 [options] diff --git a/gen/groupsmigration1-cli/mkdocs.yml b/gen/groupsmigration1-cli/mkdocs.yml index 0015dc7e06..de80d1f96a 100644 --- a/gen/groupsmigration1-cli/mkdocs.yml +++ b/gen/groupsmigration1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Groups Migration v1.0.12+20181126 +site_name: Groups Migration v1.0.13+20181126 site_url: http://byron.github.io/google-apis-rs/google-groupsmigration1-cli site_description: A complete library to interact with Groups Migration (protocol v1) diff --git a/gen/groupsmigration1-cli/src/main.rs b/gen/groupsmigration1-cli/src/main.rs index 65c9d72995..4155f51c4f 100644 --- a/gen/groupsmigration1-cli/src/main.rs +++ b/gen/groupsmigration1-cli/src/main.rs @@ -236,7 +236,7 @@ fn main() { let mut app = App::new("groupsmigration1") .author("Sebastian Thiel ") - .version("1.0.12+20181126") + .version("1.0.13+20181126") .about("Groups Migration Api.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_groupsmigration1_cli") .arg(Arg::with_name("url") diff --git a/gen/groupsmigration1/Cargo.toml b/gen/groupsmigration1/Cargo.toml index 6a271523ba..60016fb99c 100644 --- a/gen/groupsmigration1/Cargo.toml +++ b/gen/groupsmigration1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-groupsmigration1" -version = "1.0.12+20181126" +version = "1.0.13+20181126" authors = ["Sebastian Thiel "] description = "A complete library to interact with Groups Migration (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupsmigration1" homepage = "https://developers.google.com/google-apps/groups-migration/" -documentation = "https://docs.rs/google-groupsmigration1/1.0.12+20181126" +documentation = "https://docs.rs/google-groupsmigration1/1.0.13+20181126" license = "MIT" keywords = ["groupsmigration", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/groupsmigration1/README.md b/gen/groupsmigration1/README.md index 9c3a61796a..c7dbe5ce3c 100644 --- a/gen/groupsmigration1/README.md +++ b/gen/groupsmigration1/README.md @@ -5,21 +5,21 @@ DO NOT EDIT ! --> The `google-groupsmigration1` library allows access to all features of the *Google Groups Migration* service. -This documentation was generated from *Groups Migration* crate version *1.0.12+20181126*, where *20181126* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Groups Migration* crate version *1.0.13+20181126*, where *20181126* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Groups Migration* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-migration/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/struct.GroupsMigration.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/struct.GroupsMigration.html) ... * archive - * [*insert*](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/struct.ArchiveInsertCall.html) + * [*insert*](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/struct.ArchiveInsertCall.html) Upload supported by ... -* [*insert archive*](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/struct.ArchiveInsertCall.html) +* [*insert archive*](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/struct.ArchiveInsertCall.html) @@ -27,17 +27,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/struct.GroupsMigration.html)** +* **[Hub](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/struct.GroupsMigration.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.Part.html)** + * **[Parts](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -129,17 +129,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -149,29 +149,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-groupsmigration1/1.0.12+20181126/google_groupsmigration1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-groupsmigration1/1.0.13+20181126/google_groupsmigration1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/groupsmigration1/src/lib.rs b/gen/groupsmigration1/src/lib.rs index 47a07d4b12..ff72acaa29 100644 --- a/gen/groupsmigration1/src/lib.rs +++ b/gen/groupsmigration1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Groups Migration* crate version *1.0.12+20181126*, where *20181126* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Groups Migration* crate version *1.0.13+20181126*, where *20181126* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Groups Migration* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-migration/). @@ -323,7 +323,7 @@ impl<'a, C, A> GroupsMigration GroupsMigration { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/groups/v1/groups/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -334,7 +334,7 @@ impl<'a, C, A> GroupsMigration } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/groupssettings1-cli/Cargo.toml b/gen/groupssettings1-cli/Cargo.toml index 65f2380599..bfd7b534a6 100644 --- a/gen/groupssettings1-cli/Cargo.toml +++ b/gen/groupssettings1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-groupssettings1-cli" -version = "1.0.12+20190315" +version = "1.0.13+20190725" authors = ["Sebastian Thiel "] description = "A complete library to interact with groupssettings (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-groupssettings1] path = "../groupssettings1" -version = "1.0.12+20190315" +version = "1.0.13+20190725" diff --git a/gen/groupssettings1-cli/README.md b/gen/groupssettings1-cli/README.md index 2d5b0769c7..efa9c15b51 100644 --- a/gen/groupssettings1-cli/README.md +++ b/gen/groupssettings1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *groupssettings* API at revision *20190315*. The CLI is at version *1.0.12*. +This documentation was generated from the *groupssettings* API at revision *20190725*. The CLI is at version *1.0.13*. ```bash groupssettings1 [options] diff --git a/gen/groupssettings1-cli/mkdocs.yml b/gen/groupssettings1-cli/mkdocs.yml index f47e6ea175..e1cb87c322 100644 --- a/gen/groupssettings1-cli/mkdocs.yml +++ b/gen/groupssettings1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: groupssettings v1.0.12+20190315 +site_name: groupssettings v1.0.13+20190725 site_url: http://byron.github.io/google-apis-rs/google-groupssettings1-cli site_description: A complete library to interact with groupssettings (protocol v1) diff --git a/gen/groupssettings1-cli/src/main.rs b/gen/groupssettings1-cli/src/main.rs index d393df5452..adb50cc400 100644 --- a/gen/groupssettings1-cli/src/main.rs +++ b/gen/groupssettings1-cli/src/main.rs @@ -499,7 +499,7 @@ fn main() { vec![ (Some(r##"group-unique-id"##), None, - Some(r##"The resource ID"##), + Some(r##"The group's email address."##), Some(true), Some(false)), @@ -521,7 +521,7 @@ fn main() { vec![ (Some(r##"group-unique-id"##), None, - Some(r##"The resource ID"##), + Some(r##"The group's email address."##), Some(true), Some(false)), @@ -549,7 +549,7 @@ fn main() { vec![ (Some(r##"group-unique-id"##), None, - Some(r##"The resource ID"##), + Some(r##"The group's email address."##), Some(true), Some(false)), @@ -577,7 +577,7 @@ fn main() { let mut app = App::new("groupssettings1") .author("Sebastian Thiel ") - .version("1.0.12+20190315") + .version("1.0.13+20190725") .about("Manages permission levels and related settings of a group.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_groupssettings1_cli") .arg(Arg::with_name("url") diff --git a/gen/groupssettings1/Cargo.toml b/gen/groupssettings1/Cargo.toml index 40cd55c0de..c297d9f468 100644 --- a/gen/groupssettings1/Cargo.toml +++ b/gen/groupssettings1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-groupssettings1" -version = "1.0.12+20190315" +version = "1.0.13+20190725" authors = ["Sebastian Thiel "] description = "A complete library to interact with groupssettings (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/groupssettings1" homepage = "https://developers.google.com/google-apps/groups-settings/get_started" -documentation = "https://docs.rs/google-groupssettings1/1.0.12+20190315" +documentation = "https://docs.rs/google-groupssettings1/1.0.13+20190725" license = "MIT" keywords = ["groupssettings", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/groupssettings1/README.md b/gen/groupssettings1/README.md index f78406e333..07bb5a2242 100644 --- a/gen/groupssettings1/README.md +++ b/gen/groupssettings1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-groupssettings1` library allows access to all features of the *Google groupssettings* service. -This documentation was generated from *groupssettings* crate version *1.0.12+20190315*, where *20190315* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *groupssettings* crate version *1.0.13+20190725*, where *20190725* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *groupssettings* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/struct.Groupssettings.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/struct.Groupssettings.html) ... * groups - * [*get*](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/struct.GroupGetCall.html), [*patch*](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/struct.GroupUpdateCall.html) + * [*get*](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/struct.GroupGetCall.html), [*patch*](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/struct.GroupUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/struct.Groupssettings.html)** +* **[Hub](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/struct.Groupssettings.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.Part.html)** + * **[Parts](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-groupssettings1/1.0.12+20190315/google_groupssettings1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-groupssettings1/1.0.13+20190725/google_groupssettings1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/groupssettings1/src/lib.rs b/gen/groupssettings1/src/lib.rs index 99e1f69c7a..b56bda50b2 100644 --- a/gen/groupssettings1/src/lib.rs +++ b/gen/groupssettings1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *groupssettings* crate version *1.0.12+20190315*, where *20190315* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *groupssettings* crate version *1.0.13+20190725*, where *20190725* is the exact revision of the *groupssettings:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *groupssettings* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/groups-settings/get_started). @@ -331,7 +331,7 @@ impl<'a, C, A> Groupssettings Groupssettings { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/groups/v1/groups/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -342,7 +342,7 @@ impl<'a, C, A> Groupssettings } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -383,183 +383,384 @@ impl<'a, C, A> Groupssettings /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Groups { - /// Permission to ban users. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Specifies who can deny membership to users. This permission will be deprecated once it is merged into the new whoCanModerateMembers setting. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanBanUsers")] pub who_can_ban_users: Option, - /// Permission for content assistants. Possible values are: Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Specifies who can moderate metadata. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanAssistContent")] pub who_can_assist_content: Option, - /// Are external members allowed to join the group. + /// Identifies whether members external to your organization can join the group. Possible values are: + /// - true: G Suite users external to your organization can become members of this group. + /// - false: Users not belonging to the organization are not allowed to become members of this group. #[serde(rename="allowExternalMembers")] pub allow_external_members: Option, - /// Permission to enter free form tags for topics in a forum. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to enter free form tags for topics in a forum. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanEnterFreeFormTags")] pub who_can_enter_free_form_tags: Option, - /// Permission to approve pending messages in the moderation queue. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can approve pending messages in the moderation queue. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanApproveMessages")] pub who_can_approve_messages: Option, - /// Permission to mark a topic as a duplicate of another topic. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to mark a topic as a duplicate of another topic. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanMarkDuplicate")] pub who_can_mark_duplicate: Option, - /// Permissions to join the group. Possible values are: ANYONE_CAN_JOIN ALL_IN_DOMAIN_CAN_JOIN INVITED_CAN_JOIN CAN_REQUEST_TO_JOIN + /// Permission to join group. Possible values are: + /// - ANYONE_CAN_JOIN: Anyone in the account domain can join. This includes accounts with multiple domains. + /// - ALL_IN_DOMAIN_CAN_JOIN: Any Internet user who is outside your domain can access your Google Groups service and view the list of groups in your Groups directory. Warning: Group owners can add external addresses, outside of the domain to their groups. They can also allow people outside your domain to join their groups. If you later disable this option, any external addresses already added to users' groups remain in those groups. + /// - INVITED_CAN_JOIN: Candidates for membership can be invited to join. + /// - CAN_REQUEST_TO_JOIN: Non members can request an invitation to join. #[serde(rename="whoCanJoin")] pub who_can_join: Option, - /// Permission to change tags and categories. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to change tags and categories. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanModifyTagsAndCategories")] pub who_can_modify_tags_and_categories: Option, - /// Permission to mark a topic as not needing a response. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to mark a topic as not needing a response. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanMarkNoResponseNeeded")] pub who_can_mark_no_response_needed: Option, - /// Permission to unmark any post from a favorite reply. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to unmark any post from a favorite reply. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanUnmarkFavoriteReplyOnAnyTopic")] pub who_can_unmark_favorite_reply_on_any_topic: Option, - /// Permission for content moderation. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Specifies who can moderate content. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanModerateContent")] pub who_can_moderate_content: Option, - /// Primary language for the group. + /// The primary language for group. For a group's primary language use the language tags from the G Suite languages found at G Suite Email Settings API Email Language Tags. #[serde(rename="primaryLanguage")] pub primary_language: Option, - /// Permission to mark a post for a topic they started as a favorite reply. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to mark a post for a topic they started as a favorite reply. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanMarkFavoriteReplyOnOwnTopic")] pub who_can_mark_favorite_reply_on_own_topic: Option, - /// Permissions to view membership. Possible values are: ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW ALL_OWNERS_CAN_VIEW + /// Permissions to view membership. Possible values are: + /// - ALL_IN_DOMAIN_CAN_VIEW: Anyone in the account can view the group members list. + /// If a group already has external members, those members can still send email to this group. + /// + /// - ALL_MEMBERS_CAN_VIEW: The group members can view the group members list. + /// - ALL_MANAGERS_CAN_VIEW: The group managers can view group members list. #[serde(rename="whoCanViewMembership")] pub who_can_view_membership: Option, - /// If favorite replies should be displayed above other replies. + /// Indicates if favorite replies should be displayed above other replies. + /// - true: Favorite replies will be displayed above other replies. + /// - false: Favorite replies will not be displayed above other replies. #[serde(rename="favoriteRepliesOnTop")] pub favorite_replies_on_top: Option, - /// Permission to mark any other user's post as a favorite reply. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to mark any other user's post as a favorite reply. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanMarkFavoriteReplyOnAnyTopic")] pub who_can_mark_favorite_reply_on_any_topic: Option, - /// Whether to include custom footer. + /// Whether to include custom footer. Possible values are: + /// - true + /// - false #[serde(rename="includeCustomFooter")] pub include_custom_footer: Option, - /// Permission to move topics out of the group or forum. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can move topics out of the group or forum. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanMoveTopicsOut")] pub who_can_move_topics_out: Option, - /// Default message deny notification message + /// When a message is rejected, this is text for the rejection notification sent to the message's author. By default, this property is empty and has no value in the API's response body. The maximum notification text size is 10,000 characters. Note: Requires sendMessageDenyNotification property to be true. #[serde(rename="defaultMessageDenyNotificationText")] pub default_message_deny_notification_text: Option, - /// If this groups should be included in global address list or not. + /// Enables the group to be included in the Global Address List. For more information, see the help center. Possible values are: + /// - true: Group is included in the Global Address List. + /// - false: Group is not included in the Global Address List. #[serde(rename="includeInGlobalAddressList")] pub include_in_global_address_list: Option, - /// If the group is archive only + /// Allows the group to be archived only. Possible values are: + /// - true: Group is archived and the group is inactive. New messages to this group are rejected. The older archived messages are browseable and searchable. + /// - If true, the whoCanPostMessage property is set to NONE_CAN_POST. + /// - If reverted from true to false, whoCanPostMessages is set to ALL_MANAGERS_CAN_POST. + /// - false: The group is active and can receive messages. + /// - When false, updating whoCanPostMessage to NONE_CAN_POST, results in an error. #[serde(rename="archiveOnly")] pub archive_only: Option, - /// Permission to delete topics. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can delete topics. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanDeleteTopics")] pub who_can_delete_topics: Option, - /// Permission to delete replies to topics. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can delete replies to topics. (Authors can always delete their own posts). Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanDeleteAnyPost")] pub who_can_delete_any_post: Option, - /// If the contents of the group are archived. + /// Allows the Group contents to be archived. Possible values are: + /// - true: Archive messages sent to the group. + /// - false: Do not keep an archive of messages sent to this group. If false, previously archived messages remain in the archive. #[serde(rename="isArchived")] pub is_archived: Option, - /// Can members post using the group email address. + /// Enables members to post messages as the group. Possible values are: + /// - true: Group member can post messages using the group's email address instead of their own email address. Message appear to originate from the group itself. Note: When true, any message moderation settings on individual users or new members do not apply to posts made on behalf of the group. + /// - false: Members can not post in behalf of the group's email address. #[serde(rename="membersCanPostAsTheGroup")] pub members_can_post_as_the_group: Option, - /// Permission to make topics appear at the top of the topic list. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can make topics appear at the top of the topic list. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanMakeTopicsSticky")] pub who_can_make_topics_sticky: Option, - /// If any of the settings that will be merged have custom roles which is anything other than owners, managers, or group scopes. + /// Specifies whether the group has a custom role that's included in one of the settings being merged. This field is read-only and update/patch requests to it are ignored. Possible values are: + /// - true + /// - false #[serde(rename="customRolesEnabledForSettingsToBeMerged")] pub custom_roles_enabled_for_settings_to_be_merged: Option, - /// Email id of the group + /// The group's email address. This property can be updated using the Directory API. Note: Only a group owner can change a group's email address. A group manager can't do this. + /// When you change your group's address using the Directory API or the control panel, you are changing the address your subscribers use to send email and the web address people use to access your group. People can't reach your group by visiting the old address. pub email: Option, - /// Permission for who can discover the group. Possible values are: ALL_MEMBERS_CAN_DISCOVER ALL_IN_DOMAIN_CAN_DISCOVER ANYONE_CAN_DISCOVER + /// Specifies the set of users for whom this group is discoverable. Possible values are: + /// - ANYONE_CAN_DISCOVER + /// - ALL_IN_DOMAIN_CAN_DISCOVER + /// - ALL_MEMBERS_CAN_DISCOVER #[serde(rename="whoCanDiscoverGroup")] pub who_can_discover_group: Option, - /// Permission to modify members (change member roles). Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateMembers setting. Specifies who can change group members' roles. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanModifyMembers")] pub who_can_modify_members: Option, - /// Moderation level for messages. Possible values are: MODERATE_ALL_MESSAGES MODERATE_NON_MEMBERS MODERATE_NEW_MEMBERS MODERATE_NONE + /// Moderation level of incoming messages. Possible values are: + /// - MODERATE_ALL_MESSAGES: All messages are sent to the group owner's email address for approval. If approved, the message is sent to the group. + /// - MODERATE_NON_MEMBERS: All messages from non group members are sent to the group owner's email address for approval. If approved, the message is sent to the group. + /// - MODERATE_NEW_MEMBERS: All messages from new members are sent to the group owner's email address for approval. If approved, the message is sent to the group. + /// - MODERATE_NONE: No moderator approval is required. Messages are delivered directly to the group. Note: When the whoCanPostMessage is set to ANYONE_CAN_POST, we recommend the messageModerationLevel be set to MODERATE_NON_MEMBERS to protect the group from possible spam. + /// When memberCanPostAsTheGroup is true, any message moderation settings on individual users or new members will not apply to posts made on behalf of the group. #[serde(rename="messageModerationLevel")] pub message_moderation_level: Option, - /// Description of the group + /// Description of the group. This property value may be an empty string if no group description has been entered. If entered, the maximum group description is no more than 300 characters. pub description: Option, - /// Permission to unassign any topic in a forum. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to unassign any topic in a forum. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanUnassignTopic")] pub who_can_unassign_topic: Option, - /// Whome should the default reply to a message go to. Possible values are: REPLY_TO_CUSTOM REPLY_TO_SENDER REPLY_TO_LIST REPLY_TO_OWNER REPLY_TO_IGNORE REPLY_TO_MANAGERS + /// Specifies who should the default reply go to. Possible values are: + /// - REPLY_TO_CUSTOM: For replies to messages, use the group's custom email address. + /// When the group's ReplyTo property is set to REPLY_TO_CUSTOM, the customReplyTo property holds the custom email address used when replying to a message. If the group's ReplyTo property is set to REPLY_TO_CUSTOM, the customReplyTo property must have a value. Otherwise an error is returned. + /// + /// - REPLY_TO_SENDER: The reply sent to author of message. + /// - REPLY_TO_LIST: This reply message is sent to the group. + /// - REPLY_TO_OWNER: The reply is sent to the owner(s) of the group. This does not include the group's managers. + /// - REPLY_TO_IGNORE: Group users individually decide where the message reply is sent. + /// - REPLY_TO_MANAGERS: This reply message is sent to the group's managers, which includes all managers and the group owner. #[serde(rename="replyTo")] pub reply_to: Option, - /// Default email to which reply to any message should go. + /// An email address used when replying to a message if the replyTo property is set to REPLY_TO_CUSTOM. This address is defined by an account administrator. + /// - When the group's ReplyTo property is set to REPLY_TO_CUSTOM, the customReplyTo property holds a custom email address used when replying to a message. + /// - If the group's ReplyTo property is set to REPLY_TO_CUSTOM, the customReplyTo property must have a text value or an error is returned. #[serde(rename="customReplyTo")] pub custom_reply_to: Option, - /// Should the member be notified if his message is denied by owner. + /// Allows a member to be notified if the member's message to the group is denied by the group owner. Possible values are: + /// - true: When a message is rejected, send the deny message notification to the message author. + /// The defaultMessageDenyNotificationText property is dependent on the sendMessageDenyNotification property being true. + /// + /// - false: When a message is rejected, no notification is sent. #[serde(rename="sendMessageDenyNotification")] pub send_message_deny_notification: Option, - /// If a primary Collab Inbox feature is enabled. + /// Specifies whether a collaborative inbox will remain turned on for the group. Possible values are: + /// - true + /// - false #[serde(rename="enableCollaborativeInbox")] pub enable_collaborative_inbox: Option, - /// Permission to contact owner of the group via web UI. Possible values are: ANYONE_CAN_CONTACT ALL_IN_DOMAIN_CAN_CONTACT ALL_MEMBERS_CAN_CONTACT ALL_MANAGERS_CAN_CONTACT + /// Permission to contact owner of the group via web UI. Possible values are: + /// - ALL_IN_DOMAIN_CAN_CONTACT + /// - ALL_MANAGERS_CAN_CONTACT + /// - ALL_MEMBERS_CAN_CONTACT + /// - ANYONE_CAN_CONTACT #[serde(rename="whoCanContactOwner")] pub who_can_contact_owner: Option, - /// Default message display font. Possible values are: DEFAULT_FONT FIXED_WIDTH_FONT + /// Deprecated. The default message display font always has a value of "DEFAULT_FONT". #[serde(rename="messageDisplayFont")] pub message_display_font: Option, - /// Permission to leave the group. Possible values are: ALL_MANAGERS_CAN_LEAVE ALL_OWNERS_CAN_LEAVE ALL_MEMBERS_CAN_LEAVE NONE_CAN_LEAVE + /// Permission to leave the group. Possible values are: + /// - ALL_MANAGERS_CAN_LEAVE + /// - ALL_MEMBERS_CAN_LEAVE + /// - NONE_CAN_LEAVE #[serde(rename="whoCanLeaveGroup")] pub who_can_leave_group: Option, - /// Permissions to add members. Possible values are: ALL_MANAGERS_CAN_ADD ALL_OWNERS_CAN_ADD ALL_MEMBERS_CAN_ADD NONE_CAN_ADD + /// Deprecated. This is merged into the new whoCanModerateMembers setting. Permissions to add members. Possible values are: + /// - ALL_MEMBERS_CAN_ADD: Managers and members can directly add new members. + /// - ALL_MANAGERS_CAN_ADD: Only managers can directly add new members. this includes the group's owner. + /// - ALL_OWNERS_CAN_ADD: Only owners can directly add new members. + /// - NONE_CAN_ADD: No one can directly add new members. #[serde(rename="whoCanAdd")] pub who_can_add: Option, - /// Permissions to post messages to the group. Possible values are: NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST ALL_OWNERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST + /// Permissions to post messages. Possible values are: + /// - NONE_CAN_POST: The group is disabled and archived. No one can post a message to this group. + /// - When archiveOnly is false, updating whoCanPostMessage to NONE_CAN_POST, results in an error. + /// - If archiveOnly is reverted from true to false, whoCanPostMessages is set to ALL_MANAGERS_CAN_POST. + /// - ALL_MANAGERS_CAN_POST: Managers, including group owners, can post messages. + /// - ALL_MEMBERS_CAN_POST: Any group member can post a message. + /// - ALL_OWNERS_CAN_POST: Only group owners can post a message. + /// - ALL_IN_DOMAIN_CAN_POST: Anyone in the account can post a message. + /// - ANYONE_CAN_POST: Any Internet user who outside your account can access your Google Groups service and post a message. Note: When whoCanPostMessage is set to ANYONE_CAN_POST, we recommend the messageModerationLevel be set to MODERATE_NON_MEMBERS to protect the group from possible spam. #[serde(rename="whoCanPostMessage")] pub who_can_post_message: Option, - /// Permission to move topics into the group or forum. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can move topics into the group or forum. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanMoveTopicsIn")] pub who_can_move_topics_in: Option, - /// Permission to take topics in a forum. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to take topics in a forum. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanTakeTopics")] pub who_can_take_topics: Option, - /// Name of the Group + /// Name of the group, which has a maximum size of 75 characters. pub name: Option, - /// The type of the resource. + /// The type of the resource. It is always groupsSettings#groups. pub kind: Option, - /// Maximum message size allowed. + /// Deprecated. The maximum size of a message is 25Mb. #[serde(rename="maxMessageBytes")] pub max_message_bytes: Option, - /// Permissions to invite members. Possible values are: ALL_MEMBERS_CAN_INVITE ALL_MANAGERS_CAN_INVITE ALL_OWNERS_CAN_INVITE NONE_CAN_INVITE + /// Deprecated. This is merged into the new whoCanModerateMembers setting. Permissions to invite new members. Possible values are: + /// - ALL_MEMBERS_CAN_INVITE: Managers and members can invite a new member candidate. + /// - ALL_MANAGERS_CAN_INVITE: Only managers can invite a new member. This includes the group's owner. + /// - ALL_OWNERS_CAN_INVITE: Only owners can invite a new member. + /// - NONE_CAN_INVITE: No one can invite a new member candidate. #[serde(rename="whoCanInvite")] pub who_can_invite: Option, - /// Permission to approve members. Possible values are: ALL_OWNERS_CAN_APPROVE ALL_MANAGERS_CAN_APPROVE ALL_MEMBERS_CAN_APPROVE NONE_CAN_APPROVE + /// Specifies who can approve members who ask to join groups. This permission will be deprecated once it is merged into the new whoCanModerateMembers setting. Possible values are: + /// - ALL_MEMBERS_CAN_APPROVE + /// - ALL_MANAGERS_CAN_APPROVE + /// - ALL_OWNERS_CAN_APPROVE + /// - NONE_CAN_APPROVE #[serde(rename="whoCanApproveMembers")] pub who_can_approve_members: Option, - /// Moderation level for messages detected as spam. Possible values are: ALLOW MODERATE SILENTLY_MODERATE REJECT + /// Specifies moderation levels for messages detected as spam. Possible values are: + /// - ALLOW: Post the message to the group. + /// - MODERATE: Send the message to the moderation queue. This is the default. + /// - SILENTLY_MODERATE: Send the message to the moderation queue, but do not send notification to moderators. + /// - REJECT: Immediately reject the message. #[serde(rename="spamModerationLevel")] pub spam_moderation_level: Option, - /// If posting from web is allowed. + /// Allows posting from web. Possible values are: + /// - true: Allows any member to post to the group forum. + /// - false: Members only use Gmail to communicate with the group. #[serde(rename="allowWebPosting")] pub allow_web_posting: Option, - /// Permission for membership moderation. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Specifies who can manage members. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanModerateMembers")] pub who_can_moderate_members: Option, - /// Permission to add references to a topic. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This functionality is no longer supported in the Google Groups UI. The value is always "NONE". #[serde(rename="whoCanAddReferences")] pub who_can_add_references: Option, - /// Permissions to view group. Possible values are: ANYONE_CAN_VIEW ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW ALL_OWNERS_CAN_VIEW + /// Permissions to view group messages. Possible values are: + /// - ANYONE_CAN_VIEW: Any Internet user can view the group's messages. + /// - ALL_IN_DOMAIN_CAN_VIEW: Anyone in your account can view this group's messages. + /// - ALL_MEMBERS_CAN_VIEW: All group members can view the group's messages. + /// - ALL_MANAGERS_CAN_VIEW: Any group manager can view this group's messages. #[serde(rename="whoCanViewGroup")] pub who_can_view_group: Option, - /// Is the group listed in groups directory + /// Deprecated. This is merged into the new whoCanDiscoverGroup setting. Allows the group to be visible in the Groups Directory. Possible values are: + /// - true: All groups in the account are listed in the Groups directory. + /// - false: All groups in the account are not listed in the directory. #[serde(rename="showInGroupDirectory")] pub show_in_group_directory: Option, - /// Permission to post announcements, a special topic type. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can post announcements, a special topic type. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanPostAnnouncements")] pub who_can_post_announcements: Option, - /// Permission to lock topics. Possible values are: NONE OWNERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can prevent users from posting replies to topics. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanLockTopics")] pub who_can_lock_topics: Option, - /// Permission to assign topics in a forum to another user. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanAssistContent setting. Permission to assign topics in a forum to another user. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - MANAGERS_ONLY + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanAssignTopics")] pub who_can_assign_topics: Option, - /// Custom footer text. + /// Set the content of custom footer text. The maximum number of characters is 1,000. #[serde(rename="customFooterText")] pub custom_footer_text: Option, - /// Is google allowed to contact admins. + /// Deprecated. Allows Google to contact administrator of the group. + /// - true: Allow Google to contact managers of this group. Occasionally Google may send updates on the latest features, ask for input on new features, or ask for permission to highlight your group. + /// - false: Google can not contact managers of this group. #[serde(rename="allowGoogleCommunication")] pub allow_google_communication: Option, - /// Permission to hide posts by reporting them as abuse. Possible values are: NONE OWNERS_ONLY MANAGERS_ONLY OWNERS_AND_MANAGERS ALL_MEMBERS + /// Deprecated. This is merged into the new whoCanModerateContent setting. Specifies who can hide posts by reporting them as abuse. Possible values are: + /// - ALL_MEMBERS + /// - OWNERS_AND_MANAGERS + /// - OWNERS_ONLY + /// - NONE #[serde(rename="whoCanHideAbuse")] pub who_can_hide_abuse: Option, } @@ -619,7 +820,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `groupUniqueId` - The resource ID + /// * `groupUniqueId` - The group's email address. pub fn update(&self, request: Groups, group_unique_id: &str) -> GroupUpdateCall<'a, C, A> { GroupUpdateCall { hub: self.hub, @@ -638,7 +839,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `groupUniqueId` - The resource ID + /// * `groupUniqueId` - The group's email address. pub fn patch(&self, request: Groups, group_unique_id: &str) -> GroupPatchCall<'a, C, A> { GroupPatchCall { hub: self.hub, @@ -656,7 +857,7 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `groupUniqueId` - The resource ID + /// * `groupUniqueId` - The group's email address. pub fn get(&self, group_unique_id: &str) -> GroupGetCall<'a, C, A> { GroupGetCall { hub: self.hub, @@ -878,7 +1079,7 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } - /// The resource ID + /// The group's email address. /// /// Sets the *group unique id* path property to the given value. /// @@ -1149,7 +1350,7 @@ impl<'a, C, A> GroupPatchCall<'a, C, A> where C: BorrowMut, A: oa self._request = new_value; self } - /// The resource ID + /// The group's email address. /// /// Sets the *group unique id* path property to the given value. /// @@ -1389,7 +1590,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut } - /// The resource ID + /// The group's email address. /// /// Sets the *group unique id* path property to the given value. /// diff --git a/gen/healthcare1_beta1-cli/Cargo.toml b/gen/healthcare1_beta1-cli/Cargo.toml index 8b6192b3f2..b11dd50cb2 100644 --- a/gen/healthcare1_beta1-cli/Cargo.toml +++ b/gen/healthcare1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-healthcare1_beta1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200327" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Healthcare (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/healthcare1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-healthcare1_beta1] path = "../healthcare1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200327" diff --git a/gen/healthcare1_beta1-cli/README.md b/gen/healthcare1_beta1-cli/README.md index 44ea5fdd15..9fd855469a 100644 --- a/gen/healthcare1_beta1-cli/README.md +++ b/gen/healthcare1_beta1-cli/README.md @@ -25,15 +25,19 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Healthcare* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Healthcare* API at revision *20200327*. The CLI is at version *1.0.13*. ```bash healthcare1-beta1 [options] projects + locations-datasets-annotation-stores-get-iam-policy [-p ]... [-o ] + locations-datasets-annotation-stores-set-iam-policy (-r )... [-p ]... [-o ] + locations-datasets-annotation-stores-test-iam-permissions (-r )... [-p ]... [-o ] locations-datasets-create (-r )... [-p ]... [-o ] locations-datasets-deidentify (-r )... [-p ]... [-o ] locations-datasets-delete [-p ]... [-o ] locations-datasets-dicom-stores-create (-r )... [-p ]... [-o ] + locations-datasets-dicom-stores-deidentify (-r )... [-p ]... [-o ] locations-datasets-dicom-stores-delete [-p ]... [-o ] locations-datasets-dicom-stores-export (-r )... [-p ]... [-o ] locations-datasets-dicom-stores-get [-p ]... [-o ] @@ -64,6 +68,7 @@ healthcare1-beta1 [options] locations-datasets-dicom-stores-studies-store-instances (-r )... [-p ]... [-o ] locations-datasets-dicom-stores-test-iam-permissions (-r )... [-p ]... [-o ] locations-datasets-fhir-stores-create (-r )... [-p ]... [-o ] + locations-datasets-fhir-stores-deidentify (-r )... [-p ]... [-o ] locations-datasets-fhir-stores-delete [-p ]... [-o ] locations-datasets-fhir-stores-export (-r )... [-p ]... [-o ] locations-datasets-fhir-stores-fhir--observation-lastn [-p ]... [-o ] @@ -87,6 +92,7 @@ healthcare1-beta1 [options] locations-datasets-fhir-stores-import (-r )... [-p ]... [-o ] locations-datasets-fhir-stores-list [-p ]... [-o ] locations-datasets-fhir-stores-patch (-r )... [-p ]... [-o ] + locations-datasets-fhir-stores-search [-p ]... [-o ] locations-datasets-fhir-stores-set-iam-policy (-r )... [-p ]... [-o ] locations-datasets-fhir-stores-test-iam-permissions (-r )... [-p ]... [-o ] locations-datasets-get [-p ]... [-o ] @@ -106,6 +112,7 @@ healthcare1-beta1 [options] locations-datasets-hl7-v2-stores-set-iam-policy (-r )... [-p ]... [-o ] locations-datasets-hl7-v2-stores-test-iam-permissions (-r )... [-p ]... [-o ] locations-datasets-list [-p ]... [-o ] + locations-datasets-operations-cancel (-r )... [-p ]... [-o ] locations-datasets-operations-get [-p ]... [-o ] locations-datasets-operations-list [-p ]... [-o ] locations-datasets-patch (-r )... [-p ]... [-o ] diff --git a/gen/healthcare1_beta1-cli/mkdocs.yml b/gen/healthcare1_beta1-cli/mkdocs.yml index 458aac8b42..6fbe0fc244 100644 --- a/gen/healthcare1_beta1-cli/mkdocs.yml +++ b/gen/healthcare1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Healthcare v1.0.12+20190628 +site_name: Cloud Healthcare v1.0.13+20200327 site_url: http://byron.github.io/google-apis-rs/google-healthcare1_beta1-cli site_description: A complete library to interact with Cloud Healthcare (protocol v1beta1) @@ -9,10 +9,14 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['projects_locations-datasets-annotation-stores-get-iam-policy.md', 'Projects', 'Locations Datasets Annotation Stores Get Iam Policy'] +- ['projects_locations-datasets-annotation-stores-set-iam-policy.md', 'Projects', 'Locations Datasets Annotation Stores Set Iam Policy'] +- ['projects_locations-datasets-annotation-stores-test-iam-permissions.md', 'Projects', 'Locations Datasets Annotation Stores Test Iam Permissions'] - ['projects_locations-datasets-create.md', 'Projects', 'Locations Datasets Create'] - ['projects_locations-datasets-deidentify.md', 'Projects', 'Locations Datasets Deidentify'] - ['projects_locations-datasets-delete.md', 'Projects', 'Locations Datasets Delete'] - ['projects_locations-datasets-dicom-stores-create.md', 'Projects', 'Locations Datasets Dicom Stores Create'] +- ['projects_locations-datasets-dicom-stores-deidentify.md', 'Projects', 'Locations Datasets Dicom Stores Deidentify'] - ['projects_locations-datasets-dicom-stores-delete.md', 'Projects', 'Locations Datasets Dicom Stores Delete'] - ['projects_locations-datasets-dicom-stores-export.md', 'Projects', 'Locations Datasets Dicom Stores Export'] - ['projects_locations-datasets-dicom-stores-get.md', 'Projects', 'Locations Datasets Dicom Stores Get'] @@ -43,6 +47,7 @@ pages: - ['projects_locations-datasets-dicom-stores-studies-store-instances.md', 'Projects', 'Locations Datasets Dicom Stores Studies Store Instances'] - ['projects_locations-datasets-dicom-stores-test-iam-permissions.md', 'Projects', 'Locations Datasets Dicom Stores Test Iam Permissions'] - ['projects_locations-datasets-fhir-stores-create.md', 'Projects', 'Locations Datasets Fhir Stores Create'] +- ['projects_locations-datasets-fhir-stores-deidentify.md', 'Projects', 'Locations Datasets Fhir Stores Deidentify'] - ['projects_locations-datasets-fhir-stores-delete.md', 'Projects', 'Locations Datasets Fhir Stores Delete'] - ['projects_locations-datasets-fhir-stores-export.md', 'Projects', 'Locations Datasets Fhir Stores Export'] - ['projects_locations-datasets-fhir-stores-fhir--observation-lastn.md', 'Projects', 'Locations Datasets Fhir Stores Fhir Observation Lastn'] @@ -66,6 +71,7 @@ pages: - ['projects_locations-datasets-fhir-stores-import.md', 'Projects', 'Locations Datasets Fhir Stores Import'] - ['projects_locations-datasets-fhir-stores-list.md', 'Projects', 'Locations Datasets Fhir Stores List'] - ['projects_locations-datasets-fhir-stores-patch.md', 'Projects', 'Locations Datasets Fhir Stores Patch'] +- ['projects_locations-datasets-fhir-stores-search.md', 'Projects', 'Locations Datasets Fhir Stores Search'] - ['projects_locations-datasets-fhir-stores-set-iam-policy.md', 'Projects', 'Locations Datasets Fhir Stores Set Iam Policy'] - ['projects_locations-datasets-fhir-stores-test-iam-permissions.md', 'Projects', 'Locations Datasets Fhir Stores Test Iam Permissions'] - ['projects_locations-datasets-get.md', 'Projects', 'Locations Datasets Get'] @@ -85,6 +91,7 @@ pages: - ['projects_locations-datasets-hl7-v2-stores-set-iam-policy.md', 'Projects', 'Locations Datasets Hl7 V2 Stores Set Iam Policy'] - ['projects_locations-datasets-hl7-v2-stores-test-iam-permissions.md', 'Projects', 'Locations Datasets Hl7 V2 Stores Test Iam Permissions'] - ['projects_locations-datasets-list.md', 'Projects', 'Locations Datasets List'] +- ['projects_locations-datasets-operations-cancel.md', 'Projects', 'Locations Datasets Operations Cancel'] - ['projects_locations-datasets-operations-get.md', 'Projects', 'Locations Datasets Operations Get'] - ['projects_locations-datasets-operations-list.md', 'Projects', 'Locations Datasets Operations List'] - ['projects_locations-datasets-patch.md', 'Projects', 'Locations Datasets Patch'] diff --git a/gen/healthcare1_beta1-cli/src/main.rs b/gen/healthcare1_beta1-cli/src/main.rs index 46633c453c..64b175b037 100644 --- a/gen/healthcare1_beta1-cli/src/main.rs +++ b/gen/healthcare1_beta1-cli/src/main.rs @@ -46,6 +46,234 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _projects_locations_datasets_annotation_stores_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_datasets_annotation_stores_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_datasets_annotation_stores_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_datasets_annotation_stores_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_datasets_annotation_stores_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_datasets_annotation_stores_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_datasets_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -162,10 +390,11 @@ impl<'n> Engine<'n> { "destination-dataset" => Some(("destinationDataset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.dicom.filter-profile" => Some(("config.dicom.filterProfile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.dicom.remove-list.tags" => Some(("config.dicom.removeList.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dicom.skip-id-redaction" => Some(("config.dicom.skipIdRedaction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.dicom.keep-list.tags" => Some(("config.dicom.keepList.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.image.text-redaction-mode" => Some(("config.image.textRedactionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "destination-dataset", "dicom", "filter-profile", "image", "keep-list", "remove-list", "tags", "text-redaction-mode"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "destination-dataset", "dicom", "filter-profile", "image", "keep-list", "remove-list", "skip-id-redaction", "tags", "text-redaction-mode"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -368,6 +597,97 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_datasets_dicom_stores_deidentify(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "filter-config.resource-paths-gcs-uri" => Some(("filterConfig.resourcePathsGcsUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destination-store" => Some(("destinationStore", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dicom.filter-profile" => Some(("config.dicom.filterProfile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dicom.remove-list.tags" => Some(("config.dicom.removeList.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dicom.skip-id-redaction" => Some(("config.dicom.skipIdRedaction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.dicom.keep-list.tags" => Some(("config.dicom.keepList.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.image.text-redaction-mode" => Some(("config.image.textRedactionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "destination-store", "dicom", "filter-config", "filter-profile", "image", "keep-list", "remove-list", "resource-paths-gcs-uri", "skip-id-redaction", "tags", "text-redaction-mode"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DeidentifyDicomStoreRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_datasets_dicom_stores_deidentify(request, opt.value_of("source-store").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_datasets_dicom_stores_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_datasets_dicom_stores_delete(opt.value_of("name").unwrap_or("")); @@ -2157,15 +2477,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "enable-history-import" => Some(("enableHistoryImport", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "enable-update-create" => Some(("enableUpdateCreate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notification-config.pubsub-topic" => Some(("notificationConfig.pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-search-handling-strict" => Some(("defaultSearchHandlingStrict", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "disable-referential-integrity" => Some(("disableReferentialIntegrity", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "disable-resource-versioning" => Some(("disableResourceVersioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["disable-referential-integrity", "disable-resource-versioning", "enable-history-import", "enable-update-create", "labels", "name", "notification-config", "pubsub-topic"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["default-search-handling-strict", "disable-referential-integrity", "disable-resource-versioning", "enable-update-create", "labels", "name", "notification-config", "pubsub-topic", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2229,6 +2550,97 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_datasets_fhir_stores_deidentify(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "resource-filter.resources.resources" => Some(("resourceFilter.resources.resources", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "destination-store" => Some(("destinationStore", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dicom.filter-profile" => Some(("config.dicom.filterProfile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.dicom.remove-list.tags" => Some(("config.dicom.removeList.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.dicom.skip-id-redaction" => Some(("config.dicom.skipIdRedaction", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.dicom.keep-list.tags" => Some(("config.dicom.keepList.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.image.text-redaction-mode" => Some(("config.image.textRedactionMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "destination-store", "dicom", "filter-profile", "image", "keep-list", "remove-list", "resource-filter", "resources", "skip-id-redaction", "tags", "text-redaction-mode"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DeidentifyFhirStoreRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_datasets_fhir_stores_deidentify(request, opt.value_of("source-store").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_datasets_fhir_stores_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_datasets_fhir_stores_delete(opt.value_of("name").unwrap_or("")); @@ -2304,12 +2716,13 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "bigquery-destination.force" => Some(("bigqueryDestination.force", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "bigquery-destination.dataset-uri" => Some(("bigqueryDestination.datasetUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "bigquery-destination.schema-config.schema-type" => Some(("bigqueryDestination.schemaConfig.schemaType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "bigquery-destination.schema-config.recursive-structure-depth" => Some(("bigqueryDestination.schemaConfig.recursiveStructureDepth", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "gcs-destination.uri-prefix" => Some(("gcsDestination.uriPrefix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-destination", "dataset-uri", "gcs-destination", "recursive-structure-depth", "schema-config", "schema-type", "uri-prefix"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-destination", "dataset-uri", "force", "gcs-destination", "recursive-structure-depth", "schema-config", "schema-type", "uri-prefix"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2433,6 +2846,12 @@ impl<'n> Engine<'n> { "end" => { call = call.end(value.unwrap_or("")); }, + "-page-token" => { + call = call._page_token(value.unwrap_or("")); + }, + "-count" => { + call = call._count(arg_from_str(value.unwrap_or("-0"), err, "-count", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2446,7 +2865,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["start", "end"].iter().map(|v|*v)); + v.extend(["start", "-count", "-page-token", "end"].iter().map(|v|*v)); v } )); } } @@ -3038,17 +3457,17 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { - "since" => { - call = call.since(value.unwrap_or("")); + "-since" => { + call = call._since(value.unwrap_or("")); }, - "page" => { - call = call.page(value.unwrap_or("")); + "-page-token" => { + call = call._page_token(value.unwrap_or("")); }, - "count" => { - call = call.count(arg_from_str(value.unwrap_or("-0"), err, "count", "integer")); + "-count" => { + call = call._count(arg_from_str(value.unwrap_or("-0"), err, "-count", "integer")); }, - "at" => { - call = call.at(value.unwrap_or("")); + "-at" => { + call = call._at(value.unwrap_or("")); }, _ => { let mut found = false; @@ -3063,7 +3482,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["count", "since", "page", "at"].iter().map(|v|*v)); + v.extend(["-since", "-count", "-page-token", "-at"].iter().map(|v|*v)); v } )); } } @@ -3737,15 +4156,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "enable-history-import" => Some(("enableHistoryImport", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "enable-update-create" => Some(("enableUpdateCreate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notification-config.pubsub-topic" => Some(("notificationConfig.pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-search-handling-strict" => Some(("defaultSearchHandlingStrict", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "disable-referential-integrity" => Some(("disableReferentialIntegrity", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "disable-resource-versioning" => Some(("disableResourceVersioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["disable-referential-integrity", "disable-resource-versioning", "enable-history-import", "enable-update-create", "labels", "name", "notification-config", "pubsub-topic"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["default-search-handling-strict", "disable-referential-integrity", "disable-resource-versioning", "enable-update-create", "labels", "name", "notification-config", "pubsub-topic", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3809,6 +4229,62 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_datasets_fhir_stores_search(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_datasets_fhir_stores_search(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "resource-type" => { + call = call.resource_type(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["resource-type"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_datasets_fhir_stores_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -4112,13 +4588,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "parser-config.allow-null-header" => Some(("parserConfig.allowNullHeader", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "parser-config.segment-terminator" => Some(("parserConfig.segmentTerminator", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parser-config.schema.schematized-parsing-type" => Some(("parserConfig.schema.schematizedParsingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parser-config.schema.ignore-min-occurs" => Some(("parserConfig.schema.ignoreMinOccurs", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notification-config.pubsub-topic" => Some(("notificationConfig.pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reject-duplicate-message" => Some(("rejectDuplicateMessage", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-null-header", "labels", "name", "notification-config", "parser-config", "pubsub-topic", "segment-terminator"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-null-header", "ignore-min-occurs", "labels", "name", "notification-config", "parser-config", "pubsub-topic", "reject-duplicate-message", "schema", "schematized-parsing-type", "segment-terminator"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4430,12 +4909,14 @@ impl<'n> Engine<'n> { "message.name" => Some(("message.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.labels" => Some(("message.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "message.message-type" => Some(("message.messageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.create-time" => Some(("message.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.send-time" => Some(("message.sendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.data" => Some(("message.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.send-facility" => Some(("message.sendFacility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.send-time" => Some(("message.sendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.schematized-data.data" => Some(("message.schematizedData.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.schematized-data.error" => Some(("message.schematizedData.error", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.data" => Some(("message.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.create-time" => Some(("message.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "data", "labels", "message", "message-type", "name", "send-facility", "send-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "data", "error", "labels", "message", "message-type", "name", "schematized-data", "send-facility", "send-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4629,12 +5110,14 @@ impl<'n> Engine<'n> { "message.name" => Some(("message.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.labels" => Some(("message.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "message.message-type" => Some(("message.messageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.create-time" => Some(("message.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.send-time" => Some(("message.sendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "message.data" => Some(("message.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message.send-facility" => Some(("message.sendFacility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.send-time" => Some(("message.sendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.schematized-data.data" => Some(("message.schematizedData.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.schematized-data.error" => Some(("message.schematizedData.error", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.data" => Some(("message.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "message.create-time" => Some(("message.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "data", "labels", "message", "message-type", "name", "send-facility", "send-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "data", "error", "labels", "message", "message-type", "name", "schematized-data", "send-facility", "send-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4700,6 +5183,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -4725,7 +5211,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-token", "filter", "page-size"].iter().map(|v|*v)); + v.extend(["order-by", "page-token", "filter", "page-size", "view"].iter().map(|v|*v)); v } )); } } @@ -4785,12 +5271,14 @@ impl<'n> Engine<'n> { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "message-type" => Some(("messageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "send-time" => Some(("sendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "send-facility" => Some(("sendFacility", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "send-time" => Some(("sendTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schematized-data.data" => Some(("schematizedData.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "schematized-data.error" => Some(("schematizedData.error", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "data", "labels", "message-type", "name", "send-facility", "send-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "data", "error", "labels", "message-type", "name", "schematized-data", "send-facility", "send-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4877,13 +5365,16 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "parser-config.allow-null-header" => Some(("parserConfig.allowNullHeader", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "parser-config.segment-terminator" => Some(("parserConfig.segmentTerminator", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parser-config.schema.schematized-parsing-type" => Some(("parserConfig.schema.schematizedParsingType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parser-config.schema.ignore-min-occurs" => Some(("parserConfig.schema.ignoreMinOccurs", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notification-config.pubsub-topic" => Some(("notificationConfig.pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reject-duplicate-message" => Some(("rejectDuplicateMessage", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-null-header", "labels", "name", "notification-config", "parser-config", "pubsub-topic", "segment-terminator"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-null-header", "ignore-min-occurs", "labels", "name", "notification-config", "parser-config", "pubsub-topic", "reject-duplicate-message", "schema", "schematized-parsing-type", "segment-terminator"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5178,6 +5669,90 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_datasets_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CancelOperationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_datasets_operations_cancel(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_datasets_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_datasets_operations_get(opt.value_of("name").unwrap_or("")); @@ -5675,6 +6250,15 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { + ("locations-datasets-annotation-stores-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_datasets_annotation_stores_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-datasets-annotation-stores-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_datasets_annotation_stores_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-datasets-annotation-stores-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_datasets_annotation_stores_test_iam_permissions(opt, dry_run, &mut err); + }, ("locations-datasets-create", Some(opt)) => { call_result = self._projects_locations_datasets_create(opt, dry_run, &mut err); }, @@ -5687,6 +6271,9 @@ impl<'n> Engine<'n> { ("locations-datasets-dicom-stores-create", Some(opt)) => { call_result = self._projects_locations_datasets_dicom_stores_create(opt, dry_run, &mut err); }, + ("locations-datasets-dicom-stores-deidentify", Some(opt)) => { + call_result = self._projects_locations_datasets_dicom_stores_deidentify(opt, dry_run, &mut err); + }, ("locations-datasets-dicom-stores-delete", Some(opt)) => { call_result = self._projects_locations_datasets_dicom_stores_delete(opt, dry_run, &mut err); }, @@ -5777,6 +6364,9 @@ impl<'n> Engine<'n> { ("locations-datasets-fhir-stores-create", Some(opt)) => { call_result = self._projects_locations_datasets_fhir_stores_create(opt, dry_run, &mut err); }, + ("locations-datasets-fhir-stores-deidentify", Some(opt)) => { + call_result = self._projects_locations_datasets_fhir_stores_deidentify(opt, dry_run, &mut err); + }, ("locations-datasets-fhir-stores-delete", Some(opt)) => { call_result = self._projects_locations_datasets_fhir_stores_delete(opt, dry_run, &mut err); }, @@ -5846,6 +6436,9 @@ impl<'n> Engine<'n> { ("locations-datasets-fhir-stores-patch", Some(opt)) => { call_result = self._projects_locations_datasets_fhir_stores_patch(opt, dry_run, &mut err); }, + ("locations-datasets-fhir-stores-search", Some(opt)) => { + call_result = self._projects_locations_datasets_fhir_stores_search(opt, dry_run, &mut err); + }, ("locations-datasets-fhir-stores-set-iam-policy", Some(opt)) => { call_result = self._projects_locations_datasets_fhir_stores_set_iam_policy(opt, dry_run, &mut err); }, @@ -5903,6 +6496,9 @@ impl<'n> Engine<'n> { ("locations-datasets-list", Some(opt)) => { call_result = self._projects_locations_datasets_list(opt, dry_run, &mut err); }, + ("locations-datasets-operations-cancel", Some(opt)) => { + call_result = self._projects_locations_datasets_operations_cancel(opt, dry_run, &mut err); + }, ("locations-datasets-operations-get", Some(opt)) => { call_result = self._projects_locations_datasets_operations_get(opt, dry_run, &mut err); }, @@ -6015,7 +6611,99 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'locations-datasets-create', 'locations-datasets-deidentify', 'locations-datasets-delete', 'locations-datasets-dicom-stores-create', 'locations-datasets-dicom-stores-delete', 'locations-datasets-dicom-stores-export', 'locations-datasets-dicom-stores-get', 'locations-datasets-dicom-stores-get-iam-policy', 'locations-datasets-dicom-stores-import', 'locations-datasets-dicom-stores-list', 'locations-datasets-dicom-stores-patch', 'locations-datasets-dicom-stores-search-for-instances', 'locations-datasets-dicom-stores-search-for-series', 'locations-datasets-dicom-stores-search-for-studies', 'locations-datasets-dicom-stores-set-iam-policy', 'locations-datasets-dicom-stores-store-instances', 'locations-datasets-dicom-stores-studies-delete', 'locations-datasets-dicom-stores-studies-retrieve-metadata', 'locations-datasets-dicom-stores-studies-retrieve-study', 'locations-datasets-dicom-stores-studies-search-for-instances', 'locations-datasets-dicom-stores-studies-search-for-series', 'locations-datasets-dicom-stores-studies-series-delete', 'locations-datasets-dicom-stores-studies-series-instances-delete', 'locations-datasets-dicom-stores-studies-series-instances-frames-retrieve-frames', 'locations-datasets-dicom-stores-studies-series-instances-frames-retrieve-rendered', 'locations-datasets-dicom-stores-studies-series-instances-retrieve-instance', 'locations-datasets-dicom-stores-studies-series-instances-retrieve-metadata', 'locations-datasets-dicom-stores-studies-series-instances-retrieve-rendered', 'locations-datasets-dicom-stores-studies-series-retrieve-metadata', 'locations-datasets-dicom-stores-studies-series-retrieve-series', 'locations-datasets-dicom-stores-studies-series-search-for-instances', 'locations-datasets-dicom-stores-studies-store-instances', 'locations-datasets-dicom-stores-test-iam-permissions', 'locations-datasets-fhir-stores-create', 'locations-datasets-fhir-stores-delete', 'locations-datasets-fhir-stores-export', 'locations-datasets-fhir-stores-fhir--observation-lastn', 'locations-datasets-fhir-stores-fhir--patient-everything', 'locations-datasets-fhir-stores-fhir--resource-purge', 'locations-datasets-fhir-stores-fhir-capabilities', 'locations-datasets-fhir-stores-fhir-conditional-delete', 'locations-datasets-fhir-stores-fhir-conditional-patch', 'locations-datasets-fhir-stores-fhir-conditional-update', 'locations-datasets-fhir-stores-fhir-create', 'locations-datasets-fhir-stores-fhir-delete', 'locations-datasets-fhir-stores-fhir-execute-bundle', 'locations-datasets-fhir-stores-fhir-history', 'locations-datasets-fhir-stores-fhir-patch', 'locations-datasets-fhir-stores-fhir-read', 'locations-datasets-fhir-stores-fhir-search', 'locations-datasets-fhir-stores-fhir-update', 'locations-datasets-fhir-stores-fhir-vread', 'locations-datasets-fhir-stores-get', 'locations-datasets-fhir-stores-get-iam-policy', 'locations-datasets-fhir-stores-import', 'locations-datasets-fhir-stores-list', 'locations-datasets-fhir-stores-patch', 'locations-datasets-fhir-stores-set-iam-policy', 'locations-datasets-fhir-stores-test-iam-permissions', 'locations-datasets-get', 'locations-datasets-get-iam-policy', 'locations-datasets-hl7-v2-stores-create', 'locations-datasets-hl7-v2-stores-delete', 'locations-datasets-hl7-v2-stores-get', 'locations-datasets-hl7-v2-stores-get-iam-policy', 'locations-datasets-hl7-v2-stores-list', 'locations-datasets-hl7-v2-stores-messages-create', 'locations-datasets-hl7-v2-stores-messages-delete', 'locations-datasets-hl7-v2-stores-messages-get', 'locations-datasets-hl7-v2-stores-messages-ingest', 'locations-datasets-hl7-v2-stores-messages-list', 'locations-datasets-hl7-v2-stores-messages-patch', 'locations-datasets-hl7-v2-stores-patch', 'locations-datasets-hl7-v2-stores-set-iam-policy', 'locations-datasets-hl7-v2-stores-test-iam-permissions', 'locations-datasets-list', 'locations-datasets-operations-get', 'locations-datasets-operations-list', 'locations-datasets-patch', 'locations-datasets-set-iam-policy', 'locations-datasets-test-iam-permissions', 'locations-get' and 'locations-list'", vec![ + ("projects", "methods: 'locations-datasets-annotation-stores-get-iam-policy', 'locations-datasets-annotation-stores-set-iam-policy', 'locations-datasets-annotation-stores-test-iam-permissions', 'locations-datasets-create', 'locations-datasets-deidentify', 'locations-datasets-delete', 'locations-datasets-dicom-stores-create', 'locations-datasets-dicom-stores-deidentify', 'locations-datasets-dicom-stores-delete', 'locations-datasets-dicom-stores-export', 'locations-datasets-dicom-stores-get', 'locations-datasets-dicom-stores-get-iam-policy', 'locations-datasets-dicom-stores-import', 'locations-datasets-dicom-stores-list', 'locations-datasets-dicom-stores-patch', 'locations-datasets-dicom-stores-search-for-instances', 'locations-datasets-dicom-stores-search-for-series', 'locations-datasets-dicom-stores-search-for-studies', 'locations-datasets-dicom-stores-set-iam-policy', 'locations-datasets-dicom-stores-store-instances', 'locations-datasets-dicom-stores-studies-delete', 'locations-datasets-dicom-stores-studies-retrieve-metadata', 'locations-datasets-dicom-stores-studies-retrieve-study', 'locations-datasets-dicom-stores-studies-search-for-instances', 'locations-datasets-dicom-stores-studies-search-for-series', 'locations-datasets-dicom-stores-studies-series-delete', 'locations-datasets-dicom-stores-studies-series-instances-delete', 'locations-datasets-dicom-stores-studies-series-instances-frames-retrieve-frames', 'locations-datasets-dicom-stores-studies-series-instances-frames-retrieve-rendered', 'locations-datasets-dicom-stores-studies-series-instances-retrieve-instance', 'locations-datasets-dicom-stores-studies-series-instances-retrieve-metadata', 'locations-datasets-dicom-stores-studies-series-instances-retrieve-rendered', 'locations-datasets-dicom-stores-studies-series-retrieve-metadata', 'locations-datasets-dicom-stores-studies-series-retrieve-series', 'locations-datasets-dicom-stores-studies-series-search-for-instances', 'locations-datasets-dicom-stores-studies-store-instances', 'locations-datasets-dicom-stores-test-iam-permissions', 'locations-datasets-fhir-stores-create', 'locations-datasets-fhir-stores-deidentify', 'locations-datasets-fhir-stores-delete', 'locations-datasets-fhir-stores-export', 'locations-datasets-fhir-stores-fhir--observation-lastn', 'locations-datasets-fhir-stores-fhir--patient-everything', 'locations-datasets-fhir-stores-fhir--resource-purge', 'locations-datasets-fhir-stores-fhir-capabilities', 'locations-datasets-fhir-stores-fhir-conditional-delete', 'locations-datasets-fhir-stores-fhir-conditional-patch', 'locations-datasets-fhir-stores-fhir-conditional-update', 'locations-datasets-fhir-stores-fhir-create', 'locations-datasets-fhir-stores-fhir-delete', 'locations-datasets-fhir-stores-fhir-execute-bundle', 'locations-datasets-fhir-stores-fhir-history', 'locations-datasets-fhir-stores-fhir-patch', 'locations-datasets-fhir-stores-fhir-read', 'locations-datasets-fhir-stores-fhir-search', 'locations-datasets-fhir-stores-fhir-update', 'locations-datasets-fhir-stores-fhir-vread', 'locations-datasets-fhir-stores-get', 'locations-datasets-fhir-stores-get-iam-policy', 'locations-datasets-fhir-stores-import', 'locations-datasets-fhir-stores-list', 'locations-datasets-fhir-stores-patch', 'locations-datasets-fhir-stores-search', 'locations-datasets-fhir-stores-set-iam-policy', 'locations-datasets-fhir-stores-test-iam-permissions', 'locations-datasets-get', 'locations-datasets-get-iam-policy', 'locations-datasets-hl7-v2-stores-create', 'locations-datasets-hl7-v2-stores-delete', 'locations-datasets-hl7-v2-stores-get', 'locations-datasets-hl7-v2-stores-get-iam-policy', 'locations-datasets-hl7-v2-stores-list', 'locations-datasets-hl7-v2-stores-messages-create', 'locations-datasets-hl7-v2-stores-messages-delete', 'locations-datasets-hl7-v2-stores-messages-get', 'locations-datasets-hl7-v2-stores-messages-ingest', 'locations-datasets-hl7-v2-stores-messages-list', 'locations-datasets-hl7-v2-stores-messages-patch', 'locations-datasets-hl7-v2-stores-patch', 'locations-datasets-hl7-v2-stores-set-iam-policy', 'locations-datasets-hl7-v2-stores-test-iam-permissions', 'locations-datasets-list', 'locations-datasets-operations-cancel', 'locations-datasets-operations-get', 'locations-datasets-operations-list', 'locations-datasets-patch', 'locations-datasets-set-iam-policy', 'locations-datasets-test-iam-permissions', 'locations-get' and 'locations-list'", vec![ + ("locations-datasets-annotation-stores-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-annotation-stores-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-datasets-annotation-stores-set-iam-policy", + Some(r##"Sets the access control policy on the specified resource. Replaces any + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), + "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-annotation-stores-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-datasets-annotation-stores-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), + "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-annotation-stores-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("locations-datasets-create", Some(r##"Creates a new health dataset. Results are returned through the Operation interface which returns either an @@ -6028,8 +6716,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project in which the dataset should be created (e.g., - `projects/{project_id}/locations/{location_id}`)."##), + Some(r##"The name of the project where the server creates the dataset. For + example, `projects/{project_id}/locations/{location_id}`."##), Some(true), Some(false)), @@ -6059,14 +6747,21 @@ fn main() { response field type is DeidentifySummary. If errors occur, + error details field type is - DeidentifyErrorDetails."##), + DeidentifyErrorDetails. + The LRO result may still be successful if de-identification fails for some + DICOM instances. The new de-identified dataset will not contain these + failed resources. Failed resource totals are tracked in + DeidentifySummary.failure_resource_count. + Error details are also logged to Stackdriver Logging. For more information, + see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-deidentify", vec![ (Some(r##"source-dataset"##), None, - Some(r##"Source dataset resource name. (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`)."##), + Some(r##"Source dataset resource name. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`."##), Some(true), Some(false)), @@ -6096,8 +6791,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the dataset to delete (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`)."##), + Some(r##"The name of the dataset to delete. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`."##), Some(true), Some(false)), @@ -6135,6 +6830,49 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-datasets-dicom-stores-deidentify", + Some(r##"De-identifies data from the source store and writes it to the destination + store. The metadata field type + is OperationMetadata. + If the request is successful, the + response field type is + DeidentifyDicomStoreSummary. If errors occur, + error + details field type is + DeidentifyErrorDetails. + The LRO result may still be successful if de-identification fails for some + DICOM instances. The output DICOM store will not contain + these failed resources. Failed resource totals are tracked in + DeidentifySummary.failure_resource_count. + Error details are also logged to Stackdriver + (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging))."##), + "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-dicom-stores-deidentify", + vec![ + (Some(r##"source-store"##), + None, + Some(r##"Source DICOM store resource name. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6167,14 +6905,17 @@ fn main() { ("locations-datasets-dicom-stores-export", Some(r##"Exports data to the specified destination by copying it from the DICOM store. + Errors are also logged to Stackdriver Logging. For more information, + see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). The metadata field type is OperationMetadata."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-dicom-stores-export", vec![ (Some(r##"name"##), None, - Some(r##"The DICOM store resource name from which the data should be exported (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The DICOM store resource name from which to export the data. For + example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), @@ -6245,17 +6986,20 @@ fn main() { ]), ("locations-datasets-dicom-stores-import", Some(r##"Imports data into the DICOM store by copying it from the specified source. - For errors, the Operation will be populated with error details (in the form - of ImportDicomDataErrorDetails in error.details), which will hold - finer-grained error information. + For errors, the Operation is populated with error details (in the form + of ImportDicomDataErrorDetails in error.details), which hold + finer-grained error information. Errors are also logged to Stackdriver + Logging. For more information, + see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). The metadata field type is OperationMetadata."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-dicom-stores-import", vec![ (Some(r##"name"##), None, - Some(r##"The name of the DICOM store resource into which the data is imported (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store resource into which the data is imported. + For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), @@ -6335,16 +7079,16 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the SearchForInstancesRequest DICOMweb request (e.g., - `instances` or `series/{series_uid}/instances` or - `studies/{study_uid}/instances`)."##), + Some(r##"The path of the SearchForInstancesRequest DICOMweb request. For example, + `instances`, `series/{series_uid}/instances`, or + `studies/{study_uid}/instances`."##), Some(true), Some(false)), @@ -6367,15 +7111,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the SearchForSeries DICOMweb request(e.g., `series` or - `studies/{study_uid}/series`)."##), + Some(r##"The path of the SearchForSeries DICOMweb request. For example, `series` or + `studies/{study_uid}/series`."##), Some(true), Some(false)), @@ -6398,14 +7142,14 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the SearchForStudies DICOMweb request (e.g., `studies`)."##), + Some(r##"The path of the SearchForStudies DICOMweb request. For example, `studies`."##), Some(true), Some(false)), @@ -6423,7 +7167,9 @@ fn main() { ]), ("locations-datasets-dicom-stores-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-dicom-stores-set-iam-policy", vec![ (Some(r##"resource"##), @@ -6459,15 +7205,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the StoreInstances DICOMweb request (e.g., - `studies/[{study_id}]`). Note that the `study_uid` is optional."##), + Some(r##"The path of the StoreInstances DICOMweb request. For example, + `studies/[{study_uid}]`. Note that the `study_uid` is optional."##), Some(true), Some(false)), @@ -6491,19 +7237,18 @@ fn main() { ]), ("locations-datasets-dicom-stores-studies-delete", Some(r##"DeleteStudy deletes all instances within the given study. Delete requests - are equivalent to the GET requests specified in the WADO-RS standard."##), + are equivalent to the GET requests specified in the Retrieve transaction."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-dicom-stores-studies-delete", vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + None, Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the DeleteStudy request (e.g., `studies/{study_id}`)."##), + Some(r##"The path of the DeleteStudy request. For example, `studies/{study_uid}`."##), Some(true), Some(false)), @@ -6527,15 +7272,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveStudyMetadata DICOMweb request (e.g., - `studies/{study_id}/metadata`)."##), + Some(r##"The path of the RetrieveStudyMetadata DICOMweb request. For example, + `studies/{study_uid}/metadata`."##), Some(true), Some(false)), @@ -6558,15 +7303,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveStudy DICOMweb request (e.g., - `studies/{study_id}`)."##), + Some(r##"The path of the RetrieveStudy DICOMweb request. For example, + `studies/{study_uid}`."##), Some(true), Some(false)), @@ -6589,16 +7334,16 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the SearchForInstancesRequest DICOMweb request (e.g., - `instances` or `series/{series_uid}/instances` or - `studies/{study_uid}/instances`)."##), + Some(r##"The path of the SearchForInstancesRequest DICOMweb request. For example, + `instances`, `series/{series_uid}/instances`, or + `studies/{study_uid}/instances`."##), Some(true), Some(false)), @@ -6621,15 +7366,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the SearchForSeries DICOMweb request(e.g., `series` or - `studies/{study_uid}/series`)."##), + Some(r##"The path of the SearchForSeries DICOMweb request. For example, `series` or + `studies/{study_uid}/series`."##), Some(true), Some(false)), @@ -6647,21 +7392,21 @@ fn main() { ]), ("locations-datasets-dicom-stores-studies-series-delete", Some(r##"DeleteSeries deletes all instances within the given study and series. - Delete requests are equivalent to the GET requests specified in the WADO-RS - standard."##), + Delete requests are equivalent to the GET requests specified in the + Retrieve transaction."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-dicom-stores-studies-series-delete", vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the DeleteSeries request (e.g., - `studies/{study_id}/series/{series_id}`)."##), + Some(r##"The path of the DeleteSeries request. For example, + `studies/{study_uid}/series/{series_uid}`."##), Some(true), Some(false)), @@ -6680,20 +7425,20 @@ fn main() { ("locations-datasets-dicom-stores-studies-series-instances-delete", Some(r##"DeleteInstance deletes an instance associated with the given study, series, and SOP Instance UID. Delete requests are equivalent to the GET requests - specified in the WADO-RS standard."##), + specified in the Retrieve transaction."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-dicom-stores-studies-series-instances-delete", vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the DeleteInstance request (e.g., - `studies/{study_id}/series/{series_id}/instances/{instance_id}`)."##), + Some(r##"The path of the DeleteInstance request. For example, + `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`."##), Some(true), Some(false)), @@ -6717,15 +7462,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveFrames DICOMweb request (e.g., - `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}`)."##), + Some(r##"The path of the RetrieveFrames DICOMweb request. For example, + `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}`."##), Some(true), Some(false)), @@ -6750,15 +7495,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveRenderedFrames DICOMweb request (e.g., - `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}/rendered`)."##), + Some(r##"The path of the RetrieveRenderedFrames DICOMweb request. For example, + `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}/rendered`."##), Some(true), Some(false)), @@ -6782,15 +7527,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveInstance DICOMweb request (e.g., - `studies/{study_id}/series/{series_id}/instances/{instance_id}`)."##), + Some(r##"The path of the RetrieveInstance DICOMweb request. For example, + `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`."##), Some(true), Some(false)), @@ -6815,15 +7560,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveInstanceMetadata DICOMweb request (e.g., - `studies/{study_id}/series/{series_id}/instances/{instance_id}/metadata`)."##), + Some(r##"The path of the RetrieveInstanceMetadata DICOMweb request. For example, + `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/metadata`."##), Some(true), Some(false)), @@ -6847,15 +7592,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveRenderedInstance DICOMweb request (e.g., - `studies/{study_id}/series/{series_id}/instances/{instance_id}/rendered`)."##), + Some(r##"The path of the RetrieveRenderedInstance DICOMweb request. For example, + `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/rendered`."##), Some(true), Some(false)), @@ -6879,15 +7624,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveSeriesMetadata DICOMweb request (e.g., - `studies/{study_id}/series/{series_id}/metadata`)."##), + Some(r##"The path of the RetrieveSeriesMetadata DICOMweb request. For example, + `studies/{study_uid}/series/{series_uid}/metadata`."##), Some(true), Some(false)), @@ -6910,15 +7655,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the RetrieveSeries DICOMweb request (e.g., - `studies/{study_id}/series/{series_id}`)."##), + Some(r##"The path of the RetrieveSeries DICOMweb request. For example, + `studies/{study_uid}/series/{series_uid}`."##), Some(true), Some(false)), @@ -6941,16 +7686,16 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the SearchForInstancesRequest DICOMweb request (e.g., - `instances` or `series/{series_uid}/instances` or - `studies/{study_uid}/instances`)."##), + Some(r##"The path of the SearchForInstancesRequest DICOMweb request. For example, + `instances`, `series/{series_uid}/instances`, or + `studies/{study_uid}/instances`."##), Some(true), Some(false)), @@ -6974,15 +7719,15 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the DICOM store that is being accessed (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`)."##), + Some(r##"The name of the DICOM store that is being accessed. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`."##), Some(true), Some(false)), (Some(r##"dicom-web-path"##), None, - Some(r##"The path of the StoreInstances DICOMweb request (e.g., - `studies/[{study_id}]`). Note that the `study_uid` is optional."##), + Some(r##"The path of the StoreInstances DICOMweb request. For example, + `studies/[{study_uid}]`. Note that the `study_uid` is optional."##), Some(true), Some(false)), @@ -7061,6 +7806,45 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-datasets-fhir-stores-deidentify", + Some(r##"De-identifies data from the source store and writes it to the destination + store. The metadata field type + is OperationMetadata. + If the request is successful, the + response field type is + DeidentifyFhirStoreSummary. If errors occur, + error + details field type is + DeidentifyErrorDetails. + Errors are also logged to Stackdriver + (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging))."##), + "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-fhir-stores-deidentify", + vec![ + (Some(r##"source-store"##), + None, + Some(r##"Source FHIR store resource name. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7097,7 +7881,9 @@ fn main() { GetOperation. Immediate fatal errors appear in the - error field. + error field, errors are also logged + to Stackdriver (see [Viewing + logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the operation finishes, a detailed response of type ExportResourcesResponse is returned in the response field. @@ -7136,13 +7922,30 @@ fn main() { search criteria specified as query parameters, grouped by `Observation.code`, sorted from most recent to oldest. - Implements the FHIR extended operation - [Observation-lastn](http://hl7.org/implement/standards/fhir/STU3/observation-operations.html#lastn). + Implements the FHIR extended operation Observation-lastn + ([STU3](http://hl7.org/implement/standards/fhir/STU3/observation-operations.html#lastn), + [R4](http://hl7.org/implement/standards/fhir/R4/observation-operations.html#lastn)). + + DSTU2 doesn't define the Observation-lastn method, but the server supports + it the same way it supports STU3. Search terms are provided as query parameters following the same pattern as - the search method. This operation accepts an additional - query parameter `max`, which specifies N, the maximum number of - Observations to return from each group, with a default of 1. + the search method. The following search parameters must + be provided: + + - `subject` or `patient` to specify a subject for the Observation. + - `code`, `category` or any of the composite parameters that include + `code`. + + Any other valid Observation search parameters can also be provided. This + operation accepts an additional query parameter `max`, which specifies N, + the maximum number of Observations to return from each group, with a + default of 1. + + Searches with over 1000 results are rejected. Results are counted before + grouping and limiting the results with `max`. To stay within the limit, + constrain these searches using Observation search parameters such as + `_lastUpdated` or `date`. On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the @@ -7172,13 +7975,7 @@ fn main() { Some(false)), ]), ("locations-datasets-fhir-stores-fhir--patient-everything", - Some(r##"Retrieves all the resources in the patient compartment for a `Patient` - resource. - - Implements the FHIR extended operation - [Patient-everything](http://hl7.org/implement/standards/fhir/STU3/patient-operations.html#everything). - - On success, the response body will contain a JSON-encoded representation + Some(r##"On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `searchset`, containing the results of the operation. Errors generated by the FHIR store will contain a JSON-encoded @@ -7232,13 +8029,20 @@ fn main() { Some(false)), ]), ("locations-datasets-fhir-stores-fhir-capabilities", - Some(r##"Gets the FHIR [capability - statement](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html) - for the store, which contains a description of functionality supported by - the server. + Some(r##"Gets the FHIR capability statement + ([STU3](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html), + [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)), + or the [conformance + statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) + in the DSTU2 case for the store, which contains a description of + functionality supported by the server. - Implements the FHIR standard [capabilities - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities). + Implements the FHIR standard capabilities interaction + ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), + or the [conformance + interaction](http://hl7.org/implement/standards/fhir/DSTU2/http.html#conformance) + in the DSTU2 case. On success, the response body will contain a JSON-encoded representation of a `CapabilityStatement` resource."##), @@ -7265,8 +8069,10 @@ fn main() { ("locations-datasets-fhir-stores-fhir-conditional-delete", Some(r##"Deletes FHIR resources that match a search query. - Implements the FHIR standard [conditional delete - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.13.1). + Implements the FHIR standard conditional delete interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.12.1), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.13.1), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#3.1.0.7.1)). If multiple resources match, all of them will be deleted. Search terms are provided as query parameters following the same pattern as @@ -7289,8 +8095,10 @@ fn main() { (Some(r##"type"##), None, Some(r##"The FHIR resource type to delete, such as Patient or Observation. For a - complete list, see the [FHIR Resource - Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html)."##), + complete list, see the FHIR Resource Index + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html))."##), Some(true), Some(false)), @@ -7311,8 +8119,12 @@ fn main() { parameters, updates part of that resource by applying the operations specified in a [JSON Patch](http://jsonpatch.com/) document. - Implements the FHIR standard [conditional patch - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#patch). + Implements the FHIR standard conditional patch interaction + ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). + + DSTU2 doesn't define a conditional patch method, but the server supports it + in the same way it supports STU3. Search terms are provided as query parameters following the same pattern as the search method. @@ -7340,8 +8152,10 @@ fn main() { (Some(r##"type"##), None, Some(r##"The FHIR resource type to update, such as Patient or Observation. For a - complete list, see the [FHIR Resource - Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html)."##), + complete list, see the FHIR Resource Index + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html))."##), Some(true), Some(false)), @@ -7367,8 +8181,10 @@ fn main() { Some(r##"If a resource is found based on the search criteria specified in the query parameters, updates the entire contents of that resource. - Implements the FHIR standard [conditional update - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#cond-update). + Implements the FHIR standard conditional update interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.10.2), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cond-update), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cond-update)). Search terms are provided as query parameters following the same pattern as the search method. @@ -7403,8 +8219,10 @@ fn main() { (Some(r##"type"##), None, Some(r##"The FHIR resource type to update, such as Patient or Observation. For a - complete list, see the [FHIR Resource - Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). + complete list, see the FHIR Resource Index + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). Must match the resource type in the provided content."##), Some(true), Some(false)), @@ -7430,12 +8248,16 @@ fn main() { ("locations-datasets-fhir-stores-fhir-create", Some(r##"Creates a FHIR resource. - Implements the FHIR standard [create - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#create), + Implements the FHIR standard create interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), which creates a new resource with a server-assigned resource ID. - Also supports the FHIR standard [conditional create - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#ccreate), + Also supports the FHIR standard conditional create interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#ccreate), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#ccreate), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#ccreate)), specified by supplying an `If-None-Exist` header containing a FHIR search query. If no resources match this search query, the server processes the create operation as normal. @@ -7461,8 +8283,10 @@ fn main() { (Some(r##"type"##), None, Some(r##"The FHIR resource type to create, such as Patient or Observation. For a - complete list, see the [FHIR Resource - Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). + complete list, see the FHIR Resource Index + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). Must match the resource type in the provided content."##), Some(true), Some(false)), @@ -7488,8 +8312,10 @@ fn main() { ("locations-datasets-fhir-stores-fhir-delete", Some(r##"Deletes a FHIR resource. - Implements the FHIR standard [delete - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#delete). + Implements the FHIR standard delete interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). Note: Unless resource versioning is disabled by setting the disable_resource_versioning flag @@ -7520,15 +8346,21 @@ fn main() { ("locations-datasets-fhir-stores-fhir-execute-bundle", Some(r##"Executes all the requests in the given Bundle. - Implements the FHIR standard [batch/transaction - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction). + Implements the FHIR standard batch/transaction interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#transaction), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)). Supports all interactions within a bundle, except search. This method accepts Bundles of type `batch` and `transaction`, processing them - according to the [batch processing - rules](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1) - and [transaction processing - rules](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2). + according to the batch processing rules + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) + and transaction processing rules + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). The request body must contain a JSON-encoded FHIR `Bundle` resource, and the request headers must contain `Content-Type: application/fhir+json`. @@ -7571,8 +8403,10 @@ fn main() { Some(r##"Lists all the versions of a resource (including the current version and deleted versions) from the FHIR store. - Implements the per-resource form of the FHIR standard [history - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#history). + Implements the per-resource form of the FHIR standard history interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). On success, the response body will contain a JSON-encoded representation of a `Bundle` resource of type `history`, containing the version history @@ -7605,8 +8439,12 @@ fn main() { Some(r##"Updates part of an existing resource by applying the operations specified in a [JSON Patch](http://jsonpatch.com/) document. - Implements the FHIR standard [patch - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#patch). + Implements the FHIR standard patch interaction + ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). + + DSTU2 doesn't define a patch method, but the server supports it in the same + way it supports STU3. The request body must contain a JSON Patch document, and the request headers must contain `Content-Type: application/json-patch+json`. @@ -7646,11 +8484,15 @@ fn main() { ("locations-datasets-fhir-stores-fhir-read", Some(r##"Gets the contents of a FHIR resource. - Implements the FHIR standard [read - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#read). + Implements the FHIR standard read interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). - Also supports the FHIR standard [conditional read - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#cread) + Also supports the FHIR standard conditional read interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) specified by supplying an `If-Modified-Since` header with a date/time value or an `If-None-Match` header with an ETag value. @@ -7684,10 +8526,14 @@ fn main() { Some(r##"Searches for resources in the given FHIR store according to criteria specified as query parameters. - Implements the FHIR standard [search - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#search) - using the search semantics described in the [FHIR Search - specification](http://hl7.org/implement/standards/fhir/STU3/search.html). + Implements the FHIR standard search interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) + using the search semantics described in the FHIR Search specification + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), + [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), + [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports three methods of search defined by the specification: @@ -7711,8 +8557,12 @@ fn main() { The server's capability statement, retrieved through capabilities, indicates what search parameters are supported on each FHIR resource. A list of all search parameters - defined by the specification can be found in the [FHIR Search Parameter - Registry](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html). + defined by the specification can be found in the FHIR Search Parameter + Registry + ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), + [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). + FHIR search parameters for DSTU2 can be found on each resource's definition + page. Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. @@ -7723,7 +8573,15 @@ fn main() { The maximum number of search results returned defaults to 100, which can be overridden by the `_count` parameter up to a maximum limit of 1000. If there are additional results, the returned `Bundle` will contain - pagination links."##), + pagination links. + + Resources with a total size larger than 5MB or a field count larger than + 50,000 might not be fully searchable as the server might trim its generated + search index in those cases. + + Note: FHIR resources are indexed asynchronously, so there might be a slight + delay between the time a resource is created or changes and when the change + is reflected in search results."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-fhir-stores-fhir-search", vec![ (Some(r##"parent"##), @@ -7753,8 +8611,10 @@ fn main() { ("locations-datasets-fhir-stores-fhir-update", Some(r##"Updates the entire contents of a resource. - Implements the FHIR standard [update - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#update). + Implements the FHIR standard update interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). If the specified resource does not exist and the FHIR store has @@ -7802,8 +8662,10 @@ fn main() { Some(r##"Gets the contents of a version (current or historical) of a FHIR resource by version ID. - Implements the FHIR standard [vread - interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#vread). + Implements the FHIR standard vread interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). On success, the response body will contain a JSON-encoded representation of the resource. @@ -7880,31 +8742,76 @@ fn main() { ]), ("locations-datasets-fhir-stores-import", Some(r##"Import resources to the FHIR store by loading data from the specified - sources. Each resource must have a client-supplied ID, which is retained - by the server. + sources. This method is optimized to load large quantities of data using + import semantics that ignore some FHIR store configuration options and are + not suitable for all use cases. It is primarily intended to load data into + an empty FHIR store that is not being used by other clients. In cases + where this method is not appropriate, consider using ExecuteBundle to + load data. - The import operation is idempotent. Upon retry, the most recent data - (matching the client-supplied ID) is overwritten, without creating a new - resource version. If partial failures occur during the import, successful - changes are not rolled back. + Every resource in the input must contain a client-supplied ID, and will be + stored using that ID regardless of the + enable_update_create setting on the FHIR + store. - If history imports are enabled - (enable_history_import is set in the - FHIR store's configuration), you can import historical versions of a - resource by supplying a bundle of type `history`. The historical versions - in the bundle must have `lastUpdated` timestamps. If a current or - historical version with the supplied resource ID already exists, the - bundle is rejected. + The import process does not enforce referential integrity, regardless of + the + disable_referential_integrity + setting on the FHIR store. This allows the import of resources with + arbitrary interdependencies without considering grouping or ordering, but + if the input data contains invalid references or if some resources fail to + be imported, the FHIR store might be left in a state that violates + referential integrity. + + The import process does not trigger PubSub notification or BigQuery + streaming update, regardless of how those are configured on the FHIR store. + + If a resource with the specified ID already exists, the most recent + version of the resource is overwritten without creating a new historical + version, regardless of the + disable_resource_versioning + setting on the FHIR store. If transient failures occur during the import, + it is possible that successfully imported resources will be overwritten + more than once. + + The import operation is idempotent unless the input data contains multiple + valid resources with the same ID but different contents. In that case, + after the import completes, the store will contain exactly one resource + with that ID but there is no ordering guarantee on which version of the + contents it will have. The operation result counters do not count + duplicate IDs as an error and will count one success for each resource in + the input, which might result in a success count larger than the number + of resources in the FHIR store. This often occurs when importing data + organized in bundles produced by Patient-everything + where each bundle contains its own copy of a resource such as Practitioner + that might be referred to by many patients. + + If some resources fail to import, for example due to parsing errors, + successfully imported resources are not rolled back. + + The location and format of the input data is specified by the parameters + below. Note that if no format is specified, this method assumes the + `BUNDLE` format. When using the `BUNDLE` format this method ignores the + `Bundle.type` field, except that `history` bundles are rejected, and does + not apply any of the bundle processing semantics for batch or transaction + bundles. Unlike in ExecuteBundle, transaction bundles are not executed + as a single transaction and bundle-internal references are not rewritten. + The bundle is treated as a collection of resources to be written as + provided in `Bundle.entry.resource`, ignoring `Bundle.entry.request`. As + an example, this allows the import of `searchset` bundles produced by a + FHIR search or + Patient-everything operation. This method returns an Operation that can be used to track the status of the import by calling GetOperation. Immediate fatal errors appear in the - error field. - Otherwise, when the operation finishes, a detailed response of type - ImportResourcesResponse is returned in the - response field. + error field, errors are also logged + to Stackdriver (see [Viewing + logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the + operation finishes, a detailed response of type ImportResourcesResponse + is returned in the response field. The metadata field type for this operation is OperationMetadata."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-fhir-stores-import", @@ -7980,6 +8887,86 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-datasets-fhir-stores-search", + Some(r##"Searches for resources in the given FHIR store according to criteria + specified as query parameters. + + Implements the FHIR standard search interaction + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), + [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), + [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) + using the search semantics described in the FHIR Search specification + ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), + [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), + [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). + + Supports three methods of search defined by the specification: + + * `GET [base]?[parameters]` to search across all resources. + * `GET [base]/[type]?[parameters]` to search resources of a specified + type. + * `POST [base]/[type]/_search?[parameters]` as an alternate form having + the same semantics as the `GET` method. + + The `GET` methods do not support compartment searches. The `POST` method + does not support `application/x-www-form-urlencoded` search parameters. + + On success, the response body will contain a JSON-encoded representation + of a `Bundle` resource of type `searchset`, containing the results of the + search. + Errors generated by the FHIR store will contain a JSON-encoded + `OperationOutcome` resource describing the reason for the error. If the + request cannot be mapped to a valid API method on a FHIR store, a generic + GCP error might be returned instead. + + The server's capability statement, retrieved through + capabilities, indicates what search parameters + are supported on each FHIR resource. A list of all search parameters + defined by the specification can be found in the FHIR Search Parameter + Registry + ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), + [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). + FHIR search parameters for DSTU2 can be found on each resource's definition + page. + + Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, + `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. + + Supported search result parameters: `_sort`, `_count`, `_include`, + `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. + + The maximum number of search results returned defaults to 100, which can + be overridden by the `_count` parameter up to a maximum limit of 1000. If + there are additional results, the returned `Bundle` will contain + pagination links. + + Resources with a total size larger than 5MB or a field count larger than + 50,000 might not be fully searchable as the server might trim its generated + search index in those cases. + + Note: FHIR resources are indexed asynchronously, so there might be a slight + delay between the time a resource is created or changes and when the change + is reflected in search results."##), + "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-fhir-stores-search", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Name of the FHIR store to retrieve resources from."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7988,7 +8975,9 @@ fn main() { ]), ("locations-datasets-fhir-stores-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-fhir-stores-set-iam-policy", vec![ (Some(r##"resource"##), @@ -8057,8 +9046,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the dataset to read (e.g., - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`)."##), + Some(r##"The name of the dataset to read. For example, + `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`."##), Some(true), Some(false)), @@ -8299,9 +9288,7 @@ fn main() { ("locations-datasets-hl7-v2-stores-messages-ingest", Some(r##"Ingests a new HL7v2 message from the hospital and sends a notification to the Cloud Pub/Sub topic. Return is an HL7v2 ACK message if the message was - successfully stored. Otherwise an error is returned. If an identical - HL7v2 message is created twice only one resource is created on the server - and no error is reported."##), + successfully stored. Otherwise an error is returned."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-hl7-v2-stores-messages-ingest", vec![ (Some(r##"parent"##), @@ -8329,7 +9316,11 @@ fn main() { Some(false)), ]), ("locations-datasets-hl7-v2-stores-messages-list", - Some(r##"Lists all the messages in the given HL7v2 store with support for filtering."##), + Some(r##"Lists all the messages in the given HL7v2 store with support for filtering. + + Note: HL7v2 messages are indexed asynchronously, so there might be a slight + delay between the time a message is created and when it can be found + through a filter."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-hl7-v2-stores-messages-list", vec![ (Some(r##"parent"##), @@ -8351,7 +9342,13 @@ fn main() { Some(false)), ]), ("locations-datasets-hl7-v2-stores-messages-patch", - Some(r##"Update the message."##), + Some(r##"Update the message. + + The contents of the message in Message.data and data extracted from + the contents such as Message.create_time cannot be altered. Only the + Message.labels field is allowed to be updated. The labels in the + request are merged with the existing set of labels. Existing labels with + the same keys are updated."##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-hl7-v2-stores-messages-patch", vec![ (Some(r##"name"##), @@ -8411,7 +9408,9 @@ fn main() { ]), ("locations-datasets-hl7-v2-stores-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-hl7-v2-stores-set-iam-policy", vec![ (Some(r##"resource"##), @@ -8480,8 +9479,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the project whose datasets should be listed (e.g., - `projects/{project_id}/locations/{location_id}`)."##), + Some(r##"The name of the project whose datasets should be listed. + For example, `projects/{project_id}/locations/{location_id}`."##), Some(true), Some(false)), @@ -8491,6 +9490,43 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-datasets-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -8583,7 +9619,9 @@ fn main() { ]), ("locations-datasets-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli/projects_locations-datasets-set-iam-policy", vec![ (Some(r##"resource"##), @@ -8696,7 +9734,7 @@ fn main() { let mut app = App::new("healthcare1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200327") .about("Manage, store, and access healthcare data in Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_healthcare1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/healthcare1_beta1/Cargo.toml b/gen/healthcare1_beta1/Cargo.toml index 75c964242f..9dddeffb95 100644 --- a/gen/healthcare1_beta1/Cargo.toml +++ b/gen/healthcare1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-healthcare1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200327" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Healthcare (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/healthcare1_beta1" homepage = "https://cloud.google.com/healthcare" -documentation = "https://docs.rs/google-healthcare1_beta1/1.0.12+20190628" +documentation = "https://docs.rs/google-healthcare1_beta1/1.0.13+20200327" license = "MIT" keywords = ["healthcare", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/healthcare1_beta1/README.md b/gen/healthcare1_beta1/README.md index e0d9dad71f..cb2c30537b 100644 --- a/gen/healthcare1_beta1/README.md +++ b/gen/healthcare1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-healthcare1_beta1` library allows access to all features of the *Google Cloud Healthcare* service. -This documentation was generated from *Cloud Healthcare* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *healthcare:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Healthcare* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *healthcare:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Healthcare* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/healthcare). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.CloudHealthcare.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.CloudHealthcare.html) ... * projects - * [*locations datasets create*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetCreateCall.html), [*locations datasets deidentify*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDeidentifyCall.html), [*locations datasets delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDeleteCall.html), [*locations datasets dicom stores create*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreCreateCall.html), [*locations datasets dicom stores delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreDeleteCall.html), [*locations datasets dicom stores export*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreExportCall.html), [*locations datasets dicom stores get*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreGetCall.html), [*locations datasets dicom stores get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreGetIamPolicyCall.html), [*locations datasets dicom stores import*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreImportCall.html), [*locations datasets dicom stores list*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreListCall.html), [*locations datasets dicom stores patch*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStorePatchCall.html), [*locations datasets dicom stores search for instances*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSearchForInstanceCall.html), [*locations datasets dicom stores search for series*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSearchForSeryCall.html), [*locations datasets dicom stores search for studies*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSearchForStudyCall.html), [*locations datasets dicom stores set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSetIamPolicyCall.html), [*locations datasets dicom stores store instances*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStoreInstanceCall.html), [*locations datasets dicom stores studies delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyDeleteCall.html), [*locations datasets dicom stores studies retrieve metadata*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall.html), [*locations datasets dicom stores studies retrieve study*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall.html), [*locations datasets dicom stores studies search for instances*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySearchForInstanceCall.html), [*locations datasets dicom stores studies search for series*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySearchForSeryCall.html), [*locations datasets dicom stores studies series delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryDeleteCall.html), [*locations datasets dicom stores studies series instances delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall.html), [*locations datasets dicom stores studies series instances frames retrieve frames*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall.html), [*locations datasets dicom stores studies series instances frames retrieve rendered*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall.html), [*locations datasets dicom stores studies series instances retrieve instance*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall.html), [*locations datasets dicom stores studies series instances retrieve metadata*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall.html), [*locations datasets dicom stores studies series instances retrieve rendered*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall.html), [*locations datasets dicom stores studies series retrieve metadata*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall.html), [*locations datasets dicom stores studies series retrieve series*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall.html), [*locations datasets dicom stores studies series search for instances*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall.html), [*locations datasets dicom stores studies store instances*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyStoreInstanceCall.html), [*locations datasets dicom stores test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreTestIamPermissionCall.html), [*locations datasets fhir stores create*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreCreateCall.html), [*locations datasets fhir stores delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreDeleteCall.html), [*locations datasets fhir stores export*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreExportCall.html), [*locations datasets fhir stores fhir observation-lastn*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirObservationLastnCall.html), [*locations datasets fhir stores fhir patient-everything*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirPatientEverythingCall.html), [*locations datasets fhir stores fhir resource-purge*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirResourcePurgeCall.html), [*locations datasets fhir stores fhir capabilities*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirCapabilityCall.html), [*locations datasets fhir stores fhir conditional delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall.html), [*locations datasets fhir stores fhir conditional patch*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirConditionalPatchCall.html), [*locations datasets fhir stores fhir conditional update*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall.html), [*locations datasets fhir stores fhir create*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirCreateCall.html), [*locations datasets fhir stores fhir delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirDeleteCall.html), [*locations datasets fhir stores fhir execute bundle*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirExecuteBundleCall.html), [*locations datasets fhir stores fhir history*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirHistoryCall.html), [*locations datasets fhir stores fhir patch*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirPatchCall.html), [*locations datasets fhir stores fhir read*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirReadCall.html), [*locations datasets fhir stores fhir search*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirSearchCall.html), [*locations datasets fhir stores fhir update*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirUpdateCall.html), [*locations datasets fhir stores fhir vread*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirVreadCall.html), [*locations datasets fhir stores get*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreGetCall.html), [*locations datasets fhir stores get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreGetIamPolicyCall.html), [*locations datasets fhir stores import*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreImportCall.html), [*locations datasets fhir stores list*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreListCall.html), [*locations datasets fhir stores patch*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStorePatchCall.html), [*locations datasets fhir stores set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreSetIamPolicyCall.html), [*locations datasets fhir stores test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreTestIamPermissionCall.html), [*locations datasets get*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetGetCall.html), [*locations datasets get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetGetIamPolicyCall.html), [*locations datasets hl7 v2 stores create*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreCreateCall.html), [*locations datasets hl7 v2 stores delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreDeleteCall.html), [*locations datasets hl7 v2 stores get*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreGetCall.html), [*locations datasets hl7 v2 stores get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreGetIamPolicyCall.html), [*locations datasets hl7 v2 stores list*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreListCall.html), [*locations datasets hl7 v2 stores messages create*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageCreateCall.html), [*locations datasets hl7 v2 stores messages delete*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageDeleteCall.html), [*locations datasets hl7 v2 stores messages get*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageGetCall.html), [*locations datasets hl7 v2 stores messages ingest*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageIngestCall.html), [*locations datasets hl7 v2 stores messages list*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageListCall.html), [*locations datasets hl7 v2 stores messages patch*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessagePatchCall.html), [*locations datasets hl7 v2 stores patch*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StorePatchCall.html), [*locations datasets hl7 v2 stores set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreSetIamPolicyCall.html), [*locations datasets hl7 v2 stores test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreTestIamPermissionCall.html), [*locations datasets list*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetListCall.html), [*locations datasets operations get*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetOperationGetCall.html), [*locations datasets operations list*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetOperationListCall.html), [*locations datasets patch*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetPatchCall.html), [*locations datasets set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetSetIamPolicyCall.html), [*locations datasets test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationDatasetTestIamPermissionCall.html), [*locations get*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationGetCall.html) and [*locations list*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.ProjectLocationListCall.html) + * [*locations datasets annotation stores get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetAnnotationStoreGetIamPolicyCall.html), [*locations datasets annotation stores set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetAnnotationStoreSetIamPolicyCall.html), [*locations datasets annotation stores test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetAnnotationStoreTestIamPermissionCall.html), [*locations datasets create*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetCreateCall.html), [*locations datasets deidentify*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDeidentifyCall.html), [*locations datasets delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDeleteCall.html), [*locations datasets dicom stores create*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreCreateCall.html), [*locations datasets dicom stores deidentify*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreDeidentifyCall.html), [*locations datasets dicom stores delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreDeleteCall.html), [*locations datasets dicom stores export*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreExportCall.html), [*locations datasets dicom stores get*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreGetCall.html), [*locations datasets dicom stores get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreGetIamPolicyCall.html), [*locations datasets dicom stores import*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreImportCall.html), [*locations datasets dicom stores list*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreListCall.html), [*locations datasets dicom stores patch*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStorePatchCall.html), [*locations datasets dicom stores search for instances*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSearchForInstanceCall.html), [*locations datasets dicom stores search for series*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSearchForSeryCall.html), [*locations datasets dicom stores search for studies*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSearchForStudyCall.html), [*locations datasets dicom stores set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreSetIamPolicyCall.html), [*locations datasets dicom stores store instances*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStoreInstanceCall.html), [*locations datasets dicom stores studies delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyDeleteCall.html), [*locations datasets dicom stores studies retrieve metadata*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall.html), [*locations datasets dicom stores studies retrieve study*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall.html), [*locations datasets dicom stores studies search for instances*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySearchForInstanceCall.html), [*locations datasets dicom stores studies search for series*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySearchForSeryCall.html), [*locations datasets dicom stores studies series delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryDeleteCall.html), [*locations datasets dicom stores studies series instances delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall.html), [*locations datasets dicom stores studies series instances frames retrieve frames*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall.html), [*locations datasets dicom stores studies series instances frames retrieve rendered*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall.html), [*locations datasets dicom stores studies series instances retrieve instance*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall.html), [*locations datasets dicom stores studies series instances retrieve metadata*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall.html), [*locations datasets dicom stores studies series instances retrieve rendered*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall.html), [*locations datasets dicom stores studies series retrieve metadata*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall.html), [*locations datasets dicom stores studies series retrieve series*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall.html), [*locations datasets dicom stores studies series search for instances*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall.html), [*locations datasets dicom stores studies store instances*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreStudyStoreInstanceCall.html), [*locations datasets dicom stores test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetDicomStoreTestIamPermissionCall.html), [*locations datasets fhir stores create*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreCreateCall.html), [*locations datasets fhir stores deidentify*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreDeidentifyCall.html), [*locations datasets fhir stores delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreDeleteCall.html), [*locations datasets fhir stores export*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreExportCall.html), [*locations datasets fhir stores fhir observation-lastn*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirObservationLastnCall.html), [*locations datasets fhir stores fhir patient-everything*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirPatientEverythingCall.html), [*locations datasets fhir stores fhir resource-purge*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirResourcePurgeCall.html), [*locations datasets fhir stores fhir capabilities*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirCapabilityCall.html), [*locations datasets fhir stores fhir conditional delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall.html), [*locations datasets fhir stores fhir conditional patch*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirConditionalPatchCall.html), [*locations datasets fhir stores fhir conditional update*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall.html), [*locations datasets fhir stores fhir create*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirCreateCall.html), [*locations datasets fhir stores fhir delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirDeleteCall.html), [*locations datasets fhir stores fhir execute bundle*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirExecuteBundleCall.html), [*locations datasets fhir stores fhir history*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirHistoryCall.html), [*locations datasets fhir stores fhir patch*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirPatchCall.html), [*locations datasets fhir stores fhir read*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirReadCall.html), [*locations datasets fhir stores fhir search*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirSearchCall.html), [*locations datasets fhir stores fhir update*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirUpdateCall.html), [*locations datasets fhir stores fhir vread*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreFhirVreadCall.html), [*locations datasets fhir stores get*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreGetCall.html), [*locations datasets fhir stores get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreGetIamPolicyCall.html), [*locations datasets fhir stores import*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreImportCall.html), [*locations datasets fhir stores list*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreListCall.html), [*locations datasets fhir stores patch*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStorePatchCall.html), [*locations datasets fhir stores search*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreSearchCall.html), [*locations datasets fhir stores set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreSetIamPolicyCall.html), [*locations datasets fhir stores test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetFhirStoreTestIamPermissionCall.html), [*locations datasets get*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetGetCall.html), [*locations datasets get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetGetIamPolicyCall.html), [*locations datasets hl7 v2 stores create*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreCreateCall.html), [*locations datasets hl7 v2 stores delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreDeleteCall.html), [*locations datasets hl7 v2 stores get*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreGetCall.html), [*locations datasets hl7 v2 stores get iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreGetIamPolicyCall.html), [*locations datasets hl7 v2 stores list*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreListCall.html), [*locations datasets hl7 v2 stores messages create*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageCreateCall.html), [*locations datasets hl7 v2 stores messages delete*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageDeleteCall.html), [*locations datasets hl7 v2 stores messages get*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageGetCall.html), [*locations datasets hl7 v2 stores messages ingest*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageIngestCall.html), [*locations datasets hl7 v2 stores messages list*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessageListCall.html), [*locations datasets hl7 v2 stores messages patch*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreMessagePatchCall.html), [*locations datasets hl7 v2 stores patch*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StorePatchCall.html), [*locations datasets hl7 v2 stores set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreSetIamPolicyCall.html), [*locations datasets hl7 v2 stores test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetHl7V2StoreTestIamPermissionCall.html), [*locations datasets list*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetListCall.html), [*locations datasets operations cancel*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetOperationCancelCall.html), [*locations datasets operations get*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetOperationGetCall.html), [*locations datasets operations list*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetOperationListCall.html), [*locations datasets patch*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetPatchCall.html), [*locations datasets set iam policy*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetSetIamPolicyCall.html), [*locations datasets test iam permissions*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationDatasetTestIamPermissionCall.html), [*locations get*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationGetCall.html) and [*locations list*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.ProjectLocationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/struct.CloudHealthcare.html)** +* **[Hub](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/struct.CloudHealthcare.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -53,6 +53,7 @@ let r = hub.projects().locations_datasets_dicom_stores_search_for_studies(...).d let r = hub.projects().locations_datasets_fhir_stores_fhir_delete(...).doit() let r = hub.projects().locations_datasets_fhir_stores_fhir_patch(...).doit() let r = hub.projects().locations_datasets_dicom_stores_studies_series_search_for_instances(...).doit() +let r = hub.projects().locations_datasets_fhir_stores_search(...).doit() let r = hub.projects().locations_datasets_dicom_stores_studies_series_instances_retrieve_rendered(...).doit() let r = hub.projects().locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_rendered(...).doit() let r = hub.projects().locations_datasets_fhir_stores_fhir_conditional_update(...).doit() @@ -132,10 +133,10 @@ let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::Htt // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! let result = hub.projects().locations_datasets_fhir_stores_fhir_history("name") - .since("sit") - .page("Stet") - .count(-42) - .at("et") + ._since("sit") + ._page_token("Stet") + ._count(-42) + ._at("et") .doit(); match result { @@ -158,17 +159,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -178,29 +179,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-healthcare1_beta1/1.0.12+20190628/google_healthcare1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-healthcare1_beta1/1.0.13+20200327/google_healthcare1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/healthcare1_beta1/src/lib.rs b/gen/healthcare1_beta1/src/lib.rs index c336ae70bb..d5ad049915 100644 --- a/gen/healthcare1_beta1/src/lib.rs +++ b/gen/healthcare1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Healthcare* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *healthcare:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Healthcare* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *healthcare:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Healthcare* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/healthcare). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.CloudHealthcare.html) ... //! //! * projects -//! * [*locations datasets create*](struct.ProjectLocationDatasetCreateCall.html), [*locations datasets deidentify*](struct.ProjectLocationDatasetDeidentifyCall.html), [*locations datasets delete*](struct.ProjectLocationDatasetDeleteCall.html), [*locations datasets dicom stores create*](struct.ProjectLocationDatasetDicomStoreCreateCall.html), [*locations datasets dicom stores delete*](struct.ProjectLocationDatasetDicomStoreDeleteCall.html), [*locations datasets dicom stores export*](struct.ProjectLocationDatasetDicomStoreExportCall.html), [*locations datasets dicom stores get*](struct.ProjectLocationDatasetDicomStoreGetCall.html), [*locations datasets dicom stores get iam policy*](struct.ProjectLocationDatasetDicomStoreGetIamPolicyCall.html), [*locations datasets dicom stores import*](struct.ProjectLocationDatasetDicomStoreImportCall.html), [*locations datasets dicom stores list*](struct.ProjectLocationDatasetDicomStoreListCall.html), [*locations datasets dicom stores patch*](struct.ProjectLocationDatasetDicomStorePatchCall.html), [*locations datasets dicom stores search for instances*](struct.ProjectLocationDatasetDicomStoreSearchForInstanceCall.html), [*locations datasets dicom stores search for series*](struct.ProjectLocationDatasetDicomStoreSearchForSeryCall.html), [*locations datasets dicom stores search for studies*](struct.ProjectLocationDatasetDicomStoreSearchForStudyCall.html), [*locations datasets dicom stores set iam policy*](struct.ProjectLocationDatasetDicomStoreSetIamPolicyCall.html), [*locations datasets dicom stores store instances*](struct.ProjectLocationDatasetDicomStoreStoreInstanceCall.html), [*locations datasets dicom stores studies delete*](struct.ProjectLocationDatasetDicomStoreStudyDeleteCall.html), [*locations datasets dicom stores studies retrieve metadata*](struct.ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall.html), [*locations datasets dicom stores studies retrieve study*](struct.ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall.html), [*locations datasets dicom stores studies search for instances*](struct.ProjectLocationDatasetDicomStoreStudySearchForInstanceCall.html), [*locations datasets dicom stores studies search for series*](struct.ProjectLocationDatasetDicomStoreStudySearchForSeryCall.html), [*locations datasets dicom stores studies series delete*](struct.ProjectLocationDatasetDicomStoreStudySeryDeleteCall.html), [*locations datasets dicom stores studies series instances delete*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall.html), [*locations datasets dicom stores studies series instances frames retrieve frames*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall.html), [*locations datasets dicom stores studies series instances frames retrieve rendered*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall.html), [*locations datasets dicom stores studies series instances retrieve instance*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall.html), [*locations datasets dicom stores studies series instances retrieve metadata*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall.html), [*locations datasets dicom stores studies series instances retrieve rendered*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall.html), [*locations datasets dicom stores studies series retrieve metadata*](struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall.html), [*locations datasets dicom stores studies series retrieve series*](struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall.html), [*locations datasets dicom stores studies series search for instances*](struct.ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall.html), [*locations datasets dicom stores studies store instances*](struct.ProjectLocationDatasetDicomStoreStudyStoreInstanceCall.html), [*locations datasets dicom stores test iam permissions*](struct.ProjectLocationDatasetDicomStoreTestIamPermissionCall.html), [*locations datasets fhir stores create*](struct.ProjectLocationDatasetFhirStoreCreateCall.html), [*locations datasets fhir stores delete*](struct.ProjectLocationDatasetFhirStoreDeleteCall.html), [*locations datasets fhir stores export*](struct.ProjectLocationDatasetFhirStoreExportCall.html), [*locations datasets fhir stores fhir observation-lastn*](struct.ProjectLocationDatasetFhirStoreFhirObservationLastnCall.html), [*locations datasets fhir stores fhir patient-everything*](struct.ProjectLocationDatasetFhirStoreFhirPatientEverythingCall.html), [*locations datasets fhir stores fhir resource-purge*](struct.ProjectLocationDatasetFhirStoreFhirResourcePurgeCall.html), [*locations datasets fhir stores fhir capabilities*](struct.ProjectLocationDatasetFhirStoreFhirCapabilityCall.html), [*locations datasets fhir stores fhir conditional delete*](struct.ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall.html), [*locations datasets fhir stores fhir conditional patch*](struct.ProjectLocationDatasetFhirStoreFhirConditionalPatchCall.html), [*locations datasets fhir stores fhir conditional update*](struct.ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall.html), [*locations datasets fhir stores fhir create*](struct.ProjectLocationDatasetFhirStoreFhirCreateCall.html), [*locations datasets fhir stores fhir delete*](struct.ProjectLocationDatasetFhirStoreFhirDeleteCall.html), [*locations datasets fhir stores fhir execute bundle*](struct.ProjectLocationDatasetFhirStoreFhirExecuteBundleCall.html), [*locations datasets fhir stores fhir history*](struct.ProjectLocationDatasetFhirStoreFhirHistoryCall.html), [*locations datasets fhir stores fhir patch*](struct.ProjectLocationDatasetFhirStoreFhirPatchCall.html), [*locations datasets fhir stores fhir read*](struct.ProjectLocationDatasetFhirStoreFhirReadCall.html), [*locations datasets fhir stores fhir search*](struct.ProjectLocationDatasetFhirStoreFhirSearchCall.html), [*locations datasets fhir stores fhir update*](struct.ProjectLocationDatasetFhirStoreFhirUpdateCall.html), [*locations datasets fhir stores fhir vread*](struct.ProjectLocationDatasetFhirStoreFhirVreadCall.html), [*locations datasets fhir stores get*](struct.ProjectLocationDatasetFhirStoreGetCall.html), [*locations datasets fhir stores get iam policy*](struct.ProjectLocationDatasetFhirStoreGetIamPolicyCall.html), [*locations datasets fhir stores import*](struct.ProjectLocationDatasetFhirStoreImportCall.html), [*locations datasets fhir stores list*](struct.ProjectLocationDatasetFhirStoreListCall.html), [*locations datasets fhir stores patch*](struct.ProjectLocationDatasetFhirStorePatchCall.html), [*locations datasets fhir stores set iam policy*](struct.ProjectLocationDatasetFhirStoreSetIamPolicyCall.html), [*locations datasets fhir stores test iam permissions*](struct.ProjectLocationDatasetFhirStoreTestIamPermissionCall.html), [*locations datasets get*](struct.ProjectLocationDatasetGetCall.html), [*locations datasets get iam policy*](struct.ProjectLocationDatasetGetIamPolicyCall.html), [*locations datasets hl7 v2 stores create*](struct.ProjectLocationDatasetHl7V2StoreCreateCall.html), [*locations datasets hl7 v2 stores delete*](struct.ProjectLocationDatasetHl7V2StoreDeleteCall.html), [*locations datasets hl7 v2 stores get*](struct.ProjectLocationDatasetHl7V2StoreGetCall.html), [*locations datasets hl7 v2 stores get iam policy*](struct.ProjectLocationDatasetHl7V2StoreGetIamPolicyCall.html), [*locations datasets hl7 v2 stores list*](struct.ProjectLocationDatasetHl7V2StoreListCall.html), [*locations datasets hl7 v2 stores messages create*](struct.ProjectLocationDatasetHl7V2StoreMessageCreateCall.html), [*locations datasets hl7 v2 stores messages delete*](struct.ProjectLocationDatasetHl7V2StoreMessageDeleteCall.html), [*locations datasets hl7 v2 stores messages get*](struct.ProjectLocationDatasetHl7V2StoreMessageGetCall.html), [*locations datasets hl7 v2 stores messages ingest*](struct.ProjectLocationDatasetHl7V2StoreMessageIngestCall.html), [*locations datasets hl7 v2 stores messages list*](struct.ProjectLocationDatasetHl7V2StoreMessageListCall.html), [*locations datasets hl7 v2 stores messages patch*](struct.ProjectLocationDatasetHl7V2StoreMessagePatchCall.html), [*locations datasets hl7 v2 stores patch*](struct.ProjectLocationDatasetHl7V2StorePatchCall.html), [*locations datasets hl7 v2 stores set iam policy*](struct.ProjectLocationDatasetHl7V2StoreSetIamPolicyCall.html), [*locations datasets hl7 v2 stores test iam permissions*](struct.ProjectLocationDatasetHl7V2StoreTestIamPermissionCall.html), [*locations datasets list*](struct.ProjectLocationDatasetListCall.html), [*locations datasets operations get*](struct.ProjectLocationDatasetOperationGetCall.html), [*locations datasets operations list*](struct.ProjectLocationDatasetOperationListCall.html), [*locations datasets patch*](struct.ProjectLocationDatasetPatchCall.html), [*locations datasets set iam policy*](struct.ProjectLocationDatasetSetIamPolicyCall.html), [*locations datasets test iam permissions*](struct.ProjectLocationDatasetTestIamPermissionCall.html), [*locations get*](struct.ProjectLocationGetCall.html) and [*locations list*](struct.ProjectLocationListCall.html) +//! * [*locations datasets annotation stores get iam policy*](struct.ProjectLocationDatasetAnnotationStoreGetIamPolicyCall.html), [*locations datasets annotation stores set iam policy*](struct.ProjectLocationDatasetAnnotationStoreSetIamPolicyCall.html), [*locations datasets annotation stores test iam permissions*](struct.ProjectLocationDatasetAnnotationStoreTestIamPermissionCall.html), [*locations datasets create*](struct.ProjectLocationDatasetCreateCall.html), [*locations datasets deidentify*](struct.ProjectLocationDatasetDeidentifyCall.html), [*locations datasets delete*](struct.ProjectLocationDatasetDeleteCall.html), [*locations datasets dicom stores create*](struct.ProjectLocationDatasetDicomStoreCreateCall.html), [*locations datasets dicom stores deidentify*](struct.ProjectLocationDatasetDicomStoreDeidentifyCall.html), [*locations datasets dicom stores delete*](struct.ProjectLocationDatasetDicomStoreDeleteCall.html), [*locations datasets dicom stores export*](struct.ProjectLocationDatasetDicomStoreExportCall.html), [*locations datasets dicom stores get*](struct.ProjectLocationDatasetDicomStoreGetCall.html), [*locations datasets dicom stores get iam policy*](struct.ProjectLocationDatasetDicomStoreGetIamPolicyCall.html), [*locations datasets dicom stores import*](struct.ProjectLocationDatasetDicomStoreImportCall.html), [*locations datasets dicom stores list*](struct.ProjectLocationDatasetDicomStoreListCall.html), [*locations datasets dicom stores patch*](struct.ProjectLocationDatasetDicomStorePatchCall.html), [*locations datasets dicom stores search for instances*](struct.ProjectLocationDatasetDicomStoreSearchForInstanceCall.html), [*locations datasets dicom stores search for series*](struct.ProjectLocationDatasetDicomStoreSearchForSeryCall.html), [*locations datasets dicom stores search for studies*](struct.ProjectLocationDatasetDicomStoreSearchForStudyCall.html), [*locations datasets dicom stores set iam policy*](struct.ProjectLocationDatasetDicomStoreSetIamPolicyCall.html), [*locations datasets dicom stores store instances*](struct.ProjectLocationDatasetDicomStoreStoreInstanceCall.html), [*locations datasets dicom stores studies delete*](struct.ProjectLocationDatasetDicomStoreStudyDeleteCall.html), [*locations datasets dicom stores studies retrieve metadata*](struct.ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall.html), [*locations datasets dicom stores studies retrieve study*](struct.ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall.html), [*locations datasets dicom stores studies search for instances*](struct.ProjectLocationDatasetDicomStoreStudySearchForInstanceCall.html), [*locations datasets dicom stores studies search for series*](struct.ProjectLocationDatasetDicomStoreStudySearchForSeryCall.html), [*locations datasets dicom stores studies series delete*](struct.ProjectLocationDatasetDicomStoreStudySeryDeleteCall.html), [*locations datasets dicom stores studies series instances delete*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall.html), [*locations datasets dicom stores studies series instances frames retrieve frames*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall.html), [*locations datasets dicom stores studies series instances frames retrieve rendered*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall.html), [*locations datasets dicom stores studies series instances retrieve instance*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall.html), [*locations datasets dicom stores studies series instances retrieve metadata*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall.html), [*locations datasets dicom stores studies series instances retrieve rendered*](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall.html), [*locations datasets dicom stores studies series retrieve metadata*](struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall.html), [*locations datasets dicom stores studies series retrieve series*](struct.ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall.html), [*locations datasets dicom stores studies series search for instances*](struct.ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall.html), [*locations datasets dicom stores studies store instances*](struct.ProjectLocationDatasetDicomStoreStudyStoreInstanceCall.html), [*locations datasets dicom stores test iam permissions*](struct.ProjectLocationDatasetDicomStoreTestIamPermissionCall.html), [*locations datasets fhir stores create*](struct.ProjectLocationDatasetFhirStoreCreateCall.html), [*locations datasets fhir stores deidentify*](struct.ProjectLocationDatasetFhirStoreDeidentifyCall.html), [*locations datasets fhir stores delete*](struct.ProjectLocationDatasetFhirStoreDeleteCall.html), [*locations datasets fhir stores export*](struct.ProjectLocationDatasetFhirStoreExportCall.html), [*locations datasets fhir stores fhir observation-lastn*](struct.ProjectLocationDatasetFhirStoreFhirObservationLastnCall.html), [*locations datasets fhir stores fhir patient-everything*](struct.ProjectLocationDatasetFhirStoreFhirPatientEverythingCall.html), [*locations datasets fhir stores fhir resource-purge*](struct.ProjectLocationDatasetFhirStoreFhirResourcePurgeCall.html), [*locations datasets fhir stores fhir capabilities*](struct.ProjectLocationDatasetFhirStoreFhirCapabilityCall.html), [*locations datasets fhir stores fhir conditional delete*](struct.ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall.html), [*locations datasets fhir stores fhir conditional patch*](struct.ProjectLocationDatasetFhirStoreFhirConditionalPatchCall.html), [*locations datasets fhir stores fhir conditional update*](struct.ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall.html), [*locations datasets fhir stores fhir create*](struct.ProjectLocationDatasetFhirStoreFhirCreateCall.html), [*locations datasets fhir stores fhir delete*](struct.ProjectLocationDatasetFhirStoreFhirDeleteCall.html), [*locations datasets fhir stores fhir execute bundle*](struct.ProjectLocationDatasetFhirStoreFhirExecuteBundleCall.html), [*locations datasets fhir stores fhir history*](struct.ProjectLocationDatasetFhirStoreFhirHistoryCall.html), [*locations datasets fhir stores fhir patch*](struct.ProjectLocationDatasetFhirStoreFhirPatchCall.html), [*locations datasets fhir stores fhir read*](struct.ProjectLocationDatasetFhirStoreFhirReadCall.html), [*locations datasets fhir stores fhir search*](struct.ProjectLocationDatasetFhirStoreFhirSearchCall.html), [*locations datasets fhir stores fhir update*](struct.ProjectLocationDatasetFhirStoreFhirUpdateCall.html), [*locations datasets fhir stores fhir vread*](struct.ProjectLocationDatasetFhirStoreFhirVreadCall.html), [*locations datasets fhir stores get*](struct.ProjectLocationDatasetFhirStoreGetCall.html), [*locations datasets fhir stores get iam policy*](struct.ProjectLocationDatasetFhirStoreGetIamPolicyCall.html), [*locations datasets fhir stores import*](struct.ProjectLocationDatasetFhirStoreImportCall.html), [*locations datasets fhir stores list*](struct.ProjectLocationDatasetFhirStoreListCall.html), [*locations datasets fhir stores patch*](struct.ProjectLocationDatasetFhirStorePatchCall.html), [*locations datasets fhir stores search*](struct.ProjectLocationDatasetFhirStoreSearchCall.html), [*locations datasets fhir stores set iam policy*](struct.ProjectLocationDatasetFhirStoreSetIamPolicyCall.html), [*locations datasets fhir stores test iam permissions*](struct.ProjectLocationDatasetFhirStoreTestIamPermissionCall.html), [*locations datasets get*](struct.ProjectLocationDatasetGetCall.html), [*locations datasets get iam policy*](struct.ProjectLocationDatasetGetIamPolicyCall.html), [*locations datasets hl7 v2 stores create*](struct.ProjectLocationDatasetHl7V2StoreCreateCall.html), [*locations datasets hl7 v2 stores delete*](struct.ProjectLocationDatasetHl7V2StoreDeleteCall.html), [*locations datasets hl7 v2 stores get*](struct.ProjectLocationDatasetHl7V2StoreGetCall.html), [*locations datasets hl7 v2 stores get iam policy*](struct.ProjectLocationDatasetHl7V2StoreGetIamPolicyCall.html), [*locations datasets hl7 v2 stores list*](struct.ProjectLocationDatasetHl7V2StoreListCall.html), [*locations datasets hl7 v2 stores messages create*](struct.ProjectLocationDatasetHl7V2StoreMessageCreateCall.html), [*locations datasets hl7 v2 stores messages delete*](struct.ProjectLocationDatasetHl7V2StoreMessageDeleteCall.html), [*locations datasets hl7 v2 stores messages get*](struct.ProjectLocationDatasetHl7V2StoreMessageGetCall.html), [*locations datasets hl7 v2 stores messages ingest*](struct.ProjectLocationDatasetHl7V2StoreMessageIngestCall.html), [*locations datasets hl7 v2 stores messages list*](struct.ProjectLocationDatasetHl7V2StoreMessageListCall.html), [*locations datasets hl7 v2 stores messages patch*](struct.ProjectLocationDatasetHl7V2StoreMessagePatchCall.html), [*locations datasets hl7 v2 stores patch*](struct.ProjectLocationDatasetHl7V2StorePatchCall.html), [*locations datasets hl7 v2 stores set iam policy*](struct.ProjectLocationDatasetHl7V2StoreSetIamPolicyCall.html), [*locations datasets hl7 v2 stores test iam permissions*](struct.ProjectLocationDatasetHl7V2StoreTestIamPermissionCall.html), [*locations datasets list*](struct.ProjectLocationDatasetListCall.html), [*locations datasets operations cancel*](struct.ProjectLocationDatasetOperationCancelCall.html), [*locations datasets operations get*](struct.ProjectLocationDatasetOperationGetCall.html), [*locations datasets operations list*](struct.ProjectLocationDatasetOperationListCall.html), [*locations datasets patch*](struct.ProjectLocationDatasetPatchCall.html), [*locations datasets set iam policy*](struct.ProjectLocationDatasetSetIamPolicyCall.html), [*locations datasets test iam permissions*](struct.ProjectLocationDatasetTestIamPermissionCall.html), [*locations get*](struct.ProjectLocationGetCall.html) and [*locations list*](struct.ProjectLocationListCall.html) //! //! //! @@ -53,6 +53,7 @@ //! let r = hub.projects().locations_datasets_fhir_stores_fhir_delete(...).doit() //! let r = hub.projects().locations_datasets_fhir_stores_fhir_patch(...).doit() //! let r = hub.projects().locations_datasets_dicom_stores_studies_series_search_for_instances(...).doit() +//! let r = hub.projects().locations_datasets_fhir_stores_search(...).doit() //! let r = hub.projects().locations_datasets_dicom_stores_studies_series_instances_retrieve_rendered(...).doit() //! let r = hub.projects().locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_rendered(...).doit() //! let r = hub.projects().locations_datasets_fhir_stores_fhir_conditional_update(...).doit() @@ -133,10 +134,10 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.projects().locations_datasets_fhir_stores_fhir_history("name") -//! .since("kasd") -//! .page("accusam") -//! .count(-8) -//! .at("justo") +//! ._since("kasd") +//! ._page_token("accusam") +//! ._count(-8) +//! ._at("justo") //! .doit(); //! //! match result { @@ -314,10 +315,10 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_datasets_fhir_stores_fhir_history("name") -/// .since("erat") -/// .page("labore") -/// .count(-9) -/// .at("nonumy") +/// ._since("erat") +/// ._page_token("labore") +/// ._count(-9) +/// ._at("nonumy") /// .doit(); /// /// match result { @@ -355,7 +356,7 @@ impl<'a, C, A> CloudHealthcare CloudHealthcare { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://healthcare.googleapis.com/".to_string(), _root_url: "https://healthcare.googleapis.com/".to_string(), } @@ -366,7 +367,7 @@ impl<'a, C, A> CloudHealthcare } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -394,8 +395,8 @@ impl<'a, C, A> CloudHealthcare // ############ // SCHEMAS ### // ########## -/// Define how to redact sensitive values. Default behaviour is erase, -/// e.g. "My name is Jake." becomes "My name is ." +/// Define how to redact sensitive values. Default behaviour is erase. +/// For example, "My name is Jane." becomes "My name is ." /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -444,7 +445,7 @@ impl RequestValue for DicomStore {} impl ResponseResult for DicomStore {} -/// The Cloud Storage location where the output should be written, and the export +/// The Cloud Storage location where the server writes the output and the export /// configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -452,27 +453,48 @@ impl ResponseResult for DicomStore {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudHealthcareV1beta1DicomGcsDestination { /// MIME types supported by DICOM spec. - /// Each file will be written in the following format: + /// Each file is written in the following format: /// `.../{study_id}/{series_id}/{instance_id}[/{frame_number}].{extension}` - /// The frame_number component will exist only for multi-frame instances. + /// The frame_number component exists only for multi-frame instances. /// - /// Refer to the DICOM conformance statement for permissible MIME types: - /// https://cloud.google.com/healthcare/docs/dicom#wado-rs + /// Supported MIME types are consistent with supported formats in DICOMweb: + /// https://cloud.google.com/healthcare/docs/dicom#retrieve_transaction. + /// Specifically, the following are supported: /// - /// The following extensions will be used for output files: - /// application/dicom -> .dcm - /// image/jpeg -> .jpg - /// image/png -> .png + /// * application/dicom; transfer-syntax=1.2.840.10008.1.2.1 + /// (uncompressed DICOM) + /// * application/dicom; transfer-syntax=1.2.840.10008.1.2.4.50 + /// (DICOM with embedded JPEG Baseline) + /// * application/dicom; transfer-syntax=1.2.840.10008.1.2.4.90 + /// (DICOM with embedded JPEG 2000 Lossless Only) + /// * application/dicom; transfer-syntax=1.2.840.10008.1.2.4.91 + /// (DICOM with embedded JPEG 2000)h + /// * application/dicom; transfer-syntax=* + /// (DICOM with no transcoding) + /// * application/octet-stream; transfer-syntax=1.2.840.10008.1.2.1 + /// (raw uncompressed PixelData) + /// * application/octet-stream; transfer-syntax=* + /// (raw PixelData in whatever format it was uploaded in) + /// * image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.50 + /// (Consumer JPEG) + /// * image/png /// - /// If unspecified, the instances will be exported in their original - /// DICOM format. + /// The following extensions are used for output files: + /// + /// * application/dicom -> .dcm + /// * image/jpeg -> .jpg + /// * image/png -> .png + /// * application/octet-stream -> no extension + /// + /// If unspecified, the instances are exported in the original + /// DICOM format they were uploaded in. #[serde(rename="mimeType")] pub mime_type: Option, /// The Cloud Storage destination to export to. /// - /// URI for a Cloud Storage directory where result files should be written (in - /// the format `gs://{bucket-id}/{path/to/destination/dir}`). If there is no - /// trailing slash, the service will append one when composing the object path. + /// URI for a Cloud Storage directory where the server writes the result files, + /// in the format `gs://{bucket-id}/{path/to/destination/dir}`). If there is no + /// trailing slash, the service appends one when composing the object path. /// The user is responsible for creating the Cloud Storage bucket referenced in /// `uri_prefix`. #[serde(rename="uriPrefix")] @@ -500,10 +522,43 @@ pub struct CreateMessageRequest { impl RequestValue for CreateMessageRequest {} +/// Creates a new DICOM store with sensitive information de-identified. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations datasets dicom stores deidentify projects](struct.ProjectLocationDatasetDicomStoreDeidentifyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeidentifyDicomStoreRequest { + /// Filter configuration. + #[serde(rename="filterConfig")] + pub filter_config: Option, + /// The name of the DICOM store to create and write the redacted data to. + /// For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// * The destination dataset must exist. + /// * The source dataset and destination dataset must both reside in the same + /// project. De-identifying data across multiple projects is not supported. + /// * The destination DICOM store must not exist. + /// * The caller must have the necessary permissions to create the destination + /// DICOM store. + #[serde(rename="destinationStore")] + pub destination_store: Option, + /// De-identify configuration. + pub config: Option, +} + +impl RequestValue for DeidentifyDicomStoreRequest {} + + /// Imports data into the specified DICOM store. /// Returns an error if any of the files to import are not DICOM files. This -/// API will accept duplicate DICOM instances, by simply ignoring the newly -/// pushed instance (it will not overwrite). +/// API accepts duplicate DICOM instances by ignoring the newly-pushed instance. +/// It does not overwrite. /// /// # Activities /// @@ -525,9 +580,33 @@ pub struct ImportDicomDataRequest { impl RequestValue for ImportDicomDataRequest {} -/// When using the INSPECT_AND_TRANSFORM action, each match is replaced with -/// the name of the info_type. For example, "My name is Jake" becomes "My name is -/// [PERSON_NAME]." The TRANSFORM action is equivalent to redacting. +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations datasets operations list projects](struct.ProjectLocationDatasetOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, +} + +impl ResponseResult for ListOperationsResponse {} + + +/// When using the +/// INSPECT_AND_TRANSFORM +/// action, each match is replaced with the name of the info_type. For example, +/// "My name is Jane" becomes "My name is [PERSON_NAME]." The +/// TRANSFORM +/// action is equivalent to redacting. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -537,37 +616,17 @@ pub struct ReplaceWithInfoTypeConfig { _never_set: Option } impl Part for ReplaceWithInfoTypeConfig {} -/// A generic empty message that you can re-use to avoid defining duplicated -/// empty messages in your APIs. A typical example is to use it as the request -/// or the response type of an API method. For instance: +/// A list of FHIR resources. /// -/// ````text -/// service Foo { -/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -/// } -/// ```` +/// This type is not used in any activity, and only used as *part* of another schema. /// -/// The JSON representation for `Empty` is empty JSON object `{}`. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations datasets dicom stores studies series delete projects](struct.ProjectLocationDatasetDicomStoreStudySeryDeleteCall.html) (response) -/// * [locations datasets fhir stores fhir resource-purge projects](struct.ProjectLocationDatasetFhirStoreFhirResourcePurgeCall.html) (response) -/// * [locations datasets delete projects](struct.ProjectLocationDatasetDeleteCall.html) (response) -/// * [locations datasets fhir stores fhir conditional delete projects](struct.ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall.html) (response) -/// * [locations datasets dicom stores studies series instances delete projects](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall.html) (response) -/// * [locations datasets dicom stores studies delete projects](struct.ProjectLocationDatasetDicomStoreStudyDeleteCall.html) (response) -/// * [locations datasets dicom stores delete projects](struct.ProjectLocationDatasetDicomStoreDeleteCall.html) (response) -/// * [locations datasets hl7 v2 stores messages delete projects](struct.ProjectLocationDatasetHl7V2StoreMessageDeleteCall.html) (response) -/// * [locations datasets fhir stores delete projects](struct.ProjectLocationDatasetFhirStoreDeleteCall.html) (response) -/// * [locations datasets hl7 v2 stores delete projects](struct.ProjectLocationDatasetHl7V2StoreDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Empty { _never_set: Option } +pub struct Resources { + /// List of resources IDs. For example, "Patient/1234". + pub resources: Option>, +} -impl ResponseResult for Empty {} +impl Part for Resources {} /// The `Status` type defines a logical error model that is suitable for @@ -596,6 +655,29 @@ pub struct Status { impl Part for Status {} +/// Specifies the filter configuration for DICOM resources. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DicomFilterConfig { + /// The Cloud Storage location of the filter configuration file. + /// The `gcs_uri` must be in the format `gs://bucket/path/to/object`. + /// The filter configuration file must contain a list of resource paths + /// separated by newline characters (\n or \r\n). Each resource path + /// must be in the format + /// "/studies/{studyUID}[/series/{seriesUID}[/instances/{instanceUID}]]" + /// + /// The Cloud Healthcare API service account must have the + /// `roles/storage.objectViewer` Cloud IAM role for this Cloud Storage + /// location. + #[serde(rename="resourcePathsGcsUri")] + pub resource_paths_gcs_uri: Option, +} + +impl Part for DicomFilterConfig {} + + /// Response message for `TestIamPermissions` method. /// /// # Activities @@ -605,6 +687,7 @@ impl Part for Status {} /// /// * [locations datasets dicom stores test iam permissions projects](struct.ProjectLocationDatasetDicomStoreTestIamPermissionCall.html) (response) /// * [locations datasets test iam permissions projects](struct.ProjectLocationDatasetTestIamPermissionCall.html) (response) +/// * [locations datasets annotation stores test iam permissions projects](struct.ProjectLocationDatasetAnnotationStoreTestIamPermissionCall.html) (response) /// * [locations datasets fhir stores test iam permissions projects](struct.ProjectLocationDatasetFhirStoreTestIamPermissionCall.html) (response) /// * [locations datasets hl7 v2 stores test iam permissions projects](struct.ProjectLocationDatasetHl7V2StoreTestIamPermissionCall.html) (response) /// @@ -642,7 +725,24 @@ pub struct ListHl7V2StoresResponse { impl ResponseResult for ListHl7V2StoresResponse {} -/// The BigQuery table where the output should be written. +/// Root config for HL7v2 datatype definitions for a specific HL7v2 version. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Hl7TypesConfig { + /// The version selectors that this config applies to. A message must match + /// ALL version sources to apply. + pub version: Option>, + /// The HL7v2 type definitions. + #[serde(rename="type")] + pub type_: Option>, +} + +impl Part for Hl7TypesConfig {} + + +/// The BigQuery table where the server writes the output. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -653,7 +753,7 @@ pub struct GoogleCloudHealthcareV1beta1DicomBigQueryDestination { #[serde(rename="tableUri")] pub table_uri: Option, /// If the destination table already exists and this flag is `TRUE`, the table - /// will be overwritten by the contents of the DICOM store. If the flag is not + /// is overwritten by the contents of the DICOM store. If the flag is not /// set and the destination table already exists, the export call returns an /// error. pub force: Option, @@ -703,8 +803,10 @@ impl RequestValue for ImportResourcesRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchResourcesRequest { /// The FHIR resource type to search, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). #[serde(rename="resourceType")] pub resource_type: Option, } @@ -712,7 +814,7 @@ pub struct SearchResourcesRequest { impl RequestValue for SearchResourcesRequest {} -/// Specifies where notifications should be sent upon changes to a data store. +/// Specifies where to send notifications upon changes to a data store. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -720,7 +822,7 @@ impl RequestValue for SearchResourcesRequest {} pub struct NotificationConfig { /// The [Cloud Pub/Sub](https://cloud.google.com/pubsub/docs/) topic that /// notifications of changes are published on. Supplied by the client. - /// PubsubMessage.Data will contain the resource name. + /// PubsubMessage.Data contains the resource name. /// PubsubMessage.MessageId is the ID of this message. It is guaranteed to be /// unique within the topic. /// PubsubMessage.PublishTime is the time at which the message was published. @@ -729,7 +831,12 @@ pub struct NotificationConfig { /// names](https://cloud.google.com/pubsub/docs/overview#names) must be scoped /// to a project. cloud-healthcare@system.gserviceaccount.com must have /// publisher permissions on the given Cloud Pub/Sub topic. Not having adequate - /// permissions will cause the calls that send notifications to fail. + /// permissions causes the calls that send notifications to fail. + /// + /// If a notification can't be published to Cloud Pub/Sub, errors are logged to + /// Stackdriver (see [Viewing + /// logs](/healthcare/docs/how-tos/stackdriver-logging)). If the number of + /// errors exceeds a certain rate, some aren't submitted. #[serde(rename="pubsubTopic")] pub pubsub_topic: Option, } @@ -737,6 +844,23 @@ pub struct NotificationConfig { impl Part for NotificationConfig {} +/// Describes a selector for extracting and matching an MSH field to a value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VersionSource { + /// The field to extract from the MSH segment. For example, "3.1" or "18[1].1". + #[serde(rename="mshField")] + pub msh_field: Option, + /// The value to match with the field. For example, "My Application Name" or + /// "2.3". + pub value: Option, +} + +impl Part for VersionSource {} + + /// The configuration for the parser. It determines how the server parses the /// messages. /// @@ -747,16 +871,20 @@ pub struct ParserConfig { /// Determines whether messages with no header are allowed. #[serde(rename="allowNullHeader")] pub allow_null_header: Option, - /// Byte(s) to be used as the segment terminator. If this is unset, '\r' will - /// be used as segment terminator. + /// Byte(s) to use as the segment terminator. If this is unset, '\r' is + /// used as segment terminator, matching the HL7 version 2 + /// specification. #[serde(rename="segmentTerminator")] pub segment_terminator: Option, + /// Schemas used to parse messages in this store, if schematized parsing is + /// desired. + pub schema: Option, } impl Part for ParserConfig {} -/// The content of a HL7v2 message in a structured format. +/// The content of an HL7v2 message in a structured format. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -769,6 +897,90 @@ pub struct ParsedData { impl Part for ParsedData {} +/// Request message for `SetIamPolicy` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations datasets annotation stores set iam policy projects](struct.ProjectLocationDatasetAnnotationStoreSetIamPolicyCall.html) (request) +/// * [locations datasets set iam policy projects](struct.ProjectLocationDatasetSetIamPolicyCall.html) (request) +/// * [locations datasets dicom stores set iam policy projects](struct.ProjectLocationDatasetDicomStoreSetIamPolicyCall.html) (request) +/// * [locations datasets hl7 v2 stores set iam policy projects](struct.ProjectLocationDatasetHl7V2StoreSetIamPolicyCall.html) (request) +/// * [locations datasets fhir stores set iam policy projects](struct.ProjectLocationDatasetFhirStoreSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. The size of + /// the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + /// the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: + /// paths: "bindings, etag" + /// This field is only used by Cloud IAM. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// This structure contains configuration for streaming FHIR export. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StreamConfig { + /// The destination BigQuery structure that contains both the dataset + /// location and corresponding schema config. + /// + /// The output is organized in one table per resource type. The server + /// reuses the existing tables (if any) that are named after the resource + /// types, e.g. "Patient", "Observation". When there is no existing table + /// for a given resource type, the server attempts to create one. + /// + /// When a table schema doesn't align with the schema config, either + /// because of existing incompatible schema or out of band incompatible + /// modification, the server does not stream in new data. + /// + /// One resolution in this case is to delete the incompatible + /// table and let the server recreate one, though the newly created table + /// only contains data after the table recreation. + /// + /// BigQuery imposes a 1 MB limit on streaming insert row size, therefore + /// any resource mutation that generates more than 1 MB of BigQuery data + /// will not be streamed. + /// + /// Results are appended to the corresponding BigQuery tables. Different + /// versions of the same resource are distinguishable by the meta.versionId + /// and meta.lastUpdated columns. The operation (CREATE/UPDATE/DELETE) that + /// results in the new version is recorded in the meta.tag. + /// + /// The tables contain all historical resource versions since streaming was + /// enabled. For query convenience, the server also creates one view per + /// table of the same name containing only the current resource version. + /// + /// If a resource mutation cannot be streamed to BigQuery, errors will be + /// logged to Stackdriver (see [Viewing logs](/healthcare/docs/how- + /// tos/stackdriver-logging)). + #[serde(rename="bigqueryDestination")] + pub bigquery_destination: Option, + /// Supply a FHIR resource type (such as "Patient" or "Observation"). + /// See https://www.hl7.org/fhir/valueset-resource-types.html for a list of + /// all FHIR resource types. + /// The server treats an empty list as an intent to stream all the + /// supported resource types in this FHIR store. + #[serde(rename="resourceTypes")] + pub resource_types: Option>, +} + +impl Part for StreamConfig {} + + /// Lists the DICOM stores in the given dataset. /// /// # Activities @@ -860,10 +1072,10 @@ impl Part for DeidentifyConfig {} /// Exports data from the specified DICOM store. -/// If a given resource (e.g., a DICOM object with the same SOPInstance UID) +/// If a given resource, such as a DICOM object with the same SOPInstance UID, /// already exists in the output, it is overwritten with the version /// in the source dataset. -/// Exported DICOM data will persist when the DICOM store from which it was +/// Exported DICOM data persists when the DICOM store from which it was /// exported is deleted. /// /// # Activities @@ -917,6 +1129,64 @@ pub struct ListDatasetsResponse { impl ResponseResult for ListDatasetsResponse {} +/// Specifies where and whether to send notifications upon changes to a +/// data store. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Hl7V2NotificationConfig { + /// Restricts notifications sent for messages matching a filter. If this is + /// empty, all messages are matched. Syntax: + /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings + /// + /// Fields/functions available for filtering are: + /// + /// * `message_type`, from the MSH-9.1 field. For example, + /// `NOT message_type = "ADT"`. + /// * `send_date` or `sendDate`, the YYYY-MM-DD date the message was sent in + /// the dataset's time_zone, from the MSH-7 segment. For example, + /// `send_date < "2017-01-02"`. + /// * `send_time`, the timestamp when the message was sent, using the + /// RFC3339 time format for comparisons, from the MSH-7 segment. For example, + /// `send_time < "2017-01-02T00:00:00-05:00"`. + /// * `send_facility`, the care center that the message came from, from the + /// MSH-4 segment. For example, `send_facility = "ABC"`. + /// * `PatientId(value, type)`, which matches if the message lists a patient + /// having an ID of the given value and type in the PID-2, PID-3, or PID-4 + /// segments. For example, `PatientId("123456", "MRN")`. + /// * `labels.x`, a string value of the label with key `x` as set using the + /// Message.labels + /// map. For example, `labels."priority"="high"`. The operator `:*` can be + /// used to assert the existence of a label. For example, + /// `labels."priority":*`. + pub filter: Option, + /// The [Cloud Pubsub](https://cloud.google.com/pubsub/docs/) topic that + /// notifications of changes are published on. Supplied by the client. The + /// notification is a `PubsubMessage` with the following fields: + /// + /// * `PubsubMessage.Data` contains the resource name. + /// * `PubsubMessage.MessageId` is the ID of this notification. It is + /// guaranteed to be unique within the topic. + /// * `PubsubMessage.PublishTime` is the time at which the message was + /// published. + /// + /// Note that notifications are only sent if the topic is non-empty. [Topic + /// names](https://cloud.google.com/pubsub/docs/overview#names) must be + /// scoped to a project. cloud-healthcare@system.gserviceaccount.com must + /// have publisher permissions on the given Pubsub topic. Not having adequate + /// permissions causes the calls that send notifications to fail. + /// + /// If a notification cannot be published to Cloud Pub/Sub, errors will be + /// logged to Stackdriver (see [Viewing logs](/healthcare/docs/how- + /// tos/stackdriver-logging)). + #[serde(rename="pubsubTopic")] + pub pubsub_topic: Option, +} + +impl Part for Hl7V2NotificationConfig {} + + /// Associates `members` with a `role`. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -941,7 +1211,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -950,6 +1220,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -961,15 +1251,46 @@ pub struct Binding { impl Part for Binding {} -/// Specifies how de-identification of a FHIR store should be handled. +/// A schema package contains a set of schemas and type definitions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SchemaPackage { + /// Flag to ignore all min_occurs restrictions in the schema. This means that + /// incoming messages can omit any group, segment, field, component, or + /// subcomponent. + #[serde(rename="ignoreMinOccurs")] + pub ignore_min_occurs: Option, + /// Determines how messages that don't parse successfully are handled. + #[serde(rename="schematizedParsingType")] + pub schematized_parsing_type: Option, + /// Schema type definitions that are layered based on their VersionSources + /// that match the incoming message. Type definitions present in higher indices + /// override those in lower indices with the same type name if their + /// VersionSources all match an incoming message. + pub types: Option>, + /// Schema configs that are layered based on their VersionSources that + /// match the incoming message. Schema configs present in higher indices + /// override those in lower indices with the same message type and trigger + /// event if their VersionSources all match an incoming message. + pub schemas: Option>, +} + +impl Part for SchemaPackage {} + + +/// Specifies how to handle de-identification of a FHIR store. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FhirConfig { /// Specifies FHIR paths to match and how to transform them. Any field that - /// is not matched by a FieldMetadata will be passed through to the output + /// is not matched by a FieldMetadata is passed through to the output /// dataset unmodified. All extensions are removed in the output. + /// If a field can be matched by more than one FieldMetadata, the first + /// FieldMetadata.Action is applied. #[serde(rename="fieldMetadataList")] pub field_metadata_list: Option>, } @@ -985,11 +1306,13 @@ impl Part for FhirConfig {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations datasets fhir stores deidentify projects](struct.ProjectLocationDatasetFhirStoreDeidentifyCall.html) (response) /// * [locations datasets dicom stores import projects](struct.ProjectLocationDatasetDicomStoreImportCall.html) (response) /// * [locations datasets dicom stores export projects](struct.ProjectLocationDatasetDicomStoreExportCall.html) (response) /// * [locations datasets deidentify projects](struct.ProjectLocationDatasetDeidentifyCall.html) (response) /// * [locations datasets operations get projects](struct.ProjectLocationDatasetOperationGetCall.html) (response) /// * [locations datasets fhir stores export projects](struct.ProjectLocationDatasetFhirStoreExportCall.html) (response) +/// * [locations datasets dicom stores deidentify projects](struct.ProjectLocationDatasetDicomStoreDeidentifyCall.html) (response) /// * [locations datasets fhir stores import projects](struct.ProjectLocationDatasetFhirStoreImportCall.html) (response) /// * [locations datasets create projects](struct.ProjectLocationDatasetCreateCall.html) (response) /// @@ -1024,54 +1347,76 @@ pub struct Operation { impl ResponseResult for Operation {} -/// Pseudonymization method that generates surrogates via cryptographic hashing. -/// Uses SHA-256. -/// Outputs a base64-encoded representation of the hashed output -/// (for example, `L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=`). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CryptoHashConfig { - /// An AES 128/192/256 bit key. Causes the hash to be computed based on this - /// key. A default key is generated for each DeidentifyDataset operation and is - /// used wherever crypto_key is not specified. - #[serde(rename="cryptoKey")] - pub crypto_key: Option, -} - -impl Part for CryptoHashConfig {} - - -/// Request message for `SetIamPolicy` method. +/// A resource that represents Google Cloud Platform location. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations datasets set iam policy projects](struct.ProjectLocationDatasetSetIamPolicyCall.html) (request) -/// * [locations datasets dicom stores set iam policy projects](struct.ProjectLocationDatasetDicomStoreSetIamPolicyCall.html) (request) -/// * [locations datasets hl7 v2 stores set iam policy projects](struct.ProjectLocationDatasetHl7V2StoreSetIamPolicyCall.html) (request) -/// * [locations datasets fhir stores set iam policy projects](struct.ProjectLocationDatasetFhirStoreSetIamPolicyCall.html) (request) +/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. The size of - /// the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) - /// might reject them. - pub policy: Option, - /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - /// the fields in the mask will be modified. If no mask is provided, the - /// following default mask is used: - /// paths: "bindings, etag" - /// This field is only used by Cloud IAM. - #[serde(rename="updateMask")] - pub update_mask: Option, +pub struct Location { + /// The friendly name for this location, typically a nearby city name. + /// For example, "Tokyo". + #[serde(rename="displayName")] + pub display_name: Option, + /// Cross-service attributes for the location. For example + /// + /// ````text + /// {"cloud.googleapis.com/region": "us-east1"}```` + pub labels: Option>, + /// The canonical id for this location. For example: `"us-east1"`. + #[serde(rename="locationId")] + pub location_id: Option, + /// Resource name for the location, which may vary between implementations. + /// For example: `"projects/example-project/locations/us-east1"` + pub name: Option, + /// Service-specific metadata. For example the available capacity at the given + /// location. + pub metadata: Option>, } -impl RequestValue for SetIamPolicyRequest {} +impl ResponseResult for Location {} + + +/// An HL7v2 Segment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SchemaSegment { + /// The maximum number of times this segment can be present in this group. + /// 0 or -1 means unbounded. + #[serde(rename="maxOccurs")] + pub max_occurs: Option, + /// The Segment type. For example, "PID". + #[serde(rename="type")] + pub type_: Option, + /// The minimum number of times this segment can be present in this group. + #[serde(rename="minOccurs")] + pub min_occurs: Option, +} + +impl Part for SchemaSegment {} + + +/// List of tags to be filtered. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TagFilterList { + /// Tags to be filtered. Tags must be DICOM Data Elements, File Meta + /// Elements, or Directory Structuring Elements, as defined at: + /// http://dicom.nema.org/medical/dicom/current/output/html/part06.html#table_6-1,. + /// They may be provided by "Keyword" or "Tag". For example "PatientID", + /// "00100010". + pub tags: Option>, +} + +impl Part for TagFilterList {} /// Message that represents an arbitrary HTTP body. It should only be used for @@ -1128,6 +1473,7 @@ impl RequestValue for SetIamPolicyRequest {} /// * [locations datasets fhir stores fhir delete projects](struct.ProjectLocationDatasetFhirStoreFhirDeleteCall.html) (response) /// * [locations datasets fhir stores fhir patch projects](struct.ProjectLocationDatasetFhirStoreFhirPatchCall.html) (request|response) /// * [locations datasets dicom stores studies series search for instances projects](struct.ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall.html) (response) +/// * [locations datasets fhir stores search projects](struct.ProjectLocationDatasetFhirStoreSearchCall.html) (response) /// * [locations datasets dicom stores studies series instances retrieve rendered projects](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall.html) (response) /// * [locations datasets dicom stores studies series instances frames retrieve rendered projects](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall.html) (response) /// * [locations datasets fhir stores fhir conditional update projects](struct.ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall.html) (request|response) @@ -1169,6 +1515,33 @@ impl RequestValue for HttpBody {} impl ResponseResult for HttpBody {} +/// A (sub) field of a type. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Field { + /// The maximum number of times this field can be repeated. 0 or -1 means + /// unbounded. + #[serde(rename="maxOccurs")] + pub max_occurs: Option, + /// The HL7v2 table this field refers to. For example, PID-15 (Patient's + /// Primary Language) usually refers to table "0296". + pub table: Option, + /// The type of this field. A Type with this name must be defined in an + /// Hl7TypesConfig. + #[serde(rename="type")] + pub type_: Option, + /// The name of the field. For example, "PID-1" or just "1". + pub name: Option, + /// The minimum number of times this field must be present/repeated. + #[serde(rename="minOccurs")] + pub min_occurs: Option, +} + +impl Part for Field {} + + /// The response message for Locations.ListLocations. /// /// # Activities @@ -1190,71 +1563,99 @@ pub struct ListLocationsResponse { impl ResponseResult for ListLocationsResponse {} -/// A resource that represents Google Cloud Platform location. +/// Pseudonymization method that generates surrogates via cryptographic hashing. +/// Uses SHA-256. +/// Outputs a base64-encoded representation of the hashed output +/// (for example, `L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=`). /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Location { - /// The friendly name for this location, typically a nearby city name. - /// For example, "Tokyo". - #[serde(rename="displayName")] - pub display_name: Option, - /// Cross-service attributes for the location. For example - /// - /// ````text - /// {"cloud.googleapis.com/region": "us-east1"}```` - pub labels: Option>, - /// The canonical id for this location. For example: `"us-east1"`. - #[serde(rename="locationId")] - pub location_id: Option, - /// Resource name for the location, which may vary between implementations. - /// For example: `"projects/example-project/locations/us-east1"` - pub name: Option, - /// Service-specific metadata. For example the available capacity at the given - /// location. - pub metadata: Option>, +pub struct CryptoHashConfig { + /// An AES 128/192/256 bit key. Causes the hash to be computed based on this + /// key. A default key is generated for each Deidentify operation and is used + /// wherever crypto_key is not specified. + #[serde(rename="cryptoKey")] + pub crypto_key: Option, } -impl ResponseResult for Location {} +impl Part for CryptoHashConfig {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// The content of an HL7v2 message in a structured format as specified by a +/// schema. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// This type is not used in any activity, and only used as *part* of another schema. /// -/// **JSON Example** +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SchematizedData { + /// JSON output of the parser. + pub data: Option, + /// The error output of the parser. + pub error: Option, +} + +impl Part for SchematizedData {} + + +/// Filter configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FhirFilter { + /// List of resources to include in the output. If this list is empty or + /// not specified, all resources are included in the output. + pub resources: Option, +} + +impl Part for FhirFilter {} + + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. +/// +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -1262,15 +1663,21 @@ impl ResponseResult for Location {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -1279,7 +1686,9 @@ impl ResponseResult for Location {} /// /// * [locations datasets fhir stores set iam policy projects](struct.ProjectLocationDatasetFhirStoreSetIamPolicyCall.html) (response) /// * [locations datasets hl7 v2 stores set iam policy projects](struct.ProjectLocationDatasetHl7V2StoreSetIamPolicyCall.html) (response) +/// * [locations datasets annotation stores set iam policy projects](struct.ProjectLocationDatasetAnnotationStoreSetIamPolicyCall.html) (response) /// * [locations datasets dicom stores set iam policy projects](struct.ProjectLocationDatasetDicomStoreSetIamPolicyCall.html) (response) +/// * [locations datasets annotation stores get iam policy projects](struct.ProjectLocationDatasetAnnotationStoreGetIamPolicyCall.html) (response) /// * [locations datasets get iam policy projects](struct.ProjectLocationDatasetGetIamPolicyCall.html) (response) /// * [locations datasets dicom stores get iam policy projects](struct.ProjectLocationDatasetDicomStoreGetIamPolicyCall.html) (response) /// * [locations datasets set iam policy projects](struct.ProjectLocationDatasetSetIamPolicyCall.html) (response) @@ -1298,19 +1707,61 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } impl ResponseResult for Policy {} +/// A type definition for some HL7v2 type (incl. Segments and Datatypes). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Type { + /// The (sub) fields this type has (if not primitive). + pub fields: Option>, + /// If this is a primitive type then this field is the type of the primitive + /// For example, STRING. Leave unspecified for composite types. + pub primitive: Option, + /// The name of this type. This would be the segment or datatype name. + /// For example, "PID" or "XPN". + pub name: Option, +} + +impl Part for Type {} + + /// Specifies the configuration for importing data from Cloud Storage. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1348,15 +1799,21 @@ impl Part for GoogleCloudHealthcareV1beta1DicomGcsSource {} pub struct FieldMetadata { /// Deidentify action for one field. pub action: Option, - /// List of paths to FHIR fields to be redacted. Each path is a + /// List of paths to FHIR fields to redact. Each path is a /// period-separated list where each component is either a field name or - /// FHIR type name, for example: Patient, HumanName. - /// For "choice" types (those defined in the FHIR spec with the form: - /// field[x]) we use two separate components. e.g. "deceasedAge.unit" is - /// matched by "Deceased.Age.unit". - /// Supported types are: AdministrativeGenderCode, Code, Date, DateTime, - /// Decimal, HumanName, Id, LanguageCode, Markdown, MimeTypeCode, Oid, - /// String, Uri, Uuid, Xhtml. + /// FHIR type name. All types begin with an upper case letter. For example, + /// the resource field "Patient.Address.city", which uses a string type, + /// can be matched by "Patient.Address.String". Path also supports partial + /// matching. For example, "Patient.Address.city" can be matched by + /// "Address.city" (Patient omitted). Partial matching and type matching + /// can be combined, for example "Patient.Address.city" can be matched by + /// "Address.String". For "choice" types (those defined in the FHIR spec + /// with the form: field[x]), use two separate components. For example, + /// "deceasedAge.unit" is matched by "Deceased.Age.unit". Supported types + /// are: AdministrativeGenderCode, Code, Date, DateTime, Decimal, + /// HumanName, Id, LanguageCode, Markdown, Oid, String, Uri, Uuid, Xhtml. + /// The sub-type for HumanName(for example HumanName.given, + /// HumanName.family) can be omitted. pub paths: Option>, } @@ -1372,6 +1829,7 @@ impl Part for FieldMetadata {} /// /// * [locations datasets dicom stores test iam permissions projects](struct.ProjectLocationDatasetDicomStoreTestIamPermissionCall.html) (request) /// * [locations datasets test iam permissions projects](struct.ProjectLocationDatasetTestIamPermissionCall.html) (request) +/// * [locations datasets annotation stores test iam permissions projects](struct.ProjectLocationDatasetAnnotationStoreTestIamPermissionCall.html) (request) /// * [locations datasets fhir stores test iam permissions projects](struct.ProjectLocationDatasetFhirStoreTestIamPermissionCall.html) (request) /// * [locations datasets hl7 v2 stores test iam permissions projects](struct.ProjectLocationDatasetHl7V2StoreTestIamPermissionCall.html) (request) /// @@ -1424,7 +1882,8 @@ pub struct SchemaConfig { /// schema. For example, `concept` in the CodeSystem resource is a recursive /// structure; when the depth is 2, the CodeSystem table will have a column /// called `concept.concept` but not `concept.concept.concept`. If not - /// specified or set to 0, the server will use the default value 2. + /// specified or set to 0, the server will use the default value 2. The + /// maximum depth allowed is 5. #[serde(rename="recursiveStructureDepth")] pub recursive_structure_depth: Option, } @@ -1432,6 +1891,21 @@ pub struct SchemaConfig { impl Part for SchemaConfig {} +/// Construct representing a logical group or a segment. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GroupOrSegment { + /// no description provided + pub group: Option, + /// no description provided + pub segment: Option, +} + +impl Part for GroupOrSegment {} + + /// Ingests a message into the specified HL7v2 store. /// /// # Activities @@ -1450,35 +1924,99 @@ pub struct IngestMessageRequest { impl RequestValue for IngestMessageRequest {} -/// A transformation to apply to text that is identified as a specific -/// info_type. +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations datasets dicom stores studies series delete projects](struct.ProjectLocationDatasetDicomStoreStudySeryDeleteCall.html) (response) +/// * [locations datasets fhir stores fhir resource-purge projects](struct.ProjectLocationDatasetFhirStoreFhirResourcePurgeCall.html) (response) +/// * [locations datasets delete projects](struct.ProjectLocationDatasetDeleteCall.html) (response) +/// * [locations datasets fhir stores fhir conditional delete projects](struct.ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall.html) (response) +/// * [locations datasets dicom stores studies series instances delete projects](struct.ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall.html) (response) +/// * [locations datasets dicom stores studies delete projects](struct.ProjectLocationDatasetDicomStoreStudyDeleteCall.html) (response) +/// * [locations datasets dicom stores delete projects](struct.ProjectLocationDatasetDicomStoreDeleteCall.html) (response) +/// * [locations datasets hl7 v2 stores messages delete projects](struct.ProjectLocationDatasetHl7V2StoreMessageDeleteCall.html) (response) +/// * [locations datasets fhir stores delete projects](struct.ProjectLocationDatasetFhirStoreDeleteCall.html) (response) +/// * [locations datasets hl7 v2 stores delete projects](struct.ProjectLocationDatasetHl7V2StoreDeleteCall.html) (response) +/// * [locations datasets operations cancel projects](struct.ProjectLocationDatasetOperationCancelCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// ````text +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// ```` +/// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. /// /// This type is not used in any activity, and only used as *part* of another schema. -/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InfoTypeTransformation { - /// Config for character mask. - #[serde(rename="characterMaskConfig")] - pub character_mask_config: Option, - /// Config for text redaction. - #[serde(rename="redactConfig")] - pub redact_config: Option, - /// Config for crypto hash. - #[serde(rename="cryptoHashConfig")] - pub crypto_hash_config: Option, - /// Config for date shift. - #[serde(rename="dateShiftConfig")] - pub date_shift_config: Option, - /// InfoTypes to apply this transformation to. If this is not specified, the - /// transformation applies to any info_type. - #[serde(rename="infoTypes")] - pub info_types: Option>, - /// Config for replace with InfoType. - #[serde(rename="replaceWithInfoTypeConfig")] - pub replace_with_info_type_config: Option, +pub struct Expr { + /// Optional. Description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language + /// syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, } -impl Part for InfoTypeTransformation {} +impl Part for Expr {} /// The configuration for exporting to BigQuery. @@ -1491,6 +2029,10 @@ pub struct GoogleCloudHealthcareV1beta1FhirBigQueryDestination { /// `bq://projectId.bqDatasetId` #[serde(rename="datasetUri")] pub dataset_uri: Option, + /// If this flag is `TRUE`, all tables will be deleted from the dataset before + /// the new exported tables are written. If the flag is not set and the + /// destination dataset contains tables, the export call returns an error. + pub force: Option, /// The configuration for the exported BigQuery schema. #[serde(rename="schemaConfig")] pub schema_config: Option, @@ -1512,17 +2054,21 @@ pub struct Segment { /// Regex for key: (\d+)(\[\d+\])?(.\d+)?(.\d+)? /// /// Examples of (key, value) pairs: - /// - (0.1, "foo"): Component 1 of Field 0 has the value "foo". - /// - (1.1.2, "bar"): Sub-component 2 of Component 1 of field 1 has the value - /// "bar". - /// - (1[2].1, "baz"): Component 1 of Instance 2 of Field 1, which is repeated, - /// has the value "baz". + /// + /// * (0.1, "hemoglobin") denotes that the first component of Field 0 has the + /// value "hemoglobin". + /// + /// * (1.1.2, "CBC") denotes that the second sub-component of the first + /// component of Field 1 has the value "CBC". + /// + /// * (1[0].1, "HbA1c") denotes that the first component of the + /// first Instance of Field 1, which is repeated, has the value "HbA1c". pub fields: Option>, - /// Set ID for segments that can be in a set. This can be empty if it is - /// missing or it is not applicable. + /// Set ID for segments that can be in a set. This can be empty if it's + /// missing or isn't applicable. #[serde(rename="setId")] pub set_id: Option, - /// A string that indicates the type of segment, e.g., EVN, PID. + /// A string that indicates the type of segment. For example, EVN or PID. #[serde(rename="segmentId")] pub segment_id: Option, } @@ -1543,6 +2089,40 @@ pub struct TextConfig { impl Part for TextConfig {} +/// Creates a new FHIR store with sensitive information de-identified. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations datasets fhir stores deidentify projects](struct.ProjectLocationDatasetFhirStoreDeidentifyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeidentifyFhirStoreRequest { + /// Deidentify configuration. + pub config: Option, + /// The name of the FHIR store to create and write the redacted data to. + /// For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + /// + /// * The destination dataset must exist. + /// * The source dataset and destination dataset must both reside in the same + /// project. De-identifying data across multiple projects is not supported. + /// * The destination FHIR store must exist. + /// * The caller must have the healthcare.fhirResources.update permission to + /// write to the destination FHIR store. + #[serde(rename="destinationStore")] + pub destination_store: Option, + /// A filter specifying the resources to include in the output. If not + /// specified, all resources are included in the output. + #[serde(rename="resourceFilter")] + pub resource_filter: Option, +} + +impl RequestValue for DeidentifyFhirStoreRequest {} + + /// Provides the configuration for logging a type of permissions. /// Example: /// @@ -1552,7 +2132,7 @@ impl Part for TextConfig {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1563,7 +2143,7 @@ impl Part for TextConfig {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1581,36 +2161,36 @@ pub struct AuditLogConfig { impl Part for AuditLogConfig {} -/// Represents an expression text. Example: -/// -/// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" -/// ```` +/// A transformation to apply to text that is identified as a specific +/// info_type. /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Expr { - /// An optional description of the expression. This is a longer text which - /// describes the expression, e.g. when hovered over it in a UI. - pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. - pub expression: Option, - /// An optional string indicating the location of the expression for error - /// reporting, e.g. a file name and a position in the file. - pub location: Option, - /// An optional title for the expression, i.e. a short string describing - /// its purpose. This can be used e.g. in UIs which allow to enter the - /// expression. - pub title: Option, +pub struct InfoTypeTransformation { + /// Config for character mask. + #[serde(rename="characterMaskConfig")] + pub character_mask_config: Option, + /// Config for text redaction. + #[serde(rename="redactConfig")] + pub redact_config: Option, + /// Config for crypto hash. + #[serde(rename="cryptoHashConfig")] + pub crypto_hash_config: Option, + /// Config for date shift. + #[serde(rename="dateShiftConfig")] + pub date_shift_config: Option, + /// InfoTypes to apply this transformation to. If this is not specified, this + /// transformation becomes the default transformation, and is used for any + /// info_type that is not specified in another transformation. + #[serde(rename="infoTypes")] + pub info_types: Option>, + /// Config for replace with InfoType. + #[serde(rename="replaceWithInfoTypeConfig")] + pub replace_with_info_type_config: Option, } -impl Part for Expr {} +impl Part for InfoTypeTransformation {} /// Specifies the configuration for importing data from Cloud Storage. @@ -1643,30 +2223,13 @@ pub struct GoogleCloudHealthcareV1beta1FhirRestGcsSource { impl Part for GoogleCloudHealthcareV1beta1FhirRestGcsSource {} -/// List of tags to be filtered. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TagFilterList { - /// Tags to be filtered. Tags must be DICOM Data Elements, File Meta - /// Elements, or Directory Structuring Elements, as defined at: - /// http://dicom.nema.org/medical/dicom/current/output/html/part06.html#table_6-1,. - /// They may be provided by "Keyword" or "Tag". For example "PatientID", - /// "00100010". - pub tags: Option>, -} - -impl Part for TagFilterList {} - - /// A patient identifier and associated type. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PatientId { - /// ID type, e.g. MRN or NHS. + /// ID type. For example, MRN or NHS. #[serde(rename="type")] pub type_: Option, /// The patient's unique identifier. @@ -1688,6 +2251,16 @@ pub struct DicomConfig { /// List of tags to remove. Keep all other tags. #[serde(rename="removeList")] pub remove_list: Option, + /// If true, skip replacing StudyInstanceUID, SeriesInstanceUID, + /// SOPInstanceUID, and MediaStorageSOPInstanceUID and leave them untouched. + /// The Cloud Healthcare API regenerates these UIDs by default based on the + /// DICOM Standard's reasoning: "Whilst these UIDs cannot be mapped directly + /// to an individual out of context, given access to the original images, or + /// to a database of the original images containing the UIDs, it would be + /// possible to recover the individual's identity." + /// http://dicom.nema.org/medical/dicom/current/output/chtml/part15/sect_E.3.9.html + #[serde(rename="skipIdRedaction")] + pub skip_id_redaction: Option, /// List of tags to keep. Remove all other tags. #[serde(rename="keepList")] pub keep_list: Option, @@ -1696,7 +2269,7 @@ pub struct DicomConfig { impl Part for DicomConfig {} -/// Specifies how de-identification of image pixel should be handled. +/// Specifies how to handle de-identification of image pixels. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1735,12 +2308,12 @@ impl Part for CharacterMaskConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DeidentifyDatasetRequest { - /// The name of the dataset resource to create and write the redacted data to - /// (e.g., + /// The name of the dataset resource to create and write the redacted data to. /// /// * The destination dataset must not exist. - /// * The destination dataset must be in the same project as the source - /// dataset. De-identifying data across multiple projects is not supported. + /// * The destination dataset must be in the same project and location as the + /// source dataset. De-identifying data across multiple projects or locations + /// is not supported. #[serde(rename="destinationDataset")] pub destination_dataset: Option, /// Deidentify configuration. @@ -1763,6 +2336,9 @@ impl RequestValue for DeidentifyDatasetRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FhirStore { + /// Output only. Resource name of the FHIR store, of the form + /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + pub name: Option, /// User-supplied key-value pairs used to organize FHIR stores. /// /// Label keys must be between 1 and 63 characters long, have a UTF-8 encoding @@ -1776,51 +2352,70 @@ pub struct FhirStore { /// /// No more than 64 labels can be associated with a given store. pub labels: Option>, - /// Output only. Resource name of the FHIR store, of the form - /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - pub name: Option, - /// Whether to disable referential integrity in this FHIR store. This field is - /// immutable after FHIR store creation. - /// The default value is false, meaning that the API will enforce referential - /// integrity and fail the requests that will result in inconsistent state in - /// the FHIR store. - /// When this field is set to true, the API will skip referential integrity - /// check. Consequently, operations that rely on references, such as - /// GetPatientEverything, will not return all the results if broken references - /// exist. - #[serde(rename="disableReferentialIntegrity")] - pub disable_referential_integrity: Option, - /// Whether to allow the bulk import API to accept history bundles and directly - /// insert historical resource versions into the FHIR store. Importing resource - /// histories creates resource interactions that appear to have occurred in the - /// past, which clients may not want to allow. If set to false, history bundles - /// within an import will fail with an error. - #[serde(rename="enableHistoryImport")] - pub enable_history_import: Option, /// Whether this FHIR store has the [updateCreate /// capability](https://www.hl7.org/fhir/capabilitystatement-definitions.html#CapabilityStatement.rest.resource.updateCreate). /// This determines if the client can use an Update operation to create a new /// resource with a client-specified ID. If false, all IDs are server-assigned - /// through the Create operation and attempts to Update a non-existent resource - /// will return errors. Please treat the audit logs with appropriate levels of + /// through the Create operation and attempts to update a non-existent resource + /// return errors. Please treat the audit logs with appropriate levels of /// care if client-specified resource IDs contain sensitive data such as - /// patient identifiers, those IDs will be part of the FHIR resource path + /// patient identifiers, those IDs are part of the FHIR resource path /// recorded in Cloud audit logs and Cloud Pub/Sub notifications. #[serde(rename="enableUpdateCreate")] pub enable_update_create: Option, /// If non-empty, publish all resource modifications of this FHIR store to - /// this destination. The Cloud Pub/Sub message attributes will contain a map - /// with a string describing the action that has triggered the notification, - /// e.g. "action":"CreateResource". + /// this destination. The Cloud Pub/Sub message attributes contain a map + /// with a string describing the action that has triggered the notification. + /// For example, "action":"CreateResource". #[serde(rename="notificationConfig")] pub notification_config: Option, + /// A list of streaming configs that configure the destinations of streaming + /// export for every resource mutation in this FHIR store. Each store is + /// allowed to have up to 10 streaming configs. + /// After a new config is added, the next resource mutation is streamed to + /// the new location in addition to the existing ones. + /// When a location is removed from the list, the server stops + /// streaming to that location. Before adding a new config, you must add the + /// required + /// [`bigquery.dataEditor`](https://cloud.google.com/bigquery/docs/access-control#bigquery.dataEditor) + /// role to your project's **Cloud Healthcare Service Agent** + /// [service account](https://cloud.google.com/iam/docs/service-accounts). + /// Some lag (typically on the order of dozens of seconds) is expected before + /// the results show up in the streaming destination. + #[serde(rename="streamConfigs")] + pub stream_configs: Option>, + /// The FHIR specification version that this FHIR store supports natively. This + /// field is immutable after store creation. Requests are rejected if they + /// contain FHIR resources of a different version. + /// An empty value is treated as STU3. + pub version: Option, + /// If true, overrides the default search behavior for this FHIR store to + /// `handling=strict` which returns an error for unrecognized search + /// parameters. If false, uses the FHIR specification default + /// `handling=lenient` which ignores unrecognized search parameters. + /// The handling can always be changed from the default on an individual API + /// call by setting the HTTP header `Prefer: handling=strict` or + /// `Prefer: handling=lenient`. + #[serde(rename="defaultSearchHandlingStrict")] + pub default_search_handling_strict: Option, + /// Whether to disable referential integrity in this FHIR store. This field is + /// immutable after FHIR store creation. + /// The default value is false, meaning that the API enforces referential + /// integrity and fails the requests that result in inconsistent state in + /// the FHIR store. + /// When this field is set to true, the API skips referential integrity + /// checks. Consequently, operations that rely on references, such as + /// GetPatientEverything, do not return all the results if broken references + /// exist. + #[serde(rename="disableReferentialIntegrity")] + pub disable_referential_integrity: Option, /// Whether to disable resource versioning for this FHIR store. This field can /// not be changed after the creation of FHIR store. - /// If set to false, which is the default behavior, all write operations will + /// If set to false, which is the default behavior, all write operations /// cause historical versions to be recorded automatically. The historical /// versions can be fetched through the history APIs, but cannot be updated. - /// If set to true, no historical versions will be kept. The server will send - /// back errors for attempts to read the historical versions. + /// If set to true, no historical versions are kept. The server sends + /// errors for attempts to read the historical versions. #[serde(rename="disableResourceVersioning")] pub disable_resource_versioning: Option, } @@ -1829,25 +2424,55 @@ impl RequestValue for FhirStore {} impl ResponseResult for FhirStore {} -/// The response message for Operations.ListOperations. +/// Lists the messages in the specified HL7v2 store. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations datasets operations list projects](struct.ProjectLocationDatasetOperationListCall.html) (response) +/// * [locations datasets hl7 v2 stores messages list projects](struct.ProjectLocationDatasetHl7V2StoreMessageListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListOperationsResponse { - /// The standard List next-page token. +pub struct ListMessagesResponse { + /// Token to retrieve the next page of results or empty if there are no more + /// results in the list. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// A list of operations that matches the specified filter in the request. - pub operations: Option>, + /// The returned Messages. Won't be more Messages than the value of + /// page_size in the request. See + /// view for + /// populated fields. + #[serde(rename="hl7V2Messages")] + pub hl7_v2_messages: Option>, } -impl ResponseResult for ListOperationsResponse {} +impl ResponseResult for ListMessagesResponse {} + + +/// An HL7v2 logical group construct. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SchemaGroup { + /// The maximum number of times this group can be repeated. 0 or -1 means + /// unbounded. + #[serde(rename="maxOccurs")] + pub max_occurs: Option, + /// The minimum number of times this group must be present/repeated. + #[serde(rename="minOccurs")] + pub min_occurs: Option, + /// The name of this group. For example, "ORDER_DETAIL". + pub name: Option, + /// Nested groups and/or segments. + pub members: Option>, + /// True indicates that this is a choice group, meaning that only one of its + /// segments can exist in a given message. + pub choice: Option, +} + +impl Part for SchemaGroup {} /// Request to export resources. @@ -1904,7 +2529,7 @@ impl RequestValue for ExportResourcesRequest {} pub struct Dataset { /// The default timezone used by this dataset. Must be a either a valid IANA /// time zone name such as "America/New_York" or empty, which defaults to UTC. - /// This is used for parsing times in resources (e.g., HL7 messages) where no + /// This is used for parsing times in resources, such as HL7 messages, where no /// explicit timezone is specified. #[serde(rename="timeZone")] pub time_zone: Option, @@ -1930,6 +2555,26 @@ impl ResponseResult for Dataset {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Hl7V2Store { + /// The configuration for the parser. It determines how the server parses the + /// messages. + #[serde(rename="parserConfig")] + pub parser_config: Option, + /// Output only. Resource name of the HL7v2 store, of the form + /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`. + pub name: Option, + /// Determines whether duplicate messages should be rejected. A duplicate + /// message is a message with the same raw bytes as a message that has already + /// been ingested/created in this HL7v2 store. + /// The default value is false, meaning that the store accepts the duplicate + /// messages and it also returns the same ACK message in the + /// IngestMessageResponse as has been returned previously. Note that only + /// one resource is created in the store. + /// When this field is set to true, + /// CreateMessage/IngestMessage + /// requests with a duplicate message will be rejected by the store, and + /// IngestMessageErrorDetail returns a NACK message upon rejection. + #[serde(rename="rejectDuplicateMessage")] + pub reject_duplicate_message: Option, /// User-supplied key-value pairs used to organize HL7v2 stores. /// /// Label keys must be between 1 and 63 characters long, have a UTF-8 encoding @@ -1943,47 +2588,23 @@ pub struct Hl7V2Store { /// /// No more than 64 labels can be associated with a given store. pub labels: Option>, - /// The configuration for the parser. It determines how the server parses the - /// messages. - #[serde(rename="parserConfig")] - pub parser_config: Option, - /// Output only. Resource name of the HL7v2 store, of the form - /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`. - pub name: Option, /// The notification destination all messages (both Ingest & Create) are /// published on. Only the message name is sent as part of the notification. If - /// this is unset, no notifications will be sent. Supplied by the client. + /// this is unset, no notifications are sent. Supplied by the client. #[serde(rename="notificationConfig")] pub notification_config: Option, + /// A list of notification configs. Each configuration uses a filter to + /// determine whether to publish a message (both Ingest & Create) on + /// the corresponding notification destination. Only the message name is sent + /// as part of the notification. Supplied by the client. + #[serde(rename="notificationConfigs")] + pub notification_configs: Option>, } impl RequestValue for Hl7V2Store {} impl ResponseResult for Hl7V2Store {} -/// Lists the messages in the specified HL7v2 store. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations datasets hl7 v2 stores messages list projects](struct.ProjectLocationDatasetHl7V2StoreMessageListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListMessagesResponse { - /// Token to retrieve the next page of results or empty if there are no more - /// results in the list. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The returned message names. Won't be more values than the value of - /// page_size in the request. - pub messages: Option>, -} - -impl ResponseResult for ListMessagesResponse {} - - /// Specifies the audit configuration for a service. /// The configuration determines which permission types are logged, and what /// identities, if any, are exempted from logging. @@ -2005,7 +2626,7 @@ impl ResponseResult for ListMessagesResponse {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -2017,7 +2638,7 @@ impl ResponseResult for ListMessagesResponse {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -2025,7 +2646,7 @@ impl ResponseResult for ListMessagesResponse {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -2034,9 +2655,9 @@ impl ResponseResult for ListMessagesResponse {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2062,8 +2683,7 @@ impl Part for AuditConfig {} pub struct DateShiftConfig { /// An AES 128/192/256 bit key. Causes the shift to be computed based on this /// key and the patient ID. A default key is generated for each - /// DeidentifyDataset operation and is used wherever crypto_key is not - /// specified. + /// Deidentify operation and is used wherever crypto_key is not specified. #[serde(rename="cryptoKey")] pub crypto_key: Option, } @@ -2071,6 +2691,21 @@ pub struct DateShiftConfig { impl Part for DateShiftConfig {} +/// The request message for Operations.CancelOperation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations datasets operations cancel projects](struct.ProjectLocationDatasetOperationCancelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CancelOperationRequest { _never_set: Option } + +impl RequestValue for CancelOperationRequest {} + + /// A complete HL7v2 message. /// See http://www.hl7.org/implement/standards/index.cfm?ref=common for details /// on the standard. @@ -2106,7 +2741,7 @@ pub struct Message { /// /// No more than 64 labels can be associated with a given store. pub labels: Option>, - /// The message type and trigger event for this message. MSH-9. + /// The message type for this message. MSH-9.1. #[serde(rename="messageType")] pub message_type: Option, /// Output only. The datetime when the message was created. Set by the server. @@ -2116,6 +2751,10 @@ pub struct Message { /// message. #[serde(rename="patientIds")] pub patient_ids: Option>, + /// The parsed version of the raw message data schematized according to this + /// store's schemas and type definitions. + #[serde(rename="schematizedData")] + pub schematized_data: Option, /// Raw message bytes. pub data: Option, /// The hospital that this message came from. MSH-4. @@ -2130,6 +2769,26 @@ impl RequestValue for Message {} impl ResponseResult for Message {} +/// Root config message for HL7v2 schema. This contains a schema structure of +/// groups and segments, and filters that determine which messages to apply the +/// schema structure to. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Hl7SchemaConfig { + /// Map from each HL7v2 message type and trigger event pair, such as ADT_A04, + /// to its schema configuration root group. + #[serde(rename="messageSchemaConfigs")] + pub message_schema_configs: Option>, + /// Each VersionSource is tested and only if they all match is the schema used + /// for the message. + pub version: Option>, +} + +impl Part for Hl7SchemaConfig {} + + // ################### // MethodBuilders ### @@ -2159,7 +2818,7 @@ impl ResponseResult for Message {} /// ::default(), None); /// let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `locations_datasets_create(...)`, `locations_datasets_deidentify(...)`, `locations_datasets_delete(...)`, `locations_datasets_dicom_stores_create(...)`, `locations_datasets_dicom_stores_delete(...)`, `locations_datasets_dicom_stores_export(...)`, `locations_datasets_dicom_stores_get(...)`, `locations_datasets_dicom_stores_get_iam_policy(...)`, `locations_datasets_dicom_stores_import(...)`, `locations_datasets_dicom_stores_list(...)`, `locations_datasets_dicom_stores_patch(...)`, `locations_datasets_dicom_stores_search_for_instances(...)`, `locations_datasets_dicom_stores_search_for_series(...)`, `locations_datasets_dicom_stores_search_for_studies(...)`, `locations_datasets_dicom_stores_set_iam_policy(...)`, `locations_datasets_dicom_stores_store_instances(...)`, `locations_datasets_dicom_stores_studies_delete(...)`, `locations_datasets_dicom_stores_studies_retrieve_metadata(...)`, `locations_datasets_dicom_stores_studies_retrieve_study(...)`, `locations_datasets_dicom_stores_studies_search_for_instances(...)`, `locations_datasets_dicom_stores_studies_search_for_series(...)`, `locations_datasets_dicom_stores_studies_series_delete(...)`, `locations_datasets_dicom_stores_studies_series_instances_delete(...)`, `locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_frames(...)`, `locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_rendered(...)`, `locations_datasets_dicom_stores_studies_series_instances_retrieve_instance(...)`, `locations_datasets_dicom_stores_studies_series_instances_retrieve_metadata(...)`, `locations_datasets_dicom_stores_studies_series_instances_retrieve_rendered(...)`, `locations_datasets_dicom_stores_studies_series_retrieve_metadata(...)`, `locations_datasets_dicom_stores_studies_series_retrieve_series(...)`, `locations_datasets_dicom_stores_studies_series_search_for_instances(...)`, `locations_datasets_dicom_stores_studies_store_instances(...)`, `locations_datasets_dicom_stores_test_iam_permissions(...)`, `locations_datasets_fhir_stores_create(...)`, `locations_datasets_fhir_stores_delete(...)`, `locations_datasets_fhir_stores_export(...)`, `locations_datasets_fhir_stores_fhir__observation_lastn(...)`, `locations_datasets_fhir_stores_fhir__patient_everything(...)`, `locations_datasets_fhir_stores_fhir__resource_purge(...)`, `locations_datasets_fhir_stores_fhir_capabilities(...)`, `locations_datasets_fhir_stores_fhir_conditional_delete(...)`, `locations_datasets_fhir_stores_fhir_conditional_patch(...)`, `locations_datasets_fhir_stores_fhir_conditional_update(...)`, `locations_datasets_fhir_stores_fhir_create(...)`, `locations_datasets_fhir_stores_fhir_delete(...)`, `locations_datasets_fhir_stores_fhir_execute_bundle(...)`, `locations_datasets_fhir_stores_fhir_history(...)`, `locations_datasets_fhir_stores_fhir_patch(...)`, `locations_datasets_fhir_stores_fhir_read(...)`, `locations_datasets_fhir_stores_fhir_search(...)`, `locations_datasets_fhir_stores_fhir_update(...)`, `locations_datasets_fhir_stores_fhir_vread(...)`, `locations_datasets_fhir_stores_get(...)`, `locations_datasets_fhir_stores_get_iam_policy(...)`, `locations_datasets_fhir_stores_import(...)`, `locations_datasets_fhir_stores_list(...)`, `locations_datasets_fhir_stores_patch(...)`, `locations_datasets_fhir_stores_set_iam_policy(...)`, `locations_datasets_fhir_stores_test_iam_permissions(...)`, `locations_datasets_get(...)`, `locations_datasets_get_iam_policy(...)`, `locations_datasets_hl7_v2_stores_create(...)`, `locations_datasets_hl7_v2_stores_delete(...)`, `locations_datasets_hl7_v2_stores_get(...)`, `locations_datasets_hl7_v2_stores_get_iam_policy(...)`, `locations_datasets_hl7_v2_stores_list(...)`, `locations_datasets_hl7_v2_stores_messages_create(...)`, `locations_datasets_hl7_v2_stores_messages_delete(...)`, `locations_datasets_hl7_v2_stores_messages_get(...)`, `locations_datasets_hl7_v2_stores_messages_ingest(...)`, `locations_datasets_hl7_v2_stores_messages_list(...)`, `locations_datasets_hl7_v2_stores_messages_patch(...)`, `locations_datasets_hl7_v2_stores_patch(...)`, `locations_datasets_hl7_v2_stores_set_iam_policy(...)`, `locations_datasets_hl7_v2_stores_test_iam_permissions(...)`, `locations_datasets_list(...)`, `locations_datasets_operations_get(...)`, `locations_datasets_operations_list(...)`, `locations_datasets_patch(...)`, `locations_datasets_set_iam_policy(...)`, `locations_datasets_test_iam_permissions(...)`, `locations_get(...)` and `locations_list(...)` +/// // like `locations_datasets_annotation_stores_get_iam_policy(...)`, `locations_datasets_annotation_stores_set_iam_policy(...)`, `locations_datasets_annotation_stores_test_iam_permissions(...)`, `locations_datasets_create(...)`, `locations_datasets_deidentify(...)`, `locations_datasets_delete(...)`, `locations_datasets_dicom_stores_create(...)`, `locations_datasets_dicom_stores_deidentify(...)`, `locations_datasets_dicom_stores_delete(...)`, `locations_datasets_dicom_stores_export(...)`, `locations_datasets_dicom_stores_get(...)`, `locations_datasets_dicom_stores_get_iam_policy(...)`, `locations_datasets_dicom_stores_import(...)`, `locations_datasets_dicom_stores_list(...)`, `locations_datasets_dicom_stores_patch(...)`, `locations_datasets_dicom_stores_search_for_instances(...)`, `locations_datasets_dicom_stores_search_for_series(...)`, `locations_datasets_dicom_stores_search_for_studies(...)`, `locations_datasets_dicom_stores_set_iam_policy(...)`, `locations_datasets_dicom_stores_store_instances(...)`, `locations_datasets_dicom_stores_studies_delete(...)`, `locations_datasets_dicom_stores_studies_retrieve_metadata(...)`, `locations_datasets_dicom_stores_studies_retrieve_study(...)`, `locations_datasets_dicom_stores_studies_search_for_instances(...)`, `locations_datasets_dicom_stores_studies_search_for_series(...)`, `locations_datasets_dicom_stores_studies_series_delete(...)`, `locations_datasets_dicom_stores_studies_series_instances_delete(...)`, `locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_frames(...)`, `locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_rendered(...)`, `locations_datasets_dicom_stores_studies_series_instances_retrieve_instance(...)`, `locations_datasets_dicom_stores_studies_series_instances_retrieve_metadata(...)`, `locations_datasets_dicom_stores_studies_series_instances_retrieve_rendered(...)`, `locations_datasets_dicom_stores_studies_series_retrieve_metadata(...)`, `locations_datasets_dicom_stores_studies_series_retrieve_series(...)`, `locations_datasets_dicom_stores_studies_series_search_for_instances(...)`, `locations_datasets_dicom_stores_studies_store_instances(...)`, `locations_datasets_dicom_stores_test_iam_permissions(...)`, `locations_datasets_fhir_stores_create(...)`, `locations_datasets_fhir_stores_deidentify(...)`, `locations_datasets_fhir_stores_delete(...)`, `locations_datasets_fhir_stores_export(...)`, `locations_datasets_fhir_stores_fhir__observation_lastn(...)`, `locations_datasets_fhir_stores_fhir__patient_everything(...)`, `locations_datasets_fhir_stores_fhir__resource_purge(...)`, `locations_datasets_fhir_stores_fhir_capabilities(...)`, `locations_datasets_fhir_stores_fhir_conditional_delete(...)`, `locations_datasets_fhir_stores_fhir_conditional_patch(...)`, `locations_datasets_fhir_stores_fhir_conditional_update(...)`, `locations_datasets_fhir_stores_fhir_create(...)`, `locations_datasets_fhir_stores_fhir_delete(...)`, `locations_datasets_fhir_stores_fhir_execute_bundle(...)`, `locations_datasets_fhir_stores_fhir_history(...)`, `locations_datasets_fhir_stores_fhir_patch(...)`, `locations_datasets_fhir_stores_fhir_read(...)`, `locations_datasets_fhir_stores_fhir_search(...)`, `locations_datasets_fhir_stores_fhir_update(...)`, `locations_datasets_fhir_stores_fhir_vread(...)`, `locations_datasets_fhir_stores_get(...)`, `locations_datasets_fhir_stores_get_iam_policy(...)`, `locations_datasets_fhir_stores_import(...)`, `locations_datasets_fhir_stores_list(...)`, `locations_datasets_fhir_stores_patch(...)`, `locations_datasets_fhir_stores_search(...)`, `locations_datasets_fhir_stores_set_iam_policy(...)`, `locations_datasets_fhir_stores_test_iam_permissions(...)`, `locations_datasets_get(...)`, `locations_datasets_get_iam_policy(...)`, `locations_datasets_hl7_v2_stores_create(...)`, `locations_datasets_hl7_v2_stores_delete(...)`, `locations_datasets_hl7_v2_stores_get(...)`, `locations_datasets_hl7_v2_stores_get_iam_policy(...)`, `locations_datasets_hl7_v2_stores_list(...)`, `locations_datasets_hl7_v2_stores_messages_create(...)`, `locations_datasets_hl7_v2_stores_messages_delete(...)`, `locations_datasets_hl7_v2_stores_messages_get(...)`, `locations_datasets_hl7_v2_stores_messages_ingest(...)`, `locations_datasets_hl7_v2_stores_messages_list(...)`, `locations_datasets_hl7_v2_stores_messages_patch(...)`, `locations_datasets_hl7_v2_stores_patch(...)`, `locations_datasets_hl7_v2_stores_set_iam_policy(...)`, `locations_datasets_hl7_v2_stores_test_iam_permissions(...)`, `locations_datasets_list(...)`, `locations_datasets_operations_cancel(...)`, `locations_datasets_operations_get(...)`, `locations_datasets_operations_list(...)`, `locations_datasets_patch(...)`, `locations_datasets_set_iam_policy(...)`, `locations_datasets_test_iam_permissions(...)`, `locations_get(...)` and `locations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2176,31 +2835,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all the versions of a resource (including the current version and - /// deleted versions) from the FHIR store. + /// Deletes a FHIR resource. /// - /// Implements the per-resource form of the FHIR standard [history - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#history). + /// Implements the FHIR standard delete interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). /// - /// On success, the response body will contain a JSON-encoded representation - /// of a `Bundle` resource of type `history`, containing the version history - /// sorted from most recent to oldest versions. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. + /// Note: Unless resource versioning is disabled by setting the + /// disable_resource_versioning flag + /// on the FHIR store, the deleted resources will be moved to a history + /// repository that can still be retrieved through vread + /// and related methods, unless they are removed by the + /// purge method. /// /// # Arguments /// - /// * `name` - The name of the resource to retrieve. - pub fn locations_datasets_fhir_stores_fhir_history(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirHistoryCall { + /// * `name` - The name of the resource to delete. + pub fn locations_datasets_fhir_stores_fhir_delete(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirDeleteCall { hub: self.hub, _name: name.to_string(), - _since: Default::default(), - _page: Default::default(), - _count: Default::default(), - _at: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2209,21 +2864,131 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Ingests a new HL7v2 message from the hospital and sends a notification to - /// the Cloud Pub/Sub topic. Return is an HL7v2 ACK message if the message was - /// successfully stored. Otherwise an error is returned. If an identical - /// HL7v2 message is created twice only one resource is created on the server - /// and no error is reported. + /// De-identifies data from the source store and writes it to the destination + /// store. The metadata field type + /// is OperationMetadata. + /// If the request is successful, the + /// response field type is + /// DeidentifyDicomStoreSummary. If errors occur, + /// error + /// details field type is + /// DeidentifyErrorDetails. + /// The LRO result may still be successful if de-identification fails for some + /// DICOM instances. The output DICOM store will not contain + /// these failed resources. Failed resource totals are tracked in + /// DeidentifySummary.failure_resource_count. + /// Error details are also logged to Stackdriver + /// (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the HL7v2 store this message belongs to. - pub fn locations_datasets_hl7_v2_stores_messages_ingest(&self, request: IngestMessageRequest, parent: &str) -> ProjectLocationDatasetHl7V2StoreMessageIngestCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreMessageIngestCall { + /// * `sourceStore` - Source DICOM store resource name. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + pub fn locations_datasets_dicom_stores_deidentify(&self, request: DeidentifyDicomStoreRequest, source_store: &str) -> ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> { + ProjectLocationDatasetDicomStoreDeidentifyCall { hub: self.hub, _request: request, + _source_store: source_store.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Searches for resources in the given FHIR store according to criteria + /// specified as query parameters. + /// + /// Implements the FHIR standard search interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) + /// using the search semantics described in the FHIR Search specification + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). + /// + /// Supports three methods of search defined by the specification: + /// + /// * `GET [base]?[parameters]` to search across all resources. + /// * `GET [base]/[type]?[parameters]` to search resources of a specified + /// type. + /// * `POST [base]/[type]/_search?[parameters]` as an alternate form having + /// the same semantics as the `GET` method. + /// + /// The `GET` methods do not support compartment searches. The `POST` method + /// does not support `application/x-www-form-urlencoded` search parameters. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of a `Bundle` resource of type `searchset`, containing the results of the + /// search. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// The server's capability statement, retrieved through + /// capabilities, indicates what search parameters + /// are supported on each FHIR resource. A list of all search parameters + /// defined by the specification can be found in the FHIR Search Parameter + /// Registry + /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). + /// FHIR search parameters for DSTU2 can be found on each resource's definition + /// page. + /// + /// Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, + /// `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. + /// + /// Supported search result parameters: `_sort`, `_count`, `_include`, + /// `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. + /// + /// The maximum number of search results returned defaults to 100, which can + /// be overridden by the `_count` parameter up to a maximum limit of 1000. If + /// there are additional results, the returned `Bundle` will contain + /// pagination links. + /// + /// Resources with a total size larger than 5MB or a field count larger than + /// 50,000 might not be fully searchable as the server might trim its generated + /// search index in those cases. + /// + /// Note: FHIR resources are indexed asynchronously, so there might be a slight + /// delay between the time a resource is created or changes and when the change + /// is reflected in search results. + /// + /// # Arguments + /// + /// * `parent` - Name of the FHIR store to retrieve resources from. + pub fn locations_datasets_fhir_stores_search(&self, parent: &str) -> ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> { + ProjectLocationDatasetFhirStoreSearchCall { + hub: self.hub, _parent: parent.to_string(), + _resource_type: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// RetrieveRenderedInstance returns instance associated with the given study, + /// series, and SOP Instance UID in an acceptable Rendered Media Type. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveRenderedInstance DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/rendered`. + pub fn locations_datasets_dicom_stores_studies_series_instances_retrieve_rendered(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2247,224 +3012,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Gets information about a location. - /// - /// # Arguments - /// - /// * `name` - Resource name for the location. - pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { - ProjectLocationGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// SearchForStudies returns a list of matching studies. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the SearchForStudies DICOMweb request (e.g., `studies`). - pub fn locations_datasets_dicom_stores_search_for_studies(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { - ProjectLocationDatasetDicomStoreSearchForStudyCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes a FHIR resource. - /// - /// Implements the FHIR standard [delete - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#delete). - /// - /// Note: Unless resource versioning is disabled by setting the - /// disable_resource_versioning flag - /// on the FHIR store, the deleted resources will be moved to a history - /// repository that can still be retrieved through vread - /// and related methods, unless they are removed by the - /// purge method. - /// - /// # Arguments - /// - /// * `name` - The name of the resource to delete. - pub fn locations_datasets_fhir_stores_fhir_delete(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates part of an existing resource by applying the operations specified - /// in a [JSON Patch](http://jsonpatch.com/) document. - /// - /// Implements the FHIR standard [patch - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#patch). - /// - /// The request body must contain a JSON Patch document, and the request - /// headers must contain `Content-Type: application/json-patch+json`. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of the updated resource, including the server-assigned version ID. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The name of the resource to update. - pub fn locations_datasets_fhir_stores_fhir_patch(&self, request: HttpBody, name: &str) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Export resources from the FHIR store to the specified destination. - /// - /// This method returns an Operation that can - /// be used to track the status of the export by calling - /// GetOperation. - /// - /// Immediate fatal errors appear in the - /// error field. - /// Otherwise, when the operation finishes, a detailed response of type - /// ExportResourcesResponse is returned in the - /// response field. - /// The metadata field type for this - /// operation is OperationMetadata. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The name of the FHIR store to export resource from. The name should be in - /// the format of - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - pub fn locations_datasets_fhir_stores_export(&self, request: ExportResourcesRequest, name: &str) -> ProjectLocationDatasetFhirStoreExportCall<'a, C, A> { - ProjectLocationDatasetFhirStoreExportCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// SearchForInstances returns a list of matching instances. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the SearchForInstancesRequest DICOMweb request (e.g., - /// `instances` or `series/{series_uid}/instances` or - /// `studies/{study_uid}/instances`). - pub fn locations_datasets_dicom_stores_studies_series_search_for_instances(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// RetrieveRenderedInstance returns instance associated with the given study, - /// series, and SOP Instance UID in an acceptable Rendered Media Type. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveRenderedInstance DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/rendered`). - pub fn locations_datasets_dicom_stores_studies_series_instances_retrieve_rendered(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the access control policy for a resource. - /// Returns an empty policy if the resource exists and does not have a policy - /// set. - /// - /// # Arguments - /// - /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - pub fn locations_datasets_dicom_stores_get_iam_policy(&self, resource: &str) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { - ProjectLocationDatasetDicomStoreGetIamPolicyCall { - hub: self.hub, - _resource: resource.to_string(), - _options_requested_policy_version: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new FHIR store within the parent dataset. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The name of the dataset this FHIR store belongs to. - pub fn locations_datasets_fhir_stores_create(&self, request: FhirStore, parent: &str) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { - ProjectLocationDatasetFhirStoreCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _fhir_store_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// RetrieveRenderedFrames returns instances associated with the given study, @@ -2474,10 +3021,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveRenderedFrames DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}/rendered`). + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveRenderedFrames DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}/rendered`. pub fn locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_rendered(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> { ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall { hub: self.hub, @@ -2489,75 +3036,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified HL7v2 store and removes all messages that are - /// contained within it. - /// - /// # Arguments - /// - /// * `name` - The resource name of the HL7v2 store to delete. - pub fn locations_datasets_hl7_v2_stores_delete(&self, name: &str) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// If a resource is found based on the search criteria specified in the query - /// parameters, updates the entire contents of that resource. - /// - /// Implements the FHIR standard [conditional update - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#cond-update). - /// - /// Search terms are provided as query parameters following the same pattern as - /// the search method. - /// - /// If the search criteria identify more than one match, the request will - /// return a `412 Precondition Failed` error. - /// If the search criteria identify zero matches, and the supplied resource - /// body contains an `id`, and the FHIR store has - /// enable_update_create set, creates the - /// resource with the client-specified ID. If the search criteria identify zero - /// matches, and the supplied resource body does not contain an `id`, the - /// resource will be created with a server-assigned ID as per the - /// create method. - /// - /// The request body must contain a JSON-encoded FHIR resource, and the request - /// headers must contain `Content-Type: application/fhir+json`. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of the updated resource, including the server-assigned version ID. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The name of the FHIR store this resource belongs to. - /// * `type` - The FHIR resource type to update, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - /// Must match the resource type in the provided content. - pub fn locations_datasets_fhir_stores_fhir_conditional_update(&self, request: HttpBody, parent: &str, type_: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _type_: type_.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. @@ -2586,59 +3064,21 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches for resources in the given FHIR store according to criteria - /// specified as query parameters. + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. /// - /// Implements the FHIR standard [search - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#search) - /// using the search semantics described in the [FHIR Search - /// specification](http://hl7.org/implement/standards/fhir/STU3/search.html). - /// - /// Supports three methods of search defined by the specification: - /// - /// * `GET [base]?[parameters]` to search across all resources. - /// * `GET [base]/[type]?[parameters]` to search resources of a specified - /// type. - /// * `POST [base]/[type]/_search?[parameters]` as an alternate form having - /// the same semantics as the `GET` method. - /// - /// The `GET` methods do not support compartment searches. The `POST` method - /// does not support `application/x-www-form-urlencoded` search parameters. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of a `Bundle` resource of type `searchset`, containing the results of the - /// search. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// The server's capability statement, retrieved through - /// capabilities, indicates what search parameters - /// are supported on each FHIR resource. A list of all search parameters - /// defined by the specification can be found in the [FHIR Search Parameter - /// Registry](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html). - /// - /// Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, - /// `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. - /// - /// Supported search result parameters: `_sort`, `_count`, `_include`, - /// `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. - /// - /// The maximum number of search results returned defaults to 100, which can - /// be overridden by the `_count` parameter up to a maximum limit of 1000. If - /// there are additional results, the returned `Bundle` will contain - /// pagination links. + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Name of the FHIR store to retrieve resources from. - pub fn locations_datasets_fhir_stores_fhir_search(&self, request: SearchResourcesRequest, parent: &str) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirSearchCall { + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_annotation_stores_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetAnnotationStoreSetIamPolicyCall { hub: self.hub, _request: request, - _parent: parent.to_string(), + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2647,42 +3087,21 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// If a resource is found based on the search criteria specified in the query - /// parameters, updates part of that resource by applying the operations - /// specified in a [JSON Patch](http://jsonpatch.com/) document. - /// - /// Implements the FHIR standard [conditional patch - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#patch). - /// - /// Search terms are provided as query parameters following the same pattern as - /// the search method. - /// - /// If the search criteria identify more than one match, the request will - /// return a `412 Precondition Failed` error. - /// - /// The request body must contain a JSON Patch document, and the request - /// headers must contain `Content-Type: application/json-patch+json`. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of the updated resource, including the server-assigned version ID. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. + /// RetrieveFrames returns instances associated with the given study, series, + /// SOP Instance UID and frame numbers. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `parent` - The name of the FHIR store this resource belongs to. - /// * `type` - The FHIR resource type to update, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - pub fn locations_datasets_fhir_stores_fhir_conditional_patch(&self, request: HttpBody, parent: &str, type_: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirConditionalPatchCall { + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveFrames DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}`. + pub fn locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_frames(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall { hub: self.hub, - _request: request, _parent: parent.to_string(), - _type_: type_.to_string(), + _dicom_web_path: dicom_web_path.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2691,14 +3110,222 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets any metadata associated with a dataset. + /// Lists information about the supported locations for this service. /// /// # Arguments /// - /// * `name` - The name of the dataset to read (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). - pub fn locations_datasets_get(&self, name: &str) -> ProjectLocationDatasetGetCall<'a, C, A> { - ProjectLocationDatasetGetCall { + /// * `name` - The resource that owns the locations collection, if applicable. + pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// StoreInstances stores DICOM instances associated with study instance unique + /// identifiers (SUID). See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the StoreInstances DICOMweb request. For example, + /// `studies/[{study_uid}]`. Note that the `study_uid` is optional. + pub fn locations_datasets_dicom_stores_studies_store_instances(&self, request: HttpBody, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudyStoreInstanceCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update the message. + /// + /// The contents of the message in Message.data and data extracted from + /// the contents such as Message.create_time cannot be altered. Only the + /// Message.labels field is allowed to be updated. The labels in the + /// request are merged with the existing set of labels. Existing labels with + /// the same keys are updated. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Resource name of the Message, of the form + /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. + /// Assigned by the server. + pub fn locations_datasets_hl7_v2_stores_messages_patch(&self, request: Message, name: &str) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreMessagePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the FHIR stores in the given dataset. + /// + /// # Arguments + /// + /// * `parent` - Name of the dataset. + pub fn locations_datasets_fhir_stores_list(&self, parent: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { + ProjectLocationDatasetFhirStoreListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the contents of a version (current or historical) of a FHIR resource + /// by version ID. + /// + /// Implements the FHIR standard vread interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). + /// + /// On success, the response body will contain a JSON-encoded representation + /// of the resource. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `name` - The name of the resource version to retrieve. + pub fn locations_datasets_fhir_stores_fhir_vread(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirVreadCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Exports data to the specified destination by copying it from the DICOM + /// store. + /// Errors are also logged to Stackdriver Logging. For more information, + /// see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). + /// The metadata field type is + /// OperationMetadata. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The DICOM store resource name from which to export the data. For + /// example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + pub fn locations_datasets_dicom_stores_export(&self, request: ExportDicomDataRequest, name: &str) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { + ProjectLocationDatasetDicomStoreExportCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all the historical versions of a resource (excluding the current + /// version) from the FHIR store. To remove all versions of a resource, first + /// delete the current version and then call this method. + /// + /// This is not a FHIR standard operation. + /// + /// # Arguments + /// + /// * `name` - The name of the resource to purge. + pub fn locations_datasets_fhir_stores_fhir__resource_purge(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirResourcePurgeCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// DeleteInstance deletes an instance associated with the given study, series, + /// and SOP Instance UID. Delete requests are equivalent to the GET requests + /// specified in the Retrieve transaction. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the DeleteInstance request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + pub fn locations_datasets_dicom_stores_studies_series_instances_delete(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the FHIR capability statement + /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)), + /// or the [conformance + /// statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) + /// in the DSTU2 case for the store, which contains a description of + /// functionality supported by the server. + /// + /// Implements the FHIR standard capabilities interaction + /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), + /// or the [conformance + /// interaction](http://hl7.org/implement/standards/fhir/DSTU2/http.html#conformance) + /// in the DSTU2 case. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of a `CapabilityStatement` resource. + /// + /// # Arguments + /// + /// * `name` - Name of the FHIR store to retrieve the capabilities for. + pub fn locations_datasets_fhir_stores_fhir_capabilities(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirCapabilityCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -2712,6 +3339,155 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a message and sends a notification to the Cloud Pub/Sub topic. If + /// configured, the MLLP adapter listens to messages created by this method and + /// sends those back to the hospital. A successful response indicates the + /// message has been persisted to storage and a Cloud Pub/Sub notification has + /// been sent. Sending to the hospital by the MLLP adapter happens + /// asynchronously. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the dataset this message belongs to. + pub fn locations_datasets_hl7_v2_stores_messages_create(&self, request: CreateMessageRequest, parent: &str) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreMessageCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Ingests a new HL7v2 message from the hospital and sends a notification to + /// the Cloud Pub/Sub topic. Return is an HL7v2 ACK message if the message was + /// successfully stored. Otherwise an error is returned. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the HL7v2 store this message belongs to. + pub fn locations_datasets_hl7_v2_stores_messages_ingest(&self, request: IngestMessageRequest, parent: &str) -> ProjectLocationDatasetHl7V2StoreMessageIngestCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreMessageIngestCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_dicom_stores_get_iam_policy(&self, resource: &str) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetDicomStoreGetIamPolicyCall { + hub: self.hub, + _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Export resources from the FHIR store to the specified destination. + /// + /// This method returns an Operation that can + /// be used to track the status of the export by calling + /// GetOperation. + /// + /// Immediate fatal errors appear in the + /// error field, errors are also logged + /// to Stackdriver (see [Viewing + /// logs](/healthcare/docs/how-tos/stackdriver-logging)). + /// Otherwise, when the operation finishes, a detailed response of type + /// ExportResourcesResponse is returned in the + /// response field. + /// The metadata field type for this + /// operation is OperationMetadata. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the FHIR store to export resource from. The name should be in + /// the format of + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + pub fn locations_datasets_fhir_stores_export(&self, request: ExportResourcesRequest, name: &str) -> ProjectLocationDatasetFhirStoreExportCall<'a, C, A> { + ProjectLocationDatasetFhirStoreExportCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// SearchForInstances returns a list of matching instances. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the SearchForInstancesRequest DICOMweb request. For example, + /// `instances`, `series/{series_uid}/instances`, or + /// `studies/{study_uid}/instances`. + pub fn locations_datasets_dicom_stores_studies_series_search_for_instances(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2736,10 +3512,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveSeriesMetadata DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/metadata`). + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveSeriesMetadata DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/metadata`. pub fn locations_datasets_dicom_stores_studies_series_retrieve_metadata(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall<'a, C, A> { ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall { hub: self.hub, @@ -2751,6 +3527,596 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the DICOM stores in the given dataset. + /// + /// # Arguments + /// + /// * `parent` - Name of the dataset. + pub fn locations_datasets_dicom_stores_list(&self, parent: &str) -> ProjectLocationDatasetDicomStoreListCall<'a, C, A> { + ProjectLocationDatasetDicomStoreListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// If a resource is found based on the search criteria specified in the query + /// parameters, updates the entire contents of that resource. + /// + /// Implements the FHIR standard conditional update interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.10.2), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cond-update), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cond-update)). + /// + /// Search terms are provided as query parameters following the same pattern as + /// the search method. + /// + /// If the search criteria identify more than one match, the request will + /// return a `412 Precondition Failed` error. + /// If the search criteria identify zero matches, and the supplied resource + /// body contains an `id`, and the FHIR store has + /// enable_update_create set, creates the + /// resource with the client-specified ID. If the search criteria identify zero + /// matches, and the supplied resource body does not contain an `id`, the + /// resource will be created with a server-assigned ID as per the + /// create method. + /// + /// The request body must contain a JSON-encoded FHIR resource, and the request + /// headers must contain `Content-Type: application/fhir+json`. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of the updated resource, including the server-assigned version ID. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the FHIR store this resource belongs to. + /// * `type` - The FHIR resource type to update, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + /// Must match the resource type in the provided content. + pub fn locations_datasets_fhir_stores_fhir_conditional_update(&self, request: HttpBody, parent: &str, type_: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _type_: type_.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new HL7v2 store within the parent dataset. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the dataset this HL7v2 store belongs to. + pub fn locations_datasets_hl7_v2_stores_create(&self, request: Hl7V2Store, parent: &str) -> ProjectLocationDatasetHl7V2StoreCreateCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _hl7_v2_store_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// DeleteSeries deletes all instances within the given study and series. + /// Delete requests are equivalent to the GET requests specified in the + /// Retrieve transaction. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the DeleteSeries request. For example, + /// `studies/{study_uid}/series/{series_uid}`. + pub fn locations_datasets_dicom_stores_studies_series_delete(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryDeleteCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySeryDeleteCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new dataset containing de-identified data from the source + /// dataset. The metadata field type + /// is OperationMetadata. + /// If the request is successful, the + /// response field type is + /// DeidentifySummary. + /// If errors occur, + /// error + /// details field type is + /// DeidentifyErrorDetails. + /// The LRO result may still be successful if de-identification fails for some + /// DICOM instances. The new de-identified dataset will not contain these + /// failed resources. Failed resource totals are tracked in + /// DeidentifySummary.failure_resource_count. + /// Error details are also logged to Stackdriver Logging. For more information, + /// see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sourceDataset` - Source dataset resource name. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + pub fn locations_datasets_deidentify(&self, request: DeidentifyDatasetRequest, source_dataset: &str) -> ProjectLocationDatasetDeidentifyCall<'a, C, A> { + ProjectLocationDatasetDeidentifyCall { + hub: self.hub, + _request: request, + _source_dataset: source_dataset.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn locations_datasets_operations_get(&self, name: &str) -> ProjectLocationDatasetOperationGetCall<'a, C, A> { + ProjectLocationDatasetOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified health dataset and all data contained in the dataset. + /// Deleting a dataset does not affect the sources from which the dataset was + /// imported (if any). + /// + /// # Arguments + /// + /// * `name` - The name of the dataset to delete. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + pub fn locations_datasets_delete(&self, name: &str) -> ProjectLocationDatasetDeleteCall<'a, C, A> { + ProjectLocationDatasetDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the messages in the given HL7v2 store with support for filtering. + /// + /// Note: HL7v2 messages are indexed asynchronously, so there might be a slight + /// delay between the time a message is created and when it can be found + /// through a filter. + /// + /// # Arguments + /// + /// * `parent` - Name of the HL7v2 store to retrieve messages from. + pub fn locations_datasets_hl7_v2_stores_messages_list(&self, parent: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreMessageListCall { + hub: self.hub, + _parent: parent.to_string(), + _view: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// SearchForInstances returns a list of matching instances. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the SearchForInstancesRequest DICOMweb request. For example, + /// `instances`, `series/{series_uid}/instances`, or + /// `studies/{study_uid}/instances`. + pub fn locations_datasets_dicom_stores_studies_search_for_instances(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySearchForInstanceCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySearchForInstanceCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// RetrieveInstanceMetadata returns instance associated with the given study, + /// series, and SOP Instance UID presented as metadata with the bulk data + /// removed. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveInstanceMetadata DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/metadata`. + pub fn locations_datasets_dicom_stores_studies_series_instances_retrieve_metadata(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the specified DICOM store. + /// + /// # Arguments + /// + /// * `name` - The resource name of the DICOM store to get. + pub fn locations_datasets_dicom_stores_get(&self, name: &str) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> { + ProjectLocationDatasetDicomStoreGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Executes all the requests in the given Bundle. + /// + /// Implements the FHIR standard batch/transaction interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#transaction), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)). + /// + /// Supports all interactions within a bundle, except search. This method + /// accepts Bundles of type `batch` and `transaction`, processing them + /// according to the batch processing rules + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) + /// and transaction processing rules + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). + /// + /// The request body must contain a JSON-encoded FHIR `Bundle` resource, and + /// the request headers must contain `Content-Type: application/fhir+json`. + /// + /// For a batch bundle or a successful transaction the response body will + /// contain a JSON-encoded representation of a `Bundle` resource of type + /// `batch-response` or `transaction-response` containing one entry for each + /// entry in the request, with the outcome of processing the entry. In the + /// case of an error for a transaction bundle, the response body will contain + /// a JSON-encoded `OperationOutcome` resource describing the reason for the + /// error. If the request cannot be mapped to a valid API method on a FHIR + /// store, a generic GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Name of the FHIR store in which this bundle will be executed. + pub fn locations_datasets_fhir_stores_fhir_execute_bundle(&self, request: HttpBody, parent: &str) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirExecuteBundleCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new DICOM store within the parent dataset. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the dataset this DICOM store belongs to. + pub fn locations_datasets_dicom_stores_create(&self, request: DicomStore, parent: &str) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { + ProjectLocationDatasetDicomStoreCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _dicom_store_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// RetrieveStudyMetadata returns instance associated with the given study + /// presented as metadata with the bulk data removed. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveStudyMetadata DICOMweb request. For example, + /// `studies/{study_uid}/metadata`. + pub fn locations_datasets_dicom_stores_studies_retrieve_metadata(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets any metadata associated with a dataset. + /// + /// # Arguments + /// + /// * `name` - The name of the dataset to read. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + pub fn locations_datasets_get(&self, name: &str) -> ProjectLocationDatasetGetCall<'a, C, A> { + ProjectLocationDatasetGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the specified HL7v2 store. + /// + /// # Arguments + /// + /// * `name` - The resource name of the HL7v2 store to get. + pub fn locations_datasets_hl7_v2_stores_get(&self, name: &str) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// StoreInstances stores DICOM instances associated with study instance unique + /// identifiers (SUID). See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the StoreInstances DICOMweb request. For example, + /// `studies/[{study_uid}]`. Note that the `study_uid` is optional. + pub fn locations_datasets_dicom_stores_store_instances(&self, request: HttpBody, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStoreInstanceCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// De-identifies data from the source store and writes it to the destination + /// store. The metadata field type + /// is OperationMetadata. + /// If the request is successful, the + /// response field type is + /// DeidentifyFhirStoreSummary. If errors occur, + /// error + /// details field type is + /// DeidentifyErrorDetails. + /// Errors are also logged to Stackdriver + /// (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sourceStore` - Source FHIR store resource name. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + pub fn locations_datasets_fhir_stores_deidentify(&self, request: DeidentifyFhirStoreRequest, source_store: &str) -> ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> { + ProjectLocationDatasetFhirStoreDeidentifyCall { + hub: self.hub, + _request: request, + _source_store: source_store.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the versions of a resource (including the current version and + /// deleted versions) from the FHIR store. + /// + /// Implements the per-resource form of the FHIR standard history interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). + /// + /// On success, the response body will contain a JSON-encoded representation + /// of a `Bundle` resource of type `history`, containing the version history + /// sorted from most recent to oldest versions. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `name` - The name of the resource to retrieve. + pub fn locations_datasets_fhir_stores_fhir_history(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirHistoryCall { + hub: self.hub, + _name: name.to_string(), + __since: Default::default(), + __page_token: Default::default(), + __count: Default::default(), + __at: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates part of an existing resource by applying the operations specified + /// in a [JSON Patch](http://jsonpatch.com/) document. + /// + /// Implements the FHIR standard patch interaction + /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). + /// + /// DSTU2 doesn't define a patch method, but the server supports it in the same + /// way it supports STU3. + /// + /// The request body must contain a JSON Patch document, and the request + /// headers must contain `Content-Type: application/json-patch+json`. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of the updated resource, including the server-assigned version ID. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the resource to update. + pub fn locations_datasets_fhir_stores_fhir_patch(&self, request: HttpBody, name: &str) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// DeleteStudy deletes all instances within the given study. Delete requests + /// are equivalent to the GET requests specified in the Retrieve transaction. + /// + /// # Arguments + /// + /// * `parent` - No description provided. + /// * `dicomWebPath` - The path of the DeleteStudy request. For example, `studies/{study_uid}`. + pub fn locations_datasets_dicom_stores_studies_delete(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudyDeleteCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the contents of a FHIR resource. + /// + /// Implements the FHIR standard read interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). + /// + /// Also supports the FHIR standard conditional read interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) + /// specified by supplying an `If-Modified-Since` header with a date/time value + /// or an `If-None-Match` header with an ETag value. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of the resource. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `name` - The name of the resource to retrieve. + pub fn locations_datasets_fhir_stores_fhir_read(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirReadCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirReadCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the HL7v2 store. @@ -2772,26 +4138,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists the health datasets in the current project. - /// - /// # Arguments - /// - /// * `parent` - The name of the project whose datasets should be listed (e.g., - /// `projects/{project_id}/locations/{location_id}`). - pub fn locations_datasets_list(&self, parent: &str) -> ProjectLocationDatasetListCall<'a, C, A> { - ProjectLocationDatasetListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Creates a new health dataset. Results are returned through the @@ -2805,8 +4151,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the project in which the dataset should be created (e.g., - /// `projects/{project_id}/locations/{location_id}`). + /// * `parent` - The name of the project where the server creates the dataset. For + /// example, `projects/{project_id}/locations/{location_id}`. pub fn locations_datasets_create(&self, request: Dataset, parent: &str) -> ProjectLocationDatasetCreateCall<'a, C, A> { ProjectLocationDatasetCreateCall { hub: self.hub, @@ -2819,63 +4165,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves all the resources in the patient compartment for a `Patient` - /// resource. - /// - /// Implements the FHIR extended operation - /// [Patient-everything](http://hl7.org/implement/standards/fhir/STU3/patient-operations.html#everything). - /// - /// On success, the response body will contain a JSON-encoded representation - /// of a `Bundle` resource of type `searchset`, containing the results of the - /// operation. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `name` - Name of the `Patient` resource for which the information is required. - pub fn locations_datasets_fhir_stores_fhir__patient_everything(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirPatientEverythingCall { - hub: self.hub, - _name: name.to_string(), - _start: Default::default(), - _end: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the DICOM stores in the given dataset. - /// - /// # Arguments - /// - /// * `parent` - Name of the dataset. - pub fn locations_datasets_dicom_stores_list(&self, parent: &str) -> ProjectLocationDatasetDicomStoreListCall<'a, C, A> { - ProjectLocationDatasetDicomStoreListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes FHIR resources that match a search query. /// - /// Implements the FHIR standard [conditional delete - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.13.1). + /// Implements the FHIR standard conditional delete interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.12.1), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.13.1), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#3.1.0.7.1)). /// If multiple resources match, all of them will be deleted. /// /// Search terms are provided as query parameters following the same pattern as @@ -2892,8 +4189,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `parent` - The name of the FHIR store this resource belongs to. /// * `type` - The FHIR resource type to delete, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). pub fn locations_datasets_fhir_stores_fhir_conditional_delete(&self, parent: &str, type_: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> { ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall { hub: self.hub, @@ -2907,18 +4206,17 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// RetrieveFrames returns instances associated with the given study, series, - /// SOP Instance UID and frame numbers. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + /// SearchForSeries returns a list of matching series. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveFrames DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}`). - pub fn locations_datasets_dicom_stores_studies_series_instances_frames_retrieve_frames(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall { + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the SearchForSeries DICOMweb request. For example, `series` or + /// `studies/{study_uid}/series`. + pub fn locations_datasets_dicom_stores_search_for_series(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { + ProjectLocationDatasetDicomStoreSearchForSeryCall { hub: self.hub, _parent: parent.to_string(), _dicom_web_path: dicom_web_path.to_string(), @@ -2930,17 +4228,40 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// SearchForSeries returns a list of matching series. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + /// RetrieveStudy returns all instances within the given study. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the SearchForSeries DICOMweb request(e.g., `series` or - /// `studies/{study_uid}/series`). - pub fn locations_datasets_dicom_stores_search_for_series(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { - ProjectLocationDatasetDicomStoreSearchForSeryCall { + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveStudy DICOMweb request. For example, + /// `studies/{study_uid}`. + pub fn locations_datasets_dicom_stores_studies_retrieve_study(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// RetrieveInstance returns instance associated with the given study, series, + /// and SOP Instance UID. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveInstance DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + pub fn locations_datasets_dicom_stores_studies_series_instances_retrieve_instance(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall { hub: self.hub, _parent: parent.to_string(), _dicom_web_path: dicom_web_path.to_string(), @@ -2978,18 +4299,294 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all the messages in the given HL7v2 store with support for filtering. + /// Gets the configuration of the specified FHIR store. /// /// # Arguments /// - /// * `parent` - Name of the HL7v2 store to retrieve messages from. - pub fn locations_datasets_hl7_v2_stores_messages_list(&self, parent: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreMessageListCall { + /// * `name` - The resource name of the FHIR store to get. + pub fn locations_datasets_fhir_stores_get(&self, name: &str) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> { + ProjectLocationDatasetFhirStoreGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified DICOM store and removes all images that are contained + /// within it. + /// + /// # Arguments + /// + /// * `name` - The resource name of the DICOM store to delete. + pub fn locations_datasets_dicom_stores_delete(&self, name: &str) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> { + ProjectLocationDatasetDicomStoreDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Import resources to the FHIR store by loading data from the specified + /// sources. This method is optimized to load large quantities of data using + /// import semantics that ignore some FHIR store configuration options and are + /// not suitable for all use cases. It is primarily intended to load data into + /// an empty FHIR store that is not being used by other clients. In cases + /// where this method is not appropriate, consider using ExecuteBundle to + /// load data. + /// + /// Every resource in the input must contain a client-supplied ID, and will be + /// stored using that ID regardless of the + /// enable_update_create setting on the FHIR + /// store. + /// + /// The import process does not enforce referential integrity, regardless of + /// the + /// disable_referential_integrity + /// setting on the FHIR store. This allows the import of resources with + /// arbitrary interdependencies without considering grouping or ordering, but + /// if the input data contains invalid references or if some resources fail to + /// be imported, the FHIR store might be left in a state that violates + /// referential integrity. + /// + /// The import process does not trigger PubSub notification or BigQuery + /// streaming update, regardless of how those are configured on the FHIR store. + /// + /// If a resource with the specified ID already exists, the most recent + /// version of the resource is overwritten without creating a new historical + /// version, regardless of the + /// disable_resource_versioning + /// setting on the FHIR store. If transient failures occur during the import, + /// it is possible that successfully imported resources will be overwritten + /// more than once. + /// + /// The import operation is idempotent unless the input data contains multiple + /// valid resources with the same ID but different contents. In that case, + /// after the import completes, the store will contain exactly one resource + /// with that ID but there is no ordering guarantee on which version of the + /// contents it will have. The operation result counters do not count + /// duplicate IDs as an error and will count one success for each resource in + /// the input, which might result in a success count larger than the number + /// of resources in the FHIR store. This often occurs when importing data + /// organized in bundles produced by Patient-everything + /// where each bundle contains its own copy of a resource such as Practitioner + /// that might be referred to by many patients. + /// + /// If some resources fail to import, for example due to parsing errors, + /// successfully imported resources are not rolled back. + /// + /// The location and format of the input data is specified by the parameters + /// below. Note that if no format is specified, this method assumes the + /// `BUNDLE` format. When using the `BUNDLE` format this method ignores the + /// `Bundle.type` field, except that `history` bundles are rejected, and does + /// not apply any of the bundle processing semantics for batch or transaction + /// bundles. Unlike in ExecuteBundle, transaction bundles are not executed + /// as a single transaction and bundle-internal references are not rewritten. + /// The bundle is treated as a collection of resources to be written as + /// provided in `Bundle.entry.resource`, ignoring `Bundle.entry.request`. As + /// an example, this allows the import of `searchset` bundles produced by a + /// FHIR search or + /// Patient-everything operation. + /// + /// This method returns an Operation that can + /// be used to track the status of the import by calling + /// GetOperation. + /// + /// Immediate fatal errors appear in the + /// error field, errors are also logged + /// to Stackdriver (see [Viewing + /// logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the + /// operation finishes, a detailed response of type ImportResourcesResponse + /// is returned in the response field. + /// The metadata field type for this + /// operation is OperationMetadata. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the FHIR store to import FHIR resources to. The name should be + /// in the format of + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + pub fn locations_datasets_fhir_stores_import(&self, request: ImportResourcesRequest, name: &str) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { + ProjectLocationDatasetFhirStoreImportCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// SearchForInstances returns a list of matching instances. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the SearchForInstancesRequest DICOMweb request. For example, + /// `instances`, `series/{series_uid}/instances`, or + /// `studies/{study_uid}/instances`. + pub fn locations_datasets_dicom_stores_search_for_instances(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { + ProjectLocationDatasetDicomStoreSearchForInstanceCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// If a resource is found based on the search criteria specified in the query + /// parameters, updates part of that resource by applying the operations + /// specified in a [JSON Patch](http://jsonpatch.com/) document. + /// + /// Implements the FHIR standard conditional patch interaction + /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). + /// + /// DSTU2 doesn't define a conditional patch method, but the server supports it + /// in the same way it supports STU3. + /// + /// Search terms are provided as query parameters following the same pattern as + /// the search method. + /// + /// If the search criteria identify more than one match, the request will + /// return a `412 Precondition Failed` error. + /// + /// The request body must contain a JSON Patch document, and the request + /// headers must contain `Content-Type: application/json-patch+json`. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of the updated resource, including the server-assigned version ID. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the FHIR store this resource belongs to. + /// * `type` - The FHIR resource type to update, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + pub fn locations_datasets_fhir_stores_fhir_conditional_patch(&self, request: HttpBody, parent: &str, type_: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirConditionalPatchCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _type_: type_.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the N most recent `Observation` resources for a subject matching + /// search criteria specified as query parameters, grouped by + /// `Observation.code`, sorted from most recent to oldest. + /// + /// Implements the FHIR extended operation Observation-lastn + /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/observation-operations.html#lastn), + /// [R4](http://hl7.org/implement/standards/fhir/R4/observation-operations.html#lastn)). + /// + /// DSTU2 doesn't define the Observation-lastn method, but the server supports + /// it the same way it supports STU3. + /// + /// Search terms are provided as query parameters following the same pattern as + /// the search method. The following search parameters must + /// be provided: + /// + /// ````text + /// - `subject` or `patient` to specify a subject for the Observation. + /// - `code`, `category` or any of the composite parameters that include + /// `code`. + /// ```` + /// + /// Any other valid Observation search parameters can also be provided. This + /// operation accepts an additional query parameter `max`, which specifies N, + /// the maximum number of Observations to return from each group, with a + /// default of 1. + /// + /// Searches with over 1000 results are rejected. Results are counted before + /// grouping and limiting the results with `max`. To stay within the limit, + /// constrain these searches using Observation search parameters such as + /// `_lastUpdated` or `date`. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of a `Bundle` resource of type `searchset`, containing the results of the + /// operation. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `parent` - Name of the FHIR store to retrieve resources from. + pub fn locations_datasets_fhir_stores_fhir__observation_lastn(&self, parent: &str) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirObservationLastnCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// RetrieveSeries returns all instances within the given study and series. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the RetrieveSeries DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}`. + pub fn locations_datasets_dicom_stores_studies_series_retrieve_series(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the HL7v2 stores in the given dataset. + /// + /// # Arguments + /// + /// * `parent` - Name of the dataset. + pub fn locations_datasets_hl7_v2_stores_list(&self, parent: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreListCall { hub: self.hub, _parent: parent.to_string(), _page_token: Default::default(), _page_size: Default::default(), - _order_by: Default::default(), _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2999,18 +4596,229 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists information about the supported locations for this service. + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. /// /// # Arguments /// - /// * `name` - The resource that owns the locations collection, if applicable. - pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { - ProjectLocationListCall { + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_dicom_stores_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationDatasetDicomStoreTestIamPermissionCall<'a, C, A> { + ProjectLocationDatasetDicomStoreTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets an HL7v2 message. + /// + /// # Arguments + /// + /// * `name` - The resource name of the HL7v2 message to retrieve. + pub fn locations_datasets_hl7_v2_stores_messages_get(&self, name: &str) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreMessageGetCall { hub: self.hub, _name: name.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), + _view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Searches for resources in the given FHIR store according to criteria + /// specified as query parameters. + /// + /// Implements the FHIR standard search interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) + /// using the search semantics described in the FHIR Search specification + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). + /// + /// Supports three methods of search defined by the specification: + /// + /// * `GET [base]?[parameters]` to search across all resources. + /// * `GET [base]/[type]?[parameters]` to search resources of a specified + /// type. + /// * `POST [base]/[type]/_search?[parameters]` as an alternate form having + /// the same semantics as the `GET` method. + /// + /// The `GET` methods do not support compartment searches. The `POST` method + /// does not support `application/x-www-form-urlencoded` search parameters. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of a `Bundle` resource of type `searchset`, containing the results of the + /// search. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// The server's capability statement, retrieved through + /// capabilities, indicates what search parameters + /// are supported on each FHIR resource. A list of all search parameters + /// defined by the specification can be found in the FHIR Search Parameter + /// Registry + /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). + /// FHIR search parameters for DSTU2 can be found on each resource's definition + /// page. + /// + /// Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, + /// `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. + /// + /// Supported search result parameters: `_sort`, `_count`, `_include`, + /// `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. + /// + /// The maximum number of search results returned defaults to 100, which can + /// be overridden by the `_count` parameter up to a maximum limit of 1000. If + /// there are additional results, the returned `Bundle` will contain + /// pagination links. + /// + /// Resources with a total size larger than 5MB or a field count larger than + /// 50,000 might not be fully searchable as the server might trim its generated + /// search index in those cases. + /// + /// Note: FHIR resources are indexed asynchronously, so there might be a slight + /// delay between the time a resource is created or changes and when the change + /// is reflected in search results. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Name of the FHIR store to retrieve resources from. + pub fn locations_datasets_fhir_stores_fhir_search(&self, request: SearchResourcesRequest, parent: &str) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirSearchCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information about a location. + /// + /// # Arguments + /// + /// * `name` - Resource name for the location. + pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { + ProjectLocationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// SearchForStudies returns a list of matching studies. See + /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + /// + /// # Arguments + /// + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the SearchForStudies DICOMweb request. For example, `studies`. + pub fn locations_datasets_dicom_stores_search_for_studies(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { + ProjectLocationDatasetDicomStoreSearchForStudyCall { + hub: self.hub, + _parent: parent.to_string(), + _dicom_web_path: dicom_web_path.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the configuration of the specified FHIR store. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. Resource name of the FHIR store, of the form + /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + pub fn locations_datasets_fhir_stores_patch(&self, request: FhirStore, name: &str) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { + ProjectLocationDatasetFhirStorePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a FHIR resource. + /// + /// Implements the FHIR standard create interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), + /// which creates a new resource with a server-assigned resource ID. + /// + /// Also supports the FHIR standard conditional create interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#ccreate), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#ccreate), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#ccreate)), + /// specified by supplying an `If-None-Exist` header containing a FHIR search + /// query. If no resources match this search query, the server processes the + /// create operation as normal. + /// + /// The request body must contain a JSON-encoded FHIR resource, and the request + /// headers must contain `Content-Type: application/fhir+json`. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of the resource as it was created on the server, including the + /// server-assigned resource ID and version ID. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The name of the FHIR store this resource belongs to. + /// * `type` - The FHIR resource type to create, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + /// Must match the resource type in the provided content. + pub fn locations_datasets_fhir_stores_fhir_create(&self, request: HttpBody, parent: &str, type_: &str) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _type_: type_.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3027,8 +4835,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `resource` - REQUIRED: The resource for which the policy is being requested. /// See the operation documentation for the appropriate value for this field. - pub fn locations_datasets_fhir_stores_get_iam_policy(&self, resource: &str) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { - ProjectLocationDatasetFhirStoreGetIamPolicyCall { + pub fn locations_datasets_annotation_stores_get_iam_policy(&self, resource: &str) -> ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetAnnotationStoreGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), _options_requested_policy_version: Default::default(), @@ -3040,18 +4848,36 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new HL7v2 store within the parent dataset. + /// Deletes the specified HL7v2 store and removes all messages that are + /// contained within it. + /// + /// # Arguments + /// + /// * `name` - The resource name of the HL7v2 store to delete. + pub fn locations_datasets_hl7_v2_stores_delete(&self, name: &str) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new FHIR store within the parent dataset. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The name of the dataset this HL7v2 store belongs to. - pub fn locations_datasets_hl7_v2_stores_create(&self, request: Hl7V2Store, parent: &str) -> ProjectLocationDatasetHl7V2StoreCreateCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreCreateCall { + /// * `parent` - The name of the dataset this FHIR store belongs to. + pub fn locations_datasets_fhir_stores_create(&self, request: FhirStore, parent: &str) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { + ProjectLocationDatasetFhirStoreCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), - _hl7_v2_store_id: Default::default(), + _fhir_store_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3060,20 +4886,45 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// RetrieveStudy returns all instances within the given study. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. + /// On success, the response body will contain a JSON-encoded representation + /// of a `Bundle` resource of type `searchset`, containing the results of the + /// operation. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveStudy DICOMweb request (e.g., - /// `studies/{study_id}`). - pub fn locations_datasets_dicom_stores_studies_retrieve_study(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall { + /// * `name` - Name of the `Patient` resource for which the information is required. + pub fn locations_datasets_fhir_stores_fhir__patient_everything(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirPatientEverythingCall { + hub: self.hub, + _name: name.to_string(), + _start: Default::default(), + _end: Default::default(), + __page_token: Default::default(), + __count: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the health datasets in the current project. + /// + /// # Arguments + /// + /// * `parent` - The name of the project whose datasets should be listed. + /// For example, `projects/{project_id}/locations/{location_id}`. + pub fn locations_datasets_list(&self, parent: &str) -> ProjectLocationDatasetListCall<'a, C, A> { + ProjectLocationDatasetListCall { hub: self.hub, _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3082,14 +4933,38 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the configuration of the specified FHIR store. + /// Updates the entire contents of a resource. + /// + /// Implements the FHIR standard update interaction + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update), + /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). + /// + /// If the specified resource does + /// not exist and the FHIR store has + /// enable_update_create set, creates the + /// resource with the client-specified ID. + /// + /// The request body must contain a JSON-encoded FHIR resource, and the request + /// headers must contain `Content-Type: application/fhir+json`. The resource + /// must contain an `id` element having an identical value to the ID in the + /// REST path of the request. + /// + /// On success, the response body will contain a JSON-encoded representation + /// of the updated resource, including the server-assigned version ID. + /// Errors generated by the FHIR store will contain a JSON-encoded + /// `OperationOutcome` resource describing the reason for the error. If the + /// request cannot be mapped to a valid API method on a FHIR store, a generic + /// GCP error might be returned instead. /// /// # Arguments /// - /// * `name` - The resource name of the FHIR store to get. - pub fn locations_datasets_fhir_stores_get(&self, name: &str) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> { - ProjectLocationDatasetFhirStoreGetCall { + /// * `request` - No description provided. + /// * `name` - The name of the resource to update. + pub fn locations_datasets_fhir_stores_fhir_update(&self, request: HttpBody, name: &str) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { + ProjectLocationDatasetFhirStoreFhirUpdateCall { hub: self.hub, + _request: request, _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -3118,67 +4993,23 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// StoreInstances stores DICOM instances associated with study instance unique - /// identifiers (SUID). See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the StoreInstances DICOMweb request (e.g., - /// `studies/[{study_id}]`). Note that the `study_uid` is optional. - pub fn locations_datasets_dicom_stores_studies_store_instances(&self, request: HttpBody, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudyStoreInstanceCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Update the message. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Resource name of the Message, of the form - /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. - /// Assigned by the server. - pub fn locations_datasets_hl7_v2_stores_messages_patch(&self, request: Message, name: &str) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreMessagePatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Imports data into the DICOM store by copying it from the specified source. - /// For errors, the Operation will be populated with error details (in the form - /// of ImportDicomDataErrorDetails in error.details), which will hold - /// finer-grained error information. + /// For errors, the Operation is populated with error details (in the form + /// of ImportDicomDataErrorDetails in error.details), which hold + /// finer-grained error information. Errors are also logged to Stackdriver + /// Logging. For more information, + /// see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). /// The metadata field type is /// OperationMetadata. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the DICOM store resource into which the data is imported (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). + /// * `name` - The name of the DICOM store resource into which the data is imported. + /// For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. pub fn locations_datasets_dicom_stores_import(&self, request: ImportDicomDataRequest, name: &str) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> { ProjectLocationDatasetDicomStoreImportCall { hub: self.hub, @@ -3192,38 +5023,21 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// DeleteSeries deletes all instances within the given study and series. - /// Delete requests are equivalent to the GET requests specified in the WADO-RS - /// standard. + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the DeleteSeries request (e.g., - /// `studies/{study_id}/series/{series_id}`). - pub fn locations_datasets_dicom_stores_studies_series_delete(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryDeleteCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySeryDeleteCall { + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_hl7_v2_stores_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreSetIamPolicyCall { hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified FHIR store and removes all resources within it. - /// - /// # Arguments - /// - /// * `name` - The resource name of the FHIR store to delete. - pub fn locations_datasets_fhir_stores_delete(&self, name: &str) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> { - ProjectLocationDatasetFhirStoreDeleteCall { - hub: self.hub, - _name: name.to_string(), + _request: request, + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3261,144 +5075,17 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new DICOM store within the parent dataset. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The name of the dataset this DICOM store belongs to. - pub fn locations_datasets_dicom_stores_create(&self, request: DicomStore, parent: &str) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { - ProjectLocationDatasetDicomStoreCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _dicom_store_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new dataset containing de-identified data from the source - /// dataset. The metadata field type - /// is OperationMetadata. - /// If the request is successful, the - /// response field type is - /// DeidentifySummary. - /// If errors occur, - /// details field type is - /// DeidentifyErrorDetails. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `sourceDataset` - Source dataset resource name. (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). - pub fn locations_datasets_deidentify(&self, request: DeidentifyDatasetRequest, source_dataset: &str) -> ProjectLocationDatasetDeidentifyCall<'a, C, A> { - ProjectLocationDatasetDeidentifyCall { - hub: self.hub, - _request: request, - _source_dataset: source_dataset.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the latest state of a long-running operation. Clients can use this - /// method to poll the operation result at intervals as recommended by the API - /// service. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource. - pub fn locations_datasets_operations_get(&self, name: &str) -> ProjectLocationDatasetOperationGetCall<'a, C, A> { - ProjectLocationDatasetOperationGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the entire contents of a resource. - /// - /// Implements the FHIR standard [update - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#update). - /// - /// If the specified resource does - /// not exist and the FHIR store has - /// enable_update_create set, creates the - /// resource with the client-specified ID. - /// - /// The request body must contain a JSON-encoded FHIR resource, and the request - /// headers must contain `Content-Type: application/fhir+json`. The resource - /// must contain an `id` element having an identical value to the ID in the - /// REST path of the request. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of the updated resource, including the server-assigned version ID. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The name of the resource to update. - pub fn locations_datasets_fhir_stores_fhir_update(&self, request: HttpBody, name: &str) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirUpdateCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified health dataset and all data contained in the dataset. - /// Deleting a dataset does not affect the sources from which the dataset was - /// imported (if any). - /// - /// # Arguments - /// - /// * `name` - The name of the dataset to delete (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). - pub fn locations_datasets_delete(&self, name: &str) -> ProjectLocationDatasetDeleteCall<'a, C, A> { - ProjectLocationDatasetDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// SearchForInstances returns a list of matching instances. See + /// SearchForSeries returns a list of matching series. See /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the SearchForInstancesRequest DICOMweb request (e.g., - /// `instances` or `series/{series_uid}/instances` or - /// `studies/{study_uid}/instances`). - pub fn locations_datasets_dicom_stores_studies_search_for_instances(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySearchForInstanceCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySearchForInstanceCall { + /// * `parent` - The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// * `dicomWebPath` - The path of the SearchForSeries DICOMweb request. For example, `series` or + /// `studies/{study_uid}/series`. + pub fn locations_datasets_dicom_stores_studies_search_for_series(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { + ProjectLocationDatasetDicomStoreStudySearchForSeryCall { hub: self.hub, _parent: parent.to_string(), _dicom_web_path: dicom_web_path.to_string(), @@ -3431,20 +5118,21 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// SearchForSeries returns a list of matching series. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// # Arguments /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the SearchForSeries DICOMweb request(e.g., `series` or - /// `studies/{study_uid}/series`). - pub fn locations_datasets_dicom_stores_studies_search_for_series(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySearchForSeryCall { + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_dicom_stores_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationDatasetDicomStoreSetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetDicomStoreSetIamPolicyCall { hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), + _request: request, + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3453,30 +5141,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the contents of a FHIR resource. - /// - /// Implements the FHIR standard [read - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#read). - /// - /// Also supports the FHIR standard [conditional read - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#cread) - /// specified by supplying an `If-Modified-Since` header with a date/time value - /// or an `If-None-Match` header with an ETag value. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of the resource. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. /// /// # Arguments /// - /// * `name` - The name of the resource to retrieve. - pub fn locations_datasets_fhir_stores_fhir_read(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirReadCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirReadCall { + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_fhir_stores_get_iam_policy(&self, resource: &str) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetFhirStoreGetIamPolicyCall { hub: self.hub, - _name: name.to_string(), + _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3498,8 +5175,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. /// See the operation documentation for the appropriate value for this field. - pub fn locations_datasets_dicom_stores_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationDatasetDicomStoreTestIamPermissionCall<'a, C, A> { - ProjectLocationDatasetDicomStoreTestIamPermissionCall { + pub fn locations_datasets_annotation_stores_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> { + ProjectLocationDatasetAnnotationStoreTestIamPermissionCall { hub: self.hub, _request: request, _resource: resource.to_string(), @@ -3509,281 +5186,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Sets the access control policy on the specified resource. Replaces any - /// existing policy. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - pub fn locations_datasets_dicom_stores_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationDatasetDicomStoreSetIamPolicyCall<'a, C, A> { - ProjectLocationDatasetDicomStoreSetIamPolicyCall { - hub: self.hub, - _request: request, - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the N most recent `Observation` resources for a subject matching - /// search criteria specified as query parameters, grouped by - /// `Observation.code`, sorted from most recent to oldest. - /// - /// Implements the FHIR extended operation - /// [Observation-lastn](http://hl7.org/implement/standards/fhir/STU3/observation-operations.html#lastn). - /// - /// Search terms are provided as query parameters following the same pattern as - /// the search method. This operation accepts an additional - /// query parameter `max`, which specifies N, the maximum number of - /// Observations to return from each group, with a default of 1. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of a `Bundle` resource of type `searchset`, containing the results of the - /// operation. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `parent` - Name of the FHIR store to retrieve resources from. - pub fn locations_datasets_fhir_stores_fhir__observation_lastn(&self, parent: &str) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirObservationLastnCall { - hub: self.hub, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the specified DICOM store and removes all images that are contained - /// within it. - /// - /// # Arguments - /// - /// * `name` - The resource name of the DICOM store to delete. - pub fn locations_datasets_dicom_stores_delete(&self, name: &str) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> { - ProjectLocationDatasetDicomStoreDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the contents of a version (current or historical) of a FHIR resource - /// by version ID. - /// - /// Implements the FHIR standard [vread - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#vread). - /// - /// On success, the response body will contain a JSON-encoded representation - /// of the resource. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `name` - The name of the resource version to retrieve. - pub fn locations_datasets_fhir_stores_fhir_vread(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirVreadCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// RetrieveInstanceMetadata returns instance associated with the given study, - /// series, and SOP Instance UID presented as metadata with the bulk data - /// removed. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveInstanceMetadata DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/metadata`). - pub fn locations_datasets_dicom_stores_studies_series_instances_retrieve_metadata(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// SearchForInstances returns a list of matching instances. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the SearchForInstancesRequest DICOMweb request (e.g., - /// `instances` or `series/{series_uid}/instances` or - /// `studies/{study_uid}/instances`). - pub fn locations_datasets_dicom_stores_search_for_instances(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { - ProjectLocationDatasetDicomStoreSearchForInstanceCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the specified DICOM store. - /// - /// # Arguments - /// - /// * `name` - The resource name of the DICOM store to get. - pub fn locations_datasets_dicom_stores_get(&self, name: &str) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> { - ProjectLocationDatasetDicomStoreGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Executes all the requests in the given Bundle. - /// - /// Implements the FHIR standard [batch/transaction - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction). - /// - /// Supports all interactions within a bundle, except search. This method - /// accepts Bundles of type `batch` and `transaction`, processing them - /// according to the [batch processing - /// rules](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1) - /// and [transaction processing - /// rules](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2). - /// - /// The request body must contain a JSON-encoded FHIR `Bundle` resource, and - /// the request headers must contain `Content-Type: application/fhir+json`. - /// - /// For a batch bundle or a successful transaction the response body will - /// contain a JSON-encoded representation of a `Bundle` resource of type - /// `batch-response` or `transaction-response` containing one entry for each - /// entry in the request, with the outcome of processing the entry. In the - /// case of an error for a transaction bundle, the response body will contain - /// a JSON-encoded `OperationOutcome` resource describing the reason for the - /// error. If the request cannot be mapped to a valid API method on a FHIR - /// store, a generic GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Name of the FHIR store in which this bundle will be executed. - pub fn locations_datasets_fhir_stores_fhir_execute_bundle(&self, request: HttpBody, parent: &str) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirExecuteBundleCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// RetrieveInstance returns instance associated with the given study, series, - /// and SOP Instance UID. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveInstance DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}`). - pub fn locations_datasets_dicom_stores_studies_series_instances_retrieve_instance(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// RetrieveStudyMetadata returns instance associated with the given study - /// presented as metadata with the bulk data removed. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveStudyMetadata DICOMweb request (e.g., - /// `studies/{study_id}/metadata`). - pub fn locations_datasets_dicom_stores_studies_retrieve_metadata(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// RetrieveSeries returns all instances within the given study and series. See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the RetrieveSeries DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}`). - pub fn locations_datasets_dicom_stores_studies_series_retrieve_series(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Updates the specified DICOM store. @@ -3807,81 +5209,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Exports data to the specified destination by copying it from the DICOM - /// store. - /// The metadata field type is - /// OperationMetadata. + /// Deletes the specified FHIR store and removes all resources within it. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `name` - The DICOM store resource name from which the data should be exported (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - pub fn locations_datasets_dicom_stores_export(&self, request: ExportDicomDataRequest, name: &str) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { - ProjectLocationDatasetDicomStoreExportCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a FHIR resource. - /// - /// Implements the FHIR standard [create - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#create), - /// which creates a new resource with a server-assigned resource ID. - /// - /// Also supports the FHIR standard [conditional create - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#ccreate), - /// specified by supplying an `If-None-Exist` header containing a FHIR search - /// query. If no resources match this search query, the server processes the - /// create operation as normal. - /// - /// The request body must contain a JSON-encoded FHIR resource, and the request - /// headers must contain `Content-Type: application/fhir+json`. - /// - /// On success, the response body will contain a JSON-encoded representation - /// of the resource as it was created on the server, including the - /// server-assigned resource ID and version ID. - /// Errors generated by the FHIR store will contain a JSON-encoded - /// `OperationOutcome` resource describing the reason for the error. If the - /// request cannot be mapped to a valid API method on a FHIR store, a generic - /// GCP error might be returned instead. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The name of the FHIR store this resource belongs to. - /// * `type` - The FHIR resource type to create, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - /// Must match the resource type in the provided content. - pub fn locations_datasets_fhir_stores_fhir_create(&self, request: HttpBody, parent: &str, type_: &str) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _type_: type_.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the specified HL7v2 store. - /// - /// # Arguments - /// - /// * `name` - The resource name of the HL7v2 store to get. - pub fn locations_datasets_hl7_v2_stores_get(&self, name: &str) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreGetCall { + /// * `name` - The resource name of the FHIR store to delete. + pub fn locations_datasets_fhir_stores_delete(&self, name: &str) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> { + ProjectLocationDatasetFhirStoreDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -3890,291 +5224,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists the FHIR stores in the given dataset. - /// - /// # Arguments - /// - /// * `parent` - Name of the dataset. - pub fn locations_datasets_fhir_stores_list(&self, parent: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { - ProjectLocationDatasetFhirStoreListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes all the historical versions of a resource (excluding the current - /// version) from the FHIR store. To remove all versions of a resource, first - /// delete the current version and then call this method. - /// - /// This is not a FHIR standard operation. - /// - /// # Arguments - /// - /// * `name` - The name of the resource to purge. - pub fn locations_datasets_fhir_stores_fhir__resource_purge(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirResourcePurgeCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the HL7v2 stores in the given dataset. - /// - /// # Arguments - /// - /// * `parent` - Name of the dataset. - pub fn locations_datasets_hl7_v2_stores_list(&self, parent: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// DeleteInstance deletes an instance associated with the given study, series, - /// and SOP Instance UID. Delete requests are equivalent to the GET requests - /// specified in the WADO-RS standard. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the DeleteInstance request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}`). - pub fn locations_datasets_dicom_stores_studies_series_instances_delete(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// DeleteStudy deletes all instances within the given study. Delete requests - /// are equivalent to the GET requests specified in the WADO-RS standard. - /// - /// # Arguments - /// - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the DeleteStudy request (e.g., `studies/{study_id}`). - pub fn locations_datasets_dicom_stores_studies_delete(&self, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStudyDeleteCall { - hub: self.hub, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Import resources to the FHIR store by loading data from the specified - /// sources. Each resource must have a client-supplied ID, which is retained - /// by the server. - /// - /// The import operation is idempotent. Upon retry, the most recent data - /// (matching the client-supplied ID) is overwritten, without creating a new - /// resource version. If partial failures occur during the import, successful - /// changes are not rolled back. - /// - /// If history imports are enabled - /// (enable_history_import is set in the - /// FHIR store's configuration), you can import historical versions of a - /// resource by supplying a bundle of type `history`. The historical versions - /// in the bundle must have `lastUpdated` timestamps. If a current or - /// historical version with the supplied resource ID already exists, the - /// bundle is rejected. - /// - /// This method returns an Operation that can - /// be used to track the status of the import by calling - /// GetOperation. - /// - /// Immediate fatal errors appear in the - /// error field. - /// Otherwise, when the operation finishes, a detailed response of type - /// ImportResourcesResponse is returned in the - /// response field. - /// The metadata field type for this - /// operation is OperationMetadata. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The name of the FHIR store to import FHIR resources to. The name should be - /// in the format of - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - pub fn locations_datasets_fhir_stores_import(&self, request: ImportResourcesRequest, name: &str) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { - ProjectLocationDatasetFhirStoreImportCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the FHIR [capability - /// statement](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html) - /// for the store, which contains a description of functionality supported by - /// the server. - /// - /// Implements the FHIR standard [capabilities - /// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities). - /// - /// On success, the response body will contain a JSON-encoded representation - /// of a `CapabilityStatement` resource. - /// - /// # Arguments - /// - /// * `name` - Name of the FHIR store to retrieve the capabilities for. - pub fn locations_datasets_fhir_stores_fhir_capabilities(&self, name: &str) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> { - ProjectLocationDatasetFhirStoreFhirCapabilityCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the access control policy on the specified resource. Replaces any - /// existing policy. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - pub fn locations_datasets_hl7_v2_stores_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreSetIamPolicyCall { - hub: self.hub, - _request: request, - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// StoreInstances stores DICOM instances associated with study instance unique - /// identifiers (SUID). See - /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// * `dicomWebPath` - The path of the StoreInstances DICOMweb request (e.g., - /// `studies/[{study_id}]`). Note that the `study_uid` is optional. - pub fn locations_datasets_dicom_stores_store_instances(&self, request: HttpBody, parent: &str, dicom_web_path: &str) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { - ProjectLocationDatasetDicomStoreStoreInstanceCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _dicom_web_path: dicom_web_path.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the access control policy on the specified resource. Replaces any - /// existing policy. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - pub fn locations_datasets_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { - ProjectLocationDatasetSetIamPolicyCall { - hub: self.hub, - _request: request, - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the access control policy for a resource. - /// Returns an empty policy if the resource exists and does not have a policy - /// set. - /// - /// # Arguments - /// - /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - pub fn locations_datasets_hl7_v2_stores_get_iam_policy(&self, resource: &str) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreGetIamPolicyCall { - hub: self.hub, - _resource: resource.to_string(), - _options_requested_policy_version: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets an HL7v2 message. - /// - /// # Arguments - /// - /// * `name` - The resource name of the HL7v2 message to retrieve. - pub fn locations_datasets_hl7_v2_stores_messages_get(&self, name: &str) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreMessageGetCall { - hub: self.hub, - _name: name.to_string(), - _view: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. @@ -4203,19 +5252,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the configuration of the specified FHIR store. + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Output only. Resource name of the FHIR store, of the form - /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - pub fn locations_datasets_fhir_stores_patch(&self, request: FhirStore, name: &str) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { - ProjectLocationDatasetFhirStorePatchCall { + /// * `name` - The name of the operation resource to be cancelled. + pub fn locations_datasets_operations_cancel(&self, request: CancelOperationRequest, name: &str) -> ProjectLocationDatasetOperationCancelCall<'a, C, A> { + ProjectLocationDatasetOperationCancelCall { hub: self.hub, _request: request, _name: name.to_string(), - _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4224,22 +5280,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a message and sends a notification to the Cloud Pub/Sub topic. If - /// configured, the MLLP adapter listens to messages created by this method and - /// sends those back to the hospital. A successful response indicates the - /// message has been persisted to storage and a Cloud Pub/Sub notification has - /// been sent. Sending to the hospital by the MLLP adapter happens - /// asynchronously. + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `parent` - The name of the dataset this message belongs to. - pub fn locations_datasets_hl7_v2_stores_messages_create(&self, request: CreateMessageRequest, parent: &str) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { - ProjectLocationDatasetHl7V2StoreMessageCreateCall { + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_datasets_hl7_v2_stores_get_iam_policy(&self, resource: &str) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { + ProjectLocationDatasetHl7V2StoreGetIamPolicyCall { hub: self.hub, - _request: request, - _parent: parent.to_string(), + _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4255,21 +5308,21 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Lists all the versions of a resource (including the current version and -/// deleted versions) from the FHIR store. +/// Deletes a FHIR resource. /// -/// Implements the per-resource form of the FHIR standard [history -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#history). +/// Implements the FHIR standard delete interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). /// -/// On success, the response body will contain a JSON-encoded representation -/// of a `Bundle` resource of type `history`, containing the version history -/// sorted from most recent to oldest versions. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. +/// Note: Unless resource versioning is disabled by setting the +/// disable_resource_versioning flag +/// on the FHIR store, the deleted resources will be moved to a history +/// repository that can still be retrieved through vread +/// and related methods, unless they are removed by the +/// purge method. /// -/// A builder for the *locations.datasets.fhirStores.fhir.history* method supported by a *project* resource. +/// A builder for the *locations.datasets.fhirStores.fhir.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4294,31 +5347,23 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // 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_datasets_fhir_stores_fhir_history("name") -/// .since("gubergren") -/// .page("sadipscing") -/// .count(-31) -/// .at("ea") +/// let result = hub.projects().locations_datasets_fhir_stores_fhir_delete("name") /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> +pub struct ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, _name: String, - _since: Option, - _page: Option, - _count: Option, - _at: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -4331,23 +5376,11 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.history", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); - if let Some(value) = self._since { - params.push(("since", value.to_string())); - } - if let Some(value) = self._page { - params.push(("page", value.to_string())); - } - if let Some(value) = self._count { - params.push(("count", value.to_string())); - } - if let Some(value) = self._at { - params.push(("at", value.to_string())); - } - for &field in ["alt", "name", "since", "page", "count", "at"].iter() { + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4359,7 +5392,2496 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/_history"; + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the resource to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// De-identifies data from the source store and writes it to the destination +/// store. The metadata field type +/// is OperationMetadata. +/// If the request is successful, the +/// response field type is +/// DeidentifyDicomStoreSummary. If errors occur, +/// error +/// details field type is +/// DeidentifyErrorDetails. +/// The LRO result may still be successful if de-identification fails for some +/// DICOM instances. The output DICOM store will not contain +/// these failed resources. Failed resource totals are tracked in +/// DeidentifySummary.failure_resource_count. +/// Error details are also logged to Stackdriver +/// (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). +/// +/// A builder for the *locations.datasets.dicomStores.deidentify* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::DeidentifyDicomStoreRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DeidentifyDicomStoreRequest::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_datasets_dicom_stores_deidentify(req, "sourceStore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: DeidentifyDicomStoreRequest, + _source_store: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.deidentify", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("sourceStore", self._source_store.to_string())); + for &field in ["alt", "sourceStore"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+sourceStore}:deidentify"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sourceStore}", "sourceStore")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sourceStore"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DeidentifyDicomStoreRequest) -> ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> { + self._request = new_value; + self + } + /// Source DICOM store resource name. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *source store* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn source_store(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> { + self._source_store = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreDeidentifyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Searches for resources in the given FHIR store according to criteria +/// specified as query parameters. +/// +/// Implements the FHIR standard search interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) +/// using the search semantics described in the FHIR Search specification +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), +/// [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). +/// +/// Supports three methods of search defined by the specification: +/// +/// * `GET [base]?[parameters]` to search across all resources. +/// * `GET [base]/[type]?[parameters]` to search resources of a specified +/// type. +/// * `POST [base]/[type]/_search?[parameters]` as an alternate form having +/// the same semantics as the `GET` method. +/// +/// The `GET` methods do not support compartment searches. The `POST` method +/// does not support `application/x-www-form-urlencoded` search parameters. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of a `Bundle` resource of type `searchset`, containing the results of the +/// search. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// The server's capability statement, retrieved through +/// capabilities, indicates what search parameters +/// are supported on each FHIR resource. A list of all search parameters +/// defined by the specification can be found in the FHIR Search Parameter +/// Registry +/// ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), +/// [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). +/// FHIR search parameters for DSTU2 can be found on each resource's definition +/// page. +/// +/// Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, +/// `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. +/// +/// Supported search result parameters: `_sort`, `_count`, `_include`, +/// `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. +/// +/// The maximum number of search results returned defaults to 100, which can +/// be overridden by the `_count` parameter up to a maximum limit of 1000. If +/// there are additional results, the returned `Bundle` will contain +/// pagination links. +/// +/// Resources with a total size larger than 5MB or a field count larger than +/// 50,000 might not be fully searchable as the server might trim its generated +/// search index in those cases. +/// +/// Note: FHIR resources are indexed asynchronously, so there might be a slight +/// delay between the time a resource is created or changes and when the change +/// is reflected in search results. +/// +/// A builder for the *locations.datasets.fhirStores.search* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_search("parent") +/// .resource_type("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _resource_type: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.search", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._resource_type { + params.push(("resourceType", value.to_string())); + } + for &field in ["alt", "parent", "resourceType"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the FHIR store to retrieve resources from. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The FHIR resource type to search, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + /// + /// Sets the *resource type* query property to the given value. + pub fn resource_type(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> { + self._resource_type = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreSearchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// RetrieveRenderedInstance returns instance associated with the given study, +/// series, and SOP Instance UID in an acceptable Rendered Media Type. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. +/// +/// A builder for the *locations.datasets.dicomStores.studies.series.instances.retrieveRendered* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_series_instances_retrieve_rendered("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveRenderedInstance DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/rendered`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an HL7v2 message. +/// +/// A builder for the *locations.datasets.hl7V2Stores.messages.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_hl7_v2_stores_messages_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource name of the HL7v2 message to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// RetrieveRenderedFrames returns instances associated with the given study, +/// series, SOP Instance UID and frame numbers in an acceptable Rendered Media +/// Type. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. +/// +/// A builder for the *locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_series_instances_frames_retrieve_rendered("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveRenderedFrames DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}/rendered`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *locations.datasets.fhirStores.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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_datasets_fhir_stores_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED +/// +/// A builder for the *locations.datasets.annotationStores.setIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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_datasets_annotation_stores_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.annotationStores.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:setIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetAnnotationStoreSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// RetrieveFrames returns instances associated with the given study, series, +/// SOP Instance UID and frame numbers. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. +/// +/// A builder for the *locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_series_instances_frames_retrieve_frames("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveFrames DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists information about the supported locations for this service. +/// +/// A builder for the *locations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_list("name") +/// .page_token("duo") +/// .page_size(-32) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/locations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4462,60 +7984,35 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: } - /// The name of the resource to retrieve. + /// The resource that owns the locations collection, if applicable. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { self._name = new_value.to_string(); self } - /// Only include resource versions that were created at or after the given - /// instant in time. The instant in time uses the format - /// YYYY-MM-DDThh:mm:ss.sss+zz:zz (for example 2015-02-07T13:28:17.239+02:00 or - /// 2017-01-01T00:00:00Z). The time must be specified to the second and - /// include a time zone. + /// The standard list page token. /// - /// Sets the *since* query property to the given value. - pub fn since(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { - self._since = Some(new_value.to_string()); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); self } - /// Used to retrieve the first, previous, next, or last page of resource - /// versions when using pagination. Value should be set to the value of the - /// `link.url` field returned in the response to the previous request, where - /// `link.relation` is "first", "previous", "next" or "last". - /// - /// Omit `page` if no previous request has been made. + /// The standard list page size. /// - /// Sets the *page* query property to the given value. - pub fn page(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { - self._page = Some(new_value.to_string()); + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { + self._page_size = Some(new_value); self } - /// The maximum number of search results on a page. Defaults to 1000. + /// The standard list filter. /// - /// Sets the *count* query property to the given value. - pub fn count(mut self, new_value: i32) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { - self._count = Some(new_value); - self - } - /// Only include resource versions that were current at some point during the - /// time period specified in the date time value. The date parameter format is - /// yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm] - /// - /// Clients may specify any of the following: - /// - /// * An entire year: `_at=2019` - /// * An entire month: `_at=2019-01` - /// * A specific day: `_at=2019-01-20` - /// * A specific second: `_at=2018-12-31T23:59:58Z` - /// - /// Sets the *at* query property to the given value. - pub fn at(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { - self._at = Some(new_value.to_string()); + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -4524,7 +8021,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4549,7 +8046,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4569,7 +8066,2784 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// StoreInstances stores DICOM instances associated with study instance unique +/// identifiers (SUID). See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. +/// +/// A builder for the *locations.datasets.dicomStores.studies.storeInstances* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_dicom_stores_studies_store_instances(req, "parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: HttpBody, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.storeInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the StoreInstances DICOMweb request. For example, + /// `studies/[{study_uid}]`. Note that the `study_uid` is optional. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update the message. +/// +/// The contents of the message in Message.data and data extracted from +/// the contents such as Message.create_time cannot be altered. Only the +/// Message.labels field is allowed to be updated. The labels in the +/// request are merged with the existing set of labels. Existing labels with +/// the same keys are updated. +/// +/// A builder for the *locations.datasets.hl7V2Stores.messages.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::Message; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Message::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_datasets_hl7_v2_stores_messages_patch(req, "name") +/// .update_mask("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: Message, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Message)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Message) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Resource name of the Message, of the form + /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. + /// Assigned by the server. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The update mask applies to the resource. For the `FieldMask` definition, + /// see + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the FHIR stores in the given dataset. +/// +/// A builder for the *locations.datasets.fhirStores.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_list("parent") +/// .page_token("eirmod") +/// .page_size(-43) +/// .filter("amet") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListFhirStoresResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhirStores"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the dataset. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token value returned from the previous List request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Limit on the number of FHIR stores to return in a single response. If zero + /// the default page size of 100 is used. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Restricts stores returned to those matching a filter. Syntax: + /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings + /// Only filtering on labels is supported, for example `labels.key=value`. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the contents of a version (current or historical) of a FHIR resource +/// by version ID. +/// +/// Implements the FHIR standard vread interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). +/// +/// On success, the response body will contain a JSON-encoded representation +/// of the resource. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.vread* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_fhir_vread("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.vread", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the resource version to retrieve. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Exports data to the specified destination by copying it from the DICOM +/// store. +/// Errors are also logged to Stackdriver Logging. For more information, +/// see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). +/// The metadata field type is +/// OperationMetadata. +/// +/// A builder for the *locations.datasets.dicomStores.export* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::ExportDicomDataRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ExportDicomDataRequest::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_datasets_dicom_stores_export(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreExportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: ExportDicomDataRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreExportCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.export", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:export"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ExportDicomDataRequest) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { + self._request = new_value; + self + } + /// The DICOM store resource name from which to export the data. For + /// example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all the historical versions of a resource (excluding the current +/// version) from the FHIR store. To remove all versions of a resource, first +/// delete the current version and then call this method. +/// +/// This is not a FHIR standard operation. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.Resource-purge* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_fhir__resource_purge("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.Resource-purge", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/$purge"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the resource to purge. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// DeleteInstance deletes an instance associated with the given study, series, +/// and SOP Instance UID. Delete requests are equivalent to the GET requests +/// specified in the Retrieve transaction. +/// +/// A builder for the *locations.datasets.dicomStores.studies.series.instances.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_series_instances_delete("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the DeleteInstance request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the FHIR capability statement +/// ([STU3](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html), +/// [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)), +/// or the [conformance +/// statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) +/// in the DSTU2 case for the store, which contains a description of +/// functionality supported by the server. +/// +/// Implements the FHIR standard capabilities interaction +/// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), +/// or the [conformance +/// interaction](http://hl7.org/implement/standards/fhir/DSTU2/http.html#conformance) +/// in the DSTU2 case. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of a `CapabilityStatement` resource. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.capabilities* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_fhir_capabilities("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.capabilities", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/fhir/metadata"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the FHIR store to retrieve the capabilities for. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED +/// +/// A builder for the *locations.datasets.setIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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_datasets_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:setIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a message and sends a notification to the Cloud Pub/Sub topic. If +/// configured, the MLLP adapter listens to messages created by this method and +/// sends those back to the hospital. A successful response indicates the +/// message has been persisted to storage and a Cloud Pub/Sub notification has +/// been sent. Sending to the hospital by the MLLP adapter happens +/// asynchronously. +/// +/// A builder for the *locations.datasets.hl7V2Stores.messages.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::CreateMessageRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = CreateMessageRequest::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_datasets_hl7_v2_stores_messages_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: CreateMessageRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Message)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/messages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CreateMessageRequest) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the dataset this message belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -4583,9 +10857,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: /// Ingests a new HL7v2 message from the hospital and sends a notification to /// the Cloud Pub/Sub topic. Return is an HL7v2 ACK message if the message was -/// successfully stored. Otherwise an error is returned. If an identical -/// HL7v2 message is created twice only one resource is created on the server -/// and no error is reported. +/// successfully stored. Otherwise an error is returned. /// /// A builder for the *locations.datasets.hl7V2Stores.messages.ingest* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -4864,9 +11136,11 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageIngestCall<'a, C, A> where } -/// Deletes an HL7v2 message. +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. /// -/// A builder for the *locations.datasets.hl7V2Stores.messages.delete* method supported by a *project* resource. +/// A builder for the *locations.datasets.dicomStores.getIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4891,27 +11165,29 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageIngestCall<'a, C, A> where /// // 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_datasets_hl7_v2_stores_messages_delete("name") +/// let result = hub.projects().locations_datasets_dicom_stores_get_iam_policy("resource") +/// .options_requested_policy_version(-70) /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> +pub struct ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, - _name: String, + _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -4920,259 +11196,14 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> where Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the HL7v2 message to delete. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets information about a location. -/// -/// A builder for the *locations.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Location)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.get", + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.getIamPolicy", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5184,12 +11215,12 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["resource"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5287,14 +11318,29 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -5303,7 +11349,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5328,7 +11374,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5348,820 +11394,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// SearchForStudies returns a list of matching studies. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. -/// -/// A builder for the *locations.datasets.dicomStores.searchForStudies* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_search_for_studies("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.searchForStudies", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the SearchForStudies DICOMweb request (e.g., `studies`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a FHIR resource. -/// -/// Implements the FHIR standard [delete -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#delete). -/// -/// Note: Unless resource versioning is disabled by setting the -/// disable_resource_versioning flag -/// on the FHIR store, the deleted resources will be moved to a history -/// repository that can still be retrieved through vread -/// and related methods, unless they are removed by the -/// purge method. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_fhir_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the resource to delete. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates part of an existing resource by applying the operations specified -/// in a [JSON Patch](http://jsonpatch.com/) document. -/// -/// Implements the FHIR standard [patch -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#patch). -/// -/// The request body must contain a JSON Patch document, and the request -/// headers must contain `Content-Type: application/json-patch+json`. -/// -/// On success, the response body will contain a JSON-encoded representation -/// of the updated resource, including the server-assigned version ID. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_patch(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: HttpBody, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the resource to update. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6180,7 +11413,9 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> where C: B /// GetOperation. /// /// Immediate fatal errors appear in the -/// error field. +/// error field, errors are also logged +/// to Stackdriver (see [Viewing +/// logs](/healthcare/docs/how-tos/stackdriver-logging)). /// Otherwise, when the operation finishes, a detailed response of type /// ExportResourcesResponse is returned in the /// response field. @@ -6644,8 +11879,8 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall<'a } - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -6655,9 +11890,9 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall<'a self._parent = new_value.to_string(); self } - /// The path of the SearchForInstancesRequest DICOMweb request (e.g., - /// `instances` or `series/{series_uid}/instances` or - /// `studies/{study_uid}/instances`). + /// The path of the SearchForInstancesRequest DICOMweb request. For example, + /// `instances`, `series/{series_uid}/instances`, or + /// `studies/{study_uid}/instances`. /// /// Sets the *dicom web path* path property to the given value. /// @@ -6730,2835 +11965,10 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySerySearchForInstanceCall<'a } -/// RetrieveRenderedInstance returns instance associated with the given study, -/// series, and SOP Instance UID in an acceptable Rendered Media Type. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.series.instances.retrieveRendered* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_series_instances_retrieve_rendered("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveRendered", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveRenderedInstance DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/rendered`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveRenderedCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the access control policy for a resource. -/// Returns an empty policy if the resource exists and does not have a policy -/// set. -/// -/// A builder for the *locations.datasets.dicomStores.getIamPolicy* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_get_iam_policy("resource") -/// .options_requested_policy_version(-75) -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _resource: String, - _options_requested_policy_version: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.getIamPolicy", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - if let Some(value) = self._options_requested_policy_version { - params.push(("options.requestedPolicyVersion", value.to_string())); - } - for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. - /// - /// Sets the *options.requested policy version* query property to the given value. - pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { - self._options_requested_policy_version = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreGetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new FHIR store within the parent dataset. -/// -/// A builder for the *locations.datasets.fhirStores.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::FhirStore; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = FhirStore::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_datasets_fhir_stores_create(req, "parent") -/// .fhir_store_id("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: FhirStore, - _parent: String, - _fhir_store_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, FhirStore)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._fhir_store_id { - params.push(("fhirStoreId", value.to_string())); - } - for &field in ["alt", "parent", "fhirStoreId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhirStores"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: FhirStore) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the dataset this FHIR store belongs to. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The ID of the FHIR store that is being created. - /// The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. - /// - /// Sets the *fhir store id* query property to the given value. - pub fn fhir_store_id(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { - self._fhir_store_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// RetrieveRenderedFrames returns instances associated with the given study, -/// series, SOP Instance UID and frame numbers in an acceptable Rendered Media -/// Type. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_series_instances_frames_retrieve_rendered("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveRendered", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveRenderedFrames DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}/rendered`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveRenderedCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified HL7v2 store and removes all messages that are -/// contained within it. -/// -/// A builder for the *locations.datasets.hl7V2Stores.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_hl7_v2_stores_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the HL7v2 store to delete. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// If a resource is found based on the search criteria specified in the query -/// parameters, updates the entire contents of that resource. -/// -/// Implements the FHIR standard [conditional update -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#cond-update). -/// -/// Search terms are provided as query parameters following the same pattern as -/// the search method. -/// -/// If the search criteria identify more than one match, the request will -/// return a `412 Precondition Failed` error. -/// If the search criteria identify zero matches, and the supplied resource -/// body contains an `id`, and the FHIR store has -/// enable_update_create set, creates the -/// resource with the client-specified ID. If the search criteria identify zero -/// matches, and the supplied resource body does not contain an `id`, the -/// resource will be created with a server-assigned ID as per the -/// create method. -/// -/// The request body must contain a JSON-encoded FHIR resource, and the request -/// headers must contain `Content-Type: application/fhir+json`. -/// -/// On success, the response body will contain a JSON-encoded representation -/// of the updated resource, including the server-assigned version ID. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.conditionalUpdate* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_conditional_update(req, "parent", "type") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: HttpBody, - _parent: String, - _type_: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.conditionalUpdate", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("type", self._type_.to_string())); - for &field in ["alt", "parent", "type"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/{+type}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+type}", "type")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["type", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the FHIR store this resource belongs to. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The FHIR resource type to update, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - /// Must match the resource type in the provided content. - /// - /// Sets the *type* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { - self._type_ = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns permissions that a caller has on the specified resource. -/// If the resource does not exist, this will return an empty set of -/// permissions, not a NOT_FOUND error. -/// -/// Note: This operation is designed to be used for building permission-aware -/// UIs and command-line tools, not for authorization checking. This operation -/// may "fail open" without warning. -/// -/// A builder for the *locations.datasets.fhirStores.testIamPermissions* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::TestIamPermissionsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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_datasets_fhir_stores_test_iam_permissions(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: TestIamPermissionsRequest, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.testIamPermissions", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:testIamPermissions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> { - self._request = new_value; - self - } - /// REQUIRED: The resource for which the policy detail is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreTestIamPermissionCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Searches for resources in the given FHIR store according to criteria -/// specified as query parameters. -/// -/// Implements the FHIR standard [search -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#search) -/// using the search semantics described in the [FHIR Search -/// specification](http://hl7.org/implement/standards/fhir/STU3/search.html). -/// -/// Supports three methods of search defined by the specification: -/// -/// * `GET [base]?[parameters]` to search across all resources. -/// * `GET [base]/[type]?[parameters]` to search resources of a specified -/// type. -/// * `POST [base]/[type]/_search?[parameters]` as an alternate form having -/// the same semantics as the `GET` method. -/// -/// The `GET` methods do not support compartment searches. The `POST` method -/// does not support `application/x-www-form-urlencoded` search parameters. -/// -/// On success, the response body will contain a JSON-encoded representation -/// of a `Bundle` resource of type `searchset`, containing the results of the -/// search. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// The server's capability statement, retrieved through -/// capabilities, indicates what search parameters -/// are supported on each FHIR resource. A list of all search parameters -/// defined by the specification can be found in the [FHIR Search Parameter -/// Registry](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html). -/// -/// Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, -/// `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. -/// -/// Supported search result parameters: `_sort`, `_count`, `_include`, -/// `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. -/// -/// The maximum number of search results returned defaults to 100, which can -/// be overridden by the `_count` parameter up to a maximum limit of 1000. If -/// there are additional results, the returned `Bundle` will contain -/// pagination links. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.search* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::SearchResourcesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SearchResourcesRequest::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_datasets_fhir_stores_fhir_search(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: SearchResourcesRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.search", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/_search"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: SearchResourcesRequest) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { - self._request = new_value; - self - } - /// Name of the FHIR store to retrieve resources from. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// If a resource is found based on the search criteria specified in the query -/// parameters, updates part of that resource by applying the operations -/// specified in a [JSON Patch](http://jsonpatch.com/) document. -/// -/// Implements the FHIR standard [conditional patch -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#patch). -/// -/// Search terms are provided as query parameters following the same pattern as -/// the search method. -/// -/// If the search criteria identify more than one match, the request will -/// return a `412 Precondition Failed` error. -/// -/// The request body must contain a JSON Patch document, and the request -/// headers must contain `Content-Type: application/json-patch+json`. -/// -/// On success, the response body will contain a JSON-encoded representation -/// of the updated resource, including the server-assigned version ID. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.conditionalPatch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_conditional_patch(req, "parent", "type") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: HttpBody, - _parent: String, - _type_: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.conditionalPatch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("type", self._type_.to_string())); - for &field in ["alt", "parent", "type"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/{+type}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+type}", "type")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["type", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the FHIR store this resource belongs to. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The FHIR resource type to update, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - /// - /// Sets the *type* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { - self._type_ = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets any metadata associated with a dataset. -/// -/// A builder for the *locations.datasets.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the dataset to read (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *locations.datasets.fhirStores.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -10017,8 +12427,8 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall<'a, } - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -10028,8 +12438,8 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall<'a, self._parent = new_value.to_string(); self } - /// The path of the RetrieveSeriesMetadata DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/metadata`). + /// The path of the RetrieveSeriesMetadata DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/metadata`. /// /// Sets the *dicom web path* path property to the given value. /// @@ -10102,1159 +12512,6 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryRetrieveMetadataCall<'a, } -/// Updates the HL7v2 store. -/// -/// A builder for the *locations.datasets.hl7V2Stores.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::Hl7V2Store; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Hl7V2Store::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_datasets_hl7_v2_stores_patch(req, "name") -/// .update_mask("duo") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: Hl7V2Store, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Hl7V2Store)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Hl7V2Store) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Output only. Resource name of the HL7v2 store, of the form - /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The update mask applies to the resource. For the `FieldMask` definition, - /// see - /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the health datasets in the current project. -/// -/// A builder for the *locations.datasets.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_list("parent") -/// .page_token("eirmod") -/// .page_size(-58) -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetListCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListDatasetsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/datasets"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the project whose datasets should be listed (e.g., - /// `projects/{project_id}/locations/{location_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The next_page_token value returned from a previous List request, if any. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of items to return. Capped to 100 if not specified. - /// May not be larger than 1000. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new health dataset. Results are returned through the -/// Operation interface which returns either an -/// `Operation.response` which contains a Dataset or -/// `Operation.error`. The metadata -/// field type is OperationMetadata. -/// A Google Cloud Platform project can contain up to 500 datasets across all -/// regions. -/// -/// A builder for the *locations.datasets.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::Dataset; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Dataset::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_datasets_create(req, "parent") -/// .dataset_id("amet") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: Dataset, - _parent: String, - _dataset_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._dataset_id { - params.push(("datasetId", value.to_string())); - } - for &field in ["alt", "parent", "datasetId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/datasets"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Dataset) -> ProjectLocationDatasetCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the project in which the dataset should be created (e.g., - /// `projects/{project_id}/locations/{location_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The ID of the dataset that is being created. - /// The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. - /// - /// Sets the *dataset id* query property to the given value. - pub fn dataset_id(mut self, new_value: &str) -> ProjectLocationDatasetCreateCall<'a, C, A> { - self._dataset_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Retrieves all the resources in the patient compartment for a `Patient` -/// resource. -/// -/// Implements the FHIR extended operation -/// [Patient-everything](http://hl7.org/implement/standards/fhir/STU3/patient-operations.html#everything). -/// -/// On success, the response body will contain a JSON-encoded representation -/// of a `Bundle` resource of type `searchset`, containing the results of the -/// operation. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.Patient-everything* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_fhir__patient_everything("name") -/// .start("consetetur") -/// .end("ut") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _start: Option, - _end: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.Patient-everything", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._start { - params.push(("start", value.to_string())); - } - if let Some(value) = self._end { - params.push(("end", value.to_string())); - } - for &field in ["alt", "name", "start", "end"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/$everything"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the `Patient` resource for which the information is required. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The response includes records subsequent to the start date. If no start - /// date is provided, all records prior to the end date are in scope. - /// - /// Sets the *start* query property to the given value. - pub fn start(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { - self._start = Some(new_value.to_string()); - self - } - /// The response includes records prior to the end date. If no end date is - /// provided, all records subsequent to the start date are in scope. - /// - /// Sets the *end* query property to the given value. - pub fn end(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { - self._end = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the DICOM stores in the given dataset. /// /// A builder for the *locations.datasets.dicomStores.list* method supported by a *project* resource. @@ -11283,9 +12540,9 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_datasets_dicom_stores_list("parent") -/// .page_token("sed") -/// .page_size(-3) -/// .filter("dolor") +/// .page_token("ut") +/// .page_size(-16) +/// .filter("sed") /// .doit(); /// # } /// ``` @@ -11472,7 +12729,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreListCall<'a, C, A> where C: Borro } /// Restricts stores returned to those matching a filter. Syntax: /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings - /// Only filtering on labels is supported, for example `labels.key=value`. + /// Only filtering on labels is supported. For example, `labels.key=value`. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreListCall<'a, C, A> { @@ -11542,23 +12799,38 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreListCall<'a, C, A> where C: Borro } -/// Deletes FHIR resources that match a search query. +/// If a resource is found based on the search criteria specified in the query +/// parameters, updates the entire contents of that resource. /// -/// Implements the FHIR standard [conditional delete -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.13.1). -/// If multiple resources match, all of them will be deleted. +/// Implements the FHIR standard conditional update interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.10.2), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cond-update), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cond-update)). /// /// Search terms are provided as query parameters following the same pattern as /// the search method. /// -/// Note: Unless resource versioning is disabled by setting the -/// disable_resource_versioning flag -/// on the FHIR store, the deleted resources will be moved to a history -/// repository that can still be retrieved through vread -/// and related methods, unless they are removed by the -/// purge method. +/// If the search criteria identify more than one match, the request will +/// return a `412 Precondition Failed` error. +/// If the search criteria identify zero matches, and the supplied resource +/// body contains an `id`, and the FHIR store has +/// enable_update_create set, creates the +/// resource with the client-specified ID. If the search criteria identify zero +/// matches, and the supplied resource body does not contain an `id`, the +/// resource will be created with a server-assigned ID as per the +/// create method. +/// +/// The request body must contain a JSON-encoded FHIR resource, and the request +/// headers must contain `Content-Type: application/fhir+json`. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of the updated resource, including the server-assigned version ID. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. /// -/// A builder for the *locations.datasets.fhirStores.fhir.conditionalDelete* method supported by a *project* resource. +/// A builder for the *locations.datasets.fhirStores.fhir.conditionalUpdate* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -11570,6 +12842,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreListCall<'a, C, A> where C: Borro /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -11580,17 +12853,23 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreListCall<'a, C, A> where C: Borro /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_conditional_delete("parent", "type") +/// let result = hub.projects().locations_datasets_fhir_stores_fhir_conditional_update(req, "parent", "type") /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> +pub struct ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, + _request: HttpBody, _parent: String, _type_: String, _delegate: Option<&'a mut dyn Delegate>, @@ -11598,13 +12877,13 @@ pub struct ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -11613,9 +12892,9 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.conditionalDelete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.conditionalUpdate", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); params.push(("type", self._type_.to_string())); for &field in ["alt", "parent", "type"].iter() { @@ -11662,806 +12941,6 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the FHIR store this resource belongs to. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The FHIR resource type to delete, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - /// - /// Sets the *type* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> { - self._type_ = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// RetrieveFrames returns instances associated with the given study, series, -/// SOP Instance UID and frame numbers. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_series_instances_frames_retrieve_frames("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.frames.retrieveFrames", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveFrames DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/frames/{frame_list}`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceFrameRetrieveFrameCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// SearchForSeries returns a list of matching series. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. -/// -/// A builder for the *locations.datasets.dicomStores.searchForSeries* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_search_for_series("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.searchForSeries", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the SearchForSeries DICOMweb request(e.g., `series` or - /// `studies/{study_uid}/series`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Returns permissions that a caller has on the specified resource. -/// If the resource does not exist, this will return an empty set of -/// permissions, not a NOT_FOUND error. -/// -/// Note: This operation is designed to be used for building permission-aware -/// UIs and command-line tools, not for authorization checking. This operation -/// may "fail open" without warning. -/// -/// A builder for the *locations.datasets.testIamPermissions* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::TestIamPermissionsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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_datasets_test_iam_permissions(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetTestIamPermissionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: TestIamPermissionsRequest, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetTestIamPermissionCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.testIamPermissions", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:testIamPermissions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); let mut request_value_reader = { @@ -12492,7 +12971,7 @@ impl<'a, C, A> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> where C: Bo request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) @@ -12553,644 +13032,33 @@ impl<'a, C, A> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> where C: Bo /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> { + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The resource for which the policy detail is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists all the messages in the given HL7v2 store with support for filtering. -/// -/// A builder for the *locations.datasets.hl7V2Stores.messages.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_hl7_v2_stores_messages_list("parent") -/// .page_token("sit") -/// .page_size(-26) -/// .order_by("diam") -/// .filter("rebum.") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _page_token: Option, - _page_size: Option, - _order_by: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListMessagesResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/messages"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the HL7v2 store to retrieve messages from. + /// The name of the FHIR store this resource belongs to. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// The next_page_token value returned from the previous List request, if any. + /// The FHIR resource type to update, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + /// Must match the resource type in the provided content. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Limit on the number of messages to return in a single response. - /// If zero the default page size of 100 is used. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Orders messages returned by the specified order_by clause. - /// Syntax: https://cloud.google.com/apis/design/design_patterns#sorting_order - /// - /// Fields available for ordering are: - /// - /// * `send_time` - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// Restricts messages returned to those matching a filter. Syntax: - /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings - /// - /// Fields/functions available for filtering are: - /// - /// * `message_type`, from the MSH-9 segment; for example - /// `NOT message_type = "ADT"` - /// * `send_date` or `sendDate`, the YYYY-MM-DD date the message was sent in - /// the dataset's time_zone, from the MSH-7 segment; for example - /// `send_date < "2017-01-02"` - /// * `send_time`, the timestamp of when the message was sent, using the - /// RFC3339 time format for comparisons, from the MSH-7 segment; for example - /// `send_time < "2017-01-02T00:00:00-05:00"` - /// * `send_facility`, the care center that the message came from, from the - /// MSH-4 segment; for example `send_facility = "ABC"` - /// * `HL7RegExp(expr)`, which does regular expression matching of `expr` - /// against the message payload using re2 (http://code.google.com/p/re2/) - /// syntax; for example `HL7RegExp("^.*\|.*\|EMERG")` - /// * `PatientId(value, type)`, which matches if the message lists a patient - /// having an ID of the given value and type in the PID-2, PID-3, or PID-4 - /// segments; for example `PatientId("123456", "MRN")` - /// * `labels.x`, a string value of the label with key `x` as set using the - /// Message.labels - /// map, for example `labels."priority"="high"`. The operator `:*` can be used - /// to assert the existence of a label, for example `labels."priority":*`. - /// - /// Limitations on conjunctions: - /// - /// * Negation on the patient ID function or the labels field is not - /// supported, for example these queries are invalid: - /// `NOT PatientId("123456", "MRN")`, `NOT labels."tag1":*`, - /// `NOT labels."tag2"="val2"`. - /// * Conjunction of multiple patient ID functions is not supported, for - /// example this query is invalid: - /// `PatientId("123456", "MRN") AND PatientId("456789", "MRN")`. - /// * Conjunction of multiple labels fields is also not supported, for - /// example this query is invalid: `labels."tag1":* AND labels."tag2"="val2"`. - /// * Conjunction of one patient ID function, one labels field and conditions - /// on other fields is supported, for example this query is valid: - /// `PatientId("123456", "MRN") AND labels."tag1":* AND message_type = "ADT"`. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists information about the supported locations for this service. -/// -/// A builder for the *locations.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_list("name") -/// .page_token("sadipscing") -/// .page_size(-76) -/// .filter("sadipscing") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _page_token: Option, - _page_size: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListLocationsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/locations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource that owns the locations collection, if applicable. - /// - /// Sets the *name* path property to the given value. + /// Sets the *type* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The standard list page token. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The standard list page size. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The standard list filter. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { + self._type_ = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -13199,7 +13067,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13224,7 +13092,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13244,273 +13112,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the access control policy for a resource. -/// Returns an empty policy if the resource exists and does not have a policy -/// set. -/// -/// A builder for the *locations.datasets.fhirStores.getIamPolicy* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_get_iam_policy("resource") -/// .options_requested_policy_version(-96) -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _resource: String, - _options_requested_policy_version: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.getIamPolicy", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - if let Some(value) = self._options_requested_policy_version { - params.push(("options.requestedPolicyVersion", value.to_string())); - } - for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. - /// - /// Sets the *options.requested policy version* query property to the given value. - pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { - self._options_requested_policy_version = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirConditionalUpdateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13556,7 +13158,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> where C /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_datasets_hl7_v2_stores_create(req, "parent") -/// .hl7_v2_store_id("duo") +/// .hl7_v2_store_id("et") /// .doit(); /// # } /// ``` @@ -13814,1664 +13416,9 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreCreateCall<'a, C, A> where C: Bor } -/// RetrieveStudy returns all instances within the given study. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.retrieveStudy* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_retrieve_study("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveStudy DICOMweb request (e.g., - /// `studies/{study_id}`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the configuration of the specified FHIR store. -/// -/// A builder for the *locations.datasets.fhirStores.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, FhirStore)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the FHIR store to get. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the access control policy for a resource. -/// Returns an empty policy if the resource exists and does not have a policy -/// set. -/// -/// A builder for the *locations.datasets.getIamPolicy* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_get_iam_policy("resource") -/// .options_requested_policy_version(-45) -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _resource: String, - _options_requested_policy_version: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.getIamPolicy", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - if let Some(value) = self._options_requested_policy_version { - params.push(("options.requestedPolicyVersion", value.to_string())); - } - for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. - /// - /// Sets the *options.requested policy version* query property to the given value. - pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> { - self._options_requested_policy_version = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// StoreInstances stores DICOM instances associated with study instance unique -/// identifiers (SUID). See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. -/// -/// A builder for the *locations.datasets.dicomStores.studies.storeInstances* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_dicom_stores_studies_store_instances(req, "parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: HttpBody, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.storeInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the StoreInstances DICOMweb request (e.g., - /// `studies/[{study_id}]`). Note that the `study_uid` is optional. - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyStoreInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Update the message. -/// -/// A builder for the *locations.datasets.hl7V2Stores.messages.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::Message; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Message::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_datasets_hl7_v2_stores_messages_patch(req, "name") -/// .update_mask("sanctus") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: Message, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Message)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Message) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Resource name of the Message, of the form - /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. - /// Assigned by the server. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The update mask applies to the resource. For the `FieldMask` definition, - /// see - /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - /// Only the `labels` field is allowed to be updated. - /// The labels in the request will be merged with the existing set of labels. - /// Existing labels with the same keys will be updated. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessagePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Imports data into the DICOM store by copying it from the specified source. -/// For errors, the Operation will be populated with error details (in the form -/// of ImportDicomDataErrorDetails in error.details), which will hold -/// finer-grained error information. -/// The metadata field type is -/// OperationMetadata. -/// -/// A builder for the *locations.datasets.dicomStores.import* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::ImportDicomDataRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ImportDicomDataRequest::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_datasets_dicom_stores_import(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreImportCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: ImportDicomDataRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreImportCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.import", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:import"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ImportDicomDataRequest) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the DICOM store resource into which the data is imported (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// DeleteSeries deletes all instances within the given study and series. -/// Delete requests are equivalent to the GET requests specified in the WADO-RS -/// standard. +/// Delete requests are equivalent to the GET requests specified in the +/// Retrieve transaction. /// /// A builder for the *locations.datasets.dicomStores.studies.series.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -15648,8 +13595,8 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryDeleteCall<'a, C, A> whe } - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -15659,8 +13606,8 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryDeleteCall<'a, C, A> whe self._parent = new_value.to_string(); self } - /// The path of the DeleteSeries request (e.g., - /// `studies/{study_id}/series/{series_id}`). + /// The path of the DeleteSeries request. For example, + /// `studies/{study_uid}/series/{series_uid}`. /// /// Sets the *dicom web path* path property to the given value. /// @@ -15733,839 +13680,6 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryDeleteCall<'a, C, A> whe } -/// Deletes the specified FHIR store and removes all resources within it. -/// -/// A builder for the *locations.datasets.fhirStores.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the FHIR store to delete. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists operations that match the specified filter in the request. If the -/// server doesn't support this method, it returns `UNIMPLEMENTED`. -/// -/// NOTE: the `name` binding allows API services to override the binding -/// to use different resource name schemes, such as `users/*/operations`. To -/// override the binding, API services can add a binding such as -/// `"/v1/{name=users/*}/operations"` to their service configuration. -/// For backwards compatibility, the default name includes the operations -/// collection id, however overriding users must ensure the name binding -/// is the parent resource, without the operations collection id. -/// -/// A builder for the *locations.datasets.operations.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_operations_list("name") -/// .page_token("sadipscing") -/// .page_size(-66) -/// .filter("dolore") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetOperationListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _page_token: Option, - _page_size: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetOperationListCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.operations.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/operations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation's parent resource. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetOperationListCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The standard list page token. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetOperationListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The standard list page size. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetOperationListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The standard list filter. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetOperationListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetOperationListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetOperationListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetOperationListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new DICOM store within the parent dataset. -/// -/// A builder for the *locations.datasets.dicomStores.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::DicomStore; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DicomStore::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_datasets_dicom_stores_create(req, "parent") -/// .dicom_store_id("sed") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: DicomStore, - _parent: String, - _dicom_store_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DicomStore)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._dicom_store_id { - params.push(("dicomStoreId", value.to_string())); - } - for &field in ["alt", "parent", "dicomStoreId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomStores"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: DicomStore) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the dataset this DICOM store belongs to. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The ID of the DICOM store that is being created. - /// Any string value up to 256 characters in length. - /// - /// Sets the *dicom store id* query property to the given value. - pub fn dicom_store_id(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { - self._dicom_store_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates a new dataset containing de-identified data from the source /// dataset. The metadata field type /// is OperationMetadata. @@ -16573,8 +13687,15 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> where C: Bor /// response field type is /// DeidentifySummary. /// If errors occur, +/// error /// details field type is /// DeidentifyErrorDetails. +/// The LRO result may still be successful if de-identification fails for some +/// DICOM instances. The new de-identified dataset will not contain these +/// failed resources. Failed resource totals are tracked in +/// DeidentifySummary.failure_resource_count. +/// Error details are also logged to Stackdriver Logging. For more information, +/// see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). /// /// A builder for the *locations.datasets.deidentify* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -16780,8 +13901,8 @@ impl<'a, C, A> ProjectLocationDatasetDeidentifyCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// Source dataset resource name. (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`). + /// Source dataset resource name. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. /// /// Sets the *source dataset* path property to the given value. /// @@ -17104,305 +14225,6 @@ impl<'a, C, A> ProjectLocationDatasetOperationGetCall<'a, C, A> where C: BorrowM } -/// Updates the entire contents of a resource. -/// -/// Implements the FHIR standard [update -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#update). -/// -/// If the specified resource does -/// not exist and the FHIR store has -/// enable_update_create set, creates the -/// resource with the client-specified ID. -/// -/// The request body must contain a JSON-encoded FHIR resource, and the request -/// headers must contain `Content-Type: application/fhir+json`. The resource -/// must contain an `id` element having an identical value to the ID in the -/// REST path of the request. -/// -/// On success, the response body will contain a JSON-encoded representation -/// of the updated resource, including the server-assigned version ID. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.update* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_update(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: HttpBody, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the resource to update. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Deletes the specified health dataset and all data contained in the dataset. /// Deleting a dataset does not affect the sources from which the dataset was /// imported (if any). @@ -17580,8 +14402,8 @@ impl<'a, C, A> ProjectLocationDatasetDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationDatasetDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_hl7_v2_stores_messages_list("parent") +/// .view("sit") +/// .page_token("vero") +/// .page_size(-28) +/// .order_by("rebum.") +/// .filter("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _view: Option, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListMessagesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "view", "pageToken", "pageSize", "orderBy", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/messages"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the HL7v2 store to retrieve messages from. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Specifies the parts of the Message to return in the response. + /// When unspecified, equivalent to BASIC. Setting this to anything other than + /// BASIC with a `page_size` larger than the default can generate a large + /// response, which impacts the performance of this method. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// The next_page_token value returned from the previous List request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Limit on the number of messages to return in a single response. + /// If zero the default page size of 100 is used. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Orders messages returned by the specified order_by clause. + /// Syntax: https://cloud.google.com/apis/design/design_patterns#sorting_order + /// + /// Fields available for ordering are: + /// + /// * `send_time` + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// Restricts messages returned to those matching a filter. Syntax: + /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings + /// + /// Fields/functions available for filtering are: + /// + /// * `message_type`, from the MSH-9.1 field. For example, + /// `NOT message_type = "ADT"`. + /// * `send_date` or `sendDate`, the YYYY-MM-DD date the message was sent in + /// the dataset's time_zone, from the MSH-7 segment. For example, + /// `send_date < "2017-01-02"`. + /// * `send_time`, the timestamp when the message was sent, using the + /// RFC3339 time format for comparisons, from the MSH-7 segment. For example, + /// `send_time < "2017-01-02T00:00:00-05:00"`. + /// * `send_facility`, the care center that the message came from, from the + /// MSH-4 segment. For example, `send_facility = "ABC"`. + /// * `PatientId(value, type)`, which matches if the message lists a patient + /// having an ID of the given value and type in the PID-2, PID-3, or PID-4 + /// segments. For example, `PatientId("123456", "MRN")`. + /// * `labels.x`, a string value of the label with key `x` as set using the + /// Message.labels + /// map. For example, `labels."priority"="high"`. The operator `:*` can be used + /// to assert the existence of a label. For example, `labels."priority":*`. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// SearchForInstances returns a list of matching instances. See /// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. /// @@ -17832,8 +14996,8 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForInstanceCall<'a, C, } - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. /// /// Sets the *parent* path property to the given value. /// @@ -17843,9 +15007,9 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForInstanceCall<'a, C, self._parent = new_value.to_string(); self } - /// The path of the SearchForInstancesRequest DICOMweb request (e.g., - /// `instances` or `series/{series_uid}/instances` or - /// `studies/{study_uid}/instances`). + /// The path of the SearchForInstancesRequest DICOMweb request. For example, + /// `instances`, `series/{series_uid}/instances`, or + /// `studies/{study_uid}/instances`. /// /// Sets the *dicom web path* path property to the given value. /// @@ -17918,9 +15082,12 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForInstanceCall<'a, C, } -/// Updates dataset metadata. +/// RetrieveInstanceMetadata returns instance associated with the given study, +/// series, and SOP Instance UID presented as metadata with the bulk data +/// removed. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. /// -/// A builder for the *locations.datasets.patch* method supported by a *project* resource. +/// A builder for the *locations.datasets.dicomStores.studies.series.instances.retrieveMetadata* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -17932,7 +15099,545 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForInstanceCall<'a, C, /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::Dataset; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_series_instances_retrieve_metadata("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveInstanceMetadata DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/metadata`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the specified DICOM store. +/// +/// A builder for the *locations.datasets.dicomStores.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DicomStore)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource name of the DICOM store to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Executes all the requests in the given Bundle. +/// +/// Implements the FHIR standard batch/transaction interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#transaction), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)). +/// +/// Supports all interactions within a bundle, except search. This method +/// accepts Bundles of type `batch` and `transaction`, processing them +/// according to the batch processing rules +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) +/// and transaction processing rules +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). +/// +/// The request body must contain a JSON-encoded FHIR `Bundle` resource, and +/// the request headers must contain `Content-Type: application/fhir+json`. +/// +/// For a batch bundle or a successful transaction the response body will +/// contain a JSON-encoded representation of a `Bundle` resource of type +/// `batch-response` or `transaction-response` containing one entry for each +/// entry in the request, with the outcome of processing the entry. In the +/// case of an error for a transaction bundle, the response body will contain +/// a JSON-encoded `OperationOutcome` resource describing the reason for the +/// error. If the request cannot be mapped to a valid API method on a FHIR +/// store, a generic GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.executeBundle* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -17946,31 +15651,857 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForInstanceCall<'a, C, /// // 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 = Dataset::default(); +/// let mut req = HttpBody::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_datasets_patch(req, "name") -/// .update_mask("gubergren") +/// let result = hub.projects().locations_datasets_fhir_stores_fhir_execute_bundle(req, "parent") /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetPatchCall<'a, C, A> +pub struct ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, - _request: Dataset, - _name: String, - _update_mask: Option, + _request: HttpBody, + _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the FHIR store in which this bundle will be executed. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new DICOM store within the parent dataset. +/// +/// A builder for the *locations.datasets.dicomStores.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::DicomStore; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DicomStore::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_datasets_dicom_stores_create(req, "parent") +/// .dicom_store_id("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: DicomStore, + _parent: String, + _dicom_store_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DicomStore)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._dicom_store_id { + params.push(("dicomStoreId", value.to_string())); + } + for &field in ["alt", "parent", "dicomStoreId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomStores"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DicomStore) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the dataset this DICOM store belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The ID of the DICOM store that is being created. + /// Any string value up to 256 characters in length. + /// + /// Sets the *dicom store id* query property to the given value. + pub fn dicom_store_id(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { + self._dicom_store_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// RetrieveStudyMetadata returns instance associated with the given study +/// presented as metadata with the bulk data removed. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. +/// +/// A builder for the *locations.datasets.dicomStores.studies.retrieveMetadata* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_retrieve_metadata("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveStudyMetadata DICOMweb request. For example, + /// `studies/{study_uid}/metadata`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets any metadata associated with a dataset. +/// +/// A builder for the *locations.datasets.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -17983,14 +16514,1447 @@ impl<'a, C, A> ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } } - for &field in ["alt", "name", "updateMask"].iter() { + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the dataset to read. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the specified HL7v2 store. +/// +/// A builder for the *locations.datasets.hl7V2Stores.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_hl7_v2_stores_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Hl7V2Store)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource name of the HL7v2 store to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// StoreInstances stores DICOM instances associated with study instance unique +/// identifiers (SUID). See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. +/// +/// A builder for the *locations.datasets.dicomStores.storeInstances* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_dicom_stores_store_instances(req, "parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: HttpBody, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.storeInstances", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the StoreInstances DICOMweb request. For example, + /// `studies/[{study_uid}]`. Note that the `study_uid` is optional. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// De-identifies data from the source store and writes it to the destination +/// store. The metadata field type +/// is OperationMetadata. +/// If the request is successful, the +/// response field type is +/// DeidentifyFhirStoreSummary. If errors occur, +/// error +/// details field type is +/// DeidentifyErrorDetails. +/// Errors are also logged to Stackdriver +/// (see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging)). +/// +/// A builder for the *locations.datasets.fhirStores.deidentify* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::DeidentifyFhirStoreRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DeidentifyFhirStoreRequest::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_datasets_fhir_stores_deidentify(req, "sourceStore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: DeidentifyFhirStoreRequest, + _source_store: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.deidentify", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("sourceStore", self._source_store.to_string())); + for &field in ["alt", "sourceStore"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+sourceStore}:deidentify"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sourceStore}", "sourceStore")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sourceStore"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DeidentifyFhirStoreRequest) -> ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> { + self._request = new_value; + self + } + /// Source FHIR store resource name. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + /// + /// Sets the *source store* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn source_store(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> { + self._source_store = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreDeidentifyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the versions of a resource (including the current version and +/// deleted versions) from the FHIR store. +/// +/// Implements the per-resource form of the FHIR standard history interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). +/// +/// On success, the response body will contain a JSON-encoded representation +/// of a `Bundle` resource of type `history`, containing the version history +/// sorted from most recent to oldest versions. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.history* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_fhir_history("name") +/// ._since("takimata") +/// ._page_token("At") +/// ._count(-86) +/// ._at("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + __since: Option, + __page_token: Option, + __count: Option, + __at: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.history", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self.__since { + params.push(("_since", value.to_string())); + } + if let Some(value) = self.__page_token { + params.push(("_page_token", value.to_string())); + } + if let Some(value) = self.__count { + params.push(("_count", value.to_string())); + } + if let Some(value) = self.__at { + params.push(("_at", value.to_string())); + } + for &field in ["alt", "name", "_since", "_page_token", "_count", "_at"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/_history"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the resource to retrieve. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Only include resource versions that were created at or after the given + /// instant in time. The instant in time uses the format + /// YYYY-MM-DDThh:mm:ss.sss+zz:zz (for example 2015-02-07T13:28:17.239+02:00 or + /// 2017-01-01T00:00:00Z). The time must be specified to the second and + /// include a time zone. + /// + /// Sets the *_since* query property to the given value. + pub fn _since(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + self.__since = Some(new_value.to_string()); + self + } + /// Used to retrieve the first, previous, next, or last page of resource + /// versions when using pagination. Value should be set to the value of + /// `_page_token` set in next or previous page links' URLs. Next and previous + /// page are returned in the response bundle's links field, where + /// `link.relation` is "previous" or "next". + /// + /// Omit `_page_token` if no previous request has been made. + /// + /// Sets the *_page_token* query property to the given value. + pub fn _page_token(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + self.__page_token = Some(new_value.to_string()); + self + } + /// The maximum number of search results on a page. Defaults to 1000. + /// + /// Sets the *_count* query property to the given value. + pub fn _count(mut self, new_value: i32) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + self.__count = Some(new_value); + self + } + /// Only include resource versions that were current at some point during the + /// time period specified in the date time value. The date parameter format is + /// yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm] + /// + /// Clients may specify any of the following: + /// + /// * An entire year: `_at=2019` + /// * An entire month: `_at=2019-01` + /// * A specific day: `_at=2019-01-20` + /// * A specific second: `_at=2018-12-31T23:59:58Z` + /// + /// Sets the *_at* query property to the given value. + pub fn _at(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + self.__at = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirHistoryCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates part of an existing resource by applying the operations specified +/// in a [JSON Patch](http://jsonpatch.com/) document. +/// +/// Implements the FHIR standard patch interaction +/// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). +/// +/// DSTU2 doesn't define a patch method, but the server supports it in the same +/// way it supports STU3. +/// +/// The request body must contain a JSON Patch document, and the request +/// headers must contain `Content-Type: application/json-patch+json`. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of the updated resource, including the server-assigned version ID. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: HttpBody, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -18125,37 +18089,27 @@ impl<'a, C, A> ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut ProjectLocationDatasetPatchCall<'a, C, A> { + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { self._request = new_value; self } - /// Output only. Resource name of the dataset, of the form - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + /// The name of the resource to update. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetPatchCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { self._name = new_value.to_string(); self } - /// The update mask applies to the resource. For the `FieldMask` definition, - /// see - /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18180,7 +18134,7 @@ impl<'a, C, A> ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationDatasetPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18200,7 +18154,7 @@ impl<'a, C, A> ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationDatasetPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -18212,10 +18166,10 @@ impl<'a, C, A> ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, @@ -18255,13 +18209,13 @@ pub struct ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -18270,8 +18224,8 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); params.push(("dicomWebPath", self._dicom_web_path.to_string())); @@ -18337,7 +18291,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -18390,25 +18344,22 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> } - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// The path of the SearchForSeries DICOMweb request(e.g., `series` or - /// `studies/{study_uid}/series`). + /// The path of the DeleteStudy request. For example, `studies/{study_uid}`. /// /// Sets the *dicom web path* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { self._dicom_web_path = new_value.to_string(); self } @@ -18418,7 +18369,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18443,7 +18394,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18463,7 +18414,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -18477,11 +18428,15 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> /// Gets the contents of a FHIR resource. /// -/// Implements the FHIR standard [read -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#read). +/// Implements the FHIR standard read interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). /// -/// Also supports the FHIR standard [conditional read -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#cread) +/// Also supports the FHIR standard conditional read interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) /// specified by supplying an `If-Modified-Since` header with a date/time value /// or an `If-None-Match` header with an ETag value. /// @@ -18738,6 +18693,4224 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirReadCall<'a, C, A> where C: Bo } +/// Updates the HL7v2 store. +/// +/// A builder for the *locations.datasets.hl7V2Stores.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::Hl7V2Store; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Hl7V2Store::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_datasets_hl7_v2_stores_patch(req, "name") +/// .update_mask("sed") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: Hl7V2Store, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Hl7V2Store)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Hl7V2Store) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. Resource name of the HL7v2 store, of the form + /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The update mask applies to the resource. For the `FieldMask` definition, + /// see + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StorePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new health dataset. Results are returned through the +/// Operation interface which returns either an +/// `Operation.response` which contains a Dataset or +/// `Operation.error`. The metadata +/// field type is OperationMetadata. +/// A Google Cloud Platform project can contain up to 500 datasets across all +/// regions. +/// +/// A builder for the *locations.datasets.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::Dataset; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Dataset::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_datasets_create(req, "parent") +/// .dataset_id("sit") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: Dataset, + _parent: String, + _dataset_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._dataset_id { + params.push(("datasetId", value.to_string())); + } + for &field in ["alt", "parent", "datasetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/datasets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Dataset) -> ProjectLocationDatasetCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the project where the server creates the dataset. For + /// example, `projects/{project_id}/locations/{location_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The ID of the dataset that is being created. + /// The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + /// + /// Sets the *dataset id* query property to the given value. + pub fn dataset_id(mut self, new_value: &str) -> ProjectLocationDatasetCreateCall<'a, C, A> { + self._dataset_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes FHIR resources that match a search query. +/// +/// Implements the FHIR standard conditional delete interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.12.1), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.13.1), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#3.1.0.7.1)). +/// If multiple resources match, all of them will be deleted. +/// +/// Search terms are provided as query parameters following the same pattern as +/// the search method. +/// +/// Note: Unless resource versioning is disabled by setting the +/// disable_resource_versioning flag +/// on the FHIR store, the deleted resources will be moved to a history +/// repository that can still be retrieved through vread +/// and related methods, unless they are removed by the +/// purge method. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.conditionalDelete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_fhir_conditional_delete("parent", "type") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _type_: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.conditionalDelete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("type", self._type_.to_string())); + for &field in ["alt", "parent", "type"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/{+type}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+type}", "type")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["type", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the FHIR store this resource belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The FHIR resource type to delete, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + /// + /// Sets the *type* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> { + self._type_ = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirConditionalDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// SearchForSeries returns a list of matching series. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. +/// +/// A builder for the *locations.datasets.dicomStores.searchForSeries* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_search_for_series("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.searchForSeries", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the SearchForSeries DICOMweb request. For example, `series` or + /// `studies/{study_uid}/series`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreSearchForSeryCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// RetrieveStudy returns all instances within the given study. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. +/// +/// A builder for the *locations.datasets.dicomStores.studies.retrieveStudy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_retrieve_study("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.retrieveStudy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveStudy DICOMweb request. For example, + /// `studies/{study_uid}`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveStudyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// RetrieveInstance returns instance associated with the given study, series, +/// and SOP Instance UID. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. +/// +/// A builder for the *locations.datasets.dicomStores.studies.series.instances.retrieveInstance* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_series_instances_retrieve_instance("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveInstance DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *locations.datasets.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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_datasets_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the configuration of the specified FHIR store. +/// +/// A builder for the *locations.datasets.fhirStores.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FhirStore)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource name of the FHIR store to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified DICOM store and removes all images that are contained +/// within it. +/// +/// A builder for the *locations.datasets.dicomStores.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource name of the DICOM store to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Import resources to the FHIR store by loading data from the specified +/// sources. This method is optimized to load large quantities of data using +/// import semantics that ignore some FHIR store configuration options and are +/// not suitable for all use cases. It is primarily intended to load data into +/// an empty FHIR store that is not being used by other clients. In cases +/// where this method is not appropriate, consider using ExecuteBundle to +/// load data. +/// +/// Every resource in the input must contain a client-supplied ID, and will be +/// stored using that ID regardless of the +/// enable_update_create setting on the FHIR +/// store. +/// +/// The import process does not enforce referential integrity, regardless of +/// the +/// disable_referential_integrity +/// setting on the FHIR store. This allows the import of resources with +/// arbitrary interdependencies without considering grouping or ordering, but +/// if the input data contains invalid references or if some resources fail to +/// be imported, the FHIR store might be left in a state that violates +/// referential integrity. +/// +/// The import process does not trigger PubSub notification or BigQuery +/// streaming update, regardless of how those are configured on the FHIR store. +/// +/// If a resource with the specified ID already exists, the most recent +/// version of the resource is overwritten without creating a new historical +/// version, regardless of the +/// disable_resource_versioning +/// setting on the FHIR store. If transient failures occur during the import, +/// it is possible that successfully imported resources will be overwritten +/// more than once. +/// +/// The import operation is idempotent unless the input data contains multiple +/// valid resources with the same ID but different contents. In that case, +/// after the import completes, the store will contain exactly one resource +/// with that ID but there is no ordering guarantee on which version of the +/// contents it will have. The operation result counters do not count +/// duplicate IDs as an error and will count one success for each resource in +/// the input, which might result in a success count larger than the number +/// of resources in the FHIR store. This often occurs when importing data +/// organized in bundles produced by Patient-everything +/// where each bundle contains its own copy of a resource such as Practitioner +/// that might be referred to by many patients. +/// +/// If some resources fail to import, for example due to parsing errors, +/// successfully imported resources are not rolled back. +/// +/// The location and format of the input data is specified by the parameters +/// below. Note that if no format is specified, this method assumes the +/// `BUNDLE` format. When using the `BUNDLE` format this method ignores the +/// `Bundle.type` field, except that `history` bundles are rejected, and does +/// not apply any of the bundle processing semantics for batch or transaction +/// bundles. Unlike in ExecuteBundle, transaction bundles are not executed +/// as a single transaction and bundle-internal references are not rewritten. +/// The bundle is treated as a collection of resources to be written as +/// provided in `Bundle.entry.resource`, ignoring `Bundle.entry.request`. As +/// an example, this allows the import of `searchset` bundles produced by a +/// FHIR search or +/// Patient-everything operation. +/// +/// This method returns an Operation that can +/// be used to track the status of the import by calling +/// GetOperation. +/// +/// Immediate fatal errors appear in the +/// error field, errors are also logged +/// to Stackdriver (see [Viewing +/// logs](/healthcare/docs/how-tos/stackdriver-logging)). Otherwise, when the +/// operation finishes, a detailed response of type ImportResourcesResponse +/// is returned in the response field. +/// The metadata field type for this +/// operation is OperationMetadata. +/// +/// A builder for the *locations.datasets.fhirStores.import* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::ImportResourcesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ImportResourcesRequest::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_datasets_fhir_stores_import(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: ImportResourcesRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreImportCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:import"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ImportResourcesRequest) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the FHIR store to import FHIR resources to. The name should be + /// in the format of + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// SearchForInstances returns a list of matching instances. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. +/// +/// A builder for the *locations.datasets.dicomStores.searchForInstances* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_search_for_instances("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.searchForInstances", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the SearchForInstancesRequest DICOMweb request. For example, + /// `instances`, `series/{series_uid}/instances`, or + /// `studies/{study_uid}/instances`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// If a resource is found based on the search criteria specified in the query +/// parameters, updates part of that resource by applying the operations +/// specified in a [JSON Patch](http://jsonpatch.com/) document. +/// +/// Implements the FHIR standard conditional patch interaction +/// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). +/// +/// DSTU2 doesn't define a conditional patch method, but the server supports it +/// in the same way it supports STU3. +/// +/// Search terms are provided as query parameters following the same pattern as +/// the search method. +/// +/// If the search criteria identify more than one match, the request will +/// return a `412 Precondition Failed` error. +/// +/// The request body must contain a JSON Patch document, and the request +/// headers must contain `Content-Type: application/json-patch+json`. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of the updated resource, including the server-assigned version ID. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.conditionalPatch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_conditional_patch(req, "parent", "type") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: HttpBody, + _parent: String, + _type_: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.conditionalPatch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("type", self._type_.to_string())); + for &field in ["alt", "parent", "type"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/{+type}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+type}", "type")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["type", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the FHIR store this resource belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The FHIR resource type to update, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + /// + /// Sets the *type* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { + self._type_ = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirConditionalPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the N most recent `Observation` resources for a subject matching +/// search criteria specified as query parameters, grouped by +/// `Observation.code`, sorted from most recent to oldest. +/// +/// Implements the FHIR extended operation Observation-lastn +/// ([STU3](http://hl7.org/implement/standards/fhir/STU3/observation-operations.html#lastn), +/// [R4](http://hl7.org/implement/standards/fhir/R4/observation-operations.html#lastn)). +/// +/// DSTU2 doesn't define the Observation-lastn method, but the server supports +/// it the same way it supports STU3. +/// +/// Search terms are provided as query parameters following the same pattern as +/// the search method. The following search parameters must +/// be provided: +/// +/// ````text +/// - `subject` or `patient` to specify a subject for the Observation. +/// - `code`, `category` or any of the composite parameters that include +/// `code`. +/// ```` +/// +/// Any other valid Observation search parameters can also be provided. This +/// operation accepts an additional query parameter `max`, which specifies N, +/// the maximum number of Observations to return from each group, with a +/// default of 1. +/// +/// Searches with over 1000 results are rejected. Results are counted before +/// grouping and limiting the results with `max`. To stay within the limit, +/// constrain these searches using Observation search parameters such as +/// `_lastUpdated` or `date`. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of a `Bundle` resource of type `searchset`, containing the results of the +/// operation. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.Observation-lastn* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_fhir__observation_lastn("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.Observation-lastn", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/Observation/$lastn"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the FHIR store to retrieve resources from. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// RetrieveSeries returns all instances within the given study and series. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. +/// +/// A builder for the *locations.datasets.dicomStores.studies.series.retrieveSeries* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_series_retrieve_series("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the RetrieveSeries DICOMweb request. For example, + /// `studies/{study_uid}/series/{series_uid}`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the HL7v2 stores in the given dataset. +/// +/// A builder for the *locations.datasets.hl7V2Stores.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_hl7_v2_stores_list("parent") +/// .page_token("accusam") +/// .page_size(-13) +/// .filter("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListHl7V2StoresResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/hl7V2Stores"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the dataset. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token value returned from the previous List request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Limit on the number of HL7v2 stores to return in a single response. + /// If zero the default page size of 100 is used. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Restricts stores returned to those matching a filter. Syntax: + /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings + /// Only filtering on labels is supported. For example, `labels.key=value`. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns permissions that a caller has on the specified resource. /// If the resource does not exist, this will return an empty set of /// permissions, not a NOT_FOUND error. @@ -19024,8 +23197,5120 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreTestIamPermissionCall<'a, C, A> w } +/// Gets an HL7v2 message. +/// +/// A builder for the *locations.datasets.hl7V2Stores.messages.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_hl7_v2_stores_messages_get("name") +/// .view("clita") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Message)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + for &field in ["alt", "name", "view"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource name of the HL7v2 message to retrieve. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies which parts of the Message resource to return in the response. + /// When unspecified, equivalent to FULL. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Searches for resources in the given FHIR store according to criteria +/// specified as query parameters. +/// +/// Implements the FHIR standard search interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) +/// using the search semantics described in the FHIR Search specification +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), +/// [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). +/// +/// Supports three methods of search defined by the specification: +/// +/// * `GET [base]?[parameters]` to search across all resources. +/// * `GET [base]/[type]?[parameters]` to search resources of a specified +/// type. +/// * `POST [base]/[type]/_search?[parameters]` as an alternate form having +/// the same semantics as the `GET` method. +/// +/// The `GET` methods do not support compartment searches. The `POST` method +/// does not support `application/x-www-form-urlencoded` search parameters. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of a `Bundle` resource of type `searchset`, containing the results of the +/// search. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// The server's capability statement, retrieved through +/// capabilities, indicates what search parameters +/// are supported on each FHIR resource. A list of all search parameters +/// defined by the specification can be found in the FHIR Search Parameter +/// Registry +/// ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-registry.html), +/// [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter-registry.html)). +/// FHIR search parameters for DSTU2 can be found on each resource's definition +/// page. +/// +/// Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, +/// `:in`, `:not-in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. +/// +/// Supported search result parameters: `_sort`, `_count`, `_include`, +/// `_revinclude`, `_summary=text`, `_summary=data`, and `_elements`. +/// +/// The maximum number of search results returned defaults to 100, which can +/// be overridden by the `_count` parameter up to a maximum limit of 1000. If +/// there are additional results, the returned `Bundle` will contain +/// pagination links. +/// +/// Resources with a total size larger than 5MB or a field count larger than +/// 50,000 might not be fully searchable as the server might trim its generated +/// search index in those cases. +/// +/// Note: FHIR resources are indexed asynchronously, so there might be a slight +/// delay between the time a resource is created or changes and when the change +/// is reflected in search results. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.search* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::SearchResourcesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SearchResourcesRequest::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_datasets_fhir_stores_fhir_search(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: SearchResourcesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.search", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/_search"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SearchResourcesRequest) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the FHIR store to retrieve resources from. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirSearchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets information about a location. +/// +/// A builder for the *locations.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Location)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Resource name for the location. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// SearchForStudies returns a list of matching studies. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. +/// +/// A builder for the *locations.datasets.dicomStores.searchForStudies* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_search_for_studies("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.searchForStudies", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the SearchForStudies DICOMweb request. For example, `studies`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreSearchForStudyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the configuration of the specified FHIR store. +/// +/// A builder for the *locations.datasets.fhirStores.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::FhirStore; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = FhirStore::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_datasets_fhir_stores_patch(req, "name") +/// .update_mask("duo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStorePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: FhirStore, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStorePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FhirStore)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: FhirStore) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. Resource name of the FHIR store, of the form + /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The update mask applies to the resource. For the `FieldMask` definition, + /// see + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a FHIR resource. +/// +/// Implements the FHIR standard create interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), +/// which creates a new resource with a server-assigned resource ID. +/// +/// Also supports the FHIR standard conditional create interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#ccreate), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#ccreate), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#ccreate)), +/// specified by supplying an `If-None-Exist` header containing a FHIR search +/// query. If no resources match this search query, the server processes the +/// create operation as normal. +/// +/// The request body must contain a JSON-encoded FHIR resource, and the request +/// headers must contain `Content-Type: application/fhir+json`. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of the resource as it was created on the server, including the +/// server-assigned resource ID and version ID. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_create(req, "parent", "type") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: HttpBody, + _parent: String, + _type_: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("type", self._type_.to_string())); + for &field in ["alt", "parent", "type"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/{+type}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+type}", "type")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["type", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the FHIR store this resource belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The FHIR resource type to create, such as Patient or Observation. For a + /// complete list, see the FHIR Resource Index + /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), + /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), + /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). + /// Must match the resource type in the provided content. + /// + /// Sets the *type* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { + self._type_ = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *locations.datasets.annotationStores.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_annotation_stores_get_iam_policy("resource") +/// .options_requested_policy_version(-17) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _resource: String, + _options_requested_policy_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.annotationStores.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetAnnotationStoreGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes the specified HL7v2 store and removes all messages that are +/// contained within it. +/// +/// A builder for the *locations.datasets.hl7V2Stores.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_hl7_v2_stores_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource name of the HL7v2 store to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new FHIR store within the parent dataset. +/// +/// A builder for the *locations.datasets.fhirStores.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::FhirStore; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = FhirStore::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_datasets_fhir_stores_create(req, "parent") +/// .fhir_store_id("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: FhirStore, + _parent: String, + _fhir_store_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FhirStore)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._fhir_store_id { + params.push(("fhirStoreId", value.to_string())); + } + for &field in ["alt", "parent", "fhirStoreId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhirStores"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: FhirStore) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the dataset this FHIR store belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The ID of the FHIR store that is being created. + /// The string must match the following regex: `[\p{L}\p{N}_\-\.]{1,256}`. + /// + /// Sets the *fhir store id* query property to the given value. + pub fn fhir_store_id(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { + self._fhir_store_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// On success, the response body will contain a JSON-encoded representation +/// of a `Bundle` resource of type `searchset`, containing the results of the +/// operation. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.Patient-everything* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_fhir_stores_fhir__patient_everything("name") +/// .start("invidunt") +/// .end("rebum.") +/// ._page_token("Lorem") +/// ._count(-63) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _start: Option, + _end: Option, + __page_token: Option, + __count: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.Patient-everything", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._start { + params.push(("start", value.to_string())); + } + if let Some(value) = self._end { + params.push(("end", value.to_string())); + } + if let Some(value) = self.__page_token { + params.push(("_page_token", value.to_string())); + } + if let Some(value) = self.__count { + params.push(("_count", value.to_string())); + } + for &field in ["alt", "name", "start", "end", "_page_token", "_count"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/$everything"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the `Patient` resource for which the information is required. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The response includes records subsequent to the start date. If no start + /// date is provided, all records prior to the end date are in scope. + /// + /// Sets the *start* query property to the given value. + pub fn start(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { + self._start = Some(new_value.to_string()); + self + } + /// The response includes records prior to the end date. If no end date is + /// provided, all records subsequent to the start date are in scope. + /// + /// Sets the *end* query property to the given value. + pub fn end(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { + self._end = Some(new_value.to_string()); + self + } + /// Used to retrieve the next or previous page of results + /// when using pagination. Value should be set to the value of page_token set + /// in next or previous page links' urls. Next and previous page are returned + /// in the response bundle's links field, where `link.relation` is "previous" + /// or "next". + /// + /// Omit `page_token` if no previous request has been made. + /// + /// Sets the *_page_token* query property to the given value. + pub fn _page_token(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { + self.__page_token = Some(new_value.to_string()); + self + } + /// Maximum number of resources in a page. Defaults to 100. + /// + /// Sets the *_count* query property to the given value. + pub fn _count(mut self, new_value: i32) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { + self.__count = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirPatientEverythingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the health datasets in the current project. +/// +/// A builder for the *locations.datasets.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_list("parent") +/// .page_token("eirmod") +/// .page_size(-77) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDatasetsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/datasets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the project whose datasets should be listed. + /// For example, `projects/{project_id}/locations/{location_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token value returned from a previous List request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of items to return. Capped to 100 if not specified. + /// May not be larger than 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the entire contents of a resource. +/// +/// Implements the FHIR standard update interaction +/// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update), +/// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update), +/// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). +/// +/// If the specified resource does +/// not exist and the FHIR store has +/// enable_update_create set, creates the +/// resource with the client-specified ID. +/// +/// The request body must contain a JSON-encoded FHIR resource, and the request +/// headers must contain `Content-Type: application/fhir+json`. The resource +/// must contain an `id` element having an identical value to the ID in the +/// REST path of the request. +/// +/// On success, the response body will contain a JSON-encoded representation +/// of the updated resource, including the server-assigned version ID. +/// Errors generated by the FHIR store will contain a JSON-encoded +/// `OperationOutcome` resource describing the reason for the error. If the +/// request cannot be mapped to a valid API method on a FHIR store, a generic +/// GCP error might be returned instead. +/// +/// A builder for the *locations.datasets.fhirStores.fhir.update* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::HttpBody; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_update(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: HttpBody, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the resource to update. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *locations.datasets.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_get_iam_policy("resource") +/// .options_requested_policy_version(-80) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _resource: String, + _options_requested_policy_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Imports data into the DICOM store by copying it from the specified source. +/// For errors, the Operation is populated with error details (in the form +/// of ImportDicomDataErrorDetails in error.details), which hold +/// finer-grained error information. Errors are also logged to Stackdriver +/// Logging. For more information, +/// see [Viewing logs](/healthcare/docs/how-tos/stackdriver-logging). +/// The metadata field type is +/// OperationMetadata. +/// +/// A builder for the *locations.datasets.dicomStores.import* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::ImportDicomDataRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ImportDicomDataRequest::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_datasets_dicom_stores_import(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: ImportDicomDataRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreImportCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:import"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ImportDicomDataRequest) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the DICOM store resource into which the data is imported. + /// For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreImportCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED +/// +/// A builder for the *locations.datasets.hl7V2Stores.setIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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_datasets_hl7_v2_stores_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:setIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. To +/// override the binding, API services can add a binding such as +/// `"/v1/{name=users/*}/operations"` to their service configuration. +/// For backwards compatibility, the default name includes the operations +/// collection id, however overriding users must ensure the name binding +/// is the parent resource, without the operations collection id. +/// +/// A builder for the *locations.datasets.operations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_operations_list("name") +/// .page_token("nonumy") +/// .page_size(-15) +/// .filter("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/operations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// SearchForSeries returns a list of matching series. See +/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. +/// +/// A builder for the *locations.datasets.dicomStores.studies.searchForSeries* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_dicom_stores_studies_search_for_series("parent", "dicomWebPath") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _parent: String, + _dicom_web_path: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.searchForSeries", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + params.push(("dicomWebPath", self._dicom_web_path.to_string())); + for &field in ["alt", "parent", "dicomWebPath"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["dicomWebPath", "parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the DICOM store that is being accessed. For example, + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The path of the SearchForSeries DICOMweb request. For example, `series` or + /// `studies/{study_uid}/series`. + /// + /// Sets the *dicom web path* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { + self._dicom_web_path = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySearchForSeryCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates dataset metadata. +/// +/// A builder for the *locations.datasets.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// use healthcare1_beta1::Dataset; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Dataset::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_datasets_patch(req, "name") +/// .update_mask("ut") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _request: Dataset, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Dataset)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Dataset) -> ProjectLocationDatasetPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. Resource name of the dataset, of the form + /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The update mask applies to the resource. For the `FieldMask` definition, + /// see + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *locations.datasets.dicomStores.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -19305,27 +28590,11 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreSetIamPolicyCall<'a, C, A> where } -/// Retrieves the N most recent `Observation` resources for a subject matching -/// search criteria specified as query parameters, grouped by -/// `Observation.code`, sorted from most recent to oldest. -/// -/// Implements the FHIR extended operation -/// [Observation-lastn](http://hl7.org/implement/standards/fhir/STU3/observation-operations.html#lastn). -/// -/// Search terms are provided as query parameters following the same pattern as -/// the search method. This operation accepts an additional -/// query parameter `max`, which specifies N, the maximum number of -/// Observations to return from each group, with a default of 1. -/// -/// On success, the response body will contain a JSON-encoded representation -/// of a `Bundle` resource of type `searchset`, containing the results of the -/// operation. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. /// -/// A builder for the *locations.datasets.fhirStores.fhir.Observation-lastn* method supported by a *project* resource. +/// A builder for the *locations.datasets.fhirStores.getIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -19350,27 +28619,29 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreSetIamPolicyCall<'a, C, A> where /// // 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_datasets_fhir_stores_fhir__observation_lastn("parent") +/// let result = hub.projects().locations_datasets_fhir_stores_get_iam_policy("resource") +/// .options_requested_policy_version(-87) /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> +pub struct ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, - _parent: String, + _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -19379,772 +28650,14 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.Observation-lastn", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/Observation/$lastn"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the FHIR store to retrieve resources from. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirObservationLastnCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes the specified DICOM store and removes all images that are contained -/// within it. -/// -/// A builder for the *locations.datasets.dicomStores.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_delete("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the DICOM store to delete. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the contents of a version (current or historical) of a FHIR resource -/// by version ID. -/// -/// Implements the FHIR standard [vread -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#vread). -/// -/// On success, the response body will contain a JSON-encoded representation -/// of the resource. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.vread* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_fhir_vread("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.vread", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the resource version to retrieve. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirVreadCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// RetrieveInstanceMetadata returns instance associated with the given study, -/// series, and SOP Instance UID presented as metadata with the bulk data -/// removed. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.series.instances.retrieveMetadata* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_series_instances_retrieve_metadata("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveMetadata", + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.getIamPolicy", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { + params.push(("resource", self._resource.to_string())); + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -20156,536 +28669,12 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadata params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveInstanceMetadata DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}/metadata`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveMetadataCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// SearchForInstances returns a list of matching instances. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6. -/// -/// A builder for the *locations.datasets.dicomStores.searchForInstances* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_search_for_instances("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.searchForInstances", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the SearchForInstancesRequest DICOMweb request (e.g., - /// `instances` or `series/{series_uid}/instances` or - /// `studies/{study_uid}/instances`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreSearchForInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the specified DICOM store. -/// -/// A builder for the *locations.datasets.dicomStores.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DicomStore)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -20700,7 +28689,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["resource"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -20783,14 +28772,29 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow } - /// The resource name of the DICOM store to get. + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. /// - /// Sets the *name* path property to the given value. + /// Sets the *resource* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -20799,7 +28803,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -20824,7 +28828,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -20844,7 +28848,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreGetIamPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -20856,31 +28860,15 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow } -/// Executes all the requests in the given Bundle. +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. /// -/// Implements the FHIR standard [batch/transaction -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction). -/// -/// Supports all interactions within a bundle, except search. This method -/// accepts Bundles of type `batch` and `transaction`, processing them -/// according to the [batch processing -/// rules](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1) -/// and [transaction processing -/// rules](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2). -/// -/// The request body must contain a JSON-encoded FHIR `Bundle` resource, and -/// the request headers must contain `Content-Type: application/fhir+json`. -/// -/// For a batch bundle or a successful transaction the response body will -/// contain a JSON-encoded representation of a `Bundle` resource of type -/// `batch-response` or `transaction-response` containing one entry for each -/// entry in the request, with the outcome of processing the entry. In the -/// case of an error for a transaction bundle, the response body will contain -/// a JSON-encoded `OperationOutcome` resource describing the reason for the -/// error. If the request cannot be mapped to a valid API method on a FHIR -/// store, a generic GCP error might be returned instead. +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. /// -/// A builder for the *locations.datasets.fhirStores.fhir.executeBundle* method supported by a *project* resource. +/// A builder for the *locations.datasets.annotationStores.testIamPermissions* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -20892,7 +28880,7 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; +/// use healthcare1_beta1::TestIamPermissionsRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -20906,33 +28894,33 @@ impl<'a, C, A> ProjectLocationDatasetDicomStoreGetCall<'a, C, A> where C: Borrow /// // 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 = HttpBody::default(); +/// let mut req = TestIamPermissionsRequest::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_datasets_fhir_stores_fhir_execute_bundle(req, "parent") +/// let result = hub.projects().locations_datasets_annotation_stores_test_iam_permissions(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> +pub struct ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, - _request: HttpBody, - _parent: String, + _request: TestIamPermissionsRequest, + _resource: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -20941,11 +28929,11 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> wh Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.executeBundle", + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.annotationStores.testIamPermissions", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -20957,12 +28945,12 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> wh params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir"; + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:testIamPermissions"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -20977,7 +28965,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> wh } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["resource"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -21080,18 +29068,19 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> wh /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> { self._request = new_value; self } - /// Name of the FHIR store in which this bundle will be executed. + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. /// - /// Sets the *parent* path property to the given value. + /// Sets the *resource* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -21100,7 +29089,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> wh /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -21125,7 +29114,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> wh /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -21145,798 +29134,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> wh /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirExecuteBundleCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// RetrieveInstance returns instance associated with the given study, series, -/// and SOP Instance UID. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.series.instances.retrieveInstance* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_series_instances_retrieve_instance("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.retrieveInstance", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveInstance DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceRetrieveInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// RetrieveStudyMetadata returns instance associated with the given study -/// presented as metadata with the bulk data removed. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.retrieveMetadata* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_retrieve_metadata("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.retrieveMetadata", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveStudyMetadata DICOMweb request (e.g., - /// `studies/{study_id}/metadata`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyRetrieveMetadataCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// RetrieveSeries returns all instances within the given study and series. See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4. -/// -/// A builder for the *locations.datasets.dicomStores.studies.series.retrieveSeries* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_series_retrieve_series("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.retrieveSeries", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the RetrieveSeries DICOMweb request (e.g., - /// `studies/{study_id}/series/{series_id}`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryRetrieveSeryCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetAnnotationStoreTestIamPermissionCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -22242,607 +29440,9 @@ impl<'a, C, A> ProjectLocationDatasetDicomStorePatchCall<'a, C, A> where C: Borr } -/// Exports data to the specified destination by copying it from the DICOM -/// store. -/// The metadata field type is -/// OperationMetadata. +/// Deletes the specified FHIR store and removes all resources within it. /// -/// A builder for the *locations.datasets.dicomStores.export* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::ExportDicomDataRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ExportDicomDataRequest::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_datasets_dicom_stores_export(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreExportCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: ExportDicomDataRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreExportCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.export", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:export"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ExportDicomDataRequest) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { - self._request = new_value; - self - } - /// The DICOM store resource name from which the data should be exported (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreExportCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a FHIR resource. -/// -/// Implements the FHIR standard [create -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#create), -/// which creates a new resource with a server-assigned resource ID. -/// -/// Also supports the FHIR standard [conditional create -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#ccreate), -/// specified by supplying an `If-None-Exist` header containing a FHIR search -/// query. If no resources match this search query, the server processes the -/// create operation as normal. -/// -/// The request body must contain a JSON-encoded FHIR resource, and the request -/// headers must contain `Content-Type: application/fhir+json`. -/// -/// On success, the response body will contain a JSON-encoded representation -/// of the resource as it was created on the server, including the -/// server-assigned resource ID and version ID. -/// Errors generated by the FHIR store will contain a JSON-encoded -/// `OperationOutcome` resource describing the reason for the error. If the -/// request cannot be mapped to a valid API method on a FHIR store, a generic -/// GCP error might be returned instead. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_fhir_stores_fhir_create(req, "parent", "type") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: HttpBody, - _parent: String, - _type_: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("type", self._type_.to_string())); - for &field in ["alt", "parent", "type"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhir/{+type}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+type}", "type")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["type", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the FHIR store this resource belongs to. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The FHIR resource type to create, such as Patient or Observation. For a - /// complete list, see the [FHIR Resource - /// Index](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html). - /// Must match the resource type in the provided content. - /// - /// Sets the *type* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn type_(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { - self._type_ = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the specified HL7v2 store. -/// -/// A builder for the *locations.datasets.hl7V2Stores.get* method supported by a *project* resource. +/// A builder for the *locations.datasets.fhirStores.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -22867,11 +29467,11 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirCreateCall<'a, C, A> where C: /// // 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_datasets_hl7_v2_stores_get("name") +/// let result = hub.projects().locations_datasets_fhir_stores_delete("name") /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> +pub struct ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, @@ -22881,13 +29481,13 @@ pub struct ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Hl7V2Store)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -22896,8 +29496,8 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> where C: Borrow Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); for &field in ["alt", "name"].iter() { @@ -22946,545 +29546,6 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> where C: Borrow - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the HL7v2 store to get. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the FHIR stores in the given dataset. -/// -/// A builder for the *locations.datasets.fhirStores.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_list("parent") -/// .page_token("aliquyam") -/// .page_size(-67) -/// .filter("ea") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _page_token: Option, - _page_size: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreListCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListFhirStoresResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/fhirStores"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the dataset. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The next_page_token value returned from the previous List request, if any. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Limit on the number of FHIR stores to return in a single response. If zero - /// the default page size of 100 is used. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Restricts stores returned to those matching a filter. Syntax: - /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings - /// Only filtering on labels is supported, for example `labels.key=value`. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes all the historical versions of a resource (excluding the current -/// version) from the FHIR store. To remove all versions of a resource, first -/// delete the current version and then call this method. -/// -/// This is not a FHIR standard operation. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.Resource-purge* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_fhir__resource_purge("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.Resource-purge", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/$purge"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - loop { let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { Ok(token) => token, @@ -23554,13 +29615,13 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> wh } - /// The name of the resource to purge. + /// The resource name of the FHIR store to delete. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -23570,7 +29631,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> wh /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -23595,7 +29656,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> wh /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -23615,2769 +29676,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> wh /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirResourcePurgeCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the HL7v2 stores in the given dataset. -/// -/// A builder for the *locations.datasets.hl7V2Stores.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_hl7_v2_stores_list("parent") -/// .page_token("diam") -/// .page_size(-62) -/// .filter("invidunt") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _page_token: Option, - _page_size: Option, - _filter: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListHl7V2StoresResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/hl7V2Stores"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the dataset. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The next_page_token value returned from the previous List request, if any. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Limit on the number of HL7v2 stores to return in a single response. - /// If zero the default page size of 100 is used. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Restricts stores returned to those matching a filter. Syntax: - /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings - /// Only filtering on labels is supported, for example `labels.key=value`. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// DeleteInstance deletes an instance associated with the given study, series, -/// and SOP Instance UID. Delete requests are equivalent to the GET requests -/// specified in the WADO-RS standard. -/// -/// A builder for the *locations.datasets.dicomStores.studies.series.instances.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_series_instances_delete("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.series.instances.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the DeleteInstance request (e.g., - /// `studies/{study_id}/series/{series_id}/instances/{instance_id}`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudySeryInstanceDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// DeleteStudy deletes all instances within the given study. Delete requests -/// are equivalent to the GET requests specified in the WADO-RS standard. -/// -/// A builder for the *locations.datasets.dicomStores.studies.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_dicom_stores_studies_delete("parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.studies.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the DeleteStudy request (e.g., `studies/{study_id}`). - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStudyDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Import resources to the FHIR store by loading data from the specified -/// sources. Each resource must have a client-supplied ID, which is retained -/// by the server. -/// -/// The import operation is idempotent. Upon retry, the most recent data -/// (matching the client-supplied ID) is overwritten, without creating a new -/// resource version. If partial failures occur during the import, successful -/// changes are not rolled back. -/// -/// If history imports are enabled -/// (enable_history_import is set in the -/// FHIR store's configuration), you can import historical versions of a -/// resource by supplying a bundle of type `history`. The historical versions -/// in the bundle must have `lastUpdated` timestamps. If a current or -/// historical version with the supplied resource ID already exists, the -/// bundle is rejected. -/// -/// This method returns an Operation that can -/// be used to track the status of the import by calling -/// GetOperation. -/// -/// Immediate fatal errors appear in the -/// error field. -/// Otherwise, when the operation finishes, a detailed response of type -/// ImportResourcesResponse is returned in the -/// response field. -/// The metadata field type for this -/// operation is OperationMetadata. -/// -/// A builder for the *locations.datasets.fhirStores.import* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::ImportResourcesRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ImportResourcesRequest::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_datasets_fhir_stores_import(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreImportCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: ImportResourcesRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreImportCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.import", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:import"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ImportResourcesRequest) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the FHIR store to import FHIR resources to. The name should be - /// in the format of - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreImportCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the FHIR [capability -/// statement](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html) -/// for the store, which contains a description of functionality supported by -/// the server. -/// -/// Implements the FHIR standard [capabilities -/// interaction](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities). -/// -/// On success, the response body will contain a JSON-encoded representation -/// of a `CapabilityStatement` resource. -/// -/// A builder for the *locations.datasets.fhirStores.fhir.capabilities* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_fhir_stores_fhir_capabilities("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.fhir.capabilities", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}/fhir/metadata"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Name of the FHIR store to retrieve the capabilities for. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreFhirCapabilityCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets the access control policy on the specified resource. Replaces any -/// existing policy. -/// -/// A builder for the *locations.datasets.hl7V2Stores.setIamPolicy* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::SetIamPolicyRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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_datasets_hl7_v2_stores_set_iam_policy(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: SetIamPolicyRequest, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.setIamPolicy", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:setIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { - self._request = new_value; - self - } - /// REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreSetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// StoreInstances stores DICOM instances associated with study instance unique -/// identifiers (SUID). See -/// http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5. -/// -/// A builder for the *locations.datasets.dicomStores.storeInstances* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::HttpBody; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = HttpBody::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_datasets_dicom_stores_store_instances(req, "parent", "dicomWebPath") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: HttpBody, - _parent: String, - _dicom_web_path: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, HttpBody)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.dicomStores.storeInstances", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - params.push(("dicomWebPath", self._dicom_web_path.to_string())); - for &field in ["alt", "parent", "dicomWebPath"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/dicomWeb/{+dicomWebPath}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent"), ("{+dicomWebPath}", "dicomWebPath")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["dicomWebPath", "parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: HttpBody) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { - self._request = new_value; - self - } - /// The name of the DICOM store that is being accessed (e.g., - /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`). - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The path of the StoreInstances DICOMweb request (e.g., - /// `studies/[{study_id}]`). Note that the `study_uid` is optional. - /// - /// Sets the *dicom web path* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn dicom_web_path(mut self, new_value: &str) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { - self._dicom_web_path = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetDicomStoreStoreInstanceCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Sets the access control policy on the specified resource. Replaces any -/// existing policy. -/// -/// A builder for the *locations.datasets.setIamPolicy* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::SetIamPolicyRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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_datasets_set_iam_policy(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetSetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: SetIamPolicyRequest, - _resource: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetSetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.setIamPolicy", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:setIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { - self._request = new_value; - self - } - /// REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetSetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the access control policy for a resource. -/// Returns an empty policy if the resource exists and does not have a policy -/// set. -/// -/// A builder for the *locations.datasets.hl7V2Stores.getIamPolicy* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_hl7_v2_stores_get_iam_policy("resource") -/// .options_requested_policy_version(-43) -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _resource: String, - _options_requested_policy_version: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - if let Some(value) = self._options_requested_policy_version { - params.push(("options.requestedPolicyVersion", value.to_string())); - } - for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// REQUIRED: The resource for which the policy is being requested. - /// See the operation documentation for the appropriate value for this field. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); - self - } - /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. - /// - /// Sets the *options.requested policy version* query property to the given value. - pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { - self._options_requested_policy_version = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets an HL7v2 message. -/// -/// A builder for the *locations.datasets.hl7V2Stores.messages.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_datasets_hl7_v2_stores_messages_get("name") -/// .view("rebum.") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _name: String, - _view: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Message)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._view { - params.push(("view", value.to_string())); - } - for &field in ["alt", "name", "view"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the HL7v2 message to retrieve. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Specifies which parts of the Message resource should be returned - /// in the response. - /// - /// Sets the *view* query property to the given value. - pub fn view(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { - self._view = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStoreDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -26675,9 +29974,18 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreTestIamPermissionCall<'a, C, A> w } -/// Updates the configuration of the specified FHIR store. +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. /// -/// A builder for the *locations.datasets.fhirStores.patch* method supported by a *project* resource. +/// A builder for the *locations.datasets.operations.cancel* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -26689,7 +29997,7 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreTestIamPermissionCall<'a, C, A> w /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::FhirStore; +/// use healthcare1_beta1::CancelOperationRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -26703,35 +30011,33 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreTestIamPermissionCall<'a, C, A> w /// // 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 = FhirStore::default(); +/// let mut req = CancelOperationRequest::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_datasets_fhir_stores_patch(req, "name") -/// .update_mask("diam") +/// let result = hub.projects().locations_datasets_operations_cancel(req, "name") /// .doit(); /// # } /// ``` -pub struct ProjectLocationDatasetFhirStorePatchCall<'a, C, A> +pub struct ProjectLocationDatasetOperationCancelCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudHealthcare, - _request: FhirStore, + _request: CancelOperationRequest, _name: String, - _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationDatasetFhirStorePatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationDatasetOperationCancelCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationDatasetOperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, FhirStore)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -26740,14 +30046,11 @@ impl<'a, C, A> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> where C: Borro Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.fhirStores.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -26759,7 +30062,7 @@ impl<'a, C, A> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:cancel"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -26804,300 +30107,6 @@ impl<'a, C, A> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> where C: Borro request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: FhirStore) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Output only. Resource name of the FHIR store, of the form - /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The update mask applies to the resource. For the `FieldMask` definition, - /// see - /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetFhirStorePatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a message and sends a notification to the Cloud Pub/Sub topic. If -/// configured, the MLLP adapter listens to messages created by this method and -/// sends those back to the hospital. A successful response indicates the -/// message has been persisted to storage and a Cloud Pub/Sub notification has -/// been sent. Sending to the hospital by the MLLP adapter happens -/// asynchronously. -/// -/// A builder for the *locations.datasets.hl7V2Stores.messages.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; -/// use healthcare1_beta1::CreateMessageRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use healthcare1_beta1::CloudHealthcare; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = CreateMessageRequest::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_datasets_hl7_v2_stores_messages_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudHealthcare, - _request: CreateMessageRequest, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Message)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.messages.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/messages"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - loop { let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { Ok(token) => token, @@ -27176,18 +30185,18 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> where /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: CreateMessageRequest) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { + pub fn request(mut self, new_value: CancelOperationRequest) -> ProjectLocationDatasetOperationCancelCall<'a, C, A> { self._request = new_value; self } - /// The name of the dataset this message belongs to. + /// The name of the operation resource to be cancelled. /// - /// Sets the *parent* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> ProjectLocationDatasetOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -27196,7 +30205,7 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> where /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetOperationCancelCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -27221,7 +30230,7 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> where /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetOperationCancelCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -27241,7 +30250,277 @@ impl<'a, C, A> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> where /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreMessageCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *locations.datasets.hl7V2Stores.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_healthcare1_beta1 as healthcare1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use healthcare1_beta1::CloudHealthcare; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudHealthcare::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_datasets_hl7_v2_stores_get_iam_policy("resource") +/// .options_requested_policy_version(-22) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudHealthcare, + _resource: String, + _options_requested_policy_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "healthcare.projects.locations.datasets.hl7V2Stores.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1beta1/{+resource}:getIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDatasetHl7V2StoreGetIamPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/iam1-cli/Cargo.toml b/gen/iam1-cli/Cargo.toml index 728e7e7f49..f1cd117bbb 100644 --- a/gen/iam1-cli/Cargo.toml +++ b/gen/iam1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-iam1-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200319" authors = ["Sebastian Thiel "] description = "A complete library to interact with iam (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iam1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-iam1] path = "../iam1" -version = "1.0.12+20190627" +version = "1.0.13+20200319" diff --git a/gen/iam1-cli/README.md b/gen/iam1-cli/README.md index 083e0c66f9..8403bbc1a1 100644 --- a/gen/iam1-cli/README.md +++ b/gen/iam1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *iam* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *iam* API at revision *20200319*. The CLI is at version *1.0.13*. ```bash iam1 [options] @@ -58,6 +58,7 @@ iam1 [options] service-accounts-keys-delete [-p ]... [-o ] service-accounts-keys-get [-p ]... [-o ] service-accounts-keys-list [-p ]... [-o ] + service-accounts-keys-upload (-r )... [-p ]... [-o ] service-accounts-list [-p ]... [-o ] service-accounts-patch (-r )... [-p ]... [-o ] service-accounts-set-iam-policy (-r )... [-p ]... [-o ] diff --git a/gen/iam1-cli/mkdocs.yml b/gen/iam1-cli/mkdocs.yml index dd901b4a17..7129979503 100644 --- a/gen/iam1-cli/mkdocs.yml +++ b/gen/iam1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: iam v1.0.12+20190627 +site_name: iam v1.0.13+20200319 site_url: http://byron.github.io/google-apis-rs/google-iam1-cli site_description: A complete library to interact with iam (protocol v1) @@ -34,6 +34,7 @@ pages: - ['projects_service-accounts-keys-delete.md', 'Projects', 'Service Accounts Keys Delete'] - ['projects_service-accounts-keys-get.md', 'Projects', 'Service Accounts Keys Get'] - ['projects_service-accounts-keys-list.md', 'Projects', 'Service Accounts Keys List'] +- ['projects_service-accounts-keys-upload.md', 'Projects', 'Service Accounts Keys Upload'] - ['projects_service-accounts-list.md', 'Projects', 'Service Accounts List'] - ['projects_service-accounts-patch.md', 'Projects', 'Service Accounts Patch'] - ['projects_service-accounts-set-iam-policy.md', 'Projects', 'Service Accounts Set Iam Policy'] diff --git a/gen/iam1-cli/src/main.rs b/gen/iam1-cli/src/main.rs index 6cc648ab89..90b4e17e4d 100644 --- a/gen/iam1-cli/src/main.rs +++ b/gen/iam1-cli/src/main.rs @@ -69,21 +69,13 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "full-resource-name" => Some(("fullResourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "binding.role" => Some(("binding.role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "binding.members" => Some(("binding.members", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "binding.condition.title" => Some(("binding.condition.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "binding.condition.expression" => Some(("binding.condition.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "binding.condition.description" => Some(("binding.condition.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "binding.condition.location" => Some(("binding.condition.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "condition.title" => Some(("condition.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "condition.expression" => Some(("condition.expression", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "condition.description" => Some(("condition.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "condition.location" => Some(("condition.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["binding", "condition", "description", "etag", "expression", "full-resource-name", "location", "members", "policy", "role", "title", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["condition", "description", "expression", "full-resource-name", "location", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1877,6 +1869,91 @@ impl<'n> Engine<'n> { } } + fn _projects_service_accounts_keys_upload(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "public-key-data" => Some(("publicKeyData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["public-key-data"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UploadServiceAccountKeyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().service_accounts_keys_upload(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_service_accounts_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().service_accounts_list(opt.value_of("name").unwrap_or("")); @@ -2863,6 +2940,9 @@ impl<'n> Engine<'n> { ("service-accounts-keys-list", Some(opt)) => { call_result = self._projects_service_accounts_keys_list(opt, dry_run, &mut err); }, + ("service-accounts-keys-upload", Some(opt)) => { + call_result = self._projects_service_accounts_keys_upload(opt, dry_run, &mut err); + }, ("service-accounts-list", Some(opt)) => { call_result = self._projects_service_accounts_list(opt, dry_run, &mut err); }, @@ -2998,23 +3078,12 @@ fn main() { ("iam-policies", "methods: 'lint-policy' and 'query-auditable-services'", vec![ ("lint-policy", Some(r##"Lints a Cloud IAM policy object or its sub fields. Currently supports - google.iam.v1.Policy, google.iam.v1.Binding and google.iam.v1.Binding.condition. Each lint operation consists of multiple lint validation units. - Validation units have the following properties: - - - Each unit inspects the input object in regard to a particular - linting aspect and issues a google.iam.admin.v1.LintResult - disclosing the result. - - Domain of discourse of each unit can be either - google.iam.v1.Policy, google.iam.v1.Binding, or - google.iam.v1.Binding.condition depending on the purpose of the - validation. - - A unit may require additional data (like the list of all possible - enumerable values of a particular attribute used in the policy instance) - which shall be provided by the caller. Refer to the comments of - google.iam.admin.v1.LintPolicyRequest.context for more details. + Each unit inspects the input object in regard to a particular linting + aspect and issues a google.iam.admin.v1.LintResult disclosing the + result. The set of applicable validation units is determined by the Cloud IAM server and is not configurable. @@ -3379,7 +3448,7 @@ fn main() { ]), ]), - ("projects", "methods: 'roles-create', 'roles-delete', 'roles-get', 'roles-list', 'roles-patch', 'roles-undelete', 'service-accounts-create', 'service-accounts-delete', 'service-accounts-disable', 'service-accounts-enable', 'service-accounts-get', 'service-accounts-get-iam-policy', 'service-accounts-keys-create', 'service-accounts-keys-delete', 'service-accounts-keys-get', 'service-accounts-keys-list', 'service-accounts-list', 'service-accounts-patch', 'service-accounts-set-iam-policy', 'service-accounts-sign-blob', 'service-accounts-sign-jwt', 'service-accounts-test-iam-permissions', 'service-accounts-undelete' and 'service-accounts-update'", vec![ + ("projects", "methods: 'roles-create', 'roles-delete', 'roles-get', 'roles-list', 'roles-patch', 'roles-undelete', 'service-accounts-create', 'service-accounts-delete', 'service-accounts-disable', 'service-accounts-enable', 'service-accounts-get', 'service-accounts-get-iam-policy', 'service-accounts-keys-create', 'service-accounts-keys-delete', 'service-accounts-keys-get', 'service-accounts-keys-list', 'service-accounts-keys-upload', 'service-accounts-list', 'service-accounts-patch', 'service-accounts-set-iam-policy', 'service-accounts-sign-blob', 'service-accounts-sign-jwt', 'service-accounts-test-iam-permissions', 'service-accounts-undelete' and 'service-accounts-update'", vec![ ("roles-create", Some(r##"Creates a new Role."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_roles-create", @@ -3700,7 +3769,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: + Some(r##"Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the @@ -3785,9 +3854,10 @@ fn main() { (Some(r##"name"##), None, Some(r##"The resource name of the service account in the following format: - `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}'. + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from - the account."##), + the account. The `ACCOUNT` value can be the `email` address or the + `unique_id` of the service account."##), Some(true), Some(false)), @@ -3815,7 +3885,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: + Some(r##"Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the @@ -3879,7 +3949,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: + Some(r##"Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the @@ -3911,7 +3981,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account key in the following format: + Some(r##"Required. The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the @@ -3938,7 +4008,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account key in the following format: + Some(r##"Required. The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from @@ -3965,7 +4035,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: + Some(r##"Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from @@ -3980,6 +4050,41 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-accounts-keys-upload", + Some(r##"Upload public key for a given service account. + This rpc will create a + ServiceAccountKey that has the + provided public key and returns it."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-keys-upload", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the service account in the following format: + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + the account. The `ACCOUNT` value can be the `email` address or the + `unique_id` of the service account."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4107,7 +4212,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: + Some(r##"Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the @@ -4147,7 +4252,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: + Some(r##"Required. The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the @@ -4212,7 +4317,7 @@ fn main() { (Some(r##"name"##), None, Some(r##"The resource name of the service account in the following format: - `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}'. + `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account."##), Some(true), @@ -4375,7 +4480,7 @@ fn main() { let mut app = App::new("iam1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200319") .about("Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_iam1_cli") .arg(Arg::with_name("url") diff --git a/gen/iam1/Cargo.toml b/gen/iam1/Cargo.toml index 367ef446b2..c9822e097d 100644 --- a/gen/iam1/Cargo.toml +++ b/gen/iam1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-iam1" -version = "1.0.12+20190627" +version = "1.0.13+20200319" authors = ["Sebastian Thiel "] description = "A complete library to interact with iam (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iam1" homepage = "https://cloud.google.com/iam/" -documentation = "https://docs.rs/google-iam1/1.0.12+20190627" +documentation = "https://docs.rs/google-iam1/1.0.13+20200319" license = "MIT" keywords = ["iam", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/iam1/README.md b/gen/iam1/README.md index 4f7e19fbff..63caf957c3 100644 --- a/gen/iam1/README.md +++ b/gen/iam1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-iam1` library allows access to all features of the *Google iam* service. -This documentation was generated from *iam* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *iam* crate version *1.0.13+20200319*, where *20200319* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *iam* *v1* API can be found at the [official documentation site](https://cloud.google.com/iam/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.Iam.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.Iam.html) ... * iam policies - * [*lint policy*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.IamPolicyLintPolicyCall.html) and [*query auditable services*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.IamPolicyQueryAuditableServiceCall.html) + * [*lint policy*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.IamPolicyLintPolicyCall.html) and [*query auditable services*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.IamPolicyQueryAuditableServiceCall.html) * organizations - * [*roles create*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.OrganizationRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.OrganizationRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.OrganizationRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.OrganizationRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.OrganizationRolePatchCall.html) and [*roles undelete*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.OrganizationRoleUndeleteCall.html) -* [permissions](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.Permission.html) - * [*query testable permissions*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.PermissionQueryTestablePermissionCall.html) + * [*roles create*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.OrganizationRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.OrganizationRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.OrganizationRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.OrganizationRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.OrganizationRolePatchCall.html) and [*roles undelete*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.OrganizationRoleUndeleteCall.html) +* [permissions](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.Permission.html) + * [*query testable permissions*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.PermissionQueryTestablePermissionCall.html) * projects - * [*roles create*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectRolePatchCall.html), [*roles undelete*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectRoleUndeleteCall.html), [*service accounts create*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountDeleteCall.html), [*service accounts disable*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountDisableCall.html), [*service accounts enable*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountEnableCall.html), [*service accounts get*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountListCall.html), [*service accounts patch*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountPatchCall.html), [*service accounts set iam policy*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountTestIamPermissionCall.html), [*service accounts undelete*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountUndeleteCall.html) and [*service accounts update*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.ProjectServiceAccountUpdateCall.html) -* [roles](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.Role.html) - * [*get*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.RoleGetCall.html), [*list*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.RoleListCall.html) and [*query grantable roles*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.RoleQueryGrantableRoleCall.html) + * [*roles create*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectRoleCreateCall.html), [*roles delete*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectRoleDeleteCall.html), [*roles get*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectRoleGetCall.html), [*roles list*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectRoleListCall.html), [*roles patch*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectRolePatchCall.html), [*roles undelete*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectRoleUndeleteCall.html), [*service accounts create*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountDeleteCall.html), [*service accounts disable*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountDisableCall.html), [*service accounts enable*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountEnableCall.html), [*service accounts get*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountKeyListCall.html), [*service accounts keys upload*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountKeyUploadCall.html), [*service accounts list*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountListCall.html), [*service accounts patch*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountPatchCall.html), [*service accounts set iam policy*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountTestIamPermissionCall.html), [*service accounts undelete*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountUndeleteCall.html) and [*service accounts update*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.ProjectServiceAccountUpdateCall.html) +* [roles](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.Role.html) + * [*get*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.RoleGetCall.html), [*list*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.RoleListCall.html) and [*query grantable roles*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.RoleQueryGrantableRoleCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/struct.Iam.html)** +* **[Hub](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/struct.Iam.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.Part.html)** + * **[Parts](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -149,17 +149,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -169,29 +169,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-iam1/1.0.12+20190627/google_iam1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-iam1/1.0.13+20200319/google_iam1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/iam1/src/lib.rs b/gen/iam1/src/lib.rs index b0d4b62657..73335167ed 100644 --- a/gen/iam1/src/lib.rs +++ b/gen/iam1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *iam* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *iam* crate version *1.0.13+20200319*, where *20200319* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *iam* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/iam/). @@ -18,7 +18,7 @@ //! * [permissions](struct.Permission.html) //! * [*query testable permissions*](struct.PermissionQueryTestablePermissionCall.html) //! * projects -//! * [*roles create*](struct.ProjectRoleCreateCall.html), [*roles delete*](struct.ProjectRoleDeleteCall.html), [*roles get*](struct.ProjectRoleGetCall.html), [*roles list*](struct.ProjectRoleListCall.html), [*roles patch*](struct.ProjectRolePatchCall.html), [*roles undelete*](struct.ProjectRoleUndeleteCall.html), [*service accounts create*](struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](struct.ProjectServiceAccountDeleteCall.html), [*service accounts disable*](struct.ProjectServiceAccountDisableCall.html), [*service accounts enable*](struct.ProjectServiceAccountEnableCall.html), [*service accounts get*](struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](struct.ProjectServiceAccountListCall.html), [*service accounts patch*](struct.ProjectServiceAccountPatchCall.html), [*service accounts set iam policy*](struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](struct.ProjectServiceAccountTestIamPermissionCall.html), [*service accounts undelete*](struct.ProjectServiceAccountUndeleteCall.html) and [*service accounts update*](struct.ProjectServiceAccountUpdateCall.html) +//! * [*roles create*](struct.ProjectRoleCreateCall.html), [*roles delete*](struct.ProjectRoleDeleteCall.html), [*roles get*](struct.ProjectRoleGetCall.html), [*roles list*](struct.ProjectRoleListCall.html), [*roles patch*](struct.ProjectRolePatchCall.html), [*roles undelete*](struct.ProjectRoleUndeleteCall.html), [*service accounts create*](struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](struct.ProjectServiceAccountDeleteCall.html), [*service accounts disable*](struct.ProjectServiceAccountDisableCall.html), [*service accounts enable*](struct.ProjectServiceAccountEnableCall.html), [*service accounts get*](struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](struct.ProjectServiceAccountKeyListCall.html), [*service accounts keys upload*](struct.ProjectServiceAccountKeyUploadCall.html), [*service accounts list*](struct.ProjectServiceAccountListCall.html), [*service accounts patch*](struct.ProjectServiceAccountPatchCall.html), [*service accounts set iam policy*](struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](struct.ProjectServiceAccountTestIamPermissionCall.html), [*service accounts undelete*](struct.ProjectServiceAccountUndeleteCall.html) and [*service accounts update*](struct.ProjectServiceAccountUpdateCall.html) //! * [roles](struct.Role.html) //! * [*get*](struct.RoleGetCall.html), [*list*](struct.RoleListCall.html) and [*query grantable roles*](struct.RoleQueryGrantableRoleCall.html) //! @@ -347,7 +347,7 @@ impl<'a, C, A> Iam Iam { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://iam.googleapis.com/".to_string(), _root_url: "https://iam.googleapis.com/".to_string(), } @@ -370,7 +370,7 @@ impl<'a, C, A> Iam } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -488,7 +488,7 @@ impl Part for AuditableService {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SignJwtRequest { - /// The JWT payload to sign, a JSON JWT Claim set. + /// Required. The JWT payload to sign, a JSON JWT Claim set. pub payload: Option, } @@ -582,9 +582,9 @@ impl ResponseResult for QueryTestablePermissionsResponse {} pub struct Role { /// Used to perform a consistent read-modify-write. pub etag: Option, - /// Optional. A human-readable description for the role. + /// Optional. A human-readable description for the role. pub description: Option, - /// Optional. A human-readable title for the role. Typically this + /// Optional. A human-readable title for the role. Typically this /// is limited to 100 UTF-8 bytes. pub title: Option, /// The current deleted state of the role. This field is read only. @@ -602,7 +602,7 @@ pub struct Role { /// When Role is used in CreateRole, the role name must not be set. /// /// When Role is used in output and other input such as UpdateRole, the role - /// name is the complete path, e.g., roles/logging.viewer for curated roles + /// name is the complete path, e.g., roles/logging.viewer for predefined roles /// and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. pub name: Option, } @@ -612,60 +612,72 @@ impl Resource for Role {} impl ResponseResult for Role {} -/// The service account list response. +/// The service account key upload request. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [service accounts list projects](struct.ProjectServiceAccountListCall.html) (response) +/// * [service accounts keys upload projects](struct.ProjectServiceAccountKeyUploadCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListServiceAccountsResponse { - /// To retrieve the next page of results, set - /// ListServiceAccountsRequest.page_token - /// to this value. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of matching service accounts. - pub accounts: Option>, +pub struct UploadServiceAccountKeyRequest { + /// A field that allows clients to upload their own public key. If set, + /// use this public key data to create a service account key for given + /// service account. + /// Please note, the expected format for this field is X509_PEM. + #[serde(rename="publicKeyData")] + pub public_key_data: Option, } -impl ResponseResult for ListServiceAccountsResponse {} +impl RequestValue for UploadServiceAccountKeyRequest {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -673,15 +685,21 @@ impl ResponseResult for ListServiceAccountsResponse {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -703,13 +721,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -858,19 +899,24 @@ pub struct Permission { #[serde(rename="apiDisabled")] pub api_disabled: Option, /// A brief description of what this Permission is used for. + /// This permission can ONLY be used in predefined roles. pub description: Option, /// The title of this Permission. pub title: Option, - /// The current launch stage of the permission. - pub stage: Option, - /// This permission can ONLY be used in predefined roles. + /// The preferred name for this permission. If present, then this permission is + /// an alias of, and equivalent to, the listed primary_permission. + #[serde(rename="primaryPermission")] + pub primary_permission: Option, + /// The name of this Permission. + pub name: Option, + /// no description provided #[serde(rename="onlyInPredefinedRoles")] pub only_in_predefined_roles: Option, /// The current custom role support level. #[serde(rename="customRolesSupportLevel")] pub custom_roles_support_level: Option, - /// The name of this Permission. - pub name: Option, + /// The current launch stage of the permission. + pub stage: Option, } impl Resource for Permission {} @@ -998,7 +1044,7 @@ impl RequestValue for CreateRoleRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LintResult { /// The validation unit name, for instance - /// “lintValidationUnits/ConditionComplexityCheck”. + /// "lintValidationUnits/ConditionComplexityCheck". #[serde(rename="validationUnitName")] pub validation_unit_name: Option, /// The validation unit severity. @@ -1007,15 +1053,11 @@ pub struct LintResult { pub level: Option, /// The name of the field for which this lint result is about. /// - /// For nested messages, `field_name` consists of names of the embedded fields + /// For nested messages `field_name` consists of names of the embedded fields /// separated by period character. The top-level qualifier is the input object - /// to lint in the request. For instance, if the lint request is on a - /// google.iam.v1.Policy and this lint result is about a condition - /// expression of one of the input policy bindings, the field would be - /// populated as `policy.bindings.condition.expression`. - /// - /// This field does not identify the ordinality of the repetitive fields (for - /// instance bindings in a policy). + /// to lint in the request. For example, the `field_name` value + /// `condition.expression` identifies a lint result for the `expression` field + /// of the provided condition. #[serde(rename="fieldName")] pub field_name: Option, /// 0-based character position of problematic construct within the object @@ -1023,15 +1065,6 @@ pub struct LintResult { /// expression. #[serde(rename="locationOffset")] pub location_offset: Option, - /// 0-based index ordinality of the binding in the input object associated - /// with this result. - /// This field is populated only if the input object to lint is of type - /// google.iam.v1.Policy, which can comprise more than one binding. - /// It is set to -1 if the result is not associated with any particular - /// binding and only targets the policy as a whole, such as results about - /// policy size violations. - #[serde(rename="bindingOrdinal")] - pub binding_ordinal: Option, /// Human readable debug message associated with the issue. #[serde(rename="debugMessage")] pub debug_message: Option, @@ -1049,7 +1082,7 @@ impl Part for LintResult {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1060,7 +1093,7 @@ impl Part for LintResult {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1099,30 +1132,59 @@ pub struct TestIamPermissionsRequest { impl RequestValue for TestIamPermissionsRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1259,7 +1321,7 @@ impl RequestValue for DisableServiceAccountRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SignBlobRequest { - /// The bytes to sign. + /// Required. The bytes to sign. #[serde(rename="bytesToSign")] pub bytes_to_sign: Option, } @@ -1267,8 +1329,7 @@ pub struct SignBlobRequest { impl RequestValue for SignBlobRequest {} -/// The request to lint a Cloud IAM policy object. LintPolicy is currently -/// functional only for `lint_object` of type `condition`. +/// The request to lint a Cloud IAM policy object. /// /// # Activities /// @@ -1279,10 +1340,6 @@ impl RequestValue for SignBlobRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LintPolicyRequest { - /// Policy object to be linted. The functionality of linting a policy is not - /// yet implemented and if this field is set, it returns NOT_IMPLEMENTED - /// error. - pub policy: Option, /// The full resource name of the policy this lint request is about. /// /// The name follows the Google Cloud Platform (GCP) resource format. @@ -1294,16 +1351,8 @@ pub struct LintPolicyRequest { /// request object. #[serde(rename="fullResourceName")] pub full_resource_name: Option, - /// Binding object to be linted. The functionality of linting a binding is - /// not yet implemented and if this field is set, it returns NOT_IMPLEMENTED - /// error. - pub binding: Option, /// google.iam.v1.Binding.condition object to be linted. pub condition: Option, - /// `context` contains additional *permission-controlled* data that any - /// lint unit may depend on, in form of `{key: value}` pairs. Currently, this - /// field is non-operational and it will not be used during the lint operation. - pub context: Option>, } impl RequestValue for LintPolicyRequest {} @@ -1322,7 +1371,7 @@ impl RequestValue for LintPolicyRequest {} pub struct CreateServiceAccountRequest { /// The ServiceAccount resource to /// create. Currently, only the following values are user assignable: - /// `display_name` . + /// `display_name` and `description`. #[serde(rename="serviceAccount")] pub service_account: Option, /// Required. The account id that is used to generate the service account @@ -1336,6 +1385,29 @@ pub struct CreateServiceAccountRequest { impl RequestValue for CreateServiceAccountRequest {} +/// The service account list response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [service accounts list projects](struct.ProjectServiceAccountListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListServiceAccountsResponse { + /// To retrieve the next page of results, set + /// ListServiceAccountsRequest.page_token + /// to this value. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching service accounts. + pub accounts: Option>, +} + +impl ResponseResult for ListServiceAccountsResponse {} + + /// The service account sign JWT response. /// /// # Activities @@ -1382,7 +1454,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1391,6 +1463,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1426,6 +1518,7 @@ impl Part for Binding {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [service accounts keys upload projects](struct.ProjectServiceAccountKeyUploadCall.html) (response) /// * [service accounts keys get projects](struct.ProjectServiceAccountKeyGetCall.html) (response) /// * [service accounts keys create projects](struct.ProjectServiceAccountKeyCreateCall.html) (response) /// @@ -1437,7 +1530,13 @@ pub struct ServiceAccountKey { /// The resource name of the service account key in the following format /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. pub name: Option, + /// The key type. + #[serde(rename="keyType")] + pub key_type: Option, /// The key can be used before this timestamp. + /// For system-managed key pairs, this timestamp is the end time for the + /// private key signing operation. The public key could still be used + /// for verification for a few hours after this time. #[serde(rename="validBeforeTime")] pub valid_before_time: Option, /// Specifies the algorithm (and possibly key size) for the key. @@ -1492,7 +1591,7 @@ impl ResponseResult for ServiceAccountKey {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1504,7 +1603,7 @@ impl ResponseResult for ServiceAccountKey {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1512,7 +1611,7 @@ impl ResponseResult for ServiceAccountKey {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1521,9 +1620,9 @@ impl ResponseResult for ServiceAccountKey {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1552,15 +1651,7 @@ impl Part for AuditConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LintPolicyResponse { - /// List of lint results sorted by a composite key, - /// descending order of severity and ascending order of binding_ordinal. - /// There is no certain order among the same keys. - /// - /// For cross-binding results (only if the input object to lint is - /// instance of google.iam.v1.Policy), there will be a - /// google.iam.admin.v1.LintResult for each of the involved bindings, - /// and the associated debug_message may enumerate the other involved - /// binding ordinal number(s). + /// List of lint results sorted by `severity` in descending order. #[serde(rename="lintResults")] pub lint_results: Option>, } @@ -1927,23 +2018,12 @@ impl<'a, C, A> IamPolicyMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Lints a Cloud IAM policy object or its sub fields. Currently supports - /// google.iam.v1.Policy, google.iam.v1.Binding and /// google.iam.v1.Binding.condition. /// /// Each lint operation consists of multiple lint validation units. - /// Validation units have the following properties: - /// - /// - Each unit inspects the input object in regard to a particular - /// linting aspect and issues a google.iam.admin.v1.LintResult - /// disclosing the result. - /// - Domain of discourse of each unit can be either - /// google.iam.v1.Policy, google.iam.v1.Binding, or - /// google.iam.v1.Binding.condition depending on the purpose of the - /// validation. - /// - A unit may require additional data (like the list of all possible - /// enumerable values of a particular attribute used in the policy instance) - /// which shall be provided by the caller. Refer to the comments of - /// google.iam.admin.v1.LintPolicyRequest.context for more details. + /// Each unit inspects the input object in regard to a particular linting + /// aspect and issues a google.iam.admin.v1.LintResult disclosing the + /// result. /// /// The set of applicable validation units is determined by the Cloud IAM /// server and is not configurable. @@ -2108,7 +2188,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `roles_create(...)`, `roles_delete(...)`, `roles_get(...)`, `roles_list(...)`, `roles_patch(...)`, `roles_undelete(...)`, `service_accounts_create(...)`, `service_accounts_delete(...)`, `service_accounts_disable(...)`, `service_accounts_enable(...)`, `service_accounts_get(...)`, `service_accounts_get_iam_policy(...)`, `service_accounts_keys_create(...)`, `service_accounts_keys_delete(...)`, `service_accounts_keys_get(...)`, `service_accounts_keys_list(...)`, `service_accounts_list(...)`, `service_accounts_patch(...)`, `service_accounts_set_iam_policy(...)`, `service_accounts_sign_blob(...)`, `service_accounts_sign_jwt(...)`, `service_accounts_test_iam_permissions(...)`, `service_accounts_undelete(...)` and `service_accounts_update(...)` +/// // like `roles_create(...)`, `roles_delete(...)`, `roles_get(...)`, `roles_list(...)`, `roles_patch(...)`, `roles_undelete(...)`, `service_accounts_create(...)`, `service_accounts_delete(...)`, `service_accounts_disable(...)`, `service_accounts_enable(...)`, `service_accounts_get(...)`, `service_accounts_get_iam_policy(...)`, `service_accounts_keys_create(...)`, `service_accounts_keys_delete(...)`, `service_accounts_keys_get(...)`, `service_accounts_keys_list(...)`, `service_accounts_keys_upload(...)`, `service_accounts_list(...)`, `service_accounts_patch(...)`, `service_accounts_set_iam_policy(...)`, `service_accounts_sign_blob(...)`, `service_accounts_sign_jwt(...)`, `service_accounts_test_iam_permissions(...)`, `service_accounts_undelete(...)` and `service_accounts_update(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2129,7 +2209,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account key in the following format: + /// * `name` - Required. The resource name of the service account key in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -2200,9 +2280,10 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `name` - The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}'. + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from - /// the account. + /// the account. The `ACCOUNT` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_enable(&self, request: EnableServiceAccountRequest, name: &str) -> ProjectServiceAccountEnableCall<'a, C, A> { ProjectServiceAccountEnableCall { hub: self.hub, @@ -2354,7 +2435,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: + /// * `name` - Required. The resource name of the service account in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -2411,7 +2492,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account in the following format: + /// * `name` - Required. The resource name of the service account in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -2480,6 +2561,32 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Upload public key for a given service account. + /// This rpc will create a + /// ServiceAccountKey that has the + /// provided public key and returns it. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + /// the account. The `ACCOUNT` value can be the `email` address or the + /// `unique_id` of the service account. + pub fn service_accounts_keys_upload(&self, request: UploadServiceAccountKeyRequest, name: &str) -> ProjectServiceAccountKeyUploadCall<'a, C, A> { + ProjectServiceAccountKeyUploadCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a Role definition. @@ -2644,7 +2751,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `name` - The resource name of the service account in the following format: - /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}'. + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. pub fn service_accounts_undelete(&self, request: UndeleteServiceAccountRequest, name: &str) -> ProjectServiceAccountUndeleteCall<'a, C, A> { @@ -2704,7 +2811,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: + /// * `name` - Required. The resource name of the service account in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -2726,7 +2833,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account in the following format: + /// * `name` - Required. The resource name of the service account in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -2750,7 +2857,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: + /// * `name` - Required. The resource name of the service account in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -2793,7 +2900,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account key in the following format: + /// * `name` - Required. The resource name of the service account key in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -2815,7 +2922,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account in the following format: + /// * `name` - Required. The resource name of the service account in the following format: /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from /// the account. The `ACCOUNT` value can be the `email` address or the @@ -4933,23 +5040,12 @@ impl<'a, C, A> IamPolicyQueryAuditableServiceCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountEnableCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetIamPolicyCall<'a, C, A> where C: BorrowMu self } /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. /// /// Sets the *options.requested policy version* query property to the given value. pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> { @@ -8184,7 +8285,7 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountPatchCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Iam::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UploadServiceAccountKeyRequest::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().service_accounts_keys_upload(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountKeyUploadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: UploadServiceAccountKeyRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountKeyUploadCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountKeyUploadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccountKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.keys.upload", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/keys:upload"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UploadServiceAccountKeyRequest) -> ProjectServiceAccountKeyUploadCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + /// Using `-` as a wildcard for the `PROJECT_ID` will infer the project from + /// the account. The `ACCOUNT` value can be the `email` address or the + /// `unique_id` of the service account. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountKeyUploadCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectServiceAccountKeyUploadCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountKeyUploadCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectServiceAccountKeyUploadCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates a Role definition. /// /// A builder for the *roles.patch* method supported by a *project* resource. @@ -9418,7 +9805,7 @@ impl<'a, C, A> ProjectServiceAccountPatchCall<'a, C, A> where C: BorrowMut ProjectServiceAccountDisableCall<'a, C, A> where C: BorrowMut ProjectServiceAccountUndeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with IAM Credentials (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iamcredentials1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-iamcredentials1] path = "../iamcredentials1" -version = "1.0.12+20190620" +version = "1.0.13+20200327" diff --git a/gen/iamcredentials1-cli/README.md b/gen/iamcredentials1-cli/README.md index 986880beb7..6066b56c09 100644 --- a/gen/iamcredentials1-cli/README.md +++ b/gen/iamcredentials1-cli/README.md @@ -25,14 +25,13 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *IAM Credentials* API at revision *20190620*. The CLI is at version *1.0.12*. +This documentation was generated from the *IAM Credentials* API at revision *20200327*. The CLI is at version *1.0.13*. ```bash iamcredentials1 [options] projects service-accounts-generate-access-token (-r )... [-p ]... [-o ] service-accounts-generate-id-token (-r )... [-p ]... [-o ] - service-accounts-generate-identity-binding-access-token (-r )... [-p ]... [-o ] service-accounts-sign-blob (-r )... [-p ]... [-o ] service-accounts-sign-jwt (-r )... [-p ]... [-o ] iamcredentials1 --help diff --git a/gen/iamcredentials1-cli/mkdocs.yml b/gen/iamcredentials1-cli/mkdocs.yml index 567d665695..75c68eed91 100644 --- a/gen/iamcredentials1-cli/mkdocs.yml +++ b/gen/iamcredentials1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: IAM Credentials v1.0.12+20190620 +site_name: IAM Credentials v1.0.13+20200327 site_url: http://byron.github.io/google-apis-rs/google-iamcredentials1-cli site_description: A complete library to interact with IAM Credentials (protocol v1) @@ -11,7 +11,6 @@ pages: - ['index.md', 'Home'] - ['projects_service-accounts-generate-access-token.md', 'Projects', 'Service Accounts Generate Access Token'] - ['projects_service-accounts-generate-id-token.md', 'Projects', 'Service Accounts Generate Id Token'] -- ['projects_service-accounts-generate-identity-binding-access-token.md', 'Projects', 'Service Accounts Generate Identity Binding Access Token'] - ['projects_service-accounts-sign-blob.md', 'Projects', 'Service Accounts Sign Blob'] - ['projects_service-accounts-sign-jwt.md', 'Projects', 'Service Accounts Sign Jwt'] diff --git a/gen/iamcredentials1-cli/src/main.rs b/gen/iamcredentials1-cli/src/main.rs index 2ef60cb6ac..d0964ee273 100644 --- a/gen/iamcredentials1-cli/src/main.rs +++ b/gen/iamcredentials1-cli/src/main.rs @@ -220,89 +220,6 @@ impl<'n> Engine<'n> { } } - fn _projects_service_accounts_generate_identity_binding_access_token(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "scope" => Some(("scope", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "jwt" => Some(("jwt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["jwt", "scope"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::GenerateIdentityBindingAccessTokenRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.projects().service_accounts_generate_identity_binding_access_token(request, opt.value_of("name").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _projects_service_accounts_sign_blob(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -488,9 +405,6 @@ impl<'n> Engine<'n> { ("service-accounts-generate-id-token", Some(opt)) => { call_result = self._projects_service_accounts_generate_id_token(opt, dry_run, &mut err); }, - ("service-accounts-generate-identity-binding-access-token", Some(opt)) => { - call_result = self._projects_service_accounts_generate_identity_binding_access_token(opt, dry_run, &mut err); - }, ("service-accounts-sign-blob", Some(opt)) => { call_result = self._projects_service_accounts_sign_blob(opt, dry_run, &mut err); }, @@ -588,14 +502,14 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'service-accounts-generate-access-token', 'service-accounts-generate-id-token', 'service-accounts-generate-identity-binding-access-token', 'service-accounts-sign-blob' and 'service-accounts-sign-jwt'", vec![ + ("projects", "methods: 'service-accounts-generate-access-token', 'service-accounts-generate-id-token', 'service-accounts-sign-blob' and 'service-accounts-sign-jwt'", vec![ ("service-accounts-generate-access-token", Some(r##"Generates an OAuth 2.0 access token for a service account."##), "Details at http://byron.github.io/google-apis-rs/google_iamcredentials1_cli/projects_service-accounts-generate-access-token", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account for which the credentials + Some(r##"Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid."##), @@ -626,38 +540,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account for which the credentials - are requested, in the following format: - `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - character is required; replacing it with a project ID is invalid."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("service-accounts-generate-identity-binding-access-token", - Some(r##""##), - "Details at http://byron.github.io/google-apis-rs/google_iamcredentials1_cli/projects_service-accounts-generate-identity-binding-access-token", - vec![ - (Some(r##"name"##), - None, - Some(r##"The resource name of the service account for which the credentials + Some(r##"Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid."##), @@ -688,7 +571,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account for which the credentials + Some(r##"Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid."##), @@ -719,7 +602,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account for which the credentials + Some(r##"Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid."##), @@ -750,7 +633,7 @@ fn main() { let mut app = App::new("iamcredentials1") .author("Sebastian Thiel ") - .version("1.0.12+20190620") + .version("1.0.13+20200327") .about("Creates short-lived, limited-privilege credentials for IAM service accounts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_iamcredentials1_cli") .arg(Arg::with_name("url") diff --git a/gen/iamcredentials1/Cargo.toml b/gen/iamcredentials1/Cargo.toml index a55a5e5799..76070bbff0 100644 --- a/gen/iamcredentials1/Cargo.toml +++ b/gen/iamcredentials1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-iamcredentials1" -version = "1.0.12+20190620" +version = "1.0.13+20200327" authors = ["Sebastian Thiel "] description = "A complete library to interact with IAM Credentials (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iamcredentials1" homepage = "https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials" -documentation = "https://docs.rs/google-iamcredentials1/1.0.12+20190620" +documentation = "https://docs.rs/google-iamcredentials1/1.0.13+20200327" license = "MIT" keywords = ["iamcredentials", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/iamcredentials1/README.md b/gen/iamcredentials1/README.md index 0c55ecc39a..76bb36b2fd 100644 --- a/gen/iamcredentials1/README.md +++ b/gen/iamcredentials1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-iamcredentials1` library allows access to all features of the *Google IAM Credentials* service. -This documentation was generated from *IAM Credentials* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *iamcredentials:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *IAM Credentials* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *iamcredentials:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *IAM Credentials* *v1* API can be found at the [official documentation site](https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/struct.IAMCredentials.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/struct.IAMCredentials.html) ... * projects - * [*service accounts generate access token*](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/struct.ProjectServiceAccountGenerateAccessTokenCall.html), [*service accounts generate id token*](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/struct.ProjectServiceAccountGenerateIdTokenCall.html), [*service accounts generate identity binding access token*](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/struct.ProjectServiceAccountGenerateIdentityBindingAccessTokenCall.html), [*service accounts sign blob*](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/struct.ProjectServiceAccountSignBlobCall.html) and [*service accounts sign jwt*](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/struct.ProjectServiceAccountSignJwtCall.html) + * [*service accounts generate access token*](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/struct.ProjectServiceAccountGenerateAccessTokenCall.html), [*service accounts generate id token*](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/struct.ProjectServiceAccountGenerateIdTokenCall.html), [*service accounts sign blob*](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/struct.ProjectServiceAccountSignBlobCall.html) and [*service accounts sign jwt*](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/struct.ProjectServiceAccountSignJwtCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/struct.IAMCredentials.html)** +* **[Hub](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/struct.IAMCredentials.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.Part.html)** + * **[Parts](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-iamcredentials1/1.0.12+20190620/google_iamcredentials1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-iamcredentials1/1.0.13+20200327/google_iamcredentials1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/iamcredentials1/src/lib.rs b/gen/iamcredentials1/src/lib.rs index d2ffa60e77..7fdf67bbb7 100644 --- a/gen/iamcredentials1/src/lib.rs +++ b/gen/iamcredentials1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *IAM Credentials* crate version *1.0.12+20190620*, where *20190620* is the exact revision of the *iamcredentials:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *IAM Credentials* crate version *1.0.13+20200327*, where *20200327* is the exact revision of the *iamcredentials:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *IAM Credentials* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.IAMCredentials.html) ... //! //! * projects -//! * [*service accounts generate access token*](struct.ProjectServiceAccountGenerateAccessTokenCall.html), [*service accounts generate id token*](struct.ProjectServiceAccountGenerateIdTokenCall.html), [*service accounts generate identity binding access token*](struct.ProjectServiceAccountGenerateIdentityBindingAccessTokenCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html) and [*service accounts sign jwt*](struct.ProjectServiceAccountSignJwtCall.html) +//! * [*service accounts generate access token*](struct.ProjectServiceAccountGenerateAccessTokenCall.html), [*service accounts generate id token*](struct.ProjectServiceAccountGenerateIdTokenCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html) and [*service accounts sign jwt*](struct.ProjectServiceAccountSignJwtCall.html) //! //! //! @@ -329,7 +329,7 @@ impl<'a, C, A> IAMCredentials IAMCredentials { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://iamcredentials.googleapis.com/".to_string(), _root_url: "https://iamcredentials.googleapis.com/".to_string(), } @@ -340,7 +340,7 @@ impl<'a, C, A> IAMCredentials } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -435,105 +435,13 @@ pub struct SignJwtRequest { /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. pub delegates: Option>, - /// The JWT payload to sign: a JSON object that contains a JWT Claims Set. + /// Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. pub payload: Option, } impl RequestValue for SignJwtRequest {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [service accounts generate identity binding access token projects](struct.ProjectServiceAccountGenerateIdentityBindingAccessTokenCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GenerateIdentityBindingAccessTokenRequest { - /// Code to identify the scopes to be included in the OAuth 2.0 access token. - /// See https://developers.google.com/identity/protocols/googlescopes for more - /// information. - /// At least one value required. - pub scope: Option>, - /// Required. Input token. - /// Must be in JWT format according to - /// RFC7523 (https://tools.ietf.org/html/rfc7523) - /// and must have 'kid' field in the header. - /// Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon). - /// Mandatory payload fields (along the lines of RFC 7523, section 3): - /// - /// * iss: issuer of the token. Must provide a discovery document at - /// $iss/.well-known/openid-configuration . The document needs to be - /// formatted according to section 4.2 of the OpenID Connect Discovery - /// 1.0 specification. - /// * iat: Issue time in seconds since epoch. Must be in the past. - /// * exp: Expiration time in seconds since epoch. Must be less than 48 hours - /// after iat. We recommend to create tokens that last shorter than 6 - /// hours to improve security unless business reasons mandate longer - /// expiration times. Shorter token lifetimes are generally more secure - /// since tokens that have been exfiltrated by attackers can be used for - /// a shorter time. you can configure the maximum lifetime of the - /// incoming token in the configuration of the mapper. - /// The resulting Google token will expire within an hour or at "exp", - /// whichever is earlier. - /// * sub: JWT subject, identity asserted in the JWT. - /// * aud: Configured in the mapper policy. By default the service account - /// email. - /// - /// Claims from the incoming token can be transferred into the output token - /// accoding to the mapper configuration. The outgoing claim size is limited. - /// Outgoing claims size must be less than 4kB serialized as JSON without - /// whitespace. - /// - /// Example header: - /// { - /// "alg": "RS256", - /// "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8" - /// } - /// Example payload: - /// { - /// "iss": "https://accounts.google.com", - /// "iat": 1517963104, - /// "exp": 1517966704, - /// "aud": - /// "https://iamcredentials.googleapis.com/google.iam.credentials.v1.CloudGaia", - /// "sub": "113475438248934895348", - /// "my_claims": { - /// "additional_claim": "value" - /// } - /// } - pub jwt: Option, -} - -impl RequestValue for GenerateIdentityBindingAccessTokenRequest {} - - -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [service accounts generate identity binding access token projects](struct.ProjectServiceAccountGenerateIdentityBindingAccessTokenCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GenerateIdentityBindingAccessTokenResponse { - /// Token expiration time. - /// The expiration time is always set. - #[serde(rename="expireTime")] - pub expire_time: Option, - /// The OAuth 2.0 access token. - #[serde(rename="accessToken")] - pub access_token: Option, -} - -impl ResponseResult for GenerateIdentityBindingAccessTokenResponse {} - - /// There is no detailed description. /// /// # Activities @@ -578,7 +486,7 @@ pub struct SignBlobRequest { /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. pub delegates: Option>, - /// The bytes to sign. + /// Required. The bytes to sign. pub payload: Option, } @@ -612,7 +520,7 @@ pub struct GenerateAccessTokenRequest { /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. pub delegates: Option>, - /// Code to identify the scopes to be included in the OAuth 2.0 access token. + /// Required. Code to identify the scopes to be included in the OAuth 2.0 access token. /// See https://developers.google.com/identity/protocols/googlescopes for more /// information. /// At least one value required. @@ -655,7 +563,7 @@ pub struct GenerateIdTokenRequest { /// token will contain `email` and `email_verified` claims. #[serde(rename="includeEmail")] pub include_email: Option, - /// The audience for the token, such as the API or account that this token + /// Required. The audience for the token, such as the API or account that this token /// grants access to. pub audience: Option, /// The sequence of service accounts in a delegation chain. Each service @@ -703,7 +611,7 @@ impl RequestValue for GenerateIdTokenRequest {} /// ::default(), None); /// let mut hub = IAMCredentials::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `service_accounts_generate_access_token(...)`, `service_accounts_generate_id_token(...)`, `service_accounts_generate_identity_binding_access_token(...)`, `service_accounts_sign_blob(...)` and `service_accounts_sign_jwt(...)` +/// // like `service_accounts_generate_access_token(...)`, `service_accounts_generate_id_token(...)`, `service_accounts_sign_blob(...)` and `service_accounts_sign_jwt(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -720,21 +628,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// + /// Generates an OAuth 2.0 access token for a service account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account for which the credentials + /// * `name` - Required. The resource name of the service account for which the credentials /// are requested, in the following format: /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. - pub fn service_accounts_generate_identity_binding_access_token(&self, request: GenerateIdentityBindingAccessTokenRequest, name: &str) -> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> { - ProjectServiceAccountGenerateIdentityBindingAccessTokenCall { + pub fn service_accounts_generate_access_token(&self, request: GenerateAccessTokenRequest, name: &str) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { + ProjectServiceAccountGenerateAccessTokenCall { hub: self.hub, _request: request, _name: name.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -746,7 +655,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account for which the credentials + /// * `name` - Required. The resource name of the service account for which the credentials /// are requested, in the following format: /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. @@ -768,7 +677,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account for which the credentials + /// * `name` - Required. The resource name of the service account for which the credentials /// are requested, in the following format: /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. @@ -790,7 +699,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account for which the credentials + /// * `name` - Required. The resource name of the service account for which the credentials /// are requested, in the following format: /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. @@ -804,28 +713,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Generates an OAuth 2.0 access token for a service account. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The resource name of the service account for which the credentials - /// are requested, in the following format: - /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - /// character is required; replacing it with a project ID is invalid. - pub fn service_accounts_generate_access_token(&self, request: GenerateAccessTokenRequest, name: &str) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { - ProjectServiceAccountGenerateAccessTokenCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -836,9 +723,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// +/// Generates an OAuth 2.0 access token for a service account. /// -/// A builder for the *serviceAccounts.generateIdentityBindingAccessToken* method supported by a *project* resource. +/// A builder for the *serviceAccounts.generateAccessToken* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -850,7 +737,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_iamcredentials1 as iamcredentials1; -/// use iamcredentials1::GenerateIdentityBindingAccessTokenRequest; +/// use iamcredentials1::GenerateAccessTokenRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -864,32 +751,33 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // 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 = GenerateIdentityBindingAccessTokenRequest::default(); +/// let mut req = GenerateAccessTokenRequest::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().service_accounts_generate_identity_binding_access_token(req, "name") +/// let result = hub.projects().service_accounts_generate_access_token(req, "name") /// .doit(); /// # } /// ``` -pub struct ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> +pub struct ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> where C: 'a, A: 'a { hub: &'a IAMCredentials, - _request: GenerateIdentityBindingAccessTokenRequest, + _request: GenerateAccessTokenRequest, _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> {} -impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GenerateIdentityBindingAccessTokenResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GenerateAccessTokenResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -898,7 +786,7 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "iamcredentials.projects.serviceAccounts.generateIdentityBindingAccessToken", + dlg.begin(MethodInfo { id: "iamcredentials.projects.serviceAccounts.generateAccessToken", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -914,18 +802,9 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+name}:generateIdentityBindingAccessToken"; - - let mut key = self.hub.auth.borrow_mut().api_key(); - if key.is_none() { - key = dlg.api_key(); - } - match key { - Some(value) => params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + let mut url = self.hub._base_url.clone() + "v1/{+name}:generateAccessToken"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{+name}", "name")].iter() { @@ -969,11 +848,25 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) .header(ContentLength(request_size as u64)) .body(&mut request_value_reader); @@ -1032,11 +925,11 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GenerateIdentityBindingAccessTokenRequest) -> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> { + pub fn request(mut self, new_value: GenerateAccessTokenRequest) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { self._request = new_value; self } - /// The resource name of the service account for which the credentials + /// Required. The resource name of the service account for which the credentials /// are requested, in the following format: /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. @@ -1045,7 +938,7 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -1055,7 +948,7 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1080,12 +973,35 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountGenerateIdentityBindingAccessTokenCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } @@ -1295,7 +1211,7 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGenerateIdTokenCall<'a, C, A> where C: Borro self._request = new_value; self } - /// The resource name of the service account for which the credentials + /// Required. The resource name of the service account for which the credentials /// are requested, in the following format: /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard /// character is required; replacing it with a project ID is invalid. @@ -1935,285 +1851,3 @@ impl<'a, C, A> ProjectServiceAccountGenerateIdTokenCall<'a, C, A> where C: Borro } -/// Generates an OAuth 2.0 access token for a service account. -/// -/// A builder for the *serviceAccounts.generateAccessToken* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_iamcredentials1 as iamcredentials1; -/// use iamcredentials1::GenerateAccessTokenRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use iamcredentials1::IAMCredentials; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = IAMCredentials::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GenerateAccessTokenRequest::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().service_accounts_generate_access_token(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a IAMCredentials, - _request: GenerateAccessTokenRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> {} - -impl<'a, C, A> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GenerateAccessTokenResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "iamcredentials.projects.serviceAccounts.generateAccessToken", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}:generateAccessToken"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GenerateAccessTokenRequest) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { - self._request = new_value; - self - } - /// The resource name of the service account for which the credentials - /// are requested, in the following format: - /// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - /// character is required; replacing it with a project ID is invalid. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectServiceAccountGenerateAccessTokenCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - diff --git a/gen/iap1-cli/Cargo.toml b/gen/iap1-cli/Cargo.toml index 5b70337beb..b4025b4506 100644 --- a/gen/iap1-cli/Cargo.toml +++ b/gen/iap1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-iap1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud IAP (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iap1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-iap1] path = "../iap1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" diff --git a/gen/iap1-cli/README.md b/gen/iap1-cli/README.md index 0ffca8e33a..163b8131a5 100644 --- a/gen/iap1-cli/README.md +++ b/gen/iap1-cli/README.md @@ -25,14 +25,25 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud IAP* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud IAP* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash iap1 [options] methods get-iam-policy (-r )... [-p ]... [-o ] + get-iap-settings [-p ]... [-o ] set-iam-policy (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] + update-iap-settings (-r )... [-p ]... [-o ] + projects + brands-create (-r )... [-p ]... [-o ] + brands-get [-p ]... [-o ] + brands-identity-aware-proxy-clients-create (-r )... [-p ]... [-o ] + brands-identity-aware-proxy-clients-delete [-p ]... [-o ] + brands-identity-aware-proxy-clients-get [-p ]... [-o ] + brands-identity-aware-proxy-clients-list [-p ]... [-o ] + brands-identity-aware-proxy-clients-reset-secret (-r )... [-p ]... [-o ] + brands-list [-p ]... [-o ] iap1 --help Configuration: diff --git a/gen/iap1-cli/mkdocs.yml b/gen/iap1-cli/mkdocs.yml index 8750e2fc2f..0444c19b40 100644 --- a/gen/iap1-cli/mkdocs.yml +++ b/gen/iap1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud IAP v1.0.12+20190628 +site_name: Cloud IAP v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-iap1-cli site_description: A complete library to interact with Cloud IAP (protocol v1) @@ -10,8 +10,18 @@ site_dir: build_html pages: - ['index.md', 'Home'] - ['methods_get-iam-policy.md', 'Methods', 'Get Iam Policy'] +- ['methods_get-iap-settings.md', 'Methods', 'Get Iap Settings'] - ['methods_set-iam-policy.md', 'Methods', 'Set Iam Policy'] - ['methods_test-iam-permissions.md', 'Methods', 'Test Iam Permissions'] +- ['methods_update-iap-settings.md', 'Methods', 'Update Iap Settings'] +- ['projects_brands-create.md', 'Projects', 'Brands Create'] +- ['projects_brands-get.md', 'Projects', 'Brands Get'] +- ['projects_brands-identity-aware-proxy-clients-create.md', 'Projects', 'Brands Identity Aware Proxy Clients Create'] +- ['projects_brands-identity-aware-proxy-clients-delete.md', 'Projects', 'Brands Identity Aware Proxy Clients Delete'] +- ['projects_brands-identity-aware-proxy-clients-get.md', 'Projects', 'Brands Identity Aware Proxy Clients Get'] +- ['projects_brands-identity-aware-proxy-clients-list.md', 'Projects', 'Brands Identity Aware Proxy Clients List'] +- ['projects_brands-identity-aware-proxy-clients-reset-secret.md', 'Projects', 'Brands Identity Aware Proxy Clients Reset Secret'] +- ['projects_brands-list.md', 'Projects', 'Brands List'] theme: readthedocs diff --git a/gen/iap1-cli/src/main.rs b/gen/iap1-cli/src/main.rs index 64d2f913ae..8788ff9e5b 100644 --- a/gen/iap1-cli/src/main.rs +++ b/gen/iap1-cli/src/main.rs @@ -131,6 +131,58 @@ impl<'n> Engine<'n> { } } + fn _methods_get_iap_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.methods().get_iap_settings(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _methods_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -302,6 +354,637 @@ impl<'n> Engine<'n> { } } + fn _methods_update_iap_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "application-settings.access-denied-page-settings.access-denied-page-uri" => Some(("applicationSettings.accessDeniedPageSettings.accessDeniedPageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "application-settings.csm-settings.rctoken-aud" => Some(("applicationSettings.csmSettings.rctokenAud", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.cors-settings.allow-http-options" => Some(("accessSettings.corsSettings.allowHttpOptions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.policy-name.region" => Some(("accessSettings.policyDelegationSettings.policyName.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.policy-name.type" => Some(("accessSettings.policyDelegationSettings.policyName.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.policy-name.id" => Some(("accessSettings.policyDelegationSettings.policyName.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.iam-service-name" => Some(("accessSettings.policyDelegationSettings.iamServiceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.resource.labels" => Some(("accessSettings.policyDelegationSettings.resource.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "access-settings.policy-delegation-settings.resource.type" => Some(("accessSettings.policyDelegationSettings.resource.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.resource.name" => Some(("accessSettings.policyDelegationSettings.resource.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.resource.service" => Some(("accessSettings.policyDelegationSettings.resource.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.policy-delegation-settings.iam-permission" => Some(("accessSettings.policyDelegationSettings.iamPermission", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.oauth-settings.login-hint" => Some(("accessSettings.oauthSettings.loginHint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.oauth-settings.client-id" => Some(("accessSettings.oauthSettings.clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.gcip-settings.login-page-uri" => Some(("accessSettings.gcipSettings.loginPageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "access-settings.gcip-settings.tenant-ids" => Some(("accessSettings.gcipSettings.tenantIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["access-denied-page-settings", "access-denied-page-uri", "access-settings", "allow-http-options", "application-settings", "client-id", "cors-settings", "csm-settings", "gcip-settings", "iam-permission", "iam-service-name", "id", "labels", "login-hint", "login-page-uri", "name", "oauth-settings", "policy-delegation-settings", "policy-name", "rctoken-aud", "region", "resource", "service", "tenant-ids", "type"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::IapSettings = json::value::from_value(object).unwrap(); + let mut call = self.hub.methods().update_iap_settings(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "application-title" => Some(("applicationTitle", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "org-internal-only" => Some(("orgInternalOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "support-email" => Some(("supportEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["application-title", "name", "org-internal-only", "support-email"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Brand = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().brands_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().brands_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_identity_aware_proxy_clients_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "secret" => Some(("secret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["display-name", "name", "secret"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::IdentityAwareProxyClient = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().brands_identity_aware_proxy_clients_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_identity_aware_proxy_clients_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().brands_identity_aware_proxy_clients_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_identity_aware_proxy_clients_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().brands_identity_aware_proxy_clients_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_identity_aware_proxy_clients_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().brands_identity_aware_proxy_clients_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_identity_aware_proxy_clients_reset_secret(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ResetIdentityAwareProxyClientSecretRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().brands_identity_aware_proxy_clients_reset_secret(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_brands_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().brands_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); @@ -312,18 +995,56 @@ impl<'n> Engine<'n> { ("get-iam-policy", Some(opt)) => { call_result = self._methods_get_iam_policy(opt, dry_run, &mut err); }, + ("get-iap-settings", Some(opt)) => { + call_result = self._methods_get_iap_settings(opt, dry_run, &mut err); + }, ("set-iam-policy", Some(opt)) => { call_result = self._methods_set_iam_policy(opt, dry_run, &mut err); }, ("test-iam-permissions", Some(opt)) => { call_result = self._methods_test_iam_permissions(opt, dry_run, &mut err); }, + ("update-iap-settings", Some(opt)) => { + call_result = self._methods_update_iap_settings(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("methods".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); } } }, + ("projects", Some(opt)) => { + match opt.subcommand() { + ("brands-create", Some(opt)) => { + call_result = self._projects_brands_create(opt, dry_run, &mut err); + }, + ("brands-get", Some(opt)) => { + call_result = self._projects_brands_get(opt, dry_run, &mut err); + }, + ("brands-identity-aware-proxy-clients-create", Some(opt)) => { + call_result = self._projects_brands_identity_aware_proxy_clients_create(opt, dry_run, &mut err); + }, + ("brands-identity-aware-proxy-clients-delete", Some(opt)) => { + call_result = self._projects_brands_identity_aware_proxy_clients_delete(opt, dry_run, &mut err); + }, + ("brands-identity-aware-proxy-clients-get", Some(opt)) => { + call_result = self._projects_brands_identity_aware_proxy_clients_get(opt, dry_run, &mut err); + }, + ("brands-identity-aware-proxy-clients-list", Some(opt)) => { + call_result = self._projects_brands_identity_aware_proxy_clients_list(opt, dry_run, &mut err); + }, + ("brands-identity-aware-proxy-clients-reset-secret", Some(opt)) => { + call_result = self._projects_brands_identity_aware_proxy_clients_reset_secret(opt, dry_run, &mut err); + }, + ("brands-list", Some(opt)) => { + call_result = self._projects_brands_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -409,7 +1130,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("methods", "methods: 'get-iam-policy', 'set-iam-policy' and 'test-iam-permissions'", vec![ + ("methods", "methods: 'get-iam-policy', 'get-iap-settings', 'set-iam-policy', 'test-iam-permissions' and 'update-iap-settings'", vec![ ("get-iam-policy", Some(r##"Gets the access control policy for an Identity-Aware Proxy protected resource. @@ -436,6 +1157,30 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-iap-settings", + Some(r##"Gets the IAP settings on a particular IAP protected resource."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/methods_get-iap-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name for which to retrieve the settings. + Authorization: Requires the `getSettings` permission for the associated + resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -500,6 +1245,257 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-iap-settings", + Some(r##"Updates the IAP settings on a particular IAP protected resource. It + replaces all fields unless the `update_mask` is set."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/methods_update-iap-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the IAP protected resource."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("projects", "methods: 'brands-create', 'brands-get', 'brands-identity-aware-proxy-clients-create', 'brands-identity-aware-proxy-clients-delete', 'brands-identity-aware-proxy-clients-get', 'brands-identity-aware-proxy-clients-list', 'brands-identity-aware-proxy-clients-reset-secret' and 'brands-list'", vec![ + ("brands-create", + Some(r##"Constructs a new OAuth brand for the project if one does not exist. + The created brand is "internal only", meaning that OAuth clients created + under it only accept requests from users who belong to the same G Suite + organization as the project. The brand is created in an un-reviewed status. + NOTE: The "internal only" status can be manually changed in the Google + Cloud console. Requires that a brand does not already exist for the + project, and that the specified support email is owned by the caller."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. GCP Project number/id under which the brand is to be created. + In the following format: projects/{project_number/id}."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("brands-get", + Some(r##"Retrieves the OAuth brand of the project."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the brand to be fetched. + In the following format: projects/{project_number/id}/brands/{brand}."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("brands-identity-aware-proxy-clients-create", + Some(r##"Creates an Identity Aware Proxy (IAP) OAuth client. The client is owned + by IAP. Requires that the brand for the project exists and that it is + set for internal-only use."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-identity-aware-proxy-clients-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Path to create the client in. + In the following format: + projects/{project_number/id}/brands/{brand}. + The project must belong to a GSuite account."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("brands-identity-aware-proxy-clients-delete", + Some(r##"Deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing + obsolete clients, managing the number of clients in a given project, and + cleaning up after tests. Requires that the client is owned by IAP."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-identity-aware-proxy-clients-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the Identity Aware Proxy client to be deleted. + In the following format: + projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("brands-identity-aware-proxy-clients-get", + Some(r##"Retrieves an Identity Aware Proxy (IAP) OAuth client. + Requires that the client is owned by IAP."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-identity-aware-proxy-clients-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the Identity Aware Proxy client to be fetched. + In the following format: + projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("brands-identity-aware-proxy-clients-list", + Some(r##"Lists the existing clients for the brand."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-identity-aware-proxy-clients-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Full brand path. + In the following format: projects/{project_number/id}/brands/{brand}."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("brands-identity-aware-proxy-clients-reset-secret", + Some(r##"Resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the + secret was compromised. Requires that the client is owned by IAP."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-identity-aware-proxy-clients-reset-secret", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the Identity Aware Proxy client to that will have its + secret reset. In the following format: + projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("brands-list", + Some(r##"Lists the existing brands for the project."##), + "Details at http://byron.github.io/google-apis-rs/google_iap1_cli/projects_brands-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. GCP Project number/id. + In the following format: projects/{project_number/id}."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -512,7 +1508,7 @@ fn main() { let mut app = App::new("iap1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200406") .about("Controls access to cloud applications running on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_iap1_cli") .arg(Arg::with_name("url") diff --git a/gen/iap1/Cargo.toml b/gen/iap1/Cargo.toml index ba83ffccf3..3245e63a28 100644 --- a/gen/iap1/Cargo.toml +++ b/gen/iap1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-iap1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud IAP (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iap1" homepage = "https://cloud.google.com/iap" -documentation = "https://docs.rs/google-iap1/1.0.12+20190628" +documentation = "https://docs.rs/google-iap1/1.0.13+20200406" license = "MIT" keywords = ["iap", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/iap1/README.md b/gen/iap1/README.md index 687b1b56ef..2bb47a041e 100644 --- a/gen/iap1/README.md +++ b/gen/iap1/README.md @@ -5,18 +5,24 @@ DO NOT EDIT ! --> The `google-iap1` library allows access to all features of the *Google Cloud IAP* service. -This documentation was generated from *Cloud IAP* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *iap:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud IAP* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *iap:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud IAP* *v1* API can be found at the [official documentation site](https://cloud.google.com/iap). # Features -Use the following functionality with ease from the central [hub](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/struct.CloudIAP.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.CloudIAP.html) ... +* projects + * [*brands create*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandCreateCall.html), [*brands get*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandGetCall.html), [*brands identity aware proxy clients create*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandIdentityAwareProxyClientCreateCall.html), [*brands identity aware proxy clients delete*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandIdentityAwareProxyClientDeleteCall.html), [*brands identity aware proxy clients get*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandIdentityAwareProxyClientGetCall.html), [*brands identity aware proxy clients list*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandIdentityAwareProxyClientListCall.html), [*brands identity aware proxy clients reset secret*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandIdentityAwareProxyClientResetSecretCall.html) and [*brands list*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.ProjectBrandListCall.html) -* [get iam policy](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/struct.MethodGetIamPolicyCall.html) -* [set iam policy](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/struct.MethodSetIamPolicyCall.html) -* [test iam permissions](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/struct.MethodTestIamPermissionCall.html) +Other activities are ... + +* [get iam policy](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.MethodGetIamPolicyCall.html) +* [get iap settings](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.MethodGetIapSettingCall.html) +* [set iam policy](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.MethodSetIamPolicyCall.html) +* [test iam permissions](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.MethodTestIamPermissionCall.html) +* [update iap settings](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.MethodUpdateIapSettingCall.html) @@ -24,17 +30,17 @@ Use the following functionality with ease from the central [hub](https://docs.rs The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/struct.CloudIAP.html)** +* **[Hub](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/struct.CloudIAP.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.Part.html)** + * **[Parts](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -48,8 +54,9 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.methods().get_iam_policy(...).doit() -let r = hub.methods().set_iam_policy(...).doit() +let r = hub.projects().brands_identity_aware_proxy_clients_create(...).doit() +let r = hub.projects().brands_identity_aware_proxy_clients_reset_secret(...).doit() +let r = hub.projects().brands_identity_aware_proxy_clients_get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -83,7 +90,7 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_iap1 as iap1; -use iap1::GetIamPolicyRequest; +use iap1::IdentityAwareProxyClient; use iap1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -104,12 +111,12 @@ let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConne // 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 = GetIamPolicyRequest::default(); +let mut req = IdentityAwareProxyClient::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.methods().get_iam_policy(req, "resource") +let result = hub.projects().brands_identity_aware_proxy_clients_create(req, "parent") .doit(); match result { @@ -132,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-iap1/1.0.12+20190628/google_iap1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-iap1/1.0.13+20200406/google_iap1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/iap1/src/lib.rs b/gen/iap1/src/lib.rs index 7fb7da53a8..d1c3f1a65c 100644 --- a/gen/iap1/src/lib.rs +++ b/gen/iap1/src/lib.rs @@ -2,19 +2,25 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud IAP* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *iap:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud IAP* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *iap:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud IAP* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/iap). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/iap1). //! # Features //! -//! Use the following functionality with ease from the central [hub](struct.CloudIAP.html) ... +//! Handle the following *Resources* with ease from the central [hub](struct.CloudIAP.html) ... //! +//! * projects +//! * [*brands create*](struct.ProjectBrandCreateCall.html), [*brands get*](struct.ProjectBrandGetCall.html), [*brands identity aware proxy clients create*](struct.ProjectBrandIdentityAwareProxyClientCreateCall.html), [*brands identity aware proxy clients delete*](struct.ProjectBrandIdentityAwareProxyClientDeleteCall.html), [*brands identity aware proxy clients get*](struct.ProjectBrandIdentityAwareProxyClientGetCall.html), [*brands identity aware proxy clients list*](struct.ProjectBrandIdentityAwareProxyClientListCall.html), [*brands identity aware proxy clients reset secret*](struct.ProjectBrandIdentityAwareProxyClientResetSecretCall.html) and [*brands list*](struct.ProjectBrandListCall.html) +//! +//! Other activities are ... //! //! * [get iam policy](struct.MethodGetIamPolicyCall.html) +//! * [get iap settings](struct.MethodGetIapSettingCall.html) //! * [set iam policy](struct.MethodSetIamPolicyCall.html) //! * [test iam permissions](struct.MethodTestIamPermissionCall.html) +//! * [update iap settings](struct.MethodUpdateIapSettingCall.html) //! //! //! @@ -48,8 +54,9 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.methods().get_iam_policy(...).doit() -//! let r = hub.methods().set_iam_policy(...).doit() +//! let r = hub.projects().brands_identity_aware_proxy_clients_create(...).doit() +//! let r = hub.projects().brands_identity_aware_proxy_clients_reset_secret(...).doit() +//! let r = hub.projects().brands_identity_aware_proxy_clients_get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -83,7 +90,7 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_iap1 as iap1; -//! use iap1::GetIamPolicyRequest; +//! use iap1::IdentityAwareProxyClient; //! use iap1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -105,12 +112,12 @@ //! // 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 = GetIamPolicyRequest::default(); +//! let mut req = IdentityAwareProxyClient::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.methods().get_iam_policy(req, "resource") +//! let result = hub.projects().brands_identity_aware_proxy_clients_create(req, "parent") //! .doit(); //! //! match result { @@ -266,7 +273,7 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_iap1 as iap1; -/// use iap1::GetIamPolicyRequest; +/// use iap1::IdentityAwareProxyClient; /// use iap1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -288,12 +295,12 @@ impl Default for Scope { /// // 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 = GetIamPolicyRequest::default(); +/// let mut req = IdentityAwareProxyClient::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.methods().get_iam_policy(req, "resource") +/// let result = hub.projects().brands_identity_aware_proxy_clients_create(req, "parent") /// .doit(); /// /// match result { @@ -331,7 +338,7 @@ impl<'a, C, A> CloudIAP CloudIAP { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://iap.googleapis.com/".to_string(), _root_url: "https://iap.googleapis.com/".to_string(), } @@ -340,9 +347,12 @@ impl<'a, C, A> CloudIAP pub fn methods(&'a self) -> MethodMethods<'a, C, A> { MethodMethods { hub: &self } } + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { hub: &self } + } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -370,42 +380,125 @@ impl<'a, C, A> CloudIAP // ############ // SCHEMAS ### // ########## -/// Response message for `TestIamPermissions` method. +/// Allows customers to configure HTTP request paths that'll allow HTTP OPTIONS +/// call to bypass authentication and authorization. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [test iam permissions](struct.MethodTestIamPermissionCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - pub permissions: Option>, +pub struct CorsSettings { + /// Configuration to allow HTTP OPTIONS calls to skip authorization. If + /// undefined, IAP will not apply any special logic to OPTIONS requests. + #[serde(rename="allowHttpOptions")] + pub allow_http_options: Option, } -impl ResponseResult for TestIamPermissionsResponse {} +impl Part for CorsSettings {} -/// Request message for `GetIamPolicy` method. +/// There is no detailed description. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get iam policy](struct.MethodGetIamPolicyCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { - /// OPTIONAL: A `GetPolicyOptions` object for specifying options to - /// `GetIamPolicy`. This field is only used by Cloud IAM. - pub options: Option, +pub struct PolicyName { + /// For Cloud IAM: + /// The location of the Policy. + /// Must be empty or "global" for Policies owned by global IAM. Must name a + /// region from prodspec/cloud-iam-cloudspec for Regional IAM Policies, see + /// http://go/iam-faq#where-is-iam-currently-deployed. + /// + /// For Local IAM: + /// This field should be set to "local". + pub region: Option, + /// Valid values for type might be 'gce', 'gcs', 'project', 'account' etc. + #[serde(rename="type")] + pub type_: Option, + /// no description provided + pub id: Option, } -impl RequestValue for GetIamPolicyRequest {} +impl Part for PolicyName {} + + +/// Configuration for OAuth login&consent flow behavior as well as for OAuth +/// Credentials. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OAuthSettings { + /// Domain hint to send as hd=? parameter in OAuth request flow. Enables + /// redirect to primary IDP by skipping Google's login screen. + /// https://developers.google.com/identity/protocols/OpenIDConnect#hd-param + /// Note: IAP does not verify that the id token's hd claim matches this value + /// since access behavior is managed by IAM policies. + #[serde(rename="loginHint")] + pub login_hint: Option, + /// OAuth 2.0 client ID used in the OAuth flow to generate an access token. If + /// this field is set, you can skip obtaining the OAuth credentials in this + /// step: + /// https://developers.google.com/identity/protocols/OAuth2?hl=en_US#1.-obtain-oauth-2.0-credentials-from-the-google-api-console. + /// However, this could allow for client sharing. The risks of client sharing + /// are outlined here: + /// https://cloud.google.com/iap/docs/sharing-oauth-clients#risks. + #[serde(rename="clientId")] + pub client_id: Option, +} + +impl Part for OAuthSettings {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceType { + /// The service defined labels of the resource on which the conditions will be + /// evaluated. The semantics - including the key names - are vague to IAM. + /// If the effective condition has a reference to a `resource.labels[foo]` + /// construct, IAM consults with this map to retrieve the values associated + /// with `foo` key for Conditions evaluation. If the provided key is not found + /// in the labels map, the condition would evaluate to false. + /// + /// This field is in limited use. If your intended use case is not expected + /// to express resource.labels attribute in IAM Conditions, leave this field + /// empty. Before planning on using this attribute please: + /// * Read go/iam-conditions-labels-comm and ensure your service can meet the + /// data availability and management requirements. + /// * Talk to iam-conditions-eng@ about your use case. + pub labels: Option>, + /// The public resource type name of the resource on which conditions will be + /// evaluated. It is configured using the official_name of the ResourceType as + /// defined in service configurations under //configs/cloud/resourcetypes. + /// For example, the official_name for GCP projects is set as + /// 'cloudresourcemanager.googleapis.com/Project' according to + /// //configs/cloud/resourcetypes/google/cloud/resourcemanager/prod.yaml + /// For details see go/iam-conditions-integration-guide. + #[serde(rename="type")] + pub type_: Option, + /// Name of the resource on which conditions will be evaluated. + /// Must use the Relative Resource Name of the resource, which is the URI + /// path of the resource without the leading "/". Examples are + /// "projects/_/buckets/[BUCKET-ID]" for storage buckets or + /// "projects/[PROJECT-ID]/global/firewalls/[FIREWALL-ID]" for a firewall. + /// + /// This field is required for evaluating conditions with rules on resource + /// names. For a `list` permission check, the resource.name value must be set + /// to the parent resource. If the parent resource is a project, this field + /// should be left unset. + pub name: Option, + /// The name of the service this resource belongs to. It is configured using + /// the official_service_name of the Service as defined in service + /// configurations under //configs/cloud/resourcetypes. + /// For example, the official_service_name of cloud resource manager service + /// is set as 'cloudresourcemanager.googleapis.com' according to + /// //configs/cloud/resourcetypes/google/cloud/resourcemanager/prod.yaml + pub service: Option, +} + +impl Part for ResourceType {} /// Request message for `TestIamPermissions` method. @@ -450,6 +543,355 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} +/// Response message for ListIdentityAwareProxyClients. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [brands identity aware proxy clients list projects](struct.ProjectBrandIdentityAwareProxyClientListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListIdentityAwareProxyClientsResponse { + /// A token, which can be send as `page_token` to retrieve the next page. + /// If this field is omitted, there are no subsequent pages. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Clients existing in the brand. + #[serde(rename="identityAwareProxyClients")] + pub identity_aware_proxy_clients: Option>, +} + +impl ResponseResult for ListIdentityAwareProxyClientsResponse {} + + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// ````text +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// ```` +/// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// Optional. Description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language + /// syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for Expr {} + + +/// Request message for `GetIamPolicy` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get iam policy](struct.MethodGetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} + +impl RequestValue for GetIamPolicyRequest {} + + +/// Access related settings for IAP protected apps. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccessSettings { + /// Configuration to allow cross-origin requests via IAP. + #[serde(rename="corsSettings")] + pub cors_settings: Option, + /// Settings to configure Policy delegation for apps hosted in tenant projects. + /// INTERNAL_ONLY. + #[serde(rename="policyDelegationSettings")] + pub policy_delegation_settings: Option, + /// Settings to configure IAP's OAuth behavior. + #[serde(rename="oauthSettings")] + pub oauth_settings: Option, + /// GCIP claims and endpoint configurations for 3p identity providers. + #[serde(rename="gcipSettings")] + pub gcip_settings: Option, +} + +impl Part for AccessSettings {} + + +/// Configuration for RCTokens generated for CSM workloads protected by IAP. +/// RCTokens are IAP generated JWTs that can be verified at the application. The +/// RCToken is primarily used for ISTIO deployments, and can be scoped to a +/// single mesh by configuring the audience field accordingly +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CsmSettings { + /// Audience claim set in the generated RCToken. This value is not validated by + /// IAP. + #[serde(rename="rctokenAud")] + pub rctoken_aud: Option, +} + +impl Part for CsmSettings {} + + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. +/// +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** +/// +/// ````text +/// { +/// "bindings": [ +/// { +/// "role": "roles/resourcemanager.organizationAdmin", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +/// ] +/// }, +/// { +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } +/// } +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 +/// } +/// ```` +/// +/// **YAML example:** +/// +/// ````text +/// bindings: +/// - members: +/// - user:mike@example.com +/// - group:admins@example.com +/// - domain:google.com +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin +/// - members: +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 +/// ```` +/// +/// For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get iam policy](struct.MethodGetIamPolicyCall.html) (response) +/// * [set iam policy](struct.MethodSetIamPolicyCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. + pub bindings: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + pub etag: Option, + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. + pub version: Option, +} + +impl ResponseResult for Policy {} + + +/// Wrapper over application specific settings for IAP. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ApplicationSettings { + /// Customization for Access Denied page. + #[serde(rename="accessDeniedPageSettings")] + pub access_denied_page_settings: Option, + /// Settings to configure IAP's behavior for a CSM mesh. + #[serde(rename="csmSettings")] + pub csm_settings: Option, +} + +impl Part for ApplicationSettings {} + + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// ````text +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +/// ```` +/// +/// The JSON representation for `Empty` is empty JSON object `{}`. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [brands identity aware proxy clients delete projects](struct.ProjectBrandIdentityAwareProxyClientDeleteCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// Response message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [test iam permissions](struct.MethodTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + pub permissions: Option>, +} + +impl ResponseResult for TestIamPermissionsResponse {} + + +/// Allows customers to configure tenant_id for GCIP instance per-app. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GcipSettings { + /// Login page URI associated with the GCIP tenants. + /// Typically, all resources within the same project share the same login page, + /// though it could be overridden at the sub resource level. + #[serde(rename="loginPageUri")] + pub login_page_uri: Option, + /// GCIP tenant ids that are linked to the IAP resource. + /// tenant_ids could be a string beginning with a number character to indicate + /// authenticating with GCIP tenant flow, or in the format of _ + /// to indicate authenticating with GCIP agent flow. + /// If agent flow is used, tenant_ids should only contain one single element, + /// while for tenant flow, tenant_ids can contain multiple elements. + #[serde(rename="tenantIds")] + pub tenant_ids: Option>, +} + +impl Part for GcipSettings {} + + /// Encapsulates settings provided to GetIamPolicy. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -457,9 +899,13 @@ impl RequestValue for SetIamPolicyRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetPolicyOptions { /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. #[serde(rename="requestedPolicyVersion")] pub requested_policy_version: Option, } @@ -467,36 +913,52 @@ pub struct GetPolicyOptions { impl Part for GetPolicyOptions {} -/// Represents an expression text. Example: +/// The request sent to ResetIdentityAwareProxyClientSecret. /// -/// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" -/// ```` +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [brands identity aware proxy clients reset secret projects](struct.ProjectBrandIdentityAwareProxyClientResetSecretCall.html) (request) /// -/// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Expr { - /// An optional description of the expression. This is a longer text which - /// describes the expression, e.g. when hovered over it in a UI. - pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. - pub expression: Option, - /// An optional string indicating the location of the expression for error - /// reporting, e.g. a file name and a position in the file. - pub location: Option, - /// An optional title for the expression, i.e. a short string describing - /// its purpose. This can be used e.g. in UIs which allow to enter the - /// expression. - pub title: Option, +pub struct ResetIdentityAwareProxyClientSecretRequest { _never_set: Option } + +impl RequestValue for ResetIdentityAwareProxyClientSecretRequest {} + + +/// OAuth brand data. +/// NOTE: Only contains a portion of the data that describes a brand. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [brands create projects](struct.ProjectBrandCreateCall.html) (request|response) +/// * [brands get projects](struct.ProjectBrandGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Brand { + /// Application name displayed on OAuth consent screen. + #[serde(rename="applicationTitle")] + pub application_title: Option, + /// Output only. Whether the brand is only intended for usage inside the + /// GSuite organization only. + #[serde(rename="orgInternalOnly")] + pub org_internal_only: Option, + /// Support email displayed on the OAuth consent screen. + #[serde(rename="supportEmail")] + pub support_email: Option, + /// Output only. Identifier of the brand. + /// NOTE: GCP project number achieves the same brand identification purpose as + /// only one brand per project can be created. + pub name: Option, } -impl Part for Expr {} +impl RequestValue for Brand {} +impl ResponseResult for Brand {} /// Associates `members` with a `role`. @@ -523,7 +985,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -532,6 +994,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -543,82 +1025,121 @@ pub struct Binding { impl Part for Binding {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// Custom content configuration for access denied page. +/// IAP allows customers to define a custom URI to use as the error page when +/// access is denied to users. If IAP prevents access to this page, the default +/// IAP error page will be displayed instead. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// This type is not used in any activity, and only used as *part* of another schema. /// -/// **JSON Example** -/// -/// ````text -/// { -/// "bindings": [ -/// { -/// "role": "roles/owner", -/// "members": [ -/// "user:mike@example.com", -/// "group:admins@example.com", -/// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" -/// ] -/// }, -/// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] -/// } -/// ] -/// } -/// ```` -/// -/// **YAML Example** -/// -/// ````text -/// bindings: -/// - members: -/// - user:mike@example.com -/// - group:admins@example.com -/// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner -/// - members: -/// - user:sean@example.com -/// role: roles/viewer -/// ```` -/// -/// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AccessDeniedPageSettings { + /// The URI to be redirected to when access is denied. + #[serde(rename="accessDeniedPageUri")] + pub access_denied_page_uri: Option, +} + +impl Part for AccessDeniedPageSettings {} + + +/// Response message for ListBrands. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [get iam policy](struct.MethodGetIamPolicyCall.html) (response) -/// * [set iam policy](struct.MethodSetIamPolicyCall.html) (response) +/// * [brands list projects](struct.ProjectBrandListCall.html) (response) +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, - /// `etag` is used for optimistic concurrency control as a way to help - /// prevent simultaneous updates of a policy from overwriting each other. - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the policy. - /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. - pub etag: Option, - /// Deprecated. - pub version: Option, +pub struct ListBrandsResponse { + /// Brands existing in the project. + pub brands: Option>, } -impl ResponseResult for Policy {} +impl ResponseResult for ListBrandsResponse {} + + +/// Contains the data that describes an Identity Aware Proxy owned client. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [brands identity aware proxy clients create projects](struct.ProjectBrandIdentityAwareProxyClientCreateCall.html) (request|response) +/// * [brands identity aware proxy clients reset secret projects](struct.ProjectBrandIdentityAwareProxyClientResetSecretCall.html) (response) +/// * [brands identity aware proxy clients get projects](struct.ProjectBrandIdentityAwareProxyClientGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IdentityAwareProxyClient { + /// Output only. Client secret of the OAuth client. + pub secret: Option, + /// Human-friendly name given to the OAuth client. + #[serde(rename="displayName")] + pub display_name: Option, + /// Output only. Unique identifier of the OAuth client. + pub name: Option, +} + +impl RequestValue for IdentityAwareProxyClient {} +impl ResponseResult for IdentityAwareProxyClient {} + + +/// PolicyDelegationConfig allows google-internal teams to use IAP for apps +/// hosted in a tenant project. Using these settings, the app can delegate +/// permission check to happen against the linked customer project. +/// This is only ever supposed to be used by google internal teams, hence the +/// restriction on the proto. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PolicyDelegationSettings { + /// Policy name to be checked + #[serde(rename="policyName")] + pub policy_name: Option, + /// Permission to check in IAM. + #[serde(rename="iamPermission")] + pub iam_permission: Option, + /// IAM resource to check permission on + pub resource: Option, + /// The DNS name of the service (e.g. "resourcemanager.googleapis.com"). + /// This should be the domain name part of the full resource names (see + /// https://aip.dev/122#full-resource-names), which is usually + /// the same as IamServiceSpec.service of the service where the resource type + /// is defined. + #[serde(rename="iamServiceName")] + pub iam_service_name: Option, +} + +impl Part for PolicyDelegationSettings {} + + +/// The IAP configurable settings. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update iap settings](struct.MethodUpdateIapSettingCall.html) (request|response) +/// * [get iap settings](struct.MethodGetIapSettingCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IapSettings { + /// Top level wrapper for all application related settings in IAP + #[serde(rename="applicationSettings")] + pub application_settings: Option, + /// Top level wrapper for all access related setting in IAP + #[serde(rename="accessSettings")] + pub access_settings: Option, + /// Required. The resource name of the IAP protected resource. + pub name: Option, +} + +impl RequestValue for IapSettings {} +impl ResponseResult for IapSettings {} @@ -650,7 +1171,7 @@ impl ResponseResult for Policy {} /// ::default(), None); /// let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get_iam_policy(...)`, `set_iam_policy(...)` and `test_iam_permissions(...)` +/// // like `get_iam_policy(...)`, `get_iap_settings(...)`, `set_iam_policy(...)`, `test_iam_permissions(...)` and `update_iap_settings(...)` /// // to build up your call. /// let rb = hub.methods(); /// # } @@ -665,6 +1186,29 @@ impl<'a, C, A> MethodsBuilder for MethodMethods<'a, C, A> {} impl<'a, C, A> MethodMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy for an Identity-Aware Proxy protected + /// resource. Replaces any existing policy. + /// More information about managing access via IAP can be found at: + /// https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> MethodSetIamPolicyCall<'a, C, A> { + MethodSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the access control policy for an Identity-Aware Proxy protected @@ -713,21 +1257,249 @@ impl<'a, C, A> MethodMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy for an Identity-Aware Proxy protected - /// resource. Replaces any existing policy. - /// More information about managing access via IAP can be found at: - /// https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api + /// Updates the IAP settings on a particular IAP protected resource. It + /// replaces all fields unless the `update_mask` is set. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. - pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> MethodSetIamPolicyCall<'a, C, A> { - MethodSetIamPolicyCall { + /// * `name` - Required. The resource name of the IAP protected resource. + pub fn update_iap_settings(&self, request: IapSettings, name: &str) -> MethodUpdateIapSettingCall<'a, C, A> { + MethodUpdateIapSettingCall { hub: self.hub, _request: request, - _resource: resource.to_string(), + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the IAP settings on a particular IAP protected resource. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name for which to retrieve the settings. + /// Authorization: Requires the `getSettings` permission for the associated + /// resource. + pub fn get_iap_settings(&self, name: &str) -> MethodGetIapSettingCall<'a, C, A> { + MethodGetIapSettingCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudIAP` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_iap1 as iap1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use iap1::CloudIAP; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `brands_create(...)`, `brands_get(...)`, `brands_identity_aware_proxy_clients_create(...)`, `brands_identity_aware_proxy_clients_delete(...)`, `brands_identity_aware_proxy_clients_get(...)`, `brands_identity_aware_proxy_clients_list(...)`, `brands_identity_aware_proxy_clients_reset_secret(...)` and `brands_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates an Identity Aware Proxy (IAP) OAuth client. The client is owned + /// by IAP. Requires that the brand for the project exists and that it is + /// set for internal-only use. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. Path to create the client in. + /// In the following format: + /// projects/{project_number/id}/brands/{brand}. + /// The project must belong to a GSuite account. + pub fn brands_identity_aware_proxy_clients_create(&self, request: IdentityAwareProxyClient, parent: &str) -> ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> { + ProjectBrandIdentityAwareProxyClientCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the existing clients for the brand. + /// + /// # Arguments + /// + /// * `parent` - Required. Full brand path. + /// In the following format: projects/{project_number/id}/brands/{brand}. + pub fn brands_identity_aware_proxy_clients_list(&self, parent: &str) -> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> { + ProjectBrandIdentityAwareProxyClientListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the OAuth brand of the project. + /// + /// # Arguments + /// + /// * `name` - Required. Name of the brand to be fetched. + /// In the following format: projects/{project_number/id}/brands/{brand}. + pub fn brands_get(&self, name: &str) -> ProjectBrandGetCall<'a, C, A> { + ProjectBrandGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Constructs a new OAuth brand for the project if one does not exist. + /// The created brand is "internal only", meaning that OAuth clients created + /// under it only accept requests from users who belong to the same G Suite + /// organization as the project. The brand is created in an un-reviewed status. + /// NOTE: The "internal only" status can be manually changed in the Google + /// Cloud console. Requires that a brand does not already exist for the + /// project, and that the specified support email is owned by the caller. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. GCP Project number/id under which the brand is to be created. + /// In the following format: projects/{project_number/id}. + pub fn brands_create(&self, request: Brand, parent: &str) -> ProjectBrandCreateCall<'a, C, A> { + ProjectBrandCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the existing brands for the project. + /// + /// # Arguments + /// + /// * `parent` - Required. GCP Project number/id. + /// In the following format: projects/{project_number/id}. + pub fn brands_list(&self, parent: &str) -> ProjectBrandListCall<'a, C, A> { + ProjectBrandListCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing + /// obsolete clients, managing the number of clients in a given project, and + /// cleaning up after tests. Requires that the client is owned by IAP. + /// + /// # Arguments + /// + /// * `name` - Required. Name of the Identity Aware Proxy client to be deleted. + /// In the following format: + /// projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + pub fn brands_identity_aware_proxy_clients_delete(&self, name: &str) -> ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> { + ProjectBrandIdentityAwareProxyClientDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the + /// secret was compromised. Requires that the client is owned by IAP. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Name of the Identity Aware Proxy client to that will have its + /// secret reset. In the following format: + /// projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + pub fn brands_identity_aware_proxy_clients_reset_secret(&self, request: ResetIdentityAwareProxyClientSecretRequest, name: &str) -> ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> { + ProjectBrandIdentityAwareProxyClientResetSecretCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves an Identity Aware Proxy (IAP) OAuth client. + /// Requires that the client is owned by IAP. + /// + /// # Arguments + /// + /// * `name` - Required. Name of the Identity Aware Proxy client to be fetched. + /// In the following format: + /// projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + pub fn brands_identity_aware_proxy_clients_get(&self, name: &str) -> ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> { + ProjectBrandIdentityAwareProxyClientGetCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -743,6 +1515,289 @@ impl<'a, C, A> MethodMethods<'a, C, A> { // CallBuilders ### // ################# +/// Sets the access control policy for an Identity-Aware Proxy protected +/// resource. Replaces any existing policy. +/// More information about managing access via IAP can be found at: +/// https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api +/// +/// A builder for the *setIamPolicy* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// use iap1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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.methods().set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct MethodSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MethodSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> MethodSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> MethodSetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MethodSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MethodSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the access control policy for an Identity-Aware Proxy protected /// resource. /// More information about managing access via IAP can be found at: @@ -1309,12 +2364,10 @@ impl<'a, C, A> MethodTestIamPermissionCall<'a, C, A> where C: BorrowMut MethodTestIamPermissionCall<'a, C, A> where C: BorrowMut MethodTestIamPermissionCall<'a, C, A> where C: BorrowMut +pub struct MethodUpdateIapSettingCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudIAP, - _request: SetIamPolicyRequest, - _resource: String, + _request: IapSettings, + _name: String, + _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for MethodSetIamPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for MethodUpdateIapSettingCall<'a, C, A> {} -impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> MethodUpdateIapSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, IapSettings)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -1375,11 +2430,14 @@ impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "iap.setIamPolicy", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + dlg.begin(MethodInfo { id: "iap.updateIapSettings", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1391,12 +2449,12 @@ impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["resource"].iter() { + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: IapSettings) -> MethodUpdateIapSettingCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the IAP protected resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> MethodUpdateIapSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The field mask specifying which IAP settings should be updated. + /// If omitted, the all of the settings are updated. See + /// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> MethodUpdateIapSettingCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MethodUpdateIapSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodUpdateIapSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MethodUpdateIapSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the IAP settings on a particular IAP protected resource. +/// +/// A builder for the *getIapSettings* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.methods().get_iap_settings("name") +/// .doit(); +/// # } +/// ``` +pub struct MethodGetIapSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MethodGetIapSettingCall<'a, C, A> {} + +impl<'a, C, A> MethodGetIapSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, IapSettings)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.getIapSettings", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:iapSettings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name for which to retrieve the settings. + /// Authorization: Requires the `getSettings` permission for the associated + /// resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> MethodGetIapSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MethodGetIapSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodGetIapSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MethodGetIapSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates an Identity Aware Proxy (IAP) OAuth client. The client is owned +/// by IAP. Requires that the brand for the project exists and that it is +/// set for internal-only use. +/// +/// A builder for the *brands.identityAwareProxyClients.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// use iap1::IdentityAwareProxyClient; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = IdentityAwareProxyClient::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().brands_identity_aware_proxy_clients_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _request: IdentityAwareProxyClient, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, IdentityAwareProxyClient)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.identityAwareProxyClients.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/identityAwareProxyClients"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -1514,19 +3112,21 @@ impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut MethodSetIamPolicyCall<'a, C, A> { + pub fn request(mut self, new_value: IdentityAwareProxyClient) -> ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The resource for which the policy is being specified. - /// See the operation documentation for the appropriate value for this field. + /// Required. Path to create the client in. + /// In the following format: + /// projects/{project_number/id}/brands/{brand}. + /// The project must belong to a GSuite account. /// - /// Sets the *resource* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> MethodSetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> { + self._parent = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -1535,7 +3135,7 @@ impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut MethodSetIamPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1560,7 +3160,7 @@ impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> MethodSetIamPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -1580,7 +3180,1857 @@ impl<'a, C, A> MethodSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> MethodSetIamPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectBrandIdentityAwareProxyClientCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the existing clients for the brand. +/// +/// A builder for the *brands.identityAwareProxyClients.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().brands_identity_aware_proxy_clients_list("parent") +/// .page_token("erat") +/// .page_size(-35) +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListIdentityAwareProxyClientsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.identityAwareProxyClients.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/identityAwareProxyClients"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Full brand path. + /// In the following format: projects/{project_number/id}/brands/{brand}. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// A page token, received from a previous `ListIdentityAwareProxyClients` + /// call. Provide this to retrieve the subsequent page. + /// + /// When paginating, all other parameters provided to + /// `ListIdentityAwareProxyClients` must match the call that provided the page + /// token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of clients to return. The service may return fewer than + /// this value. + /// If unspecified, at most 100 clients will be returned. + /// The maximum value is 1000; values above 1000 will be coerced to 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBrandIdentityAwareProxyClientListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves the OAuth brand of the project. +/// +/// A builder for the *brands.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().brands_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Brand)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the brand to be fetched. + /// In the following format: projects/{project_number/id}/brands/{brand}. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectBrandGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBrandGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBrandGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Constructs a new OAuth brand for the project if one does not exist. +/// The created brand is "internal only", meaning that OAuth clients created +/// under it only accept requests from users who belong to the same G Suite +/// organization as the project. The brand is created in an un-reviewed status. +/// NOTE: The "internal only" status can be manually changed in the Google +/// Cloud console. Requires that a brand does not already exist for the +/// project, and that the specified support email is owned by the caller. +/// +/// A builder for the *brands.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// use iap1::Brand; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Brand::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().brands_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _request: Brand, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Brand)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/brands"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Brand) -> ProjectBrandCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. GCP Project number/id under which the brand is to be created. + /// In the following format: projects/{project_number/id}. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectBrandCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBrandCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBrandCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the existing brands for the project. +/// +/// A builder for the *brands.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().brands_list("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandListCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBrandsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/brands"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. GCP Project number/id. + /// In the following format: projects/{project_number/id}. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectBrandListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBrandListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBrandListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing +/// obsolete clients, managing the number of clients in a given project, and +/// cleaning up after tests. Requires that the client is owned by IAP. +/// +/// A builder for the *brands.identityAwareProxyClients.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().brands_identity_aware_proxy_clients_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.identityAwareProxyClients.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the Identity Aware Proxy client to be deleted. + /// In the following format: + /// projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBrandIdentityAwareProxyClientDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the +/// secret was compromised. Requires that the client is owned by IAP. +/// +/// A builder for the *brands.identityAwareProxyClients.resetSecret* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// use iap1::ResetIdentityAwareProxyClientSecretRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ResetIdentityAwareProxyClientSecretRequest::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().brands_identity_aware_proxy_clients_reset_secret(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _request: ResetIdentityAwareProxyClientSecretRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, IdentityAwareProxyClient)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.identityAwareProxyClients.resetSecret", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:resetSecret"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ResetIdentityAwareProxyClientSecretRequest) -> ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Name of the Identity Aware Proxy client to that will have its + /// secret reset. In the following format: + /// projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBrandIdentityAwareProxyClientResetSecretCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Retrieves an Identity Aware Proxy (IAP) OAuth client. +/// Requires that the client is owned by IAP. +/// +/// A builder for the *brands.identityAwareProxyClients.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_iap1 as iap1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use iap1::CloudIAP; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudIAP::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().brands_identity_aware_proxy_clients_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudIAP, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, IdentityAwareProxyClient)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iap.projects.brands.identityAwareProxyClients.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the Identity Aware Proxy client to be fetched. + /// In the following format: + /// projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectBrandIdentityAwareProxyClientGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/iap1_beta1-cli/Cargo.toml b/gen/iap1_beta1-cli/Cargo.toml index 6fdbba68e3..9bab5696de 100644 --- a/gen/iap1_beta1-cli/Cargo.toml +++ b/gen/iap1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-iap1_beta1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud IAP (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iap1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-iap1_beta1] path = "../iap1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" diff --git a/gen/iap1_beta1-cli/README.md b/gen/iap1_beta1-cli/README.md index 0e62fced21..8f98c340a2 100644 --- a/gen/iap1_beta1-cli/README.md +++ b/gen/iap1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud IAP* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud IAP* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash iap1-beta1 [options] diff --git a/gen/iap1_beta1-cli/mkdocs.yml b/gen/iap1_beta1-cli/mkdocs.yml index 2eb1b3d818..0b9308cafd 100644 --- a/gen/iap1_beta1-cli/mkdocs.yml +++ b/gen/iap1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud IAP v1.0.12+20190628 +site_name: Cloud IAP v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-iap1_beta1-cli site_description: A complete library to interact with Cloud IAP (protocol v1beta1) diff --git a/gen/iap1_beta1-cli/src/main.rs b/gen/iap1_beta1-cli/src/main.rs index 33b9fe3fb0..ed721bf8ca 100644 --- a/gen/iap1_beta1-cli/src/main.rs +++ b/gen/iap1_beta1-cli/src/main.rs @@ -514,7 +514,7 @@ fn main() { let mut app = App::new("iap1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200406") .about("Controls access to cloud applications running on Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_iap1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/iap1_beta1/Cargo.toml b/gen/iap1_beta1/Cargo.toml index 4d6696f7c9..7ba90cd805 100644 --- a/gen/iap1_beta1/Cargo.toml +++ b/gen/iap1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-iap1_beta1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud IAP (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/iap1_beta1" homepage = "https://cloud.google.com/iap" -documentation = "https://docs.rs/google-iap1_beta1/1.0.12+20190628" +documentation = "https://docs.rs/google-iap1_beta1/1.0.13+20200406" license = "MIT" keywords = ["iap", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/iap1_beta1/README.md b/gen/iap1_beta1/README.md index 55e3300fe3..d5d75584df 100644 --- a/gen/iap1_beta1/README.md +++ b/gen/iap1_beta1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-iap1_beta1` library allows access to all features of the *Google Cloud IAP* service. -This documentation was generated from *Cloud IAP* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *iap:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud IAP* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *iap:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud IAP* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/iap). # Features -Use the following functionality with ease from the central [hub](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/struct.CloudIAP.html) ... +Use the following functionality with ease from the central [hub](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/struct.CloudIAP.html) ... -* [get iam policy](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/struct.MethodGetIamPolicyCall.html) -* [set iam policy](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/struct.MethodSetIamPolicyCall.html) -* [test iam permissions](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/struct.MethodTestIamPermissionCall.html) +* [get iam policy](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/struct.MethodGetIamPolicyCall.html) +* [set iam policy](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/struct.MethodSetIamPolicyCall.html) +* [test iam permissions](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/struct.MethodTestIamPermissionCall.html) @@ -24,17 +24,17 @@ Use the following functionality with ease from the central [hub](https://docs.rs The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/struct.CloudIAP.html)** +* **[Hub](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/struct.CloudIAP.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-iap1_beta1/1.0.12+20190628/google_iap1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-iap1_beta1/1.0.13+20200406/google_iap1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/iap1_beta1/src/lib.rs b/gen/iap1_beta1/src/lib.rs index b62995d7cf..34fe481f80 100644 --- a/gen/iap1_beta1/src/lib.rs +++ b/gen/iap1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud IAP* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *iap:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud IAP* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *iap:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud IAP* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/iap). @@ -331,7 +331,7 @@ impl<'a, C, A> CloudIAP CloudIAP { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://iap.googleapis.com/".to_string(), _root_url: "https://iap.googleapis.com/".to_string(), } @@ -342,7 +342,7 @@ impl<'a, C, A> CloudIAP } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -457,9 +457,13 @@ impl RequestValue for SetIamPolicyRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetPolicyOptions { /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. #[serde(rename="requestedPolicyVersion")] pub requested_policy_version: Option, } @@ -467,30 +471,59 @@ pub struct GetPolicyOptions { impl Part for GetPolicyOptions {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -523,7 +556,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -532,6 +565,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -543,37 +596,50 @@ pub struct Binding { impl Part for Binding {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -581,15 +647,21 @@ impl Part for Binding {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -600,8 +672,9 @@ impl Part for Binding {} /// * [set iam policy](struct.MethodSetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -611,10 +684,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } diff --git a/gen/identitytoolkit3-cli/Cargo.toml b/gen/identitytoolkit3-cli/Cargo.toml index 5b4b4828fc..23e509bb84 100644 --- a/gen/identitytoolkit3-cli/Cargo.toml +++ b/gen/identitytoolkit3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-identitytoolkit3-cli" -version = "1.0.12+20180723" +version = "1.0.13+20180723" authors = ["Sebastian Thiel "] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-identitytoolkit3] path = "../identitytoolkit3" -version = "1.0.12+20180723" +version = "1.0.13+20180723" diff --git a/gen/identitytoolkit3-cli/README.md b/gen/identitytoolkit3-cli/README.md index a96505c6b6..53b81a7a0a 100644 --- a/gen/identitytoolkit3-cli/README.md +++ b/gen/identitytoolkit3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Identity Toolkit* API at revision *20180723*. The CLI is at version *1.0.12*. +This documentation was generated from the *Identity Toolkit* API at revision *20180723*. The CLI is at version *1.0.13*. ```bash identitytoolkit3 [options] diff --git a/gen/identitytoolkit3-cli/mkdocs.yml b/gen/identitytoolkit3-cli/mkdocs.yml index 157b44ce34..a46b88e494 100644 --- a/gen/identitytoolkit3-cli/mkdocs.yml +++ b/gen/identitytoolkit3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Identity Toolkit v1.0.12+20180723 +site_name: Identity Toolkit v1.0.13+20180723 site_url: http://byron.github.io/google-apis-rs/google-identitytoolkit3-cli site_description: A complete library to interact with Identity Toolkit (protocol v3) diff --git a/gen/identitytoolkit3-cli/src/main.rs b/gen/identitytoolkit3-cli/src/main.rs index 808322d7e4..1a473d6f73 100644 --- a/gen/identitytoolkit3-cli/src/main.rs +++ b/gen/identitytoolkit3-cli/src/main.rs @@ -2392,7 +2392,7 @@ fn main() { let mut app = App::new("identitytoolkit3") .author("Sebastian Thiel ") - .version("1.0.12+20180723") + .version("1.0.13+20180723") .about("Help the third party sites to implement federated login.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_identitytoolkit3_cli") .arg(Arg::with_name("url") diff --git a/gen/identitytoolkit3/Cargo.toml b/gen/identitytoolkit3/Cargo.toml index 103d00a4e3..c0ebab917b 100644 --- a/gen/identitytoolkit3/Cargo.toml +++ b/gen/identitytoolkit3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-identitytoolkit3" -version = "1.0.12+20180723" +version = "1.0.13+20180723" authors = ["Sebastian Thiel "] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3" homepage = "https://developers.google.com/identity-toolkit/v3/" -documentation = "https://docs.rs/google-identitytoolkit3/1.0.12+20180723" +documentation = "https://docs.rs/google-identitytoolkit3/1.0.13+20180723" license = "MIT" keywords = ["identitytoolkit", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/identitytoolkit3/README.md b/gen/identitytoolkit3/README.md index 5e2a22a359..76f773de65 100644 --- a/gen/identitytoolkit3/README.md +++ b/gen/identitytoolkit3/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-identitytoolkit3` library allows access to all features of the *Google Identity Toolkit* service. -This documentation was generated from *Identity Toolkit* crate version *1.0.12+20180723*, where *20180723* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Identity Toolkit* crate version *1.0.13+20180723*, where *20180723* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Identity Toolkit* *v3* API can be found at the [official documentation site](https://developers.google.com/identity-toolkit/v3/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.IdentityToolkit.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.IdentityToolkit.html) ... -* [relyingparty](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.Relyingparty.html) - * [*create auth uri*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyDeleteAccountCall.html), [*download account*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyDownloadAccountCall.html), [*email link signin*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyEmailLinkSigninCall.html), [*get account info*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyResetPasswordCall.html), [*send verification code*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartySendVerificationCodeCall.html), [*set account info*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartySetAccountInfoCall.html), [*set project config*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartySignOutUserCall.html), [*signup new user*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartySignupNewUserCall.html), [*upload account*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyCustomTokenCall.html), [*verify password*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyPasswordCall.html) and [*verify phone number*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyPhoneNumberCall.html) +* [relyingparty](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.Relyingparty.html) + * [*create auth uri*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyDeleteAccountCall.html), [*download account*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyDownloadAccountCall.html), [*email link signin*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyEmailLinkSigninCall.html), [*get account info*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyResetPasswordCall.html), [*send verification code*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartySendVerificationCodeCall.html), [*set account info*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartySetAccountInfoCall.html), [*set project config*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartySignOutUserCall.html), [*signup new user*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartySignupNewUserCall.html), [*upload account*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyCustomTokenCall.html), [*verify password*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyPasswordCall.html) and [*verify phone number*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.RelyingpartyVerifyPhoneNumberCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/struct.IdentityToolkit.html)** +* **[Hub](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/struct.IdentityToolkit.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.Part.html)** + * **[Parts](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-identitytoolkit3/1.0.12+20180723/google_identitytoolkit3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-identitytoolkit3/1.0.13+20180723/google_identitytoolkit3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/identitytoolkit3/src/lib.rs b/gen/identitytoolkit3/src/lib.rs index f07e62509c..9012c815ce 100644 --- a/gen/identitytoolkit3/src/lib.rs +++ b/gen/identitytoolkit3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Identity Toolkit* crate version *1.0.12+20180723*, where *20180723* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Identity Toolkit* crate version *1.0.13+20180723*, where *20180723* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Identity Toolkit* *v3* API can be found at the //! [official documentation site](https://developers.google.com/identity-toolkit/v3/). @@ -333,7 +333,7 @@ impl<'a, C, A> IdentityToolkit IdentityToolkit { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> IdentityToolkit } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/indexing3-cli/Cargo.toml b/gen/indexing3-cli/Cargo.toml index a7bebed7f3..bf9b2daf5a 100644 --- a/gen/indexing3-cli/Cargo.toml +++ b/gen/indexing3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-indexing3-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Indexing (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/indexing3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-indexing3] path = "../indexing3" -version = "1.0.12+20190627" +version = "1.0.13+20200402" diff --git a/gen/indexing3-cli/README.md b/gen/indexing3-cli/README.md index 5992dbd03b..a608a982d9 100644 --- a/gen/indexing3-cli/README.md +++ b/gen/indexing3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Indexing* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Indexing* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash indexing3 [options] diff --git a/gen/indexing3-cli/mkdocs.yml b/gen/indexing3-cli/mkdocs.yml index c44353a74b..a7534a7bbc 100644 --- a/gen/indexing3-cli/mkdocs.yml +++ b/gen/indexing3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Indexing v1.0.12+20190627 +site_name: Indexing v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-indexing3-cli site_description: A complete library to interact with Indexing (protocol v3) diff --git a/gen/indexing3-cli/src/main.rs b/gen/indexing3-cli/src/main.rs index fbe52c41a1..d3ef7158c1 100644 --- a/gen/indexing3-cli/src/main.rs +++ b/gen/indexing3-cli/src/main.rs @@ -340,7 +340,7 @@ fn main() { let mut app = App::new("indexing3") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200402") .about("Notifies Google when your web pages change.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_indexing3_cli") .arg(Arg::with_name("url") diff --git a/gen/indexing3/Cargo.toml b/gen/indexing3/Cargo.toml index e640c0a8d6..d83e0495f7 100644 --- a/gen/indexing3/Cargo.toml +++ b/gen/indexing3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-indexing3" -version = "1.0.12+20190627" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Indexing (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/indexing3" homepage = "https://developers.google.com/search/apis/indexing-api/" -documentation = "https://docs.rs/google-indexing3/1.0.12+20190627" +documentation = "https://docs.rs/google-indexing3/1.0.13+20200402" license = "MIT" keywords = ["indexing", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/indexing3/README.md b/gen/indexing3/README.md index 2fbdef6b58..fe2de26bf5 100644 --- a/gen/indexing3/README.md +++ b/gen/indexing3/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-indexing3` library allows access to all features of the *Google Indexing* service. -This documentation was generated from *Indexing* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *indexing:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Indexing* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *indexing:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Indexing* *v3* API can be found at the [official documentation site](https://developers.google.com/search/apis/indexing-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/struct.Indexing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/struct.Indexing.html) ... -* [url notifications](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/struct.UrlNotification.html) - * [*get metadata*](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/struct.UrlNotificationGetMetadataCall.html) and [*publish*](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/struct.UrlNotificationPublishCall.html) +* [url notifications](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/struct.UrlNotification.html) + * [*get metadata*](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/struct.UrlNotificationGetMetadataCall.html) and [*publish*](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/struct.UrlNotificationPublishCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/struct.Indexing.html)** +* **[Hub](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/struct.Indexing.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.Part.html)** + * **[Parts](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-indexing3/1.0.12+20190627/google_indexing3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-indexing3/1.0.13+20200402/google_indexing3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/indexing3/src/lib.rs b/gen/indexing3/src/lib.rs index fb85490548..ceef8314fc 100644 --- a/gen/indexing3/src/lib.rs +++ b/gen/indexing3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Indexing* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *indexing:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Indexing* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *indexing:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Indexing* *v3* API can be found at the //! [official documentation site](https://developers.google.com/search/apis/indexing-api/). @@ -330,7 +330,7 @@ impl<'a, C, A> Indexing Indexing { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://indexing.googleapis.com/".to_string(), _root_url: "https://indexing.googleapis.com/".to_string(), } @@ -341,7 +341,7 @@ impl<'a, C, A> Indexing } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/jobs3-cli/Cargo.toml b/gen/jobs3-cli/Cargo.toml index 6dc5d0f278..8d7ebef16a 100644 --- a/gen/jobs3-cli/Cargo.toml +++ b/gen/jobs3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-jobs3-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Talent Solution (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/jobs3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-jobs3] path = "../jobs3" -version = "1.0.12+20190702" +version = "1.0.13+20200409" diff --git a/gen/jobs3-cli/README.md b/gen/jobs3-cli/README.md index 47b18c0100..b0274dbe5f 100644 --- a/gen/jobs3-cli/README.md +++ b/gen/jobs3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Talent Solution* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Talent Solution* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash jobs3 [options] diff --git a/gen/jobs3-cli/mkdocs.yml b/gen/jobs3-cli/mkdocs.yml index 477bf5d3a4..3dfd339a2d 100644 --- a/gen/jobs3-cli/mkdocs.yml +++ b/gen/jobs3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Talent Solution v1.0.12+20190702 +site_name: Cloud Talent Solution v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-jobs3-cli site_description: A complete library to interact with Cloud Talent Solution (protocol v3) diff --git a/gen/jobs3-cli/src/main.rs b/gen/jobs3-cli/src/main.rs index 800b621349..7aa672c78b 100644 --- a/gen/jobs3-cli/src/main.rs +++ b/gen/jobs3-cli/src/main.rs @@ -1138,6 +1138,7 @@ impl<'n> Engine<'n> { "job-query.disable-spell-check" => Some(("jobQuery.disableSpellCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "job-query.custom-attribute-filter" => Some(("jobQuery.customAttributeFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.employment-types" => Some(("jobQuery.employmentTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-query.query-language-code" => Some(("jobQuery.queryLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.query" => Some(("jobQuery.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.publish-time-range.end-time" => Some(("jobQuery.publishTimeRange.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.publish-time-range.start-time" => Some(("jobQuery.publishTimeRange.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1178,7 +1179,7 @@ impl<'n> Engine<'n> { "offset" => Some(("offset", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "disable-keyword-match" => Some(("disableKeywordMatch", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-imprecise-addresses", "commute-filter", "commute-method", "company-display-names", "company-names", "compensation-filter", "currency-code", "custom-attribute-filter", "departure-time", "device-info", "device-type", "disable-keyword-match", "disable-spell-check", "diversification-level", "domain", "employment-types", "enable-broadening", "end-time", "histogram-facets", "hours", "id", "include-jobs-with-unspecified-compensation-range", "job-categories", "job-query", "job-view", "language-codes", "latitude", "longitude", "max-compensation", "min-compensation", "minutes", "nanos", "offset", "order-by", "page-size", "page-token", "publish-time-range", "query", "range", "request-metadata", "require-precise-result-size", "road-traffic", "search-mode", "seconds", "session-id", "simple-histogram-facets", "start-coordinates", "start-time", "travel-duration", "type", "units", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-imprecise-addresses", "commute-filter", "commute-method", "company-display-names", "company-names", "compensation-filter", "currency-code", "custom-attribute-filter", "departure-time", "device-info", "device-type", "disable-keyword-match", "disable-spell-check", "diversification-level", "domain", "employment-types", "enable-broadening", "end-time", "histogram-facets", "hours", "id", "include-jobs-with-unspecified-compensation-range", "job-categories", "job-query", "job-view", "language-codes", "latitude", "longitude", "max-compensation", "min-compensation", "minutes", "nanos", "offset", "order-by", "page-size", "page-token", "publish-time-range", "query", "query-language-code", "range", "request-metadata", "require-precise-result-size", "road-traffic", "search-mode", "seconds", "session-id", "simple-histogram-facets", "start-coordinates", "start-time", "travel-duration", "type", "units", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1267,6 +1268,7 @@ impl<'n> Engine<'n> { "job-query.disable-spell-check" => Some(("jobQuery.disableSpellCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "job-query.custom-attribute-filter" => Some(("jobQuery.customAttributeFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.employment-types" => Some(("jobQuery.employmentTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job-query.query-language-code" => Some(("jobQuery.queryLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.query" => Some(("jobQuery.query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.publish-time-range.end-time" => Some(("jobQuery.publishTimeRange.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job-query.publish-time-range.start-time" => Some(("jobQuery.publishTimeRange.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1307,7 +1309,7 @@ impl<'n> Engine<'n> { "offset" => Some(("offset", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "disable-keyword-match" => Some(("disableKeywordMatch", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-imprecise-addresses", "commute-filter", "commute-method", "company-display-names", "company-names", "compensation-filter", "currency-code", "custom-attribute-filter", "departure-time", "device-info", "device-type", "disable-keyword-match", "disable-spell-check", "diversification-level", "domain", "employment-types", "enable-broadening", "end-time", "histogram-facets", "hours", "id", "include-jobs-with-unspecified-compensation-range", "job-categories", "job-query", "job-view", "language-codes", "latitude", "longitude", "max-compensation", "min-compensation", "minutes", "nanos", "offset", "order-by", "page-size", "page-token", "publish-time-range", "query", "range", "request-metadata", "require-precise-result-size", "road-traffic", "search-mode", "seconds", "session-id", "simple-histogram-facets", "start-coordinates", "start-time", "travel-duration", "type", "units", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-imprecise-addresses", "commute-filter", "commute-method", "company-display-names", "company-names", "compensation-filter", "currency-code", "custom-attribute-filter", "departure-time", "device-info", "device-type", "disable-keyword-match", "disable-spell-check", "diversification-level", "domain", "employment-types", "enable-broadening", "end-time", "histogram-facets", "hours", "id", "include-jobs-with-unspecified-compensation-range", "job-categories", "job-query", "job-view", "language-codes", "latitude", "longitude", "max-compensation", "min-compensation", "minutes", "nanos", "offset", "order-by", "page-size", "page-token", "publish-time-range", "query", "query-language-code", "range", "request-metadata", "require-precise-result-size", "road-traffic", "search-mode", "seconds", "session-id", "simple-histogram-facets", "start-coordinates", "start-time", "travel-duration", "type", "units", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1551,9 +1553,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - Resource name of the project under which the company is created. + Some(r##"Required. Resource name of the project under which the company is created. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -1585,9 +1585,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The resource name of the company to be deleted. + Some(r##"Required. The resource name of the company to be deleted. The format is "projects/{project_id}/companies/{company_id}", for example, "projects/api-test-project/companies/foo"."##), @@ -1612,9 +1610,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The resource name of the company to be retrieved. + Some(r##"Required. The resource name of the company to be retrieved. The format is "projects/{project_id}/companies/{company_id}", for example, "projects/api-test-project/companies/foo"."##), @@ -1639,9 +1635,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - Resource name of the project under which the company is created. + Some(r##"Required. Resource name of the project under which the company is created. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -1703,9 +1697,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - Resource name of project the completion is performed within. + Some(r##"Required. Resource name of project the completion is performed within. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -1730,9 +1722,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The resource name of the project under which the job is created. + Some(r##"Required. The resource name of the project under which the job is created. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -1766,9 +1756,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The resource name of the project under which the job is created. + Some(r##"Required. The resource name of the project under which the job is created. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -1802,9 +1790,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The resource name of the job to be deleted. + Some(r##"Required. The resource name of the job to be deleted. The format is "projects/{project_id}/jobs/{job_id}", for example, "projects/api-test-project/jobs/1234"."##), @@ -1830,9 +1816,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. - - The resource name of the job to retrieve. + Some(r##"Required. The resource name of the job to retrieve. The format is "projects/{project_id}/jobs/{job_id}", for example, "projects/api-test-project/jobs/1234"."##), @@ -1857,9 +1841,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The resource name of the project under which the job is created. + Some(r##"Required. The resource name of the project under which the job is created. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -1928,9 +1910,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The resource name of the project to search within. + Some(r##"Required. The resource name of the project to search within. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -1970,9 +1950,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. - - The resource name of the project to search within. + Some(r##"Required. The resource name of the project to search within. The format is "projects/{project_id}", for example, "projects/api-test-project"."##), @@ -2003,7 +1981,7 @@ fn main() { let mut app = App::new("jobs3") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200409") .about("Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_jobs3_cli") diff --git a/gen/jobs3/Cargo.toml b/gen/jobs3/Cargo.toml index 360c8a97c3..6f41b72fdf 100644 --- a/gen/jobs3/Cargo.toml +++ b/gen/jobs3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-jobs3" -version = "1.0.12+20190702" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Talent Solution (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/jobs3" homepage = "https://cloud.google.com/talent-solution/job-search/docs/" -documentation = "https://docs.rs/google-jobs3/1.0.12+20190702" +documentation = "https://docs.rs/google-jobs3/1.0.13+20200409" license = "MIT" keywords = ["jobs", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/jobs3/README.md b/gen/jobs3/README.md index 5db39cb71a..4b1fdc3021 100644 --- a/gen/jobs3/README.md +++ b/gen/jobs3/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-jobs3` library allows access to all features of the *Google Cloud Talent Solution* service. -This documentation was generated from *Cloud Talent Solution* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *jobs:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Talent Solution* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *jobs:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Talent Solution* *v3* API can be found at the [official documentation site](https://cloud.google.com/talent-solution/job-search/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.CloudTalentSolution.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.CloudTalentSolution.html) ... * projects - * [*client events create*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectClientEventCreateCall.html), [*companies create*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectCompanyCreateCall.html), [*companies delete*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectCompanyDeleteCall.html), [*companies get*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectCompanyGetCall.html), [*companies list*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectCompanyListCall.html), [*companies patch*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectCompanyPatchCall.html), [*complete*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectCompleteCall.html), [*jobs batch delete*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobBatchDeleteCall.html), [*jobs create*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobCreateCall.html), [*jobs delete*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobDeleteCall.html), [*jobs get*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobGetCall.html), [*jobs list*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobListCall.html), [*jobs patch*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobPatchCall.html), [*jobs search*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobSearchCall.html) and [*jobs search for alert*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.ProjectJobSearchForAlertCall.html) + * [*client events create*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectClientEventCreateCall.html), [*companies create*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectCompanyCreateCall.html), [*companies delete*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectCompanyDeleteCall.html), [*companies get*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectCompanyGetCall.html), [*companies list*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectCompanyListCall.html), [*companies patch*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectCompanyPatchCall.html), [*complete*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectCompleteCall.html), [*jobs batch delete*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobBatchDeleteCall.html), [*jobs create*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobCreateCall.html), [*jobs delete*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobDeleteCall.html), [*jobs get*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobGetCall.html), [*jobs list*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobListCall.html), [*jobs patch*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobPatchCall.html), [*jobs search*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobSearchCall.html) and [*jobs search for alert*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.ProjectJobSearchForAlertCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/struct.CloudTalentSolution.html)** +* **[Hub](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/struct.CloudTalentSolution.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.Part.html)** + * **[Parts](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-jobs3/1.0.12+20190702/google_jobs3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-jobs3/1.0.13+20200409/google_jobs3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/jobs3/src/lib.rs b/gen/jobs3/src/lib.rs index b9e979c7ed..3481212abb 100644 --- a/gen/jobs3/src/lib.rs +++ b/gen/jobs3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Talent Solution* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *jobs:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Talent Solution* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *jobs:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Talent Solution* *v3* API can be found at the //! [official documentation site](https://cloud.google.com/talent-solution/job-search/docs/). @@ -335,7 +335,7 @@ impl<'a, C, A> CloudTalentSolution CloudTalentSolution { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://jobs.googleapis.com/".to_string(), _root_url: "https://jobs.googleapis.com/".to_string(), } @@ -346,7 +346,7 @@ impl<'a, C, A> CloudTalentSolution } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -374,24 +374,6 @@ impl<'a, C, A> CloudTalentSolution // ############ // SCHEMAS ### // ########## -/// Output only. -/// -/// Spell check result. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SpellingCorrection { - /// Indicates if the query was corrected by the spell checker. - pub corrected: Option, - /// Correction output consisting of the corrected keyword string. - #[serde(rename="correctedText")] - pub corrected_text: Option, -} - -impl Part for SpellingCorrection {} - - /// Input only. /// /// Geographic region of the search. @@ -400,27 +382,18 @@ impl Part for SpellingCorrection {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LocationFilter { - /// Optional. - /// - /// - /// The distance_in_miles is applied when the location being searched for is + /// Optional. The distance_in_miles is applied when the location being searched for is /// identified as a city or smaller. When the location being searched for is a /// state or larger, this field is ignored. #[serde(rename="distanceInMiles")] pub distance_in_miles: Option, - /// Optional. - /// - /// The latitude and longitude of the geographic center from which to + /// Optional. The latitude and longitude of the geographic center from which to /// search. This field's ignored if `address` is provided. #[serde(rename="latLng")] pub lat_lng: Option, - /// Optional. - /// - /// The address name, such as "Mountain View" or "Bay Area". + /// Optional. The address name, such as "Mountain View" or "Bay Area". pub address: Option, - /// Optional. - /// - /// Allows the client to return jobs without a + /// Optional. Allows the client to return jobs without a /// set location, specifically, telecommuting jobs (telecommuting is considered /// by the service as a special location. /// Job.posting_region indicates if a job permits telecommuting. @@ -438,9 +411,7 @@ pub struct LocationFilter { /// treated as less relevant than other jobs in the search response. #[serde(rename="telecommutePreference")] pub telecommute_preference: Option, - /// Optional. - /// - /// CLDR region code of the country/region of the address. This is used + /// Optional. CLDR region code of the country/region of the address. This is used /// to address ambiguity of the user-input location, for example, "Liverpool" /// against "Liverpool, NY, US" or "Liverpool, UK". /// @@ -470,31 +441,44 @@ impl Part for LocationFilter {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateJobRequest { - /// Required. - /// - /// The Job to be created. + /// Required. The Job to be created. pub job: Option, } impl RequestValue for CreateJobRequest {} +/// Device information collected from the job seeker, candidate, or +/// other entity conducting the job search. Providing this information improves +/// the quality of the search results across devices. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceInfo { + /// Optional. Type of the device. + #[serde(rename="deviceType")] + pub device_type: Option, + /// Optional. A device-specific ID. The ID must be a unique identifier that + /// distinguishes the device from other devices. + pub id: Option, +} + +impl Part for DeviceInfo {} + + /// Compensation range. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CompensationRange { - /// Optional. - /// - /// The minimum amount of compensation. If left empty, the value is set + /// Optional. The minimum amount of compensation. If left empty, the value is set /// to zero and the currency code is set to match the /// currency code of max_compensation. #[serde(rename="minCompensation")] pub min_compensation: Option, - /// Optional. - /// - /// The maximum amount of compensation. If left empty, the value is set + /// Optional. The maximum amount of compensation. If left empty, the value is set /// to a maximal compensation value and the currency code is set to /// match the currency code of /// min_compensation. @@ -712,9 +696,7 @@ impl Part for TimeOfDay {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchDeleteJobsRequest { - /// Required. - /// - /// The filter string specifies the jobs to be deleted. + /// Required. The filter string specifies the jobs to be deleted. /// /// Supported operator: =, AND /// @@ -792,9 +774,7 @@ impl Part for CommuteInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateCompanyRequest { - /// Required. - /// - /// The company resource to replace the current resource in the system. + /// Required. The company resource to replace the current resource in the system. pub company: Option, /// Optional but strongly recommended for the best service /// experience. @@ -823,15 +803,11 @@ pub struct CustomAttributeHistogramRequest { /// each key as a string. #[serde(rename="stringValueHistogram")] pub string_value_histogram: Option, - /// Optional. - /// - /// Specifies buckets used to perform a range histogram on Job's + /// Optional. Specifies buckets used to perform a range histogram on Job's /// filterable long custom field values, or min/max value requirements. #[serde(rename="longValueHistogramBucketingOption")] pub long_value_histogram_bucketing_option: Option, - /// Required. - /// - /// Specifies the custom field key to perform a histogram on. If specified + /// Required. Specifies the custom field key to perform a histogram on. If specified /// without `long_value_histogram_bucketing_option`, histogram on string values /// of the given `key` is triggered, otherwise histogram is performed on long /// values. @@ -856,9 +832,7 @@ impl Part for CustomAttributeHistogramRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Company { - /// Required. - /// - /// The display name of the company, for example, "Google, LLC". + /// Required. The display name of the company, for example, "Google LLC". #[serde(rename="displayName")] pub display_name: Option, /// Required during company update. @@ -869,48 +843,36 @@ pub struct Company { /// The format is "projects/{project_id}/companies/{company_id}", for example, /// "projects/api-test-project/companies/foo". pub name: Option, - /// Optional. - /// - /// The URI to employer's career site or careers page on the employer's web + /// Optional. The URI to employer's career site or careers page on the employer's web /// site, for example, "https://careers.google.com". #[serde(rename="careerSiteUri")] pub career_site_uri: Option, /// Output only. Derived details about the company. #[serde(rename="derivedInfo")] pub derived_info: Option, - /// Optional. - /// - /// Equal Employment Opportunity legal disclaimer text to be + /// Optional. Equal Employment Opportunity legal disclaimer text to be /// associated with all jobs, and typically to be displayed in all /// roles. /// /// The maximum number of allowed characters is 500. #[serde(rename="eeoText")] pub eeo_text: Option, - /// Optional. - /// - /// A URI that hosts the employer's company logo. + /// Optional. A URI that hosts the employer's company logo. #[serde(rename="imageUri")] pub image_uri: Option, - /// Optional. - /// - /// The street address of the company's main headquarters, which may be + /// Optional. The street address of the company's main headquarters, which may be /// different from the job location. The service attempts /// to geolocate the provided address, and populates a more specific /// location wherever possible in DerivedInfo.headquarters_location. #[serde(rename="headquartersAddress")] pub headquarters_address: Option, - /// Required. - /// - /// Client side company identifier, used to uniquely identify the + /// Required. Client side company identifier, used to uniquely identify the /// company. /// /// The maximum number of allowed characters is 255. #[serde(rename="externalId")] pub external_id: Option, - /// Optional. - /// - /// The URI representing the company's primary web site or home page, + /// Optional. The URI representing the company's primary web site or home page, /// for example, "https://www.google.com". /// /// The maximum number of allowed characters is 255. @@ -920,17 +882,13 @@ pub struct Company { /// public availability by the service when job content appears suspicious, /// abusive, or spammy. pub suspended: Option, - /// Optional. - /// - /// Set to true if it is the hiring agency that post jobs for other + /// Optional. Set to true if it is the hiring agency that post jobs for other /// employers. /// /// Defaults to false if not provided. #[serde(rename="hiringAgency")] pub hiring_agency: Option, - /// Optional. - /// - /// A list of keys of filterable Job.custom_attributes, whose + /// Optional. A list of keys of filterable Job.custom_attributes, whose /// corresponding `string_values` are used in keyword search. Jobs with /// `string_values` under these specified field keys are returned if any /// of the values matches the search keyword. Custom field values with @@ -938,9 +896,7 @@ pub struct Company { /// and those keyword queries need to be surrounded by quotes. #[serde(rename="keywordSearchableJobCustomAttributes")] pub keyword_searchable_job_custom_attributes: Option>, - /// Optional. - /// - /// The employer's company size. + /// Optional. The employer's company size. pub size: Option, } @@ -981,9 +937,7 @@ impl Part for CompletionResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateCompanyRequest { - /// Required. - /// - /// The company to be created. + /// Required. The company to be created. pub company: Option, } @@ -1005,9 +959,7 @@ impl RequestValue for CreateCompanyRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Job { - /// Optional. - /// - /// The language of the posting. This field is distinct from + /// Optional. The language of the posting. This field is distinct from /// any requirements for fluency that are associated with the job. /// /// Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". @@ -1020,9 +972,7 @@ pub struct Job { /// defaults to 'en_US'. #[serde(rename="languageCode")] pub language_code: Option, - /// Optional. - /// - /// Options for job processing. + /// Optional. Options for job processing. #[serde(rename="processingOptions")] pub processing_options: Option, /// Optional but strongly recommended for the best service experience. @@ -1046,30 +996,22 @@ pub struct Job { /// Output only. Display name of the company listing the job. #[serde(rename="companyDisplayName")] pub company_display_name: Option, - /// Required. - /// - /// The resource name of the company listing the job, such as + /// Required. The resource name of the company listing the job, such as /// "projects/api-test-project/companies/foo". #[serde(rename="companyName")] pub company_name: Option, /// Output only. Derived details about the job posting. #[serde(rename="derivedInfo")] pub derived_info: Option, - /// Optional. - /// - /// A description of bonus, commission, and other compensation + /// Optional. A description of bonus, commission, and other compensation /// incentives associated with the job not including salary or pay. /// /// The maximum number of allowed characters is 10,000. pub incentives: Option, - /// Optional. - /// - /// The benefits included with the job. + /// Optional. The benefits included with the job. #[serde(rename="jobBenefits")] pub job_benefits: Option>, - /// Optional. - /// - /// A description of the qualifications required to perform the + /// Optional. A description of the qualifications required to perform the /// job. The use of this field is recommended /// as an alternative to using the more general description field. /// @@ -1078,9 +1020,7 @@ pub struct Job { /// /// The maximum number of allowed characters is 10,000. pub qualifications: Option, - /// Optional. - /// - /// The employment type(s) of a job, for example, + /// Optional. The employment type(s) of a job, for example, /// full time or /// part time. #[serde(rename="employmentTypes")] @@ -1088,21 +1028,17 @@ pub struct Job { /// Output only. The timestamp when this job posting was created. #[serde(rename="postingCreateTime")] pub posting_create_time: Option, - /// Optional. + /// Deprecated. The job is only visible to the owner. /// /// The visibility of the job. /// /// Defaults to Visibility.ACCOUNT_ONLY if not specified. pub visibility: Option, - /// Optional. - /// - /// The end timestamp of the job. Typically this field is used for contracting + /// Optional. The end timestamp of the job. Typically this field is used for contracting /// engagements. Invalid timestamps are ignored. #[serde(rename="jobEndTime")] pub job_end_time: Option, - /// Optional. - /// - /// The job PostingRegion (for example, state, country) throughout which + /// Optional. The job PostingRegion (for example, state, country) throughout which /// the job is available. If this field is set, a /// LocationFilter in a search query within the job region /// finds this job posting if an exact location match isn't specified. @@ -1162,15 +1098,11 @@ pub struct Job { /// Use of this field in job queries and API calls is preferred over the use of /// requisition_id since this value is unique. pub name: Option, - /// Required. - /// - /// The title of the job, such as "Software Engineer" + /// Required. The title of the job, such as "Software Engineer" /// /// The maximum number of allowed characters is 500. pub title: Option, - /// Required. - /// - /// The description of the job, which typically includes a multi-paragraph + /// Required. The description of the job, which typically includes a multi-paragraph /// description of the company and related information. Separate fields are /// provided on the job object for responsibilities, /// qualifications, and other job characteristics. Use of @@ -1181,9 +1113,7 @@ pub struct Job { /// /// The maximum number of allowed characters is 100,000. pub description: Option, - /// Optional. - /// - /// A promotion value of the job, as determined by the client. + /// Optional. A promotion value of the job, as determined by the client. /// The value determines the sort order of the jobs returned when searching for /// jobs using the featured jobs search call, with higher promotional values /// being returned first and ties being resolved by relevance sort. Only the @@ -1192,9 +1122,7 @@ pub struct Job { /// Default value is 0, and negative values are treated as 0. #[serde(rename="promotionValue")] pub promotion_value: Option, - /// Optional. - /// - /// A map of fields to hold both filterable and non-filterable custom job + /// Optional. A map of fields to hold both filterable and non-filterable custom job /// attributes that are not covered by the provided structured fields. /// /// The keys of the map are strings up to 64 bytes and must match the @@ -1208,14 +1136,10 @@ pub struct Job { /// is 50KB. #[serde(rename="customAttributes")] pub custom_attributes: Option>, - /// Optional. - /// - /// The desired education degrees for the job, such as Bachelors, Masters. + /// Optional. The desired education degrees for the job, such as Bachelors, Masters. #[serde(rename="degreeTypes")] pub degree_types: Option>, - /// Optional. - /// - /// A description of job responsibilities. The use of this field is + /// Optional. A description of job responsibilities. The use of this field is /// recommended as an alternative to using the more general description /// field. /// @@ -1224,35 +1148,25 @@ pub struct Job { /// /// The maximum number of allowed characters is 10,000. pub responsibilities: Option, - /// Optional. - /// - /// The start timestamp of the job in UTC time zone. Typically this field + /// Optional. The start timestamp of the job in UTC time zone. Typically this field /// is used for contracting engagements. Invalid timestamps are ignored. #[serde(rename="jobStartTime")] pub job_start_time: Option, - /// Optional. - /// - /// Job compensation information. + /// Optional. Job compensation information. #[serde(rename="compensationInfo")] pub compensation_info: Option, - /// Optional. - /// - /// The department or functional area within the company with the open + /// Optional. The department or functional area within the company with the open /// position. /// /// The maximum number of allowed characters is 255. pub department: Option, - /// Optional. - /// - /// The experience level associated with the job, such as "Entry Level". + /// Optional. The experience level associated with the job, such as "Entry Level". #[serde(rename="jobLevel")] pub job_level: Option, /// Output only. The timestamp when this job posting was last updated. #[serde(rename="postingUpdateTime")] pub posting_update_time: Option, - /// Required. - /// - /// The requisition ID, also referred to as the posting ID, assigned by the + /// Required. The requisition ID, also referred to as the posting ID, assigned by the /// client to identify a job. This field is intended to be used by clients /// for client identification and tracking of postings. A job is not allowed /// to be created if there is another job with the same [company_name], @@ -1261,9 +1175,7 @@ pub struct Job { /// The maximum number of allowed characters is 255. #[serde(rename="requisitionId")] pub requisition_id: Option, - /// Optional. - /// - /// The timestamp this job posting was most recently published. The default + /// Optional. The timestamp this job posting was most recently published. The default /// value is the time the request arrives at the server. Invalid timestamps are /// ignored. #[serde(rename="postingPublishTime")] @@ -1283,15 +1195,11 @@ impl ResponseResult for Job {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RequestMetadata { - /// Optional. - /// - /// The type of device used by the job seeker at the time of the call to the + /// Optional. The type of device used by the job seeker at the time of the call to the /// service. #[serde(rename="deviceInfo")] pub device_info: Option, - /// Required. - /// - /// The client-defined scope or source of the service call, which typically + /// Required. The client-defined scope or source of the service call, which typically /// is the domain on /// which the service has been implemented and is currently being run. /// @@ -1306,9 +1214,7 @@ pub struct RequestMetadata { /// /// The maximum number of allowed characters is 255. pub domain: Option, - /// Required. - /// - /// A unique user identification string, as determined by the client. + /// Required. A unique user identification string, as determined by the client. /// To have the strongest positive impact on search quality /// make sure the client-level is unique. /// Obfuscate this field for privacy concerns before @@ -1321,9 +1227,7 @@ pub struct RequestMetadata { /// The maximum number of allowed characters is 255. #[serde(rename="userId")] pub user_id: Option, - /// Required. - /// - /// A unique session identification string. A session is defined as the + /// Required. A unique session identification string. A session is defined as the /// duration of an end user's interaction with the service over a certain /// period. /// Obfuscate this field for privacy concerns before @@ -1347,9 +1251,7 @@ impl Part for RequestMetadata {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CustomAttribute { - /// Optional. - /// - /// If the `filterable` flag is true, custom field values are searchable. + /// Optional. If the `filterable` flag is true, custom field values are searchable. /// If false, values are not searchable. /// /// Default is false. @@ -1361,7 +1263,7 @@ pub struct CustomAttribute { /// `CASE_INSENSITIVE_MATCH`) search. /// For filterable `string_value`s, a maximum total number of 200 values /// is allowed, with each `string_value` has a byte size of no more than - /// 255B. For unfilterable `string_values`, the maximum total byte size of + /// 500B. For unfilterable `string_values`, the maximum total byte size of /// unfilterable `string_values` is 50KB. /// /// Empty string is not allowed. @@ -1381,6 +1283,24 @@ pub struct CustomAttribute { impl Part for CustomAttribute {} +/// Output only. +/// +/// Spell check result. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SpellingCorrection { + /// Indicates if the query was corrected by the spell checker. + pub corrected: Option, + /// Correction output consisting of the corrected keyword string. + #[serde(rename="correctedText")] + pub corrected_text: Option, +} + +impl Part for SpellingCorrection {} + + /// A compensation entry that represents one component of compensation, such /// as base pay, bonus, or other compensation type. /// @@ -1394,30 +1314,20 @@ impl Part for CustomAttribute {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CompensationEntry { - /// Optional. - /// - /// Compensation amount. + /// Optional. Compensation amount. pub amount: Option, - /// Optional. - /// - /// Compensation description. For example, could + /// Optional. Compensation description. For example, could /// indicate equity terms or provide additional context to an estimated /// bonus. pub description: Option, - /// Optional. - /// - /// Compensation range. + /// Optional. Compensation range. pub range: Option, - /// Optional. - /// - /// Compensation type. + /// Optional. Compensation type. /// /// Default is CompensationUnit.COMPENSATION_TYPE_UNSPECIFIED. #[serde(rename="type")] pub type_: Option, - /// Optional. - /// - /// Expected number of units paid each year. If not specified, when + /// Optional. Expected number of units paid each year. If not specified, when /// Job.employment_types is FULLTIME, a default value is inferred /// based on unit. Default values: /// - HOURLY: 2080 @@ -1427,9 +1337,7 @@ pub struct CompensationEntry { /// - ANNUAL: 1 #[serde(rename="expectedUnitsPerYear")] pub expected_units_per_year: Option, - /// Optional. - /// - /// Frequency of the specified amount. + /// Optional. Frequency of the specified amount. /// /// Default is CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED. pub unit: Option, @@ -1463,23 +1371,15 @@ impl Part for TimestampRange {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CompensationFilter { - /// Required. - /// - /// Specify desired `base compensation entry's` + /// Required. Specify desired `base compensation entry's` /// CompensationInfo.CompensationUnit. pub units: Option>, - /// Optional. - /// - /// Compensation range. + /// Optional. Compensation range. pub range: Option, - /// Required. - /// - /// Type of filter. + /// Required. Type of filter. #[serde(rename="type")] pub type_: Option, - /// Optional. - /// - /// If set to true, jobs with unspecified compensation range fields are + /// Optional. If set to true, jobs with unspecified compensation range fields are /// included. #[serde(rename="includeJobsWithUnspecifiedCompensationRange")] pub include_jobs_with_unspecified_compensation_range: Option, @@ -1496,22 +1396,16 @@ impl Part for CompensationFilter {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HistogramFacets { - /// Optional. - /// - /// Specifies the simple type of histogram facets, for example, + /// Optional. Specifies the simple type of histogram facets, for example, /// `COMPANY_SIZE`, `EMPLOYMENT_TYPE` etc. #[serde(rename="simpleHistogramFacets")] pub simple_histogram_facets: Option>, - /// Optional. - /// - /// Specifies the custom attributes histogram requests. + /// Optional. Specifies the custom attributes histogram requests. /// Duplicate values of CustomAttributeHistogramRequest.key are not /// allowed. #[serde(rename="customAttributeHistogramFacets")] pub custom_attribute_histogram_facets: Option>, - /// Optional. - /// - /// Specifies compensation field-based histogram requests. + /// Optional. Specifies compensation field-based histogram requests. /// Duplicate values of CompensationHistogramRequest.type are not allowed. #[serde(rename="compensationHistogramFacets")] pub compensation_histogram_facets: Option>, @@ -1535,9 +1429,7 @@ impl Part for HistogramFacets {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClientEvent { - /// Required. - /// - /// A unique identifier, generated by the client application. This `event_id` + /// Required. A unique identifier, generated by the client application. This `event_id` /// is used to establish the relationship between different events /// (see parent_event_id). #[serde(rename="eventId")] @@ -1546,15 +1438,11 @@ pub struct ClientEvent { /// implements Cloud Talent Solution. #[serde(rename="jobEvent")] pub job_event: Option, - /// Required. - /// - /// A unique ID generated in the API responses. It can be found in + /// Required. A unique ID generated in the API responses. It can be found in /// ResponseMetadata.request_id. #[serde(rename="requestId")] pub request_id: Option, - /// Optional. - /// - /// The event_id of an event that resulted in the current event. For example, a + /// Optional. The event_id of an event that resulted in the current event. For example, a /// Job view event usually follows a parent /// impression event: A job seeker first does a /// search where a list of jobs appears @@ -1563,9 +1451,7 @@ pub struct ClientEvent { /// view). #[serde(rename="parentEventId")] pub parent_event_id: Option, - /// Optional. - /// - /// Extra information about this event. Used for storing information with no + /// Optional. Extra information about this event. Used for storing information with no /// matching field in event payload, for example, user application specific /// context or details. /// @@ -1573,9 +1459,7 @@ pub struct ClientEvent { /// values is 2 KB. #[serde(rename="extraInfo")] pub extra_info: Option>, - /// Required. - /// - /// The timestamp of the event. + /// Required. The timestamp of the event. #[serde(rename="createTime")] pub create_time: Option, } @@ -1634,9 +1518,7 @@ impl Part for HistogramResults {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProcessingOptions { - /// Optional. - /// - /// Option for job HTML content sanitization. Applied fields are: + /// Optional. Option for job HTML content sanitization. Applied fields are: /// /// * description /// * applicationInfo.instruction @@ -1650,9 +1532,7 @@ pub struct ProcessingOptions { /// Defaults to HtmlSanitization.SIMPLE_FORMATTING_ONLY. #[serde(rename="htmlSanitization")] pub html_sanitization: Option, - /// Optional. - /// - /// If set to `true`, the service does not attempt to resolve a + /// Optional. If set to `true`, the service does not attempt to resolve a /// more precise address for the job. #[serde(rename="disableStreetAddressResolution")] pub disable_street_address_resolution: Option, @@ -1728,9 +1608,7 @@ impl ResponseResult for ListJobsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchJobsRequest { - /// Optional. - /// - /// The criteria determining how search results are sorted. Default is + /// Optional. The criteria determining how search results are sorted. Default is /// "relevance desc". /// /// Supported options are: @@ -1762,9 +1640,7 @@ pub struct SearchJobsRequest { /// search results. #[serde(rename="orderBy")] pub order_by: Option, - /// Optional. - /// - /// Controls whether highly similar jobs are returned next to each other in + /// Optional. Controls whether highly similar jobs are returned next to each other in /// the search results. Jobs are identified as highly similar based on /// their titles, job categories, and locations. Highly similar results are /// clustered so that only one representative job of the cluster is @@ -1775,56 +1651,40 @@ pub struct SearchJobsRequest { /// is specified. #[serde(rename="diversificationLevel")] pub diversification_level: Option, - /// Optional. - /// - /// Controls whether to broaden the search when it produces sparse results. + /// Optional. Controls whether to broaden the search when it produces sparse results. /// Broadened queries append results to the end of the matching results /// list. /// /// Defaults to false. #[serde(rename="enableBroadening")] pub enable_broadening: Option, - /// Optional. - /// - /// Query used to search against jobs, such as keyword, location filters, etc. + /// Optional. Query used to search against jobs, such as keyword, location filters, etc. #[serde(rename="jobQuery")] pub job_query: Option, - /// Optional. - /// - /// A limit on the number of jobs returned in the search results. + /// Optional. A limit on the number of jobs returned in the search results. /// Increasing this value above the default value of 10 can increase search /// response time. The value can be between 1 and 100. #[serde(rename="pageSize")] pub page_size: Option, - /// Optional. - /// - /// Histogram requests for jobs matching JobQuery. + /// Optional. Histogram requests for jobs matching JobQuery. #[serde(rename="histogramFacets")] pub histogram_facets: Option, - /// Optional. - /// - /// Mode of a search. + /// Optional. Mode of a search. /// /// Defaults to SearchMode.JOB_SEARCH. #[serde(rename="searchMode")] pub search_mode: Option, - /// Optional. - /// - /// The token specifying the current offset within + /// Optional. The token specifying the current offset within /// search results. See SearchJobsResponse.next_page_token for /// an explanation of how to obtain the next set of query results. #[serde(rename="pageToken")] pub page_token: Option, - /// Required. - /// - /// The meta information collected about the job searcher, used to improve the + /// Required. The meta information collected about the job searcher, used to improve the /// search quality of the service. The identifiers (such as `user_id`) are /// provided by users, and must be unique and consistent. #[serde(rename="requestMetadata")] pub request_metadata: Option, - /// Optional. - /// - /// Controls if the search job request requires the return of a precise + /// Optional. Controls if the search job request requires the return of a precise /// count of the first 300 results. Setting this to `true` ensures /// consistency in the number of results per page. Best practice is to set this /// value to true if a client allows users to jump directly to a @@ -1835,26 +1695,22 @@ pub struct SearchJobsRequest { /// Defaults to false. #[serde(rename="requirePreciseResultSize")] pub require_precise_result_size: Option, - /// Optional. - /// - /// The desired job attributes returned for jobs in the + /// Optional. The desired job attributes returned for jobs in the /// search response. Defaults to JobView.SMALL if no value is specified. #[serde(rename="jobView")] pub job_view: Option, - /// Optional. - /// - /// An integer that specifies the current offset (that is, starting result + /// Optional. An integer that specifies the current offset (that is, starting result /// location, amongst the jobs deemed by the API as relevant) in search /// results. This field is only considered if page_token is unset. /// + /// The maximum allowed value is 5000. Otherwise an error is thrown. + /// /// For example, 0 means to return results starting from the first matching /// job, and 10 means to return from the 11th job. This can be used for /// pagination, (for example, pageSize = 10 and offset = 10 means to return /// from the second page). pub offset: Option, - /// Optional. - /// - /// Controls whether to disable exact keyword match on Job.job_title, + /// Optional. Controls whether to disable exact keyword match on Job.job_title, /// Job.description, Job.company_display_name, Job.locations, /// Job.qualifications. When disable keyword match is turned off, a /// keyword match returns jobs that do not match given category filters when @@ -1924,9 +1780,7 @@ pub struct CompensationInfo { /// See CompensationEntry for explanation on compensation annualization. #[serde(rename="annualizedBaseCompensationRange")] pub annualized_base_compensation_range: Option, - /// Optional. - /// - /// Job compensation information. + /// Optional. Job compensation information. /// /// At most one entry can be of type /// CompensationInfo.CompensationType.BASE, which is @@ -1945,14 +1799,10 @@ impl Part for CompensationInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CompensationHistogramRequest { - /// Required. - /// - /// Numeric histogram options, like buckets, whether include min or max value. + /// Required. Numeric histogram options, like buckets, whether include min or max value. #[serde(rename="bucketingOption")] pub bucketing_option: Option, - /// Required. - /// - /// Type of the request, representing which field the histogramming should be + /// Required. Type of the request, representing which field the histogramming should be /// performed over. A single request can only specify one histogram of each /// `CompensationHistogramRequestType`. #[serde(rename="type")] @@ -1996,7 +1846,7 @@ impl Part for CustomAttributeHistogramResult {} /// /// Advice on address input / editing: /// - Use an i18n-ready address widget such as -/// https://github.com/googlei18n/libaddressinput) +/// https://github.com/google/libaddressinput) /// - Users should not be presented with UI elements for input or editing of /// fields outside countries where that field is used. /// @@ -2121,18 +1971,14 @@ impl Part for BucketRange {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobQuery { - /// Optional. - /// - /// This flag controls the spell-check feature. If false, the + /// Optional. This flag controls the spell-check feature. If false, the /// service attempts to correct a misspelled query, /// for example, "enginee" is corrected to "engineer". /// /// Defaults to false: a spell check is performed. #[serde(rename="disableSpellCheck")] pub disable_spell_check: Option, - /// Optional. - /// - /// This filter specifies a structured syntax to match against the + /// Optional. This filter specifies a structured syntax to match against the /// Job.custom_attributes marked as `filterable`. /// /// The syntax for this expression is a subset of SQL syntax. @@ -2149,16 +1995,14 @@ pub struct JobQuery { /// Boolean expressions (AND/OR/NOT) are supported up to 3 levels of /// nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 /// comparisons or functions are allowed in the expression. The expression - /// must be < 3000 bytes in length. + /// must be < 6000 bytes in length. /// /// Sample Query: /// `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND /// driving_years > 10` #[serde(rename="customAttributeFilter")] pub custom_attribute_filter: Option, - /// Optional. - /// - /// The employment type filter specifies the employment type of jobs to + /// Optional. The employment type filter specifies the employment type of jobs to /// search against, such as EmploymentType.FULL_TIME. /// /// If a value is not specified, jobs in the search results includes any @@ -2168,9 +2012,18 @@ pub struct JobQuery { /// any of the specified employment types. #[serde(rename="employmentTypes")] pub employment_types: Option>, - /// Optional. + /// The language code of query. For example, "en-US". This field helps to + /// better interpret the query. /// - /// This filter specifies the locale of jobs to search against, + /// If a value isn't specified, the query language code is automatically + /// detected, which may not be accurate. + /// + /// Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". + /// For more information, see + /// [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + #[serde(rename="queryLanguageCode")] + pub query_language_code: Option, + /// Optional. This filter specifies the locale of jobs to search against, /// for example, "en-US". /// /// If a value isn't specified, the search results can contain jobs in any @@ -2184,15 +2037,11 @@ pub struct JobQuery { /// At most 10 language code filters are allowed. #[serde(rename="languageCodes")] pub language_codes: Option>, - /// Optional. - /// - /// Jobs published within a range specified by this filter are searched + /// Optional. Jobs published within a range specified by this filter are searched /// against. #[serde(rename="publishTimeRange")] pub publish_time_range: Option, - /// Optional. - /// - /// Allows filtering jobs by commute time with different travel methods (for + /// Optional. Allows filtering jobs by commute time with different travel methods (for /// example, driving or public transit). Note: This only works with COMMUTE /// MODE. When specified, [JobQuery.location_filters] is /// ignored. @@ -2200,9 +2049,7 @@ pub struct JobQuery { /// Currently we don't support sorting by commute time. #[serde(rename="commuteFilter")] pub commute_filter: Option, - /// Optional. - /// - /// The category filter specifies the categories of jobs to search against. + /// Optional. The category filter specifies the categories of jobs to search against. /// See Category for more information. /// /// If a value is not specified, jobs from any category are searched against. @@ -2211,16 +2058,12 @@ pub struct JobQuery { /// categories are searched against. #[serde(rename="jobCategories")] pub job_categories: Option>, - /// Optional. - /// - /// The query string that matches against the job title, description, and + /// Optional. The query string that matches against the job title, description, and /// location fields. /// /// The maximum number of allowed characters is 255. pub query: Option, - /// Optional. - /// - /// This filter specifies the company entities to search against. + /// Optional. This filter specifies the company entities to search against. /// /// If a value isn't specified, jobs are searched for against all /// companies. @@ -2234,9 +2077,7 @@ pub struct JobQuery { /// At most 20 company filters are allowed. #[serde(rename="companyNames")] pub company_names: Option>, - /// Optional. - /// - /// This filter specifies the exact company display + /// Optional. This filter specifies the exact company display /// name of the jobs to search against. /// /// If a value isn't specified, jobs within the search results are @@ -2248,9 +2089,7 @@ pub struct JobQuery { /// At most 20 company display name filters are allowed. #[serde(rename="companyDisplayNames")] pub company_display_names: Option>, - /// Optional. - /// - /// The location filter specifies geo-regions containing the jobs to + /// Optional. The location filter specifies geo-regions containing the jobs to /// search against. See LocationFilter for more information. /// /// If a location value isn't specified, jobs fitting the other search @@ -2264,9 +2103,7 @@ pub struct JobQuery { /// At most 5 location filters are allowed. #[serde(rename="locationFilters")] pub location_filters: Option>, - /// Optional. - /// - /// This search filter is applied only to + /// Optional. This search filter is applied only to /// Job.compensation_info. For example, if the filter is specified /// as "Hourly job with per-hour compensation > $15", only jobs meeting /// these criteria are searched. If a filter isn't defined, all open jobs @@ -2397,29 +2234,6 @@ pub struct LatLng { impl Part for LatLng {} -/// Device information collected from the job seeker, candidate, or -/// other entity conducting the job search. Providing this information improves -/// the quality of the search results across devices. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeviceInfo { - /// Optional. - /// - /// Type of the device. - #[serde(rename="deviceType")] - pub device_type: Option, - /// Optional. - /// - /// A device-specific ID. The ID must be a unique identifier that - /// distinguishes the device from other devices. - pub id: Option, -} - -impl Part for DeviceInfo {} - - /// Input only. /// /// Update job request. @@ -2433,9 +2247,7 @@ impl Part for DeviceInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateJobRequest { - /// Required. - /// - /// The Job to be updated. + /// Required. The Job to be updated. pub job: Option, /// Optional but strongly recommended to be provided for the best service /// experience. @@ -2480,17 +2292,13 @@ impl Part for JobDerivedInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobEvent { - /// Required. - /// - /// The job name(s) associated with this event. + /// Required. The job name(s) associated with this event. /// For example, if this is an impression event, /// this field contains the identifiers of all jobs shown to the job seeker. /// If this was a view event, this field contains the /// identifier of the viewed job. pub jobs: Option>, - /// Required. - /// - /// The type of the event (see JobEventType). + /// Required. The type of the event (see JobEventType). #[serde(rename="type")] pub type_: Option, } @@ -2532,27 +2340,20 @@ impl Part for HistogramResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CommuteFilter { - /// Required. - /// - /// The latitude and longitude of the location from which to calculate the + /// Required. The latitude and longitude of the location from which to calculate the /// commute time. #[serde(rename="startCoordinates")] pub start_coordinates: Option, - /// Optional. - /// - /// The departure time used to calculate traffic impact, represented as + /// Optional. The departure time used to calculate traffic impact, represented as /// google.type.TimeOfDay in local time zone. /// /// Currently traffic model is restricted to hour level resolution. #[serde(rename="departureTime")] pub departure_time: Option, - /// Required. - /// - /// The method of transportation for which to calculate the commute time. + /// Required. The method of transportation for which to calculate the commute time. #[serde(rename="commuteMethod")] pub commute_method: Option, - /// Optional. - /// If true, jobs without "precise" addresses (street level addresses or GPS + /// Optional. If true, jobs without "precise" addresses (street level addresses or GPS /// coordinates) might also be returned. For city and coarser level addresses, /// text matching is used. If this field is set to false or is not specified, /// only jobs that include precise addresses are returned by Commute @@ -2564,15 +2365,11 @@ pub struct CommuteFilter { /// `travel_duration` time of 0 regardless of distance from the job seeker. #[serde(rename="allowImpreciseAddresses")] pub allow_imprecise_addresses: Option, - /// Required. - /// - /// The maximum travel time in seconds. The maximum allowed value is `3600s` + /// Required. The maximum travel time in seconds. The maximum allowed value is `3600s` /// (one hour). Format is `123s`. #[serde(rename="travelDuration")] pub travel_duration: Option, - /// Optional. - /// - /// Specifies the traffic density to use when calculating commute time. + /// Optional. Specifies the traffic density to use when calculating commute time. #[serde(rename="roadTraffic")] pub road_traffic: Option, } @@ -2591,9 +2388,7 @@ impl Part for CommuteFilter {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateClientEventRequest { - /// Required. - /// - /// Events issued when end user interacts with customer's application that + /// Required. Events issued when end user interacts with customer's application that /// uses Cloud Talent Solution. #[serde(rename="clientEvent")] pub client_event: Option, @@ -2610,17 +2405,13 @@ impl RequestValue for CreateClientEventRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NumericBucketingOption { - /// Required. - /// - /// Two adjacent values form a histogram bucket. Values should be in + /// Required. Two adjacent values form a histogram bucket. Values should be in /// ascending order. For example, if [5, 10, 15] are provided, four buckets are /// created: (-inf, 5), 5, 10), [10, 15), [15, inf). At most 20 /// [buckets_bound is supported. #[serde(rename="bucketBounds")] pub bucket_bounds: Option>, - /// Optional. - /// - /// If set to true, the histogram result includes minimum/maximum + /// Optional. If set to true, the histogram result includes minimum/maximum /// value of the numeric field. #[serde(rename="requiresMinMax")] pub requires_min_max: Option, @@ -2705,8 +2496,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// Resource name of the project under which the company is created. + /// * `parent` - Required. Resource name of the project under which the company is created. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn companies_create(&self, request: CreateCompanyRequest, parent: &str) -> ProjectCompanyCreateCall<'a, C, A> { @@ -2726,8 +2516,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// The resource name of the project under which the job is created. + /// * `parent` - Required. The resource name of the project under which the job is created. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn jobs_list(&self, parent: &str) -> ProjectJobListCall<'a, C, A> { @@ -2753,8 +2542,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The resource name of the job to be deleted. + /// * `name` - Required. The resource name of the job to be deleted. /// The format is "projects/{project_id}/jobs/{job_id}", /// for example, "projects/api-test-project/jobs/1234". pub fn jobs_delete(&self, name: &str) -> ProjectJobDeleteCall<'a, C, A> { @@ -2773,8 +2561,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The resource name of the company to be retrieved. + /// * `name` - Required. The resource name of the company to be retrieved. /// The format is "projects/{project_id}/companies/{company_id}", for example, /// "projects/api-test-project/companies/foo". pub fn companies_get(&self, name: &str) -> ProjectCompanyGetCall<'a, C, A> { @@ -2798,8 +2585,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The resource name of the project to search within. + /// * `parent` - Required. The resource name of the project to search within. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn jobs_search(&self, request: SearchJobsRequest, parent: &str) -> ProjectJobSearchCall<'a, C, A> { @@ -2819,8 +2605,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. - /// Resource name of the project under which the company is created. + /// * `parent` - Required. Resource name of the project under which the company is created. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn companies_list(&self, parent: &str) -> ProjectCompanyListCall<'a, C, A> { @@ -2843,8 +2628,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The resource name of the job to retrieve. + /// * `name` - Required. The resource name of the job to retrieve. /// The format is "projects/{project_id}/jobs/{job_id}", /// for example, "projects/api-test-project/jobs/1234". pub fn jobs_get(&self, name: &str) -> ProjectJobGetCall<'a, C, A> { @@ -2873,8 +2657,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The resource name of the project to search within. + /// * `parent` - Required. The resource name of the project to search within. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn jobs_search_for_alert(&self, request: SearchJobsRequest, parent: &str) -> ProjectJobSearchForAlertCall<'a, C, A> { @@ -2898,8 +2681,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The resource name of the project under which the job is created. + /// * `parent` - Required. The resource name of the project under which the job is created. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn jobs_create(&self, request: CreateJobRequest, parent: &str) -> ProjectJobCreateCall<'a, C, A> { @@ -2945,8 +2727,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. - /// The resource name of the project under which the job is created. + /// * `parent` - Required. The resource name of the project under which the job is created. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn jobs_batch_delete(&self, request: BatchDeleteJobsRequest, parent: &str) -> ProjectJobBatchDeleteCall<'a, C, A> { @@ -2967,8 +2748,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// The resource name of the company to be deleted. + /// * `name` - Required. The resource name of the company to be deleted. /// The format is "projects/{project_id}/companies/{company_id}", for example, /// "projects/api-test-project/companies/foo". pub fn companies_delete(&self, name: &str) -> ProjectCompanyDeleteCall<'a, C, A> { @@ -3016,8 +2796,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. - /// Resource name of project the completion is performed within. + /// * `name` - Required. Resource name of project the completion is performed within. /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". pub fn complete(&self, name: &str) -> ProjectCompleteCall<'a, C, A> { @@ -3537,9 +3316,7 @@ impl<'a, C, A> ProjectCompanyCreateCall<'a, C, A> where C: BorrowMut ProjectJobListCall<'a, C, A> where C: BorrowMut, A } - /// Required. - /// - /// The resource name of the project under which the job is created. + /// Required. The resource name of the project under which the job is created. /// /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". @@ -3825,18 +3600,14 @@ impl<'a, C, A> ProjectJobListCall<'a, C, A> where C: BorrowMut, A self._parent = new_value.to_string(); self } - /// Optional. - /// - /// The starting point of a query result. + /// Optional. The starting point of a query result. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ProjectJobListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. - /// - /// The maximum number of jobs to be returned per page of results. + /// Optional. The maximum number of jobs to be returned per page of results. /// /// If job_view is set to JobView.JOB_VIEW_ID_ONLY, the maximum allowed /// page size is 1000. Otherwise, the maximum allowed page size is 100. @@ -3848,9 +3619,7 @@ impl<'a, C, A> ProjectJobListCall<'a, C, A> where C: BorrowMut, A self._page_size = Some(new_value); self } - /// Optional. - /// - /// The desired job attributes returned for jobs in the + /// Optional. The desired job attributes returned for jobs in the /// search response. Defaults to JobView.JOB_VIEW_FULL if no value is /// specified. /// @@ -3859,9 +3628,7 @@ impl<'a, C, A> ProjectJobListCall<'a, C, A> where C: BorrowMut, A self._job_view = Some(new_value.to_string()); self } - /// Required. - /// - /// The filter string specifies the jobs to be enumerated. + /// Required. The filter string specifies the jobs to be enumerated. /// /// Supported operator: =, AND /// @@ -4122,9 +3889,7 @@ impl<'a, C, A> ProjectJobDeleteCall<'a, C, A> where C: BorrowMut, } - /// Required. - /// - /// The resource name of the job to be deleted. + /// Required. The resource name of the job to be deleted. /// /// The format is "projects/{project_id}/jobs/{job_id}", /// for example, "projects/api-test-project/jobs/1234". @@ -4375,9 +4140,7 @@ impl<'a, C, A> ProjectCompanyGetCall<'a, C, A> where C: BorrowMut } - /// Required. - /// - /// The resource name of the company to be retrieved. + /// Required. The resource name of the company to be retrieved. /// /// The format is "projects/{project_id}/companies/{company_id}", for example, /// "projects/api-test-project/companies/foo". @@ -4663,9 +4426,7 @@ impl<'a, C, A> ProjectJobSearchCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// Required. - /// - /// The resource name of the project to search within. + /// Required. The resource name of the project to search within. /// /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". @@ -4931,9 +4692,7 @@ impl<'a, C, A> ProjectCompanyListCall<'a, C, A> where C: BorrowMut ProjectCompanyListCall<'a, C, A> where C: BorrowMut ProjectCompanyListCall<'a, C, A> where C: BorrowMut ProjectCompanyListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional. - /// - /// The maximum number of companies to be returned, at most 100. + /// Optional. The maximum number of companies to be returned, at most 100. /// Default is 100 if a non-positive number is provided. /// /// Sets the *page size* query property to the given value. @@ -5218,9 +4971,7 @@ impl<'a, C, A> ProjectJobGetCall<'a, C, A> where C: BorrowMut, A: } - /// Required. - /// - /// The resource name of the job to retrieve. + /// Required. The resource name of the job to retrieve. /// /// The format is "projects/{project_id}/jobs/{job_id}", /// for example, "projects/api-test-project/jobs/1234". @@ -5511,9 +5262,7 @@ impl<'a, C, A> ProjectJobSearchForAlertCall<'a, C, A> where C: BorrowMut ProjectJobCreateCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// Required. - /// - /// The resource name of the project under which the job is created. + /// Required. The resource name of the project under which the job is created. /// /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". @@ -6369,9 +6116,7 @@ impl<'a, C, A> ProjectJobBatchDeleteCall<'a, C, A> where C: BorrowMut ProjectCompanyDeleteCall<'a, C, A> where C: BorrowMut ProjectCompleteCall<'a, C, A> where C: BorrowMut, } - /// Required. - /// - /// Resource name of project the completion is performed within. + /// Required. Resource name of project the completion is performed within. /// /// The format is "projects/{project_id}", for example, /// "projects/api-test-project". @@ -7220,27 +6961,21 @@ impl<'a, C, A> ProjectCompleteCall<'a, C, A> where C: BorrowMut, self._name = new_value.to_string(); self } - /// Optional. - /// - /// The completion topic. The default is CompletionType.COMBINED. + /// Optional. The completion topic. The default is CompletionType.COMBINED. /// /// Sets the *type* query property to the given value. pub fn type_(mut self, new_value: &str) -> ProjectCompleteCall<'a, C, A> { self._type_ = Some(new_value.to_string()); self } - /// Optional. - /// - /// The scope of the completion. The defaults is CompletionScope.PUBLIC. + /// Optional. The scope of the completion. The defaults is CompletionScope.PUBLIC. /// /// Sets the *scope* query property to the given value. pub fn scope(mut self, new_value: &str) -> ProjectCompleteCall<'a, C, A> { self._scope = Some(new_value.to_string()); self } - /// Required. - /// - /// The query used to generate suggestions. + /// Required. The query used to generate suggestions. /// /// The maximum number of allowed characters is 255. /// @@ -7249,9 +6984,7 @@ impl<'a, C, A> ProjectCompleteCall<'a, C, A> where C: BorrowMut, self._query = Some(new_value.to_string()); self } - /// Required. - /// - /// Completion result count. + /// Required. Completion result count. /// /// The maximum allowed page size is 10. /// @@ -7260,9 +6993,7 @@ impl<'a, C, A> ProjectCompleteCall<'a, C, A> where C: BorrowMut, self._page_size = Some(new_value); self } - /// Optional. - /// - /// The list of languages of the query. This is + /// Optional. The list of languages of the query. This is /// the BCP-47 language code, such as "en-US" or "sr-Latn". /// For more information, see /// [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). @@ -7313,9 +7044,7 @@ impl<'a, C, A> ProjectCompleteCall<'a, C, A> where C: BorrowMut, self._language_code = Some(new_value.to_string()); self } - /// Optional. - /// - /// If provided, restricts completion to specified company. + /// Optional. If provided, restricts completion to specified company. /// /// The format is "projects/{project_id}/companies/{company_id}", for example, /// "projects/api-test-project/companies/foo". diff --git a/gen/language1-cli/Cargo.toml b/gen/language1-cli/Cargo.toml index 8791718284..e9b12768e9 100644 --- a/gen/language1-cli/Cargo.toml +++ b/gen/language1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-language1-cli" -version = "1.0.12+20190623" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Natural Language (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/language1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-language1] path = "../language1" -version = "1.0.12+20190623" +version = "1.0.13+20200406" diff --git a/gen/language1-cli/README.md b/gen/language1-cli/README.md index 6ff1edcf46..d0edcd56d4 100644 --- a/gen/language1-cli/README.md +++ b/gen/language1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Natural Language* API at revision *20190623*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Natural Language* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash language1 [options] diff --git a/gen/language1-cli/mkdocs.yml b/gen/language1-cli/mkdocs.yml index b45011391d..f87d3096cd 100644 --- a/gen/language1-cli/mkdocs.yml +++ b/gen/language1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Natural Language v1.0.12+20190623 +site_name: Cloud Natural Language v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-language1-cli site_description: A complete library to interact with Cloud Natural Language (protocol v1) diff --git a/gen/language1-cli/src/main.rs b/gen/language1-cli/src/main.rs index 26378dd9a6..e82629d819 100644 --- a/gen/language1-cli/src/main.rs +++ b/gen/language1-cli/src/main.rs @@ -845,7 +845,7 @@ fn main() { let mut app = App::new("language1") .author("Sebastian Thiel ") - .version("1.0.12+20190623") + .version("1.0.13+20200406") .about("Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_language1_cli") .arg(Arg::with_name("url") diff --git a/gen/language1/Cargo.toml b/gen/language1/Cargo.toml index 01377e4e13..26a0ef4606 100644 --- a/gen/language1/Cargo.toml +++ b/gen/language1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-language1" -version = "1.0.12+20190623" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Natural Language (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/language1" homepage = "https://cloud.google.com/natural-language/" -documentation = "https://docs.rs/google-language1/1.0.12+20190623" +documentation = "https://docs.rs/google-language1/1.0.13+20200406" license = "MIT" keywords = ["language", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/language1/README.md b/gen/language1/README.md index c08bf20c4d..099977249c 100644 --- a/gen/language1/README.md +++ b/gen/language1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-language1` library allows access to all features of the *Google Cloud Natural Language* service. -This documentation was generated from *Cloud Natural Language* crate version *1.0.12+20190623*, where *20190623* is the exact revision of the *language:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Natural Language* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *language:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Natural Language* *v1* API can be found at the [official documentation site](https://cloud.google.com/natural-language/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.CloudNaturalLanguage.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.CloudNaturalLanguage.html) ... -* [documents](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.Document.html) - * [*analyze entities*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.DocumentAnalyzeEntityCall.html), [*analyze entity sentiment*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.DocumentAnalyzeEntitySentimentCall.html), [*analyze sentiment*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.DocumentAnalyzeSentimentCall.html), [*analyze syntax*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.DocumentAnalyzeSyntaxCall.html), [*annotate text*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.DocumentAnnotateTextCall.html) and [*classify text*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.DocumentClassifyTextCall.html) +* [documents](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.Document.html) + * [*analyze entities*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.DocumentAnalyzeEntityCall.html), [*analyze entity sentiment*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.DocumentAnalyzeEntitySentimentCall.html), [*analyze sentiment*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.DocumentAnalyzeSentimentCall.html), [*analyze syntax*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.DocumentAnalyzeSyntaxCall.html), [*annotate text*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.DocumentAnnotateTextCall.html) and [*classify text*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.DocumentClassifyTextCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-language1/1.0.12+20190623/google_language1/struct.CloudNaturalLanguage.html)** +* **[Hub](https://docs.rs/google-language1/1.0.13+20200406/google_language1/struct.CloudNaturalLanguage.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.Part.html)** + * **[Parts](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-language1/1.0.12+20190623/google_language1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-language1/1.0.13+20200406/google_language1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-language1/1.0.12+20190623/google_language1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-language1/1.0.13+20200406/google_language1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-language1/1.0.12+20190623/google_language1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-language1/1.0.13+20200406/google_language1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/language1/src/lib.rs b/gen/language1/src/lib.rs index 900c70b973..3d24804ad8 100644 --- a/gen/language1/src/lib.rs +++ b/gen/language1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Natural Language* crate version *1.0.12+20190623*, where *20190623* is the exact revision of the *language:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Natural Language* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *language:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Natural Language* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/natural-language/). @@ -338,7 +338,7 @@ impl<'a, C, A> CloudNaturalLanguage CloudNaturalLanguage { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://language.googleapis.com/".to_string(), _root_url: "https://language.googleapis.com/".to_string(), } @@ -349,7 +349,7 @@ impl<'a, C, A> CloudNaturalLanguage } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -444,7 +444,7 @@ impl Part for Sentiment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClassifyTextRequest { - /// Input document. + /// Required. Input document. pub document: Option, } @@ -462,7 +462,7 @@ impl RequestValue for ClassifyTextRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnalyzeEntitySentimentRequest { - /// Input document. + /// Required. Input document. pub document: Option, /// The encoding type used by the API to calculate offsets. #[serde(rename="encodingType")] @@ -580,11 +580,11 @@ pub struct Document { /// The language of the document (if not specified, the language is /// automatically detected). Both ISO and BCP-47 language codes are /// accepted.
          - /// [Language Support](/natural-language/docs/languages) - /// lists currently supported languages for each API method. - /// If the language (either specified by the caller or automatically detected) - /// is not supported by the called API method, an `INVALID_ARGUMENT` error - /// is returned. + /// [Language + /// Support](https://cloud.google.com/natural-language/docs/languages) lists + /// currently supported languages for each API method. If the language (either + /// specified by the caller or automatically detected) is not supported by the + /// called API method, an `INVALID_ARGUMENT` error is returned. pub language: Option, /// The Google Cloud Storage URI where the file content is located. /// This URI must be of the form: gs://bucket_name/object_name. For more @@ -651,12 +651,12 @@ impl ResponseResult for ClassifyTextResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnnotateTextRequest { - /// Input document. + /// Required. Input document. pub document: Option, /// The encoding type used by the API to calculate offsets. #[serde(rename="encodingType")] pub encoding_type: Option, - /// The enabled features. + /// Required. The enabled features. pub features: Option, } @@ -700,7 +700,7 @@ pub struct ClassificationCategory { /// the classifier is that this category represents the given text. pub confidence: Option, /// The name of the category representing the document, from the [predefined - /// taxonomy](/natural-language/docs/categories). + /// taxonomy](https://cloud.google.com/natural-language/docs/categories). pub name: Option, } @@ -813,7 +813,7 @@ impl Part for EntityMention {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnalyzeSentimentRequest { - /// Input document. + /// Required. Input document. pub document: Option, /// The encoding type used by the API to calculate sentence offsets. #[serde(rename="encodingType")] @@ -859,7 +859,7 @@ impl ResponseResult for AnalyzeSentimentResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnalyzeSyntaxRequest { - /// Input document. + /// Required. Input document. pub document: Option, /// The encoding type used by the API to calculate offsets. #[serde(rename="encodingType")] @@ -902,7 +902,7 @@ impl ResponseResult for AnalyzeEntitiesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnalyzeEntitiesRequest { - /// Input document. + /// Required. Input document. pub document: Option, /// The encoding type used by the API to calculate offsets. #[serde(rename="encodingType")] diff --git a/gen/language1_beta1-cli/Cargo.toml b/gen/language1_beta1-cli/Cargo.toml index e556f7b954..56b1d8c0dd 100644 --- a/gen/language1_beta1-cli/Cargo.toml +++ b/gen/language1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-language1_beta1-cli" -version = "1.0.12+20190623" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Natural Language (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/language1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-language1_beta1] path = "../language1_beta1" -version = "1.0.12+20190623" +version = "1.0.13+20200406" diff --git a/gen/language1_beta1-cli/README.md b/gen/language1_beta1-cli/README.md index 62ad104c56..9b9e27a524 100644 --- a/gen/language1_beta1-cli/README.md +++ b/gen/language1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Natural Language* API at revision *20190623*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Natural Language* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash language1-beta1 [options] diff --git a/gen/language1_beta1-cli/mkdocs.yml b/gen/language1_beta1-cli/mkdocs.yml index 085b7abb50..21478c3f4a 100644 --- a/gen/language1_beta1-cli/mkdocs.yml +++ b/gen/language1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Natural Language v1.0.12+20190623 +site_name: Cloud Natural Language v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-language1_beta1-cli site_description: A complete library to interact with Cloud Natural Language (protocol v1beta1) diff --git a/gen/language1_beta1-cli/src/main.rs b/gen/language1_beta1-cli/src/main.rs index 9479ad464f..95d3c278a2 100644 --- a/gen/language1_beta1-cli/src/main.rs +++ b/gen/language1_beta1-cli/src/main.rs @@ -615,7 +615,7 @@ fn main() { let mut app = App::new("language1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190623") + .version("1.0.13+20200406") .about("Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_language1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/language1_beta1/Cargo.toml b/gen/language1_beta1/Cargo.toml index 8741231bce..88e568f10b 100644 --- a/gen/language1_beta1/Cargo.toml +++ b/gen/language1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-language1_beta1" -version = "1.0.12+20190623" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Natural Language (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/language1_beta1" homepage = "https://cloud.google.com/natural-language/" -documentation = "https://docs.rs/google-language1_beta1/1.0.12+20190623" +documentation = "https://docs.rs/google-language1_beta1/1.0.13+20200406" license = "MIT" keywords = ["language", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/language1_beta1/README.md b/gen/language1_beta1/README.md index a574238782..d20855c041 100644 --- a/gen/language1_beta1/README.md +++ b/gen/language1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-language1_beta1` library allows access to all features of the *Google Cloud Natural Language* service. -This documentation was generated from *Cloud Natural Language* crate version *1.0.12+20190623*, where *20190623* is the exact revision of the *language:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Natural Language* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *language:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Natural Language* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/natural-language/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/struct.CloudNaturalLanguage.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/struct.CloudNaturalLanguage.html) ... -* [documents](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/struct.Document.html) - * [*analyze entities*](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/struct.DocumentAnalyzeEntityCall.html), [*analyze sentiment*](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/struct.DocumentAnalyzeSentimentCall.html), [*analyze syntax*](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/struct.DocumentAnalyzeSyntaxCall.html) and [*annotate text*](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/struct.DocumentAnnotateTextCall.html) +* [documents](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/struct.Document.html) + * [*analyze entities*](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/struct.DocumentAnalyzeEntityCall.html), [*analyze sentiment*](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/struct.DocumentAnalyzeSentimentCall.html), [*analyze syntax*](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/struct.DocumentAnalyzeSyntaxCall.html) and [*annotate text*](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/struct.DocumentAnnotateTextCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/struct.CloudNaturalLanguage.html)** +* **[Hub](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/struct.CloudNaturalLanguage.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-language1_beta1/1.0.12+20190623/google_language1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-language1_beta1/1.0.13+20200406/google_language1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/language1_beta1/src/lib.rs b/gen/language1_beta1/src/lib.rs index 1f2917c99c..42a408069e 100644 --- a/gen/language1_beta1/src/lib.rs +++ b/gen/language1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Natural Language* crate version *1.0.12+20190623*, where *20190623* is the exact revision of the *language:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Natural Language* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *language:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Natural Language* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/natural-language/). @@ -336,7 +336,7 @@ impl<'a, C, A> CloudNaturalLanguage CloudNaturalLanguage { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://language.googleapis.com/".to_string(), _root_url: "https://language.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> CloudNaturalLanguage } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -515,11 +515,11 @@ pub struct Document { /// The language of the document (if not specified, the language is /// automatically detected). Both ISO and BCP-47 language codes are /// accepted.
          - /// [Language Support](/natural-language/docs/languages) - /// lists currently supported languages for each API method. - /// If the language (either specified by the caller or automatically detected) - /// is not supported by the called API method, an `INVALID_ARGUMENT` error - /// is returned. + /// [Language + /// Support](https://cloud.google.com/natural-language/docs/languages) lists + /// currently supported languages for each API method. If the language (either + /// specified by the caller or automatically detected) is not supported by the + /// called API method, an `INVALID_ARGUMENT` error is returned. pub language: Option, /// The Google Cloud Storage URI where the file content is located. /// This URI must be of the form: gs://bucket_name/object_name. For more diff --git a/gen/libraryagent1-cli/Cargo.toml b/gen/libraryagent1-cli/Cargo.toml index 91d0a9b2b3..9b81b70d3f 100644 --- a/gen/libraryagent1-cli/Cargo.toml +++ b/gen/libraryagent1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-libraryagent1-cli" -version = "1.0.12+20190703" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Libraryagent (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/libraryagent1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-libraryagent1] path = "../libraryagent1" -version = "1.0.12+20190703" +version = "1.0.13+20200409" diff --git a/gen/libraryagent1-cli/README.md b/gen/libraryagent1-cli/README.md index bd679938c2..6caefd666e 100644 --- a/gen/libraryagent1-cli/README.md +++ b/gen/libraryagent1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Libraryagent* API at revision *20190703*. The CLI is at version *1.0.12*. +This documentation was generated from the *Libraryagent* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash libraryagent1 [options] diff --git a/gen/libraryagent1-cli/mkdocs.yml b/gen/libraryagent1-cli/mkdocs.yml index 6af4b19442..70b4b475bf 100644 --- a/gen/libraryagent1-cli/mkdocs.yml +++ b/gen/libraryagent1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Libraryagent v1.0.12+20190703 +site_name: Libraryagent v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-libraryagent1-cli site_description: A complete library to interact with Libraryagent (protocol v1) diff --git a/gen/libraryagent1-cli/src/main.rs b/gen/libraryagent1-cli/src/main.rs index 2964e1ce9d..f27ec6d67b 100644 --- a/gen/libraryagent1-cli/src/main.rs +++ b/gen/libraryagent1-cli/src/main.rs @@ -498,7 +498,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the book to borrow."##), + Some(r##"Required. The name of the book to borrow."##), Some(true), Some(false)), @@ -520,7 +520,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the book to retrieve."##), + Some(r##"Required. The name of the book to retrieve."##), Some(true), Some(false)), @@ -544,7 +544,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The name of the shelf whose books we'd like to list."##), + Some(r##"Required. The name of the shelf whose books we'd like to list."##), Some(true), Some(false)), @@ -569,7 +569,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the book to return."##), + Some(r##"Required. The name of the book to return."##), Some(true), Some(false)), @@ -591,7 +591,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the shelf to retrieve."##), + Some(r##"Required. The name of the shelf to retrieve."##), Some(true), Some(false)), @@ -630,7 +630,7 @@ fn main() { let mut app = App::new("libraryagent1") .author("Sebastian Thiel ") - .version("1.0.12+20190703") + .version("1.0.13+20200409") .about("A simple Google Example Library API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_libraryagent1_cli") .arg(Arg::with_name("url") diff --git a/gen/libraryagent1/Cargo.toml b/gen/libraryagent1/Cargo.toml index 3f96cc8fb2..5392b41e09 100644 --- a/gen/libraryagent1/Cargo.toml +++ b/gen/libraryagent1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-libraryagent1" -version = "1.0.12+20190703" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Libraryagent (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/libraryagent1" homepage = "https://cloud.google.com/docs/quota" -documentation = "https://docs.rs/google-libraryagent1/1.0.12+20190703" +documentation = "https://docs.rs/google-libraryagent1/1.0.13+20200409" license = "MIT" keywords = ["libraryagent", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/libraryagent1/README.md b/gen/libraryagent1/README.md index c5176bc320..0d4ec86f44 100644 --- a/gen/libraryagent1/README.md +++ b/gen/libraryagent1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-libraryagent1` library allows access to all features of the *Google Libraryagent* service. -This documentation was generated from *Libraryagent* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *libraryagent:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Libraryagent* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *libraryagent:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Libraryagent* *v1* API can be found at the [official documentation site](https://cloud.google.com/docs/quota). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.Libraryagent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.Libraryagent.html) ... * shelves - * [*books borrow*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.ShelveBookBorrowCall.html), [*books get*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.ShelveBookGetCall.html), [*books list*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.ShelveBookListCall.html), [*books return*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.ShelveBookReturnCall.html), [*get*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.ShelveGetCall.html) and [*list*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.ShelveListCall.html) + * [*books borrow*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.ShelveBookBorrowCall.html), [*books get*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.ShelveBookGetCall.html), [*books list*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.ShelveBookListCall.html), [*books return*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.ShelveBookReturnCall.html), [*get*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.ShelveGetCall.html) and [*list*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.ShelveListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/struct.Libraryagent.html)** +* **[Hub](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/struct.Libraryagent.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.Part.html)** + * **[Parts](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -126,17 +126,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -146,29 +146,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-libraryagent1/1.0.12+20190703/google_libraryagent1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-libraryagent1/1.0.13+20200409/google_libraryagent1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/libraryagent1/src/lib.rs b/gen/libraryagent1/src/lib.rs index d00a3048ef..c86bb7ea6e 100644 --- a/gen/libraryagent1/src/lib.rs +++ b/gen/libraryagent1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Libraryagent* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *libraryagent:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Libraryagent* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *libraryagent:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Libraryagent* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/docs/quota). @@ -319,7 +319,7 @@ impl<'a, C, A> Libraryagent Libraryagent { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://libraryagent.googleapis.com/".to_string(), _root_url: "https://libraryagent.googleapis.com/".to_string(), } @@ -330,7 +330,7 @@ impl<'a, C, A> Libraryagent } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -511,7 +511,7 @@ impl<'a, C, A> ShelveMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the book to return. + /// * `name` - Required. The name of the book to return. pub fn books_return(&self, name: &str) -> ShelveBookReturnCall<'a, C, A> { ShelveBookReturnCall { hub: self.hub, @@ -528,7 +528,7 @@ impl<'a, C, A> ShelveMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the shelf to retrieve. + /// * `name` - Required. The name of the shelf to retrieve. pub fn get(&self, name: &str) -> ShelveGetCall<'a, C, A> { ShelveGetCall { hub: self.hub, @@ -548,7 +548,7 @@ impl<'a, C, A> ShelveMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the book to borrow. + /// * `name` - Required. The name of the book to borrow. pub fn books_borrow(&self, name: &str) -> ShelveBookBorrowCall<'a, C, A> { ShelveBookBorrowCall { hub: self.hub, @@ -582,7 +582,7 @@ impl<'a, C, A> ShelveMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The name of the shelf whose books we'd like to list. + /// * `parent` - Required. The name of the shelf whose books we'd like to list. pub fn books_list(&self, parent: &str) -> ShelveBookListCall<'a, C, A> { ShelveBookListCall { hub: self.hub, @@ -601,7 +601,7 @@ impl<'a, C, A> ShelveMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The name of the book to retrieve. + /// * `name` - Required. The name of the book to retrieve. pub fn books_get(&self, name: &str) -> ShelveBookGetCall<'a, C, A> { ShelveBookGetCall { hub: self.hub, @@ -799,7 +799,7 @@ impl<'a, C, A> ShelveBookReturnCall<'a, C, A> where C: BorrowMut, } - /// The name of the book to return. + /// Required. The name of the book to return. /// /// Sets the *name* path property to the given value. /// @@ -1047,7 +1047,7 @@ impl<'a, C, A> ShelveGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// The name of the shelf to retrieve. + /// Required. The name of the shelf to retrieve. /// /// Sets the *name* path property to the given value. /// @@ -1298,7 +1298,7 @@ impl<'a, C, A> ShelveBookBorrowCall<'a, C, A> where C: BorrowMut, } - /// The name of the book to borrow. + /// Required. The name of the book to borrow. /// /// Sets the *name* path property to the given value. /// @@ -1798,7 +1798,7 @@ impl<'a, C, A> ShelveBookListCall<'a, C, A> where C: BorrowMut, A } - /// The name of the shelf whose books we'd like to list. + /// Required. The name of the shelf whose books we'd like to list. /// /// Sets the *parent* path property to the given value. /// @@ -2064,7 +2064,7 @@ impl<'a, C, A> ShelveBookGetCall<'a, C, A> where C: BorrowMut, A: } - /// The name of the book to retrieve. + /// Required. The name of the book to retrieve. /// /// Sets the *name* path property to the given value. /// diff --git a/gen/licensing1-cli/Cargo.toml b/gen/licensing1-cli/Cargo.toml index fefc446cff..045c38f8ee 100644 --- a/gen/licensing1-cli/Cargo.toml +++ b/gen/licensing1-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-licensing1-cli" -version = "1.0.12+20170213" +version = "1.0.13+20190916" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1-cli" -homepage = "https://developers.google.com/google-apps/licensing/" +homepage = "https://developers.google.com/admin-sdk/licensing/" documentation = "http://byron.github.io/google-apis-rs/google_licensing1_cli" license = "MIT" keywords = ["licensing", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-licensing1] path = "../licensing1" -version = "1.0.12+20170213" +version = "1.0.13+20190916" diff --git a/gen/licensing1-cli/README.md b/gen/licensing1-cli/README.md index f55b7c92ea..c395afd882 100644 --- a/gen/licensing1-cli/README.md +++ b/gen/licensing1-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *licensing* API can be found at the -[official documentation site](https://developers.google.com/google-apps/licensing/). +[official documentation site](https://developers.google.com/admin-sdk/licensing/). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *licensing* API at revision *20170213*. The CLI is at version *1.0.12*. +This documentation was generated from the *licensing* API at revision *20190916*. The CLI is at version *1.0.13*. ```bash licensing1 [options] diff --git a/gen/licensing1-cli/mkdocs.yml b/gen/licensing1-cli/mkdocs.yml index f2d1b969b1..641937b8f5 100644 --- a/gen/licensing1-cli/mkdocs.yml +++ b/gen/licensing1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: licensing v1.0.12+20170213 +site_name: licensing v1.0.13+20190916 site_url: http://byron.github.io/google-apis-rs/google-licensing1-cli site_description: A complete library to interact with licensing (protocol v1) diff --git a/gen/licensing1-cli/src/main.rs b/gen/licensing1-cli/src/main.rs index de4cc31a48..ce4566d120 100644 --- a/gen/licensing1-cli/src/main.rs +++ b/gen/licensing1-cli/src/main.rs @@ -647,24 +647,26 @@ fn main() { let arg_data = [ ("license-assignments", "methods: 'delete', 'get', 'insert', 'list-for-product', 'list-for-product-and-sku', 'patch' and 'update'", vec![ ("delete", - Some(r##"Revoke License."##), + Some(r##"Revoke a license."##), "Details at http://byron.github.io/google-apis-rs/google_licensing1_cli/license-assignments_delete", vec![ (Some(r##"product-id"##), None, - Some(r##"Name for product"##), + Some(r##"A product's unique identifier. For more information about products in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"sku-id"##), None, - Some(r##"Name for sku"##), + Some(r##"A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"email id or unique Id of the user"##), + Some(r##"The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + If the userId is suspended, the license status changes."##), Some(true), Some(false)), @@ -675,24 +677,26 @@ fn main() { Some(true)), ]), ("get", - Some(r##"Get license assignment of a particular product and sku for a user"##), + Some(r##"Get a specific user's license by product SKU."##), "Details at http://byron.github.io/google-apis-rs/google_licensing1_cli/license-assignments_get", vec![ (Some(r##"product-id"##), None, - Some(r##"Name for product"##), + Some(r##"A product's unique identifier. For more information about products in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"sku-id"##), None, - Some(r##"Name for sku"##), + Some(r##"A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"email id or unique Id of the user"##), + Some(r##"The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + If the userId is suspended, the license status changes."##), Some(true), Some(false)), @@ -709,18 +713,18 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Assign License."##), + Some(r##"Assign a license."##), "Details at http://byron.github.io/google-apis-rs/google_licensing1_cli/license-assignments_insert", vec![ (Some(r##"product-id"##), None, - Some(r##"Name for product"##), + Some(r##"A product's unique identifier. For more information about products in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"sku-id"##), None, - Some(r##"Name for sku"##), + Some(r##"A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs."##), Some(true), Some(false)), @@ -743,18 +747,19 @@ fn main() { Some(false)), ]), ("list-for-product", - Some(r##"List license assignments for given product of the customer."##), + Some(r##"List all users assigned licenses for a specific product SKU."##), "Details at http://byron.github.io/google-apis-rs/google_licensing1_cli/license-assignments_list-for-product", vec![ (Some(r##"product-id"##), None, - Some(r##"Name for product"##), + Some(r##"A product's unique identifier. For more information about products in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"customer-id"##), None, - Some(r##"CustomerId represents the customer for whom licenseassignments are queried"##), + Some(r##"Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + If the customer is suspended, the server returns an error."##), Some(true), Some(false)), @@ -771,24 +776,25 @@ fn main() { Some(false)), ]), ("list-for-product-and-sku", - Some(r##"List license assignments for given product and sku of the customer."##), + Some(r##"List all users assigned licenses for a specific product SKU."##), "Details at http://byron.github.io/google-apis-rs/google_licensing1_cli/license-assignments_list-for-product-and-sku", vec![ (Some(r##"product-id"##), None, - Some(r##"Name for product"##), + Some(r##"A product's unique identifier. For more information about products in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"sku-id"##), None, - Some(r##"Name for sku"##), + Some(r##"A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"customer-id"##), None, - Some(r##"CustomerId represents the customer for whom licenseassignments are queried"##), + Some(r##"Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + If the customer is suspended, the server returns an error."##), Some(true), Some(false)), @@ -805,24 +811,26 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Assign License. This method supports patch semantics."##), + Some(r##"Reassign a user's product SKU with a different SKU in the same product. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_licensing1_cli/license-assignments_patch", vec![ (Some(r##"product-id"##), None, - Some(r##"Name for product"##), + Some(r##"A product's unique identifier. For more information about products in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"sku-id"##), None, - Some(r##"Name for sku for which license would be revoked"##), + Some(r##"A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"email id or unique Id of the user"##), + Some(r##"The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + If the userId is suspended, the license status changes."##), Some(true), Some(false)), @@ -845,24 +853,26 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Assign License."##), + Some(r##"Reassign a user's product SKU with a different SKU in the same product."##), "Details at http://byron.github.io/google-apis-rs/google_licensing1_cli/license-assignments_update", vec![ (Some(r##"product-id"##), None, - Some(r##"Name for product"##), + Some(r##"A product's unique identifier. For more information about products in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"sku-id"##), None, - Some(r##"Name for sku for which license would be revoked"##), + Some(r##"A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"email id or unique Id of the user"##), + Some(r##"The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + If the userId is suspended, the license status changes."##), Some(true), Some(false)), @@ -890,8 +900,8 @@ fn main() { let mut app = App::new("licensing1") .author("Sebastian Thiel ") - .version("1.0.12+20170213") - .about("Views and manages licenses for your domain.") + .version("1.0.13+20190916") + .about("Licensing API to view and manage licenses for your domain") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_licensing1_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/licensing1/Cargo.toml b/gen/licensing1/Cargo.toml index 616be0668c..3743c40625 100644 --- a/gen/licensing1/Cargo.toml +++ b/gen/licensing1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-licensing1" -version = "1.0.12+20170213" +version = "1.0.13+20190916" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1" -homepage = "https://developers.google.com/google-apps/licensing/" -documentation = "https://docs.rs/google-licensing1/1.0.12+20170213" +homepage = "https://developers.google.com/admin-sdk/licensing/" +documentation = "https://docs.rs/google-licensing1/1.0.13+20190916" license = "MIT" keywords = ["licensing", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/licensing1/README.md b/gen/licensing1/README.md index 6915801de8..022203bc70 100644 --- a/gen/licensing1/README.md +++ b/gen/licensing1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-licensing1` library allows access to all features of the *Google licensing* service. -This documentation was generated from *licensing* crate version *1.0.12+20170213*, where *20170213* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *licensing* crate version *1.0.13+20190916*, where *20190916* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *licensing* *v1* API can be found at the -[official documentation site](https://developers.google.com/google-apps/licensing/). +[official documentation site](https://developers.google.com/admin-sdk/licensing/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.Licensing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.Licensing.html) ... -* [license assignments](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignment.html) - * [*delete*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignmentDeleteCall.html), [*get*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignmentGetCall.html), [*insert*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignmentInsertCall.html), [*list for product*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignmentListForProductCall.html), [*list for product and sku*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignmentListForProductAndSkuCall.html), [*patch*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignmentPatchCall.html) and [*update*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.LicenseAssignmentUpdateCall.html) +* [license assignments](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignment.html) + * [*delete*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignmentDeleteCall.html), [*get*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignmentGetCall.html), [*insert*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignmentInsertCall.html), [*list for product*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignmentListForProductCall.html), [*list for product and sku*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignmentListForProductAndSkuCall.html), [*patch*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignmentPatchCall.html) and [*update*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.LicenseAssignmentUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/struct.Licensing.html)** +* **[Hub](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/struct.Licensing.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.Part.html)** + * **[Parts](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-licensing1/1.0.12+20170213/google_licensing1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-licensing1/1.0.13+20190916/google_licensing1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/licensing1/src/lib.rs b/gen/licensing1/src/lib.rs index 781dfeedd9..e4ca3424d6 100644 --- a/gen/licensing1/src/lib.rs +++ b/gen/licensing1/src/lib.rs @@ -2,10 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *licensing* crate version *1.0.12+20170213*, where *20170213* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *licensing* crate version *1.0.13+20190916*, where *20190916* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *licensing* *v1* API can be found at the -//! [official documentation site](https://developers.google.com/google-apps/licensing/). +//! [official documentation site](https://developers.google.com/admin-sdk/licensing/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1). //! # Features //! @@ -327,7 +327,7 @@ impl<'a, C, A> Licensing Licensing { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/apps/licensing/v1/product/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -338,7 +338,7 @@ impl<'a, C, A> Licensing } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -366,7 +366,7 @@ impl<'a, C, A> Licensing // ############ // SCHEMAS ### // ########## -/// Template for LiscenseAssignment Resource +/// Representation of a license assignment. /// /// # Activities /// @@ -383,12 +383,12 @@ impl<'a, C, A> Licensing /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LicenseAssignment { - /// Id of the sku of the product. + /// A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. #[serde(rename="skuId")] pub sku_id: Option, /// Identifies the resource as a LicenseAssignment. pub kind: Option, - /// Email id of the user. + /// The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. If the userId is suspended, the license status changes. #[serde(rename="userId")] pub user_id: Option, /// Display Name of the product. @@ -402,7 +402,7 @@ pub struct LicenseAssignment { /// Link to this page. #[serde(rename="selfLink")] pub self_link: Option, - /// Id of the product. + /// A product's unique identifier. For more information about products in this version of the API, see Product and SKU IDs. #[serde(rename="productId")] pub product_id: Option, } @@ -412,7 +412,7 @@ impl Resource for LicenseAssignment {} impl ResponseResult for LicenseAssignment {} -/// Template for LicenseAssignment Insert request +/// Representation of a license assignment. /// /// # Activities /// @@ -443,7 +443,7 @@ impl RequestValue for LicenseAssignmentInsert {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LicenseAssignmentList { - /// The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + /// The token that you must submit in a subsequent request to retrieve additional license results matching your query parameters. The maxResults query string is related to the nextPageToken since maxResults determines how many entries are returned on each next page. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The LicenseAssignments in this page of results. @@ -503,13 +503,15 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Revoke License. + /// Revoke a license. /// /// # Arguments /// - /// * `productId` - Name for product - /// * `skuId` - Name for sku - /// * `userId` - email id or unique Id of the user + /// * `productId` - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + /// * `skuId` - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + /// * `userId` - The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + /// Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + /// If the userId is suspended, the license status changes. pub fn delete(&self, product_id: &str, sku_id: &str, user_id: &str) -> LicenseAssignmentDeleteCall<'a, C, A> { LicenseAssignmentDeleteCall { hub: self.hub, @@ -524,12 +526,13 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List license assignments for given product of the customer. + /// List all users assigned licenses for a specific product SKU. /// /// # Arguments /// - /// * `productId` - Name for product - /// * `customerId` - CustomerId represents the customer for whom licenseassignments are queried + /// * `productId` - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + /// * `customerId` - Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + /// If the customer is suspended, the server returns an error. pub fn list_for_product(&self, product_id: &str, customer_id: &str) -> LicenseAssignmentListForProductCall<'a, C, A> { LicenseAssignmentListForProductCall { hub: self.hub, @@ -545,13 +548,15 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get license assignment of a particular product and sku for a user + /// Get a specific user's license by product SKU. /// /// # Arguments /// - /// * `productId` - Name for product - /// * `skuId` - Name for sku - /// * `userId` - email id or unique Id of the user + /// * `productId` - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + /// * `skuId` - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + /// * `userId` - The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + /// Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + /// If the userId is suspended, the license status changes. pub fn get(&self, product_id: &str, sku_id: &str, user_id: &str) -> LicenseAssignmentGetCall<'a, C, A> { LicenseAssignmentGetCall { hub: self.hub, @@ -566,13 +571,14 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List license assignments for given product and sku of the customer. + /// List all users assigned licenses for a specific product SKU. /// /// # Arguments /// - /// * `productId` - Name for product - /// * `skuId` - Name for sku - /// * `customerId` - CustomerId represents the customer for whom licenseassignments are queried + /// * `productId` - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + /// * `skuId` - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + /// * `customerId` - Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + /// If the customer is suspended, the server returns an error. pub fn list_for_product_and_sku(&self, product_id: &str, sku_id: &str, customer_id: &str) -> LicenseAssignmentListForProductAndSkuCall<'a, C, A> { LicenseAssignmentListForProductAndSkuCall { hub: self.hub, @@ -589,14 +595,16 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Assign License. + /// Reassign a user's product SKU with a different SKU in the same product. /// /// # Arguments /// /// * `request` - No description provided. - /// * `productId` - Name for product - /// * `skuId` - Name for sku for which license would be revoked - /// * `userId` - email id or unique Id of the user + /// * `productId` - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + /// * `skuId` - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + /// * `userId` - The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + /// Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + /// If the userId is suspended, the license status changes. pub fn update(&self, request: LicenseAssignment, product_id: &str, sku_id: &str, user_id: &str) -> LicenseAssignmentUpdateCall<'a, C, A> { LicenseAssignmentUpdateCall { hub: self.hub, @@ -612,14 +620,16 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Assign License. This method supports patch semantics. + /// Reassign a user's product SKU with a different SKU in the same product. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. - /// * `productId` - Name for product - /// * `skuId` - Name for sku for which license would be revoked - /// * `userId` - email id or unique Id of the user + /// * `productId` - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + /// * `skuId` - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. + /// * `userId` - The user's current primary email address. If the user's email address changes, use the new email address in your API requests. + /// Since a userId is subject to change, do not use a userId value as a key for persistent data. This key could break if the current user's email address changes. + /// If the userId is suspended, the license status changes. pub fn patch(&self, request: LicenseAssignment, product_id: &str, sku_id: &str, user_id: &str) -> LicenseAssignmentPatchCall<'a, C, A> { LicenseAssignmentPatchCall { hub: self.hub, @@ -635,13 +645,13 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Assign License. + /// Assign a license. /// /// # Arguments /// /// * `request` - No description provided. - /// * `productId` - Name for product - /// * `skuId` - Name for sku + /// * `productId` - A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. + /// * `skuId` - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. pub fn insert(&self, request: LicenseAssignmentInsert, product_id: &str, sku_id: &str) -> LicenseAssignmentInsertCall<'a, C, A> { LicenseAssignmentInsertCall { hub: self.hub, @@ -663,7 +673,7 @@ impl<'a, C, A> LicenseAssignmentMethods<'a, C, A> { // CallBuilders ### // ################# -/// Revoke License. +/// Revoke a license. /// /// A builder for the *delete* method supported by a *licenseAssignment* resource. /// It is not used directly, but through a `LicenseAssignmentMethods` instance. @@ -827,7 +837,7 @@ impl<'a, C, A> LicenseAssignmentDeleteCall<'a, C, A> where C: BorrowMut LicenseAssignmentDeleteCall<'a, C, A> where C: BorrowMut LicenseAssignmentDeleteCall<'a, C, A> where C: BorrowMut LicenseAssignmentDeleteCall<'a, C, A> where C: BorrowMut LicenseAssignmentListForProductCall<'a, C, A> where C: BorrowMut< } - /// Name for product + /// A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. /// /// Sets the *product id* path property to the given value. /// @@ -1109,7 +1121,8 @@ impl<'a, C, A> LicenseAssignmentListForProductCall<'a, C, A> where C: BorrowMut< self._product_id = new_value.to_string(); self } - /// CustomerId represents the customer for whom licenseassignments are queried + /// Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + /// If the customer is suspended, the server returns an error. /// /// Sets the *customer id* query property to the given value. /// @@ -1119,14 +1132,14 @@ impl<'a, C, A> LicenseAssignmentListForProductCall<'a, C, A> where C: BorrowMut< self._customer_id = new_value.to_string(); self } - /// Token to fetch the next page.Optional. By default server will return first page + /// Token to fetch the next page of data. The maxResults query string is related to the pageToken since maxResults determines how many entries are returned on each page. This is an optional query string. If not specified, the server returns the first page. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> LicenseAssignmentListForProductCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100. + /// The maxResults query string determines how many entries are returned on each page of a large response. This is an optional parameter. The value must be a positive number. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> LicenseAssignmentListForProductCall<'a, C, A> { @@ -1192,7 +1205,7 @@ impl<'a, C, A> LicenseAssignmentListForProductCall<'a, C, A> where C: BorrowMut< } -/// Get license assignment of a particular product and sku for a user +/// Get a specific user's license by product SKU. /// /// A builder for the *get* method supported by a *licenseAssignment* resource. /// It is not used directly, but through a `LicenseAssignmentMethods` instance. @@ -1367,7 +1380,7 @@ impl<'a, C, A> LicenseAssignmentGetCall<'a, C, A> where C: BorrowMut LicenseAssignmentGetCall<'a, C, A> where C: BorrowMut LicenseAssignmentGetCall<'a, C, A> where C: BorrowMut LicenseAssignmentGetCall<'a, C, A> where C: BorrowMut LicenseAssignmentListForProductAndSkuCall<'a, C, A> where C: Borr } - /// Name for product + /// A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. /// /// Sets the *product id* path property to the given value. /// @@ -1651,7 +1666,7 @@ impl<'a, C, A> LicenseAssignmentListForProductAndSkuCall<'a, C, A> where C: Borr self._product_id = new_value.to_string(); self } - /// Name for sku + /// A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. /// /// Sets the *sku id* path property to the given value. /// @@ -1661,7 +1676,8 @@ impl<'a, C, A> LicenseAssignmentListForProductAndSkuCall<'a, C, A> where C: Borr self._sku_id = new_value.to_string(); self } - /// CustomerId represents the customer for whom licenseassignments are queried + /// Customer's customerId. A previous version of this API accepted the primary domain name as a value for this field. + /// If the customer is suspended, the server returns an error. /// /// Sets the *customer id* query property to the given value. /// @@ -1671,14 +1687,14 @@ impl<'a, C, A> LicenseAssignmentListForProductAndSkuCall<'a, C, A> where C: Borr self._customer_id = new_value.to_string(); self } - /// Token to fetch the next page.Optional. By default server will return first page + /// Token to fetch the next page of data. The maxResults query string is related to the pageToken since maxResults determines how many entries are returned on each page. This is an optional query string. If not specified, the server returns the first page. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> LicenseAssignmentListForProductAndSkuCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100. + /// The maxResults query string determines how many entries are returned on each page of a large response. This is an optional parameter. The value must be a positive number. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> LicenseAssignmentListForProductAndSkuCall<'a, C, A> { @@ -1744,7 +1760,7 @@ impl<'a, C, A> LicenseAssignmentListForProductAndSkuCall<'a, C, A> where C: Borr } -/// Assign License. +/// Reassign a user's product SKU with a different SKU in the same product. /// /// A builder for the *update* method supported by a *licenseAssignment* resource. /// It is not used directly, but through a `LicenseAssignmentMethods` instance. @@ -1950,7 +1966,7 @@ impl<'a, C, A> LicenseAssignmentUpdateCall<'a, C, A> where C: BorrowMut LicenseAssignmentUpdateCall<'a, C, A> where C: BorrowMut LicenseAssignmentUpdateCall<'a, C, A> where C: BorrowMut LicenseAssignmentUpdateCall<'a, C, A> where C: BorrowMut LicenseAssignmentPatchCall<'a, C, A> where C: BorrowMut LicenseAssignmentPatchCall<'a, C, A> where C: BorrowMut LicenseAssignmentPatchCall<'a, C, A> where C: BorrowMut LicenseAssignmentPatchCall<'a, C, A> where C: BorrowMut LicenseAssignmentInsertCall<'a, C, A> where C: BorrowMut LicenseAssignmentInsertCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Logging (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-logging2] path = "../logging2" -version = "1.0.12+20190629" +version = "1.0.13+20200407" diff --git a/gen/logging2-cli/README.md b/gen/logging2-cli/README.md index beffba7c95..a325d5b160 100644 --- a/gen/logging2-cli/README.md +++ b/gen/logging2-cli/README.md @@ -25,16 +25,19 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Logging* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *Logging* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash logging2 [options] billing-accounts + buckets-get [-p ]... [-o ] exclusions-create (-r )... [-p ]... [-o ] exclusions-delete [-p ]... [-o ] exclusions-get [-p ]... [-o ] exclusions-list [-p ]... [-o ] exclusions-patch (-r )... [-p ]... [-o ] + locations-buckets-list [-p ]... [-o ] + locations-buckets-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] sinks-create (-r )... [-p ]... [-o ] @@ -58,6 +61,9 @@ logging2 [options] exclusions-get [-p ]... [-o ] exclusions-list [-p ]... [-o ] exclusions-patch (-r )... [-p ]... [-o ] + locations-buckets-get [-p ]... [-o ] + locations-buckets-list [-p ]... [-o ] + locations-buckets-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] sinks-create (-r )... [-p ]... [-o ] @@ -66,9 +72,16 @@ logging2 [options] sinks-list [-p ]... [-o ] sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] + locations + buckets-get [-p ]... [-o ] + buckets-list [-p ]... [-o ] + buckets-patch (-r )... [-p ]... [-o ] logs delete [-p ]... [-o ] list [-p ]... [-o ] + methods + get-cmek-settings [-p ]... [-o ] + update-cmek-settings (-r )... [-p ]... [-o ] monitored-resource-descriptors list [-p ]... [-o ] organizations @@ -77,6 +90,10 @@ logging2 [options] exclusions-get [-p ]... [-o ] exclusions-list [-p ]... [-o ] exclusions-patch (-r )... [-p ]... [-o ] + get-cmek-settings [-p ]... [-o ] + locations-buckets-get [-p ]... [-o ] + locations-buckets-list [-p ]... [-o ] + locations-buckets-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] sinks-create (-r )... [-p ]... [-o ] @@ -85,12 +102,16 @@ logging2 [options] sinks-list [-p ]... [-o ] sinks-patch (-r )... [-p ]... [-o ] sinks-update (-r )... [-p ]... [-o ] + update-cmek-settings (-r )... [-p ]... [-o ] projects exclusions-create (-r )... [-p ]... [-o ] exclusions-delete [-p ]... [-o ] exclusions-get [-p ]... [-o ] exclusions-list [-p ]... [-o ] exclusions-patch (-r )... [-p ]... [-o ] + locations-buckets-get [-p ]... [-o ] + locations-buckets-list [-p ]... [-o ] + locations-buckets-patch (-r )... [-p ]... [-o ] logs-delete [-p ]... [-o ] logs-list [-p ]... [-o ] metrics-create (-r )... [-p ]... [-o ] diff --git a/gen/logging2-cli/mkdocs.yml b/gen/logging2-cli/mkdocs.yml index f048b490b9..aa8d535bcf 100644 --- a/gen/logging2-cli/mkdocs.yml +++ b/gen/logging2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Logging v1.0.12+20190629 +site_name: Logging v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-logging2-cli site_description: A complete library to interact with Logging (protocol v2) @@ -9,11 +9,14 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['billing-accounts_buckets-get.md', 'Billing Accounts', 'Buckets Get'] - ['billing-accounts_exclusions-create.md', 'Billing Accounts', 'Exclusions Create'] - ['billing-accounts_exclusions-delete.md', 'Billing Accounts', 'Exclusions Delete'] - ['billing-accounts_exclusions-get.md', 'Billing Accounts', 'Exclusions Get'] - ['billing-accounts_exclusions-list.md', 'Billing Accounts', 'Exclusions List'] - ['billing-accounts_exclusions-patch.md', 'Billing Accounts', 'Exclusions Patch'] +- ['billing-accounts_locations-buckets-list.md', 'Billing Accounts', 'Locations Buckets List'] +- ['billing-accounts_locations-buckets-patch.md', 'Billing Accounts', 'Locations Buckets Patch'] - ['billing-accounts_logs-delete.md', 'Billing Accounts', 'Logs Delete'] - ['billing-accounts_logs-list.md', 'Billing Accounts', 'Logs List'] - ['billing-accounts_sinks-create.md', 'Billing Accounts', 'Sinks Create'] @@ -34,6 +37,9 @@ pages: - ['folders_exclusions-get.md', 'Folders', 'Exclusions Get'] - ['folders_exclusions-list.md', 'Folders', 'Exclusions List'] - ['folders_exclusions-patch.md', 'Folders', 'Exclusions Patch'] +- ['folders_locations-buckets-get.md', 'Folders', 'Locations Buckets Get'] +- ['folders_locations-buckets-list.md', 'Folders', 'Locations Buckets List'] +- ['folders_locations-buckets-patch.md', 'Folders', 'Locations Buckets Patch'] - ['folders_logs-delete.md', 'Folders', 'Logs Delete'] - ['folders_logs-list.md', 'Folders', 'Logs List'] - ['folders_sinks-create.md', 'Folders', 'Sinks Create'] @@ -42,14 +48,23 @@ pages: - ['folders_sinks-list.md', 'Folders', 'Sinks List'] - ['folders_sinks-patch.md', 'Folders', 'Sinks Patch'] - ['folders_sinks-update.md', 'Folders', 'Sinks Update'] +- ['locations_buckets-get.md', 'Locations', 'Buckets Get'] +- ['locations_buckets-list.md', 'Locations', 'Buckets List'] +- ['locations_buckets-patch.md', 'Locations', 'Buckets Patch'] - ['logs_delete.md', 'Logs', 'Delete'] - ['logs_list.md', 'Logs', 'List'] +- ['methods_get-cmek-settings.md', 'Methods', 'Get Cmek Settings'] +- ['methods_update-cmek-settings.md', 'Methods', 'Update Cmek Settings'] - ['monitored-resource-descriptors_list.md', 'Monitored Resource Descriptors', 'List'] - ['organizations_exclusions-create.md', 'Organizations', 'Exclusions Create'] - ['organizations_exclusions-delete.md', 'Organizations', 'Exclusions Delete'] - ['organizations_exclusions-get.md', 'Organizations', 'Exclusions Get'] - ['organizations_exclusions-list.md', 'Organizations', 'Exclusions List'] - ['organizations_exclusions-patch.md', 'Organizations', 'Exclusions Patch'] +- ['organizations_get-cmek-settings.md', 'Organizations', 'Get Cmek Settings'] +- ['organizations_locations-buckets-get.md', 'Organizations', 'Locations Buckets Get'] +- ['organizations_locations-buckets-list.md', 'Organizations', 'Locations Buckets List'] +- ['organizations_locations-buckets-patch.md', 'Organizations', 'Locations Buckets Patch'] - ['organizations_logs-delete.md', 'Organizations', 'Logs Delete'] - ['organizations_logs-list.md', 'Organizations', 'Logs List'] - ['organizations_sinks-create.md', 'Organizations', 'Sinks Create'] @@ -58,11 +73,15 @@ pages: - ['organizations_sinks-list.md', 'Organizations', 'Sinks List'] - ['organizations_sinks-patch.md', 'Organizations', 'Sinks Patch'] - ['organizations_sinks-update.md', 'Organizations', 'Sinks Update'] +- ['organizations_update-cmek-settings.md', 'Organizations', 'Update Cmek Settings'] - ['projects_exclusions-create.md', 'Projects', 'Exclusions Create'] - ['projects_exclusions-delete.md', 'Projects', 'Exclusions Delete'] - ['projects_exclusions-get.md', 'Projects', 'Exclusions Get'] - ['projects_exclusions-list.md', 'Projects', 'Exclusions List'] - ['projects_exclusions-patch.md', 'Projects', 'Exclusions Patch'] +- ['projects_locations-buckets-get.md', 'Projects', 'Locations Buckets Get'] +- ['projects_locations-buckets-list.md', 'Projects', 'Locations Buckets List'] +- ['projects_locations-buckets-patch.md', 'Projects', 'Locations Buckets Patch'] - ['projects_logs-delete.md', 'Projects', 'Logs Delete'] - ['projects_logs-list.md', 'Projects', 'Logs List'] - ['projects_metrics-create.md', 'Projects', 'Metrics Create'] diff --git a/gen/logging2-cli/src/main.rs b/gen/logging2-cli/src/main.rs index 14d1be9699..2ffdb191b5 100644 --- a/gen/logging2-cli/src/main.rs +++ b/gen/logging2-cli/src/main.rs @@ -46,6 +46,58 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _billing_accounts_buckets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.billing_accounts().buckets_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _billing_accounts_exclusions_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -393,6 +445,159 @@ impl<'n> Engine<'n> { } } + fn _billing_accounts_locations_buckets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.billing_accounts().locations_buckets_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _billing_accounts_locations_buckets_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retention-days" => Some(("retentionDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "description", "lifecycle-state", "name", "retention-days", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::LogBucket = json::value::from_value(object).unwrap(); + let mut call = self.hub.billing_accounts().locations_buckets_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _billing_accounts_logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.billing_accounts().logs_delete(opt.value_of("log-name").unwrap_or("")); @@ -527,16 +732,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -786,16 +995,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -885,16 +1098,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1835,6 +2052,211 @@ impl<'n> Engine<'n> { } } + fn _folders_locations_buckets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.folders().locations_buckets_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _folders_locations_buckets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.folders().locations_buckets_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _folders_locations_buckets_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retention-days" => Some(("retentionDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "description", "lifecycle-state", "name", "retention-days", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::LogBucket = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().locations_buckets_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _folders_logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.folders().logs_delete(opt.value_of("log-name").unwrap_or("")); @@ -1969,16 +2391,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2228,16 +2654,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2327,16 +2757,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2403,6 +2837,211 @@ impl<'n> Engine<'n> { } } + fn _locations_buckets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.locations().buckets_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _locations_buckets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.locations().buckets_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _locations_buckets_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retention-days" => Some(("retentionDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "description", "lifecycle-state", "name", "retention-days", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::LogBucket = json::value::from_value(object).unwrap(); + let mut call = self.hub.locations().buckets_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.logs().delete(opt.value_of("log-name").unwrap_or("")); @@ -2514,6 +3153,149 @@ impl<'n> Engine<'n> { } } + fn _methods_get_cmek_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.methods().get_cmek_settings(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _methods_update_cmek_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "service-account-id" => Some(("serviceAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kms-key-name" => Some(("kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["kms-key-name", "name", "service-account-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CmekSettings = json::value::from_value(object).unwrap(); + let mut call = self.hub.methods().update_cmek_settings(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _monitored_resource_descriptors_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.monitored_resource_descriptors().list(); @@ -2920,6 +3702,263 @@ impl<'n> Engine<'n> { } } + fn _organizations_get_cmek_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().get_cmek_settings(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_buckets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_buckets_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_buckets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().locations_buckets_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_locations_buckets_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retention-days" => Some(("retentionDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "description", "lifecycle-state", "name", "retention-days", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::LogBucket = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().locations_buckets_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _organizations_logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.organizations().logs_delete(opt.value_of("log-name").unwrap_or("")); @@ -3054,16 +4093,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3313,16 +4356,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3412,16 +4459,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3488,6 +4539,97 @@ impl<'n> Engine<'n> { } } + fn _organizations_update_cmek_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "service-account-id" => Some(("serviceAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kms-key-name" => Some(("kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["kms-key-name", "name", "service-account-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CmekSettings = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().update_cmek_settings(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_exclusions_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3835,6 +4977,211 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_buckets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_buckets_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_buckets_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_buckets_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_buckets_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "retention-days" => Some(("retentionDays", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "description", "lifecycle-state", "name", "retention-days", "update-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::LogBucket = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_buckets_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_logs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().logs_delete(opt.value_of("log-name").unwrap_or("")); @@ -3977,8 +5324,9 @@ impl<'n> Engine<'n> { "metric-descriptor.value-type" => Some(("metricDescriptor.valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.launch-stage" => Some(("metricDescriptor.launchStage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.name" => Some(("metricDescriptor.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.unit" => Some(("metricDescriptor.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.monitored-resource-types" => Some(("metricDescriptor.monitoredResourceTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "metric-descriptor.metadata.launch-stage" => Some(("metricDescriptor.metadata.launchStage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.metadata.ingest-delay" => Some(("metricDescriptor.metadata.ingestDelay", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.metadata.sample-period" => Some(("metricDescriptor.metadata.samplePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3996,7 +5344,7 @@ impl<'n> Engine<'n> { "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "create-time", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "ingest-delay", "label-extractors", "launch-stage", "linear-buckets", "metadata", "metric-descriptor", "metric-kind", "name", "num-finite-buckets", "offset", "sample-period", "scale", "type", "unit", "update-time", "value-extractor", "value-type", "version", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "create-time", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "ingest-delay", "label-extractors", "launch-stage", "linear-buckets", "metadata", "metric-descriptor", "metric-kind", "monitored-resource-types", "name", "num-finite-buckets", "offset", "sample-period", "scale", "type", "unit", "update-time", "value-extractor", "value-type", "version", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4250,8 +5598,9 @@ impl<'n> Engine<'n> { "metric-descriptor.value-type" => Some(("metricDescriptor.valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.launch-stage" => Some(("metricDescriptor.launchStage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.name" => Some(("metricDescriptor.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.unit" => Some(("metricDescriptor.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.type" => Some(("metricDescriptor.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metric-descriptor.monitored-resource-types" => Some(("metricDescriptor.monitoredResourceTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "metric-descriptor.metadata.launch-stage" => Some(("metricDescriptor.metadata.launchStage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.metadata.ingest-delay" => Some(("metricDescriptor.metadata.ingestDelay", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metric-descriptor.metadata.sample-period" => Some(("metricDescriptor.metadata.samplePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4269,7 +5618,7 @@ impl<'n> Engine<'n> { "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "create-time", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "ingest-delay", "label-extractors", "launch-stage", "linear-buckets", "metadata", "metric-descriptor", "metric-kind", "name", "num-finite-buckets", "offset", "sample-period", "scale", "type", "unit", "update-time", "value-extractor", "value-type", "version", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bounds", "bucket-options", "create-time", "description", "display-name", "explicit-buckets", "exponential-buckets", "filter", "growth-factor", "ingest-delay", "label-extractors", "launch-stage", "linear-buckets", "metadata", "metric-descriptor", "metric-kind", "monitored-resource-types", "name", "num-finite-buckets", "offset", "sample-period", "scale", "type", "unit", "update-time", "value-extractor", "value-type", "version", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4352,16 +5701,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4611,16 +5964,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4710,16 +6067,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4809,16 +6170,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5068,16 +6433,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "bigquery-options.use-partitioned-tables" => Some(("bigqueryOptions.usePartitionedTables", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "bigquery-options.uses-timestamp-column-partitioning" => Some(("bigqueryOptions.usesTimestampColumnPartitioning", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "destination" => Some(("destination", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writer-identity" => Some(("writerIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disabled" => Some(("disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "output-version-format" => Some(("outputVersionFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "include-children" => Some(("includeChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destination", "filter", "include-children", "name", "output-version-format", "update-time", "writer-identity"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bigquery-options", "create-time", "description", "destination", "disabled", "filter", "include-children", "name", "output-version-format", "update-time", "use-partitioned-tables", "uses-timestamp-column-partitioning", "writer-identity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5151,6 +6520,9 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("billing-accounts", Some(opt)) => { match opt.subcommand() { + ("buckets-get", Some(opt)) => { + call_result = self._billing_accounts_buckets_get(opt, dry_run, &mut err); + }, ("exclusions-create", Some(opt)) => { call_result = self._billing_accounts_exclusions_create(opt, dry_run, &mut err); }, @@ -5166,6 +6538,12 @@ impl<'n> Engine<'n> { ("exclusions-patch", Some(opt)) => { call_result = self._billing_accounts_exclusions_patch(opt, dry_run, &mut err); }, + ("locations-buckets-list", Some(opt)) => { + call_result = self._billing_accounts_locations_buckets_list(opt, dry_run, &mut err); + }, + ("locations-buckets-patch", Some(opt)) => { + call_result = self._billing_accounts_locations_buckets_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._billing_accounts_logs_delete(opt, dry_run, &mut err); }, @@ -5250,6 +6628,15 @@ impl<'n> Engine<'n> { ("exclusions-patch", Some(opt)) => { call_result = self._folders_exclusions_patch(opt, dry_run, &mut err); }, + ("locations-buckets-get", Some(opt)) => { + call_result = self._folders_locations_buckets_get(opt, dry_run, &mut err); + }, + ("locations-buckets-list", Some(opt)) => { + call_result = self._folders_locations_buckets_list(opt, dry_run, &mut err); + }, + ("locations-buckets-patch", Some(opt)) => { + call_result = self._folders_locations_buckets_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._folders_logs_delete(opt, dry_run, &mut err); }, @@ -5280,6 +6667,23 @@ impl<'n> Engine<'n> { } } }, + ("locations", Some(opt)) => { + match opt.subcommand() { + ("buckets-get", Some(opt)) => { + call_result = self._locations_buckets_get(opt, dry_run, &mut err); + }, + ("buckets-list", Some(opt)) => { + call_result = self._locations_buckets_list(opt, dry_run, &mut err); + }, + ("buckets-patch", Some(opt)) => { + call_result = self._locations_buckets_patch(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("locations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("logs", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -5294,6 +6698,20 @@ impl<'n> Engine<'n> { } } }, + ("methods", Some(opt)) => { + match opt.subcommand() { + ("get-cmek-settings", Some(opt)) => { + call_result = self._methods_get_cmek_settings(opt, dry_run, &mut err); + }, + ("update-cmek-settings", Some(opt)) => { + call_result = self._methods_update_cmek_settings(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("methods".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("monitored-resource-descriptors", Some(opt)) => { match opt.subcommand() { ("list", Some(opt)) => { @@ -5322,6 +6740,18 @@ impl<'n> Engine<'n> { ("exclusions-patch", Some(opt)) => { call_result = self._organizations_exclusions_patch(opt, dry_run, &mut err); }, + ("get-cmek-settings", Some(opt)) => { + call_result = self._organizations_get_cmek_settings(opt, dry_run, &mut err); + }, + ("locations-buckets-get", Some(opt)) => { + call_result = self._organizations_locations_buckets_get(opt, dry_run, &mut err); + }, + ("locations-buckets-list", Some(opt)) => { + call_result = self._organizations_locations_buckets_list(opt, dry_run, &mut err); + }, + ("locations-buckets-patch", Some(opt)) => { + call_result = self._organizations_locations_buckets_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._organizations_logs_delete(opt, dry_run, &mut err); }, @@ -5346,6 +6776,9 @@ impl<'n> Engine<'n> { ("sinks-update", Some(opt)) => { call_result = self._organizations_sinks_update(opt, dry_run, &mut err); }, + ("update-cmek-settings", Some(opt)) => { + call_result = self._organizations_update_cmek_settings(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("organizations".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -5369,6 +6802,15 @@ impl<'n> Engine<'n> { ("exclusions-patch", Some(opt)) => { call_result = self._projects_exclusions_patch(opt, dry_run, &mut err); }, + ("locations-buckets-get", Some(opt)) => { + call_result = self._projects_locations_buckets_get(opt, dry_run, &mut err); + }, + ("locations-buckets-list", Some(opt)) => { + call_result = self._projects_locations_buckets_list(opt, dry_run, &mut err); + }, + ("locations-buckets-patch", Some(opt)) => { + call_result = self._projects_locations_buckets_patch(opt, dry_run, &mut err); + }, ("logs-delete", Some(opt)) => { call_result = self._projects_logs_delete(opt, dry_run, &mut err); }, @@ -5522,7 +6964,34 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("billing-accounts", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("billing-accounts", "methods: 'buckets-get', 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'locations-buckets-list', 'locations-buckets-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("buckets-get", + Some(r##"Gets a bucket (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_buckets-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the bucket: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("exclusions-create", Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_exclusions-create", @@ -5664,6 +7133,66 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-list", + Some(r##"Lists buckets (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_locations-buckets-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose buckets are to be listed: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-patch", + Some(r##"Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_locations-buckets-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The full resource name of the bucket to update. + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -5671,7 +7200,7 @@ fn main() { Some(false)), ]), ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_logs-delete", vec![ (Some(r##"log-name"##), @@ -6103,7 +7632,7 @@ fn main() { ]), ]), - ("folders", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("folders", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'locations-buckets-get', 'locations-buckets-list', 'locations-buckets-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ ("exclusions-create", Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_exclusions-create", @@ -6245,6 +7774,93 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-get", + Some(r##"Gets a bucket (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_locations-buckets-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the bucket: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-list", + Some(r##"Lists buckets (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_locations-buckets-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose buckets are to be listed: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-patch", + Some(r##"Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_locations-buckets-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The full resource name of the bucket to update. + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6252,7 +7868,7 @@ fn main() { Some(false)), ]), ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_logs-delete", vec![ (Some(r##"log-name"##), @@ -6487,9 +8103,99 @@ fn main() { ]), ]), + ("locations", "methods: 'buckets-get', 'buckets-list' and 'buckets-patch'", vec![ + ("buckets-get", + Some(r##"Gets a bucket (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/locations_buckets-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the bucket: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("buckets-list", + Some(r##"Lists buckets (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/locations_buckets-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose buckets are to be listed: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("buckets-patch", + Some(r##"Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/locations_buckets-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The full resource name of the bucket to update. + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("logs", "methods: 'delete' and 'list'", vec![ ("delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/logs_delete", vec![ (Some(r##"log-name"##), @@ -6544,6 +8250,69 @@ fn main() { ]), ]), + ("methods", "methods: 'get-cmek-settings' and 'update-cmek-settings'", vec![ + ("get-cmek-settings", + Some(r##"Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/methods_get-cmek-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource for which to retrieve CMEK settings. + "projects/[PROJECT_ID]/cmekSettings" + "organizations/[ORGANIZATION_ID]/cmekSettings" + "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + "folders/[FOLDER_ID]/cmekSettings" + Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-cmek-settings", + Some(r##"Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router for more information."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/methods_update-cmek-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name for the CMEK settings to update. + "projects/[PROJECT_ID]/cmekSettings" + "organizations/[ORGANIZATION_ID]/cmekSettings" + "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + "folders/[FOLDER_ID]/cmekSettings" + Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("monitored-resource-descriptors", "methods: 'list'", vec![ ("list", Some(r##"Lists the descriptors for monitored resource types used by Logging."##), @@ -6563,7 +8332,7 @@ fn main() { ]), ]), - ("organizations", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("organizations", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'get-cmek-settings', 'locations-buckets-get', 'locations-buckets-list', 'locations-buckets-patch', 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch', 'sinks-update' and 'update-cmek-settings'", vec![ ("exclusions-create", Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_exclusions-create", @@ -6705,6 +8474,120 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-cmek-settings", + Some(r##"Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_get-cmek-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource for which to retrieve CMEK settings. + "projects/[PROJECT_ID]/cmekSettings" + "organizations/[ORGANIZATION_ID]/cmekSettings" + "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + "folders/[FOLDER_ID]/cmekSettings" + Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-get", + Some(r##"Gets a bucket (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_locations-buckets-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the bucket: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-list", + Some(r##"Lists buckets (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_locations-buckets-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose buckets are to be listed: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-patch", + Some(r##"Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_locations-buckets-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The full resource name of the bucket to update. + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6712,7 +8595,7 @@ fn main() { Some(false)), ]), ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_logs-delete", vec![ (Some(r##"log-name"##), @@ -6939,6 +8822,39 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-cmek-settings", + Some(r##"Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router for more information."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_update-cmek-settings", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name for the CMEK settings to update. + "projects/[PROJECT_ID]/cmekSettings" + "organizations/[ORGANIZATION_ID]/cmekSettings" + "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + "folders/[FOLDER_ID]/cmekSettings" + Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -6947,7 +8863,7 @@ fn main() { ]), ]), - ("projects", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'logs-delete', 'logs-list', 'metrics-create', 'metrics-delete', 'metrics-get', 'metrics-list', 'metrics-update', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ + ("projects", "methods: 'exclusions-create', 'exclusions-delete', 'exclusions-get', 'exclusions-list', 'exclusions-patch', 'locations-buckets-get', 'locations-buckets-list', 'locations-buckets-patch', 'logs-delete', 'logs-list', 'metrics-create', 'metrics-delete', 'metrics-get', 'metrics-list', 'metrics-update', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list', 'sinks-patch' and 'sinks-update'", vec![ ("exclusions-create", Some(r##"Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_exclusions-create", @@ -7089,6 +9005,93 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-get", + Some(r##"Gets a bucket (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_locations-buckets-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the bucket: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-list", + Some(r##"Lists buckets (Beta)."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_locations-buckets-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The parent resource whose buckets are to be listed: + "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-buckets-patch", + Some(r##"Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta."##), + "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_locations-buckets-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The full resource name of the bucket to update. + "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -7096,7 +9099,7 @@ fn main() { Some(false)), ]), ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_logs-delete", vec![ (Some(r##"log-name"##), @@ -7155,7 +9158,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The resource name of the project in which to create the metric: + Some(r##"Required. The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The new metric must be provided in the request."##), Some(true), @@ -7185,7 +9188,7 @@ fn main() { vec![ (Some(r##"metric-name"##), None, - Some(r##"The resource name of the metric to delete: + Some(r##"Required. The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" "##), Some(true), @@ -7209,7 +9212,7 @@ fn main() { vec![ (Some(r##"metric-name"##), None, - Some(r##"The resource name of the desired metric: + Some(r##"Required. The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" "##), Some(true), @@ -7257,7 +9260,7 @@ fn main() { vec![ (Some(r##"metric-name"##), None, - Some(r##"The resource name of the metric to update: + Some(r##"Required. The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created."##), Some(true), @@ -7617,8 +9620,8 @@ fn main() { let mut app = App::new("logging2") .author("Sebastian Thiel ") - .version("1.0.12+20190629") - .about("Writes log entries and manages your Stackdriver Logging configuration. The table entries below are presented in alphabetical order, not in order of common use. For explanations of the concepts found in the table entries, read the Stackdriver Logging documentation.") + .version("1.0.13+20200407") + .about("Writes log entries and manages your Cloud Logging configuration. The table entries below are presented in alphabetical order, not in order of common use. For explanations of the concepts found in the table entries, read the documentation at https://cloud.google.com/logging/docs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_logging2_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/logging2/Cargo.toml b/gen/logging2/Cargo.toml index f61eddb02c..88f322618c 100644 --- a/gen/logging2/Cargo.toml +++ b/gen/logging2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-logging2" -version = "1.0.12+20190629" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Logging (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2" homepage = "https://cloud.google.com/logging/docs/" -documentation = "https://docs.rs/google-logging2/1.0.12+20190629" +documentation = "https://docs.rs/google-logging2/1.0.13+20200407" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/logging2/README.md b/gen/logging2/README.md index 9beddaefa6..2145dccf3a 100644 --- a/gen/logging2/README.md +++ b/gen/logging2/README.md @@ -5,33 +5,39 @@ DO NOT EDIT ! --> The `google-logging2` library allows access to all features of the *Google Logging* service. -This documentation was generated from *Logging* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Logging* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Logging* *v2* API can be found at the [official documentation site](https://cloud.google.com/logging/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.Logging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.Logging.html) ... * billing accounts - * [*exclusions create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.BillingAccountSinkUpdateCall.html) + * [*buckets get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountBucketGetCall.html), [*exclusions create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountExclusionPatchCall.html), [*locations buckets list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountLocationBucketListCall.html), [*locations buckets patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountLocationBucketPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.BillingAccountSinkUpdateCall.html) * entries - * [*list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.EntryWriteCall.html) + * [*list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.EntryWriteCall.html) * exclusions - * [*create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ExclusionCreateCall.html), [*delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ExclusionDeleteCall.html), [*get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ExclusionGetCall.html), [*list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ExclusionListCall.html) and [*patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ExclusionPatchCall.html) + * [*create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ExclusionCreateCall.html), [*delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ExclusionDeleteCall.html), [*get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ExclusionGetCall.html), [*list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ExclusionListCall.html) and [*patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ExclusionPatchCall.html) * folders - * [*exclusions create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.FolderSinkUpdateCall.html) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderExclusionPatchCall.html), [*locations buckets get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderLocationBucketGetCall.html), [*locations buckets list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderLocationBucketListCall.html), [*locations buckets patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderLocationBucketPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.FolderSinkUpdateCall.html) +* locations + * [*buckets get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.LocationBucketGetCall.html), [*buckets list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.LocationBucketListCall.html) and [*buckets patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.LocationBucketPatchCall.html) * logs - * [*delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.LogDeleteCall.html) and [*list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.LogListCall.html) -* [monitored resource descriptors](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.MonitoredResourceDescriptor.html) - * [*list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.MonitoredResourceDescriptorListCall.html) + * [*delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.LogDeleteCall.html) and [*list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.LogListCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.MonitoredResourceDescriptorListCall.html) * organizations - * [*exclusions create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.OrganizationSinkUpdateCall.html) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationExclusionPatchCall.html), [*get cmek settings*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationGetCmekSettingCall.html), [*locations buckets get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationLocationBucketGetCall.html), [*locations buckets list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationLocationBucketListCall.html), [*locations buckets patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationLocationBucketPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationSinkPatchCall.html), [*sinks update*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationSinkUpdateCall.html) and [*update cmek settings*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.OrganizationUpdateCmekSettingCall.html) * projects - * [*exclusions create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectExclusionPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.ProjectSinkUpdateCall.html) + * [*exclusions create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectExclusionCreateCall.html), [*exclusions delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectExclusionDeleteCall.html), [*exclusions get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectExclusionGetCall.html), [*exclusions list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectExclusionListCall.html), [*exclusions patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectExclusionPatchCall.html), [*locations buckets get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectLocationBucketGetCall.html), [*locations buckets list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectLocationBucketListCall.html), [*locations buckets patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectLocationBucketPatchCall.html), [*logs delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectSinkListCall.html), [*sinks patch*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectSinkPatchCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.ProjectSinkUpdateCall.html) * sinks - * [*create*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.SinkCreateCall.html), [*delete*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.SinkDeleteCall.html), [*get*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.SinkGetCall.html), [*list*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.SinkListCall.html) and [*update*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.SinkUpdateCall.html) + * [*create*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.SinkCreateCall.html), [*delete*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.SinkDeleteCall.html), [*get*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.SinkGetCall.html), [*list*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.SinkListCall.html) and [*update*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.SinkUpdateCall.html) +Other activities are ... + +* [get cmek settings](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.MethodGetCmekSettingCall.html) +* [update cmek settings](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.MethodUpdateCmekSettingCall.html) @@ -39,17 +45,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/struct.Logging.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -166,17 +172,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -186,29 +192,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-logging2/1.0.12+20190629/google_logging2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2/1.0.13+20200407/google_logging2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/logging2/src/lib.rs b/gen/logging2/src/lib.rs index e7127a8d2f..0f522709ba 100644 --- a/gen/logging2/src/lib.rs +++ b/gen/logging2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Logging* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Logging* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Logging* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/logging/docs/). @@ -12,24 +12,30 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Logging.html) ... //! //! * billing accounts -//! * [*exclusions create*](struct.BillingAccountExclusionCreateCall.html), [*exclusions delete*](struct.BillingAccountExclusionDeleteCall.html), [*exclusions get*](struct.BillingAccountExclusionGetCall.html), [*exclusions list*](struct.BillingAccountExclusionListCall.html), [*exclusions patch*](struct.BillingAccountExclusionPatchCall.html), [*logs delete*](struct.BillingAccountLogDeleteCall.html), [*logs list*](struct.BillingAccountLogListCall.html), [*sinks create*](struct.BillingAccountSinkCreateCall.html), [*sinks delete*](struct.BillingAccountSinkDeleteCall.html), [*sinks get*](struct.BillingAccountSinkGetCall.html), [*sinks list*](struct.BillingAccountSinkListCall.html), [*sinks patch*](struct.BillingAccountSinkPatchCall.html) and [*sinks update*](struct.BillingAccountSinkUpdateCall.html) +//! * [*buckets get*](struct.BillingAccountBucketGetCall.html), [*exclusions create*](struct.BillingAccountExclusionCreateCall.html), [*exclusions delete*](struct.BillingAccountExclusionDeleteCall.html), [*exclusions get*](struct.BillingAccountExclusionGetCall.html), [*exclusions list*](struct.BillingAccountExclusionListCall.html), [*exclusions patch*](struct.BillingAccountExclusionPatchCall.html), [*locations buckets list*](struct.BillingAccountLocationBucketListCall.html), [*locations buckets patch*](struct.BillingAccountLocationBucketPatchCall.html), [*logs delete*](struct.BillingAccountLogDeleteCall.html), [*logs list*](struct.BillingAccountLogListCall.html), [*sinks create*](struct.BillingAccountSinkCreateCall.html), [*sinks delete*](struct.BillingAccountSinkDeleteCall.html), [*sinks get*](struct.BillingAccountSinkGetCall.html), [*sinks list*](struct.BillingAccountSinkListCall.html), [*sinks patch*](struct.BillingAccountSinkPatchCall.html) and [*sinks update*](struct.BillingAccountSinkUpdateCall.html) //! * entries //! * [*list*](struct.EntryListCall.html) and [*write*](struct.EntryWriteCall.html) //! * exclusions //! * [*create*](struct.ExclusionCreateCall.html), [*delete*](struct.ExclusionDeleteCall.html), [*get*](struct.ExclusionGetCall.html), [*list*](struct.ExclusionListCall.html) and [*patch*](struct.ExclusionPatchCall.html) //! * folders -//! * [*exclusions create*](struct.FolderExclusionCreateCall.html), [*exclusions delete*](struct.FolderExclusionDeleteCall.html), [*exclusions get*](struct.FolderExclusionGetCall.html), [*exclusions list*](struct.FolderExclusionListCall.html), [*exclusions patch*](struct.FolderExclusionPatchCall.html), [*logs delete*](struct.FolderLogDeleteCall.html), [*logs list*](struct.FolderLogListCall.html), [*sinks create*](struct.FolderSinkCreateCall.html), [*sinks delete*](struct.FolderSinkDeleteCall.html), [*sinks get*](struct.FolderSinkGetCall.html), [*sinks list*](struct.FolderSinkListCall.html), [*sinks patch*](struct.FolderSinkPatchCall.html) and [*sinks update*](struct.FolderSinkUpdateCall.html) +//! * [*exclusions create*](struct.FolderExclusionCreateCall.html), [*exclusions delete*](struct.FolderExclusionDeleteCall.html), [*exclusions get*](struct.FolderExclusionGetCall.html), [*exclusions list*](struct.FolderExclusionListCall.html), [*exclusions patch*](struct.FolderExclusionPatchCall.html), [*locations buckets get*](struct.FolderLocationBucketGetCall.html), [*locations buckets list*](struct.FolderLocationBucketListCall.html), [*locations buckets patch*](struct.FolderLocationBucketPatchCall.html), [*logs delete*](struct.FolderLogDeleteCall.html), [*logs list*](struct.FolderLogListCall.html), [*sinks create*](struct.FolderSinkCreateCall.html), [*sinks delete*](struct.FolderSinkDeleteCall.html), [*sinks get*](struct.FolderSinkGetCall.html), [*sinks list*](struct.FolderSinkListCall.html), [*sinks patch*](struct.FolderSinkPatchCall.html) and [*sinks update*](struct.FolderSinkUpdateCall.html) +//! * locations +//! * [*buckets get*](struct.LocationBucketGetCall.html), [*buckets list*](struct.LocationBucketListCall.html) and [*buckets patch*](struct.LocationBucketPatchCall.html) //! * logs //! * [*delete*](struct.LogDeleteCall.html) and [*list*](struct.LogListCall.html) //! * [monitored resource descriptors](struct.MonitoredResourceDescriptor.html) //! * [*list*](struct.MonitoredResourceDescriptorListCall.html) //! * organizations -//! * [*exclusions create*](struct.OrganizationExclusionCreateCall.html), [*exclusions delete*](struct.OrganizationExclusionDeleteCall.html), [*exclusions get*](struct.OrganizationExclusionGetCall.html), [*exclusions list*](struct.OrganizationExclusionListCall.html), [*exclusions patch*](struct.OrganizationExclusionPatchCall.html), [*logs delete*](struct.OrganizationLogDeleteCall.html), [*logs list*](struct.OrganizationLogListCall.html), [*sinks create*](struct.OrganizationSinkCreateCall.html), [*sinks delete*](struct.OrganizationSinkDeleteCall.html), [*sinks get*](struct.OrganizationSinkGetCall.html), [*sinks list*](struct.OrganizationSinkListCall.html), [*sinks patch*](struct.OrganizationSinkPatchCall.html) and [*sinks update*](struct.OrganizationSinkUpdateCall.html) +//! * [*exclusions create*](struct.OrganizationExclusionCreateCall.html), [*exclusions delete*](struct.OrganizationExclusionDeleteCall.html), [*exclusions get*](struct.OrganizationExclusionGetCall.html), [*exclusions list*](struct.OrganizationExclusionListCall.html), [*exclusions patch*](struct.OrganizationExclusionPatchCall.html), [*get cmek settings*](struct.OrganizationGetCmekSettingCall.html), [*locations buckets get*](struct.OrganizationLocationBucketGetCall.html), [*locations buckets list*](struct.OrganizationLocationBucketListCall.html), [*locations buckets patch*](struct.OrganizationLocationBucketPatchCall.html), [*logs delete*](struct.OrganizationLogDeleteCall.html), [*logs list*](struct.OrganizationLogListCall.html), [*sinks create*](struct.OrganizationSinkCreateCall.html), [*sinks delete*](struct.OrganizationSinkDeleteCall.html), [*sinks get*](struct.OrganizationSinkGetCall.html), [*sinks list*](struct.OrganizationSinkListCall.html), [*sinks patch*](struct.OrganizationSinkPatchCall.html), [*sinks update*](struct.OrganizationSinkUpdateCall.html) and [*update cmek settings*](struct.OrganizationUpdateCmekSettingCall.html) //! * projects -//! * [*exclusions create*](struct.ProjectExclusionCreateCall.html), [*exclusions delete*](struct.ProjectExclusionDeleteCall.html), [*exclusions get*](struct.ProjectExclusionGetCall.html), [*exclusions list*](struct.ProjectExclusionListCall.html), [*exclusions patch*](struct.ProjectExclusionPatchCall.html), [*logs delete*](struct.ProjectLogDeleteCall.html), [*logs list*](struct.ProjectLogListCall.html), [*metrics create*](struct.ProjectMetricCreateCall.html), [*metrics delete*](struct.ProjectMetricDeleteCall.html), [*metrics get*](struct.ProjectMetricGetCall.html), [*metrics list*](struct.ProjectMetricListCall.html), [*metrics update*](struct.ProjectMetricUpdateCall.html), [*sinks create*](struct.ProjectSinkCreateCall.html), [*sinks delete*](struct.ProjectSinkDeleteCall.html), [*sinks get*](struct.ProjectSinkGetCall.html), [*sinks list*](struct.ProjectSinkListCall.html), [*sinks patch*](struct.ProjectSinkPatchCall.html) and [*sinks update*](struct.ProjectSinkUpdateCall.html) +//! * [*exclusions create*](struct.ProjectExclusionCreateCall.html), [*exclusions delete*](struct.ProjectExclusionDeleteCall.html), [*exclusions get*](struct.ProjectExclusionGetCall.html), [*exclusions list*](struct.ProjectExclusionListCall.html), [*exclusions patch*](struct.ProjectExclusionPatchCall.html), [*locations buckets get*](struct.ProjectLocationBucketGetCall.html), [*locations buckets list*](struct.ProjectLocationBucketListCall.html), [*locations buckets patch*](struct.ProjectLocationBucketPatchCall.html), [*logs delete*](struct.ProjectLogDeleteCall.html), [*logs list*](struct.ProjectLogListCall.html), [*metrics create*](struct.ProjectMetricCreateCall.html), [*metrics delete*](struct.ProjectMetricDeleteCall.html), [*metrics get*](struct.ProjectMetricGetCall.html), [*metrics list*](struct.ProjectMetricListCall.html), [*metrics update*](struct.ProjectMetricUpdateCall.html), [*sinks create*](struct.ProjectSinkCreateCall.html), [*sinks delete*](struct.ProjectSinkDeleteCall.html), [*sinks get*](struct.ProjectSinkGetCall.html), [*sinks list*](struct.ProjectSinkListCall.html), [*sinks patch*](struct.ProjectSinkPatchCall.html) and [*sinks update*](struct.ProjectSinkUpdateCall.html) //! * sinks //! * [*create*](struct.SinkCreateCall.html), [*delete*](struct.SinkDeleteCall.html), [*get*](struct.SinkGetCall.html), [*list*](struct.SinkListCall.html) and [*update*](struct.SinkUpdateCall.html) //! +//! Other activities are ... +//! +//! * [get cmek settings](struct.MethodGetCmekSettingCall.html) +//! * [update cmek settings](struct.MethodUpdateCmekSettingCall.html) //! //! //! @@ -383,7 +389,7 @@ impl<'a, C, A> Logging Logging { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://logging.googleapis.com/".to_string(), _root_url: "https://logging.googleapis.com/".to_string(), } @@ -401,9 +407,15 @@ impl<'a, C, A> Logging pub fn folders(&'a self) -> FolderMethods<'a, C, A> { FolderMethods { hub: &self } } + pub fn locations(&'a self) -> LocationMethods<'a, C, A> { + LocationMethods { hub: &self } + } pub fn logs(&'a self) -> LogMethods<'a, C, A> { LogMethods { hub: &self } } + pub fn methods(&'a self) -> MethodMethods<'a, C, A> { + MethodMethods { hub: &self } + } pub fn monitored_resource_descriptors(&'a self) -> MonitoredResourceDescriptorMethods<'a, C, A> { MonitoredResourceDescriptorMethods { hub: &self } } @@ -418,7 +430,7 @@ impl<'a, C, A> Logging } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -467,42 +479,6 @@ pub struct ListLogEntriesResponse { impl ResponseResult for ListLogEntriesResponse {} -/// Additional information about the source code location that produced the log entry. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogEntrySourceLocation { - /// Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python). - pub function: Option, - /// Optional. Line within the source file. 1-based; 0 indicates no line number available. - pub line: Option, - /// Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name. - pub file: Option, -} - -impl Part for LogEntrySourceLocation {} - - -/// Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Exponential { - /// Must be greater than 0. - pub scale: Option, - /// Must be greater than 1. - #[serde(rename="growthFactor")] - pub growth_factor: Option, - /// Must be greater than 0. - #[serde(rename="numFiniteBuckets")] - pub num_finite_buckets: Option, -} - -impl Part for Exponential {} - - /// Result returned from ListLogs. /// /// # Activities @@ -521,7 +497,7 @@ pub struct ListLogsResponse { /// If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// A list of log names. For example, "projects/my-project/syslog" or "organizations/123/cloudresourcemanager.googleapis.com%2Factivity". + /// A list of log names. For example, "projects/my-project/logs/syslog" or "organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity". #[serde(rename="logNames")] pub log_names: Option>, } @@ -529,40 +505,6 @@ pub struct ListLogsResponse { impl ResponseResult for ListLogsResponse {} -/// Result returned from ListLogMetrics. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [metrics list projects](struct.ProjectMetricListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListLogMetricsResponse { - /// A list of logs-based metrics. - pub metrics: Option>, - /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, -} - -impl ResponseResult for ListLogMetricsResponse {} - - -/// Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Explicit { - /// The values must be monotonically increasing. - pub bounds: Option>, -} - -impl Part for Explicit {} - - /// BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -647,6 +589,31 @@ pub struct ListExclusionsResponse { impl ResponseResult for ListExclusionsResponse {} +/// The response from ListBuckets (Beta). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations buckets list folders](struct.FolderLocationBucketListCall.html) (response) +/// * [locations buckets list organizations](struct.OrganizationLocationBucketListCall.html) (response) +/// * [locations buckets list projects](struct.ProjectLocationBucketListCall.html) (response) +/// * [buckets list locations](struct.LocationBucketListCall.html) (response) +/// * [locations buckets list billing accounts](struct.BillingAccountLocationBucketListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListBucketsResponse { + /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of buckets. + pub buckets: Option>, +} + +impl ResponseResult for ListBucketsResponse {} + + /// Additional annotations that can be used to guide the usage of a metric. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -656,7 +623,7 @@ pub struct MetricDescriptorMetadata { /// The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors. #[serde(rename="ingestDelay")] pub ingest_delay: Option, - /// Deprecated. Please use the MetricDescriptor.launch_stage instead. The launch stage of the metric definition. + /// Deprecated. Must use the MetricDescriptor.launch_stage instead. #[serde(rename="launchStage")] pub launch_stage: Option, /// The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period. @@ -696,17 +663,22 @@ impl Part for MetricDescriptorMetadata {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogSink { + /// Optional. If set to True, then this sink is disabled and it does not export any log entries. + pub disabled: Option, /// Output only. The last update timestamp of the sink.This field may not be present for older sinks. #[serde(rename="updateTime")] pub update_time: Option, - /// Required. The client-assigned sink identifier, unique within the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. - pub name: Option, /// Required. The export destination: /// "storage.googleapis.com/[GCS_BUCKET]" /// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" /// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" /// The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs with Sinks. pub destination: Option, + /// Optional. A description of this sink. The maximum length of the description is 8000 characters. + pub description: Option, + /// Optional. Options that affect sinks exporting data to BigQuery. + #[serde(rename="bigqueryOptions")] + pub bigquery_options: Option, /// Output only. The creation timestamp of the sink.This field may not be present for older sinks. #[serde(rename="createTime")] pub create_time: Option, @@ -726,50 +698,14 @@ pub struct LogSink { /// #[serde(rename="includeChildren")] pub include_children: Option, + /// Required. The client-assigned sink identifier, unique within the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric. + pub name: Option, } impl RequestValue for LogSink {} impl ResponseResult for LogSink {} -/// The parameters to ListLogEntries. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list entries](struct.EntryListCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListLogEntriesRequest { - /// Optional. How the results should be sorted. Presently, the only permitted values are "timestamp asc" (default) and "timestamp desc". The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values. - #[serde(rename="orderBy")] - pub order_by: Option, - /// Required. Names of one or more parent resources from which to retrieve log entries: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Projects listed in the project_ids field are added to this list. - #[serde(rename="resourceNames")] - pub resource_names: Option>, - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of next_page_token in the response indicates that more results might be available. - #[serde(rename="pageSize")] - pub page_size: Option, - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call. - #[serde(rename="pageToken")] - pub page_token: Option, - /// Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: "my-project-1A". - #[serde(rename="projectIds")] - pub project_ids: Option>, - /// Optional. A filter that chooses which log entries to return. See Advanced Logs Filters. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of the filter is 20000 characters. - pub filter: Option, -} - -impl RequestValue for ListLogEntriesRequest {} - - /// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: /// service Foo { /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); @@ -793,8 +729,8 @@ impl RequestValue for ListLogEntriesRequest {} /// * [logs delete folders](struct.FolderLogDeleteCall.html) (response) /// * [metrics delete projects](struct.ProjectMetricDeleteCall.html) (response) /// * [exclusions delete organizations](struct.OrganizationExclusionDeleteCall.html) (response) -/// * [exclusions delete projects](struct.ProjectExclusionDeleteCall.html) (response) /// * [sinks delete projects](struct.ProjectSinkDeleteCall.html) (response) +/// * [exclusions delete projects](struct.ProjectExclusionDeleteCall.html) (response) /// * [logs delete billing accounts](struct.BillingAccountLogDeleteCall.html) (response) /// * [exclusions delete folders](struct.FolderExclusionDeleteCall.html) (response) /// @@ -857,28 +793,6 @@ pub struct HttpRequest { impl Part for HttpRequest {} -/// Result returned from ListMonitoredResourceDescriptors. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list monitored resource descriptors](struct.MonitoredResourceDescriptorListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListMonitoredResourceDescriptorsResponse { - /// If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of resource descriptors. - #[serde(rename="resourceDescriptors")] - pub resource_descriptors: Option>, -} - -impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} - - /// Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 1)). /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -919,6 +833,9 @@ pub struct MetricDescriptor { /// Optional. The launch stage of the metric definition. #[serde(rename="launchStage")] pub launch_stage: Option, + /// Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here. + #[serde(rename="monitoredResourceTypes")] + pub monitored_resource_types: Option>, /// Optional. Metadata which can be used to guide usage of the metric. pub metadata: Option, /// The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example: @@ -928,35 +845,36 @@ pub struct MetricDescriptor { /// #[serde(rename="type")] pub type_: Option, - /// The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) + /// The units in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values.Different systems may scale the values to be more easily displayed (so a value of 0.02KBy might be displayed as 20By, and a value of 3523KBy might be displayed as 3.5MBy). However, if the unit is KBy, then the value of the metric is always in thousands of bytes, no matter how it may be displayed..If you want a custom metric to record the exact number of CPU-seconds used by a job, you can create an INT64 CUMULATIVE metric whose unit is s{CPU} (or equivalently 1s{CPU} or just s). If the job uses 12,005 CPU-seconds, then the value is written as 12005.Alternatively, if you want a custom metric to record data in a more granular way, you can create a DOUBLE CUMULATIVE metric whose unit is ks{CPU}, and then write the value 12.005 (which is 12005/1000), or use Kis{CPU} and write 11.723 (which is 12005/1024).The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) /// bit bit /// By byte /// s second /// min minute /// h hour /// d dayPrefixes (PREFIX) - /// k kilo (10**3) - /// M mega (10**6) - /// G giga (10**9) - /// T tera (10**12) - /// P peta (10**15) - /// E exa (10**18) - /// Z zetta (10**21) - /// Y yotta (10**24) - /// m milli (10**-3) - /// u micro (10**-6) - /// n nano (10**-9) - /// p pico (10**-12) - /// f femto (10**-15) - /// a atto (10**-18) - /// z zepto (10**-21) - /// y yocto (10**-24) - /// Ki kibi (2**10) - /// Mi mebi (2**20) - /// Gi gibi (2**30) - /// Ti tebi (2**40)GrammarThe grammar also includes these connectors: - /// / division (as an infix operator, e.g. 1/s). - /// . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: + /// k kilo (10^3) + /// M mega (10^6) + /// G giga (10^9) + /// T tera (10^12) + /// P peta (10^15) + /// E exa (10^18) + /// Z zetta (10^21) + /// Y yotta (10^24) + /// m milli (10^-3) + /// u micro (10^-6) + /// n nano (10^-9) + /// p pico (10^-12) + /// f femto (10^-15) + /// a atto (10^-18) + /// z zepto (10^-21) + /// y yocto (10^-24) + /// Ki kibi (2^10) + /// Mi mebi (2^20) + /// Gi gibi (2^30) + /// Ti tebi (2^40) + /// Pi pebi (2^50)GrammarThe grammar also includes these connectors: + /// / division or ratio (as an infix operator). For examples, kBy/{email} or MiBy/10ms (although you should almost never have /s in a metric unit; rates should always be computed at query time from the underlying cumulative or delta value). + /// . multiplication or composition (as an infix operator). For examples, GBy.d or k{watt}.h.The grammar for a unit is as follows: /// Expression = Component { "." Component } { "/" Component } ; /// /// Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] @@ -966,10 +884,11 @@ pub struct MetricDescriptor { /// /// Annotation = "{" NAME "}" ; /// Notes: - /// Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. - /// NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. - /// 1 represents dimensionless value 1, such as in 1/s. - /// % represents dimensionless value 1/100, and annotates values giving a percentage. + /// Annotation is just a comment if it follows a UNIT. If the annotation is used alone, then the unit is equivalent to 1. For examples, {request}/s == 1/s, By{transmitted}/s == By/s. + /// NAME is a sequence of non-blank printable ASCII characters not containing { or }. + /// 1 represents a unitary dimensionless unit (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as in 1/s. It is typically used when none of the basic units are appropriate. For example, "new users per day" can be represented as 1/d or {new-users}/d (and a metric value 5 would mean "5 new users). Alternatively, "thousands of page views per day" would be represented as 1000/d or k1/d or k{page_views}/d (and a metric value of 5.3 would mean "5300 page views per day"). + /// % represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value 3 means "3 percent"). + /// 10^2.% indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value 0.03 means "3 percent"). pub unit: Option, /// The resource name of the metric descriptor. pub name: Option, @@ -978,32 +897,7 @@ pub struct MetricDescriptor { impl Part for MetricDescriptor {} -/// Result returned from ListSinks. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [sinks list projects](struct.ProjectSinkListCall.html) (response) -/// * [sinks list billing accounts](struct.BillingAccountSinkListCall.html) (response) -/// * [sinks list organizations](struct.OrganizationSinkListCall.html) (response) -/// * [sinks list folders](struct.FolderSinkListCall.html) (response) -/// * [list sinks](struct.SinkListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListSinksResponse { - /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of sinks. - pub sinks: Option>, -} - -impl ResponseResult for ListSinksResponse {} - - -/// Result returned from WriteLogEntries. empty +/// Result returned from WriteLogEntries. /// /// # Activities /// @@ -1048,7 +942,7 @@ pub struct WriteLogEntriesRequest { /// [LOG_ID] must be URL-encoded. For example: /// "projects/my-project-id/logs/syslog" /// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - /// The permission logging.logEntries.create is needed on each project, organization, billing account, or folder that is receiving new log entries, whether the resource is specified in logName or in an individual log entry. + /// The permission logging.logEntries.create is needed on each project, organization, billing account, or folder that is receiving new log entries, whether the resource is specified in logName or in an individual log entry. #[serde(rename="logName")] pub log_name: Option, /// Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method. @@ -1061,67 +955,32 @@ pub struct WriteLogEntriesRequest { impl RequestValue for WriteLogEntriesRequest {} -/// Specifies a set of log entries that are not to be stored in Logging. If your project receives a large volume of logs, you might be able to use exclusions to reduce your chargeable logs. Exclusions are processed after log sinks, so you can export log entries before they are excluded. Audit log entries and log entries from Amazon Web Services are never excluded. +/// Describes the customer-managed encryption key (CMEK) settings associated with a project, folder, organization, billing account, or flexible resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [patch exclusions](struct.ExclusionPatchCall.html) (request|response) -/// * [exclusions get folders](struct.FolderExclusionGetCall.html) (response) -/// * [exclusions create organizations](struct.OrganizationExclusionCreateCall.html) (request|response) -/// * [exclusions get projects](struct.ProjectExclusionGetCall.html) (response) -/// * [exclusions create projects](struct.ProjectExclusionCreateCall.html) (request|response) -/// * [create exclusions](struct.ExclusionCreateCall.html) (request|response) -/// * [exclusions patch projects](struct.ProjectExclusionPatchCall.html) (request|response) -/// * [exclusions patch folders](struct.FolderExclusionPatchCall.html) (request|response) -/// * [exclusions patch organizations](struct.OrganizationExclusionPatchCall.html) (request|response) -/// * [exclusions get billing accounts](struct.BillingAccountExclusionGetCall.html) (response) -/// * [exclusions patch billing accounts](struct.BillingAccountExclusionPatchCall.html) (request|response) -/// * [exclusions get organizations](struct.OrganizationExclusionGetCall.html) (response) -/// * [exclusions create billing accounts](struct.BillingAccountExclusionCreateCall.html) (request|response) -/// * [get exclusions](struct.ExclusionGetCall.html) (response) -/// * [exclusions create folders](struct.FolderExclusionCreateCall.html) (request|response) +/// * [update cmek settings organizations](struct.OrganizationUpdateCmekSettingCall.html) (request|response) +/// * [get cmek settings](struct.MethodGetCmekSettingCall.html) (response) +/// * [get cmek settings organizations](struct.OrganizationGetCmekSettingCall.html) (response) +/// * [update cmek settings](struct.MethodUpdateCmekSettingCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogExclusion { - /// Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field. - pub disabled: Option, - /// Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. For example, the following filter matches 99% of low-severity log entries from load balancers:"resource.type=http_load_balancer severity, - /// Output only. The last update timestamp of the exclusion.This field may not be present for older exclusions. - #[serde(rename="updateTime")] - pub update_time: Option, - /// Optional. A description of this exclusion. - pub description: Option, - /// Output only. The creation timestamp of the exclusion.This field may not be present for older exclusions. - #[serde(rename="createTime")] - pub create_time: Option, - /// Required. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. +pub struct CmekSettings { + /// Output only. The service account that will be used by the Logs Router to access your Cloud KMS key.Before enabling CMEK for Logs Router, you must first assign the role roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account that the Logs Router will use to access your Cloud KMS key. Use GetCmekSettings to obtain the service account ID.See Enabling CMEK for Logs Router for more information. + #[serde(rename="serviceAccountId")] + pub service_account_id: Option, + /// Output only. The resource name of the CMEK settings. pub name: Option, + /// The resource name for the configured Cloud KMS key.KMS key name format: "projects/PROJECT_ID/locations/LOCATION/keyRings/KEYRING/cryptoKeys/KEY"For example: "projects/my-project-id/locations/my-region/keyRings/key-ring-name/cryptoKeys/key-name"To enable CMEK for the Logs Router, set this field to a valid kms_key_name for which the associated service account has the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key.The Cloud KMS key used by the Log Router can be updated by changing the kms_key_name to a new valid key name. Encryption operations that are in progress will be completed with the key that was in use when they started. Decryption operations will be completed using the key that was used at the time of encryption unless access to that key has been revoked.To disable CMEK for the Logs Router, set this field to an empty string.See Enabling CMEK for Logs Router for more information. + #[serde(rename="kmsKeyName")] + pub kms_key_name: Option, } -impl RequestValue for LogExclusion {} -impl ResponseResult for LogExclusion {} - - -/// A description of a label. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LabelDescriptor { - /// The type of data that can be assigned to the label. - #[serde(rename="valueType")] - pub value_type: Option, - /// A human-readable description for the label. - pub description: Option, - /// The label key. - pub key: Option, -} - -impl Part for LabelDescriptor {} +impl RequestValue for CmekSettings {} +impl ResponseResult for CmekSettings {} /// An individual entry in a log. @@ -1135,7 +994,7 @@ pub struct LogEntry { pub http_request: Option, /// Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 pub trace: Option, - /// Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Logging assigns it the current time. Timestamps have nanosecond accuracy, but trailing zeros in the fractional seconds might be omitted when the timestamp is displayed.Incoming log entries should have timestamps that are no more than the logs retention period in the past, and no more than 24 hours in the future. Log entries outside those time boundaries will not be available when calling entries.list, but those log entries can still be exported with LogSinks. + /// Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Logging assigns it the current time. Timestamps have nanosecond accuracy, but trailing zeros in the fractional seconds might be omitted when the timestamp is displayed.Incoming log entries must have timestamps that don't exceed the logs retention period in the past, and that don't exceed 24 hours in the future. Log entries outside those time boundaries aren't ingested by Logging. pub timestamp: Option, /// Optional. A set of user-defined (key, value) data that provides additional information about the log entry. pub labels: Option>, @@ -1144,13 +1003,13 @@ pub struct LogEntry { /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// A project number may optionally be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". [LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results. + /// A project number may be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". [LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results. #[serde(rename="logName")] pub log_name: Option, - /// Optional. A unique identifier for the log entry. If you provide a value, then Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Logging assigns its own unique identifier. The insert_id is also used to order log entries that have the same timestamp value. + /// Optional. A unique identifier for the log entry. If you provide a value, then Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which are removed in a single query result. However, there are no guarantees of de-duplication in the export of logs.If the insert_id is omitted when writing a log entry, the Logging API assigns its own unique identifier in this field.In queries, the insert_id is also used to order log entries that have the same log_name and timestamp values. #[serde(rename="insertId")] pub insert_id: Option, - /// Optional. The span ID within the trace associated with the log entry.For Trace spans, this is the same format that the Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such as "000000000000004a". + /// Optional. The span ID within the trace associated with the log entry.For Trace spans, this is the same format that the Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such as 000000000000004a. #[serde(rename="spanId")] pub span_id: Option, /// Optional. Information about an operation associated with the log entry, if applicable. @@ -1177,32 +1036,13 @@ pub struct LogEntry { /// Optional. The sampling decision of the trace associated with the log entry.True means that the trace resource name in the trace field was sampled for storage in a trace backend. False means that the trace was not sampled for storage when this log entry was written, or the sampling decision was unknown at the time. A non-sampled trace value is still useful as a request correlation identifier. The default is False. #[serde(rename="traceSampled")] pub trace_sampled: Option, - /// Deprecated. Output only. Additional metadata about the monitored resource.Only k8s_container, k8s_pod, and k8s_node MonitoredResources have this field populated for GKE versions older than 1.12.6. For GKE versions 1.12.6 and above, the metadata field has been deprecated. The Kubernetes pod labels that used to be in metadata.userLabels will now be present in the labels field with a key prefix of k8s-pod/. The Stackdriver system labels that were present in the metadata.systemLabels field will no longer be available in the LogEntry. + /// Output only. Deprecated. Additional metadata about the monitored resource.Only k8s_container, k8s_pod, and k8s_node MonitoredResources have this field populated for GKE versions older than 1.12.6. For GKE versions 1.12.6 and above, the metadata field has been deprecated. The Kubernetes pod labels that used to be in metadata.userLabels will now be present in the labels field with a key prefix of k8s-pod/. The Stackdriver system labels that were present in the metadata.systemLabels field will no longer be available in the LogEntry. pub metadata: Option, } impl Part for LogEntry {} -/// Additional information about a potentially long-running operation with which a log entry is associated. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogEntryOperation { - /// Optional. Set this to True if this is the last log entry in the operation. - pub last: Option, - /// Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. - pub id: Option, - /// Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication". - pub producer: Option, - /// Optional. Set this to True if this is the first log entry in the operation. - pub first: Option, -} - -impl Part for LogEntryOperation {} - - /// Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.Logs-based metric can also be used to extract values from logs and create a a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options. /// /// # Activities @@ -1250,6 +1090,263 @@ impl RequestValue for LogMetric {} impl ResponseResult for LogMetric {} +/// Result returned from ListLogMetrics. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [metrics list projects](struct.ProjectMetricListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLogMetricsResponse { + /// A list of logs-based metrics. + pub metrics: Option>, + /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for ListLogMetricsResponse {} + + +/// Describes a repository of logs (Beta). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations buckets get folders](struct.FolderLocationBucketGetCall.html) (response) +/// * [buckets patch locations](struct.LocationBucketPatchCall.html) (request|response) +/// * [buckets get locations](struct.LocationBucketGetCall.html) (response) +/// * [locations buckets patch billing accounts](struct.BillingAccountLocationBucketPatchCall.html) (request|response) +/// * [locations buckets patch folders](struct.FolderLocationBucketPatchCall.html) (request|response) +/// * [locations buckets patch organizations](struct.OrganizationLocationBucketPatchCall.html) (request|response) +/// * [locations buckets get projects](struct.ProjectLocationBucketGetCall.html) (response) +/// * [locations buckets get organizations](struct.OrganizationLocationBucketGetCall.html) (response) +/// * [locations buckets patch projects](struct.ProjectLocationBucketPatchCall.html) (request|response) +/// * [buckets get billing accounts](struct.BillingAccountBucketGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogBucket { + /// Output only. The last update timestamp of the bucket. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The resource name of the bucket. For example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id The supported locations are: "global" "us-central1"For the location of global it is unspecified where logs are actually stored. Once a bucket has been created, the location can not be changed. + pub name: Option, + /// Describes this bucket. + pub description: Option, + /// Output only. The creation timestamp of the bucket. This is not set for any of the default buckets. + #[serde(rename="createTime")] + pub create_time: Option, + /// Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used. + #[serde(rename="retentionDays")] + pub retention_days: Option, + /// Output only. The bucket lifecycle state. + #[serde(rename="lifecycleState")] + pub lifecycle_state: Option, +} + +impl RequestValue for LogBucket {} +impl ResponseResult for LogBucket {} + + +/// Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Exponential { + /// Must be greater than 0. + pub scale: Option, + /// Must be greater than 1. + #[serde(rename="growthFactor")] + pub growth_factor: Option, + /// Must be greater than 0. + #[serde(rename="numFiniteBuckets")] + pub num_finite_buckets: Option, +} + +impl Part for Exponential {} + + +/// Specifies a set of log entries that are not to be stored in Logging. If your GCP resource receives a large volume of logs, you can use exclusions to reduce your chargeable logs. Exclusions are processed after log sinks, so you can export log entries before they are excluded. Note that organization-level and folder-level exclusions don't apply to child resources, and that you can't exclude audit log entries. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [patch exclusions](struct.ExclusionPatchCall.html) (request|response) +/// * [exclusions get folders](struct.FolderExclusionGetCall.html) (response) +/// * [exclusions create organizations](struct.OrganizationExclusionCreateCall.html) (request|response) +/// * [exclusions get projects](struct.ProjectExclusionGetCall.html) (response) +/// * [exclusions create projects](struct.ProjectExclusionCreateCall.html) (request|response) +/// * [create exclusions](struct.ExclusionCreateCall.html) (request|response) +/// * [exclusions patch projects](struct.ProjectExclusionPatchCall.html) (request|response) +/// * [exclusions patch folders](struct.FolderExclusionPatchCall.html) (request|response) +/// * [exclusions patch organizations](struct.OrganizationExclusionPatchCall.html) (request|response) +/// * [exclusions get billing accounts](struct.BillingAccountExclusionGetCall.html) (response) +/// * [exclusions patch billing accounts](struct.BillingAccountExclusionPatchCall.html) (request|response) +/// * [exclusions get organizations](struct.OrganizationExclusionGetCall.html) (response) +/// * [exclusions create billing accounts](struct.BillingAccountExclusionCreateCall.html) (request|response) +/// * [get exclusions](struct.ExclusionGetCall.html) (response) +/// * [exclusions create folders](struct.FolderExclusionCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogExclusion { + /// Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field. + pub disabled: Option, + /// Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. For example, the following query matches 99% of low-severity log entries from Google Cloud Storage buckets:"resource.type=gcs_bucket severity, + /// Output only. The last update timestamp of the exclusion.This field may not be present for older exclusions. + #[serde(rename="updateTime")] + pub update_time: Option, + /// Optional. A description of this exclusion. + pub description: Option, + /// Output only. The creation timestamp of the exclusion.This field may not be present for older exclusions. + #[serde(rename="createTime")] + pub create_time: Option, + /// Required. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric. + pub name: Option, +} + +impl RequestValue for LogExclusion {} +impl ResponseResult for LogExclusion {} + + +/// Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at least one element. If bounds has only one element, then there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Explicit { + /// The values must be monotonically increasing. + pub bounds: Option>, +} + +impl Part for Explicit {} + + +/// Additional information about a potentially long-running operation with which a log entry is associated. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogEntryOperation { + /// Optional. Set this to True if this is the last log entry in the operation. + pub last: Option, + /// Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. + pub id: Option, + /// Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication". + pub producer: Option, + /// Optional. Set this to True if this is the first log entry in the operation. + pub first: Option, +} + +impl Part for LogEntryOperation {} + + +/// A description of a label. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LabelDescriptor { + /// The type of data that can be assigned to the label. + #[serde(rename="valueType")] + pub value_type: Option, + /// A human-readable description for the label. + pub description: Option, + /// The label key. + pub key: Option, +} + +impl Part for LabelDescriptor {} + + +/// The parameters to ListLogEntries. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list entries](struct.EntryListCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLogEntriesRequest { + /// Optional. How the results should be sorted. Presently, the only permitted values are "timestamp asc" (default) and "timestamp desc". The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values. + #[serde(rename="orderBy")] + pub order_by: Option, + /// Required. Names of one or more parent resources from which to retrieve log entries: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Projects listed in the project_ids field are added to this list. + #[serde(rename="resourceNames")] + pub resource_names: Option>, + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of next_page_token in the response indicates that more results might be available. + #[serde(rename="pageSize")] + pub page_size: Option, + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Optional. Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: "my-project-1A". + #[serde(rename="projectIds")] + pub project_ids: Option>, + /// Optional. A filter that chooses which log entries to return. See Advanced Logs Queries. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of the filter is 20000 characters. + pub filter: Option, +} + +impl RequestValue for ListLogEntriesRequest {} + + +/// Options that change functionality of a sink exporting data to BigQuery. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BigQueryOptions { + /// Optional. Whether to use BigQuery's partition tables. By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone. + #[serde(rename="usePartitionedTables")] + pub use_partitioned_tables: Option, + /// Output only. True if new timestamp column based partitioning is in use, false if legacy ingestion-time partitioning is in use. All new sinks will have this field set true and will use timestamp column based partitioning. If use_partitioned_tables is false, this value has no meaning and will be false. Legacy sinks using partitioned tables will have this field set to false. + #[serde(rename="usesTimestampColumnPartitioning")] + pub uses_timestamp_column_partitioning: Option, +} + +impl Part for BigQueryOptions {} + + +/// Result returned from ListSinks. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [sinks list projects](struct.ProjectSinkListCall.html) (response) +/// * [sinks list billing accounts](struct.BillingAccountSinkListCall.html) (response) +/// * [sinks list organizations](struct.OrganizationSinkListCall.html) (response) +/// * [sinks list folders](struct.FolderSinkListCall.html) (response) +/// * [list sinks](struct.SinkListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListSinksResponse { + /// If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of sinks. + pub sinks: Option>, +} + +impl ResponseResult for ListSinksResponse {} + + /// An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of "gce_instance" and specifies the use of the labels "instance_id" and "zone" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API. /// /// # Activities @@ -1281,6 +1378,45 @@ pub struct MonitoredResourceDescriptor { impl Resource for MonitoredResourceDescriptor {} +/// Result returned from ListMonitoredResourceDescriptors. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list monitored resource descriptors](struct.MonitoredResourceDescriptorListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListMonitoredResourceDescriptorsResponse { + /// If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of resource descriptors. + #[serde(rename="resourceDescriptors")] + pub resource_descriptors: Option>, +} + +impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} + + +/// Additional information about the source code location that produced the log entry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogEntrySourceLocation { + /// Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python). + pub function: Option, + /// Optional. Line within the source file. 1-based; 0 indicates no line number available. + pub line: Option, + /// Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name. + pub file: Option, +} + +impl Part for LogEntrySourceLocation {} + + // ################### // MethodBuilders ### @@ -1310,7 +1446,7 @@ impl Resource for MonitoredResourceDescriptor {} /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` +/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `locations_buckets_get(...)`, `locations_buckets_list(...)`, `locations_buckets_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` /// // to build up your call. /// let rb = hub.folders(); /// # } @@ -1325,30 +1461,6 @@ impl<'a, C, A> MethodsBuilder for FolderMethods<'a, C, A> {} impl<'a, C, A> FolderMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Lists sinks. - /// - /// # Arguments - /// - /// * `parent` - Required. The parent resource whose sinks are to be listed: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - pub fn sinks_list(&self, parent: &str) -> FolderSinkListCall<'a, C, A> { - FolderSinkListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Changes one or more properties of an existing exclusion. @@ -1374,6 +1486,56 @@ impl<'a, C, A> FolderMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists buckets (Beta). + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + pub fn locations_buckets_list(&self, parent: &str) -> FolderLocationBucketListCall<'a, C, A> { + FolderLocationBucketListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> FolderSinkPatchCall<'a, C, A> { + FolderSinkPatchCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. @@ -1400,50 +1562,6 @@ impl<'a, C, A> FolderMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Gets a sink. - /// - /// # Arguments - /// - /// * `sinkName` - Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_get(&self, sink_name: &str) -> FolderSinkGetCall<'a, C, A> { - FolderSinkGetCall { - hub: self.hub, - _sink_name: sink_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the description of an exclusion. - /// - /// # Arguments - /// - /// * `name` - Required. The resource name of an existing exclusion: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - pub fn exclusions_get(&self, name: &str) -> FolderExclusionGetCall<'a, C, A> { - FolderExclusionGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists all the exclusions in a parent resource. @@ -1468,6 +1586,28 @@ impl<'a, C, A> FolderMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets a bucket (Beta). + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + pub fn locations_buckets_get(&self, name: &str) -> FolderLocationBucketGetCall<'a, C, A> { + FolderLocationBucketGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. @@ -1565,46 +1705,22 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// Lists sinks. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> FolderSinkPatchCall<'a, C, A> { - FolderSinkPatchCall { + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn sinks_list(&self, parent: &str) -> FolderSinkListCall<'a, C, A> { + FolderSinkListCall { hub: self.hub, - _request: request, - _sink_name: sink_name.to_string(), - _update_mask: Default::default(), - _unique_writer_identity: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. - /// - /// # Arguments - /// - /// * `logName` - Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - pub fn logs_delete(&self, log_name: &str) -> FolderLogDeleteCall<'a, C, A> { - FolderLogDeleteCall { - hub: self.hub, - _log_name: log_name.to_string(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1632,6 +1748,97 @@ impl<'a, C, A> FolderMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Gets the description of an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_get(&self, name: &str) -> FolderExclusionGetCall<'a, C, A> { + FolderExclusionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + pub fn locations_buckets_patch(&self, request: LogBucket, name: &str) -> FolderLocationBucketPatchCall<'a, C, A> { + FolderLocationBucketPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a sink. + /// + /// # Arguments + /// + /// * `sinkName` - Required. The resource name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_get(&self, sink_name: &str) -> FolderSinkGetCall<'a, C, A> { + FolderSinkGetCall { + hub: self.hub, + _sink_name: sink_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + /// + /// # Arguments + /// + /// * `logName` - Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + pub fn logs_delete(&self, log_name: &str) -> FolderLogDeleteCall<'a, C, A> { + FolderLogDeleteCall { + hub: self.hub, + _log_name: log_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -1660,7 +1867,7 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` +/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `get_cmek_settings(...)`, `locations_buckets_get(...)`, `locations_buckets_list(...)`, `locations_buckets_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)`, `sinks_update(...)` and `update_cmek_settings(...)` /// // to build up your call. /// let rb = hub.organizations(); /// # } @@ -1675,57 +1882,6 @@ impl<'a, C, A> MethodsBuilder for OrganizationMethods<'a, C, A> {} impl<'a, C, A> OrganizationMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> OrganizationSinkPatchCall<'a, C, A> { - OrganizationSinkPatchCall { - hub: self.hub, - _request: request, - _sink_name: sink_name.to_string(), - _update_mask: Default::default(), - _unique_writer_identity: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Changes one or more properties of an existing exclusion. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Required. The resource name of the exclusion to update: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> OrganizationExclusionPatchCall<'a, C, A> { - OrganizationExclusionPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes an exclusion. @@ -1774,68 +1930,23 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. - /// - /// # Arguments - /// - /// * `logName` - Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - pub fn logs_delete(&self, log_name: &str) -> OrganizationLogDeleteCall<'a, C, A> { - OrganizationLogDeleteCall { - hub: self.hub, - _log_name: log_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router for more information. /// /// # Arguments /// /// * `request` - No description provided. - /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_update(&self, request: LogSink, sink_name: &str) -> OrganizationSinkUpdateCall<'a, C, A> { - OrganizationSinkUpdateCall { + /// * `name` - Required. The resource name for the CMEK settings to update. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + pub fn update_cmek_settings(&self, request: CmekSettings, name: &str) -> OrganizationUpdateCmekSettingCall<'a, C, A> { + OrganizationUpdateCmekSettingCall { hub: self.hub, _request: request, - _sink_name: sink_name.to_string(), + _name: name.to_string(), _update_mask: Default::default(), - _unique_writer_identity: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets a sink. - /// - /// # Arguments - /// - /// * `sinkName` - Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_get(&self, sink_name: &str) -> OrganizationSinkGetCall<'a, C, A> { - OrganizationSinkGetCall { - hub: self.hub, - _sink_name: sink_name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1888,6 +1999,31 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The resource in which to create the sink: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn sinks_create(&self, request: LogSink, parent: &str) -> OrganizationSinkCreateCall<'a, C, A> { + OrganizationSinkCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. @@ -1912,6 +2048,30 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists buckets (Beta). + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + pub fn locations_buckets_list(&self, parent: &str) -> OrganizationLocationBucketListCall<'a, C, A> { + OrganizationLocationBucketListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists sinks. @@ -1960,22 +2120,187 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// Gets a sink. + /// + /// # Arguments + /// + /// * `sinkName` - Required. The resource name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_get(&self, sink_name: &str) -> OrganizationSinkGetCall<'a, C, A> { + OrganizationSinkGetCall { + hub: self.hub, + _sink_name: sink_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a bucket (Beta). + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + pub fn locations_buckets_get(&self, name: &str) -> OrganizationLocationBucketGetCall<'a, C, A> { + OrganizationLocationBucketGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The resource in which to create the sink: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - pub fn sinks_create(&self, request: LogSink, parent: &str) -> OrganizationSinkCreateCall<'a, C, A> { - OrganizationSinkCreateCall { + /// * `name` - Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + pub fn locations_buckets_patch(&self, request: LogBucket, name: &str) -> OrganizationLocationBucketPatchCall<'a, C, A> { + OrganizationLocationBucketPatchCall { hub: self.hub, _request: request, - _parent: parent.to_string(), + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information. + /// + /// # Arguments + /// + /// * `name` - Required. The resource for which to retrieve CMEK settings. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + pub fn get_cmek_settings(&self, name: &str) -> OrganizationGetCmekSettingCall<'a, C, A> { + OrganizationGetCmekSettingCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + /// + /// # Arguments + /// + /// * `logName` - Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + pub fn logs_delete(&self, log_name: &str) -> OrganizationLogDeleteCall<'a, C, A> { + OrganizationLogDeleteCall { + hub: self.hub, + _log_name: log_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_update(&self, request: LogSink, sink_name: &str) -> OrganizationSinkUpdateCall<'a, C, A> { + OrganizationSinkUpdateCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Changes one or more properties of an existing exclusion. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + OrganizationExclusionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_patch(&self, request: LogSink, sink_name: &str) -> OrganizationSinkPatchCall<'a, C, A> { + OrganizationSinkPatchCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), _unique_writer_identity: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2025,28 +2350,6 @@ impl<'a, C, A> MethodsBuilder for SinkMethods<'a, C, A> {} impl<'a, C, A> SinkMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Gets a sink. - /// - /// # Arguments - /// - /// * `sinkName` - Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn get(&self, sink_name: &str) -> SinkGetCall<'a, C, A> { - SinkGetCall { - hub: self.hub, - _sink_name: sink_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. @@ -2071,24 +2374,20 @@ impl<'a, C, A> SinkMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// Gets a sink. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// * `sinkName` - Required. The resource name of the sink: /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn update(&self, request: LogSink, sink_name: &str) -> SinkUpdateCall<'a, C, A> { - SinkUpdateCall { + pub fn get(&self, sink_name: &str) -> SinkGetCall<'a, C, A> { + SinkGetCall { hub: self.hub, - _request: request, _sink_name: sink_name.to_string(), - _update_mask: Default::default(), - _unique_writer_identity: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2143,6 +2442,145 @@ impl<'a, C, A> SinkMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn update(&self, request: LogSink, sink_name: &str) -> SinkUpdateCall<'a, C, A> { + SinkUpdateCall { + hub: self.hub, + _request: request, + _sink_name: sink_name.to_string(), + _update_mask: Default::default(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *location* resources. +/// It is not used directly, but through the `Logging` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_logging2 as logging2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use logging2::Logging; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `buckets_get(...)`, `buckets_list(...)` and `buckets_patch(...)` +/// // to build up your call. +/// let rb = hub.locations(); +/// # } +/// ``` +pub struct LocationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, +} + +impl<'a, C, A> MethodsBuilder for LocationMethods<'a, C, A> {} + +impl<'a, C, A> LocationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + pub fn buckets_patch(&self, request: LogBucket, name: &str) -> LocationBucketPatchCall<'a, C, A> { + LocationBucketPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a bucket (Beta). + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + pub fn buckets_get(&self, name: &str) -> LocationBucketGetCall<'a, C, A> { + LocationBucketGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists buckets (Beta). + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + pub fn buckets_list(&self, parent: &str) -> LocationBucketListCall<'a, C, A> { + LocationBucketListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -2203,6 +2641,94 @@ impl<'a, C, A> MonitoredResourceDescriptorMethods<'a, C, A> { +/// A builder providing access to all methods supported on *log* resources. +/// It is not used directly, but through the `Logging` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_logging2 as logging2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use logging2::Logging; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.logs(); +/// # } +/// ``` +pub struct LogMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, +} + +impl<'a, C, A> MethodsBuilder for LogMethods<'a, C, A> {} + +impl<'a, C, A> LogMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name that owns the logs: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn list(&self, parent: &str) -> LogListCall<'a, C, A> { + LogListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + /// + /// # Arguments + /// + /// * `logName` - Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + pub fn delete(&self, log_name: &str) -> LogDeleteCall<'a, C, A> { + LogDeleteCall { + hub: self.hub, + _log_name: log_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *entry* resources. /// It is not used directly, but through the `Logging` hub. /// @@ -2303,7 +2829,7 @@ impl<'a, C, A> EntryMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` +/// // like `buckets_get(...)`, `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `locations_buckets_list(...)`, `locations_buckets_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` /// // to build up your call. /// let rb = hub.billing_accounts(); /// # } @@ -2320,23 +2846,22 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Required. The resource in which to create the sink: + /// * `parent` - Required. The parent resource in which to create the exclusion: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" /// "billingAccounts/[BILLING_ACCOUNT_ID]" /// "folders/[FOLDER_ID]" /// Examples: "projects/my-logging-project", "organizations/123456789". - pub fn sinks_create(&self, request: LogSink, parent: &str) -> BillingAccountSinkCreateCall<'a, C, A> { - BillingAccountSinkCreateCall { + pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> BillingAccountExclusionCreateCall<'a, C, A> { + BillingAccountExclusionCreateCall { hub: self.hub, _request: request, _parent: parent.to_string(), - _unique_writer_identity: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2345,19 +2870,19 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Changes one or more properties of an existing exclusion. + /// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. The resource name of the exclusion to update: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { - BillingAccountExclusionPatchCall { + /// * `name` - Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + pub fn locations_buckets_patch(&self, request: LogBucket, name: &str) -> BillingAccountLocationBucketPatchCall<'a, C, A> { + BillingAccountLocationBucketPatchCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -2370,22 +2895,42 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + /// Gets a bucket (Beta). /// /// # Arguments /// - /// * `parent` - Required. The resource name that owns the logs: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - pub fn logs_list(&self, parent: &str) -> BillingAccountLogListCall<'a, C, A> { - BillingAccountLogListCall { + /// * `name` - Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + pub fn buckets_get(&self, name: &str) -> BillingAccountBucketGetCall<'a, C, A> { + BillingAccountBucketGetCall { hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a sink. + /// + /// # Arguments + /// + /// * `sinkName` - Required. The resource name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_get(&self, sink_name: &str) -> BillingAccountSinkGetCall<'a, C, A> { + BillingAccountSinkGetCall { + hub: self.hub, + _sink_name: sink_name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2464,54 +3009,6 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists sinks. - /// - /// # Arguments - /// - /// * `parent` - Required. The parent resource whose sinks are to be listed: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - pub fn sinks_list(&self, parent: &str) -> BillingAccountSinkListCall<'a, C, A> { - BillingAccountSinkListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The parent resource in which to create the exclusion: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> BillingAccountExclusionCreateCall<'a, C, A> { - BillingAccountExclusionCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. @@ -2562,20 +3059,72 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a sink. + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// # Arguments /// - /// * `sinkName` - Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_get(&self, sink_name: &str) -> BillingAccountSinkGetCall<'a, C, A> { - BillingAccountSinkGetCall { + /// * `request` - No description provided. + /// * `parent` - Required. The resource in which to create the sink: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn sinks_create(&self, request: LogSink, parent: &str) -> BillingAccountSinkCreateCall<'a, C, A> { + BillingAccountSinkCreateCall { hub: self.hub, - _sink_name: sink_name.to_string(), + _request: request, + _parent: parent.to_string(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Changes one or more properties of an existing exclusion. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_patch(&self, request: LogExclusion, name: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + BillingAccountExclusionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists buckets (Beta). + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + pub fn locations_buckets_list(&self, parent: &str) -> BillingAccountLocationBucketListCall<'a, C, A> { + BillingAccountLocationBucketListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2606,7 +3155,55 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. + /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name that owns the logs: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn logs_list(&self, parent: &str) -> BillingAccountLogListCall<'a, C, A> { + BillingAccountLogListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists sinks. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn sinks_list(&self, parent: &str) -> BillingAccountSinkListCall<'a, C, A> { + BillingAccountSinkListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. /// /// # Arguments /// @@ -2668,6 +3265,28 @@ impl<'a, C, A> MethodsBuilder for ExclusionMethods<'a, C, A> {} impl<'a, C, A> ExclusionMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Deletes an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn delete(&self, name: &str) -> ExclusionDeleteCall<'a, C, A> { + ExclusionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Changes one or more properties of an existing exclusion. @@ -2695,22 +3314,20 @@ impl<'a, C, A> ExclusionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + /// Gets the description of an exclusion. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `parent` - Required. The parent resource in which to create the exclusion: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - pub fn create(&self, request: LogExclusion, parent: &str) -> ExclusionCreateCall<'a, C, A> { - ExclusionCreateCall { + /// * `name` - Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn get(&self, name: &str) -> ExclusionGetCall<'a, C, A> { + ExclusionGetCall { hub: self.hub, - _request: request, - _parent: parent.to_string(), + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2743,42 +3360,22 @@ impl<'a, C, A> ExclusionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the description of an exclusion. + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. /// /// # Arguments /// - /// * `name` - Required. The resource name of an existing exclusion: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - pub fn get(&self, name: &str) -> ExclusionGetCall<'a, C, A> { - ExclusionGetCall { + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn create(&self, request: LogExclusion, parent: &str) -> ExclusionCreateCall<'a, C, A> { + ExclusionCreateCall { hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes an exclusion. - /// - /// # Arguments - /// - /// * `name` - Required. The resource name of an existing exclusion to delete: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - pub fn delete(&self, name: &str) -> ExclusionDeleteCall<'a, C, A> { - ExclusionDeleteCall { - hub: self.hub, - _name: name.to_string(), + _request: request, + _parent: parent.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2812,7 +3409,7 @@ impl<'a, C, A> ExclusionMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `metrics_create(...)`, `metrics_delete(...)`, `metrics_get(...)`, `metrics_list(...)`, `metrics_update(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` +/// // like `exclusions_create(...)`, `exclusions_delete(...)`, `exclusions_get(...)`, `exclusions_list(...)`, `exclusions_patch(...)`, `locations_buckets_get(...)`, `locations_buckets_list(...)`, `locations_buckets_patch(...)`, `logs_delete(...)`, `logs_list(...)`, `metrics_create(...)`, `metrics_delete(...)`, `metrics_get(...)`, `metrics_list(...)`, `metrics_update(...)`, `sinks_create(...)`, `sinks_delete(...)`, `sinks_get(...)`, `sinks_list(...)`, `sinks_patch(...)` and `sinks_update(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2827,6 +3424,74 @@ impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} impl<'a, C, A> ProjectMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Creates a logs-based metric. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The resource name of the project in which to create the metric: + /// "projects/[PROJECT_ID]" + /// The new metric must be provided in the request. + pub fn metrics_create(&self, request: LogMetric, parent: &str) -> ProjectMetricCreateCall<'a, C, A> { + ProjectMetricCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + pub fn locations_buckets_patch(&self, request: LogBucket, name: &str) -> ProjectLocationBucketPatchCall<'a, C, A> { + ProjectLocationBucketPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. + /// + /// # Arguments + /// + /// * `sinkName` - Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_delete(&self, sink_name: &str) -> ProjectSinkDeleteCall<'a, C, A> { + ProjectSinkDeleteCall { + hub: self.hub, + _sink_name: sink_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists all the exclusions in a parent resource. @@ -2851,6 +3516,204 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists sinks. + /// + /// # Arguments + /// + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + pub fn sinks_list(&self, parent: &str) -> ProjectSinkListCall<'a, C, A> { + ProjectSinkListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an exclusion. + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_delete(&self, name: &str) -> ProjectExclusionDeleteCall<'a, C, A> { + ProjectExclusionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The parent resource in which to create the exclusion: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> ProjectExclusionCreateCall<'a, C, A> { + ProjectExclusionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a bucket (Beta). + /// + /// # Arguments + /// + /// * `name` - Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + pub fn locations_buckets_get(&self, name: &str) -> ProjectLocationBucketGetCall<'a, C, A> { + ProjectLocationBucketGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The resource in which to create the sink: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + pub fn sinks_create(&self, request: LogSink, parent: &str) -> ProjectSinkCreateCall<'a, C, A> { + ProjectSinkCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _unique_writer_identity: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates or updates a logs-based metric. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `metricName` - Required. The resource name of the metric to update: + /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + /// The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. + pub fn metrics_update(&self, request: LogMetric, metric_name: &str) -> ProjectMetricUpdateCall<'a, C, A> { + ProjectMetricUpdateCall { + hub: self.hub, + _request: request, + _metric_name: metric_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a logs-based metric. + /// + /// # Arguments + /// + /// * `metricName` - Required. The resource name of the metric to delete: + /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + /// + pub fn metrics_delete(&self, metric_name: &str) -> ProjectMetricDeleteCall<'a, C, A> { + ProjectMetricDeleteCall { + hub: self.hub, + _metric_name: metric_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a logs-based metric. + /// + /// # Arguments + /// + /// * `metricName` - Required. The resource name of the desired metric: + /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + /// + pub fn metrics_get(&self, metric_name: &str) -> ProjectMetricGetCall<'a, C, A> { + ProjectMetricGetCall { + hub: self.hub, + _metric_name: metric_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a sink. + /// + /// # Arguments + /// + /// * `sinkName` - Required. The resource name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + pub fn sinks_get(&self, sink_name: &str) -> ProjectSinkGetCall<'a, C, A> { + ProjectSinkGetCall { + hub: self.hub, + _sink_name: sink_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. @@ -2879,17 +3742,42 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a logs-based metric. + /// Gets the description of an exclusion. /// /// # Arguments /// - /// * `metricName` - The resource name of the desired metric: - /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - /// - pub fn metrics_get(&self, metric_name: &str) -> ProjectMetricGetCall<'a, C, A> { - ProjectMetricGetCall { + /// * `name` - Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + pub fn exclusions_get(&self, name: &str) -> ProjectExclusionGetCall<'a, C, A> { + ProjectExclusionGetCall { hub: self.hub, - _metric_name: metric_name.to_string(), + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. + /// + /// # Arguments + /// + /// * `logName` - Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + pub fn logs_delete(&self, log_name: &str) -> ProjectLogDeleteCall<'a, C, A> { + ProjectLogDeleteCall { + hub: self.hub, + _log_name: log_name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2948,40 +3836,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. + /// Lists logs-based metrics. /// /// # Arguments /// - /// * `logName` - Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - pub fn logs_delete(&self, log_name: &str) -> ProjectLogDeleteCall<'a, C, A> { - ProjectLogDeleteCall { - hub: self.hub, - _log_name: log_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists sinks. - /// - /// # Arguments - /// - /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// * `parent` - Required. The name of the project containing the metrics: /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" /// - pub fn sinks_list(&self, parent: &str) -> ProjectSinkListCall<'a, C, A> { - ProjectSinkListCall { + pub fn metrics_list(&self, parent: &str) -> ProjectMetricListCall<'a, C, A> { + ProjectMetricListCall { hub: self.hub, _parent: parent.to_string(), _page_token: Default::default(), @@ -2994,156 +3857,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an exclusion. + /// Lists buckets (Beta). /// /// # Arguments /// - /// * `name` - Required. The resource name of an existing exclusion to delete: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - pub fn exclusions_delete(&self, name: &str) -> ProjectExclusionDeleteCall<'a, C, A> { - ProjectExclusionDeleteCall { + /// * `parent` - Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + pub fn locations_buckets_list(&self, parent: &str) -> ProjectLocationBucketListCall<'a, C, A> { + ProjectLocationBucketListCall { hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the description of an exclusion. - /// - /// # Arguments - /// - /// * `name` - Required. The resource name of an existing exclusion: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - pub fn exclusions_get(&self, name: &str) -> ProjectExclusionGetCall<'a, C, A> { - ProjectExclusionGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets a sink. - /// - /// # Arguments - /// - /// * `sinkName` - Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_get(&self, sink_name: &str) -> ProjectSinkGetCall<'a, C, A> { - ProjectSinkGetCall { - hub: self.hub, - _sink_name: sink_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. - /// - /// # Arguments - /// - /// * `sinkName` - Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - pub fn sinks_delete(&self, sink_name: &str) -> ProjectSinkDeleteCall<'a, C, A> { - ProjectSinkDeleteCall { - hub: self.hub, - _sink_name: sink_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a logs-based metric. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - The resource name of the project in which to create the metric: - /// "projects/[PROJECT_ID]" - /// The new metric must be provided in the request. - pub fn metrics_create(&self, request: LogMetric, parent: &str) -> ProjectMetricCreateCall<'a, C, A> { - ProjectMetricCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The resource in which to create the sink: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - pub fn sinks_create(&self, request: LogSink, parent: &str) -> ProjectSinkCreateCall<'a, C, A> { - ProjectSinkCreateCall { - hub: self.hub, - _request: request, - _parent: parent.to_string(), - _unique_writer_identity: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `parent` - Required. The parent resource in which to create the exclusion: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - pub fn exclusions_create(&self, request: LogExclusion, parent: &str) -> ProjectExclusionCreateCall<'a, C, A> { - ProjectExclusionCreateCall { - hub: self.hub, - _request: request, _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3174,72 +3903,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Creates or updates a logs-based metric. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `metricName` - The resource name of the metric to update: - /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - /// The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. - pub fn metrics_update(&self, request: LogMetric, metric_name: &str) -> ProjectMetricUpdateCall<'a, C, A> { - ProjectMetricUpdateCall { - hub: self.hub, - _request: request, - _metric_name: metric_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes a logs-based metric. - /// - /// # Arguments - /// - /// * `metricName` - The resource name of the metric to delete: - /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - /// - pub fn metrics_delete(&self, metric_name: &str) -> ProjectMetricDeleteCall<'a, C, A> { - ProjectMetricDeleteCall { - hub: self.hub, - _metric_name: metric_name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists logs-based metrics. - /// - /// # Arguments - /// - /// * `parent` - Required. The name of the project containing the metrics: - /// "projects/[PROJECT_ID]" - /// - pub fn metrics_list(&self, parent: &str) -> ProjectMetricListCall<'a, C, A> { - ProjectMetricListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } -/// A builder providing access to all methods supported on *log* resources. +/// A builder providing access to all free methods, which are not associated with a particular resource. /// It is not used directly, but through the `Logging` hub. /// /// # Example @@ -3263,37 +3931,37 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)` and `list(...)` +/// // like `get_cmek_settings(...)` and `update_cmek_settings(...)` /// // to build up your call. -/// let rb = hub.logs(); +/// let rb = hub.methods(); /// # } /// ``` -pub struct LogMethods<'a, C, A> +pub struct MethodMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, } -impl<'a, C, A> MethodsBuilder for LogMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for MethodMethods<'a, C, A> {} -impl<'a, C, A> LogMethods<'a, C, A> { +impl<'a, C, A> MethodMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. + /// Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information. /// /// # Arguments /// - /// * `logName` - Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - pub fn delete(&self, log_name: &str) -> LogDeleteCall<'a, C, A> { - LogDeleteCall { + /// * `name` - Required. The resource for which to retrieve CMEK settings. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + pub fn get_cmek_settings(&self, name: &str) -> MethodGetCmekSettingCall<'a, C, A> { + MethodGetCmekSettingCall { hub: self.hub, - _log_name: log_name.to_string(), + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3302,22 +3970,23 @@ impl<'a, C, A> LogMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. + /// Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router for more information. /// /// # Arguments /// - /// * `parent` - Required. The resource name that owns the logs: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - pub fn list(&self, parent: &str) -> LogListCall<'a, C, A> { - LogListCall { + /// * `request` - No description provided. + /// * `name` - Required. The resource name for the CMEK settings to update. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + pub fn update_cmek_settings(&self, request: CmekSettings, name: &str) -> MethodUpdateCmekSettingCall<'a, C, A> { + MethodUpdateCmekSettingCall { hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3333,283 +4002,6 @@ impl<'a, C, A> LogMethods<'a, C, A> { // CallBuilders ### // ################# -/// Lists sinks. -/// -/// A builder for the *sinks.list* method supported by a *folder* resource. -/// It is not used directly, but through a `FolderMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.folders().sinks_list("parent") -/// .page_token("amet.") -/// .page_size(-81) -/// .doit(); -/// # } -/// ``` -pub struct FolderSinkListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FolderSinkListCall<'a, C, A> {} - -impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListSinksResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.folders.sinks.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The parent resource whose sinks are to be listed: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> FolderSinkListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderSinkListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> FolderSinkListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FolderSinkListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Changes one or more properties of an existing exclusion. /// /// A builder for the *exclusions.patch* method supported by a *folder* resource. @@ -3644,7 +4036,7 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.folders().exclusions_patch(req, "name") -/// .update_mask("sea") +/// .update_mask("amet.") /// .doit(); /// # } /// ``` @@ -3836,7 +4228,7 @@ impl<'a, C, A> FolderExclusionPatchCall<'a, C, A> where C: BorrowMut FolderExclusionPatchCall<'a, C, A> { @@ -3906,6 +4298,594 @@ impl<'a, C, A> FolderExclusionPatchCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.folders().locations_buckets_list("parent") +/// .page_token("labore") +/// .page_size(-9) +/// .doit(); +/// # } +/// ``` +pub struct FolderLocationBucketListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderLocationBucketListCall<'a, C, A> {} + +impl<'a, C, A> FolderLocationBucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBucketsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.locations.buckets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/buckets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> FolderLocationBucketListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FolderLocationBucketListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> FolderLocationBucketListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderLocationBucketListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderLocationBucketListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderLocationBucketListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.patch* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.folders().sinks_patch(req, "sinkName") +/// .update_mask("dolores") +/// .unique_writer_identity(false) +/// .doit(); +/// # } +/// ``` +pub struct FolderSinkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderSinkPatchCall<'a, C, A> {} + +impl<'a, C, A> FolderSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.sinks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> FolderSinkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> FolderSinkPatchCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> FolderSinkPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> FolderSinkPatchCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderSinkPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderSinkPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderSinkPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. /// /// A builder for the *sinks.update* method supported by a *folder* resource. @@ -3940,7 +4920,7 @@ impl<'a, C, A> FolderExclusionPatchCall<'a, C, A> where C: BorrowMut FolderSinkUpdateCall<'a, C, A> where C: BorrowMut, } -/// Gets a sink. -/// -/// A builder for the *sinks.get* method supported by a *folder* resource. -/// It is not used directly, but through a `FolderMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.folders().sinks_get("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct FolderSinkGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FolderSinkGetCall<'a, C, A> {} - -impl<'a, C, A> FolderSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.folders.sinks.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> FolderSinkGetCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderSinkGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> FolderSinkGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FolderSinkGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets the description of an exclusion. -/// -/// A builder for the *exclusions.get* method supported by a *folder* resource. -/// It is not used directly, but through a `FolderMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.folders().exclusions_get("name") -/// .doit(); -/// # } -/// ``` -pub struct FolderExclusionGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FolderExclusionGetCall<'a, C, A> {} - -impl<'a, C, A> FolderExclusionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.folders.exclusions.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of an existing exclusion: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> FolderExclusionGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderExclusionGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> FolderExclusionGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FolderExclusionGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists all the exclusions in a parent resource. /// /// A builder for the *exclusions.list* method supported by a *folder* resource. @@ -4751,7 +5225,7 @@ impl<'a, C, A> FolderExclusionGetCall<'a, C, A> where C: BorrowMut FolderExclusionListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.folders().locations_buckets_get("name") +/// .doit(); +/// # } +/// ``` +pub struct FolderLocationBucketGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderLocationBucketGetCall<'a, C, A> {} + +impl<'a, C, A> FolderLocationBucketGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.locations.buckets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> FolderLocationBucketGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderLocationBucketGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderLocationBucketGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderLocationBucketGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. /// /// A builder for the *sinks.create* method supported by a *folder* resource. @@ -5861,8 +6588,8 @@ impl<'a, C, A> FolderSinkDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.folders().logs_list("parent") -/// .page_token("Lorem") -/// .page_size(-21) +/// .page_token("duo") +/// .page_size(-32) /// .doit(); /// # } /// ``` @@ -6110,320 +6837,9 @@ impl<'a, C, A> FolderLogListCall<'a, C, A> where C: BorrowMut, A: } -/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// Lists sinks. /// -/// A builder for the *sinks.patch* method supported by a *folder* resource. -/// It is not used directly, but through a `FolderMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogSink; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.folders().sinks_patch(req, "sinkName") -/// .update_mask("aliquyam") -/// .unique_writer_identity(true) -/// .doit(); -/// # } -/// ``` -pub struct FolderSinkPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogSink, - _sink_name: String, - _update_mask: Option, - _unique_writer_identity: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FolderSinkPatchCall<'a, C, A> {} - -impl<'a, C, A> FolderSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.folders.sinks.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogSink) -> FolderSinkPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> FolderSinkPatchCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> FolderSinkPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is set to false or defaulted to false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> FolderSinkPatchCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderSinkPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> FolderSinkPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FolderSinkPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. -/// -/// A builder for the *logs.delete* method supported by a *folder* resource. +/// A builder for the *sinks.list* method supported by a *folder* resource. /// It is not used directly, but through a `FolderMethods` instance. /// /// # Example @@ -6448,27 +6864,31 @@ impl<'a, C, A> FolderSinkPatchCall<'a, C, A> where C: BorrowMut, /// // 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.folders().logs_delete("logName") +/// let result = hub.folders().sinks_list("parent") +/// .page_token("Lorem") +/// .page_size(-75) /// .doit(); /// # } /// ``` -pub struct FolderLogDeleteCall<'a, C, A> +pub struct FolderSinkListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _log_name: String, + _parent: String, + _page_token: Option, + _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for FolderLogDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for FolderSinkListCall<'a, C, A> {} -impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListSinksResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -6477,11 +6897,17 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.folders.logs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("logName", self._log_name.to_string())); - for &field in ["alt", "logName"].iter() { + dlg.begin(MethodInfo { id: "logging.folders.sinks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6493,12 +6919,12 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+logName}"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+logName}", "logName")].iter() { + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -6513,7 +6939,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["logName"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -6543,7 +6969,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -6596,19 +7022,33 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, } - /// Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + /// Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// /// - /// Sets the *log name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn log_name(mut self, new_value: &str) -> FolderLogDeleteCall<'a, C, A> { - self._log_name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> FolderSinkListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> FolderSinkListCall<'a, C, A> { + self._page_size = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -6617,7 +7057,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderLogDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderSinkListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6642,7 +7082,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> FolderLogDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> FolderSinkListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6662,7 +7102,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FolderLogDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> FolderSinkListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6927,10 +7367,10 @@ impl<'a, C, A> FolderExclusionDeleteCall<'a, C, A> where C: BorrowMut FolderExclusionDeleteCall<'a, C, A> where C: BorrowMut FolderExclusionDeleteCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.organizations().sinks_patch(req, "sinkName") -/// .update_mask("sadipscing") -/// .unique_writer_identity(true) +/// let result = hub.folders().exclusions_get("name") /// .doit(); /// # } /// ``` -pub struct OrganizationSinkPatchCall<'a, C, A> +pub struct FolderExclusionGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogSink, - _sink_name: String, - _update_mask: Option, - _unique_writer_identity: Option, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrganizationSinkPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for FolderExclusionGetCall<'a, C, A> {} -impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> FolderExclusionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -6994,17 +7423,11 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.organizations.sinks.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + dlg.begin(MethodInfo { id: "logging.folders.exclusions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7016,12 +7439,12 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -7048,17 +7471,6 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> OrganizationSinkPatchCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> OrganizationSinkPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is set to false or defaulted to false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkPatchCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); + pub fn name(mut self, new_value: &str) -> FolderExclusionGetCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -7181,7 +7563,7 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderExclusionGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7206,7 +7588,7 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSinkPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> FolderExclusionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -7226,7 +7608,7 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrganizationSinkPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> FolderExclusionGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -7238,10 +7620,10 @@ impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut +pub struct FolderLocationBucketPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogExclusion, + _request: LogBucket, _name: String, _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, @@ -7288,13 +7670,13 @@ pub struct OrganizationExclusionPatchCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrganizationExclusionPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for FolderLocationBucketPatchCall<'a, C, A> {} -impl<'a, C, A> OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> FolderLocationBucketPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -7303,7 +7685,7 @@ impl<'a, C, A> OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.organizations.exclusions.patch", + dlg.begin(MethodInfo { id: "logging.folders.locations.buckets.patch", http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -7445,29 +7827,29 @@ impl<'a, C, A> OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut OrganizationExclusionPatchCall<'a, C, A> { + pub fn request(mut self, new_value: LogBucket) -> FolderLocationBucketPatchCall<'a, C, A> { self._request = new_value; self } - /// Required. The resource name of the exclusion to update: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> FolderLocationBucketPatchCall<'a, C, A> { self._name = new_value.to_string(); self } - /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. /// /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> FolderLocationBucketPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } @@ -7477,7 +7859,7 @@ impl<'a, C, A> OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut OrganizationExclusionPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderLocationBucketPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7502,7 +7884,7 @@ impl<'a, C, A> OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationExclusionPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> FolderLocationBucketPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -7522,7 +7904,513 @@ impl<'a, C, A> OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrganizationExclusionPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> FolderLocationBucketPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a sink. +/// +/// A builder for the *sinks.get* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.folders().sinks_get("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct FolderSinkGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _sink_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderSinkGetCall<'a, C, A> {} + +impl<'a, C, A> FolderSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.sinks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> FolderSinkGetCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderSinkGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderSinkGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderSinkGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. +/// +/// A builder for the *logs.delete* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.folders().logs_delete("logName") +/// .doit(); +/// # } +/// ``` +pub struct FolderLogDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _log_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderLogDeleteCall<'a, C, A> {} + +impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.folders.logs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("logName", self._log_name.to_string())); + for &field in ["alt", "logName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+logName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+logName}", "logName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["logName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + /// + /// Sets the *log name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn log_name(mut self, new_value: &str) -> FolderLogDeleteCall<'a, C, A> { + self._log_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> FolderLogDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderLogDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderLogDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -7815,8 +8703,8 @@ impl<'a, C, A> OrganizationExclusionDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.organizations().logs_delete("logName") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationLogDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _log_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationLogDeleteCall<'a, C, A> {} - -impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.organizations.logs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("logName", self._log_name.to_string())); - for &field in ["alt", "logName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+logName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+logName}", "logName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["logName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - /// - /// Sets the *log name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn log_name(mut self, new_value: &str) -> OrganizationLogDeleteCall<'a, C, A> { - self._log_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLogDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationLogDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationLogDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. -/// -/// A builder for the *sinks.update* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogSink; +/// use logging2::CmekSettings; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -8345,37 +8980,35 @@ impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut +pub struct OrganizationUpdateCmekSettingCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogSink, - _sink_name: String, + _request: CmekSettings, + _name: String, _update_mask: Option, - _unique_writer_identity: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrganizationSinkUpdateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrganizationUpdateCmekSettingCall<'a, C, A> {} -impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrganizationUpdateCmekSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, CmekSettings)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -8384,17 +9017,14 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.organizations.sinks.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); + dlg.begin(MethodInfo { id: "logging.organizations.updateCmekSettings", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); if let Some(value) = self._update_mask { params.push(("updateMask", value.to_string())); } - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8406,12 +9036,12 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8468,7 +9098,7 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> { + pub fn request(mut self, new_value: CmekSettings) -> OrganizationUpdateCmekSettingCall<'a, C, A> { self._request = new_value; self } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". + /// Required. The resource name for the CMEK settings to update. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. /// - /// Sets the *sink name* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> OrganizationSinkUpdateCall<'a, C, A> { - self._sink_name = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> OrganizationUpdateCmekSettingCall<'a, C, A> { + self._name = new_value.to_string(); self } - /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + /// Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.Example: "updateMask=kmsKeyName" /// /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> OrganizationSinkUpdateCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> OrganizationUpdateCmekSettingCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is set to false or defaulted to false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkUpdateCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationSinkUpdateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationUpdateCmekSettingCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8596,7 +9216,7 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSinkUpdateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrganizationUpdateCmekSettingCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8616,260 +9236,7 @@ impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrganizationSinkUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a sink. -/// -/// A builder for the *sinks.get* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.organizations().sinks_get("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationSinkGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationSinkGetCall<'a, C, A> {} - -impl<'a, C, A> OrganizationSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.organizations.sinks.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> OrganizationSinkGetCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationSinkGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationSinkGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationSinkGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrganizationUpdateCmekSettingCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8909,8 +9276,8 @@ impl<'a, C, A> OrganizationSinkGetCall<'a, C, A> where C: BorrowMut OrganizationExclusionGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.organizations().sinks_create(req, "parent") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationSinkCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _parent: String, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationSinkCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.sinks.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "parent", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> OrganizationSinkCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource in which to create the sink: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationSinkCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkCreateCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationSinkCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationSinkCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationSinkCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. /// /// A builder for the *exclusions.create* method supported by a *organization* resource. @@ -9695,6 +10358,283 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_buckets_list("parent") +/// .page_token("et") +/// .page_size(-46) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationBucketListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationBucketListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationBucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBucketsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.locations.buckets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/buckets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationLocationBucketListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationLocationBucketListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationLocationBucketListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationBucketListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationBucketListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationBucketListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists sinks. /// /// A builder for the *sinks.list* method supported by a *organization* resource. @@ -9723,8 +10663,8 @@ impl<'a, C, A> OrganizationExclusionCreateCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.organizations().sinks_create(req, "parent") -/// .unique_writer_identity(true) -/// .doit(); -/// # } -/// ``` -pub struct OrganizationSinkCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogSink, - _parent: String, - _unique_writer_identity: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationSinkCreateCall<'a, C, A> {} - -impl<'a, C, A> OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.organizations.sinks.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "parent", "uniqueWriterIdentity"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogSink) -> OrganizationSinkCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The resource in which to create the sink: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> OrganizationSinkCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkCreateCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationSinkCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OrganizationSinkCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationSinkCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a sink. -/// -/// A builder for the *get* method supported by a *sink* resource. -/// It is not used directly, but through a `SinkMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -10548,11 +11192,11 @@ impl<'a, C, A> OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut +pub struct OrganizationSinkGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, @@ -10562,9 +11206,9 @@ pub struct SinkGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for SinkGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrganizationSinkGetCall<'a, C, A> {} -impl<'a, C, A> SinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrganizationSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -10577,7 +11221,7 @@ impl<'a, C, A> SinkGetCall<'a, C, A> where C: BorrowMut, A: oauth Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.sinks.get", + dlg.begin(MethodInfo { id: "logging.organizations.sinks.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("sinkName", self._sink_name.to_string())); @@ -10707,7 +11351,7 @@ impl<'a, C, A> SinkGetCall<'a, C, A> where C: BorrowMut, A: oauth /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> SinkGetCall<'a, C, A> { + pub fn sink_name(mut self, new_value: &str) -> OrganizationSinkGetCall<'a, C, A> { self._sink_name = new_value.to_string(); self } @@ -10717,7 +11361,7 @@ impl<'a, C, A> SinkGetCall<'a, C, A> where C: BorrowMut, A: oauth /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SinkGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationSinkGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -10742,7 +11386,7 @@ impl<'a, C, A> SinkGetCall<'a, C, A> where C: BorrowMut, A: oauth /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SinkGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrganizationSinkGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -10762,7 +11406,1980 @@ impl<'a, C, A> SinkGetCall<'a, C, A> where C: BorrowMut, A: oauth /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SinkGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrganizationSinkGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a bucket (Beta). +/// +/// A builder for the *locations.buckets.get* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().locations_buckets_get("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationBucketGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationBucketGetCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationBucketGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.locations.buckets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationBucketGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationBucketGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationBucketGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationBucketGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. +/// +/// A builder for the *locations.buckets.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogBucket; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogBucket::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.organizations().locations_buckets_patch(req, "name") +/// .update_mask("dolor") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLocationBucketPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogBucket, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLocationBucketPatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLocationBucketPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.locations.buckets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogBucket) -> OrganizationLocationBucketPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationLocationBucketPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationLocationBucketPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLocationBucketPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLocationBucketPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLocationBucketPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information. +/// +/// A builder for the *getCmekSettings* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().get_cmek_settings("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationGetCmekSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationGetCmekSettingCall<'a, C, A> {} + +impl<'a, C, A> OrganizationGetCmekSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CmekSettings)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.getCmekSettings", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}/cmekSettings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource for which to retrieve CMEK settings. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationGetCmekSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationGetCmekSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationGetCmekSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationGetCmekSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. +/// +/// A builder for the *logs.delete* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().logs_delete("logName") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationLogDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _log_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationLogDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.logs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("logName", self._log_name.to_string())); + for &field in ["alt", "logName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+logName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+logName}", "logName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["logName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + /// + /// Sets the *log name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn log_name(mut self, new_value: &str) -> OrganizationLogDeleteCall<'a, C, A> { + self._log_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationLogDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationLogDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationLogDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.update* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.organizations().sinks_update(req, "sinkName") +/// .update_mask("voluptua.") +/// .unique_writer_identity(false) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationSinkUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationSinkUpdateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.sinks.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> OrganizationSinkUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> OrganizationSinkUpdateCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationSinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkUpdateCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationSinkUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationSinkUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationSinkUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Changes one or more properties of an existing exclusion. +/// +/// A builder for the *exclusions.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogExclusion::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.organizations().exclusions_patch(req, "name") +/// .update_mask("justo") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationExclusionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationExclusionPatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationExclusionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.exclusions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogExclusion) -> OrganizationExclusionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationExclusionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationExclusionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationExclusionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationExclusionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.patch* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.organizations().sinks_patch(req, "sinkName") +/// .update_mask("vero") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationSinkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationSinkPatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.organizations.sinks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> OrganizationSinkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> OrganizationSinkPatchCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationSinkPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> OrganizationSinkPatchCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationSinkPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationSinkPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationSinkPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11027,9 +13644,9 @@ impl<'a, C, A> SinkDeleteCall<'a, C, A> where C: BorrowMut, A: oa } -/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// Gets a sink. /// -/// A builder for the *update* method supported by a *sink* resource. +/// A builder for the *get* method supported by a *sink* resource. /// It is not used directly, but through a `SinkMethods` instance. /// /// # Example @@ -11041,7 +13658,6 @@ impl<'a, C, A> SinkDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_logging2 as logging2; -/// use logging2::LogSink; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -11052,36 +13668,26 @@ impl<'a, C, A> SinkDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.sinks().update(req, "sinkName") -/// .update_mask("dolor") -/// .unique_writer_identity(true) +/// let result = hub.sinks().get("sinkName") /// .doit(); /// # } /// ``` -pub struct SinkUpdateCall<'a, C, A> +pub struct SinkGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogSink, _sink_name: String, - _update_mask: Option, - _unique_writer_identity: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for SinkUpdateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for SinkGetCall<'a, C, A> {} -impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> SinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -11094,17 +13700,11 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.sinks.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "logging.sinks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("sinkName", self._sink_name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + for &field in ["alt", "sinkName"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11148,17 +13748,6 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa let url = hyper::Url::parse_with_params(&url, params).unwrap(); - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -11175,15 +13764,11 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa } }; let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -11234,16 +13819,7 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa } - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogSink) -> SinkUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// Required. The resource name of the sink: /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" @@ -11254,34 +13830,17 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> SinkUpdateCall<'a, C, A> { + pub fn sink_name(mut self, new_value: &str) -> SinkGetCall<'a, C, A> { self._sink_name = new_value.to_string(); self } - /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> SinkUpdateCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is set to false or defaulted to false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> SinkUpdateCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SinkUpdateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SinkGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -11306,7 +13865,7 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> SinkUpdateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> SinkGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -11326,7 +13885,7 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SinkUpdateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> SinkGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11366,8 +13925,8 @@ impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.sinks().list("parent") -/// .page_token("consetetur") -/// .page_size(-52) +/// .page_token("vero") +/// .page_size(-95) /// .doit(); /// # } /// ``` @@ -11911,6 +14470,1143 @@ impl<'a, C, A> SinkCreateCall<'a, C, A> where C: BorrowMut, A: oa } +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *update* method supported by a *sink* resource. +/// It is not used directly, but through a `SinkMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.sinks().update(req, "sinkName") +/// .update_mask("duo") +/// .unique_writer_identity(false) +/// .doit(); +/// # } +/// ``` +pub struct SinkUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SinkUpdateCall<'a, C, A> {} + +impl<'a, C, A> SinkUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.sinks.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> SinkUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> SinkUpdateCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> SinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> SinkUpdateCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SinkUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> SinkUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SinkUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. +/// +/// A builder for the *buckets.patch* method supported by a *location* resource. +/// It is not used directly, but through a `LocationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogBucket; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogBucket::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.locations().buckets_patch(req, "name") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct LocationBucketPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogBucket, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LocationBucketPatchCall<'a, C, A> {} + +impl<'a, C, A> LocationBucketPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.locations.buckets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogBucket) -> LocationBucketPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> LocationBucketPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> LocationBucketPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LocationBucketPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> LocationBucketPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LocationBucketPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a bucket (Beta). +/// +/// A builder for the *buckets.get* method supported by a *location* resource. +/// It is not used directly, but through a `LocationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.locations().buckets_get("name") +/// .doit(); +/// # } +/// ``` +pub struct LocationBucketGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LocationBucketGetCall<'a, C, A> {} + +impl<'a, C, A> LocationBucketGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.locations.buckets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> LocationBucketGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LocationBucketGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> LocationBucketGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LocationBucketGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists buckets (Beta). +/// +/// A builder for the *buckets.list* method supported by a *location* resource. +/// It is not used directly, but through a `LocationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.locations().buckets_list("parent") +/// .page_token("takimata") +/// .page_size(-40) +/// .doit(); +/// # } +/// ``` +pub struct LocationBucketListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LocationBucketListCall<'a, C, A> {} + +impl<'a, C, A> LocationBucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBucketsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.locations.buckets.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/buckets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> LocationBucketListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> LocationBucketListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> LocationBucketListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LocationBucketListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> LocationBucketListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LocationBucketListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the descriptors for monitored resource types used by Logging. /// /// A builder for the *list* method supported by a *monitoredResourceDescriptor* resource. @@ -11939,8 +15635,8 @@ impl<'a, C, A> SinkCreateCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.monitored_resource_descriptors().list() -/// .page_token("gubergren") -/// .page_size(-20) +/// .page_token("kasd") +/// .page_size(-7) /// .doit(); /// # } /// ``` @@ -12146,6 +15842,536 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< } +/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. +/// +/// A builder for the *list* method supported by a *log* resource. +/// It is not used directly, but through a `LogMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.logs().list("parent") +/// .page_token("At") +/// .page_size(-86) +/// .doit(); +/// # } +/// ``` +pub struct LogListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LogListCall<'a, C, A> {} + +impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLogsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.logs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name that owns the logs: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> LogListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> LogListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> LogListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LogListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> LogListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LogListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. +/// +/// A builder for the *delete* method supported by a *log* resource. +/// It is not used directly, but through a `LogMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.logs().delete("logName") +/// .doit(); +/// # } +/// ``` +pub struct LogDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _log_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LogDeleteCall<'a, C, A> {} + +impl<'a, C, A> LogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.logs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("logName", self._log_name.to_string())); + for &field in ["alt", "logName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+logName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+logName}", "logName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["logName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + /// + /// Sets the *log name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn log_name(mut self, new_value: &str) -> LogDeleteCall<'a, C, A> { + self._log_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LogDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> LogDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LogDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders) /// /// A builder for the *write* method supported by a *entry* resource. @@ -12630,9 +16856,9 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau } -/// Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink. +/// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. /// -/// A builder for the *sinks.create* method supported by a *billingAccount* resource. +/// A builder for the *exclusions.create* method supported by a *billingAccount* resource. /// It is not used directly, but through a `BillingAccountMethods` instance. /// /// # Example @@ -12644,7 +16870,7 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_logging2 as logging2; -/// use logging2::LogSink; +/// use logging2::LogExclusion; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -12658,35 +16884,33 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau /// // 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 = LogSink::default(); +/// let mut req = LogExclusion::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.billing_accounts().sinks_create(req, "parent") -/// .unique_writer_identity(true) +/// let result = hub.billing_accounts().exclusions_create(req, "parent") /// .doit(); /// # } /// ``` -pub struct BillingAccountSinkCreateCall<'a, C, A> +pub struct BillingAccountExclusionCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogSink, + _request: LogExclusion, _parent: String, - _unique_writer_identity: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for BillingAccountSinkCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for BillingAccountExclusionCreateCall<'a, C, A> {} -impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> BillingAccountExclusionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -12695,14 +16919,11 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.create", + dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.create", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "parent", "uniqueWriterIdentity"].iter() { + for &field in ["alt", "parent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12714,7 +16935,7 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> { + pub fn request(mut self, new_value: LogExclusion) -> BillingAccountExclusionCreateCall<'a, C, A> { self._request = new_value; self } - /// Required. The resource in which to create the sink: + /// Required. The parent resource in which to create the exclusion: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" /// "billingAccounts/[BILLING_ACCOUNT_ID]" @@ -12852,24 +17073,17 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> BillingAccountExclusionCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> BillingAccountSinkCreateCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountSinkCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountExclusionCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12894,7 +17108,7 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountSinkCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -12914,7 +17128,7 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> BillingAccountSinkCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> BillingAccountExclusionCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -12926,9 +17140,9 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut +pub struct BillingAccountLocationBucketPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogExclusion, + _request: LogBucket, _name: String, _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, @@ -12976,13 +17190,13 @@ pub struct BillingAccountExclusionPatchCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for BillingAccountExclusionPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for BillingAccountLocationBucketPatchCall<'a, C, A> {} -impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> BillingAccountLocationBucketPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -12991,7 +17205,7 @@ impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.patch", + dlg.begin(MethodInfo { id: "logging.billingAccounts.locations.buckets.patch", http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -13133,29 +17347,29 @@ impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut BillingAccountExclusionPatchCall<'a, C, A> { + pub fn request(mut self, new_value: LogBucket) -> BillingAccountLocationBucketPatchCall<'a, C, A> { self._request = new_value; self } - /// Required. The resource name of the exclusion to update: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> BillingAccountLocationBucketPatchCall<'a, C, A> { self._name = new_value.to_string(); self } - /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. /// /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> BillingAccountLocationBucketPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } @@ -13165,7 +17379,7 @@ impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut BillingAccountExclusionPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountLocationBucketPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13190,7 +17404,7 @@ impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountExclusionPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> BillingAccountLocationBucketPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13210,7 +17424,7 @@ impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> BillingAccountExclusionPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> BillingAccountLocationBucketPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13222,9 +17436,9 @@ impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut +pub struct BillingAccountBucketGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for BillingAccountLogListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for BillingAccountBucketGetCall<'a, C, A> {} -impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> BillingAccountBucketGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListLogsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -13282,17 +17492,11 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.billingAccounts.logs.list", + dlg.begin(MethodInfo { id: "logging.billingAccounts.buckets.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13304,12 +17508,12 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -13407,33 +17611,19 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> BillingAccountLogListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> BillingAccountLogListCall<'a, C, A> { - self._page_size = Some(new_value); + pub fn name(mut self, new_value: &str) -> BillingAccountBucketGetCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -13442,7 +17632,7 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountBucketGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13467,7 +17657,7 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountLogListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> BillingAccountBucketGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13487,7 +17677,260 @@ impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> BillingAccountLogListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> BillingAccountBucketGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a sink. +/// +/// A builder for the *sinks.get* method supported by a *billingAccount* resource. +/// It is not used directly, but through a `BillingAccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.billing_accounts().sinks_get("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountSinkGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _sink_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountSinkGetCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> BillingAccountSinkGetCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountSinkGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountSinkGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BillingAccountSinkGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13780,8 +18223,8 @@ impl<'a, C, A> BillingAccountExclusionDeleteCall<'a, C, A> where C: BorrowMut BillingAccountExclusionListCall<'a, C, A> where C: BorrowMut BillingAccountSinkPatchCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.billing_accounts().sinks_list("parent") -/// .page_token("clita") -/// .page_size(-45) -/// .doit(); -/// # } -/// ``` -pub struct BillingAccountSinkListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for BillingAccountSinkListCall<'a, C, A> {} - -impl<'a, C, A> BillingAccountSinkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListSinksResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The parent resource whose sinks are to be listed: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> BillingAccountSinkListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> BillingAccountSinkListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> BillingAccountSinkListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountSinkListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> BillingAccountSinkListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> BillingAccountSinkListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. -/// -/// A builder for the *exclusions.create* method supported by a *billingAccount* resource. -/// It is not used directly, but through a `BillingAccountMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogExclusion; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogExclusion::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.billing_accounts().exclusions_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct BillingAccountExclusionCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogExclusion, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for BillingAccountExclusionCreateCall<'a, C, A> {} - -impl<'a, C, A> BillingAccountExclusionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogExclusion) -> BillingAccountExclusionCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The parent resource in which to create the exclusion: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> BillingAccountExclusionCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountExclusionCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> BillingAccountExclusionCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. /// /// A builder for the *sinks.delete* method supported by a *billingAccount* resource. @@ -15188,8 +19070,8 @@ impl<'a, C, A> BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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.billing_accounts().sinks_create(req, "parent") +/// .unique_writer_identity(false) +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountSinkCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _parent: String, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountSinkCreateCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "parent", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> BillingAccountSinkCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource in which to create the sink: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> BillingAccountSinkCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> BillingAccountSinkCreateCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountSinkCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountSinkCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BillingAccountSinkCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Changes one or more properties of an existing exclusion. +/// +/// A builder for the *exclusions.patch* method supported by a *billingAccount* resource. +/// It is not used directly, but through a `BillingAccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogExclusion::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.billing_accounts().exclusions_patch(req, "name") +/// .update_mask("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountExclusionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountExclusionPatchCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountExclusionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.exclusions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogExclusion) -> BillingAccountExclusionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> BillingAccountExclusionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountExclusionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountExclusionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BillingAccountExclusionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists buckets (Beta). +/// +/// A builder for the *locations.buckets.list* method supported by a *billingAccount* resource. /// It is not used directly, but through a `BillingAccountMethods` instance. /// /// # Example @@ -15492,27 +19966,31 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut +pub struct BillingAccountLocationBucketListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _sink_name: String, + _parent: String, + _page_token: Option, + _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for BillingAccountSinkGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for BillingAccountLocationBucketListCall<'a, C, A> {} -impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> BillingAccountLocationBucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBucketsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -15521,11 +19999,17 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.get", + dlg.begin(MethodInfo { id: "logging.billingAccounts.locations.buckets.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15537,12 +20021,12 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -15640,19 +20124,33 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> { - self._sink_name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> BillingAccountLocationBucketListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> BillingAccountLocationBucketListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> BillingAccountLocationBucketListCall<'a, C, A> { + self._page_size = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -15661,7 +20159,7 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountLocationBucketListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -15686,7 +20184,7 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BillingAccountSinkGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> BillingAccountLocationBucketListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -15706,7 +20204,7 @@ impl<'a, C, A> BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> BillingAccountSinkGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> BillingAccountLocationBucketListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -15971,7 +20469,561 @@ impl<'a, C, A> BillingAccountExclusionGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.billing_accounts().logs_list("parent") +/// .page_token("justo") +/// .page_size(-6) +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountLogListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountLogListCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountLogListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLogsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.logs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name that owns the logs: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> BillingAccountLogListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> BillingAccountLogListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> BillingAccountLogListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountLogListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountLogListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BillingAccountLogListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists sinks. +/// +/// A builder for the *sinks.list* method supported by a *billingAccount* resource. +/// It is not used directly, but through a `BillingAccountMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.billing_accounts().sinks_list("parent") +/// .page_token("accusam") +/// .page_size(-13) +/// .doit(); +/// # } +/// ``` +pub struct BillingAccountSinkListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BillingAccountSinkListCall<'a, C, A> {} + +impl<'a, C, A> BillingAccountSinkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListSinksResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.billingAccounts.sinks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> BillingAccountSinkListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> BillingAccountSinkListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> BillingAccountSinkListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> BillingAccountSinkListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> BillingAccountSinkListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BillingAccountSinkListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. /// /// A builder for the *logs.delete* method supported by a *billingAccount* resource. /// It is not used directly, but through a `BillingAccountMethods` instance. @@ -16224,6 +21276,259 @@ impl<'a, C, A> BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.exclusions().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ExclusionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ExclusionDeleteCall<'a, C, A> {} + +impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.exclusions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of an existing exclusion to delete: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ExclusionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExclusionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ExclusionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExclusionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Changes one or more properties of an existing exclusion. /// /// A builder for the *patch* method supported by a *exclusion* resource. @@ -16258,7 +21563,7 @@ impl<'a, C, A> BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut ExclusionPatchCall<'a, C, A> where C: BorrowMut, A self._name = new_value.to_string(); self } - /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> ExclusionPatchCall<'a, C, A> { @@ -16520,6 +21825,536 @@ impl<'a, C, A> ExclusionPatchCall<'a, C, A> where C: BorrowMut, A } +/// Gets the description of an exclusion. +/// +/// A builder for the *get* method supported by a *exclusion* resource. +/// It is not used directly, but through a `ExclusionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.exclusions().get("name") +/// .doit(); +/// # } +/// ``` +pub struct ExclusionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ExclusionGetCall<'a, C, A> {} + +impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.exclusions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ExclusionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExclusionGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ExclusionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExclusionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the exclusions in a parent resource. +/// +/// A builder for the *list* method supported by a *exclusion* resource. +/// It is not used directly, but through a `ExclusionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.exclusions().list("parent") +/// .page_token("dolores") +/// .page_size(-24) +/// .doit(); +/// # } +/// ``` +pub struct ExclusionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ExclusionListCall<'a, C, A> {} + +impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListExclusionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.exclusions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource whose exclusions are to be listed. + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ExclusionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ExclusionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ExclusionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExclusionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ExclusionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ExclusionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. /// /// A builder for the *create* method supported by a *exclusion* resource. @@ -16804,10 +22639,10 @@ impl<'a, C, A> ExclusionCreateCall<'a, C, A> where C: BorrowMut, } -/// Lists all the exclusions in a parent resource. +/// Creates a logs-based metric. /// -/// A builder for the *list* method supported by a *exclusion* resource. -/// It is not used directly, but through a `ExclusionMethods` instance. +/// A builder for the *metrics.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example /// @@ -16818,6 +22653,7 @@ impl<'a, C, A> ExclusionCreateCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_logging2 as logging2; +/// use logging2::LogMetric; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -16828,34 +22664,36 @@ impl<'a, C, A> ExclusionCreateCall<'a, C, A> where C: BorrowMut, /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogMetric::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.exclusions().list("parent") -/// .page_token("nonumy") -/// .page_size(-29) +/// let result = hub.projects().metrics_create(req, "parent") /// .doit(); /// # } /// ``` -pub struct ExclusionListCall<'a, C, A> +pub struct ProjectMetricCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, + _request: LogMetric, _parent: String, - _page_token: Option, - _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ExclusionListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectMetricCreateCall<'a, C, A> {} -impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListExclusionsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogMetric)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -16864,17 +22702,11 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.exclusions.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "logging.projects.metrics.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + for &field in ["alt", "parent"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16886,7 +22718,7 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/metrics"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -16918,6 +22750,17 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -16934,11 +22777,15 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -16989,42 +22836,34 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: } - /// Required. The parent resource whose exclusions are to be listed. + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogMetric) -> ProjectMetricCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the project in which to create the metric: /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// + /// The new metric must be provided in the request. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ExclusionListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectMetricCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ExclusionListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ExclusionListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExclusionListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectMetricCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -17049,7 +22888,7 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ExclusionListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectMetricCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -17069,7 +22908,7 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ExclusionListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectMetricCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -17081,10 +22920,10 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: } -/// Gets the description of an exclusion. +/// Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta. /// -/// A builder for the *get* method supported by a *exclusion* resource. -/// It is not used directly, but through a `ExclusionMethods` instance. +/// A builder for the *locations.buckets.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example /// @@ -17095,6 +22934,7 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_logging2 as logging2; +/// use logging2::LogBucket; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -17105,30 +22945,38 @@ impl<'a, C, A> ExclusionListCall<'a, C, A> where C: BorrowMut, A: /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogBucket::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.exclusions().get("name") +/// let result = hub.projects().locations_buckets_patch(req, "name") +/// .update_mask("aliquyam") /// .doit(); /// # } /// ``` -pub struct ExclusionGetCall<'a, C, A> +pub struct ProjectLocationBucketPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, + _request: LogBucket, _name: String, + _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ExclusionGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationBucketPatchCall<'a, C, A> {} -impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationBucketPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -17137,11 +22985,14 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.exclusions.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "logging.projects.locations.buckets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17185,6 +23036,17 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -17201,11 +23063,15 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -17256,28 +23122,44 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: } - /// Required. The resource name of an existing exclusion: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogBucket) -> ProjectLocationBucketPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the bucket to update. + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". Also requires permission "resourcemanager.projects.updateLiens" to set the locked property /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ExclusionGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationBucketPatchCall<'a, C, A> { self._name = new_value.to_string(); self } + /// Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=retention_days. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationBucketPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExclusionGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationBucketPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -17302,7 +23184,7 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ExclusionGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationBucketPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -17322,7 +23204,7 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ExclusionGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationBucketPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -17334,10 +23216,10 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes an exclusion. +/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. /// -/// A builder for the *delete* method supported by a *exclusion* resource. -/// It is not used directly, but through a `ExclusionMethods` instance. +/// A builder for the *sinks.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example /// @@ -17361,23 +23243,23 @@ impl<'a, C, A> ExclusionGetCall<'a, C, A> where C: BorrowMut, A: /// // 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.exclusions().delete("name") +/// let result = hub.projects().sinks_delete("sinkName") /// .doit(); /// # } /// ``` -pub struct ExclusionDeleteCall<'a, C, A> +pub struct ProjectSinkDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _name: String, + _sink_name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ExclusionDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectSinkDeleteCall<'a, C, A> {} -impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -17390,11 +23272,11 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.exclusions.delete", + dlg.begin(MethodInfo { id: "logging.projects.sinks.delete", http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17406,12 +23288,12 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+name}"; + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+name}", "name")].iter() { + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -17426,7 +23308,7 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["sinkName"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -17509,19 +23391,19 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, } - /// Required. The resource name of an existing exclusion to delete: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". /// - /// Sets the *name* path property to the given value. + /// Sets the *sink name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ExclusionDeleteCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn sink_name(mut self, new_value: &str) -> ProjectSinkDeleteCall<'a, C, A> { + self._sink_name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -17530,7 +23412,7 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ExclusionDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -17555,7 +23437,7 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ExclusionDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectSinkDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -17575,7 +23457,7 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ExclusionDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectSinkDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -17615,8 +23497,8 @@ impl<'a, C, A> ExclusionDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().exclusions_list("parent") -/// .page_token("consetetur") -/// .page_size(-85) +/// .page_token("et") +/// .page_size(-48) /// .doit(); /// # } /// ``` @@ -17864,1408 +23746,6 @@ impl<'a, C, A> ProjectExclusionListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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().sinks_update(req, "sinkName") -/// .update_mask("ea") -/// .unique_writer_identity(false) -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogSink, - _sink_name: String, - _update_mask: Option, - _unique_writer_identity: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkUpdateCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogSink) -> ProjectSinkUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is set to false or defaulted to false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkUpdateCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectSinkUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectSinkUpdateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a logs-based metric. -/// -/// A builder for the *metrics.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().metrics_get("metricName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectMetricGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _metric_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectMetricGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogMetric)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.metrics.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("metricName", self._metric_name.to_string())); - for &field in ["alt", "metricName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+metricName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+metricName}", "metricName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["metricName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The resource name of the desired metric: - /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - /// - /// - /// Sets the *metric name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn metric_name(mut self, new_value: &str) -> ProjectMetricGetCall<'a, C, A> { - self._metric_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectMetricGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectMetricGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectMetricGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. -/// -/// A builder for the *sinks.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogSink; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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().sinks_patch(req, "sinkName") -/// .update_mask("tempor") -/// .unique_writer_identity(false) -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogSink, - _sink_name: String, - _update_mask: Option, - _unique_writer_identity: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - if let Some(value) = self._unique_writer_identity { - params.push(("uniqueWriterIdentity", value.to_string())); - } - for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogSink) -> ProjectSinkPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> ProjectSinkPatchCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectSinkPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: - /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. - /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. - /// It is an error if the old value is true and the new value is set to false or defaulted to false. - /// - /// Sets the *unique writer identity* query property to the given value. - pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkPatchCall<'a, C, A> { - self._unique_writer_identity = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectSinkPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectSinkPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. -/// -/// A builder for the *logs.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().logs_list("parent") -/// .page_token("ipsum") -/// .page_size(-31) -/// .doit(); -/// # } -/// ``` -pub struct ProjectLogListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLogListCall<'a, C, A> {} - -impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListLogsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.logs.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name that owns the logs: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectLogListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLogListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLogListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLogListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLogListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLogListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. -/// -/// A builder for the *logs.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().logs_delete("logName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLogDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _log_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLogDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.logs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("logName", self._log_name.to_string())); - for &field in ["alt", "logName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+logName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+logName}", "logName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["logName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - /// - /// Sets the *log name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn log_name(mut self, new_value: &str) -> ProjectLogDeleteCall<'a, C, A> { - self._log_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLogDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLogDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLogDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists sinks. /// /// A builder for the *sinks.list* method supported by a *project* resource. @@ -19294,8 +23774,8 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().sinks_list("parent") -/// .page_token("diam") -/// .page_size(-37) +/// .page_token("kasd") +/// .page_size(-87) /// .doit(); /// # } /// ``` @@ -19796,9 +24276,9 @@ impl<'a, C, A> ProjectExclusionDeleteCall<'a, C, A> where C: BorrowMut ProjectExclusionDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().exclusions_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectExclusionGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectExclusionGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectExclusionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.exclusions.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of an existing exclusion: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectExclusionGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExclusionGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectExclusionGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectExclusionGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a sink. -/// -/// A builder for the *sinks.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().sinks_get("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of the sink: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> ProjectSinkGetCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectSinkGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectSinkGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted. -/// -/// A builder for the *sinks.delete* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().sinks_delete("sinkName") -/// .doit(); -/// # } -/// ``` -pub struct ProjectSinkDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _sink_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectSinkDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("sinkName", self._sink_name.to_string())); - for &field in ["alt", "sinkName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["sinkName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: - /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" - /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" - /// Example: "projects/my-project-id/sinks/my-sink-id". - /// - /// Sets the *sink name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn sink_name(mut self, new_value: &str) -> ProjectSinkDeleteCall<'a, C, A> { - self._sink_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectSinkDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectSinkDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Creates a logs-based metric. -/// -/// A builder for the *metrics.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogMetric; +/// use logging2::LogExclusion; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -20583,33 +24304,33 @@ impl<'a, C, A> ProjectSinkDeleteCall<'a, C, A> where C: BorrowMut /// // 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 = LogMetric::default(); +/// let mut req = LogExclusion::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().metrics_create(req, "parent") +/// let result = hub.projects().exclusions_create(req, "parent") /// .doit(); /// # } /// ``` -pub struct ProjectMetricCreateCall<'a, C, A> +pub struct ProjectExclusionCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _request: LogMetric, + _request: LogExclusion, _parent: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectMetricCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectExclusionCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectExclusionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogMetric)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -20618,7 +24339,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.projects.metrics.create", + dlg.begin(MethodInfo { id: "logging.projects.exclusions.create", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -20634,7 +24355,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricCreateCall<'a, C, A> { + pub fn request(mut self, new_value: LogExclusion) -> ProjectExclusionCreateCall<'a, C, A> { self._request = new_value; self } - /// The resource name of the project in which to create the metric: + /// Required. The parent resource in which to create the exclusion: /// "projects/[PROJECT_ID]" - /// The new metric must be provided in the request. + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// Examples: "projects/my-logging-project", "organizations/123456789". /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectMetricCreateCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectExclusionCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } @@ -20779,7 +24503,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExclusionCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -20804,7 +24528,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectExclusionCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -20824,7 +24548,260 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectMetricCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectExclusionCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a bucket (Beta). +/// +/// A builder for the *locations.buckets.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_buckets_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationBucketGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationBucketGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationBucketGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogBucket)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.locations.buckets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the bucket: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + /// Example: "projects/my-project-id/locations/my-location/buckets/my-bucket-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationBucketGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationBucketGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationBucketGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationBucketGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -21132,586 +25109,6 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut } -/// Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. -/// -/// A builder for the *exclusions.create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogExclusion; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogExclusion::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().exclusions_create(req, "parent") -/// .doit(); -/// # } -/// ``` -pub struct ProjectExclusionCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogExclusion, - _parent: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectExclusionCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectExclusionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.exclusions.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - for &field in ["alt", "parent"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+parent}/exclusions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogExclusion) -> ProjectExclusionCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The parent resource in which to create the exclusion: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// Examples: "projects/my-logging-project", "organizations/123456789". - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectExclusionCreateCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExclusionCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectExclusionCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectExclusionCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Changes one or more properties of an existing exclusion. -/// -/// A builder for the *exclusions.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// use logging2::LogExclusion; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogExclusion::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().exclusions_patch(req, "name") -/// .update_mask("invidunt") -/// .doit(); -/// # } -/// ``` -pub struct ProjectExclusionPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _request: LogExclusion, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectExclusionPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.projects.exclusions.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: LogExclusion) -> ProjectExclusionPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The resource name of the exclusion to update: - /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" - /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" - /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - /// Example: "projects/my-project-id/exclusions/my-exclusion-id". - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectExclusionPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectExclusionPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExclusionPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectExclusionPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectExclusionPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates or updates a logs-based metric. /// /// A builder for the *metrics.update* method supported by a *project* resource. @@ -21918,7 +25315,7 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().metrics_get("metricName") +/// .doit(); +/// # } +/// ``` +pub struct ProjectMetricGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _metric_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectMetricGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogMetric)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.metrics.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("metricName", self._metric_name.to_string())); + for &field in ["alt", "metricName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+metricName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+metricName}", "metricName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["metricName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the desired metric: + /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + /// + /// + /// Sets the *metric name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn metric_name(mut self, new_value: &str) -> ProjectMetricGetCall<'a, C, A> { + self._metric_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectMetricGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectMetricGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectMetricGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a sink. +/// +/// A builder for the *sinks.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().sinks_get("sinkName") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _sink_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + for &field in ["alt", "sinkName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the sink: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> ProjectSinkGetCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSinkGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.update* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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().sinks_update(req, "sinkName") +/// .update_mask("takimata") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkUpdateCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> ProjectSinkUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectSinkUpdateCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkUpdateCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSinkUpdateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the description of an exclusion. +/// +/// A builder for the *exclusions.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().exclusions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExclusionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExclusionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectExclusionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.exclusions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of an existing exclusion: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectExclusionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExclusionGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExclusionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectExclusionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted. +/// +/// A builder for the *logs.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().logs_delete("logName") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLogDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _log_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLogDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.logs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("logName", self._log_name.to_string())); + for &field in ["alt", "logName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+logName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+logName}", "logName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["logName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the log to delete: + /// "projects/[PROJECT_ID]/logs/[LOG_ID]" + /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + /// "folders/[FOLDER_ID]/logs/[LOG_ID]" + /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + /// + /// Sets the *log name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn log_name(mut self, new_value: &str) -> ProjectLogDeleteCall<'a, C, A> { + self._log_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLogDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLogDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLogDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field. +/// +/// A builder for the *sinks.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogSink; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogSink::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().sinks_patch(req, "sinkName") +/// .update_mask("Lorem") +/// .unique_writer_identity(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogSink, + _sink_name: String, + _update_mask: Option, + _unique_writer_identity: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogSink)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("sinkName", self._sink_name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._unique_writer_identity { + params.push(("uniqueWriterIdentity", value.to_string())); + } + for &field in ["alt", "sinkName", "updateMask", "uniqueWriterIdentity"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+sinkName}", "sinkName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["sinkName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogSink) -> ProjectSinkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The full resource name of the sink to update, including the parent resource and the sink identifier: + /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" + /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". + /// + /// Sets the *sink name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn sink_name(mut self, new_value: &str) -> ProjectSinkPatchCall<'a, C, A> { + self._sink_name = new_value.to_string(); + self + } + /// Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectSinkPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: + /// If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is set to false or defaulted to false. + /// + /// Sets the *unique writer identity* query property to the given value. + pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkPatchCall<'a, C, A> { + self._unique_writer_identity = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectSinkPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSinkPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSinkPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. +/// +/// A builder for the *logs.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().logs_list("parent") +/// .page_token("ut") +/// .page_size(-51) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLogListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLogListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLogsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.logs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name that owns the logs: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLogListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLogListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLogListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLogListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLogListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLogListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists logs-based metrics. /// /// A builder for the *metrics.list* method supported by a *project* resource. @@ -22271,8 +27576,8 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricListCall<'a, C, A> where C: BorrowMut } -/// Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. +/// Lists buckets (Beta). /// -/// A builder for the *delete* method supported by a *log* resource. -/// It is not used directly, but through a `LogMethods` instance. +/// A builder for the *locations.buckets.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example /// @@ -22544,266 +27849,13 @@ impl<'a, C, A> ProjectMetricListCall<'a, C, A> where C: BorrowMut /// // 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.logs().delete("logName") +/// let result = hub.projects().locations_buckets_list("parent") +/// .page_token("ut") +/// .page_size(-39) /// .doit(); /// # } /// ``` -pub struct LogDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Logging, - _log_name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for LogDeleteCall<'a, C, A> {} - -impl<'a, C, A> LogDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "logging.logs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("logName", self._log_name.to_string())); - for &field in ["alt", "logName"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v2/{+logName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+logName}", "logName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["logName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - /// "folders/[FOLDER_ID]/logs/[LOG_ID]" - /// [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - /// - /// Sets the *log name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn log_name(mut self, new_value: &str) -> LogDeleteCall<'a, C, A> { - self._log_name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LogDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> LogDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LogDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. -/// -/// A builder for the *list* method supported by a *log* resource. -/// It is not used directly, but through a `LogMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_logging2 as logging2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use logging2::Logging; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.logs().list("parent") -/// .page_token("ea") -/// .page_size(-17) -/// .doit(); -/// # } -/// ``` -pub struct LogListCall<'a, C, A> +pub struct ProjectLocationBucketListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, @@ -22815,13 +27867,13 @@ pub struct LogListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for LogListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationBucketListCall<'a, C, A> {} -impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationBucketListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListLogsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBucketsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -22830,7 +27882,7 @@ impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.logs.list", + dlg.begin(MethodInfo { id: "logging.projects.locations.buckets.list", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); @@ -22852,7 +27904,7 @@ impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; + let mut url = self.hub._base_url.clone() + "v2/{+parent}/buckets"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -22955,32 +28007,32 @@ impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth } - /// Required. The resource name that owns the logs: - /// "projects/[PROJECT_ID]" - /// "organizations/[ORGANIZATION_ID]" - /// "billingAccounts/[BILLING_ACCOUNT_ID]" - /// "folders/[FOLDER_ID]" - /// + /// Required. The parent resource whose buckets are to be listed: + /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + /// Note: The locations portion of the resource must be specified, but supplying the character - in place of LOCATION_ID will return all buckets. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> LogListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationBucketListCall<'a, C, A> { self._parent = new_value.to_string(); self } /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> LogListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> ProjectLocationBucketListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. /// /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> LogListCall<'a, C, A> { + pub fn page_size(mut self, new_value: i32) -> ProjectLocationBucketListCall<'a, C, A> { self._page_size = Some(new_value); self } @@ -22990,7 +28042,7 @@ impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LogListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationBucketListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -23015,7 +28067,7 @@ impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> LogListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationBucketListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -23035,7 +28087,852 @@ impl<'a, C, A> LogListCall<'a, C, A> where C: BorrowMut, A: oauth /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LogListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationBucketListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Changes one or more properties of an existing exclusion. +/// +/// A builder for the *exclusions.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::LogExclusion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = LogExclusion::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().exclusions_patch(req, "name") +/// .update_mask("voluptua.") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExclusionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: LogExclusion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExclusionPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectExclusionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LogExclusion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.exclusions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: LogExclusion) -> ProjectExclusionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the exclusion to update: + /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + /// Example: "projects/my-project-id/exclusions/my-exclusion-id". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectExclusionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectExclusionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExclusionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExclusionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectExclusionPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.See Enabling CMEK for Logs Router for more information. +/// +/// A builder for the *getCmekSettings* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.methods().get_cmek_settings("name") +/// .doit(); +/// # } +/// ``` +pub struct MethodGetCmekSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MethodGetCmekSettingCall<'a, C, A> {} + +impl<'a, C, A> MethodGetCmekSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CmekSettings)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.getCmekSettings", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}/cmekSettings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource for which to retrieve CMEK settings. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> MethodGetCmekSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MethodGetCmekSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodGetCmekSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MethodGetCmekSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.See Enabling CMEK for Logs Router for more information. +/// +/// A builder for the *updateCmekSettings* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_logging2 as logging2; +/// use logging2::CmekSettings; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use logging2::Logging; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = CmekSettings::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.methods().update_cmek_settings(req, "name") +/// .update_mask("et") +/// .doit(); +/// # } +/// ``` +pub struct MethodUpdateCmekSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _request: CmekSettings, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MethodUpdateCmekSettingCall<'a, C, A> {} + +impl<'a, C, A> MethodUpdateCmekSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CmekSettings)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.updateCmekSettings", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v2/{+name}/cmekSettings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CmekSettings) -> MethodUpdateCmekSettingCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name for the CMEK settings to update. + /// "projects/[PROJECT_ID]/cmekSettings" + /// "organizations/[ORGANIZATION_ID]/cmekSettings" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + /// "folders/[FOLDER_ID]/cmekSettings" + /// Example: "organizations/12345/cmekSettings".Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> MethodUpdateCmekSettingCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.See FieldMask for more information.Example: "updateMask=kmsKeyName" + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> MethodUpdateCmekSettingCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MethodUpdateCmekSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> MethodUpdateCmekSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MethodUpdateCmekSettingCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/logging2_beta1-cli/Cargo.toml b/gen/logging2_beta1-cli/Cargo.toml index c83dc360aa..ceb3e92eea 100644 --- a/gen/logging2_beta1-cli/Cargo.toml +++ b/gen/logging2_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-logging2_beta1-cli" -version = "1.0.12+20190325" +version = "1.0.13+20190325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Logging (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-logging2_beta1] path = "../logging2_beta1" -version = "1.0.12+20190325" +version = "1.0.13+20190325" diff --git a/gen/logging2_beta1-cli/README.md b/gen/logging2_beta1-cli/README.md index 4d260ac32d..8b5f08c713 100644 --- a/gen/logging2_beta1-cli/README.md +++ b/gen/logging2_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Logging* API at revision *20190325*. The CLI is at version *1.0.12*. +This documentation was generated from the *Logging* API at revision *20190325*. The CLI is at version *1.0.13*. ```bash logging2-beta1 [options] diff --git a/gen/logging2_beta1-cli/mkdocs.yml b/gen/logging2_beta1-cli/mkdocs.yml index 5bd6dc2d24..6b788ef54a 100644 --- a/gen/logging2_beta1-cli/mkdocs.yml +++ b/gen/logging2_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Logging v1.0.12+20190325 +site_name: Logging v1.0.13+20190325 site_url: http://byron.github.io/google-apis-rs/google-logging2_beta1-cli site_description: A complete library to interact with Logging (protocol v2beta1) diff --git a/gen/logging2_beta1-cli/src/main.rs b/gen/logging2_beta1-cli/src/main.rs index c7c714fe02..f0fe01db4d 100644 --- a/gen/logging2_beta1-cli/src/main.rs +++ b/gen/logging2_beta1-cli/src/main.rs @@ -1529,7 +1529,7 @@ fn main() { let mut app = App::new("logging2-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190325") + .version("1.0.13+20190325") .about("Writes log entries and manages your Logging configuration.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_logging2_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/logging2_beta1/Cargo.toml b/gen/logging2_beta1/Cargo.toml index c08d5b7ca1..26ccee5de6 100644 --- a/gen/logging2_beta1/Cargo.toml +++ b/gen/logging2_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-logging2_beta1" -version = "1.0.12+20190325" +version = "1.0.13+20190325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Logging (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2_beta1" homepage = "https://cloud.google.com/logging/docs/" -documentation = "https://docs.rs/google-logging2_beta1/1.0.12+20190325" +documentation = "https://docs.rs/google-logging2_beta1/1.0.13+20190325" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/logging2_beta1/README.md b/gen/logging2_beta1/README.md index 5d427da12b..d31332657d 100644 --- a/gen/logging2_beta1/README.md +++ b/gen/logging2_beta1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-logging2_beta1` library allows access to all features of the *Google Logging* service. -This documentation was generated from *Logging* crate version *1.0.12+20190325*, where *20190325* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Logging* crate version *1.0.13+20190325*, where *20190325* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Logging* *v2_beta1* API can be found at the [official documentation site](https://cloud.google.com/logging/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.Logging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.Logging.html) ... * entries - * [*list*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.EntryWriteCall.html) -* [monitored resource descriptors](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.MonitoredResourceDescriptor.html) - * [*list*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.MonitoredResourceDescriptorListCall.html) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.EntryWriteCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.MonitoredResourceDescriptorListCall.html) * projects - * [*metrics create*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.ProjectSinkUpdateCall.html) + * [*metrics create*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.ProjectSinkUpdateCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/struct.Logging.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-logging2_beta1/1.0.12+20190325/google_logging2_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2_beta1/1.0.13+20190325/google_logging2_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/logging2_beta1/src/lib.rs b/gen/logging2_beta1/src/lib.rs index 7c22c15d49..6fcdc05a35 100644 --- a/gen/logging2_beta1/src/lib.rs +++ b/gen/logging2_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Logging* crate version *1.0.12+20190325*, where *20190325* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Logging* crate version *1.0.13+20190325*, where *20190325* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Logging* *v2_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/logging/docs/). @@ -351,7 +351,7 @@ impl<'a, C, A> Logging Logging { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://logging.googleapis.com/".to_string(), _root_url: "https://logging.googleapis.com/".to_string(), } @@ -368,7 +368,7 @@ impl<'a, C, A> Logging } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/manager1_beta2-cli/Cargo.toml b/gen/manager1_beta2-cli/Cargo.toml index 55e858985d..a66502d0b1 100644 --- a/gen/manager1_beta2-cli/Cargo.toml +++ b/gen/manager1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-manager1_beta2-cli" -version = "1.0.12+20140915" +version = "1.0.13+20140915" authors = ["Sebastian Thiel "] description = "A complete library to interact with manager (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manager1_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-manager1_beta2] path = "../manager1_beta2" -version = "1.0.12+20140915" +version = "1.0.13+20140915" diff --git a/gen/manager1_beta2-cli/README.md b/gen/manager1_beta2-cli/README.md index 7fffdb3089..3223b7e550 100644 --- a/gen/manager1_beta2-cli/README.md +++ b/gen/manager1_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *manager* API at revision *20140915*. The CLI is at version *1.0.12*. +This documentation was generated from the *manager* API at revision *20140915*. The CLI is at version *1.0.13*. ```bash manager1-beta2 [options] diff --git a/gen/manager1_beta2-cli/mkdocs.yml b/gen/manager1_beta2-cli/mkdocs.yml index ec9e14affc..2e4de4119e 100644 --- a/gen/manager1_beta2-cli/mkdocs.yml +++ b/gen/manager1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: manager v1.0.12+20140915 +site_name: manager v1.0.13+20140915 site_url: http://byron.github.io/google-apis-rs/google-manager1_beta2-cli site_description: A complete library to interact with manager (protocol v1beta2) diff --git a/gen/manager1_beta2-cli/src/main.rs b/gen/manager1_beta2-cli/src/main.rs index 2478039ff5..612953bb3b 100644 --- a/gen/manager1_beta2-cli/src/main.rs +++ b/gen/manager1_beta2-cli/src/main.rs @@ -893,7 +893,7 @@ fn main() { let mut app = App::new("manager1-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20140915") + .version("1.0.13+20140915") .about("The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_manager1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/manager1_beta2/Cargo.toml b/gen/manager1_beta2/Cargo.toml index e613bfe98b..d8984721a9 100644 --- a/gen/manager1_beta2/Cargo.toml +++ b/gen/manager1_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-manager1_beta2" -version = "1.0.12+20140915" +version = "1.0.13+20140915" authors = ["Sebastian Thiel "] description = "A complete library to interact with manager (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manager1_beta2" homepage = "https://developers.google.com/deployment-manager/" -documentation = "https://docs.rs/google-manager1_beta2/1.0.12+20140915" +documentation = "https://docs.rs/google-manager1_beta2/1.0.13+20140915" license = "MIT" keywords = ["manager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/manager1_beta2/README.md b/gen/manager1_beta2/README.md index 77a8038b28..d3887d5882 100644 --- a/gen/manager1_beta2/README.md +++ b/gen/manager1_beta2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-manager1_beta2` library allows access to all features of the *Google manager* service. -This documentation was generated from *manager* crate version *1.0.12+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *manager* crate version *1.0.13+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *manager* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/deployment-manager/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.Manager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.Manager.html) ... -* [deployments](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.Deployment.html) - * [*delete*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.DeploymentGetCall.html), [*insert*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.DeploymentInsertCall.html) and [*list*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.DeploymentListCall.html) -* [templates](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.Template.html) - * [*delete*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.TemplateInsertCall.html) and [*list*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.TemplateListCall.html) +* [deployments](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.Deployment.html) + * [*delete*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.DeploymentGetCall.html), [*insert*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.DeploymentInsertCall.html) and [*list*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.DeploymentListCall.html) +* [templates](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.Template.html) + * [*delete*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.TemplateInsertCall.html) and [*list*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.TemplateListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/struct.Manager.html)** +* **[Hub](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/struct.Manager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-manager1_beta2/1.0.12+20140915/google_manager1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-manager1_beta2/1.0.13+20140915/google_manager1_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/manager1_beta2/src/lib.rs b/gen/manager1_beta2/src/lib.rs index db514427d9..bd7ea5df2c 100644 --- a/gen/manager1_beta2/src/lib.rs +++ b/gen/manager1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *manager* crate version *1.0.12+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *manager* crate version *1.0.13+20140915*, where *20140915* is the exact revision of the *manager:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *manager* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/deployment-manager/). @@ -350,7 +350,7 @@ impl<'a, C, A> Manager Manager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/manager/v1beta2/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -364,7 +364,7 @@ impl<'a, C, A> Manager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/manufacturers1-cli/Cargo.toml b/gen/manufacturers1-cli/Cargo.toml index a868eb3bb1..9f4737d316 100644 --- a/gen/manufacturers1-cli/Cargo.toml +++ b/gen/manufacturers1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-manufacturers1-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200317" authors = ["Sebastian Thiel "] description = "A complete library to interact with Manufacturer Center (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manufacturers1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-manufacturers1] path = "../manufacturers1" -version = "1.0.12+20190627" +version = "1.0.13+20200317" diff --git a/gen/manufacturers1-cli/README.md b/gen/manufacturers1-cli/README.md index ea3f14c362..4a889df151 100644 --- a/gen/manufacturers1-cli/README.md +++ b/gen/manufacturers1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Manufacturer Center* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Manufacturer Center* API at revision *20200317*. The CLI is at version *1.0.13*. ```bash manufacturers1 [options] diff --git a/gen/manufacturers1-cli/mkdocs.yml b/gen/manufacturers1-cli/mkdocs.yml index d381f6d2c0..80c00a15e1 100644 --- a/gen/manufacturers1-cli/mkdocs.yml +++ b/gen/manufacturers1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Manufacturer Center v1.0.12+20190627 +site_name: Manufacturer Center v1.0.13+20200317 site_url: http://byron.github.io/google-apis-rs/google-manufacturers1-cli site_description: A complete library to interact with Manufacturer Center (protocol v1) diff --git a/gen/manufacturers1-cli/src/main.rs b/gen/manufacturers1-cli/src/main.rs index b816ffb869..bad68bb04d 100644 --- a/gen/manufacturers1-cli/src/main.rs +++ b/gen/manufacturers1-cli/src/main.rs @@ -253,6 +253,7 @@ impl<'n> Engine<'n> { "capacity.unit" => Some(("capacity.unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "pattern" => Some(("pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rich-product-content" => Some(("richProductContent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "disclosure-date" => Some(("disclosureDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "theme" => Some(("theme", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suggested-retail-price.currency" => Some(("suggestedRetailPrice.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -277,7 +278,7 @@ impl<'n> Engine<'n> { "video-link" => Some(("videoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "age-group" => Some(("ageGroup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["age-group", "amount", "brand", "capacity", "color", "count", "currency", "description", "disclosure-date", "excluded-destination", "flavor", "format", "gender", "gtin", "image-link", "image-url", "included-destination", "item-group-id", "material", "mpn", "pattern", "product-line", "product-name", "product-page-url", "product-type", "release-date", "scent", "size", "size-system", "size-type", "status", "suggested-retail-price", "target-client-id", "theme", "title", "type", "unit", "value", "video-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["age-group", "amount", "brand", "capacity", "color", "count", "currency", "description", "disclosure-date", "excluded-destination", "flavor", "format", "gender", "gtin", "image-link", "image-url", "included-destination", "item-group-id", "material", "mpn", "pattern", "product-line", "product-name", "product-page-url", "product-type", "release-date", "rich-product-content", "scent", "size", "size-system", "size-type", "status", "suggested-retail-price", "target-client-id", "theme", "title", "type", "unit", "value", "video-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -621,7 +622,7 @@ fn main() { let mut app = App::new("manufacturers1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200317") .about("Public API for managing Manufacturer Center related data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_manufacturers1_cli") .arg(Arg::with_name("url") diff --git a/gen/manufacturers1/Cargo.toml b/gen/manufacturers1/Cargo.toml index 8bbe48fd8a..439e8de2e1 100644 --- a/gen/manufacturers1/Cargo.toml +++ b/gen/manufacturers1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-manufacturers1" -version = "1.0.12+20190627" +version = "1.0.13+20200317" authors = ["Sebastian Thiel "] description = "A complete library to interact with Manufacturer Center (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/manufacturers1" homepage = "https://developers.google.com/manufacturers/" -documentation = "https://docs.rs/google-manufacturers1/1.0.12+20190627" +documentation = "https://docs.rs/google-manufacturers1/1.0.13+20200317" license = "MIT" keywords = ["manufacturers", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/manufacturers1/README.md b/gen/manufacturers1/README.md index d588cdc7f8..eb7bd7d5de 100644 --- a/gen/manufacturers1/README.md +++ b/gen/manufacturers1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-manufacturers1` library allows access to all features of the *Google Manufacturer Center* service. -This documentation was generated from *Manufacturer Center* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Manufacturer Center* crate version *1.0.13+20200317*, where *20200317* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Manufacturer Center* *v1* API can be found at the [official documentation site](https://developers.google.com/manufacturers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/struct.ManufacturerCenter.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/struct.ManufacturerCenter.html) ... * accounts - * [*products delete*](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/struct.AccountProductDeleteCall.html), [*products get*](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/struct.AccountProductGetCall.html), [*products list*](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/struct.AccountProductListCall.html) and [*products update*](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/struct.AccountProductUpdateCall.html) + * [*products delete*](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/struct.AccountProductDeleteCall.html), [*products get*](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/struct.AccountProductGetCall.html), [*products list*](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/struct.AccountProductListCall.html) and [*products update*](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/struct.AccountProductUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/struct.ManufacturerCenter.html)** +* **[Hub](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/struct.ManufacturerCenter.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.Part.html)** + * **[Parts](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -131,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -151,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-manufacturers1/1.0.12+20190627/google_manufacturers1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-manufacturers1/1.0.13+20200317/google_manufacturers1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/manufacturers1/src/lib.rs b/gen/manufacturers1/src/lib.rs index 350ee7ccd6..0625d9301d 100644 --- a/gen/manufacturers1/src/lib.rs +++ b/gen/manufacturers1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Manufacturer Center* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Manufacturer Center* crate version *1.0.13+20200317*, where *20200317* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Manufacturer Center* *v1* API can be found at the //! [official documentation site](https://developers.google.com/manufacturers/). @@ -330,7 +330,7 @@ impl<'a, C, A> ManufacturerCenter ManufacturerCenter { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://manufacturers.googleapis.com/".to_string(), _root_url: "https://manufacturers.googleapis.com/".to_string(), } @@ -341,7 +341,7 @@ impl<'a, C, A> ManufacturerCenter } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -609,6 +609,10 @@ pub struct Attributes { /// The pattern of the product. For more information, see /// https://support.google.com/manufacturers/answer/6124116#pattern. pub pattern: Option, + /// Rich product content. For more information, see + /// https://support.google.com/manufacturers/answer/9389865 + #[serde(rename="richProductContent")] + pub rich_product_content: Option>, /// The disclosure date of the product. For more information, see /// https://support.google.com/manufacturers/answer/6124116#disclosure. #[serde(rename="disclosureDate")] diff --git a/gen/mirror1-cli/Cargo.toml b/gen/mirror1-cli/Cargo.toml index 0150518bee..64594dda83 100644 --- a/gen/mirror1-cli/Cargo.toml +++ b/gen/mirror1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mirror1-cli" -version = "1.0.12+20190424" +version = "1.0.13+20190424" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-mirror1] path = "../mirror1" -version = "1.0.12+20190424" +version = "1.0.13+20190424" diff --git a/gen/mirror1-cli/README.md b/gen/mirror1-cli/README.md index dc7e59302d..ec8479a0c2 100644 --- a/gen/mirror1-cli/README.md +++ b/gen/mirror1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *mirror* API at revision *20190424*. The CLI is at version *1.0.12*. +This documentation was generated from the *mirror* API at revision *20190424*. The CLI is at version *1.0.13*. ```bash mirror1 [options] diff --git a/gen/mirror1-cli/mkdocs.yml b/gen/mirror1-cli/mkdocs.yml index cd4a45563d..2bde42ec7e 100644 --- a/gen/mirror1-cli/mkdocs.yml +++ b/gen/mirror1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: mirror v1.0.12+20190424 +site_name: mirror v1.0.13+20190424 site_url: http://byron.github.io/google-apis-rs/google-mirror1-cli site_description: A complete library to interact with mirror (protocol v1) diff --git a/gen/mirror1-cli/src/main.rs b/gen/mirror1-cli/src/main.rs index 4bcc99bf14..bb22a3690a 100644 --- a/gen/mirror1-cli/src/main.rs +++ b/gen/mirror1-cli/src/main.rs @@ -2564,7 +2564,7 @@ fn main() { let mut app = App::new("mirror1") .author("Sebastian Thiel ") - .version("1.0.12+20190424") + .version("1.0.13+20190424") .about("Interacts with Glass users via the timeline.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_mirror1_cli") .arg(Arg::with_name("url") diff --git a/gen/mirror1/Cargo.toml b/gen/mirror1/Cargo.toml index e7e799a48d..c6e93714a9 100644 --- a/gen/mirror1/Cargo.toml +++ b/gen/mirror1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-mirror1" -version = "1.0.12+20190424" +version = "1.0.13+20190424" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1" homepage = "https://developers.google.com/glass" -documentation = "https://docs.rs/google-mirror1/1.0.12+20190424" +documentation = "https://docs.rs/google-mirror1/1.0.13+20190424" license = "MIT" keywords = ["mirror", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/mirror1/README.md b/gen/mirror1/README.md index 072c03fe9c..e4a2a8c870 100644 --- a/gen/mirror1/README.md +++ b/gen/mirror1/README.md @@ -5,37 +5,37 @@ DO NOT EDIT ! --> The `google-mirror1` library allows access to all features of the *Google mirror* service. -This documentation was generated from *mirror* crate version *1.0.12+20190424*, where *20190424* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *mirror* crate version *1.0.13+20190424*, where *20190424* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *mirror* *v1* API can be found at the [official documentation site](https://developers.google.com/glass). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.Mirror.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.Mirror.html) ... -* [accounts](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.Account.html) - * [*insert*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.AccountInsertCall.html) -* [contacts](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.Contact.html) - * [*delete*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.ContactDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.ContactGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.ContactInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.ContactListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.ContactPatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.ContactUpdateCall.html) -* [locations](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.Location.html) - * [*get*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.LocationGetCall.html) and [*list*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.LocationListCall.html) -* [settings](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.Setting.html) - * [*get*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.SettingGetCall.html) -* [subscriptions](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.Subscription.html) - * [*delete*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.SubscriptionInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.SubscriptionListCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.SubscriptionUpdateCall.html) +* [accounts](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.Account.html) + * [*insert*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.AccountInsertCall.html) +* [contacts](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.Contact.html) + * [*delete*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.ContactDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.ContactGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.ContactInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.ContactListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.ContactPatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.ContactUpdateCall.html) +* [locations](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.Location.html) + * [*get*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.LocationGetCall.html) and [*list*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.LocationListCall.html) +* [settings](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.Setting.html) + * [*get*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.SettingGetCall.html) +* [subscriptions](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.Subscription.html) + * [*delete*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.SubscriptionInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.SubscriptionListCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.SubscriptionUpdateCall.html) * timeline - * [*attachments delete*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineAttachmentDeleteCall.html), [*attachments get*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineAttachmentGetCall.html), [*attachments insert*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineAttachmentInsertCall.html), [*attachments list*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineAttachmentListCall.html), [*delete*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelinePatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineUpdateCall.html) + * [*attachments delete*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineAttachmentDeleteCall.html), [*attachments get*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineAttachmentGetCall.html), [*attachments insert*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineAttachmentInsertCall.html), [*attachments list*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineAttachmentListCall.html), [*delete*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelinePatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineUpdateCall.html) Upload supported by ... -* [*update timeline*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineUpdateCall.html) -* [*insert timeline*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineInsertCall.html) -* [*attachments insert timeline*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineAttachmentInsertCall.html) +* [*update timeline*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineUpdateCall.html) +* [*insert timeline*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineInsertCall.html) +* [*attachments insert timeline*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineAttachmentInsertCall.html) Download supported by ... -* [*attachments get timeline*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.TimelineAttachmentGetCall.html) +* [*attachments get timeline*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.TimelineAttachmentGetCall.html) @@ -43,17 +43,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/struct.Mirror.html)** +* **[Hub](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/struct.Mirror.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.Part.html)** + * **[Parts](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -155,17 +155,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -175,29 +175,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-mirror1/1.0.12+20190424/google_mirror1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-mirror1/1.0.13+20190424/google_mirror1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/mirror1/src/lib.rs b/gen/mirror1/src/lib.rs index 1629ec03a7..48918edd75 100644 --- a/gen/mirror1/src/lib.rs +++ b/gen/mirror1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *mirror* crate version *1.0.12+20190424*, where *20190424* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *mirror* crate version *1.0.13+20190424*, where *20190424* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *mirror* *v1* API can be found at the //! [official documentation site](https://developers.google.com/glass). @@ -358,7 +358,7 @@ impl<'a, C, A> Mirror Mirror { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/mirror/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -384,7 +384,7 @@ impl<'a, C, A> Mirror } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/ml1-cli/Cargo.toml b/gen/ml1-cli/Cargo.toml index 90ff27948b..9e1ec58ddc 100644 --- a/gen/ml1-cli/Cargo.toml +++ b/gen/ml1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-ml1-cli" -version = "1.0.12+20190621" +version = "1.0.13+20200328" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Machine Learning Engine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/ml1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-ml1] path = "../ml1" -version = "1.0.12+20190621" +version = "1.0.13+20200328" diff --git a/gen/ml1-cli/README.md b/gen/ml1-cli/README.md index df6553550b..4037f56c81 100644 --- a/gen/ml1-cli/README.md +++ b/gen/ml1-cli/README.md @@ -25,11 +25,12 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Machine Learning Engine* API at revision *20190621*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Machine Learning Engine* API at revision *20200328*. The CLI is at version *1.0.13*. ```bash ml1 [options] projects + explain (-r )... [-p ]... [-o ] get-config [-p ]... [-o ] jobs-cancel (-r )... [-p ]... [-o ] jobs-create (-r )... [-p ]... [-o ] @@ -41,6 +42,21 @@ ml1 [options] jobs-test-iam-permissions (-r )... [-p ]... [-o ] locations-get [-p ]... [-o ] locations-list [-p ]... [-o ] + locations-operations-cancel [-p ]... [-o ] + locations-operations-get [-p ]... [-o ] + locations-studies-create (-r )... [-p ]... [-o ] + locations-studies-delete [-p ]... [-o ] + locations-studies-get [-p ]... [-o ] + locations-studies-list [-p ]... [-o ] + locations-studies-trials-add-measurement (-r )... [-p ]... [-o ] + locations-studies-trials-check-early-stopping-state (-r )... [-p ]... [-o ] + locations-studies-trials-complete (-r )... [-p ]... [-o ] + locations-studies-trials-create (-r )... [-p ]... [-o ] + locations-studies-trials-delete [-p ]... [-o ] + locations-studies-trials-get [-p ]... [-o ] + locations-studies-trials-list [-p ]... [-o ] + locations-studies-trials-stop (-r )... [-p ]... [-o ] + locations-studies-trials-suggest (-r )... [-p ]... [-o ] models-create (-r )... [-p ]... [-o ] models-delete [-p ]... [-o ] models-get [-p ]... [-o ] diff --git a/gen/ml1-cli/mkdocs.yml b/gen/ml1-cli/mkdocs.yml index a05b3243c9..d1e98bd5bb 100644 --- a/gen/ml1-cli/mkdocs.yml +++ b/gen/ml1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Machine Learning Engine v1.0.12+20190621 +site_name: Cloud Machine Learning Engine v1.0.13+20200328 site_url: http://byron.github.io/google-apis-rs/google-ml1-cli site_description: A complete library to interact with Cloud Machine Learning Engine (protocol v1) @@ -9,6 +9,7 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['projects_explain.md', 'Projects', 'Explain'] - ['projects_get-config.md', 'Projects', 'Get Config'] - ['projects_jobs-cancel.md', 'Projects', 'Jobs Cancel'] - ['projects_jobs-create.md', 'Projects', 'Jobs Create'] @@ -20,6 +21,21 @@ pages: - ['projects_jobs-test-iam-permissions.md', 'Projects', 'Jobs Test Iam Permissions'] - ['projects_locations-get.md', 'Projects', 'Locations Get'] - ['projects_locations-list.md', 'Projects', 'Locations List'] +- ['projects_locations-operations-cancel.md', 'Projects', 'Locations Operations Cancel'] +- ['projects_locations-operations-get.md', 'Projects', 'Locations Operations Get'] +- ['projects_locations-studies-create.md', 'Projects', 'Locations Studies Create'] +- ['projects_locations-studies-delete.md', 'Projects', 'Locations Studies Delete'] +- ['projects_locations-studies-get.md', 'Projects', 'Locations Studies Get'] +- ['projects_locations-studies-list.md', 'Projects', 'Locations Studies List'] +- ['projects_locations-studies-trials-add-measurement.md', 'Projects', 'Locations Studies Trials Add Measurement'] +- ['projects_locations-studies-trials-check-early-stopping-state.md', 'Projects', 'Locations Studies Trials Check Early Stopping State'] +- ['projects_locations-studies-trials-complete.md', 'Projects', 'Locations Studies Trials Complete'] +- ['projects_locations-studies-trials-create.md', 'Projects', 'Locations Studies Trials Create'] +- ['projects_locations-studies-trials-delete.md', 'Projects', 'Locations Studies Trials Delete'] +- ['projects_locations-studies-trials-get.md', 'Projects', 'Locations Studies Trials Get'] +- ['projects_locations-studies-trials-list.md', 'Projects', 'Locations Studies Trials List'] +- ['projects_locations-studies-trials-stop.md', 'Projects', 'Locations Studies Trials Stop'] +- ['projects_locations-studies-trials-suggest.md', 'Projects', 'Locations Studies Trials Suggest'] - ['projects_models-create.md', 'Projects', 'Models Create'] - ['projects_models-delete.md', 'Projects', 'Models Delete'] - ['projects_models-get.md', 'Projects', 'Models Get'] diff --git a/gen/ml1-cli/src/main.rs b/gen/ml1-cli/src/main.rs index 13e06bee36..641c9032b7 100644 --- a/gen/ml1-cli/src/main.rs +++ b/gen/ml1-cli/src/main.rs @@ -46,6 +46,92 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _projects_explain(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "http-body.data" => Some(("httpBody.data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-body.content-type" => Some(("httpBody.contentType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["content-type", "data", "http-body"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__ExplainRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().explain(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_get_config(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().get_config(opt.value_of("name").unwrap_or("")); @@ -232,14 +318,28 @@ impl<'n> Engine<'n> { "prediction-input.region" => Some(("predictionInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "prediction-input.input-paths" => Some(("predictionInput.inputPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "prediction-input.output-data-format" => Some(("predictionInput.outputDataFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-type" => Some(("trainingInput.workerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.tpu-tf-version" => Some(("trainingInput.parameterServerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.accelerator-config.count" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.accelerator-config.type" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.image-uri" => Some(("trainingInput.parameterServerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.runtime-version" => Some(("trainingInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.scale-tier" => Some(("trainingInput.scaleTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.master-type" => Some(("trainingInput.masterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.job-dir" => Some(("trainingInput.jobDir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.scheduling.max-running-time" => Some(("trainingInput.scheduling.maxRunningTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-count" => Some(("trainingInput.parameterServerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.evaluator-count" => Some(("trainingInput.evaluatorCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.worker-type" => Some(("trainingInput.workerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.scale-tier" => Some(("trainingInput.scaleTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.package-uris" => Some(("trainingInput.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "training-input.worker-config.tpu-tf-version" => Some(("trainingInput.workerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.worker-config.accelerator-config.count" => Some(("trainingInput.workerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.worker-config.accelerator-config.type" => Some(("trainingInput.workerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.worker-config.image-uri" => Some(("trainingInput.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.tpu-tf-version" => Some(("trainingInput.evaluatorConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.accelerator-config.count" => Some(("trainingInput.evaluatorConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.accelerator-config.type" => Some(("trainingInput.evaluatorConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.image-uri" => Some(("trainingInput.evaluatorConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.use-chief-in-tf-config" => Some(("trainingInput.useChiefInTfConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "training-input.master-config.tpu-tf-version" => Some(("trainingInput.masterConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.master-config.accelerator-config.count" => Some(("trainingInput.masterConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.master-config.accelerator-config.type" => Some(("trainingInput.masterConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.master-config.image-uri" => Some(("trainingInput.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.runtime-version" => Some(("trainingInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.max-trials" => Some(("trainingInput.hyperparameters.maxTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "training-input.hyperparameters.goal" => Some(("trainingInput.hyperparameters.goal", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.algorithm" => Some(("trainingInput.hyperparameters.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -248,24 +348,18 @@ impl<'n> Engine<'n> { "training-input.hyperparameters.resume-previous-job-id" => Some(("trainingInput.hyperparameters.resumePreviousJobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.hyperparameter-metric-tag" => Some(("trainingInput.hyperparameters.hyperparameterMetricTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.max-parallel-trials" => Some(("trainingInput.hyperparameters.maxParallelTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "training-input.region" => Some(("trainingInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.args" => Some(("trainingInput.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "training-input.python-module" => Some(("trainingInput.pythonModule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.python-version" => Some(("trainingInput.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.job-dir" => Some(("trainingInput.jobDir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.package-uris" => Some(("trainingInput.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "training-input.worker-count" => Some(("trainingInput.workerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.encryption-config.kms-key-name" => Some(("trainingInput.encryptionConfig.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.tpu-tf-version" => Some(("trainingInput.parameterServerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.accelerator-config.count" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.accelerator-config.type" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.image-uri" => Some(("trainingInput.parameterServerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.region" => Some(("trainingInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.python-version" => Some(("trainingInput.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-type" => Some(("trainingInput.evaluatorType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.parameter-server-type" => Some(("trainingInput.parameterServerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.tpu-tf-version" => Some(("trainingInput.workerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.accelerator-config.count" => Some(("trainingInput.workerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.accelerator-config.type" => Some(("trainingInput.workerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.image-uri" => Some(("trainingInput.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.max-running-time" => Some(("trainingInput.maxRunningTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.tpu-tf-version" => Some(("trainingInput.masterConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.accelerator-config.count" => Some(("trainingInput.masterConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.accelerator-config.type" => Some(("trainingInput.masterConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.image-uri" => Some(("trainingInput.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-count" => Some(("trainingInput.parameterServerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "prediction-output.node-hours" => Some(("predictionOutput.nodeHours", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "prediction-output.output-path" => Some(("predictionOutput.outputPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -273,7 +367,7 @@ impl<'n> Engine<'n> { "prediction-output.error-count" => Some(("predictionOutput.errorCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "algorithm", "args", "batch-size", "built-in-algorithm-output", "completed-trial-count", "consumed-ml-units", "count", "create-time", "data-format", "enable-trial-early-stopping", "end-time", "error-count", "error-message", "etag", "framework", "goal", "hyperparameter-metric-tag", "hyperparameters", "image-uri", "input-paths", "is-built-in-algorithm-job", "is-hyperparameter-tuning-job", "job-dir", "job-id", "labels", "master-config", "master-type", "max-failed-trials", "max-parallel-trials", "max-running-time", "max-trials", "max-worker-count", "model-name", "model-path", "node-hours", "output-data-format", "output-path", "package-uris", "parameter-server-config", "parameter-server-count", "parameter-server-type", "prediction-count", "prediction-input", "prediction-output", "python-module", "python-version", "region", "resume-previous-job-id", "runtime-version", "scale-tier", "signature-name", "start-time", "state", "tpu-tf-version", "training-input", "training-output", "type", "uri", "version-name", "worker-config", "worker-count", "worker-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "algorithm", "args", "batch-size", "built-in-algorithm-output", "completed-trial-count", "consumed-ml-units", "count", "create-time", "data-format", "enable-trial-early-stopping", "encryption-config", "end-time", "error-count", "error-message", "etag", "evaluator-config", "evaluator-count", "evaluator-type", "framework", "goal", "hyperparameter-metric-tag", "hyperparameters", "image-uri", "input-paths", "is-built-in-algorithm-job", "is-hyperparameter-tuning-job", "job-dir", "job-id", "kms-key-name", "labels", "master-config", "master-type", "max-failed-trials", "max-parallel-trials", "max-running-time", "max-trials", "max-worker-count", "model-name", "model-path", "node-hours", "output-data-format", "output-path", "package-uris", "parameter-server-config", "parameter-server-count", "parameter-server-type", "prediction-count", "prediction-input", "prediction-output", "python-module", "python-version", "region", "resume-previous-job-id", "runtime-version", "scale-tier", "scheduling", "signature-name", "start-time", "state", "tpu-tf-version", "training-input", "training-output", "type", "uri", "use-chief-in-tf-config", "version-name", "worker-config", "worker-count", "worker-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -391,6 +485,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -404,6 +501,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -549,14 +647,28 @@ impl<'n> Engine<'n> { "prediction-input.region" => Some(("predictionInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "prediction-input.input-paths" => Some(("predictionInput.inputPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "prediction-input.output-data-format" => Some(("predictionInput.outputDataFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-type" => Some(("trainingInput.workerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.tpu-tf-version" => Some(("trainingInput.parameterServerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.accelerator-config.count" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.accelerator-config.type" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-config.image-uri" => Some(("trainingInput.parameterServerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.runtime-version" => Some(("trainingInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.scale-tier" => Some(("trainingInput.scaleTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.master-type" => Some(("trainingInput.masterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.job-dir" => Some(("trainingInput.jobDir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.scheduling.max-running-time" => Some(("trainingInput.scheduling.maxRunningTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-count" => Some(("trainingInput.parameterServerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.evaluator-count" => Some(("trainingInput.evaluatorCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.worker-type" => Some(("trainingInput.workerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.scale-tier" => Some(("trainingInput.scaleTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.package-uris" => Some(("trainingInput.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "training-input.worker-config.tpu-tf-version" => Some(("trainingInput.workerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.worker-config.accelerator-config.count" => Some(("trainingInput.workerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.worker-config.accelerator-config.type" => Some(("trainingInput.workerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.worker-config.image-uri" => Some(("trainingInput.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.tpu-tf-version" => Some(("trainingInput.evaluatorConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.accelerator-config.count" => Some(("trainingInput.evaluatorConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.accelerator-config.type" => Some(("trainingInput.evaluatorConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-config.image-uri" => Some(("trainingInput.evaluatorConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.use-chief-in-tf-config" => Some(("trainingInput.useChiefInTfConfig", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "training-input.master-config.tpu-tf-version" => Some(("trainingInput.masterConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.master-config.accelerator-config.count" => Some(("trainingInput.masterConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.master-config.accelerator-config.type" => Some(("trainingInput.masterConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.master-config.image-uri" => Some(("trainingInput.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.runtime-version" => Some(("trainingInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.max-trials" => Some(("trainingInput.hyperparameters.maxTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "training-input.hyperparameters.goal" => Some(("trainingInput.hyperparameters.goal", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.algorithm" => Some(("trainingInput.hyperparameters.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -565,24 +677,18 @@ impl<'n> Engine<'n> { "training-input.hyperparameters.resume-previous-job-id" => Some(("trainingInput.hyperparameters.resumePreviousJobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.hyperparameter-metric-tag" => Some(("trainingInput.hyperparameters.hyperparameterMetricTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.max-parallel-trials" => Some(("trainingInput.hyperparameters.maxParallelTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "training-input.region" => Some(("trainingInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.args" => Some(("trainingInput.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "training-input.python-module" => Some(("trainingInput.pythonModule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.python-version" => Some(("trainingInput.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.job-dir" => Some(("trainingInput.jobDir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.package-uris" => Some(("trainingInput.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "training-input.worker-count" => Some(("trainingInput.workerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.encryption-config.kms-key-name" => Some(("trainingInput.encryptionConfig.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.tpu-tf-version" => Some(("trainingInput.parameterServerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.accelerator-config.count" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.accelerator-config.type" => Some(("trainingInput.parameterServerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.parameter-server-config.image-uri" => Some(("trainingInput.parameterServerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.region" => Some(("trainingInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.python-version" => Some(("trainingInput.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.evaluator-type" => Some(("trainingInput.evaluatorType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.parameter-server-type" => Some(("trainingInput.parameterServerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.tpu-tf-version" => Some(("trainingInput.workerConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.accelerator-config.count" => Some(("trainingInput.workerConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.accelerator-config.type" => Some(("trainingInput.workerConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.worker-config.image-uri" => Some(("trainingInput.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.max-running-time" => Some(("trainingInput.maxRunningTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.tpu-tf-version" => Some(("trainingInput.masterConfig.tpuTfVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.accelerator-config.count" => Some(("trainingInput.masterConfig.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.accelerator-config.type" => Some(("trainingInput.masterConfig.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.master-config.image-uri" => Some(("trainingInput.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "training-input.parameter-server-count" => Some(("trainingInput.parameterServerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "prediction-output.node-hours" => Some(("predictionOutput.nodeHours", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "prediction-output.output-path" => Some(("predictionOutput.outputPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -590,7 +696,7 @@ impl<'n> Engine<'n> { "prediction-output.error-count" => Some(("predictionOutput.errorCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "algorithm", "args", "batch-size", "built-in-algorithm-output", "completed-trial-count", "consumed-ml-units", "count", "create-time", "data-format", "enable-trial-early-stopping", "end-time", "error-count", "error-message", "etag", "framework", "goal", "hyperparameter-metric-tag", "hyperparameters", "image-uri", "input-paths", "is-built-in-algorithm-job", "is-hyperparameter-tuning-job", "job-dir", "job-id", "labels", "master-config", "master-type", "max-failed-trials", "max-parallel-trials", "max-running-time", "max-trials", "max-worker-count", "model-name", "model-path", "node-hours", "output-data-format", "output-path", "package-uris", "parameter-server-config", "parameter-server-count", "parameter-server-type", "prediction-count", "prediction-input", "prediction-output", "python-module", "python-version", "region", "resume-previous-job-id", "runtime-version", "scale-tier", "signature-name", "start-time", "state", "tpu-tf-version", "training-input", "training-output", "type", "uri", "version-name", "worker-config", "worker-count", "worker-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "algorithm", "args", "batch-size", "built-in-algorithm-output", "completed-trial-count", "consumed-ml-units", "count", "create-time", "data-format", "enable-trial-early-stopping", "encryption-config", "end-time", "error-count", "error-message", "etag", "evaluator-config", "evaluator-count", "evaluator-type", "framework", "goal", "hyperparameter-metric-tag", "hyperparameters", "image-uri", "input-paths", "is-built-in-algorithm-job", "is-hyperparameter-tuning-job", "job-dir", "job-id", "kms-key-name", "labels", "master-config", "master-type", "max-failed-trials", "max-parallel-trials", "max-running-time", "max-trials", "max-worker-count", "model-name", "model-path", "node-hours", "output-data-format", "output-path", "package-uris", "parameter-server-config", "parameter-server-count", "parameter-server-type", "prediction-count", "prediction-input", "prediction-output", "python-module", "python-version", "region", "resume-previous-job-id", "runtime-version", "scale-tier", "scheduling", "signature-name", "start-time", "state", "tpu-tf-version", "training-input", "training-output", "type", "uri", "use-chief-in-tf-config", "version-name", "worker-config", "worker-count", "worker-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -937,6 +1043,1038 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "inactive-reason" => Some(("inactiveReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "study-config.automated-stopping-config.decay-curve-stopping-config.use-elapsed-time" => Some(("studyConfig.automatedStoppingConfig.decayCurveStoppingConfig.useElapsedTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "study-config.automated-stopping-config.median-automated-stopping-config.use-elapsed-time" => Some(("studyConfig.automatedStoppingConfig.medianAutomatedStoppingConfig.useElapsedTime", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "study-config.algorithm" => Some(("studyConfig.algorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["algorithm", "automated-stopping-config", "create-time", "decay-curve-stopping-config", "inactive-reason", "median-automated-stopping-config", "name", "state", "study-config", "use-elapsed-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__Study = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_studies_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "study-id" => { + call = call.study_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["study-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_studies_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_studies_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_studies_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_add_measurement(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "measurement.elapsed-time" => Some(("measurement.elapsedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "measurement.step-count" => Some(("measurement.stepCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["elapsed-time", "measurement", "step-count"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__AddTrialMeasurementRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_studies_trials_add_measurement(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_check_early_stopping_state(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__CheckTrialEarlyStoppingStateRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_studies_trials_check_early_stopping_state(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_complete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "infeasible-reason" => Some(("infeasibleReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-measurement.elapsed-time" => Some(("finalMeasurement.elapsedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-measurement.step-count" => Some(("finalMeasurement.stepCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "trial-infeasible" => Some(("trialInfeasible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["elapsed-time", "final-measurement", "infeasible-reason", "step-count", "trial-infeasible"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__CompleteTrialRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_studies_trials_complete(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "infeasible-reason" => Some(("infeasibleReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-measurement.elapsed-time" => Some(("finalMeasurement.elapsedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "final-measurement.step-count" => Some(("finalMeasurement.stepCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "client-id" => Some(("clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trial-infeasible" => Some(("trialInfeasible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["client-id", "elapsed-time", "end-time", "final-measurement", "infeasible-reason", "name", "start-time", "state", "step-count", "trial-infeasible"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__Trial = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_studies_trials_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_studies_trials_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_studies_trials_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_studies_trials_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_stop(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__StopTrialRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_studies_trials_stop(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_studies_trials_suggest(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "suggestion-count" => Some(("suggestionCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "client-id" => Some(("clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["client-id", "suggestion-count"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GoogleCloudMlV1__SuggestTrialsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_studies_trials_suggest(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_models_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -965,29 +2103,36 @@ impl<'n> Engine<'n> { "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "regions" => Some(("regions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.auto-scaling.min-nodes" => Some(("defaultVersion.autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "default-version.error-message" => Some(("defaultVersion.errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.accelerator-config.count" => Some(("defaultVersion.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.accelerator-config.type" => Some(("defaultVersion.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.labels" => Some(("defaultVersion.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "default-version.prediction-class" => Some(("defaultVersion.predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.service-account" => Some(("defaultVersion.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.package-uris" => Some(("defaultVersion.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-version.state" => Some(("defaultVersion.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.etag" => Some(("defaultVersion.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.last-use-time" => Some(("defaultVersion.lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.deployment-uri" => Some(("defaultVersion.deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.explanation-config.xrai-attribution.num-integral-steps" => Some(("defaultVersion.explanationConfig.xraiAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.explanation-config.sampled-shapley-attribution.num-paths" => Some(("defaultVersion.explanationConfig.sampledShapleyAttribution.numPaths", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.explanation-config.integrated-gradients-attribution.num-integral-steps" => Some(("defaultVersion.explanationConfig.integratedGradientsAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.is-default" => Some(("defaultVersion.isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "default-version.machine-type" => Some(("defaultVersion.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.description" => Some(("defaultVersion.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.runtime-version" => Some(("defaultVersion.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.manual-scaling.nodes" => Some(("defaultVersion.manualScaling.nodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "default-version.prediction-class" => Some(("defaultVersion.predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.labels" => Some(("defaultVersion.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "default-version.service-account" => Some(("defaultVersion.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.state" => Some(("defaultVersion.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.python-version" => Some(("defaultVersion.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.error-message" => Some(("defaultVersion.errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.framework" => Some(("defaultVersion.framework", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.package-uris" => Some(("defaultVersion.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "default-version.etag" => Some(("defaultVersion.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.last-use-time" => Some(("defaultVersion.lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.deployment-uri" => Some(("defaultVersion.deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.create-time" => Some(("defaultVersion.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.is-default" => Some(("defaultVersion.isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "default-version.name" => Some(("defaultVersion.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.auto-scaling.min-nodes" => Some(("defaultVersion.autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.python-version" => Some(("defaultVersion.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.request-logging-config.sampling-percentage" => Some(("defaultVersion.requestLoggingConfig.samplingPercentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-version.request-logging-config.bigquery-table-name" => Some(("defaultVersion.requestLoggingConfig.bigqueryTableName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "online-prediction-logging" => Some(("onlinePredictionLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "default-version", "deployment-uri", "description", "error-message", "etag", "framework", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "online-prediction-console-logging", "online-prediction-logging", "package-uris", "prediction-class", "python-version", "regions", "runtime-version", "service-account", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "auto-scaling", "bigquery-table-name", "count", "create-time", "default-version", "deployment-uri", "description", "error-message", "etag", "explanation-config", "framework", "integrated-gradients-attribution", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "num-integral-steps", "num-paths", "online-prediction-console-logging", "online-prediction-logging", "package-uris", "prediction-class", "python-version", "regions", "request-logging-config", "runtime-version", "sampled-shapley-attribution", "sampling-percentage", "service-account", "state", "type", "xrai-attribution"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1157,6 +2302,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1170,6 +2318,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -1293,29 +2442,36 @@ impl<'n> Engine<'n> { "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "regions" => Some(("regions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.auto-scaling.min-nodes" => Some(("defaultVersion.autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "default-version.error-message" => Some(("defaultVersion.errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.accelerator-config.count" => Some(("defaultVersion.acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.accelerator-config.type" => Some(("defaultVersion.acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.labels" => Some(("defaultVersion.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "default-version.prediction-class" => Some(("defaultVersion.predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.service-account" => Some(("defaultVersion.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.package-uris" => Some(("defaultVersion.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "default-version.state" => Some(("defaultVersion.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.etag" => Some(("defaultVersion.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.last-use-time" => Some(("defaultVersion.lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.deployment-uri" => Some(("defaultVersion.deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.explanation-config.xrai-attribution.num-integral-steps" => Some(("defaultVersion.explanationConfig.xraiAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.explanation-config.sampled-shapley-attribution.num-paths" => Some(("defaultVersion.explanationConfig.sampledShapleyAttribution.numPaths", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.explanation-config.integrated-gradients-attribution.num-integral-steps" => Some(("defaultVersion.explanationConfig.integratedGradientsAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.is-default" => Some(("defaultVersion.isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "default-version.machine-type" => Some(("defaultVersion.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.description" => Some(("defaultVersion.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.runtime-version" => Some(("defaultVersion.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.manual-scaling.nodes" => Some(("defaultVersion.manualScaling.nodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "default-version.prediction-class" => Some(("defaultVersion.predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.labels" => Some(("defaultVersion.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "default-version.service-account" => Some(("defaultVersion.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.state" => Some(("defaultVersion.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.python-version" => Some(("defaultVersion.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.error-message" => Some(("defaultVersion.errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.framework" => Some(("defaultVersion.framework", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.package-uris" => Some(("defaultVersion.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "default-version.etag" => Some(("defaultVersion.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.last-use-time" => Some(("defaultVersion.lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.deployment-uri" => Some(("defaultVersion.deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-version.create-time" => Some(("defaultVersion.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "default-version.is-default" => Some(("defaultVersion.isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "default-version.name" => Some(("defaultVersion.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.auto-scaling.min-nodes" => Some(("defaultVersion.autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "default-version.python-version" => Some(("defaultVersion.pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "default-version.request-logging-config.sampling-percentage" => Some(("defaultVersion.requestLoggingConfig.samplingPercentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "default-version.request-logging-config.bigquery-table-name" => Some(("defaultVersion.requestLoggingConfig.bigqueryTableName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "online-prediction-logging" => Some(("onlinePredictionLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "default-version", "deployment-uri", "description", "error-message", "etag", "framework", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "online-prediction-console-logging", "online-prediction-logging", "package-uris", "prediction-class", "python-version", "regions", "runtime-version", "service-account", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "auto-scaling", "bigquery-table-name", "count", "create-time", "default-version", "deployment-uri", "description", "error-message", "etag", "explanation-config", "framework", "integrated-gradients-attribution", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "num-integral-steps", "num-paths", "online-prediction-console-logging", "online-prediction-logging", "package-uris", "prediction-class", "python-version", "regions", "request-logging-config", "runtime-version", "sampled-shapley-attribution", "sampling-percentage", "service-account", "state", "type", "xrai-attribution"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1574,27 +2730,34 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "auto-scaling.min-nodes" => Some(("autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "accelerator-config.count" => Some(("acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "accelerator-config.type" => Some(("acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "prediction-class" => Some(("predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-account" => Some(("serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "package-uris" => Some(("packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-use-time" => Some(("lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deployment-uri" => Some(("deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "explanation-config.xrai-attribution.num-integral-steps" => Some(("explanationConfig.xraiAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "explanation-config.sampled-shapley-attribution.num-paths" => Some(("explanationConfig.sampledShapleyAttribution.numPaths", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "explanation-config.integrated-gradients-attribution.num-integral-steps" => Some(("explanationConfig.integratedGradientsAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "is-default" => Some(("isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "machine-type" => Some(("machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime-version" => Some(("runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "manual-scaling.nodes" => Some(("manualScaling.nodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "prediction-class" => Some(("predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "service-account" => Some(("serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "python-version" => Some(("pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "framework" => Some(("framework", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "package-uris" => Some(("packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-use-time" => Some(("lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "deployment-uri" => Some(("deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "is-default" => Some(("isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-scaling.min-nodes" => Some(("autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "python-version" => Some(("pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-logging-config.sampling-percentage" => Some(("requestLoggingConfig.samplingPercentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "request-logging-config.bigquery-table-name" => Some(("requestLoggingConfig.bigqueryTableName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "deployment-uri", "description", "error-message", "etag", "framework", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "package-uris", "prediction-class", "python-version", "runtime-version", "service-account", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "auto-scaling", "bigquery-table-name", "count", "create-time", "deployment-uri", "description", "error-message", "etag", "explanation-config", "framework", "integrated-gradients-attribution", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "num-integral-steps", "num-paths", "package-uris", "prediction-class", "python-version", "request-logging-config", "runtime-version", "sampled-shapley-attribution", "sampling-percentage", "service-account", "state", "type", "xrai-attribution"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1843,27 +3006,34 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "auto-scaling.min-nodes" => Some(("autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "accelerator-config.count" => Some(("acceleratorConfig.count", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "accelerator-config.type" => Some(("acceleratorConfig.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "prediction-class" => Some(("predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-account" => Some(("serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "package-uris" => Some(("packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-use-time" => Some(("lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deployment-uri" => Some(("deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "explanation-config.xrai-attribution.num-integral-steps" => Some(("explanationConfig.xraiAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "explanation-config.sampled-shapley-attribution.num-paths" => Some(("explanationConfig.sampledShapleyAttribution.numPaths", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "explanation-config.integrated-gradients-attribution.num-integral-steps" => Some(("explanationConfig.integratedGradientsAttribution.numIntegralSteps", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "is-default" => Some(("isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "machine-type" => Some(("machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime-version" => Some(("runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "manual-scaling.nodes" => Some(("manualScaling.nodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "prediction-class" => Some(("predictionClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "service-account" => Some(("serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "python-version" => Some(("pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "framework" => Some(("framework", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "package-uris" => Some(("packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-use-time" => Some(("lastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "deployment-uri" => Some(("deploymentUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "is-default" => Some(("isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-scaling.min-nodes" => Some(("autoScaling.minNodes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "python-version" => Some(("pythonVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-logging-config.sampling-percentage" => Some(("requestLoggingConfig.samplingPercentage", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "request-logging-config.bigquery-table-name" => Some(("requestLoggingConfig.bigqueryTableName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-scaling", "create-time", "deployment-uri", "description", "error-message", "etag", "framework", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "package-uris", "prediction-class", "python-version", "runtime-version", "service-account", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["accelerator-config", "auto-scaling", "bigquery-table-name", "count", "create-time", "deployment-uri", "description", "error-message", "etag", "explanation-config", "framework", "integrated-gradients-attribution", "is-default", "labels", "last-use-time", "machine-type", "manual-scaling", "min-nodes", "name", "nodes", "num-integral-steps", "num-paths", "package-uris", "prediction-class", "python-version", "request-logging-config", "runtime-version", "sampled-shapley-attribution", "sampling-percentage", "service-account", "state", "type", "xrai-attribution"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2270,6 +3440,9 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { + ("explain", Some(opt)) => { + call_result = self._projects_explain(opt, dry_run, &mut err); + }, ("get-config", Some(opt)) => { call_result = self._projects_get_config(opt, dry_run, &mut err); }, @@ -2303,6 +3476,51 @@ impl<'n> Engine<'n> { ("locations-list", Some(opt)) => { call_result = self._projects_locations_list(opt, dry_run, &mut err); }, + ("locations-operations-cancel", Some(opt)) => { + call_result = self._projects_locations_operations_cancel(opt, dry_run, &mut err); + }, + ("locations-operations-get", Some(opt)) => { + call_result = self._projects_locations_operations_get(opt, dry_run, &mut err); + }, + ("locations-studies-create", Some(opt)) => { + call_result = self._projects_locations_studies_create(opt, dry_run, &mut err); + }, + ("locations-studies-delete", Some(opt)) => { + call_result = self._projects_locations_studies_delete(opt, dry_run, &mut err); + }, + ("locations-studies-get", Some(opt)) => { + call_result = self._projects_locations_studies_get(opt, dry_run, &mut err); + }, + ("locations-studies-list", Some(opt)) => { + call_result = self._projects_locations_studies_list(opt, dry_run, &mut err); + }, + ("locations-studies-trials-add-measurement", Some(opt)) => { + call_result = self._projects_locations_studies_trials_add_measurement(opt, dry_run, &mut err); + }, + ("locations-studies-trials-check-early-stopping-state", Some(opt)) => { + call_result = self._projects_locations_studies_trials_check_early_stopping_state(opt, dry_run, &mut err); + }, + ("locations-studies-trials-complete", Some(opt)) => { + call_result = self._projects_locations_studies_trials_complete(opt, dry_run, &mut err); + }, + ("locations-studies-trials-create", Some(opt)) => { + call_result = self._projects_locations_studies_trials_create(opt, dry_run, &mut err); + }, + ("locations-studies-trials-delete", Some(opt)) => { + call_result = self._projects_locations_studies_trials_delete(opt, dry_run, &mut err); + }, + ("locations-studies-trials-get", Some(opt)) => { + call_result = self._projects_locations_studies_trials_get(opt, dry_run, &mut err); + }, + ("locations-studies-trials-list", Some(opt)) => { + call_result = self._projects_locations_studies_trials_list(opt, dry_run, &mut err); + }, + ("locations-studies-trials-stop", Some(opt)) => { + call_result = self._projects_locations_studies_trials_stop(opt, dry_run, &mut err); + }, + ("locations-studies-trials-suggest", Some(opt)) => { + call_result = self._projects_locations_studies_trials_suggest(opt, dry_run, &mut err); + }, ("models-create", Some(opt)) => { call_result = self._projects_models_create(opt, dry_run, &mut err); }, @@ -2448,7 +3666,39 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'get-config', 'jobs-cancel', 'jobs-create', 'jobs-get', 'jobs-get-iam-policy', 'jobs-list', 'jobs-patch', 'jobs-set-iam-policy', 'jobs-test-iam-permissions', 'locations-get', 'locations-list', 'models-create', 'models-delete', 'models-get', 'models-get-iam-policy', 'models-list', 'models-patch', 'models-set-iam-policy', 'models-test-iam-permissions', 'models-versions-create', 'models-versions-delete', 'models-versions-get', 'models-versions-list', 'models-versions-patch', 'models-versions-set-default', 'operations-cancel', 'operations-get', 'operations-list' and 'predict'", vec![ + ("projects", "methods: 'explain', 'get-config', 'jobs-cancel', 'jobs-create', 'jobs-get', 'jobs-get-iam-policy', 'jobs-list', 'jobs-patch', 'jobs-set-iam-policy', 'jobs-test-iam-permissions', 'locations-get', 'locations-list', 'locations-operations-cancel', 'locations-operations-get', 'locations-studies-create', 'locations-studies-delete', 'locations-studies-get', 'locations-studies-list', 'locations-studies-trials-add-measurement', 'locations-studies-trials-check-early-stopping-state', 'locations-studies-trials-complete', 'locations-studies-trials-create', 'locations-studies-trials-delete', 'locations-studies-trials-get', 'locations-studies-trials-list', 'locations-studies-trials-stop', 'locations-studies-trials-suggest', 'models-create', 'models-delete', 'models-get', 'models-get-iam-policy', 'models-list', 'models-patch', 'models-set-iam-policy', 'models-test-iam-permissions', 'models-versions-create', 'models-versions-delete', 'models-versions-get', 'models-versions-list', 'models-versions-patch', 'models-versions-set-default', 'operations-cancel', 'operations-get', 'operations-list' and 'predict'", vec![ + ("explain", + Some(r##"Performs explanation on the data in the request. + AI Platform implements a custom `explain` verb on top of an HTTP POST + method."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_explain", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of a model or a version. + + Authorization: requires the `predict` permission on the specified resource."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("get-config", Some(r##"Get the service account information associated with your project. You need this information in order to grant the service account permissions for @@ -2634,7 +3884,9 @@ fn main() { ]), ("jobs-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_jobs-set-iam-policy", vec![ (Some(r##"resource"##), @@ -2737,6 +3989,393 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-create", + Some(r##"Creates a study."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project and location that the study belongs to. + Format: projects/{project}/locations/{location}"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-delete", + Some(r##"Deletes a study."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The study name."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-get", + Some(r##"Gets a study."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The study name."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-list", + Some(r##"Lists all the studies in a region for an associated project."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project and location that the study belongs to. + Format: projects/{project}/locations/{location}"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-add-measurement", + Some(r##"Adds a measurement of the objective metrics to a Trial. This measurement + is assumed to have been taken before the Trial is complete."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-add-measurement", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The trial name."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-check-early-stopping-state", + Some(r##"Checks whether a trial should stop or not."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-check-early-stopping-state", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The trial name."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-complete", + Some(r##"Marks a Trial as complete."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-complete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The trial name."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-create", + Some(r##"Adds a user provided trial to a Study."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the study that the trial belongs to."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-delete", + Some(r##"Deletes a Trial."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The trial name."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-get", + Some(r##"Gets a Trial."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The trial name."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-list", + Some(r##"Lists the trials associated with a Study."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the study that the trial belongs to."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-stop", + Some(r##"Stops a trial."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-stop", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The trial name."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-studies-trials-suggest", + Some(r##"Returns a long-running operation associated with the generation of trial + suggestions."##), + "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_locations-studies-trials-suggest", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the study that the trial belongs to."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2748,7 +4387,7 @@ fn main() { You must add at least one version before you can request predictions from the model. Add versions by calling - [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create)."##), + projects.models.versions.create."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-create", vec![ (Some(r##"parent"##), @@ -2780,7 +4419,7 @@ fn main() { You can only delete a model if there are no versions in it. You can delete versions by calling - [projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete)."##), + projects.models.versions.delete."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-delete", vec![ (Some(r##"name"##), @@ -2911,7 +4550,9 @@ fn main() { ]), ("models-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-set-iam-policy", vec![ (Some(r##"resource"##), @@ -2982,7 +4623,7 @@ fn main() { model. When you add a version to a model that already has one or more versions, the default version does not automatically change. If you want a new version to be the default, you must call - [projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault)."##), + projects.models.versions.setDefault."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-create", vec![ (Some(r##"parent"##), @@ -3023,7 +4664,7 @@ fn main() { None, Some(r##"Required. The name of the version. You can get the names of all the versions of a model by calling - [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list)."##), + projects.models.versions.list."##), Some(true), Some(false)), @@ -3043,7 +4684,7 @@ fn main() { Some(r##"Gets information about a model version. Models can have multiple versions. You can call - [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list) + projects.models.versions.list to get the same information that this method returns for all of the versions of a model."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-get", @@ -3098,8 +4739,8 @@ fn main() { ("models-versions-patch", Some(r##"Updates the specified Version resource. - Currently the only update-able fields are `description` and - `autoScaling.minNodes`."##), + Currently the only update-able fields are `description`, + `requestLoggingConfig`, `autoScaling.minNodes`, and `manualScaling.nodes`."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_models-versions-patch", vec![ (Some(r##"name"##), @@ -3141,7 +4782,7 @@ fn main() { None, Some(r##"Required. The name of the version to make the default for the model. You can get the names of all the versions of a model by calling - [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list)."##), + projects.models.versions.list."##), Some(true), Some(false)), @@ -3250,10 +4891,9 @@ fn main() { Some(false)), ]), ("predict", - Some(r##"Performs prediction on the data in the request. - AI Platform implements a custom `predict` verb on top of an HTTP POST - method.

          For details of the request and response format, see the **guide - to the [predict request format](/ml-engine/docs/v1/predict-request)**."##), + Some(r##"Performs online prediction on the data in the request. + +

          {% dynamic include "/ai-platform/includes/___predict-request" %}
          "##), "Details at http://byron.github.io/google-apis-rs/google_ml1_cli/projects_predict", vec![ (Some(r##"name"##), @@ -3288,7 +4928,7 @@ fn main() { let mut app = App::new("ml1") .author("Sebastian Thiel ") - .version("1.0.12+20190621") + .version("1.0.13+20200328") .about("An API to enable creating and using machine learning models.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_ml1_cli") .arg(Arg::with_name("url") diff --git a/gen/ml1/Cargo.toml b/gen/ml1/Cargo.toml index ca19fbfd0b..8ce532cab3 100644 --- a/gen/ml1/Cargo.toml +++ b/gen/ml1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-ml1" -version = "1.0.12+20190621" +version = "1.0.13+20200328" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Machine Learning Engine (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/ml1" homepage = "https://cloud.google.com/ml/" -documentation = "https://docs.rs/google-ml1/1.0.12+20190621" +documentation = "https://docs.rs/google-ml1/1.0.13+20200328" license = "MIT" keywords = ["ml", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/ml1/README.md b/gen/ml1/README.md index f39ab7df5b..a18bd1bf8e 100644 --- a/gen/ml1/README.md +++ b/gen/ml1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-ml1` library allows access to all features of the *Google Cloud Machine Learning Engine* service. -This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.12+20190621*, where *20190621* is the exact revision of the *ml:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.13+20200328*, where *20200328* is the exact revision of the *ml:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Machine Learning Engine* *v1* API can be found at the [official documentation site](https://cloud.google.com/ml/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.CloudMachineLearningEngine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.CloudMachineLearningEngine.html) ... * projects - * [*get config*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectGetConfigCall.html), [*jobs cancel*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobCancelCall.html), [*jobs create*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobCreateCall.html), [*jobs get*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobGetCall.html), [*jobs get iam policy*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobGetIamPolicyCall.html), [*jobs list*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobListCall.html), [*jobs patch*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobPatchCall.html), [*jobs set iam policy*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectJobTestIamPermissionCall.html), [*locations get*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectLocationListCall.html), [*models create*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelCreateCall.html), [*models delete*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelDeleteCall.html), [*models get*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelGetCall.html), [*models get iam policy*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelGetIamPolicyCall.html), [*models list*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelListCall.html), [*models patch*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelPatchCall.html), [*models set iam policy*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelSetIamPolicyCall.html), [*models test iam permissions*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelTestIamPermissionCall.html), [*models versions create*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelVersionCreateCall.html), [*models versions delete*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelVersionDeleteCall.html), [*models versions get*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelVersionGetCall.html), [*models versions list*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelVersionListCall.html), [*models versions patch*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelVersionPatchCall.html), [*models versions set default*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectOperationCancelCall.html), [*operations get*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectOperationListCall.html) and [*predict*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.ProjectPredictCall.html) + * [*explain*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectExplainCall.html), [*get config*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectGetConfigCall.html), [*jobs cancel*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobCancelCall.html), [*jobs create*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobCreateCall.html), [*jobs get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobGetCall.html), [*jobs get iam policy*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobGetIamPolicyCall.html), [*jobs list*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobListCall.html), [*jobs patch*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobPatchCall.html), [*jobs set iam policy*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectJobTestIamPermissionCall.html), [*locations get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationOperationGetCall.html), [*locations studies create*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyCreateCall.html), [*locations studies delete*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyDeleteCall.html), [*locations studies get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyGetCall.html), [*locations studies list*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyListCall.html), [*locations studies trials add measurement*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialAddMeasurementCall.html), [*locations studies trials check early stopping state*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialCheckEarlyStoppingStateCall.html), [*locations studies trials complete*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialCompleteCall.html), [*locations studies trials create*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialCreateCall.html), [*locations studies trials delete*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialDeleteCall.html), [*locations studies trials get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialGetCall.html), [*locations studies trials list*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialListCall.html), [*locations studies trials stop*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialStopCall.html), [*locations studies trials suggest*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectLocationStudyTrialSuggestCall.html), [*models create*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelCreateCall.html), [*models delete*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelDeleteCall.html), [*models get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelGetCall.html), [*models get iam policy*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelGetIamPolicyCall.html), [*models list*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelListCall.html), [*models patch*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelPatchCall.html), [*models set iam policy*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelSetIamPolicyCall.html), [*models test iam permissions*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelTestIamPermissionCall.html), [*models versions create*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelVersionCreateCall.html), [*models versions delete*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelVersionDeleteCall.html), [*models versions get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelVersionGetCall.html), [*models versions list*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelVersionListCall.html), [*models versions patch*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelVersionPatchCall.html), [*models versions set default*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectOperationCancelCall.html), [*operations get*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectOperationListCall.html) and [*predict*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.ProjectPredictCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/struct.CloudMachineLearningEngine.html)** +* **[Hub](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/struct.CloudMachineLearningEngine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.Part.html)** + * **[Parts](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,10 +47,13 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.projects().locations_studies_trials_suggest(...).doit() let r = hub.projects().models_versions_create(...).doit() let r = hub.projects().models_versions_patch(...).doit() let r = hub.projects().operations_get(...).doit() let r = hub.projects().models_versions_delete(...).doit() +let r = hub.projects().locations_operations_get(...).doit() +let r = hub.projects().locations_studies_trials_check_early_stopping_state(...).doit() let r = hub.projects().models_delete(...).doit() let r = hub.projects().models_patch(...).doit() ``` @@ -136,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-ml1/1.0.12+20190621/google_ml1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-ml1/1.0.13+20200328/google_ml1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/ml1/src/lib.rs b/gen/ml1/src/lib.rs index 3ff9a0e878..c59c238c58 100644 --- a/gen/ml1/src/lib.rs +++ b/gen/ml1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.12+20190621*, where *20190621* is the exact revision of the *ml:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.13+20200328*, where *20200328* is the exact revision of the *ml:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Machine Learning Engine* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/ml/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.CloudMachineLearningEngine.html) ... //! //! * projects -//! * [*get config*](struct.ProjectGetConfigCall.html), [*jobs cancel*](struct.ProjectJobCancelCall.html), [*jobs create*](struct.ProjectJobCreateCall.html), [*jobs get*](struct.ProjectJobGetCall.html), [*jobs get iam policy*](struct.ProjectJobGetIamPolicyCall.html), [*jobs list*](struct.ProjectJobListCall.html), [*jobs patch*](struct.ProjectJobPatchCall.html), [*jobs set iam policy*](struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](struct.ProjectJobTestIamPermissionCall.html), [*locations get*](struct.ProjectLocationGetCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*models create*](struct.ProjectModelCreateCall.html), [*models delete*](struct.ProjectModelDeleteCall.html), [*models get*](struct.ProjectModelGetCall.html), [*models get iam policy*](struct.ProjectModelGetIamPolicyCall.html), [*models list*](struct.ProjectModelListCall.html), [*models patch*](struct.ProjectModelPatchCall.html), [*models set iam policy*](struct.ProjectModelSetIamPolicyCall.html), [*models test iam permissions*](struct.ProjectModelTestIamPermissionCall.html), [*models versions create*](struct.ProjectModelVersionCreateCall.html), [*models versions delete*](struct.ProjectModelVersionDeleteCall.html), [*models versions get*](struct.ProjectModelVersionGetCall.html), [*models versions list*](struct.ProjectModelVersionListCall.html), [*models versions patch*](struct.ProjectModelVersionPatchCall.html), [*models versions set default*](struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](struct.ProjectOperationCancelCall.html), [*operations get*](struct.ProjectOperationGetCall.html), [*operations list*](struct.ProjectOperationListCall.html) and [*predict*](struct.ProjectPredictCall.html) +//! * [*explain*](struct.ProjectExplainCall.html), [*get config*](struct.ProjectGetConfigCall.html), [*jobs cancel*](struct.ProjectJobCancelCall.html), [*jobs create*](struct.ProjectJobCreateCall.html), [*jobs get*](struct.ProjectJobGetCall.html), [*jobs get iam policy*](struct.ProjectJobGetIamPolicyCall.html), [*jobs list*](struct.ProjectJobListCall.html), [*jobs patch*](struct.ProjectJobPatchCall.html), [*jobs set iam policy*](struct.ProjectJobSetIamPolicyCall.html), [*jobs test iam permissions*](struct.ProjectJobTestIamPermissionCall.html), [*locations get*](struct.ProjectLocationGetCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*locations operations cancel*](struct.ProjectLocationOperationCancelCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html), [*locations studies create*](struct.ProjectLocationStudyCreateCall.html), [*locations studies delete*](struct.ProjectLocationStudyDeleteCall.html), [*locations studies get*](struct.ProjectLocationStudyGetCall.html), [*locations studies list*](struct.ProjectLocationStudyListCall.html), [*locations studies trials add measurement*](struct.ProjectLocationStudyTrialAddMeasurementCall.html), [*locations studies trials check early stopping state*](struct.ProjectLocationStudyTrialCheckEarlyStoppingStateCall.html), [*locations studies trials complete*](struct.ProjectLocationStudyTrialCompleteCall.html), [*locations studies trials create*](struct.ProjectLocationStudyTrialCreateCall.html), [*locations studies trials delete*](struct.ProjectLocationStudyTrialDeleteCall.html), [*locations studies trials get*](struct.ProjectLocationStudyTrialGetCall.html), [*locations studies trials list*](struct.ProjectLocationStudyTrialListCall.html), [*locations studies trials stop*](struct.ProjectLocationStudyTrialStopCall.html), [*locations studies trials suggest*](struct.ProjectLocationStudyTrialSuggestCall.html), [*models create*](struct.ProjectModelCreateCall.html), [*models delete*](struct.ProjectModelDeleteCall.html), [*models get*](struct.ProjectModelGetCall.html), [*models get iam policy*](struct.ProjectModelGetIamPolicyCall.html), [*models list*](struct.ProjectModelListCall.html), [*models patch*](struct.ProjectModelPatchCall.html), [*models set iam policy*](struct.ProjectModelSetIamPolicyCall.html), [*models test iam permissions*](struct.ProjectModelTestIamPermissionCall.html), [*models versions create*](struct.ProjectModelVersionCreateCall.html), [*models versions delete*](struct.ProjectModelVersionDeleteCall.html), [*models versions get*](struct.ProjectModelVersionGetCall.html), [*models versions list*](struct.ProjectModelVersionListCall.html), [*models versions patch*](struct.ProjectModelVersionPatchCall.html), [*models versions set default*](struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](struct.ProjectOperationCancelCall.html), [*operations get*](struct.ProjectOperationGetCall.html), [*operations list*](struct.ProjectOperationListCall.html) and [*predict*](struct.ProjectPredictCall.html) //! //! //! @@ -47,10 +47,13 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.projects().locations_studies_trials_suggest(...).doit() //! let r = hub.projects().models_versions_create(...).doit() //! let r = hub.projects().models_versions_patch(...).doit() //! let r = hub.projects().operations_get(...).doit() //! let r = hub.projects().models_versions_delete(...).doit() +//! let r = hub.projects().locations_operations_get(...).doit() +//! let r = hub.projects().locations_studies_trials_check_early_stopping_state(...).doit() //! let r = hub.projects().models_delete(...).doit() //! let r = hub.projects().models_patch(...).doit() //! ``` @@ -237,12 +240,16 @@ pub use cmn::*; pub enum Scope { /// View and manage your data across Google Cloud Platform services CloudPlatform, + + /// View your data across Google Cloud Platform services + CloudPlatformReadOnly, } impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", } } } @@ -336,7 +343,7 @@ impl<'a, C, A> CloudMachineLearningEngine CloudMachineLearningEngine { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://ml.googleapis.com/".to_string(), _root_url: "https://ml.googleapis.com/".to_string(), } @@ -347,7 +354,7 @@ impl<'a, C, A> CloudMachineLearningEngine } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -400,88 +407,42 @@ pub struct GoogleCloudMlV1__BuiltInAlgorithmOutput { impl Part for GoogleCloudMlV1__BuiltInAlgorithmOutput {} -/// Represents the configuration for a replica in a cluster. +/// Attributes credit by computing the Aumann-Shapley value taking advantage +/// of the model's fully differentiable structure. Refer to this paper for +/// more details: http://proceedings.mlr.press/v70/sundararajan17a.html /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__ReplicaConfig { - /// TensorFlow version used in the custom container. This field is required if - /// the replica is a TPU worker that uses a custom container. Otherwise, do not - /// specify this field. - #[serde(rename="tpuTfVersion")] - pub tpu_tf_version: Option, - /// Represents the type and number of accelerators used by the replica. - /// [Learn about restrictions on accelerator configurations for - /// training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-machine-types-with-gpu) - #[serde(rename="acceleratorConfig")] - pub accelerator_config: Option, - /// The Docker image to run on the replica. This image must be in Container - /// Registry. Learn more about [configuring custom - /// containers](/ml-engine/docs/distributed-training-containers). - #[serde(rename="imageUri")] - pub image_uri: Option, +pub struct GoogleCloudMlV1__IntegratedGradientsAttribution { + /// Number of steps for approximating the path integral. + /// A good value to start is 50 and gradually increase until the + /// sum to diff property is met within the desired error range. + #[serde(rename="numIntegralSteps")] + pub num_integral_steps: Option, } -impl Part for GoogleCloudMlV1__ReplicaConfig {} +impl Part for GoogleCloudMlV1__IntegratedGradientsAttribution {} -/// Response message for the ListJobs method. +/// Request for explanations to be issued against a trained model. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [jobs list projects](struct.ProjectJobListCall.html) (response) +/// * [explain projects](struct.ProjectExplainCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__ListJobsResponse { - /// Optional. Pass this token as the `page_token` field of the request for a - /// subsequent call. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of jobs. - pub jobs: Option>, +pub struct GoogleCloudMlV1__ExplainRequest { + /// Required. + /// The explanation request body. + #[serde(rename="httpBody")] + pub http_body: Option, } -impl ResponseResult for GoogleCloudMlV1__ListJobsResponse {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__Config { - /// The service account Cloud ML uses to run on TPU node. - #[serde(rename="tpuServiceAccount")] - pub tpu_service_account: Option, -} - -impl Part for GoogleCloudMlV1__Config {} - - -/// Response message for the ListVersions method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [models versions list projects](struct.ProjectModelVersionListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__ListVersionsResponse { - /// Optional. Pass this token as the `page_token` field of the request for a - /// subsequent call. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of versions. - pub versions: Option>, -} - -impl ResponseResult for GoogleCloudMlV1__ListVersionsResponse {} +impl RequestValue for GoogleCloudMlV1__ExplainRequest {} /// Request message for the SetDefaultVersion request. @@ -499,24 +460,77 @@ pub struct GoogleCloudMlV1__SetDefaultVersionRequest { _never_set: Option impl RequestValue for GoogleCloudMlV1__SetDefaultVersionRequest {} -/// There is no detailed description. +/// A message representing a Measurement. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__Location { - /// no description provided - pub name: Option, - /// Capabilities available in the location. - pub capabilities: Option>, +pub struct GoogleCloudMlV1__Measurement { + /// Time that the Trial has been running at the point of this Measurement. + #[serde(rename="elapsedTime")] + pub elapsed_time: Option, + /// Provides a list of metrics that act as inputs into the objective + /// function. + pub metrics: Option>, + /// The number of steps a machine learning model has been trained for. + /// Must be non-negative. + #[serde(rename="stepCount")] + pub step_count: Option, } -impl ResponseResult for GoogleCloudMlV1__Location {} +impl Part for GoogleCloudMlV1__Measurement {} + + +/// Represents the configuration for a replica in a cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ReplicaConfig { + /// The AI Platform runtime version that includes a TensorFlow version matching + /// the one used in the custom container. This field is required if the replica + /// is a TPU worker that uses a custom container. Otherwise, do not specify + /// this field. This must be a [runtime version that currently supports + /// training with + /// TPUs](/ml-engine/docs/tensorflow/runtime-version-list#tpu-support). + /// + /// Note that the version of TensorFlow included in a runtime version may + /// differ from the numbering of the runtime version itself, because it may + /// have a different [patch + /// version](https://www.tensorflow.org/guide/version_compat#semantic_versioning_20). + /// In this field, you must specify the runtime version (TensorFlow minor + /// version). For example, if your custom container runs TensorFlow `1.x.y`, + /// specify `1.x`. + #[serde(rename="tpuTfVersion")] + pub tpu_tf_version: Option, + /// Represents the type and number of accelerators used by the replica. + /// [Learn about restrictions on accelerator configurations for + /// training.](/ai-platform/training/docs/using-gpus#compute-engine-machine-types-with-gpu) + #[serde(rename="acceleratorConfig")] + pub accelerator_config: Option, + /// The Docker image to run on the replica. This image must be in Container + /// Registry. Learn more about [configuring custom + /// containers](/ai-platform/training/docs/distributed-training-containers). + #[serde(rename="imageUri")] + pub image_uri: Option, +} + +impl Part for GoogleCloudMlV1__ReplicaConfig {} + + +/// Represents a metric to optimize. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1_StudyConfig_MetricSpec { + /// Required. The name of the metric. + pub metric: Option, + /// Required. The optimization goal of the metric. + pub goal: Option, +} + +impl Part for GoogleCloudMlV1_StudyConfig_MetricSpec {} /// Represents the result of a single hyperparameter tuning trial from a @@ -560,87 +574,19 @@ pub struct GoogleCloudMlV1__HyperparameterOutput { impl Part for GoogleCloudMlV1__HyperparameterOutput {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. -/// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. -/// -/// **JSON Example** -/// -/// ````text -/// { -/// "bindings": [ -/// { -/// "role": "roles/owner", -/// "members": [ -/// "user:mike@example.com", -/// "group:admins@example.com", -/// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" -/// ] -/// }, -/// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] -/// } -/// ] -/// } -/// ```` -/// -/// **YAML Example** -/// -/// ````text -/// bindings: -/// - members: -/// - user:mike@example.com -/// - group:admins@example.com -/// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner -/// - members: -/// - user:sean@example.com -/// role: roles/viewer -/// ```` -/// -/// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// There is no detailed description. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [models set iam policy projects](struct.ProjectModelSetIamPolicyCall.html) (response) -/// * [jobs set iam policy projects](struct.ProjectJobSetIamPolicyCall.html) (response) -/// * [models get iam policy projects](struct.ProjectModelGetIamPolicyCall.html) (response) -/// * [jobs get iam policy projects](struct.ProjectJobGetIamPolicyCall.html) (response) +/// * [locations studies trials stop projects](struct.ProjectLocationStudyTrialStopCall.html) (request) +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleIamV1__Policy { - /// Specifies cloud audit logging configuration for this policy. - #[serde(rename="auditConfigs")] - pub audit_configs: Option>, - /// `etag` is used for optimistic concurrency control as a way to help - /// prevent simultaneous updates of a policy from overwriting each other. - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the policy. - /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. - pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, - /// Deprecated. - pub version: Option, -} +pub struct GoogleCloudMlV1__StopTrialRequest { _never_set: Option } -impl ResponseResult for GoogleIamV1__Policy {} +impl RequestValue for GoogleCloudMlV1__StopTrialRequest {} /// Message that represents an arbitrary HTTP body. It should only be used for @@ -691,6 +637,7 @@ impl ResponseResult for GoogleIamV1__Policy {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [explain projects](struct.ProjectExplainCall.html) (response) /// * [predict projects](struct.ProjectPredictCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleApi__HttpBody { @@ -724,246 +671,83 @@ impl ResponseResult for GoogleApi__HttpBody {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations studies delete projects](struct.ProjectLocationStudyDeleteCall.html) (response) /// * [jobs cancel projects](struct.ProjectJobCancelCall.html) (response) /// * [operations cancel projects](struct.ProjectOperationCancelCall.html) (response) +/// * [locations studies trials delete projects](struct.ProjectLocationStudyTrialDeleteCall.html) (response) +/// * [locations operations cancel projects](struct.ProjectLocationOperationCancelCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleProtobuf__Empty { _never_set: Option } impl ResponseResult for GoogleProtobuf__Empty {} -/// Represents a set of hyperparameters to optimize. +/// Represents results of a prediction job. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__HyperparameterSpec { - /// Optional. How many training trials should be attempted to optimize - /// the specified hyperparameters. - /// - /// Defaults to one. - #[serde(rename="maxTrials")] - pub max_trials: Option, - /// Required. The type of goal to use for tuning. Available types are - /// `MAXIMIZE` and `MINIMIZE`. - /// - /// Defaults to `MAXIMIZE`. - pub goal: Option, - /// Optional. The search algorithm specified for the hyperparameter - /// tuning job. - /// Uses the default AI Platform hyperparameter tuning - /// algorithm if unspecified. - pub algorithm: Option, - /// Optional. The number of failed trials that need to be seen before failing - /// the hyperparameter tuning job. You can specify this field to override the - /// default failing criteria for AI Platform hyperparameter tuning jobs. - /// - /// Defaults to zero, which means the service decides when a hyperparameter - /// job should fail. - #[serde(rename="maxFailedTrials")] - pub max_failed_trials: Option, - /// Optional. Indicates if the hyperparameter tuning job enables auto trial - /// early stopping. - #[serde(rename="enableTrialEarlyStopping")] - pub enable_trial_early_stopping: Option, - /// Optional. The prior hyperparameter tuning job id that users hope to - /// continue with. The job id will be used to find the corresponding vizier - /// study guid and resume the study. - #[serde(rename="resumePreviousJobId")] - pub resume_previous_job_id: Option, - /// Required. The set of parameters to tune. - pub params: Option>, - /// Optional. The TensorFlow summary tag name to use for optimizing trials. For - /// current versions of TensorFlow, this tag name should exactly match what is - /// shown in TensorBoard, including all scopes. For versions of TensorFlow - /// prior to 0.12, this should be only the tag passed to tf.Summary. - /// By default, "training/hptuning/metric" will be used. - #[serde(rename="hyperparameterMetricTag")] - pub hyperparameter_metric_tag: Option, - /// Optional. The number of training trials to run concurrently. - /// You can reduce the time it takes to perform hyperparameter tuning by adding - /// trials in parallel. However, each trail only benefits from the information - /// gained in completed trials. That means that a trial does not get access to - /// the results of trials running at the same time, which could reduce the - /// quality of the overall optimization. - /// - /// Each trial will use the same scale tier and machine types. - /// - /// Defaults to one. - #[serde(rename="maxParallelTrials")] - pub max_parallel_trials: Option, +pub struct GoogleCloudMlV1__PredictionOutput { + /// Node hours used by the batch prediction job. + #[serde(rename="nodeHours")] + pub node_hours: Option, + /// The output Google Cloud Storage location provided at the job creation time. + #[serde(rename="outputPath")] + pub output_path: Option, + /// The number of generated predictions. + #[serde(rename="predictionCount")] + pub prediction_count: Option, + /// The number of data instances which resulted in errors. + #[serde(rename="errorCount")] + pub error_count: Option, } -impl Part for GoogleCloudMlV1__HyperparameterSpec {} +impl Part for GoogleCloudMlV1__PredictionOutput {} -/// An observed value of a metric. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric { - /// The global training step for this metric. - #[serde(rename="trainingStep")] - pub training_step: Option, - /// The objective value at this training step. - #[serde(rename="objectiveValue")] - pub objective_value: Option, +pub struct GoogleCloudMlV1_StudyConfigParameterSpec_CategoricalValueSpec { + /// Must be specified if type is `CATEGORICAL`. + /// The list of possible categories. + pub values: Option>, } -impl Part for GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric {} +impl Part for GoogleCloudMlV1_StudyConfigParameterSpec_CategoricalValueSpec {} -/// This resource represents a long-running operation that is the result of a -/// network API call. +/// Represents the spec to match integer values from parent parameter. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [models versions create projects](struct.ProjectModelVersionCreateCall.html) (response) -/// * [models versions patch projects](struct.ProjectModelVersionPatchCall.html) (response) -/// * [operations get projects](struct.ProjectOperationGetCall.html) (response) -/// * [models versions delete projects](struct.ProjectModelVersionDeleteCall.html) (response) -/// * [models delete projects](struct.ProjectModelDeleteCall.html) (response) -/// * [models patch projects](struct.ProjectModelPatchCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleLongrunning__Operation { - /// The error result of the operation in case of failure or cancellation. - pub error: Option, - /// If the value is `false`, it means the operation is still in progress. - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - pub done: Option, - /// The normal response of the operation in case of success. If the original - /// method returns no data on success, such as `Delete`, the response is - /// `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` - /// is the original method name. For example, if the original method name - /// is `TakeSnapshot()`, the inferred response type is - /// `TakeSnapshotResponse`. - pub response: Option>, - /// The server-assigned name, which is only unique within the same service that - /// originally returns it. If you use the default HTTP mapping, the - /// `name` should be a resource name ending with `operations/{unique_id}`. - pub name: Option, - /// Service-specific metadata associated with the operation. It typically - /// contains progress information and common metadata such as create time. - /// Some services might not provide such metadata. Any method that returns a - /// long-running operation should document the metadata type, if any. - pub metadata: Option>, +pub struct GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentIntValueSpec { + /// Matches values of the parent parameter with type 'INTEGER'. + /// All values must lie in `integer_value_spec` of parent parameter. + pub values: Option>, } -impl ResponseResult for GoogleLongrunning__Operation {} +impl Part for GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentIntValueSpec {} -/// Represents a machine learning solution. +/// There is no detailed description. /// -/// A model can have multiple versions, each of which is a deployed, trained -/// model ready to receive prediction requests. The model itself is just a -/// container. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [models get projects](struct.ProjectModelGetCall.html) (response) -/// * [models patch projects](struct.ProjectModelPatchCall.html) (request) -/// * [models create projects](struct.ProjectModelCreateCall.html) (request|response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__Model { - /// Optional. The description specified for the model when it was created. - pub description: Option, - /// Optional. If true, online prediction nodes send `stderr` and `stdout` - /// streams to Stackdriver Logging. These can be more verbose than the standard - /// access logs (see `onlinePredictionLogging`) and can incur higher cost. - /// However, they are helpful for debugging. Note that - /// [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if - /// your project receives prediction requests at a high QPS. Estimate your - /// costs before enabling this option. - /// - /// Default is false. - #[serde(rename="onlinePredictionConsoleLogging")] - pub online_prediction_console_logging: Option, - /// Optional. One or more labels that you can add, to organize your models. - /// Each label is a key-value pair, where both the key and the value are - /// arbitrary strings that you supply. - /// For more information, see the documentation on - /// using labels. - pub labels: Option>, - /// Optional. The list of regions where the model is going to be deployed. - /// Currently only one region per model is supported. - /// Defaults to 'us-central1' if nothing is set. - /// See the available regions - /// for AI Platform services. - /// Note: - /// - /// * No matter where a model is deployed, it can always be accessed by - /// users from anywhere, both for online and batch prediction. - /// * The region for a batch prediction job is set by the region field when - /// submitting the batch prediction job and does not take its value from - /// this field. - pub regions: Option>, - /// `etag` is used for optimistic concurrency control as a way to help - /// prevent simultaneous updates of a model from overwriting each other. - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform model updates in order to avoid race - /// conditions: An `etag` is returned in the response to `GetModel`, and - /// systems are expected to put that etag in the request to `UpdateModel` to - /// ensure that their change will be applied to the model as intended. - pub etag: Option, - /// Output only. The default version of the model. This version will be used to - /// handle prediction requests that do not specify a version. - /// - /// You can change the default version by calling - /// [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). - #[serde(rename="defaultVersion")] - pub default_version: Option, - /// Optional. If true, online prediction access logs are sent to StackDriver - /// Logging. These logs are like standard server access logs, containing - /// information like timestamp and latency for each request. Note that - /// [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if - /// your project receives prediction requests at a high queries per second rate - /// (QPS). Estimate your costs before enabling this option. - /// - /// Default is false. - #[serde(rename="onlinePredictionLogging")] - pub online_prediction_logging: Option, - /// Required. The name specified for the model when it was created. - /// - /// The model name must be unique within the project it is created in. - pub name: Option, +pub struct GoogleCloudMlV1_StudyConfigParameterSpec_IntegerValueSpec { + /// Must be specified if type is `INTEGER`. Maximum value of the parameter. + #[serde(rename="maxValue")] + pub max_value: Option, + /// Must be specified if type is `INTEGER`. Minimum value of the parameter. + #[serde(rename="minValue")] + pub min_value: Option, } -impl RequestValue for GoogleCloudMlV1__Model {} -impl ResponseResult for GoogleCloudMlV1__Model {} - - -/// Request message for `TestIamPermissions` method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [jobs test iam permissions projects](struct.ProjectJobTestIamPermissionCall.html) (request) -/// * [models test iam permissions projects](struct.ProjectModelTestIamPermissionCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleIamV1__TestIamPermissionsRequest { - /// The set of permissions to check for the `resource`. Permissions with - /// wildcards (such as '*' or 'storage.*') are not allowed. For more - /// information see - /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - pub permissions: Option>, -} - -impl RequestValue for GoogleIamV1__TestIamPermissionsRequest {} +impl Part for GoogleCloudMlV1_StudyConfigParameterSpec_IntegerValueSpec {} /// Represents a single hyperparameter to optimize. @@ -1010,186 +794,74 @@ pub struct GoogleCloudMlV1__ParameterSpec { impl Part for GoogleCloudMlV1__ParameterSpec {} -/// Specifies the audit configuration for a service. -/// The configuration determines which permission types are logged, and what -/// identities, if any, are exempted from logging. -/// An AuditConfig must have one or more AuditLogConfigs. +/// The request message for the CompleteTrial service method. /// -/// If there are AuditConfigs for both `allServices` and a specific service, -/// the union of the two AuditConfigs is used for that service: the log_types -/// specified in each AuditConfig are enabled, and the exempted_members in each -/// AuditLogConfig are exempted. +/// # Activities /// -/// Example Policy with multiple AuditConfigs: +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// ````text -/// { -/// "audit_configs": [ -/// { -/// "service": "allServices" -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// "exempted_members": [ -/// "user:foo@gmail.com" -/// ] -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// }, -/// { -/// "log_type": "ADMIN_READ", -/// } -/// ] -/// }, -/// { -/// "service": "fooservice.googleapis.com" -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// "exempted_members": [ -/// "user:bar@gmail.com" -/// ] -/// } -/// ] -/// } -/// ] -/// } -/// ```` +/// * [locations studies trials complete projects](struct.ProjectLocationStudyTrialCompleteCall.html) (request) /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. -/// -/// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleIamV1__AuditConfig { - /// The configuration for logging of each type of permission. - #[serde(rename="auditLogConfigs")] - pub audit_log_configs: Option>, - /// Specifies a service that will be enabled for audit logging. - /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - /// `allServices` is a special value that covers all services. - pub service: Option, +pub struct GoogleCloudMlV1__CompleteTrialRequest { + /// Optional. A human readable reason why the Trial was infeasible. This should + /// only be provided if `trial_infeasible` is true. + #[serde(rename="infeasibleReason")] + pub infeasible_reason: Option, + /// Optional. If provided, it will be used as the completed trial's + /// final_measurement; Otherwise, the service will auto-select a + /// previously reported measurement as the final-measurement + #[serde(rename="finalMeasurement")] + pub final_measurement: Option, + /// Optional. True if the trial cannot be run with the given Parameter, and + /// final_measurement will be ignored. + #[serde(rename="trialInfeasible")] + pub trial_infeasible: Option, } -impl Part for GoogleIamV1__AuditConfig {} +impl RequestValue for GoogleCloudMlV1__CompleteTrialRequest {} -/// Represents input parameters for a training job. When using the -/// gcloud command to submit your training job, you can specify -/// the input parameters as command-line arguments and/or in a YAML configuration -/// file referenced from the --config command-line argument. For -/// details, see the guide to -/// submitting a training -/// job. +/// Represents input parameters for a training job. When using the gcloud command +/// to submit your training job, you can specify the input parameters as +/// command-line arguments and/or in a YAML configuration file referenced from +/// the --config command-line argument. For details, see the guide to [submitting +/// a training job](/ai-platform/training/docs/training-jobs). /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudMlV1__TrainingInput { - /// Optional. The AI Platform runtime version to use for training. If not - /// set, AI Platform uses the default stable version, 1.0. For more - /// information, see the - /// runtime version list - /// and - /// how to manage runtime versions. + /// Optional. Specifies the type of virtual machine to use for your training + /// job's evaluator nodes. + /// + /// The supported values are the same as those described in the entry for + /// `masterType`. + /// + /// This value must be consistent with the category of machine type that + /// `masterType` uses. In other words, both must be Compute Engine machine + /// types or both must be legacy machine types. + /// + /// This value must be present when `scaleTier` is set to `CUSTOM` and + /// `evaluatorCount` is greater than zero. + #[serde(rename="evaluatorType")] + pub evaluator_type: Option, + /// Optional. The AI Platform runtime version to use for training. You must + /// either specify this field or specify `masterConfig.imageUri`. + /// + /// For more information, see the [runtime version + /// list](/ai-platform/training/docs/runtime-version-list) and learn [how to + /// manage runtime versions](/ai-platform/training/docs/versioning). #[serde(rename="runtimeVersion")] pub runtime_version: Option, /// Optional. Specifies the type of virtual machine to use for your training - /// job's master worker. + /// job's master worker. You must specify this field when `scaleTier` is set to + /// `CUSTOM`. /// + /// You can use certain Compute Engine machine types directly in this field. /// The following types are supported: /// - ///
          - ///
          standard
          - ///
          - /// A basic machine configuration suitable for training simple models with - /// small to moderate datasets. - ///
          - ///
          large_model
          - ///
          - /// A machine with a lot of memory, specially suited for parameter servers - /// when your model is large (having many hidden layers or layers with very - /// large numbers of nodes). - ///
          - ///
          complex_model_s
          - ///
          - /// A machine suitable for the master and workers of the cluster when your - /// model requires more computation than the standard machine can handle - /// satisfactorily. - ///
          - ///
          complex_model_m
          - ///
          - /// A machine with roughly twice the number of cores and roughly double the - /// memory of complex_model_s. - ///
          - ///
          complex_model_l
          - ///
          - /// A machine with roughly twice the number of cores and roughly double the - /// memory of complex_model_m. - ///
          - ///
          standard_gpu
          - ///
          - /// A machine equivalent to standard that - /// also includes a single NVIDIA Tesla K80 GPU. See more about - /// using GPUs to - /// train your model. - ///
          - ///
          complex_model_m_gpu
          - ///
          - /// A machine equivalent to complex_model_m that also includes - /// four NVIDIA Tesla K80 GPUs. - ///
          - ///
          complex_model_l_gpu
          - ///
          - /// A machine equivalent to complex_model_l that also includes - /// eight NVIDIA Tesla K80 GPUs. - ///
          - ///
          standard_p100
          - ///
          - /// A machine equivalent to standard that - /// also includes a single NVIDIA Tesla P100 GPU. - ///
          - ///
          complex_model_m_p100
          - ///
          - /// A machine equivalent to complex_model_m that also includes - /// four NVIDIA Tesla P100 GPUs. - ///
          - ///
          standard_v100
          - ///
          - /// A machine equivalent to standard that - /// also includes a single NVIDIA Tesla V100 GPU. - ///
          - ///
          large_model_v100
          - ///
          - /// A machine equivalent to large_model that - /// also includes a single NVIDIA Tesla V100 GPU. - ///
          - ///
          complex_model_m_v100
          - ///
          - /// A machine equivalent to complex_model_m that - /// also includes four NVIDIA Tesla V100 GPUs. - ///
          - ///
          complex_model_l_v100
          - ///
          - /// A machine equivalent to complex_model_l that - /// also includes eight NVIDIA Tesla V100 GPUs. - ///
          - ///
          cloud_tpu
          - ///
          - /// A TPU VM including one Cloud TPU. See more about - /// using TPUs to train - /// your model. - ///
          - ///
          - /// - /// You may also use certain Compute Engine machine types directly in this - /// field. The following types are supported: - /// /// - `n1-standard-4` /// - `n1-standard-8` /// - `n1-standard-16` @@ -1208,15 +880,43 @@ pub struct GoogleCloudMlV1__TrainingInput { /// - `n1-highcpu-64` /// - `n1-highcpu-96` /// - /// See more about [using Compute Engine machine - /// types](/ml-engine/docs/tensorflow/machine-types#compute-engine-machine-types). + /// Learn more about [using Compute Engine machine + /// types](/ml-engine/docs/machine-types#compute-engine-machine-types). /// - /// You must set this value when `scaleTier` is set to `CUSTOM`. + /// Alternatively, you can use the following legacy machine types: + /// + /// - `standard` + /// - `large_model` + /// - `complex_model_s` + /// - `complex_model_m` + /// - `complex_model_l` + /// - `standard_gpu` + /// - `complex_model_m_gpu` + /// - `complex_model_l_gpu` + /// - `standard_p100` + /// - `complex_model_m_p100` + /// - `standard_v100` + /// - `large_model_v100` + /// - `complex_model_m_v100` + /// - `complex_model_l_v100` + /// + /// Learn more about [using legacy machine + /// types](/ml-engine/docs/machine-types#legacy-machine-types). + /// + /// Finally, if you want to use a TPU for training, specify `cloud_tpu` in this + /// field. Learn more about the [special configuration options for training + /// with + /// TPUs](/ml-engine/docs/tensorflow/using-tpus#configuring_a_custom_tpu_machine). #[serde(rename="masterType")] pub master_type: Option, /// Optional. The set of Hyperparameters to tune. pub hyperparameters: Option, - /// Optional. Command line arguments to pass to the program. + /// Optional. Arguments passed to the training. + /// - If it is a python package training: + /// It will be passed as command line argument to the program. + /// - If it is a custom container training, + /// It will be passed as an argument to the custom container + /// image. pub args: Option>, /// Required. The Python module name to run after installing the packages. #[serde(rename="pythonModule")] @@ -1236,19 +936,33 @@ pub struct GoogleCloudMlV1__TrainingInput { /// The default value is zero. #[serde(rename="workerCount")] pub worker_count: Option, - /// Optional. The maximum job running time. The default is 7 days. - #[serde(rename="maxRunningTime")] - pub max_running_time: Option, + /// Optional. Scheduling options for a training job. + pub scheduling: Option, + /// Custom encryption key options for a training job. If this is set, + /// then all resources created by the training job will be encrypted with the + /// provided encryption key. + #[serde(rename="encryptionConfig")] + pub encryption_config: Option, /// Optional. The number of parameter server replicas to use for the training /// job. Each replica in the cluster will be of the type specified in /// `parameter_server_type`. /// - /// This value can only be used when `scale_tier` is set to `CUSTOM`.If you + /// This value can only be used when `scale_tier` is set to `CUSTOM`. If you /// set this value, you must also set `parameter_server_type`. /// /// The default value is zero. #[serde(rename="parameterServerCount")] pub parameter_server_count: Option, + /// Optional. The number of evaluator replicas to use for the training job. + /// Each replica in the cluster will be of the type specified in + /// `evaluator_type`. + /// + /// This value can only be used when `scale_tier` is set to `CUSTOM`. If you + /// set this value, you must also set `evaluator_type`. + /// + /// The default value is zero. + #[serde(rename="evaluatorCount")] + pub evaluator_count: Option, /// Optional. Specifies the type of virtual machine to use for your training /// job's worker nodes. /// @@ -1256,8 +970,8 @@ pub struct GoogleCloudMlV1__TrainingInput { /// `masterType`. /// /// This value must be consistent with the category of machine type that - /// `masterType` uses. In other words, both must be AI Platform machine - /// types or both must be Compute Engine machine types. + /// `masterType` uses. In other words, both must be Compute Engine machine + /// types or both must be legacy machine types. /// /// If you use `cloud_tpu` for this value, see special instructions for /// [configuring a custom TPU @@ -1270,29 +984,38 @@ pub struct GoogleCloudMlV1__TrainingInput { /// Optional. The configuration for parameter servers. /// /// You should only set `parameterServerConfig.acceleratorConfig` if - /// `parameterServerConfigType` is set to a Compute Engine machine type. [Learn + /// `parameterServerType` is set to a Compute Engine machine type. [Learn /// about restrictions on accelerator configurations for - /// training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-machine-types-with-gpu) + /// training.](/ai-platform/training/docs/using-gpus#compute-engine-machine-types-with-gpu) /// /// Set `parameterServerConfig.imageUri` only if you build a custom image for /// your parameter server. If `parameterServerConfig.imageUri` has not been - /// set, AI Platform uses the value of `masterConfig.imageUri`. + /// set, AI Platform uses the value of `masterConfig.imageUri` . /// Learn more about [configuring custom - /// containers](/ml-engine/docs/distributed-training-containers). + /// containers](/ai-platform/training/docs/distributed-training-containers). #[serde(rename="parameterServerConfig")] pub parameter_server_config: Option, /// Required. Specifies the machine types, the number of replicas for workers /// and parameter servers. #[serde(rename="scaleTier")] pub scale_tier: Option, - /// Required. The Google Compute Engine region to run the training job in. - /// See the available regions - /// for AI Platform services. + /// Required. The region to run the training job in. See the [available + /// regions](/ai-platform/training/docs/regions) for AI Platform Training. pub region: Option, - /// Optional. The version of Python used in training. If not set, the default - /// version is '2.7'. Python '3.5' is available when `runtime_version` is set - /// to '1.4' and above. Python '2.7' works with all supported - /// runtime versions. + /// Optional. The version of Python used in training. You must either specify + /// this field or specify `masterConfig.imageUri`. + /// + /// The following Python versions are available: + /// + /// * Python '3.7' is available when `runtime_version` is set to '1.15' or + /// later. + /// * Python '3.5' is available when `runtime_version` is set to a version + /// from '1.4' to '1.14'. + /// * Python '2.7' is available when `runtime_version` is set to '1.15' or + /// earlier. + /// + /// Read more about the Python versions available for [each runtime + /// version](/ml-engine/docs/runtime-version-list). #[serde(rename="pythonVersion")] pub python_version: Option, /// Required. The Google Cloud Storage location of the packages with @@ -1305,15 +1028,29 @@ pub struct GoogleCloudMlV1__TrainingInput { /// You should only set `workerConfig.acceleratorConfig` if `workerType` is set /// to a Compute Engine machine type. [Learn about restrictions on accelerator /// configurations for - /// training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-machine-types-with-gpu) + /// training.](/ai-platform/training/docs/using-gpus#compute-engine-machine-types-with-gpu) /// /// Set `workerConfig.imageUri` only if you build a custom image for your /// worker. If `workerConfig.imageUri` has not been set, AI Platform uses - /// the value of `masterConfig.imageUri`. Learn more about - /// [configuring custom - /// containers](/ml-engine/docs/distributed-training-containers). + /// the value of `masterConfig.imageUri` . + /// Learn more about [configuring custom + /// containers](/ai-platform/training/docs/distributed-training-containers). #[serde(rename="workerConfig")] pub worker_config: Option, + /// Optional. The configuration for evaluators. + /// + /// You should only set `evaluatorConfig.acceleratorConfig` if + /// `evaluatorType` is set to a Compute Engine machine type. [Learn + /// about restrictions on accelerator configurations for + /// training.](/ai-platform/training/docs/using-gpus#compute-engine-machine-types-with-gpu) + /// + /// Set `evaluatorConfig.imageUri` only if you build a custom image for + /// your evaluator. If `evaluatorConfig.imageUri` has not been + /// set, AI Platform uses the value of `masterConfig.imageUri` . + /// Learn more about [configuring custom + /// containers](/ai-platform/training/docs/distributed-training-containers). + #[serde(rename="evaluatorConfig")] + pub evaluator_config: Option, /// Optional. Specifies the type of virtual machine to use for your training /// job's parameter server. /// @@ -1321,24 +1058,33 @@ pub struct GoogleCloudMlV1__TrainingInput { /// `master_type`. /// /// This value must be consistent with the category of machine type that - /// `masterType` uses. In other words, both must be AI Platform machine - /// types or both must be Compute Engine machine types. + /// `masterType` uses. In other words, both must be Compute Engine machine + /// types or both must be legacy machine types. /// /// This value must be present when `scaleTier` is set to `CUSTOM` and /// `parameter_server_count` is greater than zero. #[serde(rename="parameterServerType")] pub parameter_server_type: Option, + /// Optional. Use `chief` instead of `master` in the `TF_CONFIG` environment + /// variable when training with a custom container. Defaults to `false`. [Learn + /// more about this + /// field.](/ai-platform/training/docs/distributed-training-details#chief-versus-master) + /// + /// This field has no effect for training jobs that don't use a custom + /// container. + #[serde(rename="useChiefInTfConfig")] + pub use_chief_in_tf_config: Option, /// Optional. The configuration for your master worker. /// /// You should only set `masterConfig.acceleratorConfig` if `masterType` is set /// to a Compute Engine machine type. Learn about [restrictions on accelerator /// configurations for - /// training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-machine-types-with-gpu) + /// training.](/ai-platform/training/docs/using-gpus#compute-engine-machine-types-with-gpu) /// /// Set `masterConfig.imageUri` only if you build a custom image. Only one of - /// `masterConfig.imageUri` and `runtimeVersion` should be set. Learn more about - /// [configuring custom - /// containers](/ml-engine/docs/distributed-training-containers). + /// `masterConfig.imageUri` and `runtimeVersion` should be set. Learn more + /// about [configuring custom + /// containers](/ai-platform/training/docs/distributed-training-containers). #[serde(rename="masterConfig")] pub master_config: Option, } @@ -1346,45 +1092,30 @@ pub struct GoogleCloudMlV1__TrainingInput { impl Part for GoogleCloudMlV1__TrainingInput {} -/// Request for predictions to be issued against a trained model. +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. It is +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. /// -/// # Activities +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). /// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [predict projects](struct.ProjectPredictCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__PredictRequest { - /// - /// Required. The prediction request body. - #[serde(rename="httpBody")] - pub http_body: Option, +pub struct GoogleRpc__Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, } -impl RequestValue for GoogleCloudMlV1__PredictRequest {} - - -/// The response message for Operations.ListOperations. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [operations list projects](struct.ProjectOperationListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleLongrunning__ListOperationsResponse { - /// The standard List next-page token. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of operations that matches the specified filter in the request. - pub operations: Option>, -} - -impl ResponseResult for GoogleLongrunning__ListOperationsResponse {} +impl Part for GoogleRpc__Status {} /// Options for manually scaling a model. @@ -1403,29 +1134,11 @@ pub struct GoogleCloudMlV1__ManualScaling { impl Part for GoogleCloudMlV1__ManualScaling {} -/// Response message for the ListModels method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [models list projects](struct.ProjectModelListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__ListModelsResponse { - /// The list of models. - pub models: Option>, - /// Optional. Pass this token as the `page_token` field of the request for a - /// subsequent call. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, -} - -impl ResponseResult for GoogleCloudMlV1__ListModelsResponse {} - - /// Represents a hardware accelerator request config. +/// Note that the AcceleratorConfig can be used in both Jobs and Versions. +/// Learn more about [accelerators for training](/ml-engine/docs/using-gpus) and +/// [accelerators for online +/// prediction](/ml-engine/docs/machine-types-online-prediction#gpus). /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1441,42 +1154,35 @@ pub struct GoogleCloudMlV1__AcceleratorConfig { impl Part for GoogleCloudMlV1__AcceleratorConfig {} -/// Provides the configuration for logging a type of permissions. -/// Example: -/// -/// ````text -/// { -/// "audit_log_configs": [ -/// { -/// "log_type": "DATA_READ", -/// "exempted_members": [ -/// "user:foo@gmail.com" -/// ] -/// }, -/// { -/// "log_type": "DATA_WRITE", -/// } -/// ] -/// } -/// ```` -/// -/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// Message holding configuration options for explaining model predictions. +/// There are two feature attribution methods supported for TensorFlow models: +/// integrated gradients and sampled Shapley. +/// [Learn more about feature +/// attributions.](/ml-engine/docs/ai-explanations/overview) /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleIamV1__AuditLogConfig { - /// Specifies the identities that do not cause logging for this type of - /// permission. - /// Follows the same format of Binding.members. - #[serde(rename="exemptedMembers")] - pub exempted_members: Option>, - /// The log type that this config enables. - #[serde(rename="logType")] - pub log_type: Option, +pub struct GoogleCloudMlV1__ExplanationConfig { + /// An attribution method that approximates Shapley values for features that + /// contribute to the label being predicted. A sampling strategy is used to + /// approximate the value rather than considering all subsets of features. + #[serde(rename="sampledShapleyAttribution")] + pub sampled_shapley_attribution: Option, + /// Attributes credit by computing the XRAI taking advantage + /// of the model's fully differentiable structure. Refer to this paper for + /// more details: https://arxiv.org/abs/1906.02825 + /// Currently only implemented for models with natural image inputs. + #[serde(rename="xraiAttribution")] + pub xrai_attribution: Option, + /// Attributes credit by computing the Aumann-Shapley value taking advantage + /// of the model's fully differentiable structure. Refer to this paper for + /// more details: http://proceedings.mlr.press/v70/sundararajan17a.html + #[serde(rename="integratedGradientsAttribution")] + pub integrated_gradients_attribution: Option, } -impl Part for GoogleIamV1__AuditLogConfig {} +impl Part for GoogleCloudMlV1__ExplanationConfig {} /// Request message for the CancelJob method. @@ -1494,47 +1200,21 @@ pub struct GoogleCloudMlV1__CancelJobRequest { _never_set: Option } impl RequestValue for GoogleCloudMlV1__CancelJobRequest {} -/// Response message for `TestIamPermissions` method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [jobs test iam permissions projects](struct.ProjectJobTestIamPermissionCall.html) (response) -/// * [models test iam permissions projects](struct.ProjectModelTestIamPermissionCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleIamV1__TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - pub permissions: Option>, -} - -impl ResponseResult for GoogleIamV1__TestIamPermissionsResponse {} - - -/// Represents results of a prediction job. +/// Represents a custom encryption key configuration that can be applied to +/// a resource. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__PredictionOutput { - /// Node hours used by the batch prediction job. - #[serde(rename="nodeHours")] - pub node_hours: Option, - /// The output Google Cloud Storage location provided at the job creation time. - #[serde(rename="outputPath")] - pub output_path: Option, - /// The number of generated predictions. - #[serde(rename="predictionCount")] - pub prediction_count: Option, - /// The number of data instances which resulted in errors. - #[serde(rename="errorCount")] - pub error_count: Option, +pub struct GoogleCloudMlV1__EncryptionConfig { + /// The Cloud KMS resource identifier of the customer managed encryption key + /// used to protect a resource, such as a training job. Has the form: + /// `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. + #[serde(rename="kmsKeyName")] + pub kms_key_name: Option, } -impl Part for GoogleCloudMlV1__PredictionOutput {} +impl Part for GoogleCloudMlV1__EncryptionConfig {} /// Represents results of a training job. Output only. @@ -1627,7 +1307,7 @@ pub struct GoogleIamV1__Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1636,6 +1316,26 @@ pub struct GoogleIamV1__Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1647,148 +1347,99 @@ pub struct GoogleIamV1__Binding { impl Part for GoogleIamV1__Binding {} -/// Represents an expression text. Example: -/// -/// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" -/// ```` +/// An attribution method that approximates Shapley values for features that +/// contribute to the label being predicted. A sampling strategy is used to +/// approximate the value rather than considering all subsets of features. /// /// This type is not used in any activity, and only used as *part* of another schema. +/// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleType__Expr { - /// An optional description of the expression. This is a longer text which - /// describes the expression, e.g. when hovered over it in a UI. - pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. - pub expression: Option, - /// An optional string indicating the location of the expression for error - /// reporting, e.g. a file name and a position in the file. - pub location: Option, - /// An optional title for the expression, i.e. a short string describing - /// its purpose. This can be used e.g. in UIs which allow to enter the - /// expression. - pub title: Option, +pub struct GoogleCloudMlV1__SampledShapleyAttribution { + /// The number of feature permutations to consider when approximating the + /// Shapley values. + #[serde(rename="numPaths")] + pub num_paths: Option, } -impl Part for GoogleType__Expr {} +impl Part for GoogleCloudMlV1__SampledShapleyAttribution {} -/// Returns service account information associated with a project. +/// Represents the spec to match discrete values from parent parameter. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get config projects](struct.ProjectGetConfigCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__GetConfigResponse { - /// The project number for `service_account`. - #[serde(rename="serviceAccountProject")] - pub service_account_project: Option, +pub struct GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentDiscreteValueSpec { + /// Matches values of the parent parameter with type 'DISCRETE'. + /// All values must exist in `discrete_value_spec` of parent parameter. + pub values: Option>, +} + +impl Part for GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentDiscreteValueSpec {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1_AutomatedStoppingConfig_DecayCurveAutomatedStoppingConfig { + /// True if measurement.elapsed_time is used as the x-axis of each + /// Trials Decay Curve. Otherwise, Measurement.steps will be used as the + /// x-axis. + #[serde(rename="useElapsedTime")] + pub use_elapsed_time: Option, +} + +impl Part for GoogleCloudMlV1_AutomatedStoppingConfig_DecayCurveAutomatedStoppingConfig {} + + +/// Represents a single parameter to optimize. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1_StudyConfig_ParameterSpec { + /// The value spec for a 'DISCRETE' parameter. + #[serde(rename="discreteValueSpec")] + pub discrete_value_spec: Option, + /// The value spec for a 'CATEGORICAL' parameter. + #[serde(rename="categoricalValueSpec")] + pub categorical_value_spec: Option, /// no description provided - pub config: Option, - /// The service account Cloud ML uses to access resources in the project. - #[serde(rename="serviceAccount")] - pub service_account: Option, + #[serde(rename="parentCategoricalValues")] + pub parent_categorical_values: Option, + /// The value spec for an 'INTEGER' parameter. + #[serde(rename="integerValueSpec")] + pub integer_value_spec: Option, + /// A child node is active if the parameter's value matches the child node's + /// matching_parent_values. + /// + /// If two items in child_parameter_specs have the same name, they must have + /// disjoint matching_parent_values. + #[serde(rename="childParameterSpecs")] + pub child_parameter_specs: Option>, + /// no description provided + #[serde(rename="parentDiscreteValues")] + pub parent_discrete_values: Option, + /// no description provided + #[serde(rename="parentIntValues")] + pub parent_int_values: Option, + /// The value spec for a 'DOUBLE' parameter. + #[serde(rename="doubleValueSpec")] + pub double_value_spec: Option, + /// Required. The parameter name must be unique amongst all ParameterSpecs. + pub parameter: Option, + /// Required. The type of the parameter. + #[serde(rename="type")] + pub type_: Option, + /// How the parameter should be scaled. + /// Leave unset for categorical parameters. + #[serde(rename="scaleType")] + pub scale_type: Option, } -impl ResponseResult for GoogleCloudMlV1__GetConfigResponse {} - - -/// Represents a training or prediction job. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [jobs create projects](struct.ProjectJobCreateCall.html) (request|response) -/// * [jobs patch projects](struct.ProjectJobPatchCall.html) (request|response) -/// * [jobs get projects](struct.ProjectJobGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__Job { - /// The current training job result. - #[serde(rename="trainingOutput")] - pub training_output: Option, - /// Input parameters to create a prediction job. - #[serde(rename="predictionInput")] - pub prediction_input: Option, - /// Output only. The details of a failure or a cancellation. - #[serde(rename="errorMessage")] - pub error_message: Option, - /// Required. The user-specified id of the job. - #[serde(rename="jobId")] - pub job_id: Option, - /// Optional. One or more labels that you can add, to organize your jobs. - /// Each label is a key-value pair, where both the key and the value are - /// arbitrary strings that you supply. - /// For more information, see the documentation on - /// using labels. - pub labels: Option>, - /// Output only. The detailed state of a job. - pub state: Option, - /// `etag` is used for optimistic concurrency control as a way to help - /// prevent simultaneous updates of a job from overwriting each other. - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform job updates in order to avoid race - /// conditions: An `etag` is returned in the response to `GetJob`, and - /// systems are expected to put that etag in the request to `UpdateJob` to - /// ensure that their change will be applied to the same version of the job. - pub etag: Option, - /// Output only. When the job processing was started. - #[serde(rename="startTime")] - pub start_time: Option, - /// Input parameters to create a training job. - #[serde(rename="trainingInput")] - pub training_input: Option, - /// Output only. When the job processing was completed. - #[serde(rename="endTime")] - pub end_time: Option, - /// The current prediction job result. - #[serde(rename="predictionOutput")] - pub prediction_output: Option, - /// Output only. When the job was created. - #[serde(rename="createTime")] - pub create_time: Option, -} - -impl RequestValue for GoogleCloudMlV1__Job {} -impl ResponseResult for GoogleCloudMlV1__Job {} - - -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](https://github.com/grpc). Each `Status` message contains -/// three pieces of data: error code, error message, and error details. -/// -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleRpc__Status { - /// A developer-facing error message, which should be in English. Any - /// user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - pub message: Option, - /// The status code, which should be an enum value of google.rpc.Code. - pub code: Option, - /// A list of messages that carry the error details. There is a common set of - /// message types for APIs to use. - pub details: Option>>, -} - -impl Part for GoogleRpc__Status {} +impl Part for GoogleCloudMlV1_StudyConfig_ParameterSpec {} /// Represents input parameters for a prediction job. @@ -1862,34 +1513,12 @@ pub struct GoogleCloudMlV1__PredictionInput { impl Part for GoogleCloudMlV1__PredictionInput {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations list projects](struct.ProjectLocationListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__ListLocationsResponse { - /// Optional. Pass this token as the `page_token` field of the request for a - /// subsequent call. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Locations where at least one type of CMLE capability is available. - pub locations: Option>, -} - -impl ResponseResult for GoogleCloudMlV1__ListLocationsResponse {} - - /// Represents a version of the model. /// /// Each version is a trained model deployed in the cloud, ready to handle /// prediction requests. A model can have multiple versions. You can get /// information about all of the versions of a given model by calling -/// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). +/// projects.models.versions.list. /// /// # Activities /// @@ -1907,30 +1536,42 @@ pub struct GoogleCloudMlV1__Version { #[serde(rename="errorMessage")] pub error_message: Option, /// Optional. The type of machine on which to serve the model. Currently only - /// applies to online prediction service. - ///
          - ///
          mls1-c1-m2
          - ///
          - /// The default machine type, with 1 core and 2 GB RAM. The deprecated - /// name for this machine type is "mls1-highmem-1". - ///
          - ///
          mls1-c4-m2
          - ///
          - /// In Beta. This machine type has 4 cores and 2 GB RAM. The - /// deprecated name for this machine type is "mls1-highcpu-4". - ///
          - ///
          + /// applies to online prediction service. If this field is not specified, it + /// defaults to `mls1-c1-m2`. + /// + /// Online prediction supports the following machine types: + /// + /// * `mls1-c1-m2` + /// * `mls1-c4-m2` + /// * `n1-standard-2` + /// * `n1-standard-4` + /// * `n1-standard-8` + /// * `n1-standard-16` + /// * `n1-standard-32` + /// * `n1-highmem-2` + /// * `n1-highmem-4` + /// * `n1-highmem-8` + /// * `n1-highmem-16` + /// * `n1-highmem-32` + /// * `n1-highcpu-2` + /// * `n1-highcpu-4` + /// * `n1-highcpu-8` + /// * `n1-highcpu-16` + /// * `n1-highcpu-32` + /// + /// `mls1-c1-m2` is generally available. All other machine types are available + /// in beta. Learn more about the [differences between machine + /// types](/ml-engine/docs/machine-types-online-prediction). #[serde(rename="machineType")] pub machine_type: Option, /// Optional. The description specified for the version when it was created. pub description: Option, - /// Optional. The AI Platform runtime version to use for this deployment. - /// If not set, AI Platform uses the default stable version, 1.0. For more - /// information, see the - /// [runtime version list](/ml-engine/docs/runtime-version-list) and - /// [how to manage runtime versions](/ml-engine/docs/versioning). - #[serde(rename="runtimeVersion")] - pub runtime_version: Option, + /// Optional. Accelerator config for using GPUs for online prediction (beta). + /// Only specify this field if you have specified a Compute Engine (N1) machine + /// type in the `machineType` field. Learn more about [using GPUs for online + /// prediction](/ml-engine/docs/machine-types-online-prediction#gpus). + #[serde(rename="acceleratorConfig")] + pub accelerator_config: Option, /// Manually select the number of nodes to use for serving the /// model. You should generally use `auto_scaling` with an appropriate /// `min_nodes` instead, but this option is available if you want more @@ -1954,14 +1595,26 @@ pub struct GoogleCloudMlV1__Version { /// /// Do **not** specify a framework if you're deploying a [custom /// prediction routine](/ml-engine/docs/tensorflow/custom-prediction-routines). + /// + /// If you specify a [Compute Engine (N1) machine + /// type](/ml-engine/docs/machine-types-online-prediction) in the + /// `machineType` field, you must specify `TENSORFLOW` + /// for the framework. pub framework: Option, /// Output only. The time the version was created. #[serde(rename="createTime")] pub create_time: Option, - /// Required.The name specified for the version when it was created. + /// Required. The name specified for the version when it was created. /// /// The version name must be unique within the model it is created in. pub name: Option, + /// Required. The AI Platform runtime version to use for this deployment. + /// + /// For more information, see the + /// [runtime version list](/ml-engine/docs/runtime-version-list) and + /// [how to manage runtime versions](/ml-engine/docs/versioning). + #[serde(rename="runtimeVersion")] + pub runtime_version: Option, /// Optional. The fully qualified name /// (module_name.class_name) of a class that implements /// the Predictor interface described in this reference field. The module @@ -1971,11 +1624,13 @@ pub struct GoogleCloudMlV1__Version { /// Specify this field if and only if you are deploying a [custom prediction /// routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines). /// If you specify this field, you must set - /// [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater. + /// [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and + /// you must set `machineType` to a [legacy (MLS1) + /// machine type](/ml-engine/docs/machine-types-online-prediction). /// /// The following code sample provides the Predictor interface: /// - /// ````textpy + ///
               /// class Predictor(object):
               /// """Interface for constructing custom predictors."""
               /// 
          @@ -2011,7 +1666,7 @@ pub struct GoogleCloudMlV1__Version {
               ///         An instance implementing this Predictor class.
               ///     """
               ///     raise NotImplementedError()
          -    /// ````
          +    /// 
          /// /// Learn more about [the Predictor interface and custom prediction /// routines](/ml-engine/docs/tensorflow/custom-prediction-routines). @@ -2021,6 +1676,10 @@ pub struct GoogleCloudMlV1__Version { /// response to increases and decreases in traffic. Care should be /// taken to ramp up traffic according to the model's ability to scale /// or you will start seeing increases in latency and 429 response codes. + /// + /// Note that you cannot use AutoScaling if your version uses + /// [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use specify + /// `manual_scaling`. #[serde(rename="autoScaling")] pub auto_scaling: Option, /// Optional. Specifies the service account for resource access control. @@ -2042,11 +1701,31 @@ pub struct GoogleCloudMlV1__Version { /// [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater. #[serde(rename="packageUris")] pub package_uris: Option>, - /// Optional. The version of Python used in prediction. If not set, the default - /// version is '2.7'. Python '3.5' is available when `runtime_version` is set - /// to '1.4' and above. Python '2.7' works with all supported runtime versions. + /// Required. The version of Python used in prediction. + /// + /// The following Python versions are available: + /// + /// * Python '3.7' is available when `runtime_version` is set to '1.15' or + /// later. + /// * Python '3.5' is available when `runtime_version` is set to a version + /// from '1.4' to '1.14'. + /// * Python '2.7' is available when `runtime_version` is set to '1.15' or + /// earlier. + /// + /// Read more about the Python versions available for [each runtime + /// version](/ml-engine/docs/runtime-version-list). #[serde(rename="pythonVersion")] pub python_version: Option, + /// Optional. *Only* specify this field in a + /// projects.models.versions.patch + /// request. Specifying it in a + /// projects.models.versions.create + /// request has no effect. + /// + /// Configures the request-response pair logging on predictions from this + /// Version. + #[serde(rename="requestLoggingConfig")] + pub request_logging_config: Option, /// Output only. The state of a version. pub state: Option, /// `etag` is used for optimistic concurrency control as a way to help @@ -2067,18 +1746,23 @@ pub struct GoogleCloudMlV1__Version { /// information. /// /// When passing Version to - /// [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create) + /// projects.models.versions.create /// the model service uses the specified location as the source of the model. /// Once deployed, the model version is hosted by the prediction service, so /// this location is useful only as a historical record. /// The total number of model files can't exceed 1000. #[serde(rename="deploymentUri")] pub deployment_uri: Option, + /// Optional. Configures explainability features on the model's version. + /// Some explanation features require additional metadata to be loaded + /// as part of the model payload. + #[serde(rename="explanationConfig")] + pub explanation_config: Option, /// Output only. If true, this version will be used to handle prediction /// requests that do not specify a version. /// /// You can change the default version by calling - /// [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + /// projects.methods.versions.setDefault. #[serde(rename="isDefault")] pub is_default: Option, } @@ -2087,21 +1771,26 @@ impl RequestValue for GoogleCloudMlV1__Version {} impl ResponseResult for GoogleCloudMlV1__Version {} -/// There is no detailed description. +/// Request for predictions to be issued against a trained model. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [predict projects](struct.ProjectPredictCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1__Capability { - /// Available accelerators for the capability. - #[serde(rename="availableAccelerators")] - pub available_accelerators: Option>, - /// no description provided - #[serde(rename="type")] - pub type_: Option, +pub struct GoogleCloudMlV1__PredictRequest { + /// + /// Required. The prediction request body. Refer to the [request body details + /// section](#request-body-details) for more information on how to structure + /// your request. + #[serde(rename="httpBody")] + pub http_body: Option, } -impl Part for GoogleCloudMlV1__Capability {} +impl RequestValue for GoogleCloudMlV1__PredictRequest {} /// Options for automatically scaling a model. @@ -2125,9 +1814,20 @@ pub struct GoogleCloudMlV1__AutoScaling { /// at least `min_nodes`. You will be charged for the time in which additional /// nodes are used. /// - /// If not specified, `min_nodes` defaults to 0, in which case, when traffic - /// to a model stops (and after a cool-down period), nodes will be shut down - /// and no charges will be incurred until traffic to the model resumes. + /// If `min_nodes` is not specified and AutoScaling is used with a [legacy + /// (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction), + /// `min_nodes` defaults to 0, in which case, when traffic to a model stops + /// (and after a cool-down period), nodes will be shut down and no charges will + /// be incurred until traffic to the model resumes. + /// + /// If `min_nodes` is not specified and AutoScaling is used with a [Compute + /// Engine (N1) machine type](/ml-engine/docs/machine-types-online-prediction), + /// `min_nodes` defaults to 1. `min_nodes` must be at least 1 for use with a + /// Compute Engine machine type. + /// + /// Note that you cannot use AutoScaling if your version uses + /// [GPUs](#Version.FIELDS.accelerator_config). Instead, you must use + /// ManualScaling. /// /// You can set `min_nodes` when creating the model version, and you can also /// update `min_nodes` for an existing version: @@ -2143,7 +1843,7 @@ pub struct GoogleCloudMlV1__AutoScaling { /// /// HTTP request: /// - ///
          +    /// 
               /// PATCH
               /// https://ml.googleapis.com/v1/{name=projects/*/models/*/versions/*}?update_mask=autoScaling.minNodes
               /// -d @./update_body.json
          @@ -2155,6 +1855,1224 @@ pub struct GoogleCloudMlV1__AutoScaling {
           impl Part for GoogleCloudMlV1__AutoScaling {}
           
           
          +/// The median automated stopping rule stops a pending trial if the trial's
          +/// best objective_value is strictly below the median 'performance' of all
          +/// completed trials reported up to the trial's last measurement.
          +/// Currently, 'performance' refers to the running average of the objective
          +/// values reported by the trial in each measurement.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1_AutomatedStoppingConfig_MedianAutomatedStoppingConfig {
          +    /// True if median automated stopping rule applies on
          +    /// measurement.use_elapsed_time. it means that elapsed_time field of
          +    /// latest measurement of current trial is used to compute median objective
          +    /// value for each completed trials.
          +    #[serde(rename="useElapsedTime")]
          +    pub use_elapsed_time: Option,
          +}
          +
          +impl Part for GoogleCloudMlV1_AutomatedStoppingConfig_MedianAutomatedStoppingConfig {}
          +
          +
          +/// Response message for the ListJobs method.
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [jobs list projects](struct.ProjectJobListCall.html) (response)
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__ListJobsResponse {
          +    /// Optional. Pass this token as the `page_token` field of the request for a
          +    /// subsequent call.
          +    #[serde(rename="nextPageToken")]
          +    pub next_page_token: Option,
          +    /// The list of jobs.
          +    pub jobs: Option>,
          +}
          +
          +impl ResponseResult for GoogleCloudMlV1__ListJobsResponse {}
          +
          +
          +/// There is no detailed description.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__Config {
          +    /// The service account Cloud ML uses to run on TPU node.
          +    #[serde(rename="tpuServiceAccount")]
          +    pub tpu_service_account: Option,
          +}
          +
          +impl Part for GoogleCloudMlV1__Config {}
          +
          +
          +/// Response message for the ListVersions method.
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [models versions list projects](struct.ProjectModelVersionListCall.html) (response)
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__ListVersionsResponse {
          +    /// Optional. Pass this token as the `page_token` field of the request for a
          +    /// subsequent call.
          +    #[serde(rename="nextPageToken")]
          +    pub next_page_token: Option,
          +    /// The list of versions.
          +    pub versions: Option>,
          +}
          +
          +impl ResponseResult for GoogleCloudMlV1__ListVersionsResponse {}
          +
          +
          +/// There is no detailed description.
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [locations get projects](struct.ProjectLocationGetCall.html) (response)
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__Location {
          +    /// no description provided
          +    pub name: Option,
          +    /// Capabilities available in the location.
          +    pub capabilities: Option>,
          +}
          +
          +impl ResponseResult for GoogleCloudMlV1__Location {}
          +
          +
          +/// Represents configuration of a study.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__StudyConfig {
          +    /// no description provided
          +    pub metrics: Option>,
          +    /// Configuration for automated stopping of unpromising Trials.
          +    #[serde(rename="automatedStoppingConfig")]
          +    pub automated_stopping_config: Option,
          +    /// The search algorithm specified for the study.
          +    pub algorithm: Option,
          +    /// Required. The set of parameters to tune.
          +    pub parameters: Option>,
          +}
          +
          +impl Part for GoogleCloudMlV1__StudyConfig {}
          +
          +
          +/// Represents the spec to match categorical values from parent parameter.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentCategoricalValueSpec {
          +    /// Matches values of the parent parameter with type 'CATEGORICAL'.
          +    /// All values must exist in `categorical_value_spec` of parent parameter.
          +    pub values: Option>,
          +}
          +
          +impl Part for GoogleCloudMlV1_StudyConfigParameterSpec_MatchingParentCategoricalValueSpec {}
          +
          +
          +/// An Identity and Access Management (IAM) policy, which specifies access
          +/// controls for Google Cloud resources.
          +/// 
          +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more
          +/// `members` to a single `role`. Members can be user accounts, service accounts,
          +/// Google groups, and domains (such as G Suite). A `role` is a named list of
          +/// permissions; each `role` can be an IAM predefined role or a user-created
          +/// custom role.
          +/// 
          +/// Optionally, a `binding` can specify a `condition`, which is a logical
          +/// expression that allows access to a resource only if the expression evaluates
          +/// to `true`. A condition can add constraints based on attributes of the
          +/// request, the resource, or both.
          +/// 
          +/// **JSON example:**
          +/// 
          +/// ````text
          +/// {
          +///   "bindings": [
          +///     {
          +///       "role": "roles/resourcemanager.organizationAdmin",
          +///       "members": [
          +///         "user:mike@example.com",
          +///         "group:admins@example.com",
          +///         "domain:google.com",
          +///         "serviceAccount:my-project-id@appspot.gserviceaccount.com"
          +///       ]
          +///     },
          +///     {
          +///       "role": "roles/resourcemanager.organizationViewer",
          +///       "members": ["user:eve@example.com"],
          +///       "condition": {
          +///         "title": "expirable access",
          +///         "description": "Does not grant access after Sep 2020",
          +///         "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')",
          +///       }
          +///     }
          +///   ],
          +///   "etag": "BwWWja0YfJA=",
          +///   "version": 3
          +/// }
          +/// ````
          +/// 
          +/// **YAML example:**
          +/// 
          +/// ````text
          +/// bindings:
          +/// - members:
          +///   - user:mike@example.com
          +///   - group:admins@example.com
          +///   - domain:google.com
          +///   - serviceAccount:my-project-id@appspot.gserviceaccount.com
          +///   role: roles/resourcemanager.organizationAdmin
          +/// - members:
          +///   - user:eve@example.com
          +///   role: roles/resourcemanager.organizationViewer
          +///   condition:
          +///     title: expirable access
          +///     description: Does not grant access after Sep 2020
          +///     expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
          +/// - etag: BwWWja0YfJA=
          +/// - version: 3
          +/// ````
          +/// 
          +/// For a description of IAM and its features, see the
          +/// [IAM documentation](https://cloud.google.com/iam/docs/).
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [models set iam policy projects](struct.ProjectModelSetIamPolicyCall.html) (response)
          +/// * [jobs set iam policy projects](struct.ProjectJobSetIamPolicyCall.html) (response)
          +/// * [models get iam policy projects](struct.ProjectModelGetIamPolicyCall.html) (response)
          +/// * [jobs get iam policy projects](struct.ProjectJobGetIamPolicyCall.html) (response)
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleIamV1__Policy {
          +    /// Specifies cloud audit logging configuration for this policy.
          +    #[serde(rename="auditConfigs")]
          +    pub audit_configs: Option>,
          +    /// `etag` is used for optimistic concurrency control as a way to help
          +    /// prevent simultaneous updates of a policy from overwriting each other.
          +    /// It is strongly suggested that systems make use of the `etag` in the
          +    /// read-modify-write cycle to perform policy updates in order to avoid race
          +    /// conditions: An `etag` is returned in the response to `getIamPolicy`, and
          +    /// systems are expected to put that etag in the request to `setIamPolicy` to
          +    /// ensure that their change will be applied to the same version of the policy.
          +    /// 
          +    /// **Important:** If you use IAM Conditions, you must include the `etag` field
          +    /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
          +    /// you to overwrite a version `3` policy with a version `1` policy, and all of
          +    /// the conditions in the version `3` policy are lost.
          +    pub etag: Option,
          +    /// Associates a list of `members` to a `role`. Optionally, may specify a
          +    /// `condition` that determines how and when the `bindings` are applied. Each
          +    /// of the `bindings` must contain at least one member.
          +    pub bindings: Option>,
          +    /// Specifies the format of the policy.
          +    /// 
          +    /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
          +    /// are rejected.
          +    /// 
          +    /// Any operation that affects conditional role bindings must specify version
          +    /// `3`. This requirement applies to the following operations:
          +    /// 
          +    /// * Getting a policy that includes a conditional role binding
          +    /// * Adding a conditional role binding to a policy
          +    /// * Changing a conditional role binding in a policy
          +    /// * Removing any role binding, with or without a condition, from a policy
          +    ///   that includes conditions
          +    /// 
          +    /// **Important:** If you use IAM Conditions, you must include the `etag` field
          +    /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
          +    /// you to overwrite a version `3` policy with a version `1` policy, and all of
          +    /// the conditions in the version `3` policy are lost.
          +    /// 
          +    /// If a policy does not include any conditions, operations on that policy may
          +    /// specify any valid version or leave the field unset.
          +    pub version: Option,
          +}
          +
          +impl ResponseResult for GoogleIamV1__Policy {}
          +
          +
          +/// Represents a set of hyperparameters to optimize.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__HyperparameterSpec {
          +    /// Optional. How many training trials should be attempted to optimize
          +    /// the specified hyperparameters.
          +    /// 
          +    /// Defaults to one.
          +    #[serde(rename="maxTrials")]
          +    pub max_trials: Option,
          +    /// Required. The type of goal to use for tuning. Available types are
          +    /// `MAXIMIZE` and `MINIMIZE`.
          +    /// 
          +    /// Defaults to `MAXIMIZE`.
          +    pub goal: Option,
          +    /// Optional. The search algorithm specified for the hyperparameter
          +    /// tuning job.
          +    /// Uses the default AI Platform hyperparameter tuning
          +    /// algorithm if unspecified.
          +    pub algorithm: Option,
          +    /// Optional. The number of failed trials that need to be seen before failing
          +    /// the hyperparameter tuning job. You can specify this field to override the
          +    /// default failing criteria for AI Platform hyperparameter tuning jobs.
          +    /// 
          +    /// Defaults to zero, which means the service decides when a hyperparameter
          +    /// job should fail.
          +    #[serde(rename="maxFailedTrials")]
          +    pub max_failed_trials: Option,
          +    /// Optional. Indicates if the hyperparameter tuning job enables auto trial
          +    /// early stopping.
          +    #[serde(rename="enableTrialEarlyStopping")]
          +    pub enable_trial_early_stopping: Option,
          +    /// Optional. The prior hyperparameter tuning job id that users hope to
          +    /// continue with. The job id will be used to find the corresponding vizier
          +    /// study guid and resume the study.
          +    #[serde(rename="resumePreviousJobId")]
          +    pub resume_previous_job_id: Option,
          +    /// Required. The set of parameters to tune.
          +    pub params: Option>,
          +    /// Optional. The TensorFlow summary tag name to use for optimizing trials. For
          +    /// current versions of TensorFlow, this tag name should exactly match what is
          +    /// shown in TensorBoard, including all scopes.  For versions of TensorFlow
          +    /// prior to 0.12, this should be only the tag passed to tf.Summary.
          +    /// By default, "training/hptuning/metric" will be used.
          +    #[serde(rename="hyperparameterMetricTag")]
          +    pub hyperparameter_metric_tag: Option,
          +    /// Optional. The number of training trials to run concurrently.
          +    /// You can reduce the time it takes to perform hyperparameter tuning by adding
          +    /// trials in parallel. However, each trail only benefits from the information
          +    /// gained in completed trials. That means that a trial does not get access to
          +    /// the results of trials running at the same time, which could reduce the
          +    /// quality of the overall optimization.
          +    /// 
          +    /// Each trial will use the same scale tier and machine types.
          +    /// 
          +    /// Defaults to one.
          +    #[serde(rename="maxParallelTrials")]
          +    pub max_parallel_trials: Option,
          +}
          +
          +impl Part for GoogleCloudMlV1__HyperparameterSpec {}
          +
          +
          +/// An observed value of a metric.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric {
          +    /// The global training step for this metric.
          +    #[serde(rename="trainingStep")]
          +    pub training_step: Option,
          +    /// The objective value at this training step.
          +    #[serde(rename="objectiveValue")]
          +    pub objective_value: Option,
          +}
          +
          +impl Part for GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric {}
          +
          +
          +/// There is no detailed description.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1_StudyConfigParameterSpec_DoubleValueSpec {
          +    /// Must be specified if type is `DOUBLE`. Maximum value of the parameter.
          +    #[serde(rename="maxValue")]
          +    pub max_value: Option,
          +    /// Must be specified if type is `DOUBLE`. Minimum value of the parameter.
          +    #[serde(rename="minValue")]
          +    pub min_value: Option,
          +}
          +
          +impl Part for GoogleCloudMlV1_StudyConfigParameterSpec_DoubleValueSpec {}
          +
          +
          +/// Represents a training or prediction job.
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [jobs create projects](struct.ProjectJobCreateCall.html) (request|response)
          +/// * [jobs patch projects](struct.ProjectJobPatchCall.html) (request|response)
          +/// * [jobs get projects](struct.ProjectJobGetCall.html) (response)
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__Job {
          +    /// The current training job result.
          +    #[serde(rename="trainingOutput")]
          +    pub training_output: Option,
          +    /// Input parameters to create a prediction job.
          +    #[serde(rename="predictionInput")]
          +    pub prediction_input: Option,
          +    /// Output only. The details of a failure or a cancellation.
          +    #[serde(rename="errorMessage")]
          +    pub error_message: Option,
          +    /// Required. The user-specified id of the job.
          +    #[serde(rename="jobId")]
          +    pub job_id: Option,
          +    /// Optional. One or more labels that you can add, to organize your jobs.
          +    /// Each label is a key-value pair, where both the key and the value are
          +    /// arbitrary strings that you supply.
          +    /// For more information, see the documentation on
          +    /// using labels.
          +    pub labels: Option>,
          +    /// Output only. The detailed state of a job.
          +    pub state: Option,
          +    /// `etag` is used for optimistic concurrency control as a way to help
          +    /// prevent simultaneous updates of a job from overwriting each other.
          +    /// It is strongly suggested that systems make use of the `etag` in the
          +    /// read-modify-write cycle to perform job updates in order to avoid race
          +    /// conditions: An `etag` is returned in the response to `GetJob`, and
          +    /// systems are expected to put that etag in the request to `UpdateJob` to
          +    /// ensure that their change will be applied to the same version of the job.
          +    pub etag: Option,
          +    /// Output only. When the job processing was started.
          +    #[serde(rename="startTime")]
          +    pub start_time: Option,
          +    /// Input parameters to create a training job.
          +    #[serde(rename="trainingInput")]
          +    pub training_input: Option,
          +    /// Output only. When the job processing was completed.
          +    #[serde(rename="endTime")]
          +    pub end_time: Option,
          +    /// The current prediction job result.
          +    #[serde(rename="predictionOutput")]
          +    pub prediction_output: Option,
          +    /// Output only. When the job was created.
          +    #[serde(rename="createTime")]
          +    pub create_time: Option,
          +}
          +
          +impl RequestValue for GoogleCloudMlV1__Job {}
          +impl ResponseResult for GoogleCloudMlV1__Job {}
          +
          +
          +/// All parameters related to scheduling of training jobs.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__Scheduling {
          +    /// Optional. The maximum job running time, expressed in seconds. The field can
          +    /// contain up to nine fractional digits, terminated by `s`. By default there
          +    /// is no limit to the running time.
          +    /// 
          +    /// If the training job is still running after this duration, AI Platform
          +    /// Training cancels it.
          +    /// 
          +    /// For example, if you want to ensure your job runs for no more than 2 hours,
          +    /// set this field to `7200s` (2 hours * 60 minutes / hour * 60 seconds /
          +    /// minute).
          +    /// 
          +    /// If you submit your training job using the `gcloud` tool, you can [provide
          +    /// this field in a `config.yaml`
          +    /// file](/ai-platform/training/docs/training-jobs#formatting_your_configuration_parameters).
          +    /// For example:
          +    /// 
          +    /// ````textyaml
          +    /// trainingInput:
          +    ///   ...
          +    ///   scheduling:
          +    ///     maxRunningTime: 7200s
          +    ///   ...
          +    /// ````
          +    #[serde(rename="maxRunningTime")]
          +    pub max_running_time: Option,
          +}
          +
          +impl Part for GoogleCloudMlV1__Scheduling {}
          +
          +
          +/// Request message for `TestIamPermissions` method.
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [jobs test iam permissions projects](struct.ProjectJobTestIamPermissionCall.html) (request)
          +/// * [models test iam permissions projects](struct.ProjectModelTestIamPermissionCall.html) (request)
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleIamV1__TestIamPermissionsRequest {
          +    /// The set of permissions to check for the `resource`. Permissions with
          +    /// wildcards (such as '*' or 'storage.*') are not allowed. For more
          +    /// information see
          +    /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
          +    pub permissions: Option>,
          +}
          +
          +impl RequestValue for GoogleIamV1__TestIamPermissionsRequest {}
          +
          +
          +/// Specifies the audit configuration for a service.
          +/// The configuration determines which permission types are logged, and what
          +/// identities, if any, are exempted from logging.
          +/// An AuditConfig must have one or more AuditLogConfigs.
          +/// 
          +/// If there are AuditConfigs for both `allServices` and a specific service,
          +/// the union of the two AuditConfigs is used for that service: the log_types
          +/// specified in each AuditConfig are enabled, and the exempted_members in each
          +/// AuditLogConfig are exempted.
          +/// 
          +/// Example Policy with multiple AuditConfigs:
          +/// 
          +/// ````text
          +/// {
          +///   "audit_configs": [
          +///     {
          +///       "service": "allServices"
          +///       "audit_log_configs": [
          +///         {
          +///           "log_type": "DATA_READ",
          +///           "exempted_members": [
          +///             "user:jose@example.com"
          +///           ]
          +///         },
          +///         {
          +///           "log_type": "DATA_WRITE",
          +///         },
          +///         {
          +///           "log_type": "ADMIN_READ",
          +///         }
          +///       ]
          +///     },
          +///     {
          +///       "service": "sampleservice.googleapis.com"
          +///       "audit_log_configs": [
          +///         {
          +///           "log_type": "DATA_READ",
          +///         },
          +///         {
          +///           "log_type": "DATA_WRITE",
          +///           "exempted_members": [
          +///             "user:aliya@example.com"
          +///           ]
          +///         }
          +///       ]
          +///     }
          +///   ]
          +/// }
          +/// ````
          +/// 
          +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
          +/// logging. It also exempts jose@example.com from DATA_READ logging, and
          +/// aliya@example.com from DATA_WRITE logging.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleIamV1__AuditConfig {
          +    /// The configuration for logging of each type of permission.
          +    #[serde(rename="auditLogConfigs")]
          +    pub audit_log_configs: Option>,
          +    /// Specifies a service that will be enabled for audit logging.
          +    /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
          +    /// `allServices` is a special value that covers all services.
          +    pub service: Option,
          +}
          +
          +impl Part for GoogleIamV1__AuditConfig {}
          +
          +
          +/// There is no detailed description.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__Capability {
          +    /// Available accelerators for the capability.
          +    #[serde(rename="availableAccelerators")]
          +    pub available_accelerators: Option>,
          +    /// no description provided
          +    #[serde(rename="type")]
          +    pub type_: Option,
          +}
          +
          +impl Part for GoogleCloudMlV1__Capability {}
          +
          +
          +/// The response message for Operations.ListOperations.
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [operations list projects](struct.ProjectOperationListCall.html) (response)
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleLongrunning__ListOperationsResponse {
          +    /// The standard List next-page token.
          +    #[serde(rename="nextPageToken")]
          +    pub next_page_token: Option,
          +    /// A list of operations that matches the specified filter in the request.
          +    pub operations: Option>,
          +}
          +
          +impl ResponseResult for GoogleLongrunning__ListOperationsResponse {}
          +
          +
          +/// Response message for the ListModels method.
          +/// 
          +/// # Activities
          +/// 
          +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. 
          +/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
          +/// 
          +/// * [models list projects](struct.ProjectModelListCall.html) (response)
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__ListModelsResponse {
          +    /// The list of models.
          +    pub models: Option>,
          +    /// Optional. Pass this token as the `page_token` field of the request for a
          +    /// subsequent call.
          +    #[serde(rename="nextPageToken")]
          +    pub next_page_token: Option,
          +}
          +
          +impl ResponseResult for GoogleCloudMlV1__ListModelsResponse {}
          +
          +
          +/// Configuration for logging request-response pairs to a BigQuery table.
          +/// Online prediction requests to a model version and the responses to these
          +/// requests are converted to raw strings and saved to the specified BigQuery
          +/// table. Logging is constrained by [BigQuery quotas and
          +/// limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
          +/// AI Platform Prediction does not log request-response pairs, but it continues
          +/// to serve predictions.
          +/// 
          +/// If you are using [continuous
          +/// evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
          +/// specify this configuration manually. Setting up continuous evaluation
          +/// automatically enables logging of request-response pairs.
          +/// 
          +/// This type is not used in any activity, and only used as *part* of another schema.
          +/// 
          +#[derive(Default, Clone, Debug, Serialize, Deserialize)]
          +pub struct GoogleCloudMlV1__RequestLoggingConfig {
          +    /// Percentage of requests to be logged, expressed as a fraction from 0 to 1.
          +    /// For example, if you want to log 10% of requests, enter `0.1`. The sampling
          +    /// window is the lifetime of the model version. Defaults to 0.
          +    #[serde(rename="samplingPercentage")]
          +    pub sampling_percentage: Option,
          +    /// Required. Fully qualified BigQuery table name in the following format:
          +    /// "project_id.dataset_name.table_name"
          +    /// 
          +    /// The specified table must already exist, and the "Cloud ML Service Agent"
          +    /// for your project must have permission to write to it. The table must have
          +    /// the following [schema](/bigquery/docs/schemas):
          +    /// 
          +    /// 
          +    ///   
          +    ///     
          +    ///   
          +    ///   
          +    ///   
          +    ///   
          +    ///   
          +    ///   
          +    /// 
          Field nameTypeMode
          modelSTRINGREQUIRED
          model_versionSTRINGREQUIRED
          timeTIMESTAMPREQUIRED
          raw_dataSTRINGREQUIRED
          raw_predictionSTRINGNULLABLE
          groundtruthSTRINGNULLABLE
          + #[serde(rename="bigqueryTableName")] + pub bigquery_table_name: Option, +} + +impl Part for GoogleCloudMlV1__RequestLoggingConfig {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1_StudyConfigParameterSpec_DiscreteValueSpec { + /// Must be specified if type is `DISCRETE`. + /// A list of feasible points. + /// The list should be in strictly increasing order. For instance, this + /// parameter might have possible settings of 1.5, 2.5, and 4.0. This list + /// should not contain more than 1,000 values. + pub values: Option>, +} + +impl Part for GoogleCloudMlV1_StudyConfigParameterSpec_DiscreteValueSpec {} + + +/// The response message for the ListTrials method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies trials list projects](struct.ProjectLocationStudyTrialListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ListTrialsResponse { + /// The trials associated with the study. + pub trials: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__ListTrialsResponse {} + + +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// ````text +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:jose@example.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// ```` +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// jose@example.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for GoogleIamV1__AuditLogConfig {} + + +/// A message representing a metric in the measurement. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1_Measurement_Metric { + /// Required. Metric name. + pub metric: Option, + /// Required. The value for this metric. + pub value: Option, +} + +impl Part for GoogleCloudMlV1_Measurement_Metric {} + + +/// A message representing a parameter to be tuned. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1_Trial_Parameter { + /// Must be set if ParameterTypeis CATEGORICAL + #[serde(rename="stringValue")] + pub string_value: Option, + /// Must be set if ParameterType is INTEGER + #[serde(rename="intValue")] + pub int_value: Option, + /// Must be set if ParameterType is DOUBLE or DISCRETE. + #[serde(rename="floatValue")] + pub float_value: Option, + /// The name of the parameter. + pub parameter: Option, +} + +impl Part for GoogleCloudMlV1_Trial_Parameter {} + + +/// Configuration for Automated Early Stopping of Trials. If no +/// implementation_config is set, automated early stopping will not be run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__AutomatedStoppingConfig { + /// no description provided + #[serde(rename="decayCurveStoppingConfig")] + pub decay_curve_stopping_config: Option, + /// no description provided + #[serde(rename="medianAutomatedStoppingConfig")] + pub median_automated_stopping_config: Option, +} + +impl Part for GoogleCloudMlV1__AutomatedStoppingConfig {} + + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// ````text +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// ```` +/// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleType__Expr { + /// Optional. Description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language + /// syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for GoogleType__Expr {} + + +/// The request message for the CheckTrialEarlyStoppingState service method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies trials check early stopping state projects](struct.ProjectLocationStudyTrialCheckEarlyStoppingStateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__CheckTrialEarlyStoppingStateRequest { _never_set: Option } + +impl RequestValue for GoogleCloudMlV1__CheckTrialEarlyStoppingStateRequest {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies trials suggest projects](struct.ProjectLocationStudyTrialSuggestCall.html) (response) +/// * [models versions create projects](struct.ProjectModelVersionCreateCall.html) (response) +/// * [models versions patch projects](struct.ProjectModelVersionPatchCall.html) (response) +/// * [operations get projects](struct.ProjectOperationGetCall.html) (response) +/// * [models versions delete projects](struct.ProjectModelVersionDeleteCall.html) (response) +/// * [locations operations get projects](struct.ProjectLocationOperationGetCall.html) (response) +/// * [locations studies trials check early stopping state projects](struct.ProjectLocationStudyTrialCheckEarlyStoppingStateCall.html) (response) +/// * [models delete projects](struct.ProjectModelDeleteCall.html) (response) +/// * [models patch projects](struct.ProjectModelPatchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleLongrunning__Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should be a resource name ending with `operations/{unique_id}`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for GoogleLongrunning__Operation {} + + +/// A message representing a Trial. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies trials add measurement projects](struct.ProjectLocationStudyTrialAddMeasurementCall.html) (response) +/// * [locations studies trials complete projects](struct.ProjectLocationStudyTrialCompleteCall.html) (response) +/// * [locations studies trials create projects](struct.ProjectLocationStudyTrialCreateCall.html) (request|response) +/// * [locations studies trials get projects](struct.ProjectLocationStudyTrialGetCall.html) (response) +/// * [locations studies trials stop projects](struct.ProjectLocationStudyTrialStopCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__Trial { + /// Output only. A human readable string describing why the Trial is + /// infeasible. This should only be set if trial_infeasible is true. + #[serde(rename="infeasibleReason")] + pub infeasible_reason: Option, + /// The final Measurement containing the objective value. + #[serde(rename="finalMeasurement")] + pub final_measurement: Option, + /// Output only. Name of the trial assigned by the service. + pub name: Option, + /// The parameters of the Trial. + pub parameters: Option>, + /// A list of measurements that are strictly lexicographically + /// ordered by their induced tuples (steps, elapsed_time). + /// These are used for early stopping computations. + pub measurements: Option>, + /// Output only. The identifier of the client that originally requested this trial. + #[serde(rename="clientId")] + pub client_id: Option, + /// The detailed state of a trial. + pub state: Option, + /// Output only. Time the Trial was started. + #[serde(rename="startTime")] + pub start_time: Option, + /// Output only. Time the Trial's status changed to COMPLETED. + #[serde(rename="endTime")] + pub end_time: Option, + /// Output only. True if the parameters in this trial should not be attempted again. + #[serde(rename="trialInfeasible")] + pub trial_infeasible: Option, +} + +impl RequestValue for GoogleCloudMlV1__Trial {} +impl ResponseResult for GoogleCloudMlV1__Trial {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies list projects](struct.ProjectLocationStudyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ListStudiesResponse { + /// The Studies associated with the project. + pub studies: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__ListStudiesResponse {} + + +/// The request message for the AddTrialMeasurement service method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies trials add measurement projects](struct.ProjectLocationStudyTrialAddMeasurementCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__AddTrialMeasurementRequest { + /// Required. The measurement to be added to a trial. + pub measurement: Option, +} + +impl RequestValue for GoogleCloudMlV1__AddTrialMeasurementRequest {} + + +/// Represents a machine learning solution. +/// +/// A model can have multiple versions, each of which is a deployed, trained +/// model ready to receive prediction requests. The model itself is just a +/// container. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [models get projects](struct.ProjectModelGetCall.html) (response) +/// * [models patch projects](struct.ProjectModelPatchCall.html) (request) +/// * [models create projects](struct.ProjectModelCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__Model { + /// Optional. The description specified for the model when it was created. + pub description: Option, + /// Optional. If true, online prediction nodes send `stderr` and `stdout` + /// streams to Stackdriver Logging. These can be more verbose than the standard + /// access logs (see `onlinePredictionLogging`) and can incur higher cost. + /// However, they are helpful for debugging. Note that + /// [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if + /// your project receives prediction requests at a high QPS. Estimate your + /// costs before enabling this option. + /// + /// Default is false. + #[serde(rename="onlinePredictionConsoleLogging")] + pub online_prediction_console_logging: Option, + /// Optional. One or more labels that you can add, to organize your models. + /// Each label is a key-value pair, where both the key and the value are + /// arbitrary strings that you supply. + /// For more information, see the documentation on + /// using labels. + pub labels: Option>, + /// Optional. The list of regions where the model is going to be deployed. + /// Only one region per model is supported. + /// Defaults to 'us-central1' if nothing is set. + /// See the available regions + /// for AI Platform services. + /// Note: + /// + /// * No matter where a model is deployed, it can always be accessed by + /// users from anywhere, both for online and batch prediction. + /// * The region for a batch prediction job is set by the region field when + /// submitting the batch prediction job and does not take its value from + /// this field. + pub regions: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a model from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform model updates in order to avoid race + /// conditions: An `etag` is returned in the response to `GetModel`, and + /// systems are expected to put that etag in the request to `UpdateModel` to + /// ensure that their change will be applied to the model as intended. + pub etag: Option, + /// Output only. The default version of the model. This version will be used to + /// handle prediction requests that do not specify a version. + /// + /// You can change the default version by calling + /// projects.models.versions.setDefault. + #[serde(rename="defaultVersion")] + pub default_version: Option, + /// Optional. If true, online prediction access logs are sent to StackDriver + /// Logging. These logs are like standard server access logs, containing + /// information like timestamp and latency for each request. Note that + /// [Stackdriver logs may incur a cost](/stackdriver/pricing), especially if + /// your project receives prediction requests at a high queries per second rate + /// (QPS). Estimate your costs before enabling this option. + /// + /// Default is false. + #[serde(rename="onlinePredictionLogging")] + pub online_prediction_logging: Option, + /// Required. The name specified for the model when it was created. + /// + /// The model name must be unique within the project it is created in. + pub name: Option, +} + +impl RequestValue for GoogleCloudMlV1__Model {} +impl ResponseResult for GoogleCloudMlV1__Model {} + + +/// Attributes credit by computing the XRAI taking advantage +/// of the model's fully differentiable structure. Refer to this paper for +/// more details: https://arxiv.org/abs/1906.02825 +/// Currently only implemented for models with natural image inputs. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__XraiAttribution { + /// Number of steps for approximating the path integral. + /// A good value to start is 50 and gradually increase until the + /// sum to diff property is met within the desired error range. + #[serde(rename="numIntegralSteps")] + pub num_integral_steps: Option, +} + +impl Part for GoogleCloudMlV1__XraiAttribution {} + + +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__ListLocationsResponse { + /// Optional. Pass this token as the `page_token` field of the request for a + /// subsequent call. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Locations where at least one type of CMLE capability is available. + pub locations: Option>, +} + +impl ResponseResult for GoogleCloudMlV1__ListLocationsResponse {} + + +/// A message representing a Study. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies get projects](struct.ProjectLocationStudyGetCall.html) (response) +/// * [locations studies create projects](struct.ProjectLocationStudyCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__Study { + /// Output only. A human readable reason why the Study is inactive. + /// This should be empty if a study is ACTIVE or COMPLETED. + #[serde(rename="inactiveReason")] + pub inactive_reason: Option, + /// Output only. The detailed state of a study. + pub state: Option, + /// Output only. Time that the study was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Required. Configuration of the study. + #[serde(rename="studyConfig")] + pub study_config: Option, + /// Output only. The name of a study. + pub name: Option, +} + +impl RequestValue for GoogleCloudMlV1__Study {} +impl ResponseResult for GoogleCloudMlV1__Study {} + + +/// Response message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [jobs test iam permissions projects](struct.ProjectJobTestIamPermissionCall.html) (response) +/// * [models test iam permissions projects](struct.ProjectModelTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleIamV1__TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + pub permissions: Option>, +} + +impl ResponseResult for GoogleIamV1__TestIamPermissionsResponse {} + + +/// Returns service account information associated with a project. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get config projects](struct.ProjectGetConfigCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__GetConfigResponse { + /// The project number for `service_account`. + #[serde(rename="serviceAccountProject")] + pub service_account_project: Option, + /// no description provided + pub config: Option, + /// The service account Cloud ML uses to access resources in the project. + #[serde(rename="serviceAccount")] + pub service_account: Option, +} + +impl ResponseResult for GoogleCloudMlV1__GetConfigResponse {} + + +/// The request message for the SuggestTrial service method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations studies trials suggest projects](struct.ProjectLocationStudyTrialSuggestCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1__SuggestTrialsRequest { + /// Required. The identifier of the client that is requesting the suggestion. + /// + /// If multiple SuggestTrialsRequests have the same `client_id`, + /// the service will return the identical suggested trial if the trial is + /// pending, and provide a new trial if the last suggested trial was completed. + #[serde(rename="clientId")] + pub client_id: Option, + /// Required. The number of suggestions requested. + #[serde(rename="suggestionCount")] + pub suggestion_count: Option, +} + +impl RequestValue for GoogleCloudMlV1__SuggestTrialsRequest {} + + // ################### // MethodBuilders ### @@ -2184,7 +3102,7 @@ impl Part for GoogleCloudMlV1__AutoScaling {} /// ::default(), None); /// let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get_config(...)`, `jobs_cancel(...)`, `jobs_create(...)`, `jobs_get(...)`, `jobs_get_iam_policy(...)`, `jobs_list(...)`, `jobs_patch(...)`, `jobs_set_iam_policy(...)`, `jobs_test_iam_permissions(...)`, `locations_get(...)`, `locations_list(...)`, `models_create(...)`, `models_delete(...)`, `models_get(...)`, `models_get_iam_policy(...)`, `models_list(...)`, `models_patch(...)`, `models_set_iam_policy(...)`, `models_test_iam_permissions(...)`, `models_versions_create(...)`, `models_versions_delete(...)`, `models_versions_get(...)`, `models_versions_list(...)`, `models_versions_patch(...)`, `models_versions_set_default(...)`, `operations_cancel(...)`, `operations_get(...)`, `operations_list(...)` and `predict(...)` +/// // like `explain(...)`, `get_config(...)`, `jobs_cancel(...)`, `jobs_create(...)`, `jobs_get(...)`, `jobs_get_iam_policy(...)`, `jobs_list(...)`, `jobs_patch(...)`, `jobs_set_iam_policy(...)`, `jobs_test_iam_permissions(...)`, `locations_get(...)`, `locations_list(...)`, `locations_operations_cancel(...)`, `locations_operations_get(...)`, `locations_studies_create(...)`, `locations_studies_delete(...)`, `locations_studies_get(...)`, `locations_studies_list(...)`, `locations_studies_trials_add_measurement(...)`, `locations_studies_trials_check_early_stopping_state(...)`, `locations_studies_trials_complete(...)`, `locations_studies_trials_create(...)`, `locations_studies_trials_delete(...)`, `locations_studies_trials_get(...)`, `locations_studies_trials_list(...)`, `locations_studies_trials_stop(...)`, `locations_studies_trials_suggest(...)`, `models_create(...)`, `models_delete(...)`, `models_get(...)`, `models_get_iam_policy(...)`, `models_list(...)`, `models_patch(...)`, `models_set_iam_policy(...)`, `models_test_iam_permissions(...)`, `models_versions_create(...)`, `models_versions_delete(...)`, `models_versions_get(...)`, `models_versions_list(...)`, `models_versions_patch(...)`, `models_versions_set_default(...)`, `operations_cancel(...)`, `operations_get(...)`, `operations_list(...)` and `predict(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2199,11 +3117,33 @@ impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} impl<'a, C, A> ProjectMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Adds a measurement of the objective metrics to a Trial. This measurement + /// is assumed to have been taken before the Trial is complete. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The trial name. + pub fn locations_studies_trials_add_measurement(&self, request: GoogleCloudMlV1__AddTrialMeasurementRequest, name: &str) -> ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> { + ProjectLocationStudyTrialAddMeasurementCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2222,10 +3162,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Performs prediction on the data in the request. - /// AI Platform implements a custom `predict` verb on top of an HTTP POST - /// method.

          For details of the request and response format, see the **guide - /// to the [predict request format](/ml-engine/docs/v1/predict-request)**. + /// Performs online prediction on the data in the request. + /// + ///

          {% dynamic include "/ai-platform/includes/___predict-request" %}
          /// /// # Arguments /// @@ -2257,7 +3196,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `name` - Required. The name of the version. You can get the names of all the /// versions of a model by calling - /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + /// projects.models.versions.list. pub fn models_versions_delete(&self, name: &str) -> ProjectModelVersionDeleteCall<'a, C, A> { ProjectModelVersionDeleteCall { hub: self.hub, @@ -2313,6 +3252,40 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the trials associated with a Study. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the study that the trial belongs to. + pub fn locations_studies_trials_list(&self, parent: &str) -> ProjectLocationStudyTrialListCall<'a, C, A> { + ProjectLocationStudyTrialListCall { + hub: self.hub, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a Trial. + /// + /// # Arguments + /// + /// * `name` - Required. The trial name. + pub fn locations_studies_trials_get(&self, name: &str) -> ProjectLocationStudyTrialGetCall<'a, C, A> { + ProjectLocationStudyTrialGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Designates a version to be the default for the model. @@ -2329,7 +3302,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `request` - No description provided. /// * `name` - Required. The name of the version to make the default for the model. You /// can get the names of all the versions of a model by calling - /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + /// projects.models.versions.list. pub fn models_versions_set_default(&self, request: GoogleCloudMlV1__SetDefaultVersionRequest, name: &str) -> ProjectModelVersionSetDefaultCall<'a, C, A> { ProjectModelVersionSetDefaultCall { hub: self.hub, @@ -2364,11 +3337,34 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a study. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project and location that the study belongs to. + /// Format: projects/{project}/locations/{location} + pub fn locations_studies_create(&self, request: GoogleCloudMlV1__Study, parent: &str) -> ProjectLocationStudyCreateCall<'a, C, A> { + ProjectLocationStudyCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _study_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2385,6 +3381,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns a long-running operation associated with the generation of trial + /// suggestions. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the study that the trial belongs to. + pub fn locations_studies_trials_suggest(&self, request: GoogleCloudMlV1__SuggestTrialsRequest, parent: &str) -> ProjectLocationStudyTrialSuggestCall<'a, C, A> { + ProjectLocationStudyTrialSuggestCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the access control policy for a resource. @@ -2399,6 +3415,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectJobGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2407,18 +3424,71 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List all locations that provides at least one type of CMLE capability. + /// Marks a Trial as complete. /// /// # Arguments /// - /// * `parent` - Required. The name of the project for which available locations are to be - /// listed (since some locations might be whitelisted for specific projects). - pub fn locations_list(&self, parent: &str) -> ProjectLocationListCall<'a, C, A> { - ProjectLocationListCall { + /// * `request` - No description provided. + /// * `name` - Required. The trial name. + pub fn locations_studies_trials_complete(&self, request: GoogleCloudMlV1__CompleteTrialRequest, name: &str) -> ProjectLocationStudyTrialCompleteCall<'a, C, A> { + ProjectLocationStudyTrialCompleteCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn locations_operations_get(&self, name: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + ProjectLocationOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a study. + /// + /// # Arguments + /// + /// * `name` - Required. The study name. + pub fn locations_studies_get(&self, name: &str) -> ProjectLocationStudyGetCall<'a, C, A> { + ProjectLocationStudyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the studies in a region for an associated project. + /// + /// # Arguments + /// + /// * `parent` - Required. The project and location that the study belongs to. + /// Format: projects/{project}/locations/{location} + pub fn locations_studies_list(&self, parent: &str) -> ProjectLocationStudyListCall<'a, C, A> { + ProjectLocationStudyListCall { hub: self.hub, _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2461,12 +3531,77 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be cancelled. + pub fn locations_operations_cancel(&self, name: &str) -> ProjectLocationOperationCancelCall<'a, C, A> { + ProjectLocationOperationCancelCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Performs explanation on the data in the request. + /// AI Platform implements a custom `explain` verb on top of an HTTP POST + /// method. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of a model or a version. + /// Authorization: requires the `predict` permission on the specified resource. + pub fn explain(&self, request: GoogleCloudMlV1__ExplainRequest, name: &str) -> ProjectExplainCall<'a, C, A> { + ProjectExplainCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a Trial. + /// + /// # Arguments + /// + /// * `name` - Required. The trial name. + pub fn locations_studies_trials_delete(&self, name: &str) -> ProjectLocationStudyTrialDeleteCall<'a, C, A> { + ProjectLocationStudyTrialDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the specified Version resource. /// - /// Currently the only update-able fields are `description` and - /// `autoScaling.minNodes`. + /// Currently the only update-able fields are `description`, + /// `requestLoggingConfig`, `autoScaling.minNodes`, and `manualScaling.nodes`. /// /// # Arguments /// @@ -2489,7 +3624,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Gets information about a model version. /// /// Models can have multiple versions. You can call - /// [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list) + /// projects.models.versions.list /// to get the same information that this method returns for all of the /// versions of a model. /// @@ -2548,6 +3683,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Adds a user provided trial to a Study. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the study that the trial belongs to. + pub fn locations_studies_trials_create(&self, request: GoogleCloudMlV1__Trial, parent: &str) -> ProjectLocationStudyTrialCreateCall<'a, C, A> { + ProjectLocationStudyTrialCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Get the complete list of CMLE capabilities in a location, along with their @@ -2566,6 +3720,45 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// List all locations that provides at least one type of CMLE capability. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project for which available locations are to be + /// listed (since some locations might be whitelisted for specific projects). + pub fn locations_list(&self, parent: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Stops a trial. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The trial name. + pub fn locations_studies_trials_stop(&self, request: GoogleCloudMlV1__StopTrialRequest, name: &str) -> ProjectLocationStudyTrialStopCall<'a, C, A> { + ProjectLocationStudyTrialStopCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. @@ -2630,7 +3823,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// model. When you add a version to a model that already has one or more /// versions, the default version does not automatically change. If you want a /// new version to be the default, you must call - /// [projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + /// projects.models.versions.setDefault. /// /// # Arguments /// @@ -2661,6 +3854,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectModelGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2713,6 +3907,23 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a study. + /// + /// # Arguments + /// + /// * `name` - Required. The study name. + pub fn locations_studies_delete(&self, name: &str) -> ProjectLocationStudyDeleteCall<'a, C, A> { + ProjectLocationStudyDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Starts asynchronous cancellation on a long-running operation. The server @@ -2739,13 +3950,32 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Checks whether a trial should stop or not. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The trial name. + pub fn locations_studies_trials_check_early_stopping_state(&self, request: GoogleCloudMlV1__CheckTrialEarlyStoppingStateRequest, name: &str) -> ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> { + ProjectLocationStudyTrialCheckEarlyStoppingStateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a model which will later contain one or more versions. /// /// You must add at least one version before you can request predictions from /// the model. Add versions by calling - /// [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create). + /// projects.models.versions.create. /// /// # Arguments /// @@ -2768,7 +3998,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// You can only delete a model if there are no versions in it. You can delete /// versions by calling - /// [projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete). + /// projects.models.versions.delete. /// /// # Arguments /// @@ -2860,8 +4090,290 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# +/// Adds a measurement of the objective metrics to a Trial. This measurement +/// is assumed to have been taken before the Trial is complete. +/// +/// A builder for the *locations.studies.trials.addMeasurement* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__AddTrialMeasurementRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__AddTrialMeasurementRequest::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_studies_trials_add_measurement(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__AddTrialMeasurementRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__Trial)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.addMeasurement", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:addMeasurement"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__AddTrialMeasurementRequest) -> ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The trial name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialAddMeasurementCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *jobs.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3141,10 +4653,9 @@ impl<'a, C, A> ProjectJobSetIamPolicyCall<'a, C, A> where C: BorrowMutFor details of the request and response format, see the **guide -/// to the [predict request format](/ml-engine/docs/v1/predict-request)**. +/// Performs online prediction on the data in the request. +/// +///
          {% dynamic include "/ai-platform/includes/___predict-request" %}
          /// /// A builder for the *predict* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3608,7 +5119,7 @@ impl<'a, C, A> ProjectModelVersionDeleteCall<'a, C, A> where C: BorrowMut ProjectJobTestIamPermissionCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_studies_trials_list("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__ListTrialsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/trials"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the study that the trial belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationStudyTrialListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a Trial. +/// +/// A builder for the *locations.studies.trials.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_studies_trials_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__Trial)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The trial name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyTrialGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Designates a version to be the default for the model. /// /// The default version is used for prediction requests made against the model @@ -4461,7 +6468,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelPatchCall<'a, C, A> where C: BorrowMut } +/// Creates a study. +/// +/// A builder for the *locations.studies.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__Study; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__Study::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_studies_create(req, "parent") +/// .study_id("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Study, + _parent: String, + _study_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__Study)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._study_id { + params.push(("studyId", value.to_string())); + } + for &field in ["alt", "parent", "studyId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/studies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__Study) -> ProjectLocationStudyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project and location that the study belongs to. + /// Format: projects/{project}/locations/{location} + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationStudyCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Required. The ID to use for the study, which will become the final component of + /// the study's resource name. + /// + /// Sets the *study id* query property to the given value. + pub fn study_id(mut self, new_value: &str) -> ProjectLocationStudyCreateCall<'a, C, A> { + self._study_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *models.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -5123,6 +7425,286 @@ impl<'a, C, A> ProjectModelSetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__SuggestTrialsRequest::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_studies_trials_suggest(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialSuggestCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__SuggestTrialsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialSuggestCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialSuggestCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunning__Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.suggest", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/trials:suggest"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__SuggestTrialsRequest) -> ProjectLocationStudyTrialSuggestCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the study that the trial belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationStudyTrialSuggestCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialSuggestCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialSuggestCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialSuggestCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the access control policy for a resource. /// Returns an empty policy if the resource exists and does not have a policy /// set. @@ -5153,6 +7735,7 @@ impl<'a, C, A> ProjectModelSetIamPolicyCall<'a, C, A> where C: BorrowMut hub: &'a CloudMachineLearningEngine, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5183,9 +7767,12 @@ impl<'a, C, A> ProjectJobGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5311,6 +7898,20 @@ impl<'a, C, A> ProjectJobGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectJobGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -5374,9 +7975,290 @@ impl<'a, C, A> ProjectJobGetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__CompleteTrialRequest::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_studies_trials_complete(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialCompleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__CompleteTrialRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialCompleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialCompleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__Trial)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.complete", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:complete"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__CompleteTrialRequest) -> ProjectLocationStudyTrialCompleteCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The trial name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyTrialCompleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialCompleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialCompleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialCompleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *locations.operations.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -5401,31 +8283,27 @@ impl<'a, C, A> ProjectJobGetIamPolicyCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationOperationGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudMachineLearningEngine, - _parent: String, - _page_token: Option, - _page_size: Option, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationOperationGetCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__ListLocationsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunning__Operation)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -5434,17 +8312,11 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "ml.projects.locations.list", + dlg.begin(MethodInfo { id: "ml.projects.locations.operations.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5456,7 +8328,503 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a study. +/// +/// A builder for the *locations.studies.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_studies_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__Study)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The study name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists all the studies in a region for an associated project. +/// +/// A builder for the *locations.studies.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_studies_list("parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__ListStudiesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/studies"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5559,45 +8927,24 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut ProjectLocationListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectLocationStudyListCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// Optional. A page token to request the next page of results. - /// - /// You get the token from the `next_page_token` field of the response from - /// the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The number of locations to retrieve per "page" of results. If - /// there are more remaining results than this number, the response message - /// will contain a valid value in the `next_page_token` field. - /// - /// The default value is 20, and the maximum page size is 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5622,7 +8969,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5642,7 +8989,7 @@ impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6181,10 +9528,798 @@ impl<'a, C, A> ProjectJobCancelCall<'a, C, A> where C: BorrowMut, } +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. +/// +/// A builder for the *locations.operations.cancel* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_operations_cancel("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobuf__Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be cancelled. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationCancelCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Performs explanation on the data in the request. +/// AI Platform implements a custom `explain` verb on top of an HTTP POST +/// method. +/// +/// A builder for the *explain* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__ExplainRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__ExplainRequest::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().explain(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectExplainCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__ExplainRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectExplainCall<'a, C, A> {} + +impl<'a, C, A> ProjectExplainCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleApi__HttpBody)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.explain", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:explain"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__ExplainRequest) -> ProjectExplainCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of a model or a version. + /// + /// Authorization: requires the `predict` permission on the specified resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectExplainCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectExplainCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectExplainCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectExplainCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes a Trial. +/// +/// A builder for the *locations.studies.trials.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_studies_trials_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobuf__Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The trial name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyTrialDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the specified Version resource. /// -/// Currently the only update-able fields are `description` and -/// `autoScaling.minNodes`. +/// Currently the only update-able fields are `description`, +/// `requestLoggingConfig`, `autoScaling.minNodes`, and `manualScaling.nodes`. /// /// A builder for the *models.versions.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -6218,7 +10353,7 @@ impl<'a, C, A> ProjectJobCancelCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().models_versions_patch(req, "name") -/// .update_mask("justo") +/// .update_mask("eos") /// .doit(); /// # } /// ``` @@ -6411,12 +10546,18 @@ impl<'a, C, A> ProjectModelVersionPatchCall<'a, C, A> where C: BorrowMut ProjectModelVersionPatchCall<'a, C, A> { @@ -6489,7 +10630,7 @@ impl<'a, C, A> ProjectModelVersionPatchCall<'a, C, A> where C: BorrowMut ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut ProjectGetConfigCall<'a, C, A> where C: BorrowMut, } +/// Adds a user provided trial to a Study. +/// +/// A builder for the *locations.studies.trials.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__Trial; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__Trial::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_studies_trials_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__Trial, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__Trial)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/trials"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__Trial) -> ProjectLocationStudyTrialCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the study that the trial belongs to. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationStudyTrialCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Get the complete list of CMLE capabilities in a location, along with their /// location-specific properties. /// @@ -7550,6 +11970,565 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_list("parent") +/// .page_token("labore") +/// .page_size(-39) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/locations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the project for which available locations are to be + /// listed (since some locations might be whitelisted for specific projects). + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. A page token to request the next page of results. + /// + /// You get the token from the `next_page_token` field of the response from + /// the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The number of locations to retrieve per "page" of results. If + /// there are more remaining results than this number, the response message + /// will contain a valid value in the `next_page_token` field. + /// + /// The default value is 20, and the maximum page size is 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Stops a trial. +/// +/// A builder for the *locations.studies.trials.stop* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_ml1 as ml1; +/// use ml1::GoogleCloudMlV1__StopTrialRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use ml1::CloudMachineLearningEngine; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__StopTrialRequest::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_studies_trials_stop(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialStopCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__StopTrialRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialStopCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialStopCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1__Trial)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.stop", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:stop"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__StopTrialRequest) -> ProjectLocationStudyTrialStopCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The trial name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyTrialStopCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialStopCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialStopCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialStopCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns permissions that a caller has on the specified resource. /// If the resource does not exist, this will return an empty set of /// permissions, not a NOT_FOUND error. @@ -7873,9 +12852,9 @@ impl<'a, C, A> ProjectModelTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectOperationListCall<'a, C, A> where C: BorrowMut ProjectModelVersionCreateCall<'a, C, A> where C: BorrowMut hub: &'a CloudMachineLearningEngine, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -8475,9 +13456,12 @@ impl<'a, C, A> ProjectModelGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8603,6 +13587,20 @@ impl<'a, C, A> ProjectModelGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectModelGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -8701,9 +13699,9 @@ impl<'a, C, A> ProjectModelGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectOperationGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_studies_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobuf__Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The study name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Starts asynchronous cancellation on a long-running operation. The server /// makes a best effort to cancel the operation, but success is not /// guaranteed. If the server doesn't support this method, it returns @@ -9471,11 +14717,290 @@ impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GoogleCloudMlV1__CheckTrialEarlyStoppingStateRequest::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_studies_trials_check_early_stopping_state(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1__CheckTrialEarlyStoppingStateRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunning__Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "ml.projects.locations.studies.trials.checkEarlyStoppingState", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:checkEarlyStoppingState"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GoogleCloudMlV1__CheckTrialEarlyStoppingStateRequest) -> ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The trial name. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationStudyTrialCheckEarlyStoppingStateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a model which will later contain one or more versions. /// /// You must add at least one version before you can request predictions from /// the model. Add versions by calling -/// [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create). +/// projects.models.versions.create. /// /// A builder for the *models.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -9758,7 +15283,7 @@ impl<'a, C, A> ProjectModelCreateCall<'a, C, A> where C: BorrowMut ProjectModelDeleteCall<'a, C, A> where C: BorrowMut ProjectModelGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().models_list("parent") -/// .page_token("et") -/// .page_size(-70) -/// .filter("et") +/// .page_token("Lorem") +/// .page_size(-11) +/// .filter("justo") /// .doit(); /// # } /// ``` diff --git a/gen/monitoring3-cli/Cargo.toml b/gen/monitoring3-cli/Cargo.toml index 1a151b685a..9aea134dcf 100644 --- a/gen/monitoring3-cli/Cargo.toml +++ b/gen/monitoring3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-monitoring3-cli" -version = "1.0.12+20190629" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Monitoring (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/monitoring3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-monitoring3] path = "../monitoring3" -version = "1.0.12+20190629" +version = "1.0.13+20200329" diff --git a/gen/monitoring3-cli/README.md b/gen/monitoring3-cli/README.md index 0abc6a742f..762f2f0d0d 100644 --- a/gen/monitoring3-cli/README.md +++ b/gen/monitoring3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Monitoring* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *Monitoring* API at revision *20200329*. The CLI is at version *1.0.13*. ```bash monitoring3 [options] @@ -60,11 +60,23 @@ monitoring3 [options] notification-channels-verify (-r )... [-p ]... [-o ] time-series-create (-r )... [-p ]... [-o ] time-series-list [-p ]... [-o ] + time-series-query (-r )... [-p ]... [-o ] uptime-check-configs-create (-r )... [-p ]... [-o ] uptime-check-configs-delete [-p ]... [-o ] uptime-check-configs-get [-p ]... [-o ] uptime-check-configs-list [-p ]... [-o ] uptime-check-configs-patch (-r )... [-p ]... [-o ] + services + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + get [-p ]... [-o ] + list [-p ]... [-o ] + patch (-r )... [-p ]... [-o ] + service-level-objectives-create (-r )... [-p ]... [-o ] + service-level-objectives-delete [-p ]... [-o ] + service-level-objectives-get [-p ]... [-o ] + service-level-objectives-list [-p ]... [-o ] + service-level-objectives-patch (-r )... [-p ]... [-o ] uptime-check-ips list [-p ]... [-o ] monitoring3 --help diff --git a/gen/monitoring3-cli/mkdocs.yml b/gen/monitoring3-cli/mkdocs.yml index b2897a521e..9436497be3 100644 --- a/gen/monitoring3-cli/mkdocs.yml +++ b/gen/monitoring3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Monitoring v1.0.12+20190629 +site_name: Monitoring v1.0.13+20200329 site_url: http://byron.github.io/google-apis-rs/google-monitoring3-cli site_description: A complete library to interact with Monitoring (protocol v3) @@ -39,11 +39,22 @@ pages: - ['projects_notification-channels-verify.md', 'Projects', 'Notification Channels Verify'] - ['projects_time-series-create.md', 'Projects', 'Time Series Create'] - ['projects_time-series-list.md', 'Projects', 'Time Series List'] +- ['projects_time-series-query.md', 'Projects', 'Time Series Query'] - ['projects_uptime-check-configs-create.md', 'Projects', 'Uptime Check Configs Create'] - ['projects_uptime-check-configs-delete.md', 'Projects', 'Uptime Check Configs Delete'] - ['projects_uptime-check-configs-get.md', 'Projects', 'Uptime Check Configs Get'] - ['projects_uptime-check-configs-list.md', 'Projects', 'Uptime Check Configs List'] - ['projects_uptime-check-configs-patch.md', 'Projects', 'Uptime Check Configs Patch'] +- ['services_create.md', 'Services', 'Create'] +- ['services_delete.md', 'Services', 'Delete'] +- ['services_get.md', 'Services', 'Get'] +- ['services_list.md', 'Services', 'List'] +- ['services_patch.md', 'Services', 'Patch'] +- ['services_service-level-objectives-create.md', 'Services', 'Service Level Objectives Create'] +- ['services_service-level-objectives-delete.md', 'Services', 'Service Level Objectives Delete'] +- ['services_service-level-objectives-get.md', 'Services', 'Service Level Objectives Get'] +- ['services_service-level-objectives-list.md', 'Services', 'Service Level Objectives List'] +- ['services_service-level-objectives-patch.md', 'Services', 'Service Level Objectives Patch'] - ['uptime-check-ips_list.md', 'Uptime Check Ips', 'List'] theme: readthedocs diff --git a/gen/monitoring3-cli/src/main.rs b/gen/monitoring3-cli/src/main.rs index aa41848cd1..2b59cda435 100644 --- a/gen/monitoring3-cli/src/main.rs +++ b/gen/monitoring3-cli/src/main.rs @@ -77,12 +77,14 @@ impl<'n> Engine<'n> { "documentation.content" => Some(("documentation.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "documentation.mime-type" => Some(("documentation.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "validity.message" => Some(("validity.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "validity.code" => Some(("validity.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "user-labels" => Some(("userLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "notification-channels" => Some(("notificationChannels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mutation-record.mutated-by" => Some(("mutationRecord.mutatedBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mutation-record.mutate-time" => Some(("mutationRecord.mutateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["combiner", "content", "creation-record", "display-name", "documentation", "enabled", "mime-type", "mutate-time", "mutated-by", "mutation-record", "name", "notification-channels", "user-labels"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "combiner", "content", "creation-record", "display-name", "documentation", "enabled", "message", "mime-type", "mutate-time", "mutated-by", "mutation-record", "name", "notification-channels", "user-labels", "validity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -342,12 +344,14 @@ impl<'n> Engine<'n> { "documentation.content" => Some(("documentation.content", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "documentation.mime-type" => Some(("documentation.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "validity.message" => Some(("validity.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "validity.code" => Some(("validity.code", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "user-labels" => Some(("userLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "notification-channels" => Some(("notificationChannels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mutation-record.mutated-by" => Some(("mutationRecord.mutatedBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "mutation-record.mutate-time" => Some(("mutationRecord.mutateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["combiner", "content", "creation-record", "display-name", "documentation", "enabled", "mime-type", "mutate-time", "mutated-by", "mutation-record", "name", "notification-channels", "user-labels"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "combiner", "content", "creation-record", "display-name", "documentation", "enabled", "message", "mime-type", "mutate-time", "mutated-by", "mutation-record", "name", "notification-channels", "user-labels", "validity"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -957,13 +961,14 @@ impl<'n> Engine<'n> { "value-type" => Some(("valueType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "launch-stage" => Some(("launchStage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "unit" => Some(("unit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "monitored-resource-types" => Some(("monitoredResourceTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "metadata.launch-stage" => Some(("metadata.launchStage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.ingest-delay" => Some(("metadata.ingestDelay", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.sample-period" => Some(("metadata.samplePeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "display-name", "ingest-delay", "launch-stage", "metadata", "metric-kind", "name", "sample-period", "type", "unit", "value-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "display-name", "ingest-delay", "launch-stage", "metadata", "metric-kind", "monitored-resource-types", "name", "sample-period", "type", "unit", "value-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2199,6 +2204,93 @@ impl<'n> Engine<'n> { } } + fn _projects_time_series_query(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "query" => Some(("query", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["page-size", "page-token", "query"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::QueryTimeSeriesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().time_series_query(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_uptime_check_configs_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2226,6 +2318,7 @@ impl<'n> Engine<'n> { "resource-group.group-id" => Some(("resourceGroup.groupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-internal" => Some(("isInternal", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "tcp-check.port" => Some(("tcpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "period" => Some(("period", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "selected-regions" => Some(("selectedRegions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2235,12 +2328,13 @@ impl<'n> Engine<'n> { "http-check.headers" => Some(("httpCheck.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "http-check.auth-info.username" => Some(("httpCheck.authInfo.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-check.auth-info.password" => Some(("httpCheck.authInfo.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.validate-ssl" => Some(("httpCheck.validateSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "http-check.mask-headers" => Some(("httpCheck.maskHeaders", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "http-check.path" => Some(("httpCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-check.port" => Some(("httpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "timeout" => Some(("timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-info", "display-name", "group-id", "headers", "http-check", "labels", "mask-headers", "monitored-resource", "name", "password", "path", "period", "port", "resource-group", "resource-type", "selected-regions", "tcp-check", "timeout", "type", "use-ssl", "username"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-info", "display-name", "group-id", "headers", "http-check", "is-internal", "labels", "mask-headers", "monitored-resource", "name", "password", "path", "period", "port", "resource-group", "resource-type", "selected-regions", "tcp-check", "timeout", "type", "use-ssl", "username", "validate-ssl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2490,6 +2584,7 @@ impl<'n> Engine<'n> { "resource-group.group-id" => Some(("resourceGroup.groupId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-internal" => Some(("isInternal", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "tcp-check.port" => Some(("tcpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "period" => Some(("period", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "selected-regions" => Some(("selectedRegions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -2499,12 +2594,13 @@ impl<'n> Engine<'n> { "http-check.headers" => Some(("httpCheck.headers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "http-check.auth-info.username" => Some(("httpCheck.authInfo.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-check.auth-info.password" => Some(("httpCheck.authInfo.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "http-check.validate-ssl" => Some(("httpCheck.validateSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "http-check.mask-headers" => Some(("httpCheck.maskHeaders", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "http-check.path" => Some(("httpCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "http-check.port" => Some(("httpCheck.port", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "timeout" => Some(("timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-info", "display-name", "group-id", "headers", "http-check", "labels", "mask-headers", "monitored-resource", "name", "password", "path", "period", "port", "resource-group", "resource-type", "selected-regions", "tcp-check", "timeout", "type", "use-ssl", "username"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-info", "display-name", "group-id", "headers", "http-check", "is-internal", "labels", "mask-headers", "monitored-resource", "name", "password", "path", "period", "port", "resource-group", "resource-type", "selected-regions", "tcp-check", "timeout", "type", "use-ssl", "username", "validate-ssl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2568,6 +2664,789 @@ impl<'n> Engine<'n> { } } + fn _services_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cloud-endpoints.service" => Some(("cloudEndpoints.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mesh-istio.mesh-uid" => Some(("meshIstio.meshUid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mesh-istio.service-namespace" => Some(("meshIstio.serviceNamespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mesh-istio.service-name" => Some(("meshIstio.serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "telemetry.resource-name" => Some(("telemetry.resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.cluster-name" => Some(("clusterIstio.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.service-namespace" => Some(("clusterIstio.serviceNamespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.service-name" => Some(("clusterIstio.serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.location" => Some(("clusterIstio.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine.module-id" => Some(("appEngine.moduleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine", "cloud-endpoints", "cluster-istio", "cluster-name", "display-name", "location", "mesh-istio", "mesh-uid", "module-id", "name", "resource-name", "service", "service-name", "service-namespace", "telemetry"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Service = json::value::from_value(object).unwrap(); + let mut call = self.hub.services().create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "service-id" => { + call = call.service_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["service-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cloud-endpoints.service" => Some(("cloudEndpoints.service", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mesh-istio.mesh-uid" => Some(("meshIstio.meshUid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mesh-istio.service-namespace" => Some(("meshIstio.serviceNamespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "mesh-istio.service-name" => Some(("meshIstio.serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "telemetry.resource-name" => Some(("telemetry.resourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.cluster-name" => Some(("clusterIstio.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.service-namespace" => Some(("clusterIstio.serviceNamespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.service-name" => Some(("clusterIstio.serviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster-istio.location" => Some(("clusterIstio.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "app-engine.module-id" => Some(("appEngine.moduleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["app-engine", "cloud-endpoints", "cluster-istio", "cluster-name", "display-name", "location", "mesh-istio", "mesh-uid", "module-id", "name", "resource-name", "service", "service-name", "service-namespace", "telemetry"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Service = json::value::from_value(object).unwrap(); + let mut call = self.hub.services().patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_service_level_objectives_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "goal" => Some(("goal", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "calendar-period" => Some(("calendarPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.basic-sli.latency.threshold" => Some(("serviceLevelIndicator.basicSli.latency.threshold", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.basic-sli.version" => Some(("serviceLevelIndicator.basicSli.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.basic-sli.method" => Some(("serviceLevelIndicator.basicSli.method", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.basic-sli.location" => Some(("serviceLevelIndicator.basicSli.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.metric-mean-in-range.range.max" => Some(("serviceLevelIndicator.windowsBased.metricMeanInRange.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-mean-in-range.range.min" => Some(("serviceLevelIndicator.windowsBased.metricMeanInRange.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-mean-in-range.time-series" => Some(("serviceLevelIndicator.windowsBased.metricMeanInRange.timeSeries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-bad-metric-filter" => Some(("serviceLevelIndicator.windowsBased.goodBadMetricFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.threshold" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.threshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.latency.threshold" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.latency.threshold", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.version" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.method" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.method", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.location" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.distribution-cut.range.max" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.distribution-cut.range.min" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.distribution-cut.distribution-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.distributionFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.good-total-ratio.bad-service-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.badServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.good-total-ratio.total-service-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.totalServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.good-total-ratio.good-service-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.goodServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-sum-in-range.range.max" => Some(("serviceLevelIndicator.windowsBased.metricSumInRange.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-sum-in-range.range.min" => Some(("serviceLevelIndicator.windowsBased.metricSumInRange.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-sum-in-range.time-series" => Some(("serviceLevelIndicator.windowsBased.metricSumInRange.timeSeries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.window-period" => Some(("serviceLevelIndicator.windowsBased.windowPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.distribution-cut.range.max" => Some(("serviceLevelIndicator.requestBased.distributionCut.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.distribution-cut.range.min" => Some(("serviceLevelIndicator.requestBased.distributionCut.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.distribution-cut.distribution-filter" => Some(("serviceLevelIndicator.requestBased.distributionCut.distributionFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.good-total-ratio.bad-service-filter" => Some(("serviceLevelIndicator.requestBased.goodTotalRatio.badServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.good-total-ratio.total-service-filter" => Some(("serviceLevelIndicator.requestBased.goodTotalRatio.totalServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.good-total-ratio.good-service-filter" => Some(("serviceLevelIndicator.requestBased.goodTotalRatio.goodServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rolling-period" => Some(("rollingPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["bad-service-filter", "basic-sli", "basic-sli-performance", "calendar-period", "display-name", "distribution-cut", "distribution-filter", "goal", "good-bad-metric-filter", "good-service-filter", "good-total-ratio", "good-total-ratio-threshold", "latency", "location", "max", "method", "metric-mean-in-range", "metric-sum-in-range", "min", "name", "performance", "range", "request-based", "rolling-period", "service-level-indicator", "threshold", "time-series", "total-service-filter", "version", "window-period", "windows-based"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ServiceLevelObjective = json::value::from_value(object).unwrap(); + let mut call = self.hub.services().service_level_objectives_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "service-level-objective-id" => { + call = call.service_level_objective_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["service-level-objective-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_service_level_objectives_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().service_level_objectives_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_service_level_objectives_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().service_level_objectives_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["view"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_service_level_objectives_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.services().service_level_objectives_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "view" => { + call = call.view(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size", "view"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _services_service_level_objectives_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "goal" => Some(("goal", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "calendar-period" => Some(("calendarPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.basic-sli.latency.threshold" => Some(("serviceLevelIndicator.basicSli.latency.threshold", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.basic-sli.version" => Some(("serviceLevelIndicator.basicSli.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.basic-sli.method" => Some(("serviceLevelIndicator.basicSli.method", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.basic-sli.location" => Some(("serviceLevelIndicator.basicSli.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.metric-mean-in-range.range.max" => Some(("serviceLevelIndicator.windowsBased.metricMeanInRange.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-mean-in-range.range.min" => Some(("serviceLevelIndicator.windowsBased.metricMeanInRange.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-mean-in-range.time-series" => Some(("serviceLevelIndicator.windowsBased.metricMeanInRange.timeSeries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-bad-metric-filter" => Some(("serviceLevelIndicator.windowsBased.goodBadMetricFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.threshold" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.threshold", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.latency.threshold" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.latency.threshold", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.version" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.method" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.method", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.good-total-ratio-threshold.basic-sli-performance.location" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.distribution-cut.range.max" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.distribution-cut.range.min" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.distribution-cut.distribution-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.distributionFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.good-total-ratio.bad-service-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.badServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.good-total-ratio.total-service-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.totalServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.good-total-ratio-threshold.performance.good-total-ratio.good-service-filter" => Some(("serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.goodServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-sum-in-range.range.max" => Some(("serviceLevelIndicator.windowsBased.metricSumInRange.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-sum-in-range.range.min" => Some(("serviceLevelIndicator.windowsBased.metricSumInRange.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.metric-sum-in-range.time-series" => Some(("serviceLevelIndicator.windowsBased.metricSumInRange.timeSeries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.windows-based.window-period" => Some(("serviceLevelIndicator.windowsBased.windowPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.distribution-cut.range.max" => Some(("serviceLevelIndicator.requestBased.distributionCut.range.max", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.distribution-cut.range.min" => Some(("serviceLevelIndicator.requestBased.distributionCut.range.min", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.distribution-cut.distribution-filter" => Some(("serviceLevelIndicator.requestBased.distributionCut.distributionFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.good-total-ratio.bad-service-filter" => Some(("serviceLevelIndicator.requestBased.goodTotalRatio.badServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.good-total-ratio.total-service-filter" => Some(("serviceLevelIndicator.requestBased.goodTotalRatio.totalServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-level-indicator.request-based.good-total-ratio.good-service-filter" => Some(("serviceLevelIndicator.requestBased.goodTotalRatio.goodServiceFilter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rolling-period" => Some(("rollingPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["bad-service-filter", "basic-sli", "basic-sli-performance", "calendar-period", "display-name", "distribution-cut", "distribution-filter", "goal", "good-bad-metric-filter", "good-service-filter", "good-total-ratio", "good-total-ratio-threshold", "latency", "location", "max", "method", "metric-mean-in-range", "metric-sum-in-range", "min", "name", "performance", "range", "request-based", "rolling-period", "service-level-indicator", "threshold", "time-series", "total-service-filter", "version", "window-period", "windows-based"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ServiceLevelObjective = json::value::from_value(object).unwrap(); + let mut call = self.hub.services().service_level_objectives_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _uptime_check_ips_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.uptime_check_ips().list(); @@ -2724,6 +3603,9 @@ impl<'n> Engine<'n> { ("time-series-list", Some(opt)) => { call_result = self._projects_time_series_list(opt, dry_run, &mut err); }, + ("time-series-query", Some(opt)) => { + call_result = self._projects_time_series_query(opt, dry_run, &mut err); + }, ("uptime-check-configs-create", Some(opt)) => { call_result = self._projects_uptime_check_configs_create(opt, dry_run, &mut err); }, @@ -2745,6 +3627,44 @@ impl<'n> Engine<'n> { } } }, + ("services", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._services_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._services_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._services_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._services_list(opt, dry_run, &mut err); + }, + ("patch", Some(opt)) => { + call_result = self._services_patch(opt, dry_run, &mut err); + }, + ("service-level-objectives-create", Some(opt)) => { + call_result = self._services_service_level_objectives_create(opt, dry_run, &mut err); + }, + ("service-level-objectives-delete", Some(opt)) => { + call_result = self._services_service_level_objectives_delete(opt, dry_run, &mut err); + }, + ("service-level-objectives-get", Some(opt)) => { + call_result = self._services_service_level_objectives_get(opt, dry_run, &mut err); + }, + ("service-level-objectives-list", Some(opt)) => { + call_result = self._services_service_level_objectives_list(opt, dry_run, &mut err); + }, + ("service-level-objectives-patch", Some(opt)) => { + call_result = self._services_service_level_objectives_patch(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("services".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("uptime-check-ips", Some(opt)) => { match opt.subcommand() { ("list", Some(opt)) => { @@ -2841,14 +3761,16 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'alert-policies-create', 'alert-policies-delete', 'alert-policies-get', 'alert-policies-list', 'alert-policies-patch', 'collectd-time-series-create', 'groups-create', 'groups-delete', 'groups-get', 'groups-list', 'groups-members-list', 'groups-update', 'metric-descriptors-create', 'metric-descriptors-delete', 'metric-descriptors-get', 'metric-descriptors-list', 'monitored-resource-descriptors-get', 'monitored-resource-descriptors-list', 'notification-channel-descriptors-get', 'notification-channel-descriptors-list', 'notification-channels-create', 'notification-channels-delete', 'notification-channels-get', 'notification-channels-get-verification-code', 'notification-channels-list', 'notification-channels-patch', 'notification-channels-send-verification-code', 'notification-channels-verify', 'time-series-create', 'time-series-list', 'uptime-check-configs-create', 'uptime-check-configs-delete', 'uptime-check-configs-get', 'uptime-check-configs-list' and 'uptime-check-configs-patch'", vec![ + ("projects", "methods: 'alert-policies-create', 'alert-policies-delete', 'alert-policies-get', 'alert-policies-list', 'alert-policies-patch', 'collectd-time-series-create', 'groups-create', 'groups-delete', 'groups-get', 'groups-list', 'groups-members-list', 'groups-update', 'metric-descriptors-create', 'metric-descriptors-delete', 'metric-descriptors-get', 'metric-descriptors-list', 'monitored-resource-descriptors-get', 'monitored-resource-descriptors-list', 'notification-channel-descriptors-get', 'notification-channel-descriptors-list', 'notification-channels-create', 'notification-channels-delete', 'notification-channels-get', 'notification-channels-get-verification-code', 'notification-channels-list', 'notification-channels-patch', 'notification-channels-send-verification-code', 'notification-channels-verify', 'time-series-create', 'time-series-list', 'time-series-query', 'uptime-check-configs-create', 'uptime-check-configs-delete', 'uptime-check-configs-get', 'uptime-check-configs-list' and 'uptime-check-configs-patch'", vec![ ("alert-policies-create", Some(r##"Creates a new alerting policy."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_alert-policies-create", vec![ (Some(r##"name"##), None, - Some(r##"The project in which to create the alerting policy. The format is projects/[PROJECT_ID].Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[POLICY_ID], identifying the policy in the container."##), + Some(r##"Required. The project in which to create the alerting policy. The format is: + projects/[PROJECT_ID_OR_NUMBER] + Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container."##), Some(true), Some(false)), @@ -2876,8 +3798,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The alerting policy to delete. The format is: - projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + Some(r##"Required. The alerting policy to delete. The format is: + projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] For more information, see AlertPolicy."##), Some(true), Some(false)), @@ -2900,8 +3822,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The alerting policy to retrieve. The format is - projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + Some(r##"Required. The alerting policy to retrieve. The format is: + projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] "##), Some(true), Some(false)), @@ -2924,8 +3846,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The project whose alert policies are to be listed. The format is - projects/[PROJECT_ID] + Some(r##"Required. The project whose alert policies are to be listed. The format is: + projects/[PROJECT_ID_OR_NUMBER] Note that this field names the parent container in which the alerting policies to be listed are stored. To retrieve a single alerting policy by name, use the GetAlertPolicy operation, instead."##), Some(true), Some(false)), @@ -2948,8 +3870,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required if the policy exists. The resource name for this policy. The syntax is: - projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + Some(r##"Required if the policy exists. The resource name for this policy. The format is: + projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request."##), Some(true), Some(false)), @@ -2978,7 +3900,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The project in which to create the time series. The format is "projects/PROJECT_ID_OR_NUMBER"."##), + Some(r##"The project in which to create the time series. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3006,7 +3930,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The project in which to create the group. The format is "projects/{project_id_or_number}"."##), + Some(r##"Required. The project in which to create the group. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3034,7 +3960,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}"."##), + Some(r##"Required. The group to delete. The format is: + projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + "##), Some(true), Some(false)), @@ -3056,7 +3984,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The group to retrieve. The format is "projects/{project_id_or_number}/groups/{group_id}"."##), + Some(r##"Required. The group to retrieve. The format is: + projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + "##), Some(true), Some(false)), @@ -3078,7 +4008,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The project whose groups are to be listed. The format is "projects/{project_id_or_number}"."##), + Some(r##"Required. The project whose groups are to be listed. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3100,7 +4032,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The group whose members are listed. The format is "projects/{project_id_or_number}/groups/{group_id}"."##), + Some(r##"Required. The group whose members are listed. The format is: + projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + "##), Some(true), Some(false)), @@ -3122,7 +4056,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically."##), + Some(r##"Output only. The name of this group. The format is: + projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically."##), Some(true), Some(false)), @@ -3145,12 +4081,14 @@ fn main() { Some(false)), ]), ("metric-descriptors-create", - Some(r##"Creates a new metric descriptor. User-created metric descriptors define custom metrics."##), + Some(r##"Creates a new metric descriptor. User-created metric descriptors define custom metrics (https://cloud.google.com/monitoring/custom-metrics)."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_metric-descriptors-create", vec![ (Some(r##"name"##), None, - Some(r##"The project on which to execute the request. The format is "projects/{project_id_or_number}"."##), + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3173,12 +4111,14 @@ fn main() { Some(false)), ]), ("metric-descriptors-delete", - Some(r##"Deletes a metric descriptor. Only user-created custom metrics can be deleted."##), + Some(r##"Deletes a metric descriptor. Only user-created custom metrics (https://cloud.google.com/monitoring/custom-metrics) can be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_metric-descriptors-delete", vec![ (Some(r##"name"##), None, - Some(r##"The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example of {metric_id} is: "custom.googleapis.com/my_test_metric"."##), + Some(r##"Required. The metric descriptor on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + An example of [METRIC_ID] is: "custom.googleapis.com/my_test_metric"."##), Some(true), Some(false)), @@ -3195,12 +4135,14 @@ fn main() { Some(false)), ]), ("metric-descriptors-get", - Some(r##"Gets a single metric descriptor. This method does not require a Stackdriver account."##), + Some(r##"Gets a single metric descriptor. This method does not require a Workspace."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_metric-descriptors-get", vec![ (Some(r##"name"##), None, - Some(r##"The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example value of {metric_id} is "compute.googleapis.com/instance/disk/read_bytes_count"."##), + Some(r##"Required. The metric descriptor on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + An example value of [METRIC_ID] is "compute.googleapis.com/instance/disk/read_bytes_count"."##), Some(true), Some(false)), @@ -3217,12 +4159,14 @@ fn main() { Some(false)), ]), ("metric-descriptors-list", - Some(r##"Lists metric descriptors that match a filter. This method does not require a Stackdriver account."##), + Some(r##"Lists metric descriptors that match a filter. This method does not require a Workspace."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_metric-descriptors-list", vec![ (Some(r##"name"##), None, - Some(r##"The project on which to execute the request. The format is "projects/{project_id_or_number}"."##), + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3239,12 +4183,14 @@ fn main() { Some(false)), ]), ("monitored-resource-descriptors-get", - Some(r##"Gets a single monitored resource descriptor. This method does not require a Stackdriver account."##), + Some(r##"Gets a single monitored resource descriptor. This method does not require a Workspace."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_monitored-resource-descriptors-get", vec![ (Some(r##"name"##), None, - Some(r##"The monitored resource descriptor to get. The format is "projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}". The {resource_type} is a predefined type, such as cloudsql_database."##), + Some(r##"Required. The monitored resource descriptor to get. The format is: + projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + The [RESOURCE_TYPE] is a predefined type, such as cloudsql_database."##), Some(true), Some(false)), @@ -3261,12 +4207,14 @@ fn main() { Some(false)), ]), ("monitored-resource-descriptors-list", - Some(r##"Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account."##), + Some(r##"Lists monitored resource descriptors that match a filter. This method does not require a Workspace."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_monitored-resource-descriptors-list", vec![ (Some(r##"name"##), None, - Some(r##"The project on which to execute the request. The format is "projects/{project_id_or_number}"."##), + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3288,7 +4236,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The channel type for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}."##), + Some(r##"Required. The channel type for which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + "##), Some(true), Some(false)), @@ -3310,8 +4260,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: - projects/[PROJECT_ID] + Some(r##"Required. The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: + projects/[PROJECT_ID_OR_NUMBER] Note that this names the parent container in which to look for the descriptors; to retrieve a single descriptor by name, use the GetNotificationChannelDescriptor operation, instead."##), Some(true), Some(false)), @@ -3334,9 +4284,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The project on which to execute the request. The format is: - projects/[PROJECT_ID] - Note that this names the container into which the channel will be written. This does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel."##), + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel."##), Some(true), Some(false)), @@ -3364,7 +4314,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]."##), + Some(r##"Required. The channel for which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + "##), Some(true), Some(false)), @@ -3386,7 +4338,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]."##), + Some(r##"Required. The channel for which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + "##), Some(true), Some(false)), @@ -3408,7 +4362,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail."##), + Some(r##"Required. The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail."##), Some(true), Some(false)), @@ -3436,7 +4390,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The project on which to execute the request. The format is projects/[PROJECT_ID]. That is, this names the container in which to look for the notification channels; it does not name a specific channel. To query a specific channel by REST resource name, use the GetNotificationChannel operation."##), + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + This names the container in which to look for the notification channels; it does not name a specific channel. To query a specific channel by REST resource name, use the GetNotificationChannel operation."##), Some(true), Some(false)), @@ -3458,8 +4414,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The full REST resource name for this channel. The syntax is: - projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] + Some(r##"The full REST resource name for this channel. The format is: + projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] The [CHANNEL_ID] is automatically assigned by the server on creation."##), Some(true), Some(false)), @@ -3488,7 +4444,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The notification channel to which to send a verification code."##), + Some(r##"Required. The notification channel to which to send a verification code."##), Some(true), Some(false)), @@ -3516,7 +4472,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The notification channel to verify."##), + Some(r##"Required. The notification channel to verify."##), Some(true), Some(false)), @@ -3544,7 +4500,9 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The project on which to execute the request. The format is "projects/{project_id_or_number}"."##), + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3567,12 +4525,14 @@ fn main() { Some(false)), ]), ("time-series-list", - Some(r##"Lists time series that match a filter. This method does not require a Stackdriver account."##), + Some(r##"Lists time series that match a filter. This method does not require a Workspace."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_time-series-list", vec![ (Some(r##"name"##), None, - Some(r##"The project on which to execute the request. The format is "projects/{project_id_or_number}"."##), + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3582,6 +4542,36 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("time-series-query", + Some(r##"Queries time series using the time series query language. This method does not require a Workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_time-series-query", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The project on which to execute the request. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3589,12 +4579,14 @@ fn main() { Some(false)), ]), ("uptime-check-configs-create", - Some(r##"Creates a new uptime check configuration."##), + Some(r##"Creates a new Uptime check configuration."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-create", vec![ (Some(r##"parent"##), None, - Some(r##"The project in which to create the uptime check. The format is projects/[PROJECT_ID]."##), + Some(r##"Required. The project in which to create the Uptime check. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3617,12 +4609,14 @@ fn main() { Some(false)), ]), ("uptime-check-configs-delete", - Some(r##"Deletes an uptime check configuration. Note that this method will fail if the uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion."##), + Some(r##"Deletes an Uptime check configuration. Note that this method will fail if the Uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-delete", vec![ (Some(r##"name"##), None, - Some(r##"The uptime check configuration to delete. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]."##), + Some(r##"Required. The Uptime check configuration to delete. The format is: + projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + "##), Some(true), Some(false)), @@ -3639,12 +4633,14 @@ fn main() { Some(false)), ]), ("uptime-check-configs-get", - Some(r##"Gets a single uptime check configuration."##), + Some(r##"Gets a single Uptime check configuration."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-get", vec![ (Some(r##"name"##), None, - Some(r##"The uptime check configuration to retrieve. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]."##), + Some(r##"Required. The Uptime check configuration to retrieve. The format is: + projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + "##), Some(true), Some(false)), @@ -3661,12 +4657,14 @@ fn main() { Some(false)), ]), ("uptime-check-configs-list", - Some(r##"Lists the existing valid uptime check configurations for the project, leaving out any invalid configurations."##), + Some(r##"Lists the existing valid Uptime check configurations for the project (leaving out any invalid configurations)."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-list", vec![ (Some(r##"parent"##), None, - Some(r##"The project whose uptime check configurations are listed. The format is projects/[PROJECT_ID]."##), + Some(r##"Required. The project whose Uptime check configurations are listed. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), Some(true), Some(false)), @@ -3683,12 +4681,283 @@ fn main() { Some(false)), ]), ("uptime-check-configs-patch", - Some(r##"Updates an uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via "updateMask". Returns the updated configuration."##), + Some(r##"Updates an Uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via updateMask. Returns the updated configuration."##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/projects_uptime-check-configs-patch", vec![ (Some(r##"name"##), None, - Some(r##"A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response."##), + Some(r##"A unique resource name for this Uptime check configuration. The format is: + projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("services", "methods: 'create', 'delete', 'get', 'list', 'patch', 'service-level-objectives-create', 'service-level-objectives-delete', 'service-level-objectives-get', 'service-level-objectives-list' and 'service-level-objectives-patch'", vec![ + ("create", + Some(r##"Create a Service."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name of the parent workspace. The format is: + projects/[PROJECT_ID_OR_NUMBER] + "##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Soft delete this Service."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the Service to delete. The format is: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + "##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get", + Some(r##"Get the named Service."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the Service. The format is: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + "##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"List Services for this workspace."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name of the parent containing the listed services, either a project or a Monitoring Workspace. The formats are: + projects/[PROJECT_ID_OR_NUMBER] + workspaces/[HOST_PROJECT_ID_OR_NUMBER] + "##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("patch", + Some(r##"Update this Service."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Resource name for this Service. The format is: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + "##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-level-objectives-create", + Some(r##"Create a ServiceLevelObjective for the given Service."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_service-level-objectives-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name of the parent Service. The format is: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + "##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-level-objectives-delete", + Some(r##"Delete the given ServiceLevelObjective."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_service-level-objectives-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the ServiceLevelObjective to delete. The format is: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + "##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-level-objectives-get", + Some(r##"Get a ServiceLevelObjective by name."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_service-level-objectives-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Resource name of the ServiceLevelObjective to get. The format is: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + "##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-level-objectives-list", + Some(r##"List the ServiceLevelObjectives for the given Service."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_service-level-objectives-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name of the parent containing the listed SLOs, either a project or a Monitoring Workspace. The formats are: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + "##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-level-objectives-patch", + Some(r##"Update the given ServiceLevelObjective."##), + "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/services_service-level-objectives-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Resource name for this ServiceLevelObjective. The format is: + projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + "##), Some(true), Some(false)), @@ -3714,7 +4983,7 @@ fn main() { ("uptime-check-ips", "methods: 'list'", vec![ ("list", - Some(r##"Returns the list of IPs that checkers run from"##), + Some(r##"Returns the list of IP addresses that checkers run from"##), "Details at http://byron.github.io/google-apis-rs/google_monitoring3_cli/uptime-check-ips_list", vec![ (Some(r##"v"##), @@ -3735,8 +5004,8 @@ fn main() { let mut app = App::new("monitoring3") .author("Sebastian Thiel ") - .version("1.0.12+20190629") - .about("Manages your Stackdriver Monitoring data and configurations. Most projects must be associated with a Stackdriver account, with a few exceptions as noted on the individual method pages. The table entries below are presented in alphabetical order, not in order of common use. For explanations of the concepts found in the table entries, read the Stackdriver Monitoring documentation.") + .version("1.0.13+20200329") + .about("Manages your Cloud Monitoring data and configurations. Most projects must be associated with a Workspace, with a few exceptions as noted on the individual method pages. The table entries below are presented in alphabetical order, not in order of common use. For explanations of the concepts found in the table entries, read the Cloud Monitoring documentation.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_monitoring3_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/monitoring3/Cargo.toml b/gen/monitoring3/Cargo.toml index 1978924d5b..f2dc4fc330 100644 --- a/gen/monitoring3/Cargo.toml +++ b/gen/monitoring3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-monitoring3" -version = "1.0.12+20190629" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Monitoring (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/monitoring3" homepage = "https://cloud.google.com/monitoring/api/" -documentation = "https://docs.rs/google-monitoring3/1.0.12+20190629" +documentation = "https://docs.rs/google-monitoring3/1.0.13+20200329" license = "MIT" keywords = ["monitoring", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/monitoring3/README.md b/gen/monitoring3/README.md index 5af3585479..5641725c5f 100644 --- a/gen/monitoring3/README.md +++ b/gen/monitoring3/README.md @@ -5,18 +5,20 @@ DO NOT EDIT ! --> The `google-monitoring3` library allows access to all features of the *Google Monitoring* service. -This documentation was generated from *Monitoring* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Monitoring* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Monitoring* *v3* API can be found at the [official documentation site](https://cloud.google.com/monitoring/api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.Monitoring.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.Monitoring.html) ... * projects - * [*alert policies create*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectAlertPolicyCreateCall.html), [*alert policies delete*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectAlertPolicyDeleteCall.html), [*alert policies get*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectAlertPolicyGetCall.html), [*alert policies list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectAlertPolicyListCall.html), [*alert policies patch*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectAlertPolicyPatchCall.html), [*collectd time series create*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectGroupCreateCall.html), [*groups delete*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectGroupDeleteCall.html), [*groups get*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectGroupGetCall.html), [*groups list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectGroupListCall.html), [*groups members list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectGroupMemberListCall.html), [*groups update*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectMonitoredResourceDescriptorListCall.html), [*notification channel descriptors get*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelDescriptorGetCall.html), [*notification channel descriptors list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelDescriptorListCall.html), [*notification channels create*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelCreateCall.html), [*notification channels delete*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelDeleteCall.html), [*notification channels get*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelGetCall.html), [*notification channels get verification code*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelGetVerificationCodeCall.html), [*notification channels list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelListCall.html), [*notification channels patch*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelPatchCall.html), [*notification channels send verification code*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelSendVerificationCodeCall.html), [*notification channels verify*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectNotificationChannelVerifyCall.html), [*time series create*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectTimeSeryCreateCall.html), [*time series list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectTimeSeryListCall.html), [*uptime check configs create*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectUptimeCheckConfigCreateCall.html), [*uptime check configs delete*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectUptimeCheckConfigDeleteCall.html), [*uptime check configs get*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectUptimeCheckConfigGetCall.html), [*uptime check configs list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectUptimeCheckConfigListCall.html) and [*uptime check configs patch*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.ProjectUptimeCheckConfigPatchCall.html) -* [uptime check ips](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.UptimeCheckIp.html) - * [*list*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.UptimeCheckIpListCall.html) + * [*alert policies create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectAlertPolicyCreateCall.html), [*alert policies delete*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectAlertPolicyDeleteCall.html), [*alert policies get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectAlertPolicyGetCall.html), [*alert policies list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectAlertPolicyListCall.html), [*alert policies patch*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectAlertPolicyPatchCall.html), [*collectd time series create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectGroupCreateCall.html), [*groups delete*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectGroupDeleteCall.html), [*groups get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectGroupGetCall.html), [*groups list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectGroupListCall.html), [*groups members list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectGroupMemberListCall.html), [*groups update*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectMonitoredResourceDescriptorListCall.html), [*notification channel descriptors get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelDescriptorGetCall.html), [*notification channel descriptors list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelDescriptorListCall.html), [*notification channels create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelCreateCall.html), [*notification channels delete*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelDeleteCall.html), [*notification channels get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelGetCall.html), [*notification channels get verification code*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelGetVerificationCodeCall.html), [*notification channels list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelListCall.html), [*notification channels patch*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelPatchCall.html), [*notification channels send verification code*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelSendVerificationCodeCall.html), [*notification channels verify*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectNotificationChannelVerifyCall.html), [*time series create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectTimeSeryCreateCall.html), [*time series list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectTimeSeryListCall.html), [*time series query*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectTimeSeryQueryCall.html), [*uptime check configs create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectUptimeCheckConfigCreateCall.html), [*uptime check configs delete*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectUptimeCheckConfigDeleteCall.html), [*uptime check configs get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectUptimeCheckConfigGetCall.html), [*uptime check configs list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectUptimeCheckConfigListCall.html) and [*uptime check configs patch*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ProjectUptimeCheckConfigPatchCall.html) +* [services](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.Service.html) + * [*create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceCreateCall.html), [*delete*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceDeleteCall.html), [*get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceGetCall.html), [*list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceListCall.html), [*patch*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServicePatchCall.html), [*service level objectives create*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceServiceLevelObjectiveCreateCall.html), [*service level objectives delete*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceServiceLevelObjectiveDeleteCall.html), [*service level objectives get*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceServiceLevelObjectiveGetCall.html), [*service level objectives list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceServiceLevelObjectiveListCall.html) and [*service level objectives patch*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.ServiceServiceLevelObjectivePatchCall.html) +* [uptime check ips](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.UptimeCheckIp.html) + * [*list*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.UptimeCheckIpListCall.html) @@ -25,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/struct.Monitoring.html)** +* **[Hub](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/struct.Monitoring.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.Part.html)** + * **[Parts](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -49,13 +51,16 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().metric_descriptors_delete(...).doit() -let r = hub.projects().alert_policies_delete(...).doit() -let r = hub.projects().uptime_check_configs_delete(...).doit() -let r = hub.projects().notification_channels_delete(...).doit() -let r = hub.projects().time_series_create(...).doit() -let r = hub.projects().notification_channels_send_verification_code(...).doit() -let r = hub.projects().groups_delete(...).doit() +let r = hub.services().service_level_objectives_patch(...).doit() +let r = hub.services().service_level_objectives_create(...).doit() +let r = hub.services().service_level_objectives_delete(...).doit() +let r = hub.services().service_level_objectives_get(...).doit() +let r = hub.services().service_level_objectives_list(...).doit() +let r = hub.services().create(...).doit() +let r = hub.services().list(...).doit() +let r = hub.services().get(...).doit() +let r = hub.services().delete(...).doit() +let r = hub.services().patch(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -109,8 +114,11 @@ let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsCon // 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().notification_channels_delete("name") - .force(true) +let result = hub.services().service_level_objectives_list("parent") + .view("sit") + .page_token("Stet") + .page_size(-42) + .filter("et") .doit(); match result { @@ -133,17 +141,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +161,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-monitoring3/1.0.12+20190629/google_monitoring3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-monitoring3/1.0.13+20200329/google_monitoring3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/monitoring3/src/lib.rs b/gen/monitoring3/src/lib.rs index 7194f78d98..5954c9cb4a 100644 --- a/gen/monitoring3/src/lib.rs +++ b/gen/monitoring3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Monitoring* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Monitoring* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Monitoring* *v3* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/api/). @@ -12,7 +12,9 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Monitoring.html) ... //! //! * projects -//! * [*alert policies create*](struct.ProjectAlertPolicyCreateCall.html), [*alert policies delete*](struct.ProjectAlertPolicyDeleteCall.html), [*alert policies get*](struct.ProjectAlertPolicyGetCall.html), [*alert policies list*](struct.ProjectAlertPolicyListCall.html), [*alert policies patch*](struct.ProjectAlertPolicyPatchCall.html), [*collectd time series create*](struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](struct.ProjectGroupCreateCall.html), [*groups delete*](struct.ProjectGroupDeleteCall.html), [*groups get*](struct.ProjectGroupGetCall.html), [*groups list*](struct.ProjectGroupListCall.html), [*groups members list*](struct.ProjectGroupMemberListCall.html), [*groups update*](struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](struct.ProjectMonitoredResourceDescriptorListCall.html), [*notification channel descriptors get*](struct.ProjectNotificationChannelDescriptorGetCall.html), [*notification channel descriptors list*](struct.ProjectNotificationChannelDescriptorListCall.html), [*notification channels create*](struct.ProjectNotificationChannelCreateCall.html), [*notification channels delete*](struct.ProjectNotificationChannelDeleteCall.html), [*notification channels get*](struct.ProjectNotificationChannelGetCall.html), [*notification channels get verification code*](struct.ProjectNotificationChannelGetVerificationCodeCall.html), [*notification channels list*](struct.ProjectNotificationChannelListCall.html), [*notification channels patch*](struct.ProjectNotificationChannelPatchCall.html), [*notification channels send verification code*](struct.ProjectNotificationChannelSendVerificationCodeCall.html), [*notification channels verify*](struct.ProjectNotificationChannelVerifyCall.html), [*time series create*](struct.ProjectTimeSeryCreateCall.html), [*time series list*](struct.ProjectTimeSeryListCall.html), [*uptime check configs create*](struct.ProjectUptimeCheckConfigCreateCall.html), [*uptime check configs delete*](struct.ProjectUptimeCheckConfigDeleteCall.html), [*uptime check configs get*](struct.ProjectUptimeCheckConfigGetCall.html), [*uptime check configs list*](struct.ProjectUptimeCheckConfigListCall.html) and [*uptime check configs patch*](struct.ProjectUptimeCheckConfigPatchCall.html) +//! * [*alert policies create*](struct.ProjectAlertPolicyCreateCall.html), [*alert policies delete*](struct.ProjectAlertPolicyDeleteCall.html), [*alert policies get*](struct.ProjectAlertPolicyGetCall.html), [*alert policies list*](struct.ProjectAlertPolicyListCall.html), [*alert policies patch*](struct.ProjectAlertPolicyPatchCall.html), [*collectd time series create*](struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](struct.ProjectGroupCreateCall.html), [*groups delete*](struct.ProjectGroupDeleteCall.html), [*groups get*](struct.ProjectGroupGetCall.html), [*groups list*](struct.ProjectGroupListCall.html), [*groups members list*](struct.ProjectGroupMemberListCall.html), [*groups update*](struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](struct.ProjectMonitoredResourceDescriptorListCall.html), [*notification channel descriptors get*](struct.ProjectNotificationChannelDescriptorGetCall.html), [*notification channel descriptors list*](struct.ProjectNotificationChannelDescriptorListCall.html), [*notification channels create*](struct.ProjectNotificationChannelCreateCall.html), [*notification channels delete*](struct.ProjectNotificationChannelDeleteCall.html), [*notification channels get*](struct.ProjectNotificationChannelGetCall.html), [*notification channels get verification code*](struct.ProjectNotificationChannelGetVerificationCodeCall.html), [*notification channels list*](struct.ProjectNotificationChannelListCall.html), [*notification channels patch*](struct.ProjectNotificationChannelPatchCall.html), [*notification channels send verification code*](struct.ProjectNotificationChannelSendVerificationCodeCall.html), [*notification channels verify*](struct.ProjectNotificationChannelVerifyCall.html), [*time series create*](struct.ProjectTimeSeryCreateCall.html), [*time series list*](struct.ProjectTimeSeryListCall.html), [*time series query*](struct.ProjectTimeSeryQueryCall.html), [*uptime check configs create*](struct.ProjectUptimeCheckConfigCreateCall.html), [*uptime check configs delete*](struct.ProjectUptimeCheckConfigDeleteCall.html), [*uptime check configs get*](struct.ProjectUptimeCheckConfigGetCall.html), [*uptime check configs list*](struct.ProjectUptimeCheckConfigListCall.html) and [*uptime check configs patch*](struct.ProjectUptimeCheckConfigPatchCall.html) +//! * [services](struct.Service.html) +//! * [*create*](struct.ServiceCreateCall.html), [*delete*](struct.ServiceDeleteCall.html), [*get*](struct.ServiceGetCall.html), [*list*](struct.ServiceListCall.html), [*patch*](struct.ServicePatchCall.html), [*service level objectives create*](struct.ServiceServiceLevelObjectiveCreateCall.html), [*service level objectives delete*](struct.ServiceServiceLevelObjectiveDeleteCall.html), [*service level objectives get*](struct.ServiceServiceLevelObjectiveGetCall.html), [*service level objectives list*](struct.ServiceServiceLevelObjectiveListCall.html) and [*service level objectives patch*](struct.ServiceServiceLevelObjectivePatchCall.html) //! * [uptime check ips](struct.UptimeCheckIp.html) //! * [*list*](struct.UptimeCheckIpListCall.html) //! @@ -49,13 +51,16 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().metric_descriptors_delete(...).doit() -//! let r = hub.projects().alert_policies_delete(...).doit() -//! let r = hub.projects().uptime_check_configs_delete(...).doit() -//! let r = hub.projects().notification_channels_delete(...).doit() -//! let r = hub.projects().time_series_create(...).doit() -//! let r = hub.projects().notification_channels_send_verification_code(...).doit() -//! let r = hub.projects().groups_delete(...).doit() +//! let r = hub.services().service_level_objectives_patch(...).doit() +//! let r = hub.services().service_level_objectives_create(...).doit() +//! let r = hub.services().service_level_objectives_delete(...).doit() +//! let r = hub.services().service_level_objectives_get(...).doit() +//! let r = hub.services().service_level_objectives_list(...).doit() +//! let r = hub.services().create(...).doit() +//! let r = hub.services().list(...).doit() +//! let r = hub.services().get(...).doit() +//! let r = hub.services().delete(...).doit() +//! let r = hub.services().patch(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -110,8 +115,11 @@ //! // 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().notification_channels_delete("name") -//! .force(true) +//! let result = hub.services().service_level_objectives_list("parent") +//! .view("kasd") +//! .page_token("accusam") +//! .page_size(-8) +//! .filter("justo") //! .doit(); //! //! match result { @@ -300,8 +308,11 @@ impl Default for Scope { /// // 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().notification_channels_delete("name") -/// .force(true) +/// let result = hub.services().service_level_objectives_list("parent") +/// .view("erat") +/// .page_token("labore") +/// .page_size(-9) +/// .filter("nonumy") /// .doit(); /// /// match result { @@ -339,7 +350,7 @@ impl<'a, C, A> Monitoring Monitoring { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://monitoring.googleapis.com/".to_string(), _root_url: "https://monitoring.googleapis.com/".to_string(), } @@ -348,12 +359,15 @@ impl<'a, C, A> Monitoring pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } + pub fn services(&'a self) -> ServiceMethods<'a, C, A> { + ServiceMethods { hub: &self } + } pub fn uptime_check_ips(&'a self) -> UptimeCheckIpMethods<'a, C, A> { UptimeCheckIpMethods { hub: &self } } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -392,7 +406,7 @@ impl<'a, C, A> Monitoring /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListMetricDescriptorsResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The metric descriptors that are available to the project and that match the value of filter, if present. @@ -414,7 +428,7 @@ impl ResponseResult for ListMetricDescriptorsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListGroupMembersResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The total number of elements matching this request. @@ -442,13 +456,17 @@ impl ResponseResult for ListGroupMembersResponse {} pub struct Group { /// The filter used to determine which monitored resources belong to this group. pub filter: Option, - /// The name of the group's parent, if it has one. The format is "projects/{project_id_or_number}/groups/{group_id}". For groups with no parent, parentName is the empty string, "". + /// The name of the group's parent, if it has one. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// For groups with no parent, parent_name is the empty string, "". #[serde(rename="parentName")] pub parent_name: Option, /// A user-assigned name for this group, used only for display purposes. #[serde(rename="displayName")] pub display_name: Option, - /// Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. + /// Output only. The name of this group. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically. pub name: Option, /// If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters. #[serde(rename="isCluster")] @@ -459,49 +477,121 @@ impl RequestValue for Group {} impl ResponseResult for Group {} -/// The protocol for the ListUptimeCheckConfigs response. +/// A condition type that allows alert policies to be defined using Monitoring Query Language. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TimeSeriesQueryLanguageCondition { + /// Monitoring Query Language query that generates time series data and describes a condition for alerting on that data. + pub query: Option, + /// A short explanation of what the query represents. For example:"Error ratio exceeds 15% for >5% of servers in >2 regions" + pub summary: Option, +} + +impl Part for TimeSeriesQueryLanguageCondition {} + + +/// A Service is a discrete, autonomous, and network-accessible unit, designed to solve an individual concern (Wikipedia (https://en.wikipedia.org/wiki/Service-orientation)). In Cloud Monitoring, a Service acts as the root resource under which operational aspects of the service are accessible. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [uptime check configs list projects](struct.ProjectUptimeCheckConfigListCall.html) (response) +/// * [service level objectives patch services](struct.ServiceServiceLevelObjectivePatchCall.html) (none) +/// * [service level objectives create services](struct.ServiceServiceLevelObjectiveCreateCall.html) (none) +/// * [service level objectives delete services](struct.ServiceServiceLevelObjectiveDeleteCall.html) (none) +/// * [service level objectives get services](struct.ServiceServiceLevelObjectiveGetCall.html) (none) +/// * [service level objectives list services](struct.ServiceServiceLevelObjectiveListCall.html) (none) +/// * [create services](struct.ServiceCreateCall.html) (request|response) +/// * [list services](struct.ServiceListCall.html) (none) +/// * [get services](struct.ServiceGetCall.html) (response) +/// * [delete services](struct.ServiceDeleteCall.html) (none) +/// * [patch services](struct.ServicePatchCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListUptimeCheckConfigsResponse { - /// This field represents the pagination token to retrieve the next page of results. If the value is empty, it means no further results for the request. To retrieve the next page of results, the value of the next_page_token is passed to the subsequent List method call (in the request message's page_token field). - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The total number of uptime check configurations for the project, irrespective of any pagination. - #[serde(rename="totalSize")] - pub total_size: Option, - /// The returned uptime check configurations. - #[serde(rename="uptimeCheckConfigs")] - pub uptime_check_configs: Option>, +pub struct Service { + /// Name used for UI elements listing this Service. + #[serde(rename="displayName")] + pub display_name: Option, + /// Type used for Cloud Endpoints services. + #[serde(rename="cloudEndpoints")] + pub cloud_endpoints: Option, + /// Type used for Istio services scoped to an Istio mesh. + #[serde(rename="meshIstio")] + pub mesh_istio: Option, + /// Configuration for how to query telemetry on a Service. + pub telemetry: Option, + /// Type used for Istio services that live in a Kubernetes cluster. + #[serde(rename="clusterIstio")] + pub cluster_istio: Option, + /// Custom service type. + pub custom: Option, + /// Type used for App Engine services. + #[serde(rename="appEngine")] + pub app_engine: Option, + /// Resource name for this Service. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + pub name: Option, } -impl ResponseResult for ListUptimeCheckConfigsResponse {} +impl RequestValue for Service {} +impl Resource for Service {} +impl ResponseResult for Service {} -/// BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite. +/// A point's value columns and time interval. Each point has one or more point values corresponding to the entries in point_descriptors field in the TimeSeriesDescriptor associated with this object. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketOptions { - /// The exponential buckets. - #[serde(rename="exponentialBuckets")] - pub exponential_buckets: Option, - /// The linear bucket. - #[serde(rename="linearBuckets")] - pub linear_buckets: Option, - /// The explicit buckets. - #[serde(rename="explicitBuckets")] - pub explicit_buckets: Option, +pub struct PointData { + /// The time interval associated with the point. + #[serde(rename="timeInterval")] + pub time_interval: Option, + /// The values that make up the point. + pub values: Option>, } -impl Part for BucketOptions {} +impl Part for PointData {} + + +/// Parameters for a latency threshold SLI. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LatencyCriteria { + /// Good service is defined to be the count of requests made to this service that return in no more than threshold. + pub threshold: Option, +} + +impl Part for LatencyCriteria {} + + +/// Describes how to combine multiple time series to provide a different view of the data. Aggregation of time series is done in two steps. First, each time series in the set is aligned to the same time interval boundaries, then the set of time series is optionally reduced in number.Alignment consists of applying the per_series_aligner operation to each time series after its data has been divided into regular alignment_period time intervals. This process takes all of the data points in an alignment period, applies a mathematical transformation such as averaging, minimum, maximum, delta, etc., and converts them into a single data point per period.Reduction is when the aligned and transformed time series can optionally be combined, reducing the number of time series through similar mathematical transformations. Reduction involves applying a cross_series_reducer to all the time series, optionally sorting the time series into subsets with group_by_fields, and applying the reducer to each subset.The raw time series data can contain a huge amount of information from multiple sources. Alignment and reduction transforms this mass of data into a more manageable and representative collection of data, for example "the 95% latency across the average of all tasks in a cluster". This representative data can be more easily graphed and comprehended, and the individual time series data is still available for later drilldown. For more details, see Filtering and aggregation (https://cloud.google.com/monitoring/api/v3/aggregation). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Aggregation { + /// The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored. + #[serde(rename="groupByFields")] + pub group_by_fields: Option>, + /// The alignment_period specifies a time interval, in seconds, that is used to divide the data in all the time series into consistent blocks of time. This will be done before the per-series aligner can be applied to the data.The value must be at least 60 seconds. If a per-series aligner other than ALIGN_NONE is specified, this field is required or an error is returned. If no per-series aligner is specified, or the aligner ALIGN_NONE is specified, then this field is ignored. + #[serde(rename="alignmentPeriod")] + pub alignment_period: Option, + /// An Aligner describes how to bring the data points in a single time series into temporal alignment. Except for ALIGN_NONE, all alignments cause all the data points in an alignment_period to be mathematically grouped together, resulting in a single data point for each alignment_period with end timestamp at the end of the period.Not all alignment operations may be applied to all time series. The valid choices depend on the metric_kind and value_type of the original time series. Alignment can change the metric_kind or the value_type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified and not equal to ALIGN_NONE and alignment_period must be specified; otherwise, an error is returned. + #[serde(rename="perSeriesAligner")] + pub per_series_aligner: Option, + /// The reduction operation to be used to combine time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series.Not all reducer operations can be applied to all time series. The valid choices depend on the metric_kind and the value_type of the original time series. Reduction can yield a time series with a different metric_kind or value_type than the input time series.Time series data must first be aligned (see per_series_aligner) in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified, and must not be ALIGN_NONE. An alignment_period must also be specified; otherwise, an error is returned. + #[serde(rename="crossSeriesReducer")] + pub cross_series_reducer: Option, +} + +impl Part for Aggregation {} /// An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "instance_id" and "zone": @@ -569,34 +659,39 @@ impl Part for CollectdValue {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UptimeCheckConfig { - /// The monitored resource (https://cloud.google.com/monitoring/api/resources) associated with the configuration. The following monitored resource types are supported for uptime checks: uptime_url gce_instance gae_app aws_ec2_instance aws_elb_load_balancer + /// The monitored resource (https://cloud.google.com/monitoring/api/resources) associated with the configuration. The following monitored resource types are supported for Uptime checks: uptime_url, gce_instance, gae_app, aws_ec2_instance, aws_elb_load_balancer #[serde(rename="monitoredResource")] pub monitored_resource: Option, - /// A human-friendly name for the uptime check configuration. The display name should be unique within a Stackdriver Workspace in order to make it easier to identify; however, uniqueness is not enforced. Required. + /// A human-friendly name for the Uptime check configuration. The display name should be unique within a Stackdriver Workspace in order to make it easier to identify; however, uniqueness is not enforced. Required. #[serde(rename="displayName")] pub display_name: Option, - /// A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response. + /// A unique resource name for this Uptime check configuration. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + /// This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response. pub name: Option, + /// If this is true, then checks are made only from the 'internal_checkers'. If it is false, then checks are made only from the 'selected_regions'. It is an error to provide 'selected_regions' when is_internal is true, or to provide 'internal_checkers' when is_internal is false. + #[serde(rename="isInternal")] + pub is_internal: Option, /// Contains information needed to make a TCP check. #[serde(rename="tcpCheck")] pub tcp_check: Option, - /// The list of regions from which the check will be run. Some regions contain one location, and others contain more than one. If this field is specified, enough regions to include a minimum of 3 locations must be provided, or an error message is returned. Not specifying this field will result in uptime checks running from all regions. + /// How often, in seconds, the Uptime check is performed. Currently, the only supported values are 60s (1 minute), 300s (5 minutes), 600s (10 minutes), and 900s (15 minutes). Optional, defaults to 60s. + pub period: Option, + /// The list of regions from which the check will be run. Some regions contain one location, and others contain more than one. If this field is specified, enough regions must be provided to include a minimum of 3 locations. Not specifying this field will result in Uptime checks running from all available regions. #[serde(rename="selectedRegions")] pub selected_regions: Option>, - /// How often, in seconds, the uptime check is performed. Currently, the only supported values are 60s (1 minute), 300s (5 minutes), 600s (10 minutes), and 900s (15 minutes). Optional, defaults to 60s. - pub period: Option, /// The group resource associated with the configuration. #[serde(rename="resourceGroup")] pub resource_group: Option, /// Contains information needed to make an HTTP or HTTPS check. #[serde(rename="httpCheck")] pub http_check: Option, - /// The internal checkers that this check will egress from. If is_internal is true and this list is empty, the check will egress from all the InternalCheckers configured for the project that owns this CheckConfig. + /// The internal checkers that this check will egress from. If is_internal is true and this list is empty, the check will egress from all the InternalCheckers configured for the project that owns this UptimeCheckConfig. #[serde(rename="internalCheckers")] pub internal_checkers: Option>, /// The maximum amount of time to wait for the request to complete (must be between 1 and 60 seconds). Required. pub timeout: Option, - /// The expected content on the page the check is run against. Currently, only the first entry in the list is supported, and other entries will be ignored. The server will look for an exact match of the string in the page response's content. This field is optional and should only be specified if a content match is required. + /// The content that is expected to appear in the data returned by the target server against which the check is run. Currently, only the first entry in the content_matchers list is supported, and additional entries will be ignored. This field is optional and should only be specified if a content match is required as part of the/ Uptime check. #[serde(rename="contentMatchers")] pub content_matchers: Option>, } @@ -614,7 +709,7 @@ pub struct MetricDescriptorMetadata { /// The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors. #[serde(rename="ingestDelay")] pub ingest_delay: Option, - /// Deprecated. Please use the MetricDescriptor.launch_stage instead. The launch stage of the metric definition. + /// Deprecated. Must use the MetricDescriptor.launch_stage instead. #[serde(rename="launchStage")] pub launch_stage: Option, /// The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period. @@ -625,36 +720,6 @@ pub struct MetricDescriptorMetadata { impl Part for MetricDescriptorMetadata {} -/// Distribution contains summary statistics for a population of values. It optionally contains a histogram representing the distribution of those values across a set of buckets.The summary statistics are the count, mean, sum of the squared deviation from the mean, the minimum, and the maximum of the set of population of values. The histogram is based on a sequence of buckets and gives a count of values that fall into each bucket. The boundaries of the buckets are given either explicitly or by formulas for buckets of fixed or exponentially increasing widths.Although it is not forbidden, it is generally a bad idea to include non-finite values (infinities or NaNs) in the population of values, as this will render the mean and sum_of_squared_deviation fields meaningless. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Distribution { - /// The number of values in the population. Must be non-negative. This value must equal the sum of the values in bucket_counts if a histogram is provided. - pub count: Option, - /// Required in the Stackdriver Monitoring API v3. The values for each bucket specified in bucket_options. The sum of the values in bucketCounts must equal the value in the count field of the Distribution object. The order of the bucket counts follows the numbering schemes described for the three bucket types. The underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; and the overflow bucket has number N-1. The size of bucket_counts must not be greater than N. If the size is less than N, then the remaining buckets are assigned values of zero. - #[serde(rename="bucketCounts")] - pub bucket_counts: Option>, - /// The sum of squared deviations from the mean of the values in the population. For values x_i this is: - /// Sum[i=1..n]((x_i - mean)^2) - /// Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition describes Welford's method for accumulating this sum in one pass.If count is zero then this field must be zero. - #[serde(rename="sumOfSquaredDeviation")] - pub sum_of_squared_deviation: Option, - /// If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Stackdriver Monitoring API v3. - pub range: Option, - /// Required in the Stackdriver Monitoring API v3. Defines the histogram bucket boundaries. - #[serde(rename="bucketOptions")] - pub bucket_options: Option, - /// Must be in increasing order of value field. - pub exemplars: Option>, - /// The arithmetic mean of the values in the population. If count is zero then this field must be zero. - pub mean: Option, -} - -impl Part for Distribution {} - - /// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: /// service Foo { /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); @@ -669,8 +734,10 @@ impl Part for Distribution {} /// * [metric descriptors delete projects](struct.ProjectMetricDescriptorDeleteCall.html) (response) /// * [alert policies delete projects](struct.ProjectAlertPolicyDeleteCall.html) (response) /// * [uptime check configs delete projects](struct.ProjectUptimeCheckConfigDeleteCall.html) (response) -/// * [notification channels delete projects](struct.ProjectNotificationChannelDeleteCall.html) (response) +/// * [service level objectives delete services](struct.ServiceServiceLevelObjectiveDeleteCall.html) (response) /// * [time series create projects](struct.ProjectTimeSeryCreateCall.html) (response) +/// * [delete services](struct.ServiceDeleteCall.html) (response) +/// * [notification channels delete projects](struct.ProjectNotificationChannelDeleteCall.html) (response) /// * [notification channels send verification code projects](struct.ProjectNotificationChannelSendVerificationCodeCall.html) (response) /// * [groups delete projects](struct.ProjectGroupDeleteCall.html) (response) /// @@ -712,22 +779,66 @@ pub struct Status { impl Part for Status {} -/// Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 1)). +/// Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Linear { - /// Must be greater than 0. - pub width: Option, - /// Must be greater than 0. - #[serde(rename="numFiniteBuckets")] - pub num_finite_buckets: Option, - /// Lower bound of the first bucket. - pub offset: Option, +pub struct CloudEndpoints { + /// The name of the Cloud Endpoints service underlying this service. Corresponds to the service resource label in the api monitored resource: https://cloud.google.com/monitoring/api/resources#tag_api + pub service: Option, } -impl Part for Linear {} +impl Part for CloudEndpoints {} + + +/// An internal checker allows Uptime checks to run on private/internal GCP resources. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InternalChecker { + /// The current operational state of the internal checker. + pub state: Option, + /// The checker's human-readable name. The display name should be unique within a Stackdriver Workspace in order to make it easier to identify; however, uniqueness is not enforced. + #[serde(rename="displayName")] + pub display_name: Option, + /// The GCP VPC network (https://cloud.google.com/vpc/docs/vpc) where the internal resource lives (ex: "default"). + pub network: Option, + /// A unique resource name for this InternalChecker. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] + /// [PROJECT_ID_OR_NUMBER] is the Stackdriver Workspace project for the Uptime check config associated with the internal checker. + pub name: Option, + /// The GCP project ID where the internal checker lives. Not necessary the same as the Workspace project. + #[serde(rename="peerProjectId")] + pub peer_project_id: Option, + /// The GCP zone the Uptime check should egress from. Only respected for internal Uptime checks, where internal_network is specified. + #[serde(rename="gcpZone")] + pub gcp_zone: Option, +} + +impl Part for InternalChecker {} + + +/// An SLI measuring performance on a well-known service type. Performance will be computed on the basis of pre-defined metrics. The type of the service_resource determines the metrics to use and the service_resource.labels and metric_labels are used to construct a monitoring filter to filter that metric down to just the data relevant to this service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BasicSli { + /// Good service is defined to be the count of requests made to this service that are fast enough with respect to latency.threshold. + pub latency: Option, + /// OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from other methods will not be used to calculate performance for this SLI. If omitted, this SLI applies to all the Service's methods. For service types that don't support breaking down by method, setting this field will result in an error. + pub method: Option>, + /// OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry from other API versions will not be used to calculate performance for this SLI. If omitted, this SLI applies to all API versions. For service types that don't support breaking down by version, setting this field will result in an error. + pub version: Option>, + /// Good service is defined to be the count of requests made to this service that return successfully. + pub availability: Option, + /// OPTIONAL: The set of locations to which this SLI is relevant. Telemetry from other locations will not be used to calculate performance for this SLI. If omitted, this SLI applies to all locations in which the Service has activity. For service types that don't support breaking down by location, setting this field will result in an error. + pub location: Option>, +} + +impl Part for BasicSli {} /// A condition type that checks that monitored resources are reporting data. The configuration defines a metric and a set of monitored resources. The predicate is considered in violation when a time series for the specified metric of a monitored resource does not include any data in the specified duration. @@ -738,38 +849,69 @@ impl Part for Linear {} pub struct MetricAbsence { /// The amount of time that a time series must fail to report new data to be considered failing. Currently, only values that are a multiple of a minute--e.g. 60, 120, or 300 seconds--are supported. If an invalid value is given, an error will be returned. The Duration.nanos field is ignored. pub duration: Option, - /// A filter that identifies which time series should be compared with the threshold.The filter is similar to the one that is specified in the MetricService.ListTimeSeries request (that call is useful to verify the time series that will be retrieved / processed) and must specify the metric type and optionally may contain restrictions on resource type, resource labels, and metric labels. This field may not exceed 2048 Unicode characters in length. + /// A filter (https://cloud.google.com/monitoring/api/v3/filters) that identifies which time series should be compared with the threshold.The filter is similar to the one that is specified in the ListTimeSeries request (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that call is useful to verify the time series that will be retrieved / processed) and must specify the metric type and optionally may contain restrictions on resource type, resource labels, and metric labels. This field may not exceed 2048 Unicode characters in length. pub filter: Option, /// The number/percent of time series for which the comparison must hold in order for the condition to trigger. If unspecified, then the condition will trigger if the comparison is true for any of the time series that have been identified by filter and aggregations. pub trigger: Option, - /// Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resrouces). Multiple aggregations are applied in the order specified.This field is similar to the one in the MetricService.ListTimeSeries request. It is advisable to use the ListTimeSeries method when debugging this field. + /// Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resrouces). Multiple aggregations are applied in the order specified.This field is similar to the one in the ListTimeSeries request (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It is advisable to use the ListTimeSeries method when debugging this field. pub aggregations: Option>, } impl Part for MetricAbsence {} -/// Describes how to combine multiple time series to provide different views of the data. Aggregation consists of an alignment step on individual time series (alignment_period and per_series_aligner) followed by an optional reduction step of the data across the aligned time series (cross_series_reducer and group_by_fields). For more details, see Aggregation. +/// BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Aggregation { - /// The set of fields to preserve when crossSeriesReducer is specified. The groupByFields determine how the time series are partitioned into subsets prior to applying the aggregation function. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The crossSeriesReducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in groupByFields are aggregated away. If groupByFields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If crossSeriesReducer is not defined, this field is ignored. - #[serde(rename="groupByFields")] - pub group_by_fields: Option>, - /// The alignment period for per-time series alignment. If present, alignmentPeriod must be at least 60 seconds. After per-time series alignment, each time series will contain data points only on the period boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, then this field is ignored. If perSeriesAligner is specified and does not equal ALIGN_NONE, then this field must be defined; otherwise an error is returned. - #[serde(rename="alignmentPeriod")] - pub alignment_period: Option, - /// The approach to be used to align individual time series. Not all alignment functions may be applied to all time series, depending on the metric type and value type of the original time series. Alignment may change the metric type or the value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned. - #[serde(rename="perSeriesAligner")] - pub per_series_aligner: Option, - /// The approach to be used to combine time series. Not all reducer functions may be applied to all time series, depending on the metric type and the value type of the original time series. Reduction may change the metric type of value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned. - #[serde(rename="crossSeriesReducer")] - pub cross_series_reducer: Option, +pub struct BucketOptions { + /// The exponential buckets. + #[serde(rename="exponentialBuckets")] + pub exponential_buckets: Option, + /// The linear bucket. + #[serde(rename="linearBuckets")] + pub linear_buckets: Option, + /// The explicit buckets. + #[serde(rename="explicitBuckets")] + pub explicit_buckets: Option, } -impl Part for Aggregation {} +impl Part for BucketOptions {} + + +/// A PerformanceThreshold is used when each window is good when that window has a sufficiently high performance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PerformanceThreshold { + /// If window performance >= threshold, the window is counted as good. + pub threshold: Option, + /// BasicSli to evaluate to judge window quality. + #[serde(rename="basicSliPerformance")] + pub basic_sli_performance: Option, + /// RequestBasedSli to evaluate to judge window quality. + pub performance: Option, +} + +impl Part for PerformanceThreshold {} + + +/// A MetricRange is used when each window is good when the value x of a single TimeSeries satisfies range.min <= x < range.max. The provided TimeSeries must have ValueType = INT64 or ValueType = DOUBLE and MetricKind = GAUGE. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MetricRange { + /// Range of values considered "good." For a one-sided range, set one bound to an infinite value. + pub range: Option, + /// A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying the TimeSeries to use for evaluating window quality. + #[serde(rename="timeSeries")] + pub time_series: Option, +} + +impl Part for MetricRange {} /// A NotificationChannel is a medium through which an alert is delivered when a policy violation is detected. Examples of channels include email, SMS, and third-party messaging applications. Fields containing sensitive information like authentication tokens or contact info are only partially populated on retrieval. @@ -804,8 +946,8 @@ pub struct NotificationChannel { /// Indicates whether this channel has been verified or not. On a ListNotificationChannels or GetNotificationChannel operation, this field is expected to be populated.If the value is UNVERIFIED, then it indicates that the channel is non-functioning (it both requires verification and lacks verification); otherwise, it is assumed that the channel works.If the channel is neither VERIFIED nor UNVERIFIED, it implies that the channel is of a type that does not require verification or that this specific channel has been exempted from verification because it was created prior to verification being required for channels of this type.This field cannot be modified using a standard UpdateNotificationChannel operation. To change the value of this field, you must call VerifyNotificationChannel. #[serde(rename="verificationStatus")] pub verification_status: Option, - /// The full REST resource name for this channel. The syntax is: - /// projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] + /// The full REST resource name for this channel. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] /// The [CHANNEL_ID] is automatically assigned by the server on creation. pub name: Option, } @@ -814,7 +956,7 @@ impl RequestValue for NotificationChannel {} impl ResponseResult for NotificationChannel {} -/// A description of the conditions under which some aspect of your system is considered to be "unhealthy" and the ways to notify people or services about this state. For an overview of alert policies, see Introduction to Alerting. +/// A description of the conditions under which some aspect of your system is considered to be "unhealthy" and the ways to notify people or services about this state. For an overview of alert policies, see Introduction to Alerting (https://cloud.google.com/monitoring/alerts/). /// /// # Activities /// @@ -827,13 +969,13 @@ impl ResponseResult for NotificationChannel {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AlertPolicy { - /// How to combine the results of multiple conditions to determine if an incident should be opened. + /// How to combine the results of multiple conditions to determine if an incident should be opened. If condition_time_series_query_language is present, this must be COMBINE_UNSPECIFIED. pub combiner: Option, /// A short name or phrase used to identify the policy in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple policies in the same project. The name is limited to 512 Unicode characters. #[serde(rename="displayName")] pub display_name: Option, - /// Required if the policy exists. The resource name for this policy. The syntax is: - /// projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + /// Required if the policy exists. The resource name for this policy. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] /// [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. pub name: Option, /// A read-only record of the creation of the alerting policy. If provided in a call to create or update, this field will be ignored. @@ -843,18 +985,20 @@ pub struct AlertPolicy { pub documentation: Option, /// Whether or not the policy is enabled. On write, the default interpretation if unset is that the policy is enabled. On read, clients should not make any assumption about the state if it has not been populated. The field should always be populated on List and Get operations, unless a field projection has been specified that strips it out. pub enabled: Option, + /// Read-only description of how the alert policy is invalid. OK if the alert policy is valid. If not OK, the alert policy will not generate incidents. + pub validity: Option, /// A read-only record of the most recent change to the alerting policy. If provided in a call to create or update, this field will be ignored. #[serde(rename="mutationRecord")] pub mutation_record: Option, /// User-supplied key/value data to be used for organizing and identifying the AlertPolicy objects.The field can contain up to 64 entries. Each key and value is limited to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values can contain only lowercase letters, numerals, underscores, and dashes. Keys must begin with a letter. #[serde(rename="userLabels")] pub user_labels: Option>, - /// Identifies the notification channels to which notifications should be sent when incidents are opened or closed or when new violations occur on an already opened incident. Each element of this array corresponds to the name field in each of the NotificationChannel objects that are returned from the ListNotificationChannels method. The syntax of the entries in this field is: - /// projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] + /// Identifies the notification channels to which notifications should be sent when incidents are opened or closed or when new violations occur on an already opened incident. Each element of this array corresponds to the name field in each of the NotificationChannel objects that are returned from the ListNotificationChannels method. The format of the entries in this field is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] /// #[serde(rename="notificationChannels")] pub notification_channels: Option>, - /// A list of conditions for the policy. The conditions are combined by AND or OR according to the combiner field. If the combined conditions evaluate to true, then an incident is created. A policy can have from one to six conditions. + /// A list of conditions for the policy. The conditions are combined by AND or OR according to the combiner field. If the combined conditions evaluate to true, then an incident is created. A policy can have from one to six conditions. If condition_time_series_query_language is present, it must be the only condition. pub conditions: Option>, } @@ -871,11 +1015,14 @@ pub struct Condition { /// A condition that compares a time series against a threshold. #[serde(rename="conditionThreshold")] pub condition_threshold: Option, + /// A condition that uses the Monitoring Query Language to define alerts. If set, no other conditions can be present. + #[serde(rename="conditionTimeSeriesQueryLanguage")] + pub condition_time_series_query_language: Option, /// A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy. #[serde(rename="displayName")] pub display_name: Option, - /// Required if the condition exists. The unique resource name for this condition. Its syntax is: - /// projects/[PROJECT_ID]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] + /// Required if the condition exists. The unique resource name for this condition. Its format is: + /// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] /// [CONDITION_ID] is assigned by Stackdriver Monitoring when the condition is created as part of a new or updated alerting policy.When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Stackdriver Monitoring creates the condition identifiers and includes them in the new policy.When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted. pub name: Option, /// A condition that checks that a time series continues to receive new data points. @@ -887,8 +1034,8 @@ impl Part for Condition {} /// A closed time interval. It extends from the start time to the end time, and includes both: [startTime, endTime]. Valid time intervals depend on the MetricKind of the metric value. In no case can the end time be earlier than the start time. -/// For a GAUGE metric, the startTime value is technically optional; if no value is specified, the start time defaults to the value of the end time, and the interval represents a single point in time. Such an interval is valid only for GAUGE metrics, which are point-in-time measurements. -/// For DELTA and CUMULATIVE metrics, the start time must be later than the end time. +/// For a GAUGE metric, the startTime value is technically optional; if no value is specified, the start time defaults to the value of the end time, and the interval represents a single point in time. If both start and end times are specified, they must be identical. Such an interval is valid only for GAUGE metrics, which are point-in-time measurements. +/// For DELTA and CUMULATIVE metrics, the start time must be earlier than the end time. /// In all cases, the start time of the next interval must be at least a microsecond after the end time of the previous interval. Because the interval is closed, if the start time of a new interval is the same as the end time of the previous interval, data written at the new start time could overwrite data written at the previous end time. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -906,14 +1053,16 @@ pub struct TimeInterval { impl Part for TimeInterval {} -/// Used to perform string matching. It allows substring and regular expressions, together with their negations. +/// Optional. Used to perform content matching. This allows matching based on substrings and regular expressions, together with their negations. Only the first 4 MB of an HTTP or HTTPS check's response (and the first 1 MB of a TCP check's response) are examined for purposes of content matching. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContentMatcher { - /// String or regex content to match (max 1024 bytes) + /// String or regex content to match. Maximum 1024 bytes. An empty content string indicates no content matching is to be performed. pub content: Option, + /// The type of content matcher that will be applied to the server output, compared to the content string when the check is run. + pub matcher: Option, } impl Part for ContentMatcher {} @@ -970,6 +1119,27 @@ pub struct CollectdPayload { impl Part for CollectdPayload {} +/// The ListServices response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list services](struct.ServiceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListServicesResponse { + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The Services matching the specified filter. + pub services: Option>, +} + +impl ResponseResult for ListServicesResponse {} + + /// Contains the region, location, and list of IP addresses where checkers in the location run from. /// /// # Activities @@ -983,7 +1153,7 @@ impl Part for CollectdPayload {} pub struct UptimeCheckIp { /// A broad region category in which the IP address is located. pub region: Option, - /// The IP address from which the uptime check originates. This is a full IP address (not an IP address range). Most IP addresses, as of this publication, are in IPv4 format; however, one should not rely on the IP addresses being in IPv4 format indefinitely and should support interpreting this field in either IPv4 or IPv6 format. + /// The IP address from which the Uptime check originates. This is a fully specified IP address (not an IP address range). Most IP addresses, as of this publication, are in IPv4 format; however, one should not rely on the IP addresses being in IPv4 format indefinitely, and should support interpreting this field in either IPv4 or IPv6 format. #[serde(rename="ipAddress")] pub ip_address: Option, /// A more specific location within the region that typically encodes a particular city/town/metro (and its containing state/province or country) within the broader umbrella region category. @@ -993,13 +1163,13 @@ pub struct UptimeCheckIp { impl Resource for UptimeCheckIp {} -/// Information required for a TCP uptime check request. +/// Information required for a TCP Uptime check request. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TcpCheck { - /// The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) to construct the full URL. Required. + /// The TCP port on the server against which to run the check. Will be combined with host (specified within the monitored_resource) to construct the full URL. Required. pub port: Option, } @@ -1019,6 +1189,43 @@ pub struct Explicit { impl Part for Explicit {} +/// A Service-Level Objective (SLO) describes a level of desired good service. It consists of a service-level indicator (SLI), a performance goal, and a period over which the objective is to be evaluated against that goal. The SLO can use SLIs defined in a number of different manners. Typical SLOs might include "99% of requests in each rolling week have latency below 200 milliseconds" or "99.5% of requests in each calendar month return successfully." +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [service level objectives patch services](struct.ServiceServiceLevelObjectivePatchCall.html) (request|response) +/// * [service level objectives get services](struct.ServiceServiceLevelObjectiveGetCall.html) (response) +/// * [service level objectives create services](struct.ServiceServiceLevelObjectiveCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceLevelObjective { + /// Name used for UI elements listing this SLO. + #[serde(rename="displayName")] + pub display_name: Option, + /// The fraction of service that must be good in order for this objective to be met. 0 < goal <= 0.999. + pub goal: Option, + /// A rolling time period, semantically "in the past ". Must be an integer multiple of 1 day no larger than 30 days. + #[serde(rename="rollingPeriod")] + pub rolling_period: Option, + /// A calendar period, semantically "since the start of the current ". At this time, only DAY, WEEK, FORTNIGHT, and MONTH are supported. + #[serde(rename="calendarPeriod")] + pub calendar_period: Option, + /// The definition of good service, used to measure and calculate the quality of the Service's performance with respect to a single aspect of service quality. + #[serde(rename="serviceLevelIndicator")] + pub service_level_indicator: Option, + /// Resource name for this ServiceLevelObjective. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + /// + pub name: Option, +} + +impl RequestValue for ServiceLevelObjective {} +impl ResponseResult for ServiceLevelObjective {} + + /// The resource submessage for group checks. It can be used instead of a monitored resource, when multiple resources are being monitored. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1028,7 +1235,7 @@ pub struct ResourceGroup { /// The resource type of the group members. #[serde(rename="resourceType")] pub resource_type: Option, - /// The group of resources being monitored. Should be only the group_id, not projects//groups/. + /// The group of resources being monitored. Should be only the [GROUP_ID], and not the full-path projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]. #[serde(rename="groupId")] pub group_id: Option, } @@ -1047,14 +1254,107 @@ impl Part for ResourceGroup {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateCollectdTimeSeriesResponse { - /// Records the error status for points that were not written due to an error.Failed requests for which nothing is written will return an error response instead. + /// Records the error status for points that were not written due to an error in the request.Failed requests for which nothing is written will return an error response instead. Requests where data points were rejected by the backend will set summary instead. #[serde(rename="payloadErrors")] pub payload_errors: Option>, + /// Aggregate statistics from writing the payloads. This field is omitted if all points were successfully written, so that the response is empty. This is for backwards compatibility with clients that log errors on any non-empty response. + pub summary: Option, } impl ResponseResult for CreateCollectdTimeSeriesResponse {} +/// A WindowsBasedSli defines good_service as the count of time windows for which the provided service was of good quality. Criteria for determining if service was good are embedded in the window_criterion. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WindowsBasedSli { + /// A window is good if the metric's value is in a good range, averaged across returned streams. + #[serde(rename="metricMeanInRange")] + pub metric_mean_in_range: Option, + /// A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries with ValueType = BOOL. The window is good if any true values appear in the window. + #[serde(rename="goodBadMetricFilter")] + pub good_bad_metric_filter: Option, + /// A window is good if its performance is high enough. + #[serde(rename="goodTotalRatioThreshold")] + pub good_total_ratio_threshold: Option, + /// A window is good if the metric's value is in a good range, summed across returned streams. + #[serde(rename="metricSumInRange")] + pub metric_sum_in_range: Option, + /// Duration over which window quality is evaluated. Must be an integer fraction of a day and at least 60s. + #[serde(rename="windowPeriod")] + pub window_period: Option, +} + +impl Part for WindowsBasedSli {} + + +/// The ListServiceLevelObjectives response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [service level objectives list services](struct.ServiceServiceLevelObjectiveListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListServiceLevelObjectivesResponse { + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The ServiceLevelObjectives matching the specified filter. + #[serde(rename="serviceLevelObjectives")] + pub service_level_objectives: Option>, +} + +impl ResponseResult for ListServiceLevelObjectivesResponse {} + + +/// Detailed information about an error category. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ErrorType { + /// The status of the requested write operation. + pub status: Option, + /// The number of points that couldn't be written because of status. + #[serde(rename="pointCount")] + pub point_count: Option, +} + +impl Part for ErrorType {} + + +/// Custom view of service telemetry. Currently a place-holder pending final design. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Custom { _never_set: Option } + +impl Part for Custom {} + + +/// Represents the values of a time series associated with a TimeSeriesDescriptor. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TimeSeriesData { + /// The points in the time series. + #[serde(rename="pointData")] + pub point_data: Option>, + /// The values of the labels in the time series identifier, given in the same order as the label_descriptors field of the TimeSeriesDescriptor associated with this object. Each value must have a value of the type given in the corresponding entry of label_descriptors. + #[serde(rename="labelValues")] + pub label_values: Option>, +} + +impl Part for TimeSeriesData {} + + /// The ListTimeSeries response. /// /// # Activities @@ -1066,7 +1366,7 @@ impl ResponseResult for CreateCollectdTimeSeriesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListTimeSeriesResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Query execution errors that may have caused the time series data returned to be incomplete. @@ -1080,6 +1380,16 @@ pub struct ListTimeSeriesResponse { impl ResponseResult for ListTimeSeriesResponse {} +/// Future parameters for the availability SLI. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AvailabilityCriteria { _never_set: Option } + +impl Part for AvailabilityCriteria {} + + /// Describes a change made to a configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1097,6 +1407,50 @@ pub struct MutationRecord { impl Part for MutationRecord {} +/// Istio service scoped to an Istio mesh +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MeshIstio { + /// Identifier for the mesh in which this Istio service is defined. Corresponds to the mesh_uid metric label in Istio metrics. + #[serde(rename="meshUid")] + pub mesh_uid: Option, + /// The namespace of the Istio service underlying this service. Corresponds to the destination_service_namespace metric label in Istio metrics. + #[serde(rename="serviceNamespace")] + pub service_namespace: Option, + /// The name of the Istio service underlying this service. Corresponds to the destination_service_name metric label in Istio metrics. + #[serde(rename="serviceName")] + pub service_name: Option, +} + +impl Part for MeshIstio {} + + +/// A TimeSeriesRatio specifies two TimeSeries to use for computing the good_service / total_service ratio. The specified TimeSeries must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = +/// DELTA or MetricKind = CUMULATIVE. The TimeSeriesRatio must specify exactly two of good, bad, and total, and the relationship good_service + +/// bad_service = total_service will be assumed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TimeSeriesRatio { + /// A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying bad service, either demanded service that was not provided or demanded service that was of inadequate quality. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE. + #[serde(rename="badServiceFilter")] + pub bad_service_filter: Option, + /// A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying total demanded service. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = + /// DELTA or MetricKind = CUMULATIVE. + #[serde(rename="totalServiceFilter")] + pub total_service_filter: Option, + /// A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying good service provided. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = + /// DELTA or MetricKind = CUMULATIVE. + #[serde(rename="goodServiceFilter")] + pub good_service_filter: Option, +} + +impl Part for TimeSeriesRatio {} + + /// The ListMonitoredResourceDescriptors response. /// /// # Activities @@ -1108,7 +1462,7 @@ impl Part for MutationRecord {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListMonitoredResourceDescriptorsResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The monitored resource descriptors that are available to this project and that match filter, if present. @@ -1127,16 +1481,16 @@ impl ResponseResult for ListMonitoredResourceDescriptorsResponse {} pub struct MetricThreshold { /// The comparison to apply between the time series (indicated by filter and aggregation) and the threshold (indicated by threshold_value). The comparison is applied on each time series, with the time series on the left-hand side and the threshold on the right-hand side.Only COMPARISON_LT and COMPARISON_GT are supported currently. pub comparison: Option, - /// A filter that identifies a time series that should be used as the denominator of a ratio that will be compared with the threshold. If a denominator_filter is specified, the time series specified by the filter field will be used as the numerator.The filter is similar to the one that is specified in the MetricService.ListTimeSeries request (that call is useful to verify the time series that will be retrieved / processed) and must specify the metric type and optionally may contain restrictions on resource type, resource labels, and metric labels. This field may not exceed 2048 Unicode characters in length. + /// A filter (https://cloud.google.com/monitoring/api/v3/filters) that identifies a time series that should be used as the denominator of a ratio that will be compared with the threshold. If a denominator_filter is specified, the time series specified by the filter field will be used as the numerator.The filter must specify the metric type and optionally may contain restrictions on resource type, resource labels, and metric labels. This field may not exceed 2048 Unicode characters in length. #[serde(rename="denominatorFilter")] pub denominator_filter: Option, - /// Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resrouces). Multiple aggregations are applied in the order specified.This field is similar to the one in the MetricService.ListTimeSeries request. It is advisable to use the ListTimeSeries method when debugging this field. + /// Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resrouces). Multiple aggregations are applied in the order specified.This field is similar to the one in the ListTimeSeries request (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It is advisable to use the ListTimeSeries method when debugging this field. pub aggregations: Option>, - /// A filter that identifies which time series should be compared with the threshold.The filter is similar to the one that is specified in the MetricService.ListTimeSeries request (that call is useful to verify the time series that will be retrieved / processed) and must specify the metric type and optionally may contain restrictions on resource type, resource labels, and metric labels. This field may not exceed 2048 Unicode characters in length. + /// A filter (https://cloud.google.com/monitoring/api/v3/filters) that identifies which time series should be compared with the threshold.The filter is similar to the one that is specified in the ListTimeSeries request (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that call is useful to verify the time series that will be retrieved / processed) and must specify the metric type and optionally may contain restrictions on resource type, resource labels, and metric labels. This field may not exceed 2048 Unicode characters in length. pub filter: Option, /// The number/percent of time series for which the comparison must hold in order for the condition to trigger. If unspecified, then the condition will trigger if the comparison is true for any of the time series that have been identified by filter and aggregations, or by the ratio, if denominator_filter and denominator_aggregations are specified. pub trigger: Option, - /// Specifies the alignment of data points in individual time series selected by denominatorFilter as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resources).When computing ratios, the aggregations and denominator_aggregations fields must use the same alignment period and produce time series that have the same periodicity and labels.This field is similar to the one in the MetricService.ListTimeSeries request. It is advisable to use the ListTimeSeries method when debugging this field. + /// Specifies the alignment of data points in individual time series selected by denominatorFilter as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resources).When computing ratios, the aggregations and denominator_aggregations fields must use the same alignment period and produce time series that have the same periodicity and labels. #[serde(rename="denominatorAggregations")] pub denominator_aggregations: Option>, /// The amount of time that a time series must violate the threshold to be considered failing. Currently, only values that are a multiple of a minute--e.g., 0, 60, 120, or 300 seconds--are supported. If an invalid value is given, an error will be returned. When choosing a duration, it is useful to keep in mind the frequency of the underlying time series data (which may also be affected by any alignments specified in the aggregations field); a good duration is long enough so that a single outlier does not generate spurious alerts, but short enough that unhealthy states are detected and alerted on quickly. @@ -1193,6 +1547,42 @@ pub struct ListNotificationChannelsResponse { impl ResponseResult for ListNotificationChannelsResponse {} +/// A descriptor for the value columns in a data point. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ValueDescriptor { + /// The value stream kind. + #[serde(rename="metricKind")] + pub metric_kind: Option, + /// The value type. + #[serde(rename="valueType")] + pub value_type: Option, + /// The value key. + pub key: Option, +} + +impl Part for ValueDescriptor {} + + +/// Service Level Indicators for which atomic units of service are counted directly. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RequestBasedSli { + /// distribution_cut is used when good_service is a count of values aggregated in a Distribution that fall into a good range. The total_service is the total count of all values aggregated in the Distribution. + #[serde(rename="distributionCut")] + pub distribution_cut: Option, + /// good_total_ratio is used when the ratio of good_service to total_service is computed from two TimeSeries. + #[serde(rename="goodTotalRatio")] + pub good_total_ratio: Option, +} + +impl Part for RequestBasedSli {} + + /// The GetNotificationChannelVerificationCode request. /// /// # Activities @@ -1214,6 +1604,44 @@ pub struct GetNotificationChannelVerificationCodeResponse { impl ResponseResult for GetNotificationChannelVerificationCodeResponse {} +/// Configuration for how to query telemetry on a Service. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Telemetry { + /// The full name of the resource that defines this service. Formatted as described in https://cloud.google.com/apis/design/resource_names. + #[serde(rename="resourceName")] + pub resource_name: Option, +} + +impl Part for Telemetry {} + + +/// The QueryTimeSeries request. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [time series query projects](struct.ProjectTimeSeryQueryCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryTimeSeriesRequest { + /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + #[serde(rename="pageToken")] + pub page_token: Option, + /// A positive number that is the maximum number of time_series_data to return. + #[serde(rename="pageSize")] + pub page_size: Option, + /// Required. The query in the monitoring query language format. The default time zone is in UTC. + pub query: Option, +} + +impl RequestValue for QueryTimeSeriesRequest {} + + /// Describes the error status for payloads that were not written. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1232,6 +1660,26 @@ pub struct CollectdPayloadError { impl Part for CollectdPayloadError {} +/// A label value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LabelValue { + /// A string label value. + #[serde(rename="stringValue")] + pub string_value: Option, + /// A bool label value. + #[serde(rename="boolValue")] + pub bool_value: Option, + /// An int64 label value. + #[serde(rename="int64Value")] + pub int64_value: Option, +} + +impl Part for LabelValue {} + + /// Auxiliary metadata for a MonitoredResource object. MonitoredResource objects contain the minimum set of information to uniquely identify a monitored resource instance. There is some other useful auxiliary metadata. Monitoring and Logging use an ingestion pipeline to extract metadata for cloud resources of all types, and store the metadata in this message. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1253,6 +1701,24 @@ pub struct MonitoredResourceMetadata { impl Part for MonitoredResourceMetadata {} +/// A DistributionCut defines a TimeSeries and thresholds used for measuring good service and total service. The TimeSeries must have ValueType = +/// DISTRIBUTION and MetricKind = DELTA or MetricKind = CUMULATIVE. The computed good_service will be the count of values x in the Distribution such that range.min <= x < range.max. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DistributionCut { + /// Range of values considered "good." For a one-sided range, set one bound to an infinite value. + pub range: Option, + /// A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries aggregating values. Must have ValueType = + /// DISTRIBUTION and MetricKind = DELTA or MetricKind = CUMULATIVE. + #[serde(rename="distributionFilter")] + pub distribution_filter: Option, +} + +impl Part for DistributionCut {} + + /// The GetNotificationChannelVerificationCode request. /// /// # Activities @@ -1300,6 +1766,9 @@ pub struct MetricDescriptor { /// Optional. The launch stage of the metric definition. #[serde(rename="launchStage")] pub launch_stage: Option, + /// Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here. + #[serde(rename="monitoredResourceTypes")] + pub monitored_resource_types: Option>, /// Optional. Metadata which can be used to guide usage of the metric. pub metadata: Option, /// The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example: @@ -1309,35 +1778,36 @@ pub struct MetricDescriptor { /// #[serde(rename="type")] pub type_: Option, - /// The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) + /// The units in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values.Different systems may scale the values to be more easily displayed (so a value of 0.02KBy might be displayed as 20By, and a value of 3523KBy might be displayed as 3.5MBy). However, if the unit is KBy, then the value of the metric is always in thousands of bytes, no matter how it may be displayed..If you want a custom metric to record the exact number of CPU-seconds used by a job, you can create an INT64 CUMULATIVE metric whose unit is s{CPU} (or equivalently 1s{CPU} or just s). If the job uses 12,005 CPU-seconds, then the value is written as 12005.Alternatively, if you want a custom metric to record data in a more granular way, you can create a DOUBLE CUMULATIVE metric whose unit is ks{CPU}, and then write the value 12.005 (which is 12005/1000), or use Kis{CPU} and write 11.723 (which is 12005/1024).The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) /// bit bit /// By byte /// s second /// min minute /// h hour /// d dayPrefixes (PREFIX) - /// k kilo (10**3) - /// M mega (10**6) - /// G giga (10**9) - /// T tera (10**12) - /// P peta (10**15) - /// E exa (10**18) - /// Z zetta (10**21) - /// Y yotta (10**24) - /// m milli (10**-3) - /// u micro (10**-6) - /// n nano (10**-9) - /// p pico (10**-12) - /// f femto (10**-15) - /// a atto (10**-18) - /// z zepto (10**-21) - /// y yocto (10**-24) - /// Ki kibi (2**10) - /// Mi mebi (2**20) - /// Gi gibi (2**30) - /// Ti tebi (2**40)GrammarThe grammar also includes these connectors: - /// / division (as an infix operator, e.g. 1/s). - /// . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows: + /// k kilo (10^3) + /// M mega (10^6) + /// G giga (10^9) + /// T tera (10^12) + /// P peta (10^15) + /// E exa (10^18) + /// Z zetta (10^21) + /// Y yotta (10^24) + /// m milli (10^-3) + /// u micro (10^-6) + /// n nano (10^-9) + /// p pico (10^-12) + /// f femto (10^-15) + /// a atto (10^-18) + /// z zepto (10^-21) + /// y yocto (10^-24) + /// Ki kibi (2^10) + /// Mi mebi (2^20) + /// Gi gibi (2^30) + /// Ti tebi (2^40) + /// Pi pebi (2^50)GrammarThe grammar also includes these connectors: + /// / division or ratio (as an infix operator). For examples, kBy/{email} or MiBy/10ms (although you should almost never have /s in a metric unit; rates should always be computed at query time from the underlying cumulative or delta value). + /// . multiplication or composition (as an infix operator). For examples, GBy.d or k{watt}.h.The grammar for a unit is as follows: /// Expression = Component { "." Component } { "/" Component } ; /// /// Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] @@ -1347,10 +1817,11 @@ pub struct MetricDescriptor { /// /// Annotation = "{" NAME "}" ; /// Notes: - /// Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s. - /// NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'. - /// 1 represents dimensionless value 1, such as in 1/s. - /// % represents dimensionless value 1/100, and annotates values giving a percentage. + /// Annotation is just a comment if it follows a UNIT. If the annotation is used alone, then the unit is equivalent to 1. For examples, {request}/s == 1/s, By{transmitted}/s == By/s. + /// NAME is a sequence of non-blank printable ASCII characters not containing { or }. + /// 1 represents a unitary dimensionless unit (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as in 1/s. It is typically used when none of the basic units are appropriate. For example, "new users per day" can be represented as 1/d or {new-users}/d (and a metric value 5 would mean "5 new users). Alternatively, "thousands of page views per day" would be represented as 1000/d or k1/d or k{page_views}/d (and a metric value of 5.3 would mean "5300 page views per day"). + /// % represents dimensionless value of 1/100, and annotates values giving a percentage (so the metric values are typically in the range of 0..100, and a metric value 3 means "3 percent"). + /// 10^2.% indicates a metric contains a ratio, typically in the range 0..1, that will be multiplied by 100 and displayed as a percentage (so a metric value 0.03 means "3 percent"). pub unit: Option, /// The resource name of the metric descriptor. pub name: Option, @@ -1371,9 +1842,6 @@ impl ResponseResult for MetricDescriptor {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NotificationChannelDescriptor { - /// The tiers that support this notification channel; the project service tier must be one of the supported_tiers. - #[serde(rename="supportedTiers")] - pub supported_tiers: Option>, /// A human-readable name for the notification channel type. This form of the name is suitable for a user interface. #[serde(rename="displayName")] pub display_name: Option, @@ -1384,8 +1852,11 @@ pub struct NotificationChannelDescriptor { /// The type of notification channel, such as "email", "sms", etc. Notification channel types are globally unique. #[serde(rename="type")] pub type_: Option, - /// The full REST resource name for this descriptor. The syntax is: - /// projects/[PROJECT_ID]/notificationChannelDescriptors/[TYPE] + /// The product launch stage for channels of this type. + #[serde(rename="launchStage")] + pub launch_stage: Option, + /// The full REST resource name for this descriptor. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] /// In the above, [TYPE] is the value of the type field. pub name: Option, } @@ -1393,6 +1864,27 @@ pub struct NotificationChannelDescriptor { impl ResponseResult for NotificationChannelDescriptor {} +/// A Service-Level Indicator (SLI) describes the "performance" of a service. For some services, the SLI is well-defined. In such cases, the SLI can be described easily by referencing the well-known SLI and providing the needed parameters. Alternatively, a "custom" SLI can be defined with a query to the underlying metric store. An SLI is defined to be good_service / +/// total_service over any queried time interval. The value of performance always falls into the range 0 <= performance <= 1. A custom SLI describes how to compute this ratio, whether this is by dividing values from a pair of time series, cutting a Distribution into good and bad counts, or counting time windows in which the service complies with a criterion. For separation of concerns, a single Service-Level Indicator measures performance for only one aspect of service quality, such as fraction of successful queries or fast-enough queries. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceLevelIndicator { + /// Basic SLI on a well-known service type. + #[serde(rename="basicSli")] + pub basic_sli: Option, + /// Windows-based SLIs + #[serde(rename="windowsBased")] + pub windows_based: Option, + /// Request-based SLIs + #[serde(rename="requestBased")] + pub request_based: Option, +} + +impl Part for ServiceLevelIndicator {} + + /// The ListGroups response. /// /// # Activities @@ -1404,7 +1896,7 @@ impl ResponseResult for NotificationChannelDescriptor {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListGroupsResponse { - /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The groups that match the specified filters. @@ -1449,7 +1941,7 @@ impl RequestValue for CreateCollectdTimeSeriesRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VerifyNotificationChannelRequest { - /// The verification code that was delivered to the channel as a result of invoking the SendNotificationChannelVerificationCode API method or that was retrieved from a verified channel via GetNotificationChannelVerificationCode. For example, one might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that the code is valid UTF-8; one should not make any assumptions regarding the structure or format of the code). + /// Required. The verification code that was delivered to the channel as a result of invoking the SendNotificationChannelVerificationCode API method or that was retrieved from a verified channel via GetNotificationChannelVerificationCode. For example, one might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that the code is valid UTF-8; one should not make any assumptions regarding the structure or format of the code). pub code: Option, } @@ -1498,7 +1990,7 @@ impl ResponseResult for MonitoredResourceDescriptor {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListAlertPoliciesResponse { - /// If there might be more results than were returned, then this field is set to a non-empty value. To see the additional results, use that value as pageToken in the next call to this method. + /// If there might be more results than were returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The returned alert policies. @@ -1573,13 +2065,35 @@ pub struct Documentation { impl Part for Documentation {} -/// Information involved in an HTTP/HTTPS uptime check request. +/// Istio service scoped to a single Kubernetes cluster. Learn more at http://istio.io. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClusterIstio { + /// The name of the Kubernetes cluster in which this Istio service is defined. Corresponds to the cluster_name resource label in k8s_cluster resources. + #[serde(rename="clusterName")] + pub cluster_name: Option, + /// The namespace of the Istio service underlying this service. Corresponds to the destination_service_namespace metric label in Istio metrics. + #[serde(rename="serviceNamespace")] + pub service_namespace: Option, + /// The name of the Istio service underlying this service. Corresponds to the destination_service_name metric label in Istio metrics. + #[serde(rename="serviceName")] + pub service_name: Option, + /// The location of the Kubernetes cluster in which this Istio service is defined. Corresponds to the location resource label in k8s_cluster resources. + pub location: Option, +} + +impl Part for ClusterIstio {} + + +/// Information involved in an HTTP/HTTPS Uptime check request. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HttpCheck { - /// The list of headers to send as part of the uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second. The maximum number of headers allowed is 100. + /// The list of headers to send as part of the Uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second. The maximum number of headers allowed is 100. pub headers: Option>, /// The authentication information. Optional when creating an HTTP check; defaults to empty. #[serde(rename="authInfo")] @@ -1587,31 +2101,47 @@ pub struct HttpCheck { /// If true, use HTTPS instead of HTTP to run the check. #[serde(rename="useSsl")] pub use_ssl: Option, - /// Boolean specifiying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to True then the headers will be obscured with ******. + /// Boolean specifiying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to true then the headers will be obscured with ******. #[serde(rename="maskHeaders")] pub mask_headers: Option, - /// The path to the page to run the check against. Will be combined with the host (specified within the MonitoredResource) and port to construct the full URL. Optional (defaults to "/"). If the provided path does not begin with "/", it will be prepended automatically. + /// Boolean specifying whether to include SSL certificate validation as a part of the Uptime check. Only applies to checks where monitored_resource is set to uptime_url. If use_ssl is false, setting validate_ssl to true has no effect. + #[serde(rename="validateSsl")] + pub validate_ssl: Option, + /// Optional (defaults to "/"). The path to the page against which to run the check. Will be combined with the host (specified within the monitored_resource) and port to construct the full URL. If the provided path does not begin with "/", a "/" will be prepended automatically. pub path: Option, - /// The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) and path to construct the full URL. Optional (defaults to 80 without SSL, or 443 with SSL). + /// Optional (defaults to 80 when use_ssl is false, and 443 when use_ssl is true). The TCP port on the HTTP server against which to run the check. Will be combined with host (specified within the monitored_resource) and path to construct the full URL. pub port: Option, } impl Part for HttpCheck {} -/// The range of the population values. +/// The QueryTimeSeries response. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [time series query projects](struct.ProjectTimeSeryQueryCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Range { - /// The maximum of the population values. - pub max: Option, - /// The minimum of the population values. - pub min: Option, +pub struct QueryTimeSeriesResponse { + /// If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as page_token in the next call to this method. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The time series data. + #[serde(rename="timeSeriesData")] + pub time_series_data: Option>, + /// Query execution errors that may have caused the time series data returned to be incomplete. The available data will be available in the response. + #[serde(rename="partialErrors")] + pub partial_errors: Option>, + /// The descriptor for the time series data. + #[serde(rename="timeSeriesDescriptor")] + pub time_series_descriptor: Option, } -impl Part for Range {} +impl ResponseResult for QueryTimeSeriesResponse {} /// Exemplars are example points that may be used to annotate aggregated distribution values. They are metadata that gives information about a particular value added to a Distribution bucket, such as a trace ID that was active when a value was added. They may contain further information, such as a example values and timestamps, origin, etc. @@ -1631,6 +2161,194 @@ pub struct Exemplar { impl Part for Exemplar {} +/// The protocol for the ListUptimeCheckConfigs response. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [uptime check configs list projects](struct.ProjectUptimeCheckConfigListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListUptimeCheckConfigsResponse { + /// This field represents the pagination token to retrieve the next page of results. If the value is empty, it means no further results for the request. To retrieve the next page of results, the value of the next_page_token is passed to the subsequent List method call (in the request message's page_token field). + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of Uptime check configurations for the project, irrespective of any pagination. + #[serde(rename="totalSize")] + pub total_size: Option, + /// The returned Uptime check configurations. + #[serde(rename="uptimeCheckConfigs")] + pub uptime_check_configs: Option>, +} + +impl ResponseResult for ListUptimeCheckConfigsResponse {} + + +/// Distribution contains summary statistics for a population of values. It optionally contains a histogram representing the distribution of those values across a set of buckets.The summary statistics are the count, mean, sum of the squared deviation from the mean, the minimum, and the maximum of the set of population of values. The histogram is based on a sequence of buckets and gives a count of values that fall into each bucket. The boundaries of the buckets are given either explicitly or by formulas for buckets of fixed or exponentially increasing widths.Although it is not forbidden, it is generally a bad idea to include non-finite values (infinities or NaNs) in the population of values, as this will render the mean and sum_of_squared_deviation fields meaningless. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Distribution { + /// The number of values in the population. Must be non-negative. This value must equal the sum of the values in bucket_counts if a histogram is provided. + pub count: Option, + /// Required in the Cloud Monitoring API v3. The values for each bucket specified in bucket_options. The sum of the values in bucketCounts must equal the value in the count field of the Distribution object. The order of the bucket counts follows the numbering schemes described for the three bucket types. The underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; and the overflow bucket has number N-1. The size of bucket_counts must not be greater than N. If the size is less than N, then the remaining buckets are assigned values of zero. + #[serde(rename="bucketCounts")] + pub bucket_counts: Option>, + /// The sum of squared deviations from the mean of the values in the population. For values x_i this is: + /// Sum[i=1..n]((x_i - mean)^2) + /// Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition describes Welford's method for accumulating this sum in one pass.If count is zero then this field must be zero. + #[serde(rename="sumOfSquaredDeviation")] + pub sum_of_squared_deviation: Option, + /// If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Cloud Monitoring API v3. + pub range: Option, + /// Required in the Cloud Monitoring API v3. Defines the histogram bucket boundaries. + #[serde(rename="bucketOptions")] + pub bucket_options: Option, + /// Must be in increasing order of value field. + pub exemplars: Option>, + /// The arithmetic mean of the values in the population. If count is zero then this field must be zero. + pub mean: Option, +} + +impl Part for Distribution {} + + +/// The authentication parameters to provide to the specified resource or URL that requires a username and password. Currently, only Basic HTTP authentication (https://tools.ietf.org/html/rfc7617) is supported in Uptime checks. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BasicAuthentication { + /// The username to use when authenticating with the HTTP server. + pub username: Option, + /// The password to use when authenticating with the HTTP server. + pub password: Option, +} + +impl Part for BasicAuthentication {} + + +/// A description of a label. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LabelDescriptor { + /// The type of data that can be assigned to the label. + #[serde(rename="valueType")] + pub value_type: Option, + /// A human-readable description for the label. + pub description: Option, + /// The key for this label. The key must meet the following criteria: + /// Does not exceed 100 characters. + /// Matches the following regular expression: [a-zA-Z][a-zA-Z0-9_]* + /// The first character must be an upper- or lower-case letter. + /// The remaining characters must be letters, digits, or underscores. + pub key: Option, +} + +impl Part for LabelDescriptor {} + + +/// Specifies a linear sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 1)). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Linear { + /// Must be greater than 0. + pub width: Option, + /// Must be greater than 0. + #[serde(rename="numFiniteBuckets")] + pub num_finite_buckets: Option, + /// Lower bound of the first bucket. + pub offset: Option, +} + +impl Part for Linear {} + + +/// Describes the error status for values that were not written. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CollectdValueError { + /// The zero-based index in CollectdPayload.values within the parent CreateCollectdTimeSeriesRequest.collectd_payloads. + pub index: Option, + /// Records the error status for the value. + pub error: Option, +} + +impl Part for CollectdValueError {} + + +/// A single data point in a time series. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Point { + /// The time interval to which the data point applies. For GAUGE metrics, the start time is optional, but if it is supplied, it must equal the end time. For DELTA metrics, the start and end time should specify a non-zero interval, with subsequent points specifying contiguous and non-overlapping intervals. For CUMULATIVE metrics, the start and end time should specify a non-zero interval, with subsequent points specifying the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points. + pub interval: Option, + /// The value of the data point. + pub value: Option, +} + +impl Part for Point {} + + +/// A specific metric, identified by specifying values for all of the labels of a MetricDescriptor. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Metric { + /// The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values. + pub labels: Option>, + /// An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for Metric {} + + +/// The range of the population values. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Range { + /// The maximum of the population values. + pub max: Option, + /// The minimum of the population values. + pub min: Option, +} + +impl Part for Range {} + + +/// A descriptor for the labels and points in a timeseries. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TimeSeriesDescriptor { + /// Descriptors for the labels. + #[serde(rename="labelDescriptors")] + pub label_descriptors: Option>, + /// Descriptors for the point data value columns. + #[serde(rename="pointDescriptors")] + pub point_descriptors: Option>, +} + +impl Part for TimeSeriesDescriptor {} + + /// A collection of data points that describes the time-varying values of a metric. A time series is identified by a combination of a fully-specified monitored resource and a fully-specified metric. This type is used for both listing and creating time series. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1656,109 +2374,19 @@ pub struct TimeSeries { impl Part for TimeSeries {} -/// A type of authentication to perform against the specified resource or URL that uses username and password. Currently, only Basic authentication is supported in Uptime Monitoring. +/// Range of numerical values, inclusive of min and exclusive of max. If the open range "< range.max" is desired, set range.min = -infinity. If the open range ">= range.min" is desired, set range.max = infinity. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BasicAuthentication { - /// The username to authenticate. - pub username: Option, - /// The password to authenticate. - pub password: Option, +pub struct GoogleMonitoringV3Range { + /// Range maximum. + pub max: Option, + /// Range minimum. + pub min: Option, } -impl Part for BasicAuthentication {} - - -/// A description of a label. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LabelDescriptor { - /// The type of data that can be assigned to the label. - #[serde(rename="valueType")] - pub value_type: Option, - /// A human-readable description for the label. - pub description: Option, - /// The label key. - pub key: Option, -} - -impl Part for LabelDescriptor {} - - -/// An internal checker allows uptime checks to run on private/internal GCP resources. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InternalChecker { - /// The current operational state of the internal checker. - pub state: Option, - /// The checker's human-readable name. The display name should be unique within a Stackdriver Workspace in order to make it easier to identify; however, uniqueness is not enforced. - #[serde(rename="displayName")] - pub display_name: Option, - /// The GCP VPC network (https://cloud.google.com/vpc/docs/vpc) where the internal resource lives (ex: "default"). - pub network: Option, - /// A unique resource name for this InternalChecker. The format is:projects/[PROJECT_ID]/internalCheckers/[INTERNAL_CHECKER_ID].PROJECT_ID is the stackdriver workspace project for the uptime check config associated with the internal checker. - pub name: Option, - /// The GCP project_id where the internal checker lives. Not necessary the same as the workspace project. - #[serde(rename="peerProjectId")] - pub peer_project_id: Option, - /// The GCP zone the uptime check should egress from. Only respected for internal uptime checks, where internal_network is specified. - #[serde(rename="gcpZone")] - pub gcp_zone: Option, -} - -impl Part for InternalChecker {} - - -/// Describes the error status for values that were not written. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CollectdValueError { - /// The zero-based index in CollectdPayload.values within the parent CreateCollectdTimeSeriesRequest.collectd_payloads. - pub index: Option, - /// Records the error status for the value. - pub error: Option, -} - -impl Part for CollectdValueError {} - - -/// A single data point in a time series. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Point { - /// The time interval to which the data point applies. For GAUGE metrics, only the end time of the interval is used. For DELTA metrics, the start and end time should specify a non-zero interval, with subsequent points specifying contiguous and non-overlapping intervals. For CUMULATIVE metrics, the start and end time should specify a non-zero interval, with subsequent points specifying the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points. - pub interval: Option, - /// The value of the data point. - pub value: Option, -} - -impl Part for Point {} - - -/// A specific metric, identified by specifying values for all of the labels of a MetricDescriptor. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Metric { - /// The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values. - pub labels: Option>, - /// An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount. - #[serde(rename="type")] - pub type_: Option, -} - -impl Part for Metric {} +impl Part for GoogleMonitoringV3Range {} /// The CreateTimeSeries request. @@ -1772,7 +2400,7 @@ impl Part for Metric {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateTimeSeriesRequest { - /// The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each TimeSeries value must fully specify a unique time series by supplying all label values for the metric and the monitored resource.The maximum number of TimeSeries objects per Create request is 200. + /// Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each TimeSeries value must fully specify a unique time series by supplying all label values for the metric and the monitored resource.The maximum number of TimeSeries objects per Create request is 200. #[serde(rename="timeSeries")] pub time_series: Option>, } @@ -1780,11 +2408,298 @@ pub struct CreateTimeSeriesRequest { impl RequestValue for CreateTimeSeriesRequest {} +/// App Engine service. Learn more at https://cloud.google.com/appengine. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppEngine { + /// The ID of the App Engine module underlying this service. Corresponds to the module_id resource label in the gae_app monitored resource: https://cloud.google.com/monitoring/api/resources#tag_gae_app + #[serde(rename="moduleId")] + pub module_id: Option, +} + +impl Part for AppEngine {} + + +/// Summary of the result of a failed request to write data to a time series. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateTimeSeriesSummary { + /// The number of points that failed to be written. Order is not guaranteed. + pub errors: Option>, + /// The number of points in the request. + #[serde(rename="totalPointCount")] + pub total_point_count: Option, + /// The number of points that were successfully written. + #[serde(rename="successPointCount")] + pub success_point_count: Option, +} + +impl Part for CreateTimeSeriesSummary {} + + // ################### // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *service* resources. +/// It is not used directly, but through the `Monitoring` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_monitoring3 as monitoring3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use monitoring3::Monitoring; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `service_level_objectives_create(...)`, `service_level_objectives_delete(...)`, `service_level_objectives_get(...)`, `service_level_objectives_list(...)` and `service_level_objectives_patch(...)` +/// // to build up your call. +/// let rb = hub.services(); +/// # } +/// ``` +pub struct ServiceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, +} + +impl<'a, C, A> MethodsBuilder for ServiceMethods<'a, C, A> {} + +impl<'a, C, A> ServiceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Update the given ServiceLevelObjective. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Resource name for this ServiceLevelObjective. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + /// + pub fn service_level_objectives_patch(&self, request: ServiceLevelObjective, name: &str) -> ServiceServiceLevelObjectivePatchCall<'a, C, A> { + ServiceServiceLevelObjectivePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Soft delete this Service. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the Service to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + pub fn delete(&self, name: &str) -> ServiceDeleteCall<'a, C, A> { + ServiceDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get a ServiceLevelObjective by name. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the ServiceLevelObjective to get. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + /// + pub fn service_level_objectives_get(&self, name: &str) -> ServiceServiceLevelObjectiveGetCall<'a, C, A> { + ServiceServiceLevelObjectiveGetCall { + hub: self.hub, + _name: name.to_string(), + _view: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List the ServiceLevelObjectives for the given Service. + /// + /// # Arguments + /// + /// * `parent` - Required. Resource name of the parent containing the listed SLOs, either a project or a Monitoring Workspace. The formats are: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + /// + pub fn service_level_objectives_list(&self, parent: &str) -> ServiceServiceLevelObjectiveListCall<'a, C, A> { + ServiceServiceLevelObjectiveListCall { + hub: self.hub, + _parent: parent.to_string(), + _view: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a Service. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. Resource name of the parent workspace. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// + pub fn create(&self, request: Service, parent: &str) -> ServiceCreateCall<'a, C, A> { + ServiceCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _service_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a ServiceLevelObjective for the given Service. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. Resource name of the parent Service. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + pub fn service_level_objectives_create(&self, request: ServiceLevelObjective, parent: &str) -> ServiceServiceLevelObjectiveCreateCall<'a, C, A> { + ServiceServiceLevelObjectiveCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _service_level_objective_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update this Service. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Resource name for this Service. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + pub fn patch(&self, request: Service, name: &str) -> ServicePatchCall<'a, C, A> { + ServicePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get the named Service. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the Service. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + pub fn get(&self, name: &str) -> ServiceGetCall<'a, C, A> { + ServiceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete the given ServiceLevelObjective. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the ServiceLevelObjective to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + /// + pub fn service_level_objectives_delete(&self, name: &str) -> ServiceServiceLevelObjectiveDeleteCall<'a, C, A> { + ServiceServiceLevelObjectiveDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List Services for this workspace. + /// + /// # Arguments + /// + /// * `parent` - Required. Resource name of the parent containing the listed services, either a project or a Monitoring Workspace. The formats are: + /// projects/[PROJECT_ID_OR_NUMBER] + /// workspaces/[HOST_PROJECT_ID_OR_NUMBER] + /// + pub fn list(&self, parent: &str) -> ServiceListCall<'a, C, A> { + ServiceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *uptimeCheckIp* resources. /// It is not used directly, but through the `Monitoring` hub. /// @@ -1826,7 +2741,7 @@ impl<'a, C, A> UptimeCheckIpMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the list of IPs that checkers run from + /// Returns the list of IP addresses that checkers run from pub fn list(&self) -> UptimeCheckIpListCall<'a, C, A> { UptimeCheckIpListCall { hub: self.hub, @@ -1865,7 +2780,7 @@ impl<'a, C, A> UptimeCheckIpMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `alert_policies_create(...)`, `alert_policies_delete(...)`, `alert_policies_get(...)`, `alert_policies_list(...)`, `alert_policies_patch(...)`, `collectd_time_series_create(...)`, `groups_create(...)`, `groups_delete(...)`, `groups_get(...)`, `groups_list(...)`, `groups_members_list(...)`, `groups_update(...)`, `metric_descriptors_create(...)`, `metric_descriptors_delete(...)`, `metric_descriptors_get(...)`, `metric_descriptors_list(...)`, `monitored_resource_descriptors_get(...)`, `monitored_resource_descriptors_list(...)`, `notification_channel_descriptors_get(...)`, `notification_channel_descriptors_list(...)`, `notification_channels_create(...)`, `notification_channels_delete(...)`, `notification_channels_get(...)`, `notification_channels_get_verification_code(...)`, `notification_channels_list(...)`, `notification_channels_patch(...)`, `notification_channels_send_verification_code(...)`, `notification_channels_verify(...)`, `time_series_create(...)`, `time_series_list(...)`, `uptime_check_configs_create(...)`, `uptime_check_configs_delete(...)`, `uptime_check_configs_get(...)`, `uptime_check_configs_list(...)` and `uptime_check_configs_patch(...)` +/// // like `alert_policies_create(...)`, `alert_policies_delete(...)`, `alert_policies_get(...)`, `alert_policies_list(...)`, `alert_policies_patch(...)`, `collectd_time_series_create(...)`, `groups_create(...)`, `groups_delete(...)`, `groups_get(...)`, `groups_list(...)`, `groups_members_list(...)`, `groups_update(...)`, `metric_descriptors_create(...)`, `metric_descriptors_delete(...)`, `metric_descriptors_get(...)`, `metric_descriptors_list(...)`, `monitored_resource_descriptors_get(...)`, `monitored_resource_descriptors_list(...)`, `notification_channel_descriptors_get(...)`, `notification_channel_descriptors_list(...)`, `notification_channels_create(...)`, `notification_channels_delete(...)`, `notification_channels_get(...)`, `notification_channels_get_verification_code(...)`, `notification_channels_list(...)`, `notification_channels_patch(...)`, `notification_channels_send_verification_code(...)`, `notification_channels_verify(...)`, `time_series_create(...)`, `time_series_list(...)`, `time_series_query(...)`, `uptime_check_configs_create(...)`, `uptime_check_configs_delete(...)`, `uptime_check_configs_get(...)`, `uptime_check_configs_list(...)` and `uptime_check_configs_patch(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1882,47 +2797,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state).There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time. + /// Gets a single metric descriptor. This method does not require a Workspace. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `name` - The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail. - pub fn notification_channels_get_verification_code(&self, request: GetNotificationChannelVerificationCodeRequest, name: &str) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { - ProjectNotificationChannelGetVerificationCodeCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method. - /// - /// # Arguments - /// - /// * `name` - The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. - pub fn notification_channels_get(&self, name: &str) -> ProjectNotificationChannelGetCall<'a, C, A> { - ProjectNotificationChannelGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets a single metric descriptor. This method does not require a Stackdriver account. - /// - /// # Arguments - /// - /// * `name` - The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example value of {metric_id} is "compute.googleapis.com/instance/disk/read_bytes_count". + /// * `name` - Required. The metric descriptor on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + /// An example value of [METRIC_ID] is "compute.googleapis.com/instance/disk/read_bytes_count". pub fn metric_descriptors_get(&self, name: &str) -> ProjectMetricDescriptorGetCall<'a, C, A> { ProjectMetricDescriptorGetCall { hub: self.hub, @@ -1933,6 +2814,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an alerting policy. You can either replace the entire policy with a new one or replace only certain fields in the current alerting policy by specifying the fields to be updated via updateMask. Returns the updated alerting policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required if the policy exists. The resource name for this policy. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + /// [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. + pub fn alert_policies_patch(&self, request: AlertPolicy, name: &str) -> ProjectAlertPolicyPatchCall<'a, C, A> { + ProjectAlertPolicyPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service. @@ -1940,9 +2843,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The project on which to execute the request. The format is: - /// projects/[PROJECT_ID] - /// Note that this names the container into which the channel will be written. This does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel. + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel. pub fn notification_channels_create(&self, request: NotificationChannel, name: &str) -> ProjectNotificationChannelCreateCall<'a, C, A> { ProjectNotificationChannelCreateCall { hub: self.hub, @@ -1954,35 +2857,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates a notification channel. Fields not specified in the field mask remain unchanged. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - The full REST resource name for this channel. The syntax is: - /// projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] - /// The [CHANNEL_ID] is automatically assigned by the server on creation. - pub fn notification_channels_patch(&self, request: NotificationChannel, name: &str) -> ProjectNotificationChannelPatchCall<'a, C, A> { - ProjectNotificationChannelPatchCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _update_mask: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists the existing groups. /// /// # Arguments /// - /// * `name` - The project whose groups are to be listed. The format is "projects/{project_id_or_number}". + /// * `name` - Required. The project whose groups are to be listed. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn groups_list(&self, name: &str) -> ProjectGroupListCall<'a, C, A> { ProjectGroupListCall { hub: self.hub, @@ -1998,6 +2881,45 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a notification channel. + /// + /// # Arguments + /// + /// * `name` - Required. The channel for which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + /// + pub fn notification_channels_delete(&self, name: &str) -> ProjectNotificationChannelDeleteCall<'a, C, A> { + ProjectNotificationChannelDeleteCall { + hub: self.hub, + _name: name.to_string(), + _force: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state).There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail. + pub fn notification_channels_get_verification_code(&self, request: GetNotificationChannelVerificationCodeRequest, name: &str) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { + ProjectNotificationChannelGetVerificationCodeCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a new group. @@ -2005,7 +2927,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The project in which to create the group. The format is "projects/{project_id_or_number}". + /// * `name` - Required. The project in which to create the group. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn groups_create(&self, request: Group, name: &str) -> ProjectGroupCreateCall<'a, C, A> { ProjectGroupCreateCall { hub: self.hub, @@ -2024,7 +2948,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The group to retrieve. The format is "projects/{project_id_or_number}/groups/{group_id}". + /// * `name` - Required. The group to retrieve. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// pub fn groups_get(&self, name: &str) -> ProjectGroupGetCall<'a, C, A> { ProjectGroupGetCall { hub: self.hub, @@ -2041,8 +2967,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: - /// projects/[PROJECT_ID] + /// * `name` - Required. The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: + /// projects/[PROJECT_ID_OR_NUMBER] /// Note that this names the parent container in which to look for the descriptors; to retrieve a single descriptor by name, use the GetNotificationChannelDescriptor operation, instead. pub fn notification_channel_descriptors_list(&self, name: &str) -> ProjectNotificationChannelDescriptorListCall<'a, C, A> { ProjectNotificationChannelDescriptorListCall { @@ -2063,7 +2989,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn time_series_create(&self, request: CreateTimeSeriesRequest, name: &str) -> ProjectTimeSeryCreateCall<'a, C, A> { ProjectTimeSeryCreateCall { hub: self.hub, @@ -2077,11 +3005,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + /// Lists metric descriptors that match a filter. This method does not require a Workspace. /// /// # Arguments /// - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn metric_descriptors_list(&self, name: &str) -> ProjectMetricDescriptorListCall<'a, C, A> { ProjectMetricDescriptorListCall { hub: self.hub, @@ -2097,11 +3027,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + /// Lists monitored resource descriptors that match a filter. This method does not require a Workspace. /// /// # Arguments /// - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn monitored_resource_descriptors_list(&self, name: &str) -> ProjectMonitoredResourceDescriptorListCall<'a, C, A> { ProjectMonitoredResourceDescriptorListCall { hub: self.hub, @@ -2117,14 +3049,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a single uptime check configuration. + /// Queries time series using the time series query language. This method does not require a Workspace. /// /// # Arguments /// - /// * `name` - The uptime check configuration to retrieve. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. - pub fn uptime_check_configs_get(&self, name: &str) -> ProjectUptimeCheckConfigGetCall<'a, C, A> { - ProjectUptimeCheckConfigGetCall { + /// * `request` - No description provided. + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// + pub fn time_series_query(&self, request: QueryTimeSeriesRequest, name: &str) -> ProjectTimeSeryQueryCall<'a, C, A> { + ProjectTimeSeryQueryCall { hub: self.hub, + _request: request, _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -2138,7 +3074,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The channel type for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}. + /// * `name` - Required. The channel type for which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + /// pub fn notification_channel_descriptors_get(&self, name: &str) -> ProjectNotificationChannelDescriptorGetCall<'a, C, A> { ProjectNotificationChannelDescriptorGetCall { hub: self.hub, @@ -2151,11 +3089,33 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists time series that match a filter. This method does not require a Stackdriver account. + /// Deletes an existing group. /// /// # Arguments /// - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + /// * `name` - Required. The group to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// + pub fn groups_delete(&self, name: &str) -> ProjectGroupDeleteCall<'a, C, A> { + ProjectGroupDeleteCall { + hub: self.hub, + _name: name.to_string(), + _recursive: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists time series that match a filter. This method does not require a Workspace. + /// + /// # Arguments + /// + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn time_series_list(&self, name: &str) -> ProjectTimeSeryListCall<'a, C, A> { ProjectTimeSeryListCall { hub: self.hub, @@ -2183,8 +3143,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The project whose alert policies are to be listed. The format is - /// projects/[PROJECT_ID] + /// * `name` - Required. The project whose alert policies are to be listed. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] /// Note that this field names the parent container in which the alerting policies to be listed are stored. To retrieve a single alerting policy by name, use the GetAlertPolicy operation, instead. pub fn alert_policies_list(&self, name: &str) -> ProjectAlertPolicyListCall<'a, C, A> { ProjectAlertPolicyListCall { @@ -2202,11 +3162,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a metric descriptor. Only user-created custom metrics can be deleted. + /// Deletes a metric descriptor. Only user-created custom metrics (https://cloud.google.com/monitoring/custom-metrics) can be deleted. /// /// # Arguments /// - /// * `name` - The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example of {metric_id} is: "custom.googleapis.com/my_test_metric". + /// * `name` - Required. The metric descriptor on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] + /// An example of [METRIC_ID] is: "custom.googleapis.com/my_test_metric". pub fn metric_descriptors_delete(&self, name: &str) -> ProjectMetricDescriptorDeleteCall<'a, C, A> { ProjectMetricDescriptorDeleteCall { hub: self.hub, @@ -2217,6 +3179,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the existing valid Uptime check configurations for the project (leaving out any invalid configurations). + /// + /// # Arguments + /// + /// * `parent` - Required. The project whose Uptime check configurations are listed. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// + pub fn uptime_check_configs_list(&self, parent: &str) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + ProjectUptimeCheckConfigListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Stackdriver Monitoring Agent only: Creates a new time series. @@ -2224,7 +3207,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The project in which to create the time series. The format is "projects/PROJECT_ID_OR_NUMBER". + /// * `name` - The project in which to create the time series. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn collectd_time_series_create(&self, request: CreateCollectdTimeSeriesRequest, name: &str) -> ProjectCollectdTimeSeryCreateCall<'a, C, A> { ProjectCollectdTimeSeryCreateCall { hub: self.hub, @@ -2238,35 +3223,16 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new alerting policy. + /// Updates a notification channel. Fields not specified in the field mask remain unchanged. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The project in which to create the alerting policy. The format is projects/[PROJECT_ID].Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[POLICY_ID], identifying the policy in the container. - pub fn alert_policies_create(&self, request: AlertPolicy, name: &str) -> ProjectAlertPolicyCreateCall<'a, C, A> { - ProjectAlertPolicyCreateCall { - hub: self.hub, - _request: request, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates an alerting policy. You can either replace the entire policy with a new one or replace only certain fields in the current alerting policy by specifying the fields to be updated via updateMask. Returns the updated alerting policy. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `name` - Required if the policy exists. The resource name for this policy. The syntax is: - /// projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - /// [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. - pub fn alert_policies_patch(&self, request: AlertPolicy, name: &str) -> ProjectAlertPolicyPatchCall<'a, C, A> { - ProjectAlertPolicyPatchCall { + /// * `name` - The full REST resource name for this channel. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + /// The [CHANNEL_ID] is automatically assigned by the server on creation. + pub fn notification_channels_patch(&self, request: NotificationChannel, name: &str) -> ProjectNotificationChannelPatchCall<'a, C, A> { + ProjectNotificationChannelPatchCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -2277,13 +3243,34 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets a single alerting policy. + /// + /// # Arguments + /// + /// * `name` - Required. The alerting policy to retrieve. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + /// + pub fn alert_policies_get(&self, name: &str) -> ProjectAlertPolicyGetCall<'a, C, A> { + ProjectAlertPolicyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists the notification channels that have been created for the project. /// /// # Arguments /// - /// * `name` - The project on which to execute the request. The format is projects/[PROJECT_ID]. That is, this names the container in which to look for the notification channels; it does not name a specific channel. To query a specific channel by REST resource name, use the GetNotificationChannel operation. + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// This names the container in which to look for the notification channels; it does not name a specific channel. To query a specific channel by REST resource name, use the GetNotificationChannel operation. pub fn notification_channels_list(&self, name: &str) -> ProjectNotificationChannelListCall<'a, C, A> { ProjectNotificationChannelListCall { hub: self.hub, @@ -2305,7 +3292,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. + /// * `name` - Output only. The name of this group. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically. pub fn groups_update(&self, request: Group, name: &str) -> ProjectGroupUpdateCall<'a, C, A> { ProjectGroupUpdateCall { hub: self.hub, @@ -2318,6 +3307,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets a single Uptime check configuration. + /// + /// # Arguments + /// + /// * `name` - Required. The Uptime check configuration to retrieve. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + /// + pub fn uptime_check_configs_get(&self, name: &str) -> ProjectUptimeCheckConfigGetCall<'a, C, A> { + ProjectUptimeCheckConfigGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Causes a verification code to be delivered to the channel. The code can then be supplied in VerifyNotificationChannel to verify the channel. @@ -2325,7 +3333,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The notification channel to which to send a verification code. + /// * `name` - Required. The notification channel to which to send a verification code. pub fn notification_channels_send_verification_code(&self, request: SendNotificationChannelVerificationCodeRequest, name: &str) -> ProjectNotificationChannelSendVerificationCodeCall<'a, C, A> { ProjectNotificationChannelSendVerificationCodeCall { hub: self.hub, @@ -2339,12 +3347,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via "updateMask". Returns the updated configuration. + /// Updates an Uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via updateMask. Returns the updated configuration. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response. + /// * `name` - A unique resource name for this Uptime check configuration. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + /// This field should be omitted when creating the Uptime check configuration; on create, the resource name is assigned by the server and included in the response. pub fn uptime_check_configs_patch(&self, request: UptimeCheckConfig, name: &str) -> ProjectUptimeCheckConfigPatchCall<'a, C, A> { ProjectUptimeCheckConfigPatchCall { hub: self.hub, @@ -2359,12 +3369,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new uptime check configuration. + /// Creates a new Uptime check configuration. /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The project in which to create the uptime check. The format is projects/[PROJECT_ID]. + /// * `parent` - Required. The project in which to create the Uptime check. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn uptime_check_configs_create(&self, request: UptimeCheckConfig, parent: &str) -> ProjectUptimeCheckConfigCreateCall<'a, C, A> { ProjectUptimeCheckConfigCreateCall { hub: self.hub, @@ -2382,8 +3394,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The alerting policy to delete. The format is: - /// projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + /// * `name` - Required. The alerting policy to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] /// For more information, see AlertPolicy. pub fn alert_policies_delete(&self, name: &str) -> ProjectAlertPolicyDeleteCall<'a, C, A> { ProjectAlertPolicyDeleteCall { @@ -2397,11 +3409,34 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an uptime check configuration. Note that this method will fail if the uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion. + /// Creates a new alerting policy. /// /// # Arguments /// - /// * `name` - The uptime check configuration to delete. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. + /// * `request` - No description provided. + /// * `name` - Required. The project in which to create the alerting policy. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container. + pub fn alert_policies_create(&self, request: AlertPolicy, name: &str) -> ProjectAlertPolicyCreateCall<'a, C, A> { + ProjectAlertPolicyCreateCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes an Uptime check configuration. Note that this method will fail if the Uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion. + /// + /// # Arguments + /// + /// * `name` - Required. The Uptime check configuration to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + /// pub fn uptime_check_configs_delete(&self, name: &str) -> ProjectUptimeCheckConfigDeleteCall<'a, C, A> { ProjectUptimeCheckConfigDeleteCall { hub: self.hub, @@ -2412,31 +3447,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes a notification channel. - /// - /// # Arguments - /// - /// * `name` - The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. - pub fn notification_channels_delete(&self, name: &str) -> ProjectNotificationChannelDeleteCall<'a, C, A> { - ProjectNotificationChannelDeleteCall { - hub: self.hub, - _name: name.to_string(), - _force: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists the monitored resources that are members of a group. /// /// # Arguments /// - /// * `name` - The group whose members are listed. The format is "projects/{project_id_or_number}/groups/{group_id}". + /// * `name` - Required. The group whose members are listed. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// pub fn groups_members_list(&self, name: &str) -> ProjectGroupMemberListCall<'a, C, A> { ProjectGroupMemberListCall { hub: self.hub, @@ -2454,15 +3473,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a single alerting policy. + /// Gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method. /// /// # Arguments /// - /// * `name` - The alerting policy to retrieve. The format is - /// projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + /// * `name` - Required. The channel for which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] /// - pub fn alert_policies_get(&self, name: &str) -> ProjectAlertPolicyGetCall<'a, C, A> { - ProjectAlertPolicyGetCall { + pub fn notification_channels_get(&self, name: &str) -> ProjectNotificationChannelGetCall<'a, C, A> { + ProjectNotificationChannelGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -2473,12 +3492,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new metric descriptor. User-created metric descriptors define custom metrics. + /// Creates a new metric descriptor. User-created metric descriptors define custom metrics (https://cloud.google.com/monitoring/custom-metrics). /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The project on which to execute the request. The format is "projects/{project_id_or_number}". + /// * `name` - Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// pub fn metric_descriptors_create(&self, request: MetricDescriptor, name: &str) -> ProjectMetricDescriptorCreateCall<'a, C, A> { ProjectMetricDescriptorCreateCall { hub: self.hub, @@ -2492,48 +3513,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an existing group. + /// Gets a single monitored resource descriptor. This method does not require a Workspace. /// /// # Arguments /// - /// * `name` - The group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". - pub fn groups_delete(&self, name: &str) -> ProjectGroupDeleteCall<'a, C, A> { - ProjectGroupDeleteCall { - hub: self.hub, - _name: name.to_string(), - _recursive: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the existing valid uptime check configurations for the project, leaving out any invalid configurations. - /// - /// # Arguments - /// - /// * `parent` - The project whose uptime check configurations are listed. The format is projects/[PROJECT_ID]. - pub fn uptime_check_configs_list(&self, parent: &str) -> ProjectUptimeCheckConfigListCall<'a, C, A> { - ProjectUptimeCheckConfigListCall { - hub: self.hub, - _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets a single monitored resource descriptor. This method does not require a Stackdriver account. - /// - /// # Arguments - /// - /// * `name` - The monitored resource descriptor to get. The format is "projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}". The {resource_type} is a predefined type, such as cloudsql_database. + /// * `name` - Required. The monitored resource descriptor to get. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + /// The [RESOURCE_TYPE] is a predefined type, such as cloudsql_database. pub fn monitored_resource_descriptors_get(&self, name: &str) -> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> { ProjectMonitoredResourceDescriptorGetCall { hub: self.hub, @@ -2551,7 +3537,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The notification channel to verify. + /// * `name` - Required. The notification channel to verify. pub fn notification_channels_verify(&self, request: VerifyNotificationChannelRequest, name: &str) -> ProjectNotificationChannelVerifyCall<'a, C, A> { ProjectNotificationChannelVerifyCall { hub: self.hub, @@ -2572,7 +3558,2785 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Returns the list of IPs that checkers run from +/// Update the given ServiceLevelObjective. +/// +/// A builder for the *serviceLevelObjectives.patch* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// use monitoring3::ServiceLevelObjective; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ServiceLevelObjective::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.services().service_level_objectives_patch(req, "name") +/// .update_mask("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct ServiceServiceLevelObjectivePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: ServiceLevelObjective, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceServiceLevelObjectivePatchCall<'a, C, A> {} + +impl<'a, C, A> ServiceServiceLevelObjectivePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceLevelObjective)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.serviceLevelObjectives.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ServiceLevelObjective) -> ServiceServiceLevelObjectivePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Resource name for this ServiceLevelObjective. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ServiceServiceLevelObjectivePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// A set of field paths defining which fields to use for the update. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ServiceServiceLevelObjectivePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceServiceLevelObjectivePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceServiceLevelObjectivePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceServiceLevelObjectivePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Soft delete this Service. +/// +/// A builder for the *delete* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.services().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ServiceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceDeleteCall<'a, C, A> {} + +impl<'a, C, A> ServiceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the Service to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ServiceDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get a ServiceLevelObjective by name. +/// +/// A builder for the *serviceLevelObjectives.get* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.services().service_level_objectives_get("name") +/// .view("ea") +/// .doit(); +/// # } +/// ``` +pub struct ServiceServiceLevelObjectiveGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _view: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceServiceLevelObjectiveGetCall<'a, C, A> {} + +impl<'a, C, A> ServiceServiceLevelObjectiveGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceLevelObjective)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.serviceLevelObjectives.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + for &field in ["alt", "name", "view"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the ServiceLevelObjective to get. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ServiceServiceLevelObjectiveGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// View of the ServiceLevelObjective to return. If DEFAULT, return the ServiceLevelObjective as originally defined. If EXPLICIT and the ServiceLevelObjective is defined in terms of a BasicSli, replace the BasicSli with a RequestBasedSli spelling out how the SLI is computed. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> ServiceServiceLevelObjectiveGetCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceServiceLevelObjectiveGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceServiceLevelObjectiveGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceServiceLevelObjectiveGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List the ServiceLevelObjectives for the given Service. +/// +/// A builder for the *serviceLevelObjectives.list* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.services().service_level_objectives_list("parent") +/// .view("justo") +/// .page_token("justo") +/// .page_size(-34) +/// .filter("et") +/// .doit(); +/// # } +/// ``` +pub struct ServiceServiceLevelObjectiveListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _parent: String, + _view: Option, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceServiceLevelObjectiveListCall<'a, C, A> {} + +impl<'a, C, A> ServiceServiceLevelObjectiveListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListServiceLevelObjectivesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.serviceLevelObjectives.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._view { + params.push(("view", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "view", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+parent}/serviceLevelObjectives"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the parent containing the listed SLOs, either a project or a Monitoring Workspace. The formats are: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ServiceServiceLevelObjectiveListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// View of the ServiceLevelObjectives to return. If DEFAULT, return each ServiceLevelObjective as originally defined. If EXPLICIT and the ServiceLevelObjective is defined in terms of a BasicSli, replace the BasicSli with a RequestBasedSli spelling out how the SLI is computed. + /// + /// Sets the *view* query property to the given value. + pub fn view(mut self, new_value: &str) -> ServiceServiceLevelObjectiveListCall<'a, C, A> { + self._view = Some(new_value.to_string()); + self + } + /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ServiceServiceLevelObjectiveListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// A non-negative number that is the maximum number of results to return. When 0, use default page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ServiceServiceLevelObjectiveListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// A filter specifying what ServiceLevelObjectives to return. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ServiceServiceLevelObjectiveListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceServiceLevelObjectiveListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceServiceLevelObjectiveListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceServiceLevelObjectiveListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a Service. +/// +/// A builder for the *create* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// use monitoring3::Service; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Service::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.services().create(req, "parent") +/// .service_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct ServiceCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: Service, + _parent: String, + _service_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceCreateCall<'a, C, A> {} + +impl<'a, C, A> ServiceCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._service_id { + params.push(("serviceId", value.to_string())); + } + for &field in ["alt", "parent", "serviceId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+parent}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Service) -> ServiceCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the parent workspace. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ServiceCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The Service id to use for this Service. If omitted, an id will be generated instead. Must match the pattern [a-z0-9\-]+ + /// + /// Sets the *service id* query property to the given value. + pub fn service_id(mut self, new_value: &str) -> ServiceCreateCall<'a, C, A> { + self._service_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a ServiceLevelObjective for the given Service. +/// +/// A builder for the *serviceLevelObjectives.create* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// use monitoring3::ServiceLevelObjective; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = ServiceLevelObjective::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.services().service_level_objectives_create(req, "parent") +/// .service_level_objective_id("et") +/// .doit(); +/// # } +/// ``` +pub struct ServiceServiceLevelObjectiveCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: ServiceLevelObjective, + _parent: String, + _service_level_objective_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceServiceLevelObjectiveCreateCall<'a, C, A> {} + +impl<'a, C, A> ServiceServiceLevelObjectiveCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceLevelObjective)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.serviceLevelObjectives.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._service_level_objective_id { + params.push(("serviceLevelObjectiveId", value.to_string())); + } + for &field in ["alt", "parent", "serviceLevelObjectiveId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+parent}/serviceLevelObjectives"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ServiceLevelObjective) -> ServiceServiceLevelObjectiveCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the parent Service. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ServiceServiceLevelObjectiveCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. The ServiceLevelObjective id to use for this ServiceLevelObjective. If omitted, an id will be generated instead. Must match the pattern [a-z0-9\-]+ + /// + /// Sets the *service level objective id* query property to the given value. + pub fn service_level_objective_id(mut self, new_value: &str) -> ServiceServiceLevelObjectiveCreateCall<'a, C, A> { + self._service_level_objective_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceServiceLevelObjectiveCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceServiceLevelObjectiveCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceServiceLevelObjectiveCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Update this Service. +/// +/// A builder for the *patch* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// use monitoring3::Service; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Service::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.services().patch(req, "name") +/// .update_mask("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ServicePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: Service, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServicePatchCall<'a, C, A> {} + +impl<'a, C, A> ServicePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Service) -> ServicePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Resource name for this Service. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ServicePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// A set of field paths defining which fields to use for the update. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ServicePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServicePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServicePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServicePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get the named Service. +/// +/// A builder for the *get* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.services().get("name") +/// .doit(); +/// # } +/// ``` +pub struct ServiceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceGetCall<'a, C, A> {} + +impl<'a, C, A> ServiceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the Service. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ServiceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete the given ServiceLevelObjective. +/// +/// A builder for the *serviceLevelObjectives.delete* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.services().service_level_objectives_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ServiceServiceLevelObjectiveDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceServiceLevelObjectiveDeleteCall<'a, C, A> {} + +impl<'a, C, A> ServiceServiceLevelObjectiveDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.serviceLevelObjectives.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the ServiceLevelObjective to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ServiceServiceLevelObjectiveDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceServiceLevelObjectiveDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceServiceLevelObjectiveDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceServiceLevelObjectiveDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List Services for this workspace. +/// +/// A builder for the *list* method supported by a *service* resource. +/// It is not used directly, but through a `ServiceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.services().list("parent") +/// .page_token("erat") +/// .page_size(-95) +/// .filter("dolor") +/// .doit(); +/// # } +/// ``` +pub struct ServiceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceListCall<'a, C, A> {} + +impl<'a, C, A> ServiceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListServicesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.services.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+parent}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Resource name of the parent containing the listed services, either a project or a Monitoring Workspace. The formats are: + /// projects/[PROJECT_ID_OR_NUMBER] + /// workspaces/[HOST_PROJECT_ID_OR_NUMBER] + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ServiceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ServiceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// A non-negative number that is the maximum number of results to return. When 0, use default page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ServiceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// A filter specifying what Services to return. The filter currently supports the following fields: + /// - `identifier_case` + /// - `app_engine.module_id` + /// - `cloud_endpoints.service` + /// - `cluster_istio.location` + /// - `cluster_istio.cluster_name` + /// - `cluster_istio.service_namespace` + /// - `cluster_istio.service_name` + /// identifier_case refers to which option in the identifier oneof is populated. For example, the filter identifier_case = "CUSTOM" would match all services with a value for the custom field. Valid options are "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ServiceListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ServiceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ServiceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns the list of IP addresses that checkers run from /// /// A builder for the *list* method supported by a *uptimeCheckIp* resource. /// It is not used directly, but through a `UptimeCheckIpMethods` instance. @@ -2600,8 +6364,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.uptime_check_ips().list() -/// .page_token("kasd") -/// .page_size(-22) +/// .page_token("eirmod") +/// .page_size(-43) /// .doit(); /// # } /// ``` @@ -2807,534 +6571,7 @@ impl<'a, C, A> UptimeCheckIpListCall<'a, C, A> where C: BorrowMut } -/// Requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state).There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time. -/// -/// A builder for the *notificationChannels.getVerificationCode* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// use monitoring3::GetNotificationChannelVerificationCodeRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GetNotificationChannelVerificationCodeRequest::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().notification_channels_get_verification_code(req, "name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _request: GetNotificationChannelVerificationCodeRequest, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> {} - -impl<'a, C, A> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GetNotificationChannelVerificationCodeResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.getVerificationCode", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}:getVerificationCode"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: GetNotificationChannelVerificationCodeRequest) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { - self._request = new_value; - self - } - /// The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method. -/// -/// A builder for the *notificationChannels.get* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().notification_channels_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectNotificationChannelGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectNotificationChannelGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectNotificationChannelGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, NotificationChannel)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a single metric descriptor. This method does not require a Stackdriver account. +/// Gets a single metric descriptor. This method does not require a Workspace. /// /// A builder for the *metricDescriptors.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3509,7 +6746,9 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AlertPolicy::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().alert_policies_patch(req, "name") +/// .update_mask("labore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAlertPolicyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: AlertPolicy, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAlertPolicyPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AlertPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.alertPolicies.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AlertPolicy) -> ProjectAlertPolicyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required if the policy exists. The resource name for this policy. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + /// [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAlertPolicyPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Optional. A list of alerting policy field names. If this field is not empty, each listed field in the existing alerting policy is set to the value of the corresponding field in the supplied policy (alert_policy), or to the field's default value if the field is not in the supplied alerting policy. Fields not listed retain their previous value.Examples of valid field masks include display_name, documentation, documentation.content, documentation.mime_type, user_labels, user_label.nameofkey, enabled, conditions, combiner, etc.If this field is empty, then the supplied alerting policy replaces the existing policy. It is the same as deleting the existing policy and adding the supplied policy, except for the following: + /// The new policy will have the same [ALERT_POLICY_ID] as the former policy. This gives you continuity with the former policy in your notifications and incidents. + /// Conditions in the new policy will keep their former [CONDITION_ID] if the supplied condition includes the name field with that [CONDITION_ID]. If the supplied condition omits the name field, then a new [CONDITION_ID] is created. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectAlertPolicyPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAlertPolicyPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAlertPolicyPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAlertPolicyPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service. /// /// A builder for the *notificationChannels.create* method supported by a *project* resource. @@ -3788,9 +7322,9 @@ impl<'a, C, A> ProjectNotificationChannelCreateCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The project on which to execute the request. The format is: - /// projects/[PROJECT_ID] - /// Note that this names the container into which the channel will be written. This does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel. + /// Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel. /// /// Sets the *name* path property to the given value. /// @@ -3863,299 +7397,6 @@ impl<'a, C, A> ProjectNotificationChannelCreateCall<'a, C, A> where C: BorrowMut } -/// Updates a notification channel. Fields not specified in the field mask remain unchanged. -/// -/// A builder for the *notificationChannels.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// use monitoring3::NotificationChannel; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = NotificationChannel::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().notification_channels_patch(req, "name") -/// .update_mask("sea") -/// .doit(); -/// # } -/// ``` -pub struct ProjectNotificationChannelPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _request: NotificationChannel, - _name: String, - _update_mask: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectNotificationChannelPatchCall<'a, C, A> {} - -impl<'a, C, A> ProjectNotificationChannelPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, NotificationChannel)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._update_mask { - params.push(("updateMask", value.to_string())); - } - for &field in ["alt", "name", "updateMask"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: NotificationChannel) -> ProjectNotificationChannelPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The full REST resource name for this channel. The syntax is: - /// projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] - /// The [CHANNEL_ID] is automatically assigned by the server on creation. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelPatchCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The fields to update. - /// - /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectNotificationChannelPatchCall<'a, C, A> { - self._update_mask = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelPatchCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the existing groups. /// /// A builder for the *groups.list* method supported by a *project* resource. @@ -4184,11 +7425,11 @@ impl<'a, C, A> ProjectNotificationChannelPatchCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().groups_list("name") -/// .page_token("dolores") -/// .page_size(-61) -/// .descendants_of_group("sadipscing") -/// .children_of_group("aliquyam") -/// .ancestors_of_group("ea") +/// .page_token("invidunt") +/// .page_size(-82) +/// .descendants_of_group("accusam") +/// .children_of_group("Lorem") +/// .ancestors_of_group("sea") /// .doit(); /// # } /// ``` @@ -4356,7 +7597,9 @@ impl<'a, C, A> ProjectGroupListCall<'a, C, A> where C: BorrowMut, } - /// The project whose groups are to be listed. The format is "projects/{project_id_or_number}". + /// Required. The project whose groups are to be listed. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// /// /// Sets the *name* path property to the given value. /// @@ -4366,7 +7609,7 @@ impl<'a, C, A> ProjectGroupListCall<'a, C, A> where C: BorrowMut, self._name = new_value.to_string(); self } - /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + /// If this field is not empty then it must contain the next_page_token value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { @@ -4380,21 +7623,27 @@ impl<'a, C, A> ProjectGroupListCall<'a, C, A> where C: BorrowMut, self._page_size = Some(new_value); self } - /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns the descendants of the specified group. This is a superset of the results returned by the childrenOfGroup filter, and includes children-of-children, and so forth. + /// A group name. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// Returns the descendants of the specified group. This is a superset of the results returned by the children_of_group filter, and includes children-of-children, and so forth. /// /// Sets the *descendants of group* query property to the given value. pub fn descendants_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { self._descendants_of_group = Some(new_value.to_string()); self } - /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups whose parentName field contains the group name. If no groups have this parent, the results are empty. + /// A group name. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// Returns groups whose parent_name field contains the group name. If no groups have this parent, the results are empty. /// /// Sets the *children of group* query property to the given value. pub fn children_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { self._children_of_group = Some(new_value.to_string()); self } - /// A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. + /// A group name. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. /// /// Sets the *ancestors of group* query property to the given value. pub fn ancestors_of_group(mut self, new_value: &str) -> ProjectGroupListCall<'a, C, A> { @@ -4464,6 +7713,547 @@ impl<'a, C, A> ProjectGroupListCall<'a, C, A> where C: BorrowMut, } +/// Deletes a notification channel. +/// +/// A builder for the *notificationChannels.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().notification_channels_delete("name") +/// .force(false) +/// .doit(); +/// # } +/// ``` +pub struct ProjectNotificationChannelDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _force: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectNotificationChannelDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectNotificationChannelDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._force { + params.push(("force", value.to_string())); + } + for &field in ["alt", "name", "force"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The channel for which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// If true, the notification channel will be deleted regardless of its use in alert policies (the policies will be updated to remove the channel). If false, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation. + /// + /// Sets the *force* query property to the given value. + pub fn force(mut self, new_value: bool) -> ProjectNotificationChannelDeleteCall<'a, C, A> { + self._force = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state).There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time. +/// +/// A builder for the *notificationChannels.getVerificationCode* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// use monitoring3::GetNotificationChannelVerificationCodeRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GetNotificationChannelVerificationCodeRequest::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().notification_channels_get_verification_code(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: GetNotificationChannelVerificationCodeRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> {} + +impl<'a, C, A> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GetNotificationChannelVerificationCodeResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.getVerificationCode", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}:getVerificationCode"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GetNotificationChannelVerificationCodeRequest) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelGetVerificationCodeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a new group. /// /// A builder for the *groups.create* method supported by a *project* resource. @@ -4498,7 +8288,7 @@ impl<'a, C, A> ProjectGroupListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().groups_create(req, "name") -/// .validate_only(true) +/// .validate_only(false) /// .doit(); /// # } /// ``` @@ -4675,7 +8465,9 @@ impl<'a, C, A> ProjectGroupCreateCall<'a, C, A> where C: BorrowMut ProjectGroupGetCall<'a, C, A> where C: BorrowMut, } - /// The group to retrieve. The format is "projects/{project_id_or_number}/groups/{group_id}". + /// Required. The group to retrieve. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// /// /// Sets the *name* path property to the given value. /// @@ -5032,7 +8826,7 @@ impl<'a, C, A> ProjectGroupGetCall<'a, C, A> where C: BorrowMut, /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().notification_channel_descriptors_list("name") /// .page_token("et") -/// .page_size(-41) +/// .page_size(-45) /// .doit(); /// # } /// ``` @@ -5188,8 +8982,8 @@ impl<'a, C, A> ProjectNotificationChannelDescriptorListCall<'a, C, A> where C: B } - /// The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: - /// projects/[PROJECT_ID] + /// Required. The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: + /// projects/[PROJECT_ID_OR_NUMBER] /// Note that this names the parent container in which to look for the descriptors; to retrieve a single descriptor by name, use the GetNotificationChannelDescriptor operation, instead. /// /// Sets the *name* path property to the given value. @@ -5483,7 +9277,9 @@ impl<'a, C, A> ProjectTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorListCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorListCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorListCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorListCall<'a, C, A> where C: BorrowMut ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor } - /// The project on which to execute the request. The format is "projects/{project_id_or_number}". + /// Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// /// /// Sets the *name* path property to the given value. /// @@ -6056,7 +9856,7 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor self._page_size = Some(new_value); self } - /// An optional filter describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: + /// An optional filter (https://cloud.google.com/monitoring/api/v3/filters) describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: /// resource.type = starts_with("gce_") AND resource.label:id /// /// @@ -6128,9 +9928,9 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor } -/// Gets a single uptime check configuration. +/// Queries time series using the time series query language. This method does not require a Workspace. /// -/// A builder for the *uptimeCheckConfigs.get* method supported by a *project* resource. +/// A builder for the *timeSeries.query* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -6142,6 +9942,7 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_monitoring3 as monitoring3; +/// use monitoring3::QueryTimeSeriesRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -6152,30 +9953,36 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = QueryTimeSeriesRequest::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().uptime_check_configs_get("name") +/// let result = hub.projects().time_series_query(req, "name") /// .doit(); /// # } /// ``` -pub struct ProjectUptimeCheckConfigGetCall<'a, C, A> +pub struct ProjectTimeSeryQueryCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, + _request: QueryTimeSeriesRequest, _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectTimeSeryQueryCall<'a, C, A> {} -impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectTimeSeryQueryCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, UptimeCheckConfig)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, QueryTimeSeriesResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -6184,9 +9991,9 @@ impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "monitoring.projects.uptimeCheckConfigs.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "monitoring.projects.timeSeries.query", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { @@ -6200,7 +10007,7 @@ impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut ProjectTimeSeryQueryCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project on which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectUptimeCheckConfigGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectTimeSeryQueryCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -6319,7 +10152,7 @@ impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectTimeSeryQueryCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6344,7 +10177,7 @@ impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectUptimeCheckConfigGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectTimeSeryQueryCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6364,7 +10197,7 @@ impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectUptimeCheckConfigGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectTimeSeryQueryCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6551,7 +10384,9 @@ impl<'a, C, A> ProjectNotificationChannelDescriptorGetCall<'a, C, A> where C: Bo } - /// The channel type for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}. + /// Required. The channel type for which to execute the request. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + /// /// /// Sets the *name* path property to the given value. /// @@ -6624,7 +10459,269 @@ impl<'a, C, A> ProjectNotificationChannelDescriptorGetCall<'a, C, A> where C: Bo } -/// Lists time series that match a filter. This method does not require a Stackdriver account. +/// Deletes an existing group. +/// +/// A builder for the *groups.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().groups_delete("name") +/// .recursive(true) +/// .doit(); +/// # } +/// ``` +pub struct ProjectGroupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _recursive: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGroupDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectGroupDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.groups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._recursive { + params.push(("recursive", value.to_string())); + } + for &field in ["alt", "name", "recursive"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The group to delete. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectGroupDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// If this field is true, then the request means to delete a group with all its descendants. Otherwise, the request means to delete a group only when it has no descendants. The default value is false. + /// + /// Sets the *recursive* query property to the given value. + pub fn recursive(mut self, new_value: bool) -> ProjectGroupDeleteCall<'a, C, A> { + self._recursive = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGroupDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGroupDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGroupDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists time series that match a filter. This method does not require a Workspace. /// /// A builder for the *timeSeries.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -6652,17 +10749,17 @@ impl<'a, C, A> ProjectNotificationChannelDescriptorGetCall<'a, C, A> where C: Bo /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().time_series_list("name") -/// .view("elitr") -/// .page_token("amet") -/// .page_size(-60) -/// .order_by("labore") -/// .interval_start_time("eirmod") -/// .interval_end_time("dolore") -/// .filter("invidunt") -/// .aggregation_per_series_aligner("aliquyam") -/// .add_aggregation_group_by_fields("accusam") -/// .aggregation_cross_series_reducer("Lorem") -/// .aggregation_alignment_period("sea") +/// .view("vero") +/// .page_token("diam") +/// .page_size(-66) +/// .order_by("consetetur") +/// .interval_start_time("sadipscing") +/// .interval_end_time("vero") +/// .filter("sadipscing") +/// .aggregation_per_series_aligner("invidunt") +/// .add_aggregation_group_by_fields("consetetur") +/// .aggregation_cross_series_reducer("dolore") +/// .aggregation_alignment_period("duo") /// .doit(); /// # } /// ``` @@ -6856,7 +10953,9 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> { @@ -6887,7 +10986,7 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> { @@ -6908,7 +11007,7 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> { self._aggregation_per_series_aligner = Some(new_value.to_string()); self } - /// The set of fields to preserve when crossSeriesReducer is specified. The groupByFields determine how the time series are partitioned into subsets prior to applying the aggregation function. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The crossSeriesReducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in groupByFields are aggregated away. If groupByFields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If crossSeriesReducer is not defined, this field is ignored. + /// The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored. /// /// Append the given value to the *aggregation.group by fields* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -6932,14 +11031,14 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> { self._aggregation_cross_series_reducer = Some(new_value.to_string()); self } - /// The alignment period for per-time series alignment. If present, alignmentPeriod must be at least 60 seconds. After per-time series alignment, each time series will contain data points only on the period boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, then this field is ignored. If perSeriesAligner is specified and does not equal ALIGN_NONE, then this field must be defined; otherwise an error is returned. + /// The alignment_period specifies a time interval, in seconds, that is used to divide the data in all the time series into consistent blocks of time. This will be done before the per-series aligner can be applied to the data.The value must be at least 60 seconds. If a per-series aligner other than ALIGN_NONE is specified, this field is required or an error is returned. If no per-series aligner is specified, or the aligner ALIGN_NONE is specified, then this field is ignored. /// /// Sets the *aggregation.alignment period* query property to the given value. pub fn aggregation_alignment_period(mut self, new_value: &str) -> ProjectTimeSeryListCall<'a, C, A> { @@ -7037,10 +11136,10 @@ impl<'a, C, A> ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyListCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyListCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// If provided, this field specifies the criteria that must be met by alert policies to be included in the response.For more details, see sorting and filtering. + /// If provided, this field specifies the criteria that must be met by alert policies to be included in the response.For more details, see sorting and filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectAlertPolicyListCall<'a, C, A> { @@ -7307,7 +11406,7 @@ impl<'a, C, A> ProjectAlertPolicyListCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().uptime_check_configs_list("parent") +/// .page_token("kasd") +/// .page_size(-7) +/// .doit(); +/// # } +/// ``` +pub struct ProjectUptimeCheckConfigListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigListCall<'a, C, A> {} + +impl<'a, C, A> ProjectUptimeCheckConfigListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListUptimeCheckConfigsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.uptimeCheckConfigs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+parent}/uptimeCheckConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The project whose Uptime check configurations are listed. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectUptimeCheckConfigListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectUptimeCheckConfigListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Stackdriver Monitoring Agent only: Creates a new time series. /// /// A builder for the *collectdTimeSeries.create* method supported by a *project* resource. @@ -7761,7 +12136,9 @@ impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut +pub struct ProjectNotificationChannelPatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, - _request: AlertPolicy, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectAlertPolicyCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectAlertPolicyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AlertPolicy)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.alertPolicies.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}/alertPolicies"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: AlertPolicy) -> ProjectAlertPolicyCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The project in which to create the alerting policy. The format is projects/[PROJECT_ID].Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[POLICY_ID], identifying the policy in the container. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAlertPolicyCreateCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAlertPolicyCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectAlertPolicyCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectAlertPolicyCreateCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Updates an alerting policy. You can either replace the entire policy with a new one or replace only certain fields in the current alerting policy by specifying the fields to be updated via updateMask. Returns the updated alerting policy. -/// -/// A builder for the *alertPolicies.patch* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// use monitoring3::AlertPolicy; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AlertPolicy::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().alert_policies_patch(req, "name") -/// .update_mask("ut") -/// .doit(); -/// # } -/// ``` -pub struct ProjectAlertPolicyPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _request: AlertPolicy, + _request: NotificationChannel, _name: String, _update_mask: Option, _delegate: Option<&'a mut dyn Delegate>, @@ -8163,13 +12261,13 @@ pub struct ProjectAlertPolicyPatchCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAlertPolicyPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectNotificationChannelPatchCall<'a, C, A> {} -impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectNotificationChannelPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AlertPolicy)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, NotificationChannel)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -8178,7 +12276,7 @@ impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "monitoring.projects.alertPolicies.patch", + dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.patch", http_method: hyper::method::Method::Patch }); let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -8320,28 +12418,26 @@ impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyPatchCall<'a, C, A> { + pub fn request(mut self, new_value: NotificationChannel) -> ProjectNotificationChannelPatchCall<'a, C, A> { self._request = new_value; self } - /// Required if the policy exists. The resource name for this policy. The syntax is: - /// projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - /// [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. + /// The full REST resource name for this channel. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + /// The [CHANNEL_ID] is automatically assigned by the server on creation. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectAlertPolicyPatchCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelPatchCall<'a, C, A> { self._name = new_value.to_string(); self } - /// Optional. A list of alerting policy field names. If this field is not empty, each listed field in the existing alerting policy is set to the value of the corresponding field in the supplied policy (alert_policy), or to the field's default value if the field is not in the supplied alerting policy. Fields not listed retain their previous value.Examples of valid field masks include display_name, documentation, documentation.content, documentation.mime_type, user_labels, user_label.nameofkey, enabled, conditions, combiner, etc.If this field is empty, then the supplied alerting policy replaces the existing policy. It is the same as deleting the existing policy and adding the supplied policy, except for the following: - /// The new policy will have the same [ALERT_POLICY_ID] as the former policy. This gives you continuity with the former policy in your notifications and incidents. - /// Conditions in the new policy will keep their former [CONDITION_ID] if the supplied condition includes the name field with that [CONDITION_ID]. If the supplied condition omits the name field, then a new [CONDITION_ID] is created. + /// The fields to update. /// /// Sets the *update mask* query property to the given value. - pub fn update_mask(mut self, new_value: &str) -> ProjectAlertPolicyPatchCall<'a, C, A> { + pub fn update_mask(mut self, new_value: &str) -> ProjectNotificationChannelPatchCall<'a, C, A> { self._update_mask = Some(new_value.to_string()); self } @@ -8351,7 +12447,7 @@ impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8376,7 +12472,7 @@ impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAlertPolicyPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8396,7 +12492,257 @@ impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAlertPolicyPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets a single alerting policy. +/// +/// A builder for the *alertPolicies.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_monitoring3 as monitoring3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use monitoring3::Monitoring; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().alert_policies_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAlertPolicyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAlertPolicyGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AlertPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.alertPolicies.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The alerting policy to retrieve. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAlertPolicyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAlertPolicyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAlertPolicyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAlertPolicyGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8436,10 +12782,10 @@ impl<'a, C, A> ProjectAlertPolicyPatchCall<'a, C, A> where C: BorrowMut ProjectNotificationChannelListCall<'a, C, A> where C: BorrowMut ProjectNotificationChannelListCall<'a, C, A> where C: BorrowMut ProjectNotificationChannelListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// If provided, this field specifies the criteria that must be met by notification channels to be included in the response.For more details, see sorting and filtering. + /// If provided, this field specifies the criteria that must be met by notification channels to be included in the response.For more details, see sorting and filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectNotificationChannelListCall<'a, C, A> { @@ -8915,7 +13263,9 @@ impl<'a, C, A> ProjectGroupUpdateCall<'a, C, A> where C: BorrowMut ProjectGroupUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().uptime_check_configs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectUptimeCheckConfigGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectUptimeCheckConfigGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UptimeCheckConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.uptimeCheckConfigs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The Uptime check configuration to retrieve. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + /// + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectUptimeCheckConfigGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectUptimeCheckConfigGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectUptimeCheckConfigGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Causes a verification code to be delivered to the channel. The code can then be supplied in VerifyNotificationChannel to verify the channel. /// /// A builder for the *notificationChannels.sendVerificationCode* method supported by a *project* resource. @@ -9201,7 +13801,7 @@ impl<'a, C, A> ProjectNotificationChannelSendVerificationCodeCall<'a, C, A> wher self._request = new_value; self } - /// The notification channel to which to send a verification code. + /// Required. The notification channel to which to send a verification code. /// /// Sets the *name* path property to the given value. /// @@ -9274,7 +13874,7 @@ impl<'a, C, A> ProjectNotificationChannelSendVerificationCodeCall<'a, C, A> wher } -/// Updates an uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via "updateMask". Returns the updated configuration. +/// Updates an Uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via updateMask. Returns the updated configuration. /// /// A builder for the *uptimeCheckConfigs.patch* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -9308,7 +13908,7 @@ impl<'a, C, A> ProjectNotificationChannelSendVerificationCodeCall<'a, C, A> wher /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().uptime_check_configs_patch(req, "name") -/// .update_mask("Lorem") +/// .update_mask("labore") /// .doit(); /// # } /// ``` @@ -9485,7 +14085,9 @@ impl<'a, C, A> ProjectUptimeCheckConfigPatchCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigPatchCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigPatchCall<'a, C, A> { @@ -9565,7 +14167,7 @@ impl<'a, C, A> ProjectUptimeCheckConfigPatchCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigCreateCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyDeleteCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AlertPolicy::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().alert_policies_create(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectAlertPolicyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Monitoring, + _request: AlertPolicy, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectAlertPolicyCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectAlertPolicyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AlertPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "monitoring.projects.alertPolicies.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v3/{+name}/alertPolicies"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AlertPolicy) -> ProjectAlertPolicyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project in which to create the alerting policy. The format is: + /// projects/[PROJECT_ID_OR_NUMBER] + /// Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the policy in the container. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectAlertPolicyCreateCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectAlertPolicyCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectAlertPolicyCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectAlertPolicyCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Deletes an Uptime check configuration. Note that this method will fail if the Uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion. /// /// A builder for the *uptimeCheckConfigs.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -10269,7 +15154,9 @@ impl<'a, C, A> ProjectUptimeCheckConfigDeleteCall<'a, C, A> where C: BorrowMut ProjectUptimeCheckConfigDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().notification_channels_delete("name") -/// .force(true) -/// .doit(); -/// # } -/// ``` -pub struct ProjectNotificationChannelDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _force: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectNotificationChannelDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectNotificationChannelDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._force { - params.push(("force", value.to_string())); - } - for &field in ["alt", "name", "force"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// If true, the notification channel will be deleted regardless of its use in alert policies (the policies will be updated to remove the channel). If false, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation. - /// - /// Sets the *force* query property to the given value. - pub fn force(mut self, new_value: bool) -> ProjectNotificationChannelDeleteCall<'a, C, A> { - self._force = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists the monitored resources that are members of a group. /// /// A builder for the *groups.members.list* method supported by a *project* resource. @@ -10630,11 +15257,11 @@ impl<'a, C, A> ProjectNotificationChannelDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().groups_members_list("name") -/// .page_token("consetetur") -/// .page_size(-44) -/// .interval_start_time("vero") -/// .interval_end_time("sadipscing") -/// .filter("invidunt") +/// .page_token("tempor") +/// .page_size(-59) +/// .interval_start_time("labore") +/// .interval_end_time("ipsum") +/// .filter("aliquyam") /// .doit(); /// # } /// ``` @@ -10802,7 +15429,9 @@ impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> { @@ -10840,8 +15469,8 @@ impl<'a, C, A> ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut +pub struct ProjectNotificationChannelGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, @@ -10953,13 +15582,13 @@ pub struct ProjectAlertPolicyGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectAlertPolicyGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectNotificationChannelGetCall<'a, C, A> {} -impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectNotificationChannelGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AlertPolicy)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, NotificationChannel)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -10968,7 +15597,7 @@ impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "monitoring.projects.alertPolicies.get", + dlg.begin(MethodInfo { id: "monitoring.projects.notificationChannels.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -11087,15 +15716,15 @@ impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectNotificationChannelGetCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -11105,7 +15734,7 @@ impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut ProjectAlertPolicyGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectNotificationChannelGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -11130,7 +15759,7 @@ impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectAlertPolicyGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectNotificationChannelGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -11150,7 +15779,7 @@ impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectAlertPolicyGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectNotificationChannelGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -11162,7 +15791,7 @@ impl<'a, C, A> ProjectAlertPolicyGetCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().groups_delete("name") -/// .recursive(false) -/// .doit(); -/// # } -/// ``` -pub struct ProjectGroupDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _name: String, - _recursive: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectGroupDeleteCall<'a, C, A> {} - -impl<'a, C, A> ProjectGroupDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.groups.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - if let Some(value) = self._recursive { - params.push(("recursive", value.to_string())); - } - for &field in ["alt", "name", "recursive"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectGroupDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// If this field is true, then the request means to delete a group with all its descendants. Otherwise, the request means to delete a group only when it has no descendants. The default value is false. - /// - /// Sets the *recursive* query property to the given value. - pub fn recursive(mut self, new_value: bool) -> ProjectGroupDeleteCall<'a, C, A> { - self._recursive = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectGroupDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectGroupDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectGroupDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Lists the existing valid uptime check configurations for the project, leaving out any invalid configurations. -/// -/// A builder for the *uptimeCheckConfigs.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_monitoring3 as monitoring3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use monitoring3::Monitoring; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Monitoring::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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().uptime_check_configs_list("parent") -/// .page_token("et") -/// .page_size(-13) -/// .doit(); -/// # } -/// ``` -pub struct ProjectUptimeCheckConfigListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Monitoring, - _parent: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectUptimeCheckConfigListCall<'a, C, A> {} - -impl<'a, C, A> ProjectUptimeCheckConfigListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListUptimeCheckConfigsResponse)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "monitoring.projects.uptimeCheckConfigs.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v3/{+parent}/uptimeCheckConfigs"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The project whose uptime check configurations are listed. The format is projects/[PROJECT_ID]. - /// - /// Sets the *parent* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectUptimeCheckConfigListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectUptimeCheckConfigListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectUptimeCheckConfigListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectUptimeCheckConfigListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectUptimeCheckConfigListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectUptimeCheckConfigListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Gets a single monitored resource descriptor. This method does not require a Stackdriver account. +/// Gets a single monitored resource descriptor. This method does not require a Workspace. /// /// A builder for the *monitoredResourceDescriptors.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -12148,7 +16247,9 @@ impl<'a, C, A> ProjectMonitoredResourceDescriptorGetCall<'a, C, A> where C: Borr } - /// The monitored resource descriptor to get. The format is "projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}". The {resource_type} is a predefined type, such as cloudsql_database. + /// Required. The monitored resource descriptor to get. The format is: + /// projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] + /// The [RESOURCE_TYPE] is a predefined type, such as cloudsql_database. /// /// Sets the *name* path property to the given value. /// @@ -12427,7 +16528,7 @@ impl<'a, C, A> ProjectNotificationChannelVerifyCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The notification channel to verify. + /// Required. The notification channel to verify. /// /// Sets the *name* path property to the given value. /// diff --git a/gen/mybusiness4-cli/Cargo.toml b/gen/mybusiness4-cli/Cargo.toml index 98b96f8355..bec52b17ed 100644 --- a/gen/mybusiness4-cli/Cargo.toml +++ b/gen/mybusiness4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mybusiness4-cli" -version = "1.0.12+0" +version = "1.0.13+0" authors = ["Sebastian Thiel "] description = "A complete library to interact with My Business (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mybusiness4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-mybusiness4] path = "../mybusiness4" -version = "1.0.12+0" +version = "1.0.13+0" diff --git a/gen/mybusiness4-cli/README.md b/gen/mybusiness4-cli/README.md index 65edcbff93..d3a19c8c54 100644 --- a/gen/mybusiness4-cli/README.md +++ b/gen/mybusiness4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *My Business* API at revision *0*. The CLI is at version *1.0.12*. +This documentation was generated from the *My Business* API at revision *0*. The CLI is at version *1.0.13*. ```bash mybusiness4 [options] diff --git a/gen/mybusiness4-cli/mkdocs.yml b/gen/mybusiness4-cli/mkdocs.yml index a2c7352f28..1eebc40d51 100644 --- a/gen/mybusiness4-cli/mkdocs.yml +++ b/gen/mybusiness4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: My Business v1.0.12+0 +site_name: My Business v1.0.13+0 site_url: http://byron.github.io/google-apis-rs/google-mybusiness4-cli site_description: A complete library to interact with My Business (protocol v4) diff --git a/gen/mybusiness4-cli/src/main.rs b/gen/mybusiness4-cli/src/main.rs index 4ddf97fb5a..1f2f0cb1fe 100644 --- a/gen/mybusiness4-cli/src/main.rs +++ b/gen/mybusiness4-cli/src/main.rs @@ -71,8 +71,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "pending-invitation" => Some(("pendingInvitation", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "admin-name" => Some(("adminName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["admin-name", "name", "pending-invitation", "role"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -254,8 +254,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "pending-invitation" => Some(("pendingInvitation", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "admin-name" => Some(("adminName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["admin-name", "name", "pending-invitation", "role"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -345,7 +345,7 @@ impl<'n> Engine<'n> { "state.vetted-status" => Some(("state.vettedStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile-photo-url" => Some(("profilePhotoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "organization-info.phone-number" => Some(("organizationInfo.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "organization-info.registered-domain" => Some(("organizationInfo.registeredDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.language-code" => Some(("organizationInfo.postalAddress.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.recipients" => Some(("organizationInfo.postalAddress.recipients", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "organization-info.postal-address.locality" => Some(("organizationInfo.postalAddress.locality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -357,7 +357,7 @@ impl<'n> Engine<'n> { "organization-info.postal-address.organization" => Some(("organizationInfo.postalAddress.organization", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.sublocality" => Some(("organizationInfo.postalAddress.sublocality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.revision" => Some(("organizationInfo.postalAddress.revision", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "organization-info.registered-domain" => Some(("organizationInfo.registeredDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "organization-info.phone-number" => Some(("organizationInfo.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["account-name", "account-number", "address-lines", "administrative-area", "language-code", "locality", "name", "organization", "organization-info", "permission-level", "phone-number", "postal-address", "postal-code", "profile-photo-url", "recipients", "region-code", "registered-domain", "revision", "role", "sorting-code", "state", "status", "sublocality", "type", "vetted-status"]); @@ -1007,8 +1007,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "pending-invitation" => Some(("pendingInvitation", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "admin-name" => Some(("adminName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["admin-name", "name", "pending-invitation", "role"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1190,8 +1190,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "pending-invitation" => Some(("pendingInvitation", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "admin-name" => Some(("adminName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["admin-name", "name", "pending-invitation", "role"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1606,11 +1606,11 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "profile.description" => Some(("profile.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "open-info.status" => Some(("openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-info.can-reopen" => Some(("openInfo.canReopen", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "open-info.opening-date.month" => Some(("openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "open-info.opening-date.day" => Some(("openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "open-info.status" => Some(("openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-info.opening-date.year" => Some(("openInfo.openingDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "open-info.opening-date.day" => Some(("openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "open-info.opening-date.month" => Some(("openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "location-state.can-update" => Some(("locationState.canUpdate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location-state.can-delete" => Some(("locationState.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location-state.is-disabled" => Some(("locationState.isDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1655,8 +1655,8 @@ impl<'n> Engine<'n> { "additional-phones" => Some(("additionalPhones", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "relationship-data.parent-chain" => Some(("relationshipData.parentChain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.new-review-url" => Some(("metadata.newReviewUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "metadata.duplicate.location-name" => Some(("metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.duplicate.access" => Some(("metadata.duplicate.access", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.duplicate.location-name" => Some(("metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.duplicate.place-id" => Some(("metadata.duplicate.placeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.maps-url" => Some(("metadata.mapsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary-category.display-name" => Some(("primaryCategory.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2188,41 +2188,41 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "event.schedule.start-date.month" => Some(("event.schedule.startDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-date.day" => Some(("event.schedule.startDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-date.year" => Some(("event.schedule.startDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.hours" => Some(("event.schedule.endTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.seconds" => Some(("event.schedule.endTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.minutes" => Some(("event.schedule.endTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.nanos" => Some(("event.schedule.endTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-date.month" => Some(("event.schedule.endDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-date.day" => Some(("event.schedule.endDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-date.year" => Some(("event.schedule.endDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.hours" => Some(("event.schedule.startTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.seconds" => Some(("event.schedule.startTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.minutes" => Some(("event.schedule.startTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.nanos" => Some(("event.schedule.startTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.title" => Some(("event.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.upper-price.nanos" => Some(("product.upperPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "product.upper-price.units" => Some(("product.upperPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.upper-price.currency-code" => Some(("product.upperPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.lower-price.nanos" => Some(("product.lowerPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "product.lower-price.units" => Some(("product.lowerPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.lower-price.currency-code" => Some(("product.lowerPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.product-name" => Some(("product.productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "topic-type" => Some(("topicType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "offer.terms-conditions" => Some(("offer.termsConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "offer.redeem-online-url" => Some(("offer.redeemOnlineUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "offer.coupon-code" => Some(("offer.couponCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.upper-price.units" => Some(("product.upperPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.upper-price.nanos" => Some(("product.upperPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "product.upper-price.currency-code" => Some(("product.upperPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.lower-price.units" => Some(("product.lowerPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.lower-price.nanos" => Some(("product.lowerPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "product.lower-price.currency-code" => Some(("product.lowerPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.product-name" => Some(("product.productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-url" => Some(("searchUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "summary" => Some(("summary", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "call-to-action.url" => Some(("callToAction.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "call-to-action.action-type" => Some(("callToAction.actionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event.title" => Some(("event.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event.schedule.start-date.year" => Some(("event.schedule.startDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-date.day" => Some(("event.schedule.startDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-date.month" => Some(("event.schedule.startDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.hours" => Some(("event.schedule.endTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.nanos" => Some(("event.schedule.endTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.minutes" => Some(("event.schedule.endTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.seconds" => Some(("event.schedule.endTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-date.year" => Some(("event.schedule.endDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-date.day" => Some(("event.schedule.endDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-date.month" => Some(("event.schedule.endDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.hours" => Some(("event.schedule.startTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.nanos" => Some(("event.schedule.startTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.minutes" => Some(("event.schedule.startTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.seconds" => Some(("event.schedule.startTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action-type", "call-to-action", "coupon-code", "create-time", "currency-code", "day", "end-date", "end-time", "event", "hours", "language-code", "lower-price", "minutes", "month", "name", "nanos", "offer", "product", "product-name", "redeem-online-url", "schedule", "search-url", "seconds", "start-date", "start-time", "state", "summary", "terms-conditions", "title", "topic-type", "units", "update-time", "upper-price", "url", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2458,41 +2458,41 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "event.schedule.start-date.month" => Some(("event.schedule.startDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-date.day" => Some(("event.schedule.startDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-date.year" => Some(("event.schedule.startDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.hours" => Some(("event.schedule.endTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.seconds" => Some(("event.schedule.endTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.minutes" => Some(("event.schedule.endTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-time.nanos" => Some(("event.schedule.endTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-date.month" => Some(("event.schedule.endDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-date.day" => Some(("event.schedule.endDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.end-date.year" => Some(("event.schedule.endDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.hours" => Some(("event.schedule.startTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.seconds" => Some(("event.schedule.startTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.minutes" => Some(("event.schedule.startTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.schedule.start-time.nanos" => Some(("event.schedule.startTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "event.title" => Some(("event.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.upper-price.nanos" => Some(("product.upperPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "product.upper-price.units" => Some(("product.upperPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.upper-price.currency-code" => Some(("product.upperPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.lower-price.nanos" => Some(("product.lowerPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "product.lower-price.units" => Some(("product.lowerPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.lower-price.currency-code" => Some(("product.lowerPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product.product-name" => Some(("product.productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "topic-type" => Some(("topicType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "offer.terms-conditions" => Some(("offer.termsConditions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "offer.redeem-online-url" => Some(("offer.redeemOnlineUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "offer.coupon-code" => Some(("offer.couponCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.upper-price.units" => Some(("product.upperPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.upper-price.nanos" => Some(("product.upperPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "product.upper-price.currency-code" => Some(("product.upperPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.lower-price.units" => Some(("product.lowerPrice.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.lower-price.nanos" => Some(("product.lowerPrice.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "product.lower-price.currency-code" => Some(("product.lowerPrice.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "product.product-name" => Some(("product.productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "search-url" => Some(("searchUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "summary" => Some(("summary", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "call-to-action.url" => Some(("callToAction.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "call-to-action.action-type" => Some(("callToAction.actionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event.title" => Some(("event.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event.schedule.start-date.year" => Some(("event.schedule.startDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-date.day" => Some(("event.schedule.startDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-date.month" => Some(("event.schedule.startDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.hours" => Some(("event.schedule.endTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.nanos" => Some(("event.schedule.endTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.minutes" => Some(("event.schedule.endTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-time.seconds" => Some(("event.schedule.endTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-date.year" => Some(("event.schedule.endDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-date.day" => Some(("event.schedule.endDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.end-date.month" => Some(("event.schedule.endDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.hours" => Some(("event.schedule.startTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.nanos" => Some(("event.schedule.startTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.minutes" => Some(("event.schedule.startTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "event.schedule.start-time.seconds" => Some(("event.schedule.startTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["action-type", "call-to-action", "coupon-code", "create-time", "currency-code", "day", "end-date", "end-time", "event", "hours", "language-code", "lower-price", "minutes", "month", "name", "nanos", "offer", "product", "product-name", "redeem-online-url", "schedule", "search-url", "seconds", "start-date", "start-time", "state", "summary", "terms-conditions", "title", "topic-type", "units", "update-time", "upper-price", "url", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2668,17 +2668,17 @@ impl<'n> Engine<'n> { "attribution.profile-name" => Some(("attribution.profileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attribution.takedown-url" => Some(("attribution.takedownUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attribution.profile-photo-url" => Some(("attribution.profilePhotoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "google-url" => Some(("googleUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "insights.view-count" => Some(("insights.viewCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "media-format" => Some(("mediaFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dimensions.width-pixels" => Some(("dimensions.widthPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "dimensions.height-pixels" => Some(("dimensions.heightPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "thumbnail-url" => Some(("thumbnailUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-url" => Some(("googleUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "media-format" => Some(("mediaFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "insights.view-count" => Some(("insights.viewCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "location-association.category" => Some(("locationAssociation.category", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location-association.price-list-item-id" => Some(("locationAssociation.priceListItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "dimensions.width-pixels" => Some(("dimensions.widthPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "dimensions.height-pixels" => Some(("dimensions.heightPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["attribution", "category", "create-time", "data-ref", "description", "dimensions", "google-url", "height-pixels", "insights", "location-association", "media-format", "name", "price-list-item-id", "profile-name", "profile-photo-url", "profile-url", "resource-name", "source-url", "takedown-url", "thumbnail-url", "view-count", "width-pixels"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3025,17 +3025,17 @@ impl<'n> Engine<'n> { "attribution.profile-name" => Some(("attribution.profileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attribution.takedown-url" => Some(("attribution.takedownUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "attribution.profile-photo-url" => Some(("attribution.profilePhotoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "google-url" => Some(("googleUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "insights.view-count" => Some(("insights.viewCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "media-format" => Some(("mediaFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dimensions.width-pixels" => Some(("dimensions.widthPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "dimensions.height-pixels" => Some(("dimensions.heightPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "thumbnail-url" => Some(("thumbnailUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "google-url" => Some(("googleUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "media-format" => Some(("mediaFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "insights.view-count" => Some(("insights.viewCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "location-association.category" => Some(("locationAssociation.category", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location-association.price-list-item-id" => Some(("locationAssociation.priceListItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "dimensions.width-pixels" => Some(("dimensions.widthPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "dimensions.height-pixels" => Some(("dimensions.heightPixels", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["attribution", "category", "create-time", "data-ref", "description", "dimensions", "google-url", "height-pixels", "insights", "location-association", "media-format", "name", "price-list-item-id", "profile-name", "profile-photo-url", "profile-url", "resource-name", "source-url", "takedown-url", "thumbnail-url", "view-count", "width-pixels"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3204,11 +3204,11 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "profile.description" => Some(("profile.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "open-info.status" => Some(("openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-info.can-reopen" => Some(("openInfo.canReopen", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "open-info.opening-date.month" => Some(("openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "open-info.opening-date.day" => Some(("openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "open-info.status" => Some(("openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-info.opening-date.year" => Some(("openInfo.openingDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "open-info.opening-date.day" => Some(("openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "open-info.opening-date.month" => Some(("openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "location-state.can-update" => Some(("locationState.canUpdate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location-state.can-delete" => Some(("locationState.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location-state.is-disabled" => Some(("locationState.isDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -3253,8 +3253,8 @@ impl<'n> Engine<'n> { "additional-phones" => Some(("additionalPhones", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "relationship-data.parent-chain" => Some(("relationshipData.parentChain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.new-review-url" => Some(("metadata.newReviewUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "metadata.duplicate.location-name" => Some(("metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.duplicate.access" => Some(("metadata.duplicate.access", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.duplicate.location-name" => Some(("metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.duplicate.place-id" => Some(("metadata.duplicate.placeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metadata.maps-url" => Some(("metadata.mapsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "primary-category.display-name" => Some(("primaryCategory.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4494,7 +4494,7 @@ impl<'n> Engine<'n> { "state.vetted-status" => Some(("state.vettedStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "profile-photo-url" => Some(("profilePhotoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "role" => Some(("role", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "organization-info.phone-number" => Some(("organizationInfo.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "organization-info.registered-domain" => Some(("organizationInfo.registeredDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.language-code" => Some(("organizationInfo.postalAddress.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.recipients" => Some(("organizationInfo.postalAddress.recipients", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "organization-info.postal-address.locality" => Some(("organizationInfo.postalAddress.locality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -4506,7 +4506,7 @@ impl<'n> Engine<'n> { "organization-info.postal-address.organization" => Some(("organizationInfo.postalAddress.organization", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.sublocality" => Some(("organizationInfo.postalAddress.sublocality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "organization-info.postal-address.revision" => Some(("organizationInfo.postalAddress.revision", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "organization-info.registered-domain" => Some(("organizationInfo.registeredDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "organization-info.phone-number" => Some(("organizationInfo.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["account-name", "account-number", "address-lines", "administrative-area", "language-code", "locality", "name", "organization", "organization-info", "permission-level", "phone-number", "postal-address", "postal-code", "profile-photo-url", "recipients", "region-code", "registered-domain", "revision", "role", "sorting-code", "state", "status", "sublocality", "type", "vetted-status"]); @@ -4594,8 +4594,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "notification-types" => Some(("notificationTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "topic-name" => Some(("topicName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification-types" => Some(("notificationTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["name", "notification-types", "topic-name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -5005,11 +5005,11 @@ impl<'n> Engine<'n> { "result-count" => Some(("resultCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "location.profile.description" => Some(("location.profile.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.language-code" => Some(("location.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location.open-info.status" => Some(("location.openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.open-info.can-reopen" => Some(("location.openInfo.canReopen", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "location.open-info.opening-date.month" => Some(("location.openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "location.open-info.opening-date.day" => Some(("location.openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "location.open-info.status" => Some(("location.openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.open-info.opening-date.year" => Some(("location.openInfo.openingDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "location.open-info.opening-date.day" => Some(("location.openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "location.open-info.opening-date.month" => Some(("location.openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "location.location-state.can-update" => Some(("location.locationState.canUpdate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location.location-state.can-delete" => Some(("location.locationState.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location.location-state.is-disabled" => Some(("location.locationState.isDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -5054,8 +5054,8 @@ impl<'n> Engine<'n> { "location.additional-phones" => Some(("location.additionalPhones", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "location.relationship-data.parent-chain" => Some(("location.relationshipData.parentChain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.new-review-url" => Some(("location.metadata.newReviewUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location.metadata.duplicate.location-name" => Some(("location.metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.duplicate.access" => Some(("location.metadata.duplicate.access", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location.metadata.duplicate.location-name" => Some(("location.metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.duplicate.place-id" => Some(("location.metadata.duplicate.placeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.maps-url" => Some(("location.metadata.mapsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.primary-category.display-name" => Some(("location.primaryCategory.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5144,11 +5144,11 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "location.profile.description" => Some(("location.profile.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.language-code" => Some(("location.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location.open-info.status" => Some(("location.openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.open-info.can-reopen" => Some(("location.openInfo.canReopen", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "location.open-info.opening-date.month" => Some(("location.openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "location.open-info.opening-date.day" => Some(("location.openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "location.open-info.status" => Some(("location.openInfo.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.open-info.opening-date.year" => Some(("location.openInfo.openingDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "location.open-info.opening-date.day" => Some(("location.openInfo.openingDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "location.open-info.opening-date.month" => Some(("location.openInfo.openingDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "location.location-state.can-update" => Some(("location.locationState.canUpdate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location.location-state.can-delete" => Some(("location.locationState.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "location.location-state.is-disabled" => Some(("location.locationState.isDisabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -5193,8 +5193,8 @@ impl<'n> Engine<'n> { "location.additional-phones" => Some(("location.additionalPhones", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "location.relationship-data.parent-chain" => Some(("location.relationshipData.parentChain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.new-review-url" => Some(("location.metadata.newReviewUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location.metadata.duplicate.location-name" => Some(("location.metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.duplicate.access" => Some(("location.metadata.duplicate.access", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location.metadata.duplicate.location-name" => Some(("location.metadata.duplicate.locationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.duplicate.place-id" => Some(("location.metadata.duplicate.placeId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.metadata.maps-url" => Some(("location.metadata.mapsUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location.primary-category.display-name" => Some(("location.primaryCategory.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -7452,7 +7452,7 @@ fn main() { let mut app = App::new("mybusiness4") .author("Sebastian Thiel ") - .version("1.0.12+0") + .version("1.0.13+0") .about("The Google My Business API provides an interface for managing business location information on Google.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_mybusiness4_cli") .arg(Arg::with_name("folder") diff --git a/gen/mybusiness4/Cargo.toml b/gen/mybusiness4/Cargo.toml index 6dbf4ab188..b05b156489 100644 --- a/gen/mybusiness4/Cargo.toml +++ b/gen/mybusiness4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-mybusiness4" -version = "1.0.12+0" +version = "1.0.13+0" authors = ["Sebastian Thiel "] description = "A complete library to interact with My Business (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mybusiness4" homepage = "https://developers.google.com/my-business/" -documentation = "https://docs.rs/google-mybusiness4/1.0.12+0" +documentation = "https://docs.rs/google-mybusiness4/1.0.13+0" license = "MIT" keywords = ["mybusiness", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/mybusiness4/README.md b/gen/mybusiness4/README.md index d32db5289a..b5d69fbb1f 100644 --- a/gen/mybusiness4/README.md +++ b/gen/mybusiness4/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-mybusiness4` library allows access to all features of the *Google My Business* service. -This documentation was generated from *My Business* crate version *1.0.12+0*, where *0* is the exact revision of the *mybusiness:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *My Business* crate version *1.0.13+0*, where *0* is the exact revision of the *mybusiness:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *My Business* *v4* API can be found at the [official documentation site](https://developers.google.com/my-business/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.MyBusiness.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.MyBusiness.html) ... -* [accounts](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.Account.html) - * [*admins create*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountAdminCreateCall.html), [*admins delete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountAdminDeleteCall.html), [*admins list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountAdminListCall.html), [*admins patch*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountAdminPatchCall.html), [*create*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountCreateCall.html), [*delete notifications*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountDeleteNotificationCall.html), [*generate account number*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountGenerateAccountNumberCall.html), [*get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountGetCall.html), [*get notifications*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountGetNotificationCall.html), [*invitations accept*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountInvitationAcceptCall.html), [*invitations decline*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountInvitationDeclineCall.html), [*invitations list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountInvitationListCall.html), [*list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountListCall.html), [*list recommend google locations*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountListRecommendGoogleLocationCall.html), [*locations admins create*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationAdminCreateCall.html), [*locations admins delete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationAdminDeleteCall.html), [*locations admins list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationAdminListCall.html), [*locations admins patch*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationAdminPatchCall.html), [*locations associate*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationAssociateCall.html), [*locations batch get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationBatchGetCall.html), [*locations batch get reviews*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationBatchGetReviewCall.html), [*locations clear association*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationClearAssociationCall.html), [*locations create*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationCreateCall.html), [*locations delete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationDeleteCall.html), [*locations fetch verification options*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationFetchVerificationOptionCall.html), [*locations find matches*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationFindMatcheCall.html), [*locations followers get metadata*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationFollowerGetMetadataCall.html), [*locations get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationGetCall.html), [*locations get google updated*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationGetGoogleUpdatedCall.html), [*locations list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationListCall.html), [*locations local posts create*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationLocalPostCreateCall.html), [*locations local posts delete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationLocalPostDeleteCall.html), [*locations local posts get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationLocalPostGetCall.html), [*locations local posts list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationLocalPostListCall.html), [*locations local posts patch*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationLocalPostPatchCall.html), [*locations local posts report insights*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationLocalPostReportInsightCall.html), [*locations media create*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaCreateCall.html), [*locations media customers get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaCustomerGetCall.html), [*locations media customers list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaCustomerListCall.html), [*locations media delete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaDeleteCall.html), [*locations media get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaGetCall.html), [*locations media list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaListCall.html), [*locations media patch*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaPatchCall.html), [*locations media start upload*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationMediaStartUploadCall.html), [*locations patch*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationPatchCall.html), [*locations questions answers delete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationQuestionAnswerDeleteCall.html), [*locations questions answers list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationQuestionAnswerListCall.html), [*locations questions answers upsert*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationQuestionAnswerUpsertCall.html), [*locations questions create*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationQuestionCreateCall.html), [*locations questions delete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationQuestionDeleteCall.html), [*locations questions list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationQuestionListCall.html), [*locations questions patch*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationQuestionPatchCall.html), [*locations report insights*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationReportInsightCall.html), [*locations reviews delete reply*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationReviewDeleteReplyCall.html), [*locations reviews get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationReviewGetCall.html), [*locations reviews list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationReviewListCall.html), [*locations reviews update reply*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationReviewUpdateReplyCall.html), [*locations transfer*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationTransferCall.html), [*locations verifications complete*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationVerificationCompleteCall.html), [*locations verifications list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationVerificationListCall.html), [*locations verify*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountLocationVerifyCall.html), [*update*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountUpdateCall.html) and [*update notifications*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AccountUpdateNotificationCall.html) -* [attributes](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.Attribute.html) - * [*list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.AttributeListCall.html) -* [categories](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.Category.html) - * [*list*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.CategoryListCall.html) -* [chains](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.Chain.html) - * [*get*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.ChainGetCall.html) and [*search*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.ChainSearchCall.html) -* [google locations](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.GoogleLocation.html) - * [*report*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.GoogleLocationReportCall.html) and [*search*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.GoogleLocationSearchCall.html) -* [verification tokens](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.VerificationToken.html) - * [*generate*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.VerificationTokenGenerateCall.html) +* [accounts](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.Account.html) + * [*admins create*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountAdminCreateCall.html), [*admins delete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountAdminDeleteCall.html), [*admins list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountAdminListCall.html), [*admins patch*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountAdminPatchCall.html), [*create*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountCreateCall.html), [*delete notifications*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountDeleteNotificationCall.html), [*generate account number*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountGenerateAccountNumberCall.html), [*get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountGetCall.html), [*get notifications*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountGetNotificationCall.html), [*invitations accept*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountInvitationAcceptCall.html), [*invitations decline*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountInvitationDeclineCall.html), [*invitations list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountInvitationListCall.html), [*list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountListCall.html), [*list recommend google locations*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountListRecommendGoogleLocationCall.html), [*locations admins create*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationAdminCreateCall.html), [*locations admins delete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationAdminDeleteCall.html), [*locations admins list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationAdminListCall.html), [*locations admins patch*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationAdminPatchCall.html), [*locations associate*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationAssociateCall.html), [*locations batch get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationBatchGetCall.html), [*locations batch get reviews*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationBatchGetReviewCall.html), [*locations clear association*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationClearAssociationCall.html), [*locations create*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationCreateCall.html), [*locations delete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationDeleteCall.html), [*locations fetch verification options*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationFetchVerificationOptionCall.html), [*locations find matches*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationFindMatcheCall.html), [*locations followers get metadata*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationFollowerGetMetadataCall.html), [*locations get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationGetCall.html), [*locations get google updated*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationGetGoogleUpdatedCall.html), [*locations list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationListCall.html), [*locations local posts create*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationLocalPostCreateCall.html), [*locations local posts delete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationLocalPostDeleteCall.html), [*locations local posts get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationLocalPostGetCall.html), [*locations local posts list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationLocalPostListCall.html), [*locations local posts patch*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationLocalPostPatchCall.html), [*locations local posts report insights*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationLocalPostReportInsightCall.html), [*locations media create*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaCreateCall.html), [*locations media customers get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaCustomerGetCall.html), [*locations media customers list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaCustomerListCall.html), [*locations media delete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaDeleteCall.html), [*locations media get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaGetCall.html), [*locations media list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaListCall.html), [*locations media patch*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaPatchCall.html), [*locations media start upload*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationMediaStartUploadCall.html), [*locations patch*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationPatchCall.html), [*locations questions answers delete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationQuestionAnswerDeleteCall.html), [*locations questions answers list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationQuestionAnswerListCall.html), [*locations questions answers upsert*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationQuestionAnswerUpsertCall.html), [*locations questions create*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationQuestionCreateCall.html), [*locations questions delete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationQuestionDeleteCall.html), [*locations questions list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationQuestionListCall.html), [*locations questions patch*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationQuestionPatchCall.html), [*locations report insights*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationReportInsightCall.html), [*locations reviews delete reply*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationReviewDeleteReplyCall.html), [*locations reviews get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationReviewGetCall.html), [*locations reviews list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationReviewListCall.html), [*locations reviews update reply*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationReviewUpdateReplyCall.html), [*locations transfer*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationTransferCall.html), [*locations verifications complete*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationVerificationCompleteCall.html), [*locations verifications list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationVerificationListCall.html), [*locations verify*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountLocationVerifyCall.html), [*update*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountUpdateCall.html) and [*update notifications*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AccountUpdateNotificationCall.html) +* [attributes](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.Attribute.html) + * [*list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.AttributeListCall.html) +* [categories](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.Category.html) + * [*list*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.CategoryListCall.html) +* [chains](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.Chain.html) + * [*get*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.ChainGetCall.html) and [*search*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.ChainSearchCall.html) +* [google locations](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.GoogleLocation.html) + * [*report*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.GoogleLocationReportCall.html) and [*search*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.GoogleLocationSearchCall.html) +* [verification tokens](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.VerificationToken.html) + * [*generate*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.VerificationTokenGenerateCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/struct.MyBusiness.html)** +* **[Hub](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/struct.MyBusiness.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.Part.html)** + * **[Parts](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -70,7 +70,7 @@ let r = hub.accounts().locations_questions_create(...).doit() let r = hub.accounts().locations_media_create(...).doit() let r = hub.accounts().locations_local_posts_get(...).doit() let r = hub.accounts().locations_reviews_update_reply(...).doit() -let r = hub.accounts().locations_list(...).doit() +let r = hub.accounts().list_recommend_google_locations(...).doit() let r = hub.accounts().invitations_decline(...).doit() let r = hub.accounts().locations_questions_list(...).doit() let r = hub.accounts().locations_create(...).doit() @@ -82,14 +82,14 @@ let r = hub.accounts().locations_questions_answers_delete(...).doit() let r = hub.accounts().locations_media_customers_get(...).doit() let r = hub.accounts().list(...).doit() let r = hub.accounts().locations_local_posts_patch(...).doit() -let r = hub.accounts().list_recommend_google_locations(...).doit() +let r = hub.accounts().locations_transfer(...).doit() let r = hub.accounts().locations_reviews_get(...).doit() let r = hub.accounts().locations_local_posts_create(...).doit() let r = hub.accounts().locations_questions_answers_upsert(...).doit() let r = hub.accounts().admins_patch(...).doit() let r = hub.accounts().locations_find_matches(...).doit() let r = hub.accounts().locations_verifications_list(...).doit() -let r = hub.accounts().locations_associate(...).doit() +let r = hub.accounts().locations_list(...).doit() let r = hub.accounts().locations_admins_delete(...).doit() let r = hub.accounts().locations_delete(...).doit() let r = hub.accounts().delete_notifications(...).doit() @@ -107,7 +107,7 @@ let r = hub.accounts().admins_create(...).doit() let r = hub.accounts().locations_admins_create(...).doit() let r = hub.accounts().locations_media_start_upload(...).doit() let r = hub.accounts().locations_report_insights(...).doit() -let r = hub.accounts().locations_transfer(...).doit() +let r = hub.accounts().locations_associate(...).doit() let r = hub.accounts().locations_reviews_list(...).doit() let r = hub.accounts().locations_get(...).doit() let r = hub.accounts().locations_questions_answers_list(...).doit() @@ -173,12 +173,12 @@ let mut hub = MyBusiness::new(hyper::Client::with_connector(hyper::net::HttpsCon // 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.accounts().locations_list("parent") +let result = hub.accounts().locations_questions_list("parent") .page_token("sit") .page_size(-65) .order_by("sed") - .language_code("et") - .filter("dolores") + .filter("et") + .answers_per_question(-18) .doit(); match result { @@ -201,17 +201,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -221,29 +221,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-mybusiness4/1.0.12+0/google_mybusiness4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-mybusiness4/1.0.13+0/google_mybusiness4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/mybusiness4/src/lib.rs b/gen/mybusiness4/src/lib.rs index a0ad1a18c0..57960a2cd0 100644 --- a/gen/mybusiness4/src/lib.rs +++ b/gen/mybusiness4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *My Business* crate version *1.0.12+0*, where *0* is the exact revision of the *mybusiness:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *My Business* crate version *1.0.13+0*, where *0* is the exact revision of the *mybusiness:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *My Business* *v4* API can be found at the //! [official documentation site](https://developers.google.com/my-business/). @@ -70,7 +70,7 @@ //! let r = hub.accounts().locations_media_create(...).doit() //! let r = hub.accounts().locations_local_posts_get(...).doit() //! let r = hub.accounts().locations_reviews_update_reply(...).doit() -//! let r = hub.accounts().locations_list(...).doit() +//! let r = hub.accounts().list_recommend_google_locations(...).doit() //! let r = hub.accounts().invitations_decline(...).doit() //! let r = hub.accounts().locations_questions_list(...).doit() //! let r = hub.accounts().locations_create(...).doit() @@ -82,14 +82,14 @@ //! let r = hub.accounts().locations_media_customers_get(...).doit() //! let r = hub.accounts().list(...).doit() //! let r = hub.accounts().locations_local_posts_patch(...).doit() -//! let r = hub.accounts().list_recommend_google_locations(...).doit() +//! let r = hub.accounts().locations_transfer(...).doit() //! let r = hub.accounts().locations_reviews_get(...).doit() //! let r = hub.accounts().locations_local_posts_create(...).doit() //! let r = hub.accounts().locations_questions_answers_upsert(...).doit() //! let r = hub.accounts().admins_patch(...).doit() //! let r = hub.accounts().locations_find_matches(...).doit() //! let r = hub.accounts().locations_verifications_list(...).doit() -//! let r = hub.accounts().locations_associate(...).doit() +//! let r = hub.accounts().locations_list(...).doit() //! let r = hub.accounts().locations_admins_delete(...).doit() //! let r = hub.accounts().locations_delete(...).doit() //! let r = hub.accounts().delete_notifications(...).doit() @@ -107,7 +107,7 @@ //! let r = hub.accounts().locations_admins_create(...).doit() //! let r = hub.accounts().locations_media_start_upload(...).doit() //! let r = hub.accounts().locations_report_insights(...).doit() -//! let r = hub.accounts().locations_transfer(...).doit() +//! let r = hub.accounts().locations_associate(...).doit() //! let r = hub.accounts().locations_reviews_list(...).doit() //! let r = hub.accounts().locations_get(...).doit() //! let r = hub.accounts().locations_questions_answers_list(...).doit() @@ -174,12 +174,12 @@ //! // 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.accounts().locations_list("parent") +//! let result = hub.accounts().locations_questions_list("parent") //! .page_token("accusam") //! .page_size(-8) //! .order_by("justo") -//! .language_code("amet.") -//! .filter("erat") +//! .filter("amet.") +//! .answers_per_question(-81) //! .doit(); //! //! match result { @@ -334,12 +334,12 @@ pub use cmn::*; /// // 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.accounts().locations_list("parent") +/// let result = hub.accounts().locations_questions_list("parent") /// .page_token("sea") /// .page_size(-90) /// .order_by("dolores") -/// .language_code("gubergren") -/// .filter("sadipscing") +/// .filter("gubergren") +/// .answers_per_question(-95) /// .doit(); /// /// match result { @@ -377,7 +377,7 @@ impl<'a, C, A> MyBusiness MyBusiness { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://mybusiness.googleapis.com/".to_string(), _root_url: "https://mybusiness.googleapis.com/".to_string(), } @@ -403,7 +403,7 @@ impl<'a, C, A> MyBusiness } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -431,27 +431,19 @@ impl<'a, C, A> MyBusiness // ############ // SCHEMAS ### // ########## -/// A category describing what this business is (not what it does). For a list of -/// valid category IDs, and the mappings to their human-readable names, see -/// [categories.list](/my-business/reference/rest/v4/categories/list). +/// Request message for Media.StartUploadMediaItemData. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations media start upload accounts](struct.AccountLocationMediaStartUploadCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Category { - /// Output only. The human-readable name of the category. This is set when - /// reading the location. When modifying the location, `category_id` must be - /// set. - #[serde(rename="displayName")] - pub display_name: Option, - /// A stable ID (provided by Google) for this category. - /// The `category_id` must be specified when modifying the category (when - /// creating or updating a location). - #[serde(rename="categoryId")] - pub category_id: Option, -} +pub struct StartUploadMediaItemDataRequest { _never_set: Option } -impl Part for Category {} +impl RequestValue for StartUploadMediaItemDataRequest {} /// Represents the author of a question or answer @@ -521,10 +513,10 @@ impl RequestValue for ReportLocationInsightsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LocalPostEvent { - /// Name of the event. - pub title: Option, /// Event start and end date/time. pub schedule: Option, + /// Name of the event. + pub title: Option, } impl Part for LocalPostEvent {} @@ -536,11 +528,11 @@ impl Part for LocalPostEvent {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AddressVerificationData { + /// Address that a postcard can be sent to. + pub address: Option, /// Merchant's business name. #[serde(rename="businessName")] pub business_name: Option, - /// Address that a postcard can be sent to. - pub address: Option, } impl Part for AddressVerificationData {} @@ -620,48 +612,36 @@ pub struct Attribution { impl Part for Attribution {} -/// Metadata for an attribute. Contains display information for the attribute, -/// including a localized name and a heading for grouping related attributes -/// together. +/// Represents a Location that is present on +/// Google. This can be a location that has been claimed by the user, someone +/// else, or could be unclaimed. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [report google locations](struct.GoogleLocationReportCall.html) (none) +/// * [search google locations](struct.GoogleLocationSearchCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AttributeMetadata { - /// For some types of attributes (for example, enums), a list of supported - /// values and corresponding display names for those values is provided. - #[serde(rename="valueMetadata")] - pub value_metadata: Option>, - /// The localized display name for the attribute, if available; otherwise, - /// the English display name. - #[serde(rename="displayName")] - pub display_name: Option, - /// If true, the attribute is deprecated and should no longer be used. If - /// deprecated, updating this attribute will not result in an error, but - /// updates will not be saved. At some point after being deprecated, the - /// attribute will be removed entirely and it will become an error. - #[serde(rename="isDeprecated")] - pub is_deprecated: Option, - /// The localized display name of the group that contains this attribute, if - /// available; otherwise, the English group name. Related attributes are - /// collected into a group and should be displayed together under the heading - /// given here. - #[serde(rename="groupDisplayName")] - pub group_display_name: Option, - /// The ID of the attribute. - #[serde(rename="attributeId")] - pub attribute_id: Option, - /// The value type for the attribute. Values set and retrieved should be - /// expected to be of this type. - #[serde(rename="valueType")] - pub value_type: Option, - /// If true, the attribute supports multiple values. If false, only a single - /// value should be provided. - #[serde(rename="isRepeatable")] - pub is_repeatable: Option, +pub struct GoogleLocation { + /// A URL that will redirect the user to the request admin rights UI. + /// This field is only present if the location has already been claimed by + /// any user, including the current user. + #[serde(rename="requestAdminRightsUrl")] + pub request_admin_rights_url: Option, + /// The sparsely populated Location + /// information. This field can be re-used in + /// CreateLocation if it is + /// not currently claimed by a user. + pub location: Option, + /// Resource name of this GoogleLocation, in the format + /// `googleLocations/{googleLocationId}`. + pub name: Option, } -impl Part for AttributeMetadata {} +impl Resource for GoogleLocation {} /// A Google Cloud Pub/Sub topic where notifications can be published when a @@ -680,6 +660,11 @@ impl Part for AttributeMetadata {} pub struct Notifications { /// Output only. The notifications resource name. pub name: Option, + /// The types of notifications that will be sent to the Cloud Pub/Sub topic. + /// At least one must be specified. To stop receiving notifications entirely, + /// use DeleteNotifications. + #[serde(rename="notificationTypes")] + pub notification_types: Option>, /// The Google Cloud Pub/Sub topic that will receive notifications when /// locations managed by this account are updated. If unset, no notifications /// will be posted. @@ -688,11 +673,6 @@ pub struct Notifications { /// least Publish permissions on the Cloud Pub/Sub topic. #[serde(rename="topicName")] pub topic_name: Option, - /// The types of notifications that will be sent to the Cloud Pub/Sub topic. - /// At least one must be specified. To stop receiving notifications entirely, - /// use DeleteNotifications. - #[serde(rename="notificationTypes")] - pub notification_types: Option>, } impl RequestValue for Notifications {} @@ -819,7 +799,7 @@ impl Part for TimeInterval {} /// * [locations media create accounts](struct.AccountLocationMediaCreateCall.html) (none) /// * [locations local posts get accounts](struct.AccountLocationLocalPostGetCall.html) (none) /// * [locations reviews update reply accounts](struct.AccountLocationReviewUpdateReplyCall.html) (none) -/// * [locations list accounts](struct.AccountLocationListCall.html) (none) +/// * [list recommend google locations accounts](struct.AccountListRecommendGoogleLocationCall.html) (none) /// * [invitations decline accounts](struct.AccountInvitationDeclineCall.html) (none) /// * [locations questions list accounts](struct.AccountLocationQuestionListCall.html) (none) /// * [locations create accounts](struct.AccountLocationCreateCall.html) (none) @@ -831,14 +811,14 @@ impl Part for TimeInterval {} /// * [locations media customers get accounts](struct.AccountLocationMediaCustomerGetCall.html) (none) /// * [list accounts](struct.AccountListCall.html) (none) /// * [locations local posts patch accounts](struct.AccountLocationLocalPostPatchCall.html) (none) -/// * [list recommend google locations accounts](struct.AccountListRecommendGoogleLocationCall.html) (none) +/// * [locations transfer accounts](struct.AccountLocationTransferCall.html) (none) /// * [locations reviews get accounts](struct.AccountLocationReviewGetCall.html) (none) /// * [locations local posts create accounts](struct.AccountLocationLocalPostCreateCall.html) (none) /// * [locations questions answers upsert accounts](struct.AccountLocationQuestionAnswerUpsertCall.html) (none) /// * [admins patch accounts](struct.AccountAdminPatchCall.html) (none) /// * [locations find matches accounts](struct.AccountLocationFindMatcheCall.html) (none) /// * [locations verifications list accounts](struct.AccountLocationVerificationListCall.html) (none) -/// * [locations associate accounts](struct.AccountLocationAssociateCall.html) (none) +/// * [locations list accounts](struct.AccountLocationListCall.html) (none) /// * [locations admins delete accounts](struct.AccountLocationAdminDeleteCall.html) (none) /// * [locations delete accounts](struct.AccountLocationDeleteCall.html) (none) /// * [delete notifications accounts](struct.AccountDeleteNotificationCall.html) (none) @@ -856,7 +836,7 @@ impl Part for TimeInterval {} /// * [locations admins create accounts](struct.AccountLocationAdminCreateCall.html) (none) /// * [locations media start upload accounts](struct.AccountLocationMediaStartUploadCall.html) (none) /// * [locations report insights accounts](struct.AccountLocationReportInsightCall.html) (none) -/// * [locations transfer accounts](struct.AccountLocationTransferCall.html) (none) +/// * [locations associate accounts](struct.AccountLocationAssociateCall.html) (none) /// * [locations reviews list accounts](struct.AccountLocationReviewListCall.html) (none) /// * [locations get accounts](struct.AccountLocationGetCall.html) (none) /// * [locations questions answers list accounts](struct.AccountLocationQuestionAnswerListCall.html) (none) @@ -1142,15 +1122,15 @@ impl ResponseResult for GoogleUpdatedLocation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListAnswersResponse { - /// The total number of answers posted for this question across all pages. - #[serde(rename="totalSize")] - pub total_size: Option, /// If the number of answers exceeds the requested max page size, this field /// is populated with a token to fetch the next page of answers on a subsequent /// call. If there are no more answers, this field is not present in the /// response. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// The total number of answers posted for this question across all pages. + #[serde(rename="totalSize")] + pub total_size: Option, /// The requested answers. pub answers: Option>, } @@ -1684,15 +1664,15 @@ impl RequestValue for FetchVerificationOptionsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OrganizationInfo { - /// The registered domain for the account. - #[serde(rename="registeredDomain")] - pub registered_domain: Option, - /// The postal address for the account. - #[serde(rename="postalAddress")] - pub postal_address: Option, /// The contact number for the organization. #[serde(rename="phoneNumber")] pub phone_number: Option, + /// The postal address for the account. + #[serde(rename="postalAddress")] + pub postal_address: Option, + /// The registered domain for the account. + #[serde(rename="registeredDomain")] + pub registered_domain: Option, } impl Part for OrganizationInfo {} @@ -1851,15 +1831,15 @@ impl ResponseResult for ListAccountsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListQuestionsResponse { - /// The total number of questions posted for this location across all pages. - #[serde(rename="totalSize")] - pub total_size: Option, /// If the number of questions exceeds the requested max page size, this field /// is populated with a token to fetch the next page of questions on a /// subsequent call. If there are no more questions, this field is not present /// in the response. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// The total number of questions posted for this location across all pages. + #[serde(rename="totalSize")] + pub total_size: Option, /// The requested questions, pub questions: Option>, } @@ -1917,11 +1897,11 @@ pub struct Verification { pub state: Option, /// The method of the verification. pub method: Option, - /// Resource name of the verification. - pub name: Option, /// The timestamp when the verification is requested. #[serde(rename="createTime")] pub create_time: Option, + /// Resource name of the verification. + pub name: Option, } impl Part for Verification {} @@ -1988,67 +1968,85 @@ pub struct LocalPostProduct { impl Part for LocalPostProduct {} -/// Response message for Reviews.ListReviews. +/// Alternate/surrogate key references for a location. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations reviews list accounts](struct.AccountLocationReviewListCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListReviewsResponse { - /// The reviews. - pub reviews: Option>, - /// If the number of reviews exceeded the requested page size, this field - /// is populated with a token to fetch the next page of reviews on a - /// subsequent call to ListReviews. If there are no more reviews, this - /// field is not present in the response. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The total number of reviews for this location. - #[serde(rename="totalReviewCount")] - pub total_review_count: Option, - /// The average star rating of all reviews for this location - /// on a scale of 1 to 5, where 5 is the highest rating. - #[serde(rename="averageRating")] - pub average_rating: Option, +pub struct LocationKey { + /// Output only. If this location has a Google+ page associated with it, this + /// is populated with the Google+ page ID for this location. + #[serde(rename="plusPageId")] + pub plus_page_id: Option, + /// Output only. A value of true indicates that an unset place ID is + /// deliberate, which is different from no association being made yet. + #[serde(rename="explicitNoPlaceId")] + pub explicit_no_place_id: Option, + /// If this location has been verified and is connected to/appears on Google + /// Maps, this field is populated with the place ID for the location. + /// This ID can be used in various Places APIs. + /// + /// If this location is unverified, this field may be populated if the location + /// has been associated with a place that appears on Google Maps. + /// + /// This field can be set during Create calls, but not for Update. + /// + /// The additional `explicit_no_place_id` bool qualifies whether an unset + /// place ID is deliberate or not. + #[serde(rename="placeId")] + pub place_id: Option, + /// Output only. The `request_id` used to create this location. May be empty if + /// this location was created outside of the GMB API or Google My Business + /// Locations. + #[serde(rename="requestId")] + pub request_id: Option, } -impl ResponseResult for ListReviewsResponse {} +impl Part for LocationKey {} -/// Represents a Location that is present on -/// Google. This can be a location that has been claimed by the user, someone -/// else, or could be unclaimed. +/// Metadata for an attribute. Contains display information for the attribute, +/// including a localized name and a heading for grouping related attributes +/// together. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [report google locations](struct.GoogleLocationReportCall.html) (none) -/// * [search google locations](struct.GoogleLocationSearchCall.html) (none) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleLocation { - /// A URL that will redirect the user to the request admin rights UI. - /// This field is only present if the location has already been claimed by - /// any user, including the current user. - #[serde(rename="requestAdminRightsUrl")] - pub request_admin_rights_url: Option, - /// Resource name of this GoogleLocation, in the format - /// `googleLocations/{googleLocationId}`. - pub name: Option, - /// The sparsely populated Location - /// information. This field can be re-used in - /// CreateLocation if it is - /// not currently claimed by a user. - pub location: Option, +pub struct AttributeMetadata { + /// For some types of attributes (for example, enums), a list of supported + /// values and corresponding display names for those values is provided. + #[serde(rename="valueMetadata")] + pub value_metadata: Option>, + /// The localized display name for the attribute, if available; otherwise, + /// the English display name. + #[serde(rename="displayName")] + pub display_name: Option, + /// If true, the attribute is deprecated and should no longer be used. If + /// deprecated, updating this attribute will not result in an error, but + /// updates will not be saved. At some point after being deprecated, the + /// attribute will be removed entirely and it will become an error. + #[serde(rename="isDeprecated")] + pub is_deprecated: Option, + /// The localized display name of the group that contains this attribute, if + /// available; otherwise, the English group name. Related attributes are + /// collected into a group and should be displayed together under the heading + /// given here. + #[serde(rename="groupDisplayName")] + pub group_display_name: Option, + /// The ID of the attribute. + #[serde(rename="attributeId")] + pub attribute_id: Option, + /// The value type for the attribute. Values set and retrieved should be + /// expected to be of this type. + #[serde(rename="valueType")] + pub value_type: Option, + /// If true, the attribute supports multiple values. If false, only a single + /// value should be provided. + #[serde(rename="isRepeatable")] + pub is_repeatable: Option, } -impl Resource for GoogleLocation {} +impl Part for AttributeMetadata {} /// A chain is a brand that your business's locations can be affiliated with. @@ -2085,9 +2083,6 @@ impl ResponseResult for Chain {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Money { - /// The whole units of the amount. - /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - pub units: Option, /// Number of nano (10^-9) units of the amount. /// The value must be between -999,999,999 and +999,999,999 inclusive. /// If `units` is positive, `nanos` must be positive or zero. @@ -2095,6 +2090,9 @@ pub struct Money { /// If `units` is negative, `nanos` must be negative or zero. /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. pub nanos: Option, + /// The whole units of the amount. + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + pub units: Option, /// The 3-letter currency code defined in ISO 4217. #[serde(rename="currencyCode")] pub currency_code: Option, @@ -2211,32 +2209,40 @@ pub struct LocationDrivingDirectionMetrics { /// The location resource name this metric value belongs to. #[serde(rename="locationName")] pub location_name: Option, - /// Driving-direction requests by source region. By convention, these - /// are sorted by count with at most 10 results. - #[serde(rename="topDirectionSources")] - pub top_direction_sources: Option>, /// Time zone (IANA timezone IDs, for example, 'Europe/London') of the /// location. #[serde(rename="timeZone")] pub time_zone: Option, + /// Driving-direction requests by source region. By convention, these + /// are sorted by count with at most 10 results. + #[serde(rename="topDirectionSources")] + pub top_direction_sources: Option>, } impl Part for LocationDrivingDirectionMetrics {} -/// Request message for Media.StartUploadMediaItemData. +/// A category describing what this business is (not what it does). For a list of +/// valid category IDs, and the mappings to their human-readable names, see +/// [categories.list](/my-business/reference/rest/v4/categories/list). /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations media start upload accounts](struct.AccountLocationMediaStartUploadCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StartUploadMediaItemDataRequest { _never_set: Option } +pub struct Category { + /// Output only. The human-readable name of the category. This is set when + /// reading the location. When modifying the location, `category_id` must be + /// set. + #[serde(rename="displayName")] + pub display_name: Option, + /// A stable ID (provided by Google) for this category. + /// The `category_id` must be specified when modifying the category (when + /// creating or updating a location). + #[serde(rename="categoryId")] + pub category_id: Option, +} -impl RequestValue for StartUploadMediaItemDataRequest {} +impl Part for Category {} /// Response message for Media.ListMediaItems. @@ -2397,26 +2403,27 @@ pub struct MediaItem { /// display this attribution as provided to your users and must not delete or /// alter the attribution. pub attribution: Option, - /// The resource name for this media item. - /// `accounts/{account_id}/locations/{location_id}/media/{media_key}` - pub name: Option, - /// Output only. Where provided, the URL of a thumbnail image for this media - /// item. - #[serde(rename="thumbnailUrl")] - pub thumbnail_url: Option, + /// Output only. The dimensions (width and height) in pixels. + pub dimensions: Option, + /// Description for this media item. Descriptions cannot be modified through + /// the My Business API, but can be set when creating a new media item that is + /// not a cover photo. + pub description: Option, /// Output only. Google-hosted URL for this media item. This URL is not static /// since it may change over time. For video this will be a preview image with /// an overlaid play icon. #[serde(rename="googleUrl")] pub google_url: Option, + /// Output only. Statistics for this media item. + pub insights: Option, /// The format of this media item. Must be set when the media item is created, /// and is read-only on all other requests. Cannot be updated. #[serde(rename="mediaFormat")] pub media_format: Option, - /// Output only. The dimensions (width and height) in pixels. - pub dimensions: Option, - /// Output only. Statistics for this media item. - pub insights: Option, + /// Output only. Where provided, the URL of a thumbnail image for this media + /// item. + #[serde(rename="thumbnailUrl")] + pub thumbnail_url: Option, /// Required when calling `CreatePhoto`. Describes how this media item is /// connected to its location. Must be either a category (for example, /// EXTERIOR) or the ID of a price list item. @@ -2429,10 +2436,9 @@ pub struct MediaItem { /// Output only. Creation time of this media item. #[serde(rename="createTime")] pub create_time: Option, - /// Description for this media item. Descriptions cannot be modified through - /// the My Business API, but can be set when creating a new media item that is - /// not a cover photo. - pub description: Option, + /// The resource name for this media item. + /// `accounts/{account_id}/locations/{location_id}/media/{media_key}` + pub name: Option, } impl RequestValue for MediaItem {} @@ -2445,13 +2451,13 @@ impl ResponseResult for MediaItem {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Duplicate { + /// Indicates whether the user has access to the location it duplicates. + pub access: Option, /// The resource name of the location that this duplicates. Only populated /// if the authenticated user has access rights to that location and that /// location is not deleted. #[serde(rename="locationName")] pub location_name: Option, - /// Indicates whether the user has access to the location it duplicates. - pub access: Option, /// The place ID of the location that this duplicates. #[serde(rename="placeId")] pub place_id: Option, @@ -2504,13 +2510,13 @@ pub struct TimeOfDay { /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose /// to allow the value "24:00:00" for scenarios like business closing time. pub hours: Option, + /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + pub nanos: Option, + /// Minutes of hour of day. Must be from 0 to 59. + pub minutes: Option, /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may /// allow the value 60 if it allows leap-seconds. pub seconds: Option, - /// Minutes of hour of day. Must be from 0 to 59. - pub minutes: Option, - /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - pub nanos: Option, } impl Part for TimeOfDay {} @@ -2628,16 +2634,16 @@ impl RequestValue for AcceptInvitationRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Date { - /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without - /// a year. - pub year: Option, + /// Month of year. Must be from 1 to 12, or 0 if specifying a year without a + /// month and day. + pub month: Option, /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 /// if specifying a year by itself or a year and month where the day is not /// significant. pub day: Option, - /// Month of year. Must be from 1 to 12, or 0 if specifying a year without a - /// month and day. - pub month: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, } impl Part for Date {} @@ -2681,16 +2687,16 @@ impl Part for Section {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListRecommendedGoogleLocationsResponse { - /// The total number of recommended locations for this GMB account, - /// irrespective of pagination. - #[serde(rename="totalSize")] - pub total_size: Option, /// During pagination, if there are more locations available to be fetched in /// the next page, this field is populated with a token to fetch the next page /// of locations in a subsequent call. If there are no more locations to be /// fetched, this field is not present in the response. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// The total number of recommended locations for this GMB account, + /// irrespective of pagination. + #[serde(rename="totalSize")] + pub total_size: Option, /// The locations recommended to a GMB account. /// Each of these represents a GoogleLocation that /// is present on Maps. @@ -2727,41 +2733,35 @@ pub struct ReportLocalPostInsightsResponse { impl ResponseResult for ReportLocalPostInsightsResponse {} -/// Alternate/surrogate key references for a location. +/// Response message for Reviews.ListReviews. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations reviews list accounts](struct.AccountLocationReviewListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LocationKey { - /// Output only. If this location has a Google+ page associated with it, this - /// is populated with the Google+ page ID for this location. - #[serde(rename="plusPageId")] - pub plus_page_id: Option, - /// Output only. A value of true indicates that an unset place ID is - /// deliberate, which is different from no association being made yet. - #[serde(rename="explicitNoPlaceId")] - pub explicit_no_place_id: Option, - /// If this location has been verified and is connected to/appears on Google - /// Maps, this field is populated with the place ID for the location. - /// This ID can be used in various Places APIs. - /// - /// If this location is unverified, this field may be populated if the location - /// has been associated with a place that appears on Google Maps. - /// - /// This field can be set during Create calls, but not for Update. - /// - /// The additional `explicit_no_place_id` bool qualifies whether an unset - /// place ID is deliberate or not. - #[serde(rename="placeId")] - pub place_id: Option, - /// Output only. The `request_id` used to create this location. May be empty if - /// this location was created outside of the GMB API or Google My Business - /// Locations. - #[serde(rename="requestId")] - pub request_id: Option, +pub struct ListReviewsResponse { + /// If the number of reviews exceeded the requested page size, this field + /// is populated with a token to fetch the next page of reviews on a + /// subsequent call to ListReviews. If there are no more reviews, this + /// field is not present in the response. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The reviews. + pub reviews: Option>, + /// The total number of reviews for this location. + #[serde(rename="totalReviewCount")] + pub total_review_count: Option, + /// The average star rating of all reviews for this location + /// on a scale of 1 to 5, where 5 is the highest rating. + #[serde(rename="averageRating")] + pub average_rating: Option, } -impl Part for LocationKey {} +impl ResponseResult for ListReviewsResponse {} /// Token generated by a vetted partner. @@ -2919,30 +2919,6 @@ pub struct TimeDimension { impl Part for TimeDimension {} -/// Response message for Verifications.ListVerifications. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [locations verifications list accounts](struct.AccountLocationVerificationListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListVerificationsResponse { - /// If the number of verifications exceeded the requested page size, this field - /// will be populated with a token to fetch the next page of verification on a - /// subsequent call. If there are no more attributes, this field will not be - /// present in the response. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of the verifications. - pub verifications: Option>, -} - -impl ResponseResult for ListVerificationsResponse {} - - /// Response message for GoogleLocations.SearchGoogleLocations. /// /// # Activities @@ -2977,12 +2953,14 @@ impl ResponseResult for SearchGoogleLocationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LocalPost { + /// Event information. Required for topic types `EVENT` and `OFFER`. + pub event: Option, /// The language of the local post. #[serde(rename="languageCode")] pub language_code: Option, - /// Output only. Time of the last modification of the post made by the user. - #[serde(rename="updateTime")] - pub update_time: Option, + /// Additional data for product posts. This should only be set when the + /// topic_type is PRODUCT. + pub product: Option, /// Required. The topic type of the post: standard, event, offer, or product. #[serde(rename="topicType")] pub topic_type: Option, @@ -2995,12 +2973,9 @@ pub struct LocalPost { /// The media associated with the post. source_url is the only supported data /// field for a LocalPost MediaItem. pub media: Option>, - /// Output only. Time of the creation of the post. - #[serde(rename="createTime")] - pub create_time: Option, - /// Additional data for product posts. This should only be set when the - /// topic_type is PRODUCT. - pub product: Option, + /// Output only. Time of the last modification of the post made by the user. + #[serde(rename="updateTime")] + pub update_time: Option, /// Output only. The link to the local post in Google search. This link can /// be used to share the post via social media, email, text, etc. #[serde(rename="searchUrl")] @@ -3014,8 +2989,9 @@ pub struct LocalPost { /// for topic type `OFFER`. #[serde(rename="callToAction")] pub call_to_action: Option, - /// Event information. Required for topic types `EVENT` and `OFFER`. - pub event: Option, + /// Output only. Time of the creation of the post. + #[serde(rename="createTime")] + pub create_time: Option, } impl RequestValue for LocalPost {} @@ -3036,9 +3012,10 @@ impl ResponseResult for LocalPost {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Attribute { - /// The ID of the attribute. Attribute IDs are provided by Google. - #[serde(rename="attributeId")] - pub attribute_id: Option, + /// When the attribute value type is URL, this field contains the value(s) for + /// this attribute, and the other values fields must be empty. + #[serde(rename="urlValues")] + pub url_values: Option>, /// Output only. The type of value that this attribute contains. This should be /// used to determine how to interpret the value. #[serde(rename="valueType")] @@ -3049,14 +3026,13 @@ pub struct Attribute { /// This is a repeated field where multiple attribute values may be provided. /// Attribute types only support one value. pub values: Option>, + /// The ID of the attribute. Attribute IDs are provided by Google. + #[serde(rename="attributeId")] + pub attribute_id: Option, /// When the attribute value type is REPEATED_ENUM, this contains the attribute /// value, and the other values fields must be empty. #[serde(rename="repeatedEnumValue")] pub repeated_enum_value: Option, - /// When the attribute value type is URL, this field contains the value(s) for - /// this attribute, and the other values fields must be empty. - #[serde(rename="urlValues")] - pub url_values: Option>, } impl Resource for Attribute {} @@ -3081,12 +3057,12 @@ impl Part for VettedPartnerInput {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TargetLocation { - /// The name of the location to which the user is invited. - #[serde(rename="locationName")] - pub location_name: Option, /// The address of the location to which the user is invited. #[serde(rename="locationAddress")] pub location_address: Option, + /// The name of the location to which the user is invited. + #[serde(rename="locationName")] + pub location_name: Option, } impl Part for TargetLocation {} @@ -3238,6 +3214,24 @@ pub struct CompleteVerificationResponse { impl ResponseResult for CompleteVerificationResponse {} +/// Response message for Verifications.FetchVerificationOptions. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations fetch verification options accounts](struct.AccountLocationFetchVerificationOptionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FetchVerificationOptionsResponse { + /// The available verification options. + pub options: Option>, +} + +impl ResponseResult for FetchVerificationOptionsResponse {} + + /// Response message for Locations.ListLocations. /// /// # Activities @@ -3265,41 +3259,45 @@ pub struct ListLocationsResponse { impl ResponseResult for ListLocationsResponse {} -/// Request message for Insights.ReportLocalPostInsights +/// Name to be used when displaying the chain. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChainName { + /// The BCP 47 code of language of the name. + #[serde(rename="languageCode")] + pub language_code: Option, + /// The display name for this chain. + #[serde(rename="displayName")] + pub display_name: Option, +} + +impl Part for ChainName {} + + +/// Response message for Locations.FindMatchingLocations. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations local posts report insights accounts](struct.AccountLocationLocalPostReportInsightCall.html) (request) +/// * [locations find matches accounts](struct.AccountLocationFindMatcheCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReportLocalPostInsightsRequest { - /// Required. The list of posts for which to fetch insights data. All posts - /// have to belong to the location whose name is specified in the `name` field. - #[serde(rename="localPostNames")] - pub local_post_names: Option>, - /// A request to include basic metric insights in the report. This request - /// applies to all posts requested. - #[serde(rename="basicRequest")] - pub basic_request: Option, +pub struct FindMatchingLocationsResponse { + /// When the matching algorithm was last executed for this location. + #[serde(rename="matchTime")] + pub match_time: Option, + /// A collection of locations that are potential matches to the specified + /// location, listed in order from best to least match. If there is an exact + /// match, it will be in the first position. + #[serde(rename="matchedLocations")] + pub matched_locations: Option>, } -impl RequestValue for ReportLocalPostInsightsRequest {} - - -/// All information pertaining to the location's profile. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Profile { - /// Description of the location in your own voice, not editable by anyone else. - pub description: Option, -} - -impl Part for Profile {} +impl ResponseResult for FindMatchingLocationsResponse {} /// A region with its associated request count. @@ -3471,45 +3469,41 @@ pub struct RelationshipData { impl Part for RelationshipData {} -/// Name to be used when displaying the chain. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChainName { - /// The BCP 47 code of language of the name. - #[serde(rename="languageCode")] - pub language_code: Option, - /// The display name for this chain. - #[serde(rename="displayName")] - pub display_name: Option, -} - -impl Part for ChainName {} - - -/// Response message for Locations.FindMatchingLocations. +/// Request message for Insights.ReportLocalPostInsights /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations find matches accounts](struct.AccountLocationFindMatcheCall.html) (response) +/// * [locations local posts report insights accounts](struct.AccountLocationLocalPostReportInsightCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FindMatchingLocationsResponse { - /// When the matching algorithm was last executed for this location. - #[serde(rename="matchTime")] - pub match_time: Option, - /// A collection of locations that are potential matches to the specified - /// location, listed in order from best to least match. If there is an exact - /// match, it will be in the first position. - #[serde(rename="matchedLocations")] - pub matched_locations: Option>, +pub struct ReportLocalPostInsightsRequest { + /// Required. The list of posts for which to fetch insights data. All posts + /// have to belong to the location whose name is specified in the `name` field. + #[serde(rename="localPostNames")] + pub local_post_names: Option>, + /// A request to include basic metric insights in the report. This request + /// applies to all posts requested. + #[serde(rename="basicRequest")] + pub basic_request: Option, } -impl ResponseResult for FindMatchingLocationsResponse {} +impl RequestValue for ReportLocalPostInsightsRequest {} + + +/// All information pertaining to the location's profile. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Profile { + /// Description of the location in your own voice, not editable by anyone else. + pub description: Option, +} + +impl Part for Profile {} /// A series of Metrics and BreakdownMetrics associated with a Location over @@ -3556,40 +3550,46 @@ pub struct Admin { /// specified resource. #[serde(rename="pendingInvitation")] pub pending_invitation: Option, - /// The name of the admin. When making the initial invitation, this is the - /// invitee's email address. On `GET` calls, the user's email address is - /// returned if the invitation is still pending. Otherwise, it contains - /// the user's first and last names. - #[serde(rename="adminName")] - pub admin_name: Option, /// The resource name. For account admins, this is in the form: /// `accounts/{account_id}/admins/{admin_id}` /// /// For location admins, this is in the form: /// `accounts/{account_id}/locations/{location_id}/admins/{admin_id}` pub name: Option, + /// The name of the admin. When making the initial invitation, this is the + /// invitee's email address. On `GET` calls, the user's email address is + /// returned if the invitation is still pending. Otherwise, it contains + /// the user's first and last names. + #[serde(rename="adminName")] + pub admin_name: Option, } impl RequestValue for Admin {} impl ResponseResult for Admin {} -/// Response message for Verifications.FetchVerificationOptions. +/// Response message for Verifications.ListVerifications. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations fetch verification options accounts](struct.AccountLocationFetchVerificationOptionCall.html) (response) +/// * [locations verifications list accounts](struct.AccountLocationVerificationListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FetchVerificationOptionsResponse { - /// The available verification options. - pub options: Option>, +pub struct ListVerificationsResponse { + /// If the number of verifications exceeded the requested page size, this field + /// will be populated with a token to fetch the next page of verification on a + /// subsequent call. If there are no more attributes, this field will not be + /// present in the response. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of the verifications. + pub verifications: Option>, } -impl ResponseResult for FetchVerificationOptionsResponse {} +impl ResponseResult for ListVerificationsResponse {} /// A single list item. Each variation of an item in the price list should @@ -3803,12 +3803,12 @@ impl Part for TopDirectionSources {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OpenInfo { - /// Indicates whether or not the Location is currently open for business. - /// All locations are open by default, unless updated to be closed. - pub status: Option, /// Output only. Indicates whether this business is eligible for re-open. #[serde(rename="canReopen")] pub can_reopen: Option, + /// Indicates whether or not the Location is currently open for business. + /// All locations are open by default, unless updated to be closed. + pub status: Option, /// The date on which the location first opened. If the exact day is not known, /// month and year only can be provided. The date must be in the past or be /// no more than one year in the future. @@ -4326,22 +4326,27 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the locations for the specified account. + /// List all the GoogleLocations that + /// have been recommended to the specified GMB account. + /// Recommendations are provided for personal accounts and location groups + /// only, requests for all other account types will result in an error. + /// The recommendations for location groups are based on the locations in that + /// group. + /// + /// The recommendations for personal accounts are based on all of + /// the locations that the user has access to on Google My Business (which + /// includes locations they can access through location groups), and is a + /// superset of all recommendations generated for the user. /// /// # Arguments /// - /// * `parent` - The name of the account to fetch locations from. If the Account is of AccountType PERSONAL, only Locations that are - /// directly owned by the Account are returned, otherwise it will return all - /// accessible locations from the Account, either directly or indirectly. - pub fn locations_list(&self, parent: &str) -> AccountLocationListCall<'a, C, A> { - AccountLocationListCall { + /// * `name` - Name of the account resource to fetch recommended Google locations for. + pub fn list_recommend_google_locations(&self, name: &str) -> AccountListRecommendGoogleLocationCall<'a, C, A> { + AccountListRecommendGoogleLocationCall { hub: self.hub, - _parent: parent.to_string(), + _name: name.to_string(), _page_token: Default::default(), _page_size: Default::default(), - _order_by: Default::default(), - _language_code: Default::default(), - _filter: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), } @@ -4548,27 +4553,21 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List all the GoogleLocations that - /// have been recommended to the specified GMB account. - /// Recommendations are provided for personal accounts and location groups - /// only, requests for all other account types will result in an error. - /// The recommendations for location groups are based on the locations in that - /// group. - /// - /// The recommendations for personal accounts are based on all of - /// the locations that the user has access to on Google My Business (which - /// includes locations they can access through location groups), and is a - /// superset of all recommendations generated for the user. + /// Moves a location from an account that the user owns to another account + /// that the same user administers. The user must be an owner of the account + /// the location is currently associated with and must also be at least a + /// manager of the destination account. Returns the Location with its new + /// resource name. /// /// # Arguments /// - /// * `name` - Name of the account resource to fetch recommended Google locations for. - pub fn list_recommend_google_locations(&self, name: &str) -> AccountListRecommendGoogleLocationCall<'a, C, A> { - AccountListRecommendGoogleLocationCall { + /// * `request` - No description provided. + /// * `name` - The name of the location to transfer. + pub fn locations_transfer(&self, request: TransferLocationRequest, name: &str) -> AccountLocationTransferCall<'a, C, A> { + AccountLocationTransferCall { hub: self.hub, + _request: request, _name: name.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), } @@ -4688,20 +4687,22 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Associates a location to a place ID. Any previous association is - /// overwritten. This operation is only valid if the location is unverified. - /// The association must be valid, that is, it appears in the list of - /// `FindMatchingLocations`. + /// Lists the locations for the specified account. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `name` - The resource name of the location to associate. - pub fn locations_associate(&self, request: AssociateLocationRequest, name: &str) -> AccountLocationAssociateCall<'a, C, A> { - AccountLocationAssociateCall { + /// * `parent` - The name of the account to fetch locations from. If the Account is of AccountType PERSONAL, only Locations that are + /// directly owned by the Account are returned, otherwise it will return all + /// accessible locations from the Account, either directly or indirectly. + pub fn locations_list(&self, parent: &str) -> AccountLocationListCall<'a, C, A> { + AccountLocationListCall { hub: self.hub, - _request: request, - _name: name.to_string(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _language_code: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), } @@ -5024,18 +5025,17 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Moves a location from an account that the user owns to another account - /// that the same user administers. The user must be an owner of the account - /// the location is currently associated with and must also be at least a - /// manager of the destination account. Returns the Location with its new - /// resource name. + /// Associates a location to a place ID. Any previous association is + /// overwritten. This operation is only valid if the location is unverified. + /// The association must be valid, that is, it appears in the list of + /// `FindMatchingLocations`. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the location to transfer. - pub fn locations_transfer(&self, request: TransferLocationRequest, name: &str) -> AccountLocationTransferCall<'a, C, A> { - AccountLocationTransferCall { + /// * `name` - The resource name of the location to associate. + pub fn locations_associate(&self, request: AssociateLocationRequest, name: &str) -> AccountLocationAssociateCall<'a, C, A> { + AccountLocationAssociateCall { hub: self.hub, _request: request, _name: name.to_string(), @@ -9335,9 +9335,19 @@ impl<'a, C, A> AccountLocationReviewUpdateReplyCall<'a, C, A> where C: BorrowMut } -/// Lists the locations for the specified account. +/// List all the GoogleLocations that +/// have been recommended to the specified GMB account. +/// Recommendations are provided for personal accounts and location groups +/// only, requests for all other account types will result in an error. +/// The recommendations for location groups are based on the locations in that +/// group. +/// +/// The recommendations for personal accounts are based on all of +/// the locations that the user has access to on Google My Business (which +/// includes locations they can access through location groups), and is a +/// superset of all recommendations generated for the user. /// -/// A builder for the *locations.list* method supported by a *account* resource. +/// A builder for the *listRecommendGoogleLocations* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. /// /// # Example @@ -9362,36 +9372,30 @@ impl<'a, C, A> AccountLocationReviewUpdateReplyCall<'a, C, A> where C: BorrowMut /// // 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.accounts().locations_list("parent") +/// let result = hub.accounts().list_recommend_google_locations("name") /// .page_token("dolor") /// .page_size(-39) -/// .order_by("elitr") -/// .language_code("amet") -/// .filter("no") /// .doit(); /// # } /// ``` -pub struct AccountLocationListCall<'a, C, A> +pub struct AccountListRecommendGoogleLocationCall<'a, C, A> where C: 'a, A: 'a { hub: &'a MyBusiness, - _parent: String, + _name: String, _page_token: Option, _page_size: Option, - _order_by: Option, - _language_code: Option, - _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, } -impl<'a, C, A> CallBuilder for AccountLocationListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AccountListRecommendGoogleLocationCall<'a, C, A> {} -impl<'a, C, A> AccountLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AccountListRecommendGoogleLocationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListLocationsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListRecommendedGoogleLocationsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -9400,26 +9404,17 @@ impl<'a, C, A> AccountLocationListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "mybusiness.accounts.locations.list", + dlg.begin(MethodInfo { id: "mybusiness.accounts.listRecommendGoogleLocations", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } if let Some(value) = self._page_size { params.push(("pageSize", value.to_string())); } - if let Some(value) = self._order_by { - params.push(("orderBy", value.to_string())); - } - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "languageCode", "filter"].iter() { + for &field in ["alt", "name", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9431,7 +9426,7 @@ impl<'a, C, A> AccountLocationListCall<'a, C, A> where C: BorrowMut AccountLocationListCall<'a, C, A> where C: BorrowMut AccountLocationListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -9529,77 +9524,38 @@ impl<'a, C, A> AccountLocationListCall<'a, C, A> where C: BorrowMut AccountLocationListCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn name(mut self, new_value: &str) -> AccountListRecommendGoogleLocationCall<'a, C, A> { + self._name = new_value.to_string(); self } - /// If specified, it fetches the next `page` of locations. The page token - /// is returned by previous calls to `ListLocations` when there were more - /// locations than could fit in the requested page size. + /// If specified, the next page of locations is retrieved. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> AccountListRecommendGoogleLocationCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// How many locations to fetch per page. Default is 100, - /// minimum is 1, and maximum page size is 100. + /// How many locations to fetch per page. Default is 25, minimum is 1, and + /// maximum page size is 100. /// /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AccountLocationListCall<'a, C, A> { + pub fn page_size(mut self, new_value: i32) -> AccountListRecommendGoogleLocationCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Sorting order for the request. Multiple fields should be comma-separated, - /// following SQL syntax. - /// The default sorting order is ascending. To specify descending order, a - /// suffix " desc" should be added. - /// Valid fields to order_by are location_name and store_code. For example: - /// "location_name, store_code desc" or "location_name" or "store_code desc" - /// - /// Sets the *order by* query property to the given value. - pub fn order_by(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { - self._order_by = Some(new_value.to_string()); - self - } - /// The BCP 47 code of language to get display location properties in. If this - /// language is not available, they will be provided in the language of the - /// location. If neither is available, they will be provided in English. - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } - /// A filter constraining the locations to return. The response includes - /// only entries that match the filter. If `filter` is empty, then - /// constraints are applied and all locations (paginated) are retrieved for - /// the requested account. - /// - /// For more information about valid fields and example usage, see [Work with - /// Location Data - /// Guide](https://developers.google.com/my-business/content/location-data#filter_results_when_you_list_locations). - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccountLocationListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccountListRecommendGoogleLocationCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -9624,7 +9580,7 @@ impl<'a, C, A> AccountLocationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountLocationListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AccountListRecommendGoogleLocationCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -9912,11 +9868,11 @@ impl<'a, C, A> AccountInvitationDeclineCall<'a, C, A> where C: BorrowMut AccountLocationQuestionListCall<'a, C, A> where C: BorrowMut AccountLocationMediaCustomerGetCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().list() -/// .page_token("consetetur") -/// .page_size(-36) -/// .name("ea") -/// .filter("sed") +/// .page_token("et") +/// .page_size(-46) +/// .name("et") +/// .filter("consetetur") /// .doit(); /// # } /// ``` @@ -12072,7 +12028,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().locations_local_posts_patch(req, "name") -/// .update_mask("dolor") +/// .update_mask("ea") /// .doit(); /// # } /// ``` @@ -12301,19 +12257,13 @@ impl<'a, C, A> AccountLocationLocalPostPatchCall<'a, C, A> where C: BorrowMut AccountLocationLocalPostPatchCall<'a, C, A> where C: BorrowMut AccountLocationLocalPostPatchCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = MyBusiness::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TransferLocationRequest::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.accounts().list_recommend_google_locations("name") -/// .page_token("et") -/// .page_size(-96) +/// let result = hub.accounts().locations_transfer(req, "name") /// .doit(); /// # } /// ``` -pub struct AccountListRecommendGoogleLocationCall<'a, C, A> +pub struct AccountLocationTransferCall<'a, C, A> where C: 'a, A: 'a { hub: &'a MyBusiness, + _request: TransferLocationRequest, _name: String, - _page_token: Option, - _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, } -impl<'a, C, A> CallBuilder for AccountListRecommendGoogleLocationCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AccountLocationTransferCall<'a, C, A> {} -impl<'a, C, A> AccountListRecommendGoogleLocationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AccountLocationTransferCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListRecommendedGoogleLocationsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Location)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -12370,17 +12323,11 @@ impl<'a, C, A> AccountListRecommendGoogleLocationCall<'a, C, A> where C: BorrowM Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "mybusiness.accounts.listRecommendGoogleLocations", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "mybusiness.accounts.locations.transfer", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "name", "pageToken", "pageSize"].iter() { + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12392,7 +12339,7 @@ impl<'a, C, A> AccountListRecommendGoogleLocationCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v4/{+name}:recommendGoogleLocations"; + let mut url = self.hub._base_url.clone() + "v4/{+name}:transfer"; let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -12433,13 +12380,28 @@ impl<'a, C, A> AccountListRecommendGoogleLocationCall<'a, C, A> where C: BorrowM let url = hyper::Url::parse_with_params(&url, params).unwrap(); + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); dlg.pre_request(); req.send() @@ -12490,38 +12452,32 @@ impl<'a, C, A> AccountListRecommendGoogleLocationCall<'a, C, A> where C: BorrowM } - /// Name of the account resource to fetch recommended Google locations for. + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TransferLocationRequest) -> AccountLocationTransferCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the location to transfer. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccountListRecommendGoogleLocationCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> AccountLocationTransferCall<'a, C, A> { self._name = new_value.to_string(); self } - /// If specified, the next page of locations is retrieved. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccountListRecommendGoogleLocationCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// How many locations to fetch per page. Default is 25, minimum is 1, and - /// maximum page size is 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AccountListRecommendGoogleLocationCall<'a, C, A> { - self._page_size = Some(new_value); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccountListRecommendGoogleLocationCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccountLocationTransferCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12546,7 +12502,7 @@ impl<'a, C, A> AccountListRecommendGoogleLocationCall<'a, C, A> where C: BorrowM /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> AccountListRecommendGoogleLocationCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AccountLocationTransferCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13808,8 +13764,8 @@ impl<'a, C, A> AccountLocationFindMatcheCall<'a, C, A> where C: BorrowMut AccountLocationVerificationListCall<'a, C, A> where C: BorrowMut< } -/// Associates a location to a place ID. Any previous association is -/// overwritten. This operation is only valid if the location is unverified. -/// The association must be valid, that is, it appears in the list of -/// `FindMatchingLocations`. +/// Lists the locations for the specified account. /// -/// A builder for the *locations.associate* method supported by a *account* resource. +/// A builder for the *locations.list* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. /// /// # Example @@ -14040,7 +13993,6 @@ impl<'a, C, A> AccountLocationVerificationListCall<'a, C, A> where C: BorrowMut< /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_mybusiness4 as mybusiness4; -/// use mybusiness4::AssociateLocationRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -14051,35 +14003,39 @@ impl<'a, C, A> AccountLocationVerificationListCall<'a, C, A> where C: BorrowMut< /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = MyBusiness::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AssociateLocationRequest::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.accounts().locations_associate(req, "name") +/// let result = hub.accounts().locations_list("parent") +/// .page_token("justo") +/// .page_size(-52) +/// .order_by("vero") +/// .language_code("diam") +/// .filter("rebum.") /// .doit(); /// # } /// ``` -pub struct AccountLocationAssociateCall<'a, C, A> +pub struct AccountLocationListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a MyBusiness, - _request: AssociateLocationRequest, - _name: String, + _parent: String, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _language_code: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, } -impl<'a, C, A> CallBuilder for AccountLocationAssociateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AccountLocationListCall<'a, C, A> {} -impl<'a, C, A> AccountLocationAssociateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AccountLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLocationsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -14088,11 +14044,26 @@ impl<'a, C, A> AccountLocationAssociateCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "mybusiness.accounts.locations.associate", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + dlg.begin(MethodInfo { id: "mybusiness.accounts.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "orderBy", "languageCode", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14104,7 +14075,7 @@ impl<'a, C, A> AccountLocationAssociateCall<'a, C, A> where C: BorrowMut AccountLocationAssociateCall<'a, C, A> where C: BorrowMut AccountLocationAssociateCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -14145,28 +14116,13 @@ impl<'a, C, A> AccountLocationAssociateCall<'a, C, A> where C: BorrowMut AccountLocationAssociateCall<'a, C, A> where C: BorrowMut AccountLocationAssociateCall<'a, C, A> { - self._request = new_value; + pub fn parent(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { + self._parent = new_value.to_string(); self } - /// The resource name of the location to associate. + /// If specified, it fetches the next `page` of locations. The page token + /// is returned by previous calls to `ListLocations` when there were more + /// locations than could fit in the requested page size. /// - /// Sets the *name* path property to the given value. + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// How many locations to fetch per page. Default is 100, + /// minimum is 1, and maximum page size is 100. /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccountLocationAssociateCall<'a, C, A> { - self._name = new_value.to_string(); + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AccountLocationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Sorting order for the request. Multiple fields should be comma-separated, + /// following SQL syntax. + /// The default sorting order is ascending. To specify descending order, a + /// suffix " desc" should be added. + /// Valid fields to order_by are location_name and store_code. For example: + /// "location_name, store_code desc" or "location_name" or "store_code desc" + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The BCP 47 code of language to get display location properties in. If this + /// language is not available, they will be provided in the language of the + /// location. If neither is available, they will be provided in English. + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// A filter constraining the locations to return. The response includes + /// only entries that match the filter. If `filter` is empty, then + /// constraints are applied and all locations (paginated) are retrieved for + /// the requested account. + /// + /// For more information about valid fields and example usage, see [Work with + /// Location Data + /// Guide](https://developers.google.com/my-business/content/location-data#filter_results_when_you_list_locations). + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> AccountLocationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -14242,7 +14243,7 @@ impl<'a, C, A> AccountLocationAssociateCall<'a, C, A> where C: BorrowMut AccountLocationAssociateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccountLocationListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -14267,7 +14268,7 @@ impl<'a, C, A> AccountLocationAssociateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountLocationAssociateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AccountLocationListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18320,13 +18321,12 @@ impl<'a, C, A> AccountLocationReportInsightCall<'a, C, A> where C: BorrowMut AccountLocationReportInsightCall<'a, C, A> where C: BorrowMut AccountLocationReportInsightCall<'a, C, A> where C: BorrowMut +pub struct AccountLocationAssociateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a MyBusiness, - _request: TransferLocationRequest, + _request: AssociateLocationRequest, _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, } -impl<'a, C, A> CallBuilder for AccountLocationTransferCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for AccountLocationAssociateCall<'a, C, A> {} -impl<'a, C, A> AccountLocationTransferCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> AccountLocationAssociateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Location)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -18386,7 +18386,7 @@ impl<'a, C, A> AccountLocationTransferCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "mybusiness.accounts.locations.transfer", + dlg.begin(MethodInfo { id: "mybusiness.accounts.locations.associate", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -18402,7 +18402,7 @@ impl<'a, C, A> AccountLocationTransferCall<'a, C, A> where C: BorrowMut AccountLocationTransferCall<'a, C, A> where C: BorrowMut AccountLocationTransferCall<'a, C, A> { + pub fn request(mut self, new_value: AssociateLocationRequest) -> AccountLocationAssociateCall<'a, C, A> { self._request = new_value; self } - /// The name of the location to transfer. + /// The resource name of the location to associate. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> AccountLocationTransferCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> AccountLocationAssociateCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -18540,7 +18540,7 @@ impl<'a, C, A> AccountLocationTransferCall<'a, C, A> where C: BorrowMut AccountLocationTransferCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> AccountLocationAssociateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18565,7 +18565,7 @@ impl<'a, C, A> AccountLocationTransferCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountLocationTransferCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> AccountLocationAssociateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self diff --git a/gen/oslogin1-cli/Cargo.toml b/gen/oslogin1-cli/Cargo.toml index 6e8c3e3291..5266742181 100644 --- a/gen/oslogin1-cli/Cargo.toml +++ b/gen/oslogin1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-oslogin1-cli" -version = "1.0.12+20190614" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud OS Login (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-oslogin1] path = "../oslogin1" -version = "1.0.12+20190614" +version = "1.0.13+20200329" diff --git a/gen/oslogin1-cli/README.md b/gen/oslogin1-cli/README.md index 237908585a..40b248ce6d 100644 --- a/gen/oslogin1-cli/README.md +++ b/gen/oslogin1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud OS Login* API at revision *20190614*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud OS Login* API at revision *20200329*. The CLI is at version *1.0.13*. ```bash oslogin1 [options] diff --git a/gen/oslogin1-cli/mkdocs.yml b/gen/oslogin1-cli/mkdocs.yml index 13127d11a0..22e50c06a1 100644 --- a/gen/oslogin1-cli/mkdocs.yml +++ b/gen/oslogin1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud OS Login v1.0.12+20190614 +site_name: Cloud OS Login v1.0.13+20200329 site_url: http://byron.github.io/google-apis-rs/google-oslogin1-cli site_description: A complete library to interact with Cloud OS Login (protocol v1) diff --git a/gen/oslogin1-cli/src/main.rs b/gen/oslogin1-cli/src/main.rs index e1199b1afd..b09c115352 100644 --- a/gen/oslogin1-cli/src/main.rs +++ b/gen/oslogin1-cli/src/main.rs @@ -128,11 +128,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "key" => Some(("key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time-usec" => Some(("expirationTimeUsec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -375,11 +376,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "key" => Some(("key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time-usec" => Some(("expirationTimeUsec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -567,7 +569,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique ID for the user in format `users/{user}`."##), + Some(r##"Required. The unique ID for the user in format `users/{user}`."##), Some(true), Some(false)), @@ -591,7 +593,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The unique ID for the user in format `users/{user}`."##), + Some(r##"Required. The unique ID for the user in format `users/{user}`."##), Some(true), Some(false)), @@ -619,7 +621,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"A reference to the POSIX account to update. POSIX accounts are identified + Some(r##"Required. A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`."##), Some(true), @@ -643,7 +645,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The fingerprint of the public key to update. Public keys are identified by + Some(r##"Required. The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`."##), Some(true), @@ -667,7 +669,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The fingerprint of the public key to retrieve. Public keys are identified + Some(r##"Required. The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`."##), Some(true), @@ -692,7 +694,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The fingerprint of the public key to update. Public keys are identified by + Some(r##"Required. The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`."##), Some(true), @@ -722,8 +724,8 @@ fn main() { let mut app = App::new("oslogin1") .author("Sebastian Thiel ") - .version("1.0.12+20190614") - .about("You can use OS Login to manage access to your VM instances using IAM roles. For more information, read [OS Login](/compute/docs/oslogin/).") + .version("1.0.13+20200329") + .about("You can use OS Login to manage access to your VM instances using IAM roles.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_oslogin1_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/oslogin1/Cargo.toml b/gen/oslogin1/Cargo.toml index 70cf4c2240..c77ce99962 100644 --- a/gen/oslogin1/Cargo.toml +++ b/gen/oslogin1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-oslogin1" -version = "1.0.12+20190614" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud OS Login (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1" homepage = "https://cloud.google.com/compute/docs/oslogin/" -documentation = "https://docs.rs/google-oslogin1/1.0.12+20190614" +documentation = "https://docs.rs/google-oslogin1/1.0.13+20200329" license = "MIT" keywords = ["oslogin", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/oslogin1/README.md b/gen/oslogin1/README.md index 5be8b0ef57..ad29f43c75 100644 --- a/gen/oslogin1/README.md +++ b/gen/oslogin1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-oslogin1` library allows access to all features of the *Google Cloud OS Login* service. -This documentation was generated from *Cloud OS Login* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *oslogin:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud OS Login* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *oslogin:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud OS Login* *v1* API can be found at the [official documentation site](https://cloud.google.com/compute/docs/oslogin/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.CloudOSLogin.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.CloudOSLogin.html) ... * users - * [*get login profile*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.UserGetLoginProfileCall.html), [*import ssh public key*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.UserImportSshPublicKeyCall.html), [*projects delete*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.UserProjectDeleteCall.html), [*ssh public keys delete*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.UserSshPublicKeyPatchCall.html) + * [*get login profile*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.UserGetLoginProfileCall.html), [*import ssh public key*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.UserImportSshPublicKeyCall.html), [*projects delete*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.UserProjectDeleteCall.html), [*ssh public keys delete*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.UserSshPublicKeyPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/struct.CloudOSLogin.html)** +* **[Hub](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/struct.CloudOSLogin.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.Part.html)** + * **[Parts](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-oslogin1/1.0.12+20190614/google_oslogin1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-oslogin1/1.0.13+20200329/google_oslogin1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/oslogin1/src/lib.rs b/gen/oslogin1/src/lib.rs index f45f887bdf..9b8b2c6e1a 100644 --- a/gen/oslogin1/src/lib.rs +++ b/gen/oslogin1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud OS Login* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *oslogin:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud OS Login* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *oslogin:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud OS Login* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/compute/docs/oslogin/). @@ -337,7 +337,7 @@ impl<'a, C, A> CloudOSLogin CloudOSLogin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://oslogin.googleapis.com/".to_string(), _root_url: "https://oslogin.googleapis.com/".to_string(), } @@ -348,7 +348,7 @@ impl<'a, C, A> CloudOSLogin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -394,7 +394,7 @@ pub struct LoginProfile { /// A map from SSH public key fingerprint to the associated key object. #[serde(rename="sshPublicKeys")] pub ssh_public_keys: Option>, - /// A unique user ID. + /// Required. A unique user ID. pub name: Option, } @@ -458,13 +458,15 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SshPublicKey { - /// An expiration time in microseconds since epoch. - #[serde(rename="expirationTimeUsec")] - pub expiration_time_usec: Option, /// Public key text in SSH format, defined by /// RFC4253 /// section 6.6. pub key: Option, + /// Output only. The canonical resource name. + pub name: Option, + /// An expiration time in microseconds since epoch. + #[serde(rename="expirationTimeUsec")] + pub expiration_time_usec: Option, /// Output only. The SHA-256 fingerprint of the SSH public key. pub fingerprint: Option, } @@ -483,8 +485,8 @@ pub struct PosixAccount { pub username: Option, /// The path to the logic shell for this account. pub shell: Option, - /// The user ID. - pub uid: Option, + /// Output only. The canonical resource name. + pub name: Option, /// Only one POSIX account can be marked as primary. pub primary: Option, /// The operating system type where this account applies. @@ -504,6 +506,8 @@ pub struct PosixAccount { /// Output only. A POSIX account identifier. #[serde(rename="accountId")] pub account_id: Option, + /// The user ID. + pub uid: Option, } impl Part for PosixAccount {} @@ -559,7 +563,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - A reference to the POSIX account to update. POSIX accounts are identified + /// * `name` - Required. A reference to the POSIX account to update. POSIX accounts are identified /// by the project ID they are associated with. A reference to the POSIX /// account is in format `users/{user}/projects/{project}`. pub fn projects_delete(&self, name: &str) -> UserProjectDeleteCall<'a, C, A> { @@ -581,7 +585,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The unique ID for the user in format `users/{user}`. + /// * `parent` - Required. The unique ID for the user in format `users/{user}`. pub fn import_ssh_public_key(&self, request: SshPublicKey, parent: &str) -> UserImportSshPublicKeyCall<'a, C, A> { UserImportSshPublicKeyCall { hub: self.hub, @@ -600,7 +604,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The fingerprint of the public key to update. Public keys are identified by + /// * `name` - Required. The fingerprint of the public key to update. Public keys are identified by /// their SHA-256 fingerprint. The fingerprint of the public key is in format /// `users/{user}/sshPublicKeys/{fingerprint}`. pub fn ssh_public_keys_delete(&self, name: &str) -> UserSshPublicKeyDeleteCall<'a, C, A> { @@ -620,7 +624,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique ID for the user in format `users/{user}`. + /// * `name` - Required. The unique ID for the user in format `users/{user}`. pub fn get_login_profile(&self, name: &str) -> UserGetLoginProfileCall<'a, C, A> { UserGetLoginProfileCall { hub: self.hub, @@ -639,7 +643,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The fingerprint of the public key to retrieve. Public keys are identified + /// * `name` - Required. The fingerprint of the public key to retrieve. Public keys are identified /// by their SHA-256 fingerprint. The fingerprint of the public key is in /// format `users/{user}/sshPublicKeys/{fingerprint}`. pub fn ssh_public_keys_get(&self, name: &str) -> UserSshPublicKeyGetCall<'a, C, A> { @@ -660,7 +664,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The fingerprint of the public key to update. Public keys are identified by + /// * `name` - Required. The fingerprint of the public key to update. Public keys are identified by /// their SHA-256 fingerprint. The fingerprint of the public key is in format /// `users/{user}/sshPublicKeys/{fingerprint}`. pub fn ssh_public_keys_patch(&self, request: SshPublicKey, name: &str) -> UserSshPublicKeyPatchCall<'a, C, A> { @@ -859,7 +863,7 @@ impl<'a, C, A> UserProjectDeleteCall<'a, C, A> where C: BorrowMut } - /// A reference to the POSIX account to update. POSIX accounts are identified + /// Required. A reference to the POSIX account to update. POSIX accounts are identified /// by the project ID they are associated with. A reference to the POSIX /// account is in format `users/{user}/projects/{project}`. /// @@ -1147,7 +1151,7 @@ impl<'a, C, A> UserImportSshPublicKeyCall<'a, C, A> where C: BorrowMut UserSshPublicKeyDeleteCall<'a, C, A> where C: BorrowMut UserGetLoginProfileCall<'a, C, A> where C: BorrowMut UserSshPublicKeyGetCall<'a, C, A> where C: BorrowMut UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud OS Login (protocol v1beta)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1_beta-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-oslogin1_beta] path = "../oslogin1_beta" -version = "1.0.12+20190614" +version = "1.0.13+20200329" diff --git a/gen/oslogin1_beta-cli/README.md b/gen/oslogin1_beta-cli/README.md index 5527b8909f..3781e4f648 100644 --- a/gen/oslogin1_beta-cli/README.md +++ b/gen/oslogin1_beta-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud OS Login* API at revision *20190614*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud OS Login* API at revision *20200329*. The CLI is at version *1.0.13*. ```bash oslogin1-beta [options] diff --git a/gen/oslogin1_beta-cli/mkdocs.yml b/gen/oslogin1_beta-cli/mkdocs.yml index a6ca0bd6db..31a90675e8 100644 --- a/gen/oslogin1_beta-cli/mkdocs.yml +++ b/gen/oslogin1_beta-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud OS Login v1.0.12+20190614 +site_name: Cloud OS Login v1.0.13+20200329 site_url: http://byron.github.io/google-apis-rs/google-oslogin1_beta-cli site_description: A complete library to interact with Cloud OS Login (protocol v1beta) diff --git a/gen/oslogin1_beta-cli/src/main.rs b/gen/oslogin1_beta-cli/src/main.rs index d5b09e0dec..f8188c0cec 100644 --- a/gen/oslogin1_beta-cli/src/main.rs +++ b/gen/oslogin1_beta-cli/src/main.rs @@ -128,11 +128,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "key" => Some(("key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time-usec" => Some(("expirationTimeUsec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -375,11 +376,12 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "key" => Some(("key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "expiration-time-usec" => Some(("expirationTimeUsec", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["expiration-time-usec", "fingerprint", "key", "name"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -567,7 +569,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The unique ID for the user in format `users/{user}`."##), + Some(r##"Required. The unique ID for the user in format `users/{user}`."##), Some(true), Some(false)), @@ -619,7 +621,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"A reference to the POSIX account to update. POSIX accounts are identified + Some(r##"Required. A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`."##), Some(true), @@ -643,7 +645,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The fingerprint of the public key to update. Public keys are identified by + Some(r##"Required. The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`."##), Some(true), @@ -667,7 +669,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The fingerprint of the public key to retrieve. Public keys are identified + Some(r##"Required. The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`."##), Some(true), @@ -692,7 +694,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The fingerprint of the public key to update. Public keys are identified by + Some(r##"Required. The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`."##), Some(true), @@ -722,8 +724,8 @@ fn main() { let mut app = App::new("oslogin1-beta") .author("Sebastian Thiel ") - .version("1.0.12+20190614") - .about("You can use OS Login to manage access to your VM instances using IAM roles. For more information, read [OS Login](/compute/docs/oslogin/).") + .version("1.0.13+20200329") + .about("You can use OS Login to manage access to your VM instances using IAM roles.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_oslogin1_beta_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/oslogin1_beta/Cargo.toml b/gen/oslogin1_beta/Cargo.toml index 8b3d324c82..905adbed95 100644 --- a/gen/oslogin1_beta/Cargo.toml +++ b/gen/oslogin1_beta/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-oslogin1_beta" -version = "1.0.12+20190614" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud OS Login (protocol v1beta)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/oslogin1_beta" homepage = "https://cloud.google.com/compute/docs/oslogin/" -documentation = "https://docs.rs/google-oslogin1_beta/1.0.12+20190614" +documentation = "https://docs.rs/google-oslogin1_beta/1.0.13+20200329" license = "MIT" keywords = ["oslogin", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/oslogin1_beta/README.md b/gen/oslogin1_beta/README.md index e3be5010d5..a035299153 100644 --- a/gen/oslogin1_beta/README.md +++ b/gen/oslogin1_beta/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-oslogin1_beta` library allows access to all features of the *Google Cloud OS Login* service. -This documentation was generated from *Cloud OS Login* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *oslogin:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud OS Login* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *oslogin:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud OS Login* *v1_beta* API can be found at the [official documentation site](https://cloud.google.com/compute/docs/oslogin/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.CloudOSLogin.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.CloudOSLogin.html) ... * users - * [*get login profile*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.UserGetLoginProfileCall.html), [*import ssh public key*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.UserImportSshPublicKeyCall.html), [*projects delete*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.UserProjectDeleteCall.html), [*ssh public keys delete*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.UserSshPublicKeyPatchCall.html) + * [*get login profile*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.UserGetLoginProfileCall.html), [*import ssh public key*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.UserImportSshPublicKeyCall.html), [*projects delete*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.UserProjectDeleteCall.html), [*ssh public keys delete*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.UserSshPublicKeyDeleteCall.html), [*ssh public keys get*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.UserSshPublicKeyGetCall.html) and [*ssh public keys patch*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.UserSshPublicKeyPatchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/struct.CloudOSLogin.html)** +* **[Hub](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/struct.CloudOSLogin.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.Part.html)** + * **[Parts](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.RequestValue.html) and -[decodable](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.RequestValue.html) and +[decodable](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-oslogin1_beta/1.0.12+20190614/google_oslogin1_beta/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-oslogin1_beta/1.0.13+20200329/google_oslogin1_beta/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/oslogin1_beta/src/lib.rs b/gen/oslogin1_beta/src/lib.rs index 213e7e0b7d..8fd947642d 100644 --- a/gen/oslogin1_beta/src/lib.rs +++ b/gen/oslogin1_beta/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud OS Login* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *oslogin:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud OS Login* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *oslogin:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud OS Login* *v1_beta* API can be found at the //! [official documentation site](https://cloud.google.com/compute/docs/oslogin/). @@ -345,7 +345,7 @@ impl<'a, C, A> CloudOSLogin CloudOSLogin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://oslogin.googleapis.com/".to_string(), _root_url: "https://oslogin.googleapis.com/".to_string(), } @@ -356,7 +356,7 @@ impl<'a, C, A> CloudOSLogin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -402,7 +402,7 @@ pub struct LoginProfile { /// A map from SSH public key fingerprint to the associated key object. #[serde(rename="sshPublicKeys")] pub ssh_public_keys: Option>, - /// A unique user ID. + /// Required. A unique user ID. pub name: Option, } @@ -466,13 +466,15 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SshPublicKey { - /// An expiration time in microseconds since epoch. - #[serde(rename="expirationTimeUsec")] - pub expiration_time_usec: Option, /// Public key text in SSH format, defined by /// RFC4253 /// section 6.6. pub key: Option, + /// Output only. The canonical resource name. + pub name: Option, + /// An expiration time in microseconds since epoch. + #[serde(rename="expirationTimeUsec")] + pub expiration_time_usec: Option, /// Output only. The SHA-256 fingerprint of the SSH public key. pub fingerprint: Option, } @@ -491,8 +493,8 @@ pub struct PosixAccount { pub username: Option, /// The path to the logic shell for this account. pub shell: Option, - /// The user ID. - pub uid: Option, + /// Output only. The canonical resource name. + pub name: Option, /// Only one POSIX account can be marked as primary. pub primary: Option, /// The operating system type where this account applies. @@ -512,6 +514,8 @@ pub struct PosixAccount { /// Output only. A POSIX account identifier. #[serde(rename="accountId")] pub account_id: Option, + /// The user ID. + pub uid: Option, } impl Part for PosixAccount {} @@ -567,7 +571,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - A reference to the POSIX account to update. POSIX accounts are identified + /// * `name` - Required. A reference to the POSIX account to update. POSIX accounts are identified /// by the project ID they are associated with. A reference to the POSIX /// account is in format `users/{user}/projects/{project}`. pub fn projects_delete(&self, name: &str) -> UserProjectDeleteCall<'a, C, A> { @@ -608,7 +612,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The fingerprint of the public key to update. Public keys are identified by + /// * `name` - Required. The fingerprint of the public key to update. Public keys are identified by /// their SHA-256 fingerprint. The fingerprint of the public key is in format /// `users/{user}/sshPublicKeys/{fingerprint}`. pub fn ssh_public_keys_delete(&self, name: &str) -> UserSshPublicKeyDeleteCall<'a, C, A> { @@ -628,7 +632,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The unique ID for the user in format `users/{user}`. + /// * `name` - Required. The unique ID for the user in format `users/{user}`. pub fn get_login_profile(&self, name: &str) -> UserGetLoginProfileCall<'a, C, A> { UserGetLoginProfileCall { hub: self.hub, @@ -647,7 +651,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The fingerprint of the public key to retrieve. Public keys are identified + /// * `name` - Required. The fingerprint of the public key to retrieve. Public keys are identified /// by their SHA-256 fingerprint. The fingerprint of the public key is in /// format `users/{user}/sshPublicKeys/{fingerprint}`. pub fn ssh_public_keys_get(&self, name: &str) -> UserSshPublicKeyGetCall<'a, C, A> { @@ -668,7 +672,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The fingerprint of the public key to update. Public keys are identified by + /// * `name` - Required. The fingerprint of the public key to update. Public keys are identified by /// their SHA-256 fingerprint. The fingerprint of the public key is in format /// `users/{user}/sshPublicKeys/{fingerprint}`. pub fn ssh_public_keys_patch(&self, request: SshPublicKey, name: &str) -> UserSshPublicKeyPatchCall<'a, C, A> { @@ -867,7 +871,7 @@ impl<'a, C, A> UserProjectDeleteCall<'a, C, A> where C: BorrowMut } - /// A reference to the POSIX account to update. POSIX accounts are identified + /// Required. A reference to the POSIX account to update. POSIX accounts are identified /// by the project ID they are associated with. A reference to the POSIX /// account is in format `users/{user}/projects/{project}`. /// @@ -1410,7 +1414,7 @@ impl<'a, C, A> UserSshPublicKeyDeleteCall<'a, C, A> where C: BorrowMut UserGetLoginProfileCall<'a, C, A> where C: BorrowMut UserSshPublicKeyGetCall<'a, C, A> where C: BorrowMut UserSshPublicKeyPatchCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with pagespeedonline (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-pagespeedonline2] path = "../pagespeedonline2" -version = "1.0.12+20190507" +version = "1.0.13+20191206" diff --git a/gen/pagespeedonline2-cli/README.md b/gen/pagespeedonline2-cli/README.md index 59c1823248..3a351a5540 100644 --- a/gen/pagespeedonline2-cli/README.md +++ b/gen/pagespeedonline2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *pagespeedonline* API at revision *20190507*. The CLI is at version *1.0.12*. +This documentation was generated from the *pagespeedonline* API at revision *20191206*. The CLI is at version *1.0.13*. ```bash pagespeedonline2 [options] diff --git a/gen/pagespeedonline2-cli/mkdocs.yml b/gen/pagespeedonline2-cli/mkdocs.yml index d7f8fc7441..b5074a6bfa 100644 --- a/gen/pagespeedonline2-cli/mkdocs.yml +++ b/gen/pagespeedonline2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: pagespeedonline v1.0.12+20190507 +site_name: pagespeedonline v1.0.13+20191206 site_url: http://byron.github.io/google-apis-rs/google-pagespeedonline2-cli site_description: A complete library to interact with pagespeedonline (protocol v2) diff --git a/gen/pagespeedonline2-cli/src/main.rs b/gen/pagespeedonline2-cli/src/main.rs index 84b28e7d7d..4810693cd5 100644 --- a/gen/pagespeedonline2-cli/src/main.rs +++ b/gen/pagespeedonline2-cli/src/main.rs @@ -238,7 +238,7 @@ fn main() { let mut app = App::new("pagespeedonline2") .author("Sebastian Thiel ") - .version("1.0.12+20190507") + .version("1.0.13+20191206") .about("Analyzes the performance of a web page and provides tailored suggestions to make that page faster.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pagespeedonline2_cli") .arg(Arg::with_name("folder") diff --git a/gen/pagespeedonline2/Cargo.toml b/gen/pagespeedonline2/Cargo.toml index a8e41276a8..7d89749002 100644 --- a/gen/pagespeedonline2/Cargo.toml +++ b/gen/pagespeedonline2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pagespeedonline2" -version = "1.0.12+20190507" +version = "1.0.13+20191206" authors = ["Sebastian Thiel "] description = "A complete library to interact with pagespeedonline (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline2" homepage = "https://developers.google.com/speed/docs/insights/v2/getting-started" -documentation = "https://docs.rs/google-pagespeedonline2/1.0.12+20190507" +documentation = "https://docs.rs/google-pagespeedonline2/1.0.13+20191206" license = "MIT" keywords = ["pagespeedonline", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/pagespeedonline2/README.md b/gen/pagespeedonline2/README.md index 5f0fbab24b..9411640101 100644 --- a/gen/pagespeedonline2/README.md +++ b/gen/pagespeedonline2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-pagespeedonline2` library allows access to all features of the *Google pagespeedonline* service. -This documentation was generated from *pagespeedonline* crate version *1.0.12+20190507*, where *20190507* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *pagespeedonline* crate version *1.0.13+20191206*, where *20191206* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *pagespeedonline* *v2* API can be found at the [official documentation site](https://developers.google.com/speed/docs/insights/v2/getting-started). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/struct.Pagespeedonline.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/struct.Pagespeedonline.html) ... * pagespeedapi - * [*runpagespeed*](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/struct.PagespeedapiRunpagespeedCall.html) + * [*runpagespeed*](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/struct.PagespeedapiRunpagespeedCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/struct.Pagespeedonline.html)** +* **[Hub](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/struct.Pagespeedonline.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.Part.html)** + * **[Parts](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -129,17 +129,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -149,29 +149,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-pagespeedonline2/1.0.12+20190507/google_pagespeedonline2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pagespeedonline2/1.0.13+20191206/google_pagespeedonline2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/pagespeedonline2/src/lib.rs b/gen/pagespeedonline2/src/lib.rs index 6375686dd1..366348f047 100644 --- a/gen/pagespeedonline2/src/lib.rs +++ b/gen/pagespeedonline2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pagespeedonline* crate version *1.0.12+20190507*, where *20190507* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *pagespeedonline* crate version *1.0.13+20191206*, where *20191206* is the exact revision of the *pagespeedonline:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *pagespeedonline* *v2* API can be found at the //! [official documentation site](https://developers.google.com/speed/docs/insights/v2/getting-started). @@ -305,7 +305,7 @@ impl<'a, C, A> Pagespeedonline Pagespeedonline { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/pagespeedonline/v2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -316,7 +316,7 @@ impl<'a, C, A> Pagespeedonline } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/pagespeedonline4-cli/Cargo.toml b/gen/pagespeedonline4-cli/Cargo.toml index 36c4b7cd84..f620194a0c 100644 --- a/gen/pagespeedonline4-cli/Cargo.toml +++ b/gen/pagespeedonline4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pagespeedonline4-cli" -version = "1.0.12+20190507" +version = "1.0.13+20191206" authors = ["Sebastian Thiel "] description = "A complete library to interact with pagespeedonline (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-pagespeedonline4] path = "../pagespeedonline4" -version = "1.0.12+20190507" +version = "1.0.13+20191206" diff --git a/gen/pagespeedonline4-cli/README.md b/gen/pagespeedonline4-cli/README.md index 729479b568..41e29d86c5 100644 --- a/gen/pagespeedonline4-cli/README.md +++ b/gen/pagespeedonline4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *pagespeedonline* API at revision *20190507*. The CLI is at version *1.0.12*. +This documentation was generated from the *pagespeedonline* API at revision *20191206*. The CLI is at version *1.0.13*. ```bash pagespeedonline4 [options] diff --git a/gen/pagespeedonline4-cli/mkdocs.yml b/gen/pagespeedonline4-cli/mkdocs.yml index d401f1c66f..89ee5f05d0 100644 --- a/gen/pagespeedonline4-cli/mkdocs.yml +++ b/gen/pagespeedonline4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: pagespeedonline v1.0.12+20190507 +site_name: pagespeedonline v1.0.13+20191206 site_url: http://byron.github.io/google-apis-rs/google-pagespeedonline4-cli site_description: A complete library to interact with pagespeedonline (protocol v4) diff --git a/gen/pagespeedonline4-cli/src/main.rs b/gen/pagespeedonline4-cli/src/main.rs index 8acebd7107..ecb189c9fe 100644 --- a/gen/pagespeedonline4-cli/src/main.rs +++ b/gen/pagespeedonline4-cli/src/main.rs @@ -247,7 +247,7 @@ fn main() { let mut app = App::new("pagespeedonline4") .author("Sebastian Thiel ") - .version("1.0.12+20190507") + .version("1.0.13+20191206") .about("Analyzes the performance of a web page and provides tailored suggestions to make that page faster.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pagespeedonline4_cli") .arg(Arg::with_name("folder") diff --git a/gen/pagespeedonline4/Cargo.toml b/gen/pagespeedonline4/Cargo.toml index 839c64913e..3c23e3d302 100644 --- a/gen/pagespeedonline4/Cargo.toml +++ b/gen/pagespeedonline4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pagespeedonline4" -version = "1.0.12+20190507" +version = "1.0.13+20191206" authors = ["Sebastian Thiel "] description = "A complete library to interact with pagespeedonline (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline4" homepage = "https://developers.google.com/speed/docs/insights/v4/getting-started" -documentation = "https://docs.rs/google-pagespeedonline4/1.0.12+20190507" +documentation = "https://docs.rs/google-pagespeedonline4/1.0.13+20191206" license = "MIT" keywords = ["pagespeedonline", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/pagespeedonline4/README.md b/gen/pagespeedonline4/README.md index 93f186c8cd..3803f417c3 100644 --- a/gen/pagespeedonline4/README.md +++ b/gen/pagespeedonline4/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-pagespeedonline4` library allows access to all features of the *Google pagespeedonline* service. -This documentation was generated from *pagespeedonline* crate version *1.0.12+20190507*, where *20190507* is the exact revision of the *pagespeedonline:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *pagespeedonline* crate version *1.0.13+20191206*, where *20191206* is the exact revision of the *pagespeedonline:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *pagespeedonline* *v4* API can be found at the [official documentation site](https://developers.google.com/speed/docs/insights/v4/getting-started). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/struct.Pagespeedonline.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/struct.Pagespeedonline.html) ... * pagespeedapi - * [*runpagespeed*](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/struct.PagespeedapiRunpagespeedCall.html) + * [*runpagespeed*](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/struct.PagespeedapiRunpagespeedCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/struct.Pagespeedonline.html)** +* **[Hub](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/struct.Pagespeedonline.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.Part.html)** + * **[Parts](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-pagespeedonline4/1.0.12+20190507/google_pagespeedonline4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pagespeedonline4/1.0.13+20191206/google_pagespeedonline4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/pagespeedonline4/src/lib.rs b/gen/pagespeedonline4/src/lib.rs index bda901ff93..27204ad978 100644 --- a/gen/pagespeedonline4/src/lib.rs +++ b/gen/pagespeedonline4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pagespeedonline* crate version *1.0.12+20190507*, where *20190507* is the exact revision of the *pagespeedonline:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *pagespeedonline* crate version *1.0.13+20191206*, where *20191206* is the exact revision of the *pagespeedonline:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *pagespeedonline* *v4* API can be found at the //! [official documentation site](https://developers.google.com/speed/docs/insights/v4/getting-started). @@ -311,7 +311,7 @@ impl<'a, C, A> Pagespeedonline Pagespeedonline { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/pagespeedonline/v4/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -322,7 +322,7 @@ impl<'a, C, A> Pagespeedonline } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/pagespeedonline5-cli/Cargo.toml b/gen/pagespeedonline5-cli/Cargo.toml index 3c152c7b66..6385936bee 100644 --- a/gen/pagespeedonline5-cli/Cargo.toml +++ b/gen/pagespeedonline5-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-pagespeedonline5-cli" -version = "1.0.12+20190507" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] -description = "A complete library to interact with pagespeedonline (protocol v5)" +description = "A complete library to interact with Pagespeed Insights (protocol v5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline5-cli" -homepage = "https://developers.google.com/speed/docs/insights/v5/get-started" +homepage = "https://developers.google.com/speed/docs/insights/v5/about" documentation = "http://byron.github.io/google-apis-rs/google_pagespeedonline5_cli" license = "MIT" keywords = ["pagespeedonline", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-pagespeedonline5] path = "../pagespeedonline5" -version = "1.0.12+20190507" +version = "1.0.13+20200318" diff --git a/gen/pagespeedonline5-cli/README.md b/gen/pagespeedonline5-cli/README.md index 99e3c3910e..a82cb1e80f 100644 --- a/gen/pagespeedonline5-cli/README.md +++ b/gen/pagespeedonline5-cli/README.md @@ -3,15 +3,15 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `pagespeedonline5` command-line interface *(CLI)* allows to use most features of the *Google pagespeedonline* service from the comfort of your terminal. +The `pagespeedonline5` command-line interface *(CLI)* allows to use most features of the *Google Pagespeed Insights* service from the comfort of your terminal. By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. -Everything else about the *pagespeedonline* API can be found at the -[official documentation site](https://developers.google.com/speed/docs/insights/v5/get-started). +Everything else about the *Pagespeed Insights* API can be found at the +[official documentation site](https://developers.google.com/speed/docs/insights/v5/about). # Installation and Source Code @@ -25,15 +25,19 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *pagespeedonline* API at revision *20190507*. The CLI is at version *1.0.12*. +This documentation was generated from the *Pagespeed Insights* API at revision *20200318*. The CLI is at version *1.0.13*. ```bash pagespeedonline5 [options] pagespeedapi - runpagespeed [-p ]... [-o ] + runpagespeed [-p ]... [-o ] pagespeedonline5 --help Configuration: + [--scope ]... + Specify the authentication a method should be executed in. Each scope + requires the user to grant this application permission to use it. + If unset, it defaults to the shortest scope url for a particular method. --config-dir A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation. diff --git a/gen/pagespeedonline5-cli/mkdocs.yml b/gen/pagespeedonline5-cli/mkdocs.yml index 4c2de7c7d7..25a454fb17 100644 --- a/gen/pagespeedonline5-cli/mkdocs.yml +++ b/gen/pagespeedonline5-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: pagespeedonline v1.0.12+20190507 +site_name: Pagespeed Insights v1.0.13+20200318 site_url: http://byron.github.io/google-apis-rs/google-pagespeedonline5-cli -site_description: A complete library to interact with pagespeedonline (protocol v5) +site_description: A complete library to interact with Pagespeed Insights (protocol v5) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline5-cli diff --git a/gen/pagespeedonline5-cli/src/main.rs b/gen/pagespeedonline5-cli/src/main.rs index 64c4a5f835..ec05a3a538 100644 --- a/gen/pagespeedonline5-cli/src/main.rs +++ b/gen/pagespeedonline5-cli/src/main.rs @@ -39,7 +39,7 @@ enum DoitError { struct Engine<'n> { opt: ArgMatches<'n>, - hub: api::Pagespeedonline>, + hub: api::PagespeedInsights>, gp: Vec<&'static str>, gpm: Vec<(&'static str, &'static str)>, } @@ -48,7 +48,7 @@ struct Engine<'n> { impl<'n> Engine<'n> { fn _pagespeedapi_runpagespeed(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.pagespeedapi().runpagespeed(opt.value_of("url").unwrap_or("")); + let mut call = self.hub.pagespeedapi().runpagespeed(); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { @@ -58,6 +58,9 @@ impl<'n> Engine<'n> { "utm-campaign" => { call = call.utm_campaign(value.unwrap_or("")); }, + "url" => { + call = call.url(value.unwrap_or("")); + }, "strategy" => { call = call.strategy(value.unwrap_or("")); }, @@ -67,6 +70,9 @@ impl<'n> Engine<'n> { "category" => { call = call.add_category(value.unwrap_or("")); }, + "captcha-token" => { + call = call.captcha_token(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -80,7 +86,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["locale", "utm-campaign", "category", "utm-source", "strategy"].iter().map(|v|*v)); + v.extend(["category", "utm-campaign", "captcha-token", "url", "utm-source", "strategy", "locale"].iter().map(|v|*v)); v } )); } } @@ -91,6 +97,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -181,13 +190,16 @@ impl<'n> Engine<'n> { }; let engine = Engine { opt: opt, - hub: api::Pagespeedonline::new(client, auth), - gp: vec!["alt", "fields", "key", "oauth-token", "pretty-print", "quota-user", "user-ip"], + hub: api::PagespeedInsights::new(client, auth), + gp: vec!["$-xgafv", "access-token", "alt", "callback", "fields", "key", "oauth-token", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), ("oauth-token", "oauth_token"), ("pretty-print", "prettyPrint"), ("quota-user", "quotaUser"), - ("user-ip", "userIp"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), ] }; @@ -211,15 +223,11 @@ fn main() { let arg_data = [ ("pagespeedapi", "methods: 'runpagespeed'", vec![ ("runpagespeed", - Some(r##"Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information."##), + Some(r##"Runs PageSpeed analysis on the page at the specified URL, and returns + PageSpeed scores, a list of suggestions to make that page faster, and other + information."##), "Details at http://byron.github.io/google-apis-rs/google_pagespeedonline5_cli/pagespeedapi_runpagespeed", vec![ - (Some(r##"url"##), - None, - Some(r##"The URL to fetch and analyze"##), - Some(true), - Some(false)), - (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), @@ -238,9 +246,15 @@ fn main() { let mut app = App::new("pagespeedonline5") .author("Sebastian Thiel ") - .version("1.0.12+20190507") - .about("Analyzes the performance of a web page and provides tailored suggestions to make that page faster.") + .version("1.0.13+20200318") + .about("The PageSpeed Insights API lets you analyze the performance of your website with a simple API. It offers tailored suggestions for how you can optimize your site, and lets you easily integrate PageSpeed Insights analysis into your development tools and workflow. + ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pagespeedonline5_cli") + .arg(Arg::with_name("url") + .long("scope") + .help("Specify the authentication a method should be executed in. Each scope requires the user to grant this application permission to use it.If unset, it defaults to the shortest scope url for a particular method.") + .multiple(true) + .takes_value(true)) .arg(Arg::with_name("folder") .long("config-dir") .help("A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation.[default: ~/.google-service-cli") diff --git a/gen/pagespeedonline5/Cargo.toml b/gen/pagespeedonline5/Cargo.toml index be61dc8065..2efe3dca6d 100644 --- a/gen/pagespeedonline5/Cargo.toml +++ b/gen/pagespeedonline5/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pagespeedonline5" -version = "1.0.12+20190507" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] -description = "A complete library to interact with pagespeedonline (protocol v5)" +description = "A complete library to interact with Pagespeed Insights (protocol v5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline5" -homepage = "https://developers.google.com/speed/docs/insights/v5/get-started" -documentation = "https://docs.rs/google-pagespeedonline5/1.0.12+20190507" +homepage = "https://developers.google.com/speed/docs/insights/v5/about" +documentation = "https://docs.rs/google-pagespeedonline5/1.0.13+20200318" license = "MIT" keywords = ["pagespeedonline", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/pagespeedonline5/README.md b/gen/pagespeedonline5/README.md index 51a2cc11a1..dd3f110506 100644 --- a/gen/pagespeedonline5/README.md +++ b/gen/pagespeedonline5/README.md @@ -3,18 +3,18 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-pagespeedonline5` library allows access to all features of the *Google pagespeedonline* service. +The `google-pagespeedonline5` library allows access to all features of the *Google Pagespeed Insights* service. -This documentation was generated from *pagespeedonline* crate version *1.0.12+20190507*, where *20190507* is the exact revision of the *pagespeedonline:v5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Pagespeed Insights* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *pagespeedonline:v5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. -Everything else about the *pagespeedonline* *v5* API can be found at the -[official documentation site](https://developers.google.com/speed/docs/insights/v5/get-started). +Everything else about the *Pagespeed Insights* *v5* API can be found at the +[official documentation site](https://developers.google.com/speed/docs/insights/v5/about). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/struct.Pagespeedonline.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/struct.PagespeedInsights.html) ... * pagespeedapi - * [*runpagespeed*](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/struct.PagespeedapiRunpagespeedCall.html) + * [*runpagespeed*](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/struct.PagespeedapiRunpagespeedCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/struct.Pagespeedonline.html)** +* **[Hub](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/struct.PagespeedInsights.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.Part.html)** + * **[Parts](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -84,7 +84,7 @@ extern crate google_pagespeedonline5 as pagespeedonline5; use pagespeedonline5::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -use pagespeedonline5::Pagespeedonline; +use pagespeedonline5::PagespeedInsights; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. @@ -97,16 +97,18 @@ let secret: ApplicationSecret = Default::default(); let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); -let mut hub = Pagespeedonline::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +let mut hub = PagespeedInsights::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); // 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.pagespeedapi().runpagespeed("url") - .utm_source("sit") - .utm_campaign("Stet") +let result = hub.pagespeedapi().runpagespeed() + .utm_source("eirmod") + .utm_campaign("sit") + .url("Stet") .strategy("sed") .locale("et") .add_category("dolores") + .captcha_token("kasd") .doit(); match result { @@ -129,17 +131,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -149,29 +151,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-pagespeedonline5/1.0.12+20190507/google_pagespeedonline5/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pagespeedonline5/1.0.13+20200318/google_pagespeedonline5/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/pagespeedonline5/src/lib.rs b/gen/pagespeedonline5/src/lib.rs index 38c7c0ce6b..a72a49f14b 100644 --- a/gen/pagespeedonline5/src/lib.rs +++ b/gen/pagespeedonline5/src/lib.rs @@ -2,14 +2,14 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pagespeedonline* crate version *1.0.12+20190507*, where *20190507* is the exact revision of the *pagespeedonline:v5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Pagespeed Insights* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *pagespeedonline:v5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! -//! Everything else about the *pagespeedonline* *v5* API can be found at the -//! [official documentation site](https://developers.google.com/speed/docs/insights/v5/get-started). +//! Everything else about the *Pagespeed Insights* *v5* API can be found at the +//! [official documentation site](https://developers.google.com/speed/docs/insights/v5/about). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/pagespeedonline5). //! # Features //! -//! Handle the following *Resources* with ease from the central [hub](struct.Pagespeedonline.html) ... +//! Handle the following *Resources* with ease from the central [hub](struct.PagespeedInsights.html) ... //! //! * pagespeedapi //! * [*runpagespeed*](struct.PagespeedapiRunpagespeedCall.html) @@ -23,7 +23,7 @@ //! //! The API is structured into the following primary items: //! -//! * **[Hub](struct.Pagespeedonline.html)** +//! * **[Hub](struct.PagespeedInsights.html)** //! * a central object to maintain state and allow accessing all *Activities* //! * creates [*Method Builders*](trait.MethodsBuilder.html) which in turn //! allow access to individual [*Call Builders*](trait.CallBuilder.html) @@ -85,7 +85,7 @@ //! # #[test] fn egal() { //! use std::default::Default; //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -//! use pagespeedonline5::Pagespeedonline; +//! use pagespeedonline5::PagespeedInsights; //! //! // Get an ApplicationSecret instance by some means. It contains the `client_id` and //! // `client_secret`, among other things. @@ -98,16 +98,18 @@ //! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); -//! let mut hub = Pagespeedonline::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +//! let mut hub = PagespeedInsights::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); //! // 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.pagespeedapi().runpagespeed("url") +//! let result = hub.pagespeedapi().runpagespeed() //! .utm_source("accusam") //! .utm_campaign("takimata") -//! .strategy("justo") -//! .locale("amet.") -//! .add_category("erat") +//! .url("justo") +//! .strategy("amet.") +//! .locale("erat") +//! .add_category("labore") +//! .captcha_token("sea") //! .doit(); //! //! match result { @@ -223,6 +225,28 @@ pub use cmn::*; // UTILITIES ### // ############ +/// Identifies the an OAuth2 authorization scope. +/// A scope is needed when requesting an +/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). +#[derive(PartialEq, Eq, Hash)] +pub enum Scope { + /// Associate you with your personal info on Google + Openid, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Openid => "openid", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Openid + } +} @@ -230,7 +254,7 @@ pub use cmn::*; // HUB ### // ###### -/// Central instance to access all Pagespeedonline related resource activities +/// Central instance to access all PagespeedInsights related resource activities /// /// # Examples /// @@ -245,7 +269,7 @@ pub use cmn::*; /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use pagespeedonline5::Pagespeedonline; +/// use pagespeedonline5::PagespeedInsights; /// /// // Get an ApplicationSecret instance by some means. It contains the `client_id` and /// // `client_secret`, among other things. @@ -258,16 +282,18 @@ pub use cmn::*; /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); -/// let mut hub = Pagespeedonline::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// let mut hub = PagespeedInsights::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // 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.pagespeedapi().runpagespeed("url") -/// .utm_source("sea") -/// .utm_campaign("nonumy") -/// .strategy("dolores") -/// .locale("gubergren") -/// .add_category("sadipscing") +/// let result = hub.pagespeedapi().runpagespeed() +/// .utm_source("nonumy") +/// .utm_campaign("dolores") +/// .url("gubergren") +/// .strategy("sadipscing") +/// .locale("aliquyam") +/// .add_category("ea") +/// .captcha_token("no") /// .doit(); /// /// match result { @@ -288,7 +314,7 @@ pub use cmn::*; /// } /// # } /// ``` -pub struct Pagespeedonline { +pub struct PagespeedInsights { client: RefCell, auth: RefCell, _user_agent: String, @@ -296,18 +322,18 @@ pub struct Pagespeedonline { _root_url: String, } -impl<'a, C, A> Hub for Pagespeedonline {} +impl<'a, C, A> Hub for PagespeedInsights {} -impl<'a, C, A> Pagespeedonline +impl<'a, C, A> PagespeedInsights where C: BorrowMut, A: oauth2::GetToken { - pub fn new(client: C, authenticator: A) -> Pagespeedonline { - Pagespeedonline { + pub fn new(client: C, authenticator: A) -> PagespeedInsights { + PagespeedInsights { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), - _base_url: "https://www.googleapis.com/pagespeedonline/v5/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), + _base_url: "https://pagespeedonline.googleapis.com/".to_string(), + _root_url: "https://pagespeedonline.googleapis.com/".to_string(), } } @@ -316,7 +342,7 @@ impl<'a, C, A> Pagespeedonline } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -324,7 +350,7 @@ impl<'a, C, A> Pagespeedonline } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/pagespeedonline/v5/`. + /// It defaults to `https://pagespeedonline.googleapis.com/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -332,7 +358,7 @@ impl<'a, C, A> Pagespeedonline } /// Set the root url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/`. + /// It defaults to `https://pagespeedonline.googleapis.com/`. /// /// Returns the previously set root url. pub fn root_url(&mut self, new_root_url: String) -> String { @@ -344,7 +370,7 @@ impl<'a, C, A> Pagespeedonline // ############ // SCHEMAS ### // ########## -/// There is no detailed description. +/// The Pagespeed API response object. /// /// # Activities /// @@ -360,13 +386,14 @@ pub struct PagespeedApiPagespeedResponseV5 { /// The captcha verify result #[serde(rename="captchaResult")] pub captcha_result: Option, - /// Canonicalized and final URL for the document, after following page redirects (if any). + /// Canonicalized and final URL for the document, after following page + /// redirects (if any). pub id: Option, /// Metrics of end users' page loading experience. #[serde(rename="loadingExperience")] pub loading_experience: Option, /// The version of PageSpeed used to generate these results. - pub version: Option, + pub version: Option, /// The UTC timestamp of this analysis. #[serde(rename="analysisUTCTimestamp")] pub analysis_utc_timestamp: Option, @@ -381,74 +408,146 @@ pub struct PagespeedApiPagespeedResponseV5 { impl ResponseResult for PagespeedApiPagespeedResponseV5 {} -/// Timing information for this LHR. +/// Message containing the configuration settings for the Lighthouse run. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5Timing { - /// The total duration of Lighthouse's run. - pub total: Option, +pub struct ConfigSettings { + /// The locale setting. + pub locale: Option, + /// List of categories of audits the run should conduct. + #[serde(rename="onlyCategories")] + pub only_categories: Option, + /// The form factor the emulation should use. + #[serde(rename="emulatedFormFactor")] + pub emulated_form_factor: Option, + /// How Lighthouse was run, e.g. from the Chrome extension or from the npm + /// module. + pub channel: Option, } -impl NestedType for LighthouseResultV5Timing {} -impl Part for LighthouseResultV5Timing {} +impl Part for ConfigSettings {} -/// Map of categories in the LHR. +/// Message containing a runtime error config. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5Categories { - /// The Search-Engine-Optimization (SEO) category, containing all seo related audits. - pub seo: Option, - /// The best practices category, containing all web best practice related audits. - #[serde(rename="best-practices")] - pub best_practices: Option, - /// The performance category, containing all performance related audits. - pub performance: Option, - /// The accessibility category, containing all accessibility related audits. - pub accessibility: Option, - /// The Progressive-Web-App (PWA) category, containing all pwa related audits. - pub pwa: Option, +pub struct RuntimeError { + /// A human readable message explaining the error code. + pub message: Option, + /// The enumerated Lighthouse Error code. + pub code: Option, } -impl NestedType for LighthouseResultV5Categories {} -impl Part for LighthouseResultV5Categories {} +impl Part for RuntimeError {} -/// There is no detailed description. +/// Message holding the formatted strings used in the renderer. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseCategoryV5 { - /// A description for the manual audits in the category. - #[serde(rename="manualDescription")] - pub manual_description: Option, - /// no description provided - pub score: Option, - /// A more detailed description of the category and its importance. - pub description: Option, - /// The human-friendly name of the category. - pub title: Option, - /// An array of references to all the audit members of this category. - #[serde(rename="auditRefs")] - pub audit_refs: Option>, - /// The string identifier of the category. - pub id: Option, +pub struct RendererFormattedStrings { + /// The heading that is shown above a list of audits that are passing. + #[serde(rename="passedAuditsGroupTitle")] + pub passed_audits_group_title: Option, + /// The tooltip text on an expandable chevron icon. + #[serde(rename="auditGroupExpandTooltip")] + pub audit_group_expand_tooltip: Option, + /// The heading for the estimated page load savings of opportunity audits. + #[serde(rename="opportunitySavingsColumnLabel")] + pub opportunity_savings_column_label: Option, + /// The error string shown next to an erroring audit. + #[serde(rename="errorMissingAuditInfo")] + pub error_missing_audit_info: Option, + /// The disclaimer shown under performance explaning that the network can + /// vary. + #[serde(rename="lsPerformanceCategoryDescription")] + pub ls_performance_category_description: Option, + /// The heading shown above a list of audits that were not computerd in the + /// run. + #[serde(rename="manualAuditsGroupTitle")] + pub manual_audits_group_title: Option, + /// The heading shown above a list of audits that do not apply to a page. + #[serde(rename="notApplicableAuditsGroupTitle")] + pub not_applicable_audits_group_title: Option, + /// The label that explains the score gauges scale (0-49, 50-89, 90-100). + #[serde(rename="scorescaleLabel")] + pub scorescale_label: Option, + /// The disclaimer shown below a performance metric value. + #[serde(rename="varianceDisclaimer")] + pub variance_disclaimer: Option, + /// The title of the lab data performance category. + #[serde(rename="labDataTitle")] + pub lab_data_title: Option, + /// The label shown above a bulleted list of warnings. + #[serde(rename="warningHeader")] + pub warning_header: Option, + /// The label shown preceding important warnings that may have invalidated + /// an entire report. + #[serde(rename="toplevelWarningsMessage")] + pub toplevel_warnings_message: Option, + /// The label for values shown in the summary of critical request chains. + #[serde(rename="crcLongestDurationLabel")] + pub crc_longest_duration_label: Option, + /// The label shown next to an audit or metric that has had an error. + #[serde(rename="errorLabel")] + pub error_label: Option, + /// The heading for the estimated page load savings opportunity of an + /// audit. + #[serde(rename="opportunityResourceColumnLabel")] + pub opportunity_resource_column_label: Option, + /// The label for the initial request in a critical request chain. + #[serde(rename="crcInitialNavigation")] + pub crc_initial_navigation: Option, } -impl Part for LighthouseCategoryV5 {} +impl Part for RendererFormattedStrings {} -/// Environment settings that were used when making this LHR. +/// A proportion of data in the total distribution, bucketed by a min/max +/// percentage. Each bucket's range is bounded by min <= x < max, In +/// millisecond. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5Environment { +pub struct Bucket { + /// Upper bound for a bucket's range. + pub max: Option, + /// The proportion of data in this bucket. + pub proportion: Option, + /// Lower bound for a bucket's range. + pub min: Option, +} + +impl Part for Bucket {} + + +/// The Pagespeed Version object. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PagespeedVersion { + /// The major version number of PageSpeed used to generate these results. + pub major: Option, + /// The minor version number of PageSpeed used to generate these results. + pub minor: Option, +} + +impl Part for PagespeedVersion {} + + +/// Message containing environment configuration for a Lighthouse run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Environment { /// The benchmark index number that indicates rough device class. #[serde(rename="benchmarkIndex")] pub benchmark_index: Option, @@ -460,141 +559,86 @@ pub struct LighthouseResultV5Environment { pub host_user_agent: Option, } -impl NestedType for LighthouseResultV5Environment {} -impl Part for LighthouseResultV5Environment {} +impl Part for Environment {} -/// Internationalized strings that are formatted to the locale in configSettings. +/// Message containing the i18n data for the LHR - Version 1. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5I18nRendererFormattedStrings { - /// The heading that is shown above a list of audits that are passing. - #[serde(rename="passedAuditsGroupTitle")] - pub passed_audits_group_title: Option, - /// The tooltip text on an expandable chevron icon. - #[serde(rename="auditGroupExpandTooltip")] - pub audit_group_expand_tooltip: Option, - /// The disclaimer shown below a performance metric value. - #[serde(rename="varianceDisclaimer")] - pub variance_disclaimer: Option, - /// The heading for the estimated page load savings of opportunity audits. - #[serde(rename="opportunitySavingsColumnLabel")] - pub opportunity_savings_column_label: Option, - /// The error string shown next to an erroring audit. - #[serde(rename="errorMissingAuditInfo")] - pub error_missing_audit_info: Option, - /// The disclaimer shown under performance explaning that the network can vary. - #[serde(rename="lsPerformanceCategoryDescription")] - pub ls_performance_category_description: Option, - /// The heading shown above a list of audits that were not computerd in the run. - #[serde(rename="manualAuditsGroupTitle")] - pub manual_audits_group_title: Option, - /// The heading shown above a list of audits that do not apply to a page. - #[serde(rename="notApplicableAuditsGroupTitle")] - pub not_applicable_audits_group_title: Option, - /// The label that explains the score gauges scale (0-49, 50-89, 90-100). - #[serde(rename="scorescaleLabel")] - pub scorescale_label: Option, - /// The label shown above a bulleted list of warnings. - #[serde(rename="warningHeader")] - pub warning_header: Option, - /// The title of the lab data performance category. - #[serde(rename="labDataTitle")] - pub lab_data_title: Option, - /// The label shown preceding important warnings that may have invalidated an entire report. - #[serde(rename="toplevelWarningsMessage")] - pub toplevel_warnings_message: Option, - /// The label for values shown in the summary of critical request chains. - #[serde(rename="crcLongestDurationLabel")] - pub crc_longest_duration_label: Option, - /// The label shown next to an audit or metric that has had an error. - #[serde(rename="errorLabel")] - pub error_label: Option, - /// The heading for the estimated page load savings opportunity of an audit. - #[serde(rename="opportunityResourceColumnLabel")] - pub opportunity_resource_column_label: Option, - /// The label for the initial request in a critical request chain. - #[serde(rename="crcInitialNavigation")] - pub crc_initial_navigation: Option, +pub struct I18n { + /// Internationalized strings that are formatted to the locale in + /// configSettings. + #[serde(rename="rendererFormattedStrings")] + pub renderer_formatted_strings: Option, } -impl NestedType for LighthouseResultV5I18nRendererFormattedStrings {} -impl Part for LighthouseResultV5I18nRendererFormattedStrings {} +impl Part for I18n {} -/// A grouping contained in a category that groups similar audits together. +/// A Lighthouse category. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5CategoryGroups { - /// An optional human readable description of the category group. +pub struct LighthouseCategoryV5 { + /// A description for the manual audits in the category. + #[serde(rename="manualDescription")] + pub manual_description: Option, + /// The overall score of the category, the weighted average of all its audits. + /// (The category's score, can be null.) + pub score: Option, + /// A more detailed description of the category and its importance. pub description: Option, - /// The title of the category group. + /// The human-friendly name of the category. + pub title: Option, + /// An array of references to all the audit members of this category. + #[serde(rename="auditRefs")] + pub audit_refs: Option>, + /// The string identifier of the category. + pub id: Option, +} + +impl Part for LighthouseCategoryV5 {} + + +/// Message containing a category +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CategoryGroupV5 { + /// The description of what the category is grouping + pub description: Option, + /// The human readable title of the group pub title: Option, } -impl NestedType for LighthouseResultV5CategoryGroups {} -impl Part for LighthouseResultV5CategoryGroups {} +impl Part for CategoryGroupV5 {} -/// The configuration settings for this LHR. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5ConfigSettings { - /// The locale setting. - pub locale: Option, - /// no description provided - #[serde(rename="onlyCategories")] - pub only_categories: Option, - /// The form factor the emulation should use. - #[serde(rename="emulatedFormFactor")] - pub emulated_form_factor: Option, -} - -impl NestedType for LighthouseResultV5ConfigSettings {} -impl Part for LighthouseResultV5ConfigSettings {} - - -/// The internationalization strings that are required to render the LHR. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5I18n { - /// Internationalized strings that are formatted to the locale in configSettings. - #[serde(rename="rendererFormattedStrings")] - pub renderer_formatted_strings: Option, -} - -impl NestedType for LighthouseResultV5I18n {} -impl Part for LighthouseResultV5I18n {} - - -/// There is no detailed description. +/// The Lighthouse result object. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LighthouseResultV5 { /// Environment settings that were used when making this LHR. - pub environment: Option, + pub environment: Option, /// The time that this run was fetched. #[serde(rename="fetchTime")] pub fetch_time: Option, /// Map of category groups in the LHR. #[serde(rename="categoryGroups")] - pub category_groups: Option>, + pub category_groups: Option>, /// The configuration settings for this LHR. #[serde(rename="configSettings")] - pub config_settings: Option, - /// A top-level error message that, if present, indicates a serious enough problem that this Lighthouse result may need to be discarded. + pub config_settings: Option, + /// A top-level error message that, if present, indicates a serious enough + /// problem that this Lighthouse result may need to be discarded. #[serde(rename="runtimeError")] - pub runtime_error: Option, + pub runtime_error: Option, /// The final resolved url that was audited. #[serde(rename="finalUrl")] pub final_url: Option, @@ -603,21 +647,21 @@ pub struct LighthouseResultV5 { pub lighthouse_version: Option, /// The Stack Pack advice strings. #[serde(rename="stackPacks")] - pub stack_packs: Option>, + pub stack_packs: Option>, /// The internationalization strings that are required to render the LHR. - pub i18n: Option, - /// List of all run warnings in the LHR. Will always output to at least `[]`. + pub i18n: Option, + /// List of all run warnings in the LHR. Will always output to at least `[]`. #[serde(rename="runWarnings")] pub run_warnings: Option>, /// Timing information for this LHR. - pub timing: Option, + pub timing: Option, /// The user agent that was used to run this LHR. #[serde(rename="userAgent")] pub user_agent: Option, /// Map of audits in the LHR. pub audits: Option>, /// Map of categories in the LHR. - pub categories: Option, + pub categories: Option, /// The original requested url. #[serde(rename="requestedUrl")] pub requested_url: Option, @@ -626,46 +670,13 @@ pub struct LighthouseResultV5 { impl Part for LighthouseResultV5 {} -/// There is no detailed description. +/// A light reference to an audit by id, used to group and weight audits in a +/// given category. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PagespeedApiLoadingExperienceV5MetricsDistributions { - /// no description provided - pub max: Option, - /// no description provided - pub proportion: Option, - /// no description provided - pub min: Option, -} - -impl NestedType for PagespeedApiLoadingExperienceV5MetricsDistributions {} -impl Part for PagespeedApiLoadingExperienceV5MetricsDistributions {} - - -/// A top-level error message that, if present, indicates a serious enough problem that this Lighthouse result may need to be discarded. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5RuntimeError { - /// A human readable message explaining the error code. - pub message: Option, - /// The enumerated Lighthouse Error code. - pub code: Option, -} - -impl NestedType for LighthouseResultV5RuntimeError {} -impl Part for LighthouseResultV5RuntimeError {} - - -/// An array of references to all the audit members of this category. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseCategoryV5AuditRefs { +pub struct AuditRefs { /// The category group that the audit belongs to (optional). pub group: Option, /// The audit ref id. @@ -674,72 +685,79 @@ pub struct LighthouseCategoryV5AuditRefs { pub weight: Option, } -impl NestedType for LighthouseCategoryV5AuditRefs {} -impl Part for LighthouseCategoryV5AuditRefs {} +impl Part for AuditRefs {} -/// The version of PageSpeed used to generate these results. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PagespeedApiPagespeedResponseV5Version { - /// The major version number of PageSpeed used to generate these results. - pub major: Option, - /// The minor version number of PageSpeed used to generate these results. - pub minor: Option, -} - -impl NestedType for PagespeedApiPagespeedResponseV5Version {} -impl Part for PagespeedApiPagespeedResponseV5Version {} - - -/// There is no detailed description. +/// The CrUX loading experience object that contains CrUX data breakdowns. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PagespeedApiLoadingExperienceV5 { - /// no description provided - pub metrics: Option>, + /// The map of . + pub metrics: Option>, /// The url, pattern or origin which the metrics are on. pub id: Option, - /// no description provided + /// The human readable speed "category" of the id. pub overall_category: Option, - /// no description provided + /// The requested URL, which may differ from the resolved "id". pub initial_url: Option, } impl Part for PagespeedApiLoadingExperienceV5 {} -/// The Stack Pack advice strings. +/// A CrUX metric object for a single metric and form factor. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LighthouseResultV5StackPacks { - /// The stack pack advice strings. - pub descriptions: Option>, - /// The stack pack id. - pub id: Option, - /// The stack pack icon data uri. - #[serde(rename="iconDataURL")] - pub icon_data_url: Option, - /// The stack pack title. - pub title: Option, +pub struct UserPageLoadMetricV5 { + /// The category of the specific time metric. + pub category: Option, + /// Identifies the form factor of the metric being collected. + #[serde(rename="formFactor")] + pub form_factor: Option, + /// We use this field to store certain percentile value for this metric. + /// For v4, this field contains pc50. + /// For v5, this field contains pc90. + pub percentile: Option, + /// Metric distributions. Proportions should sum up to 1. + pub distributions: Option>, + /// Identifies the type of the metric. + #[serde(rename="metricId")] + pub metric_id: Option, + /// The median number of the metric, in millisecond. + pub median: Option, } -impl NestedType for LighthouseResultV5StackPacks {} -impl Part for LighthouseResultV5StackPacks {} +impl Part for UserPageLoadMetricV5 {} -/// There is no detailed description. +/// Message containing the performance timing data for the Lighthouse run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Timing { + /// The total duration of Lighthouse's run. + pub total: Option, +} + +impl Part for Timing {} + + +/// An audit's result object in a Lighthouse result. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LighthouseAuditResultV5 { + /// A numeric value that has a meaning specific to the audit, e.g. the number + /// of nodes in the DOM or the timestamp of a specific load event. More + /// information can be found in the audit details, if present. + #[serde(rename="numericValue")] + pub numeric_value: Option, /// The description of the audit. pub description: Option, /// The human readable title. @@ -749,11 +767,11 @@ pub struct LighthouseAuditResultV5 { /// An error message from a thrown error inside the audit. #[serde(rename="errorMessage")] pub error_message: Option, - /// no description provided + /// The score of the audit, can be null. pub score: Option, /// Freeform details section of the audit. pub details: Option>, - /// no description provided + /// Possible warnings that occurred in the audit, can be null. pub warnings: Option, /// The value that should be displayed on the UI for this audit. #[serde(rename="displayValue")] @@ -768,22 +786,49 @@ pub struct LighthouseAuditResultV5 { impl Part for LighthouseAuditResultV5 {} -/// The type of the metric. +/// Message containing Stack Pack information. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PagespeedApiLoadingExperienceV5Metrics { - /// no description provided - pub category: Option, - /// no description provided - pub percentile: Option, - /// no description provided - pub distributions: Option>, +pub struct StackPack { + /// The stack pack id. + pub id: Option, + /// The stack pack advice strings. + pub descriptions: Option>, + /// The stack pack icon data uri. + #[serde(rename="iconDataURL")] + pub icon_data_url: Option, + /// The stack pack title. + pub title: Option, } -impl NestedType for PagespeedApiLoadingExperienceV5Metrics {} -impl Part for PagespeedApiLoadingExperienceV5Metrics {} +impl Part for StackPack {} + + +/// The categories in a Lighthouse run. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Categories { + /// The Search-Engine-Optimization (SEO) category, containing all seo related + /// audits. + pub seo: Option, + /// The best practices category, containing all best practices related + /// audits. + #[serde(rename="best-practices")] + pub best_practices: Option, + /// The performance category, containing all performance related audits. + pub performance: Option, + /// The accessibility category, containing all accessibility related audits. + pub accessibility: Option, + /// The Progressive-Web-App (PWA) category, containing all pwa related + /// audits. + pub pwa: Option, +} + +impl Part for Categories {} @@ -792,7 +837,7 @@ impl Part for PagespeedApiLoadingExperienceV5Metrics {} // ################# /// A builder providing access to all methods supported on *pagespeedapi* resources. -/// It is not used directly, but through the `Pagespeedonline` hub. +/// It is not used directly, but through the `PagespeedInsights` hub. /// /// # Example /// @@ -807,13 +852,13 @@ impl Part for PagespeedApiLoadingExperienceV5Metrics {} /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use pagespeedonline5::Pagespeedonline; +/// use pagespeedonline5::PagespeedInsights; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); -/// let mut hub = Pagespeedonline::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// let mut hub = PagespeedInsights::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `runpagespeed(...)` /// // to build up your call. @@ -823,7 +868,7 @@ impl Part for PagespeedApiLoadingExperienceV5Metrics {} pub struct PagespeedapiMethods<'a, C, A> where C: 'a, A: 'a { - hub: &'a Pagespeedonline, + hub: &'a PagespeedInsights, } impl<'a, C, A> MethodsBuilder for PagespeedapiMethods<'a, C, A> {} @@ -832,21 +877,21 @@ impl<'a, C, A> PagespeedapiMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information. - /// - /// # Arguments - /// - /// * `url` - The URL to fetch and analyze - pub fn runpagespeed(&self, url: &str) -> PagespeedapiRunpagespeedCall<'a, C, A> { + /// Runs PageSpeed analysis on the page at the specified URL, and returns + /// PageSpeed scores, a list of suggestions to make that page faster, and other + /// information. + pub fn runpagespeed(&self) -> PagespeedapiRunpagespeedCall<'a, C, A> { PagespeedapiRunpagespeedCall { hub: self.hub, - _url: url.to_string(), _utm_source: Default::default(), _utm_campaign: Default::default(), + _url: Default::default(), _strategy: Default::default(), _locale: Default::default(), _category: Default::default(), + _captcha_token: Default::default(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -860,7 +905,9 @@ impl<'a, C, A> PagespeedapiMethods<'a, C, A> { // CallBuilders ### // ################# -/// Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information. +/// Runs PageSpeed analysis on the page at the specified URL, and returns +/// PageSpeed scores, a list of suggestions to make that page faster, and other +/// information. /// /// A builder for the *runpagespeed* method supported by a *pagespeedapi* resource. /// It is not used directly, but through a `PagespeedapiMethods` instance. @@ -877,37 +924,41 @@ impl<'a, C, A> PagespeedapiMethods<'a, C, A> { /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use pagespeedonline5::Pagespeedonline; +/// # use pagespeedonline5::PagespeedInsights; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); -/// # let mut hub = Pagespeedonline::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// # let mut hub = PagespeedInsights::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // 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.pagespeedapi().runpagespeed("url") -/// .utm_source("ea") -/// .utm_campaign("no") -/// .strategy("justo") -/// .locale("justo") -/// .add_category("et") +/// let result = hub.pagespeedapi().runpagespeed() +/// .utm_source("justo") +/// .utm_campaign("justo") +/// .url("et") +/// .strategy("et") +/// .locale("diam") +/// .add_category("ipsum") +/// .captcha_token("Lorem") /// .doit(); /// # } /// ``` pub struct PagespeedapiRunpagespeedCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a Pagespeedonline, - _url: String, + hub: &'a PagespeedInsights, _utm_source: Option, _utm_campaign: Option, + _url: Option, _strategy: Option, _locale: Option, _category: Vec, + _captcha_token: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for PagespeedapiRunpagespeedCall<'a, C, A> {} @@ -926,14 +977,16 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(8 + self._additional_params.len()); - params.push(("url", self._url.to_string())); + let mut params: Vec<(&str, String)> = Vec::with_capacity(9 + self._additional_params.len()); if let Some(value) = self._utm_source { params.push(("utm_source", value.to_string())); } if let Some(value) = self._utm_campaign { params.push(("utm_campaign", value.to_string())); } + if let Some(value) = self._url { + params.push(("url", value.to_string())); + } if let Some(value) = self._strategy { params.push(("strategy", value.to_string())); } @@ -945,7 +998,10 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + let mut url = self.hub._base_url.clone() + "pagespeedonline/v5/runPagespeed"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Openid.as_ref().to_string(), ()); } @@ -977,10 +1024,24 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())); + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -1031,16 +1092,6 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut PagespeedapiRunpagespeedCall<'a, C, A> { - self._url = new_value.to_string(); - self - } /// Campaign source for analytics. /// /// Sets the *utm_source* query property to the given value. @@ -1055,7 +1106,15 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut PagespeedapiRunpagespeedCall<'a, C, A> { + self._url = Some(new_value.to_string()); + self + } + /// The analysis strategy (desktop or mobile) to use, and desktop is the + /// default /// /// Sets the *strategy* query property to the given value. pub fn strategy(mut self, new_value: &str) -> PagespeedapiRunpagespeedCall<'a, C, A> { @@ -1069,7 +1128,8 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut PagespeedapiRunpagespeedCall<'a, C, A> { + self._captcha_token = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -1097,19 +1164,46 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> PagespeedapiRunpagespeedCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Openid`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PagespeedapiRunpagespeedCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } } diff --git a/gen/partners2-cli/Cargo.toml b/gen/partners2-cli/Cargo.toml index 5e1c261b8e..5d7bd06825 100644 --- a/gen/partners2-cli/Cargo.toml +++ b/gen/partners2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-partners2-cli" -version = "1.0.12+20180925" +version = "1.0.13+20180925" authors = ["Sebastian Thiel "] description = "A complete library to interact with Partners (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/partners2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-partners2] path = "../partners2" -version = "1.0.12+20180925" +version = "1.0.13+20180925" diff --git a/gen/partners2-cli/README.md b/gen/partners2-cli/README.md index c5c0b4821d..3fa5208f98 100644 --- a/gen/partners2-cli/README.md +++ b/gen/partners2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Partners* API at revision *20180925*. The CLI is at version *1.0.12*. +This documentation was generated from the *Partners* API at revision *20180925*. The CLI is at version *1.0.13*. ```bash partners2 [options] diff --git a/gen/partners2-cli/mkdocs.yml b/gen/partners2-cli/mkdocs.yml index 1c93e8c7ce..c16b137fe9 100644 --- a/gen/partners2-cli/mkdocs.yml +++ b/gen/partners2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Partners v1.0.12+20180925 +site_name: Partners v1.0.13+20180925 site_url: http://byron.github.io/google-apis-rs/google-partners2-cli site_description: A complete library to interact with Partners (protocol v2) diff --git a/gen/partners2-cli/src/main.rs b/gen/partners2-cli/src/main.rs index ac646bd3fe..399f15e3f1 100644 --- a/gen/partners2-cli/src/main.rs +++ b/gen/partners2-cli/src/main.rs @@ -2284,7 +2284,7 @@ fn main() { let mut app = App::new("partners2") .author("Sebastian Thiel ") - .version("1.0.12+20180925") + .version("1.0.13+20180925") .about("Searches certified companies and creates contact leads with them, and also audits the usage of clients.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_partners2_cli") .arg(Arg::with_name("folder") diff --git a/gen/partners2/Cargo.toml b/gen/partners2/Cargo.toml index b5043685af..0a7becb379 100644 --- a/gen/partners2/Cargo.toml +++ b/gen/partners2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-partners2" -version = "1.0.12+20180925" +version = "1.0.13+20180925" authors = ["Sebastian Thiel "] description = "A complete library to interact with Partners (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/partners2" homepage = "https://developers.google.com/partners/" -documentation = "https://docs.rs/google-partners2/1.0.12+20180925" +documentation = "https://docs.rs/google-partners2/1.0.13+20180925" license = "MIT" keywords = ["partners", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/partners2/README.md b/gen/partners2/README.md index 2e7ed2f20c..a647aee48b 100644 --- a/gen/partners2/README.md +++ b/gen/partners2/README.md @@ -5,36 +5,36 @@ DO NOT EDIT ! --> The `google-partners2` library allows access to all features of the *Google Partners* service. -This documentation was generated from *Partners* crate version *1.0.12+20180925*, where *20180925* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Partners* crate version *1.0.13+20180925*, where *20180925* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Partners* *v2* API can be found at the [official documentation site](https://developers.google.com/partners/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.Partners.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.Partners.html) ... * analytics - * [*list*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.AnalyticListCall.html) + * [*list*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.AnalyticListCall.html) * client messages - * [*log*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.ClientMessageLogCall.html) -* [companies](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.Company.html) - * [*get*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.CompanyGetCall.html), [*leads create*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.CompanyLeadCreateCall.html) and [*list*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.CompanyListCall.html) -* [leads](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.Lead.html) - * [*list*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.LeadListCall.html) + * [*log*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.ClientMessageLogCall.html) +* [companies](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.Company.html) + * [*get*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.CompanyGetCall.html), [*leads create*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.CompanyLeadCreateCall.html) and [*list*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.CompanyListCall.html) +* [leads](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.Lead.html) + * [*list*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.LeadListCall.html) * offers - * [*history list*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.OfferHistoryListCall.html) and [*list*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.OfferListCall.html) + * [*history list*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.OfferHistoryListCall.html) and [*list*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.OfferListCall.html) * user events - * [*log*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.UserEventLogCall.html) + * [*log*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.UserEventLogCall.html) * user states - * [*list*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.UserStateListCall.html) -* [users](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.User.html) - * [*create company relation*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.UserCreateCompanyRelationCall.html), [*delete company relation*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.UserDeleteCompanyRelationCall.html), [*get*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.UserGetCall.html) and [*update profile*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.UserUpdateProfileCall.html) + * [*list*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.UserStateListCall.html) +* [users](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.User.html) + * [*create company relation*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.UserCreateCompanyRelationCall.html), [*delete company relation*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.UserDeleteCompanyRelationCall.html), [*get*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.UserGetCall.html) and [*update profile*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.UserUpdateProfileCall.html) Other activities are ... -* [get partnersstatus](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.MethodGetPartnersstatuCall.html) -* [update companies](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.MethodUpdateCompanyCall.html) -* [update leads](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.MethodUpdateLeadCall.html) +* [get partnersstatus](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.MethodGetPartnersstatuCall.html) +* [update companies](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.MethodUpdateCompanyCall.html) +* [update leads](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.MethodUpdateLeadCall.html) @@ -42,17 +42,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/struct.Partners.html)** +* **[Hub](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/struct.Partners.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.Part.html)** + * **[Parts](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -159,17 +159,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -179,29 +179,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-partners2/1.0.12+20180925/google_partners2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-partners2/1.0.13+20180925/google_partners2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/partners2/src/lib.rs b/gen/partners2/src/lib.rs index 07c1ae9f8e..907c835e04 100644 --- a/gen/partners2/src/lib.rs +++ b/gen/partners2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Partners* crate version *1.0.12+20180925*, where *20180925* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Partners* crate version *1.0.13+20180925*, where *20180925* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Partners* *v2* API can be found at the //! [official documentation site](https://developers.google.com/partners/). @@ -343,7 +343,7 @@ impl<'a, C, A> Partners Partners { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://partners.googleapis.com/".to_string(), _root_url: "https://partners.googleapis.com/".to_string(), } @@ -378,7 +378,7 @@ impl<'a, C, A> Partners } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/people1-cli/Cargo.toml b/gen/people1-cli/Cargo.toml index aefbb7bdff..394019b0e9 100644 --- a/gen/people1-cli/Cargo.toml +++ b/gen/people1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-people1-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with People Service (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/people1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-people1] path = "../people1" -version = "1.0.12+20190702" +version = "1.0.13+20200407" diff --git a/gen/people1-cli/README.md b/gen/people1-cli/README.md index 974b9419b0..d894558977 100644 --- a/gen/people1-cli/README.md +++ b/gen/people1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *People Service* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *People Service* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash people1 [options] @@ -41,9 +41,11 @@ people1 [options] connections-list [-p ]... [-o ] create-contact (-r )... [-p ]... [-o ] delete-contact [-p ]... [-o ] + delete-contact-photo [-p ]... [-o ] get [-p ]... [-o ] get-batch-get [-p ]... [-o ] update-contact (-r )... [-p ]... [-o ] + update-contact-photo (-r )... [-p ]... [-o ] people1 --help Configuration: diff --git a/gen/people1-cli/mkdocs.yml b/gen/people1-cli/mkdocs.yml index 0c81a11bc5..052c4cb3f2 100644 --- a/gen/people1-cli/mkdocs.yml +++ b/gen/people1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: People Service v1.0.12+20190702 +site_name: People Service v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-people1-cli site_description: A complete library to interact with People Service (protocol v1) @@ -19,9 +19,11 @@ pages: - ['people_connections-list.md', 'People', 'Connections List'] - ['people_create-contact.md', 'People', 'Create Contact'] - ['people_delete-contact.md', 'People', 'Delete Contact'] +- ['people_delete-contact-photo.md', 'People', 'Delete Contact Photo'] - ['people_get.md', 'People', 'Get'] - ['people_get-batch-get.md', 'People', 'Get Batch Get'] - ['people_update-contact.md', 'People', 'Update Contact'] +- ['people_update-contact-photo.md', 'People', 'Update Contact Photo'] theme: readthedocs diff --git a/gen/people1-cli/src/main.rs b/gen/people1-cli/src/main.rs index f48e732806..0186787b26 100644 --- a/gen/people1-cli/src/main.rs +++ b/gen/people1-cli/src/main.rs @@ -670,9 +670,6 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { - "parent" => { - call = call.parent(value.unwrap_or("")); - }, _ => { let mut found = false; for param in &self.gp { @@ -686,7 +683,6 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["parent"].iter().map(|v|*v)); v } )); } } @@ -772,6 +768,62 @@ impl<'n> Engine<'n> { } } + fn _people_delete_contact_photo(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.people().delete_contact_photo(opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "person-fields" => { + call = call.person_fields(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["person-fields"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _people_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.people().get(opt.value_of("resource-name").unwrap_or("")); @@ -988,6 +1040,92 @@ impl<'n> Engine<'n> { } } + fn _people_update_contact_photo(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "person-fields" => Some(("personFields", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "photo-bytes" => Some(("photoBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["person-fields", "photo-bytes"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpdateContactPhotoRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.people().update_contact_photo(request, opt.value_of("resource-name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); @@ -1033,6 +1171,9 @@ impl<'n> Engine<'n> { ("delete-contact", Some(opt)) => { call_result = self._people_delete_contact(opt, dry_run, &mut err); }, + ("delete-contact-photo", Some(opt)) => { + call_result = self._people_delete_contact_photo(opt, dry_run, &mut err); + }, ("get", Some(opt)) => { call_result = self._people_get(opt, dry_run, &mut err); }, @@ -1042,6 +1183,9 @@ impl<'n> Engine<'n> { ("update-contact", Some(opt)) => { call_result = self._people_update_contact(opt, dry_run, &mut err); }, + ("update-contact-photo", Some(opt)) => { + call_result = self._people_update_contact_photo(opt, dry_run, &mut err); + }, _ => { err.issues.push(CLIError::MissingMethodError("people".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -1180,7 +1324,7 @@ fn main() { vec![ (Some(r##"resource-name"##), None, - Some(r##"The resource name of the contact group to delete."##), + Some(r##"Required. The resource name of the contact group to delete."##), Some(true), Some(false)), @@ -1203,7 +1347,7 @@ fn main() { vec![ (Some(r##"resource-name"##), None, - Some(r##"The resource name of the contact group to get."##), + Some(r##"Required. The resource name of the contact group to get."##), Some(true), Some(false)), @@ -1238,7 +1382,7 @@ fn main() { ]), ("members-modify", Some(r##"Modify the members of a contact group owned by the authenticated user. -
          + The only system contact groups that can have members added are `contactGroups/myContacts` and `contactGroups/starred`. Other system contact groups are deprecated and can only have contacts removed."##), @@ -1246,7 +1390,7 @@ fn main() { vec![ (Some(r##"resource-name"##), None, - Some(r##"The resource name of the contact group to modify."##), + Some(r##"Required. The resource name of the contact group to modify."##), Some(true), Some(false)), @@ -1276,7 +1420,7 @@ fn main() { (Some(r##"resource-name"##), None, Some(r##"The resource name for the contact group, assigned by the server. An ASCII - string, in the form of `contactGroups/`contact_group_id."##), + string, in the form of `contactGroups/{contact_group_id}`."##), Some(true), Some(false)), @@ -1300,17 +1444,17 @@ fn main() { ]), ]), - ("people", "methods: 'connections-list', 'create-contact', 'delete-contact', 'get', 'get-batch-get' and 'update-contact'", vec![ + ("people", "methods: 'connections-list', 'create-contact', 'delete-contact', 'delete-contact-photo', 'get', 'get-batch-get', 'update-contact' and 'update-contact-photo'", vec![ ("connections-list", Some(r##"Provides a list of the authenticated user's contacts merged with any connected profiles. -
          + The request throws a 400 error if 'personFields' is not specified."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_connections-list", vec![ (Some(r##"resource-name"##), None, - Some(r##"The resource name to return connections for. Only `people/me` is valid."##), + Some(r##"Required. The resource name to return connections for. Only `people/me` is valid."##), Some(true), Some(false)), @@ -1354,7 +1498,29 @@ fn main() { vec![ (Some(r##"resource-name"##), None, - Some(r##"The resource name of the contact to delete."##), + Some(r##"Required. The resource name of the contact to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete-contact-photo", + Some(r##"Delete a contact's photo."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_delete-contact-photo", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"Required. The resource name of the contact whose photo will be deleted."##), Some(true), Some(false)), @@ -1373,17 +1539,17 @@ fn main() { ("get", Some(r##"Provides information about a person by specifying a resource name. Use `people/me` to indicate the authenticated user. -
          + The request throws a 400 error if 'personFields' is not specified."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_get", vec![ (Some(r##"resource-name"##), None, - Some(r##"The resource name of the person to provide information about. + Some(r##"Required. The resource name of the person to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about a google account, specify - `people/`account_id. + `people/{account_id}`. - To get information about a contact, specify the resource name that identifies the contact as returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list)."##), @@ -1406,7 +1572,7 @@ fn main() { Some(r##"Provides information about a list of specific people by specifying a list of requested resource names. Use `people/me` to indicate the authenticated user. -
          + The request throws a 400 error if 'personFields' is not specified."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_get-batch-get", vec![ @@ -1427,21 +1593,50 @@ fn main() { will not be modified. The request throws a 400 error if `updatePersonFields` is not specified. -
          + The request throws a 400 error if `person.metadata.sources` is not specified for the contact to be updated. -
          - The request throws a 412 error if `person.metadata.sources.etag` is - different than the contact's etag, which indicates the contact has changed - since its data was read. Clients should get the latest person and re-apply - their updates to the latest person."##), + + The request throws a 400 error with an error with reason + `"failedPrecondition"` if `person.metadata.sources.etag` is different than + the contact's etag, which indicates the contact has changed since its data + was read. Clients should get the latest person and re-apply their updates + to the latest person."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_update-contact", vec![ (Some(r##"resource-name"##), None, Some(r##"The resource name for the person, assigned by the server. An ASCII string with a max length of 27 characters, in the form of - `people/`person_id."##), + `people/{person_id}`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-contact-photo", + Some(r##"Update a contact's photo."##), + "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_update-contact-photo", + vec![ + (Some(r##"resource-name"##), + None, + Some(r##"Required. Person resource name"##), Some(true), Some(false)), @@ -1469,7 +1664,7 @@ fn main() { let mut app = App::new("people1") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200407") .about("Provides access to information about profiles and contacts.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_people1_cli") .arg(Arg::with_name("url") diff --git a/gen/people1/Cargo.toml b/gen/people1/Cargo.toml index bd103a5433..9160eb3acf 100644 --- a/gen/people1/Cargo.toml +++ b/gen/people1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-people1" -version = "1.0.12+20190702" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with People Service (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/people1" homepage = "https://developers.google.com/people/" -documentation = "https://docs.rs/google-people1/1.0.12+20190702" +documentation = "https://docs.rs/google-people1/1.0.13+20200407" license = "MIT" keywords = ["people", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/people1/README.md b/gen/people1/README.md index 89c5de2c22..61d74e5747 100644 --- a/gen/people1/README.md +++ b/gen/people1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-people1` library allows access to all features of the *Google People Service* service. -This documentation was generated from *People Service* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *People Service* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *People Service* *v1* API can be found at the [official documentation site](https://developers.google.com/people/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleService.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleService.html) ... -* [contact groups](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroup.html) - * [*batch get*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroupBatchGetCall.html), [*create*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroupCreateCall.html), [*delete*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroupDeleteCall.html), [*get*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroupGetCall.html), [*list*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroupListCall.html), [*members modify*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroupMemberModifyCall.html) and [*update*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.ContactGroupUpdateCall.html) +* [contact groups](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroup.html) + * [*batch get*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroupBatchGetCall.html), [*create*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroupCreateCall.html), [*delete*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroupDeleteCall.html), [*get*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroupGetCall.html), [*list*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroupListCall.html), [*members modify*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroupMemberModifyCall.html) and [*update*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.ContactGroupUpdateCall.html) * people - * [*connections list*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleConnectionListCall.html), [*create contact*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleCreateContactCall.html), [*delete contact*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleDeleteContactCall.html), [*get*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleGetCall.html), [*get batch get*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleGetBatchGetCall.html) and [*update contact*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleUpdateContactCall.html) + * [*connections list*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleConnectionListCall.html), [*create contact*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleCreateContactCall.html), [*delete contact*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleDeleteContactCall.html), [*delete contact photo*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleDeleteContactPhotoCall.html), [*get*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleGetCall.html), [*get batch get*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleGetBatchGetCall.html), [*update contact*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleUpdateContactCall.html) and [*update contact photo*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleUpdateContactPhotoCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-people1/1.0.12+20190702/google_people1/struct.PeopleService.html)** +* **[Hub](https://docs.rs/google-people1/1.0.13+20200407/google_people1/struct.PeopleService.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.Part.html)** + * **[Parts](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-people1/1.0.12+20190702/google_people1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-people1/1.0.13+20200407/google_people1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-people1/1.0.12+20190702/google_people1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-people1/1.0.13+20200407/google_people1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-people1/1.0.12+20190702/google_people1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-people1/1.0.13+20200407/google_people1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/people1/src/lib.rs b/gen/people1/src/lib.rs index 84f2ade7df..21fa41f7dc 100644 --- a/gen/people1/src/lib.rs +++ b/gen/people1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *People Service* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *People Service* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *People Service* *v1* API can be found at the //! [official documentation site](https://developers.google.com/people/). @@ -14,7 +14,7 @@ //! * [contact groups](struct.ContactGroup.html) //! * [*batch get*](struct.ContactGroupBatchGetCall.html), [*create*](struct.ContactGroupCreateCall.html), [*delete*](struct.ContactGroupDeleteCall.html), [*get*](struct.ContactGroupGetCall.html), [*list*](struct.ContactGroupListCall.html), [*members modify*](struct.ContactGroupMemberModifyCall.html) and [*update*](struct.ContactGroupUpdateCall.html) //! * people -//! * [*connections list*](struct.PeopleConnectionListCall.html), [*create contact*](struct.PeopleCreateContactCall.html), [*delete contact*](struct.PeopleDeleteContactCall.html), [*get*](struct.PeopleGetCall.html), [*get batch get*](struct.PeopleGetBatchGetCall.html) and [*update contact*](struct.PeopleUpdateContactCall.html) +//! * [*connections list*](struct.PeopleConnectionListCall.html), [*create contact*](struct.PeopleCreateContactCall.html), [*delete contact*](struct.PeopleDeleteContactCall.html), [*delete contact photo*](struct.PeopleDeleteContactPhotoCall.html), [*get*](struct.PeopleGetCall.html), [*get batch get*](struct.PeopleGetBatchGetCall.html), [*update contact*](struct.PeopleUpdateContactCall.html) and [*update contact photo*](struct.PeopleUpdateContactPhotoCall.html) //! //! //! @@ -240,6 +240,9 @@ pub enum Scope { /// See and download your contacts ContactReadonly, + /// See your education, work history and org info + UserOrganizationRead, + /// View your email addresses UserEmailRead, @@ -264,6 +267,7 @@ impl AsRef for Scope { match *self { Scope::UserBirthdayRead => "https://www.googleapis.com/auth/user.birthday.read", Scope::ContactReadonly => "https://www.googleapis.com/auth/contacts.readonly", + Scope::UserOrganizationRead => "https://www.googleapis.com/auth/user.organization.read", Scope::UserEmailRead => "https://www.googleapis.com/auth/user.emails.read", Scope::UserAddresseRead => "https://www.googleapis.com/auth/user.addresses.read", Scope::Contact => "https://www.googleapis.com/auth/contacts", @@ -359,7 +363,7 @@ impl<'a, C, A> PeopleService PeopleService { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://people.googleapis.com/".to_string(), _root_url: "https://people.googleapis.com/".to_string(), } @@ -373,7 +377,7 @@ impl<'a, C, A> PeopleService } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -430,7 +434,7 @@ pub struct ListContactGroupsResponse { impl ResponseResult for ListContactGroupsResponse {} -/// There is no detailed description. +/// The response to a request for the authenticated user's connections. /// /// # Activities /// @@ -443,10 +447,13 @@ impl ResponseResult for ListContactGroupsResponse {} pub struct ListConnectionsResponse { /// The list of people that the requestor is connected to. pub connections: Option>, - /// The token that can be used to retrieve the next page of results. + /// A token, which can be sent as `page_token` to retrieve the next page. + /// If this field is omitted, there are no subsequent pages. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// The token that can be used to retrieve changes since the last request. + /// A token, which can be sent as `sync_token` to retrieve changes since the + /// last request. Request must set `request_sync_token` to return the sync + /// token. #[serde(rename="nextSyncToken")] pub next_sync_token: Option, /// The total number of items in the list without pagination. @@ -461,13 +468,14 @@ pub struct ListConnectionsResponse { impl ResponseResult for ListConnectionsResponse {} -/// A person's read-only relationship status. +/// **DEPRECATED**: No data will be returned +/// A person's relationship status. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RelationshipStatus { - /// The read-only value of the relationship status translated and formatted in + /// Output only. The value of the relationship status translated and formatted in /// the viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedValue")] pub formatted_value: Option, @@ -537,7 +545,8 @@ pub struct UserDefined { impl Part for UserDefined {} -/// A read-only brief one-line description of the person. +/// **DEPRECATED**: No data will be returned +/// A brief one-line description of the person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -558,11 +567,11 @@ impl Part for Tagline {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContactGroupMembership { - /// The read-only contact group ID for the contact group membership. + /// Output only. The contact group ID for the contact group membership. #[serde(rename="contactGroupId")] pub contact_group_id: Option, /// The resource name for the contact group, assigned by the server. An ASCII - /// string, in the form of `contactGroups/`contact_group_id. + /// string, in the form of `contactGroups/{contact_group_id}`. /// Only contact_group_resource_name can be used for modifying memberships. /// Any contact group membership can be removed, but only user group or /// "myContacts" or "starred" system groups memberships can be added. A @@ -580,7 +589,7 @@ impl Part for ContactGroupMembership {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Source { - /// **Only populated in `person.metadata.sources`.** + /// Output only. **Only populated in `person.metadata.sources`.** /// /// Last update timestamp of this source. #[serde(rename="updateTime")] @@ -595,7 +604,7 @@ pub struct Source { pub type_: Option, /// The unique identifier within the source type generated by the server. pub id: Option, - /// **Only populated in `person.metadata.sources`.** + /// Output only. **Only populated in `person.metadata.sources`.** /// /// Metadata about a source of type PROFILE. #[serde(rename="profileMetadata")] @@ -632,7 +641,7 @@ impl Part for Interest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateContactGroupRequest { - /// The contact group to update. + /// Required. The contact group to update. #[serde(rename="contactGroup")] pub contact_group: Option, } @@ -640,7 +649,26 @@ pub struct UpdateContactGroupRequest { impl RequestValue for UpdateContactGroupRequest {} -/// A person's read-only cover photo. A large image shown on the person's +/// The response for updating a contact's photo. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update contact photo people](struct.PeopleUpdateContactPhotoCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateContactPhotoResponse { + /// The updated person, if person_fields is set in the + /// UpdateContactPhotoRequest; otherwise this will be unset. + pub person: Option, +} + +impl ResponseResult for UpdateContactPhotoResponse {} + + +/// A person's cover photo. A large image shown on the person's /// profile page that represents who they are or what they care about. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -667,7 +695,7 @@ impl Part for CoverPhoto {} pub struct FieldMetadata { /// The source of the field. pub source: Option, - /// True if the field is verified; false if the field is unverified. A + /// Output only. True if the field is verified; false if the field is unverified. A /// verified field is typically a name, email address, phone number, or /// website that has been confirmed to be owned by the person. pub verified: Option, @@ -679,7 +707,7 @@ pub struct FieldMetadata { impl Part for FieldMetadata {} -/// There is no detailed description. +/// The response to a get request for a list of people by resource name. /// /// # Activities /// @@ -697,15 +725,16 @@ pub struct GetPeopleResponse { impl ResponseResult for GetPeopleResponse {} -/// A person's read-only relationship interest . +/// **DEPRECATED**: No data will be returned +/// A person's relationship interest . /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RelationshipInterest { - /// The value of the relationship interest translated and formatted in the - /// viewer's account locale or the locale specified in the Accept-Language - /// HTTP header. + /// Output only. The value of the relationship interest translated and formatted + /// in the viewer's account locale or the locale specified in the + /// Accept-Language HTTP header. #[serde(rename="formattedValue")] pub formatted_value: Option, /// The kind of relationship the person is looking for. The value can be custom @@ -723,6 +752,7 @@ pub struct RelationshipInterest { impl Part for RelationshipInterest {} +/// **DEPRECATED**: No data will be returned /// A person's bragging rights. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -755,24 +785,24 @@ impl Part for BraggingRights {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContactGroup { - /// The read-only name translated and formatted in the viewer's account locale + /// Output only. The name translated and formatted in the viewer's account locale /// or the `Accept-Language` HTTP header locale for system groups names. /// Group names set by the owner are the same as name. #[serde(rename="formattedName")] pub formatted_name: Option, - /// The read-only contact group type. + /// Output only. The contact group type. #[serde(rename="groupType")] pub group_type: Option, /// The contact group name set by the group owner or a system provided name /// for system groups. pub name: Option, - /// The list of contact person resource names that are members of the contact + /// Output only. The list of contact person resource names that are members of the contact /// group. The field is not populated for LIST requests and can only be updated /// through the /// [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/members/modify). #[serde(rename="memberResourceNames")] pub member_resource_names: Option>, - /// The total number of contacts in the group irrespective of max members in + /// Output only. The total number of contacts in the group irrespective of max members in /// specified in the request. #[serde(rename="memberCount")] pub member_count: Option, @@ -780,10 +810,10 @@ pub struct ContactGroup { /// resource. Used for web cache validation. pub etag: Option, /// The resource name for the contact group, assigned by the server. An ASCII - /// string, in the form of `contactGroups/`contact_group_id. + /// string, in the form of `contactGroups/{contact_group_id}`. #[serde(rename="resourceName")] pub resource_name: Option, - /// Metadata about the contact group. + /// Output only. Metadata about the contact group. pub metadata: Option, } @@ -801,7 +831,7 @@ pub struct Membership { /// The contact group membership. #[serde(rename="contactGroupMembership")] pub contact_group_membership: Option, - /// The read-only domain membership. + /// Output only. The domain membership. #[serde(rename="domainMembership")] pub domain_membership: Option, /// Metadata about the membership. @@ -868,7 +898,7 @@ pub struct Address { /// code of the address. #[serde(rename="countryCode")] pub country_code: Option, - /// The read-only type of the address translated and formatted in the viewer's + /// Output only. The type of the address translated and formatted in the viewer's /// account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -907,13 +937,16 @@ pub struct Address { impl Part for Address {} -/// Represents a whole calendar date, for example a date of birth. The time -/// of day and time zone are either specified elsewhere or are not -/// significant. The date is relative to the -/// [Proleptic Gregorian Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). -/// The day may be 0 to represent a year and month where the day is not -/// significant. The year may be 0 to represent a month and day independent -/// of year; for example, anniversary date. +/// Represents a whole or partial calendar date, e.g. a birthday. The time of day +/// and time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. This can represent: +/// +/// * A full date, with non-zero year, month and day values +/// * A month and day value, with a zero year, e.g. an anniversary +/// * A year on its own, with zero month and day values +/// * A year and month value, with a zero day, e.g. a credit card expiration date +/// +/// Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -940,7 +973,7 @@ impl Part for Date {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct EmailAddress { - /// The read-only type of the email address translated and formatted in the + /// Output only. The type of the email address translated and formatted in the /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -971,7 +1004,7 @@ impl Part for EmailAddress {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SipAddress { - /// The read-only type of the SIP address translated and formatted in the + /// Output only. The type of the SIP address translated and formatted in the /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -1066,7 +1099,7 @@ impl Part for Status {} pub struct ImClient { /// The user name used in the IM client. pub username: Option, - /// The read-only type of the IM client translated and formatted in the + /// Output only. The type of the IM client translated and formatted in the /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -1083,7 +1116,7 @@ pub struct ImClient { /// * `jabber` /// * `netMeeting` pub protocol: Option, - /// The read-only protocol of the IM client formatted in the viewer's account + /// Output only. The protocol of the IM client formatted in the viewer's account /// locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedProtocol")] pub formatted_protocol: Option, @@ -1133,12 +1166,12 @@ pub struct Name { /// The honorific prefixes, such as `Mrs.` or `Dr.` #[serde(rename="honorificPrefix")] pub honorific_prefix: Option, - /// The read-only display name with the last name first formatted according to + /// Output only. The display name with the last name first formatted according to /// the locale specified by the viewer's account or the /// `Accept-Language` HTTP header. #[serde(rename="displayNameLastFirst")] pub display_name_last_first: Option, - /// The read-only display name formatted according to the locale specified by + /// Output only. The display name formatted according to the locale specified by /// the viewer's account or the `Accept-Language` HTTP header. #[serde(rename="displayName")] pub display_name: Option, @@ -1179,7 +1212,7 @@ impl Part for Name {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Url { - /// The read-only type of the URL translated and formatted in the viewer's + /// Output only. The type of the URL translated and formatted in the viewer's /// account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -1224,6 +1257,57 @@ pub struct Residence { impl Part for Residence {} +/// A request to update an existing contact's photo. +/// All requests must have a valid photo format: JPEG or PNG. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update contact photo people](struct.PeopleUpdateContactPhotoCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateContactPhotoRequest { + /// Optional. A field mask to restrict which fields on the person are returned. Multiple + /// fields can be specified by separating them with commas. Defaults to empty + /// if not set, which will skip the post mutate get. Valid values are: + /// + /// * addresses + /// * ageRanges + /// * biographies + /// * birthdays + /// * coverPhotos + /// * emailAddresses + /// * events + /// * genders + /// * imClients + /// * interests + /// * locales + /// * memberships + /// * metadata + /// * names + /// * nicknames + /// * occupations + /// * organizations + /// * phoneNumbers + /// * photos + /// * relations + /// * residences + /// * sipAddresses + /// * skills + /// * urls + /// * userDefined + #[serde(rename="personFields")] + pub person_fields: Option, + /// Required. Raw photo bytes + #[serde(rename="photoBytes")] + pub photo_bytes: Option, +} + +impl RequestValue for UpdateContactPhotoRequest {} + + /// A request to modify an existing contact group's members. Contacts can be /// removed from any group but they can only be added to a user group or /// "myContacts" or "starred" system groups. @@ -1237,12 +1321,12 @@ impl Part for Residence {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyContactGroupMembersRequest { - /// The resource names of the contact people to remove in the form of in the - /// form of `people/`person_id. + /// Optional. The resource names of the contact people to remove in the form of + /// `people/{person_id}`. #[serde(rename="resourceNamesToRemove")] pub resource_names_to_remove: Option>, - /// The resource names of the contact people to add in the form of in the form - /// `people/`person_id. + /// Optional. The resource names of the contact people to add in the form of + /// `people/{person_id}`. #[serde(rename="resourceNamesToAdd")] pub resource_names_to_add: Option>, } @@ -1288,6 +1372,7 @@ impl ResponseResult for BatchGetContactGroupsResponse {} pub struct Person { /// The person's interests. pub interests: Option>, + /// **DEPRECATED**: No data will be returned /// The person's bragging rights. #[serde(rename="braggingRights")] pub bragging_rights: Option>, @@ -1304,10 +1389,10 @@ pub struct Person { pub names: Option>, /// The resource name for the person, assigned by the server. An ASCII string /// with a max length of 27 characters, in the form of - /// `people/`person_id. + /// `people/{person_id}`. #[serde(rename="resourceName")] pub resource_name: Option, - /// The person's read-only age ranges. + /// Output only. The person's age ranges. #[serde(rename="ageRanges")] pub age_ranges: Option>, /// The person's birthdays. @@ -1317,7 +1402,8 @@ pub struct Person { /// The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the /// resource. Used for web cache validation. pub etag: Option, - /// The person's read-only relationship statuses. + /// Output only. **DEPRECATED**: No data will be returned + /// The person's relationship statuses. #[serde(rename="relationshipStatuses")] pub relationship_statuses: Option>, /// The person's instant messaging clients. @@ -1325,19 +1411,20 @@ pub struct Person { pub im_clients: Option>, /// The person's events. pub events: Option>, - /// Read-only metadata about the person. + /// Output only. Metadata about the person. pub metadata: Option, /// The person's SIP addresses. #[serde(rename="sipAddresses")] pub sip_addresses: Option>, - /// The person's read-only photos. + /// Output only. The person's photos. pub photos: Option>, /// The person's residences. pub residences: Option>, - /// The person's read-only relationship interests. + /// Output only. **DEPRECATED**: No data will be returned + /// The person's relationship interests. #[serde(rename="relationshipInterests")] pub relationship_interests: Option>, - /// The person's read-only cover photos. + /// Output only. The person's cover photos. #[serde(rename="coverPhotos")] pub cover_photos: Option>, /// The person's locale preferences. @@ -1351,13 +1438,14 @@ pub struct Person { pub skills: Option>, /// The person's group memberships. pub memberships: Option>, - /// The person's read-only taglines. + /// Output only. **DEPRECATED**: No data will be returned + /// The person's taglines. pub taglines: Option>, /// The person's associated URLs. pub urls: Option>, - /// **DEPRECATED** (Please use `person.ageRanges` instead)** + /// Output only. **DEPRECATED** (Please use `person.ageRanges` instead) /// - /// The person's read-only age range. + /// The person's age range. #[serde(rename="ageRange")] pub age_range: Option, /// The person's genders. @@ -1379,17 +1467,25 @@ impl ResponseResult for Person {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Gender { - /// The read-only value of the gender translated and formatted in the viewer's - /// account locale or the `Accept-Language` HTTP header locale. + /// Output only. The value of the gender translated and formatted in the viewer's account + /// locale or the `Accept-Language` HTTP header locale. Unspecified or custom + /// value are not localized. #[serde(rename="formattedValue")] pub formatted_value: Option, + /// The type of pronouns that should be used to address the person. The value + /// can be custom or one of these predefined values: + /// + /// * `male` + /// * `female` + /// * `other` + #[serde(rename="addressMeAs")] + pub address_me_as: Option, /// The gender for the person. The gender can be custom or one of these /// predefined values: /// /// * `male` /// * `female` - /// * `other` - /// * `unknown` + /// * `unspecified` pub value: Option, /// Metadata about the gender. pub metadata: Option, @@ -1404,12 +1500,12 @@ impl Part for Gender {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PhoneNumber { - /// The read-only canonicalized [ITU-T + /// Output only. The canonicalized [ITU-T /// E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) /// form of the phone number. #[serde(rename="canonicalForm")] pub canonical_form: Option, - /// The read-only type of the phone number translated and formatted in the + /// Output only. The type of the phone number translated and formatted in the /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -1446,7 +1542,7 @@ impl Part for PhoneNumber {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Organization { - /// The read-only type of the organization translated and formatted in the + /// Output only. The type of the organization translated and formatted in the /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -1504,7 +1600,7 @@ impl Part for Organization {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateContactGroupRequest { - /// The contact group to create. + /// Required. The contact group to create. #[serde(rename="contactGroup")] pub contact_group: Option, } @@ -1528,7 +1624,7 @@ pub struct Locale { impl Part for Locale {} -/// A person's read-only photo. A picture shown next to the person's name to +/// A person's photo. A picture shown next to the person's name to /// help others recognize the person. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1539,8 +1635,9 @@ pub struct Photo { /// false if the photo is a user-provided photo. pub default: Option, /// The URL of the photo. You can change the desired size by appending a query - /// parameter `sz=`size at the end of the url. Example: - /// `https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50` + /// parameter `sz={size}` at the end of the url, where {size} is the size in + /// pixels. Example: + /// https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50 pub url: Option, /// Metadata about the photo. pub metadata: Option, @@ -1549,17 +1646,17 @@ pub struct Photo { impl Part for Photo {} -/// The read-only metadata about a contact group. +/// The metadata about a contact group. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContactGroupMetadata { - /// True if the contact group resource has been deleted. Populated only for + /// Output only. True if the contact group resource has been deleted. Populated only for /// [`ListContactGroups`](/people/api/rest/v1/contactgroups/list) requests /// that include a sync token. pub deleted: Option, - /// The time the group was last updated. + /// Output only. The time the group was last updated. #[serde(rename="updateTime")] pub update_time: Option, } @@ -1567,17 +1664,17 @@ pub struct ContactGroupMetadata { impl Part for ContactGroupMetadata {} -/// The read-only metadata about a person. +/// The metadata about a person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PersonMetadata { - /// True if the person resource has been deleted. Populated only for + /// Output only. True if the person resource has been deleted. Populated only for /// [`connections.list`](/people/api/rest/v1/people.connections/list) requests /// that include a sync token. pub deleted: Option, - /// Any former resource names this person has had. Populated only for + /// Output only. Any former resource names this person has had. Populated only for /// [`connections.list`](/people/api/rest/v1/people.connections/list) requests /// that include a sync token. /// @@ -1586,10 +1683,10 @@ pub struct PersonMetadata { /// profile URL. #[serde(rename="previousResourceNames")] pub previous_resource_names: Option>, - /// Resource names of people linked to this resource. + /// Output only. Resource names of people linked to this resource. #[serde(rename="linkedPeopleResourceNames")] pub linked_people_resource_names: Option>, - /// **DEPRECATED** (Please use + /// Output only. **DEPRECATED** (Please use /// `person.metadata.sources.profileMetadata.objectType` instead) /// /// The type of the person object. @@ -1613,6 +1710,10 @@ impl Part for PersonMetadata {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyContactGroupMembersResponse { + /// The contact people resource names that cannot be removed from their + /// last contact group. + #[serde(rename="canNotRemoveLastContactGroupResourceNames")] + pub can_not_remove_last_contact_group_resource_names: Option>, /// The contact people resource names that were not found. #[serde(rename="notFoundResourceNames")] pub not_found_resource_names: Option>, @@ -1621,14 +1722,33 @@ pub struct ModifyContactGroupMembersResponse { impl ResponseResult for ModifyContactGroupMembersResponse {} +/// The response for deleteing a contact's photo. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete contact photo people](struct.PeopleDeleteContactPhotoCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeleteContactPhotoResponse { + /// The updated person, if person_fields is set in the + /// DeleteContactPhotoRequest; otherwise this will be unset. + pub person: Option, +} + +impl ResponseResult for DeleteContactPhotoResponse {} + + /// A person's relation to another person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Relation { - /// The type of the relation translated and formatted in the viewer's account - /// locale or the locale specified in the Accept-Language HTTP header. + /// Output only. The type of the relation translated and formatted in the viewer's + /// account locale or the locale specified in the Accept-Language HTTP header. #[serde(rename="formattedType")] pub formatted_type: Option, /// Metadata about the relation. @@ -1689,7 +1809,7 @@ pub struct Occupation { impl Part for Occupation {} -/// A read-only G Suite Domain membership. +/// A G Suite Domain membership. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1711,7 +1831,7 @@ impl Part for DomainMembership {} pub struct Event { /// The date of the event. pub date: Option, - /// The read-only type of the event translated and formatted in the + /// Output only. The type of the event translated and formatted in the /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, @@ -1747,16 +1867,16 @@ pub struct Biography { impl Part for Biography {} -/// The read-only metadata about a profile. +/// The metadata about a profile. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProfileMetadata { - /// The user types. + /// Output only. The user types. #[serde(rename="userTypes")] pub user_types: Option>, - /// The profile object type. + /// Output only. The profile object type. #[serde(rename="objectType")] pub object_type: Option, } @@ -1865,7 +1985,7 @@ impl<'a, C, A> ContactGroupMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resourceName` - The resource name for the contact group, assigned by the server. An ASCII - /// string, in the form of `contactGroups/`contact_group_id. + /// string, in the form of `contactGroups/{contact_group_id}`. pub fn update(&self, request: UpdateContactGroupRequest, resource_name: &str) -> ContactGroupUpdateCall<'a, C, A> { ContactGroupUpdateCall { hub: self.hub, @@ -1884,7 +2004,7 @@ impl<'a, C, A> ContactGroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `resourceName` - The resource name of the contact group to delete. + /// * `resourceName` - Required. The resource name of the contact group to delete. pub fn delete(&self, resource_name: &str) -> ContactGroupDeleteCall<'a, C, A> { ContactGroupDeleteCall { hub: self.hub, @@ -1899,7 +2019,7 @@ impl<'a, C, A> ContactGroupMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Modify the members of a contact group owned by the authenticated user. - ///
          + /// /// The only system contact groups that can have members added are /// `contactGroups/myContacts` and `contactGroups/starred`. Other system /// contact groups are deprecated and can only have contacts removed. @@ -1907,7 +2027,7 @@ impl<'a, C, A> ContactGroupMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `resourceName` - The resource name of the contact group to modify. + /// * `resourceName` - Required. The resource name of the contact group to modify. pub fn members_modify(&self, request: ModifyContactGroupMembersRequest, resource_name: &str) -> ContactGroupMemberModifyCall<'a, C, A> { ContactGroupMemberModifyCall { hub: self.hub, @@ -1926,7 +2046,7 @@ impl<'a, C, A> ContactGroupMethods<'a, C, A> { /// /// # Arguments /// - /// * `resourceName` - The resource name of the contact group to get. + /// * `resourceName` - Required. The resource name of the contact group to get. pub fn get(&self, resource_name: &str) -> ContactGroupGetCall<'a, C, A> { ContactGroupGetCall { hub: self.hub, @@ -1965,7 +2085,7 @@ impl<'a, C, A> ContactGroupMethods<'a, C, A> { /// ::default(), None); /// let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `connections_list(...)`, `create_contact(...)`, `delete_contact(...)`, `get(...)`, `get_batch_get(...)` and `update_contact(...)` +/// // like `connections_list(...)`, `create_contact(...)`, `delete_contact(...)`, `delete_contact_photo(...)`, `get(...)`, `get_batch_get(...)`, `update_contact(...)` and `update_contact_photo(...)` /// // to build up your call. /// let rb = hub.people(); /// # } @@ -1980,16 +2100,34 @@ impl<'a, C, A> MethodsBuilder for PeopleMethods<'a, C, A> {} impl<'a, C, A> PeopleMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Delete a contact's photo. + /// + /// # Arguments + /// + /// * `resourceName` - Required. The resource name of the contact whose photo will be deleted. + pub fn delete_contact_photo(&self, resource_name: &str) -> PeopleDeleteContactPhotoCall<'a, C, A> { + PeopleDeleteContactPhotoCall { + hub: self.hub, + _resource_name: resource_name.to_string(), + _person_fields: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Provides a list of the authenticated user's contacts merged with any /// connected profiles. - ///
          + /// /// The request throws a 400 error if 'personFields' is not specified. /// /// # Arguments /// - /// * `resourceName` - The resource name to return connections for. Only `people/me` is valid. + /// * `resourceName` - Required. The resource name to return connections for. Only `people/me` is valid. pub fn connections_list(&self, resource_name: &str) -> PeopleConnectionListCall<'a, C, A> { PeopleConnectionListCall { hub: self.hub, @@ -2018,7 +2156,6 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { PeopleCreateContactCall { hub: self.hub, _request: request, - _parent: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2031,7 +2168,7 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { /// /// # Arguments /// - /// * `resourceName` - The resource name of the contact to delete. + /// * `resourceName` - Required. The resource name of the contact to delete. pub fn delete_contact(&self, resource_name: &str) -> PeopleDeleteContactCall<'a, C, A> { PeopleDeleteContactCall { hub: self.hub, @@ -2046,15 +2183,15 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { /// /// Provides information about a person by specifying a resource name. Use /// `people/me` to indicate the authenticated user. - ///
          + /// /// The request throws a 400 error if 'personFields' is not specified. /// /// # Arguments /// - /// * `resourceName` - The resource name of the person to provide information about. + /// * `resourceName` - Required. The resource name of the person to provide information about. /// - To get information about the authenticated user, specify `people/me`. /// - To get information about a google account, specify - /// `people/`account_id. + /// `people/{account_id}`. /// - To get information about a contact, specify the resource name that /// identifies the contact as returned by /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). @@ -2076,21 +2213,22 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { /// will not be modified. /// /// The request throws a 400 error if `updatePersonFields` is not specified. - ///
          + /// /// The request throws a 400 error if `person.metadata.sources` is not /// specified for the contact to be updated. - ///
          - /// The request throws a 412 error if `person.metadata.sources.etag` is - /// different than the contact's etag, which indicates the contact has changed - /// since its data was read. Clients should get the latest person and re-apply - /// their updates to the latest person. + /// + /// The request throws a 400 error with an error with reason + /// `"failedPrecondition"` if `person.metadata.sources.etag` is different than + /// the contact's etag, which indicates the contact has changed since its data + /// was read. Clients should get the latest person and re-apply their updates + /// to the latest person. /// /// # Arguments /// /// * `request` - No description provided. /// * `resourceName` - The resource name for the person, assigned by the server. An ASCII string /// with a max length of 27 characters, in the form of - /// `people/`person_id. + /// `people/{person_id}`. pub fn update_contact(&self, request: Person, resource_name: &str) -> PeopleUpdateContactCall<'a, C, A> { PeopleUpdateContactCall { hub: self.hub, @@ -2103,12 +2241,31 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Update a contact's photo. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resourceName` - Required. Person resource name + pub fn update_contact_photo(&self, request: UpdateContactPhotoRequest, resource_name: &str) -> PeopleUpdateContactPhotoCall<'a, C, A> { + PeopleUpdateContactPhotoCall { + hub: self.hub, + _request: request, + _resource_name: resource_name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Provides information about a list of specific people by specifying a list /// of requested resource names. Use `people/me` to indicate the authenticated /// user. - ///
          + /// /// The request throws a 400 error if 'personFields' is not specified. pub fn get_batch_get(&self) -> PeopleGetBatchGetCall<'a, C, A> { PeopleGetBatchGetCall { @@ -2292,7 +2449,7 @@ impl<'a, C, A> ContactGroupBatchGetCall<'a, C, A> where C: BorrowMut ContactGroupBatchGetCall<'a, C, A> where C: BorrowMut ContactGroupBatchGetCall<'a, C, A> { @@ -2534,7 +2692,7 @@ impl<'a, C, A> ContactGroupListCall<'a, C, A> where C: BorrowMut, } - /// A sync token, returned by a previous call to `contactgroups.list`. + /// Optional. A sync token, returned by a previous call to `contactgroups.list`. /// Only resources changed since the sync token was created will be returned. /// /// Sets the *sync token* query property to the given value. @@ -2542,7 +2700,7 @@ impl<'a, C, A> ContactGroupListCall<'a, C, A> where C: BorrowMut, self._sync_token = Some(new_value.to_string()); self } - /// The next_page_token value returned from a previous call to + /// Optional. The next_page_token value returned from a previous call to /// [ListContactGroups](/people/api/rest/v1/contactgroups/list). /// Requests the next page of resources. /// @@ -2551,7 +2709,8 @@ impl<'a, C, A> ContactGroupListCall<'a, C, A> where C: BorrowMut, self._page_token = Some(new_value.to_string()); self } - /// The maximum number of resources to return. + /// Optional. The maximum number of resources to return. Valid values are between 1 and + /// 1000, inclusive. Defaults to 30 if not set or set to 0. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ContactGroupListCall<'a, C, A> { @@ -3071,7 +3230,7 @@ impl<'a, C, A> ContactGroupUpdateCall<'a, C, A> where C: BorrowMutcontact_group_id. + /// string, in the form of `contactGroups/{contact_group_id}`. /// /// Sets the *resource name* path property to the given value. /// @@ -3325,7 +3484,7 @@ impl<'a, C, A> ContactGroupDeleteCall<'a, C, A> where C: BorrowMut ContactGroupDeleteCall<'a, C, A> where C: BorrowMut ContactGroupDeleteCall<'a, C, A> { @@ -3406,7 +3565,7 @@ impl<'a, C, A> ContactGroupDeleteCall<'a, C, A> where C: BorrowMut +/// /// The only system contact groups that can have members added are /// `contactGroups/myContacts` and `contactGroups/starred`. Other system /// contact groups are deprecated and can only have contacts removed. @@ -3615,7 +3774,7 @@ impl<'a, C, A> ContactGroupMemberModifyCall<'a, C, A> where C: BorrowMut ContactGroupGetCall<'a, C, A> where C: BorrowMut, } - /// The resource name of the contact group to get. + /// Required. The resource name of the contact group to get. /// /// Sets the *resource name* path property to the given value. /// @@ -3879,7 +4038,8 @@ impl<'a, C, A> ContactGroupGetCall<'a, C, A> where C: BorrowMut, self._resource_name = new_value.to_string(); self } - /// Specifies the maximum number of members to return. + /// Optional. Specifies the maximum number of members to return. Defaults to 0 if not + /// set, which will return zero members. /// /// Sets the *max members* query property to the given value. pub fn max_members(mut self, new_value: i32) -> ContactGroupGetCall<'a, C, A> { @@ -3949,9 +4109,297 @@ impl<'a, C, A> ContactGroupGetCall<'a, C, A> where C: BorrowMut, } +/// Delete a contact's photo. +/// +/// A builder for the *deleteContactPhoto* method supported by a *people* resource. +/// It is not used directly, but through a `PeopleMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_people1 as people1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use people1::PeopleService; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.people().delete_contact_photo("resourceName") +/// .person_fields("justo") +/// .doit(); +/// # } +/// ``` +pub struct PeopleDeleteContactPhotoCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _resource_name: String, + _person_fields: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PeopleDeleteContactPhotoCall<'a, C, A> {} + +impl<'a, C, A> PeopleDeleteContactPhotoCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DeleteContactPhotoResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.people.deleteContactPhoto", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resourceName", self._resource_name.to_string())); + if let Some(value) = self._person_fields { + params.push(("personFields", value.to_string())); + } + for &field in ["alt", "resourceName", "personFields"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resourceName}:deleteContactPhoto"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the contact whose photo will be deleted. + /// + /// Sets the *resource name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource_name(mut self, new_value: &str) -> PeopleDeleteContactPhotoCall<'a, C, A> { + self._resource_name = new_value.to_string(); + self + } + /// Optional. A field mask to restrict which fields on the person are returned. Multiple + /// fields can be specified by separating them with commas. Defaults to empty + /// if not set, which will skip the post mutate get. Valid values are: + /// + /// * addresses + /// * ageRanges + /// * biographies + /// * birthdays + /// * coverPhotos + /// * emailAddresses + /// * events + /// * genders + /// * imClients + /// * interests + /// * locales + /// * memberships + /// * metadata + /// * names + /// * nicknames + /// * occupations + /// * organizations + /// * phoneNumbers + /// * photos + /// * relations + /// * residences + /// * sipAddresses + /// * skills + /// * urls + /// * userDefined + /// + /// Sets the *person fields* query property to the given value. + pub fn person_fields(mut self, new_value: &str) -> PeopleDeleteContactPhotoCall<'a, C, A> { + self._person_fields = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PeopleDeleteContactPhotoCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PeopleDeleteContactPhotoCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PeopleDeleteContactPhotoCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Provides a list of the authenticated user's contacts merged with any /// connected profiles. -///
          +/// /// The request throws a 400 error if 'personFields' is not specified. /// /// A builder for the *connections.list* method supported by a *people* resource. @@ -3980,13 +4428,13 @@ impl<'a, C, A> ContactGroupGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.people().connections_list("resourceName") -/// .sync_token("justo") -/// .sort_order("justo") +/// .sync_token("et") +/// .sort_order("et") /// .request_sync_token(true) -/// .request_mask_include_field("et") -/// .person_fields("diam") -/// .page_token("ipsum") -/// .page_size(-5) +/// .request_mask_include_field("ipsum") +/// .person_fields("Lorem") +/// .page_token("et") +/// .page_size(-70) /// .doit(); /// # } /// ``` @@ -4162,7 +4610,7 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> { self._sync_token = Some(new_value.to_string()); self } - /// The order in which the connections should be sorted. Defaults to + /// Optional. The order in which the connections should be sorted. Defaults to /// `LAST_MODIFIED_ASCENDING`. /// /// Sets the *sort order* query property to the given value. @@ -4189,9 +4640,9 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> { self._request_mask_include_field = Some(new_value.to_string()); self } - /// **Required.** A field mask to restrict which fields on each person are - /// returned. Multiple fields can be specified by separating them with commas. - /// Valid values are: + /// Required. A field mask to restrict which fields on each person are returned. Multiple + /// fields can be specified by separating them with commas. Valid values are: /// /// * addresses /// * ageRanges /// * biographies /// * birthdays - /// * braggingRights /// * coverPhotos /// * emailAddresses /// * events @@ -4233,12 +4682,9 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The number of connections to include in the response. Valid values are - /// between 1 and 2000, inclusive. Defaults to 100. + /// Optional. The number of connections to include in the response. Valid values are + /// between 1 and 2000, inclusive. Defaults to 100 if not set or set to 0. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> PeopleConnectionListCall<'a, C, A> { @@ -4359,7 +4809,6 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut hub: &'a PeopleService, _request: Person, - _parent: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4390,11 +4838,8 @@ impl<'a, C, A> PeopleCreateContactCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(4 + self._additional_params.len()); - if let Some(value) = self._parent { - params.push(("parent", value.to_string())); - } - for &field in ["alt", "parent"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + for &field in ["alt"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4509,13 +4954,6 @@ impl<'a, C, A> PeopleCreateContactCall<'a, C, A> where C: BorrowMut PeopleCreateContactCall<'a, C, A> { - self._parent = Some(new_value.to_string()); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4754,7 +5192,7 @@ impl<'a, C, A> PeopleDeleteContactCall<'a, C, A> where C: BorrowMut PeopleDeleteContactCall<'a, C, A> where C: BorrowMut +/// /// The request throws a 400 error if 'personFields' is not specified. /// /// A builder for the *get* method supported by a *people* resource. @@ -4858,8 +5296,8 @@ impl<'a, C, A> PeopleDeleteContactCall<'a, C, A> where C: BorrowMut PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// The resource name of the person to provide information about. + /// Required. The resource name of the person to provide information about. /// /// - To get information about the authenticated user, specify `people/me`. /// - To get information about a google account, specify - /// `people/`account_id. + /// `people/{account_id}`. /// - To get information about a contact, specify the resource name that /// identifies the contact as returned by /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). @@ -5032,24 +5470,22 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau self._resource_name = new_value.to_string(); self } - /// **Required.** Comma-separated list of person fields to be included in the - /// response. Each path should start with `person.`: for example, - /// `person.names` or `person.photos`. + /// Required. Comma-separated list of person fields to be included in the response. Each + /// path should start with `person.`: for example, `person.names` or + /// `person.photos`. /// /// Sets the *request mask.include field* query property to the given value. pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> { self._request_mask_include_field = Some(new_value.to_string()); self } - /// **Required.** A field mask to restrict which fields on the person are - /// returned. Multiple fields can be specified by separating them with commas. - /// Valid values are: + /// Required. A field mask to restrict which fields on the person are returned. Multiple + /// fields can be specified by separating them with commas. Valid values are: /// /// * addresses /// * ageRanges /// * biographies /// * birthdays - /// * braggingRights /// * coverPhotos /// * emailAddresses /// * events @@ -5066,12 +5502,9 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// * phoneNumbers /// * photos /// * relations - /// * relationshipInterests - /// * relationshipStatuses /// * residences /// * sipAddresses /// * skills - /// * taglines /// * urls /// * userDefined /// @@ -5147,14 +5580,15 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// will not be modified. /// /// The request throws a 400 error if `updatePersonFields` is not specified. -///
          +/// /// The request throws a 400 error if `person.metadata.sources` is not /// specified for the contact to be updated. -///
          -/// The request throws a 412 error if `person.metadata.sources.etag` is -/// different than the contact's etag, which indicates the contact has changed -/// since its data was read. Clients should get the latest person and re-apply -/// their updates to the latest person. +/// +/// The request throws a 400 error with an error with reason +/// `"failedPrecondition"` if `person.metadata.sources.etag` is different than +/// the contact's etag, which indicates the contact has changed since its data +/// was read. Clients should get the latest person and re-apply their updates +/// to the latest person. /// /// A builder for the *updateContact* method supported by a *people* resource. /// It is not used directly, but through a `PeopleMethods` instance. @@ -5188,7 +5622,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.people().update_contact(req, "resourceName") -/// .update_person_fields("erat") +/// .update_person_fields("sadipscing") /// .doit(); /// # } /// ``` @@ -5367,7 +5801,7 @@ impl<'a, C, A> PeopleUpdateContactCall<'a, C, A> where C: BorrowMutperson_id. + /// `people/{person_id}`. /// /// Sets the *resource name* path property to the given value. /// @@ -5377,8 +5811,8 @@ impl<'a, C, A> PeopleUpdateContactCall<'a, C, A> where C: BorrowMut PeopleUpdateContactCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = PeopleService::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UpdateContactPhotoRequest::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.people().update_contact_photo(req, "resourceName") +/// .doit(); +/// # } +/// ``` +pub struct PeopleUpdateContactPhotoCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a PeopleService, + _request: UpdateContactPhotoRequest, + _resource_name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PeopleUpdateContactPhotoCall<'a, C, A> {} + +impl<'a, C, A> PeopleUpdateContactPhotoCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UpdateContactPhotoResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "people.people.updateContactPhoto", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resourceName", self._resource_name.to_string())); + for &field in ["alt", "resourceName"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resourceName}:updateContactPhoto"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Contact.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resourceName}", "resourceName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resourceName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UpdateContactPhotoRequest) -> PeopleUpdateContactPhotoCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Person resource name + /// + /// Sets the *resource name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource_name(mut self, new_value: &str) -> PeopleUpdateContactPhotoCall<'a, C, A> { + self._resource_name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> PeopleUpdateContactPhotoCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> PeopleUpdateContactPhotoCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Contact`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PeopleUpdateContactPhotoCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Provides information about a list of specific people by specifying a list /// of requested resource names. Use `people/me` to indicate the authenticated /// user. -///
          +/// /// The request throws a 400 error if 'personFields' is not specified. /// /// A builder for the *getBatchGet* method supported by a *people* resource. @@ -5502,9 +6215,9 @@ impl<'a, C, A> PeopleUpdateContactCall<'a, C, A> where C: BorrowMut PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut } - /// The resource names of the people to provide information about. + /// Required. The resource names of the people to provide information about. /// /// - To get information about the authenticated user, specify `people/me`. /// - To get information about a google account, specify - /// `people/`account_id. + /// `people/{account_id}`. /// - To get information about a contact, specify the resource name that /// identifies the contact as returned by /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). @@ -5656,24 +6369,22 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut self._resource_names.push(new_value.to_string()); self } - /// **Required.** Comma-separated list of person fields to be included in the - /// response. Each path should start with `person.`: for example, - /// `person.names` or `person.photos`. + /// Required. Comma-separated list of person fields to be included in the response. Each + /// path should start with `person.`: for example, `person.names` or + /// `person.photos`. /// /// Sets the *request mask.include field* query property to the given value. pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleGetBatchGetCall<'a, C, A> { self._request_mask_include_field = Some(new_value.to_string()); self } - /// **Required.** A field mask to restrict which fields on each person are - /// returned. Multiple fields can be specified by separating them with commas. - /// Valid values are: + /// Required. A field mask to restrict which fields on each person are returned. Multiple + /// fields can be specified by separating them with commas. Valid values are: /// /// * addresses /// * ageRanges /// * biographies /// * birthdays - /// * braggingRights /// * coverPhotos /// * emailAddresses /// * events @@ -5690,12 +6401,9 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut /// * phoneNumbers /// * photos /// * relations - /// * relationshipInterests - /// * relationshipStatuses /// * residences /// * sipAddresses /// * skills - /// * taglines /// * urls /// * userDefined /// diff --git a/gen/photoslibrary1-cli/Cargo.toml b/gen/photoslibrary1-cli/Cargo.toml index 5517ff76c8..ea2983b38d 100644 --- a/gen/photoslibrary1-cli/Cargo.toml +++ b/gen/photoslibrary1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-photoslibrary1-cli" -version = "1.0.12+20190702" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Photos Library (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/photoslibrary1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-photoslibrary1] path = "../photoslibrary1" -version = "1.0.12+20190702" +version = "1.0.13+20200329" diff --git a/gen/photoslibrary1-cli/README.md b/gen/photoslibrary1-cli/README.md index 647718445c..0cf2acfd6a 100644 --- a/gen/photoslibrary1-cli/README.md +++ b/gen/photoslibrary1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Photos Library* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Photos Library* API at revision *20200329*. The CLI is at version *1.0.13*. ```bash photoslibrary1 [options] diff --git a/gen/photoslibrary1-cli/mkdocs.yml b/gen/photoslibrary1-cli/mkdocs.yml index 14ca880d1f..eaa90c0903 100644 --- a/gen/photoslibrary1-cli/mkdocs.yml +++ b/gen/photoslibrary1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Photos Library v1.0.12+20190702 +site_name: Photos Library v1.0.13+20200329 site_url: http://byron.github.io/google-apis-rs/google-photoslibrary1-cli site_description: A complete library to interact with Photos Library (protocol v1) diff --git a/gen/photoslibrary1-cli/src/main.rs b/gen/photoslibrary1-cli/src/main.rs index 6af0de0fdc..77586b705b 100644 --- a/gen/photoslibrary1-cli/src/main.rs +++ b/gen/photoslibrary1-cli/src/main.rs @@ -339,17 +339,18 @@ impl<'n> Engine<'n> { "album.media-items-count" => Some(("album.mediaItemsCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "album.title" => Some(("album.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "album.is-writeable" => Some(("album.isWriteable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "album.share-info.shared-album-options.is-commentable" => Some(("album.shareInfo.sharedAlbumOptions.isCommentable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "album.share-info.shared-album-options.is-collaborative" => Some(("album.shareInfo.sharedAlbumOptions.isCollaborative", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "album.share-info.shareable-url" => Some(("album.shareInfo.shareableUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "album.share-info.share-token" => Some(("album.shareInfo.shareToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "album.share-info.is-joined" => Some(("album.shareInfo.isJoined", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "album.share-info.shareable-url" => Some(("album.shareInfo.shareableUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "album.share-info.is-owned" => Some(("album.shareInfo.isOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "album.share-info.shared-album-options.is-commentable" => Some(("album.shareInfo.sharedAlbumOptions.isCommentable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "album.share-info.shared-album-options.is-collaborative" => Some(("album.shareInfo.sharedAlbumOptions.isCollaborative", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "album.cover-photo-base-url" => Some(("album.coverPhotoBaseUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "album.product-url" => Some(("album.productUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "album.cover-photo-media-item-id" => Some(("album.coverPhotoMediaItemId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "album.id" => Some(("album.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["album", "cover-photo-base-url", "cover-photo-media-item-id", "id", "is-collaborative", "is-commentable", "is-joined", "is-writeable", "media-items-count", "product-url", "share-info", "share-token", "shareable-url", "shared-album-options", "title"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["album", "cover-photo-base-url", "cover-photo-media-item-id", "id", "is-collaborative", "is-commentable", "is-joined", "is-owned", "is-writeable", "media-items-count", "product-url", "share-info", "share-token", "shareable-url", "shared-album-options", "title"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1947,7 +1948,7 @@ fn main() { let mut app = App::new("photoslibrary1") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200329") .about("Manage photos, videos, and albums in Google Photos ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_photoslibrary1_cli") diff --git a/gen/photoslibrary1/Cargo.toml b/gen/photoslibrary1/Cargo.toml index a1eb671714..63f68fd6f1 100644 --- a/gen/photoslibrary1/Cargo.toml +++ b/gen/photoslibrary1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-photoslibrary1" -version = "1.0.12+20190702" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Photos Library (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/photoslibrary1" homepage = "https://developers.google.com/photos/" -documentation = "https://docs.rs/google-photoslibrary1/1.0.12+20190702" +documentation = "https://docs.rs/google-photoslibrary1/1.0.13+20200329" license = "MIT" keywords = ["photoslibrary", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/photoslibrary1/README.md b/gen/photoslibrary1/README.md index 8770dff6af..688e3997ce 100644 --- a/gen/photoslibrary1/README.md +++ b/gen/photoslibrary1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-photoslibrary1` library allows access to all features of the *Google Photos Library* service. -This documentation was generated from *Photos Library* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *photoslibrary:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Photos Library* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *photoslibrary:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Photos Library* *v1* API can be found at the [official documentation site](https://developers.google.com/photos/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.PhotosLibrary.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.PhotosLibrary.html) ... -* [albums](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.Album.html) - * [*add enrichment*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumAddEnrichmentCall.html), [*batch add media items*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumBatchAddMediaItemCall.html), [*batch remove media items*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumBatchRemoveMediaItemCall.html), [*create*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumCreateCall.html), [*get*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumGetCall.html), [*list*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumListCall.html), [*share*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumShareCall.html) and [*unshare*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.AlbumUnshareCall.html) -* [media items](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.MediaItem.html) - * [*batch create*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.MediaItemBatchCreateCall.html), [*batch get*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.MediaItemBatchGetCall.html), [*get*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.MediaItemGetCall.html), [*list*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.MediaItemListCall.html) and [*search*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.MediaItemSearchCall.html) +* [albums](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.Album.html) + * [*add enrichment*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumAddEnrichmentCall.html), [*batch add media items*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumBatchAddMediaItemCall.html), [*batch remove media items*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumBatchRemoveMediaItemCall.html), [*create*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumCreateCall.html), [*get*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumGetCall.html), [*list*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumListCall.html), [*share*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumShareCall.html) and [*unshare*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.AlbumUnshareCall.html) +* [media items](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.MediaItem.html) + * [*batch create*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.MediaItemBatchCreateCall.html), [*batch get*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.MediaItemBatchGetCall.html), [*get*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.MediaItemGetCall.html), [*list*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.MediaItemListCall.html) and [*search*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.MediaItemSearchCall.html) * shared albums - * [*get*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.SharedAlbumGetCall.html), [*join*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.SharedAlbumJoinCall.html), [*leave*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.SharedAlbumLeaveCall.html) and [*list*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.SharedAlbumListCall.html) + * [*get*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.SharedAlbumGetCall.html), [*join*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.SharedAlbumJoinCall.html), [*leave*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.SharedAlbumLeaveCall.html) and [*list*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.SharedAlbumListCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/struct.PhotosLibrary.html)** +* **[Hub](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/struct.PhotosLibrary.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.Part.html)** + * **[Parts](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-photoslibrary1/1.0.12+20190702/google_photoslibrary1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-photoslibrary1/1.0.13+20200329/google_photoslibrary1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/photoslibrary1/src/lib.rs b/gen/photoslibrary1/src/lib.rs index c7a957a74d..cb058be847 100644 --- a/gen/photoslibrary1/src/lib.rs +++ b/gen/photoslibrary1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Photos Library* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *photoslibrary:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Photos Library* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *photoslibrary:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Photos Library* *v1* API can be found at the //! [official documentation site](https://developers.google.com/photos/). @@ -351,7 +351,7 @@ impl<'a, C, A> PhotosLibrary PhotosLibrary { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://photoslibrary.googleapis.com/".to_string(), _root_url: "https://photoslibrary.googleapis.com/".to_string(), } @@ -368,7 +368,7 @@ impl<'a, C, A> PhotosLibrary } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -448,8 +448,7 @@ pub struct Album { /// in to their Google Photos account to access this link. #[serde(rename="productUrl")] pub product_url: Option, - /// [Output only] Identifier for the media item associated with the cover - /// photo. + /// Identifier for the media item associated with the cover photo. #[serde(rename="coverPhotoMediaItemId")] pub cover_photo_media_item_id: Option, /// [Ouput only] Identifier for the album. This is a persistent identifier that @@ -517,7 +516,7 @@ impl ResponseResult for ShareAlbumResponse {} /// Defines a range of dates. Both dates must be of the same format. For more -/// information, see
          Date +/// information, see Date. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -957,7 +956,9 @@ pub struct JoinSharedAlbumResponse { impl ResponseResult for JoinSharedAlbumResponse {} -/// Represents a whole calendar date. The day may be 0 to represent a year and month where the day isn't significant, such as a whole calendar month. The month may be 0 to represent a a day and a year where the month isn't signficant, like when you want to specify the same day in every month of a year or a specific year. The year may be 0 to represent a month and day independent of year, like an anniversary date. +/// Represents a whole calendar date. Set `day` to 0 when only the month and year are significant, for example, all of December 2018. Set `day` and `month` to 0 if only the year is significant, for example, the entire of 2018. Set `year` to 0 when only the day and month are significant, for example, an anniversary or birthday. +/// +/// Unsupported: Setting all values to 0, only `month` to 0, or both `day` and `year` to 0 at the same time. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1078,6 +1079,14 @@ pub struct SimpleMediaItem { /// Token identifying the media bytes that have been uploaded to Google. #[serde(rename="uploadToken")] pub upload_token: Option, + /// File name with extension of the media item. This is shown to the user in + /// Google Photos. The file name specified during the byte + /// upload process is ignored if this field is set. The file name, + /// including the file extension, shouldn't be more than 255 characters. This + /// is an optional field. + #[serde(rename="fileName")] + pub file_name: Option, } impl Part for SimpleMediaItem {} @@ -1132,19 +1141,22 @@ impl ResponseResult for ListMediaItemsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ShareInfo { - /// A link to the album that's now shared on the Google Photos website and app. - /// Anyone with the link can access this shared album and see all of the items - /// present in the album. - #[serde(rename="shareableUrl")] - pub shareable_url: Option, - /// A token that can be used by other users to join this shared album via the - /// API. + /// True if the user owns the album. + #[serde(rename="isOwned")] + pub is_owned: Option, + /// A token that can be used by other users to join or leave this shared album + /// via the API. #[serde(rename="shareToken")] pub share_token: Option, /// True if the user has joined the album. This is always true for the owner /// of the shared album. #[serde(rename="isJoined")] pub is_joined: Option, + /// A link to the album that's now shared on the Google Photos website and app. + /// Anyone with the link can access this shared album and see all of the items + /// present in the album. + #[serde(rename="shareableUrl")] + pub shareable_url: Option, /// Options that control the sharing of an album. #[serde(rename="sharedAlbumOptions")] pub shared_album_options: Option, @@ -1425,9 +1437,9 @@ pub struct SearchMediaItemsRequest { /// Filters to apply to the request. Can't be set in conjunction with an /// `albumId`. pub filters: Option, - /// Maximum number of media items to return in the response. The default number - /// of media items to return at a time is 25. The maximum - /// `pageSize` is 100. + /// Maximum number of media items to return in the response. Fewer media items + /// might be returned than the specified number. The default `pageSize` is 25, + /// the maximum is 100. #[serde(rename="pageSize")] pub page_size: Option, /// A continuation token to get the next page of the results. Adding this to @@ -3055,8 +3067,9 @@ impl<'a, C, A> AlbumListCall<'a, C, A> where C: BorrowMut, A: oau self._page_token = Some(new_value.to_string()); self } - /// Maximum number of albums to return in the response. The default number of - /// albums to return at a time is 20. The maximum `pageSize` is 50. + /// Maximum number of albums to return in the response. Fewer albums might be + /// returned than the specified number. The default `pageSize` is 20, the + /// maximum is 50. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> AlbumListCall<'a, C, A> { @@ -5101,8 +5114,9 @@ impl<'a, C, A> SharedAlbumListCall<'a, C, A> where C: BorrowMut, self._page_token = Some(new_value.to_string()); self } - /// Maximum number of albums to return in the response. The default number of - /// albums to return at a time is 20. The maximum `pageSize` is 50. + /// Maximum number of albums to return in the response. Fewer albums might be + /// returned than the specified number. The default `pageSize` is 20, the + /// maximum is 50. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> SharedAlbumListCall<'a, C, A> { @@ -6334,8 +6348,9 @@ impl<'a, C, A> MediaItemListCall<'a, C, A> where C: BorrowMut, A: self._page_token = Some(new_value.to_string()); self } - /// Maximum number of media items to return in the response. The default number - /// of media items to return at a time is 25. The maximum `pageSize` is 100. + /// Maximum number of media items to return in the response. Fewer media items + /// might be returned than the specified number. The default `pageSize` is 25, + /// the maximum is 100. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> MediaItemListCall<'a, C, A> { diff --git a/gen/playcustomapp1-cli/Cargo.toml b/gen/playcustomapp1-cli/Cargo.toml index e8818590f9..1f802d09b1 100644 --- a/gen/playcustomapp1-cli/Cargo.toml +++ b/gen/playcustomapp1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-playcustomapp1-cli" -version = "1.0.12+20170622" +version = "1.0.13+20170622" authors = ["Sebastian Thiel "] description = "A complete library to interact with playcustomapp (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playcustomapp1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-playcustomapp1] path = "../playcustomapp1" -version = "1.0.12+20170622" +version = "1.0.13+20170622" diff --git a/gen/playcustomapp1-cli/README.md b/gen/playcustomapp1-cli/README.md index a8aafc3e9f..d7c0b26984 100644 --- a/gen/playcustomapp1-cli/README.md +++ b/gen/playcustomapp1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *playcustomapp* API at revision *20170622*. The CLI is at version *1.0.12*. +This documentation was generated from the *playcustomapp* API at revision *20170622*. The CLI is at version *1.0.13*. ```bash playcustomapp1 [options] diff --git a/gen/playcustomapp1-cli/mkdocs.yml b/gen/playcustomapp1-cli/mkdocs.yml index 3a8e0586f9..f3f83429bc 100644 --- a/gen/playcustomapp1-cli/mkdocs.yml +++ b/gen/playcustomapp1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: playcustomapp v1.0.12+20170622 +site_name: playcustomapp v1.0.13+20170622 site_url: http://byron.github.io/google-apis-rs/google-playcustomapp1-cli site_description: A complete library to interact with playcustomapp (protocol v1) diff --git a/gen/playcustomapp1-cli/src/main.rs b/gen/playcustomapp1-cli/src/main.rs index 540ae68223..60ce2bb34b 100644 --- a/gen/playcustomapp1-cli/src/main.rs +++ b/gen/playcustomapp1-cli/src/main.rs @@ -276,7 +276,7 @@ fn main() { let mut app = App::new("playcustomapp1") .author("Sebastian Thiel ") - .version("1.0.12+20170622") + .version("1.0.13+20170622") .about("An API to publish custom Android apps.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_playcustomapp1_cli") .arg(Arg::with_name("url") diff --git a/gen/playcustomapp1/Cargo.toml b/gen/playcustomapp1/Cargo.toml index f4ff12c11c..7dd621bd54 100644 --- a/gen/playcustomapp1/Cargo.toml +++ b/gen/playcustomapp1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-playcustomapp1" -version = "1.0.12+20170622" +version = "1.0.13+20170622" authors = ["Sebastian Thiel "] description = "A complete library to interact with playcustomapp (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playcustomapp1" homepage = "https://developers.google.com/android/work/play/custom-app-api" -documentation = "https://docs.rs/google-playcustomapp1/1.0.12+20170622" +documentation = "https://docs.rs/google-playcustomapp1/1.0.13+20170622" license = "MIT" keywords = ["playcustomapp", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/playcustomapp1/README.md b/gen/playcustomapp1/README.md index bfc936c087..f802f60823 100644 --- a/gen/playcustomapp1/README.md +++ b/gen/playcustomapp1/README.md @@ -5,21 +5,21 @@ DO NOT EDIT ! --> The `google-playcustomapp1` library allows access to all features of the *Google playcustomapp* service. -This documentation was generated from *playcustomapp* crate version *1.0.12+20170622*, where *20170622* is the exact revision of the *playcustomapp:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *playcustomapp* crate version *1.0.13+20170622*, where *20170622* is the exact revision of the *playcustomapp:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *playcustomapp* *v1* API can be found at the [official documentation site](https://developers.google.com/android/work/play/custom-app-api). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/struct.Playcustomapp.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/struct.Playcustomapp.html) ... * accounts - * [*custom apps create*](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/struct.AccountCustomAppCreateCall.html) + * [*custom apps create*](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/struct.AccountCustomAppCreateCall.html) Upload supported by ... -* [*custom apps create accounts*](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/struct.AccountCustomAppCreateCall.html) +* [*custom apps create accounts*](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/struct.AccountCustomAppCreateCall.html) @@ -27,17 +27,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/struct.Playcustomapp.html)** +* **[Hub](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/struct.Playcustomapp.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.Part.html)** + * **[Parts](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-playcustomapp1/1.0.12+20170622/google_playcustomapp1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-playcustomapp1/1.0.13+20170622/google_playcustomapp1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/playcustomapp1/src/lib.rs b/gen/playcustomapp1/src/lib.rs index 7b1f47e036..4b533b4163 100644 --- a/gen/playcustomapp1/src/lib.rs +++ b/gen/playcustomapp1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *playcustomapp* crate version *1.0.12+20170622*, where *20170622* is the exact revision of the *playcustomapp:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *playcustomapp* crate version *1.0.13+20170622*, where *20170622* is the exact revision of the *playcustomapp:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *playcustomapp* *v1* API can be found at the //! [official documentation site](https://developers.google.com/android/work/play/custom-app-api). @@ -335,7 +335,7 @@ impl<'a, C, A> Playcustomapp Playcustomapp { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/playcustomapp/v1/accounts/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -346,7 +346,7 @@ impl<'a, C, A> Playcustomapp } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/playmoviespartner1-cli/Cargo.toml b/gen/playmoviespartner1-cli/Cargo.toml index dbdcaae613..6a699428fc 100644 --- a/gen/playmoviespartner1-cli/Cargo.toml +++ b/gen/playmoviespartner1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-playmoviespartner1-cli" -version = "1.0.12+20170919" +version = "1.0.13+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with Play Movies (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playmoviespartner1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-playmoviespartner1] path = "../playmoviespartner1" -version = "1.0.12+20170919" +version = "1.0.13+20170919" diff --git a/gen/playmoviespartner1-cli/README.md b/gen/playmoviespartner1-cli/README.md index 578b2fb824..35c5046bae 100644 --- a/gen/playmoviespartner1-cli/README.md +++ b/gen/playmoviespartner1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Play Movies* API at revision *20170919*. The CLI is at version *1.0.12*. +This documentation was generated from the *Play Movies* API at revision *20170919*. The CLI is at version *1.0.13*. ```bash playmoviespartner1 [options] diff --git a/gen/playmoviespartner1-cli/mkdocs.yml b/gen/playmoviespartner1-cli/mkdocs.yml index 2594c1e936..8e751618b2 100644 --- a/gen/playmoviespartner1-cli/mkdocs.yml +++ b/gen/playmoviespartner1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Play Movies v1.0.12+20170919 +site_name: Play Movies v1.0.13+20170919 site_url: http://byron.github.io/google-apis-rs/google-playmoviespartner1-cli site_description: A complete library to interact with Play Movies (protocol v1) diff --git a/gen/playmoviespartner1-cli/src/main.rs b/gen/playmoviespartner1-cli/src/main.rs index bb7115e6a1..73729db9ba 100644 --- a/gen/playmoviespartner1-cli/src/main.rs +++ b/gen/playmoviespartner1-cli/src/main.rs @@ -737,7 +737,7 @@ fn main() { let mut app = App::new("playmoviespartner1") .author("Sebastian Thiel ") - .version("1.0.12+20170919") + .version("1.0.13+20170919") .about("Gets the delivery status of titles for Google Play Movies Partners.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli") .arg(Arg::with_name("url") diff --git a/gen/playmoviespartner1/Cargo.toml b/gen/playmoviespartner1/Cargo.toml index bc350aa4df..f30e200ae4 100644 --- a/gen/playmoviespartner1/Cargo.toml +++ b/gen/playmoviespartner1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-playmoviespartner1" -version = "1.0.12+20170919" +version = "1.0.13+20170919" authors = ["Sebastian Thiel "] description = "A complete library to interact with Play Movies (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playmoviespartner1" homepage = "https://developers.google.com/playmoviespartner/" -documentation = "https://docs.rs/google-playmoviespartner1/1.0.12+20170919" +documentation = "https://docs.rs/google-playmoviespartner1/1.0.13+20170919" license = "MIT" keywords = ["playmoviespartner", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/playmoviespartner1/README.md b/gen/playmoviespartner1/README.md index 9ada5dc8fc..e8471715f1 100644 --- a/gen/playmoviespartner1/README.md +++ b/gen/playmoviespartner1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-playmoviespartner1` library allows access to all features of the *Google Play Movies* service. -This documentation was generated from *Play Movies* crate version *1.0.12+20170919*, where *20170919* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Play Movies* crate version *1.0.13+20170919*, where *20170919* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Play Movies* *v1* API can be found at the [official documentation site](https://developers.google.com/playmoviespartner/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.PlayMovies.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.PlayMovies.html) ... * accounts - * [*avails get*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.AccountAvailGetCall.html), [*avails list*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.AccountAvailListCall.html), [*orders get*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.AccountOrderGetCall.html), [*orders list*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.AccountOrderListCall.html), [*store infos country get*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.AccountStoreInfoListCall.html) + * [*avails get*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.AccountAvailGetCall.html), [*avails list*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.AccountAvailListCall.html), [*orders get*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.AccountOrderGetCall.html), [*orders list*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.AccountOrderListCall.html), [*store infos country get*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.AccountStoreInfoListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/struct.PlayMovies.html)** +* **[Hub](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/struct.PlayMovies.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.Part.html)** + * **[Parts](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -124,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -144,29 +144,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-playmoviespartner1/1.0.12+20170919/google_playmoviespartner1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-playmoviespartner1/1.0.13+20170919/google_playmoviespartner1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/playmoviespartner1/src/lib.rs b/gen/playmoviespartner1/src/lib.rs index c241e51658..fcd1161b2c 100644 --- a/gen/playmoviespartner1/src/lib.rs +++ b/gen/playmoviespartner1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Play Movies* crate version *1.0.12+20170919*, where *20170919* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Play Movies* crate version *1.0.13+20170919*, where *20170919* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Play Movies* *v1* API can be found at the //! [official documentation site](https://developers.google.com/playmoviespartner/). @@ -317,7 +317,7 @@ impl<'a, C, A> PlayMovies PlayMovies { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://playmoviespartner.googleapis.com/".to_string(), _root_url: "https://playmoviespartner.googleapis.com/".to_string(), } @@ -328,7 +328,7 @@ impl<'a, C, A> PlayMovies } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/plus1-cli/Cargo.toml b/gen/plus1-cli/Cargo.toml index 9ab0029c60..4408bdc598 100644 --- a/gen/plus1-cli/Cargo.toml +++ b/gen/plus1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plus1-cli" -version = "1.0.12+20190616" +version = "1.0.13+20190616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plus (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plus1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-plus1] path = "../plus1" -version = "1.0.12+20190616" +version = "1.0.13+20190616" diff --git a/gen/plus1-cli/README.md b/gen/plus1-cli/README.md index fad8d358c0..064d901563 100644 --- a/gen/plus1-cli/README.md +++ b/gen/plus1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *plus* API at revision *20190616*. The CLI is at version *1.0.12*. +This documentation was generated from the *plus* API at revision *20190616*. The CLI is at version *1.0.13*. ```bash plus1 [options] diff --git a/gen/plus1-cli/mkdocs.yml b/gen/plus1-cli/mkdocs.yml index 9ccfa85742..c5e07991a1 100644 --- a/gen/plus1-cli/mkdocs.yml +++ b/gen/plus1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plus v1.0.12+20190616 +site_name: plus v1.0.13+20190616 site_url: http://byron.github.io/google-apis-rs/google-plus1-cli site_description: A complete library to interact with plus (protocol v1) diff --git a/gen/plus1-cli/src/main.rs b/gen/plus1-cli/src/main.rs index 13624fddd3..7174151ce0 100644 --- a/gen/plus1-cli/src/main.rs +++ b/gen/plus1-cli/src/main.rs @@ -938,7 +938,7 @@ fn main() { let mut app = App::new("plus1") .author("Sebastian Thiel ") - .version("1.0.12+20190616") + .version("1.0.13+20190616") .about("Builds on top of the Google+ platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_plus1_cli") .arg(Arg::with_name("url") diff --git a/gen/plus1/Cargo.toml b/gen/plus1/Cargo.toml index 6215617b53..370fa3cf84 100644 --- a/gen/plus1/Cargo.toml +++ b/gen/plus1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plus1" -version = "1.0.12+20190616" +version = "1.0.13+20190616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plus (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plus1" homepage = "https://developers.google.com/+/api/" -documentation = "https://docs.rs/google-plus1/1.0.12+20190616" +documentation = "https://docs.rs/google-plus1/1.0.13+20190616" license = "MIT" keywords = ["plus", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/plus1/README.md b/gen/plus1/README.md index 04f67033e4..483d023dc6 100644 --- a/gen/plus1/README.md +++ b/gen/plus1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-plus1` library allows access to all features of the *Google plus* service. -This documentation was generated from *plus* crate version *1.0.12+20190616*, where *20190616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *plus* crate version *1.0.13+20190616*, where *20190616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *plus* *v1* API can be found at the [official documentation site](https://developers.google.com/+/api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.Plus.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.Plus.html) ... -* [activities](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.Activity.html) - * [*get*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.ActivityGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.ActivityListCall.html) and [*search*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.ActivitySearchCall.html) -* [comments](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.Comment.html) - * [*get*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.CommentListCall.html) +* [activities](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.Activity.html) + * [*get*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.ActivityGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.ActivityListCall.html) and [*search*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.ActivitySearchCall.html) +* [comments](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.Comment.html) + * [*get*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.CommentListCall.html) * people - * [*get*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.PeopleListByActivityCall.html) and [*search*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.PeopleSearchCall.html) + * [*get*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.PeopleListByActivityCall.html) and [*search*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.PeopleSearchCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/struct.Plus.html)** +* **[Hub](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/struct.Plus.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-plus1/1.0.12+20190616/google_plus1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plus1/1.0.13+20190616/google_plus1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/plus1/src/lib.rs b/gen/plus1/src/lib.rs index e85e681c78..eba83de0bb 100644 --- a/gen/plus1/src/lib.rs +++ b/gen/plus1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *plus* crate version *1.0.12+20190616*, where *20190616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *plus* crate version *1.0.13+20190616*, where *20190616* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *plus* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/api/). @@ -341,7 +341,7 @@ impl<'a, C, A> Plus Plus { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/plus/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -358,7 +358,7 @@ impl<'a, C, A> Plus } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/plusdomains1-cli/Cargo.toml b/gen/plusdomains1-cli/Cargo.toml index 53eb00a030..500020c067 100644 --- a/gen/plusdomains1-cli/Cargo.toml +++ b/gen/plusdomains1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-plusdomains1-cli" -version = "1.0.12+20190616" +version = "1.0.13+20190616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plusDomains (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-plusdomains1] path = "../plusdomains1" -version = "1.0.12+20190616" +version = "1.0.13+20190616" diff --git a/gen/plusdomains1-cli/README.md b/gen/plusdomains1-cli/README.md index 6f58931ea4..d30efd4b42 100644 --- a/gen/plusdomains1-cli/README.md +++ b/gen/plusdomains1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *plusDomains* API at revision *20190616*. The CLI is at version *1.0.12*. +This documentation was generated from the *plusDomains* API at revision *20190616*. The CLI is at version *1.0.13*. ```bash plusdomains1 [options] diff --git a/gen/plusdomains1-cli/mkdocs.yml b/gen/plusdomains1-cli/mkdocs.yml index 3c0f00aaa0..1d0c0e6f6d 100644 --- a/gen/plusdomains1-cli/mkdocs.yml +++ b/gen/plusdomains1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plusDomains v1.0.12+20190616 +site_name: plusDomains v1.0.13+20190616 site_url: http://byron.github.io/google-apis-rs/google-plusdomains1-cli site_description: A complete library to interact with plusDomains (protocol v1) diff --git a/gen/plusdomains1-cli/src/main.rs b/gen/plusdomains1-cli/src/main.rs index a04e909bb3..b80f984218 100644 --- a/gen/plusdomains1-cli/src/main.rs +++ b/gen/plusdomains1-cli/src/main.rs @@ -1114,7 +1114,7 @@ fn main() { let mut app = App::new("plusdomains1") .author("Sebastian Thiel ") - .version("1.0.12+20190616") + .version("1.0.13+20190616") .about("Builds on top of the Google+ platform for Google Apps Domains.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_plusdomains1_cli") .arg(Arg::with_name("url") diff --git a/gen/plusdomains1/Cargo.toml b/gen/plusdomains1/Cargo.toml index 400f70d1f9..6976a38e85 100644 --- a/gen/plusdomains1/Cargo.toml +++ b/gen/plusdomains1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plusdomains1" -version = "1.0.12+20190616" +version = "1.0.13+20190616" authors = ["Sebastian Thiel "] description = "A complete library to interact with plusDomains (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/plusdomains1" homepage = "https://developers.google.com/+/domains/" -documentation = "https://docs.rs/google-plusdomains1/1.0.12+20190616" +documentation = "https://docs.rs/google-plusdomains1/1.0.13+20190616" license = "MIT" keywords = ["plusDomains", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/plusdomains1/README.md b/gen/plusdomains1/README.md index 8357965f3e..437e2ee60f 100644 --- a/gen/plusdomains1/README.md +++ b/gen/plusdomains1/README.md @@ -5,31 +5,31 @@ DO NOT EDIT ! --> The `google-plusdomains1` library allows access to all features of the *Google plusDomains* service. -This documentation was generated from *plusDomains* crate version *1.0.12+20190616*, where *20190616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *plusDomains* crate version *1.0.13+20190616*, where *20190616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *plusDomains* *v1* API can be found at the [official documentation site](https://developers.google.com/+/domains/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.PlusDomains.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.PlusDomains.html) ... -* [activities](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.Activity.html) - * [*get*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.ActivityGetCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.ActivityListCall.html) -* [audiences](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.Audience.html) - * [*list*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.AudienceListCall.html) -* [circles](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.Circle.html) - * [*list*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.CircleListCall.html) -* [comments](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.Comment.html) - * [*get*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.CommentListCall.html) -* [media](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.Media.html) - * [*insert*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.MediaInsertCall.html) +* [activities](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.Activity.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.ActivityGetCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.ActivityListCall.html) +* [audiences](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.Audience.html) + * [*list*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.AudienceListCall.html) +* [circles](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.Circle.html) + * [*list*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.CircleListCall.html) +* [comments](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.Comment.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.CommentListCall.html) +* [media](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.Media.html) + * [*insert*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.MediaInsertCall.html) * people - * [*get*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.PeopleListCall.html) and [*list by activity*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.PeopleListByActivityCall.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.PeopleListCall.html) and [*list by activity*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.PeopleListByActivityCall.html) Upload supported by ... -* [*insert media*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.MediaInsertCall.html) +* [*insert media*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.MediaInsertCall.html) @@ -37,17 +37,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/struct.PlusDomains.html)** +* **[Hub](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/struct.PlusDomains.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -142,17 +142,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -162,29 +162,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-plusdomains1/1.0.12+20190616/google_plusdomains1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plusdomains1/1.0.13+20190616/google_plusdomains1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/plusdomains1/src/lib.rs b/gen/plusdomains1/src/lib.rs index 36a88f1dde..8122e24c9e 100644 --- a/gen/plusdomains1/src/lib.rs +++ b/gen/plusdomains1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *plusDomains* crate version *1.0.12+20190616*, where *20190616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *plusDomains* crate version *1.0.13+20190616*, where *20190616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *plusDomains* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/domains/). @@ -366,7 +366,7 @@ impl<'a, C, A> PlusDomains PlusDomains { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/plusDomains/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -392,7 +392,7 @@ impl<'a, C, A> PlusDomains } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/prediction1d6-cli/Cargo.toml b/gen/prediction1d6-cli/Cargo.toml index a5f3a7aabd..848a849c87 100644 --- a/gen/prediction1d6-cli/Cargo.toml +++ b/gen/prediction1d6-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-prediction1d6-cli" -version = "1.0.12+20160511" +version = "1.0.13+20160511" authors = ["Sebastian Thiel "] description = "A complete library to interact with prediction (protocol v1.6)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/prediction1d6-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-prediction1d6] path = "../prediction1d6" -version = "1.0.12+20160511" +version = "1.0.13+20160511" diff --git a/gen/prediction1d6-cli/README.md b/gen/prediction1d6-cli/README.md index eccd3ec8b7..99de3e1b91 100644 --- a/gen/prediction1d6-cli/README.md +++ b/gen/prediction1d6-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *prediction* API at revision *20160511*. The CLI is at version *1.0.12*. +This documentation was generated from the *prediction* API at revision *20160511*. The CLI is at version *1.0.13*. ```bash prediction1d6 [options] diff --git a/gen/prediction1d6-cli/mkdocs.yml b/gen/prediction1d6-cli/mkdocs.yml index 35247fed01..ce7043c186 100644 --- a/gen/prediction1d6-cli/mkdocs.yml +++ b/gen/prediction1d6-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: prediction v1.0.12+20160511 +site_name: prediction v1.0.13+20160511 site_url: http://byron.github.io/google-apis-rs/google-prediction1d6-cli site_description: A complete library to interact with prediction (protocol v1.6) diff --git a/gen/prediction1d6-cli/src/main.rs b/gen/prediction1d6-cli/src/main.rs index 38b1b28d05..9cf04fe9cc 100644 --- a/gen/prediction1d6-cli/src/main.rs +++ b/gen/prediction1d6-cli/src/main.rs @@ -963,7 +963,7 @@ fn main() { let mut app = App::new("prediction1d6") .author("Sebastian Thiel ") - .version("1.0.12+20160511") + .version("1.0.13+20160511") .about("Lets you access a cloud hosted machine learning service that makes it easy to build smart apps") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_prediction1d6_cli") .arg(Arg::with_name("url") diff --git a/gen/prediction1d6/Cargo.toml b/gen/prediction1d6/Cargo.toml index 8d596f32b1..420de68666 100644 --- a/gen/prediction1d6/Cargo.toml +++ b/gen/prediction1d6/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-prediction1d6" -version = "1.0.12+20160511" +version = "1.0.13+20160511" authors = ["Sebastian Thiel "] description = "A complete library to interact with prediction (protocol v1.6)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/prediction1d6" homepage = "https://developers.google.com/prediction/docs/developer-guide" -documentation = "https://docs.rs/google-prediction1d6/1.0.12+20160511" +documentation = "https://docs.rs/google-prediction1d6/1.0.13+20160511" license = "MIT" keywords = ["prediction", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/prediction1d6/README.md b/gen/prediction1d6/README.md index 86b982ea8b..251024510e 100644 --- a/gen/prediction1d6/README.md +++ b/gen/prediction1d6/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-prediction1d6` library allows access to all features of the *Google prediction* service. -This documentation was generated from *prediction* crate version *1.0.12+20160511*, where *20160511* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *prediction* crate version *1.0.13+20160511*, where *20160511* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *prediction* *v1d6* API can be found at the [official documentation site](https://developers.google.com/prediction/docs/developer-guide). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.Prediction.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.Prediction.html) ... * hostedmodels - * [*predict*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.HostedmodelPredictCall.html) + * [*predict*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.HostedmodelPredictCall.html) * trainedmodels - * [*analyze*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.TrainedmodelAnalyzeCall.html), [*delete*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.TrainedmodelDeleteCall.html), [*get*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.TrainedmodelGetCall.html), [*insert*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.TrainedmodelInsertCall.html), [*list*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.TrainedmodelListCall.html), [*predict*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.TrainedmodelPredictCall.html) and [*update*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.TrainedmodelUpdateCall.html) + * [*analyze*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.TrainedmodelAnalyzeCall.html), [*delete*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.TrainedmodelDeleteCall.html), [*get*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.TrainedmodelGetCall.html), [*insert*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.TrainedmodelInsertCall.html), [*list*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.TrainedmodelListCall.html), [*predict*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.TrainedmodelPredictCall.html) and [*update*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.TrainedmodelUpdateCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/struct.Prediction.html)** +* **[Hub](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/struct.Prediction.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.Part.html)** + * **[Parts](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.RequestValue.html) and -[decodable](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.RequestValue.html) and +[decodable](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-prediction1d6/1.0.12+20160511/google_prediction1d6/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-prediction1d6/1.0.13+20160511/google_prediction1d6/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/prediction1d6/src/lib.rs b/gen/prediction1d6/src/lib.rs index 359e5b8519..fba0de55c7 100644 --- a/gen/prediction1d6/src/lib.rs +++ b/gen/prediction1d6/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *prediction* crate version *1.0.12+20160511*, where *20160511* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *prediction* crate version *1.0.13+20160511*, where *20160511* is the exact revision of the *prediction:v1.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *prediction* *v1d6* API can be found at the //! [official documentation site](https://developers.google.com/prediction/docs/developer-guide). @@ -349,7 +349,7 @@ impl<'a, C, A> Prediction Prediction { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/prediction/v1.6/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -363,7 +363,7 @@ impl<'a, C, A> Prediction } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/proximitybeacon1_beta1-cli/Cargo.toml b/gen/proximitybeacon1_beta1-cli/Cargo.toml index 88bcac4194..760c17dafb 100644 --- a/gen/proximitybeacon1_beta1-cli/Cargo.toml +++ b/gen/proximitybeacon1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-proximitybeacon1_beta1-cli" -version = "1.0.12+20190323" +version = "1.0.13+20200127" authors = ["Sebastian Thiel "] description = "A complete library to interact with proximitybeacon (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/proximitybeacon1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-proximitybeacon1_beta1] path = "../proximitybeacon1_beta1" -version = "1.0.12+20190323" +version = "1.0.13+20200127" diff --git a/gen/proximitybeacon1_beta1-cli/README.md b/gen/proximitybeacon1_beta1-cli/README.md index 16fc3a22d9..116e687055 100644 --- a/gen/proximitybeacon1_beta1-cli/README.md +++ b/gen/proximitybeacon1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *proximitybeacon* API at revision *20190323*. The CLI is at version *1.0.12*. +This documentation was generated from the *proximitybeacon* API at revision *20200127*. The CLI is at version *1.0.13*. ```bash proximitybeacon1-beta1 [options] diff --git a/gen/proximitybeacon1_beta1-cli/mkdocs.yml b/gen/proximitybeacon1_beta1-cli/mkdocs.yml index 22cc989a24..46de364d42 100644 --- a/gen/proximitybeacon1_beta1-cli/mkdocs.yml +++ b/gen/proximitybeacon1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: proximitybeacon v1.0.12+20190323 +site_name: proximitybeacon v1.0.13+20200127 site_url: http://byron.github.io/google-apis-rs/google-proximitybeacon1_beta1-cli site_description: A complete library to interact with proximitybeacon (protocol v1beta1) diff --git a/gen/proximitybeacon1_beta1-cli/src/main.rs b/gen/proximitybeacon1_beta1-cli/src/main.rs index d4247eea24..4624972e7c 100644 --- a/gen/proximitybeacon1_beta1-cli/src/main.rs +++ b/gen/proximitybeacon1_beta1-cli/src/main.rs @@ -1392,7 +1392,8 @@ fn main() { ("getforobserved", Some(r##"Given one or more beacon observations, returns any beacon information and attachments accessible to your application. Authorize by using the - [API key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) + [API + key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) for the application."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beaconinfo_getforobserved", vec![ @@ -1423,9 +1424,10 @@ fn main() { Calling this method on an already active beacon will do nothing (but will return a successful response code). - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_activate", vec![ (Some(r##"beacon-name"##), @@ -1461,9 +1463,10 @@ fn main() { attachments on the given beacon will be deleted. You also may explicitly specify `*/*` to delete all. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-batch-delete", vec![ (Some(r##"beacon-name"##), @@ -1504,9 +1507,10 @@ fn main() { Attachment data can be up to 1024 bytes long. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-create", vec![ (Some(r##"beacon-name"##), @@ -1546,9 +1550,10 @@ fn main() { request to control which attachment is removed. This operation cannot be undone. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-delete", vec![ (Some(r##"attachment-name"##), @@ -1583,9 +1588,10 @@ fn main() { `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **viewer**, **Is owner** or **Can edit** - permissions in the Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-list", vec![ (Some(r##"beacon-name"##), @@ -1618,9 +1624,10 @@ fn main() { `beaconinfo.getforobserved`. Calling this method on an already inactive beacon will do nothing (but will return a successful response code). - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_deactivate", vec![ (Some(r##"beacon-name"##), @@ -1653,9 +1660,10 @@ fn main() { permanent -- you will not be able to re-register a beacon with this ID again. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_decommission", vec![ (Some(r##"beacon-name"##), @@ -1687,9 +1695,10 @@ fn main() { as well as any attachments on the beacon (including those belonging to other projects). This operation cannot be undone. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_delete", vec![ (Some(r##"beacon-name"##), @@ -1721,9 +1730,10 @@ fn main() { all the beacons owned by your Google Developers Console project by using the beacon name `beacons/-`. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **viewer**, **Is owner** or **Can edit** - permissions in the Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_diagnostics-list", vec![ (Some(r##"beacon-name"##), @@ -1747,9 +1757,10 @@ fn main() { ("get", Some(r##"Returns detailed information about the specified beacon. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **viewer**, **Is owner** or **Can edit** - permissions in the Google Developers Console project. + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + the Google Developers Console project. Requests may supply an Eddystone-EID beacon name in the form: `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID @@ -1787,9 +1798,10 @@ fn main() { criteria. Only those beacons that the client has permission to list will be returned. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **viewer**, **Is owner** or **Can edit** - permissions in the Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_list", vec![ (Some(r##"v"##), @@ -1808,9 +1820,10 @@ fn main() { Some(r##"Registers a previously unregistered beacon given its `advertisedId`. These IDs are unique within the system. An ID can be registered only once. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_register", vec![ (Some(r##"kv"##), @@ -1840,9 +1853,10 @@ fn main() { Changes to the beacon status via this method will be silently ignored. To update beacon status, use the separate methods on this API for activation, deactivation, and decommissioning. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **Is owner** or **Can edit** permissions in the - Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **Is owner** or **Can edit** permissions in the Google + Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_update", vec![ (Some(r##"beacon-name"##), @@ -1908,9 +1922,10 @@ fn main() { project. Attachment data associated with a beacon must include a namespaced type, and the namespace must be owned by your project. - Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - from a signed-in user with **viewer**, **Is owner** or **Can edit** - permissions in the Google Developers Console project."##), + Authenticate using an [OAuth access + token](https://developers.google.com/identity/protocols/OAuth2) from a + signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/namespaces_list", vec![ (Some(r##"v"##), @@ -1961,7 +1976,7 @@ fn main() { let mut app = App::new("proximitybeacon1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190323") + .version("1.0.13+20200127") .about("Registers, manages, indexes, and searches beacons.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/proximitybeacon1_beta1/Cargo.toml b/gen/proximitybeacon1_beta1/Cargo.toml index b990f6971a..bf8f0ebf83 100644 --- a/gen/proximitybeacon1_beta1/Cargo.toml +++ b/gen/proximitybeacon1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-proximitybeacon1_beta1" -version = "1.0.12+20190323" +version = "1.0.13+20200127" authors = ["Sebastian Thiel "] description = "A complete library to interact with proximitybeacon (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/proximitybeacon1_beta1" homepage = "https://developers.google.com/beacons/proximity/" -documentation = "https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323" +documentation = "https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127" license = "MIT" keywords = ["proximitybeacon", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/proximitybeacon1_beta1/README.md b/gen/proximitybeacon1_beta1/README.md index adb9ea39f4..1f7af1ffe3 100644 --- a/gen/proximitybeacon1_beta1/README.md +++ b/gen/proximitybeacon1_beta1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-proximitybeacon1_beta1` library allows access to all features of the *Google proximitybeacon* service. -This documentation was generated from *proximitybeacon* crate version *1.0.12+20190323*, where *20190323* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *proximitybeacon* crate version *1.0.13+20200127*, where *20200127* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *proximitybeacon* *v1_beta1* API can be found at the [official documentation site](https://developers.google.com/beacons/proximity/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.Proximitybeacon.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.Proximitybeacon.html) ... * beaconinfo - * [*getforobserved*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconinfoGetforobservedCall.html) -* [beacons](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.Beacon.html) - * [*activate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconActivateCall.html), [*attachments batch delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconAttachmentCreateCall.html), [*attachments delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconAttachmentDeleteCall.html), [*attachments list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconAttachmentListCall.html), [*deactivate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconDeactivateCall.html), [*decommission*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconDecommissionCall.html), [*delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconDeleteCall.html), [*diagnostics list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconDiagnosticListCall.html), [*get*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconGetCall.html), [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconListCall.html), [*register*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconRegisterCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.BeaconUpdateCall.html) -* [namespaces](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.Namespace.html) - * [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.NamespaceListCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.NamespaceUpdateCall.html) + * [*getforobserved*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconinfoGetforobservedCall.html) +* [beacons](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.Beacon.html) + * [*activate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconActivateCall.html), [*attachments batch delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconAttachmentCreateCall.html), [*attachments delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconAttachmentDeleteCall.html), [*attachments list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconAttachmentListCall.html), [*deactivate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconDeactivateCall.html), [*decommission*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconDecommissionCall.html), [*delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconDeleteCall.html), [*diagnostics list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconDiagnosticListCall.html), [*get*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconGetCall.html), [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconListCall.html), [*register*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconRegisterCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.BeaconUpdateCall.html) +* [namespaces](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.Namespace.html) + * [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.NamespaceListCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.NamespaceUpdateCall.html) Other activities are ... -* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.MethodGetEidparamCall.html) +* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.MethodGetEidparamCall.html) @@ -30,17 +30,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/struct.Proximitybeacon.html)** +* **[Hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/struct.Proximitybeacon.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -147,17 +147,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -167,29 +167,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-proximitybeacon1_beta1/1.0.12+20190323/google_proximitybeacon1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-proximitybeacon1_beta1/1.0.13+20200127/google_proximitybeacon1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/proximitybeacon1_beta1/src/lib.rs b/gen/proximitybeacon1_beta1/src/lib.rs index 54645c60b9..c9d869325b 100644 --- a/gen/proximitybeacon1_beta1/src/lib.rs +++ b/gen/proximitybeacon1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *proximitybeacon* crate version *1.0.12+20190323*, where *20190323* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *proximitybeacon* crate version *1.0.13+20200127*, where *20200127* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *proximitybeacon* *v1_beta1* API can be found at the //! [official documentation site](https://developers.google.com/beacons/proximity/). @@ -344,7 +344,7 @@ impl<'a, C, A> Proximitybeacon Proximitybeacon { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://proximitybeacon.googleapis.com/".to_string(), _root_url: "https://proximitybeacon.googleapis.com/".to_string(), } @@ -364,7 +364,7 @@ impl<'a, C, A> Proximitybeacon } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -776,7 +776,9 @@ impl ResponseResult for Empty {} /// Information a client needs to provision and register beacons that /// broadcast Eddystone-EID format beacon IDs, using Elliptic curve /// Diffie-Hellman key exchange. See -/// [the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub. +/// [the Eddystone +/// specification](https://github.com/google/eddystone/tree/master/eddystone-eid) +/// at GitHub. /// /// # Activities /// @@ -788,11 +790,13 @@ impl ResponseResult for Empty {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct EphemeralIdRegistrationParams { /// Indicates the minimum rotation period supported by the service. - /// See EddystoneEidRegistration.rotation_period_exponent + /// See + /// EddystoneEidRegistration.rotation_period_exponent #[serde(rename="minRotationPeriodExponent")] pub min_rotation_period_exponent: Option, /// Indicates the maximum rotation period supported by the service. - /// See EddystoneEidRegistration.rotation_period_exponent + /// See + /// EddystoneEidRegistration.rotation_period_exponent #[serde(rename="maxRotationPeriodExponent")] pub max_rotation_period_exponent: Option, /// The beacon service's public key for use by a beacon to derive its @@ -1103,9 +1107,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// `*/*`, to return all attachments, or the namespace must be one of /// the ones returned from the `namespaces` endpoint. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **viewer**, **Is owner** or **Can edit** - /// permissions in the Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + /// the Google Developers Console project. /// /// # Arguments /// @@ -1132,9 +1137,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// /// Returns detailed information about the specified beacon. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **viewer**, **Is owner** or **Can edit** - /// permissions in the Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + /// the Google Developers Console project. /// /// Requests may supply an Eddystone-EID beacon name in the form: /// `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID @@ -1177,9 +1183,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// /// Attachment data can be up to 1024 bytes long. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1210,9 +1217,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// permanent -- you will not be able to re-register a beacon with this ID /// again. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1241,9 +1249,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Calling this method on an already active beacon will do nothing (but /// will return a successful response code). /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1271,9 +1280,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// criteria. Only those beacons that the client has permission to list /// will be returned. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **viewer**, **Is owner** or **Can edit** - /// permissions in the Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + /// the Google Developers Console project. pub fn list(&self) -> BeaconListCall<'a, C, A> { BeaconListCall { hub: self.hub, @@ -1297,9 +1307,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Changes to the beacon status via this method will be silently ignored. /// To update beacon status, use the separate methods on this API for /// activation, deactivation, and decommissioning. - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1330,9 +1341,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// request to control which attachment is removed. This operation cannot be /// undone. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1360,9 +1372,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// `beaconinfo.getforobserved`. Calling this method on an already inactive /// beacon will do nothing (but will return a successful response code). /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1389,9 +1402,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Registers a previously unregistered beacon given its `advertisedId`. /// These IDs are unique within the system. An ID can be registered only once. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1413,9 +1427,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// as well as any attachments on the beacon (including those belonging to /// other projects). This operation cannot be undone. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1443,9 +1458,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// all the beacons owned by your Google Developers Console project by using /// the beacon name `beacons/-`. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **viewer**, **Is owner** or **Can edit** - /// permissions in the Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + /// the Google Developers Console project. /// /// # Arguments /// @@ -1474,9 +1490,10 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// attachments on the given beacon will be deleted. You also may explicitly /// specify `*/*` to delete all. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **Is owner** or **Can edit** permissions in the - /// Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **Is owner** or **Can edit** permissions in the Google + /// Developers Console project. /// /// # Arguments /// @@ -1545,7 +1562,8 @@ impl<'a, C, A> BeaconinfoMethods<'a, C, A> { /// /// Given one or more beacon observations, returns any beacon information /// and attachments accessible to your application. Authorize by using the - /// [API key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) + /// [API + /// key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) /// for the application. /// /// # Arguments @@ -1668,9 +1686,10 @@ impl<'a, C, A> NamespaceMethods<'a, C, A> { /// project. Attachment data associated with a beacon must include a /// namespaced type, and the namespace must be owned by your project. /// - /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) - /// from a signed-in user with **viewer**, **Is owner** or **Can edit** - /// permissions in the Google Developers Console project. + /// Authenticate using an [OAuth access + /// token](https://developers.google.com/identity/protocols/OAuth2) from a + /// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in + /// the Google Developers Console project. pub fn list(&self) -> NamespaceListCall<'a, C, A> { NamespaceListCall { hub: self.hub, @@ -1720,9 +1739,10 @@ impl<'a, C, A> NamespaceMethods<'a, C, A> { /// `*/*`, to return all attachments, or the namespace must be one of /// the ones returned from the `namespaces` endpoint. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **viewer**, **Is owner** or **Can edit** -/// permissions in the Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in +/// the Google Developers Console project. /// /// A builder for the *attachments.list* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -2009,9 +2029,10 @@ impl<'a, C, A> BeaconAttachmentListCall<'a, C, A> where C: BorrowMut BeaconGetCall<'a, C, A> where C: BorrowMut, A: oau /// /// Attachment data can be up to 1024 bytes long. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **Is owner** or **Can edit** permissions in the -/// Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **Is owner** or **Can edit** permissions in the Google +/// Developers Console project. /// /// A builder for the *attachments.create* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -2606,9 +2628,10 @@ impl<'a, C, A> BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut BeaconDecommissionCall<'a, C, A> where C: BorrowMut BeaconActivateCall<'a, C, A> where C: BorrowMut, A /// criteria. Only those beacons that the client has permission to list /// will be returned. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **viewer**, **Is owner** or **Can edit** -/// permissions in the Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in +/// the Google Developers Console project. /// /// A builder for the *list* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -3393,7 +3418,8 @@ impl<'a, C, A> BeaconListCall<'a, C, A> where C: BorrowMut, A: oa /// be URL-encoded. /// /// Example REST request: - /// `GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` + /// `GET + /// /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` /// /// Sets the *q* query property to the given value. pub fn q(mut self, new_value: &str) -> BeaconListCall<'a, C, A> { @@ -3495,9 +3521,10 @@ impl<'a, C, A> BeaconListCall<'a, C, A> where C: BorrowMut, A: oa /// Changes to the beacon status via this method will be silently ignored. /// To update beacon status, use the separate methods on this API for /// activation, deactivation, and decommissioning. -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **Is owner** or **Can edit** permissions in the -/// Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **Is owner** or **Can edit** permissions in the Google +/// Developers Console project. /// /// A builder for the *update* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -3803,9 +3830,10 @@ impl<'a, C, A> BeaconUpdateCall<'a, C, A> where C: BorrowMut, A: /// request to control which attachment is removed. This operation cannot be /// undone. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **Is owner** or **Can edit** permissions in the -/// Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **Is owner** or **Can edit** permissions in the Google +/// Developers Console project. /// /// A builder for the *attachments.delete* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -4077,9 +4105,10 @@ impl<'a, C, A> BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut BeaconDeactivateCall<'a, C, A> where C: BorrowMut, /// Registers a previously unregistered beacon given its `advertisedId`. /// These IDs are unique within the system. An ID can be registered only once. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **Is owner** or **Can edit** permissions in the -/// Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **Is owner** or **Can edit** permissions in the Google +/// Developers Console project. /// /// A builder for the *register* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -4614,9 +4644,10 @@ impl<'a, C, A> BeaconRegisterCall<'a, C, A> where C: BorrowMut, A /// as well as any attachments on the beacon (including those belonging to /// other projects). This operation cannot be undone. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **Is owner** or **Can edit** permissions in the -/// Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **Is owner** or **Can edit** permissions in the Google +/// Developers Console project. /// /// A builder for the *delete* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -4888,9 +4919,10 @@ impl<'a, C, A> BeaconDeleteCall<'a, C, A> where C: BorrowMut, A: /// all the beacons owned by your Google Developers Console project by using /// the beacon name `beacons/-`. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **viewer**, **Is owner** or **Can edit** -/// permissions in the Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in +/// the Google Developers Console project. /// /// A builder for the *diagnostics.list* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -5199,9 +5231,10 @@ impl<'a, C, A> BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut MethodGetEidparamCall<'a, C, A> where C: BorrowMut /// project. Attachment data associated with a beacon must include a /// namespaced type, and the namespace must be owned by your project. /// -/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) -/// from a signed-in user with **viewer**, **Is owner** or **Can edit** -/// permissions in the Google Developers Console project. +/// Authenticate using an [OAuth access +/// token](https://developers.google.com/identity/protocols/OAuth2) from a +/// signed-in user with **viewer**, **Is owner** or **Can edit** permissions in +/// the Google Developers Console project. /// /// A builder for the *list* method supported by a *namespace* resource. /// It is not used directly, but through a `NamespaceMethods` instance. diff --git a/gen/pubsub1-cli/Cargo.toml b/gen/pubsub1-cli/Cargo.toml index 751f031ab9..001901edc4 100644 --- a/gen/pubsub1-cli/Cargo.toml +++ b/gen/pubsub1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-pubsub1-cli" -version = "1.0.12+20190625" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Pubsub (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-pubsub1] path = "../pubsub1" -version = "1.0.12+20190625" +version = "1.0.13+20200403" diff --git a/gen/pubsub1-cli/README.md b/gen/pubsub1-cli/README.md index a334b9236c..9014d7d8a8 100644 --- a/gen/pubsub1-cli/README.md +++ b/gen/pubsub1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Pubsub* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *Pubsub* API at revision *20200403*. The CLI is at version *1.0.13*. ```bash pubsub1 [options] diff --git a/gen/pubsub1-cli/mkdocs.yml b/gen/pubsub1-cli/mkdocs.yml index 3016153cee..80ef1c7eab 100644 --- a/gen/pubsub1-cli/mkdocs.yml +++ b/gen/pubsub1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Pubsub v1.0.12+20190625 +site_name: Pubsub v1.0.13+20200403 site_url: http://byron.github.io/google-apis-rs/google-pubsub1-cli site_description: A complete library to interact with Pubsub (protocol v1) diff --git a/gen/pubsub1-cli/src/main.rs b/gen/pubsub1-cli/src/main.rs index 586085d3a5..5e6a417949 100644 --- a/gen/pubsub1-cli/src/main.rs +++ b/gen/pubsub1-cli/src/main.rs @@ -242,6 +242,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -255,6 +258,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -725,9 +729,11 @@ impl<'n> Engine<'n> { "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "message-retention-duration" => Some(("messageRetentionDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "retain-acked-messages" => Some(("retainAckedMessages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "dead-letter-policy.dead-letter-topic" => Some(("deadLetterPolicy.deadLetterTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "dead-letter-policy.max-delivery-attempts" => Some(("deadLetterPolicy.maxDeliveryAttempts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "expiration-policy.ttl" => Some(("expirationPolicy.ttl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "attributes", "audience", "expiration-policy", "labels", "message-retention-duration", "name", "oidc-token", "push-config", "push-endpoint", "retain-acked-messages", "service-account-email", "topic", "ttl"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "attributes", "audience", "dead-letter-policy", "dead-letter-topic", "expiration-policy", "labels", "max-delivery-attempts", "message-retention-duration", "name", "oidc-token", "push-config", "push-endpoint", "retain-acked-messages", "service-account-email", "topic", "ttl"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -897,6 +903,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -910,6 +919,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -1210,9 +1220,11 @@ impl<'n> Engine<'n> { "subscription.topic" => Some(("subscription.topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription.message-retention-duration" => Some(("subscription.messageRetentionDuration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "subscription.retain-acked-messages" => Some(("subscription.retainAckedMessages", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "subscription.dead-letter-policy.dead-letter-topic" => Some(("subscription.deadLetterPolicy.deadLetterTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "subscription.dead-letter-policy.max-delivery-attempts" => Some(("subscription.deadLetterPolicy.maxDeliveryAttempts", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "subscription.expiration-policy.ttl" => Some(("subscription.expirationPolicy.ttl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "attributes", "audience", "expiration-policy", "labels", "message-retention-duration", "name", "oidc-token", "push-config", "push-endpoint", "retain-acked-messages", "service-account-email", "subscription", "topic", "ttl", "update-mask"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["ack-deadline-seconds", "attributes", "audience", "dead-letter-policy", "dead-letter-topic", "expiration-policy", "labels", "max-delivery-attempts", "message-retention-duration", "name", "oidc-token", "push-config", "push-endpoint", "retain-acked-messages", "service-account-email", "subscription", "topic", "ttl", "update-mask"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1813,6 +1825,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1826,6 +1841,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -2598,13 +2614,12 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Optional user-provided name for this snapshot. - If the name is not provided in the request, the server will assign a random - name for this snapshot on the same project as the subscription. - Note that for REST API requests, you must specify a name. See the - - resource name rules. - Format is `projects/{project}/snapshots/{snap}`."##), + Some(r##"Required. User-provided name for this snapshot. If the name is not provided in the + request, the server will assign a random name for this snapshot on the same + project as the subscription. Note that for REST API requests, you must + specify a name. See the resource + name rules. Format is `projects/{project}/snapshots/{snap}`."##), Some(true), Some(false)), @@ -2641,7 +2656,7 @@ fn main() { vec![ (Some(r##"snapshot"##), None, - Some(r##"The name of the snapshot to delete. + Some(r##"Required. The name of the snapshot to delete. Format is `projects/{project}/snapshots/{snap}`."##), Some(true), Some(false)), @@ -2668,7 +2683,7 @@ fn main() { vec![ (Some(r##"snapshot"##), None, - Some(r##"The name of the snapshot to get. + Some(r##"Required. The name of the snapshot to get. Format is `projects/{project}/snapshots/{snap}`."##), Some(true), Some(false)), @@ -2721,7 +2736,7 @@ fn main() { vec![ (Some(r##"project"##), None, - Some(r##"The name of the project in which to list snapshots. + Some(r##"Required. The name of the project in which to list snapshots. Format is `projects/{project-id}`."##), Some(true), Some(false)), @@ -2773,7 +2788,9 @@ fn main() { ]), ("snapshots-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_snapshots-set-iam-policy", vec![ (Some(r##"resource"##), @@ -2848,7 +2865,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - Some(r##"The subscription whose message is being acknowledged. + Some(r##"Required. The subscription whose message is being acknowledged. Format is `projects/{project}/subscriptions/{sub}`."##), Some(true), Some(false)), @@ -2889,7 +2906,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the subscription. It must have the format + Some(r##"Required. The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), @@ -2926,7 +2943,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - Some(r##"The subscription to delete. + Some(r##"Required. The subscription to delete. Format is `projects/{project}/subscriptions/{sub}`."##), Some(true), Some(false)), @@ -2949,7 +2966,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - Some(r##"The name of the subscription to get. + Some(r##"Required. The name of the subscription to get. Format is `projects/{project}/subscriptions/{sub}`."##), Some(true), Some(false)), @@ -2997,7 +3014,7 @@ fn main() { vec![ (Some(r##"project"##), None, - Some(r##"The name of the project in which to list subscriptions. + Some(r##"Required. The name of the project in which to list subscriptions. Format is `projects/{project-id}`."##), Some(true), Some(false)), @@ -3024,7 +3041,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - Some(r##"The name of the subscription. + Some(r##"Required. The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`."##), Some(true), Some(false)), @@ -3058,7 +3075,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - Some(r##"The name of the subscription. + Some(r##"Required. The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`."##), Some(true), Some(false)), @@ -3088,7 +3105,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the subscription. It must have the format + Some(r##"Required. The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), @@ -3123,7 +3140,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - Some(r##"The subscription from which messages should be pulled. + Some(r##"Required. The subscription from which messages should be pulled. Format is `projects/{project}/subscriptions/{sub}`."##), Some(true), Some(false)), @@ -3159,7 +3176,7 @@ fn main() { vec![ (Some(r##"subscription"##), None, - Some(r##"The subscription to affect."##), + Some(r##"Required. The subscription to affect."##), Some(true), Some(false)), @@ -3183,7 +3200,9 @@ fn main() { ]), ("subscriptions-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_subscriptions-set-iam-policy", vec![ (Some(r##"resource"##), @@ -3254,7 +3273,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the topic. It must have the format + Some(r##"Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -3291,7 +3310,7 @@ fn main() { vec![ (Some(r##"topic"##), None, - Some(r##"Name of the topic to delete. + Some(r##"Required. Name of the topic to delete. Format is `projects/{project}/topics/{topic}`."##), Some(true), Some(false)), @@ -3314,7 +3333,7 @@ fn main() { vec![ (Some(r##"topic"##), None, - Some(r##"The name of the topic to get. + Some(r##"Required. The name of the topic to get. Format is `projects/{project}/topics/{topic}`."##), Some(true), Some(false)), @@ -3362,7 +3381,7 @@ fn main() { vec![ (Some(r##"project"##), None, - Some(r##"The name of the project in which to list topics. + Some(r##"Required. The name of the project in which to list topics. Format is `projects/{project-id}`."##), Some(true), Some(false)), @@ -3386,7 +3405,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the topic. It must have the format + Some(r##"Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -3420,7 +3439,7 @@ fn main() { vec![ (Some(r##"topic"##), None, - Some(r##"The messages in the request will be published on this topic. + Some(r##"Required. The messages in the request will be published on this topic. Format is `projects/{project}/topics/{topic}`."##), Some(true), Some(false)), @@ -3445,7 +3464,9 @@ fn main() { ]), ("topics-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_topics-set-iam-policy", vec![ (Some(r##"resource"##), @@ -3484,7 +3505,7 @@ fn main() { vec![ (Some(r##"topic"##), None, - Some(r##"The name of the topic that snapshots are attached to. + Some(r##"Required. The name of the topic that snapshots are attached to. Format is `projects/{project}/topics/{topic}`."##), Some(true), Some(false)), @@ -3507,7 +3528,7 @@ fn main() { vec![ (Some(r##"topic"##), None, - Some(r##"The name of the topic that subscriptions are attached to. + Some(r##"Required. The name of the topic that subscriptions are attached to. Format is `projects/{project}/topics/{topic}`."##), Some(true), Some(false)), @@ -3565,7 +3586,7 @@ fn main() { let mut app = App::new("pubsub1") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200403") .about("Provides reliable, many-to-many, asynchronous messaging between applications. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pubsub1_cli") diff --git a/gen/pubsub1/Cargo.toml b/gen/pubsub1/Cargo.toml index 1bb78aa996..6d8a40a84b 100644 --- a/gen/pubsub1/Cargo.toml +++ b/gen/pubsub1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pubsub1" -version = "1.0.12+20190625" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Pubsub (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1" homepage = "https://cloud.google.com/pubsub/docs" -documentation = "https://docs.rs/google-pubsub1/1.0.12+20190625" +documentation = "https://docs.rs/google-pubsub1/1.0.13+20200403" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/pubsub1/README.md b/gen/pubsub1/README.md index 4e86154f41..a6069218b3 100644 --- a/gen/pubsub1/README.md +++ b/gen/pubsub1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-pubsub1` library allows access to all features of the *Google Pubsub* service. -This documentation was generated from *Pubsub* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Pubsub* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Pubsub* *v1* API can be found at the [official documentation site](https://cloud.google.com/pubsub/docs). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.Pubsub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.Pubsub.html) ... * projects - * [*snapshots create*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotCreateCall.html), [*snapshots delete*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotDeleteCall.html), [*snapshots get*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotGetCall.html), [*snapshots get iam policy*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots list*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotListCall.html), [*snapshots patch*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotPatchCall.html), [*snapshots set iam policy*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions patch*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionPatchCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionPullCall.html), [*subscriptions seek*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionSeekCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicListCall.html), [*topics patch*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicPatchCall.html), [*topics publish*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicSetIamPolicyCall.html), [*topics snapshots list*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicSnapshotListCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.ProjectTopicTestIamPermissionCall.html) + * [*snapshots create*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotCreateCall.html), [*snapshots delete*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotDeleteCall.html), [*snapshots get*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotGetCall.html), [*snapshots get iam policy*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots list*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotListCall.html), [*snapshots patch*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotPatchCall.html), [*snapshots set iam policy*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions patch*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionPatchCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionPullCall.html), [*subscriptions seek*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionSeekCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicListCall.html), [*topics patch*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicPatchCall.html), [*topics publish*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicSetIamPolicyCall.html), [*topics snapshots list*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicSnapshotListCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.ProjectTopicTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/struct.Pubsub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -86,7 +86,6 @@ extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_pubsub1 as pubsub1; -use pubsub1::SetIamPolicyRequest; use pubsub1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -104,15 +103,11 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), ::default(), None); let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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().snapshots_set_iam_policy(req, "resource") +let result = hub.projects().snapshots_get_iam_policy("resource") + .options_requested_policy_version(-48) .doit(); match result { @@ -135,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-pubsub1/1.0.12+20190625/google_pubsub1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1/1.0.13+20200403/google_pubsub1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/pubsub1/src/lib.rs b/gen/pubsub1/src/lib.rs index e7fbf711f3..7d99f643f5 100644 --- a/gen/pubsub1/src/lib.rs +++ b/gen/pubsub1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Pubsub* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Pubsub* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Pubsub* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/pubsub/docs). @@ -86,7 +86,6 @@ //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; //! extern crate google_pubsub1 as pubsub1; -//! use pubsub1::SetIamPolicyRequest; //! use pubsub1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -105,15 +104,11 @@ //! hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), //! ::default(), None); //! let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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().snapshots_set_iam_policy(req, "resource") +//! let result = hub.projects().snapshots_get_iam_policy("resource") +//! .options_requested_policy_version(-42) //! .doit(); //! //! match result { @@ -273,7 +268,6 @@ impl Default for Scope { /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; /// extern crate google_pubsub1 as pubsub1; -/// use pubsub1::SetIamPolicyRequest; /// use pubsub1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -292,15 +286,11 @@ impl Default for Scope { /// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// ::default(), None); /// let mut hub = Pubsub::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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().snapshots_set_iam_policy(req, "resource") +/// let result = hub.projects().snapshots_get_iam_policy("resource") +/// .options_requested_policy_version(-18) /// .doit(); /// /// match result { @@ -338,7 +328,7 @@ impl<'a, C, A> Pubsub Pubsub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://pubsub.googleapis.com/".to_string(), _root_url: "https://pubsub.googleapis.com/".to_string(), } @@ -349,7 +339,7 @@ impl<'a, C, A> Pubsub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -388,14 +378,18 @@ impl<'a, C, A> Pubsub /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PullRequest { - /// If this field set to true, the system will respond immediately even if + /// Optional. If this field set to true, the system will respond immediately even if /// it there are no messages available to return in the `Pull` response. /// Otherwise, the system may wait (for a bounded amount of time) until at - /// least one message is available, rather than returning no messages. + /// least one message is available, rather than returning no messages. Warning: + /// setting this field to `true` is discouraged because it adversely impacts + /// the performance of `Pull` operations. We recommend that users do not set + /// this field. #[serde(rename="returnImmediately")] pub return_immediately: Option, - /// The maximum number of messages returned for this request. The Pub/Sub - /// system may return fewer than the number specified. + /// Required. The maximum number of messages to return for this request. Must be a + /// positive integer. The Pub/Sub system may return fewer than the number + /// specified. #[serde(rename="maxMessages")] pub max_messages: Option, } @@ -460,6 +454,24 @@ pub struct ReceivedMessage { pub ack_id: Option, /// The message. pub message: Option, + /// Delivery attempt counter is 1 + (the sum of number of NACKs and number of + /// ack_deadline exceeds) for this message. + /// + /// A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + /// exceeds event is whenever a message is not acknowledged within + /// ack_deadline. Note that ack_deadline is initially + /// Subscription.ackDeadlineSeconds, but may get extended automatically by + /// the client library. + /// + /// The first delivery of a given message will have this value as 1. The value + /// is calculated at best effort and is approximate. + /// + /// If a DeadLetterPolicy is not set on the subscription, this will be 0. + /// EXPERIMENTAL: This feature is part of a closed alpha release. This + /// API might be changed in backward-incompatible ways and is not recommended + /// for production use. It is not subject to any SLA or deprecation policy. + #[serde(rename="deliveryAttempt")] + pub delivery_attempt: Option, } impl Part for ReceivedMessage {} @@ -476,7 +488,7 @@ impl Part for ReceivedMessage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AcknowledgeRequest { - /// The acknowledgment ID for the messages being acknowledged that was returned + /// Required. The acknowledgment ID for the messages being acknowledged that was returned /// by the Pub/Sub system in the `Pull` response. Must not be empty. #[serde(rename="ackIds")] pub ack_ids: Option>, @@ -496,7 +508,7 @@ impl RequestValue for AcknowledgeRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyAckDeadlineRequest { - /// The new ack deadline with respect to the time this request was sent to + /// Required. The new ack deadline with respect to the time this request was sent to /// the Pub/Sub system. For example, if the value is 10, the new /// ack deadline will expire 10 seconds after the `ModifyAckDeadline` call /// was made. Specifying zero might immediately make the message available for @@ -506,7 +518,7 @@ pub struct ModifyAckDeadlineRequest { /// The maximum deadline you can specify is 600 seconds (10 minutes). #[serde(rename="ackDeadlineSeconds")] pub ack_deadline_seconds: Option, - /// List of acknowledgment IDs. + /// Required. List of acknowledgment IDs. #[serde(rename="ackIds")] pub ack_ids: Option>, } @@ -557,7 +569,7 @@ impl RequestValue for SeekRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PublishRequest { - /// The messages to publish. + /// Required. The messages to publish. pub messages: Option>, } @@ -586,37 +598,50 @@ pub struct ListSnapshotsResponse { impl ResponseResult for ListSnapshotsResponse {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -624,15 +649,21 @@ impl ResponseResult for ListSnapshotsResponse {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -647,8 +678,9 @@ impl ResponseResult for ListSnapshotsResponse {} /// * [subscriptions set iam policy projects](struct.ProjectSubscriptionSetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -658,10 +690,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -724,7 +778,7 @@ impl ResponseResult for ListTopicsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyPushConfigRequest { - /// The push configuration for future deliveries. + /// Required. The push configuration for future deliveries. /// /// An empty `pushConfig` indicates that the Pub/Sub system should /// stop pushing messages from the given subscription and allow @@ -777,13 +831,13 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateTopicRequest { - /// The updated topic object. + /// Required. The updated topic object. pub topic: Option, - /// Indicates which fields in the provided topic to update. Must be specified + /// Required. Indicates which fields in the provided topic to update. Must be specified /// and non-empty. Note that if `update_mask` contains - /// "message_storage_policy" then the new value will be determined based on the - /// policy configured at the project or organization level. The - /// `message_storage_policy` must not be set in the `topic` provided above. + /// "message_storage_policy" but the `message_storage_policy` is not set in + /// the `topic` provided above, then the updated value is determined by the + /// policy configured at the project or organization level. #[serde(rename="updateMask")] pub update_mask: Option, } @@ -839,6 +893,70 @@ pub struct OidcToken { impl Part for OidcToken {} +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + pub role: Option, + /// The condition that is associated with this binding. + /// NOTE: An unsatisfied condition will not allow user access via current + /// binding. Different bindings, including their conditions, are examined + /// independently. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@example.com` . + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// + /// + /// * `domain:{domain}`: The G Suite domain (primary) that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + /// Response for the `Pull` method. /// /// # Activities @@ -884,47 +1002,6 @@ pub struct ListTopicSnapshotsResponse { impl ResponseResult for ListTopicSnapshotsResponse {} -/// Configuration for a push delivery endpoint. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PushConfig { - /// Endpoint configuration attributes. - /// - /// Every endpoint has a set of API supported attributes that can be used to - /// control different aspects of the message delivery. - /// - /// The currently supported attribute is `x-goog-version`, which you can - /// use to change the format of the pushed message. This attribute - /// indicates the version of the data expected by the endpoint. This - /// controls the shape of the pushed message (i.e., its fields and metadata). - /// The endpoint version is based on the version of the Pub/Sub API. - /// - /// If not present during the `CreateSubscription` call, it will default to - /// the version of the API used to make such call. If not present during a - /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - /// calls will always return a valid version, even if the subscription was - /// created without this attribute. - /// - /// The possible values for this attribute are: - /// - /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - pub attributes: Option>, - /// If specified, Pub/Sub will generate and attach an OIDC JWT token as an - /// `Authorization` header in the HTTP request for every pushed message. - #[serde(rename="oidcToken")] - pub oidc_token: Option, - /// A URL locating the endpoint to which messages should be pushed. - /// For example, a Webhook endpoint might use "https://example.com/push". - #[serde(rename="pushEndpoint")] - pub push_endpoint: Option, -} - -impl Part for PushConfig {} - - /// A subscription resource. /// /// # Activities @@ -938,7 +1015,7 @@ impl Part for PushConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Subscription { - /// The name of the subscription. It must have the format + /// Required. The name of the subscription. It must have the format /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must /// start with a letter, and contain only letters (`[A-Za-z]`), numbers /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), @@ -975,7 +1052,7 @@ pub struct Subscription { /// will pull and ack messages using API methods. #[serde(rename="pushConfig")] pub push_config: Option, - /// The name of the topic from which this subscription is receiving messages. + /// Required. The name of the topic from which this subscription is receiving messages. /// Format is `projects/{project}/topics/{topic}`. /// The value of this field will be `_deleted-topic_` if the topic has been /// deleted. @@ -997,6 +1074,19 @@ pub struct Subscription { /// Seek to a timestamp. #[serde(rename="retainAckedMessages")] pub retain_acked_messages: Option, + /// A policy that specifies the conditions for dead lettering messages in + /// this subscription. If dead_letter_policy is not set, dead lettering + /// is disabled. + /// + /// The Cloud Pub/Sub service account associated with this subscriptions's + /// parent project (i.e., + /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + /// permission to Acknowledge() messages on this subscription. + /// EXPERIMENTAL: This feature is part of a closed alpha release. This + /// API might be changed in backward-incompatible ways and is not recommended + /// for production use. It is not subject to any SLA or deprecation policy. + #[serde(rename="deadLetterPolicy")] + pub dead_letter_policy: Option, /// A policy that specifies the conditions for this subscription's expiration. /// A subscription is considered active as long as any connected subscriber is /// successfully consuming messages from the subscription or is issuing @@ -1049,30 +1139,59 @@ pub struct TestIamPermissionsRequest { impl RequestValue for TestIamPermissionsRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1162,6 +1281,47 @@ pub struct MessageStoragePolicy { impl Part for MessageStoragePolicy {} +/// Dead lettering is done on a best effort basis. The same message might be +/// dead lettered multiple times. +/// +/// If validation on any of the fields fails at subscription creation/updation, +/// the create/update subscription request will fail. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeadLetterPolicy { + /// The name of the topic to which dead letter messages should be published. + /// Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service + /// account associated with the enclosing subscription's parent project (i.e., + /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + /// permission to Publish() to this topic. + /// + /// The operation will fail if the topic does not exist. + /// Users should ensure that there is a subscription attached to this topic + /// since messages published to a topic with no subscriptions are lost. + #[serde(rename="deadLetterTopic")] + pub dead_letter_topic: Option, + /// The maximum number of delivery attempts for any message. The value must be + /// between 5 and 100. + /// + /// The number of delivery attempts is defined as 1 + (the sum of number of + /// NACKs and number of times the acknowledgement deadline has been exceeded + /// for the message). + /// + /// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + /// client libraries may automatically extend ack_deadlines. + /// + /// This field will be honored on a best effort basis. + /// + /// If this parameter is 0, a default value of 5 is used. + #[serde(rename="maxDeliveryAttempts")] + pub max_delivery_attempts: Option, +} + +impl Part for DeadLetterPolicy {} + + /// A policy that specifies the conditions for resource expiration (i.e., /// automatic resource deletion). /// @@ -1181,48 +1341,45 @@ pub struct ExpirationPolicy { impl Part for ExpirationPolicy {} -/// Associates `members` with a `role`. +/// Configuration for a push delivery endpoint. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Binding { - /// Role that is assigned to `members`. - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - pub role: Option, - /// The condition that is associated with this binding. - /// NOTE: An unsatisfied condition will not allow user access via current - /// binding. Different bindings, including their conditions, are examined - /// independently. - pub condition: Option, - /// Specifies the identities requesting access for a Cloud Platform resource. - /// `members` can have the following values: +pub struct PushConfig { + /// Endpoint configuration attributes that can be used to control different + /// aspects of the message delivery. /// - /// * `allUsers`: A special identifier that represents anyone who is - /// on the internet; with or without a Google account. + /// The only currently supported attribute is `x-goog-version`, which you can + /// use to change the format of the pushed message. This attribute + /// indicates the version of the data expected by the endpoint. This + /// controls the shape of the pushed message (i.e., its fields and metadata). /// - /// * `allAuthenticatedUsers`: A special identifier that represents anyone - /// who is authenticated with a Google account or a service account. + /// If not present during the `CreateSubscription` call, it will default to + /// the version of the Pub/Sub API used to make such call. If not present in a + /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + /// calls will always return a valid version, even if the subscription was + /// created without this attribute. /// - /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// The only supported values for the `x-goog-version` attribute are: /// + /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. /// - /// * `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. - /// - /// * `group:{emailid}`: An email address that represents a Google group. - /// For example, `admins@example.com`. - /// - /// - /// * `domain:{domain}`: The G Suite domain (primary) that represents all the - /// users of that domain. For example, `google.com` or `example.com`. - /// - /// - pub members: Option>, + /// For example: + ///
          attributes { "x-goog-version": "v1" } 
          + pub attributes: Option>, + /// If specified, Pub/Sub will generate and attach an OIDC JWT token as an + /// `Authorization` header in the HTTP request for every pushed message. + #[serde(rename="oidcToken")] + pub oidc_token: Option, + /// A URL locating the endpoint to which messages should be pushed. + /// For example, a Webhook endpoint might use "https://example.com/push". + #[serde(rename="pushEndpoint")] + pub push_endpoint: Option, } -impl Part for Binding {} +impl Part for PushConfig {} /// Request for the `CreateSnapshot` method. @@ -1239,7 +1396,7 @@ pub struct CreateSnapshotRequest { /// See Creating and /// managing labels. pub labels: Option>, - /// The subscription whose backlog the snapshot retains. + /// Required. The subscription whose backlog the snapshot retains. /// Specifically, the created snapshot is guaranteed to retain: /// (a) The existing backlog on the subscription. More precisely, this is /// defined as the messages in the subscription's backlog that are @@ -1270,7 +1427,7 @@ pub struct Topic { /// See Creating and /// managing labels. pub labels: Option>, - /// The name of the topic. It must have the format + /// Required. The name of the topic. It must have the format /// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, /// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -1305,11 +1462,11 @@ impl ResponseResult for Topic {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateSubscriptionRequest { - /// Indicates which fields in the provided subscription to update. + /// Required. Indicates which fields in the provided subscription to update. /// Must be specified and non-empty. #[serde(rename="updateMask")] pub update_mask: Option, - /// The updated subscription object. + /// Required. The updated subscription object. pub subscription: Option, } @@ -1327,9 +1484,9 @@ impl RequestValue for UpdateSubscriptionRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateSnapshotRequest { - /// The updated snapshot object. + /// Required. The updated snapshot object. pub snapshot: Option, - /// Indicates which fields in the provided snapshot to update. + /// Required. Indicates which fields in the provided snapshot to update. /// Must be specified and non-empty. #[serde(rename="updateMask")] pub update_mask: Option, @@ -1351,7 +1508,8 @@ impl RequestValue for UpdateSnapshotRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PubsubMessage { - /// Optional attributes for this message. + /// Attributes for this message. If this field is empty, the message must + /// contain non-empty data. pub attributes: Option>, /// The message data field. If this field is empty, the message must contain /// at least one attribute. @@ -1422,7 +1580,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `project` - The name of the project in which to list subscriptions. + /// * `project` - Required. The name of the project in which to list subscriptions. /// Format is `projects/{project-id}`. pub fn subscriptions_list(&self, project: &str) -> ProjectSubscriptionListCall<'a, C, A> { ProjectSubscriptionListCall { @@ -1445,7 +1603,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the topic. It must have the format + /// * `name` - Required. The name of the topic. It must have the format /// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, /// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -1549,7 +1707,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - The subscription from which messages should be pulled. + /// * `subscription` - Required. The subscription from which messages should be pulled. /// Format is `projects/{project}/subscriptions/{sub}`. pub fn subscriptions_pull(&self, request: PullRequest, subscription: &str) -> ProjectSubscriptionPullCall<'a, C, A> { ProjectSubscriptionPullCall { @@ -1574,7 +1732,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - The name of the subscription. + /// * `subscription` - Required. The name of the subscription. /// Format is `projects/{project}/subscriptions/{sub}`. pub fn subscriptions_modify_push_config(&self, request: ModifyPushConfigRequest, subscription: &str) -> ProjectSubscriptionModifyPushConfigCall<'a, C, A> { ProjectSubscriptionModifyPushConfigCall { @@ -1601,6 +1759,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectSnapshotGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1618,7 +1777,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - The name of the subscription. + /// * `subscription` - Required. The name of the subscription. /// Format is `projects/{project}/subscriptions/{sub}`. pub fn subscriptions_modify_ack_deadline(&self, request: ModifyAckDeadlineRequest, subscription: &str) -> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> { ProjectSubscriptionModifyAckDeadlineCall { @@ -1645,6 +1804,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectTopicGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1664,7 +1824,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - The subscription whose message is being acknowledged. + /// * `subscription` - Required. The subscription whose message is being acknowledged. /// Format is `projects/{project}/subscriptions/{sub}`. pub fn subscriptions_acknowledge(&self, request: AcknowledgeRequest, subscription: &str) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> { ProjectSubscriptionAcknowledgeCall { @@ -1687,7 +1847,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `subscription` - The subscription to delete. + /// * `subscription` - Required. The subscription to delete. /// Format is `projects/{project}/subscriptions/{sub}`. pub fn subscriptions_delete(&self, subscription: &str) -> ProjectSubscriptionDeleteCall<'a, C, A> { ProjectSubscriptionDeleteCall { @@ -1709,7 +1869,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `snapshot` - The name of the snapshot to get. + /// * `snapshot` - Required. The name of the snapshot to get. /// Format is `projects/{project}/snapshots/{snap}`. pub fn snapshots_get(&self, snapshot: &str) -> ProjectSnapshotGetCall<'a, C, A> { ProjectSnapshotGetCall { @@ -1735,6 +1895,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectSubscriptionGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1747,7 +1908,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `project` - The name of the project in which to list topics. + /// * `project` - Required. The name of the project in which to list topics. /// Format is `projects/{project-id}`. pub fn topics_list(&self, project: &str) -> ProjectTopicListCall<'a, C, A> { ProjectTopicListCall { @@ -1793,7 +1954,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `topic` - The messages in the request will be published on this topic. + /// * `topic` - Required. The messages in the request will be published on this topic. /// Format is `projects/{project}/topics/{topic}`. pub fn topics_publish(&self, request: PublishRequest, topic: &str) -> ProjectTopicPublishCall<'a, C, A> { ProjectTopicPublishCall { @@ -1812,7 +1973,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `topic` - The name of the topic to get. + /// * `topic` - Required. The name of the topic to get. /// Format is `projects/{project}/topics/{topic}`. pub fn topics_get(&self, topic: &str) -> ProjectTopicGetCall<'a, C, A> { ProjectTopicGetCall { @@ -1839,7 +2000,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `snapshot` - The name of the snapshot to delete. + /// * `snapshot` - Required. The name of the snapshot to delete. /// Format is `projects/{project}/snapshots/{snap}`. pub fn snapshots_delete(&self, snapshot: &str) -> ProjectSnapshotDeleteCall<'a, C, A> { ProjectSnapshotDeleteCall { @@ -1856,6 +2017,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -1880,7 +2043,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the topic. It must have the format + /// * `name` - Required. The name of the topic. It must have the format /// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, /// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -1916,7 +2079,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the subscription. It must have the format + /// * `name` - Required. The name of the subscription. It must have the format /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must /// start with a letter, and contain only letters (`[A-Za-z]`), numbers /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), @@ -1941,7 +2104,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the subscription. It must have the format + /// * `name` - Required. The name of the subscription. It must have the format /// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must /// start with a letter, and contain only letters (`[A-Za-z]`), numbers /// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), @@ -1982,13 +2145,12 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Optional user-provided name for this snapshot. - /// If the name is not provided in the request, the server will assign a random - /// name for this snapshot on the same project as the subscription. - /// Note that for REST API requests, you must specify a name. See the - /// - /// resource name rules. - /// Format is `projects/{project}/snapshots/{snap}`. + /// * `name` - Required. User-provided name for this snapshot. If the name is not provided in the + /// request, the server will assign a random name for this snapshot on the same + /// project as the subscription. Note that for REST API requests, you must + /// specify a name. See the resource + /// name rules. Format is `projects/{project}/snapshots/{snap}`. pub fn snapshots_create(&self, request: CreateSnapshotRequest, name: &str) -> ProjectSnapshotCreateCall<'a, C, A> { ProjectSnapshotCreateCall { hub: self.hub, @@ -2010,7 +2172,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `topic` - Name of the topic to delete. + /// * `topic` - Required. Name of the topic to delete. /// Format is `projects/{project}/topics/{topic}`. pub fn topics_delete(&self, topic: &str) -> ProjectTopicDeleteCall<'a, C, A> { ProjectTopicDeleteCall { @@ -2033,7 +2195,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `project` - The name of the project in which to list snapshots. + /// * `project` - Required. The name of the project in which to list snapshots. /// Format is `projects/{project-id}`. pub fn snapshots_list(&self, project: &str) -> ProjectSnapshotListCall<'a, C, A> { ProjectSnapshotListCall { @@ -2052,6 +2214,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2082,7 +2246,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `subscription` - The subscription to affect. + /// * `subscription` - Required. The subscription to affect. pub fn subscriptions_seek(&self, request: SeekRequest, subscription: &str) -> ProjectSubscriptionSeekCall<'a, C, A> { ProjectSubscriptionSeekCall { hub: self.hub, @@ -2100,7 +2264,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `subscription` - The name of the subscription to get. + /// * `subscription` - Required. The name of the subscription to get. /// Format is `projects/{project}/subscriptions/{sub}`. pub fn subscriptions_get(&self, subscription: &str) -> ProjectSubscriptionGetCall<'a, C, A> { ProjectSubscriptionGetCall { @@ -2118,7 +2282,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `topic` - The name of the topic that subscriptions are attached to. + /// * `topic` - Required. The name of the topic that subscriptions are attached to. /// Format is `projects/{project}/topics/{topic}`. pub fn topics_subscriptions_list(&self, topic: &str) -> ProjectTopicSubscriptionListCall<'a, C, A> { ProjectTopicSubscriptionListCall { @@ -2143,7 +2307,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `topic` - The name of the topic that snapshots are attached to. + /// * `topic` - Required. The name of the topic that snapshots are attached to. /// Format is `projects/{project}/topics/{topic}`. pub fn topics_snapshots_list(&self, topic: &str) -> ProjectTopicSnapshotListCall<'a, C, A> { ProjectTopicSnapshotListCall { @@ -2162,6 +2326,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -2215,8 +2381,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().subscriptions_list("project") -/// .page_token("et") -/// .page_size(-18) +/// .page_token("accusam") +/// .page_size(-8) /// .doit(); /// # } /// ``` @@ -2372,7 +2538,7 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// The name of the subscription. + /// Required. The name of the subscription. /// Format is `projects/{project}/subscriptions/{sub}`. /// /// Sets the *subscription* path property to the given value. @@ -4203,6 +4369,7 @@ impl<'a, C, A> ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().snapshots_get_iam_policy("resource") +/// .options_requested_policy_version(-61) /// .doit(); /// # } /// ``` @@ -4211,6 +4378,7 @@ pub struct ProjectSnapshotGetIamPolicyCall<'a, C, A> hub: &'a Pubsub, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4233,9 +4401,12 @@ impl<'a, C, A> ProjectSnapshotGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4361,6 +4532,20 @@ impl<'a, C, A> ProjectSnapshotGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSnapshotGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4634,7 +4819,7 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro self._request = new_value; self } - /// The name of the subscription. + /// Required. The name of the subscription. /// Format is `projects/{project}/subscriptions/{sub}`. /// /// Sets the *subscription* path property to the given value. @@ -4738,6 +4923,7 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().topics_get_iam_policy("resource") +/// .options_requested_policy_version(-66) /// .doit(); /// # } /// ``` @@ -4746,6 +4932,7 @@ pub struct ProjectTopicGetIamPolicyCall<'a, C, A> hub: &'a Pubsub, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4768,9 +4955,12 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4896,6 +5086,20 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -5171,7 +5375,7 @@ impl<'a, C, A> ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut ProjectSnapshotGetCall<'a, C, A> where C: BorrowMut ProjectSnapshotGetCall<'a, C, A> where C: BorrowMut hub: &'a Pubsub, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5811,9 +6017,12 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< }; dlg.begin(MethodInfo { id: "pubsub.projects.subscriptions.getIamPolicy", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5939,6 +6148,20 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< self._resource = new_value.to_string(); self } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -6030,8 +6253,8 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().topics_list("project") -/// .page_token("no") -/// .page_size(-21) +/// .page_token("ipsum") +/// .page_size(-5) /// .doit(); /// # } /// ``` @@ -6187,7 +6410,7 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, } - /// The name of the project in which to list topics. + /// Required. The name of the project in which to list topics. /// Format is `projects/{project-id}`. /// /// Sets the *project* path property to the given value. @@ -6768,7 +6991,7 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut ProjectTopicGetCall<'a, C, A> where C: BorrowMut, } - /// The name of the topic to get. + /// Required. The name of the topic to get. /// Format is `projects/{project}/topics/{topic}`. /// /// Sets the *topic* path property to the given value. @@ -7275,7 +7498,7 @@ impl<'a, C, A> ProjectSnapshotDeleteCall<'a, C, A> where C: BorrowMut ProjectSnapshotDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicPatchCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The name of the topic. It must have the format + /// Required. The name of the topic. It must have the format /// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, /// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), /// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent @@ -8133,7 +8358,7 @@ impl<'a, C, A> ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut ProjectSubscriptionPatchCall<'a, C, A> where C: BorrowMut ProjectSnapshotCreateCall<'a, C, A> where C: BorrowMut - /// resource name rules. - /// Format is `projects/{project}/snapshots/{snap}`. + /// Required. User-provided name for this snapshot. If the name is not provided in the + /// request, the server will assign a random name for this snapshot on the same + /// project as the subscription. Note that for REST API requests, you must + /// specify a name. See the resource + /// name rules. Format is `projects/{project}/snapshots/{snap}`. /// /// Sets the *name* path property to the given value. /// @@ -8977,7 +9201,7 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectSnapshotListCall<'a, C, A> where C: BorrowMut ProjectSnapshotListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionSeekCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicSnapshotListCall<'a, C, A> where C: BorrowMut ProjectTopicSnapshotListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-pubsub1_beta2] path = "../pubsub1_beta2" -version = "1.0.12+20190625" +version = "1.0.13+20200403" diff --git a/gen/pubsub1_beta2-cli/README.md b/gen/pubsub1_beta2-cli/README.md index 3fd4b2256d..9ab634416f 100644 --- a/gen/pubsub1_beta2-cli/README.md +++ b/gen/pubsub1_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Pubsub* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *Pubsub* API at revision *20200403*. The CLI is at version *1.0.13*. ```bash pubsub1-beta2 [options] diff --git a/gen/pubsub1_beta2-cli/mkdocs.yml b/gen/pubsub1_beta2-cli/mkdocs.yml index 74896ab7cc..7d5cb0fd84 100644 --- a/gen/pubsub1_beta2-cli/mkdocs.yml +++ b/gen/pubsub1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Pubsub v1.0.12+20190625 +site_name: Pubsub v1.0.13+20200403 site_url: http://byron.github.io/google-apis-rs/google-pubsub1_beta2-cli site_description: A complete library to interact with Pubsub (protocol v1beta2) diff --git a/gen/pubsub1_beta2-cli/src/main.rs b/gen/pubsub1_beta2-cli/src/main.rs index 4b0e3010d3..15ae934ca4 100644 --- a/gen/pubsub1_beta2-cli/src/main.rs +++ b/gen/pubsub1_beta2-cli/src/main.rs @@ -332,6 +332,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -345,6 +348,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -1064,6 +1068,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1077,6 +1084,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -1908,7 +1916,9 @@ fn main() { ]), ("subscriptions-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_subscriptions-set-iam-policy", vec![ (Some(r##"resource"##), @@ -2131,7 +2141,9 @@ fn main() { ]), ("topics-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_topics-set-iam-policy", vec![ (Some(r##"resource"##), @@ -2222,7 +2234,7 @@ fn main() { let mut app = App::new("pubsub1-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200403") .about("Provides reliable, many-to-many, asynchronous messaging between applications. ") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli") diff --git a/gen/pubsub1_beta2/Cargo.toml b/gen/pubsub1_beta2/Cargo.toml index 484cd13462..d32c8f2ca9 100644 --- a/gen/pubsub1_beta2/Cargo.toml +++ b/gen/pubsub1_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pubsub1_beta2" -version = "1.0.12+20190625" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2" homepage = "https://cloud.google.com/pubsub/docs" -documentation = "https://docs.rs/google-pubsub1_beta2/1.0.12+20190625" +documentation = "https://docs.rs/google-pubsub1_beta2/1.0.13+20200403" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/pubsub1_beta2/README.md b/gen/pubsub1_beta2/README.md index fc79e9a81e..b54f153130 100644 --- a/gen/pubsub1_beta2/README.md +++ b/gen/pubsub1_beta2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-pubsub1_beta2` library allows access to all features of the *Google Pubsub* service. -This documentation was generated from *Pubsub* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Pubsub* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Pubsub* *v1_beta2* API can be found at the [official documentation site](https://cloud.google.com/pubsub/docs). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.Pubsub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.Pubsub.html) ... * projects - * [*subscriptions acknowledge*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.ProjectTopicTestIamPermissionCall.html) + * [*subscriptions acknowledge*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.ProjectTopicTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/struct.Pubsub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-pubsub1_beta2/1.0.12+20190625/google_pubsub1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1_beta2/1.0.13+20200403/google_pubsub1_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/pubsub1_beta2/src/lib.rs b/gen/pubsub1_beta2/src/lib.rs index 3190f89b33..101c8f4935 100644 --- a/gen/pubsub1_beta2/src/lib.rs +++ b/gen/pubsub1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Pubsub* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Pubsub* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Pubsub* *v1_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/pubsub/docs). @@ -337,7 +337,7 @@ impl<'a, C, A> Pubsub Pubsub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://pubsub.googleapis.com/".to_string(), _root_url: "https://pubsub.googleapis.com/".to_string(), } @@ -348,7 +348,7 @@ impl<'a, C, A> Pubsub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -387,11 +387,13 @@ impl<'a, C, A> Pubsub /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PullRequest { - /// If this is specified as true the system will respond immediately even if + /// Optional. If this is specified as true the system will respond immediately even if /// it is not able to return a message in the `Pull` response. Otherwise the /// system is allowed to wait until at least one message is available rather /// than returning no messages. The client may cancel the request if it does - /// not wish to wait any longer for the response. + /// not wish to wait any longer for the response. Warning: setting this field + /// to `true` is discouraged because it adversely impacts the performance of + /// `Pull` operations. We recommend that users do not set this field. #[serde(rename="returnImmediately")] pub return_immediately: Option, /// The maximum number of messages returned for this request. The Pub/Sub @@ -575,37 +577,50 @@ pub struct PublishRequest { impl RequestValue for PublishRequest {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -613,15 +628,21 @@ impl RequestValue for PublishRequest {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -634,8 +655,9 @@ impl RequestValue for PublishRequest {} /// * [topics set iam policy projects](struct.ProjectTopicSetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -645,10 +667,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -890,7 +934,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -899,6 +943,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -910,30 +974,59 @@ pub struct Binding { impl Part for Binding {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1257,6 +1350,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectTopicGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1312,6 +1406,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -1397,6 +1493,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectSubscriptionGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1510,6 +1607,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -3504,6 +3603,7 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().topics_get_iam_policy("resource") +/// .options_requested_policy_version(-9) /// .doit(); /// # } /// ``` @@ -3512,6 +3612,7 @@ pub struct ProjectTopicGetIamPolicyCall<'a, C, A> hub: &'a Pubsub, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3534,9 +3635,12 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3662,6 +3766,20 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4262,6 +4380,8 @@ impl<'a, C, A> ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut hub: &'a Pubsub, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5176,9 +5298,12 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< }; dlg.begin(MethodInfo { id: "pubsub.projects.subscriptions.getIamPolicy", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5304,6 +5429,20 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< self._resource = new_value.to_string(); self } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -6181,8 +6320,8 @@ impl<'a, C, A> ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with QPX Express (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/qpxexpress1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-qpxexpress1] path = "../qpxexpress1" -version = "1.0.12+20160708" +version = "1.0.13+20160708" diff --git a/gen/qpxexpress1-cli/README.md b/gen/qpxexpress1-cli/README.md index 340fb1d58b..a6d5ce1996 100644 --- a/gen/qpxexpress1-cli/README.md +++ b/gen/qpxexpress1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *QPX Express* API at revision *20160708*. The CLI is at version *1.0.12*. +This documentation was generated from the *QPX Express* API at revision *20160708*. The CLI is at version *1.0.13*. ```bash qpxexpress1 [options] diff --git a/gen/qpxexpress1-cli/mkdocs.yml b/gen/qpxexpress1-cli/mkdocs.yml index a0e9ff130a..a9177caab5 100644 --- a/gen/qpxexpress1-cli/mkdocs.yml +++ b/gen/qpxexpress1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: QPX Express v1.0.12+20160708 +site_name: QPX Express v1.0.13+20160708 site_url: http://byron.github.io/google-apis-rs/google-qpxexpress1-cli site_description: A complete library to interact with QPX Express (protocol v1) diff --git a/gen/qpxexpress1-cli/src/main.rs b/gen/qpxexpress1-cli/src/main.rs index aea0c5e0af..5d4a94a0da 100644 --- a/gen/qpxexpress1-cli/src/main.rs +++ b/gen/qpxexpress1-cli/src/main.rs @@ -265,7 +265,7 @@ fn main() { let mut app = App::new("qpxexpress1") .author("Sebastian Thiel ") - .version("1.0.12+20160708") + .version("1.0.13+20160708") .about("Finds the least expensive flights between an origin and a destination.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_qpxexpress1_cli") .arg(Arg::with_name("folder") diff --git a/gen/qpxexpress1/Cargo.toml b/gen/qpxexpress1/Cargo.toml index c61948136e..c8c9e9d0eb 100644 --- a/gen/qpxexpress1/Cargo.toml +++ b/gen/qpxexpress1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-qpxexpress1" -version = "1.0.12+20160708" +version = "1.0.13+20160708" authors = ["Sebastian Thiel "] description = "A complete library to interact with QPX Express (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/qpxexpress1" homepage = "http://developers.google.com/qpx-express" -documentation = "https://docs.rs/google-qpxexpress1/1.0.12+20160708" +documentation = "https://docs.rs/google-qpxexpress1/1.0.13+20160708" license = "MIT" keywords = ["qpxExpress", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/qpxexpress1/README.md b/gen/qpxexpress1/README.md index edae23fff2..b556e1c4d7 100644 --- a/gen/qpxexpress1/README.md +++ b/gen/qpxexpress1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-qpxexpress1` library allows access to all features of the *Google QPX Express* service. -This documentation was generated from *QPX Express* crate version *1.0.12+20160708*, where *20160708* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *QPX Express* crate version *1.0.13+20160708*, where *20160708* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *QPX Express* *v1* API can be found at the [official documentation site](http://developers.google.com/qpx-express). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/struct.QPXExpress.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/struct.QPXExpress.html) ... * trips - * [*search*](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/struct.TripSearchCall.html) + * [*search*](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/struct.TripSearchCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/struct.QPXExpress.html)** +* **[Hub](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/struct.QPXExpress.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.Part.html)** + * **[Parts](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-qpxexpress1/1.0.12+20160708/google_qpxexpress1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-qpxexpress1/1.0.13+20160708/google_qpxexpress1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/qpxexpress1/src/lib.rs b/gen/qpxexpress1/src/lib.rs index 0b6031e43f..cf9af27f78 100644 --- a/gen/qpxexpress1/src/lib.rs +++ b/gen/qpxexpress1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *QPX Express* crate version *1.0.12+20160708*, where *20160708* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *QPX Express* crate version *1.0.13+20160708*, where *20160708* is the exact revision of the *qpxExpress:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *QPX Express* *v1* API can be found at the //! [official documentation site](http://developers.google.com/qpx-express). @@ -307,7 +307,7 @@ impl<'a, C, A> QPXExpress QPXExpress { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/qpxExpress/v1/trips/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -318,7 +318,7 @@ impl<'a, C, A> QPXExpress } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/redis1-cli/Cargo.toml b/gen/redis1-cli/Cargo.toml index dfe6e9ddbf..60b9ef695d 100644 --- a/gen/redis1-cli/Cargo.toml +++ b/gen/redis1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-redis1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Redis (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/redis1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-redis1] path = "../redis1" -version = "1.0.12+20190628" +version = "1.0.13+20200402" diff --git a/gen/redis1-cli/README.md b/gen/redis1-cli/README.md index c00864cb87..a6ac7383c8 100644 --- a/gen/redis1-cli/README.md +++ b/gen/redis1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Redis* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Redis* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash redis1 [options] @@ -39,6 +39,7 @@ redis1 [options] locations-instances-import (-r )... [-p ]... [-o ] locations-instances-list [-p ]... [-o ] locations-instances-patch (-r )... [-p ]... [-o ] + locations-instances-upgrade (-r )... [-p ]... [-o ] locations-list [-p ]... [-o ] locations-operations-cancel [-p ]... [-o ] locations-operations-delete [-p ]... [-o ] diff --git a/gen/redis1-cli/mkdocs.yml b/gen/redis1-cli/mkdocs.yml index cec5e64357..e791fcc378 100644 --- a/gen/redis1-cli/mkdocs.yml +++ b/gen/redis1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Redis v1.0.12+20190628 +site_name: Cloud Redis v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-redis1-cli site_description: A complete library to interact with Cloud Redis (protocol v1) @@ -18,6 +18,7 @@ pages: - ['projects_locations-instances-import.md', 'Projects', 'Locations Instances Import'] - ['projects_locations-instances-list.md', 'Projects', 'Locations Instances List'] - ['projects_locations-instances-patch.md', 'Projects', 'Locations Instances Patch'] +- ['projects_locations-instances-upgrade.md', 'Projects', 'Locations Instances Upgrade'] - ['projects_locations-list.md', 'Projects', 'Locations List'] - ['projects_locations-operations-cancel.md', 'Projects', 'Locations Operations Cancel'] - ['projects_locations-operations-delete.md', 'Projects', 'Locations Operations Delete'] diff --git a/gen/redis1-cli/src/main.rs b/gen/redis1-cli/src/main.rs index 733f4fb06d..30d650bd02 100644 --- a/gen/redis1-cli/src/main.rs +++ b/gen/redis1-cli/src/main.rs @@ -135,12 +135,13 @@ impl<'n> Engine<'n> { "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status-message" => Some(("statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "redis-configs" => Some(("redisConfigs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "connect-mode" => Some(("connectMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "persistence-iam-identity" => Some(("persistenceIamIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "authorized-network" => Some(("authorizedNetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["alternative-location-id", "authorized-network", "create-time", "current-location-id", "display-name", "host", "labels", "location-id", "memory-size-gb", "name", "persistence-iam-identity", "port", "redis-configs", "redis-version", "reserved-ip-range", "state", "status-message", "tier"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternative-location-id", "authorized-network", "connect-mode", "create-time", "current-location-id", "display-name", "host", "labels", "location-id", "memory-size-gb", "name", "persistence-iam-identity", "port", "redis-configs", "redis-version", "reserved-ip-range", "state", "status-message", "tier"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -659,12 +660,13 @@ impl<'n> Engine<'n> { "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status-message" => Some(("statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "redis-configs" => Some(("redisConfigs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "connect-mode" => Some(("connectMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tier" => Some(("tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "persistence-iam-identity" => Some(("persistenceIamIdentity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "authorized-network" => Some(("authorizedNetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["alternative-location-id", "authorized-network", "create-time", "current-location-id", "display-name", "host", "labels", "location-id", "memory-size-gb", "name", "persistence-iam-identity", "port", "redis-configs", "redis-version", "reserved-ip-range", "state", "status-message", "tier"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternative-location-id", "authorized-network", "connect-mode", "create-time", "current-location-id", "display-name", "host", "labels", "location-id", "memory-size-gb", "name", "persistence-iam-identity", "port", "redis-configs", "redis-version", "reserved-ip-range", "state", "status-message", "tier"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -728,6 +730,91 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_instances_upgrade(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "redis-version" => Some(("redisVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["redis-version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpgradeInstanceRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_instances_upgrade(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or("")); @@ -1042,6 +1129,9 @@ impl<'n> Engine<'n> { ("locations-instances-patch", Some(opt)) => { call_result = self._projects_locations_instances_patch(opt, dry_run, &mut err); }, + ("locations-instances-upgrade", Some(opt)) => { + call_result = self._projects_locations_instances_upgrade(opt, dry_run, &mut err); + }, ("locations-list", Some(opt)) => { call_result = self._projects_locations_list(opt, dry_run, &mut err); }, @@ -1148,7 +1238,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'locations-get', 'locations-instances-create', 'locations-instances-delete', 'locations-instances-export', 'locations-instances-failover', 'locations-instances-get', 'locations-instances-import', 'locations-instances-list', 'locations-instances-patch', 'locations-list', 'locations-operations-cancel', 'locations-operations-delete', 'locations-operations-get' and 'locations-operations-list'", vec![ + ("projects", "methods: 'locations-get', 'locations-instances-create', 'locations-instances-delete', 'locations-instances-export', 'locations-instances-failover', 'locations-instances-get', 'locations-instances-import', 'locations-instances-list', 'locations-instances-patch', 'locations-instances-upgrade', 'locations-list', 'locations-operations-cancel', 'locations-operations-delete', 'locations-operations-get' and 'locations-operations-list'", vec![ ("locations-get", Some(r##"Gets information about a location."##), "Details at http://byron.github.io/google-apis-rs/google_redis1_cli/projects_locations-get", @@ -1369,6 +1459,7 @@ fn main() { location (region) or all locations. The location should have the following format: + * `projects/{project_id}/locations/{location_id}` If `location_id` is specified as `-` (wildcard), then all regions @@ -1412,8 +1503,39 @@ fn main() { Note: Redis instances are managed and addressed at regional level so location_id here refers to a GCP region; however, users may choose which specific zone (or collection of zones for cross-zone instances) an instance - should be provisioned in. Refer to [location_id] and - [alternative_location_id] fields for more details."##), + should be provisioned in. Refer to location_id and + alternative_location_id fields for more details."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-instances-upgrade", + Some(r##"Upgrades Redis instance to the newer Redis version specified in the + request."##), + "Details at http://byron.github.io/google-apis-rs/google_redis1_cli/projects_locations-instances-upgrade", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Redis instance resource name using the form: + `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + where `location_id` refers to a GCP region."##), Some(true), Some(false)), @@ -1574,7 +1696,7 @@ fn main() { let mut app = App::new("redis1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200402") .about("Creates and manages Redis instances on the Google Cloud Platform.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_redis1_cli") .arg(Arg::with_name("url") diff --git a/gen/redis1/Cargo.toml b/gen/redis1/Cargo.toml index 06cc875b8e..f9000b260b 100644 --- a/gen/redis1/Cargo.toml +++ b/gen/redis1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-redis1" -version = "1.0.12+20190628" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Redis (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/redis1" homepage = "https://cloud.google.com/memorystore/docs/redis/" -documentation = "https://docs.rs/google-redis1/1.0.12+20190628" +documentation = "https://docs.rs/google-redis1/1.0.13+20200402" license = "MIT" keywords = ["redis", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/redis1/README.md b/gen/redis1/README.md index 9151e567f6..b6b82d3d34 100644 --- a/gen/redis1/README.md +++ b/gen/redis1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-redis1` library allows access to all features of the *Google Cloud Redis* service. -This documentation was generated from *Cloud Redis* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *redis:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Redis* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *redis:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Redis* *v1* API can be found at the [official documentation site](https://cloud.google.com/memorystore/docs/redis/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.CloudRedis.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.CloudRedis.html) ... * projects - * [*locations get*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances export*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstanceExportCall.html), [*locations instances failover*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstanceFailoverCall.html), [*locations instances get*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstanceGetCall.html), [*locations instances import*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstanceImportCall.html), [*locations instances list*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationInstancePatchCall.html), [*locations list*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.ProjectLocationOperationListCall.html) + * [*locations get*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationGetCall.html), [*locations instances create*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceDeleteCall.html), [*locations instances export*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceExportCall.html), [*locations instances failover*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceFailoverCall.html), [*locations instances get*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceGetCall.html), [*locations instances import*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceImportCall.html), [*locations instances list*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstancePatchCall.html), [*locations instances upgrade*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationInstanceUpgradeCall.html), [*locations list*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationListCall.html), [*locations operations cancel*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.ProjectLocationOperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/struct.CloudRedis.html)** +* **[Hub](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/struct.CloudRedis.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.Part.html)** + * **[Parts](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -53,6 +53,7 @@ let r = hub.projects().locations_instances_delete(...).doit() let r = hub.projects().locations_instances_failover(...).doit() let r = hub.projects().locations_instances_patch(...).doit() let r = hub.projects().locations_instances_create(...).doit() +let r = hub.projects().locations_instances_upgrade(...).doit() let r = hub.projects().locations_operations_get(...).doit() ``` @@ -137,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -157,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-redis1/1.0.12+20190628/google_redis1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-redis1/1.0.13+20200402/google_redis1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/redis1/src/lib.rs b/gen/redis1/src/lib.rs index a4d93f304e..aeaf37d8b6 100644 --- a/gen/redis1/src/lib.rs +++ b/gen/redis1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Redis* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *redis:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Redis* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *redis:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Redis* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/memorystore/docs/redis/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.CloudRedis.html) ... //! //! * projects -//! * [*locations get*](struct.ProjectLocationGetCall.html), [*locations instances create*](struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](struct.ProjectLocationInstanceDeleteCall.html), [*locations instances export*](struct.ProjectLocationInstanceExportCall.html), [*locations instances failover*](struct.ProjectLocationInstanceFailoverCall.html), [*locations instances get*](struct.ProjectLocationInstanceGetCall.html), [*locations instances import*](struct.ProjectLocationInstanceImportCall.html), [*locations instances list*](struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](struct.ProjectLocationInstancePatchCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*locations operations cancel*](struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](struct.ProjectLocationOperationListCall.html) +//! * [*locations get*](struct.ProjectLocationGetCall.html), [*locations instances create*](struct.ProjectLocationInstanceCreateCall.html), [*locations instances delete*](struct.ProjectLocationInstanceDeleteCall.html), [*locations instances export*](struct.ProjectLocationInstanceExportCall.html), [*locations instances failover*](struct.ProjectLocationInstanceFailoverCall.html), [*locations instances get*](struct.ProjectLocationInstanceGetCall.html), [*locations instances import*](struct.ProjectLocationInstanceImportCall.html), [*locations instances list*](struct.ProjectLocationInstanceListCall.html), [*locations instances patch*](struct.ProjectLocationInstancePatchCall.html), [*locations instances upgrade*](struct.ProjectLocationInstanceUpgradeCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*locations operations cancel*](struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](struct.ProjectLocationOperationListCall.html) //! //! //! @@ -53,6 +53,7 @@ //! let r = hub.projects().locations_instances_failover(...).doit() //! let r = hub.projects().locations_instances_patch(...).doit() //! let r = hub.projects().locations_instances_create(...).doit() +//! let r = hub.projects().locations_instances_upgrade(...).doit() //! let r = hub.projects().locations_operations_get(...).doit() //! ``` //! @@ -337,7 +338,7 @@ impl<'a, C, A> CloudRedis CloudRedis { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://redis.googleapis.com/".to_string(), _root_url: "https://redis.googleapis.com/".to_string(), } @@ -348,7 +349,7 @@ impl<'a, C, A> CloudRedis } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -397,10 +398,10 @@ pub struct ListInstancesResponse { /// If the `location_id` in the parent field of the request is "-", all regions /// available to the project are queried, and the results aggregated. /// If in such an aggregated query a location is unavailable, a dummy Redis - /// entry is included in the response with the "name" field set to a value of - /// the form projects/{project_id}/locations/{location_id}/instances/- and the - /// "status" field set to ERROR and "status_message" field set to "location not - /// available for ListInstances". + /// entry is included in the response with the `name` field set to a value of + /// the form `projects/{project_id}/locations/{location_id}/instances/`- and + /// the `status` field set to ERROR and `status_message` field set to "location + /// not available for ListInstances". pub instances: Option>, /// Locations that could not be reached. pub unreachable: Option>, @@ -453,23 +454,23 @@ pub struct Instance { pub labels: Option>, /// Optional. Only applicable to STANDARD_HA tier which protects the instance /// against zonal failures by provisioning it across two zones. If provided, it - /// must be a different zone from the one provided in [location_id]. + /// must be a different zone from the one provided in location_id. #[serde(rename="alternativeLocationId")] pub alternative_location_id: Option, /// Output only. The current zone where the Redis endpoint is placed. For Basic - /// Tier instances, this will always be the same as the [location_id] + /// Tier instances, this will always be the same as the location_id /// provided by the user at creation time. For Standard Tier instances, - /// this can be either [location_id] or [alternative_location_id] and can + /// this can be either location_id or alternative_location_id and can /// change after a failover event. #[serde(rename="currentLocationId")] pub current_location_id: Option, /// Optional. The version of Redis software. - /// If not provided, latest supported version will be used. Updating the - /// version will perform an upgrade/downgrade to the new version. Currently, - /// the supported values are: + /// If not provided, latest supported version will be used. Currently, the + /// supported values are: /// - /// * `REDIS_4_0` for Redis 4.0 compatibility (default) /// * `REDIS_3_2` for Redis 3.2 compatibility + /// * `REDIS_4_0` for Redis 4.0 compatibility (default) + /// * `REDIS_5_0` for Redis 5.0 compatibility #[serde(rename="redisVersion")] pub redis_version: Option, /// Output only. Hostname or IP address of the exposed Redis endpoint used by @@ -478,24 +479,30 @@ pub struct Instance { /// Optional. The zone where the instance will be provisioned. If not provided, /// the service will choose a zone for the instance. For STANDARD_HA tier, /// instances will be created across two zones for protection against zonal - /// failures. If [alternative_location_id] is also provided, it must be - /// different from [location_id]. + /// failures. If alternative_location_id is also provided, it must be + /// different from location_id. #[serde(rename="locationId")] pub location_id: Option, /// Optional. Redis configuration parameters, according to /// http://redis.io/topics/config. Currently, the only supported parameters /// are: /// - /// Redis 3.2 and above: + /// Redis version 3.2 and newer: /// /// * maxmemory-policy /// * notify-keyspace-events /// - /// Redis 4.0 and above: + /// Redis version 4.0 and newer: /// /// * activedefrag - /// * lfu-log-factor /// * lfu-decay-time + /// * lfu-log-factor + /// * maxmemory-gb + /// + /// Redis version 5.0 and newer: + /// + /// * stream-node-max-bytes + /// * stream-node-max-entries #[serde(rename="redisConfigs")] pub redis_configs: Option>, /// Required. The service tier of the instance. @@ -513,8 +520,8 @@ pub struct Instance { /// Note: Redis instances are managed and addressed at regional level so /// location_id here refers to a GCP region; however, users may choose which /// specific zone (or collection of zones for cross-zone instances) an instance - /// should be provisioned in. Refer to [location_id] and - /// [alternative_location_id] fields for more details. + /// should be provisioned in. Refer to location_id and + /// alternative_location_id fields for more details. pub name: Option, /// Optional. The CIDR range of internal addresses that are reserved for this /// instance. If not provided, the service will choose an unused /29 block, @@ -542,6 +549,10 @@ pub struct Instance { /// will be used. #[serde(rename="authorizedNetwork")] pub authorized_network: Option, + /// Optional. The network connect mode of the Redis instance. + /// If not provided, the connect mode defaults to DIRECT_PEERING. + #[serde(rename="connectMode")] + pub connect_mode: Option, /// Output only. Additional information about the current status of this /// instance, if available. #[serde(rename="statusMessage")] @@ -705,6 +716,25 @@ pub struct InputConfig { impl Part for InputConfig {} +/// Request for UpgradeInstance. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations instances upgrade projects](struct.ProjectLocationInstanceUpgradeCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpgradeInstanceRequest { + /// Required. Specifies the target version of Redis software to upgrade to. + #[serde(rename="redisVersion")] + pub redis_version: Option, +} + +impl RequestValue for UpgradeInstanceRequest {} + + /// A generic empty message that you can re-use to avoid defining duplicated /// empty messages in your APIs. A typical example is to use it as the request /// or the response type of an API method. For instance: @@ -763,6 +793,7 @@ impl RequestValue for ImportInstanceRequest {} /// * [locations instances failover projects](struct.ProjectLocationInstanceFailoverCall.html) (response) /// * [locations instances patch projects](struct.ProjectLocationInstancePatchCall.html) (response) /// * [locations instances create projects](struct.ProjectLocationInstanceCreateCall.html) (response) +/// * [locations instances upgrade projects](struct.ProjectLocationInstanceUpgradeCall.html) (response) /// * [locations operations get projects](struct.ProjectLocationOperationGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -852,7 +883,7 @@ impl Part for GcsDestination {} /// ::default(), None); /// let mut hub = CloudRedis::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `locations_get(...)`, `locations_instances_create(...)`, `locations_instances_delete(...)`, `locations_instances_export(...)`, `locations_instances_failover(...)`, `locations_instances_get(...)`, `locations_instances_import(...)`, `locations_instances_list(...)`, `locations_instances_patch(...)`, `locations_list(...)`, `locations_operations_cancel(...)`, `locations_operations_delete(...)`, `locations_operations_get(...)` and `locations_operations_list(...)` +/// // like `locations_get(...)`, `locations_instances_create(...)`, `locations_instances_delete(...)`, `locations_instances_export(...)`, `locations_instances_failover(...)`, `locations_instances_get(...)`, `locations_instances_import(...)`, `locations_instances_list(...)`, `locations_instances_patch(...)`, `locations_instances_upgrade(...)`, `locations_list(...)`, `locations_operations_cancel(...)`, `locations_operations_delete(...)`, `locations_operations_get(...)` and `locations_operations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1036,8 +1067,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Note: Redis instances are managed and addressed at regional level so /// location_id here refers to a GCP region; however, users may choose which /// specific zone (or collection of zones for cross-zone instances) an instance - /// should be provisioned in. Refer to [location_id] and - /// [alternative_location_id] fields for more details. + /// should be provisioned in. Refer to location_id and + /// alternative_location_id fields for more details. pub fn locations_instances_patch(&self, request: Instance, name: &str) -> ProjectLocationInstancePatchCall<'a, C, A> { ProjectLocationInstancePatchCall { hub: self.hub, @@ -1103,6 +1134,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Upgrades Redis instance to the newer Redis version specified in the + /// request. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. Redis instance resource name using the form: + /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + /// where `location_id` refers to a GCP region. + pub fn locations_instances_upgrade(&self, request: UpgradeInstanceRequest, name: &str) -> ProjectLocationInstanceUpgradeCall<'a, C, A> { + ProjectLocationInstanceUpgradeCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the latest state of a long-running operation. Clients can use this @@ -1157,6 +1210,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// location (region) or all locations. /// /// The location should have the following format: + /// /// * `projects/{project_id}/locations/{location_id}` /// /// If `location_id` is specified as `-` (wildcard), then all regions @@ -3292,8 +3346,8 @@ impl<'a, C, A> ProjectLocationInstancePatchCall<'a, C, A> where C: BorrowMut ProjectLocationInstanceCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudRedis::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UpgradeInstanceRequest::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_instances_upgrade(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationInstanceUpgradeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRedis, + _request: UpgradeInstanceRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationInstanceUpgradeCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationInstanceUpgradeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "redis.projects.locations.instances.upgrade", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}:upgrade"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UpgradeInstanceRequest) -> ProjectLocationInstanceUpgradeCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Redis instance resource name using the form: + /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + /// where `location_id` refers to a GCP region. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationInstanceUpgradeCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationInstanceUpgradeCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationInstanceUpgradeCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationInstanceUpgradeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the latest state of a long-running operation. Clients can use this /// method to poll the operation result at intervals as recommended by the API /// service. @@ -4263,8 +4599,8 @@ impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut ProjectLocationOperationListCall<'a, C, A> where C: BorrowMut ProjectLocationOperationListCall<'a, C, A> where C: BorrowMut ProjectLocationInstanceListCall<'a, C, A> where C: BorrowMut ProjectLocationInstanceListCall<'a, C, A> { @@ -4735,7 +5072,7 @@ impl<'a, C, A> ProjectLocationInstanceListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Remote Build Execution (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/remotebuildexecution2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-remotebuildexecution2] path = "../remotebuildexecution2" -version = "1.0.12+20190702" +version = "1.0.13+20200408" diff --git a/gen/remotebuildexecution2-cli/README.md b/gen/remotebuildexecution2-cli/README.md index e13b86dc88..f7ecb4b3f4 100644 --- a/gen/remotebuildexecution2-cli/README.md +++ b/gen/remotebuildexecution2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Remote Build Execution* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *Remote Build Execution* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash remotebuildexecution2 [options] diff --git a/gen/remotebuildexecution2-cli/mkdocs.yml b/gen/remotebuildexecution2-cli/mkdocs.yml index 396ef20995..bf9bca4e81 100644 --- a/gen/remotebuildexecution2-cli/mkdocs.yml +++ b/gen/remotebuildexecution2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Remote Build Execution v1.0.12+20190702 +site_name: Remote Build Execution v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-remotebuildexecution2-cli site_description: A complete library to interact with Remote Build Execution (protocol v2) diff --git a/gen/remotebuildexecution2-cli/src/main.rs b/gen/remotebuildexecution2-cli/src/main.rs index b90e472331..22148d57a2 100644 --- a/gen/remotebuildexecution2-cli/src/main.rs +++ b/gen/remotebuildexecution2-cli/src/main.rs @@ -1229,6 +1229,9 @@ fn main() { Clients can use this API before uploading blobs to determine which ones are already present in the CAS and do not need to be uploaded again. + Servers SHOULD increase the TTLs of the referenced blobs if necessary and + applicable. + There are no method-specific errors."##), "Details at http://byron.github.io/google-apis-rs/google_remotebuildexecution2_cli/blobs_find-missing", vec![ @@ -1281,6 +1284,8 @@ fn main() { If part of the tree is missing from the CAS, the server will return the portion present and omit the rest. + Errors: + * `NOT_FOUND`: The requested tree root is not present in the CAS."##), "Details at http://byron.github.io/google-apis-rs/google_remotebuildexecution2_cli/blobs_get-tree", vec![ @@ -1398,7 +1403,7 @@ fn main() { let mut app = App::new("remotebuildexecution2") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200408") .about("Supplies a Remote Execution API service for tools such as bazel.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_remotebuildexecution2_cli") .arg(Arg::with_name("url") diff --git a/gen/remotebuildexecution2/Cargo.toml b/gen/remotebuildexecution2/Cargo.toml index 2d8d00c6ff..da2c41c3a6 100644 --- a/gen/remotebuildexecution2/Cargo.toml +++ b/gen/remotebuildexecution2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-remotebuildexecution2" -version = "1.0.12+20190702" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Remote Build Execution (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/remotebuildexecution2" homepage = "https://cloud.google.com/remote-build-execution/docs/" -documentation = "https://docs.rs/google-remotebuildexecution2/1.0.12+20190702" +documentation = "https://docs.rs/google-remotebuildexecution2/1.0.13+20200408" license = "MIT" keywords = ["remotebuildexecution", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/remotebuildexecution2/README.md b/gen/remotebuildexecution2/README.md index e5fad28d4c..32ec0b96cf 100644 --- a/gen/remotebuildexecution2/README.md +++ b/gen/remotebuildexecution2/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-remotebuildexecution2` library allows access to all features of the *Google Remote Build Execution* service. -This documentation was generated from *Remote Build Execution* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *remotebuildexecution:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Remote Build Execution* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *remotebuildexecution:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Remote Build Execution* *v2* API can be found at the [official documentation site](https://cloud.google.com/remote-build-execution/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.RemoteBuildExecution.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.RemoteBuildExecution.html) ... * action results - * [*get*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.ActionResultGetCall.html) and [*update*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.ActionResultUpdateCall.html) + * [*get*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.ActionResultGetCall.html) and [*update*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.ActionResultUpdateCall.html) * actions - * [*execute*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.ActionExecuteCall.html) + * [*execute*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.ActionExecuteCall.html) * blobs - * [*batch read*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.BlobBatchReadCall.html), [*batch update*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.BlobBatchUpdateCall.html), [*find missing*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.BlobFindMissingCall.html) and [*get tree*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.BlobGetTreeCall.html) + * [*batch read*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.BlobBatchReadCall.html), [*batch update*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.BlobBatchUpdateCall.html), [*find missing*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.BlobFindMissingCall.html) and [*get tree*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.BlobGetTreeCall.html) * operations - * [*wait execution*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.OperationWaitExecutionCall.html) + * [*wait execution*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.OperationWaitExecutionCall.html) Other activities are ... -* [get capabilities](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.MethodGetCapabilityCall.html) +* [get capabilities](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.MethodGetCapabilityCall.html) @@ -32,17 +32,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/struct.RemoteBuildExecution.html)** +* **[Hub](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/struct.RemoteBuildExecution.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.Part.html)** + * **[Parts](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-remotebuildexecution2/1.0.12+20190702/google_remotebuildexecution2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-remotebuildexecution2/1.0.13+20200408/google_remotebuildexecution2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/remotebuildexecution2/src/lib.rs b/gen/remotebuildexecution2/src/lib.rs index 7dbe6b7900..9fcb123c1d 100644 --- a/gen/remotebuildexecution2/src/lib.rs +++ b/gen/remotebuildexecution2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Remote Build Execution* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *remotebuildexecution:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Remote Build Execution* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *remotebuildexecution:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Remote Build Execution* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/remote-build-execution/docs/). @@ -333,7 +333,7 @@ impl<'a, C, A> RemoteBuildExecution RemoteBuildExecution { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://remotebuildexecution.googleapis.com/".to_string(), _root_url: "https://remotebuildexecution.googleapis.com/".to_string(), } @@ -356,7 +356,7 @@ impl<'a, C, A> RemoteBuildExecution } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -407,8 +407,6 @@ impl Part for BuildBazelRemoteExecutionV2PriorityCapabilitiesPriorityRange {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BuildBazelRemoteExecutionV2SymlinkNode { - /// The name of the symlink. - pub name: Option, /// The target path of the symlink. The path separator is a forward slash `/`. /// The target path can be relative to the parent directory of the symlink or /// it can be an absolute path starting with `/`. Support for absolute paths @@ -416,6 +414,11 @@ pub struct BuildBazelRemoteExecutionV2SymlinkNode { /// API. The canonical form forbids the substrings `/./` and `//` in the target /// path. `..` components are allowed anywhere in the target path. pub target: Option, + /// The node properties of the SymlinkNode. + #[serde(rename="nodeProperties")] + pub node_properties: Option>, + /// The name of the symlink. + pub name: Option, } impl Part for BuildBazelRemoteExecutionV2SymlinkNode {} @@ -444,6 +447,9 @@ impl Part for BuildBazelRemoteExecutionV2SymlinkNode {} /// * The files, directories and symlinks in the directory must each be sorted /// in lexicographical order by path. The path strings must be sorted by code /// point, equivalently, by UTF-8 bytes. +/// * The NodeProperties of files, +/// directories, and symlinks must be sorted in lexicographical order by +/// property name. /// /// A `Directory` that obeys the restrictions is said to be in canonical form. /// @@ -460,7 +466,13 @@ impl Part for BuildBazelRemoteExecutionV2SymlinkNode {} /// digest: { /// hash: "4a73bc9d03...", /// size: 65534 -/// } +/// }, +/// node_properties: [ +/// { +/// "name": "MTime", +/// "value": "2017-01-15T01:30:15.01Z" +/// } +/// ] /// } /// ], /// directories: [ @@ -498,6 +510,9 @@ pub struct BuildBazelRemoteExecutionV2Directory { pub symlinks: Option>, /// The subdirectories in the directory. pub directories: Option>, + /// The node properties of the Directory. + #[serde(rename="nodeProperties")] + pub node_properties: Option>, } impl Part for BuildBazelRemoteExecutionV2Directory {} @@ -582,22 +597,6 @@ pub struct BuildBazelRemoteExecutionV2PriorityCapabilities { impl Part for BuildBazelRemoteExecutionV2PriorityCapabilities {} -/// A request message for -/// WaitExecution. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [wait execution operations](struct.OperationWaitExecutionCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BuildBazelRemoteExecutionV2WaitExecutionRequest { _never_set: Option } - -impl RequestValue for BuildBazelRemoteExecutionV2WaitExecutionRequest {} - - /// A request corresponding to a single blob that the client wants to upload. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -633,16 +632,20 @@ pub struct BuildBazelRemoteExecutionV2ActionResult { /// may be links to other output files, or input files, or even absolute paths /// outside of the working directory, if the server supports /// SymlinkAbsolutePathStrategy.ALLOWED. - /// For each output file requested in the `output_files` field of the Action, - /// if the corresponding file existed after + /// For each output file requested in the `output_files` or `output_paths` + /// field of the Action, if the corresponding file existed after /// the action completed, a single entry will be present either in this field, /// or in the `output_files` field, if the file was not a symbolic link. /// - /// If an output symbolic link of the same name was found, but its target - /// type was not a regular file, the server will return a FAILED_PRECONDITION. + /// If an output symbolic link of the same name as listed in `output_files` of + /// the Command was found, but its target type was not a regular file, the + /// server will return a FAILED_PRECONDITION. /// If the action does not produce the requested output, then that output /// will be omitted from the list. The server is free to arrange the output /// list as desired; clients MUST NOT assume that the output list is sorted. + /// + /// DEPRECATED as of v2.1. Servers that wish to be compatible with v2.0 API + /// should still populate this field in addition to `output_symlinks`. #[serde(rename="outputFileSymlinks")] pub output_file_symlinks: Option>, /// The digest for a blob containing the standard error of the action, which @@ -669,13 +672,29 @@ pub struct BuildBazelRemoteExecutionV2ActionResult { /// ContentAddressableStorage. #[serde(rename="stdoutDigest")] pub stdout_digest: Option, - /// The output files of the action. For each output file requested in the - /// `output_files` field of the Action, if the corresponding file existed after - /// the action completed, a single entry will be present either in this field, - /// or the `output_file_symlinks` field if the file was a symbolic link to - /// another file. + /// New in v2.1: this field will only be populated if the command + /// `output_paths` field was used, and not the pre v2.1 `output_files` or + /// `output_directories` fields. + /// The output paths of the action that are symbolic links to other paths. Those + /// may be links to other outputs, or inputs, or even absolute paths + /// outside of the working directory, if the server supports + /// SymlinkAbsolutePathStrategy.ALLOWED. + /// A single entry for each output requested in `output_paths` + /// field of the Action, if the corresponding path existed after + /// the action completed and was a symbolic link. /// - /// If an output of the same name was found, but was a directory rather + /// If the action does not produce a requested output, then that output + /// will be omitted from the list. The server is free to arrange the output + /// list as desired; clients MUST NOT assume that the output list is sorted. + #[serde(rename="outputSymlinks")] + pub output_symlinks: Option>, + /// The output files of the action. For each output file requested in the + /// `output_files` or `output_paths` field of the Action, if the corresponding + /// file existed after the action completed, a single entry will be present + /// either in this field, or the `output_file_symlinks` field if the file was + /// a symbolic link to another file (`output_symlinks` field after v2.1). + /// + /// If an output listed in `output_files` was found, but was a directory rather /// than a regular file, the server will return a FAILED_PRECONDITION. /// If the action does not produce the requested output, then that output /// will be omitted from the list. The server is free to arrange the output @@ -697,12 +716,15 @@ pub struct BuildBazelRemoteExecutionV2ActionResult { /// If the action does not produce the requested output, then that output /// will be omitted from the list. The server is free to arrange the output /// list as desired; clients MUST NOT assume that the output list is sorted. + /// + /// DEPRECATED as of v2.1. Servers that wish to be compatible with v2.0 API + /// should still populate this field in addition to `output_symlinks`. #[serde(rename="outputDirectorySymlinks")] pub output_directory_symlinks: Option>, /// The output directories of the action. For each output directory requested - /// in the `output_directories` field of the Action, if the corresponding - /// directory existed after the action completed, a single entry will be - /// present in the output list, which will contain the digest of a + /// in the `output_directories` or `output_paths` field of the Action, if the + /// corresponding directory existed after the action completed, a single entry + /// will be present in the output list, which will contain the digest of a /// Tree message containing the /// directory tree, and the path equal exactly to the corresponding Action /// output_directories member. @@ -759,7 +781,8 @@ pub struct BuildBazelRemoteExecutionV2ActionResult { /// } /// ```` /// - /// If an output of the same name was found, but was not a directory, the + /// If an output of the same name as listed in `output_files` of + /// the Command was found in `output_directories`, but was not a directory, the /// server will return a FAILED_PRECONDITION. #[serde(rename="outputDirectories")] pub output_directories: Option>, @@ -823,26 +846,6 @@ pub struct BuildBazelRemoteExecutionV2BatchReadBlobsResponse { impl ResponseResult for BuildBazelRemoteExecutionV2BatchReadBlobsResponse {} -/// A `DirectoryNode` represents a child of a -/// Directory which is itself -/// a `Directory` and its associated metadata. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BuildBazelRemoteExecutionV2DirectoryNode { - /// The name of the directory. - pub name: Option, - /// The digest of the - /// Directory object - /// represented. See Digest - /// for information about how to take the digest of a proto message. - pub digest: Option, -} - -impl Part for BuildBazelRemoteExecutionV2DirectoryNode {} - - /// An `OutputDirectory` is the output in an `ActionResult` corresponding to a /// directory's full contents rather than a single file. /// @@ -924,6 +927,21 @@ pub struct BuildBazelRemoteExecutionV2ActionCacheUpdateCapabilities { impl Part for BuildBazelRemoteExecutionV2ActionCacheUpdateCapabilities {} +/// A response corresponding to a single blob that the client tried to upload. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BuildBazelRemoteExecutionV2BatchUpdateBlobsResponseResponse { + /// The result of attempting to upload that blob. + pub status: Option, + /// The blob digest to which this response corresponds. + pub digest: Option, +} + +impl Part for BuildBazelRemoteExecutionV2BatchUpdateBlobsResponseResponse {} + + /// Capabilities of the remote cache system. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -954,6 +972,25 @@ pub struct BuildBazelRemoteExecutionV2CacheCapabilities { impl Part for BuildBazelRemoteExecutionV2CacheCapabilities {} +/// A single property for FileNodes, +/// DirectoryNodes, and +/// SymlinkNodes. The server is +/// responsible for specifying the property `name`s that it accepts. If +/// permitted by the server, the same `name` may occur multiple times. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BuildBazelRemoteExecutionV2NodeProperty { + /// The property name. + pub name: Option, + /// The property value. + pub value: Option, +} + +impl Part for BuildBazelRemoteExecutionV2NodeProperty {} + + /// The full version of a given tool. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -995,21 +1032,24 @@ pub struct BuildBazelRemoteExecutionV2FindMissingBlobsRequest { impl RequestValue for BuildBazelRemoteExecutionV2FindMissingBlobsRequest {} -/// A response corresponding to a single blob that the client tried to download. +/// A `DirectoryNode` represents a child of a +/// Directory which is itself +/// a `Directory` and its associated metadata. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BuildBazelRemoteExecutionV2BatchReadBlobsResponseResponse { - /// The result of attempting to download that blob. - pub status: Option, - /// The raw binary data. - pub data: Option, - /// The digest to which this response corresponds. +pub struct BuildBazelRemoteExecutionV2DirectoryNode { + /// The name of the directory. + pub name: Option, + /// The digest of the + /// Directory object + /// represented. See Digest + /// for information about how to take the digest of a proto message. pub digest: Option, } -impl Part for BuildBazelRemoteExecutionV2BatchReadBlobsResponseResponse {} +impl Part for BuildBazelRemoteExecutionV2DirectoryNode {} /// An `OutputSymlink` is similar to a @@ -1026,6 +1066,10 @@ pub struct BuildBazelRemoteExecutionV2OutputSymlink { /// filename. The path separator is a forward slash `/`. Since this is a /// relative path, it MUST NOT begin with a leading forward slash. pub path: Option, + /// The supported node properties of the OutputSymlink, if requested by the + /// Action. + #[serde(rename="nodeProperties")] + pub node_properties: Option>, /// The target path of the symlink. The path separator is a forward slash `/`. /// The target path can be relative to the parent directory of the symlink or /// it can be an absolute path starting with `/`. Support for absolute paths @@ -1038,19 +1082,39 @@ pub struct BuildBazelRemoteExecutionV2OutputSymlink { impl Part for BuildBazelRemoteExecutionV2OutputSymlink {} -/// A response corresponding to a single blob that the client tried to upload. +/// A response message for +/// ContentAddressableStorage.BatchUpdateBlobs. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch update blobs](struct.BlobBatchUpdateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BuildBazelRemoteExecutionV2BatchUpdateBlobsResponseResponse { - /// The result of attempting to upload that blob. - pub status: Option, - /// The blob digest to which this response corresponds. - pub digest: Option, +pub struct BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse { + /// The responses to the requests. + pub responses: Option>, } -impl Part for BuildBazelRemoteExecutionV2BatchUpdateBlobsResponseResponse {} +impl ResponseResult for BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse {} + + +/// A request message for +/// WaitExecution. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [wait execution operations](struct.OperationWaitExecutionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BuildBazelRemoteExecutionV2WaitExecutionRequest { _never_set: Option } + +impl RequestValue for BuildBazelRemoteExecutionV2WaitExecutionRequest {} /// The `Status` type defines a logical error model that is suitable for @@ -1092,6 +1156,9 @@ pub struct BuildBazelRemoteExecutionV2FileNode { pub name: Option, /// The digest of the file's content. pub digest: Option, + /// The node properties of the FileNode. + #[serde(rename="nodeProperties")] + pub node_properties: Option>, } impl Part for BuildBazelRemoteExecutionV2FileNode {} @@ -1121,33 +1188,33 @@ pub struct BuildBazelRemoteExecutionV2OutputFile { pub contents: Option, /// The digest of the file's content. pub digest: Option, + /// The supported node properties of the OutputFile, if requested by the Action. + #[serde(rename="nodeProperties")] + pub node_properties: Option>, } impl Part for BuildBazelRemoteExecutionV2OutputFile {} -/// A response message for -/// ContentAddressableStorage.BatchUpdateBlobs. +/// A response corresponding to a single blob that the client tried to download. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [batch update blobs](struct.BlobBatchUpdateCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse { - /// The responses to the requests. - pub responses: Option>, +pub struct BuildBazelRemoteExecutionV2BatchReadBlobsResponseResponse { + /// The result of attempting to download that blob. + pub status: Option, + /// The raw binary data. + pub data: Option, + /// The digest to which this response corresponds. + pub digest: Option, } -impl ResponseResult for BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse {} +impl Part for BuildBazelRemoteExecutionV2BatchReadBlobsResponseResponse {} /// A content digest. A digest for a given blob consists of the size of the blob -/// and its hash. The hash algorithm to use is defined by the server, but servers -/// SHOULD use SHA-256. +/// and its hash. The hash algorithm to use is defined by the server. /// /// The size is considered to be an integral part of the digest and cannot be /// separated. That is, even if the `hash` field is correctly specified but @@ -1263,6 +1330,9 @@ pub struct BuildBazelRemoteExecutionV2ExecutionCapabilities { /// Supported execution priority range. #[serde(rename="executionPriorityCapabilities")] pub execution_priority_capabilities: Option, + /// Supported node properties. + #[serde(rename="supportedNodeProperties")] + pub supported_node_properties: Option>, /// Whether remote execution is enabled for the particular server/instance. #[serde(rename="execEnabled")] pub exec_enabled: Option, @@ -1600,6 +1670,9 @@ impl<'a, C, A> BlobMethods<'a, C, A> { /// Clients can use this API before uploading blobs to determine which ones are /// already present in the CAS and do not need to be uploaded again. /// + /// Servers SHOULD increase the TTLs of the referenced blobs if necessary and + /// applicable. + /// /// There are no method-specific errors. /// /// # Arguments @@ -1731,6 +1804,8 @@ impl<'a, C, A> BlobMethods<'a, C, A> { /// If part of the tree is missing from the CAS, the server will return the /// portion present and omit the rest. /// + /// Errors: + /// /// * `NOT_FOUND`: The requested tree root is not present in the CAS. /// /// # Arguments @@ -2926,6 +3001,9 @@ impl<'a, C, A> ActionResultUpdateCall<'a, C, A> where C: BorrowMut BlobBatchReadCall<'a, C, A> where C: BorrowMut, A: /// If part of the tree is missing from the CAS, the server will return the /// portion present and omit the rest. /// +/// Errors: +/// /// * `NOT_FOUND`: The requested tree root is not present in the CAS. /// /// A builder for the *getTree* method supported by a *blob* resource. @@ -4063,7 +4143,8 @@ impl<'a, C, A> BlobGetTreeCall<'a, C, A> where C: BorrowMut, A: o } /// A page token, which must be a value received in a previous /// GetTreeResponse. - /// If present, the server will use it to return the following page of results. + /// If present, the server will use that token as an offset, returning only + /// that page and the ones that succeed it. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> BlobGetTreeCall<'a, C, A> { diff --git a/gen/replicapool1_beta2-cli/Cargo.toml b/gen/replicapool1_beta2-cli/Cargo.toml index 5b719a0928..6ecd3fb2e1 100644 --- a/gen/replicapool1_beta2-cli/Cargo.toml +++ b/gen/replicapool1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapool1_beta2-cli" -version = "1.0.12+20160512" +version = "1.0.13+20160512" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapool (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-replicapool1_beta2] path = "../replicapool1_beta2" -version = "1.0.12+20160512" +version = "1.0.13+20160512" diff --git a/gen/replicapool1_beta2-cli/README.md b/gen/replicapool1_beta2-cli/README.md index 83e87441e8..30cc1b6f6d 100644 --- a/gen/replicapool1_beta2-cli/README.md +++ b/gen/replicapool1_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *replicapool* API at revision *20160512*. The CLI is at version *1.0.12*. +This documentation was generated from the *replicapool* API at revision *20160512*. The CLI is at version *1.0.13*. ```bash replicapool1-beta2 [options] diff --git a/gen/replicapool1_beta2-cli/mkdocs.yml b/gen/replicapool1_beta2-cli/mkdocs.yml index c7d7af0ed3..0e156bad2d 100644 --- a/gen/replicapool1_beta2-cli/mkdocs.yml +++ b/gen/replicapool1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: replicapool v1.0.12+20160512 +site_name: replicapool v1.0.13+20160512 site_url: http://byron.github.io/google-apis-rs/google-replicapool1_beta2-cli site_description: A complete library to interact with replicapool (protocol v1beta2) diff --git a/gen/replicapool1_beta2-cli/src/main.rs b/gen/replicapool1_beta2-cli/src/main.rs index c4ca4e7efa..f5e4ee1bdb 100644 --- a/gen/replicapool1_beta2-cli/src/main.rs +++ b/gen/replicapool1_beta2-cli/src/main.rs @@ -1490,7 +1490,7 @@ fn main() { let mut app = App::new("replicapool1-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20160512") + .version("1.0.13+20160512") .about("[Deprecated. Please use Instance Group Manager in Compute API] Provides groups of homogenous Compute Engine instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_replicapool1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/replicapool1_beta2/Cargo.toml b/gen/replicapool1_beta2/Cargo.toml index ed0127e177..a6147b9c7f 100644 --- a/gen/replicapool1_beta2/Cargo.toml +++ b/gen/replicapool1_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-replicapool1_beta2" -version = "1.0.12+20160512" +version = "1.0.13+20160512" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapool (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapool1_beta2" homepage = "https://developers.google.com/compute/docs/instance-groups/manager/v1beta2" -documentation = "https://docs.rs/google-replicapool1_beta2/1.0.12+20160512" +documentation = "https://docs.rs/google-replicapool1_beta2/1.0.13+20160512" license = "MIT" keywords = ["replicapool", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/replicapool1_beta2/README.md b/gen/replicapool1_beta2/README.md index ceef834fd1..31f817f7b0 100644 --- a/gen/replicapool1_beta2/README.md +++ b/gen/replicapool1_beta2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-replicapool1_beta2` library allows access to all features of the *Google replicapool* service. -This documentation was generated from *replicapool* crate version *1.0.12+20160512*, where *20160512* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *replicapool* crate version *1.0.13+20160512*, where *20160512* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *replicapool* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.Replicapool.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.Replicapool.html) ... -* [instance group managers](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManager.html) - * [*abandon instances*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerAbandonInstanceCall.html), [*delete*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerGetCall.html), [*insert*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerInsertCall.html), [*list*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerListCall.html), [*recreate instances*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerResizeCall.html), [*set instance template*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerSetTargetPoolCall.html) +* [instance group managers](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManager.html) + * [*abandon instances*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerAbandonInstanceCall.html), [*delete*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerDeleteCall.html), [*delete instances*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerDeleteInstanceCall.html), [*get*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerGetCall.html), [*insert*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerInsertCall.html), [*list*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerListCall.html), [*recreate instances*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerRecreateInstanceCall.html), [*resize*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerResizeCall.html), [*set instance template*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerSetInstanceTemplateCall.html) and [*set target pools*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.InstanceGroupManagerSetTargetPoolCall.html) * zone operations - * [*get*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.ZoneOperationListCall.html) + * [*get*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.ZoneOperationListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/struct.Replicapool.html)** +* **[Hub](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/struct.Replicapool.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -158,29 +158,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-replicapool1_beta2/1.0.12+20160512/google_replicapool1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-replicapool1_beta2/1.0.13+20160512/google_replicapool1_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/replicapool1_beta2/src/lib.rs b/gen/replicapool1_beta2/src/lib.rs index c269cef0b9..c7ec4159fb 100644 --- a/gen/replicapool1_beta2/src/lib.rs +++ b/gen/replicapool1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *replicapool* crate version *1.0.12+20160512*, where *20160512* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *replicapool* crate version *1.0.13+20160512*, where *20160512* is the exact revision of the *replicapool:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *replicapool* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/docs/instance-groups/manager/v1beta2). @@ -346,7 +346,7 @@ impl<'a, C, A> Replicapool Replicapool { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/replicapool/v1beta2/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -360,7 +360,7 @@ impl<'a, C, A> Replicapool } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/replicapoolupdater1_beta1-cli/Cargo.toml b/gen/replicapoolupdater1_beta1-cli/Cargo.toml index f408fe9ce5..f834e0b130 100644 --- a/gen/replicapoolupdater1_beta1-cli/Cargo.toml +++ b/gen/replicapoolupdater1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-replicapoolupdater1_beta1-cli" -version = "1.0.12+20161003" +version = "1.0.13+20161003" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapoolupdater (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapoolupdater1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-replicapoolupdater1_beta1] path = "../replicapoolupdater1_beta1" -version = "1.0.12+20161003" +version = "1.0.13+20161003" diff --git a/gen/replicapoolupdater1_beta1-cli/README.md b/gen/replicapoolupdater1_beta1-cli/README.md index d4ebff6db5..e366962568 100644 --- a/gen/replicapoolupdater1_beta1-cli/README.md +++ b/gen/replicapoolupdater1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *replicapoolupdater* API at revision *20161003*. The CLI is at version *1.0.12*. +This documentation was generated from the *replicapoolupdater* API at revision *20161003*. The CLI is at version *1.0.13*. ```bash replicapoolupdater1-beta1 [options] diff --git a/gen/replicapoolupdater1_beta1-cli/mkdocs.yml b/gen/replicapoolupdater1_beta1-cli/mkdocs.yml index d69bae142e..8d12776a92 100644 --- a/gen/replicapoolupdater1_beta1-cli/mkdocs.yml +++ b/gen/replicapoolupdater1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: replicapoolupdater v1.0.12+20161003 +site_name: replicapoolupdater v1.0.13+20161003 site_url: http://byron.github.io/google-apis-rs/google-replicapoolupdater1_beta1-cli site_description: A complete library to interact with replicapoolupdater (protocol v1beta1) diff --git a/gen/replicapoolupdater1_beta1-cli/src/main.rs b/gen/replicapoolupdater1_beta1-cli/src/main.rs index c44f7ed83f..23efeab972 100644 --- a/gen/replicapoolupdater1_beta1-cli/src/main.rs +++ b/gen/replicapoolupdater1_beta1-cli/src/main.rs @@ -1118,7 +1118,7 @@ fn main() { let mut app = App::new("replicapoolupdater1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20161003") + .version("1.0.13+20161003") .about("[Deprecated. Please use compute.instanceGroupManagers.update method. replicapoolupdater API will be disabled after December 30th, 2016] Updates groups of Compute Engine instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_replicapoolupdater1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/replicapoolupdater1_beta1/Cargo.toml b/gen/replicapoolupdater1_beta1/Cargo.toml index dbf1c7806a..fa667dcaab 100644 --- a/gen/replicapoolupdater1_beta1/Cargo.toml +++ b/gen/replicapoolupdater1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-replicapoolupdater1_beta1" -version = "1.0.12+20161003" +version = "1.0.13+20161003" authors = ["Sebastian Thiel "] description = "A complete library to interact with replicapoolupdater (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/replicapoolupdater1_beta1" homepage = "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service" -documentation = "https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003" +documentation = "https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003" license = "MIT" keywords = ["replicapoolupdater", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/replicapoolupdater1_beta1/README.md b/gen/replicapoolupdater1_beta1/README.md index 4add7a616c..864b145b92 100644 --- a/gen/replicapoolupdater1_beta1/README.md +++ b/gen/replicapoolupdater1_beta1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-replicapoolupdater1_beta1` library allows access to all features of the *Google replicapoolupdater* service. -This documentation was generated from *replicapoolupdater* crate version *1.0.12+20161003*, where *20161003* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *replicapoolupdater* crate version *1.0.13+20161003*, where *20161003* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *replicapoolupdater* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.Replicapoolupdater.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.Replicapoolupdater.html) ... -* [rolling updates](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdate.html) - * [*cancel*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateCancelCall.html), [*get*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateGetCall.html), [*insert*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateInsertCall.html), [*list*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateListCall.html), [*list instance updates*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateListInstanceUpdateCall.html), [*pause*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdatePauseCall.html), [*resume*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateResumeCall.html) and [*rollback*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateRollbackCall.html) +* [rolling updates](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdate.html) + * [*cancel*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateCancelCall.html), [*get*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateGetCall.html), [*insert*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateInsertCall.html), [*list*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateListCall.html), [*list instance updates*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateListInstanceUpdateCall.html), [*pause*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdatePauseCall.html), [*resume*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateResumeCall.html) and [*rollback*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.RollingUpdateRollbackCall.html) * zone operations - * [*get*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.ZoneOperationListCall.html) + * [*get*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.ZoneOperationListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/struct.Replicapoolupdater.html)** +* **[Hub](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/struct.Replicapoolupdater.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-replicapoolupdater1_beta1/1.0.12+20161003/google_replicapoolupdater1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-replicapoolupdater1_beta1/1.0.13+20161003/google_replicapoolupdater1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/replicapoolupdater1_beta1/src/lib.rs b/gen/replicapoolupdater1_beta1/src/lib.rs index 10e39cf25b..6be3c1da0c 100644 --- a/gen/replicapoolupdater1_beta1/src/lib.rs +++ b/gen/replicapoolupdater1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *replicapoolupdater* crate version *1.0.12+20161003*, where *20161003* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *replicapoolupdater* crate version *1.0.13+20161003*, where *20161003* is the exact revision of the *replicapoolupdater:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *replicapoolupdater* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service). @@ -344,7 +344,7 @@ impl<'a, C, A> Replicapoolupdater Replicapoolupdater { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -358,7 +358,7 @@ impl<'a, C, A> Replicapoolupdater } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/reseller1_sandbox-cli/Cargo.toml b/gen/reseller1_sandbox-cli/Cargo.toml index 135a924993..930871ba9e 100644 --- a/gen/reseller1_sandbox-cli/Cargo.toml +++ b/gen/reseller1_sandbox-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-reseller1_sandbox-cli" -version = "1.0.12+20160329" +version = "1.0.13+20160329" authors = ["Sebastian Thiel "] description = "A complete library to interact with reseller (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-reseller1_sandbox] path = "../reseller1_sandbox" -version = "1.0.12+20160329" +version = "1.0.13+20160329" diff --git a/gen/reseller1_sandbox-cli/README.md b/gen/reseller1_sandbox-cli/README.md index 23787ff559..3eaa56bbb5 100644 --- a/gen/reseller1_sandbox-cli/README.md +++ b/gen/reseller1_sandbox-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *reseller* API at revision *20160329*. The CLI is at version *1.0.12*. +This documentation was generated from the *reseller* API at revision *20160329*. The CLI is at version *1.0.13*. ```bash reseller1-sandbox [options] diff --git a/gen/reseller1_sandbox-cli/mkdocs.yml b/gen/reseller1_sandbox-cli/mkdocs.yml index c307c39627..9ceccf7ade 100644 --- a/gen/reseller1_sandbox-cli/mkdocs.yml +++ b/gen/reseller1_sandbox-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reseller v1.0.12+20160329 +site_name: reseller v1.0.13+20160329 site_url: http://byron.github.io/google-apis-rs/google-reseller1_sandbox-cli site_description: A complete library to interact with reseller (protocol v1sandbox) diff --git a/gen/reseller1_sandbox-cli/src/main.rs b/gen/reseller1_sandbox-cli/src/main.rs index 5668a6b6d2..f990162b9c 100644 --- a/gen/reseller1_sandbox-cli/src/main.rs +++ b/gen/reseller1_sandbox-cli/src/main.rs @@ -1646,7 +1646,7 @@ fn main() { let mut app = App::new("reseller1-sandbox") .author("Sebastian Thiel ") - .version("1.0.12+20160329") + .version("1.0.13+20160329") .about("Creates and manages your customers and their subscriptions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_reseller1_sandbox_cli") .arg(Arg::with_name("url") diff --git a/gen/reseller1_sandbox/Cargo.toml b/gen/reseller1_sandbox/Cargo.toml index 94b2821d05..959dcd1040 100644 --- a/gen/reseller1_sandbox/Cargo.toml +++ b/gen/reseller1_sandbox/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-reseller1_sandbox" -version = "1.0.12+20160329" +version = "1.0.13+20160329" authors = ["Sebastian Thiel "] description = "A complete library to interact with reseller (protocol v1sandbox)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/reseller1_sandbox" homepage = "https://developers.google.com/google-apps/reseller/" -documentation = "https://docs.rs/google-reseller1_sandbox/1.0.12+20160329" +documentation = "https://docs.rs/google-reseller1_sandbox/1.0.13+20160329" license = "MIT" keywords = ["reseller", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/reseller1_sandbox/README.md b/gen/reseller1_sandbox/README.md index 46da64774a..d291461c6d 100644 --- a/gen/reseller1_sandbox/README.md +++ b/gen/reseller1_sandbox/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-reseller1_sandbox` library allows access to all features of the *Google reseller* service. -This documentation was generated from *reseller* crate version *1.0.12+20160329*, where *20160329* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *reseller* crate version *1.0.13+20160329*, where *20160329* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *reseller* *v1_sandbox* API can be found at the [official documentation site](https://developers.google.com/google-apps/reseller/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.Reseller.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.Reseller.html) ... -* [customers](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.Customer.html) - * [*get*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.CustomerGetCall.html), [*insert*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.CustomerInsertCall.html), [*patch*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.CustomerUpdateCall.html) -* [subscriptions](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.Subscription.html) - * [*activate*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionActivateCall.html), [*change plan*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionChangePlanCall.html), [*change renewal settings*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionChangeRenewalSettingCall.html), [*change seats*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionChangeSeatCall.html), [*delete*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionDeleteCall.html), [*get*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionGetCall.html), [*insert*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionInsertCall.html), [*list*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionListCall.html), [*start paid service*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionStartPaidServiceCall.html) and [*suspend*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.SubscriptionSuspendCall.html) +* [customers](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.Customer.html) + * [*get*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.CustomerGetCall.html), [*insert*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.CustomerInsertCall.html), [*patch*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.CustomerUpdateCall.html) +* [subscriptions](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.Subscription.html) + * [*activate*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionActivateCall.html), [*change plan*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionChangePlanCall.html), [*change renewal settings*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionChangeRenewalSettingCall.html), [*change seats*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionChangeSeatCall.html), [*delete*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionDeleteCall.html), [*get*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionGetCall.html), [*insert*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionInsertCall.html), [*list*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionListCall.html), [*start paid service*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionStartPaidServiceCall.html) and [*suspend*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.SubscriptionSuspendCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/struct.Reseller.html)** +* **[Hub](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/struct.Reseller.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.Part.html)** + * **[Parts](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -140,17 +140,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -160,29 +160,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.RequestValue.html) and -[decodable](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.RequestValue.html) and +[decodable](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-reseller1_sandbox/1.0.12+20160329/google_reseller1_sandbox/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-reseller1_sandbox/1.0.13+20160329/google_reseller1_sandbox/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/reseller1_sandbox/src/lib.rs b/gen/reseller1_sandbox/src/lib.rs index 9b33c447d9..8fb9b24882 100644 --- a/gen/reseller1_sandbox/src/lib.rs +++ b/gen/reseller1_sandbox/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *reseller* crate version *1.0.12+20160329*, where *20160329* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *reseller* crate version *1.0.13+20160329*, where *20160329* is the exact revision of the *reseller:v1sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *reseller* *v1_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/reseller/). @@ -342,7 +342,7 @@ impl<'a, C, A> Reseller Reseller { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/apps/reseller/v1sandbox/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -356,7 +356,7 @@ impl<'a, C, A> Reseller } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/resourceviews1_beta2-cli/Cargo.toml b/gen/resourceviews1_beta2-cli/Cargo.toml index db1a9105e7..ddfdd6d4ac 100644 --- a/gen/resourceviews1_beta2-cli/Cargo.toml +++ b/gen/resourceviews1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-resourceviews1_beta2-cli" -version = "1.0.12+20160512" +version = "1.0.13+20160512" authors = ["Sebastian Thiel "] description = "A complete library to interact with resourceviews (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-resourceviews1_beta2] path = "../resourceviews1_beta2" -version = "1.0.12+20160512" +version = "1.0.13+20160512" diff --git a/gen/resourceviews1_beta2-cli/README.md b/gen/resourceviews1_beta2-cli/README.md index fb77bcff49..dd061b923f 100644 --- a/gen/resourceviews1_beta2-cli/README.md +++ b/gen/resourceviews1_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *resourceviews* API at revision *20160512*. The CLI is at version *1.0.12*. +This documentation was generated from the *resourceviews* API at revision *20160512*. The CLI is at version *1.0.13*. ```bash resourceviews1-beta2 [options] diff --git a/gen/resourceviews1_beta2-cli/mkdocs.yml b/gen/resourceviews1_beta2-cli/mkdocs.yml index 9c88e5b826..ac38d21bd9 100644 --- a/gen/resourceviews1_beta2-cli/mkdocs.yml +++ b/gen/resourceviews1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: resourceviews v1.0.12+20160512 +site_name: resourceviews v1.0.13+20160512 site_url: http://byron.github.io/google-apis-rs/google-resourceviews1_beta2-cli site_description: A complete library to interact with resourceviews (protocol v1beta2) diff --git a/gen/resourceviews1_beta2-cli/src/main.rs b/gen/resourceviews1_beta2-cli/src/main.rs index 123a7a3821..487fab81e2 100644 --- a/gen/resourceviews1_beta2-cli/src/main.rs +++ b/gen/resourceviews1_beta2-cli/src/main.rs @@ -1323,7 +1323,7 @@ fn main() { let mut app = App::new("resourceviews1-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20160512") + .version("1.0.13+20160512") .about("The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_resourceviews1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/resourceviews1_beta2/Cargo.toml b/gen/resourceviews1_beta2/Cargo.toml index 4187684835..5a8fa83db2 100644 --- a/gen/resourceviews1_beta2/Cargo.toml +++ b/gen/resourceviews1_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-resourceviews1_beta2" -version = "1.0.12+20160512" +version = "1.0.13+20160512" authors = ["Sebastian Thiel "] description = "A complete library to interact with resourceviews (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/resourceviews1_beta2" homepage = "https://developers.google.com/compute/" -documentation = "https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512" +documentation = "https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512" license = "MIT" keywords = ["resourceviews", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/resourceviews1_beta2/README.md b/gen/resourceviews1_beta2/README.md index 42b09469d9..a4f29fb10f 100644 --- a/gen/resourceviews1_beta2/README.md +++ b/gen/resourceviews1_beta2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-resourceviews1_beta2` library allows access to all features of the *Google resourceviews* service. -This documentation was generated from *resourceviews* crate version *1.0.12+20160512*, where *20160512* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *resourceviews* crate version *1.0.13+20160512*, where *20160512* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *resourceviews* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/compute/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.Resourceviews.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.Resourceviews.html) ... * zone operations - * [*get*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneOperationListCall.html) + * [*get*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneOperationGetCall.html) and [*list*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneOperationListCall.html) * zone views - * [*add resources*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewAddResourceCall.html), [*delete*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewDeleteCall.html), [*get*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewGetCall.html), [*get service*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewGetServiceCall.html), [*insert*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewInsertCall.html), [*list*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewListCall.html), [*list resources*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewListResourceCall.html), [*remove resources*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewRemoveResourceCall.html) and [*set service*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.ZoneViewSetServiceCall.html) + * [*add resources*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewAddResourceCall.html), [*delete*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewDeleteCall.html), [*get*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewGetCall.html), [*get service*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewGetServiceCall.html), [*insert*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewInsertCall.html), [*list*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewListCall.html), [*list resources*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewListResourceCall.html), [*remove resources*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewRemoveResourceCall.html) and [*set service*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.ZoneViewSetServiceCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/struct.Resourceviews.html)** +* **[Hub](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/struct.Resourceviews.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -137,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -157,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-resourceviews1_beta2/1.0.12+20160512/google_resourceviews1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-resourceviews1_beta2/1.0.13+20160512/google_resourceviews1_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/resourceviews1_beta2/src/lib.rs b/gen/resourceviews1_beta2/src/lib.rs index 4b385c21ee..c67ccc7762 100644 --- a/gen/resourceviews1_beta2/src/lib.rs +++ b/gen/resourceviews1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *resourceviews* crate version *1.0.12+20160512*, where *20160512* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *resourceviews* crate version *1.0.13+20160512*, where *20160512* is the exact revision of the *resourceviews:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *resourceviews* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/compute/). @@ -356,7 +356,7 @@ impl<'a, C, A> Resourceviews Resourceviews { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/resourceviews/v1beta2/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -370,7 +370,7 @@ impl<'a, C, A> Resourceviews } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/run1-cli/Cargo.toml b/gen/run1-cli/Cargo.toml index a1382512ad..1b353bed40 100644 --- a/gen/run1-cli/Cargo.toml +++ b/gen/run1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-run1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Run (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/run1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-run1] path = "../run1" -version = "1.0.12+20190624" +version = "1.0.13+20200407" diff --git a/gen/run1-cli/README.md b/gen/run1-cli/README.md index d722364c4f..9236036d86 100644 --- a/gen/run1-cli/README.md +++ b/gen/run1-cli/README.md @@ -25,12 +25,61 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Run* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Run* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash run1 [options] + api + v1-namespaces-get [-p ]... [-o ] + v1-namespaces-patch (-r )... [-p ]... [-o ] + v1-namespaces-secrets-create (-r )... [-p ]... [-o ] + v1-namespaces-secrets-get [-p ]... [-o ] + v1-namespaces-secrets-replace-secret (-r )... [-p ]... [-o ] + namespaces + authorizeddomains-list [-p ]... [-o ] + configurations-get [-p ]... [-o ] + configurations-list [-p ]... [-o ] + domainmappings-create (-r )... [-p ]... [-o ] + domainmappings-delete [-p ]... [-o ] + domainmappings-get [-p ]... [-o ] + domainmappings-list [-p ]... [-o ] + revisions-delete [-p ]... [-o ] + revisions-get [-p ]... [-o ] + revisions-list [-p ]... [-o ] + routes-get [-p ]... [-o ] + routes-list [-p ]... [-o ] + services-create (-r )... [-p ]... [-o ] + services-delete [-p ]... [-o ] + services-get [-p ]... [-o ] + services-list [-p ]... [-o ] + services-replace-service (-r )... [-p ]... [-o ] projects - locations-get [-p ]... [-o ] + locations-authorizeddomains-list [-p ]... [-o ] + locations-configurations-get [-p ]... [-o ] + locations-configurations-list [-p ]... [-o ] + locations-domainmappings-create (-r )... [-p ]... [-o ] + locations-domainmappings-delete [-p ]... [-o ] + locations-domainmappings-get [-p ]... [-o ] + locations-domainmappings-list [-p ]... [-o ] + locations-list [-p ]... [-o ] + locations-namespaces-get [-p ]... [-o ] + locations-namespaces-patch (-r )... [-p ]... [-o ] + locations-revisions-delete [-p ]... [-o ] + locations-revisions-get [-p ]... [-o ] + locations-revisions-list [-p ]... [-o ] + locations-routes-get [-p ]... [-o ] + locations-routes-list [-p ]... [-o ] + locations-secrets-create (-r )... [-p ]... [-o ] + locations-secrets-get [-p ]... [-o ] + locations-secrets-replace-secret (-r )... [-p ]... [-o ] + locations-services-create (-r )... [-p ]... [-o ] + locations-services-delete [-p ]... [-o ] + locations-services-get [-p ]... [-o ] + locations-services-get-iam-policy [-p ]... [-o ] + locations-services-list [-p ]... [-o ] + locations-services-replace-service (-r )... [-p ]... [-o ] + locations-services-set-iam-policy (-r )... [-p ]... [-o ] + locations-services-test-iam-permissions (-r )... [-p ]... [-o ] run1 --help Configuration: diff --git a/gen/run1-cli/mkdocs.yml b/gen/run1-cli/mkdocs.yml index d30d6dc08e..e4d831e2a5 100644 --- a/gen/run1-cli/mkdocs.yml +++ b/gen/run1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Run v1.0.12+20190624 +site_name: Cloud Run v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-run1-cli site_description: A complete library to interact with Cloud Run (protocol v1) @@ -9,7 +9,54 @@ site_dir: build_html pages: - ['index.md', 'Home'] -- ['projects_locations-get.md', 'Projects', 'Locations Get'] +- ['api_v1-namespaces-get.md', 'Api', 'V1 Namespaces Get'] +- ['api_v1-namespaces-patch.md', 'Api', 'V1 Namespaces Patch'] +- ['api_v1-namespaces-secrets-create.md', 'Api', 'V1 Namespaces Secrets Create'] +- ['api_v1-namespaces-secrets-get.md', 'Api', 'V1 Namespaces Secrets Get'] +- ['api_v1-namespaces-secrets-replace-secret.md', 'Api', 'V1 Namespaces Secrets Replace Secret'] +- ['namespaces_authorizeddomains-list.md', 'Namespaces', 'Authorizeddomains List'] +- ['namespaces_configurations-get.md', 'Namespaces', 'Configurations Get'] +- ['namespaces_configurations-list.md', 'Namespaces', 'Configurations List'] +- ['namespaces_domainmappings-create.md', 'Namespaces', 'Domainmappings Create'] +- ['namespaces_domainmappings-delete.md', 'Namespaces', 'Domainmappings Delete'] +- ['namespaces_domainmappings-get.md', 'Namespaces', 'Domainmappings Get'] +- ['namespaces_domainmappings-list.md', 'Namespaces', 'Domainmappings List'] +- ['namespaces_revisions-delete.md', 'Namespaces', 'Revisions Delete'] +- ['namespaces_revisions-get.md', 'Namespaces', 'Revisions Get'] +- ['namespaces_revisions-list.md', 'Namespaces', 'Revisions List'] +- ['namespaces_routes-get.md', 'Namespaces', 'Routes Get'] +- ['namespaces_routes-list.md', 'Namespaces', 'Routes List'] +- ['namespaces_services-create.md', 'Namespaces', 'Services Create'] +- ['namespaces_services-delete.md', 'Namespaces', 'Services Delete'] +- ['namespaces_services-get.md', 'Namespaces', 'Services Get'] +- ['namespaces_services-list.md', 'Namespaces', 'Services List'] +- ['namespaces_services-replace-service.md', 'Namespaces', 'Services Replace Service'] +- ['projects_locations-authorizeddomains-list.md', 'Projects', 'Locations Authorizeddomains List'] +- ['projects_locations-configurations-get.md', 'Projects', 'Locations Configurations Get'] +- ['projects_locations-configurations-list.md', 'Projects', 'Locations Configurations List'] +- ['projects_locations-domainmappings-create.md', 'Projects', 'Locations Domainmappings Create'] +- ['projects_locations-domainmappings-delete.md', 'Projects', 'Locations Domainmappings Delete'] +- ['projects_locations-domainmappings-get.md', 'Projects', 'Locations Domainmappings Get'] +- ['projects_locations-domainmappings-list.md', 'Projects', 'Locations Domainmappings List'] +- ['projects_locations-list.md', 'Projects', 'Locations List'] +- ['projects_locations-namespaces-get.md', 'Projects', 'Locations Namespaces Get'] +- ['projects_locations-namespaces-patch.md', 'Projects', 'Locations Namespaces Patch'] +- ['projects_locations-revisions-delete.md', 'Projects', 'Locations Revisions Delete'] +- ['projects_locations-revisions-get.md', 'Projects', 'Locations Revisions Get'] +- ['projects_locations-revisions-list.md', 'Projects', 'Locations Revisions List'] +- ['projects_locations-routes-get.md', 'Projects', 'Locations Routes Get'] +- ['projects_locations-routes-list.md', 'Projects', 'Locations Routes List'] +- ['projects_locations-secrets-create.md', 'Projects', 'Locations Secrets Create'] +- ['projects_locations-secrets-get.md', 'Projects', 'Locations Secrets Get'] +- ['projects_locations-secrets-replace-secret.md', 'Projects', 'Locations Secrets Replace Secret'] +- ['projects_locations-services-create.md', 'Projects', 'Locations Services Create'] +- ['projects_locations-services-delete.md', 'Projects', 'Locations Services Delete'] +- ['projects_locations-services-get.md', 'Projects', 'Locations Services Get'] +- ['projects_locations-services-get-iam-policy.md', 'Projects', 'Locations Services Get Iam Policy'] +- ['projects_locations-services-list.md', 'Projects', 'Locations Services List'] +- ['projects_locations-services-replace-service.md', 'Projects', 'Locations Services Replace Service'] +- ['projects_locations-services-set-iam-policy.md', 'Projects', 'Locations Services Set Iam Policy'] +- ['projects_locations-services-test-iam-permissions.md', 'Projects', 'Locations Services Test Iam Permissions'] theme: readthedocs diff --git a/gen/run1-cli/src/main.rs b/gen/run1-cli/src/main.rs index 77852963fc..cd3932bd0b 100644 --- a/gen/run1-cli/src/main.rs +++ b/gen/run1-cli/src/main.rs @@ -46,9 +46,3515 @@ struct Engine<'n> { impl<'n> Engine<'n> { - fn _projects_locations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + fn _api_v1_namespaces_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.projects().locations_get(opt.value_of("name").unwrap_or("")); + let mut call = self.hub.api().v1_namespaces_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _api_v1_namespaces_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.phase" => Some(("status.phase", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.finalizers" => Some(("spec.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "cluster-name", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "labels", "metadata", "name", "namespace", "phase", "resource-version", "self-link", "spec", "status", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Namespace = json::value::from_value(object).unwrap(); + let mut call = self.hub.api().v1_namespaces_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _api_v1_namespaces_secrets_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "string-data" => Some(("stringData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "cluster-name", "creation-timestamp", "data", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "labels", "metadata", "name", "namespace", "resource-version", "self-link", "string-data", "type", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Secret = json::value::from_value(object).unwrap(); + let mut call = self.hub.api().v1_namespaces_secrets_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _api_v1_namespaces_secrets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.api().v1_namespaces_secrets_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _api_v1_namespaces_secrets_replace_secret(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "string-data" => Some(("stringData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "cluster-name", "creation-timestamp", "data", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "labels", "metadata", "name", "namespace", "resource-version", "self-link", "string-data", "type", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Secret = json::value::from_value(object).unwrap(); + let mut call = self.hub.api().v1_namespaces_secrets_replace_secret(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_authorizeddomains_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().authorizeddomains_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_configurations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().configurations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_configurations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().configurations_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_domainmappings_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.observed-generation" => Some(("status.observedGeneration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status.mapped-route-name" => Some(("status.mappedRouteName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.route-name" => Some(("spec.routeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.force-override" => Some(("spec.forceOverride", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spec.certificate-mode" => Some(("spec.certificateMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "api-version", "certificate-mode", "cluster-name", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "force-override", "generate-name", "generation", "kind", "labels", "mapped-route-name", "metadata", "name", "namespace", "observed-generation", "resource-version", "route-name", "self-link", "spec", "status", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DomainMapping = json::value::from_value(object).unwrap(); + let mut call = self.hub.namespaces().domainmappings_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_domainmappings_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().domainmappings_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "propagation-policy" => { + call = call.propagation_policy(value.unwrap_or("")); + }, + "kind" => { + call = call.kind(value.unwrap_or("")); + }, + "api-version" => { + call = call.api_version(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["propagation-policy", "kind", "api-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_domainmappings_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().domainmappings_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_domainmappings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().domainmappings_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_revisions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().revisions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "propagation-policy" => { + call = call.propagation_policy(value.unwrap_or("")); + }, + "kind" => { + call = call.kind(value.unwrap_or("")); + }, + "api-version" => { + call = call.api_version(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["propagation-policy", "kind", "api-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_revisions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().revisions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_revisions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().revisions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_routes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().routes_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_routes_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().routes_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_services_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.observed-generation" => Some(("status.observedGeneration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status.url" => Some(("status.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.address.url" => Some(("status.address.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-created-revision-name" => Some(("status.latestCreatedRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-ready-revision-name" => Some(("status.latestReadyRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.spec.timeout-seconds" => Some(("spec.template.spec.timeoutSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.container-concurrency" => Some(("spec.template.spec.containerConcurrency", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.service-account-name" => Some(("spec.template.spec.serviceAccountName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.name" => Some(("spec.template.metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-timestamp" => Some(("spec.template.metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.cluster-name" => Some(("spec.template.metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-grace-period-seconds" => Some(("spec.template.metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.labels" => Some(("spec.template.metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.namespace" => Some(("spec.template.metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generation" => Some(("spec.template.metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.finalizers" => Some(("spec.template.metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.template.metadata.resource-version" => Some(("spec.template.metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generate-name" => Some(("spec.template.metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.creation-timestamp" => Some(("spec.template.metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.annotations" => Some(("spec.template.metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.self-link" => Some(("spec.template.metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.uid" => Some(("spec.template.metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "annotations", "api-version", "cluster-name", "container-concurrency", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "kind", "labels", "latest-created-revision-name", "latest-ready-revision-name", "metadata", "name", "namespace", "observed-generation", "resource-version", "self-link", "service-account-name", "spec", "status", "template", "timeout-seconds", "uid", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Service = json::value::from_value(object).unwrap(); + let mut call = self.hub.namespaces().services_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_services_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().services_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "propagation-policy" => { + call = call.propagation_policy(value.unwrap_or("")); + }, + "kind" => { + call = call.kind(value.unwrap_or("")); + }, + "api-version" => { + call = call.api_version(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["propagation-policy", "kind", "api-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_services_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().services_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_services_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.namespaces().services_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _namespaces_services_replace_service(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.observed-generation" => Some(("status.observedGeneration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status.url" => Some(("status.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.address.url" => Some(("status.address.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-created-revision-name" => Some(("status.latestCreatedRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-ready-revision-name" => Some(("status.latestReadyRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.spec.timeout-seconds" => Some(("spec.template.spec.timeoutSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.container-concurrency" => Some(("spec.template.spec.containerConcurrency", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.service-account-name" => Some(("spec.template.spec.serviceAccountName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.name" => Some(("spec.template.metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-timestamp" => Some(("spec.template.metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.cluster-name" => Some(("spec.template.metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-grace-period-seconds" => Some(("spec.template.metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.labels" => Some(("spec.template.metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.namespace" => Some(("spec.template.metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generation" => Some(("spec.template.metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.finalizers" => Some(("spec.template.metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.template.metadata.resource-version" => Some(("spec.template.metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generate-name" => Some(("spec.template.metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.creation-timestamp" => Some(("spec.template.metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.annotations" => Some(("spec.template.metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.self-link" => Some(("spec.template.metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.uid" => Some(("spec.template.metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "annotations", "api-version", "cluster-name", "container-concurrency", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "kind", "labels", "latest-created-revision-name", "latest-ready-revision-name", "metadata", "name", "namespace", "observed-generation", "resource-version", "self-link", "service-account-name", "spec", "status", "template", "timeout-seconds", "uid", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Service = json::value::from_value(object).unwrap(); + let mut call = self.hub.namespaces().services_replace_service(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_authorizeddomains_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_authorizeddomains_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_configurations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_configurations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_configurations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_configurations_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_domainmappings_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.observed-generation" => Some(("status.observedGeneration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status.mapped-route-name" => Some(("status.mappedRouteName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.route-name" => Some(("spec.routeName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.force-override" => Some(("spec.forceOverride", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spec.certificate-mode" => Some(("spec.certificateMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "api-version", "certificate-mode", "cluster-name", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "force-override", "generate-name", "generation", "kind", "labels", "mapped-route-name", "metadata", "name", "namespace", "observed-generation", "resource-version", "route-name", "self-link", "spec", "status", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DomainMapping = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_domainmappings_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_domainmappings_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_domainmappings_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "propagation-policy" => { + call = call.propagation_policy(value.unwrap_or("")); + }, + "kind" => { + call = call.kind(value.unwrap_or("")); + }, + "api-version" => { + call = call.api_version(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["propagation-policy", "kind", "api-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_domainmappings_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_domainmappings_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_domainmappings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_domainmappings_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_namespaces_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_namespaces_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_namespaces_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.phase" => Some(("status.phase", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.finalizers" => Some(("spec.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "cluster-name", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "labels", "metadata", "name", "namespace", "phase", "resource-version", "self-link", "spec", "status", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Namespace = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_namespaces_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_revisions_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_revisions_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "propagation-policy" => { + call = call.propagation_policy(value.unwrap_or("")); + }, + "kind" => { + call = call.kind(value.unwrap_or("")); + }, + "api-version" => { + call = call.api_version(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["propagation-policy", "kind", "api-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_revisions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_revisions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_revisions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_revisions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_routes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_routes_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_routes_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_routes_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_secrets_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "string-data" => Some(("stringData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "cluster-name", "creation-timestamp", "data", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "labels", "metadata", "name", "namespace", "resource-version", "self-link", "string-data", "type", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Secret = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_secrets_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_secrets_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_secrets_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_secrets_replace_secret(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "string-data" => Some(("stringData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "data" => Some(("data", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["annotations", "cluster-name", "creation-timestamp", "data", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "labels", "metadata", "name", "namespace", "resource-version", "self-link", "string-data", "type", "uid"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Secret = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_secrets_replace_secret(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.observed-generation" => Some(("status.observedGeneration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status.url" => Some(("status.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.address.url" => Some(("status.address.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-created-revision-name" => Some(("status.latestCreatedRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-ready-revision-name" => Some(("status.latestReadyRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.spec.timeout-seconds" => Some(("spec.template.spec.timeoutSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.container-concurrency" => Some(("spec.template.spec.containerConcurrency", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.service-account-name" => Some(("spec.template.spec.serviceAccountName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.name" => Some(("spec.template.metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-timestamp" => Some(("spec.template.metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.cluster-name" => Some(("spec.template.metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-grace-period-seconds" => Some(("spec.template.metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.labels" => Some(("spec.template.metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.namespace" => Some(("spec.template.metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generation" => Some(("spec.template.metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.finalizers" => Some(("spec.template.metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.template.metadata.resource-version" => Some(("spec.template.metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generate-name" => Some(("spec.template.metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.creation-timestamp" => Some(("spec.template.metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.annotations" => Some(("spec.template.metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.self-link" => Some(("spec.template.metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.uid" => Some(("spec.template.metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "annotations", "api-version", "cluster-name", "container-concurrency", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "kind", "labels", "latest-created-revision-name", "latest-ready-revision-name", "metadata", "name", "namespace", "observed-generation", "resource-version", "self-link", "service-account-name", "spec", "status", "template", "timeout-seconds", "uid", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Service = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_services_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_services_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "propagation-policy" => { + call = call.propagation_policy(value.unwrap_or("")); + }, + "kind" => { + call = call.kind(value.unwrap_or("")); + }, + "api-version" => { + call = call.api_version(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["propagation-policy", "kind", "api-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_services_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_services_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_services_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "watch" => { + call = call.watch(arg_from_str(value.unwrap_or("false"), err, "watch", "boolean")); + }, + "resource-version" => { + call = call.resource_version(value.unwrap_or("")); + }, + "limit" => { + call = call.limit(arg_from_str(value.unwrap_or("-0"), err, "limit", "integer")); + }, + "label-selector" => { + call = call.label_selector(value.unwrap_or("")); + }, + "include-uninitialized" => { + call = call.include_uninitialized(arg_from_str(value.unwrap_or("false"), err, "include-uninitialized", "boolean")); + }, + "field-selector" => { + call = call.field_selector(value.unwrap_or("")); + }, + "continue" => { + call = call.continue_(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["label-selector", "watch", "include-uninitialized", "continue", "limit", "resource-version", "field-selector"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_replace_service(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "status.observed-generation" => Some(("status.observedGeneration", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "status.url" => Some(("status.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.address.url" => Some(("status.address.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-created-revision-name" => Some(("status.latestCreatedRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.latest-ready-revision-name" => Some(("status.latestReadyRevisionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.spec.timeout-seconds" => Some(("spec.template.spec.timeoutSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.container-concurrency" => Some(("spec.template.spec.containerConcurrency", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.spec.service-account-name" => Some(("spec.template.spec.serviceAccountName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.name" => Some(("spec.template.metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-timestamp" => Some(("spec.template.metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.cluster-name" => Some(("spec.template.metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.deletion-grace-period-seconds" => Some(("spec.template.metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.labels" => Some(("spec.template.metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.namespace" => Some(("spec.template.metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generation" => Some(("spec.template.metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "spec.template.metadata.finalizers" => Some(("spec.template.metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spec.template.metadata.resource-version" => Some(("spec.template.metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.generate-name" => Some(("spec.template.metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.creation-timestamp" => Some(("spec.template.metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.annotations" => Some(("spec.template.metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spec.template.metadata.self-link" => Some(("spec.template.metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spec.template.metadata.uid" => Some(("spec.template.metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-version" => Some(("apiVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.name" => Some(("metadata.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-timestamp" => Some(("metadata.deletionTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.cluster-name" => Some(("metadata.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.deletion-grace-period-seconds" => Some(("metadata.deletionGracePeriodSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.labels" => Some(("metadata.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.namespace" => Some(("metadata.namespace", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generation" => Some(("metadata.generation", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "metadata.finalizers" => Some(("metadata.finalizers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "metadata.resource-version" => Some(("metadata.resourceVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.generate-name" => Some(("metadata.generateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.creation-timestamp" => Some(("metadata.creationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.annotations" => Some(("metadata.annotations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "metadata.self-link" => Some(("metadata.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "metadata.uid" => Some(("metadata.uid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "annotations", "api-version", "cluster-name", "container-concurrency", "creation-timestamp", "deletion-grace-period-seconds", "deletion-timestamp", "finalizers", "generate-name", "generation", "kind", "labels", "latest-created-revision-name", "latest-ready-revision-name", "metadata", "name", "namespace", "observed-generation", "resource-version", "self-link", "service-account-name", "spec", "status", "template", "timeout-seconds", "uid", "url"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Service = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_services_replace_service(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_services_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_services_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_services_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { @@ -103,10 +3609,167 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("api", Some(opt)) => { + match opt.subcommand() { + ("v1-namespaces-get", Some(opt)) => { + call_result = self._api_v1_namespaces_get(opt, dry_run, &mut err); + }, + ("v1-namespaces-patch", Some(opt)) => { + call_result = self._api_v1_namespaces_patch(opt, dry_run, &mut err); + }, + ("v1-namespaces-secrets-create", Some(opt)) => { + call_result = self._api_v1_namespaces_secrets_create(opt, dry_run, &mut err); + }, + ("v1-namespaces-secrets-get", Some(opt)) => { + call_result = self._api_v1_namespaces_secrets_get(opt, dry_run, &mut err); + }, + ("v1-namespaces-secrets-replace-secret", Some(opt)) => { + call_result = self._api_v1_namespaces_secrets_replace_secret(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("api".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("namespaces", Some(opt)) => { + match opt.subcommand() { + ("authorizeddomains-list", Some(opt)) => { + call_result = self._namespaces_authorizeddomains_list(opt, dry_run, &mut err); + }, + ("configurations-get", Some(opt)) => { + call_result = self._namespaces_configurations_get(opt, dry_run, &mut err); + }, + ("configurations-list", Some(opt)) => { + call_result = self._namespaces_configurations_list(opt, dry_run, &mut err); + }, + ("domainmappings-create", Some(opt)) => { + call_result = self._namespaces_domainmappings_create(opt, dry_run, &mut err); + }, + ("domainmappings-delete", Some(opt)) => { + call_result = self._namespaces_domainmappings_delete(opt, dry_run, &mut err); + }, + ("domainmappings-get", Some(opt)) => { + call_result = self._namespaces_domainmappings_get(opt, dry_run, &mut err); + }, + ("domainmappings-list", Some(opt)) => { + call_result = self._namespaces_domainmappings_list(opt, dry_run, &mut err); + }, + ("revisions-delete", Some(opt)) => { + call_result = self._namespaces_revisions_delete(opt, dry_run, &mut err); + }, + ("revisions-get", Some(opt)) => { + call_result = self._namespaces_revisions_get(opt, dry_run, &mut err); + }, + ("revisions-list", Some(opt)) => { + call_result = self._namespaces_revisions_list(opt, dry_run, &mut err); + }, + ("routes-get", Some(opt)) => { + call_result = self._namespaces_routes_get(opt, dry_run, &mut err); + }, + ("routes-list", Some(opt)) => { + call_result = self._namespaces_routes_list(opt, dry_run, &mut err); + }, + ("services-create", Some(opt)) => { + call_result = self._namespaces_services_create(opt, dry_run, &mut err); + }, + ("services-delete", Some(opt)) => { + call_result = self._namespaces_services_delete(opt, dry_run, &mut err); + }, + ("services-get", Some(opt)) => { + call_result = self._namespaces_services_get(opt, dry_run, &mut err); + }, + ("services-list", Some(opt)) => { + call_result = self._namespaces_services_list(opt, dry_run, &mut err); + }, + ("services-replace-service", Some(opt)) => { + call_result = self._namespaces_services_replace_service(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("namespaces".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("projects", Some(opt)) => { match opt.subcommand() { - ("locations-get", Some(opt)) => { - call_result = self._projects_locations_get(opt, dry_run, &mut err); + ("locations-authorizeddomains-list", Some(opt)) => { + call_result = self._projects_locations_authorizeddomains_list(opt, dry_run, &mut err); + }, + ("locations-configurations-get", Some(opt)) => { + call_result = self._projects_locations_configurations_get(opt, dry_run, &mut err); + }, + ("locations-configurations-list", Some(opt)) => { + call_result = self._projects_locations_configurations_list(opt, dry_run, &mut err); + }, + ("locations-domainmappings-create", Some(opt)) => { + call_result = self._projects_locations_domainmappings_create(opt, dry_run, &mut err); + }, + ("locations-domainmappings-delete", Some(opt)) => { + call_result = self._projects_locations_domainmappings_delete(opt, dry_run, &mut err); + }, + ("locations-domainmappings-get", Some(opt)) => { + call_result = self._projects_locations_domainmappings_get(opt, dry_run, &mut err); + }, + ("locations-domainmappings-list", Some(opt)) => { + call_result = self._projects_locations_domainmappings_list(opt, dry_run, &mut err); + }, + ("locations-list", Some(opt)) => { + call_result = self._projects_locations_list(opt, dry_run, &mut err); + }, + ("locations-namespaces-get", Some(opt)) => { + call_result = self._projects_locations_namespaces_get(opt, dry_run, &mut err); + }, + ("locations-namespaces-patch", Some(opt)) => { + call_result = self._projects_locations_namespaces_patch(opt, dry_run, &mut err); + }, + ("locations-revisions-delete", Some(opt)) => { + call_result = self._projects_locations_revisions_delete(opt, dry_run, &mut err); + }, + ("locations-revisions-get", Some(opt)) => { + call_result = self._projects_locations_revisions_get(opt, dry_run, &mut err); + }, + ("locations-revisions-list", Some(opt)) => { + call_result = self._projects_locations_revisions_list(opt, dry_run, &mut err); + }, + ("locations-routes-get", Some(opt)) => { + call_result = self._projects_locations_routes_get(opt, dry_run, &mut err); + }, + ("locations-routes-list", Some(opt)) => { + call_result = self._projects_locations_routes_list(opt, dry_run, &mut err); + }, + ("locations-secrets-create", Some(opt)) => { + call_result = self._projects_locations_secrets_create(opt, dry_run, &mut err); + }, + ("locations-secrets-get", Some(opt)) => { + call_result = self._projects_locations_secrets_get(opt, dry_run, &mut err); + }, + ("locations-secrets-replace-secret", Some(opt)) => { + call_result = self._projects_locations_secrets_replace_secret(opt, dry_run, &mut err); + }, + ("locations-services-create", Some(opt)) => { + call_result = self._projects_locations_services_create(opt, dry_run, &mut err); + }, + ("locations-services-delete", Some(opt)) => { + call_result = self._projects_locations_services_delete(opt, dry_run, &mut err); + }, + ("locations-services-get", Some(opt)) => { + call_result = self._projects_locations_services_get(opt, dry_run, &mut err); + }, + ("locations-services-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_services_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-services-list", Some(opt)) => { + call_result = self._projects_locations_services_list(opt, dry_run, &mut err); + }, + ("locations-services-replace-service", Some(opt)) => { + call_result = self._projects_locations_services_replace_service(opt, dry_run, &mut err); + }, + ("locations-services-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_services_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-services-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_services_test_iam_permissions(opt, dry_run, &mut err); }, _ => { err.issues.push(CLIError::MissingMethodError("projects".to_string())); @@ -199,14 +3862,15 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'locations-get'", vec![ - ("locations-get", - Some(r##"Gets information about a location."##), - "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-get", + ("api", "methods: 'v1-namespaces-get', 'v1-namespaces-patch', 'v1-namespaces-secrets-create', 'v1-namespaces-secrets-get' and 'v1-namespaces-secrets-replace-secret'", vec![ + ("v1-namespaces-get", + Some(r##"Rpc to get information about a namespace."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/api_v1-namespaces-get", vec![ (Some(r##"name"##), None, - Some(r##"Resource name for the location."##), + Some(r##"Required. The name of the namespace being retrieved. If needed, replace + {namespace_id} with the project ID."##), Some(true), Some(false)), @@ -216,6 +3880,1242 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("v1-namespaces-patch", + Some(r##"Rpc to update a namespace."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/api_v1-namespaces-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the namespace being retrieved. If needed, replace + {namespace_id} with the project ID."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("v1-namespaces-secrets-create", + Some(r##"Creates a new secret."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/api_v1-namespaces-secrets-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project ID or project number in which this secret should + be created."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("v1-namespaces-secrets-get", + Some(r##"Rpc to get information about a secret."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/api_v1-namespaces-secrets-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the secret being retrieved. If needed, replace + {namespace_id} with the project ID."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("v1-namespaces-secrets-replace-secret", + Some(r##"Rpc to replace a secret. + + Only the spec and metadata labels and annotations are modifiable. After + the Update request, Cloud Run will work to make the 'status' + match the requested 'spec'. + + May provide metadata.resourceVersion to enforce update from last read for + optimistic concurrency control."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/api_v1-namespaces-secrets-replace-secret", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the secret being retrieved. If needed, replace + {namespace_id} with the project ID."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("namespaces", "methods: 'authorizeddomains-list', 'configurations-get', 'configurations-list', 'domainmappings-create', 'domainmappings-delete', 'domainmappings-get', 'domainmappings-list', 'revisions-delete', 'revisions-get', 'revisions-list', 'routes-get', 'routes-list', 'services-create', 'services-delete', 'services-get', 'services-list' and 'services-replace-service'", vec![ + ("authorizeddomains-list", + Some(r##"List authorized domains."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_authorizeddomains-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Name of the parent Application resource. Example: `apps/myapp`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("configurations-get", + Some(r##"Get information about a configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_configurations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the configuration to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("configurations-list", + Some(r##"List configurations."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_configurations-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the configurations should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("domainmappings-create", + Some(r##"Create a new domain mapping."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_domainmappings-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace in which the domain mapping should be created. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("domainmappings-delete", + Some(r##"Delete a domain mapping."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_domainmappings-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the domain mapping to delete. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("domainmappings-get", + Some(r##"Get information about a domain mapping."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_domainmappings-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the domain mapping to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("domainmappings-list", + Some(r##"List domain mappings."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_domainmappings-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the domain mappings should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("revisions-delete", + Some(r##"Delete a revision."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_revisions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the revision to delete. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("revisions-get", + Some(r##"Get information about a revision."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_revisions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the revision to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("revisions-list", + Some(r##"List revisions."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_revisions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the revisions should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("routes-get", + Some(r##"Get information about a route."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_routes-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the route to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("routes-list", + Some(r##"List routes."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_routes-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the routes should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("services-create", + Some(r##"Create a service."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_services-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace in which the service should be created. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("services-delete", + Some(r##"Delete a service. + This will cause the Service to stop serving traffic and will delete the + child entities like Routes, Configurations and Revisions."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_services-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the service to delete. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("services-get", + Some(r##"Get information about a service."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_services-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the service to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("services-list", + Some(r##"List services."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_services-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the services should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("services-replace-service", + Some(r##"Replace a service. + + Only the spec and metadata labels and annotations are modifiable. After + the Update request, Cloud Run will work to make the 'status' + match the requested 'spec'. + + May provide metadata.resourceVersion to enforce update from last read for + optimistic concurrency control."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/namespaces_services-replace-service", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the service being replaced. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("projects", "methods: 'locations-authorizeddomains-list', 'locations-configurations-get', 'locations-configurations-list', 'locations-domainmappings-create', 'locations-domainmappings-delete', 'locations-domainmappings-get', 'locations-domainmappings-list', 'locations-list', 'locations-namespaces-get', 'locations-namespaces-patch', 'locations-revisions-delete', 'locations-revisions-get', 'locations-revisions-list', 'locations-routes-get', 'locations-routes-list', 'locations-secrets-create', 'locations-secrets-get', 'locations-secrets-replace-secret', 'locations-services-create', 'locations-services-delete', 'locations-services-get', 'locations-services-get-iam-policy', 'locations-services-list', 'locations-services-replace-service', 'locations-services-set-iam-policy' and 'locations-services-test-iam-permissions'", vec![ + ("locations-authorizeddomains-list", + Some(r##"List authorized domains."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-authorizeddomains-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Name of the parent Application resource. Example: `apps/myapp`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-configurations-get", + Some(r##"Get information about a configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-configurations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the configuration to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-configurations-list", + Some(r##"List configurations."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-configurations-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the configurations should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-domainmappings-create", + Some(r##"Create a new domain mapping."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-domainmappings-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace in which the domain mapping should be created. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-domainmappings-delete", + Some(r##"Delete a domain mapping."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-domainmappings-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the domain mapping to delete. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-domainmappings-get", + Some(r##"Get information about a domain mapping."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-domainmappings-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the domain mapping to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-domainmappings-list", + Some(r##"List domain mappings."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-domainmappings-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the domain mappings should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-list", + Some(r##"Lists information about the supported locations for this service."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource that owns the locations collection, if applicable."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-namespaces-get", + Some(r##"Rpc to get information about a namespace."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-namespaces-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the namespace being retrieved. If needed, replace + {namespace_id} with the project ID."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-namespaces-patch", + Some(r##"Rpc to update a namespace."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-namespaces-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the namespace being retrieved. If needed, replace + {namespace_id} with the project ID."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-revisions-delete", + Some(r##"Delete a revision."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-revisions-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the revision to delete. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-revisions-get", + Some(r##"Get information about a revision."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-revisions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the revision to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-revisions-list", + Some(r##"List revisions."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-revisions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the revisions should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-routes-get", + Some(r##"Get information about a route."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-routes-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the route to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-routes-list", + Some(r##"List routes."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-routes-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the routes should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-secrets-create", + Some(r##"Creates a new secret."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-secrets-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project ID or project number in which this secret should + be created."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-secrets-get", + Some(r##"Rpc to get information about a secret."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-secrets-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the secret being retrieved. If needed, replace + {namespace_id} with the project ID."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-secrets-replace-secret", + Some(r##"Rpc to replace a secret. + + Only the spec and metadata labels and annotations are modifiable. After + the Update request, Cloud Run will work to make the 'status' + match the requested 'spec'. + + May provide metadata.resourceVersion to enforce update from last read for + optimistic concurrency control."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-secrets-replace-secret", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The name of the secret being retrieved. If needed, replace + {namespace_id} with the project ID."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-create", + Some(r##"Create a service."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace in which the service should be created. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-delete", + Some(r##"Delete a service. + This will cause the Service to stop serving traffic and will delete the + child entities like Routes, Configurations and Revisions."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the service to delete. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-get", + Some(r##"Get information about a service."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the service to retrieve. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-get-iam-policy", + Some(r##"Get the IAM Access Control policy currently in effect for the given + Cloud Run service. This result does not include any inherited policies."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-list", + Some(r##"List services."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"The namespace from which the services should be listed. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-replace-service", + Some(r##"Replace a service. + + Only the spec and metadata labels and annotations are modifiable. After + the Update request, Cloud Run will work to make the 'status' + match the requested 'spec'. + + May provide metadata.resourceVersion to enforce update from last read for + optimistic concurrency control."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-replace-service", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the service being replaced. + For Cloud Run (fully managed), replace {namespace_id} with the project ID + or number."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-set-iam-policy", + Some(r##"Sets the IAM Access control policy for the specified Service. Overwrites + any existing policy."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-services-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified Project. + + There are no permissions required for making this API call."##), + "Details at http://byron.github.io/google-apis-rs/google_run1_cli/projects_locations-services-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -228,7 +5128,7 @@ fn main() { let mut app = App::new("run1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200407") .about("Deploy and manage user provided container images that scale automatically based on HTTP traffic.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_run1_cli") .arg(Arg::with_name("url") diff --git a/gen/run1/Cargo.toml b/gen/run1/Cargo.toml index c8cad33e5f..add0bacdbe 100644 --- a/gen/run1/Cargo.toml +++ b/gen/run1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-run1" -version = "1.0.12+20190624" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Run (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/run1" homepage = "https://cloud.google.com/run/" -documentation = "https://docs.rs/google-run1/1.0.12+20190624" +documentation = "https://docs.rs/google-run1/1.0.13+20200407" license = "MIT" keywords = ["run", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/run1/README.md b/gen/run1/README.md index 83b6bf6b1c..8a969a7570 100644 --- a/gen/run1/README.md +++ b/gen/run1/README.md @@ -5,16 +5,20 @@ DO NOT EDIT ! --> The `google-run1` library allows access to all features of the *Google Cloud Run* service. -This documentation was generated from *Cloud Run* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *run:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Run* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *run:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Run* *v1* API can be found at the [official documentation site](https://cloud.google.com/run/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-run1/1.0.12+20190624/google_run1/struct.CloudRun.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.CloudRun.html) ... +* api + * [*v1 namespaces get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ApiV1NamespaceGetCall.html), [*v1 namespaces patch*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ApiV1NamespacePatchCall.html), [*v1 namespaces secrets create*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ApiV1NamespaceSecretCreateCall.html), [*v1 namespaces secrets get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ApiV1NamespaceSecretGetCall.html) and [*v1 namespaces secrets replace secret*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ApiV1NamespaceSecretReplaceSecretCall.html) +* [namespaces](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.Namespace.html) + * [*authorizeddomains list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceAuthorizeddomainListCall.html), [*configurations get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceConfigurationGetCall.html), [*configurations list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceConfigurationListCall.html), [*domainmappings create*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceDomainmappingCreateCall.html), [*domainmappings delete*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceDomainmappingDeleteCall.html), [*domainmappings get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceDomainmappingGetCall.html), [*domainmappings list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceDomainmappingListCall.html), [*revisions delete*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceRevisionDeleteCall.html), [*revisions get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceRevisionGetCall.html), [*revisions list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceRevisionListCall.html), [*routes get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceRouteGetCall.html), [*routes list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceRouteListCall.html), [*services create*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceServiceCreateCall.html), [*services delete*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceServiceDeleteCall.html), [*services get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceServiceGetCall.html), [*services list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceServiceListCall.html) and [*services replace service*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.NamespaceServiceReplaceServiceCall.html) * projects - * [*locations get*](https://docs.rs/google-run1/1.0.12+20190624/google_run1/struct.ProjectLocationGetCall.html) + * [*locations authorizeddomains list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationAuthorizeddomainListCall.html), [*locations configurations get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationConfigurationGetCall.html), [*locations configurations list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationConfigurationListCall.html), [*locations domainmappings create*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationDomainmappingCreateCall.html), [*locations domainmappings delete*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationDomainmappingDeleteCall.html), [*locations domainmappings get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationDomainmappingGetCall.html), [*locations domainmappings list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationDomainmappingListCall.html), [*locations list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationListCall.html), [*locations namespaces get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationNamespaceGetCall.html), [*locations namespaces patch*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationNamespacePatchCall.html), [*locations revisions delete*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationRevisionDeleteCall.html), [*locations revisions get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationRevisionGetCall.html), [*locations revisions list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationRevisionListCall.html), [*locations routes get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationRouteGetCall.html), [*locations routes list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationRouteListCall.html), [*locations secrets create*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationSecretCreateCall.html), [*locations secrets get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationSecretGetCall.html), [*locations secrets replace secret*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationSecretReplaceSecretCall.html), [*locations services create*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceCreateCall.html), [*locations services delete*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceDeleteCall.html), [*locations services get*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceGetCall.html), [*locations services get iam policy*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceGetIamPolicyCall.html), [*locations services list*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceListCall.html), [*locations services replace service*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceReplaceServiceCall.html), [*locations services set iam policy*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceSetIamPolicyCall.html) and [*locations services test iam permissions*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.ProjectLocationServiceTestIamPermissionCall.html) @@ -23,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-run1/1.0.12+20190624/google_run1/struct.CloudRun.html)** +* **[Hub](https://docs.rs/google-run1/1.0.13+20200407/google_run1/struct.CloudRun.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.Part.html)** + * **[Parts](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,7 +51,27 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().locations_get(...).doit() +let r = hub.namespaces().services_delete(...).doit() +let r = hub.namespaces().services_create(...).doit() +let r = hub.namespaces().routes_get(...).doit() +let r = hub.namespaces().services_get(...).doit() +let r = hub.api().v1_namespaces_patch(...).doit() +let r = hub.namespaces().domainmappings_delete(...).doit() +let r = hub.projects().locations_namespaces_patch(...).doit() +let r = hub.api().v1_namespaces_get(...).doit() +let r = hub.namespaces().authorizeddomains_list(...).doit() +let r = hub.namespaces().configurations_get(...).doit() +let r = hub.namespaces().routes_list(...).doit() +let r = hub.namespaces().services_list(...).doit() +let r = hub.namespaces().revisions_get(...).doit() +let r = hub.namespaces().revisions_list(...).doit() +let r = hub.namespaces().services_replace_service(...).doit() +let r = hub.namespaces().configurations_list(...).doit() +let r = hub.namespaces().domainmappings_get(...).doit() +let r = hub.projects().locations_namespaces_get(...).doit() +let r = hub.namespaces().domainmappings_create(...).doit() +let r = hub.namespaces().revisions_delete(...).doit() +let r = hub.namespaces().domainmappings_list(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -101,7 +125,14 @@ let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConne // 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_get("name") +let result = hub.namespaces().routes_list("parent") + .watch(true) + .resource_version("Stet") + .limit(-42) + .label_selector("et") + .include_uninitialized(true) + .field_selector("kasd") + .continue_("accusam") .doit(); match result { @@ -124,17 +155,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-run1/1.0.12+20190624/google_run1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-run1/1.0.13+20200407/google_run1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-run1/1.0.12+20190624/google_run1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-run1/1.0.13+20200407/google_run1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -144,29 +175,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-run1/1.0.12+20190624/google_run1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-run1/1.0.13+20200407/google_run1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/run1/src/lib.rs b/gen/run1/src/lib.rs index 716f87b51f..a033a60aad 100644 --- a/gen/run1/src/lib.rs +++ b/gen/run1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Run* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *run:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Run* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *run:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Run* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/run/). @@ -11,8 +11,12 @@ //! //! Handle the following *Resources* with ease from the central [hub](struct.CloudRun.html) ... //! +//! * api +//! * [*v1 namespaces get*](struct.ApiV1NamespaceGetCall.html), [*v1 namespaces patch*](struct.ApiV1NamespacePatchCall.html), [*v1 namespaces secrets create*](struct.ApiV1NamespaceSecretCreateCall.html), [*v1 namespaces secrets get*](struct.ApiV1NamespaceSecretGetCall.html) and [*v1 namespaces secrets replace secret*](struct.ApiV1NamespaceSecretReplaceSecretCall.html) +//! * [namespaces](struct.Namespace.html) +//! * [*authorizeddomains list*](struct.NamespaceAuthorizeddomainListCall.html), [*configurations get*](struct.NamespaceConfigurationGetCall.html), [*configurations list*](struct.NamespaceConfigurationListCall.html), [*domainmappings create*](struct.NamespaceDomainmappingCreateCall.html), [*domainmappings delete*](struct.NamespaceDomainmappingDeleteCall.html), [*domainmappings get*](struct.NamespaceDomainmappingGetCall.html), [*domainmappings list*](struct.NamespaceDomainmappingListCall.html), [*revisions delete*](struct.NamespaceRevisionDeleteCall.html), [*revisions get*](struct.NamespaceRevisionGetCall.html), [*revisions list*](struct.NamespaceRevisionListCall.html), [*routes get*](struct.NamespaceRouteGetCall.html), [*routes list*](struct.NamespaceRouteListCall.html), [*services create*](struct.NamespaceServiceCreateCall.html), [*services delete*](struct.NamespaceServiceDeleteCall.html), [*services get*](struct.NamespaceServiceGetCall.html), [*services list*](struct.NamespaceServiceListCall.html) and [*services replace service*](struct.NamespaceServiceReplaceServiceCall.html) //! * projects -//! * [*locations get*](struct.ProjectLocationGetCall.html) +//! * [*locations authorizeddomains list*](struct.ProjectLocationAuthorizeddomainListCall.html), [*locations configurations get*](struct.ProjectLocationConfigurationGetCall.html), [*locations configurations list*](struct.ProjectLocationConfigurationListCall.html), [*locations domainmappings create*](struct.ProjectLocationDomainmappingCreateCall.html), [*locations domainmappings delete*](struct.ProjectLocationDomainmappingDeleteCall.html), [*locations domainmappings get*](struct.ProjectLocationDomainmappingGetCall.html), [*locations domainmappings list*](struct.ProjectLocationDomainmappingListCall.html), [*locations list*](struct.ProjectLocationListCall.html), [*locations namespaces get*](struct.ProjectLocationNamespaceGetCall.html), [*locations namespaces patch*](struct.ProjectLocationNamespacePatchCall.html), [*locations revisions delete*](struct.ProjectLocationRevisionDeleteCall.html), [*locations revisions get*](struct.ProjectLocationRevisionGetCall.html), [*locations revisions list*](struct.ProjectLocationRevisionListCall.html), [*locations routes get*](struct.ProjectLocationRouteGetCall.html), [*locations routes list*](struct.ProjectLocationRouteListCall.html), [*locations secrets create*](struct.ProjectLocationSecretCreateCall.html), [*locations secrets get*](struct.ProjectLocationSecretGetCall.html), [*locations secrets replace secret*](struct.ProjectLocationSecretReplaceSecretCall.html), [*locations services create*](struct.ProjectLocationServiceCreateCall.html), [*locations services delete*](struct.ProjectLocationServiceDeleteCall.html), [*locations services get*](struct.ProjectLocationServiceGetCall.html), [*locations services get iam policy*](struct.ProjectLocationServiceGetIamPolicyCall.html), [*locations services list*](struct.ProjectLocationServiceListCall.html), [*locations services replace service*](struct.ProjectLocationServiceReplaceServiceCall.html), [*locations services set iam policy*](struct.ProjectLocationServiceSetIamPolicyCall.html) and [*locations services test iam permissions*](struct.ProjectLocationServiceTestIamPermissionCall.html) //! //! //! @@ -47,7 +51,27 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().locations_get(...).doit() +//! let r = hub.namespaces().services_delete(...).doit() +//! let r = hub.namespaces().services_create(...).doit() +//! let r = hub.namespaces().routes_get(...).doit() +//! let r = hub.namespaces().services_get(...).doit() +//! let r = hub.api().v1_namespaces_patch(...).doit() +//! let r = hub.namespaces().domainmappings_delete(...).doit() +//! let r = hub.projects().locations_namespaces_patch(...).doit() +//! let r = hub.api().v1_namespaces_get(...).doit() +//! let r = hub.namespaces().authorizeddomains_list(...).doit() +//! let r = hub.namespaces().configurations_get(...).doit() +//! let r = hub.namespaces().routes_list(...).doit() +//! let r = hub.namespaces().services_list(...).doit() +//! let r = hub.namespaces().revisions_get(...).doit() +//! let r = hub.namespaces().revisions_list(...).doit() +//! let r = hub.namespaces().services_replace_service(...).doit() +//! let r = hub.namespaces().configurations_list(...).doit() +//! let r = hub.namespaces().domainmappings_get(...).doit() +//! let r = hub.projects().locations_namespaces_get(...).doit() +//! let r = hub.namespaces().domainmappings_create(...).doit() +//! let r = hub.namespaces().revisions_delete(...).doit() +//! let r = hub.namespaces().domainmappings_list(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -102,7 +126,14 @@ //! // 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_get("name") +//! let result = hub.namespaces().routes_list("parent") +//! .watch(false) +//! .resource_version("amet.") +//! .limit(-81) +//! .label_selector("labore") +//! .include_uninitialized(true) +//! .field_selector("nonumy") +//! .continue_("dolores") //! .doit(); //! //! match result { @@ -279,7 +310,14 @@ impl Default for Scope { /// // 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_get("name") +/// let result = hub.namespaces().routes_list("parent") +/// .watch(false) +/// .resource_version("aliquyam") +/// .limit(-66) +/// .label_selector("no") +/// .include_uninitialized(true) +/// .field_selector("justo") +/// .continue_("et") /// .doit(); /// /// match result { @@ -317,18 +355,24 @@ impl<'a, C, A> CloudRun CloudRun { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://run.googleapis.com/".to_string(), _root_url: "https://run.googleapis.com/".to_string(), } } + pub fn api(&'a self) -> ApiMethods<'a, C, A> { + ApiMethods { hub: &self } + } + pub fn namespaces(&'a self) -> NamespaceMethods<'a, C, A> { + NamespaceMethods { hub: &self } + } pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { ProjectMethods { hub: &self } } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -356,14 +400,1554 @@ impl<'a, C, A> CloudRun // ############ // SCHEMAS ### // ########## -/// A resource that represents Google Cloud Platform location. +/// Service acts as a top-level container that manages a set of Routes and +/// Configurations which implement a network service. Service exists to provide a +/// singular abstraction which can be access controlled, reasoned about, and +/// which encapsulates software lifecycle decisions such as rollout policy and +/// team resource ownership. Service acts only as an orchestrator of the +/// underlying Routes and Configurations (much as a kubernetes Deployment +/// orchestrates ReplicaSets). +/// +/// The Service's controller will track the statuses of its owned Configuration +/// and Route, reflecting their statuses and conditions as its own. +/// +/// See also: +/// https://github.com/knative/serving/blob/master/docs/spec/overview.md#service /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// * [locations services replace service projects](struct.ProjectLocationServiceReplaceServiceCall.html) (request|response) +/// * [services create namespaces](struct.NamespaceServiceCreateCall.html) (request|response) +/// * [locations services create projects](struct.ProjectLocationServiceCreateCall.html) (request|response) +/// * [services get namespaces](struct.NamespaceServiceGetCall.html) (response) +/// * [locations services get projects](struct.ProjectLocationServiceGetCall.html) (response) +/// * [services replace service namespaces](struct.NamespaceServiceReplaceServiceCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Service { + /// Status communicates the observed state of the Service (from the + /// controller). + pub status: Option, + /// The kind of resource, in this case "Service". + pub kind: Option, + /// Spec holds the desired state of the Service (from the client). + pub spec: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Metadata associated with this Service, including name, namespace, labels, + /// and annotations. + pub metadata: Option, +} + +impl RequestValue for Service {} +impl ResponseResult for Service {} + + +/// A DNS resource record. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceRecord { + /// Data for this record. Values vary by record type, as defined in RFC 1035 + /// (section 5) and RFC 1034 (section 3.6.1). + pub rrdata: Option, + /// Resource record type. Example: `AAAA`. + #[serde(rename="type")] + pub type_: Option, + /// Relative name of the object affected by this record. Only applicable for + /// `CNAME` records. Example: 'www'. + pub name: Option, +} + +impl Part for ResourceRecord {} + + +/// Revision is an immutable snapshot of code and configuration. A revision +/// references a container image. Revisions are created by updates to a +/// Configuration. +/// +/// See also: +/// https://github.com/knative/serving/blob/master/docs/spec/overview.md#revision +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations revisions get projects](struct.ProjectLocationRevisionGetCall.html) (response) +/// * [revisions get namespaces](struct.NamespaceRevisionGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Revision { + /// Status communicates the observed state of the Revision (from the + /// controller). + pub status: Option, + /// The kind of this resource, in this case "Revision". + pub kind: Option, + /// Spec holds the desired state of the Revision (from the client). + pub spec: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Metadata associated with this Revision, including name, namespace, labels, + /// and annotations. + pub metadata: Option, +} + +impl ResponseResult for Revision {} + + +/// Status is a return value for calls that don't return other objects +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [services delete namespaces](struct.NamespaceServiceDeleteCall.html) (response) +/// * [locations domainmappings delete projects](struct.ProjectLocationDomainmappingDeleteCall.html) (response) +/// * [domainmappings delete namespaces](struct.NamespaceDomainmappingDeleteCall.html) (response) +/// * [revisions delete namespaces](struct.NamespaceRevisionDeleteCall.html) (response) +/// * [locations revisions delete projects](struct.ProjectLocationRevisionDeleteCall.html) (response) +/// * [locations services delete projects](struct.ProjectLocationServiceDeleteCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// Status of the operation. + /// One of: "Success" or "Failure". + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + /// +optional + pub status: Option, + /// A machine-readable description of why this operation is in the + /// "Failure" status. If this value is empty there + /// is no information available. A Reason clarifies an HTTP status + /// code but does not override it. + /// +optional + pub reason: Option, + /// Suggested HTTP return code for this status, 0 if not set. + /// +optional + pub code: Option, + /// Extended data associated with the reason. Each reason may define its + /// own extended details. This field is optional and the data returned + /// is not guaranteed to conform to any schema except that defined by + /// the reason type. + /// +optional + pub details: Option, + /// A human-readable description of the status of this operation. + /// +optional + pub message: Option, + /// Standard list metadata. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds + /// +optional + pub metadata: Option, +} + +impl ResponseResult for Status {} + + +/// Response message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations services test iam permissions projects](struct.ProjectLocationServiceTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + pub permissions: Option>, +} + +impl ResponseResult for TestIamPermissionsResponse {} + + +/// TrafficTarget holds a single entry of the routing table for a Route. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TrafficTarget { + /// LatestRevision may be optionally provided to indicate that the latest + /// ready Revision of the Configuration should be used for this traffic + /// target. When provided LatestRevision must be true if RevisionName is + /// empty; it must be false when RevisionName is non-empty. + /// + /// +optional + #[serde(rename="latestRevision")] + pub latest_revision: Option, + /// ConfigurationName of a configuration to whose latest revision we will + /// send this portion of traffic. When the "status.latestReadyRevisionName" + /// of the referenced configuration changes, we will automatically migrate + /// traffic from the prior "latest ready" revision to the new one. This field + /// is never set in Route's status, only its spec. This is mutually exclusive + /// with RevisionName. + /// + /// Cloud Run currently supports a single ConfigurationName. + #[serde(rename="configurationName")] + pub configuration_name: Option, + /// Tag is optionally used to expose a dedicated url for referencing + /// this target exclusively. + /// + /// Not currently supported in Cloud Run. + /// +optional + pub tag: Option, + /// Output only. URL displays the URL for accessing tagged traffic targets. URL + /// is displayed in status, and is disallowed on spec. URL must contain a + /// scheme (e.g. http://) and a hostname, but may not contain anything else + /// (e.g. basic auth, url path, etc. + /// + /// Not currently supported in Cloud Run. + pub url: Option, + /// Percent specifies percent of the traffic to this Revision or Configuration. + /// This defaults to zero if unspecified. + /// + /// Cloud Run currently requires 100 percent for a single ConfigurationName + /// TrafficTarget entry. + pub percent: Option, + /// RevisionName of a specific revision to which to send this portion of + /// traffic. This is mutually exclusive with ConfigurationName. + /// + /// Providing RevisionName in spec is not currently supported by Cloud Run. + #[serde(rename="revisionName")] + pub revision_name: Option, +} + +impl Part for TrafficTarget {} + + +/// ListRevisionsResponse is a list of Revision resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [revisions list namespaces](struct.NamespaceRevisionListCall.html) (response) +/// * [locations revisions list projects](struct.ProjectLocationRevisionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListRevisionsResponse { + /// List of Revisions. + pub items: Option>, + /// The kind of this resource, in this case "RevisionList". + pub kind: Option, + /// Metadata associated with this revision list. + pub metadata: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Locations that could not be reached. + pub unreachable: Option>, +} + +impl ResponseResult for ListRevisionsResponse {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// HTTPGetAction describes an action based on HTTP Get requests. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HTTPGetAction { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Path to access on the HTTP server. + pub path: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Host name to connect to, defaults to the pod IP. You probably want to set + /// "Host" in httpHeaders instead. + pub host: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Scheme to use for connecting to the host. + /// Defaults to HTTP. + pub scheme: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Custom headers to set in the request. HTTP allows repeated headers. + #[serde(rename="httpHeaders")] + pub http_headers: Option>, +} + +impl Part for HTTPGetAction {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// TCPSocketAction describes an action based on opening a socket +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TCPSocketAction { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Optional: Host name to connect to, defaults to the pod IP. + pub host: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Number or name of the port to access on the container. + /// Number must be in the range 1 to 65535. + /// Name must be an IANA_SVC_NAME. + pub port: Option, +} + +impl Part for TCPSocketAction {} + + +/// RevisionSpec holds the desired state of the Revision (from the client). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevisionSpec { + /// (Optional) + /// + /// ContainerConcurrency specifies the maximum allowed in-flight (concurrent) + /// requests per container instance of the Revision. + /// + /// Cloud Run fully managed: supported, defaults to 80 + /// + /// Cloud Run for Anthos: supported, defaults to 0, which means concurrency + /// to the application is not limited, and the system decides the + /// target concurrency for the autoscaler. + #[serde(rename="containerConcurrency")] + pub container_concurrency: Option, + /// Containers holds the single container that defines the unit of execution + /// for this Revision. In the context of a Revision, we disallow a number of + /// fields on this Container, including: name and lifecycle. + /// In Cloud Run, only a single container may be provided. + /// The runtime contract is documented here: + /// https://github.com/knative/serving/blob/master/docs/runtime-contract.md + pub containers: Option>, + /// TimeoutSeconds holds the max duration the instance is allowed for + /// responding to a request. + /// Not currently used by Cloud Run. + #[serde(rename="timeoutSeconds")] + pub timeout_seconds: Option, + /// no description provided + pub volumes: Option>, + /// Email address of the IAM service account associated with the revision + /// of the service. The service account represents the identity of the + /// running revision, and determines what permissions the revision has. If + /// not provided, the revision will use the project's default service account. + #[serde(rename="serviceAccountName")] + pub service_account_name: Option, +} + +impl Part for RevisionSpec {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// VolumeMount describes a mounting of a Volume within a container. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VolumeMount { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Only true is accepted. + /// Defaults to true. + #[serde(rename="readOnly")] + pub read_only: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Path within the container at which the volume should be mounted. Must + /// not contain ':'. + #[serde(rename="mountPath")] + pub mount_path: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Path within the volume from which the container's volume should be mounted. + /// Defaults to "" (volume's root). + #[serde(rename="subPath")] + pub sub_path: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// This must match the Name of a Volume. + pub name: Option, +} + +impl Part for VolumeMount {} + + +/// ContainerPort represents a network port in a single container. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ContainerPort { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Protocol for port. Must be "TCP". + /// Defaults to "TCP". + pub protocol: Option, + /// (Optional) + /// + /// Port number the container listens on. + /// This must be a valid port number, 0 < x < 65536. + #[serde(rename="containerPort")] + pub container_port: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// If specified, used to specify which protocol to use. + /// Allowed values are "http1" and "h2c". + pub name: Option, +} + +impl Part for ContainerPort {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// ConfigMapEnvSource selects a ConfigMap to populate the environment +/// variables with. +/// +/// The contents of the target ConfigMap's Data field will represent the +/// key-value pairs as environment variables. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConfigMapEnvSource { + /// This field should not be used directly as it is meant to be inlined + /// directly into the message. Use the "name" field instead. + #[serde(rename="localObjectReference")] + pub local_object_reference: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Specify whether the ConfigMap must be defined + pub optional: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The ConfigMap to select from. + pub name: Option, +} + +impl Part for ConfigMapEnvSource {} + + +/// ServiceSpec holds the desired state of the Route (from the client), which +/// is used to manipulate the underlying Route and Configuration(s). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceSpec { + /// Traffic specifies how to distribute traffic over a collection of Knative + /// Revisions and Configurations. + pub traffic: Option>, + /// Template holds the latest specification for the Revision to + /// be stamped out. + pub template: Option, +} + +impl Part for ServiceSpec {} + + +/// A list of Service resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations services list projects](struct.ProjectLocationServiceListCall.html) (response) +/// * [services list namespaces](struct.NamespaceServiceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListServicesResponse { + /// List of Services. + pub items: Option>, + /// The kind of this resource, in this case "ServiceList". + pub kind: Option, + /// Metadata associated with this Service list. + pub metadata: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Locations that could not be reached. + pub unreachable: Option>, +} + +impl ResponseResult for ListServicesResponse {} + + +/// ListDomainMappingsResponse is a list of DomainMapping resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations domainmappings list projects](struct.ProjectLocationDomainmappingListCall.html) (response) +/// * [domainmappings list namespaces](struct.NamespaceDomainmappingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDomainMappingsResponse { + /// List of DomainMappings. + pub items: Option>, + /// The kind of this resource, in this case "DomainMappingList". + pub kind: Option, + /// Metadata associated with this DomainMapping list. + pub metadata: Option, + /// The API version for this call such as "domains.cloudrun.com/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Locations that could not be reached. + pub unreachable: Option>, +} + +impl ResponseResult for ListDomainMappingsResponse {} + + +/// IntOrString is a type that can hold an int32 or a string. When used in +/// JSON or YAML marshalling and unmarshalling, it produces or consumes the +/// inner type. This allows you to have, for example, a JSON field that can +/// accept a name or number. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IntOrString { + /// The string value. + #[serde(rename="strVal")] + pub str_val: Option, + /// The type of the value. + #[serde(rename="type")] + pub type_: Option, + /// The int value. + #[serde(rename="intVal")] + pub int_val: Option, +} + +impl Part for IntOrString {} + + +/// Information for connecting over HTTP(s). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Addressable { + /// no description provided + pub url: Option, +} + +impl Part for Addressable {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// EnvVarSource represents a source for the value of an EnvVar. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnvVarSource { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Selects a key of a secret in the pod's namespace + #[serde(rename="secretKeyRef")] + pub secret_key_ref: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Selects a key of a ConfigMap. + #[serde(rename="configMapKeyRef")] + pub config_map_key_ref: Option, +} + +impl Part for EnvVarSource {} + + +/// RevisionTemplateSpec describes the data a revision should have when created +/// from a template. Based on: +/// https://github.com/kubernetes/api/blob/e771f807/core/v1/types.go#L3179-L3190 +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevisionTemplate { + /// RevisionSpec holds the desired state of the Revision (from the client). + pub spec: Option, + /// Optional metadata for this Revision, including labels and annotations. Name + /// will be generated by the Configuration. + /// To set minimum instances for this revision, use the + /// "autoscaling.knative.dev/minScale" annotation key. + /// To set maximum instances for this revision, use the + /// "autoscaling.knative.dev/maxScale" annotation key. + /// To set Cloud SQL connections for the revision, use the + /// "run.googleapis.com/cloudsql-instances" annotation key. + pub metadata: Option, +} + +impl Part for RevisionTemplate {} + + +/// RouteSpec holds the desired state of the Route (from the client). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouteSpec { + /// Traffic specifies how to distribute traffic over a collection of Knative + /// Revisions and Configurations. + /// Cloud Run currently supports a single configurationName. + pub traffic: Option>, +} + +impl Part for RouteSpec {} + + +/// k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta is metadata that all +/// persisted resources must have, which includes all objects users must create. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObjectMeta { + /// Name must be unique within a namespace, within a Cloud Run region. + /// Is required when creating + /// resources, although some resources may allow a client to request the + /// generation of an appropriate name automatically. Name is primarily intended + /// for creation idempotence and configuration definition. Cannot be updated. + /// More info: http://kubernetes.io/docs/user-guide/identifiers#names + /// +optional + pub name: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be + /// deleted. This field is set by the server when a graceful deletion is + /// requested by the user, and is not directly settable by a client. The + /// resource is expected to be deleted (no longer visible from resource lists, + /// and not reachable by name) after the time in this field, once the + /// finalizers list is empty. As long as the finalizers list contains items, + /// deletion is blocked. Once the deletionTimestamp is set, this value may not + /// be unset or be set further into the future, although it may be shortened or + /// the resource may be deleted prior to this time. For example, a user may + /// request that a pod is deleted in 30 seconds. The Kubelet will react by + /// sending a graceful termination signal to the containers in the pod. After + /// that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) + /// to the container and after cleanup, remove the pod from the API. In the + /// presence of network partitions, this object may still exist after this + /// timestamp, until an administrator or automated process can determine the + /// resource is fully terminated. + /// If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. + /// Read-only. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + #[serde(rename="deletionTimestamp")] + pub deletion_timestamp: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The name of the cluster which the object belongs to. + /// This is used to distinguish resources with same name and namespace in + /// different clusters. This field is not set anywhere right now and apiserver + /// is going to ignore it if set in create or update request. + #[serde(rename="clusterName")] + pub cluster_name: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Number of seconds allowed for this object to gracefully terminate before + /// it will be removed from the system. Only set when deletionTimestamp is also + /// set. May only be shortened. Read-only. + #[serde(rename="deletionGracePeriodSeconds")] + pub deletion_grace_period_seconds: Option, + /// (Optional) + /// + /// Map of string keys and values that can be used to organize and categorize + /// (scope and select) objects. May match selectors of replication controllers + /// and routes. + /// More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + /// Namespace defines the space within each name must be unique, within a + /// Cloud Run region. In Cloud Run the namespace must be equal to either the + /// project ID or project number. + pub namespace: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Must be empty before the object is deleted from the registry. Each entry + /// is an identifier for the responsible component that will remove the entry + /// from the list. If the deletionTimestamp of the object is non-nil, entries + /// in this list can only be removed. + /// +patchStrategy=merge + pub finalizers: Option>, + /// (Optional) + /// + /// A sequence number representing a specific generation of the desired state. + /// Populated by the system. Read-only. + pub generation: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// GenerateName is an optional prefix, used by the server, to generate a + /// unique name ONLY IF the Name field has not been provided. If this field is + /// used, the name returned to the client will be different than the name + /// passed. This value will also be combined with a unique suffix. The provided + /// value has the same validation rules as the Name field, and may be truncated + /// by the length of the suffix required to make the value unique on the + /// server. + /// + /// If this field is specified and the generated name exists, the server will + /// NOT return a 409 - instead, it will either return 201 Created or 500 with + /// Reason ServerTimeout indicating a unique name could not be found in the + /// time allotted, and the client should retry (optionally after the time + /// indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency + /// string generateName = 2; + #[serde(rename="generateName")] + pub generate_name: Option, + /// (Optional) + /// + /// An opaque value that represents the internal version of this object that + /// can be used by clients to determine when objects have changed. May be used + /// for optimistic concurrency, change detection, and the watch operation on a + /// resource or set of resources. Clients must treat these values as opaque and + /// passed unmodified back to the server. They may only be valid for a + /// particular resource or set of resources. + /// + /// Populated by the system. + /// Read-only. + /// Value must be treated as opaque by clients and . + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency + #[serde(rename="resourceVersion")] + pub resource_version: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// List of objects that own this object. If ALL objects in the list have + /// been deleted, this object will be garbage collected. + #[serde(rename="ownerReferences")] + pub owner_references: Option>, + /// (Optional) + /// + /// CreationTimestamp is a timestamp representing the server time when this + /// object was created. It is not guaranteed to be set in happens-before order + /// across separate operations. Clients may not set this value. It is + /// represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. + /// Read-only. + /// Null for lists. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + #[serde(rename="creationTimestamp")] + pub creation_timestamp: Option, + /// (Optional) + /// + /// Annotations is an unstructured key value map stored with a resource that + /// may be set by external tools to store and retrieve arbitrary metadata. They + /// are not queryable and should be preserved when modifying objects. More + /// info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + /// (Optional) + /// + /// SelfLink is a URL representing this object. + /// Populated by the system. + /// Read-only. + /// string selfLink = 4; + #[serde(rename="selfLink")] + pub self_link: Option, + /// (Optional) + /// + /// UID is the unique in time and space value for this object. It is typically + /// generated by the server on successful creation of a resource and is not + /// allowed to change on PUT operations. + /// + /// Populated by the system. + /// Read-only. + /// More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl Part for ObjectMeta {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + pub role: Option, + /// The condition that is associated with this binding. + /// NOTE: An unsatisfied condition will not allow user access via current + /// binding. Different bindings, including their conditions, are examined + /// independently. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@example.com` . + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// + /// + /// * `domain:{domain}`: The G Suite domain (primary) that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + +/// ListConfigurationsResponse is a list of Configuration resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations configurations list projects](struct.ProjectLocationConfigurationListCall.html) (response) +/// * [configurations list namespaces](struct.NamespaceConfigurationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListConfigurationsResponse { + /// List of Configurations. + pub items: Option>, + /// The kind of this resource, in this case "ConfigurationList". + pub kind: Option, + /// Metadata associated with this Configuration list. + pub metadata: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Locations that could not be reached. + pub unreachable: Option>, +} + +impl ResponseResult for ListConfigurationsResponse {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// ExecAction describes a "run in container" action. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExecAction { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Command is the command line to execute inside the container, the working + /// directory for the command is root ('/') in the container's filesystem. The + /// command is simply exec'd, it is not run inside a shell, so traditional + /// shell instructions ('|', etc) won't work. To use a shell, you need to + /// explicitly call out to that shell. Exit status of 0 is treated as + /// live/healthy and non-zero is unhealthy. + pub command: Option, +} + +impl Part for ExecAction {} + + +/// ResourceRequirements describes the compute resource requirements. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceRequirements { + /// (Optional) + /// + /// Cloud Run fully managed: Only memory and CPU are supported. Note: The only + /// supported value for CPU is '1'. + /// + /// Cloud Run for Anthos: supported + /// + /// Requests describes the minimum amount of compute resources required. + /// If Requests is omitted for a container, it defaults to Limits if that is + /// explicitly specified, otherwise to an implementation-defined value. + /// The values of the map is string form of the 'quantity' k8s type: + /// https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + pub requests: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: Only memory and CPU are supported. Note: The only + /// supported value for CPU is '1'. + /// + /// Cloud Run for Anthos: supported + /// + /// Limits describes the maximum amount of compute resources allowed. + /// The values of the map is string form of the 'quantity' k8s type: + /// https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + pub limits: Option>, +} + +impl Part for ResourceRequirements {} + + +/// The desired state of the Domain Mapping. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DomainMappingSpec { + /// The name of the Knative Route that this DomainMapping applies to. + /// The route must exist. + #[serde(rename="routeName")] + pub route_name: Option, + /// If set, the mapping will override any mapping set before this spec was set. + /// It is recommended that the user leaves this empty to receive an error + /// warning about a potential conflict and only set it once the respective UI + /// has given such a warning. + #[serde(rename="forceOverride")] + pub force_override: Option, + /// The mode of the certificate. + #[serde(rename="certificateMode")] + pub certificate_mode: Option, +} + +impl Part for DomainMappingSpec {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// LocalObjectReference contains enough information to let you locate the +/// referenced object inside the same namespace. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LocalObjectReference { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Name of the referent. + /// More info: + /// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + pub name: Option, +} + +impl Part for LocalObjectReference {} + + +/// A single application container. +/// This specifies both the container to run, the command to run in the container +/// and the arguments to supply to it. +/// Note that additional arguments may be supplied by the system to the container +/// at runtime. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Container { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Periodic probe of container liveness. + /// Container will be restarted if the probe fails. + /// More info: + /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + #[serde(rename="livenessProbe")] + pub liveness_probe: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Path at which the file to which the container's termination + /// message will be written is mounted into the container's filesystem. Message + /// written is intended to be brief final status, such as an assertion failure + /// message. Will be truncated by the node if greater than 4096 bytes. The + /// total message length across all containers will be limited to 12kb. + /// Defaults to /dev/termination-log. + #[serde(rename="terminationMessagePath")] + pub termination_message_path: Option, + /// Cloud Run fully managed: only supports containers from Google Container + /// Registry + /// + /// Cloud Run for Anthos: supported + /// + /// URL of the Container image. + /// More info: https://kubernetes.io/docs/concepts/containers/images + pub image: Option, + /// (Optional) + /// + /// Cloud Run fully managed: supported + /// + /// Cloud Run for Anthos: supported + /// + /// Arguments to the entrypoint. + /// The docker image's CMD is used if this is not provided. + /// Variable references $(VAR_NAME) are expanded using the container's + /// environment. If a variable cannot be resolved, the reference in the input + /// string will be unchanged. The $(VAR_NAME) syntax can be escaped with a + /// double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, + /// regardless of whether the variable exists or not. + /// More info: + /// https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + pub args: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Pod volumes to mount into the container's filesystem. + #[serde(rename="volumeMounts")] + pub volume_mounts: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Security options the pod should run with. + /// More info: https://kubernetes.io/docs/concepts/policy/security-context/ + /// More info: + /// https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + #[serde(rename="securityContext")] + pub security_context: Option, + /// (Optional) + /// + /// Name of the container specified as a DNS_LABEL. + pub name: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// List of sources to populate environment variables in the container. + /// The keys defined within a source must be a C_IDENTIFIER. All invalid keys + /// will be reported as an event when the container is starting. When a key + /// exists in multiple sources, the value associated with the last source will + /// take precedence. Values defined by an Env with a duplicate key will take + /// precedence. Cannot be updated. + #[serde(rename="envFrom")] + pub env_from: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Container's working directory. + /// If not specified, the container runtime's default will be used, which + /// might be configured in the container image. + #[serde(rename="workingDir")] + pub working_dir: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Indicate how the termination message should be populated. File will use the + /// contents of terminationMessagePath to populate the container status message + /// on both success and failure. FallbackToLogsOnError will use the last chunk + /// of container log output if the termination message file is empty and the + /// container exited with an error. The log output is limited to 2048 bytes or + /// 80 lines, whichever is smaller. Defaults to File. Cannot be updated. + #[serde(rename="terminationMessagePolicy")] + pub termination_message_policy: Option, + /// no description provided + pub command: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: supported + /// + /// Cloud Run for Anthos: supported + /// + /// List of environment variables to set in the container. + pub env: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Image pull policy. + /// One of Always, Never, IfNotPresent. + /// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + /// More info: + /// https://kubernetes.io/docs/concepts/containers/images#updating-images + #[serde(rename="imagePullPolicy")] + pub image_pull_policy: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Periodic probe of container service readiness. + /// Container will be removed from service endpoints if the probe fails. + /// More info: + /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + #[serde(rename="readinessProbe")] + pub readiness_probe: Option, + /// (Optional) + /// + /// List of ports to expose from the container. Only a single port can be + /// specified. The specified ports must be listening on all interfaces + /// (0.0.0.0) within the container to be accessible. + /// + /// If omitted, a port number will be chosen and passed to the container + /// through the PORT environment variable for the container to listen on. + pub ports: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: supported + /// + /// Cloud Run for Anthos: supported + /// + /// Compute Resources required by this container. + /// More info: + /// https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + pub resources: Option, +} + +impl Part for Container {} + + +/// Request message for `SetIamPolicy` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations services set iam policy projects](struct.ProjectLocationServiceSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. The size of + /// the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + /// the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: + /// paths: "bindings, etag" + /// This field is only used by Cloud IAM. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// Adapts a ConfigMap into a volume. +/// The contents of the target ConfigMap's Data field will be presented in a +/// volume as files using the keys in the Data field as the file names, unless +/// the items element is populated with specific mappings of keys to paths. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConfigMapVolumeSource { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// If unspecified, each key-value pair in the Data field of the referenced + /// Secret will be projected into the volume as a file whose name is the + /// key and content is the value. If specified, the listed keys will be + /// projected into the specified paths, and unlisted keys will not be + /// present. If a key is specified which is not present in the Secret, + /// the volume setup will error unless it is marked optional. + pub items: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Specify whether the Secret or its keys must be defined. + pub optional: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Mode bits to use on created files by default. Must be a value between 0 and + /// 0777. Defaults to 0644. Directories within the path are not affected by + /// this setting. This might be in conflict with other options that affect the + /// file mode, like fsGroup, and the result can be other mode bits set. + #[serde(rename="defaultMode")] + pub default_mode: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Name of the config. + pub name: Option, +} + +impl Part for ConfigMapVolumeSource {} + + +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// ````text +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:jose@example.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// ```` +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// jose@example.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run on GKE: supported +/// +/// Namespace provides a scope for Names. +/// Use of multiple namespaces is optional. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [services delete namespaces](struct.NamespaceServiceDeleteCall.html) (none) +/// * [services create namespaces](struct.NamespaceServiceCreateCall.html) (none) +/// * [routes get namespaces](struct.NamespaceRouteGetCall.html) (none) +/// * [services get namespaces](struct.NamespaceServiceGetCall.html) (none) +/// * [v1 namespaces patch api](struct.ApiV1NamespacePatchCall.html) (request|response) +/// * [domainmappings delete namespaces](struct.NamespaceDomainmappingDeleteCall.html) (none) +/// * [locations namespaces patch projects](struct.ProjectLocationNamespacePatchCall.html) (request|response) +/// * [v1 namespaces get api](struct.ApiV1NamespaceGetCall.html) (response) +/// * [authorizeddomains list namespaces](struct.NamespaceAuthorizeddomainListCall.html) (none) +/// * [configurations get namespaces](struct.NamespaceConfigurationGetCall.html) (none) +/// * [routes list namespaces](struct.NamespaceRouteListCall.html) (none) +/// * [services list namespaces](struct.NamespaceServiceListCall.html) (none) +/// * [revisions get namespaces](struct.NamespaceRevisionGetCall.html) (none) +/// * [revisions list namespaces](struct.NamespaceRevisionListCall.html) (none) +/// * [services replace service namespaces](struct.NamespaceServiceReplaceServiceCall.html) (none) +/// * [configurations list namespaces](struct.NamespaceConfigurationListCall.html) (none) +/// * [domainmappings get namespaces](struct.NamespaceDomainmappingGetCall.html) (none) +/// * [locations namespaces get projects](struct.ProjectLocationNamespaceGetCall.html) (response) +/// * [domainmappings create namespaces](struct.NamespaceDomainmappingCreateCall.html) (none) +/// * [revisions delete namespaces](struct.NamespaceRevisionDeleteCall.html) (none) +/// * [domainmappings list namespaces](struct.NamespaceDomainmappingListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Namespace { + /// Status describes the current status of a Namespace. + /// More info: + /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + pub status: Option, + /// Spec defines the behavior of the Namespace. + /// More info: + /// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + pub spec: Option, + /// Standard object's metadata. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + pub metadata: Option, +} + +impl RequestValue for Namespace {} +impl Resource for Namespace {} +impl ResponseResult for Namespace {} + + +/// A list of Authorized Domains. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [authorizeddomains list namespaces](struct.NamespaceAuthorizeddomainListCall.html) (response) +/// * [locations authorizeddomains list projects](struct.ProjectLocationAuthorizeddomainListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAuthorizedDomainsResponse { + /// The authorized domains belonging to the user. + pub domains: Option>, + /// Continuation token for fetching the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for ListAuthorizedDomainsResponse {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run on GKE: supported +/// +/// Secret holds secret data of a certain type. The total bytes of the values in +/// the Data field must be less than MaxSecretSize bytes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [v1 namespaces secrets create api](struct.ApiV1NamespaceSecretCreateCall.html) (request|response) +/// * [locations secrets get projects](struct.ProjectLocationSecretGetCall.html) (response) +/// * [locations secrets create projects](struct.ProjectLocationSecretCreateCall.html) (request|response) +/// * [locations secrets replace secret projects](struct.ProjectLocationSecretReplaceSecretCall.html) (request|response) +/// * [v1 namespaces secrets replace secret api](struct.ApiV1NamespaceSecretReplaceSecretCall.html) (request|response) +/// * [v1 namespaces secrets get api](struct.ApiV1NamespaceSecretGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Secret { + /// stringData allows specifying non-binary secret data in string form. + /// It is provided as a write-only convenience method. + /// All keys and values are merged into the data field on write, overwriting + /// any existing values. It is never output when reading from the API. + /// +k8s:conversion-gen=false + #[serde(rename="stringData")] + pub string_data: Option>, + /// Standard object's metadata. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + pub metadata: Option, + /// Used to facilitate programmatic handling of secret data. + #[serde(rename="type")] + pub type_: Option, + /// Data contains the secret data. Each key must consist of alphanumeric + /// characters, '-', '_' or '.'. The serialized form of the secret data is a + /// base64 encoded string, representing the arbitrary (possibly non-string) + /// data value here. Described in https://tools.ietf.org/html/rfc4648#section-4 + pub data: Option>, +} + +impl RequestValue for Secret {} +impl ResponseResult for Secret {} + + +/// A domain that a user has been authorized to administer. To authorize use +/// of a domain, verify ownership via +/// [Webmaster Central](https://www.google.com/webmasters/verification/home). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuthorizedDomain { + /// Relative name of the domain authorized for use. Example: `example.com`. + pub id: Option, + /// Read only. Full path to the `AuthorizedDomain` resource in the API. + /// Example: `apps/myapp/authorizedDomains/example.com`. + pub name: Option, +} + +impl Part for AuthorizedDomain {} + + +/// The response message for Locations.ListLocations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLocationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of locations that matches the specified filter in the request. + pub locations: Option>, +} + +impl ResponseResult for ListLocationsResponse {} + + +/// A resource that represents Google Cloud Platform location. +/// +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Location { @@ -387,7 +1971,1336 @@ pub struct Location { pub metadata: Option>, } -impl ResponseResult for Location {} +impl Part for Location {} + + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. +/// +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** +/// +/// ````text +/// { +/// "bindings": [ +/// { +/// "role": "roles/resourcemanager.organizationAdmin", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +/// ] +/// }, +/// { +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } +/// } +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 +/// } +/// ```` +/// +/// **YAML example:** +/// +/// ````text +/// bindings: +/// - members: +/// - user:mike@example.com +/// - group:admins@example.com +/// - domain:google.com +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin +/// - members: +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 +/// ```` +/// +/// For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations services get iam policy projects](struct.ProjectLocationServiceGetIamPolicyCall.html) (response) +/// * [locations services set iam policy projects](struct.ProjectLocationServiceSetIamPolicyCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + pub etag: Option, + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. + pub bindings: Option>, + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. + pub version: Option, +} + +impl ResponseResult for Policy {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// SecurityContext holds security configuration that will be applied to a +/// container. Some fields are present in both SecurityContext and +/// PodSecurityContext. When both are set, the values in SecurityContext take +/// precedence. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecurityContext { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The UID to run the entrypoint of the container process. + /// Defaults to user specified in image metadata if unspecified. + /// May also be set in PodSecurityContext. If set in both SecurityContext and + /// PodSecurityContext, the value specified in SecurityContext takes + /// precedence. + #[serde(rename="runAsUser")] + pub run_as_user: Option, +} + +impl Part for SecurityContext {} + + +/// StatusDetails is a set of additional properties that MAY be set by the +/// server to provide additional information about a response. The Reason +/// field of a Status object defines what attributes will be set. Clients +/// must ignore fields that do not match the defined type of each attribute, +/// and should assume that any attribute may be empty, invalid, or under +/// defined. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StatusDetails { + /// The kind attribute of the resource associated with the status StatusReason. + /// On some operations may differ from the requested resource Kind. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds + /// +optional + pub kind: Option, + /// The group attribute of the resource associated with the status + /// StatusReason. +optional + pub group: Option, + /// UID of the resource. + /// (when there is a single resource which can be described). + /// More info: http://kubernetes.io/docs/user-guide/identifiers#uids + /// +optional + pub uid: Option, + /// If specified, the time in seconds before the operation should be retried. + /// Some errors may indicate the client must take an alternate action - for + /// those errors this field may indicate how long to wait before taking the + /// alternate action. +optional + #[serde(rename="retryAfterSeconds")] + pub retry_after_seconds: Option, + /// The Causes array includes more details associated with the StatusReason + /// failure. Not all StatusReasons may provide detailed causes. + /// +optional + pub causes: Option>, + /// The name attribute of the resource associated with the status StatusReason + /// (when there is a single name which can be described). + /// +optional + pub name: Option, +} + +impl Part for StatusDetails {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// EnvFromSource represents the source of a set of ConfigMaps +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnvFromSource { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// An optional identifier to prepend to each key in the ConfigMap. Must be a + /// C_IDENTIFIER. + pub prefix: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The ConfigMap to select from + #[serde(rename="configMapRef")] + pub config_map_ref: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The Secret to select from + #[serde(rename="secretRef")] + pub secret_ref: Option, +} + +impl Part for EnvFromSource {} + + +/// OwnerReference contains enough information to let you identify an owning +/// object. Currently, an owning object must be in the same namespace, so there +/// is no namespace field. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OwnerReference { + /// Kind of the referent. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds + pub kind: Option, + /// If true, AND if the owner has the "foregroundDeletion" finalizer, then + /// the owner cannot be deleted from the key-value store until this + /// reference is removed. + /// Defaults to false. + /// To set this field, a user needs "delete" permission of the owner, + /// otherwise 422 (Unprocessable Entity) will be returned. + /// +optional + #[serde(rename="blockOwnerDeletion")] + pub block_owner_deletion: Option, + /// UID of the referent. + /// More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, + /// If true, this reference points to the managing controller. + /// +optional + pub controller: Option, + /// API version of the referent. + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Name of the referent. + /// More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, +} + +impl Part for OwnerReference {} + + +/// RouteStatus communicates the observed state of the Route (from the +/// controller). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RouteStatus { + /// ObservedGeneration is the 'Generation' of the Route that + /// was last processed by the controller. + /// + /// Clients polling for completed reconciliation should poll until + /// observedGeneration = metadata.generation and the Ready condition's status + /// is True or False. + /// + /// Note that providing a trafficTarget that only has a configurationName will + /// result in a Route that does not increment either its metadata.generation or + /// its observedGeneration, as new "latest ready" revisions from the + /// Configuration are processed without an update to the Route's spec. + #[serde(rename="observedGeneration")] + pub observed_generation: Option, + /// Conditions communicates information about ongoing/complete + /// reconciliation processes that bring the "spec" inline with the observed + /// state of the world. + pub conditions: Option>, + /// Traffic holds the configured traffic distribution. + /// These entries will always contain RevisionName references. + /// When ConfigurationName appears in the spec, this will hold the + /// LatestReadyRevisionName that we last observed. + pub traffic: Option>, + /// URL holds the url that will distribute traffic over the provided traffic + /// targets. It generally has the form: + /// https://{route-hash}-{project-hash}-{cluster-level-suffix}.a.run.app + pub url: Option, + /// Similar to url, information on where the service is available on HTTP. + pub address: Option, +} + +impl Part for RouteStatus {} + + +/// ConfigurationStatus communicates the observed state of the Configuration +/// (from the controller). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConfigurationStatus { + /// LatestCreatedRevisionName is the last revision that was created from this + /// Configuration. It might not be ready yet, for that use + /// LatestReadyRevisionName. + #[serde(rename="latestCreatedRevisionName")] + pub latest_created_revision_name: Option, + /// ObservedGeneration is the 'Generation' of the Configuration that + /// was last processed by the controller. The observed generation is updated + /// even if the controller failed to process the spec and create the Revision. + /// + /// Clients polling for completed reconciliation should poll until + /// observedGeneration = metadata.generation, and the Ready condition's status + /// is True or False. + #[serde(rename="observedGeneration")] + pub observed_generation: Option, + /// Conditions communicates information about ongoing/complete + /// reconciliation processes that bring the "spec" inline with the observed + /// state of the world. + pub conditions: Option>, + /// LatestReadyRevisionName holds the name of the latest Revision stamped out + /// from this Configuration that has had its "Ready" condition become "True". + #[serde(rename="latestReadyRevisionName")] + pub latest_ready_revision_name: Option, +} + +impl Part for ConfigurationStatus {} + + +/// The current state of the Domain Mapping. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DomainMappingStatus { + /// ObservedGeneration is the 'Generation' of the DomainMapping that + /// was last processed by the controller. + /// + /// Clients polling for completed reconciliation should poll until + /// observedGeneration = metadata.generation and the Ready condition's status + /// is True or False. + #[serde(rename="observedGeneration")] + pub observed_generation: Option, + /// Array of observed DomainMappingConditions, indicating the current state + /// of the DomainMapping. + pub conditions: Option>, + /// The resource records required to configure this domain mapping. These + /// records must be added to the domain's DNS configuration in order to + /// serve the application via this domain mapping. + #[serde(rename="resourceRecords")] + pub resource_records: Option>, + /// The name of the route that the mapping currently points to. + #[serde(rename="mappedRouteName")] + pub mapped_route_name: Option, +} + +impl Part for DomainMappingStatus {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// Volume represents a named volume in a container. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Volume { + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + #[serde(rename="configMap")] + pub config_map: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + pub secret: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Volume's name. + pub name: Option, +} + +impl Part for Volume {} + + +/// Resource to hold the state and status of a user's domain mapping. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations domainmappings create projects](struct.ProjectLocationDomainmappingCreateCall.html) (request|response) +/// * [domainmappings get namespaces](struct.NamespaceDomainmappingGetCall.html) (response) +/// * [domainmappings create namespaces](struct.NamespaceDomainmappingCreateCall.html) (request|response) +/// * [locations domainmappings get projects](struct.ProjectLocationDomainmappingGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DomainMapping { + /// The current status of the DomainMapping. + pub status: Option, + /// The kind of resource, in this case "DomainMapping". + pub kind: Option, + /// The spec for this DomainMapping. + pub spec: Option, + /// The API version for this call such as "domains.cloudrun.com/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Metadata associated with this BuildTemplate. + pub metadata: Option, +} + +impl RequestValue for DomainMapping {} +impl ResponseResult for DomainMapping {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run on GKE: supported +/// +/// NamespaceSpec describes the attributes on a Namespace. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NamespaceSpec { + /// Finalizers is an opaque list of values that must be empty to permanently + /// remove object from storage. More info: + /// https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ + pub finalizers: Option>, +} + +impl Part for NamespaceSpec {} + + +/// Configuration represents the "floating HEAD" of a linear history of +/// Revisions, and optionally how the containers those revisions reference are +/// built. Users create new Revisions by updating the Configuration's spec. The +/// "latest created" revision's name is available under status, as is the "latest +/// ready" revision's name. See also: +/// https://github.com/knative/serving/blob/master/docs/spec/overview.md#configuration +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [configurations get namespaces](struct.NamespaceConfigurationGetCall.html) (response) +/// * [locations configurations get projects](struct.ProjectLocationConfigurationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Configuration { + /// Status communicates the observed state of the Configuration (from the + /// controller). + pub status: Option, + /// The kind of resource, in this case always "Configuration". + pub kind: Option, + /// Spec holds the desired state of the Configuration (from the client). + pub spec: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Metadata associated with this Configuration, including name, namespace, + /// labels, and annotations. + pub metadata: Option, +} + +impl ResponseResult for Configuration {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// Selects a key from a ConfigMap. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConfigMapKeySelector { + /// This field should not be used directly as it is meant to be inlined + /// directly into the message. Use the "name" field instead. + #[serde(rename="localObjectReference")] + pub local_object_reference: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Specify whether the ConfigMap or its key must be defined + pub optional: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The ConfigMap to select from. + pub name: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The key to select. + pub key: Option, +} + +impl Part for ConfigMapKeySelector {} + + +/// StatusCause provides more information about an api.Status failure, including +/// cases when multiple errors are encountered. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StatusCause { + /// The field of the resource that has caused this error, as named by its JSON + /// serialization. May include dot and postfix notation for nested attributes. + /// Arrays are zero-indexed. Fields may appear more than once in an array of + /// causes due to fields having multiple errors. + /// Optional. + /// + /// Examples: + /// "name" - the field "name" on the current resource + /// "items[0].name" - the field "name" on the first array entry in "items" + /// +optional + pub field: Option, + /// A human-readable description of the cause of the error. This field may be + /// presented as-is to a reader. + /// +optional + pub message: Option, + /// A machine-readable description of the cause of the error. If this value is + /// empty there is no information available. + /// +optional + pub reason: Option, +} + +impl Part for StatusCause {} + + +/// Request message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations services test iam permissions projects](struct.ProjectLocationServiceTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. Permissions with + /// wildcards (such as '*' or 'storage.*') are not allowed. For more + /// information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + +/// ListMeta describes metadata that synthetic resources must have, including +/// lists and various status objects. A resource may have only one of +/// {ObjectMeta, ListMeta}. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListMeta { + /// continue may be set if the user set a limit on the number of items + /// returned, and indicates that the server has more data available. The value + /// is opaque and may be used to issue another request to the endpoint that + /// served this list to retrieve the next set of available objects. Continuing + /// a list may not be possible if the server configuration has changed or more + /// than a few minutes have passed. The resourceVersion field returned when + /// using this continue value will be identical to the value in the first + /// response. + #[serde(rename="continue")] + pub continue_: Option, + /// SelfLink is a URL representing this object. + /// Populated by the system. + /// Read-only. + /// +optional + #[serde(rename="selfLink")] + pub self_link: Option, + /// String that identifies the server's internal version of this object that + /// can be used by clients to determine when objects have changed. Value must + /// be treated as opaque by clients and passed unmodified back to the server. + /// Populated by the system. + /// Read-only. + /// More info: + /// https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency + /// +optional + #[serde(rename="resourceVersion")] + pub resource_version: Option, +} + +impl Part for ListMeta {} + + +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): +/// +/// ````text +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" +/// ```` +/// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Expr { + /// Optional. Description of the expression. This is a longer text which + /// describes the expression, e.g. when hovered over it in a UI. + pub description: Option, + /// Textual representation of an expression in Common Expression Language + /// syntax. + pub expression: Option, + /// Optional. String indicating the location of the expression for error + /// reporting, e.g. a file name and a position in the file. + pub location: Option, + /// Optional. Title for the expression, i.e. a short string describing + /// its purpose. This can be used e.g. in UIs which allow to enter the + /// expression. + pub title: Option, +} + +impl Part for Expr {} + + +/// Route is responsible for configuring ingress over a collection of Revisions. +/// Some of the Revisions a Route distributes traffic over may be specified by +/// referencing the Configuration responsible for creating them; in these cases +/// the Route is additionally responsible for monitoring the Configuration for +/// "latest ready" revision changes, and smoothly rolling out latest revisions. +/// See also: +/// https://github.com/knative/serving/blob/master/docs/spec/overview.md#route +/// +/// Cloud Run currently supports referencing a single Configuration to +/// automatically deploy the "latest ready" Revision from that Configuration. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [routes get namespaces](struct.NamespaceRouteGetCall.html) (response) +/// * [locations routes get projects](struct.ProjectLocationRouteGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Route { + /// Status communicates the observed state of the Route (from the controller). + pub status: Option, + /// The kind of this resource, in this case always "Route". + pub kind: Option, + /// Spec holds the desired state of the Route (from the client). + pub spec: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Metadata associated with this Route, including name, namespace, labels, + /// and annotations. + pub metadata: Option, +} + +impl ResponseResult for Route {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run on GKE: supported +/// +/// NamespaceStatus is information about the current status of a Namespace. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NamespaceStatus { + /// Phase is the current lifecycle phase of the namespace. + /// More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ + pub phase: Option, +} + +impl Part for NamespaceStatus {} + + +/// Condition defines a generic condition for a Resource +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudRunV1Condition { + /// Status of the condition, one of True, False, Unknown. + pub status: Option, + /// Optional. One-word CamelCase reason for the condition's last transition. + pub reason: Option, + /// Optional. How to interpret failures of this condition, one of Error, Warning, Info + pub severity: Option, + /// type is used to communicate the status of the reconciliation process. + /// See also: + /// https://github.com/knative/serving/blob/master/docs/spec/errors.md#error-conditions-and-reporting + /// Types common to all resources include: + /// * "Ready": True when the Resource is ready. + #[serde(rename="type")] + pub type_: Option, + /// Optional. Human readable message indicating details about the current status. + pub message: Option, + /// Optional. Last time the condition transitioned from one status to another. + #[serde(rename="lastTransitionTime")] + pub last_transition_time: Option, +} + +impl Part for GoogleCloudRunV1Condition {} + + +/// ListRoutesResponse is a list of Route resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations routes list projects](struct.ProjectLocationRouteListCall.html) (response) +/// * [routes list namespaces](struct.NamespaceRouteListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListRoutesResponse { + /// List of Routes. + pub items: Option>, + /// The kind of this resource, in this case always "RouteList". + pub kind: Option, + /// Metadata associated with this Route list. + pub metadata: Option, + /// The API version for this call such as "serving.knative.dev/v1". + #[serde(rename="apiVersion")] + pub api_version: Option, + /// Locations that could not be reached. + pub unreachable: Option>, +} + +impl ResponseResult for ListRoutesResponse {} + + +/// ConfigurationSpec holds the desired state of the Configuration (from the +/// client). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ConfigurationSpec { + /// Optional metadata for this Revision, including labels and annotations. Name + /// will be generated by the Configuration. + /// To set minimum instances for this revision, use the + /// "autoscaling.knative.dev/minScale" annotation key. (Cloud Run for Anthos + /// only). To set maximum instances for this revision, use the + /// "autoscaling.knative.dev/maxScale" annotation key. + /// To set Cloud SQL connections for the revision, use the + /// "run.googleapis.com/cloudsql-instances" annotation key. Values should be + /// comma separated. + pub template: Option, +} + +impl Part for ConfigurationSpec {} + + +/// EnvVar represents an environment variable present in a Container. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnvVar { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Source for the environment variable's value. Cannot be used if value is not + /// empty. + #[serde(rename="valueFrom")] + pub value_from: Option, + /// Name of the environment variable. Must be a C_IDENTIFIER. + pub name: Option, + /// (Optional) + /// + /// Variable references $(VAR_NAME) are expanded + /// using the previous defined environment variables in the container and + /// any route environment variables. If a variable cannot be resolved, + /// the reference in the input string will be unchanged. The $(VAR_NAME) + /// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped + /// references will never be expanded, regardless of whether the variable + /// exists or not. + /// Defaults to "". + pub value: Option, +} + +impl Part for EnvVar {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// Maps a string key to a path within a volume. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeyToPath { + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The relative path of the file to map the key to. + /// May not be an absolute path. + /// May not contain the path element '..'. + /// May not start with the string '..'. + pub path: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Mode bits to use on this file, must be a value between 0 and 0777. If not + /// specified, the volume defaultMode will be used. This might be in conflict + /// with other options that affect the file mode, like fsGroup, and the result + /// can be other mode bits set. + pub mode: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The key to project. + pub key: Option, +} + +impl Part for KeyToPath {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// Probe describes a health check to be performed against a container to +/// determine whether it is alive or ready to receive traffic. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Probe { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// HTTPGet specifies the http request to perform. + /// + /// A field inlined from the Handler message. + #[serde(rename="httpGet")] + pub http_get: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Number of seconds after which the probe times out. + /// Defaults to 1 second. Minimum value is 1. + /// More info: + /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + #[serde(rename="timeoutSeconds")] + pub timeout_seconds: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// One and only one of the following should be specified. + /// Exec specifies the action to take. + /// + /// A field inlined from the Handler message. + pub exec: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Number of seconds after the container has started before liveness probes + /// are initiated. More info: + /// https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + #[serde(rename="initialDelaySeconds")] + pub initial_delay_seconds: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// TCPSocket specifies an action involving a TCP port. + /// TCP hooks not yet supported + /// + /// A field inlined from the Handler message. + #[serde(rename="tcpSocket")] + pub tcp_socket: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// How often (in seconds) to perform the probe. + /// Default to 10 seconds. Minimum value is 1. + #[serde(rename="periodSeconds")] + pub period_seconds: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Minimum consecutive successes for the probe to be considered successful + /// after having failed. Defaults to 1. Must be 1 for liveness. Minimum value + /// is 1. + #[serde(rename="successThreshold")] + pub success_threshold: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Minimum consecutive failures for the probe to be considered failed after + /// having succeeded. Defaults to 3. Minimum value is 1. + #[serde(rename="failureThreshold")] + pub failure_threshold: Option, +} + +impl Part for Probe {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// SecretKeySelector selects a key of a Secret. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecretKeySelector { + /// This field should not be used directly as it is meant to be inlined + /// directly into the message. Use the "name" field instead. + #[serde(rename="localObjectReference")] + pub local_object_reference: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Specify whether the Secret or its key must be defined + pub optional: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The name of the secret in the pod's namespace to select from. + pub name: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The key of the secret to select from. Must be a valid secret key. + pub key: Option, +} + +impl Part for SecretKeySelector {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// The contents of the target Secret's Data field will be presented in a volume +/// as files using the keys in the Data field as the file names. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecretVolumeSource { + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// If unspecified, each key-value pair in the Data field of the referenced + /// Secret will be projected into the volume as a file whose name is the + /// key and content is the value. If specified, the listed keys will be + /// projected into the specified paths, and unlisted keys will not be + /// present. If a key is specified which is not present in the Secret, + /// the volume setup will error unless it is marked optional. + pub items: Option>, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Specify whether the Secret or its keys must be defined. + pub optional: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Mode bits to use on created files by default. Must be a value between 0 and + /// 0777. Defaults to 0644. Directories within the path are not affected by + /// this setting. This might be in conflict with other options that affect the + /// file mode, like fsGroup, and the result can be other mode bits set. + #[serde(rename="defaultMode")] + pub default_mode: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Name of the secret in the container's namespace to use. + #[serde(rename="secretName")] + pub secret_name: Option, +} + +impl Part for SecretVolumeSource {} + + +/// Specifies the audit configuration for a service. +/// The configuration determines which permission types are logged, and what +/// identities, if any, are exempted from logging. +/// An AuditConfig must have one or more AuditLogConfigs. +/// +/// If there are AuditConfigs for both `allServices` and a specific service, +/// the union of the two AuditConfigs is used for that service: the log_types +/// specified in each AuditConfig are enabled, and the exempted_members in each +/// AuditLogConfig are exempted. +/// +/// Example Policy with multiple AuditConfigs: +/// +/// ````text +/// { +/// "audit_configs": [ +/// { +/// "service": "allServices" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:jose@example.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// }, +/// { +/// "log_type": "ADMIN_READ", +/// } +/// ] +/// }, +/// { +/// "service": "sampleservice.googleapis.com" +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// "exempted_members": [ +/// "user:aliya@example.com" +/// ] +/// } +/// ] +/// } +/// ] +/// } +/// ```` +/// +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditConfig { + /// The configuration for logging of each type of permission. + #[serde(rename="auditLogConfigs")] + pub audit_log_configs: Option>, + /// Specifies a service that will be enabled for audit logging. + /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + /// `allServices` is a special value that covers all services. + pub service: Option, +} + +impl Part for AuditConfig {} + + +/// The current state of the Service. Output only. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceStatus { + /// ObservedGeneration is the 'Generation' of the Route that + /// was last processed by the controller. + /// + /// Clients polling for completed reconciliation should poll until + /// observedGeneration = metadata.generation and the Ready condition's status + /// is True or False. + #[serde(rename="observedGeneration")] + pub observed_generation: Option, + /// From RouteStatus. + /// Traffic holds the configured traffic distribution. + /// These entries will always contain RevisionName references. + /// When ConfigurationName appears in the spec, this will hold the + /// LatestReadyRevisionName that we last observed. + pub traffic: Option>, + /// From ConfigurationStatus. + /// LatestReadyRevisionName holds the name of the latest Revision stamped out + /// from this Service's Configuration that has had its "Ready" condition become + /// "True". + #[serde(rename="latestReadyRevisionName")] + pub latest_ready_revision_name: Option, + /// From RouteStatus. + /// URL holds the url that will distribute traffic over the provided traffic + /// targets. It generally has the form + /// https://{route-hash}-{project-hash}-{cluster-level-suffix}.a.run.app + pub url: Option, + /// From RouteStatus. + /// Similar to url, information on where the service is available on HTTP. + pub address: Option, + /// Conditions communicates information about ongoing/complete + /// reconciliation processes that bring the "spec" inline with the observed + /// state of the world. + /// Service-specific conditions include: + /// * "ConfigurationsReady": true when the underlying Configuration is ready. + /// * "RoutesReady": true when the underlying Route is ready. + /// * "Ready": true when both the underlying Route and Configuration are + /// ready. + pub conditions: Option>, + /// From ConfigurationStatus. + /// LatestCreatedRevisionName is the last revision that was created from this + /// Service's Configuration. It might not be ready yet, for that use + /// LatestReadyRevisionName. + #[serde(rename="latestCreatedRevisionName")] + pub latest_created_revision_name: Option, +} + +impl Part for ServiceStatus {} + + +/// RevisionStatus communicates the observed state of the Revision (from the +/// controller). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevisionStatus { + /// ObservedGeneration is the 'Generation' of the Revision that + /// was last processed by the controller. + /// + /// Clients polling for completed reconciliation should poll until + /// observedGeneration = metadata.generation, and the Ready condition's status + /// is True or False. + #[serde(rename="observedGeneration")] + pub observed_generation: Option, + /// Conditions communicates information about ongoing/complete + /// reconciliation processes that bring the "spec" inline with the observed + /// state of the world. + /// + /// As a Revision is being prepared, it will incrementally + /// update conditions. Revision-specific conditions include: + /// * "ResourcesAvailable": True when underlying resources have been + /// provisioned. + /// * "ContainerHealthy": True when the Revision readiness check completes. + /// * "Active": True when the Revision may receive traffic. + pub conditions: Option>, + /// Not currently used by Cloud Run. + #[serde(rename="serviceName")] + pub service_name: Option, + /// ImageDigest holds the resolved digest for the image specified + /// within .Spec.Container.Image. The digest is resolved during the creation + /// of Revision. This field holds the digest value regardless of whether + /// a tag or digest was originally specified in the Container object. + #[serde(rename="imageDigest")] + pub image_digest: Option, + /// Specifies the generated logging url for this particular revision + /// based on the revision url template specified in the controller's config. + /// +optional + #[serde(rename="logUrl")] + pub log_url: Option, +} + +impl Part for RevisionStatus {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// HTTPHeader describes a custom header to be used in HTTP probes +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HTTPHeader { + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The header field name + pub name: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The header field value + pub value: Option, +} + +impl Part for HTTPHeader {} + + +/// Cloud Run fully managed: not supported +/// +/// Cloud Run for Anthos: supported +/// +/// SecretEnvSource selects a Secret to populate the environment +/// variables with. +/// +/// The contents of the target Secret's Data field will represent the +/// key-value pairs as environment variables. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SecretEnvSource { + /// This field should not be used directly as it is meant to be inlined + /// directly into the message. Use the "name" field instead. + #[serde(rename="localObjectReference")] + pub local_object_reference: Option, + /// (Optional) + /// + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// Specify whether the Secret must be defined + pub optional: Option, + /// Cloud Run fully managed: not supported + /// + /// Cloud Run for Anthos: supported + /// + /// The Secret to select from. + pub name: Option, +} + +impl Part for SecretEnvSource {} @@ -395,6 +3308,576 @@ impl ResponseResult for Location {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *api* resources. +/// It is not used directly, but through the `CloudRun` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_run1 as run1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use run1::CloudRun; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `v1_namespaces_get(...)`, `v1_namespaces_patch(...)`, `v1_namespaces_secrets_create(...)`, `v1_namespaces_secrets_get(...)` and `v1_namespaces_secrets_replace_secret(...)` +/// // to build up your call. +/// let rb = hub.api(); +/// # } +/// ``` +pub struct ApiMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, +} + +impl<'a, C, A> MethodsBuilder for ApiMethods<'a, C, A> {} + +impl<'a, C, A> ApiMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Rpc to update a namespace. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn v1_namespaces_patch(&self, request: Namespace, name: &str) -> ApiV1NamespacePatchCall<'a, C, A> { + ApiV1NamespacePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rpc to get information about a namespace. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn v1_namespaces_get(&self, name: &str) -> ApiV1NamespaceGetCall<'a, C, A> { + ApiV1NamespaceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new secret. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project ID or project number in which this secret should + /// be created. + pub fn v1_namespaces_secrets_create(&self, request: Secret, parent: &str) -> ApiV1NamespaceSecretCreateCall<'a, C, A> { + ApiV1NamespaceSecretCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rpc to get information about a secret. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the secret being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn v1_namespaces_secrets_get(&self, name: &str) -> ApiV1NamespaceSecretGetCall<'a, C, A> { + ApiV1NamespaceSecretGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rpc to replace a secret. + /// + /// Only the spec and metadata labels and annotations are modifiable. After + /// the Update request, Cloud Run will work to make the 'status' + /// match the requested 'spec'. + /// + /// May provide metadata.resourceVersion to enforce update from last read for + /// optimistic concurrency control. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the secret being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn v1_namespaces_secrets_replace_secret(&self, request: Secret, name: &str) -> ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> { + ApiV1NamespaceSecretReplaceSecretCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *namespace* resources. +/// It is not used directly, but through the `CloudRun` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_run1 as run1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use run1::CloudRun; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `authorizeddomains_list(...)`, `configurations_get(...)`, `configurations_list(...)`, `domainmappings_create(...)`, `domainmappings_delete(...)`, `domainmappings_get(...)`, `domainmappings_list(...)`, `revisions_delete(...)`, `revisions_get(...)`, `revisions_list(...)`, `routes_get(...)`, `routes_list(...)`, `services_create(...)`, `services_delete(...)`, `services_get(...)`, `services_list(...)` and `services_replace_service(...)` +/// // to build up your call. +/// let rb = hub.namespaces(); +/// # } +/// ``` +pub struct NamespaceMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, +} + +impl<'a, C, A> MethodsBuilder for NamespaceMethods<'a, C, A> {} + +impl<'a, C, A> NamespaceMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Get information about a route. + /// + /// # Arguments + /// + /// * `name` - The name of the route to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn routes_get(&self, name: &str) -> NamespaceRouteGetCall<'a, C, A> { + NamespaceRouteGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a service. + /// + /// # Arguments + /// + /// * `name` - The name of the service to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn services_get(&self, name: &str) -> NamespaceServiceGetCall<'a, C, A> { + NamespaceServiceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List authorized domains. + /// + /// # Arguments + /// + /// * `parent` - Name of the parent Application resource. Example: `apps/myapp`. + pub fn authorizeddomains_list(&self, parent: &str) -> NamespaceAuthorizeddomainListCall<'a, C, A> { + NamespaceAuthorizeddomainListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Replace a service. + /// + /// Only the spec and metadata labels and annotations are modifiable. After + /// the Update request, Cloud Run will work to make the 'status' + /// match the requested 'spec'. + /// + /// May provide metadata.resourceVersion to enforce update from last read for + /// optimistic concurrency control. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The name of the service being replaced. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn services_replace_service(&self, request: Service, name: &str) -> NamespaceServiceReplaceServiceCall<'a, C, A> { + NamespaceServiceReplaceServiceCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List domain mappings. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the domain mappings should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn domainmappings_list(&self, parent: &str) -> NamespaceDomainmappingListCall<'a, C, A> { + NamespaceDomainmappingListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a service. + /// This will cause the Service to stop serving traffic and will delete the + /// child entities like Routes, Configurations and Revisions. + /// + /// # Arguments + /// + /// * `name` - The name of the service to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn services_delete(&self, name: &str) -> NamespaceServiceDeleteCall<'a, C, A> { + NamespaceServiceDeleteCall { + hub: self.hub, + _name: name.to_string(), + _propagation_policy: Default::default(), + _kind: Default::default(), + _api_version: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a domain mapping. + /// + /// # Arguments + /// + /// * `name` - The name of the domain mapping to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn domainmappings_delete(&self, name: &str) -> NamespaceDomainmappingDeleteCall<'a, C, A> { + NamespaceDomainmappingDeleteCall { + hub: self.hub, + _name: name.to_string(), + _propagation_policy: Default::default(), + _kind: Default::default(), + _api_version: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List services. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the services should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn services_list(&self, parent: &str) -> NamespaceServiceListCall<'a, C, A> { + NamespaceServiceListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a revision. + /// + /// # Arguments + /// + /// * `name` - The name of the revision to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn revisions_delete(&self, name: &str) -> NamespaceRevisionDeleteCall<'a, C, A> { + NamespaceRevisionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _propagation_policy: Default::default(), + _kind: Default::default(), + _api_version: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List configurations. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the configurations should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn configurations_list(&self, parent: &str) -> NamespaceConfigurationListCall<'a, C, A> { + NamespaceConfigurationListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a service. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The namespace in which the service should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn services_create(&self, request: Service, parent: &str) -> NamespaceServiceCreateCall<'a, C, A> { + NamespaceServiceCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a configuration. + /// + /// # Arguments + /// + /// * `name` - The name of the configuration to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn configurations_get(&self, name: &str) -> NamespaceConfigurationGetCall<'a, C, A> { + NamespaceConfigurationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List revisions. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the revisions should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn revisions_list(&self, parent: &str) -> NamespaceRevisionListCall<'a, C, A> { + NamespaceRevisionListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new domain mapping. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The namespace in which the domain mapping should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn domainmappings_create(&self, request: DomainMapping, parent: &str) -> NamespaceDomainmappingCreateCall<'a, C, A> { + NamespaceDomainmappingCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List routes. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the routes should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn routes_list(&self, parent: &str) -> NamespaceRouteListCall<'a, C, A> { + NamespaceRouteListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a domain mapping. + /// + /// # Arguments + /// + /// * `name` - The name of the domain mapping to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn domainmappings_get(&self, name: &str) -> NamespaceDomainmappingGetCall<'a, C, A> { + NamespaceDomainmappingGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a revision. + /// + /// # Arguments + /// + /// * `name` - The name of the revision to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn revisions_get(&self, name: &str) -> NamespaceRevisionGetCall<'a, C, A> { + NamespaceRevisionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *project* resources. /// It is not used directly, but through the `CloudRun` hub. /// @@ -419,7 +3902,7 @@ impl ResponseResult for Location {} /// ::default(), None); /// let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `locations_get(...)` +/// // like `locations_authorizeddomains_list(...)`, `locations_configurations_get(...)`, `locations_configurations_list(...)`, `locations_domainmappings_create(...)`, `locations_domainmappings_delete(...)`, `locations_domainmappings_get(...)`, `locations_domainmappings_list(...)`, `locations_list(...)`, `locations_namespaces_get(...)`, `locations_namespaces_patch(...)`, `locations_revisions_delete(...)`, `locations_revisions_get(...)`, `locations_revisions_list(...)`, `locations_routes_get(...)`, `locations_routes_list(...)`, `locations_secrets_create(...)`, `locations_secrets_get(...)`, `locations_secrets_replace_secret(...)`, `locations_services_create(...)`, `locations_services_delete(...)`, `locations_services_get(...)`, `locations_services_get_iam_policy(...)`, `locations_services_list(...)`, `locations_services_replace_service(...)`, `locations_services_set_iam_policy(...)` and `locations_services_test_iam_permissions(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -436,15 +3919,567 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets information about a location. + /// Replace a service. + /// + /// Only the spec and metadata labels and annotations are modifiable. After + /// the Update request, Cloud Run will work to make the 'status' + /// match the requested 'spec'. + /// + /// May provide metadata.resourceVersion to enforce update from last read for + /// optimistic concurrency control. /// /// # Arguments /// - /// * `name` - Resource name for the location. - pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { - ProjectLocationGetCall { + /// * `request` - No description provided. + /// * `name` - The name of the service being replaced. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_services_replace_service(&self, request: Service, name: &str) -> ProjectLocationServiceReplaceServiceCall<'a, C, A> { + ProjectLocationServiceReplaceServiceCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List services. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the services should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_services_list(&self, parent: &str) -> ProjectLocationServiceListCall<'a, C, A> { + ProjectLocationServiceListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a domain mapping. + /// + /// # Arguments + /// + /// * `name` - The name of the domain mapping to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_domainmappings_delete(&self, name: &str) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> { + ProjectLocationDomainmappingDeleteCall { hub: self.hub, _name: name.to_string(), + _propagation_policy: Default::default(), + _kind: Default::default(), + _api_version: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists information about the supported locations for this service. + /// + /// # Arguments + /// + /// * `name` - The resource that owns the locations collection, if applicable. + pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List routes. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the routes should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_routes_list(&self, parent: &str) -> ProjectLocationRouteListCall<'a, C, A> { + ProjectLocationRouteListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new domain mapping. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The namespace in which the domain mapping should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_domainmappings_create(&self, request: DomainMapping, parent: &str) -> ProjectLocationDomainmappingCreateCall<'a, C, A> { + ProjectLocationDomainmappingCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List domain mappings. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the domain mappings should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_domainmappings_list(&self, parent: &str) -> ProjectLocationDomainmappingListCall<'a, C, A> { + ProjectLocationDomainmappingListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new secret. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project ID or project number in which this secret should + /// be created. + pub fn locations_secrets_create(&self, request: Secret, parent: &str) -> ProjectLocationSecretCreateCall<'a, C, A> { + ProjectLocationSecretCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List authorized domains. + /// + /// # Arguments + /// + /// * `parent` - Name of the parent Application resource. Example: `apps/myapp`. + pub fn locations_authorizeddomains_list(&self, parent: &str) -> ProjectLocationAuthorizeddomainListCall<'a, C, A> { + ProjectLocationAuthorizeddomainListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rpc to update a namespace. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn locations_namespaces_patch(&self, request: Namespace, name: &str) -> ProjectLocationNamespacePatchCall<'a, C, A> { + ProjectLocationNamespacePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified Project. + /// + /// There are no permissions required for making this API call. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_services_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationServiceTestIamPermissionCall<'a, C, A> { + ProjectLocationServiceTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rpc to get information about a secret. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the secret being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn locations_secrets_get(&self, name: &str) -> ProjectLocationSecretGetCall<'a, C, A> { + ProjectLocationSecretGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a service. + /// + /// # Arguments + /// + /// * `name` - The name of the service to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_services_get(&self, name: &str) -> ProjectLocationServiceGetCall<'a, C, A> { + ProjectLocationServiceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rpc to get information about a namespace. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn locations_namespaces_get(&self, name: &str) -> ProjectLocationNamespaceGetCall<'a, C, A> { + ProjectLocationNamespaceGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a revision. + /// + /// # Arguments + /// + /// * `name` - The name of the revision to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_revisions_get(&self, name: &str) -> ProjectLocationRevisionGetCall<'a, C, A> { + ProjectLocationRevisionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a domain mapping. + /// + /// # Arguments + /// + /// * `name` - The name of the domain mapping to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_domainmappings_get(&self, name: &str) -> ProjectLocationDomainmappingGetCall<'a, C, A> { + ProjectLocationDomainmappingGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a configuration. + /// + /// # Arguments + /// + /// * `name` - The name of the configuration to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_configurations_get(&self, name: &str) -> ProjectLocationConfigurationGetCall<'a, C, A> { + ProjectLocationConfigurationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a service. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - The namespace in which the service should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_services_create(&self, request: Service, parent: &str) -> ProjectLocationServiceCreateCall<'a, C, A> { + ProjectLocationServiceCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a route. + /// + /// # Arguments + /// + /// * `name` - The name of the route to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_routes_get(&self, name: &str) -> ProjectLocationRouteGetCall<'a, C, A> { + ProjectLocationRouteGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the IAM Access control policy for the specified Service. Overwrites + /// any existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_services_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationServiceSetIamPolicyCall<'a, C, A> { + ProjectLocationServiceSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a revision. + /// + /// # Arguments + /// + /// * `name` - The name of the revision to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_revisions_delete(&self, name: &str) -> ProjectLocationRevisionDeleteCall<'a, C, A> { + ProjectLocationRevisionDeleteCall { + hub: self.hub, + _name: name.to_string(), + _propagation_policy: Default::default(), + _kind: Default::default(), + _api_version: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get the IAM Access Control policy currently in effect for the given + /// Cloud Run service. This result does not include any inherited policies. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_services_get_iam_policy(&self, resource: &str) -> ProjectLocationServiceGetIamPolicyCall<'a, C, A> { + ProjectLocationServiceGetIamPolicyCall { + hub: self.hub, + _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List revisions. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the revisions should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_revisions_list(&self, parent: &str) -> ProjectLocationRevisionListCall<'a, C, A> { + ProjectLocationRevisionListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Rpc to replace a secret. + /// + /// Only the spec and metadata labels and annotations are modifiable. After + /// the Update request, Cloud Run will work to make the 'status' + /// match the requested 'spec'. + /// + /// May provide metadata.resourceVersion to enforce update from last read for + /// optimistic concurrency control. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The name of the secret being retrieved. If needed, replace + /// {namespace_id} with the project ID. + pub fn locations_secrets_replace_secret(&self, request: Secret, name: &str) -> ProjectLocationSecretReplaceSecretCall<'a, C, A> { + ProjectLocationSecretReplaceSecretCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// List configurations. + /// + /// # Arguments + /// + /// * `parent` - The namespace from which the configurations should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_configurations_list(&self, parent: &str) -> ProjectLocationConfigurationListCall<'a, C, A> { + ProjectLocationConfigurationListCall { + hub: self.hub, + _parent: parent.to_string(), + _watch: Default::default(), + _resource_version: Default::default(), + _limit: Default::default(), + _label_selector: Default::default(), + _include_uninitialized: Default::default(), + _field_selector: Default::default(), + _continue_: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Delete a service. + /// This will cause the Service to stop serving traffic and will delete the + /// child entities like Routes, Configurations and Revisions. + /// + /// # Arguments + /// + /// * `name` - The name of the service to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + pub fn locations_services_delete(&self, name: &str) -> ProjectLocationServiceDeleteCall<'a, C, A> { + ProjectLocationServiceDeleteCall { + hub: self.hub, + _name: name.to_string(), + _propagation_policy: Default::default(), + _kind: Default::default(), + _api_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -460,9 +4495,6591 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Gets information about a location. +/// Rpc to update a namespace. /// -/// A builder for the *locations.get* method supported by a *project* resource. +/// A builder for the *v1.namespaces.patch* method supported by a *api* resource. +/// It is not used directly, but through a `ApiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Namespace; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Namespace::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.api().v1_namespaces_patch(req, "name") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct ApiV1NamespacePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Namespace, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ApiV1NamespacePatchCall<'a, C, A> {} + +impl<'a, C, A> ApiV1NamespacePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Namespace)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.api.v1.namespaces.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "api/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Namespace) -> ApiV1NamespacePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ApiV1NamespacePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Indicates which fields in the provided namespace to update. + /// This field is currently unused. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ApiV1NamespacePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ApiV1NamespacePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ApiV1NamespacePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ApiV1NamespacePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rpc to get information about a namespace. +/// +/// A builder for the *v1.namespaces.get* method supported by a *api* resource. +/// It is not used directly, but through a `ApiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.api().v1_namespaces_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ApiV1NamespaceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ApiV1NamespaceGetCall<'a, C, A> {} + +impl<'a, C, A> ApiV1NamespaceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Namespace)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.api.v1.namespaces.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "api/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ApiV1NamespaceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ApiV1NamespaceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ApiV1NamespaceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ApiV1NamespaceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new secret. +/// +/// A builder for the *v1.namespaces.secrets.create* method supported by a *api* resource. +/// It is not used directly, but through a `ApiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Secret; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Secret::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.api().v1_namespaces_secrets_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ApiV1NamespaceSecretCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Secret, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ApiV1NamespaceSecretCreateCall<'a, C, A> {} + +impl<'a, C, A> ApiV1NamespaceSecretCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Secret)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.api.v1.namespaces.secrets.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "api/v1/{+parent}/secrets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Secret) -> ApiV1NamespaceSecretCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project ID or project number in which this secret should + /// be created. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ApiV1NamespaceSecretCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ApiV1NamespaceSecretCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ApiV1NamespaceSecretCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ApiV1NamespaceSecretCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rpc to get information about a secret. +/// +/// A builder for the *v1.namespaces.secrets.get* method supported by a *api* resource. +/// It is not used directly, but through a `ApiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.api().v1_namespaces_secrets_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ApiV1NamespaceSecretGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ApiV1NamespaceSecretGetCall<'a, C, A> {} + +impl<'a, C, A> ApiV1NamespaceSecretGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Secret)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.api.v1.namespaces.secrets.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "api/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the secret being retrieved. If needed, replace + /// {namespace_id} with the project ID. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ApiV1NamespaceSecretGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ApiV1NamespaceSecretGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ApiV1NamespaceSecretGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ApiV1NamespaceSecretGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rpc to replace a secret. +/// +/// Only the spec and metadata labels and annotations are modifiable. After +/// the Update request, Cloud Run will work to make the 'status' +/// match the requested 'spec'. +/// +/// May provide metadata.resourceVersion to enforce update from last read for +/// optimistic concurrency control. +/// +/// A builder for the *v1.namespaces.secrets.replaceSecret* method supported by a *api* resource. +/// It is not used directly, but through a `ApiMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Secret; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Secret::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.api().v1_namespaces_secrets_replace_secret(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Secret, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> {} + +impl<'a, C, A> ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Secret)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.api.v1.namespaces.secrets.replaceSecret", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "api/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Secret) -> ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the secret being retrieved. If needed, replace + /// {namespace_id} with the project ID. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ApiV1NamespaceSecretReplaceSecretCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a route. +/// +/// A builder for the *routes.get* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().routes_get("name") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceRouteGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceRouteGetCall<'a, C, A> {} + +impl<'a, C, A> NamespaceRouteGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Route)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.routes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the route to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceRouteGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceRouteGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceRouteGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceRouteGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a service. +/// +/// A builder for the *services.get* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().services_get("name") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceServiceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceServiceGetCall<'a, C, A> {} + +impl<'a, C, A> NamespaceServiceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.services.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the service to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceServiceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceServiceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceServiceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceServiceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List authorized domains. +/// +/// A builder for the *authorizeddomains.list* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().authorizeddomains_list("parent") +/// .page_token("eos") +/// .page_size(-81) +/// .doit(); +/// # } +/// ``` +pub struct NamespaceAuthorizeddomainListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceAuthorizeddomainListCall<'a, C, A> {} + +impl<'a, C, A> NamespaceAuthorizeddomainListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAuthorizedDomainsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.authorizeddomains.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/domains.cloudrun.com/v1/{+parent}/authorizeddomains"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the parent Application resource. Example: `apps/myapp`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceAuthorizeddomainListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> NamespaceAuthorizeddomainListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum results to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> NamespaceAuthorizeddomainListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceAuthorizeddomainListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceAuthorizeddomainListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceAuthorizeddomainListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Replace a service. +/// +/// Only the spec and metadata labels and annotations are modifiable. After +/// the Update request, Cloud Run will work to make the 'status' +/// match the requested 'spec'. +/// +/// May provide metadata.resourceVersion to enforce update from last read for +/// optimistic concurrency control. +/// +/// A builder for the *services.replaceService* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Service; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Service::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.namespaces().services_replace_service(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceServiceReplaceServiceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Service, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceServiceReplaceServiceCall<'a, C, A> {} + +impl<'a, C, A> NamespaceServiceReplaceServiceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.services.replaceService", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Service) -> NamespaceServiceReplaceServiceCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the service being replaced. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceServiceReplaceServiceCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceServiceReplaceServiceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceServiceReplaceServiceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceServiceReplaceServiceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List domain mappings. +/// +/// A builder for the *domainmappings.list* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().domainmappings_list("parent") +/// .watch(true) +/// .resource_version("elitr") +/// .limit(-97) +/// .label_selector("no") +/// .include_uninitialized(true) +/// .field_selector("eirmod") +/// .continue_("dolore") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceDomainmappingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceDomainmappingListCall<'a, C, A> {} + +impl<'a, C, A> NamespaceDomainmappingListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDomainMappingsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.domainmappings.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/domains.cloudrun.com/v1/{+parent}/domainmappings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the domain mappings should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceDomainmappingListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> NamespaceDomainmappingListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> NamespaceDomainmappingListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> NamespaceDomainmappingListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> NamespaceDomainmappingListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> NamespaceDomainmappingListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> NamespaceDomainmappingListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> NamespaceDomainmappingListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceDomainmappingListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceDomainmappingListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceDomainmappingListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a service. +/// This will cause the Service to stop serving traffic and will delete the +/// child entities like Routes, Configurations and Revisions. +/// +/// A builder for the *services.delete* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().services_delete("name") +/// .propagation_policy("aliquyam") +/// .kind("accusam") +/// .api_version("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceServiceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _propagation_policy: Option, + _kind: Option, + _api_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceServiceDeleteCall<'a, C, A> {} + +impl<'a, C, A> NamespaceServiceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Status)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.services.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._propagation_policy { + params.push(("propagationPolicy", value.to_string())); + } + if let Some(value) = self._kind { + params.push(("kind", value.to_string())); + } + if let Some(value) = self._api_version { + params.push(("apiVersion", value.to_string())); + } + for &field in ["alt", "name", "propagationPolicy", "kind", "apiVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the service to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceServiceDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies the propagation policy of delete. Cloud Run currently ignores + /// this setting, and deletes in the background. Please see + /// kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + /// more information. + /// + /// Sets the *propagation policy* query property to the given value. + pub fn propagation_policy(mut self, new_value: &str) -> NamespaceServiceDeleteCall<'a, C, A> { + self._propagation_policy = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *kind* query property to the given value. + pub fn kind(mut self, new_value: &str) -> NamespaceServiceDeleteCall<'a, C, A> { + self._kind = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *api version* query property to the given value. + pub fn api_version(mut self, new_value: &str) -> NamespaceServiceDeleteCall<'a, C, A> { + self._api_version = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceServiceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceServiceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceServiceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a domain mapping. +/// +/// A builder for the *domainmappings.delete* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().domainmappings_delete("name") +/// .propagation_policy("et") +/// .kind("duo") +/// .api_version("et") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceDomainmappingDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _propagation_policy: Option, + _kind: Option, + _api_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceDomainmappingDeleteCall<'a, C, A> {} + +impl<'a, C, A> NamespaceDomainmappingDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Status)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.domainmappings.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._propagation_policy { + params.push(("propagationPolicy", value.to_string())); + } + if let Some(value) = self._kind { + params.push(("kind", value.to_string())); + } + if let Some(value) = self._api_version { + params.push(("apiVersion", value.to_string())); + } + for &field in ["alt", "name", "propagationPolicy", "kind", "apiVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/domains.cloudrun.com/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the domain mapping to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceDomainmappingDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies the propagation policy of delete. Cloud Run currently ignores + /// this setting, and deletes in the background. Please see + /// kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + /// more information. + /// + /// Sets the *propagation policy* query property to the given value. + pub fn propagation_policy(mut self, new_value: &str) -> NamespaceDomainmappingDeleteCall<'a, C, A> { + self._propagation_policy = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *kind* query property to the given value. + pub fn kind(mut self, new_value: &str) -> NamespaceDomainmappingDeleteCall<'a, C, A> { + self._kind = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *api version* query property to the given value. + pub fn api_version(mut self, new_value: &str) -> NamespaceDomainmappingDeleteCall<'a, C, A> { + self._api_version = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceDomainmappingDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceDomainmappingDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceDomainmappingDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List services. +/// +/// A builder for the *services.list* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().services_list("parent") +/// .watch(false) +/// .resource_version("et") +/// .limit(-46) +/// .label_selector("et") +/// .include_uninitialized(true) +/// .field_selector("ut") +/// .continue_("ea") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceServiceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceServiceListCall<'a, C, A> {} + +impl<'a, C, A> NamespaceServiceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListServicesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.services.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+parent}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the services should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceServiceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> NamespaceServiceListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> NamespaceServiceListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> NamespaceServiceListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> NamespaceServiceListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> NamespaceServiceListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> NamespaceServiceListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> NamespaceServiceListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceServiceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceServiceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceServiceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a revision. +/// +/// A builder for the *revisions.delete* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().revisions_delete("name") +/// .propagation_policy("dolor") +/// .kind("dolor") +/// .api_version("dolor") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceRevisionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _propagation_policy: Option, + _kind: Option, + _api_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceRevisionDeleteCall<'a, C, A> {} + +impl<'a, C, A> NamespaceRevisionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Status)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.revisions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._propagation_policy { + params.push(("propagationPolicy", value.to_string())); + } + if let Some(value) = self._kind { + params.push(("kind", value.to_string())); + } + if let Some(value) = self._api_version { + params.push(("apiVersion", value.to_string())); + } + for &field in ["alt", "name", "propagationPolicy", "kind", "apiVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the revision to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceRevisionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies the propagation policy of delete. Cloud Run currently ignores + /// this setting, and deletes in the background. Please see + /// kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + /// more information. + /// + /// Sets the *propagation policy* query property to the given value. + pub fn propagation_policy(mut self, new_value: &str) -> NamespaceRevisionDeleteCall<'a, C, A> { + self._propagation_policy = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *kind* query property to the given value. + pub fn kind(mut self, new_value: &str) -> NamespaceRevisionDeleteCall<'a, C, A> { + self._kind = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *api version* query property to the given value. + pub fn api_version(mut self, new_value: &str) -> NamespaceRevisionDeleteCall<'a, C, A> { + self._api_version = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceRevisionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceRevisionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceRevisionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List configurations. +/// +/// A builder for the *configurations.list* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().configurations_list("parent") +/// .watch(false) +/// .resource_version("amet.") +/// .limit(-27) +/// .label_selector("Lorem") +/// .include_uninitialized(true) +/// .field_selector("justo") +/// .continue_("sit") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceConfigurationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceConfigurationListCall<'a, C, A> {} + +impl<'a, C, A> NamespaceConfigurationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListConfigurationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.configurations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+parent}/configurations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the configurations should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceConfigurationListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> NamespaceConfigurationListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> NamespaceConfigurationListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> NamespaceConfigurationListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> NamespaceConfigurationListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> NamespaceConfigurationListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> NamespaceConfigurationListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> NamespaceConfigurationListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceConfigurationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceConfigurationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceConfigurationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a service. +/// +/// A builder for the *services.create* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Service; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Service::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.namespaces().services_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceServiceCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Service, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceServiceCreateCall<'a, C, A> {} + +impl<'a, C, A> NamespaceServiceCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.services.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+parent}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Service) -> NamespaceServiceCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The namespace in which the service should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceServiceCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceServiceCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceServiceCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceServiceCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a configuration. +/// +/// A builder for the *configurations.get* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().configurations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceConfigurationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceConfigurationGetCall<'a, C, A> {} + +impl<'a, C, A> NamespaceConfigurationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Configuration)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.configurations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the configuration to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceConfigurationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceConfigurationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceConfigurationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceConfigurationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List revisions. +/// +/// A builder for the *revisions.list* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().revisions_list("parent") +/// .watch(true) +/// .resource_version("sadipscing") +/// .limit(-76) +/// .label_selector("sadipscing") +/// .include_uninitialized(false) +/// .field_selector("consetetur") +/// .continue_("dolore") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceRevisionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceRevisionListCall<'a, C, A> {} + +impl<'a, C, A> NamespaceRevisionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListRevisionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.revisions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+parent}/revisions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the revisions should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceRevisionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> NamespaceRevisionListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> NamespaceRevisionListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> NamespaceRevisionListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> NamespaceRevisionListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> NamespaceRevisionListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> NamespaceRevisionListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> NamespaceRevisionListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceRevisionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceRevisionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceRevisionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a new domain mapping. +/// +/// A builder for the *domainmappings.create* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::DomainMapping; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DomainMapping::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.namespaces().domainmappings_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceDomainmappingCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: DomainMapping, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceDomainmappingCreateCall<'a, C, A> {} + +impl<'a, C, A> NamespaceDomainmappingCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DomainMapping)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.domainmappings.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/domains.cloudrun.com/v1/{+parent}/domainmappings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DomainMapping) -> NamespaceDomainmappingCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The namespace in which the domain mapping should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceDomainmappingCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceDomainmappingCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceDomainmappingCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceDomainmappingCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List routes. +/// +/// A builder for the *routes.list* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().routes_list("parent") +/// .watch(true) +/// .resource_version("et") +/// .limit(-13) +/// .label_selector("consetetur") +/// .include_uninitialized(false) +/// .field_selector("nonumy") +/// .continue_("kasd") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceRouteListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceRouteListCall<'a, C, A> {} + +impl<'a, C, A> NamespaceRouteListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListRoutesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.routes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+parent}/routes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the routes should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> NamespaceRouteListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> NamespaceRouteListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> NamespaceRouteListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> NamespaceRouteListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> NamespaceRouteListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> NamespaceRouteListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> NamespaceRouteListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> NamespaceRouteListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceRouteListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceRouteListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceRouteListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a domain mapping. +/// +/// A builder for the *domainmappings.get* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().domainmappings_get("name") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceDomainmappingGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceDomainmappingGetCall<'a, C, A> {} + +impl<'a, C, A> NamespaceDomainmappingGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DomainMapping)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.domainmappings.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/domains.cloudrun.com/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the domain mapping to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceDomainmappingGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceDomainmappingGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceDomainmappingGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceDomainmappingGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a revision. +/// +/// A builder for the *revisions.get* method supported by a *namespace* resource. +/// It is not used directly, but through a `NamespaceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.namespaces().revisions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct NamespaceRevisionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NamespaceRevisionGetCall<'a, C, A> {} + +impl<'a, C, A> NamespaceRevisionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Revision)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.namespaces.revisions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "apis/serving.knative.dev/v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the revision to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> NamespaceRevisionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> NamespaceRevisionGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> NamespaceRevisionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NamespaceRevisionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Replace a service. +/// +/// Only the spec and metadata labels and annotations are modifiable. After +/// the Update request, Cloud Run will work to make the 'status' +/// match the requested 'spec'. +/// +/// May provide metadata.resourceVersion to enforce update from last read for +/// optimistic concurrency control. +/// +/// A builder for the *locations.services.replaceService* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Service; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Service::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_services_replace_service(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationServiceReplaceServiceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Service, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceReplaceServiceCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceReplaceServiceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.replaceService", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Service) -> ProjectLocationServiceReplaceServiceCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the service being replaced. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationServiceReplaceServiceCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceReplaceServiceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceReplaceServiceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceReplaceServiceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List services. +/// +/// A builder for the *locations.services.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -487,11 +11104,3009 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // 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_get("name") +/// let result = hub.projects().locations_services_list("parent") +/// .watch(true) +/// .resource_version("ea") +/// .limit(-95) +/// .label_selector("rebum.") +/// .include_uninitialized(true) +/// .field_selector("nonumy") +/// .continue_("sed") /// .doit(); /// # } /// ``` -pub struct ProjectLocationGetCall<'a, C, A> +pub struct ProjectLocationServiceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListServicesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the services should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationServiceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> ProjectLocationServiceListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> ProjectLocationServiceListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> ProjectLocationServiceListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> ProjectLocationServiceListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> ProjectLocationServiceListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> ProjectLocationServiceListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> ProjectLocationServiceListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a domain mapping. +/// +/// A builder for the *locations.domainmappings.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_domainmappings_delete("name") +/// .propagation_policy("sit") +/// .kind("eirmod") +/// .api_version("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDomainmappingDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _propagation_policy: Option, + _kind: Option, + _api_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDomainmappingDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDomainmappingDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Status)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.domainmappings.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._propagation_policy { + params.push(("propagationPolicy", value.to_string())); + } + if let Some(value) = self._kind { + params.push(("kind", value.to_string())); + } + if let Some(value) = self._api_version { + params.push(("apiVersion", value.to_string())); + } + for &field in ["alt", "name", "propagationPolicy", "kind", "apiVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the domain mapping to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies the propagation policy of delete. Cloud Run currently ignores + /// this setting, and deletes in the background. Please see + /// kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + /// more information. + /// + /// Sets the *propagation policy* query property to the given value. + pub fn propagation_policy(mut self, new_value: &str) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> { + self._propagation_policy = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *kind* query property to the given value. + pub fn kind(mut self, new_value: &str) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> { + self._kind = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *api version* query property to the given value. + pub fn api_version(mut self, new_value: &str) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> { + self._api_version = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDomainmappingDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists information about the supported locations for this service. +/// +/// A builder for the *locations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_list("name") +/// .page_token("sed") +/// .page_size(-16) +/// .filter("gubergren") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}/locations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The resource that owns the locations collection, if applicable. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectLocationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List routes. +/// +/// A builder for the *locations.routes.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_routes_list("parent") +/// .watch(true) +/// .resource_version("tempor") +/// .limit(-59) +/// .label_selector("labore") +/// .include_uninitialized(false) +/// .field_selector("aliquyam") +/// .continue_("dolores") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRouteListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRouteListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRouteListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListRoutesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.routes.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/routes"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the routes should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationRouteListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> ProjectLocationRouteListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> ProjectLocationRouteListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> ProjectLocationRouteListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> ProjectLocationRouteListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> ProjectLocationRouteListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> ProjectLocationRouteListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> ProjectLocationRouteListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationRouteListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationRouteListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRouteListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a new domain mapping. +/// +/// A builder for the *locations.domainmappings.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::DomainMapping; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = DomainMapping::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_domainmappings_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDomainmappingCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: DomainMapping, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDomainmappingCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDomainmappingCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DomainMapping)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.domainmappings.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/domainmappings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DomainMapping) -> ProjectLocationDomainmappingCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The namespace in which the domain mapping should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDomainmappingCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDomainmappingCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDomainmappingCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDomainmappingCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List domain mappings. +/// +/// A builder for the *locations.domainmappings.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_domainmappings_list("parent") +/// .watch(true) +/// .resource_version("justo") +/// .limit(-6) +/// .label_selector("amet") +/// .include_uninitialized(true) +/// .field_selector("clita") +/// .continue_("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDomainmappingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDomainmappingListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDomainmappingListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDomainMappingsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.domainmappings.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/domainmappings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the domain mappings should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDomainmappingListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDomainmappingListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDomainmappingListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates a new secret. +/// +/// A builder for the *locations.secrets.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Secret; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Secret::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_secrets_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationSecretCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Secret, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationSecretCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationSecretCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Secret)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.secrets.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/secrets"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Secret) -> ProjectLocationSecretCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project ID or project number in which this secret should + /// be created. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationSecretCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationSecretCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationSecretCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationSecretCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List authorized domains. +/// +/// A builder for the *locations.authorizeddomains.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_authorizeddomains_list("parent") +/// .page_token("clita") +/// .page_size(-37) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationAuthorizeddomainListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationAuthorizeddomainListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationAuthorizeddomainListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAuthorizedDomainsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.authorizeddomains.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/authorizeddomains"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Name of the parent Application resource. Example: `apps/myapp`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationAuthorizeddomainListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Continuation token for fetching the next page of results. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationAuthorizeddomainListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum results to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationAuthorizeddomainListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationAuthorizeddomainListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationAuthorizeddomainListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationAuthorizeddomainListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rpc to update a namespace. +/// +/// A builder for the *locations.namespaces.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Namespace; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Namespace::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_namespaces_patch(req, "name") +/// .update_mask("dolores") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNamespacePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Namespace, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNamespacePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNamespacePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Namespace)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.namespaces.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Namespace) -> ProjectLocationNamespacePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationNamespacePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required. Indicates which fields in the provided namespace to update. + /// This field is currently unused. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationNamespacePatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationNamespacePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationNamespacePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNamespacePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that a caller has on the specified Project. +/// +/// There are no permissions required for making this API call. +/// +/// A builder for the *locations.services.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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_services_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationServiceTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationServiceTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationServiceTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rpc to get information about a secret. +/// +/// A builder for the *locations.secrets.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_secrets_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationSecretGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudRun, @@ -501,13 +14116,13 @@ pub struct ProjectLocationGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationSecretGetCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationSecretGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Location)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Secret)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -516,7 +14131,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "run.projects.locations.get", + dlg.begin(MethodInfo { id: "run.projects.locations.secrets.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); params.push(("name", self._name.to_string())); @@ -635,13 +14250,14 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectLocationSecretGetCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -651,7 +14267,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut ProjectLocationGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationSecretGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -676,7 +14292,7 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationSecretGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -696,7 +14312,3882 @@ impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationSecretGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a service. +/// +/// A builder for the *locations.services.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_services_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationServiceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the service to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationServiceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rpc to get information about a namespace. +/// +/// A builder for the *locations.namespaces.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_namespaces_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationNamespaceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationNamespaceGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationNamespaceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Namespace)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.namespaces.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the namespace being retrieved. If needed, replace + /// {namespace_id} with the project ID. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationNamespaceGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationNamespaceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationNamespaceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationNamespaceGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a revision. +/// +/// A builder for the *locations.revisions.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_revisions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRevisionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRevisionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRevisionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Revision)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.revisions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the revision to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationRevisionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationRevisionGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationRevisionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRevisionGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a domain mapping. +/// +/// A builder for the *locations.domainmappings.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_domainmappings_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationDomainmappingGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationDomainmappingGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationDomainmappingGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DomainMapping)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.domainmappings.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the domain mapping to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationDomainmappingGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationDomainmappingGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationDomainmappingGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationDomainmappingGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a configuration. +/// +/// A builder for the *locations.configurations.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_configurations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationConfigurationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationConfigurationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationConfigurationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Configuration)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.configurations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the configuration to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationConfigurationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationConfigurationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationConfigurationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationConfigurationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a service. +/// +/// A builder for the *locations.services.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Service; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Service::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_services_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationServiceCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Service, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Service)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/services"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Service) -> ProjectLocationServiceCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The namespace in which the service should be created. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationServiceCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get information about a route. +/// +/// A builder for the *locations.routes.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_routes_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRouteGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRouteGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRouteGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Route)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.routes.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the route to retrieve. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationRouteGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationRouteGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationRouteGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRouteGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the IAM Access control policy for the specified Service. Overwrites +/// any existing policy. +/// +/// A builder for the *locations.services.setIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SetIamPolicyRequest::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_services_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationServiceSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationServiceSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationServiceSetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceSetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a revision. +/// +/// A builder for the *locations.revisions.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_revisions_delete("name") +/// .propagation_policy("invidunt") +/// .kind("rebum.") +/// .api_version("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRevisionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _propagation_policy: Option, + _kind: Option, + _api_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRevisionDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRevisionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Status)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.revisions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._propagation_policy { + params.push(("propagationPolicy", value.to_string())); + } + if let Some(value) = self._kind { + params.push(("kind", value.to_string())); + } + if let Some(value) = self._api_version { + params.push(("apiVersion", value.to_string())); + } + for &field in ["alt", "name", "propagationPolicy", "kind", "apiVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the revision to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationRevisionDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies the propagation policy of delete. Cloud Run currently ignores + /// this setting, and deletes in the background. Please see + /// kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + /// more information. + /// + /// Sets the *propagation policy* query property to the given value. + pub fn propagation_policy(mut self, new_value: &str) -> ProjectLocationRevisionDeleteCall<'a, C, A> { + self._propagation_policy = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *kind* query property to the given value. + pub fn kind(mut self, new_value: &str) -> ProjectLocationRevisionDeleteCall<'a, C, A> { + self._kind = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *api version* query property to the given value. + pub fn api_version(mut self, new_value: &str) -> ProjectLocationRevisionDeleteCall<'a, C, A> { + self._api_version = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationRevisionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationRevisionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRevisionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Get the IAM Access Control policy currently in effect for the given +/// Cloud Run service. This result does not include any inherited policies. +/// +/// A builder for the *locations.services.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_services_get_iam_policy("resource") +/// .options_requested_policy_version(-37) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationServiceGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _resource: String, + _options_requested_policy_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationServiceGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + /// + /// Sets the *options.requested policy version* query property to the given value. + pub fn options_requested_policy_version(mut self, new_value: i32) -> ProjectLocationServiceGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List revisions. +/// +/// A builder for the *locations.revisions.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_revisions_list("parent") +/// .watch(false) +/// .resource_version("consetetur") +/// .limit(-22) +/// .label_selector("sed") +/// .include_uninitialized(true) +/// .field_selector("takimata") +/// .continue_("elitr") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationRevisionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationRevisionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationRevisionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListRevisionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.revisions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/revisions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the revisions should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationRevisionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> ProjectLocationRevisionListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> ProjectLocationRevisionListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> ProjectLocationRevisionListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> ProjectLocationRevisionListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> ProjectLocationRevisionListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> ProjectLocationRevisionListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> ProjectLocationRevisionListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationRevisionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationRevisionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationRevisionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Rpc to replace a secret. +/// +/// Only the spec and metadata labels and annotations are modifiable. After +/// the Update request, Cloud Run will work to make the 'status' +/// match the requested 'spec'. +/// +/// May provide metadata.resourceVersion to enforce update from last read for +/// optimistic concurrency control. +/// +/// A builder for the *locations.secrets.replaceSecret* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// use run1::Secret; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Secret::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_secrets_replace_secret(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationSecretReplaceSecretCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _request: Secret, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationSecretReplaceSecretCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationSecretReplaceSecretCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Secret)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.secrets.replaceSecret", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Secret) -> ProjectLocationSecretReplaceSecretCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the secret being retrieved. If needed, replace + /// {namespace_id} with the project ID. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationSecretReplaceSecretCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationSecretReplaceSecretCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationSecretReplaceSecretCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationSecretReplaceSecretCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// List configurations. +/// +/// A builder for the *locations.configurations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_configurations_list("parent") +/// .watch(true) +/// .resource_version("Lorem") +/// .limit(-42) +/// .label_selector("ut") +/// .include_uninitialized(true) +/// .field_selector("amet.") +/// .continue_("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationConfigurationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _parent: String, + _watch: Option, + _resource_version: Option, + _limit: Option, + _label_selector: Option, + _include_uninitialized: Option, + _field_selector: Option, + _continue_: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationConfigurationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationConfigurationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListConfigurationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.configurations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._watch { + params.push(("watch", value.to_string())); + } + if let Some(value) = self._resource_version { + params.push(("resourceVersion", value.to_string())); + } + if let Some(value) = self._limit { + params.push(("limit", value.to_string())); + } + if let Some(value) = self._label_selector { + params.push(("labelSelector", value.to_string())); + } + if let Some(value) = self._include_uninitialized { + params.push(("includeUninitialized", value.to_string())); + } + if let Some(value) = self._field_selector { + params.push(("fieldSelector", value.to_string())); + } + if let Some(value) = self._continue_ { + params.push(("continue", value.to_string())); + } + for &field in ["alt", "parent", "watch", "resourceVersion", "limit", "labelSelector", "includeUninitialized", "fieldSelector", "continue"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/configurations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The namespace from which the configurations should be listed. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Flag that indicates that the client expects to watch this resource as well. + /// Not currently used by Cloud Run. + /// + /// Sets the *watch* query property to the given value. + pub fn watch(mut self, new_value: bool) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._watch = Some(new_value); + self + } + /// The baseline resource version from which the list or watch operation should + /// start. Not currently used by Cloud Run. + /// + /// Sets the *resource version* query property to the given value. + pub fn resource_version(mut self, new_value: &str) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._resource_version = Some(new_value.to_string()); + self + } + /// The maximum number of records that should be returned. + /// + /// Sets the *limit* query property to the given value. + pub fn limit(mut self, new_value: i32) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._limit = Some(new_value); + self + } + /// Allows to filter resources based on a label. Supported operations are + /// =, !=, exists, in, and notIn. + /// + /// Sets the *label selector* query property to the given value. + pub fn label_selector(mut self, new_value: &str) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._label_selector = Some(new_value.to_string()); + self + } + /// Not currently used by Cloud Run. + /// + /// Sets the *include uninitialized* query property to the given value. + pub fn include_uninitialized(mut self, new_value: bool) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._include_uninitialized = Some(new_value); + self + } + /// Allows to filter resources based on a specific value for a field name. + /// Send this in a query string format. i.e. 'metadata.name%3Dlorem'. + /// Not currently used by Cloud Run. + /// + /// Sets the *field selector* query property to the given value. + pub fn field_selector(mut self, new_value: &str) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._field_selector = Some(new_value.to_string()); + self + } + /// Optional encoded string to continue paging. + /// + /// Sets the *continue* query property to the given value. + pub fn continue_(mut self, new_value: &str) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._continue_ = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationConfigurationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationConfigurationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationConfigurationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Delete a service. +/// This will cause the Service to stop serving traffic and will delete the +/// child entities like Routes, Configurations and Revisions. +/// +/// A builder for the *locations.services.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_run1 as run1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use run1::CloudRun; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = CloudRun::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_services_delete("name") +/// .propagation_policy("dolor") +/// .kind("sea") +/// .api_version("ut") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationServiceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudRun, + _name: String, + _propagation_policy: Option, + _kind: Option, + _api_version: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationServiceDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationServiceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Status)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "run.projects.locations.services.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._propagation_policy { + params.push(("propagationPolicy", value.to_string())); + } + if let Some(value) = self._kind { + params.push(("kind", value.to_string())); + } + if let Some(value) = self._api_version { + params.push(("apiVersion", value.to_string())); + } + for &field in ["alt", "name", "propagationPolicy", "kind", "apiVersion"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the service to delete. + /// For Cloud Run (fully managed), replace {namespace_id} with the project ID + /// or number. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationServiceDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Specifies the propagation policy of delete. Cloud Run currently ignores + /// this setting, and deletes in the background. Please see + /// kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ for + /// more information. + /// + /// Sets the *propagation policy* query property to the given value. + pub fn propagation_policy(mut self, new_value: &str) -> ProjectLocationServiceDeleteCall<'a, C, A> { + self._propagation_policy = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *kind* query property to the given value. + pub fn kind(mut self, new_value: &str) -> ProjectLocationServiceDeleteCall<'a, C, A> { + self._kind = Some(new_value.to_string()); + self + } + /// Cloud Run currently ignores this parameter. + /// + /// Sets the *api version* query property to the given value. + pub fn api_version(mut self, new_value: &str) -> ProjectLocationServiceDeleteCall<'a, C, A> { + self._api_version = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationServiceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationServiceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationServiceDeleteCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { diff --git a/gen/runtimeconfig1-cli/Cargo.toml b/gen/runtimeconfig1-cli/Cargo.toml index d9390901e9..a980f72805 100644 --- a/gen/runtimeconfig1-cli/Cargo.toml +++ b/gen/runtimeconfig1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-runtimeconfig1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud RuntimeConfig (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/runtimeconfig1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-runtimeconfig1] path = "../runtimeconfig1" -version = "1.0.12+20190624" +version = "1.0.13+20200406" diff --git a/gen/runtimeconfig1-cli/README.md b/gen/runtimeconfig1-cli/README.md index 2f7d652552..a88b681cf4 100644 --- a/gen/runtimeconfig1-cli/README.md +++ b/gen/runtimeconfig1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud RuntimeConfig* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud RuntimeConfig* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash runtimeconfig1 [options] diff --git a/gen/runtimeconfig1-cli/mkdocs.yml b/gen/runtimeconfig1-cli/mkdocs.yml index e4657bc60c..0c658af3e3 100644 --- a/gen/runtimeconfig1-cli/mkdocs.yml +++ b/gen/runtimeconfig1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud RuntimeConfig v1.0.12+20190624 +site_name: Cloud RuntimeConfig v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-runtimeconfig1-cli site_description: A complete library to interact with Cloud RuntimeConfig (protocol v1) diff --git a/gen/runtimeconfig1-cli/src/main.rs b/gen/runtimeconfig1-cli/src/main.rs index 12b11026bd..5d0d353ee1 100644 --- a/gen/runtimeconfig1-cli/src/main.rs +++ b/gen/runtimeconfig1-cli/src/main.rs @@ -451,7 +451,7 @@ fn main() { let mut app = App::new("runtimeconfig1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200406") .about("The Runtime Configurator allows you to dynamically configure and expose variables through Google Cloud Platform. In addition, you can also set Watchers and Waiters that will watch for changes to your data and return based on certain conditions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_runtimeconfig1_cli") .arg(Arg::with_name("url") diff --git a/gen/runtimeconfig1/Cargo.toml b/gen/runtimeconfig1/Cargo.toml index 3b68053686..90588ab84f 100644 --- a/gen/runtimeconfig1/Cargo.toml +++ b/gen/runtimeconfig1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-runtimeconfig1" -version = "1.0.12+20190624" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud RuntimeConfig (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/runtimeconfig1" homepage = "https://cloud.google.com/deployment-manager/runtime-configurator/" -documentation = "https://docs.rs/google-runtimeconfig1/1.0.12+20190624" +documentation = "https://docs.rs/google-runtimeconfig1/1.0.13+20200406" license = "MIT" keywords = ["runtimeconfig", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/runtimeconfig1/README.md b/gen/runtimeconfig1/README.md index c6d628b2d7..5149f1917d 100644 --- a/gen/runtimeconfig1/README.md +++ b/gen/runtimeconfig1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-runtimeconfig1` library allows access to all features of the *Google Cloud RuntimeConfig* service. -This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *runtimeconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *runtimeconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud RuntimeConfig* *v1* API can be found at the [official documentation site](https://cloud.google.com/deployment-manager/runtime-configurator/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/struct.CloudRuntimeConfig.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/struct.CloudRuntimeConfig.html) ... -* [operations](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/struct.OperationDeleteCall.html) and [*list*](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/struct.OperationListCall.html) +* [operations](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/struct.OperationDeleteCall.html) and [*list*](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/struct.OperationListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/struct.CloudRuntimeConfig.html)** +* **[Hub](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/struct.CloudRuntimeConfig.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.Part.html)** + * **[Parts](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -129,17 +129,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -149,29 +149,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-runtimeconfig1/1.0.12+20190624/google_runtimeconfig1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-runtimeconfig1/1.0.13+20200406/google_runtimeconfig1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/runtimeconfig1/src/lib.rs b/gen/runtimeconfig1/src/lib.rs index 0557e03118..e2a830aa5b 100644 --- a/gen/runtimeconfig1/src/lib.rs +++ b/gen/runtimeconfig1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *runtimeconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *runtimeconfig:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud RuntimeConfig* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/deployment-manager/runtime-configurator/). @@ -329,7 +329,7 @@ impl<'a, C, A> CloudRuntimeConfig CloudRuntimeConfig { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://runtimeconfig.googleapis.com/".to_string(), _root_url: "https://runtimeconfig.googleapis.com/".to_string(), } @@ -340,7 +340,7 @@ impl<'a, C, A> CloudRuntimeConfig } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/runtimeconfig1_beta1-cli/Cargo.toml b/gen/runtimeconfig1_beta1-cli/Cargo.toml index 0e95fa9ee6..643f3b40e8 100644 --- a/gen/runtimeconfig1_beta1-cli/Cargo.toml +++ b/gen/runtimeconfig1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-runtimeconfig1_beta1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud RuntimeConfig (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/runtimeconfig1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-runtimeconfig1_beta1] path = "../runtimeconfig1_beta1" -version = "1.0.12+20190624" +version = "1.0.13+20200406" diff --git a/gen/runtimeconfig1_beta1-cli/README.md b/gen/runtimeconfig1_beta1-cli/README.md index 6b63d6736b..06b41d34f5 100644 --- a/gen/runtimeconfig1_beta1-cli/README.md +++ b/gen/runtimeconfig1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud RuntimeConfig* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud RuntimeConfig* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash runtimeconfig1-beta1 [options] diff --git a/gen/runtimeconfig1_beta1-cli/mkdocs.yml b/gen/runtimeconfig1_beta1-cli/mkdocs.yml index 831c4f742c..9b69726f45 100644 --- a/gen/runtimeconfig1_beta1-cli/mkdocs.yml +++ b/gen/runtimeconfig1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud RuntimeConfig v1.0.12+20190624 +site_name: Cloud RuntimeConfig v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-runtimeconfig1_beta1-cli site_description: A complete library to interact with Cloud RuntimeConfig (protocol v1beta1) diff --git a/gen/runtimeconfig1_beta1-cli/src/main.rs b/gen/runtimeconfig1_beta1-cli/src/main.rs index da40d6ea16..d3e57f53bb 100644 --- a/gen/runtimeconfig1_beta1-cli/src/main.rs +++ b/gen/runtimeconfig1_beta1-cli/src/main.rs @@ -246,6 +246,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -259,6 +262,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -1970,7 +1974,9 @@ fn main() { ]), ("configs-set-iam-policy", Some(r##"Sets the access control policy on the specified resource. Replaces any - existing policy."##), + existing policy. + + Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED"##), "Details at http://byron.github.io/google-apis-rs/google_runtimeconfig1_beta1_cli/projects_configs-set-iam-policy", vec![ (Some(r##"resource"##), @@ -2441,7 +2447,7 @@ fn main() { let mut app = App::new("runtimeconfig1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200406") .about("The Runtime Configurator allows you to dynamically configure and expose variables through Google Cloud Platform. In addition, you can also set Watchers and Waiters that will watch for changes to your data and return based on certain conditions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_runtimeconfig1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/runtimeconfig1_beta1/Cargo.toml b/gen/runtimeconfig1_beta1/Cargo.toml index 6513715234..0182734966 100644 --- a/gen/runtimeconfig1_beta1/Cargo.toml +++ b/gen/runtimeconfig1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-runtimeconfig1_beta1" -version = "1.0.12+20190624" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud RuntimeConfig (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/runtimeconfig1_beta1" homepage = "https://cloud.google.com/deployment-manager/runtime-configurator/" -documentation = "https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624" +documentation = "https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406" license = "MIT" keywords = ["runtimeconfig", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/runtimeconfig1_beta1/README.md b/gen/runtimeconfig1_beta1/README.md index c16e14a42a..d9ce3627ed 100644 --- a/gen/runtimeconfig1_beta1/README.md +++ b/gen/runtimeconfig1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-runtimeconfig1_beta1` library allows access to all features of the *Google Cloud RuntimeConfig* service. -This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *runtimeconfig:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *runtimeconfig:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud RuntimeConfig* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/deployment-manager/runtime-configurator/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.CloudRuntimeConfig.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.CloudRuntimeConfig.html) ... * projects - * [*configs create*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigCreateCall.html), [*configs delete*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigDeleteCall.html), [*configs get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigGetCall.html), [*configs get iam policy*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigGetIamPolicyCall.html), [*configs list*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigListCall.html), [*configs operations get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigOperationGetCall.html), [*configs operations test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigOperationTestIamPermissionCall.html), [*configs set iam policy*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigSetIamPolicyCall.html), [*configs test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigTestIamPermissionCall.html), [*configs update*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigUpdateCall.html), [*configs variables create*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigVariableCreateCall.html), [*configs variables delete*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigVariableDeleteCall.html), [*configs variables get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigVariableGetCall.html), [*configs variables list*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigVariableListCall.html), [*configs variables test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigVariableTestIamPermissionCall.html), [*configs variables update*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigVariableUpdateCall.html), [*configs variables watch*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigVariableWatchCall.html), [*configs waiters create*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterCreateCall.html), [*configs waiters delete*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterDeleteCall.html), [*configs waiters get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterGetCall.html), [*configs waiters list*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterListCall.html) and [*configs waiters test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterTestIamPermissionCall.html) + * [*configs create*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigCreateCall.html), [*configs delete*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigDeleteCall.html), [*configs get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigGetCall.html), [*configs get iam policy*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigGetIamPolicyCall.html), [*configs list*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigListCall.html), [*configs operations get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigOperationGetCall.html), [*configs operations test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigOperationTestIamPermissionCall.html), [*configs set iam policy*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigSetIamPolicyCall.html), [*configs test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigTestIamPermissionCall.html), [*configs update*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigUpdateCall.html), [*configs variables create*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigVariableCreateCall.html), [*configs variables delete*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigVariableDeleteCall.html), [*configs variables get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigVariableGetCall.html), [*configs variables list*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigVariableListCall.html), [*configs variables test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigVariableTestIamPermissionCall.html), [*configs variables update*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigVariableUpdateCall.html), [*configs variables watch*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigVariableWatchCall.html), [*configs waiters create*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterCreateCall.html), [*configs waiters delete*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterDeleteCall.html), [*configs waiters get*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterGetCall.html), [*configs waiters list*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterListCall.html) and [*configs waiters test iam permissions*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.ProjectConfigWaiterTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/struct.CloudRuntimeConfig.html)** +* **[Hub](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/struct.CloudRuntimeConfig.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-runtimeconfig1_beta1/1.0.12+20190624/google_runtimeconfig1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-runtimeconfig1_beta1/1.0.13+20200406/google_runtimeconfig1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/runtimeconfig1_beta1/src/lib.rs b/gen/runtimeconfig1_beta1/src/lib.rs index 581fcc52a6..e78583a5e9 100644 --- a/gen/runtimeconfig1_beta1/src/lib.rs +++ b/gen/runtimeconfig1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *runtimeconfig:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud RuntimeConfig* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *runtimeconfig:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud RuntimeConfig* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/deployment-manager/runtime-configurator/). @@ -338,7 +338,7 @@ impl<'a, C, A> CloudRuntimeConfig CloudRuntimeConfig { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://runtimeconfig.googleapis.com/".to_string(), _root_url: "https://runtimeconfig.googleapis.com/".to_string(), } @@ -349,7 +349,7 @@ impl<'a, C, A> CloudRuntimeConfig } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -498,30 +498,59 @@ impl RequestValue for Waiter {} impl ResponseResult for Waiter {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -556,37 +585,50 @@ pub struct ListVariablesResponse { impl ResponseResult for ListVariablesResponse {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -594,15 +636,21 @@ impl ResponseResult for ListVariablesResponse {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -613,8 +661,9 @@ impl ResponseResult for ListVariablesResponse {} /// * [configs set iam policy projects](struct.ProjectConfigSetIamPolicyCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, /// `etag` is used for optimistic concurrency control as a way to help /// prevent simultaneous updates of a policy from overwriting each other. @@ -624,10 +673,32 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -823,7 +894,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -832,6 +903,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1167,6 +1258,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Sets the access control policy on the specified resource. Replaces any /// existing policy. /// + /// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + /// /// # Arguments /// /// * `request` - No description provided. @@ -1215,6 +1308,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectConfigGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2714,6 +2808,8 @@ impl<'a, C, A> ProjectConfigWaiterTestIamPermissionCall<'a, C, A> where C: Borro /// Sets the access control policy on the specified resource. Replaces any /// existing policy. +/// +/// Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED /// /// A builder for the *configs.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3273,6 +3369,7 @@ impl<'a, C, A> ProjectConfigGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().configs_get_iam_policy("resource") +/// .options_requested_policy_version(-9) /// .doit(); /// # } /// ``` @@ -3281,6 +3378,7 @@ pub struct ProjectConfigGetIamPolicyCall<'a, C, A> hub: &'a CloudRuntimeConfig, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3303,9 +3401,12 @@ impl<'a, C, A> ProjectConfigGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3431,6 +3532,20 @@ impl<'a, C, A> ProjectConfigGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectConfigGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3785,7 +3900,7 @@ impl<'a, C, A> ProjectConfigWaiterDeleteCall<'a, C, A> where C: BorrowMut ProjectConfigVariableCreateCall<'a, C, A> where C: BorrowMut ProjectConfigWaiterListCall<'a, C, A> where C: BorrowMut ProjectConfigTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectConfigWaiterGetCall<'a, C, A> where C: BorrowMut ProjectConfigVariableListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with safebrowsing (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/safebrowsing4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-safebrowsing4] path = "../safebrowsing4" -version = "1.0.12+20190702" +version = "1.0.13+20200407" diff --git a/gen/safebrowsing4-cli/README.md b/gen/safebrowsing4-cli/README.md index ba5aabb915..ea91782551 100644 --- a/gen/safebrowsing4-cli/README.md +++ b/gen/safebrowsing4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *safebrowsing* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *safebrowsing* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash safebrowsing4 [options] diff --git a/gen/safebrowsing4-cli/mkdocs.yml b/gen/safebrowsing4-cli/mkdocs.yml index 65fd778b05..ea1a75f889 100644 --- a/gen/safebrowsing4-cli/mkdocs.yml +++ b/gen/safebrowsing4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: safebrowsing v1.0.12+20190702 +site_name: safebrowsing v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-safebrowsing4-cli site_description: A complete library to interact with safebrowsing (protocol v4) diff --git a/gen/safebrowsing4-cli/src/main.rs b/gen/safebrowsing4-cli/src/main.rs index 6c5df6cdac..6499824454 100644 --- a/gen/safebrowsing4-cli/src/main.rs +++ b/gen/safebrowsing4-cli/src/main.rs @@ -897,8 +897,8 @@ fn main() { let mut app = App::new("safebrowsing4") .author("Sebastian Thiel ") - .version("1.0.12+20190702") - .about("Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.") + .version("1.0.13+20200407") + .about("Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_safebrowsing4_cli") .arg(Arg::with_name("folder") .long("config-dir") diff --git a/gen/safebrowsing4/Cargo.toml b/gen/safebrowsing4/Cargo.toml index c892028723..37f70ebf95 100644 --- a/gen/safebrowsing4/Cargo.toml +++ b/gen/safebrowsing4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-safebrowsing4" -version = "1.0.12+20190702" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with safebrowsing (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/safebrowsing4" homepage = "https://developers.google.com/safe-browsing/" -documentation = "https://docs.rs/google-safebrowsing4/1.0.12+20190702" +documentation = "https://docs.rs/google-safebrowsing4/1.0.13+20200407" license = "MIT" keywords = ["safebrowsing", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/safebrowsing4/README.md b/gen/safebrowsing4/README.md index 253e4adb4c..53f81b8260 100644 --- a/gen/safebrowsing4/README.md +++ b/gen/safebrowsing4/README.md @@ -5,28 +5,28 @@ DO NOT EDIT ! --> The `google-safebrowsing4` library allows access to all features of the *Google safebrowsing* service. -This documentation was generated from *safebrowsing* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *safebrowsing* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *safebrowsing* *v4* API can be found at the [official documentation site](https://developers.google.com/safe-browsing/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.Safebrowsing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.Safebrowsing.html) ... * encoded full hashes - * [*get*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.EncodedFullHasheGetCall.html) + * [*get*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.EncodedFullHasheGetCall.html) * encoded updates - * [*get*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.EncodedUpdateGetCall.html) + * [*get*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.EncodedUpdateGetCall.html) * full hashes - * [*find*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.FullHasheFindCall.html) -* [threat hits](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.ThreatHit.html) - * [*create*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.ThreatHitCreateCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.FullHasheFindCall.html) +* [threat hits](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.ThreatHit.html) + * [*create*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.ThreatHitCreateCall.html) * threat list updates - * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) + * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) * threat lists - * [*list*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.ThreatListListCall.html) + * [*list*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.ThreatListListCall.html) * threat matches - * [*find*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.ThreatMatcheFindCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.ThreatMatcheFindCall.html) @@ -35,17 +35,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/struct.Safebrowsing.html)** +* **[Hub](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/struct.Safebrowsing.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.Part.html)** + * **[Parts](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -139,17 +139,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +159,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-safebrowsing4/1.0.12+20190702/google_safebrowsing4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-safebrowsing4/1.0.13+20200407/google_safebrowsing4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/safebrowsing4/src/lib.rs b/gen/safebrowsing4/src/lib.rs index 67e5c4e3c4..b847626e01 100644 --- a/gen/safebrowsing4/src/lib.rs +++ b/gen/safebrowsing4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *safebrowsing* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *safebrowsing* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *safebrowsing* *v4* API can be found at the //! [official documentation site](https://developers.google.com/safe-browsing/). @@ -312,7 +312,7 @@ impl<'a, C, A> Safebrowsing Safebrowsing { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://safebrowsing.googleapis.com/".to_string(), _root_url: "https://safebrowsing.googleapis.com/".to_string(), } @@ -341,7 +341,7 @@ impl<'a, C, A> Safebrowsing } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -601,8 +601,8 @@ pub struct Constraints { /// format. pub language: Option, /// Sets the maximum number of entries that the client is willing to have - /// in the local database. This should be a power of 2 between 2**10 and - /// 2**20. If zero, no database size limit is set. + /// in the local database for the specified list. This should be a power of + /// 2 between 2**10 and 2**20. If zero, no database size limit is set. #[serde(rename="maxDatabaseEntries")] pub max_database_entries: Option, /// Requests the list for a specific geographic location. If not set the diff --git a/gen/searchconsole1-cli/Cargo.toml b/gen/searchconsole1-cli/Cargo.toml index 19e2463a73..bca8881e07 100644 --- a/gen/searchconsole1-cli/Cargo.toml +++ b/gen/searchconsole1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-searchconsole1-cli" -version = "1.0.12+20190629" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Search Console (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/searchconsole1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-searchconsole1] path = "../searchconsole1" -version = "1.0.12+20190629" +version = "1.0.13+20200409" diff --git a/gen/searchconsole1-cli/README.md b/gen/searchconsole1-cli/README.md index 5221719f2e..c6ae22b337 100644 --- a/gen/searchconsole1-cli/README.md +++ b/gen/searchconsole1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Search Console* API at revision *20190629*. The CLI is at version *1.0.12*. +This documentation was generated from the *Search Console* API at revision *20200409*. The CLI is at version *1.0.13*. ```bash searchconsole1 [options] diff --git a/gen/searchconsole1-cli/mkdocs.yml b/gen/searchconsole1-cli/mkdocs.yml index 9a2e1ff179..f73b24c6e2 100644 --- a/gen/searchconsole1-cli/mkdocs.yml +++ b/gen/searchconsole1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Search Console v1.0.12+20190629 +site_name: Search Console v1.0.13+20200409 site_url: http://byron.github.io/google-apis-rs/google-searchconsole1-cli site_description: A complete library to interact with Search Console (protocol v1) diff --git a/gen/searchconsole1-cli/src/main.rs b/gen/searchconsole1-cli/src/main.rs index ccc286355c..33fb015785 100644 --- a/gen/searchconsole1-cli/src/main.rs +++ b/gen/searchconsole1-cli/src/main.rs @@ -259,7 +259,7 @@ fn main() { let mut app = App::new("searchconsole1") .author("Sebastian Thiel ") - .version("1.0.12+20190629") + .version("1.0.13+20200409") .about("Provides tools for running validation tests against single URLs") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_searchconsole1_cli") .arg(Arg::with_name("folder") diff --git a/gen/searchconsole1/Cargo.toml b/gen/searchconsole1/Cargo.toml index 9ebc0f42e9..7a3c9d3e39 100644 --- a/gen/searchconsole1/Cargo.toml +++ b/gen/searchconsole1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-searchconsole1" -version = "1.0.12+20190629" +version = "1.0.13+20200409" authors = ["Sebastian Thiel "] description = "A complete library to interact with Search Console (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/searchconsole1" homepage = "https://developers.google.com/webmaster-tools/search-console-api/" -documentation = "https://docs.rs/google-searchconsole1/1.0.12+20190629" +documentation = "https://docs.rs/google-searchconsole1/1.0.13+20200409" license = "MIT" keywords = ["searchconsole", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/searchconsole1/README.md b/gen/searchconsole1/README.md index 78463225b0..d7ab7b38fb 100644 --- a/gen/searchconsole1/README.md +++ b/gen/searchconsole1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-searchconsole1` library allows access to all features of the *Google Search Console* service. -This documentation was generated from *Search Console* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Search Console* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Search Console* *v1* API can be found at the [official documentation site](https://developers.google.com/webmaster-tools/search-console-api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/struct.SearchConsole.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/struct.SearchConsole.html) ... * url testing tools - * [*mobile friendly test run*](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/struct.UrlTestingToolMobileFriendlyTestRunCall.html) + * [*mobile friendly test run*](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/struct.UrlTestingToolMobileFriendlyTestRunCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/struct.SearchConsole.html)** +* **[Hub](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/struct.SearchConsole.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.Part.html)** + * **[Parts](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-searchconsole1/1.0.12+20190629/google_searchconsole1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-searchconsole1/1.0.13+20200409/google_searchconsole1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/searchconsole1/src/lib.rs b/gen/searchconsole1/src/lib.rs index 692ab7be79..a2cf1c43a4 100644 --- a/gen/searchconsole1/src/lib.rs +++ b/gen/searchconsole1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Search Console* crate version *1.0.12+20190629*, where *20190629* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Search Console* crate version *1.0.13+20200409*, where *20200409* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Search Console* *v1* API can be found at the //! [official documentation site](https://developers.google.com/webmaster-tools/search-console-api/). @@ -307,7 +307,7 @@ impl<'a, C, A> SearchConsole SearchConsole { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://searchconsole.googleapis.com/".to_string(), _root_url: "https://searchconsole.googleapis.com/".to_string(), } @@ -318,7 +318,7 @@ impl<'a, C, A> SearchConsole } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/securitycenter1-cli/Cargo.toml b/gen/securitycenter1-cli/Cargo.toml index e5e2ee0b57..a1b90fa3b8 100644 --- a/gen/securitycenter1-cli/Cargo.toml +++ b/gen/securitycenter1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-securitycenter1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Security Command Center (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/securitycenter1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-securitycenter1] path = "../securitycenter1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" diff --git a/gen/securitycenter1-cli/README.md b/gen/securitycenter1-cli/README.md index 4a00494eeb..17bdb859d0 100644 --- a/gen/securitycenter1-cli/README.md +++ b/gen/securitycenter1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Security Command Center* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Security Command Center* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash securitycenter1 [options] @@ -35,6 +35,11 @@ securitycenter1 [options] assets-run-discovery (-r )... [-p ]... [-o ] assets-update-security-marks (-r )... [-p ]... [-o ] get-organization-settings [-p ]... [-o ] + notification-configs-create (-r )... [-p ]... [-o ] + notification-configs-delete [-p ]... [-o ] + notification-configs-get [-p ]... [-o ] + notification-configs-list [-p ]... [-o ] + notification-configs-patch (-r )... [-p ]... [-o ] operations-cancel [-p ]... [-o ] operations-delete [-p ]... [-o ] operations-get [-p ]... [-o ] diff --git a/gen/securitycenter1-cli/mkdocs.yml b/gen/securitycenter1-cli/mkdocs.yml index eeaa1d845c..b414cdfec1 100644 --- a/gen/securitycenter1-cli/mkdocs.yml +++ b/gen/securitycenter1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Security Command Center v1.0.12+20190628 +site_name: Security Command Center v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-securitycenter1-cli site_description: A complete library to interact with Security Command Center (protocol v1) @@ -14,6 +14,11 @@ pages: - ['organizations_assets-run-discovery.md', 'Organizations', 'Assets Run Discovery'] - ['organizations_assets-update-security-marks.md', 'Organizations', 'Assets Update Security Marks'] - ['organizations_get-organization-settings.md', 'Organizations', 'Get Organization Settings'] +- ['organizations_notification-configs-create.md', 'Organizations', 'Notification Configs Create'] +- ['organizations_notification-configs-delete.md', 'Organizations', 'Notification Configs Delete'] +- ['organizations_notification-configs-get.md', 'Organizations', 'Notification Configs Get'] +- ['organizations_notification-configs-list.md', 'Organizations', 'Notification Configs List'] +- ['organizations_notification-configs-patch.md', 'Organizations', 'Notification Configs Patch'] - ['organizations_operations-cancel.md', 'Organizations', 'Operations Cancel'] - ['organizations_operations-delete.md', 'Organizations', 'Operations Delete'] - ['organizations_operations-get.md', 'Organizations', 'Operations Get'] diff --git a/gen/securitycenter1-cli/src/main.rs b/gen/securitycenter1-cli/src/main.rs index 4b74d672c9..c130738b46 100644 --- a/gen/securitycenter1-cli/src/main.rs +++ b/gen/securitycenter1-cli/src/main.rs @@ -439,6 +439,355 @@ impl<'n> Engine<'n> { } } + fn _organizations_notification_configs_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "pubsub-topic" => Some(("pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "streaming-config.filter" => Some(("streamingConfig.filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-account" => Some(("serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "pubsub-topic", "service-account", "streaming-config"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::NotificationConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().notification_configs_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "config-id" => { + call = call.config_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["config-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_notification_configs_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().notification_configs_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_notification_configs_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().notification_configs_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_notification_configs_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.organizations().notification_configs_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _organizations_notification_configs_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "pubsub-topic" => Some(("pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "streaming-config.filter" => Some(("streamingConfig.filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "service-account" => Some(("serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "pubsub-topic", "service-account", "streaming-config"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::NotificationConfig = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().notification_configs_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _organizations_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.organizations().operations_cancel(opt.value_of("name").unwrap_or("")); @@ -1856,6 +2205,21 @@ impl<'n> Engine<'n> { ("get-organization-settings", Some(opt)) => { call_result = self._organizations_get_organization_settings(opt, dry_run, &mut err); }, + ("notification-configs-create", Some(opt)) => { + call_result = self._organizations_notification_configs_create(opt, dry_run, &mut err); + }, + ("notification-configs-delete", Some(opt)) => { + call_result = self._organizations_notification_configs_delete(opt, dry_run, &mut err); + }, + ("notification-configs-get", Some(opt)) => { + call_result = self._organizations_notification_configs_get(opt, dry_run, &mut err); + }, + ("notification-configs-list", Some(opt)) => { + call_result = self._organizations_notification_configs_list(opt, dry_run, &mut err); + }, + ("notification-configs-patch", Some(opt)) => { + call_result = self._organizations_notification_configs_patch(opt, dry_run, &mut err); + }, ("operations-cancel", Some(opt)) => { call_result = self._organizations_operations_cancel(opt, dry_run, &mut err); }, @@ -2001,7 +2365,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("organizations", "methods: 'assets-group', 'assets-list', 'assets-run-discovery', 'assets-update-security-marks', 'get-organization-settings', 'operations-cancel', 'operations-delete', 'operations-get', 'operations-list', 'sources-create', 'sources-findings-create', 'sources-findings-group', 'sources-findings-list', 'sources-findings-patch', 'sources-findings-set-state', 'sources-findings-update-security-marks', 'sources-get', 'sources-get-iam-policy', 'sources-list', 'sources-patch', 'sources-set-iam-policy', 'sources-test-iam-permissions' and 'update-organization-settings'", vec![ + ("organizations", "methods: 'assets-group', 'assets-list', 'assets-run-discovery', 'assets-update-security-marks', 'get-organization-settings', 'notification-configs-create', 'notification-configs-delete', 'notification-configs-get', 'notification-configs-list', 'notification-configs-patch', 'operations-cancel', 'operations-delete', 'operations-get', 'operations-list', 'sources-create', 'sources-findings-create', 'sources-findings-group', 'sources-findings-list', 'sources-findings-patch', 'sources-findings-set-state', 'sources-findings-update-security-marks', 'sources-get', 'sources-get-iam-policy', 'sources-list', 'sources-patch', 'sources-set-iam-policy', 'sources-test-iam-permissions' and 'update-organization-settings'", vec![ ("assets-group", Some(r##"Filters an organization's assets and groups them by their specified properties."##), @@ -2009,7 +2373,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Name of the organization to groupBy. Its format is + Some(r##"Required. Name of the organization to groupBy. Its format is "organizations/[organization_id]"."##), Some(true), Some(false)), @@ -2038,7 +2402,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Name of the organization assets should belong to. Its format is + Some(r##"Required. Name of the organization assets should belong to. Its format is "organizations/[organization_id]"."##), Some(true), Some(false)), @@ -2066,7 +2430,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Name of the organization to run asset discovery for. Its format is + Some(r##"Required. Name of the organization to run asset discovery for. Its format is "organizations/[organization_id]"."##), Some(true), Some(false)), @@ -2098,8 +2462,8 @@ fn main() { Some(r##"The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: - "organizations/123/assets/456/securityMarks" - "organizations/123/sources/456/findings/789/securityMarks"."##), + "organizations/{organization_id}/assets/{asset_id}/securityMarks" + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks"."##), Some(true), Some(false)), @@ -2127,7 +2491,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Name of the organization to get organization settings for. Its format is + Some(r##"Required. Name of the organization to get organization settings for. Its format is "organizations/[organization_id]/organizationSettings"."##), Some(true), Some(false)), @@ -2138,6 +2502,136 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("notification-configs-create", + Some(r##"Creates a notification config."##), + "Details at http://byron.github.io/google-apis-rs/google_securitycenter1_cli/organizations_notification-configs-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Resource name of the new notification config's parent. Its format is + "organizations/[organization_id]"."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("notification-configs-delete", + Some(r##"Deletes a notification config."##), + "Details at http://byron.github.io/google-apis-rs/google_securitycenter1_cli/organizations_notification-configs-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the notification config to delete. Its format is + "organizations/[organization_id]/notificationConfigs/[config_id]"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("notification-configs-get", + Some(r##"Gets a notification config."##), + "Details at http://byron.github.io/google-apis-rs/google_securitycenter1_cli/organizations_notification-configs-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the notification config to get. Its format is + "organizations/[organization_id]/notificationConfigs/[config_id]"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("notification-configs-list", + Some(r##"Lists notification configs."##), + "Details at http://byron.github.io/google-apis-rs/google_securitycenter1_cli/organizations_notification-configs-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. Name of the organization to list notification configs. + Its format is "organizations/[organization_id]"."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("notification-configs-patch", + Some(r##" + Updates a notification config."##), + "Details at http://byron.github.io/google-apis-rs/google_securitycenter1_cli/organizations_notification-configs-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"The relative resource name of this notification config. See: + https://cloud.google.com/apis/design/resource_names#relative_resource_name + Example: + "organizations/{organization_id}/notificationConfigs/notify_public_bucket"."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -2261,7 +2755,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Resource name of the new source's parent. Its format should be + Some(r##"Required. Resource name of the new source's parent. Its format should be "organizations/[organization_id]"."##), Some(true), Some(false)), @@ -2291,7 +2785,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Resource name of the new finding's parent. Its format should be + Some(r##"Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]"."##), Some(true), Some(false)), @@ -2319,15 +2813,15 @@ fn main() { specified properties. To group across all sources provide a `-` as the source id. - Example: /v1/organizations/123/sources/-/findings"##), + Example: /v1/organizations/{organization_id}/sources/-/findings"##), "Details at http://byron.github.io/google-apis-rs/google_securitycenter1_cli/organizations_sources-findings-group", vec![ (Some(r##"parent"##), None, - Some(r##"Name of the source to groupBy. Its format is + Some(r##"Required. Name of the source to groupBy. Its format is "organizations/[organization_id]/sources/[source_id]". To groupBy across all sources provide a source_id of `-`. For example: - organizations/123/sources/-"##), + organizations/{organization_id}/sources/-"##), Some(true), Some(false)), @@ -2353,15 +2847,15 @@ fn main() { Some(r##"Lists an organization or source's findings. To list across all sources provide a `-` as the source id. - Example: /v1/organizations/123/sources/-/findings"##), + Example: /v1/organizations/{organization_id}/sources/-/findings"##), "Details at http://byron.github.io/google-apis-rs/google_securitycenter1_cli/organizations_sources-findings-list", vec![ (Some(r##"parent"##), None, - Some(r##"Name of the source the findings belong to. Its format is + Some(r##"Required. Name of the source the findings belong to. Its format is "organizations/[organization_id]/sources/[source_id]". To list across all sources provide a source_id of `-`. For example: - organizations/123/sources/-"##), + organizations/{organization_id}/sources/-"##), Some(true), Some(false)), @@ -2387,7 +2881,7 @@ fn main() { Some(r##"The relative resource name of this finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: - "organizations/123/sources/456/findings/789""##), + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}""##), Some(true), Some(false)), @@ -2415,10 +2909,10 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The relative resource name of the finding. See: + Some(r##"Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: - "organizations/123/sources/456/finding/789"."##), + "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}"."##), Some(true), Some(false)), @@ -2449,8 +2943,8 @@ fn main() { Some(r##"The relative resource name of the SecurityMarks. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Examples: - "organizations/123/assets/456/securityMarks" - "organizations/123/sources/456/findings/789/securityMarks"."##), + "organizations/{organization_id}/assets/{asset_id}/securityMarks" + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks"."##), Some(true), Some(false)), @@ -2478,7 +2972,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Relative resource name of the source. Its format is + Some(r##"Required. Relative resource name of the source. Its format is "organizations/[organization_id]/source/[source_id]"."##), Some(true), Some(false)), @@ -2530,7 +3024,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Resource name of the parent of sources to list. Its format should be + Some(r##"Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id]"."##), Some(true), Some(false)), @@ -2556,7 +3050,7 @@ fn main() { Some(r##"The relative resource name of this source. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: - "organizations/123/sources/456""##), + "organizations/{organization_id}/sources/{source_id}""##), Some(true), Some(false)), @@ -2645,7 +3139,7 @@ fn main() { Some(r##"The relative resource name of the settings. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: - "organizations/123/organizationSettings"."##), + "organizations/{organization_id}/organizationSettings"."##), Some(true), Some(false)), @@ -2673,8 +3167,8 @@ fn main() { let mut app = App::new("securitycenter1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") - .about("Cloud Security Command Center API provides access to temporal views of assets and findings within an organization.") + .version("1.0.13+20200406") + .about("Security Command Center API provides access to temporal views of assets and findings within an organization.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_securitycenter1_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/securitycenter1/Cargo.toml b/gen/securitycenter1/Cargo.toml index 1994ac8b75..a12c953b6e 100644 --- a/gen/securitycenter1/Cargo.toml +++ b/gen/securitycenter1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-securitycenter1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Security Command Center (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/securitycenter1" homepage = "https://console.cloud.google.com/apis/api/securitycenter.googleapis.com/overview" -documentation = "https://docs.rs/google-securitycenter1/1.0.12+20190628" +documentation = "https://docs.rs/google-securitycenter1/1.0.13+20200406" license = "MIT" keywords = ["securitycenter", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/securitycenter1/README.md b/gen/securitycenter1/README.md index 4dd581e67a..5b0a294399 100644 --- a/gen/securitycenter1/README.md +++ b/gen/securitycenter1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-securitycenter1` library allows access to all features of the *Google Security Command Center* service. -This documentation was generated from *Security Command Center* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *securitycenter:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Security Command Center* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *securitycenter:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Security Command Center* *v1* API can be found at the [official documentation site](https://console.cloud.google.com/apis/api/securitycenter.googleapis.com/overview). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.SecurityCommandCenter.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.SecurityCommandCenter.html) ... * organizations - * [*assets group*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationAssetGroupCall.html), [*assets list*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationAssetListCall.html), [*assets run discovery*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationAssetRunDiscoveryCall.html), [*assets update security marks*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationAssetUpdateSecurityMarkCall.html), [*get organization settings*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationGetOrganizationSettingCall.html), [*operations cancel*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationOperationCancelCall.html), [*operations delete*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationOperationDeleteCall.html), [*operations get*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationOperationGetCall.html), [*operations list*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationOperationListCall.html), [*sources create*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceCreateCall.html), [*sources findings create*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceFindingCreateCall.html), [*sources findings group*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceFindingGroupCall.html), [*sources findings list*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceFindingListCall.html), [*sources findings patch*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceFindingPatchCall.html), [*sources findings set state*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceFindingSetStateCall.html), [*sources findings update security marks*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceFindingUpdateSecurityMarkCall.html), [*sources get*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceGetCall.html), [*sources get iam policy*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceGetIamPolicyCall.html), [*sources list*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceListCall.html), [*sources patch*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourcePatchCall.html), [*sources set iam policy*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceSetIamPolicyCall.html), [*sources test iam permissions*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationSourceTestIamPermissionCall.html) and [*update organization settings*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.OrganizationUpdateOrganizationSettingCall.html) + * [*assets group*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationAssetGroupCall.html), [*assets list*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationAssetListCall.html), [*assets run discovery*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationAssetRunDiscoveryCall.html), [*assets update security marks*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationAssetUpdateSecurityMarkCall.html), [*get organization settings*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationGetOrganizationSettingCall.html), [*notification configs create*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationNotificationConfigCreateCall.html), [*notification configs delete*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationNotificationConfigDeleteCall.html), [*notification configs get*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationNotificationConfigGetCall.html), [*notification configs list*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationNotificationConfigListCall.html), [*notification configs patch*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationNotificationConfigPatchCall.html), [*operations cancel*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationOperationCancelCall.html), [*operations delete*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationOperationDeleteCall.html), [*operations get*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationOperationGetCall.html), [*operations list*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationOperationListCall.html), [*sources create*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceCreateCall.html), [*sources findings create*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceFindingCreateCall.html), [*sources findings group*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceFindingGroupCall.html), [*sources findings list*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceFindingListCall.html), [*sources findings patch*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceFindingPatchCall.html), [*sources findings set state*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceFindingSetStateCall.html), [*sources findings update security marks*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceFindingUpdateSecurityMarkCall.html), [*sources get*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceGetCall.html), [*sources get iam policy*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceGetIamPolicyCall.html), [*sources list*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceListCall.html), [*sources patch*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourcePatchCall.html), [*sources set iam policy*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceSetIamPolicyCall.html), [*sources test iam permissions*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationSourceTestIamPermissionCall.html) and [*update organization settings*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.OrganizationUpdateOrganizationSettingCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/struct.SecurityCommandCenter.html)** +* **[Hub](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/struct.SecurityCommandCenter.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.Part.html)** + * **[Parts](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-securitycenter1/1.0.12+20190628/google_securitycenter1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-securitycenter1/1.0.13+20200406/google_securitycenter1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/securitycenter1/src/lib.rs b/gen/securitycenter1/src/lib.rs index 54393e4efd..551b954b4f 100644 --- a/gen/securitycenter1/src/lib.rs +++ b/gen/securitycenter1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Security Command Center* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *securitycenter:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Security Command Center* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *securitycenter:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Security Command Center* *v1* API can be found at the //! [official documentation site](https://console.cloud.google.com/apis/api/securitycenter.googleapis.com/overview). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.SecurityCommandCenter.html) ... //! //! * organizations -//! * [*assets group*](struct.OrganizationAssetGroupCall.html), [*assets list*](struct.OrganizationAssetListCall.html), [*assets run discovery*](struct.OrganizationAssetRunDiscoveryCall.html), [*assets update security marks*](struct.OrganizationAssetUpdateSecurityMarkCall.html), [*get organization settings*](struct.OrganizationGetOrganizationSettingCall.html), [*operations cancel*](struct.OrganizationOperationCancelCall.html), [*operations delete*](struct.OrganizationOperationDeleteCall.html), [*operations get*](struct.OrganizationOperationGetCall.html), [*operations list*](struct.OrganizationOperationListCall.html), [*sources create*](struct.OrganizationSourceCreateCall.html), [*sources findings create*](struct.OrganizationSourceFindingCreateCall.html), [*sources findings group*](struct.OrganizationSourceFindingGroupCall.html), [*sources findings list*](struct.OrganizationSourceFindingListCall.html), [*sources findings patch*](struct.OrganizationSourceFindingPatchCall.html), [*sources findings set state*](struct.OrganizationSourceFindingSetStateCall.html), [*sources findings update security marks*](struct.OrganizationSourceFindingUpdateSecurityMarkCall.html), [*sources get*](struct.OrganizationSourceGetCall.html), [*sources get iam policy*](struct.OrganizationSourceGetIamPolicyCall.html), [*sources list*](struct.OrganizationSourceListCall.html), [*sources patch*](struct.OrganizationSourcePatchCall.html), [*sources set iam policy*](struct.OrganizationSourceSetIamPolicyCall.html), [*sources test iam permissions*](struct.OrganizationSourceTestIamPermissionCall.html) and [*update organization settings*](struct.OrganizationUpdateOrganizationSettingCall.html) +//! * [*assets group*](struct.OrganizationAssetGroupCall.html), [*assets list*](struct.OrganizationAssetListCall.html), [*assets run discovery*](struct.OrganizationAssetRunDiscoveryCall.html), [*assets update security marks*](struct.OrganizationAssetUpdateSecurityMarkCall.html), [*get organization settings*](struct.OrganizationGetOrganizationSettingCall.html), [*notification configs create*](struct.OrganizationNotificationConfigCreateCall.html), [*notification configs delete*](struct.OrganizationNotificationConfigDeleteCall.html), [*notification configs get*](struct.OrganizationNotificationConfigGetCall.html), [*notification configs list*](struct.OrganizationNotificationConfigListCall.html), [*notification configs patch*](struct.OrganizationNotificationConfigPatchCall.html), [*operations cancel*](struct.OrganizationOperationCancelCall.html), [*operations delete*](struct.OrganizationOperationDeleteCall.html), [*operations get*](struct.OrganizationOperationGetCall.html), [*operations list*](struct.OrganizationOperationListCall.html), [*sources create*](struct.OrganizationSourceCreateCall.html), [*sources findings create*](struct.OrganizationSourceFindingCreateCall.html), [*sources findings group*](struct.OrganizationSourceFindingGroupCall.html), [*sources findings list*](struct.OrganizationSourceFindingListCall.html), [*sources findings patch*](struct.OrganizationSourceFindingPatchCall.html), [*sources findings set state*](struct.OrganizationSourceFindingSetStateCall.html), [*sources findings update security marks*](struct.OrganizationSourceFindingUpdateSecurityMarkCall.html), [*sources get*](struct.OrganizationSourceGetCall.html), [*sources get iam policy*](struct.OrganizationSourceGetIamPolicyCall.html), [*sources list*](struct.OrganizationSourceListCall.html), [*sources patch*](struct.OrganizationSourcePatchCall.html), [*sources set iam policy*](struct.OrganizationSourceSetIamPolicyCall.html), [*sources test iam permissions*](struct.OrganizationSourceTestIamPermissionCall.html) and [*update organization settings*](struct.OrganizationUpdateOrganizationSettingCall.html) //! //! //! @@ -333,7 +333,7 @@ impl<'a, C, A> SecurityCommandCenter SecurityCommandCenter { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://securitycenter.googleapis.com/".to_string(), _root_url: "https://securitycenter.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> SecurityCommandCenter } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -416,154 +416,37 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. -/// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. -/// -/// **JSON Example** -/// -/// ````text -/// { -/// "bindings": [ -/// { -/// "role": "roles/owner", -/// "members": [ -/// "user:mike@example.com", -/// "group:admins@example.com", -/// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" -/// ] -/// }, -/// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] -/// } -/// ] -/// } -/// ```` -/// -/// **YAML Example** -/// -/// ````text -/// bindings: -/// - members: -/// - user:mike@example.com -/// - group:admins@example.com -/// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner -/// - members: -/// - user:sean@example.com -/// role: roles/viewer -/// ```` -/// -/// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// Request message for running asset discovery for an organization. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [sources get iam policy organizations](struct.OrganizationSourceGetIamPolicyCall.html) (response) -/// * [sources set iam policy organizations](struct.OrganizationSourceSetIamPolicyCall.html) (response) -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Policy { - /// Specifies cloud audit logging configuration for this policy. - #[serde(rename="auditConfigs")] - pub audit_configs: Option>, - /// `etag` is used for optimistic concurrency control as a way to help - /// prevent simultaneous updates of a policy from overwriting each other. - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the policy. - /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. - pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, - /// Deprecated. - pub version: Option, -} - -impl ResponseResult for Policy {} - - -/// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud -/// Platform (GCP) resource. +/// * [assets run discovery organizations](struct.OrganizationAssetRunDiscoveryCall.html) (request) /// -/// The Asset is a Cloud SCC resource that captures information about a single -/// GCP resource. All modifications to an Asset are only within the context of -/// Cloud SCC and don't affect the referenced GCP resource. +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RunAssetDiscoveryRequest { _never_set: Option } + +impl RequestValue for RunAssetDiscoveryRequest {} + + +/// The config for streaming-based notifications, which send each event as soon +/// as it is detected. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Asset { - /// Resource managed properties. These properties are managed and defined by - /// the GCP resource and cannot be modified by the user. - #[serde(rename="resourceProperties")] - pub resource_properties: Option>, - /// The time at which the asset was last updated, added, or deleted in Cloud - /// SCC. - #[serde(rename="updateTime")] - pub update_time: Option, - /// The relative resource name of this asset. See: - /// https://cloud.google.com/apis/design/resource_names#relative_resource_name - /// Example: - /// "organizations/123/assets/456". - pub name: Option, - /// IAM Policy information associated with the GCP resource described by the - /// Cloud SCC asset. This information is managed and defined by the GCP - /// resource and cannot be modified by the user. - #[serde(rename="iamPolicy")] - pub iam_policy: Option, - /// User specified security marks. These marks are entirely managed by the user - /// and come from the SecurityMarks resource that belongs to the asset. - #[serde(rename="securityMarks")] - pub security_marks: Option, - /// The time at which the asset was created in Cloud SCC. - #[serde(rename="createTime")] - pub create_time: Option, - /// Cloud SCC managed properties. These properties are managed by - /// Cloud SCC and cannot be modified by the user. - #[serde(rename="securityCenterProperties")] - pub security_center_properties: Option, -} - -impl Part for Asset {} - - -/// Request message for grouping by findings. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [sources findings group organizations](struct.OrganizationSourceFindingGroupCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GroupFindingsRequest { - /// Expression that defines the filter to apply across findings. - /// The expression is a list of one or more restrictions combined via logical - /// operators `AND` and `OR`. - /// Parentheses are supported, and `OR` has higher precedence than `AND`. +pub struct StreamingConfig { + /// Expression that defines the filter to apply across create/update events + /// of assets or findings as specified by the event type. The expression is a + /// list of zero or more restrictions combined via logical operators `AND` + /// and `OR`. Parentheses are supported, and `OR` has higher precedence than + /// `AND`. /// - /// Restrictions have the form ` ` and may have a `-` - /// character in front of them to indicate negation. Examples include: - /// - /// * name - /// * source_properties.a_property - /// * security_marks.marks.marka + /// Restrictions have the form ` ` and may have a + /// `-` character in front of them to indicate negation. The fields map to + /// those defined in the corresponding resource. /// /// The supported operators are: /// @@ -576,91 +459,23 @@ pub struct GroupFindingsRequest { /// * string literals in quotes. /// * integer literals without quotes. /// * boolean literals `true` and `false` without quotes. - /// - /// The following field and operator combinations are supported: - /// - /// * name: `=` - /// * parent: `=`, `:` - /// * resource_name: `=`, `:` - /// * state: `=`, `:` - /// * category: `=`, `:` - /// * external_uri: `=`, `:` - /// * event_time: `>`, `<`, `>=`, `<=` - /// * security_marks: `=`, `:` - /// * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - /// - /// For example, `source_properties.size = 100` is a valid filter string. pub filter: Option, - /// The value returned by the last `GroupFindingsResponse`; indicates - /// that this is a continuation of a prior `GroupFindings` call, and - /// that the system should return the next page of data. - #[serde(rename="pageToken")] - pub page_token: Option, - /// When compare_duration is set, the GroupResult's "state_change" attribute is - /// updated to indicate whether the finding had its state changed, the - /// finding's state remained unchanged, or if the finding was added during the - /// compare_duration period of time that precedes the read_time. This is the - /// time between (read_time - compare_duration) and read_time. - /// - /// The state_change value is derived based on the presence and state of the - /// finding at the two points in time. Intermediate state changes between the - /// two times don't affect the result. For example, the results aren't affected - /// if the finding is made inactive and then active again. - /// - /// Possible "state_change" values when compare_duration is specified: - /// - /// * "CHANGED": indicates that the finding was present at the start of - /// compare_duration, but changed its state at read_time. - /// * "UNCHANGED": indicates that the finding was present at the start of - /// compare_duration and did not change state at read_time. - /// * "ADDED": indicates that the finding was not present at the start - /// of compare_duration, but was present at read_time. - /// - /// If compare_duration is not specified, then the only possible state_change - /// is "UNUSED", which will be the state_change set for all findings present - /// at read_time. - /// - /// If this field is set then `state_change` must be a specified field in - /// `group_by`. - #[serde(rename="compareDuration")] - pub compare_duration: Option, - /// The maximum number of results to return in a single response. Default is - /// 10, minimum is 1, maximum is 1000. - #[serde(rename="pageSize")] - pub page_size: Option, - /// Expression that defines what assets fields to use for grouping (including - /// `state_change`). The string value should follow SQL syntax: comma separated - /// list of fields. For example: "parent,resource_name". - /// - /// The following fields are supported: - /// - /// * resource_name - /// * category - /// * state - /// * parent - /// - /// The following fields are supported when compare_duration is set: - /// - /// * state_change - #[serde(rename="groupBy")] - pub group_by: Option, - /// Time used as a reference point when filtering findings. The filter is - /// limited to findings existing at the supplied time and their values are - /// those at that specific time. Absence of this field will default to the - /// API's version of NOW. - #[serde(rename="readTime")] - pub read_time: Option, } -impl RequestValue for GroupFindingsRequest {} +impl Part for StreamingConfig {} -/// Cloud Security Command Center (Cloud SCC) finding. +/// Security Command Center finding. /// -/// A finding is a record of assessment data (security, risk, health or privacy) -/// ingested into Cloud SCC for presentation, notification, analysis, -/// policy testing, and enforcement. For example, an XSS vulnerability in an -/// App Engine application is a finding. +/// A finding is a record of assessment data like security, risk, health, or +/// privacy, that is ingested into Security Command Center for presentation, +/// notification, analysis, policy testing, and enforcement. For example, a +/// cross-site scripting (XSS) vulnerability in an App Engine application is a +/// finding. +/// +/// When adding a new field hidden behind a visibility label, ensure it is also +/// hidden from Notifications: +/// http://google3/java/com/google/cloud/security/riskdashboard/notification/actions/streaming/FindingTranslator.java?l=26 /// /// # Activities /// @@ -691,20 +506,22 @@ pub struct Finding { /// The relative resource name of this finding. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/sources/456/findings/789" + /// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" pub name: Option, /// The relative resource name of the source the finding belongs to. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// This field is immutable after creation time. /// For example: - /// "organizations/123/sources/456" + /// "organizations/{organization_id}/sources/{source_id}" pub parent: Option, /// The state of the finding. pub state: Option, - /// The full resource name of the Google Cloud Platform (GCP) resource this - /// finding is for. See: + /// For findings on Google Cloud resources, the full resource + /// name of the Google Cloud resource this finding is for. See: /// https://cloud.google.com/apis/design/resource_names#full_resource_name - /// This field is immutable after creation time. + /// When the finding is for a non-Google Cloud resource, the resourceName can + /// be a customer or partner defined string. This field is immutable after + /// creation time. #[serde(rename="resourceName")] pub resource_name: Option, /// Output only. User specified security marks. These marks are entirely @@ -712,12 +529,12 @@ pub struct Finding { /// to the finding. #[serde(rename="securityMarks")] pub security_marks: Option, - /// The time at which the finding was created in Cloud SCC. + /// The time at which the finding was created in Security Command Center. #[serde(rename="createTime")] pub create_time: Option, - /// The URI that, if available, points to a web page outside of Cloud SCC - /// where additional information about the finding can be found. This field is - /// guaranteed to be either empty or a well formed URL. + /// The URI that, if available, points to a web page outside of Security + /// Command Center where additional information about the finding can be found. + /// This field is guaranteed to be either empty or a well formed URL. #[serde(rename="externalUri")] pub external_uri: Option, } @@ -726,6 +543,314 @@ impl RequestValue for Finding {} impl ResponseResult for Finding {} +/// Security Command Center representation of a Google Cloud +/// resource. +/// +/// The Asset is a Security Command Center resource that captures information +/// about a single Google Cloud resource. All modifications to an Asset are only +/// within the context of Security Command Center and don't affect the referenced +/// Google Cloud resource. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Asset { + /// Resource managed properties. These properties are managed and defined by + /// the Google Cloud resource and cannot be modified by the user. + #[serde(rename="resourceProperties")] + pub resource_properties: Option>, + /// The time at which the asset was last updated, added, or deleted in Security + /// Command Center. + #[serde(rename="updateTime")] + pub update_time: Option, + /// The relative resource name of this asset. See: + /// https://cloud.google.com/apis/design/resource_names#relative_resource_name + /// Example: + /// "organizations/{organization_id}/assets/{asset_id}". + pub name: Option, + /// Cloud IAM Policy information associated with the Google Cloud resource + /// described by the Security Command Center asset. This information is managed + /// and defined by the Google Cloud resource and cannot be modified by the + /// user. + #[serde(rename="iamPolicy")] + pub iam_policy: Option, + /// User specified security marks. These marks are entirely managed by the user + /// and come from the SecurityMarks resource that belongs to the asset. + #[serde(rename="securityMarks")] + pub security_marks: Option, + /// The time at which the asset was created in Security Command Center. + #[serde(rename="createTime")] + pub create_time: Option, + /// Security Command Center managed properties. These properties are managed by + /// Security Command Center and cannot be modified by the user. + #[serde(rename="securityCenterProperties")] + pub security_center_properties: Option, +} + +impl Part for Asset {} + + +/// Request message for grouping by findings. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [sources findings group organizations](struct.OrganizationSourceFindingGroupCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GroupFindingsRequest { + /// Expression that defines the filter to apply across findings. + /// The expression is a list of one or more restrictions combined via logical + /// operators `AND` and `OR`. + /// Parentheses are supported, and `OR` has higher precedence than `AND`. + /// + /// Restrictions have the form ` ` and may have a `-` + /// character in front of them to indicate negation. Examples include: + /// + /// * name + /// * source_properties.a_property + /// * security_marks.marks.marka + /// + /// The supported operators are: + /// + /// * `=` for all value types. + /// * `>`, `<`, `>=`, `<=` for integer values. + /// * `:`, meaning substring matching, for strings. + /// + /// The supported value types are: + /// + /// * string literals in quotes. + /// * integer literals without quotes. + /// * boolean literals `true` and `false` without quotes. + /// + /// The following field and operator combinations are supported: + /// + /// * name: `=` + /// + /// * parent: `=`, `:` + /// + /// * resource_name: `=`, `:` + /// + /// * state: `=`, `:` + /// + /// * category: `=`, `:` + /// + /// * external_uri: `=`, `:` + /// + /// * event_time: `=`, `>`, `<`, `>=`, `<=` + /// + /// Usage: This should be milliseconds since epoch or an RFC3339 string. + /// Examples: + /// "event_time = "2019-06-10T16:07:18-07:00"" + /// "event_time = 1560208038000" + /// + /// * security_marks.marks: `=`, `:` + /// + /// * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` + /// + /// For example, `source_properties.size = 100` is a valid filter string. + /// + /// Use a partial match on the empty string to filter based on a property + /// existing: "source_properties.my_property : """ + /// + /// Use a negated partial match on the empty string to filter based on a + /// property not existing: "-source_properties.my_property : """ + pub filter: Option, + /// The value returned by the last `GroupFindingsResponse`; indicates + /// that this is a continuation of a prior `GroupFindings` call, and + /// that the system should return the next page of data. + #[serde(rename="pageToken")] + pub page_token: Option, + /// When compare_duration is set, the GroupResult's "state_change" attribute is + /// updated to indicate whether the finding had its state changed, the + /// finding's state remained unchanged, or if the finding was added during the + /// compare_duration period of time that precedes the read_time. This is the + /// time between (read_time - compare_duration) and read_time. + /// + /// The state_change value is derived based on the presence and state of the + /// finding at the two points in time. Intermediate state changes between the + /// two times don't affect the result. For example, the results aren't affected + /// if the finding is made inactive and then active again. + /// + /// Possible "state_change" values when compare_duration is specified: + /// + /// * "CHANGED": indicates that the finding was present and matched the given + /// filter at the start of compare_duration, but changed its + /// state at read_time. + /// * "UNCHANGED": indicates that the finding was present and matched the given + /// filter at the start of compare_duration and did not change + /// state at read_time. + /// * "ADDED": indicates that the finding did not match the given filter or + /// was not present at the start of compare_duration, but was + /// present at read_time. + /// * "REMOVED": indicates that the finding was present and matched the + /// filter at the start of compare_duration, but did not match + /// the filter at read_time. + /// + /// If compare_duration is not specified, then the only possible state_change + /// is "UNUSED", which will be the state_change set for all findings present + /// at read_time. + /// + /// If this field is set then `state_change` must be a specified field in + /// `group_by`. + #[serde(rename="compareDuration")] + pub compare_duration: Option, + /// The maximum number of results to return in a single response. Default is + /// 10, minimum is 1, maximum is 1000. + #[serde(rename="pageSize")] + pub page_size: Option, + /// Required. Expression that defines what assets fields to use for grouping (including + /// `state_change`). The string value should follow SQL syntax: comma separated + /// list of fields. For example: "parent,resource_name". + /// + /// The following fields are supported: + /// + /// * resource_name + /// * category + /// * state + /// * parent + /// + /// The following fields are supported when compare_duration is set: + /// + /// * state_change + #[serde(rename="groupBy")] + pub group_by: Option, + /// Time used as a reference point when filtering findings. The filter is + /// limited to findings existing at the supplied time and their values are + /// those at that specific time. Absence of this field will default to the + /// API's version of NOW. + #[serde(rename="readTime")] + pub read_time: Option, +} + +impl RequestValue for GroupFindingsRequest {} + + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. +/// +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** +/// +/// ````text +/// { +/// "bindings": [ +/// { +/// "role": "roles/resourcemanager.organizationAdmin", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +/// ] +/// }, +/// { +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } +/// } +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 +/// } +/// ```` +/// +/// **YAML example:** +/// +/// ````text +/// bindings: +/// - members: +/// - user:mike@example.com +/// - group:admins@example.com +/// - domain:google.com +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin +/// - members: +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 +/// ```` +/// +/// For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [sources get iam policy organizations](struct.OrganizationSourceGetIamPolicyCall.html) (response) +/// * [sources set iam policy organizations](struct.OrganizationSourceSetIamPolicyCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + pub etag: Option, + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. + pub bindings: Option>, + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. + pub version: Option, +} + +impl ResponseResult for Policy {} + + /// Response message for listing assets. /// /// # Activities @@ -774,6 +899,7 @@ impl ResponseResult for ListAssetsResponse {} /// /// * [operations cancel organizations](struct.OrganizationOperationCancelCall.html) (response) /// * [operations delete organizations](struct.OrganizationOperationDeleteCall.html) (response) +/// * [notification configs delete organizations](struct.OrganizationNotificationConfigDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -825,20 +951,35 @@ pub struct TestIamPermissionsResponse { impl ResponseResult for TestIamPermissionsResponse {} -/// Result containing the Finding and its StateChange. +/// Response message for group by findings. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [sources findings group organizations](struct.OrganizationSourceFindingGroupCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListFindingsResult { - /// Finding matching the search request. - pub finding: Option, - /// State change of the finding between the points in time. - #[serde(rename="stateChange")] - pub state_change: Option, +pub struct GroupFindingsResponse { + /// Token to retrieve the next page of results, or empty if there are no more + /// results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of results matching the query. + #[serde(rename="totalSize")] + pub total_size: Option, + /// Group results. There exists an element for each existing unique + /// combination of property/values. The element contains a count for the number + /// of times those specific property/values appear. + #[serde(rename="groupByResults")] + pub group_by_results: Option>, + /// Time used for executing the groupBy request. + #[serde(rename="readTime")] + pub read_time: Option, } -impl Part for ListFindingsResult {} +impl ResponseResult for GroupFindingsResponse {} /// Result containing the properties and count of a groupBy request. @@ -867,9 +1008,9 @@ impl Part for GroupResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetFindingStateRequest { - /// The desired State of the finding. + /// Required. The desired State of the finding. pub state: Option, - /// The time at which the updated state takes effect. + /// Required. The time at which the updated state takes effect. #[serde(rename="startTime")] pub start_time: Option, } @@ -877,39 +1018,56 @@ pub struct SetFindingStateRequest { impl RequestValue for SetFindingStateRequest {} -/// Request message for running asset discovery for an organization. +/// Cloud Security Command Center (Cloud SCC) notification configs. +/// +/// A notification config is a Cloud SCC resource that contains the configuration +/// to send notifications for create/update events of findings, assets and etc. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [assets run discovery organizations](struct.OrganizationAssetRunDiscoveryCall.html) (request) +/// * [notification configs create organizations](struct.OrganizationNotificationConfigCreateCall.html) (request|response) +/// * [notification configs get organizations](struct.OrganizationNotificationConfigGetCall.html) (response) +/// * [notification configs patch organizations](struct.OrganizationNotificationConfigPatchCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RunAssetDiscoveryRequest { _never_set: Option } +pub struct NotificationConfig { + /// The PubSub topic to send notifications to. Its format is + /// "projects/[project_id]/topics/[topic]". + #[serde(rename="pubsubTopic")] + pub pubsub_topic: Option, + /// Output only. The service account that needs "pubsub.topics.publish" + /// permission to publish to the PubSub topic. + #[serde(rename="serviceAccount")] + pub service_account: Option, + /// The description of the notification config (max of 1024 characters). + pub description: Option, + /// The relative resource name of this notification config. See: + /// https://cloud.google.com/apis/design/resource_names#relative_resource_name + /// Example: + /// "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + pub name: Option, + /// The config for triggering streaming-based notifications. + #[serde(rename="streamingConfig")] + pub streaming_config: Option, +} -impl RequestValue for RunAssetDiscoveryRequest {} +impl RequestValue for NotificationConfig {} +impl ResponseResult for NotificationConfig {} -/// Cloud SCC managed properties. These properties are managed by Cloud SCC and -/// cannot be modified by the user. +/// Security Command Center managed properties. These properties are managed by +/// Security Command Center and cannot be modified by the user. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SecurityCenterProperties { - /// The type of the GCP resource. Examples include: APPLICATION, - /// PROJECT, and ORGANIZATION. This is a case insensitive field defined by - /// Cloud SCC and/or the producer of the resource and is immutable - /// after create time. - #[serde(rename="resourceType")] - pub resource_type: Option, - /// The full resource name of the GCP resource this asset - /// represents. This field is immutable after create time. See: - /// https://cloud.google.com/apis/design/resource_names#full_resource_name - #[serde(rename="resourceName")] - pub resource_name: Option, + /// The user defined display name for this resource. + #[serde(rename="resourceDisplayName")] + pub resource_display_name: Option, /// The full resource name of the immediate parent of the resource. See: /// https://cloud.google.com/apis/design/resource_names#full_resource_name #[serde(rename="resourceParent")] @@ -921,6 +1079,23 @@ pub struct SecurityCenterProperties { /// Owners of the Google Cloud resource. #[serde(rename="resourceOwners")] pub resource_owners: Option>, + /// The type of the Google Cloud resource. Examples include: APPLICATION, + /// PROJECT, and ORGANIZATION. This is a case insensitive field defined by + /// Security Command Center and/or the producer of the resource and is + /// immutable after create time. + #[serde(rename="resourceType")] + pub resource_type: Option, + /// The user defined display name for the project of this resource. + #[serde(rename="resourceProjectDisplayName")] + pub resource_project_display_name: Option, + /// The full resource name of the Google Cloud resource this asset + /// represents. This field is immutable after create time. See: + /// https://cloud.google.com/apis/design/resource_names#full_resource_name + #[serde(rename="resourceName")] + pub resource_name: Option, + /// The user defined display name for the parent of this resource. + #[serde(rename="resourceParentDisplayName")] + pub resource_parent_display_name: Option, } impl Part for SecurityCenterProperties {} @@ -955,40 +1130,9 @@ pub struct ListFindingsResponse { impl ResponseResult for ListFindingsResponse {} -/// Response message for grouping by assets. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [assets group organizations](struct.OrganizationAssetGroupCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GroupAssetsResponse { - /// Token to retrieve the next page of results, or empty if there are no more - /// results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The total number of results matching the query. - #[serde(rename="totalSize")] - pub total_size: Option, - /// Group results. There exists an element for each existing unique - /// combination of property/values. The element contains a count for the number - /// of times those specific property/values appear. - #[serde(rename="groupByResults")] - pub group_by_results: Option>, - /// Time used for executing the groupBy request. - #[serde(rename="readTime")] - pub read_time: Option, -} - -impl ResponseResult for GroupAssetsResponse {} - - -/// User specified security marks that are attached to the parent Cloud Security -/// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud -/// SCC organization -- they can be modified and viewed by all users who have +/// User specified security marks that are attached to the parent Security +/// Command Center resource. Security marks are scoped within a Security Command +/// Center organization -- they can be modified and viewed by all users who have /// proper permissions on the organization. /// /// # Activities @@ -1004,8 +1148,8 @@ pub struct SecurityMarks { /// The relative resource name of the SecurityMarks. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Examples: - /// "organizations/123/assets/456/securityMarks" - /// "organizations/123/sources/456/findings/789/securityMarks". + /// "organizations/{organization_id}/assets/{asset_id}/securityMarks" + /// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". pub name: Option, /// Mutable user specified security marks belonging to the parent resource. /// Constraints are as follows: @@ -1031,7 +1175,7 @@ impl ResponseResult for SecurityMarks {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1042,7 +1186,7 @@ impl ResponseResult for SecurityMarks {} /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1079,6 +1223,33 @@ pub struct GetIamPolicyRequest { impl RequestValue for GetIamPolicyRequest {} +/// Information related to the Google Cloud resource that is +/// associated with this finding. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceType { + /// The human readable name of project that the resource belongs to. + #[serde(rename="projectDisplayName")] + pub project_display_name: Option, + /// The full resource name of project that the resource belongs to. + #[serde(rename="projectName")] + pub project_name: Option, + /// The full resource name of resource's parent. + #[serde(rename="parentName")] + pub parent_name: Option, + /// The full resource name of the resource. See: + /// https://cloud.google.com/apis/design/resource_names#full_resource_name + pub name: Option, + /// The human readable name of resource's parent. + #[serde(rename="parentDisplayName")] + pub parent_display_name: Option, +} + +impl Part for ResourceType {} + + /// Request message for `TestIamPermissions` method. /// /// # Activities @@ -1100,30 +1271,59 @@ pub struct TestIamPermissionsRequest { impl RequestValue for TestIamPermissionsRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -1132,8 +1332,8 @@ pub struct Expr { impl Part for Expr {} -/// User specified settings that are attached to the Cloud Security Command -/// Center (Cloud SCC) organization. +/// User specified settings that are attached to the Security Command +/// Center organization. /// /// # Activities /// @@ -1151,7 +1351,7 @@ pub struct OrganizationSettings { /// The relative resource name of the settings. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/organizationSettings". + /// "organizations/{organization_id}/organizationSettings". pub name: Option, /// A flag that indicates if Asset Discovery should be enabled. If the flag is /// set to `true`, then discovery of assets will occur. If it is set to `false, @@ -1205,18 +1405,50 @@ pub struct GroupAssetsRequest { /// The following field and operator combinations are supported: /// /// * name: `=` - /// * update_time: `>`, `<`, `>=`, `<=`, `=` - /// * create_time: `>`, `<`, `>=`, `<=`, `=` + /// + /// * update_time: `=`, `>`, `<`, `>=`, `<=` + /// + /// Usage: This should be milliseconds since epoch or an RFC3339 string. + /// Examples: + /// "update_time = "2019-06-10T16:07:18-07:00"" + /// "update_time = 1560208038000" + /// + /// * create_time: `=`, `>`, `<`, `>=`, `<=` + /// + /// Usage: This should be milliseconds since epoch or an RFC3339 string. + /// Examples: + /// "create_time = "2019-06-10T16:07:18-07:00"" + /// "create_time = 1560208038000" + /// /// * iam_policy.policy_blob: `=`, `:` + /// /// * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - /// * security_marks: `=`, `:` + /// + /// * security_marks.marks: `=`, `:` + /// /// * security_center_properties.resource_name: `=`, `:` + /// + /// * security_center_properties.resource_display_name: `=`, `:` + /// /// * security_center_properties.resource_type: `=`, `:` + /// /// * security_center_properties.resource_parent: `=`, `:` + /// + /// * security_center_properties.resource_parent_display_name: `=`, `:` + /// /// * security_center_properties.resource_project: `=`, `:` + /// + /// * security_center_properties.resource_project_display_name: `=`, `:` + /// /// * security_center_properties.resource_owners: `=`, `:` /// /// For example, `resource_properties.size = 100` is a valid filter string. + /// + /// Use a partial match on the empty string to filter based on a property + /// existing: "resource_properties.my_property : """ + /// + /// Use a negated partial match on the empty string to filter based on a + /// property not existing: "-resource_properties.my_property : """ pub filter: Option, /// The value returned by the last `GroupAssetsResponse`; indicates /// that this is a continuation of a prior `GroupAssets` call, and that the @@ -1256,7 +1488,7 @@ pub struct GroupAssetsRequest { /// 10, minimum is 1, maximum is 1000. #[serde(rename="pageSize")] pub page_size: Option, - /// Expression that defines what assets fields to use for grouping. The string + /// Required. Expression that defines what assets fields to use for grouping. The string /// value should follow SQL syntax: comma separated list of fields. For /// example: /// "security_center_properties.resource_project,security_center_properties.project". @@ -1264,12 +1496,16 @@ pub struct GroupAssetsRequest { /// The following fields are supported when compare_duration is not set: /// /// * security_center_properties.resource_project + /// * security_center_properties.resource_project_display_name /// * security_center_properties.resource_type /// * security_center_properties.resource_parent + /// * security_center_properties.resource_parent_display_name /// /// The following fields are supported when compare_duration is set: /// /// * security_center_properties.resource_type + /// * security_center_properties.resource_project_display_name + /// * security_center_properties.resource_parent_display_name #[serde(rename="groupBy")] pub group_by: Option, /// Time used as a reference point when filtering assets. The filter is limited @@ -1283,17 +1519,35 @@ pub struct GroupAssetsRequest { impl RequestValue for GroupAssetsRequest {} -/// Response message for group by findings. +/// Result containing the Finding and its StateChange. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListFindingsResult { + /// Finding matching the search request. + pub finding: Option, + /// Output only. Resource that is associated with this finding. + pub resource: Option, + /// State change of the finding between the points in time. + #[serde(rename="stateChange")] + pub state_change: Option, +} + +impl Part for ListFindingsResult {} + + +/// Response message for grouping by assets. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [sources findings group organizations](struct.OrganizationSourceFindingGroupCall.html) (response) +/// * [assets group organizations](struct.OrganizationAssetGroupCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GroupFindingsResponse { +pub struct GroupAssetsResponse { /// Token to retrieve the next page of results, or empty if there are no more /// results. #[serde(rename="nextPageToken")] @@ -1311,7 +1565,7 @@ pub struct GroupFindingsResponse { pub read_time: Option, } -impl ResponseResult for GroupFindingsResponse {} +impl ResponseResult for GroupAssetsResponse {} /// The response message for Operations.ListOperations. @@ -1335,9 +1589,10 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +/// Security Command Center finding source. A finding source /// is an entity or a mechanism that can produce a finding. A source is like a -/// container of findings that come from the same scanner, logger, monitor, etc. +/// container of findings that come from the same scanner, logger, monitor, and +/// other tools. /// /// # Activities /// @@ -1359,16 +1614,16 @@ pub struct Source { pub display_name: Option, /// The description of the source (max of 1024 characters). /// Example: - /// "Cloud Security Scanner is a web security scanner for common + /// "Web Security Scanner is a web security scanner for common /// vulnerabilities in App Engine applications. It can automatically /// scan and detect four common vulnerabilities, including cross-site-scripting /// (XSS), Flash injection, mixed content (HTTP in HTTPS), and - /// outdated/insecure libraries." + /// outdated or insecure libraries." pub description: Option, /// The relative resource name of this source. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/sources/456" + /// "organizations/{organization_id}/sources/{source_id}" pub name: Option, } @@ -1383,9 +1638,13 @@ impl ResponseResult for Source {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetPolicyOptions { /// Optional. The policy format version to be returned. - /// Acceptable values are 0 and 1. - /// If the value is 0, or the field is omitted, policy format version 1 will be - /// returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. #[serde(rename="requestedPolicyVersion")] pub requested_policy_version: Option, } @@ -1417,7 +1676,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -1426,6 +1685,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -1437,6 +1716,29 @@ pub struct Binding { impl Part for Binding {} +/// Response message for listing notification configs. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [notification configs list organizations](struct.OrganizationNotificationConfigListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListNotificationConfigsResponse { + /// Token to retrieve the next page of results, or empty if there are no more + /// results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Notification configs belonging to the requested parent. + #[serde(rename="notificationConfigs")] + pub notification_configs: Option>, +} + +impl ResponseResult for ListNotificationConfigsResponse {} + + /// Specifies the audit configuration for a service. /// The configuration determines which permission types are logged, and what /// identities, if any, are exempted from logging. @@ -1458,7 +1760,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -1470,7 +1772,7 @@ impl Part for Binding {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -1478,7 +1780,7 @@ impl Part for Binding {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -1487,9 +1789,9 @@ impl Part for Binding {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1506,9 +1808,10 @@ pub struct AuditConfig { impl Part for AuditConfig {} -/// IAM Policy information associated with the GCP resource described by the -/// Cloud SCC asset. This information is managed and defined by the GCP -/// resource and cannot be modified by the user. +/// Cloud IAM Policy information associated with the Google Cloud resource +/// described by the Security Command Center asset. This information is managed +/// and defined by the Google Cloud resource and cannot be modified by the +/// user. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1634,7 +1937,7 @@ impl ResponseResult for ListSourcesResponse {} /// ::default(), None); /// let mut hub = SecurityCommandCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `assets_group(...)`, `assets_list(...)`, `assets_run_discovery(...)`, `assets_update_security_marks(...)`, `get_organization_settings(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)`, `sources_create(...)`, `sources_findings_create(...)`, `sources_findings_group(...)`, `sources_findings_list(...)`, `sources_findings_patch(...)`, `sources_findings_set_state(...)`, `sources_findings_update_security_marks(...)`, `sources_get(...)`, `sources_get_iam_policy(...)`, `sources_list(...)`, `sources_patch(...)`, `sources_set_iam_policy(...)`, `sources_test_iam_permissions(...)` and `update_organization_settings(...)` +/// // like `assets_group(...)`, `assets_list(...)`, `assets_run_discovery(...)`, `assets_update_security_marks(...)`, `get_organization_settings(...)`, `notification_configs_create(...)`, `notification_configs_delete(...)`, `notification_configs_get(...)`, `notification_configs_list(...)`, `notification_configs_patch(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)`, `sources_create(...)`, `sources_findings_create(...)`, `sources_findings_group(...)`, `sources_findings_list(...)`, `sources_findings_patch(...)`, `sources_findings_set_state(...)`, `sources_findings_update_security_marks(...)`, `sources_get(...)`, `sources_get_iam_policy(...)`, `sources_list(...)`, `sources_patch(...)`, `sources_set_iam_policy(...)`, `sources_test_iam_permissions(...)` and `update_organization_settings(...)` /// // to build up your call. /// let rb = hub.organizations(); /// # } @@ -1655,7 +1958,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Name of the organization to get organization settings for. Its format is + /// * `name` - Required. Name of the organization to get organization settings for. Its format is /// "organizations/[organization_id]/organizationSettings". pub fn get_organization_settings(&self, name: &str) -> OrganizationGetOrganizationSettingCall<'a, C, A> { OrganizationGetOrganizationSettingCall { @@ -1673,15 +1976,15 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// specified properties. /// /// To group across all sources provide a `-` as the source id. - /// Example: /v1/organizations/123/sources/-/findings + /// Example: /v1/organizations/{organization_id}/sources/-/findings /// /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Name of the source to groupBy. Its format is + /// * `parent` - Required. Name of the source to groupBy. Its format is /// "organizations/[organization_id]/sources/[source_id]". To groupBy across /// all sources provide a source_id of `-`. For example: - /// organizations/123/sources/- + /// organizations/{organization_id}/sources/- pub fn sources_findings_group(&self, request: GroupFindingsRequest, parent: &str) -> OrganizationSourceFindingGroupCall<'a, C, A> { OrganizationSourceFindingGroupCall { hub: self.hub, @@ -1693,13 +1996,31 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a notification config. + /// + /// # Arguments + /// + /// * `name` - Required. Name of the notification config to delete. Its format is + /// "organizations/[organization_id]/notificationConfigs/[config_id]". + pub fn notification_configs_delete(&self, name: &str) -> OrganizationNotificationConfigDeleteCall<'a, C, A> { + OrganizationNotificationConfigDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists all sources belonging to an organization. /// /// # Arguments /// - /// * `parent` - Resource name of the parent of sources to list. Its format should be + /// * `parent` - Required. Resource name of the parent of sources to list. Its format should be /// "organizations/[organization_id]". pub fn sources_list(&self, parent: &str) -> OrganizationSourceListCall<'a, C, A> { OrganizationSourceListCall { @@ -1723,7 +2044,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `name` - The relative resource name of the settings. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/organizationSettings". + /// "organizations/{organization_id}/organizationSettings". pub fn update_organization_settings(&self, request: OrganizationSettings, name: &str) -> OrganizationUpdateOrganizationSettingCall<'a, C, A> { OrganizationUpdateOrganizationSettingCall { hub: self.hub, @@ -1768,7 +2089,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Name of the organization to run asset discovery for. Its format is + /// * `parent` - Required. Name of the organization to run asset discovery for. Its format is /// "organizations/[organization_id]". pub fn assets_run_discovery(&self, request: RunAssetDiscoveryRequest, parent: &str) -> OrganizationAssetRunDiscoveryCall<'a, C, A> { OrganizationAssetRunDiscoveryCall { @@ -1801,6 +2122,30 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// + /// Updates a notification config. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The relative resource name of this notification config. See: + /// https://cloud.google.com/apis/design/resource_names#relative_resource_name + /// Example: + /// "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + pub fn notification_configs_patch(&self, request: NotificationConfig, name: &str) -> OrganizationNotificationConfigPatchCall<'a, C, A> { + OrganizationNotificationConfigPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Starts asynchronous cancellation on a long-running operation. The server @@ -1827,6 +2172,26 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists notification configs. + /// + /// # Arguments + /// + /// * `parent` - Required. Name of the organization to list notification configs. + /// Its format is "organizations/[organization_id]". + pub fn notification_configs_list(&self, parent: &str) -> OrganizationNotificationConfigListCall<'a, C, A> { + OrganizationNotificationConfigListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the state of a finding. @@ -1834,10 +2199,10 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The relative resource name of the finding. See: + /// * `name` - Required. The relative resource name of the finding. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/sources/456/finding/789". + /// "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". pub fn sources_findings_set_state(&self, request: SetFindingStateRequest, name: &str) -> OrganizationSourceFindingSetStateCall<'a, C, A> { OrganizationSourceFindingSetStateCall { hub: self.hub, @@ -1854,14 +2219,14 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Lists an organization or source's findings. /// /// To list across all sources provide a `-` as the source id. - /// Example: /v1/organizations/123/sources/-/findings + /// Example: /v1/organizations/{organization_id}/sources/-/findings /// /// # Arguments /// - /// * `parent` - Name of the source the findings belong to. Its format is + /// * `parent` - Required. Name of the source the findings belong to. Its format is /// "organizations/[organization_id]/sources/[source_id]". To list across all /// sources provide a source_id of `-`. For example: - /// organizations/123/sources/- + /// organizations/{organization_id}/sources/- pub fn sources_findings_list(&self, parent: &str) -> OrganizationSourceFindingListCall<'a, C, A> { OrganizationSourceFindingListCall { hub: self.hub, @@ -1890,7 +2255,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `name` - The relative resource name of this finding. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/sources/456/findings/789" + /// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}" pub fn sources_findings_patch(&self, request: Finding, name: &str) -> OrganizationSourceFindingPatchCall<'a, C, A> { OrganizationSourceFindingPatchCall { hub: self.hub, @@ -1911,7 +2276,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Name of the organization to groupBy. Its format is + /// * `parent` - Required. Name of the organization to groupBy. Its format is /// "organizations/[organization_id]". pub fn assets_group(&self, request: GroupAssetsRequest, parent: &str) -> OrganizationAssetGroupCall<'a, C, A> { OrganizationAssetGroupCall { @@ -1934,8 +2299,8 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `name` - The relative resource name of the SecurityMarks. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Examples: - /// "organizations/123/assets/456/securityMarks" - /// "organizations/123/sources/456/findings/789/securityMarks". + /// "organizations/{organization_id}/assets/{asset_id}/securityMarks" + /// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". pub fn sources_findings_update_security_marks(&self, request: SecurityMarks, name: &str) -> OrganizationSourceFindingUpdateSecurityMarkCall<'a, C, A> { OrganizationSourceFindingUpdateSecurityMarkCall { hub: self.hub, @@ -1959,7 +2324,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `name` - The relative resource name of this source. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/sources/456" + /// "organizations/{organization_id}/sources/{source_id}" pub fn sources_patch(&self, request: Source, name: &str) -> OrganizationSourcePatchCall<'a, C, A> { OrganizationSourcePatchCall { hub: self.hub, @@ -1978,7 +2343,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Name of the organization assets should belong to. Its format is + /// * `parent` - Required. Name of the organization assets should belong to. Its format is /// "organizations/[organization_id]". pub fn assets_list(&self, parent: &str) -> OrganizationAssetListCall<'a, C, A> { OrganizationAssetListCall { @@ -2055,8 +2420,8 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `name` - The relative resource name of the SecurityMarks. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Examples: - /// "organizations/123/assets/456/securityMarks" - /// "organizations/123/sources/456/findings/789/securityMarks". + /// "organizations/{organization_id}/assets/{asset_id}/securityMarks" + /// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". pub fn assets_update_security_marks(&self, request: SecurityMarks, name: &str) -> OrganizationAssetUpdateSecurityMarkCall<'a, C, A> { OrganizationAssetUpdateSecurityMarkCall { hub: self.hub, @@ -2090,6 +2455,27 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a notification config. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. Resource name of the new notification config's parent. Its format is + /// "organizations/[organization_id]". + pub fn notification_configs_create(&self, request: NotificationConfig, parent: &str) -> OrganizationNotificationConfigCreateCall<'a, C, A> { + OrganizationNotificationConfigCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _config_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a source. @@ -2097,7 +2483,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Resource name of the new source's parent. Its format should be + /// * `parent` - Required. Resource name of the new source's parent. Its format should be /// "organizations/[organization_id]". pub fn sources_create(&self, request: Source, parent: &str) -> OrganizationSourceCreateCall<'a, C, A> { OrganizationSourceCreateCall { @@ -2118,7 +2504,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Resource name of the new finding's parent. Its format should be + /// * `parent` - Required. Resource name of the new finding's parent. Its format should be /// "organizations/[organization_id]/sources/[source_id]". pub fn sources_findings_create(&self, request: Finding, parent: &str) -> OrganizationSourceFindingCreateCall<'a, C, A> { OrganizationSourceFindingCreateCall { @@ -2152,13 +2538,31 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets a notification config. + /// + /// # Arguments + /// + /// * `name` - Required. Name of the notification config to get. Its format is + /// "organizations/[organization_id]/notificationConfigs/[config_id]". + pub fn notification_configs_get(&self, name: &str) -> OrganizationNotificationConfigGetCall<'a, C, A> { + OrganizationNotificationConfigGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets a source. /// /// # Arguments /// - /// * `name` - Relative resource name of the source. Its format is + /// * `name` - Required. Relative resource name of the source. Its format is /// "organizations/[organization_id]/source/[source_id]". pub fn sources_get(&self, name: &str) -> OrganizationSourceGetCall<'a, C, A> { OrganizationSourceGetCall { @@ -2354,7 +2758,7 @@ impl<'a, C, A> OrganizationGetOrganizationSettingCall<'a, C, A> where C: BorrowM } - /// Name of the organization to get organization settings for. Its format is + /// Required. Name of the organization to get organization settings for. Its format is /// "organizations/[organization_id]/organizationSettings". /// /// Sets the *name* path property to the given value. @@ -2432,7 +2836,7 @@ impl<'a, C, A> OrganizationGetOrganizationSettingCall<'a, C, A> where C: BorrowM /// specified properties. /// /// To group across all sources provide a `-` as the source id. -/// Example: /v1/organizations/123/sources/-/findings +/// Example: /v1/organizations/{organization_id}/sources/-/findings /// /// A builder for the *sources.findings.group* method supported by a *organization* resource. /// It is not used directly, but through a `OrganizationMethods` instance. @@ -2638,10 +3042,10 @@ impl<'a, C, A> OrganizationSourceFindingGroupCall<'a, C, A> where C: BorrowMut OrganizationSourceFindingGroupCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = SecurityCommandCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().notification_configs_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationNotificationConfigDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SecurityCommandCenter, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationNotificationConfigDeleteCall<'a, C, A> {} + +impl<'a, C, A> OrganizationNotificationConfigDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "securitycenter.organizations.notificationConfigs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the notification config to delete. Its format is + /// "organizations/[organization_id]/notificationConfigs/[config_id]". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationNotificationConfigDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationNotificationConfigDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationNotificationConfigDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationNotificationConfigDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists all sources belonging to an organization. /// /// A builder for the *sources.list* method supported by a *organization* resource. @@ -2742,8 +3395,8 @@ impl<'a, C, A> OrganizationSourceFindingGroupCall<'a, C, A> where C: BorrowMut OrganizationSourceListCall<'a, C, A> where C: BorrowMut OrganizationSourceListCall<'a, C, A> where C: BorrowMut OrganizationUpdateOrganizationSettingCall<'a, C, A> where C: Borr /// The relative resource name of the settings. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/organizationSettings". + /// "organizations/{organization_id}/organizationSettings". /// /// Sets the *name* path property to the given value. /// @@ -3777,7 +4430,7 @@ impl<'a, C, A> OrganizationAssetRunDiscoveryCall<'a, C, A> where C: BorrowMut OrganizationSourceGetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = SecurityCommandCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = NotificationConfig::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.organizations().notification_configs_patch(req, "name") +/// .update_mask("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationNotificationConfigPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SecurityCommandCenter, + _request: NotificationConfig, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationNotificationConfigPatchCall<'a, C, A> {} + +impl<'a, C, A> OrganizationNotificationConfigPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NotificationConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "securitycenter.organizations.notificationConfigs.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: NotificationConfig) -> OrganizationNotificationConfigPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The relative resource name of this notification config. See: + /// https://cloud.google.com/apis/design/resource_names#relative_resource_name + /// Example: + /// "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationNotificationConfigPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The FieldMask to use when updating the notification config. + /// + /// If empty all mutable fields will be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> OrganizationNotificationConfigPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationNotificationConfigPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationNotificationConfigPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationNotificationConfigPatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Starts asynchronous cancellation on a long-running operation. The server /// makes a best effort to cancel the operation, but success is not /// guaranteed. If the server doesn't support this method, it returns @@ -4388,6 +5338,282 @@ impl<'a, C, A> OrganizationOperationCancelCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = SecurityCommandCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().notification_configs_list("parent") +/// .page_token("justo") +/// .page_size(-21) +/// .doit(); +/// # } +/// ``` +pub struct OrganizationNotificationConfigListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SecurityCommandCenter, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationNotificationConfigListCall<'a, C, A> {} + +impl<'a, C, A> OrganizationNotificationConfigListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListNotificationConfigsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "securitycenter.organizations.notificationConfigs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/notificationConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the organization to list notification configs. + /// Its format is "organizations/[organization_id]". + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationNotificationConfigListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The value returned by the last `ListNotificationConfigsResponse`; indicates + /// that this is a continuation of a prior `ListNotificationConfigs` call, and + /// that the system should return the next page of data. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OrganizationNotificationConfigListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of results to return in a single response. Default is + /// 10, minimum is 1, maximum is 1000. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OrganizationNotificationConfigListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationNotificationConfigListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationNotificationConfigListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationNotificationConfigListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the state of a finding. /// /// A builder for the *sources.findings.setState* method supported by a *organization* resource. @@ -4594,10 +5820,10 @@ impl<'a, C, A> OrganizationSourceFindingSetStateCall<'a, C, A> where C: BorrowMu self._request = new_value; self } - /// The relative resource name of the finding. See: + /// Required. The relative resource name of the finding. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Example: - /// "organizations/123/sources/456/finding/789". + /// "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". /// /// Sets the *name* path property to the given value. /// @@ -4673,7 +5899,7 @@ impl<'a, C, A> OrganizationSourceFindingSetStateCall<'a, C, A> where C: BorrowMu /// Lists an organization or source's findings. /// /// To list across all sources provide a `-` as the source id. -/// Example: /v1/organizations/123/sources/-/findings +/// Example: /v1/organizations/{organization_id}/sources/-/findings /// /// A builder for the *sources.findings.list* method supported by a *organization* resource. /// It is not used directly, but through a `OrganizationMethods` instance. @@ -4701,13 +5927,13 @@ impl<'a, C, A> OrganizationSourceFindingSetStateCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.organizations().sources_findings_list("parent") -/// .read_time("ea") -/// .page_token("no") -/// .page_size(-21) -/// .order_by("justo") -/// .filter("et") -/// .field_mask("et") -/// .compare_duration("diam") +/// .read_time("diam") +/// .page_token("ipsum") +/// .page_size(-5) +/// .order_by("et") +/// .filter("duo") +/// .field_mask("aliquyam") +/// .compare_duration("sea") /// .doit(); /// # } /// ``` @@ -4883,10 +6109,10 @@ impl<'a, C, A> OrganizationSourceFindingListCall<'a, C, A> where C: BorrowMut OrganizationSourceFindingListCall<'a, C, A> where C: BorrowMut OrganizationSourceFindingListCall<'a, C, A> { @@ -4955,9 +6181,9 @@ impl<'a, C, A> OrganizationSourceFindingListCall<'a, C, A> where C: BorrowMut ` and may have a `-` /// character in front of them to indicate negation. Examples include: /// - /// * name - /// * source_properties.a_property - /// * security_marks.marks.marka + /// * name + /// * source_properties.a_property + /// * security_marks.marks.marka /// /// The supported operators are: /// @@ -4979,11 +6205,23 @@ impl<'a, C, A> OrganizationSourceFindingListCall<'a, C, A> where C: BorrowMut`, `<`, `>=`, `<=` - /// security_marks: `=`, `:` + /// event_time: `=`, `>`, `<`, `>=`, `<=` + /// + /// Usage: This should be milliseconds since epoch or an RFC3339 string. + /// Examples: + /// "event_time = "2019-06-10T16:07:18-07:00"" + /// "event_time = 1560208038000" + /// + /// security_marks.marks: `=`, `:` /// source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` /// /// For example, `source_properties.size = 100` is a valid filter string. + /// + /// Use a partial match on the empty string to filter based on a property + /// existing: "source_properties.my_property : """ + /// + /// Use a negated partial match on the empty string to filter based on a + /// property not existing: "-source_properties.my_property : """ /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> OrganizationSourceFindingListCall<'a, C, A> { @@ -5012,12 +6250,18 @@ impl<'a, C, A> OrganizationSourceFindingListCall<'a, C, A> where C: BorrowMut OrganizationSourceFindingListCall<'a, C, A> where C: BorrowMut OrganizationSourceFindingPatchCall<'a, C, A> where C: BorrowMut OrganizationAssetGroupCall<'a, C, A> where C: BorrowMut OrganizationAssetGroupCall<'a, C, A> where C: BorrowMut OrganizationSourceFindingUpdateSecurityMarkCall<'a, C, A> where C /// The relative resource name of the SecurityMarks. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Examples: - /// "organizations/123/assets/456/securityMarks" - /// "organizations/123/sources/456/findings/789/securityMarks". + /// "organizations/{organization_id}/assets/{asset_id}/securityMarks" + /// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". /// /// Sets the *name* path property to the given value. /// @@ -6020,7 +7264,7 @@ impl<'a, C, A> OrganizationSourceFindingUpdateSecurityMarkCall<'a, C, A> where C /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.organizations().sources_patch(req, "name") -/// .update_mask("eos") +/// .update_mask("amet") /// .doit(); /// # } /// ``` @@ -6200,7 +7444,7 @@ impl<'a, C, A> OrganizationSourcePatchCall<'a, C, A> where C: BorrowMut OrganizationSourcePatchCall<'a, C, A> where C: BorrowMut OrganizationAssetListCall<'a, C, A> where C: BorrowMut OrganizationAssetListCall<'a, C, A> where C: BorrowMut OrganizationAssetListCall<'a, C, A> where C: BorrowMut`, `<`, `>=`, `<=` + /// + /// * update_time: `=`, `>`, `<`, `>=`, `<=` + /// + /// Usage: This should be milliseconds since epoch or an RFC3339 string. + /// Examples: + /// "update_time = "2019-06-10T16:07:18-07:00"" + /// "update_time = 1560208038000" + /// + /// * create_time: `=`, `>`, `<`, `>=`, `<=` + /// + /// Usage: This should be milliseconds since epoch or an RFC3339 string. + /// Examples: + /// "create_time = "2019-06-10T16:07:18-07:00"" + /// "create_time = 1560208038000" + /// /// * iam_policy.policy_blob: `=`, `:` + /// /// * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` - /// * security_marks: `=`, `:` + /// + /// * security_marks.marks: `=`, `:` + /// /// * security_center_properties.resource_name: `=`, `:` + /// + /// * security_center_properties.resource_display_name: `=`, `:` + /// /// * security_center_properties.resource_type: `=`, `:` + /// /// * security_center_properties.resource_parent: `=`, `:` + /// + /// * security_center_properties.resource_parent_display_name: `=`, `:` + /// /// * security_center_properties.resource_project: `=`, `:` + /// + /// * security_center_properties.resource_project_display_name: `=`, `:` + /// /// * security_center_properties.resource_owners: `=`, `:` /// /// For example, `resource_properties.size = 100` is a valid filter string. + /// + /// Use a partial match on the empty string to filter based on a property + /// existing: "resource_properties.my_property : """ + /// + /// Use a negated partial match on the empty string to filter based on a + /// property not existing: "-resource_properties.my_property : """ /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> OrganizationAssetListCall<'a, C, A> { @@ -6989,9 +8269,9 @@ impl<'a, C, A> OrganizationOperationGetCall<'a, C, A> where C: BorrowMut OrganizationOperationListCall<'a, C, A> where C: BorrowMut OrganizationAssetUpdateSecurityMarkCall<'a, C, A> where C: Borrow /// The relative resource name of the SecurityMarks. See: /// https://cloud.google.com/apis/design/resource_names#relative_resource_name /// Examples: - /// "organizations/123/assets/456/securityMarks" - /// "organizations/123/sources/456/findings/789/securityMarks". + /// "organizations/{organization_id}/assets/{asset_id}/securityMarks" + /// "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". /// /// Sets the *name* path property to the given value. /// @@ -7838,6 +9118,301 @@ impl<'a, C, A> OrganizationSourceSetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = SecurityCommandCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = NotificationConfig::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.organizations().notification_configs_create(req, "parent") +/// .config_id("ut") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationNotificationConfigCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SecurityCommandCenter, + _request: NotificationConfig, + _parent: String, + _config_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationNotificationConfigCreateCall<'a, C, A> {} + +impl<'a, C, A> OrganizationNotificationConfigCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NotificationConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "securitycenter.organizations.notificationConfigs.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._config_id { + params.push(("configId", value.to_string())); + } + for &field in ["alt", "parent", "configId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/notificationConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: NotificationConfig) -> OrganizationNotificationConfigCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. Resource name of the new notification config's parent. Its format is + /// "organizations/[organization_id]". + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> OrganizationNotificationConfigCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Required. + /// Unique identifier provided by the client within the parent scope. + /// It must be between 1 and 128 characters, and contains alphanumeric + /// characters, underscores or hyphens only. + /// + /// Sets the *config id* query property to the given value. + pub fn config_id(mut self, new_value: &str) -> OrganizationNotificationConfigCreateCall<'a, C, A> { + self._config_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationNotificationConfigCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationNotificationConfigCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationNotificationConfigCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a source. /// /// A builder for the *sources.create* method supported by a *organization* resource. @@ -8044,7 +9619,7 @@ impl<'a, C, A> OrganizationSourceCreateCall<'a, C, A> where C: BorrowMut OrganizationSourceCreateCall<'a, C, A> where C: BorrowMut OrganizationSourceFindingCreateCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// Resource name of the new finding's parent. Its format should be + /// Required. Resource name of the new finding's parent. Its format should be /// "organizations/[organization_id]/sources/[source_id]". /// /// Sets the *parent* path property to the given value. @@ -8341,7 +9916,7 @@ impl<'a, C, A> OrganizationSourceFindingCreateCall<'a, C, A> where C: BorrowMut< self._parent = new_value.to_string(); self } - /// Unique identifier provided by the client within the parent scope. + /// Required. Unique identifier provided by the client within the parent scope. /// It must be alphanumeric and less than or equal to 32 characters and /// greater than 0 characters in length. /// @@ -8664,6 +10239,255 @@ impl<'a, C, A> OrganizationOperationDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = SecurityCommandCenter::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.organizations().notification_configs_get("name") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationNotificationConfigGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SecurityCommandCenter, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationNotificationConfigGetCall<'a, C, A> {} + +impl<'a, C, A> OrganizationNotificationConfigGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, NotificationConfig)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "securitycenter.organizations.notificationConfigs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the notification config to get. Its format is + /// "organizations/[organization_id]/notificationConfigs/[config_id]". + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OrganizationNotificationConfigGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OrganizationNotificationConfigGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationNotificationConfigGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationNotificationConfigGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets a source. /// /// A builder for the *sources.get* method supported by a *organization* resource. @@ -8839,7 +10663,7 @@ impl<'a, C, A> OrganizationSourceGetCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Service Broker (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/servicebroker1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-servicebroker1] path = "../servicebroker1" -version = "1.0.12+20190624" +version = "1.0.13+20190624" diff --git a/gen/servicebroker1-cli/README.md b/gen/servicebroker1-cli/README.md index 444c0e2348..fd92deeda8 100644 --- a/gen/servicebroker1-cli/README.md +++ b/gen/servicebroker1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Service Broker* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *Service Broker* API at revision *20190624*. The CLI is at version *1.0.13*. ```bash servicebroker1 [options] diff --git a/gen/servicebroker1-cli/mkdocs.yml b/gen/servicebroker1-cli/mkdocs.yml index ac6ce97146..54ab519390 100644 --- a/gen/servicebroker1-cli/mkdocs.yml +++ b/gen/servicebroker1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Service Broker v1.0.12+20190624 +site_name: Service Broker v1.0.13+20190624 site_url: http://byron.github.io/google-apis-rs/google-servicebroker1-cli site_description: A complete library to interact with Service Broker (protocol v1) diff --git a/gen/servicebroker1-cli/src/main.rs b/gen/servicebroker1-cli/src/main.rs index d6bdfcc9fe..f2f1bc7e25 100644 --- a/gen/servicebroker1-cli/src/main.rs +++ b/gen/servicebroker1-cli/src/main.rs @@ -473,7 +473,7 @@ fn main() { let mut app = App::new("servicebroker1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20190624") .about("The Google Cloud Platform Service Broker API provides Google hosted implementation of the Open Service Broker API (https://www.openservicebrokerapi.org/). diff --git a/gen/servicebroker1/Cargo.toml b/gen/servicebroker1/Cargo.toml index 49999912a0..f1484fa40d 100644 --- a/gen/servicebroker1/Cargo.toml +++ b/gen/servicebroker1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-servicebroker1" -version = "1.0.12+20190624" +version = "1.0.13+20190624" authors = ["Sebastian Thiel "] description = "A complete library to interact with Service Broker (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/servicebroker1" homepage = "https://cloud.google.com/kubernetes-engine/docs/concepts/add-on/service-broker" -documentation = "https://docs.rs/google-servicebroker1/1.0.12+20190624" +documentation = "https://docs.rs/google-servicebroker1/1.0.13+20190624" license = "MIT" keywords = ["servicebroker", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/servicebroker1/README.md b/gen/servicebroker1/README.md index af3ec9f940..f52a5cb547 100644 --- a/gen/servicebroker1/README.md +++ b/gen/servicebroker1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-servicebroker1` library allows access to all features of the *Google Service Broker* service. -This documentation was generated from *Service Broker* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *servicebroker:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Service Broker* crate version *1.0.13+20190624*, where *20190624* is the exact revision of the *servicebroker:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Service Broker* *v1* API can be found at the [official documentation site](https://cloud.google.com/kubernetes-engine/docs/concepts/add-on/service-broker). # Features -Use the following functionality with ease from the central [hub](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/struct.ServiceBroker.html) ... +Use the following functionality with ease from the central [hub](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/struct.ServiceBroker.html) ... -* [get iam policy](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/struct.MethodGetIamPolicyCall.html) -* [set iam policy](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/struct.MethodSetIamPolicyCall.html) -* [test iam permissions](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/struct.MethodTestIamPermissionCall.html) +* [get iam policy](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/struct.MethodGetIamPolicyCall.html) +* [set iam policy](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/struct.MethodSetIamPolicyCall.html) +* [test iam permissions](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/struct.MethodTestIamPermissionCall.html) @@ -24,17 +24,17 @@ Use the following functionality with ease from the central [hub](https://docs.rs The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/struct.ServiceBroker.html)** +* **[Hub](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/struct.ServiceBroker.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.Part.html)** + * **[Parts](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-servicebroker1/1.0.12+20190624/google_servicebroker1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-servicebroker1/1.0.13+20190624/google_servicebroker1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/servicebroker1/src/lib.rs b/gen/servicebroker1/src/lib.rs index ce9125b575..157f16d63a 100644 --- a/gen/servicebroker1/src/lib.rs +++ b/gen/servicebroker1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Service Broker* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *servicebroker:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Service Broker* crate version *1.0.13+20190624*, where *20190624* is the exact revision of the *servicebroker:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Service Broker* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/kubernetes-engine/docs/concepts/add-on/service-broker). @@ -331,7 +331,7 @@ impl<'a, C, A> ServiceBroker ServiceBroker { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://servicebroker.googleapis.com/".to_string(), _root_url: "https://servicebroker.googleapis.com/".to_string(), } @@ -342,7 +342,7 @@ impl<'a, C, A> ServiceBroker } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/servicecontrol1-cli/Cargo.toml b/gen/servicecontrol1-cli/Cargo.toml index 7f0d8db3a2..7fd68484ba 100644 --- a/gen/servicecontrol1-cli/Cargo.toml +++ b/gen/servicecontrol1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-servicecontrol1-cli" -version = "1.0.12+20190622" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Service Control (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/servicecontrol1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-servicecontrol1] path = "../servicecontrol1" -version = "1.0.12+20190622" +version = "1.0.13+20200407" diff --git a/gen/servicecontrol1-cli/README.md b/gen/servicecontrol1-cli/README.md index b2d0376f51..82dfe2af40 100644 --- a/gen/servicecontrol1-cli/README.md +++ b/gen/servicecontrol1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Service Control* API at revision *20190622*. The CLI is at version *1.0.12*. +This documentation was generated from the *Service Control* API at revision *20200407*. The CLI is at version *1.0.13*. ```bash servicecontrol1 [options] diff --git a/gen/servicecontrol1-cli/mkdocs.yml b/gen/servicecontrol1-cli/mkdocs.yml index 5f19471e4a..f00bd5bc5a 100644 --- a/gen/servicecontrol1-cli/mkdocs.yml +++ b/gen/servicecontrol1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Service Control v1.0.12+20190622 +site_name: Service Control v1.0.13+20200407 site_url: http://byron.github.io/google-apis-rs/google-servicecontrol1-cli site_description: A complete library to interact with Service Control (protocol v1) diff --git a/gen/servicecontrol1-cli/src/main.rs b/gen/servicecontrol1-cli/src/main.rs index 7cc7c26fee..82d9969b18 100644 --- a/gen/servicecontrol1-cli/src/main.rs +++ b/gen/servicecontrol1-cli/src/main.rs @@ -161,11 +161,10 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "skip-activation-check" => Some(("skipActivationCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "operation.operation-name" => Some(("operation.operationName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "operation.consumer-id" => Some(("operation.consumerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation.importance" => Some(("operation.importance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation.labels" => Some(("operation.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "operation.quota-properties.quota-mode" => Some(("operation.quotaProperties.quotaMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "operation.resource-container" => Some(("operation.resourceContainer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "operation.consumer-id" => Some(("operation.consumerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation.user-labels" => Some(("operation.userLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "operation.start-time" => Some(("operation.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "operation.end-time" => Some(("operation.endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -173,7 +172,7 @@ impl<'n> Engine<'n> { "service-config-id" => Some(("serviceConfigId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-project-settings" => Some(("requestProjectSettings", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["consumer-id", "end-time", "importance", "labels", "operation", "operation-id", "operation-name", "quota-mode", "quota-properties", "request-project-settings", "resource-container", "service-config-id", "skip-activation-check", "start-time", "user-labels"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["consumer-id", "end-time", "importance", "labels", "operation", "operation-id", "operation-name", "quota-mode", "quota-properties", "request-project-settings", "service-config-id", "skip-activation-check", "start-time", "user-labels"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -525,7 +524,8 @@ fn main() { the aggregation time window to avoid data loss risk more than 0.01% for business and compliance reasons. - NOTE: the ReportRequest has the size limit of 1MB. + NOTE: the ReportRequest has the size limit (wire-format byte size) of + 1MB. This method requires the `servicemanagement.services.report` permission on the specified service. For more information, see @@ -567,7 +567,7 @@ fn main() { let mut app = App::new("servicecontrol1") .author("Sebastian Thiel ") - .version("1.0.12+20190622") + .version("1.0.13+20200407") .about("Provides control plane functionality to managed services, such as logging, monitoring, and status checks.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_servicecontrol1_cli") .arg(Arg::with_name("url") diff --git a/gen/servicecontrol1/Cargo.toml b/gen/servicecontrol1/Cargo.toml index 57eb8bd4d4..01a796936b 100644 --- a/gen/servicecontrol1/Cargo.toml +++ b/gen/servicecontrol1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-servicecontrol1" -version = "1.0.12+20190622" +version = "1.0.13+20200407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Service Control (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/servicecontrol1" homepage = "https://cloud.google.com/service-control/" -documentation = "https://docs.rs/google-servicecontrol1/1.0.12+20190622" +documentation = "https://docs.rs/google-servicecontrol1/1.0.13+20200407" license = "MIT" keywords = ["servicecontrol", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/servicecontrol1/README.md b/gen/servicecontrol1/README.md index 7eb4193166..0e5ee9890c 100644 --- a/gen/servicecontrol1/README.md +++ b/gen/servicecontrol1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-servicecontrol1` library allows access to all features of the *Google Service Control* service. -This documentation was generated from *Service Control* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *servicecontrol:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Service Control* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *servicecontrol:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Service Control* *v1* API can be found at the [official documentation site](https://cloud.google.com/service-control/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/struct.ServiceControl.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/struct.ServiceControl.html) ... * services - * [*allocate quota*](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/struct.ServiceAllocateQuotaCall.html), [*check*](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/struct.ServiceCheckCall.html) and [*report*](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/struct.ServiceReportCall.html) + * [*allocate quota*](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/struct.ServiceAllocateQuotaCall.html), [*check*](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/struct.ServiceCheckCall.html) and [*report*](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/struct.ServiceReportCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/struct.ServiceControl.html)** +* **[Hub](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/struct.ServiceControl.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.Part.html)** + * **[Parts](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-servicecontrol1/1.0.12+20190622/google_servicecontrol1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-servicecontrol1/1.0.13+20200407/google_servicecontrol1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/servicecontrol1/src/lib.rs b/gen/servicecontrol1/src/lib.rs index 7ced9f62f8..bfa21b8b74 100644 --- a/gen/servicecontrol1/src/lib.rs +++ b/gen/servicecontrol1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Service Control* crate version *1.0.12+20190622*, where *20190622* is the exact revision of the *servicecontrol:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Service Control* crate version *1.0.13+20200407*, where *20200407* is the exact revision of the *servicecontrol:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Service Control* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/service-control/). @@ -333,7 +333,7 @@ impl<'a, C, A> ServiceControl ServiceControl { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://servicecontrol.googleapis.com/".to_string(), _root_url: "https://servicecontrol.googleapis.com/".to_string(), } @@ -344,7 +344,7 @@ impl<'a, C, A> ServiceControl } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -410,6 +410,7 @@ pub struct MetricValue { /// The labels describing the metric value. /// See comments on google.api.servicecontrol.v1.Operation.labels for /// the overriding relationship. + /// Note that this map must not contain monitored resource labels. pub labels: Option>, /// A double precision floating point value. #[serde(rename="doubleValue")] @@ -490,10 +491,11 @@ pub struct QuotaOperation { /// of the service that generated the operation, and guarantees idempotency in /// case of retries. /// - /// UUID version 4 is recommended, though not required. In scenarios where an - /// operation is computed from existing information and an idempotent id is - /// desirable for deduplication purpose, UUID version 5 is recommended. See - /// RFC 4122 for details. + /// In order to ensure best performance and latency in the Quota backends, + /// operation_ids are optimally associated with time, so that related + /// operations can be accessed fast in storage. For this reason, the + /// recommended token for services that intend to operate at a high QPS is + /// Unix time in nanos + UUID #[serde(rename="operationId")] pub operation_id: Option, } @@ -501,6 +503,47 @@ pub struct QuotaOperation { impl Part for QuotaOperation {} +/// Response message for the AllocateQuota method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [allocate quota services](struct.ServiceAllocateQuotaCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AllocateQuotaResponse { + /// Indicates the decision of the allocate. + #[serde(rename="allocateErrors")] + pub allocate_errors: Option>, + /// ID of the actual config used to process the request. + #[serde(rename="serviceConfigId")] + pub service_config_id: Option, + /// Quota metrics to indicate the result of allocation. Depending on the + /// request, one or more of the following metrics will be included: + /// + /// 1. Per quota group or per quota metric incremental usage will be specified + /// using the following delta metric : + /// "serviceruntime.googleapis.com/api/consumer/quota_used_count" + /// + /// 2. The quota limit reached condition will be specified using the following + /// boolean metric : + /// "serviceruntime.googleapis.com/quota/exceeded" + #[serde(rename="quotaMetrics")] + pub quota_metrics: Option>, + /// WARNING: DO NOT use this field until this warning message is removed. + #[serde(rename="allocateInfo")] + pub allocate_info: Option, + /// The same operation_id value used in the AllocateQuotaRequest. Used for + /// logging and diagnostics purposes. + #[serde(rename="operationId")] + pub operation_id: Option, +} + +impl ResponseResult for AllocateQuotaResponse {} + + /// Request message for the Report method. /// /// # Activities @@ -519,9 +562,9 @@ pub struct ReportRequest { /// be used only when multiple operations are natually available at the time /// of the report. /// - /// If multiple operations are in a single request, the total request size - /// should be no larger than 1MB. See ReportResponse.report_errors for - /// partial failure behavior. + /// There is no limit on the number of operations in the same ReportRequest, + /// however the ReportRequest size should be no larger than 1MB. See + /// ReportResponse.report_errors for partial failure behavior. pub operations: Option>, /// Specifies which version of service config should be used to process the /// request. @@ -580,61 +623,77 @@ pub struct QuotaInfo { impl Part for QuotaInfo {} -/// Distribution represents a frequency distribution of double-valued sample -/// points. It contains the size of the population of sample points plus -/// additional optional information: -/// -/// - the arithmetic mean of the samples -/// - the minimum and maximum of the samples -/// - the sum-squared-deviation of the samples, used to compute variance -/// - a histogram of the values of the sample points +/// A span represents a single operation within a trace. Spans can be +/// nested to form a trace tree. Often, a trace contains a root span +/// that describes the end-to-end latency, and one or more subspans for +/// its sub-operations. A trace can also contain multiple root spans, +/// or none at all. Spans do not need to be contiguous—there may be +/// gaps or overlaps between spans in a trace. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Distribution { - /// The total number of samples in the distribution. Must be >= 0. - pub count: Option, - /// The number of samples in each histogram bucket. `bucket_counts` are - /// optional. If present, they must sum to the `count` value. +pub struct TraceSpan { + /// An optional final status for this span. + pub status: Option, + /// An optional number of child spans that were generated while this span + /// was active. If set, allows implementation to detect missing child spans. + #[serde(rename="childSpanCount")] + pub child_span_count: Option, + /// A description of the span's operation (up to 128 bytes). + /// Stackdriver Trace displays the description in the + /// Google Cloud Platform Console. + /// For example, the display name can be a qualified method name or a file name + /// and a line number where the operation is called. A best practice is to use + /// the same display name within an application and at the same call point. + /// This makes it easier to correlate spans in different traces. + #[serde(rename="displayName")] + pub display_name: Option, + /// The resource name of the span in the following format: /// - /// The buckets are defined below in `bucket_option`. There are N buckets. - /// `bucket_counts[0]` is the number of samples in the underflow bucket. - /// `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples - /// in each of the finite buckets. And `bucket_counts[N] is the number - /// of samples in the overflow bucket. See the comments of `bucket_option` - /// below for more details. + /// ````text + /// projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; + /// ```` /// - /// Any suffix of trailing zeros may be omitted. - #[serde(rename="bucketCounts")] - pub bucket_counts: Option>, - /// Buckets with exponentially growing width. - #[serde(rename="exponentialBuckets")] - pub exponential_buckets: Option, - /// The minimum of the population of values. Ignored if `count` is zero. - pub minimum: Option, - /// The maximum of the population of values. Ignored if `count` is zero. - pub maximum: Option, - /// Example points. Must be in increasing order of `value` field. - pub exemplars: Option>, - /// The sum of squared deviations from the mean: - /// Sum[i=1..count]((x_i - mean)^2) - /// where each x_i is a sample values. If `count` is zero then this field - /// must be zero, otherwise validation of the request fails. - #[serde(rename="sumOfSquaredDeviation")] - pub sum_of_squared_deviation: Option, - /// Buckets with constant width. - #[serde(rename="linearBuckets")] - pub linear_buckets: Option, - /// Buckets with arbitrary user-provided width. - #[serde(rename="explicitBuckets")] - pub explicit_buckets: Option, - /// The arithmetic mean of the samples in the distribution. If `count` is - /// zero then this field must be zero. - pub mean: Option, + /// it is a 32-character hexadecimal encoding of a 16-byte array. + /// + /// [SPAN_ID] is a unique identifier for a span within a trace; it + /// is a 16-character hexadecimal encoding of an 8-byte array. + pub name: Option, + /// Distinguishes between spans generated in a particular context. For example, + /// two spans with the same name may be distinguished using `CLIENT` (caller) + /// and `SERVER` (callee) to identify an RPC call. + #[serde(rename="spanKind")] + pub span_kind: Option, + /// The [SPAN_ID] of this span's parent span. If this is a root span, + /// then this field must be empty. + #[serde(rename="parentSpanId")] + pub parent_span_id: Option, + /// The start time of the span. On the client side, this is the time kept by + /// the local machine where the span execution starts. On the server side, this + /// is the time when the server's application handler starts running. + #[serde(rename="startTime")] + pub start_time: Option, + /// A set of attributes on the span. You can have up to 32 attributes per + /// span. + pub attributes: Option, + /// The [SPAN_ID] portion of the span's resource name. + #[serde(rename="spanId")] + pub span_id: Option, + /// The end time of the span. On the client side, this is the time kept by + /// the local machine where the span execution ends. On the server side, this + /// is the time when the server application handler stops running. + #[serde(rename="endTime")] + pub end_time: Option, + /// (Optional) Set this parameter to indicate whether this span is in + /// the same process as its parent. If you do not set this parameter, + /// Stackdriver Trace is unable to take advantage of this helpful + /// information. + #[serde(rename="sameProcessAsParentSpan")] + pub same_process_as_parent_span: Option, } -impl Part for Distribution {} +impl Part for TraceSpan {} /// Describing buckets with arbitrary user-provided width. @@ -808,7 +867,7 @@ pub struct ReportResponse { /// The actual config id used to process the request. #[serde(rename="serviceConfigId")] pub service_config_id: Option, - /// Unimplemented. The current service rollout id used to process the request. + /// The current service rollout id used to process the request. #[serde(rename="serviceRolloutId")] pub service_rollout_id: Option, } @@ -923,6 +982,10 @@ pub struct LogEntry { /// Optional. Information about an operation associated with the log entry, if /// applicable. pub operation: Option, + /// Optional. Source code location information associated with the log entry, + /// if any. + #[serde(rename="sourceLocation")] + pub source_location: Option, /// The severity of the log entry. The default value is /// `LogSeverity.DEFAULT`. pub severity: Option, @@ -990,7 +1053,7 @@ pub struct CheckResponse { /// Used for logging and diagnostics purposes. #[serde(rename="operationId")] pub operation_id: Option, - /// Unimplemented. The current service rollout id used to process the request. + /// The current service rollout id used to process the request. #[serde(rename="serviceRolloutId")] pub service_rollout_id: Option, } @@ -1024,6 +1087,31 @@ pub struct Status { impl Part for Status {} +/// Additional information about the source code location that produced the log +/// entry. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogEntrySourceLocation { + /// Optional. Human-readable name of the function or method being invoked, with + /// optional context such as the class or package name. This information may be + /// used in contexts such as the logs viewer, where a file and line number are + /// less meaningful. The format can vary by language. For example: + /// `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + /// (Python). + pub function: Option, + /// Optional. Line within the source file. 1-based; 0 indicates no line number + /// available. + pub line: Option, + /// Optional. Source file name. Depending on the runtime environment, this + /// might be a simple name or a fully-qualified name. + pub file: Option, +} + +impl Part for LogEntrySourceLocation {} + + /// Request message for the AllocateQuota method. /// /// # Activities @@ -1057,7 +1145,8 @@ pub struct AllocateInfo { /// A list of label keys that were unused by the server in processing the /// request. Thus, for similar requests repeated in a certain future time /// window, the caller can choose to ignore these labels in the requests - /// to achieve better client-side cache hits and quota aggregation. + /// to achieve better client-side cache hits and quota aggregation for rate + /// quota. This field is not populated for allocation quota checks. #[serde(rename="unusedArguments")] pub unused_arguments: Option>, } @@ -1065,6 +1154,29 @@ pub struct AllocateInfo { impl Part for AllocateInfo {} +/// Additional information about a potentially long-running operation with which +/// a log entry is associated. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogEntryOperation { + /// Optional. Set this to True if this is the last log entry in the operation. + pub last: Option, + /// Optional. An arbitrary operation identifier. Log entries with the + /// same identifier are assumed to be part of the same operation. + pub id: Option, + /// Optional. An arbitrary producer identifier. The combination of + /// `id` and `producer` must be globally unique. Examples for `producer`: + /// `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + pub producer: Option, + /// Optional. Set this to True if this is the first log entry in the operation. + pub first: Option, +} + +impl Part for LogEntryOperation {} + + /// Exemplars are example points that may be used to annotate aggregated /// distribution values. They are metadata that gives information about a /// particular value added to a Distribution bucket, such as a trace ID that @@ -1097,45 +1209,131 @@ pub struct Exemplar { impl Part for Exemplar {} -/// Response message for the AllocateQuota method. +/// Represents a string that might be shortened to a specified length. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [allocate quota services](struct.ServiceAllocateQuotaCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AllocateQuotaResponse { - /// Indicates the decision of the allocate. - #[serde(rename="allocateErrors")] - pub allocate_errors: Option>, - /// ID of the actual config used to process the request. - #[serde(rename="serviceConfigId")] - pub service_config_id: Option, - /// Quota metrics to indicate the result of allocation. Depending on the - /// request, one or more of the following metrics will be included: +pub struct TruncatableString { + /// The shortened string. For example, if the original string is 500 + /// bytes long and the limit of the string is 128 bytes, then + /// `value` contains the first 128 bytes of the 500-byte string. /// - /// 1. Per quota group or per quota metric incremental usage will be specified - /// using the following delta metric : - /// "serviceruntime.googleapis.com/api/consumer/quota_used_count" - /// - /// 2. The quota limit reached condition will be specified using the following - /// boolean metric : - /// "serviceruntime.googleapis.com/quota/exceeded" - #[serde(rename="quotaMetrics")] - pub quota_metrics: Option>, - /// WARNING: DO NOT use this field until this warning message is removed. - #[serde(rename="allocateInfo")] - pub allocate_info: Option, - /// The same operation_id value used in the AllocateQuotaRequest. Used for - /// logging and diagnostics purposes. - #[serde(rename="operationId")] - pub operation_id: Option, + /// Truncation always happens on a UTF8 character boundary. If there + /// are multi-byte characters in the string, then the length of the + /// shortened string might be less than the size limit. + pub value: Option, + /// The number of bytes removed from the original string. If this + /// value is 0, then the string was not shortened. + #[serde(rename="truncatedByteCount")] + pub truncated_byte_count: Option, } -impl ResponseResult for AllocateQuotaResponse {} +impl Part for TruncatableString {} + + +/// A set of attributes, each in the format `[KEY]:[VALUE]`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Attributes { + /// The number of attributes that were discarded. Attributes can be discarded + /// because their keys are too long or because there are too many attributes. + /// If this value is 0 then all attributes are valid. + #[serde(rename="droppedAttributesCount")] + pub dropped_attributes_count: Option, + /// The set of attributes. Each attribute's key can be up to 128 bytes + /// long. The value can be a string up to 256 bytes, a signed 64-bit integer, + /// or the Boolean values `true` and `false`. For example: + /// + /// ````text + /// "/instance_id": "my-instance" + /// "/http/user_agent": "" + /// "/http/request_bytes": 300 + /// "abc.com/myattribute": true```` + #[serde(rename="attributeMap")] + pub attribute_map: Option>, +} + +impl Part for Attributes {} + + +/// Distribution represents a frequency distribution of double-valued sample +/// points. It contains the size of the population of sample points plus +/// additional optional information: +/// +/// - the arithmetic mean of the samples +/// - the minimum and maximum of the samples +/// - the sum-squared-deviation of the samples, used to compute variance +/// - a histogram of the values of the sample points +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Distribution { + /// The total number of samples in the distribution. Must be >= 0. + pub count: Option, + /// The number of samples in each histogram bucket. `bucket_counts` are + /// optional. If present, they must sum to the `count` value. + /// + /// The buckets are defined below in `bucket_option`. There are N buckets. + /// `bucket_counts[0]` is the number of samples in the underflow bucket. + /// `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples + /// in each of the finite buckets. And `bucket_counts[N] is the number + /// of samples in the overflow bucket. See the comments of `bucket_option` + /// below for more details. + /// + /// Any suffix of trailing zeros may be omitted. + #[serde(rename="bucketCounts")] + pub bucket_counts: Option>, + /// Buckets with exponentially growing width. + #[serde(rename="exponentialBuckets")] + pub exponential_buckets: Option, + /// The minimum of the population of values. Ignored if `count` is zero. + pub minimum: Option, + /// The maximum of the population of values. Ignored if `count` is zero. + pub maximum: Option, + /// Example points. Must be in increasing order of `value` field. + pub exemplars: Option>, + /// The sum of squared deviations from the mean: + /// Sum[i=1..count]((x_i - mean)^2) + /// where each x_i is a sample values. If `count` is zero then this field + /// must be zero, otherwise validation of the request fails. + #[serde(rename="sumOfSquaredDeviation")] + pub sum_of_squared_deviation: Option, + /// Buckets with constant width. + #[serde(rename="linearBuckets")] + pub linear_buckets: Option, + /// Buckets with arbitrary user-provided width. + #[serde(rename="explicitBuckets")] + pub explicit_buckets: Option, + /// The arithmetic mean of the samples in the distribution. If `count` is + /// zero then this field must be zero. + pub mean: Option, +} + +impl Part for Distribution {} + + +/// The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AttributeValue { + /// A string up to 256 bytes long. + #[serde(rename="stringValue")] + pub string_value: Option, + /// A Boolean value represented by `true` or `false`. + #[serde(rename="boolValue")] + pub bool_value: Option, + /// A 64-bit signed integer. + #[serde(rename="intValue")] + pub int_value: Option, +} + +impl Part for AttributeValue {} /// Describing buckets with exponentially growing width. @@ -1255,29 +1453,6 @@ pub struct QuotaProperties { impl Part for QuotaProperties {} -/// Additional information about a potentially long-running operation with which -/// a log entry is associated. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogEntryOperation { - /// Optional. Set this to True if this is the last log entry in the operation. - pub last: Option, - /// Optional. An arbitrary operation identifier. Log entries with the - /// same identifier are assumed to be part of the same operation. - pub id: Option, - /// Optional. An arbitrary producer identifier. The combination of - /// `id` and `producer` must be globally unique. Examples for `producer`: - /// `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - pub producer: Option, - /// Optional. Set this to True if this is the first log entry in the operation. - pub first: Option, -} - -impl Part for LogEntryOperation {} - - /// Represents information regarding an operation. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1287,6 +1462,11 @@ pub struct Operation { /// Fully qualified name of the operation. Reserved for future use. #[serde(rename="operationName")] pub operation_name: Option, + /// Unimplemented. A list of Cloud Trace spans. The span names shall contain + /// the id of the destination project which can be either the produce or the + /// consumer project. + #[serde(rename="traceSpans")] + pub trace_spans: Option>, /// Represents information about this operation. Each MetricValueSet /// corresponds to a metric defined in the service configuration. /// The data type used in the MetricValueSet must agree with @@ -1323,31 +1503,6 @@ pub struct Operation { /// check will be performed. #[serde(rename="quotaProperties")] pub quota_properties: Option, - /// DO NOT USE. This field is deprecated, use "resources" field instead. - /// The resource name of the parent of a resource in the resource hierarchy. - /// - /// This can be in one of the following formats: - /// - “projects/” - /// - “folders/” - /// - “organizations/” - #[serde(rename="resourceContainer")] - pub resource_container: Option, - /// User defined labels for the resource that this operation is associated - /// with. Only a combination of 1000 user labels per consumer project are - /// allowed. - #[serde(rename="userLabels")] - pub user_labels: Option>, - /// End time of the operation. - /// Required when the operation is used in ServiceController.Report, - /// but optional when the operation is used in ServiceController.Check. - #[serde(rename="endTime")] - pub end_time: Option, - /// Represents information to be logged. - #[serde(rename="logEntries")] - pub log_entries: Option>, - /// Required. Start time of the operation. - #[serde(rename="startTime")] - pub start_time: Option, /// Identity of the consumer who is using the service. /// This field should be filled in for the operations initiated by a /// consumer, but not for service-initiated operations that are @@ -1362,6 +1517,22 @@ pub struct Operation { /// * api`_`key:API_KEY. #[serde(rename="consumerId")] pub consumer_id: Option, + /// User defined labels for the resource that this operation is associated + /// with. Only a combination of 1000 user labels per consumer project are + /// allowed. + #[serde(rename="userLabels")] + pub user_labels: Option>, + /// Represents information to be logged. + #[serde(rename="logEntries")] + pub log_entries: Option>, + /// Required. Start time of the operation. + #[serde(rename="startTime")] + pub start_time: Option, + /// End time of the operation. + /// Required when the operation is used in ServiceController.Report, + /// but optional when the operation is used in ServiceController.Check. + #[serde(rename="endTime")] + pub end_time: Option, /// The resources that are involved in the operation. /// The maximum supported number of entries in this field is 100. pub resources: Option>, @@ -1499,7 +1670,8 @@ impl<'a, C, A> ServiceMethods<'a, C, A> { /// the aggregation time window to avoid data loss risk more than 0.01% /// for business and compliance reasons. /// - /// NOTE: the ReportRequest has the size limit of 1MB. + /// NOTE: the ReportRequest has the size limit (wire-format byte size) of + /// 1MB. /// /// This method requires the `servicemanagement.services.report` permission /// on the specified service. For more information, see @@ -1868,7 +2040,8 @@ impl<'a, C, A> ServiceCheckCall<'a, C, A> where C: BorrowMut, A: /// the aggregation time window to avoid data loss risk more than 0.01% /// for business and compliance reasons. /// -/// NOTE: the ReportRequest has the size limit of 1MB. +/// NOTE: the ReportRequest has the size limit (wire-format byte size) of +/// 1MB. /// /// This method requires the `servicemanagement.services.report` permission /// on the specified service. For more information, see diff --git a/gen/serviceregistryalpha-cli/Cargo.toml b/gen/serviceregistryalpha-cli/Cargo.toml index 85285566b9..b3a02f6b51 100644 --- a/gen/serviceregistryalpha-cli/Cargo.toml +++ b/gen/serviceregistryalpha-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-serviceregistryalpha-cli" -version = "1.0.12+20160401" +version = "1.0.13+20160401" authors = ["Sebastian Thiel "] description = "A complete library to interact with Service Registry (protocol alpha)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/serviceregistryalpha-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-serviceregistryalpha] path = "../serviceregistryalpha" -version = "1.0.12+20160401" +version = "1.0.13+20160401" diff --git a/gen/serviceregistryalpha-cli/README.md b/gen/serviceregistryalpha-cli/README.md index 072601b755..862aa4084b 100644 --- a/gen/serviceregistryalpha-cli/README.md +++ b/gen/serviceregistryalpha-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Service Registry* API at revision *20160401*. The CLI is at version *1.0.12*. +This documentation was generated from the *Service Registry* API at revision *20160401*. The CLI is at version *1.0.13*. ```bash serviceregistryalpha [options] diff --git a/gen/serviceregistryalpha-cli/mkdocs.yml b/gen/serviceregistryalpha-cli/mkdocs.yml index c4a010907e..d5a025f1f9 100644 --- a/gen/serviceregistryalpha-cli/mkdocs.yml +++ b/gen/serviceregistryalpha-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Service Registry v1.0.12+20160401 +site_name: Service Registry v1.0.13+20160401 site_url: http://byron.github.io/google-apis-rs/google-serviceregistryalpha-cli site_description: A complete library to interact with Service Registry (protocol alpha) diff --git a/gen/serviceregistryalpha-cli/src/main.rs b/gen/serviceregistryalpha-cli/src/main.rs index b1452bf629..ca4b7a470e 100644 --- a/gen/serviceregistryalpha-cli/src/main.rs +++ b/gen/serviceregistryalpha-cli/src/main.rs @@ -975,7 +975,7 @@ fn main() { let mut app = App::new("serviceregistryalpha") .author("Sebastian Thiel ") - .version("1.0.12+20160401") + .version("1.0.13+20160401") .about("Manages service endpoints in Service Registry and provides integration with DNS for service discovery and name resolution.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_serviceregistryalpha_cli") .arg(Arg::with_name("url") diff --git a/gen/serviceregistryalpha/Cargo.toml b/gen/serviceregistryalpha/Cargo.toml index 873134c611..0558eb32e7 100644 --- a/gen/serviceregistryalpha/Cargo.toml +++ b/gen/serviceregistryalpha/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-serviceregistryalpha" -version = "1.0.12+20160401" +version = "1.0.13+20160401" authors = ["Sebastian Thiel "] description = "A complete library to interact with Service Registry (protocol alpha)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/serviceregistryalpha" homepage = "https://developers.google.com/cloud-serviceregistry/" -documentation = "https://docs.rs/google-serviceregistryalpha/1.0.12+20160401" +documentation = "https://docs.rs/google-serviceregistryalpha/1.0.13+20160401" license = "MIT" keywords = ["serviceregistry", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/serviceregistryalpha/README.md b/gen/serviceregistryalpha/README.md index 821389a998..570c83fdb3 100644 --- a/gen/serviceregistryalpha/README.md +++ b/gen/serviceregistryalpha/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-serviceregistryalpha` library allows access to all features of the *Google Service Registry* service. -This documentation was generated from *Service Registry* crate version *1.0.12+20160401*, where *20160401* is the exact revision of the *serviceregistry:alpha* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Service Registry* crate version *1.0.13+20160401*, where *20160401* is the exact revision of the *serviceregistry:alpha* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Service Registry* *alpha* API can be found at the [official documentation site](https://developers.google.com/cloud-serviceregistry/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.ServiceRegistry.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.ServiceRegistry.html) ... -* [endpoints](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.Endpoint.html) - * [*delete*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.EndpointDeleteCall.html), [*get*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.EndpointGetCall.html), [*insert*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.EndpointInsertCall.html), [*list*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.EndpointListCall.html), [*patch*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.EndpointPatchCall.html) and [*update*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.EndpointUpdateCall.html) -* [operations](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.Operation.html) - * [*get*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.OperationListCall.html) +* [endpoints](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.Endpoint.html) + * [*delete*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.EndpointDeleteCall.html), [*get*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.EndpointGetCall.html), [*insert*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.EndpointInsertCall.html), [*list*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.EndpointListCall.html), [*patch*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.EndpointPatchCall.html) and [*update*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.EndpointUpdateCall.html) +* [operations](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.Operation.html) + * [*get*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.OperationListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/struct.ServiceRegistry.html)** +* **[Hub](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/struct.ServiceRegistry.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.Part.html)** + * **[Parts](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.RequestValue.html) and -[decodable](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.RequestValue.html) and +[decodable](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-serviceregistryalpha/1.0.12+20160401/google_serviceregistryalpha/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-serviceregistryalpha/1.0.13+20160401/google_serviceregistryalpha/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/serviceregistryalpha/src/lib.rs b/gen/serviceregistryalpha/src/lib.rs index f6eb9071b1..897a7d6942 100644 --- a/gen/serviceregistryalpha/src/lib.rs +++ b/gen/serviceregistryalpha/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Service Registry* crate version *1.0.12+20160401*, where *20160401* is the exact revision of the *serviceregistry:alpha* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Service Registry* crate version *1.0.13+20160401*, where *20160401* is the exact revision of the *serviceregistry:alpha* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Service Registry* *alpha* API can be found at the //! [official documentation site](https://developers.google.com/cloud-serviceregistry/). @@ -344,7 +344,7 @@ impl<'a, C, A> ServiceRegistry ServiceRegistry { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/serviceregistry/alpha/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -358,7 +358,7 @@ impl<'a, C, A> ServiceRegistry } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/sheets4-cli/Cargo.toml b/gen/sheets4-cli/Cargo.toml index 6008977794..c3a013f7ef 100644 --- a/gen/sheets4-cli/Cargo.toml +++ b/gen/sheets4-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-sheets4-cli" -version = "1.0.12+20190625" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Sheets (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sheets4-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-sheets4] path = "../sheets4" -version = "1.0.12+20190625" +version = "1.0.13+20200402" diff --git a/gen/sheets4-cli/README.md b/gen/sheets4-cli/README.md index a634a5de9a..76f7e94484 100644 --- a/gen/sheets4-cli/README.md +++ b/gen/sheets4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Sheets* API at revision *20190625*. The CLI is at version *1.0.12*. +This documentation was generated from the *Sheets* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash sheets4 [options] diff --git a/gen/sheets4-cli/mkdocs.yml b/gen/sheets4-cli/mkdocs.yml index 7d15f92e99..47db505ca9 100644 --- a/gen/sheets4-cli/mkdocs.yml +++ b/gen/sheets4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Sheets v1.0.12+20190625 +site_name: Sheets v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-sheets4-cli site_description: A complete library to interact with Sheets (protocol v4) diff --git a/gen/sheets4-cli/src/main.rs b/gen/sheets4-cli/src/main.rs index 2ea31afa73..37b8ead682 100644 --- a/gen/sheets4-cli/src/main.rs +++ b/gen/sheets4-cli/src/main.rs @@ -160,13 +160,19 @@ impl<'n> Engine<'n> { "properties.title" => Some(("properties.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.locale" => Some(("properties.locale", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.auto-recalc" => Some(("properties.autoRecalc", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "properties.default-format.number-format.pattern" => Some(("properties.defaultFormat.numberFormat.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "properties.default-format.number-format.type" => Some(("properties.defaultFormat.numberFormat.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "properties.default-format.text-direction" => Some(("properties.defaultFormat.textDirection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.spreadsheet-theme.primary-font-family" => Some(("properties.spreadsheetTheme.primaryFontFamily", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.padding.top" => Some(("properties.defaultFormat.padding.top", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "properties.default-format.padding.right" => Some(("properties.defaultFormat.padding.right", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "properties.default-format.padding.left" => Some(("properties.defaultFormat.padding.left", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "properties.default-format.padding.bottom" => Some(("properties.defaultFormat.padding.bottom", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "properties.default-format.number-format.pattern" => Some(("properties.defaultFormat.numberFormat.pattern", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.number-format.type" => Some(("properties.defaultFormat.numberFormat.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.text-direction" => Some(("properties.defaultFormat.textDirection", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.background-color-style.theme-color" => Some(("properties.defaultFormat.backgroundColorStyle.themeColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.background-color-style.rgb-color.blue" => Some(("properties.defaultFormat.backgroundColorStyle.rgbColor.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.background-color-style.rgb-color.alpha" => Some(("properties.defaultFormat.backgroundColorStyle.rgbColor.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.background-color-style.rgb-color.green" => Some(("properties.defaultFormat.backgroundColorStyle.rgbColor.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.background-color-style.rgb-color.red" => Some(("properties.defaultFormat.backgroundColorStyle.rgbColor.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.horizontal-alignment" => Some(("properties.defaultFormat.horizontalAlignment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.background-color.blue" => Some(("properties.defaultFormat.backgroundColor.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.background-color.alpha" => Some(("properties.defaultFormat.backgroundColor.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -178,24 +184,44 @@ impl<'n> Engine<'n> { "properties.default-format.borders.top.color.green" => Some(("properties.defaultFormat.borders.top.color.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.top.color.red" => Some(("properties.defaultFormat.borders.top.color.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.top.width" => Some(("properties.defaultFormat.borders.top.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "properties.default-format.borders.top.color-style.theme-color" => Some(("properties.defaultFormat.borders.top.colorStyle.themeColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.borders.top.color-style.rgb-color.blue" => Some(("properties.defaultFormat.borders.top.colorStyle.rgbColor.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.top.color-style.rgb-color.alpha" => Some(("properties.defaultFormat.borders.top.colorStyle.rgbColor.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.top.color-style.rgb-color.green" => Some(("properties.defaultFormat.borders.top.colorStyle.rgbColor.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.top.color-style.rgb-color.red" => Some(("properties.defaultFormat.borders.top.colorStyle.rgbColor.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.top.style" => Some(("properties.defaultFormat.borders.top.style", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.borders.right.color.blue" => Some(("properties.defaultFormat.borders.right.color.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.right.color.alpha" => Some(("properties.defaultFormat.borders.right.color.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.right.color.green" => Some(("properties.defaultFormat.borders.right.color.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.right.color.red" => Some(("properties.defaultFormat.borders.right.color.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.right.width" => Some(("properties.defaultFormat.borders.right.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "properties.default-format.borders.right.color-style.theme-color" => Some(("properties.defaultFormat.borders.right.colorStyle.themeColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.borders.right.color-style.rgb-color.blue" => Some(("properties.defaultFormat.borders.right.colorStyle.rgbColor.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.right.color-style.rgb-color.alpha" => Some(("properties.defaultFormat.borders.right.colorStyle.rgbColor.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.right.color-style.rgb-color.green" => Some(("properties.defaultFormat.borders.right.colorStyle.rgbColor.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.right.color-style.rgb-color.red" => Some(("properties.defaultFormat.borders.right.colorStyle.rgbColor.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.right.style" => Some(("properties.defaultFormat.borders.right.style", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.borders.left.color.blue" => Some(("properties.defaultFormat.borders.left.color.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.left.color.alpha" => Some(("properties.defaultFormat.borders.left.color.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.left.color.green" => Some(("properties.defaultFormat.borders.left.color.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.left.color.red" => Some(("properties.defaultFormat.borders.left.color.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.left.width" => Some(("properties.defaultFormat.borders.left.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "properties.default-format.borders.left.color-style.theme-color" => Some(("properties.defaultFormat.borders.left.colorStyle.themeColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.borders.left.color-style.rgb-color.blue" => Some(("properties.defaultFormat.borders.left.colorStyle.rgbColor.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.left.color-style.rgb-color.alpha" => Some(("properties.defaultFormat.borders.left.colorStyle.rgbColor.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.left.color-style.rgb-color.green" => Some(("properties.defaultFormat.borders.left.colorStyle.rgbColor.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.left.color-style.rgb-color.red" => Some(("properties.defaultFormat.borders.left.colorStyle.rgbColor.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.left.style" => Some(("properties.defaultFormat.borders.left.style", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.borders.bottom.color.blue" => Some(("properties.defaultFormat.borders.bottom.color.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.bottom.color.alpha" => Some(("properties.defaultFormat.borders.bottom.color.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.bottom.color.green" => Some(("properties.defaultFormat.borders.bottom.color.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.bottom.color.red" => Some(("properties.defaultFormat.borders.bottom.color.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.bottom.width" => Some(("properties.defaultFormat.borders.bottom.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "properties.default-format.borders.bottom.color-style.theme-color" => Some(("properties.defaultFormat.borders.bottom.colorStyle.themeColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.borders.bottom.color-style.rgb-color.blue" => Some(("properties.defaultFormat.borders.bottom.colorStyle.rgbColor.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.bottom.color-style.rgb-color.alpha" => Some(("properties.defaultFormat.borders.bottom.colorStyle.rgbColor.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.bottom.color-style.rgb-color.green" => Some(("properties.defaultFormat.borders.bottom.colorStyle.rgbColor.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.borders.bottom.color-style.rgb-color.red" => Some(("properties.defaultFormat.borders.bottom.colorStyle.rgbColor.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.borders.bottom.style" => Some(("properties.defaultFormat.borders.bottom.style", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.wrap-strategy" => Some(("properties.defaultFormat.wrapStrategy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.hyperlink-display-type" => Some(("properties.defaultFormat.hyperlinkDisplayType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -204,6 +230,11 @@ impl<'n> Engine<'n> { "properties.default-format.text-format.foreground-color.green" => Some(("properties.defaultFormat.textFormat.foregroundColor.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.text-format.foreground-color.red" => Some(("properties.defaultFormat.textFormat.foregroundColor.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.text-format.bold" => Some(("properties.defaultFormat.textFormat.bold", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "properties.default-format.text-format.foreground-color-style.theme-color" => Some(("properties.defaultFormat.textFormat.foregroundColorStyle.themeColor", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "properties.default-format.text-format.foreground-color-style.rgb-color.blue" => Some(("properties.defaultFormat.textFormat.foregroundColorStyle.rgbColor.blue", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.text-format.foreground-color-style.rgb-color.alpha" => Some(("properties.defaultFormat.textFormat.foregroundColorStyle.rgbColor.alpha", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.text-format.foreground-color-style.rgb-color.green" => Some(("properties.defaultFormat.textFormat.foregroundColorStyle.rgbColor.green", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "properties.default-format.text-format.foreground-color-style.rgb-color.red" => Some(("properties.defaultFormat.textFormat.foregroundColorStyle.rgbColor.red", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "properties.default-format.text-format.strikethrough" => Some(("properties.defaultFormat.textFormat.strikethrough", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "properties.default-format.text-format.font-family" => Some(("properties.defaultFormat.textFormat.fontFamily", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties.default-format.text-format.font-size" => Some(("properties.defaultFormat.textFormat.fontSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -216,7 +247,7 @@ impl<'n> Engine<'n> { "properties.time-zone" => Some(("properties.timeZone", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spreadsheet-url" => Some(("spreadsheetUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["alpha", "angle", "auto-recalc", "background-color", "blue", "bold", "borders", "bottom", "color", "convergence-threshold", "default-format", "font-family", "font-size", "foreground-color", "green", "horizontal-alignment", "hyperlink-display-type", "italic", "iterative-calculation-settings", "left", "locale", "max-iterations", "number-format", "padding", "pattern", "properties", "red", "right", "spreadsheet-id", "spreadsheet-url", "strikethrough", "style", "text-direction", "text-format", "text-rotation", "time-zone", "title", "top", "type", "underline", "vertical", "vertical-alignment", "width", "wrap-strategy"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["alpha", "angle", "auto-recalc", "background-color", "background-color-style", "blue", "bold", "borders", "bottom", "color", "color-style", "convergence-threshold", "default-format", "font-family", "font-size", "foreground-color", "foreground-color-style", "green", "horizontal-alignment", "hyperlink-display-type", "italic", "iterative-calculation-settings", "left", "locale", "max-iterations", "number-format", "padding", "pattern", "primary-font-family", "properties", "red", "rgb-color", "right", "spreadsheet-id", "spreadsheet-theme", "spreadsheet-url", "strikethrough", "style", "text-direction", "text-format", "text-rotation", "theme-color", "time-zone", "title", "top", "type", "underline", "vertical", "vertical-alignment", "width", "wrap-strategy"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1919,7 +1950,7 @@ fn main() { (Some(r##"range"##), None, Some(r##"The A1 notation of a range to search for a logical table of data. - Values will be appended after the last row of the table."##), + Values are appended after the last row of the table."##), Some(true), Some(false)), @@ -2228,7 +2259,7 @@ fn main() { let mut app = App::new("sheets4") .author("Sebastian Thiel ") - .version("1.0.12+20190625") + .version("1.0.13+20200402") .about("Reads and writes Google Sheets.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_sheets4_cli") .arg(Arg::with_name("url") diff --git a/gen/sheets4/Cargo.toml b/gen/sheets4/Cargo.toml index 29f3cb2787..28b961d06b 100644 --- a/gen/sheets4/Cargo.toml +++ b/gen/sheets4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-sheets4" -version = "1.0.12+20190625" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with Sheets (protocol v4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sheets4" homepage = "https://developers.google.com/sheets/" -documentation = "https://docs.rs/google-sheets4/1.0.12+20190625" +documentation = "https://docs.rs/google-sheets4/1.0.13+20200402" license = "MIT" keywords = ["sheets", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/sheets4/README.md b/gen/sheets4/README.md index 9a07771a7d..9006ed88ad 100644 --- a/gen/sheets4/README.md +++ b/gen/sheets4/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-sheets4` library allows access to all features of the *Google Sheets* service. -This documentation was generated from *Sheets* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *sheets:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Sheets* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *sheets:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Sheets* *v4* API can be found at the [official documentation site](https://developers.google.com/sheets/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.Sheets.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.Sheets.html) ... -* [spreadsheets](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.Spreadsheet.html) - * [*batch update*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetBatchUpdateCall.html), [*create*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetCreateCall.html), [*developer metadata get*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetDeveloperMetadataGetCall.html), [*developer metadata search*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetDeveloperMetadataSearchCall.html), [*get*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetGetCall.html), [*get by data filter*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetGetByDataFilterCall.html), [*sheets copy to*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetSheetCopyToCall.html), [*values append*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueAppendCall.html), [*values batch clear*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueBatchClearCall.html), [*values batch clear by data filter*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueBatchClearByDataFilterCall.html), [*values batch get*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueBatchGetCall.html), [*values batch get by data filter*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueBatchGetByDataFilterCall.html), [*values batch update*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueBatchUpdateCall.html), [*values batch update by data filter*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueBatchUpdateByDataFilterCall.html), [*values clear*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueClearCall.html), [*values get*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueGetCall.html) and [*values update*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.SpreadsheetValueUpdateCall.html) +* [spreadsheets](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.Spreadsheet.html) + * [*batch update*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetBatchUpdateCall.html), [*create*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetCreateCall.html), [*developer metadata get*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetDeveloperMetadataGetCall.html), [*developer metadata search*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetDeveloperMetadataSearchCall.html), [*get*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetGetCall.html), [*get by data filter*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetGetByDataFilterCall.html), [*sheets copy to*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetSheetCopyToCall.html), [*values append*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueAppendCall.html), [*values batch clear*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueBatchClearCall.html), [*values batch clear by data filter*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueBatchClearByDataFilterCall.html), [*values batch get*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueBatchGetCall.html), [*values batch get by data filter*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueBatchGetByDataFilterCall.html), [*values batch update*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueBatchUpdateCall.html), [*values batch update by data filter*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueBatchUpdateByDataFilterCall.html), [*values clear*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueClearCall.html), [*values get*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueGetCall.html) and [*values update*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.SpreadsheetValueUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/struct.Sheets.html)** +* **[Hub](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/struct.Sheets.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.Part.html)** + * **[Parts](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -151,17 +151,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -171,29 +171,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-sheets4/1.0.12+20190625/google_sheets4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-sheets4/1.0.13+20200402/google_sheets4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/sheets4/src/lib.rs b/gen/sheets4/src/lib.rs index 09d3cbda48..432a33eafb 100644 --- a/gen/sheets4/src/lib.rs +++ b/gen/sheets4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Sheets* crate version *1.0.12+20190625*, where *20190625* is the exact revision of the *sheets:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Sheets* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *sheets:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Sheets* *v4* API can be found at the //! [official documentation site](https://developers.google.com/sheets/). @@ -371,7 +371,7 @@ impl<'a, C, A> Sheets Sheets { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://sheets.googleapis.com/".to_string(), _root_url: "https://sheets.googleapis.com/".to_string(), } @@ -382,7 +382,7 @@ impl<'a, C, A> Sheets } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -410,6 +410,23 @@ impl<'a, C, A> Sheets // ############ // SCHEMAS ### // ########## +/// A color value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ColorStyle { + /// Theme color. + #[serde(rename="themeColor")] + pub theme_color: Option, + /// RGB color. + #[serde(rename="rgbColor")] + pub rgb_color: Option, +} + +impl Part for ColorStyle {} + + /// A group over an interval of rows or columns on a sheet, which can contain or /// be contained within other groups. A group can be collapsed or expanded as a /// unit on the sheet. @@ -657,12 +674,15 @@ pub struct Sheet { /// The filter views in this sheet. #[serde(rename="filterViews")] pub filter_views: Option>, + /// The slicers on this sheet. + pub slicers: Option>, /// The properties of the sheet. pub properties: Option, /// The protected ranges in this sheet. #[serde(rename="protectedRanges")] pub protected_ranges: Option>, /// Data in the grid, if this is a grid sheet. + /// /// The number of GridData objects returned is dependent on the number of /// ranges requested on this sheet. For example, if this is representing /// `Sheet1`, and the spreadsheet was requested with ranges @@ -680,26 +700,64 @@ pub struct Sheet { impl Part for Sheet {} -/// A single interpolation point on a gradient conditional format. -/// These pin the gradient color scale according to the color, -/// type and value chosen. +/// The result of removing duplicates in a range. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct InterpolationPoint { - /// The color this interpolation point should use. - pub color: Option, - /// How the value should be interpreted. - #[serde(rename="type")] - pub type_: Option, - /// The value this interpolation point uses. May be a formula. - /// Unused if type is MIN or - /// MAX. - pub value: Option, +pub struct DeleteDuplicatesResponse { + /// The number of duplicate rows removed. + #[serde(rename="duplicatesRemovedCount")] + pub duplicates_removed_count: Option, } -impl Part for InterpolationPoint {} +impl Part for DeleteDuplicatesResponse {} + + +/// The format of a cell. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CellFormat { + /// The background color of the cell. + /// If background_color is also set, this field takes precedence. + #[serde(rename="backgroundColorStyle")] + pub background_color_style: Option, + /// A format describing how number values should be represented to the user. + #[serde(rename="numberFormat")] + pub number_format: Option, + /// The direction of the text in the cell. + #[serde(rename="textDirection")] + pub text_direction: Option, + /// The padding of the cell. + pub padding: Option, + /// The horizontal alignment of the value in the cell. + #[serde(rename="horizontalAlignment")] + pub horizontal_alignment: Option, + /// The background color of the cell. + #[serde(rename="backgroundColor")] + pub background_color: Option, + /// The vertical alignment of the value in the cell. + #[serde(rename="verticalAlignment")] + pub vertical_alignment: Option, + /// The borders of the cell. + pub borders: Option, + /// The rotation applied to text in a cell + #[serde(rename="textRotation")] + pub text_rotation: Option, + /// How a hyperlink, if it exists, should be displayed in the cell. + #[serde(rename="hyperlinkDisplayType")] + pub hyperlink_display_type: Option, + /// The format of the text in the cell (unless overridden by a format run). + #[serde(rename="textFormat")] + pub text_format: Option, + /// The wrap strategy for the value in the cell. + #[serde(rename="wrapStrategy")] + pub wrap_strategy: Option, +} + +impl Part for CellFormat {} /// Inserts data into the spreadsheet starting at the specified coordinate. @@ -724,17 +782,50 @@ pub struct PasteDataRequest { impl Part for PasteDataRequest {} +/// The result of adding a slicer to a spreadsheet. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddSlicerResponse { + /// The newly added slicer. + pub slicer: Option, +} + +impl Part for AddSlicerResponse {} + + /// Criteria for showing/hiding rows in a filter or filter view. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FilterCriteria { + /// The background fill color to filter by; only cells with this fill color are + /// shown. Mutually exclusive with visible_foreground_color. + #[serde(rename="visibleBackgroundColor")] + pub visible_background_color: Option, /// Values that should be hidden. #[serde(rename="hiddenValues")] pub hidden_values: Option>, + /// The background fill color to filter by; only cells with this fill color are + /// shown. This field is mutually exclusive with visible_foreground_color, + /// and must be set to an RGB-type color. If visible_background_color is + /// also set, this field takes precedence. + #[serde(rename="visibleBackgroundColorStyle")] + pub visible_background_color_style: Option, + /// The foreground color to filter by; only cells with this foreground color + /// are shown. This field is mutually exclusive with + /// visible_background_color, and must be set to an RGB-type color. If + /// visible_foreground_color is also set, this field takes precedence. + #[serde(rename="visibleForegroundColorStyle")] + pub visible_foreground_color_style: Option, + /// The foreground color to filter by; only cells with this foreground color + /// are shown. Mutually exclusive with visible_background_color. + #[serde(rename="visibleForegroundColor")] + pub visible_foreground_color: Option, /// A condition that must be true for values to be shown. - /// (This does not override hiddenValues -- if a value is listed there, + /// (This does not override hidden_values -- if a value is listed there, /// it will still be hidden.) pub condition: Option, } @@ -1038,6 +1129,54 @@ pub struct DeveloperMetadataLookup { impl Part for DeveloperMetadataLookup {} +/// A scorecard chart. Scorecard charts are used to highlight key performance +/// indicators, known as KPIs, on the spreadsheet. A scorecard chart can +/// represent things like total sales, average cost, or a top selling item. You +/// can specify a single data value, or aggregate over a range of data. +/// Percentage or absolute difference from a baseline value can be highlighted, +/// like changes over time. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ScorecardChartSpec { + /// The number format source used in the scorecard chart. + /// This field is optional. + #[serde(rename="numberFormatSource")] + pub number_format_source: Option, + /// The data for scorecard baseline value. + /// This field is optional. + #[serde(rename="baselineValueData")] + pub baseline_value_data: Option, + /// Formatting options for key value. + #[serde(rename="keyValueFormat")] + pub key_value_format: Option, + /// The aggregation type for key and baseline chart data in scorecard chart. + /// This field is optional. + #[serde(rename="aggregateType")] + pub aggregate_type: Option, + /// Formatting options for baseline value. + /// This field is needed only if baseline_value_data is specified. + #[serde(rename="baselineValueFormat")] + pub baseline_value_format: Option, + /// The data for scorecard key value. + #[serde(rename="keyValueData")] + pub key_value_data: Option, + /// Value to scale scorecard key and baseline value. For example, a factor of + /// 10 can be used to divide all values in the chart by 10. + /// This field is optional. + #[serde(rename="scaleFactor")] + pub scale_factor: Option, + /// Custom formatting options for numeric key/baseline values in scorecard + /// chart. This field is used only when number_format_source is set to + /// CUSTOM. This field is optional. + #[serde(rename="customFormatOptions")] + pub custom_format_options: Option, +} + +impl Part for ScorecardChartSpec {} + + /// Adds new cells after the last row with data in a sheet, /// inserting new rows into the sheet if necessary. /// @@ -1111,6 +1250,14 @@ pub struct ChartSpec { /// A treemap chart specification. #[serde(rename="treemapChart")] pub treemap_chart: Option, + /// A scorecard chart specification. + #[serde(rename="scorecardChart")] + pub scorecard_chart: Option, + /// The background color of the entire chart. + /// Not applicable to Org charts. + /// If background_color is also set, this field takes precedence. + #[serde(rename="backgroundColorStyle")] + pub background_color_style: Option, /// A candlestick chart specification. #[serde(rename="candlestickChart")] pub candlestick_chart: Option, @@ -1352,15 +1499,73 @@ pub struct NumberFormat { impl Part for NumberFormat {} +/// A slicer in a sheet. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Slicer { + /// The position of the slicer. Note that slicer can be positioned only on + /// existing sheet. Also, width and height of slicer can be automatically + /// adjusted to keep it within permitted limits. + pub position: Option, + /// The specification of the slicer. + pub spec: Option, + /// The ID of the slicer. + #[serde(rename="slicerId")] + pub slicer_id: Option, +} + +impl Part for Slicer {} + + +/// Represents spreadsheet theme +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SpreadsheetTheme { + /// The spreadsheet theme color pairs. To update you must provide all theme + /// color pairs. + #[serde(rename="themeColors")] + pub theme_colors: Option>, + /// / Name of the primary font family. + #[serde(rename="primaryFontFamily")] + pub primary_font_family: Option, +} + +impl Part for SpreadsheetTheme {} + + /// A sort order associated with a specific column or row. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SortSpec { + /// The background fill color to sort by; cells with this fill color are sorted + /// to the top. Mutually exclusive with foreground_color, and must be an + /// RGB-type color. If background_color is also set, this field takes + /// precedence. + #[serde(rename="backgroundColorStyle")] + pub background_color_style: Option, + /// The foreground color to sort by; cells with this foreground color are + /// sorted to the top. Mutually exclusive with background_color. + #[serde(rename="foregroundColor")] + pub foreground_color: Option, /// The order data should be sorted. #[serde(rename="sortOrder")] pub sort_order: Option, + /// The background fill color to sort by; cells with this fill color are sorted + /// to the top. Mutually exclusive with foreground_color. + #[serde(rename="backgroundColor")] + pub background_color: Option, + /// The foreground color to sort by; cells with this foreground color are + /// sorted to the top. Mutually exclusive with background_color, and must + /// be an RGB-type color. If foreground_color is also set, this field takes + /// precedence. + #[serde(rename="foregroundColorStyle")] + pub foreground_color_style: Option, /// The dimension the sort should be applied to. #[serde(rename="dimensionIndex")] pub dimension_index: Option, @@ -1492,6 +1697,28 @@ pub struct CutPasteRequest { impl Part for CutPasteRequest {} +/// Updates a slicer's specifications. +/// (This does not move or resize a slicer. To move or resize a slicer use +/// UpdateEmbeddedObjectPositionRequest. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateSlicerSpecRequest { + /// The fields that should be updated. At least one field must be specified. + /// The root `SlicerSpec` is implied and should not be specified. A single "*"` + /// can be used as short-hand for listing every field. + pub fields: Option, + /// The specification to apply to the slicer. + pub spec: Option, + /// The id of the slicer to update. + #[serde(rename="slicerId")] + pub slicer_id: Option, +} + +impl Part for UpdateSlicerSpecRequest {} + + /// A bubble chart. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1512,6 +1739,10 @@ pub struct BubbleChartSpec { /// The data contianing the bubble y-values. These values locate the bubbles /// in the chart vertically. pub series: Option, + /// The bubble border color. + /// If bubble_border_color is also set, this field takes precedence. + #[serde(rename="bubbleBorderColorStyle")] + pub bubble_border_color_style: Option, /// Where the legend of the chart should be drawn. #[serde(rename="legendPosition")] pub legend_position: Option, @@ -1785,21 +2016,25 @@ impl Part for OverlayPosition {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TextFormat { - /// The font family. - #[serde(rename="fontFamily")] - pub font_family: Option, /// The foreground color of the text. #[serde(rename="foregroundColor")] pub foreground_color: Option, + /// True if the text is bold. + pub bold: Option, + /// The foreground color of the text. + /// If foreground_color is also set, this field takes precedence. + #[serde(rename="foregroundColorStyle")] + pub foreground_color_style: Option, + /// True if the text has a strikethrough. + pub strikethrough: Option, + /// The font family. + #[serde(rename="fontFamily")] + pub font_family: Option, /// The size of the font. #[serde(rename="fontSize")] pub font_size: Option, - /// True if the text is bold. - pub bold: Option, /// True if the text is italicized. pub italic: Option, - /// True if the text has a strikethrough. - pub strikethrough: Option, /// True if the text is underlined. pub underline: Option, } @@ -1807,28 +2042,30 @@ pub struct TextFormat { impl Part for TextFormat {} -/// An optional setting on a PivotGroup that defines buckets for the values -/// in the source data column rather than breaking out each individual value. -/// Only one PivotGroup with a group rule may be added for each column in -/// the source data, though on any given column you may add both a -/// PivotGroup that has a rule and a PivotGroup that does not. +/// A single interpolation point on a gradient conditional format. +/// These pin the gradient color scale according to the color, +/// type and value chosen. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PivotGroupRule { - /// A HistogramRule. - #[serde(rename="histogramRule")] - pub histogram_rule: Option, - /// A ManualRule. - #[serde(rename="manualRule")] - pub manual_rule: Option, - /// A DateTimeRule. - #[serde(rename="dateTimeRule")] - pub date_time_rule: Option, +pub struct InterpolationPoint { + /// The color this interpolation point should use. + pub color: Option, + /// The color this interpolation point should use. + /// If color is also set, this field takes precedence. + #[serde(rename="colorStyle")] + pub color_style: Option, + /// How the value should be interpreted. + #[serde(rename="type")] + pub type_: Option, + /// The value this interpolation point uses. May be a formula. + /// Unused if type is MIN or + /// MAX. + pub value: Option, } -impl Part for PivotGroupRule {} +impl Part for InterpolationPoint {} /// A location where metadata may be associated in a spreadsheet. @@ -1972,21 +2209,77 @@ pub struct TextToColumnsRequest { impl Part for TextToColumnsRequest {} -/// An error in a cell. +/// A single grouping (either row or column) in a pivot table. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ErrorValue { - /// A message with more information about the error - /// (in the spreadsheet's locale). - pub message: Option, - /// The type of error. - #[serde(rename="type")] - pub type_: Option, +pub struct PivotGroup { + /// True if the pivot table should include the totals for this grouping. + #[serde(rename="showTotals")] + pub show_totals: Option, + /// The column offset of the source range that this grouping is based on. + /// + /// For example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` + /// means this group refers to column `C`, whereas the offset `1` would refer + /// to column `D`. + #[serde(rename="sourceColumnOffset")] + pub source_column_offset: Option, + /// The labels to use for the row/column groups which can be customized. For + /// example, in the following pivot table, the row label is `Region` (which + /// could be renamed to `State`) and the column label is `Product` (which + /// could be renamed `Item`). Pivot tables created before December 2017 do + /// not have header labels. If you'd like to add header labels to an existing + /// pivot table, please delete the existing pivot table and then create a new + /// pivot table with same parameters. + /// + /// ````text + /// +--------------+---------+-------+ + /// | SUM of Units | Product | | + /// | Region | Pen | Paper | + /// +--------------+---------+-------+ + /// | New York | 345 | 98 | + /// | Oregon | 234 | 123 | + /// | Tennessee | 531 | 415 | + /// +--------------+---------+-------+ + /// | Grand Total | 1110 | 636 | + /// +--------------+---------+-------+```` + pub label: Option, + /// Metadata about values in the grouping. + #[serde(rename="valueMetadata")] + pub value_metadata: Option>, + /// The bucket of the opposite pivot group to sort by. + /// If not specified, sorting is alphabetical by this group's values. + #[serde(rename="valueBucket")] + pub value_bucket: Option, + /// The order the values in this group should be sorted. + #[serde(rename="sortOrder")] + pub sort_order: Option, + /// True if the headings in this pivot group should be repeated. + /// This is only valid for row groupings and is ignored by columns. + /// + /// By default, we minimize repitition of headings by not showing higher + /// level headings where they are the same. For example, even though the + /// third row below corresponds to "Q1 Mar", "Q1" is not shown because + /// it is redundant with previous rows. Setting repeat_headings to true + /// would cause "Q1" to be repeated for "Feb" and "Mar". + /// + /// ````text + /// +--------------+ + /// | Q1 | Jan | + /// | | Feb | + /// | | Mar | + /// +--------+-----+ + /// | Q1 Total | + /// +--------------+```` + #[serde(rename="repeatHeadings")] + pub repeat_headings: Option, + /// The group rule to apply to this row/column group. + #[serde(rename="groupRule")] + pub group_rule: Option, } -impl Part for ErrorValue {} +impl Part for PivotGroup {} /// The data included in a domain or series. @@ -2268,22 +2561,21 @@ pub struct FindReplaceResponse { impl Part for FindReplaceResponse {} -/// A developer metadata entry and the data filters specified in the original -/// request that matched it. +/// Custom number formatting options for chart attributes. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MatchedDeveloperMetadata { - /// All filters matching the returned developer metadata. - #[serde(rename="dataFilters")] - pub data_filters: Option>, - /// The developer metadata matching the specified filters. - #[serde(rename="developerMetadata")] - pub developer_metadata: Option, +pub struct ChartCustomNumberFormatOptions { + /// Custom prefix to be prepended to the chart attribute. + /// This field is optional. + pub prefix: Option, + /// Custom suffix to be appended to the chart attribute. + /// This field is optional. + pub suffix: Option, } -impl Part for MatchedDeveloperMetadata {} +impl Part for ChartCustomNumberFormatOptions {} /// The Candlestick chart data, each containing the low, open, close, and high @@ -2316,6 +2608,20 @@ pub struct CandlestickData { impl Part for CandlestickData {} +/// Clears the basic filter, if any exists on the sheet. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClearBasicFilterRequest { + /// The sheet ID on which the basic filter should be cleared. + #[serde(rename="sheetId")] + pub sheet_id: Option, +} + +impl Part for ClearBasicFilterRequest {} + + /// The request for updating more than one range of values in a spreadsheet. /// /// # Activities @@ -2336,10 +2642,10 @@ pub struct BatchUpdateValuesRequest { /// Determines if the update response should include the values /// of the cells that were updated. By default, responses /// do not include the updated values. The `updatedData` field within - /// each of the BatchUpdateValuesResponse.responses will contain - /// the updated values. If the range to write was larger than than the range - /// actually written, the response will include all values in the requested - /// range (excluding trailing empty rows and columns). + /// each of the BatchUpdateValuesResponse.responses contains the updated + /// values. If the range to write was larger than the range actually written, + /// the response includes all values in the requested range (excluding trailing + /// empty rows and columns). #[serde(rename="includeValuesInResponse")] pub include_values_in_response: Option, /// How the input data should be interpreted. @@ -2394,23 +2700,22 @@ pub struct UpdateBordersRequest { impl Part for UpdateBordersRequest {} -/// Deletes a range of cells, shifting other cells into the deleted area. +/// Deletes a group over the specified range by decrementing the depth of the +/// dimensions in the range. +/// +/// For example, assume the sheet has a depth-1 group over B:E and a depth-2 +/// group over C:D. Deleting a group over D:E leaves the sheet with a +/// depth-1 group over B:D and a depth-2 group over C:C. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeleteRangeRequest { - /// The range of cells to delete. - pub range: Option, - /// The dimension from which deleted cells will be replaced with. - /// If ROWS, existing cells will be shifted upward to - /// replace the deleted cells. If COLUMNS, existing cells - /// will be shifted left to replace the deleted cells. - #[serde(rename="shiftDimension")] - pub shift_dimension: Option, +pub struct DeleteDimensionGroupRequest { + /// The range of the group to be deleted. + pub range: Option, } -impl Part for DeleteRangeRequest {} +impl Part for DeleteDimensionGroupRequest {} /// A border along a cell. @@ -2424,6 +2729,10 @@ pub struct Border { /// The width of the border, in pixels. /// Deprecated; the width is determined by the "style" field. pub width: Option, + /// The color of the border. + /// If color is also set, this field takes precedence. + #[serde(rename="colorStyle")] + pub color_style: Option, /// The style of the border. pub style: Option, } @@ -2573,10 +2882,9 @@ pub struct BatchClearValuesResponse { /// The spreadsheet the updates were applied to. #[serde(rename="spreadsheetId")] pub spreadsheet_id: Option, - /// The ranges that were cleared, in A1 notation. - /// (If the requests were for an unbounded range or a ranger larger - /// than the bounds of the sheet, this will be the actual ranges - /// that were cleared, bounded to the sheet's limits.) + /// The ranges that were cleared, in A1 notation. If the requests are for an + /// unbounded range or a ranger larger than the bounds of the sheet, this is + /// the actual ranges that were cleared, bounded to the sheet's limits. #[serde(rename="clearedRanges")] pub cleared_ranges: Option>, } @@ -2621,6 +2929,39 @@ pub struct AddChartResponse { impl Part for AddChartResponse {} +/// The rotation applied to text in a cell. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TextRotation { + /// The angle between the standard orientation and the desired orientation. + /// Measured in degrees. Valid values are between -90 and 90. Positive + /// angles are angled upwards, negative are angled downwards. + /// + /// Note: For LTR text direction positive angles are in the + /// counterclockwise direction, whereas for RTL they are in the clockwise + /// direction + pub angle: Option, + /// If true, text reads top to bottom, but the orientation of individual + /// characters is unchanged. + /// For example: + /// + /// ````text + /// | V | + /// | e | + /// | r | + /// | t | + /// | i | + /// | c | + /// | a | + /// | l |```` + pub vertical: Option, +} + +impl Part for TextRotation {} + + /// Updates properties of the supplied banded range. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2661,18 +3002,16 @@ pub struct BatchGetValuesByDataFilterRequest { /// The default render option is ValueRenderOption.FORMATTED_VALUE. #[serde(rename="valueRenderOption")] pub value_render_option: Option, - /// The data filters used to match the ranges of values to retrieve. Ranges - /// that match any of the specified data filters will be included in the - /// response. + /// The data filters used to match the ranges of values to retrieve. Ranges + /// that match any of the specified data filters are included in the response. #[serde(rename="dataFilters")] pub data_filters: Option>, /// The major dimension that results should use. /// /// For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, - /// then a request that selects that range and sets `majorDimension=ROWS` will - /// return `[[1,2],[3,4]]`, - /// whereas a request that sets `majorDimension=COLUMNS` will return - /// `[[1,3],[2,4]]`. + /// then a request that selects that range and sets `majorDimension=ROWS` + /// returns `[[1,2],[3,4]]`, whereas a request that sets + /// `majorDimension=COLUMNS` returns `[[1,3],[2,4]]`. #[serde(rename="majorDimension")] pub major_dimension: Option, } @@ -2809,6 +3148,9 @@ pub struct SpreadsheetProperties { /// The amount of time to wait before volatile functions are recalculated. #[serde(rename="autoRecalc")] pub auto_recalc: Option, + /// Theme applied to the spreadsheet. + #[serde(rename="spreadsheetTheme")] + pub spreadsheet_theme: Option, /// The default format of all cells in the spreadsheet. /// CellData.effectiveFormat will not be set if /// the cell's format is equal to this default format. This field is read-only. @@ -2832,8 +3174,8 @@ pub struct SpreadsheetProperties { #[serde(rename="timeZone")] pub time_zone: Option, /// Determines whether and how circular references are resolved with iterative - /// calculation. Absence of this field means that circular references will - /// result in calculation errors. + /// calculation. Absence of this field means that circular references result + /// in calculation errors. #[serde(rename="iterativeCalculationSettings")] pub iterative_calculation_settings: Option, } @@ -2967,6 +3309,10 @@ pub struct SheetProperties { pub tab_color: Option, /// True if the sheet is hidden in the UI, false if it's visible. pub hidden: Option, + /// The color of the tab in the UI. + /// If tab_color is also set, this field takes precedence. + #[serde(rename="tabColorStyle")] + pub tab_color_style: Option, /// The ID of the sheet. Must be non-negative. /// This field cannot be changed once set. #[serde(rename="sheetId")] @@ -3112,24 +3458,6 @@ pub struct ExtendedValue { impl Part for ExtendedValue {} -/// Deletes a group over the specified range by decrementing the depth of the -/// dimensions in the range. -/// -/// For example, assume the sheet has a depth-1 group over B:E and a depth-2 -/// group over C:D. Deleting a group over D:E leaves the sheet with a -/// depth-1 group over B:D and a depth-2 group over C:C. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeleteDimensionGroupRequest { - /// The range of the group to be deleted. - pub range: Option, -} - -impl Part for DeleteDimensionGroupRequest {} - - /// A rule that may or may not match, depending on the condition. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3199,6 +3527,23 @@ pub struct UnmergeCellsRequest { impl Part for UnmergeCellsRequest {} +/// Formatting options for key value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeyValueFormat { + /// Specifies the horizontal text positioning of key value. + /// This field is optional. If not specified, default positioning is used. + pub position: Option, + /// Text formatting options for key value. + #[serde(rename="textFormat")] + pub text_format: Option, +} + +impl Part for KeyValueFormat {} + + /// A rule that applies a gradient color scale format, based on /// the interpolation points listed. The format of a cell will vary /// based on its contents as compared to the values of the interpolation @@ -3271,12 +3616,10 @@ pub struct TreemapChartSpec { /// interactive and are shown with their labels. Defaults to 2 if not /// specified. pub levels: Option, - /// The minimum possible data value. Cells with values less than this will - /// have the same color as cells with this value. If not specified, defaults - /// to the actual minimum value from color_data, or the minimum value from - /// size_data if color_data is not specified. - #[serde(rename="minValue")] - pub min_value: Option, + /// The background color for header cells. + /// If header_color is also set, this field takes precedence. + #[serde(rename="headerColorStyle")] + pub header_color_style: Option, /// The data that determines the size of each treemap data cell. This data is /// expected to be numeric. The cells corresponding to non-numeric or missing /// data will not be rendered. If color_data is not specified, this data @@ -3291,6 +3634,12 @@ pub struct TreemapChartSpec { /// The text format for all labels on the chart. #[serde(rename="textFormat")] pub text_format: Option, + /// The minimum possible data value. Cells with values less than this will + /// have the same color as cells with this value. If not specified, defaults + /// to the actual minimum value from color_data, or the minimum value from + /// size_data if color_data is not specified. + #[serde(rename="minValue")] + pub min_value: Option, } impl Part for TreemapChartSpec {} @@ -3476,10 +3825,9 @@ pub struct BatchClearValuesByDataFilterResponse { /// The spreadsheet the updates were applied to. #[serde(rename="spreadsheetId")] pub spreadsheet_id: Option, - /// The ranges that were cleared, in A1 notation. - /// (If the requests were for an unbounded range or a ranger larger - /// than the bounds of the sheet, this will be the actual ranges - /// that were cleared, bounded to the sheet's limits.) + /// The ranges that were cleared, in A1 notation. If the requests are for an + /// unbounded range or a ranger larger than the bounds of the sheet, this is + /// the actual ranges that were cleared, bounded to the sheet's limits. #[serde(rename="clearedRanges")] pub cleared_ranges: Option>, } @@ -3595,6 +3943,9 @@ pub struct Response { /// A reply from adding a filter view. #[serde(rename="addFilterView")] pub add_filter_view: Option, + /// A reply from adding a slicer. + #[serde(rename="addSlicer")] + pub add_slicer: Option, /// A reply from duplicating a sheet. #[serde(rename="duplicateSheet")] pub duplicate_sheet: Option, @@ -3613,45 +3964,32 @@ pub struct Response { /// A reply from doing a find/replace. #[serde(rename="findReplace")] pub find_replace: Option, + /// A reply from trimming whitespace. + #[serde(rename="trimWhitespace")] + pub trim_whitespace: Option, /// A reply from deleting a conditional format rule. #[serde(rename="deleteConditionalFormatRule")] pub delete_conditional_format_rule: Option, + /// A reply from removing rows containing duplicate values. + #[serde(rename="deleteDuplicates")] + pub delete_duplicates: Option, } impl Part for Response {} -/// The rotation applied to text in a cell. +/// The result of trimming whitespace in cells. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TextRotation { - /// The angle between the standard orientation and the desired orientation. - /// Measured in degrees. Valid values are between -90 and 90. Positive - /// angles are angled upwards, negative are angled downwards. - /// - /// Note: For LTR text direction positive angles are in the - /// counterclockwise direction, whereas for RTL they are in the clockwise - /// direction - pub angle: Option, - /// If true, text reads top to bottom, but the orientation of individual - /// characters is unchanged. - /// For example: - /// - /// ````text - /// | V | - /// | e | - /// | r | - /// | t | - /// | i | - /// | c | - /// | a | - /// | l |```` - pub vertical: Option, +pub struct TrimWhitespaceResponse { + /// The number of cells that were trimmed of whitespace. + #[serde(rename="cellsChangedCount")] + pub cells_changed_count: Option, } -impl Part for TextRotation {} +impl Part for TrimWhitespaceResponse {} /// A single series of data in a chart. @@ -3662,11 +4000,32 @@ impl Part for TextRotation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BasicChartSeries { - /// The color for elements (i.e. bars, lines, points) associated with this - /// series. If empty, a default color is used. + /// The line style of this series. Valid only if the + /// chartType is AREA, + /// LINE, or SCATTER. + /// COMBO charts are also supported if the + /// series chart type is + /// AREA or LINE. + #[serde(rename="lineStyle")] + pub line_style: Option, + /// The color for elements (such as bars, lines, and points) associated with + /// this series. If empty, a default color is used. + /// If color is also set, this field takes precedence. + #[serde(rename="colorStyle")] + pub color_style: Option, + /// The color for elements (such as bars, lines, and points) associated with + /// this series. If empty, a default color is used. pub color: Option, /// The data being visualized in this chart series. pub series: Option, + /// The type of this series. Valid only if the + /// chartType is + /// COMBO. + /// Different types will change the way the series is visualized. + /// Only LINE, AREA, + /// and COLUMN are supported. + #[serde(rename="type")] + pub type_: Option, /// The minor axis that will specify the range of values for this series. /// For example, if charting stocks over time, the "Volume" series /// may want to be pinned to the right with the prices pinned to the left, @@ -3676,22 +4035,6 @@ pub struct BasicChartSeries { /// for the chart's type. #[serde(rename="targetAxis")] pub target_axis: Option, - /// The line style of this series. Valid only if the - /// chartType is AREA, - /// LINE, or SCATTER. - /// COMBO charts are also supported if the - /// series chart type is - /// AREA or LINE. - #[serde(rename="lineStyle")] - pub line_style: Option, - /// The type of this series. Valid only if the - /// chartType is - /// COMBO. - /// Different types will change the way the series is visualized. - /// Only LINE, AREA, - /// and COLUMN are supported. - #[serde(rename="type")] - pub type_: Option, } impl Part for BasicChartSeries {} @@ -3709,7 +4052,7 @@ impl Part for BasicChartSeries {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchUpdateSpreadsheetRequest { /// Limits the ranges included in the response spreadsheet. - /// Meaningful only if include_spreadsheet_response is 'true'. + /// Meaningful only if include_spreadsheet_in_response is 'true'. #[serde(rename="responseRanges")] pub response_ranges: Option>, /// Determines if the update response should include the spreadsheet @@ -3717,7 +4060,7 @@ pub struct BatchUpdateSpreadsheetRequest { #[serde(rename="includeSpreadsheetInResponse")] pub include_spreadsheet_in_response: Option, /// True if grid data should be returned. Meaningful only if - /// if include_spreadsheet_in_response is 'true'. + /// include_spreadsheet_in_response is 'true'. /// This parameter is ignored if a field mask was set in the request. #[serde(rename="responseIncludeGridData")] pub response_include_grid_data: Option, @@ -3730,6 +4073,29 @@ pub struct BatchUpdateSpreadsheetRequest { impl RequestValue for BatchUpdateSpreadsheetRequest {} +/// The options that define a "view window" for a chart (such as the visible +/// values in an axis). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChartAxisViewWindowOptions { + /// The minimum numeric value to be shown in this view window. If unset, will + /// automatically determine a minimum value that looks good for the data. + #[serde(rename="viewWindowMin")] + pub view_window_min: Option, + /// The maximum numeric value to be shown in this view window. If unset, will + /// automatically determine a maximum value that looks good for the data. + #[serde(rename="viewWindowMax")] + pub view_window_max: Option, + /// The view window's mode. + #[serde(rename="viewWindowMode")] + pub view_window_mode: Option, +} + +impl Part for ChartAxisViewWindowOptions {} + + /// Updates the state of the specified group. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3765,16 +4131,16 @@ pub struct BatchUpdateValuesByDataFilterRequest { #[serde(rename="responseValueRenderOption")] pub response_value_render_option: Option, /// The new values to apply to the spreadsheet. If more than one range is - /// matched by the specified DataFilter the specified values will be - /// applied to all of those ranges. + /// matched by the specified DataFilter the specified values are applied to + /// all of those ranges. pub data: Option>, /// Determines if the update response should include the values /// of the cells that were updated. By default, responses /// do not include the updated values. The `updatedData` field within - /// each of the BatchUpdateValuesResponse.responses will contain - /// the updated values. If the range to write was larger than than the range - /// actually written, the response will include all values in the requested - /// range (excluding trailing empty rows and columns). + /// each of the BatchUpdateValuesResponse.responses contains the updated + /// values. If the range to write was larger than the range actually written, + /// the response includes all values in the requested range (excluding trailing + /// empty rows and columns). #[serde(rename="includeValuesInResponse")] pub include_values_in_response: Option, /// How the input data should be interpreted. @@ -3886,6 +4252,32 @@ pub struct DeleteNamedRangeRequest { impl Part for DeleteNamedRangeRequest {} +/// Removes rows within this range that contain values in the specified columns +/// that are duplicates of values in any previous row. Rows with identical values +/// but different letter cases, formatting, or formulas are considered to be +/// duplicates. +/// +/// This request also removes duplicate rows hidden from view (for example, due +/// to a filter). When removing duplicates, the first instance of each duplicate +/// row scanning from the top downwards is kept in the resulting range. Content +/// outside of the specified range isn't removed, and rows considered duplicates +/// do not have to be adjacent to each other in the range. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeleteDuplicatesRequest { + /// The columns in the range to analyze for duplicate values. If no columns are + /// selected then all columns are analyzed for duplicates. + #[serde(rename="comparisonColumns")] + pub comparison_columns: Option>, + /// The range to remove duplicates rows from. + pub range: Option, +} + +impl Part for DeleteDuplicatesRequest {} + + /// Developer metadata associated with a location or object in a spreadsheet. /// Developer metadata may be used to associate arbitrary data with various /// parts of a spreadsheet and will remain associated at those locations as they @@ -3926,6 +4318,24 @@ pub struct DeveloperMetadata { impl ResponseResult for DeveloperMetadata {} +/// A developer metadata entry and the data filters specified in the original +/// request that matched it. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MatchedDeveloperMetadata { + /// All filters matching the returned developer metadata. + #[serde(rename="dataFilters")] + pub data_filters: Option>, + /// The developer metadata matching the specified filters. + #[serde(rename="developerMetadata")] + pub developer_metadata: Option, +} + +impl Part for MatchedDeveloperMetadata {} + + /// Updates all cells in a range with new data. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4013,32 +4423,22 @@ pub struct LineStyle { impl Part for LineStyle {} -/// Creates a group over the specified range. -/// -/// If the requested range is a superset of the range of an existing group G, -/// then the depth of G is incremented and this new group G' has the -/// depth of that group. For example, a group [C:D, depth 1] + [B:E] results in -/// groups [B:E, depth 1] and [C:D, depth 2]. -/// If the requested range is a subset of the range of an existing group G, -/// then the depth of the new group G' becomes one greater than the depth of G. -/// For example, a group [B:E, depth 1] + [C:D] results in groups [B:E, depth 1] -/// and [C:D, depth 2]. -/// If the requested range starts before and ends within, or starts within and -/// ends after, the range of an existing group G, then the range of the existing -/// group G becomes the union of the ranges, and the new group G' has -/// depth one greater than the depth of G and range as the intersection of the -/// ranges. For example, a group [B:D, depth 1] + [C:E] results in groups [B:E, -/// depth 1] and [C:D, depth 2]. +/// Trims the whitespace (such as spaces, tabs, or new lines) in every cell in +/// the specified range. This request removes all whitespace from the start and +/// end of each cell's text, and reduces any subsequence of remaining whitespace +/// characters to a single space. If the resulting trimmed text starts with a '+' +/// or '=' character, the text remains as a string value and isn't interpreted +/// as a formula. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddDimensionGroupRequest { - /// The range over which to create a group. - pub range: Option, +pub struct TrimWhitespaceRequest { + /// The range whose cells to trim. + pub range: Option, } -impl Part for AddDimensionGroupRequest {} +impl Part for TrimWhitespaceRequest {} /// Properties referring a single dimension (either row or column). If both @@ -4062,23 +4462,46 @@ pub struct BandingProperties { /// The second color that is alternating. (Required) #[serde(rename="secondBandColor")] pub second_band_color: Option, - /// The color of the first row or column. If this field is set, the first - /// row or column will be filled with this color and the colors will - /// alternate between first_band_color and second_band_color starting - /// from the second row or column. Otherwise, the first row or column will be - /// filled with first_band_color and the colors will proceed to alternate - /// as they normally would. + /// The color of the first row or column. If this field is set, the first row + /// or column is filled with this color and the colors alternate between + /// first_band_color and second_band_color starting from the second + /// row or column. Otherwise, the first row or column is filled with + /// first_band_color and the colors proceed to alternate as they normally + /// would. #[serde(rename="headerColor")] pub header_color: Option, /// The color of the last row or column. If this field is not set, the last - /// row or column will be filled with either first_band_color or + /// row or column is filled with either first_band_color or + /// second_band_color, depending on the color of the previous row or + /// column. + /// If footer_color is also set, this field takes precedence. + #[serde(rename="footerColorStyle")] + pub footer_color_style: Option, + /// The color of the first row or column. If this field is set, the first row + /// or column is filled with this color and the colors alternate between + /// first_band_color and second_band_color starting from the second + /// row or column. Otherwise, the first row or column is filled with + /// first_band_color and the colors proceed to alternate as they normally + /// would. If header_color is also set, this field takes precedence. + #[serde(rename="headerColorStyle")] + pub header_color_style: Option, + /// The second color that is alternating. (Required) + /// If second_band_color is also set, this field takes precedence. + #[serde(rename="secondBandColorStyle")] + pub second_band_color_style: Option, + /// The first color that is alternating. (Required) + #[serde(rename="firstBandColor")] + pub first_band_color: Option, + /// The first color that is alternating. (Required) + /// If first_band_color is also set, this field takes precedence. + #[serde(rename="firstBandColorStyle")] + pub first_band_color_style: Option, + /// The color of the last row or column. If this field is not set, the last + /// row or column is filled with either first_band_color or /// second_band_color, depending on the color of the previous row or /// column. #[serde(rename="footerColor")] pub footer_color: Option, - /// The first color that is alternating. (Required) - #[serde(rename="firstBandColor")] - pub first_band_color: Option, } impl Part for BandingProperties {} @@ -4094,6 +4517,11 @@ pub struct HistogramSeries { /// This field is optional. #[serde(rename="barColor")] pub bar_color: Option, + /// The color of the column representing this series in each bucket. + /// This field is optional. + /// If bar_color is also set, this field takes precedence. + #[serde(rename="barColorStyle")] + pub bar_color_style: Option, /// The data for this histogram series. pub data: Option, } @@ -4140,6 +4568,10 @@ impl Part for DeleteDimensionGroupResponse {} pub struct WaterfallChartColumnStyle { /// The color of the column. pub color: Option, + /// The color of the column. + /// If color is also set, this field takes precedence. + #[serde(rename="colorStyle")] + pub color_style: Option, /// The label of the column's legend. pub label: Option, } @@ -4147,46 +4579,28 @@ pub struct WaterfallChartColumnStyle { impl Part for WaterfallChartColumnStyle {} -/// The format of a cell. +/// An optional setting on a PivotGroup that defines buckets for the values +/// in the source data column rather than breaking out each individual value. +/// Only one PivotGroup with a group rule may be added for each column in +/// the source data, though on any given column you may add both a +/// PivotGroup that has a rule and a PivotGroup that does not. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CellFormat { - /// A format describing how number values should be represented to the user. - #[serde(rename="numberFormat")] - pub number_format: Option, - /// The direction of the text in the cell. - #[serde(rename="textDirection")] - pub text_direction: Option, - /// The padding of the cell. - pub padding: Option, - /// The vertical alignment of the value in the cell. - #[serde(rename="verticalAlignment")] - pub vertical_alignment: Option, - /// The background color of the cell. - #[serde(rename="backgroundColor")] - pub background_color: Option, - /// The horizontal alignment of the value in the cell. - #[serde(rename="horizontalAlignment")] - pub horizontal_alignment: Option, - /// The borders of the cell. - pub borders: Option, - /// The rotation applied to text in a cell - #[serde(rename="textRotation")] - pub text_rotation: Option, - /// How a hyperlink, if it exists, should be displayed in the cell. - #[serde(rename="hyperlinkDisplayType")] - pub hyperlink_display_type: Option, - /// The format of the text in the cell (unless overridden by a format run). - #[serde(rename="textFormat")] - pub text_format: Option, - /// The wrap strategy for the value in the cell. - #[serde(rename="wrapStrategy")] - pub wrap_strategy: Option, +pub struct PivotGroupRule { + /// A HistogramRule. + #[serde(rename="histogramRule")] + pub histogram_rule: Option, + /// A ManualRule. + #[serde(rename="manualRule")] + pub manual_rule: Option, + /// A DateTimeRule. + #[serde(rename="dateTimeRule")] + pub date_time_rule: Option, } -impl Part for CellFormat {} +impl Part for PivotGroupRule {} /// Sorts data in rows based on a sort order per column. @@ -4206,39 +4620,44 @@ pub struct SortRangeRequest { impl Part for SortRangeRequest {} -/// A filter view. +/// The specifications of a slicer. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FilterView { - /// The range this filter view covers. - /// - /// When writing, only one of range or named_range_id - /// may be set. - pub range: Option, - /// The sort order per column. Later specifications are used when values - /// are equal in the earlier specifications. - #[serde(rename="sortSpecs")] - pub sort_specs: Option>, - /// The name of the filter view. +pub struct SlicerSpec { + /// True if the filter should apply to pivot tables. + /// If not set, default to `True`. + #[serde(rename="applyToPivotTables")] + pub apply_to_pivot_tables: Option, + /// The data range of the slicer. + #[serde(rename="dataRange")] + pub data_range: Option, + /// The title of the slicer. pub title: Option, - /// The named range this filter view is backed by, if any. - /// - /// When writing, only one of range or named_range_id - /// may be set. - #[serde(rename="namedRangeId")] - pub named_range_id: Option, - /// The criteria for showing/hiding values per column. - /// The map's key is the column index, and the value is the criteria for - /// that column. - pub criteria: Option>, - /// The ID of the filter view. - #[serde(rename="filterViewId")] - pub filter_view_id: Option, + /// The background color of the slicer. + /// If background_color is also set, this field takes precedence. + #[serde(rename="backgroundColorStyle")] + pub background_color_style: Option, + /// The column index in the data table on which the filter is applied to. + #[serde(rename="columnIndex")] + pub column_index: Option, + /// The horizontal alignment of title in the slicer. + /// If unspecified, defaults to `LEFT` + #[serde(rename="horizontalAlignment")] + pub horizontal_alignment: Option, + /// The background color of the slicer. + #[serde(rename="backgroundColor")] + pub background_color: Option, + /// The text format of title in the slicer. + #[serde(rename="textFormat")] + pub text_format: Option, + /// The filtering criteria of the slicer. + #[serde(rename="filterCriteria")] + pub filter_criteria: Option, } -impl Part for FilterView {} +impl Part for SlicerSpec {} /// The definition of how a value in a pivot table should be calculated. @@ -4333,18 +4752,32 @@ pub struct RandomizeRangeRequest { impl Part for RandomizeRangeRequest {} -/// Clears the basic filter, if any exists on the sheet. +/// Creates a group over the specified range. +/// +/// If the requested range is a superset of the range of an existing group G, +/// then the depth of G is incremented and this new group G' has the +/// depth of that group. For example, a group [C:D, depth 1] + [B:E] results in +/// groups [B:E, depth 1] and [C:D, depth 2]. +/// If the requested range is a subset of the range of an existing group G, +/// then the depth of the new group G' becomes one greater than the depth of G. +/// For example, a group [B:E, depth 1] + [C:D] results in groups [B:E, depth 1] +/// and [C:D, depth 2]. +/// If the requested range starts before and ends within, or starts within and +/// ends after, the range of an existing group G, then the range of the existing +/// group G becomes the union of the ranges, and the new group G' has +/// depth one greater than the depth of G and range as the intersection of the +/// ranges. For example, a group [B:D, depth 1] + [C:E] results in groups [B:E, +/// depth 1] and [C:D, depth 2]. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ClearBasicFilterRequest { - /// The sheet ID on which the basic filter should be cleared. - #[serde(rename="sheetId")] - pub sheet_id: Option, +pub struct AddDimensionGroupRequest { + /// The range over which to create a group. + pub range: Option, } -impl Part for ClearBasicFilterRequest {} +impl Part for AddDimensionGroupRequest {} /// A range of values whose location is specified by a DataFilter. @@ -4357,9 +4790,9 @@ pub struct DataFilterValueRange { #[serde(rename="dataFilter")] pub data_filter: Option, /// The data to be written. If the provided values exceed any of the ranges - /// matched by the data filter then the request will fail. If the provided - /// values are less than the matched ranges only the specified values will be - /// written, existing values in the matched ranges will remain unaffected. + /// matched by the data filter then the request fails. If the provided values + /// are less than the matched ranges only the specified values are written, + /// existing values in the matched ranges remain unaffected. pub values: Option>>, /// The major dimension of the values. #[serde(rename="majorDimension")] @@ -4387,6 +4820,23 @@ pub struct UpdateChartSpecRequest { impl Part for UpdateChartSpecRequest {} +/// An error in a cell. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ErrorValue { + /// A message with more information about the error + /// (in the spreadsheet's locale). + pub message: Option, + /// The type of error. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for ErrorValue {} + + /// Deletes the embedded object with the given ID. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4561,9 +5011,9 @@ pub struct Request { /// Deletes rows or columns in a sheet. #[serde(rename="deleteDimension")] pub delete_dimension: Option, - /// Cuts data from one area and pastes it to another. - #[serde(rename="cutPaste")] - pub cut_paste: Option, + /// Adds a protected range. + #[serde(rename="addProtectedRange")] + pub add_protected_range: Option, /// Deletes an embedded object (e.g, chart, image) in a sheet. #[serde(rename="deleteEmbeddedObject")] pub delete_embedded_object: Option, @@ -4573,6 +5023,9 @@ pub struct Request { /// Appends cells after the last row with data in a sheet. #[serde(rename="appendCells")] pub append_cells: Option, + /// Adds a slicer. + #[serde(rename="addSlicer")] + pub add_slicer: Option, /// Duplicates a sheet. #[serde(rename="duplicateSheet")] pub duplicate_sheet: Option, @@ -4594,9 +5047,9 @@ pub struct Request { /// Finds and replaces occurrences of some text with other text. #[serde(rename="findReplace")] pub find_replace: Option, - /// Automatically fills in more data based on existing data. - #[serde(rename="autoFill")] - pub auto_fill: Option, + /// Trims cells of whitespace (such as spaces, tabs, or new lines). + #[serde(rename="trimWhitespace")] + pub trim_whitespace: Option, /// Sets the basic filter on a sheet. #[serde(rename="setBasicFilter")] pub set_basic_filter: Option, @@ -4615,19 +5068,20 @@ pub struct Request { /// Updates a banded range #[serde(rename="updateBanding")] pub update_banding: Option, - /// Adds a new banded range - #[serde(rename="addBanding")] - pub add_banding: Option, /// Automatically resizes one or more dimensions based on the contents /// of the cells in that dimension. #[serde(rename="autoResizeDimensions")] pub auto_resize_dimensions: Option, + /// Removes rows containing duplicate values in specified columns of a cell + /// range. + #[serde(rename="deleteDuplicates")] + pub delete_duplicates: Option, /// Updates dimensions' properties. #[serde(rename="updateDimensionProperties")] pub update_dimension_properties: Option, - /// Converts a column of text into many columns of text. - #[serde(rename="textToColumns")] - pub text_to_columns: Option, + /// Adds a new banded range + #[serde(rename="addBanding")] + pub add_banding: Option, /// Unmerges merged cells. #[serde(rename="unmergeCells")] pub unmerge_cells: Option, @@ -4640,12 +5094,12 @@ pub struct Request { /// Clears the basic filter on a sheet. #[serde(rename="clearBasicFilter")] pub clear_basic_filter: Option, - /// Adds a named range. - #[serde(rename="addNamedRange")] - pub add_named_range: Option, - /// Updates a chart's specifications. - #[serde(rename="updateChartSpec")] - pub update_chart_spec: Option, + /// Converts a column of text into many columns of text. + #[serde(rename="textToColumns")] + pub text_to_columns: Option, + /// Automatically fills in more data based on existing data. + #[serde(rename="autoFill")] + pub auto_fill: Option, /// Inserts new cells in a sheet, shifting the existing cells. #[serde(rename="insertRange")] pub insert_range: Option, @@ -4667,6 +5121,12 @@ pub struct Request { /// Merges cells together. #[serde(rename="mergeCells")] pub merge_cells: Option, + /// Updates a slicer's specifications. + #[serde(rename="updateSlicerSpec")] + pub update_slicer_spec: Option, + /// Updates a chart's specifications. + #[serde(rename="updateChartSpec")] + pub update_chart_spec: Option, /// Deletes a protected range. #[serde(rename="deleteProtectedRange")] pub delete_protected_range: Option, @@ -4682,9 +5142,9 @@ pub struct Request { /// Updates the borders in a range of cells. #[serde(rename="updateBorders")] pub update_borders: Option, - /// Adds a protected range. - #[serde(rename="addProtectedRange")] - pub add_protected_range: Option, + /// Cuts data from one area and pastes it to another. + #[serde(rename="cutPaste")] + pub cut_paste: Option, /// Copies data from one area and pastes it to another. #[serde(rename="copyPaste")] pub copy_paste: Option, @@ -4709,6 +5169,9 @@ pub struct Request { /// Deletes an existing conditional format rule. #[serde(rename="deleteConditionalFormatRule")] pub delete_conditional_format_rule: Option, + /// Adds a named range. + #[serde(rename="addNamedRange")] + pub add_named_range: Option, /// Creates a group over the specified range. #[serde(rename="addDimensionGroup")] pub add_dimension_group: Option, @@ -4783,7 +5246,7 @@ impl Part for WaterfallChartSeries {} pub struct SearchDeveloperMetadataRequest { /// The data filters describing the criteria used to determine which /// DeveloperMetadata entries to return. DeveloperMetadata matching any of the - /// specified filters will be included in the response. + /// specified filters are included in the response. #[serde(rename="dataFilters")] pub data_filters: Option>, } @@ -4862,6 +5325,66 @@ pub struct DimensionRange { impl Part for DimensionRange {} +/// Formatting options for baseline value. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BaselineValueFormat { + /// Description which is appended after the baseline value. + /// This field is optional. + pub description: Option, + /// Color to be used, in case baseline value represents a negative change for + /// key value. This field is optional. + #[serde(rename="negativeColor")] + pub negative_color: Option, + /// The comparison type of key value with baseline value. + #[serde(rename="comparisonType")] + pub comparison_type: Option, + /// Color to be used, in case baseline value represents a positive change for + /// key value. This field is optional. + /// If positive_color is also set, this field takes precedence. + #[serde(rename="positiveColorStyle")] + pub positive_color_style: Option, + /// Color to be used, in case baseline value represents a negative change for + /// key value. This field is optional. + /// If negative_color is also set, this field takes precedence. + #[serde(rename="negativeColorStyle")] + pub negative_color_style: Option, + /// Specifies the horizontal text positioning of baseline value. + /// This field is optional. If not specified, default positioning is used. + pub position: Option, + /// Text formatting options for baseline value. + #[serde(rename="textFormat")] + pub text_format: Option, + /// Color to be used, in case baseline value represents a positive change for + /// key value. This field is optional. + #[serde(rename="positiveColor")] + pub positive_color: Option, +} + +impl Part for BaselineValueFormat {} + + +/// Deletes a range of cells, shifting other cells into the deleted area. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeleteRangeRequest { + /// The range of cells to delete. + pub range: Option, + /// The dimension from which deleted cells will be replaced with. + /// If ROWS, existing cells will be shifted upward to + /// replace the deleted cells. If COLUMNS, existing cells + /// will be shifted left to replace the deleted cells. + #[serde(rename="shiftDimension")] + pub shift_dimension: Option, +} + +impl Part for DeleteRangeRequest {} + + /// Moves one or more rows or columns. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4907,6 +5430,41 @@ pub struct TextFormatRun { impl Part for TextFormatRun {} +/// A filter view. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FilterView { + /// The range this filter view covers. + /// + /// When writing, only one of range or named_range_id + /// may be set. + pub range: Option, + /// The sort order per column. Later specifications are used when values + /// are equal in the earlier specifications. + #[serde(rename="sortSpecs")] + pub sort_specs: Option>, + /// The name of the filter view. + pub title: Option, + /// The named range this filter view is backed by, if any. + /// + /// When writing, only one of range or named_range_id + /// may be set. + #[serde(rename="namedRangeId")] + pub named_range_id: Option, + /// The criteria for showing/hiding values per column. + /// The map's key is the column index, and the value is the criteria for + /// that column. + pub criteria: Option>, + /// The ID of the filter view. + #[serde(rename="filterViewId")] + pub filter_view_id: Option, +} + +impl Part for FilterView {} + + /// Sets the basic filter associated with a sheet. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4955,6 +5513,14 @@ pub struct OrgChartSpec { /// The color of the selected org chart nodes. #[serde(rename="selectedNodeColor")] pub selected_node_color: Option, + /// The color of the org chart nodes. + /// If node_color is also set, this field takes precedence. + #[serde(rename="nodeColorStyle")] + pub node_color_style: Option, + /// The color of the selected org chart nodes. + /// If selected_node_color is also set, this field takes precedence. + #[serde(rename="selectedNodeColorStyle")] + pub selected_node_color_style: Option, /// The size of the org chart nodes. #[serde(rename="nodeSize")] pub node_size: Option, @@ -5148,6 +5714,22 @@ pub struct CandlestickChartSpec { impl Part for CandlestickChartSpec {} +/// Adds a slicer to a sheet in the spreadsheet. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddSlicerRequest { + /// The slicer that should be added to the spreadsheet, including + /// the position where it should be placed. The slicerId field is optional; if one is not set, an id + /// will be randomly generated. (It is an error to specify the ID + /// of a slicer that already exists.) + pub slicer: Option, +} + +impl Part for AddSlicerRequest {} + + /// Updates properties of the filter view. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -5273,77 +5855,21 @@ pub struct FindReplaceRequest { impl Part for FindReplaceRequest {} -/// A single grouping (either row or column) in a pivot table. +/// A pair mapping a spreadsheet theme color type to the concrete color it +/// represents. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PivotGroup { - /// True if the pivot table should include the totals for this grouping. - #[serde(rename="showTotals")] - pub show_totals: Option, - /// The column offset of the source range that this grouping is based on. - /// - /// For example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` - /// means this group refers to column `C`, whereas the offset `1` would refer - /// to column `D`. - #[serde(rename="sourceColumnOffset")] - pub source_column_offset: Option, - /// The labels to use for the row/column groups which can be customized. For - /// example, in the following pivot table, the row label is `Region` (which - /// could be renamed to `State`) and the column label is `Product` (which - /// could be renamed `Item`). Pivot tables created before December 2017 do - /// not have header labels. If you'd like to add header labels to an existing - /// pivot table, please delete the existing pivot table and then create a new - /// pivot table with same parameters. - /// - /// ````text - /// +--------------+---------+-------+ - /// | SUM of Units | Product | | - /// | Region | Pen | Paper | - /// +--------------+---------+-------+ - /// | New York | 345 | 98 | - /// | Oregon | 234 | 123 | - /// | Tennessee | 531 | 415 | - /// +--------------+---------+-------+ - /// | Grand Total | 1110 | 636 | - /// +--------------+---------+-------+```` - pub label: Option, - /// Metadata about values in the grouping. - #[serde(rename="valueMetadata")] - pub value_metadata: Option>, - /// The bucket of the opposite pivot group to sort by. - /// If not specified, sorting is alphabetical by this group's values. - #[serde(rename="valueBucket")] - pub value_bucket: Option, - /// The order the values in this group should be sorted. - #[serde(rename="sortOrder")] - pub sort_order: Option, - /// True if the headings in this pivot group should be repeated. - /// This is only valid for row groupings and is ignored by columns. - /// - /// By default, we minimize repitition of headings by not showing higher - /// level headings where they are the same. For example, even though the - /// third row below corresponds to "Q1 Mar", "Q1" is not shown because - /// it is redundant with previous rows. Setting repeat_headings to true - /// would cause "Q1" to be repeated for "Feb" and "Mar". - /// - /// ````text - /// +--------------+ - /// | Q1 | Jan | - /// | | Feb | - /// | | Mar | - /// +--------+-----+ - /// | Q1 Total | - /// +--------------+```` - #[serde(rename="repeatHeadings")] - pub repeat_headings: Option, - /// The group rule to apply to this row/column group. - #[serde(rename="groupRule")] - pub group_rule: Option, +pub struct ThemeColorPair { + /// The concrete color corresponding to the theme color type. + pub color: Option, + /// The type of the spreadsheet theme color. + #[serde(rename="colorType")] + pub color_type: Option, } -impl Part for PivotGroup {} +impl Part for ThemeColorPair {} /// An axis of the chart. @@ -5354,11 +5880,14 @@ impl Part for PivotGroup {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BasicChartAxis { - /// The position of this axis. - pub position: Option, /// The format of the title. /// Only valid if the axis is not associated with the domain. pub format: Option, + /// The position of this axis. + pub position: Option, + /// The view window options for this axis. + #[serde(rename="viewWindowOptions")] + pub view_window_options: Option, /// The title of this axis. If set, this overrides any title inferred /// from headers of the data. pub title: Option, @@ -5376,6 +5905,11 @@ impl Part for BasicChartAxis {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TreemapChartColorScale { + /// The background color for cells with a color value greater than or equal + /// to maxValue. Defaults to #109618 if not + /// specified. + #[serde(rename="maxValueColor")] + pub max_value_color: Option, /// The background color for cells that have no color data associated with /// them. Defaults to #000000 if not specified. #[serde(rename="noDataColor")] @@ -5384,18 +5918,37 @@ pub struct TreemapChartColorScale { /// minValue and /// maxValue. Defaults to #efe6dc if not /// specified. + /// If mid_value_color is also set, this field takes precedence. + #[serde(rename="midValueColorStyle")] + pub mid_value_color_style: Option, + /// The background color for cells with a color value greater than or equal + /// to maxValue. Defaults to #109618 if not + /// specified. + /// If max_value_color is also set, this field takes precedence. + #[serde(rename="maxValueColorStyle")] + pub max_value_color_style: Option, + /// The background color for cells with a color value less than or equal to + /// minValue. Defaults to #dc3912 if not + /// specified. + #[serde(rename="minValueColor")] + pub min_value_color: Option, + /// The background color for cells that have no color data associated with + /// them. Defaults to #000000 if not specified. + /// If no_data_color is also set, this field takes precedence. + #[serde(rename="noDataColorStyle")] + pub no_data_color_style: Option, + /// The background color for cells with a color value at the midpoint between + /// minValue and + /// maxValue. Defaults to #efe6dc if not + /// specified. #[serde(rename="midValueColor")] pub mid_value_color: Option, /// The background color for cells with a color value less than or equal to /// minValue. Defaults to #dc3912 if not /// specified. - #[serde(rename="minValueColor")] - pub min_value_color: Option, - /// The background color for cells with a color value greater than or equal - /// to maxValue. Defaults to #109618 if not - /// specified. - #[serde(rename="maxValueColor")] - pub max_value_color: Option, + /// If min_value_color is also set, this field takes precedence. + #[serde(rename="minValueColorStyle")] + pub min_value_color_style: Option, } impl Part for TreemapChartColorScale {} @@ -5631,7 +6184,7 @@ impl<'a, C, A> SpreadsheetMethods<'a, C, A> { /// * `request` - No description provided. /// * `spreadsheetId` - The ID of the spreadsheet to update. /// * `range` - The A1 notation of a range to search for a logical table of data. - /// Values will be appended after the last row of the table. + /// Values are appended after the last row of the table. pub fn values_append(&self, request: ValueRange, spreadsheet_id: &str, range: &str) -> SpreadsheetValueAppendCall<'a, C, A> { SpreadsheetValueAppendCall { hub: self.hub, @@ -7255,9 +7808,8 @@ impl<'a, C, A> SpreadsheetValueBatchGetCall<'a, C, A> where C: BorrowMut SpreadsheetValueAppendCall<'a, C, A> where C: BorrowMut SpreadsheetValueGetCall<'a, C, A> where C: BorrowMut SpreadsheetValueUpdateCall<'a, C, A> where C: BorrowMut SpreadsheetValueUpdateCall<'a, C, A> { diff --git a/gen/siteverification1-cli/Cargo.toml b/gen/siteverification1-cli/Cargo.toml index 5c44976b2f..c032d14578 100644 --- a/gen/siteverification1-cli/Cargo.toml +++ b/gen/siteverification1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-siteverification1-cli" -version = "1.0.12+20180830" +version = "1.0.13+20191119" authors = ["Sebastian Thiel "] description = "A complete library to interact with siteVerification (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-siteverification1] path = "../siteverification1" -version = "1.0.12+20180830" +version = "1.0.13+20191119" diff --git a/gen/siteverification1-cli/README.md b/gen/siteverification1-cli/README.md index 083a31a01a..587bc2a5e9 100644 --- a/gen/siteverification1-cli/README.md +++ b/gen/siteverification1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *siteVerification* API at revision *20180830*. The CLI is at version *1.0.12*. +This documentation was generated from the *siteVerification* API at revision *20191119*. The CLI is at version *1.0.13*. ```bash siteverification1 [options] diff --git a/gen/siteverification1-cli/mkdocs.yml b/gen/siteverification1-cli/mkdocs.yml index 6b617c4c9e..57b820033f 100644 --- a/gen/siteverification1-cli/mkdocs.yml +++ b/gen/siteverification1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: siteVerification v1.0.12+20180830 +site_name: siteVerification v1.0.13+20191119 site_url: http://byron.github.io/google-apis-rs/google-siteverification1-cli site_description: A complete library to interact with siteVerification (protocol v1) diff --git a/gen/siteverification1-cli/src/main.rs b/gen/siteverification1-cli/src/main.rs index 177a82914e..79c68fd25a 100644 --- a/gen/siteverification1-cli/src/main.rs +++ b/gen/siteverification1-cli/src/main.rs @@ -828,7 +828,7 @@ fn main() { let mut app = App::new("siteverification1") .author("Sebastian Thiel ") - .version("1.0.12+20180830") + .version("1.0.13+20191119") .about("Verifies ownership of websites or domains with Google.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_siteverification1_cli") .arg(Arg::with_name("url") diff --git a/gen/siteverification1/Cargo.toml b/gen/siteverification1/Cargo.toml index 4a10c2c92f..101037185f 100644 --- a/gen/siteverification1/Cargo.toml +++ b/gen/siteverification1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-siteverification1" -version = "1.0.12+20180830" +version = "1.0.13+20191119" authors = ["Sebastian Thiel "] description = "A complete library to interact with siteVerification (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1" homepage = "https://developers.google.com/site-verification/" -documentation = "https://docs.rs/google-siteverification1/1.0.12+20180830" +documentation = "https://docs.rs/google-siteverification1/1.0.13+20191119" license = "MIT" keywords = ["siteVerification", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/siteverification1/README.md b/gen/siteverification1/README.md index 9c9f32e149..05dfb07561 100644 --- a/gen/siteverification1/README.md +++ b/gen/siteverification1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-siteverification1` library allows access to all features of the *Google siteVerification* service. -This documentation was generated from *siteVerification* crate version *1.0.12+20180830*, where *20180830* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *siteVerification* crate version *1.0.13+20191119*, where *20191119* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *siteVerification* *v1* API can be found at the [official documentation site](https://developers.google.com/site-verification/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.SiteVerification.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.SiteVerification.html) ... * web resource - * [*delete*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.WebResourceDeleteCall.html), [*get*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.WebResourceGetCall.html), [*get token*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.WebResourceGetTokenCall.html), [*insert*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.WebResourceInsertCall.html), [*list*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.WebResourceListCall.html), [*patch*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.WebResourcePatchCall.html) and [*update*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.WebResourceUpdateCall.html) + * [*delete*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.WebResourceDeleteCall.html), [*get*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.WebResourceGetCall.html), [*get token*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.WebResourceGetTokenCall.html), [*insert*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.WebResourceInsertCall.html), [*list*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.WebResourceListCall.html), [*patch*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.WebResourcePatchCall.html) and [*update*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.WebResourceUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/struct.SiteVerification.html)** +* **[Hub](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/struct.SiteVerification.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.Part.html)** + * **[Parts](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -133,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -153,29 +153,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-siteverification1/1.0.12+20180830/google_siteverification1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-siteverification1/1.0.13+20191119/google_siteverification1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/siteverification1/src/lib.rs b/gen/siteverification1/src/lib.rs index c6e9e8f126..2c5b7709cf 100644 --- a/gen/siteverification1/src/lib.rs +++ b/gen/siteverification1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *siteVerification* crate version *1.0.12+20180830*, where *20180830* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *siteVerification* crate version *1.0.13+20191119*, where *20191119* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *siteVerification* *v1* API can be found at the //! [official documentation site](https://developers.google.com/site-verification/). @@ -336,7 +336,7 @@ impl<'a, C, A> SiteVerification SiteVerification { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/siteVerification/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> SiteVerification } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/sourcerepo1-cli/Cargo.toml b/gen/sourcerepo1-cli/Cargo.toml index 65e0d4f216..875027f008 100644 --- a/gen/sourcerepo1-cli/Cargo.toml +++ b/gen/sourcerepo1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-sourcerepo1-cli" -version = "1.0.12+20190611" +version = "1.0.13+20200121" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Source Repositories (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sourcerepo1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-sourcerepo1] path = "../sourcerepo1" -version = "1.0.12+20190611" +version = "1.0.13+20200121" diff --git a/gen/sourcerepo1-cli/README.md b/gen/sourcerepo1-cli/README.md index 74ca7dc829..c2fb485575 100644 --- a/gen/sourcerepo1-cli/README.md +++ b/gen/sourcerepo1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Source Repositories* API at revision *20190611*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Source Repositories* API at revision *20200121*. The CLI is at version *1.0.13*. ```bash sourcerepo1 [options] diff --git a/gen/sourcerepo1-cli/mkdocs.yml b/gen/sourcerepo1-cli/mkdocs.yml index 0d3f4cc3ad..d2e8ee3d1f 100644 --- a/gen/sourcerepo1-cli/mkdocs.yml +++ b/gen/sourcerepo1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Source Repositories v1.0.12+20190611 +site_name: Cloud Source Repositories v1.0.13+20200121 site_url: http://byron.github.io/google-apis-rs/google-sourcerepo1-cli site_description: A complete library to interact with Cloud Source Repositories (protocol v1) diff --git a/gen/sourcerepo1-cli/src/main.rs b/gen/sourcerepo1-cli/src/main.rs index a165459c8d..d1d98cf786 100644 --- a/gen/sourcerepo1-cli/src/main.rs +++ b/gen/sourcerepo1-cli/src/main.rs @@ -298,6 +298,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -311,6 +314,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -1275,7 +1279,7 @@ fn main() { let mut app = App::new("sourcerepo1") .author("Sebastian Thiel ") - .version("1.0.12+20190611") + .version("1.0.13+20200121") .about("Accesses source code repositories hosted by Google.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_sourcerepo1_cli") .arg(Arg::with_name("url") diff --git a/gen/sourcerepo1/Cargo.toml b/gen/sourcerepo1/Cargo.toml index 9df597d96a..b043861f56 100644 --- a/gen/sourcerepo1/Cargo.toml +++ b/gen/sourcerepo1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-sourcerepo1" -version = "1.0.12+20190611" +version = "1.0.13+20200121" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Source Repositories (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sourcerepo1" homepage = "https://cloud.google.com/source-repositories/docs/apis" -documentation = "https://docs.rs/google-sourcerepo1/1.0.12+20190611" +documentation = "https://docs.rs/google-sourcerepo1/1.0.13+20200121" license = "MIT" keywords = ["sourcerepo", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/sourcerepo1/README.md b/gen/sourcerepo1/README.md index 6c1215edf9..032a58f59c 100644 --- a/gen/sourcerepo1/README.md +++ b/gen/sourcerepo1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-sourcerepo1` library allows access to all features of the *Google Cloud Source Repositories* service. -This documentation was generated from *Cloud Source Repositories* crate version *1.0.12+20190611*, where *20190611* is the exact revision of the *sourcerepo:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Source Repositories* crate version *1.0.13+20200121*, where *20200121* is the exact revision of the *sourcerepo:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Source Repositories* *v1* API can be found at the [official documentation site](https://cloud.google.com/source-repositories/docs/apis). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.CloudSourceRepositories.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.CloudSourceRepositories.html) ... * projects - * [*get config*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectGetConfigCall.html), [*repos create*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoCreateCall.html), [*repos delete*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoDeleteCall.html), [*repos get*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoGetCall.html), [*repos get iam policy*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoGetIamPolicyCall.html), [*repos list*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoListCall.html), [*repos patch*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoPatchCall.html), [*repos set iam policy*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoSetIamPolicyCall.html), [*repos sync*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoSyncCall.html), [*repos test iam permissions*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectRepoTestIamPermissionCall.html) and [*update config*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.ProjectUpdateConfigCall.html) + * [*get config*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectGetConfigCall.html), [*repos create*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoCreateCall.html), [*repos delete*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoDeleteCall.html), [*repos get*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoGetCall.html), [*repos get iam policy*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoGetIamPolicyCall.html), [*repos list*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoListCall.html), [*repos patch*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoPatchCall.html), [*repos set iam policy*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoSetIamPolicyCall.html), [*repos sync*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoSyncCall.html), [*repos test iam permissions*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectRepoTestIamPermissionCall.html) and [*update config*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.ProjectUpdateConfigCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/struct.CloudSourceRepositories.html)** +* **[Hub](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/struct.CloudSourceRepositories.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.Part.html)** + * **[Parts](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-sourcerepo1/1.0.12+20190611/google_sourcerepo1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-sourcerepo1/1.0.13+20200121/google_sourcerepo1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/sourcerepo1/src/lib.rs b/gen/sourcerepo1/src/lib.rs index 5d7ec4ba14..eb3eebf027 100644 --- a/gen/sourcerepo1/src/lib.rs +++ b/gen/sourcerepo1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Source Repositories* crate version *1.0.12+20190611*, where *20190611* is the exact revision of the *sourcerepo:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Source Repositories* crate version *1.0.13+20200121*, where *20200121* is the exact revision of the *sourcerepo:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Source Repositories* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/source-repositories/docs/apis). @@ -343,7 +343,7 @@ impl<'a, C, A> CloudSourceRepositories CloudSourceRepositories { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://sourcerepo.googleapis.com/".to_string(), _root_url: "https://sourcerepo.googleapis.com/".to_string(), } @@ -354,7 +354,7 @@ impl<'a, C, A> CloudSourceRepositories } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -391,7 +391,7 @@ impl<'a, C, A> CloudSourceRepositories /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -402,7 +402,7 @@ impl<'a, C, A> CloudSourceRepositories /// ```` /// /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting -/// foo@gmail.com from DATA_READ logging. +/// jose@example.com from DATA_READ logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -469,30 +469,59 @@ pub struct SetIamPolicyRequest { impl RequestValue for SetIamPolicyRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -526,37 +555,50 @@ pub struct MirrorConfig { impl Part for MirrorConfig {} -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. /// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. /// -/// **JSON Example** +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** /// /// ````text /// { /// "bindings": [ /// { -/// "role": "roles/owner", +/// "role": "roles/resourcemanager.organizationAdmin", /// "members": [ /// "user:mike@example.com", /// "group:admins@example.com", /// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" /// ] /// }, /// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } /// } -/// ] +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 /// } /// ```` /// -/// **YAML Example** +/// **YAML example:** /// /// ````text /// bindings: @@ -564,15 +606,21 @@ impl Part for MirrorConfig {} /// - user:mike@example.com /// - group:admins@example.com /// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin /// - members: -/// - user:sean@example.com -/// role: roles/viewer +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 /// ```` /// /// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). +/// [IAM documentation](https://cloud.google.com/iam/docs/). /// /// # Activities /// @@ -594,13 +642,36 @@ pub struct Policy { /// systems are expected to put that etag in the request to `setIamPolicy` to /// ensure that their change will be applied to the same version of the policy. /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. pub etag: Option, - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. pub bindings: Option>, - /// Deprecated. + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. pub version: Option, } @@ -763,7 +834,7 @@ pub struct Binding { /// who is authenticated with a Google account or a service account. /// /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . + /// account. For example, `alice@example.com` . /// /// /// * `serviceAccount:{emailid}`: An email address that represents a service @@ -772,6 +843,26 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// /// /// * `domain:{domain}`: The G Suite domain (primary) that represents all the /// users of that domain. For example, `google.com` or `example.com`. @@ -841,7 +932,7 @@ impl ResponseResult for Repo {} /// { /// "log_type": "DATA_READ", /// "exempted_members": [ -/// "user:foo@gmail.com" +/// "user:jose@example.com" /// ] /// }, /// { @@ -853,7 +944,7 @@ impl ResponseResult for Repo {} /// ] /// }, /// { -/// "service": "fooservice.googleapis.com" +/// "service": "sampleservice.googleapis.com" /// "audit_log_configs": [ /// { /// "log_type": "DATA_READ", @@ -861,7 +952,7 @@ impl ResponseResult for Repo {} /// { /// "log_type": "DATA_WRITE", /// "exempted_members": [ -/// "user:bar@gmail.com" +/// "user:aliya@example.com" /// ] /// } /// ] @@ -870,9 +961,9 @@ impl ResponseResult for Repo {} /// } /// ```` /// -/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ -/// logging. It also exempts foo@gmail.com from DATA_READ logging, and -/// bar@gmail.com from DATA_WRITE logging. +/// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +/// logging. It also exempts jose@example.com from DATA_READ logging, and +/// aliya@example.com from DATA_WRITE logging. /// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -1162,6 +1253,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectRepoGetIamPolicyCall { hub: self.hub, _resource: resource.to_string(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2681,6 +2773,7 @@ impl<'a, C, A> ProjectRepoPatchCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().repos_get_iam_policy("resource") +/// .options_requested_policy_version(-70) /// .doit(); /// # } /// ``` @@ -2689,6 +2782,7 @@ pub struct ProjectRepoGetIamPolicyCall<'a, C, A> hub: &'a CloudSourceRepositories, _resource: String, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -2711,9 +2805,12 @@ impl<'a, C, A> ProjectRepoGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + if let Some(value) = self._options_requested_policy_version { + params.push(("options.requestedPolicyVersion", value.to_string())); + } + for &field in ["alt", "resource", "options.requestedPolicyVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2839,6 +2936,20 @@ impl<'a, C, A> ProjectRepoGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectRepoGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3214,8 +3325,8 @@ impl<'a, C, A> ProjectRepoCreateCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().repos_list("name") -/// .page_token("erat") -/// .page_size(-35) +/// .page_token("labore") +/// .page_size(-9) /// .doit(); /// # } /// ``` diff --git a/gen/spanner1-cli/Cargo.toml b/gen/spanner1-cli/Cargo.toml index 9d069730ba..ae2669a071 100644 --- a/gen/spanner1-cli/Cargo.toml +++ b/gen/spanner1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-spanner1-cli" -version = "1.0.12+20190613" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Spanner (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spanner1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-spanner1] path = "../spanner1" -version = "1.0.12+20190613" +version = "1.0.13+20200403" diff --git a/gen/spanner1-cli/README.md b/gen/spanner1-cli/README.md index 92d44d05ad..6f88a04e38 100644 --- a/gen/spanner1-cli/README.md +++ b/gen/spanner1-cli/README.md @@ -25,14 +25,28 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Spanner* API at revision *20190613*. The CLI is at version *1.0.12*. +This documentation was generated from the *Spanner* API at revision *20200403*. The CLI is at version *1.0.13*. ```bash spanner1 [options] projects instance-configs-get [-p ]... [-o ] instance-configs-list [-p ]... [-o ] + instances-backup-operations-list [-p ]... [-o ] + instances-backups-create (-r )... [-p ]... [-o ] + instances-backups-delete [-p ]... [-o ] + instances-backups-get [-p ]... [-o ] + instances-backups-get-iam-policy (-r )... [-p ]... [-o ] + instances-backups-list [-p ]... [-o ] + instances-backups-operations-cancel [-p ]... [-o ] + instances-backups-operations-delete [-p ]... [-o ] + instances-backups-operations-get [-p ]... [-o ] + instances-backups-operations-list [-p ]... [-o ] + instances-backups-patch (-r )... [-p ]... [-o ] + instances-backups-set-iam-policy (-r )... [-p ]... [-o ] + instances-backups-test-iam-permissions (-r )... [-p ]... [-o ] instances-create (-r )... [-p ]... [-o ] + instances-database-operations-list [-p ]... [-o ] instances-databases-create (-r )... [-p ]... [-o ] instances-databases-drop-database [-p ]... [-o ] instances-databases-get [-p ]... [-o ] @@ -43,6 +57,8 @@ spanner1 [options] instances-databases-operations-delete [-p ]... [-o ] instances-databases-operations-get [-p ]... [-o ] instances-databases-operations-list [-p ]... [-o ] + instances-databases-restore (-r )... [-p ]... [-o ] + instances-databases-sessions-batch-create (-r )... [-p ]... [-o ] instances-databases-sessions-begin-transaction (-r )... [-p ]... [-o ] instances-databases-sessions-commit (-r )... [-p ]... [-o ] instances-databases-sessions-create (-r )... [-p ]... [-o ] diff --git a/gen/spanner1-cli/mkdocs.yml b/gen/spanner1-cli/mkdocs.yml index 6f29852e72..5806312423 100644 --- a/gen/spanner1-cli/mkdocs.yml +++ b/gen/spanner1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Spanner v1.0.12+20190613 +site_name: Spanner v1.0.13+20200403 site_url: http://byron.github.io/google-apis-rs/google-spanner1-cli site_description: A complete library to interact with Spanner (protocol v1) @@ -11,7 +11,21 @@ pages: - ['index.md', 'Home'] - ['projects_instance-configs-get.md', 'Projects', 'Instance Configs Get'] - ['projects_instance-configs-list.md', 'Projects', 'Instance Configs List'] +- ['projects_instances-backup-operations-list.md', 'Projects', 'Instances Backup Operations List'] +- ['projects_instances-backups-create.md', 'Projects', 'Instances Backups Create'] +- ['projects_instances-backups-delete.md', 'Projects', 'Instances Backups Delete'] +- ['projects_instances-backups-get.md', 'Projects', 'Instances Backups Get'] +- ['projects_instances-backups-get-iam-policy.md', 'Projects', 'Instances Backups Get Iam Policy'] +- ['projects_instances-backups-list.md', 'Projects', 'Instances Backups List'] +- ['projects_instances-backups-operations-cancel.md', 'Projects', 'Instances Backups Operations Cancel'] +- ['projects_instances-backups-operations-delete.md', 'Projects', 'Instances Backups Operations Delete'] +- ['projects_instances-backups-operations-get.md', 'Projects', 'Instances Backups Operations Get'] +- ['projects_instances-backups-operations-list.md', 'Projects', 'Instances Backups Operations List'] +- ['projects_instances-backups-patch.md', 'Projects', 'Instances Backups Patch'] +- ['projects_instances-backups-set-iam-policy.md', 'Projects', 'Instances Backups Set Iam Policy'] +- ['projects_instances-backups-test-iam-permissions.md', 'Projects', 'Instances Backups Test Iam Permissions'] - ['projects_instances-create.md', 'Projects', 'Instances Create'] +- ['projects_instances-database-operations-list.md', 'Projects', 'Instances Database Operations List'] - ['projects_instances-databases-create.md', 'Projects', 'Instances Databases Create'] - ['projects_instances-databases-drop-database.md', 'Projects', 'Instances Databases Drop Database'] - ['projects_instances-databases-get.md', 'Projects', 'Instances Databases Get'] @@ -22,6 +36,8 @@ pages: - ['projects_instances-databases-operations-delete.md', 'Projects', 'Instances Databases Operations Delete'] - ['projects_instances-databases-operations-get.md', 'Projects', 'Instances Databases Operations Get'] - ['projects_instances-databases-operations-list.md', 'Projects', 'Instances Databases Operations List'] +- ['projects_instances-databases-restore.md', 'Projects', 'Instances Databases Restore'] +- ['projects_instances-databases-sessions-batch-create.md', 'Projects', 'Instances Databases Sessions Batch Create'] - ['projects_instances-databases-sessions-begin-transaction.md', 'Projects', 'Instances Databases Sessions Begin Transaction'] - ['projects_instances-databases-sessions-commit.md', 'Projects', 'Instances Databases Sessions Commit'] - ['projects_instances-databases-sessions-create.md', 'Projects', 'Instances Databases Sessions Create'] diff --git a/gen/spanner1-cli/src/main.rs b/gen/spanner1-cli/src/main.rs index 40bb49a9da..a89255db9c 100644 --- a/gen/spanner1-cli/src/main.rs +++ b/gen/spanner1-cli/src/main.rs @@ -157,6 +157,898 @@ impl<'n> Engine<'n> { } } + fn _projects_instances_backup_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backup_operations_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "database" => Some(("database", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expire-time" => Some(("expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size-bytes" => Some(("sizeBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "referencing-databases" => Some(("referencingDatabases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "database", "expire-time", "name", "referencing-databases", "size-bytes", "state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Backup = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_backups_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "backup-id" => { + call = call.backup_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["backup-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backups_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backups_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_backups_get_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backups_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backups_operations_cancel(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backups_operations_delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backups_operations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_backups_operations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "database" => Some(("database", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expire-time" => Some(("expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "size-bytes" => Some(("sizeBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "referencing-databases" => Some(("referencingDatabases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "database", "expire-time", "name", "referencing-databases", "size-bytes", "state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Backup = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_backups_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_backups_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_backups_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_backups_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_instances_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -185,10 +1077,11 @@ impl<'n> Engine<'n> { "instance.name" => Some(("instance.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "instance.labels" => Some(("instance.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "instance.state" => Some(("instance.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.endpoint-uris" => Some(("instance.endpointUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "instance.node-count" => Some(("instance.nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "instance.config" => Some(("instance.config", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "display-name", "instance", "instance-id", "labels", "name", "node-count", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "display-name", "endpoint-uris", "instance", "instance-id", "labels", "name", "node-count", "state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -248,6 +1141,68 @@ impl<'n> Engine<'n> { } } + fn _projects_instances_database_operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_database_operations_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_instances_databases_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -513,8 +1468,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -851,6 +1807,181 @@ impl<'n> Engine<'n> { } } + fn _projects_instances_databases_restore(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "database-id" => Some(("databaseId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "backup" => Some(("backup", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["backup", "database-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RestoreDatabaseRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_restore(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_databases_sessions_batch_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "session-count" => Some(("sessionCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "session-template.labels" => Some(("sessionTemplate.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "session-template.create-time" => Some(("sessionTemplate.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "session-template.approximate-last-use-time" => Some(("sessionTemplate.approximateLastUseTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "session-template.name" => Some(("sessionTemplate.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["approximate-last-use-time", "create-time", "labels", "name", "session-count", "session-template"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchCreateSessionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_databases_sessions_batch_create(request, opt.value_of("database").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_instances_databases_sessions_begin_transaction(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1309,10 +2440,11 @@ impl<'n> Engine<'n> { "seqno" => Some(("seqno", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resume-token" => Some(("resumeToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "partition-token" => Some(("partitionToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-options.optimizer-version" => Some(("queryOptions.optimizerVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-mode" => Some(("queryMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sql" => Some(("sql", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["begin", "exact-staleness", "id", "max-staleness", "min-read-timestamp", "partition-token", "query-mode", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "seqno", "single-use", "sql", "strong", "transaction"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["begin", "exact-staleness", "id", "max-staleness", "min-read-timestamp", "optimizer-version", "partition-token", "query-mode", "query-options", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "seqno", "single-use", "sql", "strong", "transaction"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1411,10 +2543,11 @@ impl<'n> Engine<'n> { "seqno" => Some(("seqno", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "resume-token" => Some(("resumeToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "partition-token" => Some(("partitionToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "query-options.optimizer-version" => Some(("queryOptions.optimizerVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "query-mode" => Some(("queryMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sql" => Some(("sql", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["begin", "exact-staleness", "id", "max-staleness", "min-read-timestamp", "partition-token", "query-mode", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "seqno", "single-use", "sql", "strong", "transaction"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["begin", "exact-staleness", "id", "max-staleness", "min-read-timestamp", "optimizer-version", "partition-token", "query-mode", "query-options", "read-only", "read-timestamp", "resume-token", "return-read-timestamp", "seqno", "single-use", "sql", "strong", "transaction"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2399,6 +3532,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "field-mask" => { + call = call.field_mask(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2412,6 +3548,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["field-mask"].iter().map(|v|*v)); v } )); } } @@ -2468,8 +3605,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "options.requested-policy-version" => Some(("options.requestedPolicyVersion", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["options", "requested-policy-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2836,11 +3974,12 @@ impl<'n> Engine<'n> { "instance.name" => Some(("instance.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "instance.labels" => Some(("instance.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "instance.state" => Some(("instance.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "instance.endpoint-uris" => Some(("instance.endpointUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "instance.node-count" => Some(("instance.nodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "instance.config" => Some(("instance.config", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "field-mask" => Some(("fieldMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "display-name", "field-mask", "instance", "labels", "name", "node-count", "state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "display-name", "endpoint-uris", "field-mask", "instance", "labels", "name", "node-count", "state"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3084,9 +4223,51 @@ impl<'n> Engine<'n> { ("instance-configs-list", Some(opt)) => { call_result = self._projects_instance_configs_list(opt, dry_run, &mut err); }, + ("instances-backup-operations-list", Some(opt)) => { + call_result = self._projects_instances_backup_operations_list(opt, dry_run, &mut err); + }, + ("instances-backups-create", Some(opt)) => { + call_result = self._projects_instances_backups_create(opt, dry_run, &mut err); + }, + ("instances-backups-delete", Some(opt)) => { + call_result = self._projects_instances_backups_delete(opt, dry_run, &mut err); + }, + ("instances-backups-get", Some(opt)) => { + call_result = self._projects_instances_backups_get(opt, dry_run, &mut err); + }, + ("instances-backups-get-iam-policy", Some(opt)) => { + call_result = self._projects_instances_backups_get_iam_policy(opt, dry_run, &mut err); + }, + ("instances-backups-list", Some(opt)) => { + call_result = self._projects_instances_backups_list(opt, dry_run, &mut err); + }, + ("instances-backups-operations-cancel", Some(opt)) => { + call_result = self._projects_instances_backups_operations_cancel(opt, dry_run, &mut err); + }, + ("instances-backups-operations-delete", Some(opt)) => { + call_result = self._projects_instances_backups_operations_delete(opt, dry_run, &mut err); + }, + ("instances-backups-operations-get", Some(opt)) => { + call_result = self._projects_instances_backups_operations_get(opt, dry_run, &mut err); + }, + ("instances-backups-operations-list", Some(opt)) => { + call_result = self._projects_instances_backups_operations_list(opt, dry_run, &mut err); + }, + ("instances-backups-patch", Some(opt)) => { + call_result = self._projects_instances_backups_patch(opt, dry_run, &mut err); + }, + ("instances-backups-set-iam-policy", Some(opt)) => { + call_result = self._projects_instances_backups_set_iam_policy(opt, dry_run, &mut err); + }, + ("instances-backups-test-iam-permissions", Some(opt)) => { + call_result = self._projects_instances_backups_test_iam_permissions(opt, dry_run, &mut err); + }, ("instances-create", Some(opt)) => { call_result = self._projects_instances_create(opt, dry_run, &mut err); }, + ("instances-database-operations-list", Some(opt)) => { + call_result = self._projects_instances_database_operations_list(opt, dry_run, &mut err); + }, ("instances-databases-create", Some(opt)) => { call_result = self._projects_instances_databases_create(opt, dry_run, &mut err); }, @@ -3117,6 +4298,12 @@ impl<'n> Engine<'n> { ("instances-databases-operations-list", Some(opt)) => { call_result = self._projects_instances_databases_operations_list(opt, dry_run, &mut err); }, + ("instances-databases-restore", Some(opt)) => { + call_result = self._projects_instances_databases_restore(opt, dry_run, &mut err); + }, + ("instances-databases-sessions-batch-create", Some(opt)) => { + call_result = self._projects_instances_databases_sessions_batch_create(opt, dry_run, &mut err); + }, ("instances-databases-sessions-begin-transaction", Some(opt)) => { call_result = self._projects_instances_databases_sessions_begin_transaction(opt, dry_run, &mut err); }, @@ -3292,7 +4479,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'instance-configs-get', 'instance-configs-list', 'instances-create', 'instances-databases-create', 'instances-databases-drop-database', 'instances-databases-get', 'instances-databases-get-ddl', 'instances-databases-get-iam-policy', 'instances-databases-list', 'instances-databases-operations-cancel', 'instances-databases-operations-delete', 'instances-databases-operations-get', 'instances-databases-operations-list', 'instances-databases-sessions-begin-transaction', 'instances-databases-sessions-commit', 'instances-databases-sessions-create', 'instances-databases-sessions-delete', 'instances-databases-sessions-execute-batch-dml', 'instances-databases-sessions-execute-sql', 'instances-databases-sessions-execute-streaming-sql', 'instances-databases-sessions-get', 'instances-databases-sessions-list', 'instances-databases-sessions-partition-query', 'instances-databases-sessions-partition-read', 'instances-databases-sessions-read', 'instances-databases-sessions-rollback', 'instances-databases-sessions-streaming-read', 'instances-databases-set-iam-policy', 'instances-databases-test-iam-permissions', 'instances-databases-update-ddl', 'instances-delete', 'instances-get', 'instances-get-iam-policy', 'instances-list', 'instances-operations-cancel', 'instances-operations-delete', 'instances-operations-get', 'instances-operations-list', 'instances-patch', 'instances-set-iam-policy' and 'instances-test-iam-permissions'", vec![ + ("projects", "methods: 'instance-configs-get', 'instance-configs-list', 'instances-backup-operations-list', 'instances-backups-create', 'instances-backups-delete', 'instances-backups-get', 'instances-backups-get-iam-policy', 'instances-backups-list', 'instances-backups-operations-cancel', 'instances-backups-operations-delete', 'instances-backups-operations-get', 'instances-backups-operations-list', 'instances-backups-patch', 'instances-backups-set-iam-policy', 'instances-backups-test-iam-permissions', 'instances-create', 'instances-database-operations-list', 'instances-databases-create', 'instances-databases-drop-database', 'instances-databases-get', 'instances-databases-get-ddl', 'instances-databases-get-iam-policy', 'instances-databases-list', 'instances-databases-operations-cancel', 'instances-databases-operations-delete', 'instances-databases-operations-get', 'instances-databases-operations-list', 'instances-databases-restore', 'instances-databases-sessions-batch-create', 'instances-databases-sessions-begin-transaction', 'instances-databases-sessions-commit', 'instances-databases-sessions-create', 'instances-databases-sessions-delete', 'instances-databases-sessions-execute-batch-dml', 'instances-databases-sessions-execute-sql', 'instances-databases-sessions-execute-streaming-sql', 'instances-databases-sessions-get', 'instances-databases-sessions-list', 'instances-databases-sessions-partition-query', 'instances-databases-sessions-partition-read', 'instances-databases-sessions-read', 'instances-databases-sessions-rollback', 'instances-databases-sessions-streaming-read', 'instances-databases-set-iam-policy', 'instances-databases-test-iam-permissions', 'instances-databases-update-ddl', 'instances-delete', 'instances-get', 'instances-get-iam-policy', 'instances-list', 'instances-operations-cancel', 'instances-operations-delete', 'instances-operations-get', 'instances-operations-list', 'instances-patch', 'instances-set-iam-policy' and 'instances-test-iam-permissions'", vec![ ("instance-configs-get", Some(r##"Gets information about a particular instance configuration."##), "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instance-configs-get", @@ -3334,6 +4521,412 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backup-operations-list", + Some(r##"Lists the backup long-running operations in + the given instance. A backup operation has a name of the form + `projects//instances//backups//operations/`. + The long-running operation + metadata field type + `metadata.type_url` describes the type of the metadata. Operations returned + include those that have completed/failed/canceled within the last 7 days, + and pending operations. Operations returned are ordered by + `operation.metadata.value.progress.start_time` in descending order starting + from the most recently started operation."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backup-operations-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The instance of the backup operations. Values are of + the form `projects//instances/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-create", + Some(r##"Starts creating a new Cloud Spanner Backup. + The returned backup long-running operation + will have a name of the format + `projects//instances//backups//operations/` + and can be used to track creation of the backup. The + metadata field type is + CreateBackupMetadata. The + response field type is + Backup, if successful. Cancelling the returned operation will stop the + creation and delete the backup. + There can be only one pending backup creation per database. Backup creation + of different databases can run concurrently."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the instance in which the backup will be + created. This must be the same instance that contains the database the + backup will be created from. The backup will be stored in the + location(s) specified in the instance configuration of this + instance. Values are of the form + `projects//instances/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-delete", + Some(r##"Deletes a pending or completed Backup."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the backup to delete. + Values are of the form + `projects//instances//backups/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-get", + Some(r##"Gets metadata on a pending or completed Backup."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. Name of the backup. + Values are of the form + `projects//instances//backups/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-get-iam-policy", + Some(r##"Gets the access control policy for a database or backup resource. + Returns an empty policy if a database or backup exists but does not have a + policy set. + + Authorization requires `spanner.databases.getIamPolicy` permission on + resource. + For backups, authorization requires `spanner.backups.getIamPolicy` + permission on resource."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-list", + Some(r##"Lists completed and pending backups. + Backups returned are ordered by `create_time` in descending order, + starting from the most recent `create_time`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The instance to list backups from. Values are of the + form `projects//instances/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-operations-cancel", + Some(r##"Starts asynchronous cancellation on a long-running operation. The server + makes a best effort to cancel the operation, but success is not + guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. Clients can use + Operations.GetOperation or + other methods to check whether the cancellation succeeded or whether the + operation completed despite cancellation. On successful cancellation, + the operation is not deleted; instead, it becomes an operation with + an Operation.error value with a google.rpc.Status.code of 1, + corresponding to `Code.CANCELLED`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-operations-cancel", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be cancelled."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-operations-delete", + Some(r##"Deletes a long-running operation. This method indicates that the client is + no longer interested in the operation result. It does not cancel the + operation. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-operations-delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-operations-get", + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-operations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-operations-list", + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`. To + override the binding, API services can add a binding such as + `"/v1/{name=users/*}/operations"` to their service configuration. + For backwards compatibility, the default name includes the operations + collection id, however overriding users must ensure the name binding + is the parent resource, without the operations collection id."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-operations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation's parent resource."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-patch", + Some(r##"Updates a pending or completed Backup."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Output only for the CreateBackup operation. + Required for the UpdateBackup operation. + + A globally unique identifier for the backup which cannot be + changed. Values are of the form + `projects//instances//backups/a-z*[a-z0-9]` + The final segment of the name must be between 2 and 60 characters + in length. + + The backup is stored in the location(s) specified in the instance + configuration of the instance containing the backup, identified + by the prefix of the backup name of the form + `projects//instances/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-set-iam-policy", + Some(r##"Sets the access control policy on a database or backup resource. + Replaces any existing policy. + + Authorization requires `spanner.databases.setIamPolicy` + permission on resource. + For backups, authorization requires `spanner.backups.setIamPolicy` + permission on resource."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-backups-test-iam-permissions", + Some(r##"Returns permissions that the caller has on the specified database or backup + resource. + + Attempting this RPC on a non-existent Cloud Spanner database will + result in a NOT_FOUND error if the user has + `spanner.databases.list` permission on the containing Cloud + Spanner instance. Otherwise returns an empty set of permissions. + Calling this method on a backup that does not exist will + result in a NOT_FOUND error if the user has + `spanner.backups.list` permission on the containing instance."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-backups-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3396,6 +4989,36 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-database-operations-list", + Some(r##"Lists database longrunning-operations. + A database operation has a name of the form + `projects//instances//databases//operations/`. + The long-running operation + metadata field type + `metadata.type_url` describes the type of the metadata. Operations returned + include those that have completed/failed/canceled within the last 7 days, + and pending operations."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-database-operations-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The instance of the database operations. + Values are of the form `projects//instances/`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3439,7 +5062,9 @@ fn main() { Some(false)), ]), ("instances-databases-drop-database", - Some(r##"Drops (aka deletes) a Cloud Spanner database."##), + Some(r##"Drops (aka deletes) a Cloud Spanner database. + Completed backups for the database will be retained according to their + `expire_time`."##), "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-drop-database", vec![ (Some(r##"database"##), @@ -3508,12 +5133,14 @@ fn main() { Some(false)), ]), ("instances-databases-get-iam-policy", - Some(r##"Gets the access control policy for a database resource. - Returns an empty policy if a database exists but does - not have a policy set. + Some(r##"Gets the access control policy for a database or backup resource. + Returns an empty policy if a database or backup exists but does not have a + policy set. Authorization requires `spanner.databases.getIamPolicy` permission on - resource."##), + resource. + For backups, authorization requires `spanner.backups.getIamPolicy` + permission on resource."##), "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-get-iam-policy", vec![ (Some(r##"resource"##), @@ -3668,6 +5295,85 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-databases-restore", + Some(r##"Create a new database by restoring from a completed backup. The new + database must be in the same project and in an instance with the same + instance configuration as the instance containing + the backup. The returned database long-running + operation has a name of the format + `projects//instances//databases//operations/`, + and can be used to track the progress of the operation, and to cancel it. + The metadata field type is + RestoreDatabaseMetadata. + The response type + is Database, if + successful. Cancelling the returned operation will stop the restore and + delete the database. + There can be only one database being restored into an instance at a time. + Once the restore operation completes, a new restore operation can be + initiated, without waiting for the optimize operation associated with the + first restore to complete."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-restore", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the instance in which to create the + restored database. This instance must be in the same project and + have the same instance configuration as the instance containing + the source backup. Values are of the form + `projects//instances/`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-databases-sessions-batch-create", + Some(r##"Creates multiple new sessions. + + This API can be used to initialize a session cache on the clients. + See https://goo.gl/TgSFN2 for best practices on session cache management."##), + "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-batch-create", + vec![ + (Some(r##"database"##), + None, + Some(r##"Required. The database in which the new sessions are created."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3752,9 +5458,9 @@ fn main() { transaction internally, and count toward the one transaction limit. - Cloud Spanner limits the number of sessions that can exist at any given - time; thus, it is a good idea to delete idle and/or unneeded sessions. - Aside from explicit deletes, Cloud Spanner can delete sessions for which no + Active sessions use additional server resources, so it is a good idea to + delete idle and unneeded sessions. + Aside from explicit deletes, Cloud Spanner may delete sessions for which no operations are sent for more than an hour. If a session is deleted, requests to it return `NOT_FOUND`. @@ -3815,21 +5521,13 @@ fn main() { to be run with lower latency than submitting them sequentially with ExecuteSql. - Statements are executed in order, sequentially. - ExecuteBatchDmlResponse will contain a - ResultSet for each DML statement that has successfully executed. If a - statement fails, its error status will be returned as part of the - ExecuteBatchDmlResponse. Execution will - stop at the first failed statement; the remaining statements will not run. + Statements are executed in sequential order. A request can succeed even if + a statement fails. The ExecuteBatchDmlResponse.status field in the + response provides information about the statement that failed. Clients must + inspect this field to determine whether an error occurred. - ExecuteBatchDml is expected to return an OK status with a response even if - there was an error while processing one of the DML statements. Clients must - inspect response.status to determine if there were any errors while - processing the request. - - See more details in - ExecuteBatchDmlRequest and - ExecuteBatchDmlResponse."##), + Execution stops after the first failed statement; the remaining statements + are not executed."##), "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-sessions-execute-batch-dml", vec![ (Some(r##"session"##), @@ -4158,10 +5856,12 @@ fn main() { Some(false)), ]), ("instances-databases-set-iam-policy", - Some(r##"Sets the access control policy on a database resource. + Some(r##"Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` + permission on resource. + For backups, authorization requires `spanner.backups.setIamPolicy` permission on resource."##), "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-set-iam-policy", vec![ @@ -4190,12 +5890,16 @@ fn main() { Some(false)), ]), ("instances-databases-test-iam-permissions", - Some(r##"Returns permissions that the caller has on the specified database resource. + Some(r##"Returns permissions that the caller has on the specified database or backup + resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud - Spanner instance. Otherwise returns an empty set of permissions."##), + Spanner instance. Otherwise returns an empty set of permissions. + Calling this method on a backup that does not exist will + result in a NOT_FOUND error if the user has + `spanner.backups.list` permission on the containing instance."##), "Details at http://byron.github.io/google-apis-rs/google_spanner1_cli/projects_instances-databases-test-iam-permissions", vec![ (Some(r##"resource"##), @@ -4619,7 +6323,7 @@ fn main() { let mut app = App::new("spanner1") .author("Sebastian Thiel ") - .version("1.0.12+20190613") + .version("1.0.13+20200403") .about("Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_spanner1_cli") .arg(Arg::with_name("url") diff --git a/gen/spanner1/Cargo.toml b/gen/spanner1/Cargo.toml index 58c643c52c..c1cd2e7040 100644 --- a/gen/spanner1/Cargo.toml +++ b/gen/spanner1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-spanner1" -version = "1.0.12+20190613" +version = "1.0.13+20200403" authors = ["Sebastian Thiel "] description = "A complete library to interact with Spanner (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spanner1" homepage = "https://cloud.google.com/spanner/" -documentation = "https://docs.rs/google-spanner1/1.0.12+20190613" +documentation = "https://docs.rs/google-spanner1/1.0.13+20200403" license = "MIT" keywords = ["spanner", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/spanner1/README.md b/gen/spanner1/README.md index 77b5cf9cbf..28d15624c6 100644 --- a/gen/spanner1/README.md +++ b/gen/spanner1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-spanner1` library allows access to all features of the *Google Spanner* service. -This documentation was generated from *Spanner* crate version *1.0.12+20190613*, where *20190613* is the exact revision of the *spanner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Spanner* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *spanner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Spanner* *v1* API can be found at the [official documentation site](https://cloud.google.com/spanner/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.Spanner.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.Spanner.html) ... * projects - * [*instance configs get*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceConfigGetCall.html), [*instance configs list*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceConfigListCall.html), [*instances create*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceCreateCall.html), [*instances databases create*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseCreateCall.html), [*instances databases drop database*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseDropDatabaseCall.html), [*instances databases get*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseGetCall.html), [*instances databases get ddl*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseGetDdlCall.html), [*instances databases get iam policy*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseGetIamPolicyCall.html), [*instances databases list*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseListCall.html), [*instances databases operations cancel*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseOperationCancelCall.html), [*instances databases operations delete*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseOperationDeleteCall.html), [*instances databases operations get*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseOperationGetCall.html), [*instances databases operations list*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases sessions begin transaction*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html), [*instances databases sessions commit*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionCommitCall.html), [*instances databases sessions create*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionCreateCall.html), [*instances databases sessions delete*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionDeleteCall.html), [*instances databases sessions execute batch dml*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteBatchDmlCall.html), [*instances databases sessions execute sql*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html), [*instances databases sessions execute streaming sql*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html), [*instances databases sessions get*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionGetCall.html), [*instances databases sessions list*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionListCall.html), [*instances databases sessions partition query*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html), [*instances databases sessions partition read*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionPartitionReadCall.html), [*instances databases sessions read*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionReadCall.html), [*instances databases sessions rollback*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionRollbackCall.html), [*instances databases sessions streaming read*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSessionStreamingReadCall.html), [*instances databases set iam policy*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseSetIamPolicyCall.html), [*instances databases test iam permissions*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseTestIamPermissionCall.html), [*instances databases update ddl*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDatabaseUpdateDdlCall.html), [*instances delete*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceDeleteCall.html), [*instances get*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceGetCall.html), [*instances get iam policy*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceListCall.html), [*instances operations cancel*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceOperationCancelCall.html), [*instances operations delete*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceOperationDeleteCall.html), [*instances operations get*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceOperationGetCall.html), [*instances operations list*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceOperationListCall.html), [*instances patch*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstancePatchCall.html), [*instances set iam policy*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceSetIamPolicyCall.html) and [*instances test iam permissions*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.ProjectInstanceTestIamPermissionCall.html) + * [*instance configs get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceConfigGetCall.html), [*instance configs list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceConfigListCall.html), [*instances backup operations list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupOperationListCall.html), [*instances backups create*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupCreateCall.html), [*instances backups delete*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupDeleteCall.html), [*instances backups get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupGetCall.html), [*instances backups get iam policy*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupGetIamPolicyCall.html), [*instances backups list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupListCall.html), [*instances backups operations cancel*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupOperationCancelCall.html), [*instances backups operations delete*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupOperationDeleteCall.html), [*instances backups operations get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupOperationGetCall.html), [*instances backups operations list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupOperationListCall.html), [*instances backups patch*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupPatchCall.html), [*instances backups set iam policy*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupSetIamPolicyCall.html), [*instances backups test iam permissions*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceBackupTestIamPermissionCall.html), [*instances create*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceCreateCall.html), [*instances database operations list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases create*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseCreateCall.html), [*instances databases drop database*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseDropDatabaseCall.html), [*instances databases get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseGetCall.html), [*instances databases get ddl*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseGetDdlCall.html), [*instances databases get iam policy*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseGetIamPolicyCall.html), [*instances databases list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseListCall.html), [*instances databases operations cancel*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseOperationCancelCall.html), [*instances databases operations delete*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseOperationDeleteCall.html), [*instances databases operations get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseOperationGetCall.html), [*instances databases operations list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases restore*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseRestoreCall.html), [*instances databases sessions batch create*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionBatchCreateCall.html), [*instances databases sessions begin transaction*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html), [*instances databases sessions commit*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionCommitCall.html), [*instances databases sessions create*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionCreateCall.html), [*instances databases sessions delete*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionDeleteCall.html), [*instances databases sessions execute batch dml*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteBatchDmlCall.html), [*instances databases sessions execute sql*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html), [*instances databases sessions execute streaming sql*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html), [*instances databases sessions get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionGetCall.html), [*instances databases sessions list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionListCall.html), [*instances databases sessions partition query*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html), [*instances databases sessions partition read*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionPartitionReadCall.html), [*instances databases sessions read*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionReadCall.html), [*instances databases sessions rollback*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionRollbackCall.html), [*instances databases sessions streaming read*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSessionStreamingReadCall.html), [*instances databases set iam policy*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseSetIamPolicyCall.html), [*instances databases test iam permissions*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseTestIamPermissionCall.html), [*instances databases update ddl*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDatabaseUpdateDdlCall.html), [*instances delete*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceDeleteCall.html), [*instances get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceGetCall.html), [*instances get iam policy*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceListCall.html), [*instances operations cancel*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceOperationCancelCall.html), [*instances operations delete*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceOperationDeleteCall.html), [*instances operations get*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceOperationGetCall.html), [*instances operations list*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceOperationListCall.html), [*instances patch*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstancePatchCall.html), [*instances set iam policy*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceSetIamPolicyCall.html) and [*instances test iam permissions*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.ProjectInstanceTestIamPermissionCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/struct.Spanner.html)** +* **[Hub](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/struct.Spanner.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.Part.html)** + * **[Parts](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -48,6 +48,8 @@ Or specifically ... ```ignore let r = hub.projects().instances_databases_operations_cancel(...).doit() +let r = hub.projects().instances_backups_operations_delete(...).doit() +let r = hub.projects().instances_backups_operations_cancel(...).doit() let r = hub.projects().instances_databases_drop_database(...).doit() let r = hub.projects().instances_operations_delete(...).doit() let r = hub.projects().instances_databases_operations_delete(...).doit() @@ -55,6 +57,7 @@ let r = hub.projects().instances_delete(...).doit() let r = hub.projects().instances_operations_cancel(...).doit() let r = hub.projects().instances_databases_sessions_rollback(...).doit() let r = hub.projects().instances_databases_sessions_delete(...).doit() +let r = hub.projects().instances_backups_delete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -137,17 +140,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -157,29 +160,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-spanner1/1.0.12+20190613/google_spanner1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-spanner1/1.0.13+20200403/google_spanner1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/spanner1/src/lib.rs b/gen/spanner1/src/lib.rs index 0351ed96d1..2f9810c1a2 100644 --- a/gen/spanner1/src/lib.rs +++ b/gen/spanner1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Spanner* crate version *1.0.12+20190613*, where *20190613* is the exact revision of the *spanner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Spanner* crate version *1.0.13+20200403*, where *20200403* is the exact revision of the *spanner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Spanner* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/spanner/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Spanner.html) ... //! //! * projects -//! * [*instance configs get*](struct.ProjectInstanceConfigGetCall.html), [*instance configs list*](struct.ProjectInstanceConfigListCall.html), [*instances create*](struct.ProjectInstanceCreateCall.html), [*instances databases create*](struct.ProjectInstanceDatabaseCreateCall.html), [*instances databases drop database*](struct.ProjectInstanceDatabaseDropDatabaseCall.html), [*instances databases get*](struct.ProjectInstanceDatabaseGetCall.html), [*instances databases get ddl*](struct.ProjectInstanceDatabaseGetDdlCall.html), [*instances databases get iam policy*](struct.ProjectInstanceDatabaseGetIamPolicyCall.html), [*instances databases list*](struct.ProjectInstanceDatabaseListCall.html), [*instances databases operations cancel*](struct.ProjectInstanceDatabaseOperationCancelCall.html), [*instances databases operations delete*](struct.ProjectInstanceDatabaseOperationDeleteCall.html), [*instances databases operations get*](struct.ProjectInstanceDatabaseOperationGetCall.html), [*instances databases operations list*](struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases sessions begin transaction*](struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html), [*instances databases sessions commit*](struct.ProjectInstanceDatabaseSessionCommitCall.html), [*instances databases sessions create*](struct.ProjectInstanceDatabaseSessionCreateCall.html), [*instances databases sessions delete*](struct.ProjectInstanceDatabaseSessionDeleteCall.html), [*instances databases sessions execute batch dml*](struct.ProjectInstanceDatabaseSessionExecuteBatchDmlCall.html), [*instances databases sessions execute sql*](struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html), [*instances databases sessions execute streaming sql*](struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html), [*instances databases sessions get*](struct.ProjectInstanceDatabaseSessionGetCall.html), [*instances databases sessions list*](struct.ProjectInstanceDatabaseSessionListCall.html), [*instances databases sessions partition query*](struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html), [*instances databases sessions partition read*](struct.ProjectInstanceDatabaseSessionPartitionReadCall.html), [*instances databases sessions read*](struct.ProjectInstanceDatabaseSessionReadCall.html), [*instances databases sessions rollback*](struct.ProjectInstanceDatabaseSessionRollbackCall.html), [*instances databases sessions streaming read*](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html), [*instances databases set iam policy*](struct.ProjectInstanceDatabaseSetIamPolicyCall.html), [*instances databases test iam permissions*](struct.ProjectInstanceDatabaseTestIamPermissionCall.html), [*instances databases update ddl*](struct.ProjectInstanceDatabaseUpdateDdlCall.html), [*instances delete*](struct.ProjectInstanceDeleteCall.html), [*instances get*](struct.ProjectInstanceGetCall.html), [*instances get iam policy*](struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](struct.ProjectInstanceListCall.html), [*instances operations cancel*](struct.ProjectInstanceOperationCancelCall.html), [*instances operations delete*](struct.ProjectInstanceOperationDeleteCall.html), [*instances operations get*](struct.ProjectInstanceOperationGetCall.html), [*instances operations list*](struct.ProjectInstanceOperationListCall.html), [*instances patch*](struct.ProjectInstancePatchCall.html), [*instances set iam policy*](struct.ProjectInstanceSetIamPolicyCall.html) and [*instances test iam permissions*](struct.ProjectInstanceTestIamPermissionCall.html) +//! * [*instance configs get*](struct.ProjectInstanceConfigGetCall.html), [*instance configs list*](struct.ProjectInstanceConfigListCall.html), [*instances backup operations list*](struct.ProjectInstanceBackupOperationListCall.html), [*instances backups create*](struct.ProjectInstanceBackupCreateCall.html), [*instances backups delete*](struct.ProjectInstanceBackupDeleteCall.html), [*instances backups get*](struct.ProjectInstanceBackupGetCall.html), [*instances backups get iam policy*](struct.ProjectInstanceBackupGetIamPolicyCall.html), [*instances backups list*](struct.ProjectInstanceBackupListCall.html), [*instances backups operations cancel*](struct.ProjectInstanceBackupOperationCancelCall.html), [*instances backups operations delete*](struct.ProjectInstanceBackupOperationDeleteCall.html), [*instances backups operations get*](struct.ProjectInstanceBackupOperationGetCall.html), [*instances backups operations list*](struct.ProjectInstanceBackupOperationListCall.html), [*instances backups patch*](struct.ProjectInstanceBackupPatchCall.html), [*instances backups set iam policy*](struct.ProjectInstanceBackupSetIamPolicyCall.html), [*instances backups test iam permissions*](struct.ProjectInstanceBackupTestIamPermissionCall.html), [*instances create*](struct.ProjectInstanceCreateCall.html), [*instances database operations list*](struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases create*](struct.ProjectInstanceDatabaseCreateCall.html), [*instances databases drop database*](struct.ProjectInstanceDatabaseDropDatabaseCall.html), [*instances databases get*](struct.ProjectInstanceDatabaseGetCall.html), [*instances databases get ddl*](struct.ProjectInstanceDatabaseGetDdlCall.html), [*instances databases get iam policy*](struct.ProjectInstanceDatabaseGetIamPolicyCall.html), [*instances databases list*](struct.ProjectInstanceDatabaseListCall.html), [*instances databases operations cancel*](struct.ProjectInstanceDatabaseOperationCancelCall.html), [*instances databases operations delete*](struct.ProjectInstanceDatabaseOperationDeleteCall.html), [*instances databases operations get*](struct.ProjectInstanceDatabaseOperationGetCall.html), [*instances databases operations list*](struct.ProjectInstanceDatabaseOperationListCall.html), [*instances databases restore*](struct.ProjectInstanceDatabaseRestoreCall.html), [*instances databases sessions batch create*](struct.ProjectInstanceDatabaseSessionBatchCreateCall.html), [*instances databases sessions begin transaction*](struct.ProjectInstanceDatabaseSessionBeginTransactionCall.html), [*instances databases sessions commit*](struct.ProjectInstanceDatabaseSessionCommitCall.html), [*instances databases sessions create*](struct.ProjectInstanceDatabaseSessionCreateCall.html), [*instances databases sessions delete*](struct.ProjectInstanceDatabaseSessionDeleteCall.html), [*instances databases sessions execute batch dml*](struct.ProjectInstanceDatabaseSessionExecuteBatchDmlCall.html), [*instances databases sessions execute sql*](struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html), [*instances databases sessions execute streaming sql*](struct.ProjectInstanceDatabaseSessionExecuteStreamingSqlCall.html), [*instances databases sessions get*](struct.ProjectInstanceDatabaseSessionGetCall.html), [*instances databases sessions list*](struct.ProjectInstanceDatabaseSessionListCall.html), [*instances databases sessions partition query*](struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html), [*instances databases sessions partition read*](struct.ProjectInstanceDatabaseSessionPartitionReadCall.html), [*instances databases sessions read*](struct.ProjectInstanceDatabaseSessionReadCall.html), [*instances databases sessions rollback*](struct.ProjectInstanceDatabaseSessionRollbackCall.html), [*instances databases sessions streaming read*](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html), [*instances databases set iam policy*](struct.ProjectInstanceDatabaseSetIamPolicyCall.html), [*instances databases test iam permissions*](struct.ProjectInstanceDatabaseTestIamPermissionCall.html), [*instances databases update ddl*](struct.ProjectInstanceDatabaseUpdateDdlCall.html), [*instances delete*](struct.ProjectInstanceDeleteCall.html), [*instances get*](struct.ProjectInstanceGetCall.html), [*instances get iam policy*](struct.ProjectInstanceGetIamPolicyCall.html), [*instances list*](struct.ProjectInstanceListCall.html), [*instances operations cancel*](struct.ProjectInstanceOperationCancelCall.html), [*instances operations delete*](struct.ProjectInstanceOperationDeleteCall.html), [*instances operations get*](struct.ProjectInstanceOperationGetCall.html), [*instances operations list*](struct.ProjectInstanceOperationListCall.html), [*instances patch*](struct.ProjectInstancePatchCall.html), [*instances set iam policy*](struct.ProjectInstanceSetIamPolicyCall.html) and [*instances test iam permissions*](struct.ProjectInstanceTestIamPermissionCall.html) //! //! //! @@ -48,6 +48,8 @@ //! //! ```ignore //! let r = hub.projects().instances_databases_operations_cancel(...).doit() +//! let r = hub.projects().instances_backups_operations_delete(...).doit() +//! let r = hub.projects().instances_backups_operations_cancel(...).doit() //! let r = hub.projects().instances_databases_drop_database(...).doit() //! let r = hub.projects().instances_operations_delete(...).doit() //! let r = hub.projects().instances_databases_operations_delete(...).doit() @@ -55,6 +57,7 @@ //! let r = hub.projects().instances_operations_cancel(...).doit() //! let r = hub.projects().instances_databases_sessions_rollback(...).doit() //! let r = hub.projects().instances_databases_sessions_delete(...).doit() +//! let r = hub.projects().instances_backups_delete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -344,7 +347,7 @@ impl<'a, C, A> Spanner Spanner { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://spanner.googleapis.com/".to_string(), _root_url: "https://spanner.googleapis.com/".to_string(), } @@ -355,7 +358,7 @@ impl<'a, C, A> Spanner } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -383,6 +386,48 @@ impl<'a, C, A> Spanner // ############ // SCHEMAS ### // ########## +/// The response for BatchCreateSessions. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions batch create projects](struct.ProjectInstanceDatabaseSessionBatchCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchCreateSessionsResponse { + /// The freshly created sessions. + pub session: Option>, +} + +impl ResponseResult for BatchCreateSessionsResponse {} + + +/// The response for ListBackups. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances backups list projects](struct.ProjectInstanceBackupListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListBackupsResponse { + /// `next_page_token` can be sent in a subsequent + /// ListBackups call to fetch more + /// of the matching backups. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching backups. Backups returned are ordered by `create_time` + /// in descending order, starting from the most recent `create_time`. + pub backups: Option>, +} + +impl ResponseResult for ListBackupsResponse {} + + /// The response for ListSessions. /// /// # Activities @@ -450,8 +495,12 @@ pub struct Instance { /// `projects//instances/a-z*[a-z0-9]`. The final /// segment of the name must be between 2 and 64 characters in length. pub name: Option, - /// Required. The number of nodes allocated to this instance. This may be zero - /// in API responses for instances that are not yet in state `READY`. + /// Deprecated. This field is not populated. + #[serde(rename="endpointUris")] + pub endpoint_uris: Option>, + /// The number of nodes allocated to this instance. This + /// may be zero in API responses for instances that are not yet in state + /// `READY`. /// /// See [the /// documentation](https://cloud.google.com/spanner/docs/instances#node_count) @@ -641,6 +690,10 @@ pub struct Mutation { /// Like insert, except that if the row already exists, then /// its column values are overwritten with the ones provided. Any /// column values not explicitly written are preserved. + /// + /// When using insert_or_update, just as when using insert, all `NOT + /// NULL` columns in the table must be given a value. This holds true + /// even when the row already exists and will therefore actually be updated. #[serde(rename="insertOrUpdate")] pub insert_or_update: Option, /// Update existing rows in a table. If any of the rows does not @@ -650,6 +703,11 @@ pub struct Mutation { /// deleted, and the column values provided are inserted /// instead. Unlike insert_or_update, this means any values not /// explicitly written become `NULL`. + /// + /// In an interleaved table, if you create the child table with the + /// `ON DELETE CASCADE` annotation, then replacing a parent row + /// also deletes the child rows. Otherwise, you must delete the + /// child rows before you replace the parent row. pub replace: Option, } @@ -672,20 +730,18 @@ pub struct Statement { /// about SQL types. #[serde(rename="paramTypes")] pub param_types: Option>, - /// The DML string can contain parameter placeholders. A parameter - /// placeholder consists of `'@'` followed by the parameter - /// name. Parameter names consist of any combination of letters, - /// numbers, and underscores. + /// Parameter names and values that bind to placeholders in the DML string. + /// + /// A parameter placeholder consists of the `@` character followed by the + /// parameter name (for example, `@firstName`). Parameter names can contain + /// letters, numbers, and underscores. /// /// Parameters can appear anywhere that a literal value is expected. The /// same parameter name can be used more than once, for example: - /// `"WHERE id > @msg_id AND id < @msg_id + 100"` /// - /// It is an error to execute an SQL statement with unbound parameters. + /// `"WHERE id > @msg_id AND id < @msg_id + 100"` /// - /// Parameter values are specified using `params`, which is a JSON - /// object whose keys are parameter names, and whose values are the - /// corresponding parameter values. + /// It is an error to execute a SQL statement with unbound parameters. pub params: Option>, /// Required. The DML string. pub sql: Option, @@ -694,28 +750,6 @@ pub struct Statement { impl Part for Statement {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReplicaInfo { - /// If true, this location is designated as the default leader location where - /// leader replicas are placed. See the [region types - /// documentation](https://cloud.google.com/spanner/docs/instances#region_types) - /// for more details. - #[serde(rename="defaultLeaderLocation")] - pub default_leader_location: Option, - /// The type of replica. - #[serde(rename="type")] - pub type_: Option, - /// The location of the serving resources, e.g. "us-central1". - pub location: Option, -} - -impl Part for ReplicaInfo {} - - /// A generic empty message that you can re-use to avoid defining duplicated /// empty messages in your APIs. A typical example is to use it as the request /// or the response type of an API method. For instance: @@ -734,6 +768,8 @@ impl Part for ReplicaInfo {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [instances databases operations cancel projects](struct.ProjectInstanceDatabaseOperationCancelCall.html) (response) +/// * [instances backups operations delete projects](struct.ProjectInstanceBackupOperationDeleteCall.html) (response) +/// * [instances backups operations cancel projects](struct.ProjectInstanceBackupOperationCancelCall.html) (response) /// * [instances databases drop database projects](struct.ProjectInstanceDatabaseDropDatabaseCall.html) (response) /// * [instances operations delete projects](struct.ProjectInstanceOperationDeleteCall.html) (response) /// * [instances databases operations delete projects](struct.ProjectInstanceDatabaseOperationDeleteCall.html) (response) @@ -741,1219 +777,13 @@ impl Part for ReplicaInfo {} /// * [instances operations cancel projects](struct.ProjectInstanceOperationCancelCall.html) (response) /// * [instances databases sessions rollback projects](struct.ProjectInstanceDatabaseSessionRollbackCall.html) (response) /// * [instances databases sessions delete projects](struct.ProjectInstanceDatabaseSessionDeleteCall.html) (response) +/// * [instances backups delete projects](struct.ProjectInstanceBackupDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } impl ResponseResult for Empty {} -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](https://github.com/grpc). Each `Status` message contains -/// three pieces of data: error code, error message, and error details. -/// -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Status { - /// A developer-facing error message, which should be in English. Any - /// user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - pub message: Option, - /// The status code, which should be an enum value of google.rpc.Code. - pub code: Option, - /// A list of messages that carry the error details. There is a common set of - /// message types for APIs to use. - pub details: Option>>, -} - -impl Part for Status {} - - -/// Response message for `TestIamPermissions` method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases test iam permissions projects](struct.ProjectInstanceDatabaseTestIamPermissionCall.html) (response) -/// * [instances test iam permissions projects](struct.ProjectInstanceTestIamPermissionCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is - /// allowed. - pub permissions: Option>, -} - -impl ResponseResult for TestIamPermissionsResponse {} - - -/// The request for CreateInstance. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances create projects](struct.ProjectInstanceCreateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateInstanceRequest { - /// Required. The ID of the instance to create. Valid identifiers are of the - /// form `a-z*[a-z0-9]` and must be between 2 and 64 characters in - /// length. - #[serde(rename="instanceId")] - pub instance_id: Option, - /// Required. The instance to create. The name may be omitted, but if - /// specified must be `/instances/`. - pub instance: Option, -} - -impl RequestValue for CreateInstanceRequest {} - - -/// `StructType` defines the fields of a STRUCT type. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StructType { - /// The list of fields that make up this struct. Order is - /// significant, because values of this struct type are represented as - /// lists, where the order of field values matches the order of - /// fields in the StructType. In turn, the order of fields - /// matches the order of columns in a read request, or the order of - /// fields in the `SELECT` clause of a query. - pub fields: Option>, -} - -impl Part for StructType {} - - -/// Request message for `GetIamPolicy` method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (request) -/// * [instances databases get iam policy projects](struct.ProjectInstanceDatabaseGetIamPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetIamPolicyRequest { _never_set: Option } - -impl RequestValue for GetIamPolicyRequest {} - - -/// A Cloud Spanner database. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases get projects](struct.ProjectInstanceDatabaseGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Database { - /// Output only. The current database state. - pub state: Option, - /// Required. The name of the database. Values are of the form - /// `projects//instances//databases/`, - /// where `` is as specified in the `CREATE DATABASE` - /// statement. This name can be passed to other API methods to - /// identify the database. - pub name: Option, -} - -impl ResponseResult for Database {} - - -/// The response for ExecuteBatchDml. Contains a list -/// of ResultSet, one for each DML statement that has successfully executed. -/// If a statement fails, the error is returned as part of the response payload. -/// Clients can determine whether all DML statements have run successfully, or if -/// a statement failed, using one of the following approaches: -/// -/// 1. Check if `'status'` field is `OkStatus`. -/// 1. Check if `result_sets_size()` equals the number of statements in -/// ExecuteBatchDmlRequest. -/// -/// Example 1: A request with 5 DML statements, all executed successfully. -/// -/// Result: A response with 5 ResultSets, one for each statement in the same -/// order, and an `OkStatus`. -/// -/// Example 2: A request with 5 DML statements. The 3rd statement has a syntax -/// error. -/// -/// Result: A response with 2 ResultSets, for the first 2 statements that -/// run successfully, and a syntax error (`INVALID_ARGUMENT`) status. From -/// `result_set_size()` client can determine that the 3rd statement has failed. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions execute batch dml projects](struct.ProjectInstanceDatabaseSessionExecuteBatchDmlCall.html) (response) -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ExecuteBatchDmlResponse { - /// If all DML statements are executed successfully, status will be OK. - /// Otherwise, the error status of the first failed statement. - pub status: Option, - /// ResultSets, one for each statement in the request that ran successfully, in - /// the same order as the statements in the request. Each ResultSet will - /// not contain any rows. The ResultSetStats in each ResultSet will - /// contain the number of rows modified by the statement. - /// - /// Only the first ResultSet in the response contains a valid - /// ResultSetMetadata. - #[serde(rename="resultSets")] - pub result_sets: Option>, -} - -impl ResponseResult for ExecuteBatchDmlResponse {} - - -/// The response for GetDatabaseDdl. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases get ddl projects](struct.ProjectInstanceDatabaseGetDdlCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetDatabaseDdlResponse { - /// A list of formatted DDL statements defining the schema of the database - /// specified in the request. - pub statements: Option>, -} - -impl ResponseResult for GetDatabaseDdlResponse {} - - -/// The response for PartitionQuery -/// or PartitionRead -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions partition query projects](struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html) (response) -/// * [instances databases sessions partition read projects](struct.ProjectInstanceDatabaseSessionPartitionReadCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PartitionResponse { - /// Transaction created by this request. - pub transaction: Option, - /// Partitions created by this request. - pub partitions: Option>, -} - -impl ResponseResult for PartitionResponse {} - - -/// The request for PartitionRead -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions partition read projects](struct.ProjectInstanceDatabaseSessionPartitionReadCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PartitionReadRequest { - /// If non-empty, the name of an index on table. This index is - /// used instead of the table primary key when interpreting key_set - /// and sorting result rows. See key_set for further information. - pub index: Option, - /// Read only snapshot transactions are supported, read/write and single use - /// transactions are not. - pub transaction: Option, - /// Required. `key_set` identifies the rows to be yielded. `key_set` names the - /// primary keys of the rows in table to be yielded, unless index - /// is present. If index is present, then key_set instead names - /// index keys in index. - /// - /// It is not an error for the `key_set` to name rows that do not - /// exist in the database. Read yields nothing for nonexistent rows. - #[serde(rename="keySet")] - pub key_set: Option, - /// Additional options that affect how many partitions are created. - #[serde(rename="partitionOptions")] - pub partition_options: Option, - /// Required. The name of the table in the database to be read. - pub table: Option, - /// The columns of table to be returned for each row matching - /// this request. - pub columns: Option>, -} - -impl RequestValue for PartitionReadRequest {} - - -/// This message is used to select the transaction in which a -/// Read or -/// ExecuteSql call runs. -/// -/// See TransactionOptions for more information about transactions. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TransactionSelector { - /// Begin a new transaction and execute this read or SQL query in - /// it. The transaction ID of the new transaction is returned in - /// ResultSetMetadata.transaction, which is a Transaction. - pub begin: Option, - /// Execute the read or SQL query in a temporary transaction. - /// This is the most efficient way to execute a transaction that - /// consists of a single SQL query. - #[serde(rename="singleUse")] - pub single_use: Option, - /// Execute the read or SQL query in a previously-started transaction. - pub id: Option, -} - -impl Part for TransactionSelector {} - - -/// Message type to initiate a read-write transaction. Currently this -/// transaction type has no options. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReadWrite { _never_set: Option } - -impl Part for ReadWrite {} - - -/// Associates `members` with a `role`. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Binding { - /// Role that is assigned to `members`. - /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - pub role: Option, - /// The condition that is associated with this binding. - /// NOTE: An unsatisfied condition will not allow user access via current - /// binding. Different bindings, including their conditions, are examined - /// independently. - pub condition: Option, - /// Specifies the identities requesting access for a Cloud Platform resource. - /// `members` can have the following values: - /// - /// * `allUsers`: A special identifier that represents anyone who is - /// on the internet; with or without a Google account. - /// - /// * `allAuthenticatedUsers`: A special identifier that represents anyone - /// who is authenticated with a Google account or a service account. - /// - /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` . - /// - /// - /// * `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. - /// - /// * `group:{emailid}`: An email address that represents a Google group. - /// For example, `admins@example.com`. - /// - /// - /// * `domain:{domain}`: The G Suite domain (primary) that represents all the - /// users of that domain. For example, `google.com` or `example.com`. - /// - /// - pub members: Option>, -} - -impl Part for Binding {} - - -/// Message type to initiate a Partitioned DML transaction. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PartitionedDml { _never_set: Option } - -impl Part for PartitionedDml {} - - -/// The request for CreateDatabase. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases create projects](struct.ProjectInstanceDatabaseCreateCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateDatabaseRequest { - /// An optional list of DDL statements to run inside the newly created - /// database. Statements can create tables, indexes, etc. These - /// statements execute atomically with the creation of the database: - /// if there is an error in any statement, the database is not created. - #[serde(rename="extraStatements")] - pub extra_statements: Option>, - /// Required. A `CREATE DATABASE` statement, which specifies the ID of the - /// new database. The database ID must conform to the regular expression - /// `a-z*[a-z0-9]` and be between 2 and 30 characters in length. - /// If the database ID is a reserved word or if it contains a hyphen, the - /// database ID must be enclosed in backticks (`` ` ``). - #[serde(rename="createStatement")] - pub create_statement: Option, -} - -impl RequestValue for CreateDatabaseRequest {} - - -/// The request for Rollback. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions rollback projects](struct.ProjectInstanceDatabaseSessionRollbackCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RollbackRequest { - /// Required. The transaction to roll back. - #[serde(rename="transactionId")] - pub transaction_id: Option, -} - -impl RequestValue for RollbackRequest {} - - -/// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All -/// the keys are expected to be in the same table or index. The keys need -/// not be sorted in any particular way. -/// -/// If the same key is specified multiple times in the set (for example -/// if two ranges, two keys, or a key and a range overlap), Cloud Spanner -/// behaves as if the key were only specified once. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct KeySet { - /// A list of specific keys. Entries in `keys` should have exactly as - /// many elements as there are columns in the primary or index key - /// with which this `KeySet` is used. Individual key values are - /// encoded as described here. - pub keys: Option>>, - /// A list of key ranges. See KeyRange for more information about - /// key range specifications. - pub ranges: Option>, - /// For convenience `all` can be set to `true` to indicate that this - /// `KeySet` matches all keys in the table or index. Note that any keys - /// specified in `keys` or `ranges` are only yielded once. - pub all: Option, -} - -impl Part for KeySet {} - - -/// Message type to initiate a read-only transaction. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReadOnly { - /// Executes all reads at a timestamp >= `min_read_timestamp`. - /// - /// This is useful for requesting fresher data than some previous - /// read, or data that is fresh enough to observe the effects of some - /// previously committed transaction whose timestamp is known. - /// - /// Note that this option can only be used in single-use transactions. - /// - /// A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - /// Example: `"2014-10-02T15:01:23.045123456Z"`. - #[serde(rename="minReadTimestamp")] - pub min_read_timestamp: Option, - /// If true, the Cloud Spanner-selected read timestamp is included in - /// the Transaction message that describes the transaction. - #[serde(rename="returnReadTimestamp")] - pub return_read_timestamp: Option, - /// Read at a timestamp where all previously committed transactions - /// are visible. - pub strong: Option, - /// Executes all reads at the given timestamp. Unlike other modes, - /// reads at a specific timestamp are repeatable; the same read at - /// the same timestamp always returns the same data. If the - /// timestamp is in the future, the read will block until the - /// specified timestamp, modulo the read's deadline. - /// - /// Useful for large scale consistent reads such as mapreduces, or - /// for coordinating many reads against a consistent snapshot of the - /// data. - /// - /// A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. - /// Example: `"2014-10-02T15:01:23.045123456Z"`. - #[serde(rename="readTimestamp")] - pub read_timestamp: Option, - /// Read data at a timestamp >= `NOW - max_staleness` - /// seconds. Guarantees that all writes that have committed more - /// than the specified number of seconds ago are visible. Because - /// Cloud Spanner chooses the exact timestamp, this mode works even if - /// the client's local clock is substantially skewed from Cloud Spanner - /// commit timestamps. - /// - /// Useful for reading the freshest data available at a nearby - /// replica, while bounding the possible staleness if the local - /// replica has fallen behind. - /// - /// Note that this option can only be used in single-use - /// transactions. - #[serde(rename="maxStaleness")] - pub max_staleness: Option, - /// Executes all reads at a timestamp that is `exact_staleness` - /// old. The timestamp is chosen soon after the read is started. - /// - /// Guarantees that all writes that have committed more than the - /// specified number of seconds ago are visible. Because Cloud Spanner - /// chooses the exact timestamp, this mode works even if the client's - /// local clock is substantially skewed from Cloud Spanner commit - /// timestamps. - /// - /// Useful for reading at nearby replicas without the distributed - /// timestamp negotiation overhead of `max_staleness`. - #[serde(rename="exactStaleness")] - pub exact_staleness: Option, -} - -impl Part for ReadOnly {} - - -/// Metadata associated with a parent-child relationship appearing in a -/// PlanNode. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChildLink { - /// Only present if the child node is SCALAR and corresponds - /// to an output variable of the parent node. The field carries the name of - /// the output variable. - /// For example, a `TableScan` operator that reads rows from a table will - /// have child links to the `SCALAR` nodes representing the output variables - /// created for each column that is read by the operator. The corresponding - /// `variable` fields will be set to the variable names assigned to the - /// columns. - pub variable: Option, - /// The node to which the link points. - #[serde(rename="childIndex")] - pub child_index: Option, - /// The type of the link. For example, in Hash Joins this could be used to - /// distinguish between the build child and the probe child, or in the case - /// of the child being an output variable, to represent the tag associated - /// with the output variable. - #[serde(rename="type")] - pub type_: Option, -} - -impl Part for ChildLink {} - - -/// The request for Read and -/// StreamingRead. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions streaming read projects](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html) (request) -/// * [instances databases sessions read projects](struct.ProjectInstanceDatabaseSessionReadCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReadRequest { - /// If non-empty, the name of an index on table. This index is - /// used instead of the table primary key when interpreting key_set - /// and sorting result rows. See key_set for further information. - pub index: Option, - /// The transaction to use. If none is provided, the default is a - /// temporary read-only transaction with strong concurrency. - pub transaction: Option, - /// If this request is resuming a previously interrupted read, - /// `resume_token` should be copied from the last - /// PartialResultSet yielded before the interruption. Doing this - /// enables the new read to resume where the last read left off. The - /// rest of the request parameters must exactly match the request - /// that yielded this token. - #[serde(rename="resumeToken")] - pub resume_token: Option, - /// If present, results will be restricted to the specified partition - /// previously created using PartitionRead(). There must be an exact - /// match for the values of fields common to this message and the - /// PartitionReadRequest message used to create this partition_token. - #[serde(rename="partitionToken")] - pub partition_token: Option, - /// Required. `key_set` identifies the rows to be yielded. `key_set` names the - /// primary keys of the rows in table to be yielded, unless index - /// is present. If index is present, then key_set instead names - /// index keys in index. - /// - /// If the partition_token field is empty, rows are yielded - /// in table primary key order (if index is empty) or index key order - /// (if index is non-empty). If the partition_token field is not - /// empty, rows will be yielded in an unspecified order. - /// - /// It is not an error for the `key_set` to name rows that do not - /// exist in the database. Read yields nothing for nonexistent rows. - #[serde(rename="keySet")] - pub key_set: Option, - /// If greater than zero, only the first `limit` rows are yielded. If `limit` - /// is zero, the default is no limit. A limit cannot be specified if - /// `partition_token` is set. - pub limit: Option, - /// Required. The name of the table in the database to be read. - pub table: Option, - /// The columns of table to be returned for each row matching - /// this request. - pub columns: Option>, -} - -impl RequestValue for ReadRequest {} - - -/// Options for a PartitionQueryRequest and -/// PartitionReadRequest. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PartitionOptions { - /// **Note:** This hint is currently ignored by PartitionQuery and - /// PartitionRead requests. - /// - /// The desired maximum number of partitions to return. For example, this may - /// be set to the number of workers available. The default for this option - /// is currently 10,000. The maximum value is currently 200,000. This is only - /// a hint. The actual number of partitions returned may be smaller or larger - /// than this maximum count request. - #[serde(rename="maxPartitions")] - pub max_partitions: Option, - /// **Note:** This hint is currently ignored by PartitionQuery and - /// PartitionRead requests. - /// - /// The desired data size for each partition generated. The default for this - /// option is currently 1 GiB. This is only a hint. The actual size of each - /// partition may be smaller or larger than this size request. - #[serde(rename="partitionSizeBytes")] - pub partition_size_bytes: Option, -} - -impl Part for PartitionOptions {} - - -/// This resource represents a long-running operation that is the result of a -/// network API call. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases operations get projects](struct.ProjectInstanceDatabaseOperationGetCall.html) (response) -/// * [instances operations get projects](struct.ProjectInstanceOperationGetCall.html) (response) -/// * [instances databases create projects](struct.ProjectInstanceDatabaseCreateCall.html) (response) -/// * [instances create projects](struct.ProjectInstanceCreateCall.html) (response) -/// * [instances databases update ddl projects](struct.ProjectInstanceDatabaseUpdateDdlCall.html) (response) -/// * [instances patch projects](struct.ProjectInstancePatchCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Operation { - /// The error result of the operation in case of failure or cancellation. - pub error: Option, - /// If the value is `false`, it means the operation is still in progress. - /// If `true`, the operation is completed, and either `error` or `response` is - /// available. - pub done: Option, - /// The normal response of the operation in case of success. If the original - /// method returns no data on success, such as `Delete`, the response is - /// `google.protobuf.Empty`. If the original method is standard - /// `Get`/`Create`/`Update`, the response should be the resource. For other - /// methods, the response should have the type `XxxResponse`, where `Xxx` - /// is the original method name. For example, if the original method name - /// is `TakeSnapshot()`, the inferred response type is - /// `TakeSnapshotResponse`. - pub response: Option>, - /// The server-assigned name, which is only unique within the same service that - /// originally returns it. If you use the default HTTP mapping, the - /// `name` should be a resource name ending with `operations/{unique_id}`. - pub name: Option, - /// Service-specific metadata associated with the operation. It typically - /// contains progress information and common metadata such as create time. - /// Some services might not provide such metadata. Any method that returns a - /// long-running operation should document the metadata type, if any. - pub metadata: Option>, -} - -impl ResponseResult for Operation {} - - -/// The response for ListInstances. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances list projects](struct.ProjectInstanceListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListInstancesResponse { - /// `next_page_token` can be sent in a subsequent - /// ListInstances call to fetch more - /// of the matching instances. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of requested instances. - pub instances: Option>, -} - -impl ResponseResult for ListInstancesResponse {} - - -/// Contains an ordered list of nodes appearing in the query plan. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct QueryPlan { - /// The nodes in the query plan. Plan nodes are returned in pre-order starting - /// with the plan root. Each PlanNode's `id` corresponds to its index in - /// `plan_nodes`. - #[serde(rename="planNodes")] - pub plan_nodes: Option>, -} - -impl Part for QueryPlan {} - - -/// Request message for `SetIamPolicy` method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases set iam policy projects](struct.ProjectInstanceDatabaseSetIamPolicyCall.html) (request) -/// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SetIamPolicyRequest { - /// REQUIRED: The complete policy to be applied to the `resource`. The size of - /// the policy is limited to a few 10s of KB. An empty policy is a - /// valid policy but certain Cloud Platform services (such as Projects) - /// might reject them. - pub policy: Option, -} - -impl RequestValue for SetIamPolicyRequest {} - - -/// The request for PartitionQuery -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions partition query projects](struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PartitionQueryRequest { - /// It is not always possible for Cloud Spanner to infer the right SQL type - /// from a JSON value. For example, values of type `BYTES` and values - /// of type `STRING` both appear in params as JSON strings. - /// - /// In these cases, `param_types` can be used to specify the exact - /// SQL type for some or all of the SQL query parameters. See the - /// definition of Type for more information - /// about SQL types. - #[serde(rename="paramTypes")] - pub param_types: Option>, - /// Additional options that affect how many partitions are created. - #[serde(rename="partitionOptions")] - pub partition_options: Option, - /// Read only snapshot transactions are supported, read/write and single use - /// transactions are not. - pub transaction: Option, - /// The SQL query string can contain parameter placeholders. A parameter - /// placeholder consists of `'@'` followed by the parameter - /// name. Parameter names consist of any combination of letters, - /// numbers, and underscores. - /// - /// Parameters can appear anywhere that a literal value is expected. The same - /// parameter name can be used more than once, for example: - /// `"WHERE id > @msg_id AND id < @msg_id + 100"` - /// - /// It is an error to execute an SQL query with unbound parameters. - /// - /// Parameter values are specified using `params`, which is a JSON - /// object whose keys are parameter names, and whose values are the - /// corresponding parameter values. - pub params: Option>, - /// The query request to generate partitions for. The request will fail if - /// the query is not root partitionable. The query plan of a root - /// partitionable query has a single distributed union operator. A distributed - /// union operator conceptually divides one or more tables into multiple - /// splits, remotely evaluates a subquery independently on each split, and - /// then unions all results. - /// - /// This must not contain DML commands, such as INSERT, UPDATE, or - /// DELETE. Use ExecuteStreamingSql with a - /// PartitionedDml transaction for large, partition-friendly DML operations. - pub sql: Option, -} - -impl RequestValue for PartitionQueryRequest {} - - -/// Results from Read or -/// ExecuteSql. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions execute sql projects](struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html) (response) -/// * [instances databases sessions read projects](struct.ProjectInstanceDatabaseSessionReadCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResultSet { - /// Each element in `rows` is a row whose format is defined by - /// metadata.row_type. The ith element - /// in each row matches the ith field in - /// metadata.row_type. Elements are - /// encoded based on type as described - /// here. - pub rows: Option>>, - /// Query plan and execution statistics for the SQL statement that - /// produced this result set. These can be requested by setting - /// ExecuteSqlRequest.query_mode. - /// DML statements always produce stats containing the number of rows - /// modified, unless executed using the - /// ExecuteSqlRequest.QueryMode.PLAN ExecuteSqlRequest.query_mode. - /// Other fields may or may not be populated, based on the - /// ExecuteSqlRequest.query_mode. - pub stats: Option, - /// Metadata about the result set, such as row type information. - pub metadata: Option, -} - -impl ResponseResult for ResultSet {} - - -/// Arguments to insert, update, insert_or_update, and -/// replace operations. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Write { - /// Required. The table whose rows will be written. - pub table: Option, - /// The values to be written. `values` can contain more than one - /// list of values. If it does, then multiple rows are written, one - /// for each entry in `values`. Each list in `values` must have - /// exactly as many entries as there are entries in columns - /// above. Sending multiple lists is equivalent to sending multiple - /// `Mutation`s, each containing one `values` entry and repeating - /// table and columns. Individual values in each list are - /// encoded as described here. - pub values: Option>>, - /// The names of the columns in table to be written. - /// - /// The list of columns must contain enough columns to allow - /// Cloud Spanner to derive values for all primary key columns in the - /// row(s) to be modified. - pub columns: Option>, -} - -impl Part for Write {} - - -/// Message representing a single field of a struct. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Field { - /// The type of the field. - #[serde(rename="type")] - pub type_: Option, - /// The name of the field. For reads, this is the column name. For - /// SQL queries, it is the column alias (e.g., `"Word"` in the - /// query `"SELECT 'hello' AS Word"`), or the column name (e.g., - /// `"ColName"` in the query `"SELECT ColName FROM Table"`). Some - /// columns might have an empty name (e.g., !"SELECT - /// UPPER(ColName)"`). Note that a query result can contain - /// multiple fields with the same name. - pub name: Option, -} - -impl Part for Field {} - - -/// The response for ListDatabases. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases list projects](struct.ProjectInstanceDatabaseListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListDatabasesResponse { - /// `next_page_token` can be sent in a subsequent - /// ListDatabases call to fetch more - /// of the matching databases. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Databases that matched the request. - pub databases: Option>, -} - -impl ResponseResult for ListDatabasesResponse {} - - -/// Additional statistics about a ResultSet or PartialResultSet. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResultSetStats { - /// Partitioned DML does not offer exactly-once semantics, so it - /// returns a lower bound of the rows modified. - #[serde(rename="rowCountLowerBound")] - pub row_count_lower_bound: Option, - /// Standard DML returns an exact count of rows that were modified. - #[serde(rename="rowCountExact")] - pub row_count_exact: Option, - /// QueryPlan for the query associated with this result. - #[serde(rename="queryPlan")] - pub query_plan: Option, - /// Aggregated statistics from the execution of the query. Only present when - /// the query is profiled. For example, a query could return the statistics as - /// follows: - /// - /// ````text - /// { - /// "rows_returned": "3", - /// "elapsed_time": "1.22 secs", - /// "cpu_time": "1.19 secs" - /// }```` - #[serde(rename="queryStats")] - pub query_stats: Option>, -} - -impl Part for ResultSetStats {} - - -/// The response for Commit. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions commit projects](struct.ProjectInstanceDatabaseSessionCommitCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommitResponse { - /// The Cloud Spanner timestamp at which the transaction committed. - #[serde(rename="commitTimestamp")] - pub commit_timestamp: Option, -} - -impl ResponseResult for CommitResponse {} - - -/// Defines an Identity and Access Management (IAM) policy. It is used to -/// specify access control policies for Cloud Platform resources. -/// -/// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -/// `members` to a `role`, where the members can be user accounts, Google groups, -/// Google domains, and service accounts. A `role` is a named list of permissions -/// defined by IAM. -/// -/// **JSON Example** -/// -/// ````text -/// { -/// "bindings": [ -/// { -/// "role": "roles/owner", -/// "members": [ -/// "user:mike@example.com", -/// "group:admins@example.com", -/// "domain:google.com", -/// "serviceAccount:my-other-app@appspot.gserviceaccount.com" -/// ] -/// }, -/// { -/// "role": "roles/viewer", -/// "members": ["user:sean@example.com"] -/// } -/// ] -/// } -/// ```` -/// -/// **YAML Example** -/// -/// ````text -/// bindings: -/// - members: -/// - user:mike@example.com -/// - group:admins@example.com -/// - domain:google.com -/// - serviceAccount:my-other-app@appspot.gserviceaccount.com -/// role: roles/owner -/// - members: -/// - user:sean@example.com -/// role: roles/viewer -/// ```` -/// -/// For a description of IAM and its features, see the -/// [IAM developer's guide](https://cloud.google.com/iam/docs). -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (response) -/// * [instances databases set iam policy projects](struct.ProjectInstanceDatabaseSetIamPolicyCall.html) (response) -/// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.html) (response) -/// * [instances databases get iam policy projects](struct.ProjectInstanceDatabaseGetIamPolicyCall.html) (response) -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Policy { - /// Associates a list of `members` to a `role`. - /// `bindings` with no members will result in an error. - pub bindings: Option>, - /// `etag` is used for optimistic concurrency control as a way to help - /// prevent simultaneous updates of a policy from overwriting each other. - /// It is strongly suggested that systems make use of the `etag` in the - /// read-modify-write cycle to perform policy updates in order to avoid race - /// conditions: An `etag` is returned in the response to `getIamPolicy`, and - /// systems are expected to put that etag in the request to `setIamPolicy` to - /// ensure that their change will be applied to the same version of the policy. - /// - /// If no `etag` is provided in the call to `setIamPolicy`, then the existing - /// policy is overwritten blindly. - pub etag: Option, - /// Deprecated. - pub version: Option, -} - -impl ResponseResult for Policy {} - - -/// Enqueues the given DDL statements to be applied, in order but not -/// necessarily all at once, to the database schema at some point (or -/// points) in the future. The server checks that the statements -/// are executable (syntactically valid, name tables that exist, etc.) -/// before enqueueing them, but they may still fail upon -/// later execution (e.g., if a statement from another batch of -/// statements is applied first and it conflicts in some way, or if -/// there is some data-related problem like a `NULL` value in a column to -/// which `NOT NULL` would be added). If a statement fails, all -/// subsequent statements in the batch are automatically cancelled. -/// -/// Each batch of statements is assigned a name which can be used with -/// the Operations API to monitor -/// progress. See the -/// operation_id field for more -/// details. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases update ddl projects](struct.ProjectInstanceDatabaseUpdateDdlCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UpdateDatabaseDdlRequest { - /// DDL statements to be applied to the database. - pub statements: Option>, - /// If empty, the new update request is assigned an - /// automatically-generated operation ID. Otherwise, `operation_id` - /// is used to construct the name of the resulting - /// Operation. - /// - /// Specifying an explicit operation ID simplifies determining - /// whether the statements were executed in the event that the - /// UpdateDatabaseDdl call is replayed, - /// or the return value is otherwise lost: the database and - /// `operation_id` fields can be combined to form the - /// name of the resulting - /// longrunning.Operation: `/operations/`. - /// - /// `operation_id` should be unique within the database, and must be - /// a valid identifier: `a-z*`. Note that - /// automatically-generated operation IDs always begin with an - /// underscore. If the named operation already exists, - /// UpdateDatabaseDdl returns - /// `ALREADY_EXISTS`. - #[serde(rename="operationId")] - pub operation_id: Option, -} - -impl RequestValue for UpdateDatabaseDdlRequest {} - - -/// `Type` indicates the type of a Cloud Spanner value, as might be stored in a -/// table cell or returned from an SQL query. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Type { - /// If code == STRUCT, then `struct_type` - /// provides type information for the struct's fields. - #[serde(rename="structType")] - pub struct_type: Option, - /// Required. The TypeCode for this type. - pub code: Option, - /// If code == ARRAY, then `array_element_type` - /// is the type of the array elements. - #[serde(rename="arrayElementType")] - pub array_element_type: Option>>, -} - -impl Part for Type {} - - -/// A session in the Cloud Spanner API. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances databases sessions get projects](struct.ProjectInstanceDatabaseSessionGetCall.html) (response) -/// * [instances databases sessions create projects](struct.ProjectInstanceDatabaseSessionCreateCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Session { - /// The labels for the session. - /// - /// * Label keys must be between 1 and 63 characters long and must conform to - /// the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - /// * Label values must be between 0 and 63 characters long and must conform - /// to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - /// * No more than 64 labels can be associated with a given session. - /// - /// See https://goo.gl/xmQnxf for more information on and examples of labels. - pub labels: Option>, - /// Output only. The timestamp when the session is created. - #[serde(rename="createTime")] - pub create_time: Option, - /// Output only. The approximate timestamp when the session is last used. It is - /// typically earlier than the actual last use time. - #[serde(rename="approximateLastUseTime")] - pub approximate_last_use_time: Option, - /// The name of the session. This is always system-assigned; values provided - /// when creating a session are ignored. - pub name: Option, -} - -impl ResponseResult for Session {} - - -/// The request for UpdateInstance. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [instances patch projects](struct.ProjectInstancePatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UpdateInstanceRequest { - /// Required. The instance to update, which must always include the instance - /// name. Otherwise, only fields mentioned in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need be included. - pub instance: Option, - /// Required. A mask specifying which fields in [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should be updated. - /// The field mask must always be specified; this prevents any future fields in - /// [][google.spanner.admin.instance.v1.Instance] from being erased accidentally by clients that do not know - /// about them. - #[serde(rename="fieldMask")] - pub field_mask: Option, -} - -impl RequestValue for UpdateInstanceRequest {} - - -/// Node information for nodes appearing in a QueryPlan.plan_nodes. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PlanNode { - /// The `PlanNode`'s index in node list. - pub index: Option, - /// Used to determine the type of node. May be needed for visualizing - /// different kinds of nodes differently. For example, If the node is a - /// SCALAR node, it will have a condensed representation - /// which can be used to directly embed a description of the node in its - /// parent. - pub kind: Option, - /// The display name for the node. - #[serde(rename="displayName")] - pub display_name: Option, - /// The execution statistics associated with the node, contained in a group of - /// key-value pairs. Only present if the plan was returned as a result of a - /// profile query. For example, number of executions, number of rows/time per - /// execution etc. - #[serde(rename="executionStats")] - pub execution_stats: Option>, - /// List of child node `index`es and their relationship to this parent. - #[serde(rename="childLinks")] - pub child_links: Option>, - /// Condensed representation for SCALAR nodes. - #[serde(rename="shortRepresentation")] - pub short_representation: Option, - /// Attributes relevant to the node contained in a group of key-value pairs. - /// For example, a Parameter Reference node could have the following - /// information in its metadata: - /// - /// ````text - /// { - /// "parameter_reference": "param1", - /// "parameter_type": "array" - /// }```` - pub metadata: Option>, -} - -impl Part for PlanNode {} - - /// # Transactions /// /// Each session can have at most one active transaction at a time. After the @@ -2260,6 +1090,1481 @@ pub struct TransactionOptions { impl Part for TransactionOptions {} +/// Response message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases test iam permissions projects](struct.ProjectInstanceDatabaseTestIamPermissionCall.html) (response) +/// * [instances test iam permissions projects](struct.ProjectInstanceTestIamPermissionCall.html) (response) +/// * [instances backups test iam permissions projects](struct.ProjectInstanceBackupTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + pub permissions: Option>, +} + +impl ResponseResult for TestIamPermissionsResponse {} + + +/// A backup of a Cloud Spanner database. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances backups patch projects](struct.ProjectInstanceBackupPatchCall.html) (request|response) +/// * [instances backups create projects](struct.ProjectInstanceBackupCreateCall.html) (request) +/// * [instances backups get projects](struct.ProjectInstanceBackupGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Backup { + /// Required for the CreateBackup + /// operation. The expiration time of the backup, with microseconds + /// granularity that must be at least 6 hours and at most 366 days + /// from the time the CreateBackup request is processed. Once the `expire_time` + /// has passed, the backup is eligible to be automatically deleted by Cloud + /// Spanner to free the resources used by the backup. + #[serde(rename="expireTime")] + pub expire_time: Option, + /// Output only. Size of the backup in bytes. + #[serde(rename="sizeBytes")] + pub size_bytes: Option, + /// Output only. The current state of the backup. + pub state: Option, + /// Output only for the CreateBackup operation. + /// Required for the UpdateBackup operation. + /// + /// A globally unique identifier for the backup which cannot be + /// changed. Values are of the form + /// `projects//instances//backups/a-z*[a-z0-9]` + /// The final segment of the name must be between 2 and 60 characters + /// in length. + /// + /// The backup is stored in the location(s) specified in the instance + /// configuration of the instance containing the backup, identified + /// by the prefix of the backup name of the form + /// `projects//instances/`. + pub name: Option, + /// Required for the CreateBackup operation. + /// Name of the database from which this backup was + /// created. This needs to be in the same instance as the backup. + /// Values are of the form + /// `projects//instances//databases/`. + pub database: Option, + /// Output only. The names of the restored databases that reference the backup. + /// The database names are of + /// the form `projects//instances//databases/`. + /// Referencing databases may exist in different instances. The existence of + /// any referencing database prevents the backup from being deleted. When a + /// restored database from the backup enters the `READY` state, the reference + /// to the backup is removed. + #[serde(rename="referencingDatabases")] + pub referencing_databases: Option>, + /// Output only. The backup will contain an externally consistent + /// copy of the database at the timestamp specified by + /// `create_time`. `create_time` is approximately the time the + /// CreateBackup request is received. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl RequestValue for Backup {} +impl ResponseResult for Backup {} + + +/// The request for CreateInstance. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances create projects](struct.ProjectInstanceCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateInstanceRequest { + /// Required. The ID of the instance to create. Valid identifiers are of the + /// form `a-z*[a-z0-9]` and must be between 2 and 64 characters in + /// length. + #[serde(rename="instanceId")] + pub instance_id: Option, + /// Required. The instance to create. The name may be omitted, but if + /// specified must be `/instances/`. + pub instance: Option, +} + +impl RequestValue for CreateInstanceRequest {} + + +/// The response for +/// ListBackupOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances backup operations list projects](struct.ProjectInstanceBackupOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListBackupOperationsResponse { + /// `next_page_token` can be sent in a subsequent + /// ListBackupOperations + /// call to fetch more of the matching metadata. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching backup long-running + /// operations. Each operation's name will be + /// prefixed by the backup's name and the operation's + /// metadata will be of type + /// CreateBackupMetadata. Operations returned include those that are + /// pending or have completed/failed/canceled within the last 7 days. + /// Operations returned are ordered by + /// `operation.metadata.value.progress.start_time` in descending order starting + /// from the most recently started operation. + pub operations: Option>, +} + +impl ResponseResult for ListBackupOperationsResponse {} + + +/// Request message for `GetIamPolicy` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances backups get iam policy projects](struct.ProjectInstanceBackupGetIamPolicyCall.html) (request) +/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (request) +/// * [instances databases get iam policy projects](struct.ProjectInstanceDatabaseGetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetIamPolicyRequest { + /// OPTIONAL: A `GetPolicyOptions` object for specifying options to + /// `GetIamPolicy`. This field is only used by Cloud IAM. + pub options: Option, +} + +impl RequestValue for GetIamPolicyRequest {} + + +/// A Cloud Spanner database. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases get projects](struct.ProjectInstanceDatabaseGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Database { + /// Output only. The current database state. + pub state: Option, + /// Output only. If exists, the time at which the database creation started. + #[serde(rename="createTime")] + pub create_time: Option, + /// Required. The name of the database. Values are of the form + /// `projects//instances//databases/`, + /// where `` is as specified in the `CREATE DATABASE` + /// statement. This name can be passed to other API methods to + /// identify the database. + pub name: Option, + /// Output only. Applicable only for restored databases. Contains information + /// about the restore source. + #[serde(rename="restoreInfo")] + pub restore_info: Option, +} + +impl ResponseResult for Database {} + + +/// The request for BatchCreateSessions. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions batch create projects](struct.ProjectInstanceDatabaseSessionBatchCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchCreateSessionsRequest { + /// Required. The number of sessions to be created in this batch call. + /// The API may return fewer than the requested number of sessions. If a + /// specific number of sessions are desired, the client can make additional + /// calls to BatchCreateSessions (adjusting + /// session_count as necessary). + #[serde(rename="sessionCount")] + pub session_count: Option, + /// Parameters to be applied to each created session. + #[serde(rename="sessionTemplate")] + pub session_template: Option, +} + +impl RequestValue for BatchCreateSessionsRequest {} + + +/// The response for ExecuteBatchDml. Contains a list +/// of ResultSet messages, one for each DML statement that has successfully +/// executed, in the same order as the statements in the request. If a statement +/// fails, the status in the response body identifies the cause of the failure. +/// +/// To check for DML statements that failed, use the following approach: +/// +/// 1. Check the status in the response message. The google.rpc.Code enum +/// value `OK` indicates that all statements were executed successfully. +/// 2. If the status was not `OK`, check the number of result sets in the +/// response. If the response contains `N` ResultSet messages, then +/// statement `N+1` in the request failed. +/// +/// Example 1: +/// +/// * Request: 5 DML statements, all executed successfully. +/// * Response: 5 ResultSet messages, with the status `OK`. +/// +/// Example 2: +/// +/// * Request: 5 DML statements. The third statement has a syntax error. +/// * Response: 2 ResultSet messages, and a syntax error (`INVALID_ARGUMENT`) +/// status. The number of ResultSet messages indicates that the third +/// statement failed, and the fourth and fifth statements were not executed. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions execute batch dml projects](struct.ProjectInstanceDatabaseSessionExecuteBatchDmlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExecuteBatchDmlResponse { + /// If all DML statements are executed successfully, the status is `OK`. + /// Otherwise, the error status of the first failed statement. + pub status: Option, + /// One ResultSet for each statement in the request that ran successfully, + /// in the same order as the statements in the request. Each ResultSet does + /// not contain any rows. The ResultSetStats in each ResultSet contain + /// the number of rows modified by the statement. + /// + /// Only the first ResultSet in the response contains valid + /// ResultSetMetadata. + #[serde(rename="resultSets")] + pub result_sets: Option>, +} + +impl ResponseResult for ExecuteBatchDmlResponse {} + + +/// The response for GetDatabaseDdl. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases get ddl projects](struct.ProjectInstanceDatabaseGetDdlCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetDatabaseDdlResponse { + /// A list of formatted DDL statements defining the schema of the database + /// specified in the request. + pub statements: Option>, +} + +impl ResponseResult for GetDatabaseDdlResponse {} + + +/// The response for PartitionQuery +/// or PartitionRead +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions partition query projects](struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html) (response) +/// * [instances databases sessions partition read projects](struct.ProjectInstanceDatabaseSessionPartitionReadCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartitionResponse { + /// Transaction created by this request. + pub transaction: Option, + /// Partitions created by this request. + pub partitions: Option>, +} + +impl ResponseResult for PartitionResponse {} + + +/// The request for PartitionRead +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions partition read projects](struct.ProjectInstanceDatabaseSessionPartitionReadCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartitionReadRequest { + /// If non-empty, the name of an index on table. This index is + /// used instead of the table primary key when interpreting key_set + /// and sorting result rows. See key_set for further information. + pub index: Option, + /// Read only snapshot transactions are supported, read/write and single use + /// transactions are not. + pub transaction: Option, + /// Required. `key_set` identifies the rows to be yielded. `key_set` names the + /// primary keys of the rows in table to be yielded, unless index + /// is present. If index is present, then key_set instead names + /// index keys in index. + /// + /// It is not an error for the `key_set` to name rows that do not + /// exist in the database. Read yields nothing for nonexistent rows. + #[serde(rename="keySet")] + pub key_set: Option, + /// Additional options that affect how many partitions are created. + #[serde(rename="partitionOptions")] + pub partition_options: Option, + /// Required. The name of the table in the database to be read. + pub table: Option, + /// The columns of table to be returned for each row matching + /// this request. + pub columns: Option>, +} + +impl RequestValue for PartitionReadRequest {} + + +/// This message is used to select the transaction in which a +/// Read or +/// ExecuteSql call runs. +/// +/// See TransactionOptions for more information about transactions. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TransactionSelector { + /// Begin a new transaction and execute this read or SQL query in + /// it. The transaction ID of the new transaction is returned in + /// ResultSetMetadata.transaction, which is a Transaction. + pub begin: Option, + /// Execute the read or SQL query in a temporary transaction. + /// This is the most efficient way to execute a transaction that + /// consists of a single SQL query. + #[serde(rename="singleUse")] + pub single_use: Option, + /// Execute the read or SQL query in a previously-started transaction. + pub id: Option, +} + +impl Part for TransactionSelector {} + + +/// Message type to initiate a read-write transaction. Currently this +/// transaction type has no options. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadWrite { _never_set: Option } + +impl Part for ReadWrite {} + + +/// The response for +/// ListDatabaseOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances database operations list projects](struct.ProjectInstanceDatabaseOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDatabaseOperationsResponse { + /// `next_page_token` can be sent in a subsequent + /// ListDatabaseOperations + /// call to fetch more of the matching metadata. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching database long-running + /// operations. Each operation's name will be + /// prefixed by the database's name. The operation's + /// metadata field type + /// `metadata.type_url` describes the type of the metadata. + pub operations: Option>, +} + +impl ResponseResult for ListDatabaseOperationsResponse {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + pub role: Option, + /// The condition that is associated with this binding. + /// NOTE: An unsatisfied condition will not allow user access via current + /// binding. Different bindings, including their conditions, are examined + /// independently. + pub condition: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@example.com` . + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a user that has been recently deleted. For + /// example, `alice@example.com?uid=123456789012345678901`. If the user is + /// recovered, this value reverts to `user:{emailid}` and the recovered user + /// retains the role in the binding. + /// + /// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + /// unique identifier) representing a service account that has been recently + /// deleted. For example, + /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + /// If the service account is undeleted, this value reverts to + /// `serviceAccount:{emailid}` and the undeleted service account retains the + /// role in the binding. + /// + /// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + /// identifier) representing a Google group that has been recently + /// deleted. For example, `admins@example.com?uid=123456789012345678901`. If + /// the group is recovered, this value reverts to `group:{emailid}` and the + /// recovered group retains the role in the binding. + /// + /// + /// * `domain:{domain}`: The G Suite domain (primary) that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + +/// Message type to initiate a Partitioned DML transaction. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartitionedDml { _never_set: Option } + +impl Part for PartitionedDml {} + + +/// The request for CreateDatabase. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases create projects](struct.ProjectInstanceDatabaseCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateDatabaseRequest { + /// Optional. A list of DDL statements to run inside the newly created + /// database. Statements can create tables, indexes, etc. These + /// statements execute atomically with the creation of the database: + /// if there is an error in any statement, the database is not created. + #[serde(rename="extraStatements")] + pub extra_statements: Option>, + /// Required. A `CREATE DATABASE` statement, which specifies the ID of the + /// new database. The database ID must conform to the regular expression + /// `a-z*[a-z0-9]` and be between 2 and 30 characters in length. + /// If the database ID is a reserved word or if it contains a hyphen, the + /// database ID must be enclosed in backticks (`` ` ``). + #[serde(rename="createStatement")] + pub create_statement: Option, +} + +impl RequestValue for CreateDatabaseRequest {} + + +/// The request for Rollback. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions rollback projects](struct.ProjectInstanceDatabaseSessionRollbackCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RollbackRequest { + /// Required. The transaction to roll back. + #[serde(rename="transactionId")] + pub transaction_id: Option, +} + +impl RequestValue for RollbackRequest {} + + +/// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All +/// the keys are expected to be in the same table or index. The keys need +/// not be sorted in any particular way. +/// +/// If the same key is specified multiple times in the set (for example +/// if two ranges, two keys, or a key and a range overlap), Cloud Spanner +/// behaves as if the key were only specified once. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeySet { + /// A list of specific keys. Entries in `keys` should have exactly as + /// many elements as there are columns in the primary or index key + /// with which this `KeySet` is used. Individual key values are + /// encoded as described here. + pub keys: Option>>, + /// A list of key ranges. See KeyRange for more information about + /// key range specifications. + pub ranges: Option>, + /// For convenience `all` can be set to `true` to indicate that this + /// `KeySet` matches all keys in the table or index. Note that any keys + /// specified in `keys` or `ranges` are only yielded once. + pub all: Option, +} + +impl Part for KeySet {} + + +/// Metadata associated with a parent-child relationship appearing in a +/// PlanNode. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChildLink { + /// Only present if the child node is SCALAR and corresponds + /// to an output variable of the parent node. The field carries the name of + /// the output variable. + /// For example, a `TableScan` operator that reads rows from a table will + /// have child links to the `SCALAR` nodes representing the output variables + /// created for each column that is read by the operator. The corresponding + /// `variable` fields will be set to the variable names assigned to the + /// columns. + pub variable: Option, + /// The node to which the link points. + #[serde(rename="childIndex")] + pub child_index: Option, + /// The type of the link. For example, in Hash Joins this could be used to + /// distinguish between the build child and the probe child, or in the case + /// of the child being an output variable, to represent the tag associated + /// with the output variable. + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for ChildLink {} + + +/// The request for Read and +/// StreamingRead. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions streaming read projects](struct.ProjectInstanceDatabaseSessionStreamingReadCall.html) (request) +/// * [instances databases sessions read projects](struct.ProjectInstanceDatabaseSessionReadCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadRequest { + /// If non-empty, the name of an index on table. This index is + /// used instead of the table primary key when interpreting key_set + /// and sorting result rows. See key_set for further information. + pub index: Option, + /// The transaction to use. If none is provided, the default is a + /// temporary read-only transaction with strong concurrency. + pub transaction: Option, + /// If this request is resuming a previously interrupted read, + /// `resume_token` should be copied from the last + /// PartialResultSet yielded before the interruption. Doing this + /// enables the new read to resume where the last read left off. The + /// rest of the request parameters must exactly match the request + /// that yielded this token. + #[serde(rename="resumeToken")] + pub resume_token: Option, + /// If present, results will be restricted to the specified partition + /// previously created using PartitionRead(). There must be an exact + /// match for the values of fields common to this message and the + /// PartitionReadRequest message used to create this partition_token. + #[serde(rename="partitionToken")] + pub partition_token: Option, + /// Required. `key_set` identifies the rows to be yielded. `key_set` names the + /// primary keys of the rows in table to be yielded, unless index + /// is present. If index is present, then key_set instead names + /// index keys in index. + /// + /// If the partition_token field is empty, rows are yielded + /// in table primary key order (if index is empty) or index key order + /// (if index is non-empty). If the partition_token field is not + /// empty, rows will be yielded in an unspecified order. + /// + /// It is not an error for the `key_set` to name rows that do not + /// exist in the database. Read yields nothing for nonexistent rows. + #[serde(rename="keySet")] + pub key_set: Option, + /// If greater than zero, only the first `limit` rows are yielded. If `limit` + /// is zero, the default is no limit. A limit cannot be specified if + /// `partition_token` is set. + pub limit: Option, + /// Required. The name of the table in the database to be read. + pub table: Option, + /// Required. The columns of table to be returned for each row matching + /// this request. + pub columns: Option>, +} + +impl RequestValue for ReadRequest {} + + +/// Options for a PartitionQueryRequest and +/// PartitionReadRequest. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartitionOptions { + /// **Note:** This hint is currently ignored by PartitionQuery and + /// PartitionRead requests. + /// + /// The desired maximum number of partitions to return. For example, this may + /// be set to the number of workers available. The default for this option + /// is currently 10,000. The maximum value is currently 200,000. This is only + /// a hint. The actual number of partitions returned may be smaller or larger + /// than this maximum count request. + #[serde(rename="maxPartitions")] + pub max_partitions: Option, + /// **Note:** This hint is currently ignored by PartitionQuery and + /// PartitionRead requests. + /// + /// The desired data size for each partition generated. The default for this + /// option is currently 1 GiB. This is only a hint. The actual size of each + /// partition may be smaller or larger than this size request. + #[serde(rename="partitionSizeBytes")] + pub partition_size_bytes: Option, +} + +impl Part for PartitionOptions {} + + +/// This resource represents a long-running operation that is the result of a +/// network API call. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases operations get projects](struct.ProjectInstanceDatabaseOperationGetCall.html) (response) +/// * [instances operations get projects](struct.ProjectInstanceOperationGetCall.html) (response) +/// * [instances backups create projects](struct.ProjectInstanceBackupCreateCall.html) (response) +/// * [instances databases create projects](struct.ProjectInstanceDatabaseCreateCall.html) (response) +/// * [instances create projects](struct.ProjectInstanceCreateCall.html) (response) +/// * [instances backups operations get projects](struct.ProjectInstanceBackupOperationGetCall.html) (response) +/// * [instances databases update ddl projects](struct.ProjectInstanceDatabaseUpdateDdlCall.html) (response) +/// * [instances databases restore projects](struct.ProjectInstanceDatabaseRestoreCall.html) (response) +/// * [instances patch projects](struct.ProjectInstancePatchCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The error result of the operation in case of failure or cancellation. + pub error: Option, + /// If the value is `false`, it means the operation is still in progress. + /// If `true`, the operation is completed, and either `error` or `response` is + /// available. + pub done: Option, + /// The normal response of the operation in case of success. If the original + /// method returns no data on success, such as `Delete`, the response is + /// `google.protobuf.Empty`. If the original method is standard + /// `Get`/`Create`/`Update`, the response should be the resource. For other + /// methods, the response should have the type `XxxResponse`, where `Xxx` + /// is the original method name. For example, if the original method name + /// is `TakeSnapshot()`, the inferred response type is + /// `TakeSnapshotResponse`. + pub response: Option>, + /// The server-assigned name, which is only unique within the same service that + /// originally returns it. If you use the default HTTP mapping, the + /// `name` should be a resource name ending with `operations/{unique_id}`. + pub name: Option, + /// Service-specific metadata associated with the operation. It typically + /// contains progress information and common metadata such as create time. + /// Some services might not provide such metadata. Any method that returns a + /// long-running operation should document the metadata type, if any. + pub metadata: Option>, +} + +impl ResponseResult for Operation {} + + +/// `StructType` defines the fields of a STRUCT type. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StructType { + /// The list of fields that make up this struct. Order is + /// significant, because values of this struct type are represented as + /// lists, where the order of field values matches the order of + /// fields in the StructType. In turn, the order of fields + /// matches the order of columns in a read request, or the order of + /// fields in the `SELECT` clause of a query. + pub fields: Option>, +} + +impl Part for StructType {} + + +/// The response for ListInstances. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances list projects](struct.ProjectInstanceListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListInstancesResponse { + /// `next_page_token` can be sent in a subsequent + /// ListInstances call to fetch more + /// of the matching instances. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of requested instances. + pub instances: Option>, +} + +impl ResponseResult for ListInstancesResponse {} + + +/// Contains an ordered list of nodes appearing in the query plan. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryPlan { + /// The nodes in the query plan. Plan nodes are returned in pre-order starting + /// with the plan root. Each PlanNode's `id` corresponds to its index in + /// `plan_nodes`. + #[serde(rename="planNodes")] + pub plan_nodes: Option>, +} + +impl Part for QueryPlan {} + + +/// The request for +/// RestoreDatabase. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases restore projects](struct.ProjectInstanceDatabaseRestoreCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RestoreDatabaseRequest { + /// Required. The id of the database to create and restore to. This + /// database must not already exist. The `database_id` appended to + /// `parent` forms the full database name of the form + /// `projects//instances//databases/`. + #[serde(rename="databaseId")] + pub database_id: Option, + /// Name of the backup from which to restore. Values are of the form + /// `projects//instances//backups/`. + pub backup: Option, +} + +impl RequestValue for RestoreDatabaseRequest {} + + +/// Request message for `SetIamPolicy` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases set iam policy projects](struct.ProjectInstanceDatabaseSetIamPolicyCall.html) (request) +/// * [instances backups set iam policy projects](struct.ProjectInstanceBackupSetIamPolicyCall.html) (request) +/// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. The size of + /// the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// The request for PartitionQuery +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions partition query projects](struct.ProjectInstanceDatabaseSessionPartitionQueryCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PartitionQueryRequest { + /// It is not always possible for Cloud Spanner to infer the right SQL type + /// from a JSON value. For example, values of type `BYTES` and values + /// of type `STRING` both appear in params as JSON strings. + /// + /// In these cases, `param_types` can be used to specify the exact + /// SQL type for some or all of the SQL query parameters. See the + /// definition of Type for more information + /// about SQL types. + #[serde(rename="paramTypes")] + pub param_types: Option>, + /// Additional options that affect how many partitions are created. + #[serde(rename="partitionOptions")] + pub partition_options: Option, + /// Read only snapshot transactions are supported, read/write and single use + /// transactions are not. + pub transaction: Option, + /// Parameter names and values that bind to placeholders in the SQL string. + /// + /// A parameter placeholder consists of the `@` character followed by the + /// parameter name (for example, `@firstName`). Parameter names can contain + /// letters, numbers, and underscores. + /// + /// Parameters can appear anywhere that a literal value is expected. The same + /// parameter name can be used more than once, for example: + /// + /// `"WHERE id > @msg_id AND id < @msg_id + 100"` + /// + /// It is an error to execute a SQL statement with unbound parameters. + pub params: Option>, + /// Required. The query request to generate partitions for. The request will fail if + /// the query is not root partitionable. The query plan of a root + /// partitionable query has a single distributed union operator. A distributed + /// union operator conceptually divides one or more tables into multiple + /// splits, remotely evaluates a subquery independently on each split, and + /// then unions all results. + /// + /// This must not contain DML commands, such as INSERT, UPDATE, or + /// DELETE. Use ExecuteStreamingSql with a + /// PartitionedDml transaction for large, partition-friendly DML operations. + pub sql: Option, +} + +impl RequestValue for PartitionQueryRequest {} + + +/// Results from Read or +/// ExecuteSql. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions execute sql projects](struct.ProjectInstanceDatabaseSessionExecuteSqlCall.html) (response) +/// * [instances databases sessions read projects](struct.ProjectInstanceDatabaseSessionReadCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResultSet { + /// Each element in `rows` is a row whose format is defined by + /// metadata.row_type. The ith element + /// in each row matches the ith field in + /// metadata.row_type. Elements are + /// encoded based on type as described + /// here. + pub rows: Option>>, + /// Query plan and execution statistics for the SQL statement that + /// produced this result set. These can be requested by setting + /// ExecuteSqlRequest.query_mode. + /// DML statements always produce stats containing the number of rows + /// modified, unless executed using the + /// ExecuteSqlRequest.QueryMode.PLAN ExecuteSqlRequest.query_mode. + /// Other fields may or may not be populated, based on the + /// ExecuteSqlRequest.query_mode. + pub stats: Option, + /// Metadata about the result set, such as row type information. + pub metadata: Option, +} + +impl ResponseResult for ResultSet {} + + +/// Arguments to insert, update, insert_or_update, and +/// replace operations. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Write { + /// Required. The table whose rows will be written. + pub table: Option, + /// The values to be written. `values` can contain more than one + /// list of values. If it does, then multiple rows are written, one + /// for each entry in `values`. Each list in `values` must have + /// exactly as many entries as there are entries in columns + /// above. Sending multiple lists is equivalent to sending multiple + /// `Mutation`s, each containing one `values` entry and repeating + /// table and columns. Individual values in each list are + /// encoded as described here. + pub values: Option>>, + /// The names of the columns in table to be written. + /// + /// The list of columns must contain enough columns to allow + /// Cloud Spanner to derive values for all primary key columns in the + /// row(s) to be modified. + pub columns: Option>, +} + +impl Part for Write {} + + +/// Message representing a single field of a struct. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Field { + /// The type of the field. + #[serde(rename="type")] + pub type_: Option, + /// The name of the field. For reads, this is the column name. For + /// SQL queries, it is the column alias (e.g., `"Word"` in the + /// query `"SELECT 'hello' AS Word"`), or the column name (e.g., + /// `"ColName"` in the query `"SELECT ColName FROM Table"`). Some + /// columns might have an empty name (e.g., !"SELECT + /// UPPER(ColName)"`). Note that a query result can contain + /// multiple fields with the same name. + pub name: Option, +} + +impl Part for Field {} + + +/// The response for ListDatabases. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases list projects](struct.ProjectInstanceDatabaseListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDatabasesResponse { + /// `next_page_token` can be sent in a subsequent + /// ListDatabases call to fetch more + /// of the matching databases. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Databases that matched the request. + pub databases: Option>, +} + +impl ResponseResult for ListDatabasesResponse {} + + +/// Information about the database restore. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RestoreInfo { + /// Information about the backup used to restore the database. The backup + /// may no longer exist. + #[serde(rename="backupInfo")] + pub backup_info: Option, + /// The type of the restore source. + #[serde(rename="sourceType")] + pub source_type: Option, +} + +impl Part for RestoreInfo {} + + +/// Additional statistics about a ResultSet or PartialResultSet. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResultSetStats { + /// Partitioned DML does not offer exactly-once semantics, so it + /// returns a lower bound of the rows modified. + #[serde(rename="rowCountLowerBound")] + pub row_count_lower_bound: Option, + /// Standard DML returns an exact count of rows that were modified. + #[serde(rename="rowCountExact")] + pub row_count_exact: Option, + /// QueryPlan for the query associated with this result. + #[serde(rename="queryPlan")] + pub query_plan: Option, + /// Aggregated statistics from the execution of the query. Only present when + /// the query is profiled. For example, a query could return the statistics as + /// follows: + /// + /// ````text + /// { + /// "rows_returned": "3", + /// "elapsed_time": "1.22 secs", + /// "cpu_time": "1.19 secs" + /// }```` + #[serde(rename="queryStats")] + pub query_stats: Option>, +} + +impl Part for ResultSetStats {} + + +/// The response for Commit. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions commit projects](struct.ProjectInstanceDatabaseSessionCommitCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommitResponse { + /// The Cloud Spanner timestamp at which the transaction committed. + #[serde(rename="commitTimestamp")] + pub commit_timestamp: Option, +} + +impl ResponseResult for CommitResponse {} + + +/// Information about a backup. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BackupInfo { + /// Name of the backup. + pub backup: Option, + /// The backup contains an externally consistent copy of `source_database` at + /// the timestamp specified by `create_time`. + #[serde(rename="createTime")] + pub create_time: Option, + /// Name of the database the backup was created from. + #[serde(rename="sourceDatabase")] + pub source_database: Option, +} + +impl Part for BackupInfo {} + + +/// An Identity and Access Management (IAM) policy, which specifies access +/// controls for Google Cloud resources. +/// +/// A `Policy` is a collection of `bindings`. A `binding` binds one or more +/// `members` to a single `role`. Members can be user accounts, service accounts, +/// Google groups, and domains (such as G Suite). A `role` is a named list of +/// permissions; each `role` can be an IAM predefined role or a user-created +/// custom role. +/// +/// Optionally, a `binding` can specify a `condition`, which is a logical +/// expression that allows access to a resource only if the expression evaluates +/// to `true`. A condition can add constraints based on attributes of the +/// request, the resource, or both. +/// +/// **JSON example:** +/// +/// ````text +/// { +/// "bindings": [ +/// { +/// "role": "roles/resourcemanager.organizationAdmin", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +/// ] +/// }, +/// { +/// "role": "roles/resourcemanager.organizationViewer", +/// "members": ["user:eve@example.com"], +/// "condition": { +/// "title": "expirable access", +/// "description": "Does not grant access after Sep 2020", +/// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", +/// } +/// } +/// ], +/// "etag": "BwWWja0YfJA=", +/// "version": 3 +/// } +/// ```` +/// +/// **YAML example:** +/// +/// ````text +/// bindings: +/// - members: +/// - user:mike@example.com +/// - group:admins@example.com +/// - domain:google.com +/// - serviceAccount:my-project-id@appspot.gserviceaccount.com +/// role: roles/resourcemanager.organizationAdmin +/// - members: +/// - user:eve@example.com +/// role: roles/resourcemanager.organizationViewer +/// condition: +/// title: expirable access +/// description: Does not grant access after Sep 2020 +/// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +/// - etag: BwWWja0YfJA= +/// - version: 3 +/// ```` +/// +/// For a description of IAM and its features, see the +/// [IAM documentation](https://cloud.google.com/iam/docs/). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances get iam policy projects](struct.ProjectInstanceGetIamPolicyCall.html) (response) +/// * [instances set iam policy projects](struct.ProjectInstanceSetIamPolicyCall.html) (response) +/// * [instances backups get iam policy projects](struct.ProjectInstanceBackupGetIamPolicyCall.html) (response) +/// * [instances databases set iam policy projects](struct.ProjectInstanceDatabaseSetIamPolicyCall.html) (response) +/// * [instances backups set iam policy projects](struct.ProjectInstanceBackupSetIamPolicyCall.html) (response) +/// * [instances databases get iam policy projects](struct.ProjectInstanceDatabaseGetIamPolicyCall.html) (response) +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Associates a list of `members` to a `role`. Optionally, may specify a + /// `condition` that determines how and when the `bindings` are applied. Each + /// of the `bindings` must contain at least one member. + pub bindings: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + pub etag: Option, + /// Specifies the format of the policy. + /// + /// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + /// are rejected. + /// + /// Any operation that affects conditional role bindings must specify version + /// `3`. This requirement applies to the following operations: + /// + /// * Getting a policy that includes a conditional role binding + /// * Adding a conditional role binding to a policy + /// * Changing a conditional role binding in a policy + /// * Removing any role binding, with or without a condition, from a policy + /// that includes conditions + /// + /// **Important:** If you use IAM Conditions, you must include the `etag` field + /// whenever you call `setIamPolicy`. If you omit this field, then IAM allows + /// you to overwrite a version `3` policy with a version `1` policy, and all of + /// the conditions in the version `3` policy are lost. + /// + /// If a policy does not include any conditions, operations on that policy may + /// specify any valid version or leave the field unset. + pub version: Option, +} + +impl ResponseResult for Policy {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReplicaInfo { + /// If true, this location is designated as the default leader location where + /// leader replicas are placed. See the [region types + /// documentation](https://cloud.google.com/spanner/docs/instances#region_types) + /// for more details. + #[serde(rename="defaultLeaderLocation")] + pub default_leader_location: Option, + /// The type of replica. + #[serde(rename="type")] + pub type_: Option, + /// The location of the serving resources, e.g. "us-central1". + pub location: Option, +} + +impl Part for ReplicaInfo {} + + +/// `Type` indicates the type of a Cloud Spanner value, as might be stored in a +/// table cell or returned from an SQL query. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Type { + /// If code == STRUCT, then `struct_type` + /// provides type information for the struct's fields. + #[serde(rename="structType")] + pub struct_type: Option, + /// Required. The TypeCode for this type. + pub code: Option, + /// If code == ARRAY, then `array_element_type` + /// is the type of the array elements. + #[serde(rename="arrayElementType")] + pub array_element_type: Option>>, +} + +impl Part for Type {} + + +/// Message type to initiate a read-only transaction. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReadOnly { + /// Executes all reads at a timestamp >= `min_read_timestamp`. + /// + /// This is useful for requesting fresher data than some previous + /// read, or data that is fresh enough to observe the effects of some + /// previously committed transaction whose timestamp is known. + /// + /// Note that this option can only be used in single-use transactions. + /// + /// A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + /// Example: `"2014-10-02T15:01:23.045123456Z"`. + #[serde(rename="minReadTimestamp")] + pub min_read_timestamp: Option, + /// If true, the Cloud Spanner-selected read timestamp is included in + /// the Transaction message that describes the transaction. + #[serde(rename="returnReadTimestamp")] + pub return_read_timestamp: Option, + /// Read at a timestamp where all previously committed transactions + /// are visible. + pub strong: Option, + /// Executes all reads at the given timestamp. Unlike other modes, + /// reads at a specific timestamp are repeatable; the same read at + /// the same timestamp always returns the same data. If the + /// timestamp is in the future, the read will block until the + /// specified timestamp, modulo the read's deadline. + /// + /// Useful for large scale consistent reads such as mapreduces, or + /// for coordinating many reads against a consistent snapshot of the + /// data. + /// + /// A timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. + /// Example: `"2014-10-02T15:01:23.045123456Z"`. + #[serde(rename="readTimestamp")] + pub read_timestamp: Option, + /// Read data at a timestamp >= `NOW - max_staleness` + /// seconds. Guarantees that all writes that have committed more + /// than the specified number of seconds ago are visible. Because + /// Cloud Spanner chooses the exact timestamp, this mode works even if + /// the client's local clock is substantially skewed from Cloud Spanner + /// commit timestamps. + /// + /// Useful for reading the freshest data available at a nearby + /// replica, while bounding the possible staleness if the local + /// replica has fallen behind. + /// + /// Note that this option can only be used in single-use + /// transactions. + #[serde(rename="maxStaleness")] + pub max_staleness: Option, + /// Executes all reads at a timestamp that is `exact_staleness` + /// old. The timestamp is chosen soon after the read is started. + /// + /// Guarantees that all writes that have committed more than the + /// specified number of seconds ago are visible. Because Cloud Spanner + /// chooses the exact timestamp, this mode works even if the client's + /// local clock is substantially skewed from Cloud Spanner commit + /// timestamps. + /// + /// Useful for reading at nearby replicas without the distributed + /// timestamp negotiation overhead of `max_staleness`. + #[serde(rename="exactStaleness")] + pub exact_staleness: Option, +} + +impl Part for ReadOnly {} + + +/// A session in the Cloud Spanner API. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases sessions get projects](struct.ProjectInstanceDatabaseSessionGetCall.html) (response) +/// * [instances databases sessions create projects](struct.ProjectInstanceDatabaseSessionCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Session { + /// The labels for the session. + /// + /// * Label keys must be between 1 and 63 characters long and must conform to + /// the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. + /// * Label values must be between 0 and 63 characters long and must conform + /// to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. + /// * No more than 64 labels can be associated with a given session. + /// + /// See https://goo.gl/xmQnxf for more information on and examples of labels. + pub labels: Option>, + /// Output only. The timestamp when the session is created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The approximate timestamp when the session is last used. It is + /// typically earlier than the actual last use time. + #[serde(rename="approximateLastUseTime")] + pub approximate_last_use_time: Option, + /// The name of the session. This is always system-assigned; values provided + /// when creating a session are ignored. + pub name: Option, +} + +impl ResponseResult for Session {} + + +/// The request for UpdateInstance. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances patch projects](struct.ProjectInstancePatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateInstanceRequest { + /// Required. The instance to update, which must always include the instance + /// name. Otherwise, only fields mentioned in field_mask need be included. + pub instance: Option, + /// Required. A mask specifying which fields in Instance should be updated. + /// The field mask must always be specified; this prevents any future fields in + /// Instance from being erased accidentally by clients that do not know + /// about them. + #[serde(rename="fieldMask")] + pub field_mask: Option, +} + +impl RequestValue for UpdateInstanceRequest {} + + +/// Node information for nodes appearing in a QueryPlan.plan_nodes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PlanNode { + /// The `PlanNode`'s index in node list. + pub index: Option, + /// Used to determine the type of node. May be needed for visualizing + /// different kinds of nodes differently. For example, If the node is a + /// SCALAR node, it will have a condensed representation + /// which can be used to directly embed a description of the node in its + /// parent. + pub kind: Option, + /// The display name for the node. + #[serde(rename="displayName")] + pub display_name: Option, + /// The execution statistics associated with the node, contained in a group of + /// key-value pairs. Only present if the plan was returned as a result of a + /// profile query. For example, number of executions, number of rows/time per + /// execution etc. + #[serde(rename="executionStats")] + pub execution_stats: Option>, + /// List of child node `index`es and their relationship to this parent. + #[serde(rename="childLinks")] + pub child_links: Option>, + /// Condensed representation for SCALAR nodes. + #[serde(rename="shortRepresentation")] + pub short_representation: Option, + /// Attributes relevant to the node contained in a group of key-value pairs. + /// For example, a Parameter Reference node could have the following + /// information in its metadata: + /// + /// ````text + /// { + /// "parameter_reference": "param1", + /// "parameter_type": "array" + /// }```` + pub metadata: Option>, +} + +impl Part for PlanNode {} + + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. It is +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. +/// +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + /// A transaction. /// /// # Activities @@ -2302,6 +2607,7 @@ impl ResponseResult for Transaction {} /// /// * [instances databases test iam permissions projects](struct.ProjectInstanceDatabaseTestIamPermissionCall.html) (request) /// * [instances test iam permissions projects](struct.ProjectInstanceTestIamPermissionCall.html) (request) +/// * [instances backups test iam permissions projects](struct.ProjectInstanceBackupTestIamPermissionCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestIamPermissionsRequest { @@ -2313,30 +2619,59 @@ pub struct TestIamPermissionsRequest { impl RequestValue for TestIamPermissionsRequest {} -/// Represents an expression text. Example: +/// Represents a textual expression in the Common Expression Language (CEL) +/// syntax. CEL is a C-like expression language. The syntax and semantics of CEL +/// are documented at https://github.com/google/cel-spec. +/// +/// Example (Comparison): /// /// ````text -/// title: "User account presence" -/// description: "Determines whether the request has a user account" -/// expression: "size(request.user) > 0" +/// title: "Summary size limit" +/// description: "Determines if a summary is less than 100 chars" +/// expression: "document.summary.size() < 100" /// ```` /// +/// Example (Equality): +/// +/// ````text +/// title: "Requestor is owner" +/// description: "Determines if requestor is the document owner" +/// expression: "document.owner == request.auth.claims.email" +/// ```` +/// +/// Example (Logic): +/// +/// ````text +/// title: "Public documents" +/// description: "Determine whether the document should be publicly visible" +/// expression: "document.type != 'private' && document.type != 'internal'" +/// ```` +/// +/// Example (Data Manipulation): +/// +/// ````text +/// title: "Notification string" +/// description: "Create a notification string with a timestamp." +/// expression: "'New message received at ' + string(document.create_time)" +/// ```` +/// +/// The exact variables and functions that may be referenced within an expression +/// are determined by the service that evaluates it. See the service +/// documentation for additional information. +/// /// This type is not used in any activity, and only used as *part* of another schema. #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Expr { - /// An optional description of the expression. This is a longer text which + /// Optional. Description of the expression. This is a longer text which /// describes the expression, e.g. when hovered over it in a UI. pub description: Option, - /// Textual representation of an expression in - /// Common Expression Language syntax. - /// - /// The application context of the containing message determines which - /// well-known feature set of CEL is supported. + /// Textual representation of an expression in Common Expression Language + /// syntax. pub expression: Option, - /// An optional string indicating the location of the expression for error + /// Optional. String indicating the location of the expression for error /// reporting, e.g. a file name and a position in the file. pub location: Option, - /// An optional title for the expression, i.e. a short string describing + /// Optional. Title for the expression, i.e. a short string describing /// its purpose. This can be used e.g. in UIs which allow to enter the /// expression. pub title: Option, @@ -2481,7 +2816,36 @@ pub struct PartialResultSet { impl ResponseResult for PartialResultSet {} -/// The request for ExecuteBatchDml +/// Query optimizer configuration. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct QueryOptions { + /// An option to control the selection of optimizer version. + /// + /// This parameter allows individual queries to pick different query + /// optimizer versions. + /// + /// Specifying "latest" as a value instructs Cloud Spanner to use the + /// latest supported query optimizer version. If not specified, Cloud Spanner + /// uses optimizer version set at the database level options. Any other + /// positive integer (from the list of supported optimizer versions) + /// overrides the default optimizer version for query execution. + /// The list of supported optimizer versions can be queried from + /// SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. Executing a SQL statement + /// with an invalid optimizer version will fail with a syntax error + /// (`INVALID_ARGUMENT`) status. + /// + /// The `optimizer_version` statement hint has precedence over this setting. + #[serde(rename="optimizerVersion")] + pub optimizer_version: Option, +} + +impl Part for QueryOptions {} + + +/// The request for ExecuteBatchDml. /// /// # Activities /// @@ -2492,27 +2856,87 @@ impl ResponseResult for PartialResultSet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ExecuteBatchDmlRequest { - /// A per-transaction sequence number used to identify this request. This is - /// used in the same space as the seqno in - /// ExecuteSqlRequest. See more details - /// in ExecuteSqlRequest. - pub seqno: Option, - /// The transaction to use. A ReadWrite transaction is required. Single-use - /// transactions are not supported (to avoid replay). The caller must either - /// supply an existing transaction ID or begin a new transaction. - pub transaction: Option, - /// The list of statements to execute in this batch. Statements are executed - /// serially, such that the effects of statement i are visible to statement - /// i+1. Each statement must be a DML statement. Execution will stop at the - /// first failed statement; the remaining statements will not run. + /// Required. A per-transaction sequence number used to identify this request. This field + /// makes each request idempotent such that if the request is received multiple + /// times, at most one will succeed. /// - /// REQUIRES: `statements_size()` > 0. + /// The sequence number must be monotonically increasing within the + /// transaction. If a request arrives for the first time with an out-of-order + /// sequence number, the transaction may be aborted. Replays of previously + /// handled requests will yield the same response as the first execution. + pub seqno: Option, + /// Required. The transaction to use. Must be a read-write transaction. + /// + /// To protect against replays, single-use transactions are not supported. The + /// caller must either supply an existing transaction ID or begin a new + /// transaction. + pub transaction: Option, + /// Required. The list of statements to execute in this batch. Statements are executed + /// serially, such that the effects of statement `i` are visible to statement + /// `i+1`. Each statement must be a DML statement. Execution stops at the + /// first failed statement; the remaining statements are not executed. + /// + /// Callers must provide at least one statement. pub statements: Option>, } impl RequestValue for ExecuteBatchDmlRequest {} +/// Enqueues the given DDL statements to be applied, in order but not +/// necessarily all at once, to the database schema at some point (or +/// points) in the future. The server checks that the statements +/// are executable (syntactically valid, name tables that exist, etc.) +/// before enqueueing them, but they may still fail upon +/// later execution (e.g., if a statement from another batch of +/// statements is applied first and it conflicts in some way, or if +/// there is some data-related problem like a `NULL` value in a column to +/// which `NOT NULL` would be added). If a statement fails, all +/// subsequent statements in the batch are automatically cancelled. +/// +/// Each batch of statements is assigned a name which can be used with +/// the Operations API to monitor +/// progress. See the +/// operation_id field for more +/// details. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances databases update ddl projects](struct.ProjectInstanceDatabaseUpdateDdlCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateDatabaseDdlRequest { + /// Required. DDL statements to be applied to the database. + pub statements: Option>, + /// If empty, the new update request is assigned an + /// automatically-generated operation ID. Otherwise, `operation_id` + /// is used to construct the name of the resulting + /// Operation. + /// + /// Specifying an explicit operation ID simplifies determining + /// whether the statements were executed in the event that the + /// UpdateDatabaseDdl call is replayed, + /// or the return value is otherwise lost: the database and + /// `operation_id` fields can be combined to form the + /// name of the resulting + /// longrunning.Operation: `/operations/`. + /// + /// `operation_id` should be unique within the database, and must be + /// a valid identifier: `a-z*`. Note that + /// automatically-generated operation IDs always begin with an + /// underscore. If the named operation already exists, + /// UpdateDatabaseDdl returns + /// `ALREADY_EXISTS`. + #[serde(rename="operationId")] + pub operation_id: Option, +} + +impl RequestValue for UpdateDatabaseDdlRequest {} + + /// The request for ExecuteSql and /// ExecuteStreamingSql. /// @@ -2526,21 +2950,18 @@ impl RequestValue for ExecuteBatchDmlRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ExecuteSqlRequest { - /// The transaction to use. If none is provided, the default is a - /// temporary read-only transaction with strong concurrency. - /// /// The transaction to use. /// /// For queries, if none is provided, the default is a temporary read-only /// transaction with strong concurrency. /// - /// Standard DML statements require a ReadWrite transaction. Single-use - /// transactions are not supported (to avoid replay). The caller must - /// either supply an existing transaction ID or begin a new transaction. + /// Standard DML statements require a read-write transaction. To protect + /// against replays, single-use transactions are not supported. The caller + /// must either supply an existing transaction ID or begin a new transaction. /// - /// Partitioned DML requires an existing PartitionedDml transaction ID. + /// Partitioned DML requires an existing Partitioned DML transaction ID. pub transaction: Option, - /// A per-transaction sequence number used to identify this request. This + /// A per-transaction sequence number used to identify this request. This field /// makes each request idempotent such that if the request is received multiple /// times, at most one will succeed. /// @@ -2575,6 +2996,9 @@ pub struct ExecuteSqlRequest { /// about SQL types. #[serde(rename="paramTypes")] pub param_types: Option>, + /// Query optimizer configuration to use for the given query. + #[serde(rename="queryOptions")] + pub query_options: Option, /// Used to control the amount of debugging information returned in /// ResultSetStats. If partition_token is set, query_mode can only /// be set to QueryMode.NORMAL. @@ -2582,20 +3006,18 @@ pub struct ExecuteSqlRequest { pub query_mode: Option, /// Required. The SQL string. pub sql: Option, - /// The SQL string can contain parameter placeholders. A parameter - /// placeholder consists of `'@'` followed by the parameter - /// name. Parameter names consist of any combination of letters, - /// numbers, and underscores. + /// Parameter names and values that bind to placeholders in the SQL string. + /// + /// A parameter placeholder consists of the `@` character followed by the + /// parameter name (for example, `@firstName`). Parameter names can contain + /// letters, numbers, and underscores. /// /// Parameters can appear anywhere that a literal value is expected. The same /// parameter name can be used more than once, for example: - /// `"WHERE id > @msg_id AND id < @msg_id + 100"` /// - /// It is an error to execute an SQL statement with unbound parameters. + /// `"WHERE id > @msg_id AND id < @msg_id + 100"` /// - /// Parameter values are specified using `params`, which is a JSON - /// object whose keys are parameter names, and whose values are the - /// corresponding parameter values. + /// It is an error to execute a SQL statement with unbound parameters. pub params: Option>, } @@ -2635,7 +3057,10 @@ impl ResponseResult for InstanceConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Delete { - /// Required. The primary keys of the rows within table to delete. + /// Required. The primary keys of the rows within table to delete. The + /// primary keys must be specified in the order in which they appear in the + /// `PRIMARY KEY()` clause of the table's equivalent DDL statement (the DDL + /// statement used to create the table). /// Delete is idempotent. The transaction will succeed even if some or all /// rows do not exist. #[serde(rename="keySet")] @@ -2689,6 +3114,7 @@ impl RequestValue for CommitRequest {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [instances databases operations list projects](struct.ProjectInstanceDatabaseOperationListCall.html) (response) +/// * [instances backups operations list projects](struct.ProjectInstanceBackupOperationListCall.html) (response) /// * [instances operations list projects](struct.ProjectInstanceOperationListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -2703,6 +3129,27 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} +/// Encapsulates settings provided to GetIamPolicy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPolicyOptions { + /// Optional. The policy format version to be returned. + /// + /// Valid values are 0, 1, and 3. Requests specifying an invalid value will be + /// rejected. + /// + /// Requests for policies with any conditional bindings must specify version 3. + /// Policies without any conditional bindings may specify any valid value or + /// leave the field unset. + #[serde(rename="requestedPolicyVersion")] + pub requested_policy_version: Option, +} + +impl Part for GetPolicyOptions {} + + /// The request for BeginTransaction. /// /// # Activities @@ -2818,7 +3265,7 @@ impl Part for ShortRepresentation {} /// ::default(), None); /// let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `instance_configs_get(...)`, `instance_configs_list(...)`, `instances_create(...)`, `instances_databases_create(...)`, `instances_databases_drop_database(...)`, `instances_databases_get(...)`, `instances_databases_get_ddl(...)`, `instances_databases_get_iam_policy(...)`, `instances_databases_list(...)`, `instances_databases_operations_cancel(...)`, `instances_databases_operations_delete(...)`, `instances_databases_operations_get(...)`, `instances_databases_operations_list(...)`, `instances_databases_sessions_begin_transaction(...)`, `instances_databases_sessions_commit(...)`, `instances_databases_sessions_create(...)`, `instances_databases_sessions_delete(...)`, `instances_databases_sessions_execute_batch_dml(...)`, `instances_databases_sessions_execute_sql(...)`, `instances_databases_sessions_execute_streaming_sql(...)`, `instances_databases_sessions_get(...)`, `instances_databases_sessions_list(...)`, `instances_databases_sessions_partition_query(...)`, `instances_databases_sessions_partition_read(...)`, `instances_databases_sessions_read(...)`, `instances_databases_sessions_rollback(...)`, `instances_databases_sessions_streaming_read(...)`, `instances_databases_set_iam_policy(...)`, `instances_databases_test_iam_permissions(...)`, `instances_databases_update_ddl(...)`, `instances_delete(...)`, `instances_get(...)`, `instances_get_iam_policy(...)`, `instances_list(...)`, `instances_operations_cancel(...)`, `instances_operations_delete(...)`, `instances_operations_get(...)`, `instances_operations_list(...)`, `instances_patch(...)`, `instances_set_iam_policy(...)` and `instances_test_iam_permissions(...)` +/// // like `instance_configs_get(...)`, `instance_configs_list(...)`, `instances_backup_operations_list(...)`, `instances_backups_create(...)`, `instances_backups_delete(...)`, `instances_backups_get(...)`, `instances_backups_get_iam_policy(...)`, `instances_backups_list(...)`, `instances_backups_operations_cancel(...)`, `instances_backups_operations_delete(...)`, `instances_backups_operations_get(...)`, `instances_backups_operations_list(...)`, `instances_backups_patch(...)`, `instances_backups_set_iam_policy(...)`, `instances_backups_test_iam_permissions(...)`, `instances_create(...)`, `instances_database_operations_list(...)`, `instances_databases_create(...)`, `instances_databases_drop_database(...)`, `instances_databases_get(...)`, `instances_databases_get_ddl(...)`, `instances_databases_get_iam_policy(...)`, `instances_databases_list(...)`, `instances_databases_operations_cancel(...)`, `instances_databases_operations_delete(...)`, `instances_databases_operations_get(...)`, `instances_databases_operations_list(...)`, `instances_databases_restore(...)`, `instances_databases_sessions_batch_create(...)`, `instances_databases_sessions_begin_transaction(...)`, `instances_databases_sessions_commit(...)`, `instances_databases_sessions_create(...)`, `instances_databases_sessions_delete(...)`, `instances_databases_sessions_execute_batch_dml(...)`, `instances_databases_sessions_execute_sql(...)`, `instances_databases_sessions_execute_streaming_sql(...)`, `instances_databases_sessions_get(...)`, `instances_databases_sessions_list(...)`, `instances_databases_sessions_partition_query(...)`, `instances_databases_sessions_partition_read(...)`, `instances_databases_sessions_read(...)`, `instances_databases_sessions_rollback(...)`, `instances_databases_sessions_streaming_read(...)`, `instances_databases_set_iam_policy(...)`, `instances_databases_test_iam_permissions(...)`, `instances_databases_update_ddl(...)`, `instances_delete(...)`, `instances_get(...)`, `instances_get_iam_policy(...)`, `instances_list(...)`, `instances_operations_cancel(...)`, `instances_operations_delete(...)`, `instances_operations_get(...)`, `instances_operations_list(...)`, `instances_patch(...)`, `instances_set_iam_policy(...)` and `instances_test_iam_permissions(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2931,22 +3378,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the access control policy for a database resource. - /// Returns an empty policy if a database exists but does - /// not have a policy set. - /// - /// Authorization requires `spanner.databases.getIamPolicy` permission on - /// resource. + /// Lists the backup long-running operations in + /// the given instance. A backup operation has a name of the form + /// `projects//instances//backups//operations/`. + /// The long-running operation + /// metadata field type + /// `metadata.type_url` describes the type of the metadata. Operations returned + /// include those that have completed/failed/canceled within the last 7 days, + /// and pending operations. Operations returned are ordered by + /// `operation.metadata.value.progress.start_time` in descending order starting + /// from the most recently started operation. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. - pub fn instances_databases_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { - ProjectInstanceDatabaseGetIamPolicyCall { + /// * `parent` - Required. The instance of the backup operations. Values are of + /// the form `projects//instances/`. + pub fn instances_backup_operations_list(&self, parent: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + ProjectInstanceBackupOperationListCall { hub: self.hub, - _request: request, - _resource: resource.to_string(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2990,21 +3443,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// to be run with lower latency than submitting them sequentially with /// ExecuteSql. /// - /// Statements are executed in order, sequentially. - /// ExecuteBatchDmlResponse will contain a - /// ResultSet for each DML statement that has successfully executed. If a - /// statement fails, its error status will be returned as part of the - /// ExecuteBatchDmlResponse. Execution will - /// stop at the first failed statement; the remaining statements will not run. + /// Statements are executed in sequential order. A request can succeed even if + /// a statement fails. The ExecuteBatchDmlResponse.status field in the + /// response provides information about the statement that failed. Clients must + /// inspect this field to determine whether an error occurred. /// - /// ExecuteBatchDml is expected to return an OK status with a response even if - /// there was an error while processing one of the DML statements. Clients must - /// inspect response.status to determine if there were any errors while - /// processing the request. - /// - /// See more details in - /// ExecuteBatchDmlRequest and - /// ExecuteBatchDmlResponse. + /// Execution stops after the first failed statement; the remaining statements + /// are not executed. /// /// # Arguments /// @@ -3046,19 +3491,48 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns permissions that the caller has on the specified database resource. + /// Deletes an instance. /// - /// Attempting this RPC on a non-existent Cloud Spanner database will - /// result in a NOT_FOUND error if the user has - /// `spanner.databases.list` permission on the containing Cloud - /// Spanner instance. Otherwise returns an empty set of permissions. + /// Immediately upon completion of the request: + /// + /// * Billing ceases for all of the instance's reserved resources. + /// + /// Soon afterward: + /// + /// * The instance and *all of its databases* immediately and + /// irrevocably disappear from the API. All data in the databases + /// is permanently deleted. + /// + /// # Arguments + /// + /// * `name` - Required. The name of the instance to be deleted. Values are of the form + /// `projects//instances/` + pub fn instances_delete(&self, name: &str) -> ProjectInstanceDeleteCall<'a, C, A> { + ProjectInstanceDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on a database or backup resource. + /// Replaces any existing policy. + /// + /// Authorization requires `spanner.databases.setIamPolicy` + /// permission on resource. + /// For backups, authorization requires `spanner.backups.setIamPolicy` + /// permission on resource. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. - pub fn instances_databases_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { - ProjectInstanceDatabaseTestIamPermissionCall { + /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + pub fn instances_backups_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectInstanceBackupSetIamPolicyCall<'a, C, A> { + ProjectInstanceBackupSetIamPolicyCall { hub: self.hub, _request: request, _resource: resource.to_string(), @@ -3126,6 +3600,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { ProjectInstanceGetCall { hub: self.hub, _name: name.to_string(), + _field_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3176,19 +3651,34 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all instances in the given project. + /// Starts creating a new Cloud Spanner Backup. + /// The returned backup long-running operation + /// will have a name of the format + /// `projects//instances//backups//operations/` + /// and can be used to track creation of the backup. The + /// metadata field type is + /// CreateBackupMetadata. The + /// response field type is + /// Backup, if successful. Cancelling the returned operation will stop the + /// creation and delete the backup. + /// There can be only one pending backup creation per database. Backup creation + /// of different databases can run concurrently. /// /// # Arguments /// - /// * `parent` - Required. The name of the project for which a list of instances is - /// requested. Values are of the form `projects/`. - pub fn instances_list(&self, parent: &str) -> ProjectInstanceListCall<'a, C, A> { - ProjectInstanceListCall { + /// * `request` - No description provided. + /// * `parent` - Required. The name of the instance in which the backup will be + /// created. This must be the same instance that contains the database the + /// backup will be created from. The backup will be stored in the + /// location(s) specified in the instance configuration of this + /// instance. Values are of the form + /// `projects//instances/`. + pub fn instances_backups_create(&self, request: Backup, parent: &str) -> ProjectInstanceBackupCreateCall<'a, C, A> { + ProjectInstanceBackupCreateCall { hub: self.hub, + _request: request, _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), + _backup_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3208,9 +3698,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// transaction internally, and count toward the one transaction /// limit. /// - /// Cloud Spanner limits the number of sessions that can exist at any given - /// time; thus, it is a good idea to delete idle and/or unneeded sessions. - /// Aside from explicit deletes, Cloud Spanner can delete sessions for which no + /// Active sessions use additional server resources, so it is a good idea to + /// delete idle and unneeded sessions. + /// Aside from explicit deletes, Cloud Spanner may delete sessions for which no /// operations are sent for more than an hour. If a session is deleted, /// requests to it return `NOT_FOUND`. /// @@ -3259,6 +3749,35 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// NOTE: the `name` binding allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. To + /// override the binding, API services can add a binding such as + /// `"/v1/{name=users/*}/operations"` to their service configuration. + /// For backwards compatibility, the default name includes the operations + /// collection id, however overriding users must ensure the name binding + /// is the parent resource, without the operations collection id. + /// + /// # Arguments + /// + /// * `name` - The name of the operation's parent resource. + pub fn instances_backups_operations_list(&self, name: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + ProjectInstanceBackupOperationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the schema of a Cloud Spanner database by @@ -3286,11 +3805,34 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on a database resource. + /// Lists all instances in the given project. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project for which a list of instances is + /// requested. Values are of the form `projects/`. + pub fn instances_list(&self, parent: &str) -> ProjectInstanceListCall<'a, C, A> { + ProjectInstanceListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on a database or backup resource. /// Replaces any existing policy. /// /// Authorization requires `spanner.databases.setIamPolicy` /// permission on resource. + /// For backups, authorization requires `spanner.backups.setIamPolicy` + /// permission on resource. /// /// # Arguments /// @@ -3309,59 +3851,97 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an instance, and begins allocating or releasing resources - /// as requested. The returned long-running - /// operation can be used to track the - /// progress of updating the instance. If the named instance does not - /// exist, returns `NOT_FOUND`. + /// Gets metadata on a pending or completed Backup. /// - /// Immediately upon completion of this request: + /// # Arguments + /// + /// * `name` - Required. Name of the backup. + /// Values are of the form + /// `projects//instances//backups/`. + pub fn instances_backups_get(&self, name: &str) -> ProjectInstanceBackupGetCall<'a, C, A> { + ProjectInstanceBackupGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists database longrunning-operations. + /// A database operation has a name of the form + /// `projects//instances//databases//operations/`. + /// The long-running operation + /// metadata field type + /// `metadata.type_url` describes the type of the metadata. Operations returned + /// include those that have completed/failed/canceled within the last 7 days, + /// and pending operations. /// - /// * For resource types for which a decrease in the instance's allocation - /// has been requested, billing is based on the newly-requested level. + /// # Arguments + /// + /// * `parent` - Required. The instance of the database operations. + /// Values are of the form `projects//instances/`. + pub fn instances_database_operations_list(&self, parent: &str) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + ProjectInstanceDatabaseOperationListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates multiple new sessions. /// - /// Until completion of the returned operation: - /// - /// * Cancelling the operation sets its metadata's - /// cancel_time, and begins - /// restoring resources to their pre-request values. The operation - /// is guaranteed to succeed at undoing all resource changes, - /// after which point it terminates with a `CANCELLED` status. - /// * All other attempts to modify the instance are rejected. - /// * Reading the instance via the API continues to give the pre-request - /// resource levels. - /// - /// Upon completion of the returned operation: - /// - /// * Billing begins for all successfully-allocated resources (some types - /// may have lower than the requested levels). - /// * All newly-reserved resources are available for serving the instance's - /// tables. - /// * The instance's new resource levels are readable via the API. - /// - /// The returned long-running operation will - /// have a name of the format `/operations/` and - /// can be used to track the instance modification. The - /// metadata field type is - /// UpdateInstanceMetadata. - /// The response field type is - /// Instance, if successful. - /// - /// Authorization requires `spanner.instances.update` permission on - /// resource name. + /// This API can be used to initialize a session cache on the clients. + /// See https://goo.gl/TgSFN2 for best practices on session cache management. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. A unique identifier for the instance, which cannot be changed - /// after the instance is created. Values are of the form - /// `projects//instances/a-z*[a-z0-9]`. The final - /// segment of the name must be between 2 and 64 characters in length. - pub fn instances_patch(&self, request: UpdateInstanceRequest, name: &str) -> ProjectInstancePatchCall<'a, C, A> { - ProjectInstancePatchCall { + /// * `database` - Required. The database in which the new sessions are created. + pub fn instances_databases_sessions_batch_create(&self, request: BatchCreateSessionsRequest, database: &str) -> ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> { + ProjectInstanceDatabaseSessionBatchCreateCall { + hub: self.hub, + _request: request, + _database: database.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a pending or completed Backup. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only for the CreateBackup operation. + /// Required for the UpdateBackup operation. + /// A globally unique identifier for the backup which cannot be + /// changed. Values are of the form + /// `projects//instances//backups/a-z*[a-z0-9]` + /// The final segment of the name must be between 2 and 60 characters + /// in length. + /// The backup is stored in the location(s) specified in the instance + /// configuration of the instance containing the backup, identified + /// by the prefix of the backup name of the form + /// `projects//instances/`. + pub fn instances_backups_patch(&self, request: Backup, name: &str) -> ProjectInstanceBackupPatchCall<'a, C, A> { + ProjectInstanceBackupPatchCall { hub: self.hub, _request: request, _name: name.to_string(), + _update_mask: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3458,6 +4038,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn instances_backups_operations_delete(&self, name: &str) -> ProjectInstanceBackupOperationDeleteCall<'a, C, A> { + ProjectInstanceBackupOperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Returns the schema of a Cloud Spanner database as a list of formatted @@ -3477,6 +4077,67 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an instance, and begins allocating or releasing resources + /// as requested. The returned long-running + /// operation can be used to track the + /// progress of updating the instance. If the named instance does not + /// exist, returns `NOT_FOUND`. + /// + /// Immediately upon completion of this request: + /// + /// * For resource types for which a decrease in the instance's allocation + /// has been requested, billing is based on the newly-requested level. + /// + /// Until completion of the returned operation: + /// + /// * Cancelling the operation sets its metadata's + /// cancel_time, and begins + /// restoring resources to their pre-request values. The operation + /// is guaranteed to succeed at undoing all resource changes, + /// after which point it terminates with a `CANCELLED` status. + /// * All other attempts to modify the instance are rejected. + /// * Reading the instance via the API continues to give the pre-request + /// resource levels. + /// + /// Upon completion of the returned operation: + /// + /// * Billing begins for all successfully-allocated resources (some types + /// may have lower than the requested levels). + /// * All newly-reserved resources are available for serving the instance's + /// tables. + /// * The instance's new resource levels are readable via the API. + /// + /// The returned long-running operation will + /// have a name of the format `/operations/` and + /// can be used to track the instance modification. The + /// metadata field type is + /// UpdateInstanceMetadata. + /// The response field type is + /// Instance, if successful. + /// + /// Authorization requires `spanner.instances.update` permission on + /// resource name. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. A unique identifier for the instance, which cannot be changed + /// after the instance is created. Values are of the form + /// `projects//instances/a-z*[a-z0-9]`. The final + /// segment of the name must be between 2 and 64 characters in length. + pub fn instances_patch(&self, request: UpdateInstanceRequest, name: &str) -> ProjectInstancePatchCall<'a, C, A> { + ProjectInstancePatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Begins a new transaction. This step can often be skipped: @@ -3530,19 +4191,63 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the supported instance configurations for a given project. + /// Gets the access control policy for a database or backup resource. + /// Returns an empty policy if a database or backup exists but does not have a + /// policy set. + /// + /// Authorization requires `spanner.databases.getIamPolicy` permission on + /// resource. + /// For backups, authorization requires `spanner.backups.getIamPolicy` + /// permission on resource. /// /// # Arguments /// - /// * `parent` - Required. The name of the project for which a list of supported instance - /// configurations is requested. Values are of the form - /// `projects/`. - pub fn instance_configs_list(&self, parent: &str) -> ProjectInstanceConfigListCall<'a, C, A> { - ProjectInstanceConfigListCall { + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_backups_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceBackupGetIamPolicyCall<'a, C, A> { + ProjectInstanceBackupGetIamPolicyCall { hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new database by restoring from a completed backup. The new + /// database must be in the same project and in an instance with the same + /// instance configuration as the instance containing + /// the backup. The returned database long-running + /// operation has a name of the format + /// `projects//instances//databases//operations/`, + /// and can be used to track the progress of the operation, and to cancel it. + /// The metadata field type is + /// RestoreDatabaseMetadata. + /// The response type + /// is Database, if + /// successful. Cancelling the returned operation will stop the restore and + /// delete the database. + /// There can be only one database being restored into an instance at a time. + /// Once the restore operation completes, a new restore operation can be + /// initiated, without waiting for the optimize operation associated with the + /// first restore to complete. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the instance in which to create the + /// restored database. This instance must be in the same project and + /// have the same instance configuration as the instance containing + /// the source backup. Values are of the form + /// `projects//instances/`. + pub fn instances_databases_restore(&self, request: RestoreDatabaseRequest, parent: &str) -> ProjectInstanceDatabaseRestoreCall<'a, C, A> { + ProjectInstanceDatabaseRestoreCall { + hub: self.hub, + _request: request, _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3580,6 +4285,34 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that the caller has on the specified database or backup + /// resource. + /// + /// Attempting this RPC on a non-existent Cloud Spanner database will + /// result in a NOT_FOUND error if the user has + /// `spanner.databases.list` permission on the containing Cloud + /// Spanner instance. Otherwise returns an empty set of permissions. + /// Calling this method on a backup that does not exist will + /// result in a NOT_FOUND error if the user has + /// `spanner.backups.list` permission on the containing instance. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_databases_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + ProjectInstanceDatabaseTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Like ExecuteSql, except returns the result @@ -3603,6 +4336,27 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the supported instance configurations for a given project. + /// + /// # Arguments + /// + /// * `parent` - Required. The name of the project for which a list of supported instance + /// configurations is requested. Values are of the form + /// `projects/`. + pub fn instance_configs_list(&self, parent: &str) -> ProjectInstanceConfigListCall<'a, C, A> { + ProjectInstanceConfigListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the latest state of a long-running operation. Clients can use this @@ -3650,18 +4404,24 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all sessions in a given database. + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// Operations.GetOperation or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an Operation.error value with a google.rpc.Status.code of 1, + /// corresponding to `Code.CANCELLED`. /// /// # Arguments /// - /// * `database` - Required. The database in which to list sessions. - pub fn instances_databases_sessions_list(&self, database: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { - ProjectInstanceDatabaseSessionListCall { + /// * `name` - The name of the operation resource to be cancelled. + pub fn instances_backups_operations_cancel(&self, name: &str) -> ProjectInstanceBackupOperationCancelCall<'a, C, A> { + ProjectInstanceBackupOperationCancelCall { hub: self.hub, - _database: database.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3753,6 +4513,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Drops (aka deletes) a Cloud Spanner database. + /// Completed backups for the database will be retained according to their + /// `expire_time`. /// /// # Arguments /// @@ -3767,6 +4529,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn instances_backups_operations_get(&self, name: &str) -> ProjectInstanceBackupOperationGetCall<'a, C, A> { + ProjectInstanceBackupOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a long-running operation. This method indicates that the client is @@ -3787,6 +4568,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all sessions in a given database. + /// + /// # Arguments + /// + /// * `database` - Required. The database in which to list sessions. + pub fn instances_databases_sessions_list(&self, database: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + ProjectInstanceDatabaseSessionListCall { + hub: self.hub, + _database: database.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Deletes a long-running operation. This method indicates that the client is @@ -3809,26 +4610,75 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an instance. + /// Gets the access control policy for a database or backup resource. + /// Returns an empty policy if a database or backup exists but does not have a + /// policy set. /// - /// Immediately upon completion of the request: - /// - /// * Billing ceases for all of the instance's reserved resources. - /// - /// Soon afterward: - /// - /// * The instance and *all of its databases* immediately and - /// irrevocably disappear from the API. All data in the databases - /// is permanently deleted. + /// Authorization requires `spanner.databases.getIamPolicy` permission on + /// resource. + /// For backups, authorization requires `spanner.backups.getIamPolicy` + /// permission on resource. /// /// # Arguments /// - /// * `name` - Required. The name of the instance to be deleted. Values are of the form - /// `projects//instances/` - pub fn instances_delete(&self, name: &str) -> ProjectInstanceDeleteCall<'a, C, A> { - ProjectInstanceDeleteCall { + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_databases_get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { + ProjectInstanceDatabaseGetIamPolicyCall { hub: self.hub, - _name: name.to_string(), + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists completed and pending backups. + /// Backups returned are ordered by `create_time` in descending order, + /// starting from the most recent `create_time`. + /// + /// # Arguments + /// + /// * `parent` - Required. The instance to list backups from. Values are of the + /// form `projects//instances/`. + pub fn instances_backups_list(&self, parent: &str) -> ProjectInstanceBackupListCall<'a, C, A> { + ProjectInstanceBackupListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that the caller has on the specified database or backup + /// resource. + /// + /// Attempting this RPC on a non-existent Cloud Spanner database will + /// result in a NOT_FOUND error if the user has + /// `spanner.databases.list` permission on the containing Cloud + /// Spanner instance. Otherwise returns an empty set of permissions. + /// Calling this method on a backup that does not exist will + /// result in a NOT_FOUND error if the user has + /// `spanner.backups.list` permission on the containing instance. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + pub fn instances_backups_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectInstanceBackupTestIamPermissionCall<'a, C, A> { + ProjectInstanceBackupTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3879,6 +4729,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a pending or completed Backup. + /// + /// # Arguments + /// + /// * `name` - Required. Name of the backup to delete. + /// Values are of the form + /// `projects//instances//backups/`. + pub fn instances_backups_delete(&self, name: &str) -> ProjectInstanceBackupDeleteCall<'a, C, A> { + ProjectInstanceBackupDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -4996,14 +5865,18 @@ impl<'a, C, A> ProjectInstanceGetIamPolicyCall<'a, C, A> where C: BorrowMut/instances//backups//operations/`. +/// The long-running operation +/// metadata field type +/// `metadata.type_url` describes the type of the metadata. Operations returned +/// include those that have completed/failed/canceled within the last 7 days, +/// and pending operations. Operations returned are ordered by +/// `operation.metadata.value.progress.start_time` in descending order starting +/// from the most recently started operation. /// -/// A builder for the *instances.databases.getIamPolicy* method supported by a *project* resource. +/// A builder for the *instances.backupOperations.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -5015,7 +5888,6 @@ impl<'a, C, A> ProjectInstanceGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectInstanceGetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GetIamPolicyRequest::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().instances_databases_get_iam_policy(req, "resource") +/// let result = hub.projects().instances_backup_operations_list("parent") +/// .page_token("takimata") +/// .page_size(-70) +/// .filter("amet.") /// .doit(); /// # } /// ``` -pub struct ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> +pub struct ProjectInstanceBackupOperationListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Spanner, - _request: GetIamPolicyRequest, - _resource: String, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceBackupOperationListCall<'a, C, A> {} -impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceBackupOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBackupOperationsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -5064,11 +5936,20 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.getIamPolicy", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("resource", self._resource.to_string())); - for &field in ["alt", "resource"].iter() { + dlg.begin(MethodInfo { id: "spanner.projects.instances.backupOperations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5080,12 +5961,12 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + let mut url = self.hub._base_url.clone() + "v1/{+parent}/backupOperations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -5100,7 +5981,7 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["resource"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5112,17 +5993,6 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow let url = hyper::Url::parse_with_params(&url, params).unwrap(); - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -5139,15 +6009,11 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow } }; let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -5198,23 +6064,77 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow } + /// Required. The instance of the backup operations. Values are of + /// the form `projects//instances/`. /// - /// Sets the *request* property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { - self._request = new_value; + pub fn parent(mut self, new_value: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._parent = new_value.to_string(); self } - /// REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// If non-empty, `page_token` should contain a + /// next_page_token + /// from a previous ListBackupOperationsResponse to the + /// same `parent` and with the same `filter`. /// - /// Sets the *resource* path property to the given value. + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of operations to be returned in the response. If 0 or + /// less, defaults to the server's maximum allowed page size. /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { - self._resource = new_value.to_string(); + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// An expression that filters the list of returned backup operations. + /// + /// A filter expression consists of a field name, a + /// comparison operator, and a value for filtering. + /// The value must be a string, a number, or a boolean. The comparison operator + /// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + /// Colon `:` is the contains operator. Filter rules are not case sensitive. + /// + /// The following fields in the operation + /// are eligible for filtering: + /// + /// * `name` - The name of the long-running operation + /// * `done` - False if the operation is in progress, else true. + /// * `metadata.@type` - the type of metadata. For example, the type string + /// for CreateBackupMetadata is + /// `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. + /// * `metadata.` - any field in metadata.value. + /// * `error` - Error associated with the long-running operation. + /// * `response.@type` - the type of response. + /// * `response.` - any field in response.value. + /// + /// You can combine multiple expressions by enclosing each expression in + /// parentheses. By default, expressions are combined with AND logic, but + /// you can specify AND, OR, and NOT logic explicitly. + /// + /// Here are a few examples: + /// + /// * `done:true` - The operation is complete. + /// * `metadata.database:prod` - The database the backup was taken from has + /// a name containing the string "prod". + /// * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`
          + /// `(metadata.name:howl) AND`
          + /// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
          + /// `(error:*)` - Returns operations where: + /// * The operation's metadata type is CreateBackupMetadata. + /// * The backup name contains the string "howl". + /// * The operation started before 2018-03-28T14:50:00Z. + /// * The operation resulted in an error. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -5223,7 +6143,7 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupOperationListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5248,7 +6168,7 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupOperationListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5268,7 +6188,7 @@ impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: Borrow /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupOperationListCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -5575,21 +6495,13 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionReadCall<'a, C, A> where C: BorrowM /// to be run with lower latency than submitting them sequentially with /// ExecuteSql. /// -/// Statements are executed in order, sequentially. -/// ExecuteBatchDmlResponse will contain a -/// ResultSet for each DML statement that has successfully executed. If a -/// statement fails, its error status will be returned as part of the -/// ExecuteBatchDmlResponse. Execution will -/// stop at the first failed statement; the remaining statements will not run. +/// Statements are executed in sequential order. A request can succeed even if +/// a statement fails. The ExecuteBatchDmlResponse.status field in the +/// response provides information about the statement that failed. Clients must +/// inspect this field to determine whether an error occurred. /// -/// ExecuteBatchDml is expected to return an OK status with a response even if -/// there was an error while processing one of the DML statements. Clients must -/// inspect response.status to determine if there were any errors while -/// processing the request. -/// -/// See more details in -/// ExecuteBatchDmlRequest and -/// ExecuteBatchDmlResponse. +/// Execution stops after the first failed statement; the remaining statements +/// are not executed. /// /// A builder for the *instances.databases.sessions.executeBatchDml* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -6151,14 +7063,19 @@ impl<'a, C, A> ProjectInstanceSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectInstanceSetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the instance to be deleted. Values are of the form + /// `projects//instances/` + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on a database or backup resource. +/// Replaces any existing policy. +/// +/// Authorization requires `spanner.databases.setIamPolicy` +/// permission on resource. +/// For backups, authorization requires `spanner.backups.setIamPolicy` +/// permission on resource. +/// +/// A builder for the *instances.backups.setIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::SetIamPolicyRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -6184,33 +7356,33 @@ impl<'a, C, A> ProjectInstanceSetIamPolicyCall<'a, C, A> where C: BorrowMut +pub struct ProjectInstanceBackupSetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Spanner, - _request: TestIamPermissionsRequest, + _request: SetIamPolicyRequest, _resource: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceBackupSetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceBackupSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -6219,7 +7391,7 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.testIamPermissions", + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.setIamPolicy", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("resource", self._resource.to_string())); @@ -6235,7 +7407,7 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + let mut url = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6358,17 +7530,17 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectInstanceBackupSetIamPolicyCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. /// /// Sets the *resource* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + pub fn resource(mut self, new_value: &str) -> ProjectInstanceBackupSetIamPolicyCall<'a, C, A> { self._resource = new_value.to_string(); self } @@ -6378,7 +7550,7 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupSetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6403,7 +7575,7 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupSetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6423,7 +7595,7 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupSetIamPolicyCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -6463,8 +7635,8 @@ impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: B /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().instances_databases_list("parent") -/// .page_token("sea") -/// .page_size(-90) +/// .page_token("sadipscing") +/// .page_size(-31) /// .doit(); /// # } /// ``` @@ -7025,6 +8197,7 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionRollbackCall<'a, C, A> where C: Bor /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().instances_get("name") +/// .field_mask("justo") /// .doit(); /// # } /// ``` @@ -7033,6 +8206,7 @@ pub struct ProjectInstanceGetCall<'a, C, A> hub: &'a Spanner, _name: String, + _field_mask: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7055,9 +8229,12 @@ impl<'a, C, A> ProjectInstanceGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._field_mask { + params.push(("fieldMask", value.to_string())); + } + for &field in ["alt", "name", "fieldMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7183,6 +8360,15 @@ impl<'a, C, A> ProjectInstanceGetCall<'a, C, A> where C: BorrowMut ProjectInstanceGetCall<'a, C, A> { + self._field_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -7779,9 +8965,20 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> where C } -/// Lists all instances in the given project. +/// Starts creating a new Cloud Spanner Backup. +/// The returned backup long-running operation +/// will have a name of the format +/// `projects//instances//backups//operations/` +/// and can be used to track creation of the backup. The +/// metadata field type is +/// CreateBackupMetadata. The +/// response field type is +/// Backup, if successful. Cancelling the returned operation will stop the +/// creation and delete the backup. +/// There can be only one pending backup creation per database. Backup creation +/// of different databases can run concurrently. /// -/// A builder for the *instances.list* method supported by a *project* resource. +/// A builder for the *instances.backups.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -7793,6 +8990,7 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> where C /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_spanner1 as spanner1; +/// use spanner1::Backup; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -7803,36 +9001,38 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionStreamingReadCall<'a, C, A> where C /// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), /// # ::default(), None); /// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Backup::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().instances_list("parent") -/// .page_token("no") -/// .page_size(-21) -/// .filter("justo") +/// let result = hub.projects().instances_backups_create(req, "parent") +/// .backup_id("diam") /// .doit(); /// # } /// ``` -pub struct ProjectInstanceListCall<'a, C, A> +pub struct ProjectInstanceBackupCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Spanner, + _request: Backup, _parent: String, - _page_token: Option, - _page_size: Option, - _filter: Option, + _backup_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstanceListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceBackupCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceBackupCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListInstancesResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -7841,20 +9041,14 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "spanner.projects.instances.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); + if let Some(value) = self._backup_id { + params.push(("backupId", value.to_string())); } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { + for &field in ["alt", "parent", "backupId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7866,7 +9060,7 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut ProjectInstanceListCall<'a, C, A> where C: BorrowMut ProjectInstanceListCall<'a, C, A> where C: BorrowMut ProjectInstanceListCall<'a, C, A> where C: BorrowMut`. + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Backup) -> ProjectInstanceBackupCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the instance in which the backup will be + /// created. This must be the same instance that contains the database the + /// backup will be created from. The backup will be stored in the + /// location(s) specified in the instance configuration of this + /// instance. Values are of the form + /// `projects//instances/`. /// /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { + pub fn parent(mut self, new_value: &str) -> ProjectInstanceBackupCreateCall<'a, C, A> { self._parent = new_value.to_string(); self } - /// If non-empty, `page_token` should contain a - /// next_page_token from a - /// previous ListInstancesResponse. + /// Required. The id of the backup to be created. The `backup_id` appended to + /// `parent` forms the full backup name of the form + /// `projects//instances//backups/`. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Number of instances to be returned in the response. If 0 or less, defaults - /// to the server's maximum allowed page size. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectInstanceListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// An expression for filtering the results of the request. Filter rules are - /// case insensitive. The fields eligible for filtering are: - /// - /// * `name` - /// * `display_name` - /// * `labels.key` where key is the name of a label - /// - /// Some examples of using filters are: - /// - /// * `name:*` --> The instance has a name. - /// * `name:Howl` --> The instance's name contains the string "howl". - /// * `name:HOWL` --> Equivalent to above. - /// * `NAME:howl` --> Equivalent to above. - /// * `labels.env:*` --> The instance has the label "env". - /// * `labels.env:dev` --> The instance has the label "env" and the value of - /// the label contains the string "dev". - /// * `name:howl labels.env:dev` --> The instance's name contains "howl" and - /// it has the label "env" with its value - /// containing "dev". - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + /// Sets the *backup id* query property to the given value. + pub fn backup_id(mut self, new_value: &str) -> ProjectInstanceBackupCreateCall<'a, C, A> { + self._backup_id = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -8028,7 +9217,7 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut ProjectInstanceListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8053,7 +9242,7 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8073,7 +9262,7 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInstanceListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupCreateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8096,9 +9285,9 @@ impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut ProjectInstanceDatabaseCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_backups_operations_list("name") +/// .page_token("duo") +/// .page_size(-32) +/// .filter("sea") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceBackupOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceBackupOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceBackupOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.operations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation's parent resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The standard list page token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The standard list page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The standard list filter. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Updates the schema of a Cloud Spanner database by /// creating/altering/dropping tables, columns, indexes, etc. The returned /// long-running operation will have a name of @@ -8954,11 +10436,319 @@ impl<'a, C, A> ProjectInstanceDatabaseUpdateDdlCall<'a, C, A> where C: BorrowMut } -/// Sets the access control policy on a database resource. +/// Lists all instances in the given project. +/// +/// A builder for the *instances.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_list("parent") +/// .page_token("erat") +/// .page_size(-95) +/// .filter("dolor") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListInstancesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/instances"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the project for which a list of instances is + /// requested. Values are of the form `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token from a + /// previous ListInstancesResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of instances to be returned in the response. If 0 or less, defaults + /// to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// An expression for filtering the results of the request. Filter rules are + /// case insensitive. The fields eligible for filtering are: + /// + /// * `name` + /// * `display_name` + /// * `labels.key` where key is the name of a label + /// + /// Some examples of using filters are: + /// + /// * `name:*` --> The instance has a name. + /// * `name:Howl` --> The instance's name contains the string "howl". + /// * `name:HOWL` --> Equivalent to above. + /// * `NAME:howl` --> Equivalent to above. + /// * `labels.env:*` --> The instance has the label "env". + /// * `labels.env:dev` --> The instance has the label "env" and the value of + /// the label contains the string "dev". + /// * `name:howl labels.env:dev` --> The instance's name contains "howl" and + /// it has the label "env" with its value + /// containing "dev". + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Sets the access control policy on a database or backup resource. /// Replaces any existing policy. /// /// Authorization requires `spanner.databases.setIamPolicy` /// permission on resource. +/// For backups, authorization requires `spanner.backups.setIamPolicy` +/// permission on resource. /// /// A builder for the *instances.databases.setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -9237,48 +11027,9 @@ impl<'a, C, A> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> where C: Borrow } -/// Updates an instance, and begins allocating or releasing resources -/// as requested. The returned long-running -/// operation can be used to track the -/// progress of updating the instance. If the named instance does not -/// exist, returns `NOT_FOUND`. -/// -/// Immediately upon completion of this request: -/// -/// * For resource types for which a decrease in the instance's allocation -/// has been requested, billing is based on the newly-requested level. -/// -/// Until completion of the returned operation: -/// -/// * Cancelling the operation sets its metadata's -/// cancel_time, and begins -/// restoring resources to their pre-request values. The operation -/// is guaranteed to succeed at undoing all resource changes, -/// after which point it terminates with a `CANCELLED` status. -/// * All other attempts to modify the instance are rejected. -/// * Reading the instance via the API continues to give the pre-request -/// resource levels. -/// -/// Upon completion of the returned operation: -/// -/// * Billing begins for all successfully-allocated resources (some types -/// may have lower than the requested levels). -/// * All newly-reserved resources are available for serving the instance's -/// tables. -/// * The instance's new resource levels are readable via the API. -/// -/// The returned long-running operation will -/// have a name of the format `/operations/` and -/// can be used to track the instance modification. The -/// metadata field type is -/// UpdateInstanceMetadata. -/// The response field type is -/// Instance, if successful. -/// -/// Authorization requires `spanner.instances.update` permission on -/// resource name. +/// Gets metadata on a pending or completed Backup. /// -/// A builder for the *instances.patch* method supported by a *project* resource. +/// A builder for the *instances.backups.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -9290,7 +11041,595 @@ impl<'a, C, A> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> where C: Borrow /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_spanner1 as spanner1; -/// use spanner1::UpdateInstanceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_backups_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceBackupGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceBackupGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceBackupGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Backup)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the backup. + /// Values are of the form + /// `projects//instances//backups/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceBackupGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists database longrunning-operations. +/// A database operation has a name of the form +/// `projects//instances//databases//operations/`. +/// The long-running operation +/// metadata field type +/// `metadata.type_url` describes the type of the metadata. Operations returned +/// include those that have completed/failed/canceled within the last 7 days, +/// and pending operations. +/// +/// A builder for the *instances.databaseOperations.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_database_operations_list("parent") +/// .page_token("no") +/// .page_size(-36) +/// .filter("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseOperationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseOperationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseOperationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListDatabaseOperationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databaseOperations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/databaseOperations"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The instance of the database operations. + /// Values are of the form `projects//instances/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token + /// from a previous ListDatabaseOperationsResponse to the + /// same `parent` and with the same `filter`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of operations to be returned in the response. If 0 or + /// less, defaults to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// An expression that filters the list of returned operations. + /// + /// A filter expression consists of a field name, a + /// comparison operator, and a value for filtering. + /// The value must be a string, a number, or a boolean. The comparison operator + /// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + /// Colon `:` is the contains operator. Filter rules are not case sensitive. + /// + /// The following fields in the Operation + /// are eligible for filtering: + /// + /// * `name` - The name of the long-running operation + /// * `done` - False if the operation is in progress, else true. + /// * `metadata.@type` - the type of metadata. For example, the type string + /// for RestoreDatabaseMetadata is + /// `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. + /// * `metadata.` - any field in metadata.value. + /// * `error` - Error associated with the long-running operation. + /// * `response.@type` - the type of response. + /// * `response.` - any field in response.value. + /// + /// You can combine multiple expressions by enclosing each expression in + /// parentheses. By default, expressions are combined with AND logic. However, + /// you can specify AND, OR, and NOT logic explicitly. + /// + /// Here are a few examples: + /// + /// * `done:true` - The operation is complete. + /// * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND`
          + /// `(metadata.source_type:BACKUP) AND`
          + /// `(metadata.backup_info.backup:backup_howl) AND`
          + /// `(metadata.name:restored_howl) AND`
          + /// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`
          + /// `(error:*)` - Return operations where: + /// * The operation's metadata type is RestoreDatabaseMetadata. + /// * The database is restored from a backup. + /// * The backup name contains "backup_howl". + /// * The restored database's name contains "restored_howl". + /// * The operation started before 2018-03-28T14:50:00Z. + /// * The operation resulted in an error. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseOperationListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Creates multiple new sessions. +/// +/// This API can be used to initialize a session cache on the clients. +/// See https://goo.gl/TgSFN2 for best practices on session cache management. +/// +/// A builder for the *instances.databases.sessions.batchCreate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::BatchCreateSessionsRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -9304,33 +11643,33 @@ impl<'a, C, A> ProjectInstanceDatabaseSetIamPolicyCall<'a, C, A> where C: Borrow /// // 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 = UpdateInstanceRequest::default(); +/// let mut req = BatchCreateSessionsRequest::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().instances_patch(req, "name") +/// let result = hub.projects().instances_databases_sessions_batch_create(req, "database") /// .doit(); /// # } /// ``` -pub struct ProjectInstancePatchCall<'a, C, A> +pub struct ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Spanner, - _request: UpdateInstanceRequest, - _name: String, + _request: BatchCreateSessionsRequest, + _database: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstancePatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> {} -impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchCreateSessionsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -9339,11 +11678,295 @@ impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "spanner.projects.instances.patch", - http_method: hyper::method::Method::Patch }); + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.batchCreate", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("database", self._database.to_string())); + for &field in ["alt", "database"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+database}/sessions:batchCreate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+database}", "database")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["database"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BatchCreateSessionsRequest) -> ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The database in which the new sessions are created. + /// + /// Sets the *database* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn database(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> { + self._database = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseSessionBatchCreateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Updates a pending or completed Backup. +/// +/// A builder for the *instances.backups.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::Backup; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Backup::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().instances_backups_patch(req, "name") +/// .update_mask("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceBackupPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: Backup, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceBackupPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceBackupPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Backup)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9478,30 +12101,50 @@ impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut ProjectInstancePatchCall<'a, C, A> { + pub fn request(mut self, new_value: Backup) -> ProjectInstanceBackupPatchCall<'a, C, A> { self._request = new_value; self } - /// Required. A unique identifier for the instance, which cannot be changed - /// after the instance is created. Values are of the form - /// `projects//instances/a-z*[a-z0-9]`. The final - /// segment of the name must be between 2 and 64 characters in length. + /// Output only for the CreateBackup operation. + /// Required for the UpdateBackup operation. + /// + /// A globally unique identifier for the backup which cannot be + /// changed. Values are of the form + /// `projects//instances//backups/a-z*[a-z0-9]` + /// The final segment of the name must be between 2 and 60 characters + /// in length. + /// + /// The backup is stored in the location(s) specified in the instance + /// configuration of the instance containing the backup, identified + /// by the prefix of the backup name of the form + /// `projects//instances/`. /// /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectInstancePatchCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectInstanceBackupPatchCall<'a, C, A> { self._name = new_value.to_string(); self } + /// Required. A mask specifying which fields (e.g. `expire_time`) in the + /// Backup resource should be updated. This mask is relative to the Backup + /// resource, not to the request message. The field mask must always be + /// specified; this prevents any future fields from being erased accidentally + /// by clients that do not know about them. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectInstanceBackupPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstancePatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupPatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -9526,7 +12169,7 @@ impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstancePatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupPatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -9546,7 +12189,7 @@ impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInstancePatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupPatchCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -10630,6 +13273,257 @@ impl<'a, C, A> ProjectInstanceTestIamPermissionCall<'a, C, A> where C: BorrowMut } +/// Deletes a long-running operation. This method indicates that the client is +/// no longer interested in the operation result. It does not cancel the +/// operation. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. +/// +/// A builder for the *instances.backups.operations.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_backups_operations_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceBackupOperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceBackupOperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceBackupOperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceBackupOperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupOperationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupOperationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupOperationDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns the schema of a Cloud Spanner database as a list of formatted /// DDL statements. This method does not show pending schema updates, those may /// be queried using the Operations API. @@ -10880,6 +13774,327 @@ impl<'a, C, A> ProjectInstanceDatabaseGetDdlCall<'a, C, A> where C: BorrowMut/operations/` and +/// can be used to track the instance modification. The +/// metadata field type is +/// UpdateInstanceMetadata. +/// The response field type is +/// Instance, if successful. +/// +/// Authorization requires `spanner.instances.update` permission on +/// resource name. +/// +/// A builder for the *instances.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::UpdateInstanceRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = UpdateInstanceRequest::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().instances_patch(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstancePatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: UpdateInstanceRequest, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstancePatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstancePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UpdateInstanceRequest) -> ProjectInstancePatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. A unique identifier for the instance, which cannot be changed + /// after the instance is created. Values are of the form + /// `projects//instances/a-z*[a-z0-9]`. The final + /// segment of the name must be between 2 and 64 characters in length. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstancePatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstancePatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstancePatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstancePatchCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Begins a new transaction. This step can often be skipped: /// Read, ExecuteSql and /// Commit can begin a new transaction as a @@ -11199,9 +14414,9 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionBeginTransactionCall<'a, C, A> wher /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().instances_operations_list("name") -/// .page_token("sadipscing") -/// .page_size(-48) -/// .filter("eirmod") +/// .page_token("amet") +/// .page_size(-23) +/// .filter("consetetur") /// .doit(); /// # } /// ``` @@ -11455,9 +14670,16 @@ impl<'a, C, A> ProjectInstanceOperationListCall<'a, C, A> where C: BorrowMut ProjectInstanceOperationListCall<'a, C, A> where C: BorrowMut ProjectInstanceOperationListCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GetIamPolicyRequest::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().instance_configs_list("parent") -/// .page_token("amet") -/// .page_size(-60) +/// let result = hub.projects().instances_backups_get_iam_policy(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectInstanceConfigListCall<'a, C, A> +pub struct ProjectInstanceBackupGetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Spanner, - _parent: String, - _page_token: Option, - _page_size: Option, + _request: GetIamPolicyRequest, + _resource: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstanceConfigListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceBackupGetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceBackupGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListInstanceConfigsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -11515,17 +14740,11 @@ impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "spanner.projects.instanceConfigs.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.getIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11537,12 +14756,12 @@ impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["resource"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -11569,6 +14788,17 @@ impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut`. /// - /// Sets the *parent* path property to the given value. + /// Sets the *request* property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn parent(mut self, new_value: &str) -> ProjectInstanceConfigListCall<'a, C, A> { - self._parent = new_value.to_string(); + pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectInstanceBackupGetIamPolicyCall<'a, C, A> { + self._request = new_value; self } - /// If non-empty, `page_token` should contain a - /// next_page_token - /// from a previous ListInstanceConfigsResponse. + /// REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectInstanceConfigListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Number of instance configurations to be returned in the response. If 0 or - /// less, defaults to the server's maximum allowed page size. + /// Sets the *resource* path property to the given value. /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectInstanceConfigListCall<'a, C, A> { - self._page_size = Some(new_value); + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectInstanceBackupGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -11675,7 +14899,7 @@ impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut ProjectInstanceConfigListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupGetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -11700,7 +14924,7 @@ impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceConfigListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupGetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -11720,7 +14944,306 @@ impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInstanceConfigListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Create a new database by restoring from a completed backup. The new +/// database must be in the same project and in an instance with the same +/// instance configuration as the instance containing +/// the backup. The returned database long-running +/// operation has a name of the format +/// `projects//instances//databases//operations/`, +/// and can be used to track the progress of the operation, and to cancel it. +/// The metadata field type is +/// RestoreDatabaseMetadata. +/// The response type +/// is Database, if +/// successful. Cancelling the returned operation will stop the restore and +/// delete the database. +/// There can be only one database being restored into an instance at a time. +/// Once the restore operation completes, a new restore operation can be +/// initiated, without waiting for the optimize operation associated with the +/// first restore to complete. +/// +/// A builder for the *instances.databases.restore* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::RestoreDatabaseRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = RestoreDatabaseRequest::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().instances_databases_restore(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseRestoreCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: RestoreDatabaseRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseRestoreCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseRestoreCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.restore", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/databases:restore"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RestoreDatabaseRequest) -> ProjectInstanceDatabaseRestoreCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the instance in which to create the + /// restored database. This instance must be in the same project and + /// have the same instance configuration as the instance containing + /// the source backup. Values are of the form + /// `projects//instances/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectInstanceDatabaseRestoreCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseRestoreCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseRestoreCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseRestoreCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -12023,6 +15546,294 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionPartitionReadCall<'a, C, A> where C } +/// Returns permissions that the caller has on the specified database or backup +/// resource. +/// +/// Attempting this RPC on a non-existent Cloud Spanner database will +/// result in a NOT_FOUND error if the user has +/// `spanner.databases.list` permission on the containing Cloud +/// Spanner instance. Otherwise returns an empty set of permissions. +/// Calling this method on a backup that does not exist will +/// result in a NOT_FOUND error if the user has +/// `spanner.backups.list` permission on the containing instance. +/// +/// A builder for the *instances.databases.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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().instances_databases_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseTestIamPermissionCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Like ExecuteSql, except returns the result /// set as a stream. Unlike ExecuteSql, there /// is no limit on the size of the returned result set. However, no @@ -12306,6 +16117,283 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionExecuteStreamingSqlCall<'a, C, A> w } +/// Lists the supported instance configurations for a given project. +/// +/// A builder for the *instanceConfigs.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instance_configs_list("parent") +/// .page_token("et") +/// .page_size(-96) +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceConfigListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceConfigListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceConfigListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListInstanceConfigsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instanceConfigs.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/instanceConfigs"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The name of the project for which a list of supported instance + /// configurations is requested. Values are of the form + /// `projects/`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectInstanceConfigListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token + /// from a previous ListInstanceConfigsResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceConfigListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of instance configurations to be returned in the response. If 0 or + /// less, defaults to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceConfigListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceConfigListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceConfigListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceConfigListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets the latest state of a long-running operation. Clients can use this /// method to poll the operation result at intervals as recommended by the API /// service. @@ -12813,9 +16901,18 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationCancelCall<'a, C, A> where C: Bor } -/// Lists all sessions in a given database. +/// Starts asynchronous cancellation on a long-running operation. The server +/// makes a best effort to cancel the operation, but success is not +/// guaranteed. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use +/// Operations.GetOperation or +/// other methods to check whether the cancellation succeeded or whether the +/// operation completed despite cancellation. On successful cancellation, +/// the operation is not deleted; instead, it becomes an operation with +/// an Operation.error value with a google.rpc.Status.code of 1, +/// corresponding to `Code.CANCELLED`. /// -/// A builder for the *instances.databases.sessions.list* method supported by a *project* resource. +/// A builder for the *instances.backups.operations.cancel* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -12840,33 +16937,27 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationCancelCall<'a, C, A> where C: Bor /// // 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().instances_databases_sessions_list("database") -/// .page_token("accusam") -/// .page_size(-56) -/// .filter("sea") +/// let result = hub.projects().instances_backups_operations_cancel("name") /// .doit(); /// # } /// ``` -pub struct ProjectInstanceDatabaseSessionListCall<'a, C, A> +pub struct ProjectInstanceBackupOperationCancelCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Spanner, - _database: String, - _page_token: Option, - _page_size: Option, - _filter: Option, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceBackupOperationCancelCall<'a, C, A> {} -impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceBackupOperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListSessionsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -12875,20 +16966,11 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); - params.push(("database", self._database.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "database", "pageToken", "pageSize", "filter"].iter() { + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12900,12 +16982,12 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+database}/sessions"; + let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+database}", "database")].iter() { + for &(find_this, param_name) in [("{+name}", "name")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -12920,7 +17002,7 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["database"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -12950,7 +17032,7 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -13003,47 +17085,14 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM } - /// Required. The database in which to list sessions. + /// The name of the operation resource to be cancelled. /// - /// Sets the *database* path property to the given value. + /// Sets the *name* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn database(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { - self._database = new_value.to_string(); - self - } - /// If non-empty, `page_token` should contain a - /// next_page_token from a previous - /// ListSessionsResponse. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Number of sessions to be returned in the response. If 0 or less, defaults - /// to the server's maximum allowed page size. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// An expression for filtering the results of the request. Filter rules are - /// case insensitive. The fields eligible for filtering are: - /// - /// * `labels.key` where key is the name of a label - /// - /// Some examples of using filters are: - /// - /// * `labels.env:*` --> The session has the label "env". - /// * `labels.env:dev` --> The session has the label "env" and the value of - /// the label contains the string "dev". - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + pub fn name(mut self, new_value: &str) -> ProjectInstanceBackupOperationCancelCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -13052,7 +17101,7 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupOperationCancelCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13077,7 +17126,7 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupOperationCancelCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13097,7 +17146,7 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupOperationCancelCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -13146,9 +17195,9 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().instances_databases_operations_list("name") -/// .page_token("duo") -/// .page_size(-21) -/// .filter("eirmod") +/// .page_token("justo") +/// .page_size(-52) +/// .filter("vero") /// .doit(); /// # } /// ``` @@ -13716,6 +17765,8 @@ impl<'a, C, A> ProjectInstanceCreateCall<'a, C, A> where C: BorrowMut ProjectInstanceDatabaseDropDatabaseCall<'a, C, A> where C: Borrow } +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *instances.backups.operations.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_backups_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceBackupOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceBackupOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceBackupOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceBackupOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a long-running operation. This method indicates that the client is /// no longer interested in the operation result. It does not cancel the /// operation. If the server doesn't support this method, it returns @@ -14214,6 +18515,302 @@ impl<'a, C, A> ProjectInstanceOperationDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_databases_sessions_list("database") +/// .page_token("sadipscing") +/// .page_size(-88) +/// .filter("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseSessionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _database: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseSessionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseSessionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListSessionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.sessions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("database", self._database.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "database", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+database}/sessions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+database}", "database")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["database"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The database in which to list sessions. + /// + /// Sets the *database* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn database(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + self._database = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token from a previous + /// ListSessionsResponse. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of sessions to be returned in the response. If 0 or less, defaults + /// to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// An expression for filtering the results of the request. Filter rules are + /// case insensitive. The fields eligible for filtering are: + /// + /// * `labels.key` where key is the name of a label + /// + /// Some examples of using filters are: + /// + /// * `labels.env:*` --> The session has the label "env". + /// * `labels.env:dev` --> The session has the label "env" and the value of + /// the label contains the string "dev". + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseSessionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a long-running operation. This method indicates that the client is /// no longer interested in the operation result. It does not cancel the /// operation. If the server doesn't support this method, it returns @@ -14465,19 +19062,297 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> where C: Bor } -/// Deletes an instance. +/// Gets the access control policy for a database or backup resource. +/// Returns an empty policy if a database or backup exists but does not have a +/// policy set. /// -/// Immediately upon completion of the request: -/// -/// * Billing ceases for all of the instance's reserved resources. -/// -/// Soon afterward: -/// -/// * The instance and *all of its databases* immediately and -/// irrevocably disappear from the API. All data in the databases -/// is permanently deleted. +/// Authorization requires `spanner.databases.getIamPolicy` permission on +/// resource. +/// For backups, authorization requires `spanner.backups.getIamPolicy` +/// permission on resource. /// -/// A builder for the *instances.delete* method supported by a *project* resource. +/// A builder for the *instances.databases.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::GetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = GetIamPolicyRequest::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().instances_databases_get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.databases.getIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceDatabaseGetIamPolicyCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Lists completed and pending backups. +/// Backups returned are ordered by `create_time` in descending order, +/// starting from the most recent `create_time`. +/// +/// A builder for the *instances.backups.list* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -14502,27 +19377,33 @@ impl<'a, C, A> ProjectInstanceDatabaseOperationDeleteCall<'a, C, A> where C: Bor /// // 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().instances_delete("name") +/// let result = hub.projects().instances_backups_list("parent") +/// .page_token("Lorem") +/// .page_size(-17) +/// .filter("clita") /// .doit(); /// # } /// ``` -pub struct ProjectInstanceDeleteCall<'a, C, A> +pub struct ProjectInstanceBackupListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Spanner, - _name: String, + _parent: String, + _page_token: Option, + _page_size: Option, + _filter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectInstanceDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectInstanceBackupListCall<'a, C, A> {} -impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectInstanceBackupListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListBackupsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -14531,11 +19412,20 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "spanner.projects.instances.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14547,12 +19437,12 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -14597,7 +19487,7 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut/instances/` + /// Required. The instance to list backups from. Values are of the + /// form `projects//instances/`. /// - /// Sets the *name* path property to the given value. + /// Sets the *parent* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectInstanceDeleteCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectInstanceBackupListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// If non-empty, `page_token` should contain a + /// next_page_token from a + /// previous ListBackupsResponse to the same `parent` and with the same + /// `filter`. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectInstanceBackupListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Number of backups to be returned in the response. If 0 or + /// less, defaults to the server's maximum allowed page size. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectInstanceBackupListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// An expression that filters the list of returned backups. + /// + /// A filter expression consists of a field name, a comparison operator, and a + /// value for filtering. + /// The value must be a string, a number, or a boolean. The comparison operator + /// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. + /// Colon `:` is the contains operator. Filter rules are not case sensitive. + /// + /// The following fields in the Backup are eligible for filtering: + /// + /// * `name` + /// * `database` + /// * `state` + /// * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + /// * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) + /// * `size_bytes` + /// + /// You can combine multiple expressions by enclosing each expression in + /// parentheses. By default, expressions are combined with AND logic, but + /// you can specify AND, OR, and NOT logic explicitly. + /// + /// Here are a few examples: + /// + /// * `name:Howl` - The backup's name contains the string "howl". + /// * `database:prod` + /// - The database's name contains the string "prod". + /// * `state:CREATING` - The backup is pending creation. + /// * `state:READY` - The backup is fully created and ready for use. + /// * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` + /// - The backup name contains the string "howl" and `create_time` + /// of the backup is before 2018-03-28T14:50:00Z. + /// * `expire_time < \"2018-03-28T14:50:00Z\"` + /// - The backup `expire_time` is before 2018-03-28T14:50:00Z. + /// * `size_bytes > 10000000000` - The backup's size is greater than 10GB + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectInstanceBackupListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -14667,7 +19615,7 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut ProjectInstanceDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -14692,7 +19640,7 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectInstanceDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -14712,7 +19660,295 @@ impl<'a, C, A> ProjectInstanceDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectInstanceDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Returns permissions that the caller has on the specified database or backup +/// resource. +/// +/// Attempting this RPC on a non-existent Cloud Spanner database will +/// result in a NOT_FOUND error if the user has +/// `spanner.databases.list` permission on the containing Cloud +/// Spanner instance. Otherwise returns an empty set of permissions. +/// Calling this method on a backup that does not exist will +/// result in a NOT_FOUND error if the user has +/// `spanner.backups.list` permission on the containing instance. +/// +/// A builder for the *instances.backups.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// use spanner1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = TestIamPermissionsRequest::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().instances_backups_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceBackupTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceBackupTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceBackupTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectInstanceBackupTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectInstanceBackupTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupTestIamPermissionCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -15231,3 +20467,253 @@ impl<'a, C, A> ProjectInstanceDatabaseSessionGetCall<'a, C, A> where C: BorrowMu } +/// Deletes a pending or completed Backup. +/// +/// A builder for the *instances.backups.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_spanner1 as spanner1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use spanner1::Spanner; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Spanner::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_backups_delete("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceBackupDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Spanner, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceBackupDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceBackupDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "spanner.projects.instances.backups.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. Name of the backup to delete. + /// Values are of the form + /// `projects//instances//backups/`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectInstanceBackupDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceBackupDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceBackupDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceBackupDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/spectrum1_explorer-cli/Cargo.toml b/gen/spectrum1_explorer-cli/Cargo.toml index ca52677c00..06d8774a19 100644 --- a/gen/spectrum1_explorer-cli/Cargo.toml +++ b/gen/spectrum1_explorer-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-spectrum1_explorer-cli" -version = "1.0.12+20170306" +version = "1.0.13+20170306" authors = ["Sebastian Thiel "] description = "A complete library to interact with spectrum (protocol v1explorer)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-spectrum1_explorer] path = "../spectrum1_explorer" -version = "1.0.12+20170306" +version = "1.0.13+20170306" diff --git a/gen/spectrum1_explorer-cli/README.md b/gen/spectrum1_explorer-cli/README.md index 2c4deb662a..c48573c915 100644 --- a/gen/spectrum1_explorer-cli/README.md +++ b/gen/spectrum1_explorer-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *spectrum* API at revision *20170306*. The CLI is at version *1.0.12*. +This documentation was generated from the *spectrum* API at revision *20170306*. The CLI is at version *1.0.13*. ```bash spectrum1-explorer [options] diff --git a/gen/spectrum1_explorer-cli/mkdocs.yml b/gen/spectrum1_explorer-cli/mkdocs.yml index d0060d7ae9..b7c8834164 100644 --- a/gen/spectrum1_explorer-cli/mkdocs.yml +++ b/gen/spectrum1_explorer-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: spectrum v1.0.12+20170306 +site_name: spectrum v1.0.13+20170306 site_url: http://byron.github.io/google-apis-rs/google-spectrum1_explorer-cli site_description: A complete library to interact with spectrum (protocol v1explorer) diff --git a/gen/spectrum1_explorer-cli/src/main.rs b/gen/spectrum1_explorer-cli/src/main.rs index bc8a6b7643..8300c5a112 100644 --- a/gen/spectrum1_explorer-cli/src/main.rs +++ b/gen/spectrum1_explorer-cli/src/main.rs @@ -961,7 +961,7 @@ fn main() { let mut app = App::new("spectrum1-explorer") .author("Sebastian Thiel ") - .version("1.0.12+20170306") + .version("1.0.13+20170306") .about("API for spectrum-management functions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_spectrum1_explorer_cli") .arg(Arg::with_name("folder") diff --git a/gen/spectrum1_explorer/Cargo.toml b/gen/spectrum1_explorer/Cargo.toml index 3e83c25b3c..d13be26ec0 100644 --- a/gen/spectrum1_explorer/Cargo.toml +++ b/gen/spectrum1_explorer/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-spectrum1_explorer" -version = "1.0.12+20170306" +version = "1.0.13+20170306" authors = ["Sebastian Thiel "] description = "A complete library to interact with spectrum (protocol v1explorer)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer" homepage = "http://developers.google.com/spectrum" -documentation = "https://docs.rs/google-spectrum1_explorer/1.0.12+20170306" +documentation = "https://docs.rs/google-spectrum1_explorer/1.0.13+20170306" license = "MIT" keywords = ["spectrum", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/spectrum1_explorer/README.md b/gen/spectrum1_explorer/README.md index 52831c8a29..939464df53 100644 --- a/gen/spectrum1_explorer/README.md +++ b/gen/spectrum1_explorer/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-spectrum1_explorer` library allows access to all features of the *Google spectrum* service. -This documentation was generated from *spectrum* crate version *1.0.12+20170306*, where *20170306* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *spectrum* crate version *1.0.13+20170306*, where *20170306* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *spectrum* *v1_explorer* API can be found at the [official documentation site](http://developers.google.com/spectrum). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.Spectrum.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.Spectrum.html) ... * paws - * [*get spectrum*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.PawGetSpectrumCall.html), [*get spectrum batch*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.PawGetSpectrumBatchCall.html), [*init*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.PawInitCall.html), [*notify spectrum use*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.PawNotifySpectrumUseCall.html), [*register*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.PawRegisterCall.html) and [*verify device*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.PawVerifyDeviceCall.html) + * [*get spectrum*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.PawGetSpectrumCall.html), [*get spectrum batch*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.PawGetSpectrumBatchCall.html), [*init*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.PawInitCall.html), [*notify spectrum use*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.PawNotifySpectrumUseCall.html), [*register*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.PawRegisterCall.html) and [*verify device*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.PawVerifyDeviceCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/struct.Spectrum.html)** +* **[Hub](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/struct.Spectrum.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.Part.html)** + * **[Parts](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.RequestValue.html) and -[decodable](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.RequestValue.html) and +[decodable](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-spectrum1_explorer/1.0.12+20170306/google_spectrum1_explorer/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-spectrum1_explorer/1.0.13+20170306/google_spectrum1_explorer/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/spectrum1_explorer/src/lib.rs b/gen/spectrum1_explorer/src/lib.rs index caac43dc0d..f9cdf8692c 100644 --- a/gen/spectrum1_explorer/src/lib.rs +++ b/gen/spectrum1_explorer/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *spectrum* crate version *1.0.12+20170306*, where *20170306* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *spectrum* crate version *1.0.13+20170306*, where *20170306* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *spectrum* *v1_explorer* API can be found at the //! [official documentation site](http://developers.google.com/spectrum). @@ -307,7 +307,7 @@ impl<'a, C, A> Spectrum Spectrum { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/spectrum/v1explorer/paws/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -318,7 +318,7 @@ impl<'a, C, A> Spectrum } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/speech1-cli/Cargo.toml b/gen/speech1-cli/Cargo.toml index fc8c530622..5273392339 100644 --- a/gen/speech1-cli/Cargo.toml +++ b/gen/speech1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-speech1-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Speech (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/speech1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-speech1] path = "../speech1" -version = "1.0.12+20190627" +version = "1.0.13+20200406" diff --git a/gen/speech1-cli/README.md b/gen/speech1-cli/README.md index ac660c2cd6..f85e03b703 100644 --- a/gen/speech1-cli/README.md +++ b/gen/speech1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Speech* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *Speech* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash speech1 [options] diff --git a/gen/speech1-cli/mkdocs.yml b/gen/speech1-cli/mkdocs.yml index 1acac23a23..ec5a34bb96 100644 --- a/gen/speech1-cli/mkdocs.yml +++ b/gen/speech1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Speech v1.0.12+20190627 +site_name: Speech v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-speech1-cli site_description: A complete library to interact with Speech (protocol v1) diff --git a/gen/speech1-cli/src/main.rs b/gen/speech1-cli/src/main.rs index 0e5cb2f0d5..b5b76c08ea 100644 --- a/gen/speech1-cli/src/main.rs +++ b/gen/speech1-cli/src/main.rs @@ -313,17 +313,20 @@ impl<'n> Engine<'n> { "config.sample-rate-hertz" => Some(("config.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.profanity-filter" => Some(("config.profanityFilter", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.model" => Some(("config.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.diarization-config.min-speaker-count" => Some(("config.diarizationConfig.minSpeakerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.diarization-config.enable-speaker-diarization" => Some(("config.diarizationConfig.enableSpeakerDiarization", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.diarization-config.max-speaker-count" => Some(("config.diarizationConfig.maxSpeakerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.diarization-config.speaker-tag" => Some(("config.diarizationConfig.speakerTag", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.metadata.recording-device-type" => Some(("config.metadata.recordingDeviceType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.original-media-type" => Some(("config.metadata.originalMediaType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.microphone-distance" => Some(("config.metadata.microphoneDistance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.metadata.obfuscated-id" => Some(("config.metadata.obfuscatedId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.recording-device-name" => Some(("config.metadata.recordingDeviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.industry-naics-code-of-audio" => Some(("config.metadata.industryNaicsCodeOfAudio", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.metadata.audio-topic" => Some(("config.metadata.audioTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.original-mime-type" => Some(("config.metadata.originalMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.interaction-type" => Some(("config.metadata.interactionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["audio", "audio-channel-count", "audio-topic", "config", "content", "enable-automatic-punctuation", "enable-separate-recognition-per-channel", "enable-word-time-offsets", "encoding", "industry-naics-code-of-audio", "interaction-type", "language-code", "max-alternatives", "metadata", "microphone-distance", "model", "obfuscated-id", "original-media-type", "original-mime-type", "profanity-filter", "recording-device-name", "recording-device-type", "sample-rate-hertz", "uri", "use-enhanced"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["audio", "audio-channel-count", "audio-topic", "config", "content", "diarization-config", "enable-automatic-punctuation", "enable-separate-recognition-per-channel", "enable-speaker-diarization", "enable-word-time-offsets", "encoding", "industry-naics-code-of-audio", "interaction-type", "language-code", "max-alternatives", "max-speaker-count", "metadata", "microphone-distance", "min-speaker-count", "model", "original-media-type", "original-mime-type", "profanity-filter", "recording-device-name", "recording-device-type", "sample-rate-hertz", "speaker-tag", "uri", "use-enhanced"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -419,17 +422,20 @@ impl<'n> Engine<'n> { "config.sample-rate-hertz" => Some(("config.sampleRateHertz", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.profanity-filter" => Some(("config.profanityFilter", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.model" => Some(("config.model", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "config.diarization-config.min-speaker-count" => Some(("config.diarizationConfig.minSpeakerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.diarization-config.enable-speaker-diarization" => Some(("config.diarizationConfig.enableSpeakerDiarization", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.diarization-config.max-speaker-count" => Some(("config.diarizationConfig.maxSpeakerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.diarization-config.speaker-tag" => Some(("config.diarizationConfig.speakerTag", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.metadata.recording-device-type" => Some(("config.metadata.recordingDeviceType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.original-media-type" => Some(("config.metadata.originalMediaType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.microphone-distance" => Some(("config.metadata.microphoneDistance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.metadata.obfuscated-id" => Some(("config.metadata.obfuscatedId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.recording-device-name" => Some(("config.metadata.recordingDeviceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.industry-naics-code-of-audio" => Some(("config.metadata.industryNaicsCodeOfAudio", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.metadata.audio-topic" => Some(("config.metadata.audioTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.original-mime-type" => Some(("config.metadata.originalMimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.metadata.interaction-type" => Some(("config.metadata.interactionType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["audio", "audio-channel-count", "audio-topic", "config", "content", "enable-automatic-punctuation", "enable-separate-recognition-per-channel", "enable-word-time-offsets", "encoding", "industry-naics-code-of-audio", "interaction-type", "language-code", "max-alternatives", "metadata", "microphone-distance", "model", "obfuscated-id", "original-media-type", "original-mime-type", "profanity-filter", "recording-device-name", "recording-device-type", "sample-rate-hertz", "uri", "use-enhanced"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["audio", "audio-channel-count", "audio-topic", "config", "content", "diarization-config", "enable-automatic-punctuation", "enable-separate-recognition-per-channel", "enable-speaker-diarization", "enable-word-time-offsets", "encoding", "industry-naics-code-of-audio", "interaction-type", "language-code", "max-alternatives", "max-speaker-count", "metadata", "microphone-distance", "min-speaker-count", "model", "original-media-type", "original-mime-type", "profanity-filter", "recording-device-name", "recording-device-type", "sample-rate-hertz", "speaker-tag", "uri", "use-enhanced"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -788,7 +794,7 @@ fn main() { let mut app = App::new("speech1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200406") .about("Converts audio to text by applying powerful neural network models.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_speech1_cli") .arg(Arg::with_name("url") diff --git a/gen/speech1/Cargo.toml b/gen/speech1/Cargo.toml index 947b269743..b2411a239c 100644 --- a/gen/speech1/Cargo.toml +++ b/gen/speech1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-speech1" -version = "1.0.12+20190627" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Speech (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/speech1" homepage = "https://cloud.google.com/speech-to-text/docs/quickstart-protocol" -documentation = "https://docs.rs/google-speech1/1.0.12+20190627" +documentation = "https://docs.rs/google-speech1/1.0.13+20200406" license = "MIT" keywords = ["speech", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/speech1/README.md b/gen/speech1/README.md index b0e70840c6..71d2e1b631 100644 --- a/gen/speech1/README.md +++ b/gen/speech1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-speech1` library allows access to all features of the *Google Speech* service. -This documentation was generated from *Speech* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *speech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Speech* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *speech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Speech* *v1* API can be found at the [official documentation site](https://cloud.google.com/speech-to-text/docs/quickstart-protocol). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.Speech.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.Speech.html) ... -* [operations](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.Operation.html) - * [*get*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.OperationListCall.html) +* [operations](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.Operation.html) + * [*get*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.OperationListCall.html) * projects - * [*locations operations get*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.ProjectLocationOperationListCall.html) + * [*locations operations get*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.ProjectLocationOperationListCall.html) * speech - * [*longrunningrecognize*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.SpeechLongrunningrecognizeCall.html) and [*recognize*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.SpeechRecognizeCall.html) + * [*longrunningrecognize*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.SpeechLongrunningrecognizeCall.html) and [*recognize*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.SpeechRecognizeCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/struct.Speech.html)** +* **[Hub](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/struct.Speech.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.Part.html)** + * **[Parts](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-speech1/1.0.12+20190627/google_speech1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-speech1/1.0.13+20200406/google_speech1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/speech1/src/lib.rs b/gen/speech1/src/lib.rs index 31c871af44..bc5ee45d6e 100644 --- a/gen/speech1/src/lib.rs +++ b/gen/speech1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Speech* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *speech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Speech* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *speech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Speech* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/speech-to-text/docs/quickstart-protocol). @@ -332,7 +332,7 @@ impl<'a, C, A> Speech Speech { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://speech.googleapis.com/".to_string(), _root_url: "https://speech.googleapis.com/".to_string(), } @@ -349,7 +349,7 @@ impl<'a, C, A> Speech } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -377,32 +377,6 @@ impl<'a, C, A> Speech // ############ // SCHEMAS ### // ########## -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](https://github.com/grpc). Each `Status` message contains -/// three pieces of data: error code, error message, and error details. -/// -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](https://cloud.google.com/apis/design/errors). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Status { - /// A developer-facing error message, which should be in English. Any - /// user-facing error message should be localized and sent in the - /// google.rpc.Status.details field, or localized by the client. - pub message: Option, - /// The status code, which should be an enum value of google.rpc.Code. - pub code: Option, - /// A list of messages that carry the error details. There is a common set of - /// message types for APIs to use. - pub details: Option>>, -} - -impl Part for Status {} - - /// A speech recognition result corresponding to a portion of the audio. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -414,7 +388,7 @@ pub struct SpeechRecognitionResult { /// For audio_channel_count = N, its output values can range from '1' to 'N'. #[serde(rename="channelTag")] pub channel_tag: Option, - /// Output only. May contain one or more recognition hypotheses (up to the + /// May contain one or more recognition hypotheses (up to the /// maximum specified in `max_alternatives`). /// These alternatives are ordered in terms of accuracy, with the top (first) /// alternative being the most probable, as ranked by the recognizer. @@ -437,7 +411,7 @@ impl Part for SpeechRecognitionResult {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RecognizeResponse { - /// Output only. Sequential list of transcription results corresponding to + /// Sequential list of transcription results corresponding to /// sequential portions of audio. pub results: Option>, } @@ -445,32 +419,79 @@ pub struct RecognizeResponse { impl ResponseResult for RecognizeResponse {} -/// The response message for Operations.ListOperations. +/// Description of audio data to be recognized. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list operations](struct.OperationListCall.html) (response) -/// * [locations operations list projects](struct.ProjectLocationOperationListCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListOperationsResponse { - /// The standard List next-page token. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// A list of operations that matches the specified filter in the request. - pub operations: Option>, +pub struct RecognitionMetadata { + /// The type of device the speech was recorded with. + #[serde(rename="recordingDeviceType")] + pub recording_device_type: Option, + /// The original media the speech was recorded on. + #[serde(rename="originalMediaType")] + pub original_media_type: Option, + /// The audio type that most closely describes the audio being recognized. + #[serde(rename="microphoneDistance")] + pub microphone_distance: Option, + /// Mime type of the original audio file. For example `audio/m4a`, + /// `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + /// A list of possible audio mime types is maintained at + /// http://www.iana.org/assignments/media-types/media-types.xhtml#audio + #[serde(rename="originalMimeType")] + pub original_mime_type: Option, + /// The industry vertical to which this speech recognition request most + /// closely applies. This is most indicative of the topics contained + /// in the audio. Use the 6-digit NAICS code to identify the industry + /// vertical - see https://www.naics.com/search/. + #[serde(rename="industryNaicsCodeOfAudio")] + pub industry_naics_code_of_audio: Option, + /// Description of the content. Eg. "Recordings of federal supreme court + /// hearings from 2012". + #[serde(rename="audioTopic")] + pub audio_topic: Option, + /// The device used to make the recording. Examples 'Nexus 5X' or + /// 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + /// 'Cardioid Microphone'. + #[serde(rename="recordingDeviceName")] + pub recording_device_name: Option, + /// The use case most closely describing the audio content to be recognized. + #[serde(rename="interactionType")] + pub interaction_type: Option, } -impl ResponseResult for ListOperationsResponse {} +impl Part for RecognitionMetadata {} + + +/// Provides "hints" to the speech recognizer to favor specific words and phrases +/// in the results. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SpeechContext { + /// A list of strings containing words and phrases "hints" so that + /// the speech recognition is more likely to recognize them. This can be used + /// to improve the accuracy for specific words and phrases, for example, if + /// specific commands are typically spoken by the user. This can also be used + /// to add additional words to the vocabulary of the recognizer. See + /// [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + /// + /// List items can also be set to classes for groups of words that represent + /// common concepts that occur in natural language. For example, rather than + /// providing phrase hints for every month of the year, using the $MONTH class + /// improves the likelihood of correctly transcribing audio that includes + /// months. + pub phrases: Option>, +} + +impl Part for SpeechContext {} /// Contains audio data in the encoding specified in the `RecognitionConfig`. /// Either `content` or `uri` must be supplied. Supplying both or neither /// returns google.rpc.Code.INVALID_ARGUMENT. See -/// [content limits](/speech-to-text/quotas#content). +/// [content limits](https://cloud.google.com/speech-to-text/quotas#content). /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -499,7 +520,7 @@ impl Part for RecognitionAudio {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct WordInfo { - /// Output only. Time offset relative to the beginning of the audio, + /// Time offset relative to the beginning of the audio, /// and corresponding to the end of the spoken word. /// This field is only set if `enable_word_time_offsets=true` and only /// in the top hypothesis. @@ -507,9 +528,9 @@ pub struct WordInfo { /// vary. #[serde(rename="endTime")] pub end_time: Option, - /// Output only. The word corresponding to this set of information. + /// The word corresponding to this set of information. pub word: Option, - /// Output only. Time offset relative to the beginning of the audio, + /// Time offset relative to the beginning of the audio, /// and corresponding to the start of the spoken word. /// This field is only set if `enable_word_time_offsets=true` and only /// in the top hypothesis. @@ -517,11 +538,95 @@ pub struct WordInfo { /// vary. #[serde(rename="startTime")] pub start_time: Option, + /// Output only. A distinct integer value is assigned for every speaker within + /// the audio. This field specifies which one of those speakers was detected to + /// have spoken this word. Value ranges from '1' to diarization_speaker_count. + /// speaker_tag is set if enable_speaker_diarization = 'true' and only in the + /// top alternative. + #[serde(rename="speakerTag")] + pub speaker_tag: Option, } impl Part for WordInfo {} +/// Config to enable speaker diarization. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SpeakerDiarizationConfig { + /// Minimum number of speakers in the conversation. This range gives you more + /// flexibility by allowing the system to automatically determine the correct + /// number of speakers. If not set, the default value is 2. + #[serde(rename="minSpeakerCount")] + pub min_speaker_count: Option, + /// If 'true', enables speaker detection for each recognized word in + /// the top alternative of the recognition result using a speaker_tag provided + /// in the WordInfo. + #[serde(rename="enableSpeakerDiarization")] + pub enable_speaker_diarization: Option, + /// Maximum number of speakers in the conversation. This range gives you more + /// flexibility by allowing the system to automatically determine the correct + /// number of speakers. If not set, the default value is 6. + #[serde(rename="maxSpeakerCount")] + pub max_speaker_count: Option, + /// Output only. Unused. + #[serde(rename="speakerTag")] + pub speaker_tag: Option, +} + +impl Part for SpeakerDiarizationConfig {} + + +/// The `Status` type defines a logical error model that is suitable for +/// different programming environments, including REST APIs and RPC APIs. It is +/// used by [gRPC](https://github.com/grpc). Each `Status` message contains +/// three pieces of data: error code, error message, and error details. +/// +/// You can find out more about this error model and how to work with it in the +/// [API Design Guide](https://cloud.google.com/apis/design/errors). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Status { + /// A developer-facing error message, which should be in English. Any + /// user-facing error message should be localized and sent in the + /// google.rpc.Status.details field, or localized by the client. + pub message: Option, + /// The status code, which should be an enum value of google.rpc.Code. + pub code: Option, + /// A list of messages that carry the error details. There is a common set of + /// message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + +/// The response message for Operations.ListOperations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list operations](struct.OperationListCall.html) (response) +/// * [locations operations list projects](struct.ProjectLocationOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of operations that matches the specified filter in the request. + pub operations: Option>, +} + +impl ResponseResult for ListOperationsResponse {} + + /// The top-level message sent by the client for the `LongRunningRecognize` /// method. /// @@ -534,9 +639,9 @@ impl Part for WordInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LongRunningRecognizeRequest { - /// *Required* The audio data to be recognized. + /// Required. The audio data to be recognized. pub audio: Option, - /// *Required* Provides information to the recognizer that specifies how to + /// Required. Provides information to the recognizer that specifies how to /// process the request. pub config: Option, } @@ -544,31 +649,6 @@ pub struct LongRunningRecognizeRequest { impl RequestValue for LongRunningRecognizeRequest {} -/// Provides "hints" to the speech recognizer to favor specific words and phrases -/// in the results. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SpeechContext { - /// *Optional* A list of strings containing words and phrases "hints" so that - /// the speech recognition is more likely to recognize them. This can be used - /// to improve the accuracy for specific words and phrases, for example, if - /// specific commands are typically spoken by the user. This can also be used - /// to add additional words to the vocabulary of the recognizer. See - /// [usage limits](/speech-to-text/quotas#content). - /// - /// List items can also be set to classes for groups of words that represent - /// common concepts that occur in natural language. For example, rather than - /// providing phrase hints for every month of the year, using the $MONTH class - /// improves the likelihood of correctly transcribing audio that includes - /// months. - pub phrases: Option>, -} - -impl Part for SpeechContext {} - - /// This resource represents a long-running operation that is the result of a /// network API call. /// @@ -625,9 +705,9 @@ impl ResponseResult for Operation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RecognizeRequest { - /// *Required* The audio data to be recognized. + /// Required. The audio data to be recognized. pub audio: Option, - /// *Required* Provides information to the recognizer that specifies how to + /// Required. Provides information to the recognizer that specifies how to /// process the request. pub config: Option, } @@ -641,7 +721,7 @@ impl RequestValue for RecognizeRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SpeechRecognitionAlternative { - /// Output only. The confidence estimate between 0.0 and 1.0. A higher number + /// The confidence estimate between 0.0 and 1.0. A higher number /// indicates an estimated greater likelihood that the recognized words are /// correct. This field is set only for the top alternative of a non-streaming /// result or, of a streaming result where `is_final=true`. @@ -649,9 +729,9 @@ pub struct SpeechRecognitionAlternative { /// to be always provided. /// The default of 0.0 is a sentinel value indicating `confidence` was not set. pub confidence: Option, - /// Output only. Transcript text representing the words that the user spoke. + /// Transcript text representing the words that the user spoke. pub transcript: Option, - /// Output only. A list of word-specific information for each recognized word. + /// A list of word-specific information for each recognized word. /// Note: When `enable_speaker_diarization` is true, you will see all the words /// from the beginning of the audio. pub words: Option>, @@ -667,14 +747,15 @@ impl Part for SpeechRecognitionAlternative {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RecognitionConfig { - /// *Required* The language of the supplied audio as a + /// Required. The language of the supplied audio as a /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. /// Example: "en-US". - /// See [Language Support](/speech-to-text/docs/languages) - /// for a list of the currently supported language codes. + /// See [Language + /// Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + /// of the currently supported language codes. #[serde(rename="languageCode")] pub language_code: Option, - /// *Optional* The number of channels in the input audio data. + /// The number of channels in the input audio data. /// ONLY set this for MULTI-CHANNEL recognition. /// Valid values for LINEAR16 and FLAC are `1`-`8`. /// Valid values for OGG_OPUS are '1'-'254'. @@ -689,13 +770,10 @@ pub struct RecognitionConfig { /// This field is optional for `FLAC` and `WAV` audio files and required /// for all other audio formats. For details, see AudioEncoding. pub encoding: Option, - /// *Optional* If 'true', adds punctuation to recognition result hypotheses. + /// If 'true', adds punctuation to recognition result hypotheses. /// This feature is only available in select languages. Setting this for /// requests in other languages has no effect at all. /// The default 'false' value does not add punctuation to result hypotheses. - /// Note: This is currently offered as an experimental service, complimentary - /// to all users. In the future this may be exclusively available as a - /// premium feature. #[serde(rename="enableAutomaticPunctuation")] pub enable_automatic_punctuation: Option, /// This needs to be set to `true` explicitly and `audio_channel_count` > 1 @@ -706,13 +784,13 @@ pub struct RecognitionConfig { /// `audio_channel_count` multiplied by the length of the audio. #[serde(rename="enableSeparateRecognitionPerChannel")] pub enable_separate_recognition_per_channel: Option, - /// *Optional* If `true`, the top result includes a list of words and + /// If `true`, the top result includes a list of words and /// the start and end time offsets (timestamps) for those words. If /// `false`, no word-level time offset information is returned. The default is /// `false`. #[serde(rename="enableWordTimeOffsets")] pub enable_word_time_offsets: Option, - /// *Optional* Maximum number of recognition hypotheses to be returned. + /// Maximum number of recognition hypotheses to be returned. /// Specifically, the maximum number of `SpeechRecognitionAlternative` messages /// within each `SpeechRecognitionResult`. /// The server may return fewer than `max_alternatives`. @@ -720,7 +798,7 @@ pub struct RecognitionConfig { /// one. If omitted, will return a maximum of one. #[serde(rename="maxAlternatives")] pub max_alternatives: Option, - /// *Optional* Set to true to use an enhanced model for speech recognition. + /// Set to true to use an enhanced model for speech recognition. /// If `use_enhanced` is set to true and the `model` field is not set, then /// an appropriate enhanced model is chosen if an enhanced model exists for /// the audio. @@ -739,13 +817,13 @@ pub struct RecognitionConfig { /// required for all other audio formats. For details, see AudioEncoding. #[serde(rename="sampleRateHertz")] pub sample_rate_hertz: Option, - /// *Optional* If set to `true`, the server will attempt to filter out + /// If set to `true`, the server will attempt to filter out /// profanities, replacing all but the initial character in each filtered word /// with asterisks, e.g. "f***". If set to `false` or omitted, profanities /// won't be filtered out. #[serde(rename="profanityFilter")] pub profanity_filter: Option, - /// *Optional* Which model to select for the given request. Select the model + /// Which model to select for the given request. Select the model /// best suited to your domain to get best results. If a model is not /// explicitly specified, then we auto-select a model based on the parameters /// in the RecognitionConfig. @@ -779,66 +857,30 @@ pub struct RecognitionConfig { /// /// pub model: Option, - /// *Optional* array of SpeechContext. + /// Config to enable speaker diarization and set additional + /// parameters to make diarization better suited for your application. + /// Note: When this is enabled, we send all the words from the beginning of the + /// audio for the top alternative in every consecutive STREAMING responses. + /// This is done in order to improve our speaker tags as our models learn to + /// identify the speakers in the conversation over time. + /// For non-streaming requests, the diarization results will be provided only + /// in the top alternative of the FINAL SpeechRecognitionResult. + #[serde(rename="diarizationConfig")] + pub diarization_config: Option, + /// Array of SpeechContext. /// A means to provide context to assist the speech recognition. For more - /// information, see [Phrase Hints](/speech-to-text/docs/basics#phrase-hints). + /// information, see + /// [speech + /// adaptation](https://cloud.google.com/speech-to-text/docs/context-strength). #[serde(rename="speechContexts")] pub speech_contexts: Option>, - /// *Optional* Metadata regarding this request. + /// Metadata regarding this request. pub metadata: Option, } impl Part for RecognitionConfig {} -/// Description of audio data to be recognized. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RecognitionMetadata { - /// The type of device the speech was recorded with. - #[serde(rename="recordingDeviceType")] - pub recording_device_type: Option, - /// The original media the speech was recorded on. - #[serde(rename="originalMediaType")] - pub original_media_type: Option, - /// The audio type that most closely describes the audio being recognized. - #[serde(rename="microphoneDistance")] - pub microphone_distance: Option, - /// Obfuscated (privacy-protected) ID of the user, to identify number of - /// unique users using the service. - #[serde(rename="obfuscatedId")] - pub obfuscated_id: Option, - /// Mime type of the original audio file. For example `audio/m4a`, - /// `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - /// A list of possible audio mime types is maintained at - /// http://www.iana.org/assignments/media-types/media-types.xhtml#audio - #[serde(rename="originalMimeType")] - pub original_mime_type: Option, - /// The industry vertical to which this speech recognition request most - /// closely applies. This is most indicative of the topics contained - /// in the audio. Use the 6-digit NAICS code to identify the industry - /// vertical - see https://www.naics.com/search/. - #[serde(rename="industryNaicsCodeOfAudio")] - pub industry_naics_code_of_audio: Option, - /// Description of the content. Eg. "Recordings of federal supreme court - /// hearings from 2012". - #[serde(rename="audioTopic")] - pub audio_topic: Option, - /// The device used to make the recording. Examples 'Nexus 5X' or - /// 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - /// 'Cardioid Microphone'. - #[serde(rename="recordingDeviceName")] - pub recording_device_name: Option, - /// The use case most closely describing the audio content to be recognized. - #[serde(rename="interactionType")] - pub interaction_type: Option, -} - -impl Part for RecognitionMetadata {} - - // ################### // MethodBuilders ### diff --git a/gen/speech1_beta1-cli/Cargo.toml b/gen/speech1_beta1-cli/Cargo.toml index ae8a27c799..02adf0d745 100644 --- a/gen/speech1_beta1-cli/Cargo.toml +++ b/gen/speech1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-speech1_beta1-cli" -version = "1.0.12+20181005" +version = "1.0.13+20181005" authors = ["Sebastian Thiel "] description = "A complete library to interact with Speech (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/speech1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-speech1_beta1] path = "../speech1_beta1" -version = "1.0.12+20181005" +version = "1.0.13+20181005" diff --git a/gen/speech1_beta1-cli/README.md b/gen/speech1_beta1-cli/README.md index 029d4c8c15..bafae21250 100644 --- a/gen/speech1_beta1-cli/README.md +++ b/gen/speech1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Speech* API at revision *20181005*. The CLI is at version *1.0.12*. +This documentation was generated from the *Speech* API at revision *20181005*. The CLI is at version *1.0.13*. ```bash speech1-beta1 [options] diff --git a/gen/speech1_beta1-cli/mkdocs.yml b/gen/speech1_beta1-cli/mkdocs.yml index eabe90dd71..08e711a22d 100644 --- a/gen/speech1_beta1-cli/mkdocs.yml +++ b/gen/speech1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Speech v1.0.12+20181005 +site_name: Speech v1.0.13+20181005 site_url: http://byron.github.io/google-apis-rs/google-speech1_beta1-cli site_description: A complete library to interact with Speech (protocol v1beta1) diff --git a/gen/speech1_beta1-cli/src/main.rs b/gen/speech1_beta1-cli/src/main.rs index d0669f1f5c..9fd5f78022 100644 --- a/gen/speech1_beta1-cli/src/main.rs +++ b/gen/speech1_beta1-cli/src/main.rs @@ -574,7 +574,7 @@ fn main() { let mut app = App::new("speech1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20181005") + .version("1.0.13+20181005") .about("Converts audio to text by applying powerful neural network models.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_speech1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/speech1_beta1/Cargo.toml b/gen/speech1_beta1/Cargo.toml index 92befaf2e2..4a9e1dc243 100644 --- a/gen/speech1_beta1/Cargo.toml +++ b/gen/speech1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-speech1_beta1" -version = "1.0.12+20181005" +version = "1.0.13+20181005" authors = ["Sebastian Thiel "] description = "A complete library to interact with Speech (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/speech1_beta1" homepage = "https://cloud.google.com/speech-to-text/docs/quickstart-protocol" -documentation = "https://docs.rs/google-speech1_beta1/1.0.12+20181005" +documentation = "https://docs.rs/google-speech1_beta1/1.0.13+20181005" license = "MIT" keywords = ["speech", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/speech1_beta1/README.md b/gen/speech1_beta1/README.md index 67439976c0..93fa73e392 100644 --- a/gen/speech1_beta1/README.md +++ b/gen/speech1_beta1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-speech1_beta1` library allows access to all features of the *Google Speech* service. -This documentation was generated from *Speech* crate version *1.0.12+20181005*, where *20181005* is the exact revision of the *speech:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Speech* crate version *1.0.13+20181005*, where *20181005* is the exact revision of the *speech:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Speech* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/speech-to-text/docs/quickstart-protocol). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/struct.Speech.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/struct.Speech.html) ... -* [operations](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/struct.Operation.html) - * [*get*](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/struct.OperationListCall.html) +* [operations](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/struct.Operation.html) + * [*get*](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/struct.OperationListCall.html) * speech - * [*asyncrecognize*](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/struct.SpeechAsyncrecognizeCall.html) and [*syncrecognize*](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/struct.SpeechSyncrecognizeCall.html) + * [*asyncrecognize*](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/struct.SpeechAsyncrecognizeCall.html) and [*syncrecognize*](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/struct.SpeechSyncrecognizeCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/struct.Speech.html)** +* **[Hub](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/struct.Speech.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -152,29 +152,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-speech1_beta1/1.0.12+20181005/google_speech1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-speech1_beta1/1.0.13+20181005/google_speech1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/speech1_beta1/src/lib.rs b/gen/speech1_beta1/src/lib.rs index 2b98cbff37..44e0771720 100644 --- a/gen/speech1_beta1/src/lib.rs +++ b/gen/speech1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Speech* crate version *1.0.12+20181005*, where *20181005* is the exact revision of the *speech:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Speech* crate version *1.0.13+20181005*, where *20181005* is the exact revision of the *speech:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Speech* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/speech-to-text/docs/quickstart-protocol). @@ -329,7 +329,7 @@ impl<'a, C, A> Speech Speech { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://speech.googleapis.com/".to_string(), _root_url: "https://speech.googleapis.com/".to_string(), } @@ -343,7 +343,7 @@ impl<'a, C, A> Speech } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/sqladmin1_beta4-cli/Cargo.toml b/gen/sqladmin1_beta4-cli/Cargo.toml index 7000cb20db..4a0b1bc404 100644 --- a/gen/sqladmin1_beta4-cli/Cargo.toml +++ b/gen/sqladmin1_beta4-cli/Cargo.toml @@ -3,19 +3,19 @@ # DO NOT EDIT ! [package] -name = "google-sqladmin1_beta4-cli" -version = "1.0.12+20190607" +name = "google-sql1_beta4-cli" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with SQL Admin (protocol v1beta4)" -repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4-cli" -homepage = "https://cloud.google.com/sql/docs/reference/latest" -documentation = "http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sql1_beta4-cli" +homepage = "https://developers.google.com/cloud-sql/" +documentation = "http://byron.github.io/google-apis-rs/google_sql1_beta4_cli" license = "MIT" -keywords = ["sqladmin", "google", "cli"] +keywords = ["sql", "google", "cli"] autobins = false [[bin]] -name = "sqladmin1-beta4" +name = "sql1-beta4" path = "src/main.rs" [dev-dependencies] @@ -40,6 +40,6 @@ rustls = ["yup-oauth2/no-openssl"] -[dependencies.google-sqladmin1_beta4] -path = "../sqladmin1_beta4" -version = "1.0.12+20190607" +[dependencies.google-sql1_beta4] +path = "../sql1_beta4" +version = "1.0.13+20200331" diff --git a/gen/sqladmin1_beta4-cli/README.md b/gen/sqladmin1_beta4-cli/README.md index ed061039de..b9d977de10 100644 --- a/gen/sqladmin1_beta4-cli/README.md +++ b/gen/sqladmin1_beta4-cli/README.md @@ -3,7 +3,7 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `sqladmin1-beta4` command-line interface *(CLI)* allows to use most features of the *Google SQL Admin* service from the comfort of your terminal. +The `sql1-beta4` command-line interface *(CLI)* allows to use most features of the *Google SQL Admin* service from the comfort of your terminal. By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. @@ -11,24 +11,24 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *SQL Admin* API can be found at the -[official documentation site](https://cloud.google.com/sql/docs/reference/latest). +[official documentation site](https://developers.google.com/cloud-sql/). # Installation and Source Code Install the command-line interface with cargo using: ```bash -cargo install google-sqladmin1_beta4-cli +cargo install google-sql1_beta4-cli ``` -Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4-cli). +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sql1_beta4-cli). # Usage -This documentation was generated from the *SQL Admin* API at revision *20190607*. The CLI is at version *1.0.12*. +This documentation was generated from the *SQL Admin* API at revision *20200331*. The CLI is at version *1.0.13*. ```bash -sqladmin1-beta4 [options] +sql1-beta4 [options] backup-runs delete [-p ]... [-o ] get [-p ]... [-o ] @@ -67,7 +67,11 @@ sqladmin1-beta4 [options] update (-r )... [-p ]... [-o ] operations get [-p ]... [-o ] - list [-p ]... [-o ] + list [-p ]... [-o ] + projects + instances-reschedule-maintenance (-r )... [-p ]... [-o ] + instances-start-external-sync [-p ]... [-o ] + instances-verify-external-sync-settings [-p ]... [-o ] ssl-certs create-ephemeral (-r )... [-p ]... [-o ] delete [-p ]... [-o ] @@ -77,11 +81,11 @@ sqladmin1-beta4 [options] tiers list [-p ]... [-o ] users - delete [-p ]... [-o ] + delete [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] - update (-r )... [-p ]... [-o ] - sqladmin1-beta4 --help + update (-r )... [-p ]... [-o ] + sql1-beta4 --help Configuration: [--scope ]... @@ -103,7 +107,7 @@ Configuration: # Configuration -The program will store all persistent data in the `~/.google-service-cli` directory in *JSON* files prefixed with `sqladmin1-beta4-`. You can change the directory used to store configuration with the `--config-dir` flag on a per-invocation basis. +The program will store all persistent data in the `~/.google-service-cli` directory in *JSON* files prefixed with `sql1-beta4-`. You can change the directory used to store configuration with the `--config-dir` flag on a per-invocation basis. More information about the various kinds of persistent data are given in the following paragraphs. @@ -121,7 +125,7 @@ The first time a scope is used, the user is asked for permission. Follow the ins by the CLI to grant permissions, or to decline. If a scope was authenticated by the user, the respective information will be stored as *JSON* in the configuration -directory, e.g. `~/.google-service-cli/sqladmin1-beta4-token-.json`. No manual management of these tokens +directory, e.g. `~/.google-service-cli/sql1-beta4-token-.json`. No manual management of these tokens is necessary. To revoke granted authentication, please refer to the [official documentation][revoke-access]. @@ -137,7 +141,7 @@ comes with a default application secret that is configured accordingly. This als all around the world may deplete the daily quota. You can workaround this limitation by putting your own secrets file at this location: -`~/.google-service-cli/sqladmin1-beta4-secret.json`, assuming that the required *sqladmin* API +`~/.google-service-cli/sql1-beta4-secret.json`, assuming that the required *sql* API was enabled for it. Such a secret file can be downloaded in the *Google Developer Console* at *APIs & auth -> Credentials -> Download JSON* and used as is. @@ -155,7 +159,7 @@ will cause all communication related to authentication to standard error. If the `--debug` flag is set, error-results will be debug-printed, possibly yielding more information about the issue at hand. -You may consider redirecting standard error into a file for ease of use, e.g. `sqladmin1-beta4 --debug [options] 2>debug.txt`. +You may consider redirecting standard error into a file for ease of use, e.g. `sql1-beta4 --debug [options] 2>debug.txt`. [scopes]: https://developers.google.com/+/api/oauth#scopes diff --git a/gen/sqladmin1_beta4-cli/mkdocs.yml b/gen/sqladmin1_beta4-cli/mkdocs.yml index a07f8d75b6..6fed5d79f0 100644 --- a/gen/sqladmin1_beta4-cli/mkdocs.yml +++ b/gen/sqladmin1_beta4-cli/mkdocs.yml @@ -1,8 +1,8 @@ -site_name: SQL Admin v1.0.12+20190607 -site_url: http://byron.github.io/google-apis-rs/google-sqladmin1_beta4-cli +site_name: SQL Admin v1.0.13+20200331 +site_url: http://byron.github.io/google-apis-rs/google-sql1_beta4-cli site_description: A complete library to interact with SQL Admin (protocol v1beta4) -repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4-cli +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/sql1_beta4-cli docs_dir: docs site_dir: build_html @@ -43,6 +43,9 @@ pages: - ['instances_update.md', 'Instances', 'Update'] - ['operations_get.md', 'Operations', 'Get'] - ['operations_list.md', 'Operations', 'List'] +- ['projects_instances-reschedule-maintenance.md', 'Projects', 'Instances Reschedule Maintenance'] +- ['projects_instances-start-external-sync.md', 'Projects', 'Instances Start External Sync'] +- ['projects_instances-verify-external-sync-settings.md', 'Projects', 'Instances Verify External Sync Settings'] - ['ssl-certs_create-ephemeral.md', 'Ssl Certs', 'Create Ephemeral'] - ['ssl-certs_delete.md', 'Ssl Certs', 'Delete'] - ['ssl-certs_get.md', 'Ssl Certs', 'Get'] diff --git a/gen/sqladmin1_beta4-cli/src/main.rs b/gen/sqladmin1_beta4-cli/src/main.rs index 17fe420023..5c18802e25 100644 --- a/gen/sqladmin1_beta4-cli/src/main.rs +++ b/gen/sqladmin1_beta4-cli/src/main.rs @@ -13,7 +13,7 @@ extern crate serde_json; extern crate hyper; extern crate mime; extern crate strsim; -extern crate google_sqladmin1_beta4 as api; +extern crate google_sql1_beta4 as api; use std::env; use std::io::{self, Write}; @@ -174,10 +174,14 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-encryption-configuration.kind" => Some(("diskEncryptionConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-encryption-configuration.kms-key-name" => Some(("diskEncryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "window-start-time" => Some(("windowStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "enqueued-time" => Some(("enqueuedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-encryption-status.kms-key-version-name" => Some(("diskEncryptionStatus.kmsKeyVersionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "disk-encryption-status.kind" => Some(("diskEncryptionStatus.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "instance" => Some(("instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -186,10 +190,10 @@ impl<'n> Engine<'n> { "error.message" => Some(("error.message", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "enqueued-time" => Some(("enqueuedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "description", "end-time", "enqueued-time", "error", "id", "instance", "kind", "location", "message", "self-link", "start-time", "status", "type", "window-start-time"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["code", "description", "disk-encryption-configuration", "disk-encryption-status", "end-time", "enqueued-time", "error", "id", "instance", "kind", "kms-key-name", "kms-key-version-name", "location", "message", "self-link", "start-time", "status", "type", "window-start-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -435,6 +439,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "sqlserver-database-details.compatibility-level" => Some(("sqlserverDatabaseDetails.compatibilityLevel", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "sqlserver-database-details.recovery-model" => Some(("sqlserverDatabaseDetails.recoveryModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "charset" => Some(("charset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -444,7 +450,7 @@ impl<'n> Engine<'n> { "collation" => Some(("collation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["charset", "collation", "etag", "instance", "kind", "name", "project", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["charset", "collation", "compatibility-level", "etag", "instance", "kind", "name", "project", "recovery-model", "self-link", "sqlserver-database-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -579,6 +585,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "sqlserver-database-details.compatibility-level" => Some(("sqlserverDatabaseDetails.compatibilityLevel", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "sqlserver-database-details.recovery-model" => Some(("sqlserverDatabaseDetails.recoveryModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "charset" => Some(("charset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -588,7 +596,7 @@ impl<'n> Engine<'n> { "collation" => Some(("collation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["charset", "collation", "etag", "instance", "kind", "name", "project", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["charset", "collation", "compatibility-level", "etag", "instance", "kind", "name", "project", "recovery-model", "self-link", "sqlserver-database-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -671,6 +679,8 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "sqlserver-database-details.compatibility-level" => Some(("sqlserverDatabaseDetails.compatibilityLevel", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "sqlserver-database-details.recovery-model" => Some(("sqlserverDatabaseDetails.recoveryModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "charset" => Some(("charset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -680,7 +690,7 @@ impl<'n> Engine<'n> { "collation" => Some(("collation", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["charset", "collation", "etag", "instance", "kind", "name", "project", "self-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["charset", "collation", "compatibility-level", "etag", "instance", "kind", "name", "project", "recovery-model", "self-link", "sqlserver-database-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -875,10 +885,11 @@ impl<'n> Engine<'n> { "clone-context.bin-log-coordinates.kind" => Some(("cloneContext.binLogCoordinates.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "clone-context.bin-log-coordinates.bin-log-file-name" => Some(("cloneContext.binLogCoordinates.binLogFileName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "clone-context.kind" => Some(("cloneContext.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "clone-context.point-in-time" => Some(("cloneContext.pointInTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "clone-context.pitr-timestamp-ms" => Some(("cloneContext.pitrTimestampMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "clone-context.destination-instance-name" => Some(("cloneContext.destinationInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["bin-log-coordinates", "bin-log-file-name", "bin-log-position", "clone-context", "destination-instance-name", "kind", "pitr-timestamp-ms"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bin-log-coordinates", "bin-log-file-name", "bin-log-position", "clone-context", "destination-instance-name", "kind", "pitr-timestamp-ms", "point-in-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1337,6 +1348,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "import-context.bak-import-options.encryption-options.pvk-path" => Some(("importContext.bakImportOptions.encryptionOptions.pvkPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "import-context.bak-import-options.encryption-options.cert-path" => Some(("importContext.bakImportOptions.encryptionOptions.certPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "import-context.bak-import-options.encryption-options.pvk-password" => Some(("importContext.bakImportOptions.encryptionOptions.pvkPassword", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-context.kind" => Some(("importContext.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-context.database" => Some(("importContext.database", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-context.file-type" => Some(("importContext.fileType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1345,7 +1359,7 @@ impl<'n> Engine<'n> { "import-context.csv-import-options.table" => Some(("importContext.csvImportOptions.table", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "import-context.csv-import-options.columns" => Some(("importContext.csvImportOptions.columns", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["columns", "csv-import-options", "database", "file-type", "import-context", "import-user", "kind", "table", "uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["bak-import-options", "cert-path", "columns", "csv-import-options", "database", "encryption-options", "file-type", "import-context", "import-user", "kind", "pvk-password", "pvk-path", "table", "uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1436,6 +1450,9 @@ impl<'n> Engine<'n> { "max-disk-size" => Some(("maxDiskSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-configuration.kind" => Some(("diskEncryptionConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-configuration.kms-key-name" => Some(("diskEncryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-maintenance.start-time" => Some(("scheduledMaintenance.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-maintenance.can-defer" => Some(("scheduledMaintenance.canDefer", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "scheduled-maintenance.can-reschedule" => Some(("scheduledMaintenance.canReschedule", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "suspension-reason" => Some(("suspensionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "master-instance-name" => Some(("masterInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-status.kms-key-version-name" => Some(("diskEncryptionStatus.kmsKeyVersionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1446,8 +1463,14 @@ impl<'n> Engine<'n> { "failover-replica.available" => Some(("failoverReplica.available", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "failover-replica.name" => Some(("failoverReplica.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "replica-names" => Some(("replicaNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "on-premises-configuration.username" => Some(("onPremisesConfiguration.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "on-premises-configuration.kind" => Some(("onPremisesConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.password" => Some(("onPremisesConfiguration.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.ca-certificate" => Some(("onPremisesConfiguration.caCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.client-certificate" => Some(("onPremisesConfiguration.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.dump-file-path" => Some(("onPremisesConfiguration.dumpFilePath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "on-premises-configuration.host-port" => Some(("onPremisesConfiguration.hostPort", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.client-key" => Some(("onPremisesConfiguration.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "connection-name" => Some(("connectionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1477,6 +1500,7 @@ impl<'n> Engine<'n> { "settings.backup-configuration.binary-log-enabled" => Some(("settings.backupConfiguration.binaryLogEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.backup-configuration.location" => Some(("settings.backupConfiguration.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.backup-configuration.start-time" => Some(("settings.backupConfiguration.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.backup-configuration.point-in-time-recovery-enabled" => Some(("settings.backupConfiguration.pointInTimeRecoveryEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.ipv4-enabled" => Some(("settings.ipConfiguration.ipv4Enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.require-ssl" => Some(("settings.ipConfiguration.requireSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.private-network" => Some(("settings.ipConfiguration.privateNetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1510,7 +1534,7 @@ impl<'n> Engine<'n> { "root-password" => Some(("rootPassword", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "disk-encryption-configuration", "disk-encryption-status", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "kms-key-name", "kms-key-version-name", "location", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "private-network", "project", "region", "replica-configuration", "replica-names", "replication-log-archiving-enabled", "replication-type", "require-ssl", "root-password", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "can-defer", "can-reschedule", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "disk-encryption-configuration", "disk-encryption-status", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "kms-key-name", "kms-key-version-name", "location", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "point-in-time-recovery-enabled", "pricing-plan", "private-network", "project", "region", "replica-configuration", "replica-names", "replication-log-archiving-enabled", "replication-type", "require-ssl", "root-password", "scheduled-maintenance", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1715,6 +1739,9 @@ impl<'n> Engine<'n> { "max-disk-size" => Some(("maxDiskSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-configuration.kind" => Some(("diskEncryptionConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-configuration.kms-key-name" => Some(("diskEncryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-maintenance.start-time" => Some(("scheduledMaintenance.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-maintenance.can-defer" => Some(("scheduledMaintenance.canDefer", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "scheduled-maintenance.can-reschedule" => Some(("scheduledMaintenance.canReschedule", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "suspension-reason" => Some(("suspensionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "master-instance-name" => Some(("masterInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-status.kms-key-version-name" => Some(("diskEncryptionStatus.kmsKeyVersionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1725,8 +1752,14 @@ impl<'n> Engine<'n> { "failover-replica.available" => Some(("failoverReplica.available", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "failover-replica.name" => Some(("failoverReplica.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "replica-names" => Some(("replicaNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "on-premises-configuration.username" => Some(("onPremisesConfiguration.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "on-premises-configuration.kind" => Some(("onPremisesConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.password" => Some(("onPremisesConfiguration.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.ca-certificate" => Some(("onPremisesConfiguration.caCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.client-certificate" => Some(("onPremisesConfiguration.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.dump-file-path" => Some(("onPremisesConfiguration.dumpFilePath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "on-premises-configuration.host-port" => Some(("onPremisesConfiguration.hostPort", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.client-key" => Some(("onPremisesConfiguration.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "connection-name" => Some(("connectionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1756,6 +1789,7 @@ impl<'n> Engine<'n> { "settings.backup-configuration.binary-log-enabled" => Some(("settings.backupConfiguration.binaryLogEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.backup-configuration.location" => Some(("settings.backupConfiguration.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.backup-configuration.start-time" => Some(("settings.backupConfiguration.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.backup-configuration.point-in-time-recovery-enabled" => Some(("settings.backupConfiguration.pointInTimeRecoveryEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.ipv4-enabled" => Some(("settings.ipConfiguration.ipv4Enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.require-ssl" => Some(("settings.ipConfiguration.requireSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.private-network" => Some(("settings.ipConfiguration.privateNetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1789,7 +1823,7 @@ impl<'n> Engine<'n> { "root-password" => Some(("rootPassword", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "disk-encryption-configuration", "disk-encryption-status", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "kms-key-name", "kms-key-version-name", "location", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "private-network", "project", "region", "replica-configuration", "replica-names", "replication-log-archiving-enabled", "replication-type", "require-ssl", "root-password", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "can-defer", "can-reschedule", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "disk-encryption-configuration", "disk-encryption-status", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "kms-key-name", "kms-key-version-name", "location", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "point-in-time-recovery-enabled", "pricing-plan", "private-network", "project", "region", "replica-configuration", "replica-names", "replication-log-archiving-enabled", "replication-type", "require-ssl", "root-password", "scheduled-maintenance", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2400,6 +2434,9 @@ impl<'n> Engine<'n> { "max-disk-size" => Some(("maxDiskSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-configuration.kind" => Some(("diskEncryptionConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-configuration.kms-key-name" => Some(("diskEncryptionConfiguration.kmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-maintenance.start-time" => Some(("scheduledMaintenance.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "scheduled-maintenance.can-defer" => Some(("scheduledMaintenance.canDefer", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "scheduled-maintenance.can-reschedule" => Some(("scheduledMaintenance.canReschedule", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "suspension-reason" => Some(("suspensionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "master-instance-name" => Some(("masterInstanceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-encryption-status.kms-key-version-name" => Some(("diskEncryptionStatus.kmsKeyVersionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2410,8 +2447,14 @@ impl<'n> Engine<'n> { "failover-replica.available" => Some(("failoverReplica.available", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "failover-replica.name" => Some(("failoverReplica.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "replica-names" => Some(("replicaNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "on-premises-configuration.username" => Some(("onPremisesConfiguration.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "on-premises-configuration.kind" => Some(("onPremisesConfiguration.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.password" => Some(("onPremisesConfiguration.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.ca-certificate" => Some(("onPremisesConfiguration.caCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.client-certificate" => Some(("onPremisesConfiguration.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.dump-file-path" => Some(("onPremisesConfiguration.dumpFilePath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "on-premises-configuration.host-port" => Some(("onPremisesConfiguration.hostPort", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "on-premises-configuration.client-key" => Some(("onPremisesConfiguration.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "connection-name" => Some(("connectionName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2441,6 +2484,7 @@ impl<'n> Engine<'n> { "settings.backup-configuration.binary-log-enabled" => Some(("settings.backupConfiguration.binaryLogEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.backup-configuration.location" => Some(("settings.backupConfiguration.location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.backup-configuration.start-time" => Some(("settings.backupConfiguration.startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.backup-configuration.point-in-time-recovery-enabled" => Some(("settings.backupConfiguration.pointInTimeRecoveryEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.ipv4-enabled" => Some(("settings.ipConfiguration.ipv4Enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.require-ssl" => Some(("settings.ipConfiguration.requireSsl", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.ip-configuration.private-network" => Some(("settings.ipConfiguration.privateNetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2474,7 +2518,7 @@ impl<'n> Engine<'n> { "root-password" => Some(("rootPassword", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "disk-encryption-configuration", "disk-encryption-status", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "kms-key-name", "kms-key-version-name", "location", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "private-network", "project", "region", "replica-configuration", "replica-names", "replication-log-archiving-enabled", "replication-type", "require-ssl", "root-password", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "can-defer", "can-reschedule", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "disk-encryption-configuration", "disk-encryption-status", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "gce-zone", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "kms-key-name", "kms-key-version-name", "location", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "point-in-time-recovery-enabled", "pricing-plan", "private-network", "project", "region", "replica-configuration", "replica-names", "replication-log-archiving-enabled", "replication-type", "require-ssl", "root-password", "scheduled-maintenance", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "user-labels", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2588,7 +2632,7 @@ impl<'n> Engine<'n> { fn _operations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.operations().list(opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + let mut call = self.hub.operations().list(opt.value_of("project").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { @@ -2598,6 +2642,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "instance" => { + call = call.instance(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2611,7 +2658,208 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["page-token", "max-results"].iter().map(|v|*v)); + v.extend(["page-token", "max-results", "instance"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_reschedule_maintenance(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "reschedule.schedule-time" => Some(("reschedule.scheduleTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reschedule.reschedule-type" => Some(("reschedule.rescheduleType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["reschedule", "reschedule-type", "schedule-time"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SqlInstancesRescheduleMaintenanceRequestBody = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().instances_reschedule_maintenance(request, opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_start_external_sync(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_start_external_sync(opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "sync-mode" => { + call = call.sync_mode(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["sync-mode"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_instances_verify_external_sync_settings(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().instances_verify_external_sync_settings(opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "verify-connection-only" => { + call = call.verify_connection_only(arg_from_str(value.unwrap_or("false"), err, "verify-connection-only", "boolean")); + }, + "sync-mode" => { + call = call.sync_mode(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["sync-mode", "verify-connection-only"].iter().map(|v|*v)); v } )); } } @@ -3025,10 +3273,16 @@ impl<'n> Engine<'n> { fn _users_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.users().delete(opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or(""), opt.value_of("host").unwrap_or(""), opt.value_of("name").unwrap_or("")); + let mut call = self.hub.users().delete(opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "name" => { + call = call.name(value.unwrap_or("")); + }, + "host" => { + call = call.host(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3042,6 +3296,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["host", "name"].iter().map(|v|*v)); v } )); } } @@ -3104,9 +3359,11 @@ impl<'n> Engine<'n> { "instance" => Some(("instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "host" => Some(("host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sqlserver-user-details.disabled" => Some(("sqlserverUserDetails.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "sqlserver-user-details.server-roles" => Some(("sqlserverUserDetails.serverRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "host", "instance", "kind", "name", "password", "project"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["disabled", "etag", "host", "instance", "kind", "name", "password", "project", "server-roles", "sqlserver-user-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3247,9 +3504,11 @@ impl<'n> Engine<'n> { "instance" => Some(("instance", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "host" => Some(("host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sqlserver-user-details.disabled" => Some(("sqlserverUserDetails.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "sqlserver-user-details.server-roles" => Some(("sqlserverUserDetails.serverRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "host", "instance", "kind", "name", "password", "project"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["disabled", "etag", "host", "instance", "kind", "name", "password", "project", "server-roles", "sqlserver-user-details"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3259,10 +3518,13 @@ impl<'n> Engine<'n> { } } let mut request: api::User = json::value::from_value(object).unwrap(); - let mut call = self.hub.users().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or(""), opt.value_of("name").unwrap_or("")); + let mut call = self.hub.users().update(request, opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or("")); for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "name" => { + call = call.name(value.unwrap_or("")); + }, "host" => { call = call.host(value.unwrap_or("")); }, @@ -3279,7 +3541,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["host"].iter().map(|v|*v)); + v.extend(["host", "name"].iter().map(|v|*v)); v } )); } } @@ -3460,6 +3722,23 @@ impl<'n> Engine<'n> { } } }, + ("projects", Some(opt)) => { + match opt.subcommand() { + ("instances-reschedule-maintenance", Some(opt)) => { + call_result = self._projects_instances_reschedule_maintenance(opt, dry_run, &mut err); + }, + ("instances-start-external-sync", Some(opt)) => { + call_result = self._projects_instances_start_external_sync(opt, dry_run, &mut err); + }, + ("instances-verify-external-sync-settings", Some(opt)) => { + call_result = self._projects_instances_verify_external_sync_settings(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("ssl-certs", Some(opt)) => { match opt.subcommand() { ("create-ephemeral", Some(opt)) => { @@ -3538,7 +3817,7 @@ impl<'n> Engine<'n> { Ok(p) => p, }; - match cmn::application_secret_from_directory(&config_dir, "sqladmin1-beta4-secret.json", + match cmn::application_secret_from_directory(&config_dir, "sql1-beta4-secret.json", "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"hCsslbCUyfehWMmbkG8vTYxG\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"620010449518-9ngf7o4dhs0dka470npqvor6dc5lqb9b.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}") { Ok(secret) => (config_dir, secret), Err(e) => return Err(InvalidOptionsError::single(e, 4)) @@ -3554,7 +3833,7 @@ impl<'n> Engine<'n> { hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())) }, JsonTokenStorage { - program_name: "sqladmin1-beta4", + program_name: "sql1-beta4", db_dir: config_dir.clone(), }, Some(FlowType::InstalledRedirect(54324))); @@ -3569,12 +3848,15 @@ impl<'n> Engine<'n> { let engine = Engine { opt: opt, hub: api::SQLAdmin::new(client, auth), - gp: vec!["alt", "fields", "key", "oauth-token", "pretty-print", "quota-user", "user-ip"], + gp: vec!["$-xgafv", "access-token", "alt", "callback", "fields", "key", "oauth-token", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), ("oauth-token", "oauth_token"), ("pretty-print", "prettyPrint"), ("quota-user", "quotaUser"), - ("user-ip", "userIp"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), ] }; @@ -3599,7 +3881,7 @@ fn main() { ("backup-runs", "methods: 'delete', 'get', 'insert' and 'list'", vec![ ("delete", Some(r##"Deletes the backup taken by a backup run."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/backup-runs_delete", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/backup-runs_delete", vec![ (Some(r##"project"##), None, @@ -3615,7 +3897,9 @@ fn main() { (Some(r##"id"##), None, - Some(r##"The ID of the Backup Run to delete. To find a Backup Run ID, use the list method."##), + Some(r##"The ID of the Backup Run to delete. To find a Backup Run ID, use the list + method."##), Some(true), Some(false)), @@ -3633,7 +3917,7 @@ fn main() { ]), ("get", Some(r##"Retrieves a resource containing information about a backup run."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/backup-runs_get", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/backup-runs_get", vec![ (Some(r##"project"##), None, @@ -3666,8 +3950,9 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Creates a new backup run on demand. This method is applicable only to Second Generation instances."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/backup-runs_insert", + Some(r##"Creates a new backup run on demand. This method is applicable only to + Second Generation instances."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/backup-runs_insert", vec![ (Some(r##"project"##), None, @@ -3700,8 +3985,9 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/backup-runs_list", + Some(r##"Lists all backup runs associated with a given instance and configuration in + the reverse chronological order of the backup initiation time."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/backup-runs_list", vec![ (Some(r##"project"##), None, @@ -3732,7 +4018,7 @@ fn main() { ("databases", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", Some(r##"Deletes a database from a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/databases_delete", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/databases_delete", vec![ (Some(r##"project"##), None, @@ -3765,8 +4051,9 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves a resource containing information about a database inside a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/databases_get", + Some(r##"Retrieves a resource containing information about a database inside a Cloud + SQL instance."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/databases_get", vec![ (Some(r##"project"##), None, @@ -3799,8 +4086,9 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Inserts a resource containing information about a database inside a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/databases_insert", + Some(r##"Inserts a resource containing information about a database inside a Cloud + SQL instance."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/databases_insert", vec![ (Some(r##"project"##), None, @@ -3834,7 +4122,7 @@ fn main() { ]), ("list", Some(r##"Lists databases in the specified Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/databases_list", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/databases_list", vec![ (Some(r##"project"##), None, @@ -3861,8 +4149,9 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/databases_patch", + Some(r##"Partially updates a resource containing information about a database inside + a Cloud SQL instance. This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/databases_patch", vec![ (Some(r##"project"##), None, @@ -3901,8 +4190,9 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates a resource containing information about a database inside a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/databases_update", + Some(r##"Updates a resource containing information about a database inside a Cloud + SQL instance."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/databases_update", vec![ (Some(r##"project"##), None, @@ -3945,7 +4235,7 @@ fn main() { ("flags", "methods: 'list'", vec![ ("list", Some(r##"List all available database flags for Cloud SQL instances."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/flags_list", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/flags_list", vec![ (Some(r##"v"##), Some(r##"p"##), @@ -3963,8 +4253,12 @@ fn main() { ("instances", "methods: 'add-server-ca', 'clone', 'delete', 'demote-master', 'export', 'failover', 'get', 'import', 'insert', 'list', 'list-server-cas', 'patch', 'promote-replica', 'reset-ssl-config', 'restart', 'restore-backup', 'rotate-server-ca', 'start-replica', 'stop-replica', 'truncate-log' and 'update'", vec![ ("add-server-ca", - Some(r##"Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_add-server-ca", + Some(r##"Add a new trusted Certificate Authority (CA) version for the specified + instance. Required to prepare for a certificate rotation. If a CA version + was previously added but never used in a certificate rotation, this + operation replaces that version. There cannot be more than one CA version + waiting to be rotated in."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_add-server-ca", vec![ (Some(r##"project"##), None, @@ -3991,8 +4285,9 @@ fn main() { Some(false)), ]), ("clone", - Some(r##"Creates a Cloud SQL instance as a clone of the source instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_clone", + Some(r##"Creates a Cloud SQL instance as a clone of the source instance. Using this + operation might cause your instance to restart."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_clone", vec![ (Some(r##"project"##), None, @@ -4002,7 +4297,8 @@ fn main() { (Some(r##"instance"##), None, - Some(r##"The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID."##), + Some(r##"The ID of the Cloud SQL instance to be cloned (source). This does not + include the project ID."##), Some(true), Some(false)), @@ -4026,7 +4322,7 @@ fn main() { ]), ("delete", Some(r##"Deletes a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_delete", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_delete", vec![ (Some(r##"project"##), None, @@ -4053,8 +4349,9 @@ fn main() { Some(false)), ]), ("demote-master", - Some(r##"Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_demote-master", + Some(r##"Demotes the stand-alone instance to be a Cloud SQL read replica for an + external database server."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_demote-master", vec![ (Some(r##"project"##), None, @@ -4087,8 +4384,9 @@ fn main() { Some(false)), ]), ("export", - Some(r##"Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_export", + Some(r##"Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL + dump or CSV file."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_export", vec![ (Some(r##"project"##), None, @@ -4121,8 +4419,9 @@ fn main() { Some(false)), ]), ("failover", - Some(r##"Failover the instance to its failover replica instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_failover", + Some(r##"Failover the instance to its failover replica instance. Using this + operation might cause your instance to restart."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_failover", vec![ (Some(r##"project"##), None, @@ -4156,7 +4455,7 @@ fn main() { ]), ("get", Some(r##"Retrieves a resource containing information about a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_get", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_get", vec![ (Some(r##"project"##), None, @@ -4183,8 +4482,9 @@ fn main() { Some(false)), ]), ("import", - Some(r##"Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_import", + Some(r##"Imports data into a Cloud SQL instance from a SQL dump or CSV file in + Cloud Storage."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_import", vec![ (Some(r##"project"##), None, @@ -4218,11 +4518,12 @@ fn main() { ]), ("insert", Some(r##"Creates a new Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_insert", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_insert", vec![ (Some(r##"project"##), None, - Some(r##"Project ID of the project to which the newly created Cloud SQL instances should belong."##), + Some(r##"Project ID of the project to which the newly created Cloud SQL instances + should belong."##), Some(true), Some(false)), @@ -4245,8 +4546,8 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists instances under a given project in the alphabetical order of the instance name."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_list", + Some(r##"Lists instances under a given project."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_list", vec![ (Some(r##"project"##), None, @@ -4267,8 +4568,12 @@ fn main() { Some(false)), ]), ("list-server-cas", - Some(r##"Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_list-server-cas", + Some(r##"Lists all of the trusted Certificate Authorities (CAs) for the specified + instance. There can be up to three CAs listed: the CA that was used to sign + the certificate that is currently in use, a CA that has been added but not + yet used to sign a certificate, and a CA used to sign a certificate that + has previously rotated out."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_list-server-cas", vec![ (Some(r##"project"##), None, @@ -4295,8 +4600,9 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_patch", + Some(r##"Updates settings of a Cloud SQL instance. + This method supports patch semantics."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_patch", vec![ (Some(r##"project"##), None, @@ -4329,8 +4635,9 @@ fn main() { Some(false)), ]), ("promote-replica", - Some(r##"Promotes the read replica instance to be a stand-alone Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_promote-replica", + Some(r##"Promotes the read replica instance to be a stand-alone Cloud SQL instance. + Using this operation might cause your instance to restart."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_promote-replica", vec![ (Some(r##"project"##), None, @@ -4357,8 +4664,9 @@ fn main() { Some(false)), ]), ("reset-ssl-config", - Some(r##"Deletes all client certificates and generates a new server SSL certificate for the instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_reset-ssl-config", + Some(r##"Deletes all client certificates and generates a new server SSL certificate + for the instance."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_reset-ssl-config", vec![ (Some(r##"project"##), None, @@ -4386,7 +4694,7 @@ fn main() { ]), ("restart", Some(r##"Restarts a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_restart", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_restart", vec![ (Some(r##"project"##), None, @@ -4413,8 +4721,9 @@ fn main() { Some(false)), ]), ("restore-backup", - Some(r##"Restores a backup of a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_restore-backup", + Some(r##"Restores a backup of a Cloud SQL instance. Using this operation might cause + your instance to restart."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_restore-backup", vec![ (Some(r##"project"##), None, @@ -4447,8 +4756,9 @@ fn main() { Some(false)), ]), ("rotate-server-ca", - Some(r##"Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_rotate-server-ca", + Some(r##"Rotates the server certificate to one signed by the Certificate Authority + (CA) version previously added with the addServerCA method."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_rotate-server-ca", vec![ (Some(r##"project"##), None, @@ -4482,7 +4792,7 @@ fn main() { ]), ("start-replica", Some(r##"Starts the replication in the read replica instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_start-replica", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_start-replica", vec![ (Some(r##"project"##), None, @@ -4510,7 +4820,7 @@ fn main() { ]), ("stop-replica", Some(r##"Stops the replication in the read replica instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_stop-replica", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_stop-replica", vec![ (Some(r##"project"##), None, @@ -4538,7 +4848,7 @@ fn main() { ]), ("truncate-log", Some(r##"Truncate MySQL general and slow query log tables"##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_truncate-log", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_truncate-log", vec![ (Some(r##"project"##), None, @@ -4571,8 +4881,9 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/instances_update", + Some(r##"Updates settings of a Cloud SQL instance. Using this operation might cause + your instance to restart."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/instances_update", vec![ (Some(r##"project"##), None, @@ -4609,7 +4920,7 @@ fn main() { ("operations", "methods: 'get' and 'list'", vec![ ("get", Some(r##"Retrieves an instance operation that has been performed on an instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/operations_get", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/operations_get", vec![ (Some(r##"project"##), None, @@ -4636,8 +4947,96 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/operations_list", + Some(r##"Lists all instance operations that have been performed on the given Cloud + SQL instance in the reverse chronological order of the start time."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/operations_list", + vec![ + (Some(r##"project"##), + None, + Some(r##"Project ID of the project that contains the instance."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("projects", "methods: 'instances-reschedule-maintenance', 'instances-start-external-sync' and 'instances-verify-external-sync-settings'", vec![ + ("instances-reschedule-maintenance", + Some(r##"Reschedules the maintenance on the given instance."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/projects_instances-reschedule-maintenance", + vec![ + (Some(r##"project"##), + None, + Some(r##"ID of the project that contains the instance."##), + Some(true), + Some(false)), + + (Some(r##"instance"##), + None, + Some(r##"Cloud SQL instance ID. This does not include the project ID."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-start-external-sync", + Some(r##"Start External master migration."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/projects_instances-start-external-sync", + vec![ + (Some(r##"project"##), + None, + Some(r##"ID of the project that contains the first generation instance."##), + Some(true), + Some(false)), + + (Some(r##"instance"##), + None, + Some(r##"Cloud SQL instance ID. This does not include the project ID."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("instances-verify-external-sync-settings", + Some(r##"Verify External master external sync settings."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/projects_instances-verify-external-sync-settings", vec![ (Some(r##"project"##), None, @@ -4667,8 +5066,11 @@ fn main() { ("ssl-certs", "methods: 'create-ephemeral', 'delete', 'get', 'insert' and 'list'", vec![ ("create-ephemeral", - Some(r##"Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/ssl-certs_create-ephemeral", + Some(r##"Generates a short-lived X509 certificate containing the provided public key + and signed by a private key specific to the target instance. Users may use + the certificate to authenticate as themselves when connecting to the + database."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/ssl-certs_create-ephemeral", vec![ (Some(r##"project"##), None, @@ -4701,8 +5103,9 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/ssl-certs_delete", + Some(r##"Deletes the SSL certificate. For First Generation instances, the + certificate remains valid until the instance is restarted."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/ssl-certs_delete", vec![ (Some(r##"project"##), None, @@ -4735,8 +5138,10 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/ssl-certs_get", + Some(r##"Retrieves a particular SSL certificate. Does not include the private key + (required for usage). The private key must be saved from the response to + initial creation."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/ssl-certs_get", vec![ (Some(r##"project"##), None, @@ -4769,8 +5174,10 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/ssl-certs_insert", + Some(r##"Creates an SSL certificate and returns it along with the private key and + server certificate authority. The new certificate will not be usable until + the instance is restarted."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/ssl-certs_insert", vec![ (Some(r##"project"##), None, @@ -4804,7 +5211,7 @@ fn main() { ]), ("list", Some(r##"Lists all of the current SSL certificates for the instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/ssl-certs_list", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/ssl-certs_list", vec![ (Some(r##"project"##), None, @@ -4834,8 +5241,10 @@ fn main() { ("tiers", "methods: 'list'", vec![ ("list", - Some(r##"Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/tiers_list", + Some(r##"Lists all available machine types (tiers) for Cloud SQL, for example, + db-n1-standard-1. For related information, see Pricing."##), + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/tiers_list", vec![ (Some(r##"project"##), None, @@ -4860,7 +5269,7 @@ fn main() { ("users", "methods: 'delete', 'insert', 'list' and 'update'", vec![ ("delete", Some(r##"Deletes a user from a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/users_delete", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/users_delete", vec![ (Some(r##"project"##), None, @@ -4874,18 +5283,6 @@ fn main() { Some(true), Some(false)), - (Some(r##"host"##), - None, - Some(r##"Host of the user in the instance."##), - Some(true), - Some(false)), - - (Some(r##"name"##), - None, - Some(r##"Name of the user in the instance."##), - Some(true), - Some(false)), - (Some(r##"v"##), Some(r##"p"##), Some(r##"Set various optional parameters, matching the key=value form"##), @@ -4900,7 +5297,7 @@ fn main() { ]), ("insert", Some(r##"Creates a new user in a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/users_insert", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/users_insert", vec![ (Some(r##"project"##), None, @@ -4934,7 +5331,7 @@ fn main() { ]), ("list", Some(r##"Lists users in the specified Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/users_list", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/users_list", vec![ (Some(r##"project"##), None, @@ -4962,7 +5359,7 @@ fn main() { ]), ("update", Some(r##"Updates an existing user in a Cloud SQL instance."##), - "Details at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli/users_update", + "Details at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli/users_update", vec![ (Some(r##"project"##), None, @@ -4976,12 +5373,6 @@ fn main() { Some(true), Some(false)), - (Some(r##"name"##), - None, - Some(r##"Name of the user in the instance."##), - Some(true), - Some(false)), - (Some(r##"kv"##), Some(r##"r"##), Some(r##"Set various fields of the request structure, matching the key=value form"##), @@ -5004,11 +5395,11 @@ fn main() { ]; - let mut app = App::new("sqladmin1-beta4") + let mut app = App::new("sql1-beta4") .author("Sebastian Thiel ") - .version("1.0.12+20190607") - .about("Creates and manages Cloud SQL instances, which provide fully managed MySQL or PostgreSQL databases.") - .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_sqladmin1_beta4_cli") + .version("1.0.13+20200331") + .about("API for Cloud SQL database instance management") + .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_sql1_beta4_cli") .arg(Arg::with_name("url") .long("scope") .help("Specify the authentication a method should be executed in. Each scope requires the user to grant this application permission to use it.If unset, it defaults to the shortest scope url for a particular method.") diff --git a/gen/sqladmin1_beta4/Cargo.toml b/gen/sqladmin1_beta4/Cargo.toml index 04535eb2ec..4ec633f249 100644 --- a/gen/sqladmin1_beta4/Cargo.toml +++ b/gen/sqladmin1_beta4/Cargo.toml @@ -3,15 +3,15 @@ # DO NOT EDIT ! [package] -name = "google-sqladmin1_beta4" -version = "1.0.12+20190607" +name = "google-sql1_beta4" +version = "1.0.13+20200331" authors = ["Sebastian Thiel "] description = "A complete library to interact with SQL Admin (protocol v1beta4)" -repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4" -homepage = "https://cloud.google.com/sql/docs/reference/latest" -documentation = "https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/sql1_beta4" +homepage = "https://developers.google.com/cloud-sql/" +documentation = "https://docs.rs/google-sql1_beta4/1.0.13+20200331" license = "MIT" -keywords = ["sqladmin", "google", "protocol", "web", "api"] +keywords = ["sql", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/sqladmin1_beta4/README.md b/gen/sqladmin1_beta4/README.md index 7b75a43878..eec21c5504 100644 --- a/gen/sqladmin1_beta4/README.md +++ b/gen/sqladmin1_beta4/README.md @@ -3,32 +3,34 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-sqladmin1_beta4` library allows access to all features of the *Google SQL Admin* service. +The `google-sql1_beta4` library allows access to all features of the *Google SQL Admin* service. -This documentation was generated from *SQL Admin* crate version *1.0.12+20190607*, where *20190607* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *SQL Admin* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *sql:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *SQL Admin* *v1_beta4* API can be found at the -[official documentation site](https://cloud.google.com/sql/docs/reference/latest). +[official documentation site](https://developers.google.com/cloud-sql/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SQLAdmin.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SQLAdmin.html) ... -* [backup runs](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.BackupRun.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.BackupRunDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.BackupRunGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.BackupRunInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.BackupRunListCall.html) -* [databases](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.Database.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.DatabaseDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.DatabaseGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.DatabaseInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.DatabaseListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.DatabasePatchCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.DatabaseUpdateCall.html) -* [flags](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.Flag.html) - * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.FlagListCall.html) +* [backup runs](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.BackupRun.html) + * [*delete*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.BackupRunDeleteCall.html), [*get*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.BackupRunGetCall.html), [*insert*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.BackupRunInsertCall.html) and [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.BackupRunListCall.html) +* [databases](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.Database.html) + * [*delete*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.DatabaseDeleteCall.html), [*get*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.DatabaseGetCall.html), [*insert*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.DatabaseInsertCall.html), [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.DatabaseListCall.html), [*patch*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.DatabasePatchCall.html) and [*update*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.DatabaseUpdateCall.html) +* [flags](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.Flag.html) + * [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.FlagListCall.html) * instances - * [*add server ca*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceAddServerCaCall.html), [*clone*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceCloneCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceDeleteCall.html), [*demote master*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceDemoteMasterCall.html), [*export*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceExportCall.html), [*failover*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceFailoverCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceGetCall.html), [*import*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceImportCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceListCall.html), [*list server cas*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceListServerCaCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstancePatchCall.html), [*promote replica*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstancePromoteReplicaCall.html), [*reset ssl config*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceResetSslConfigCall.html), [*restart*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceRestartCall.html), [*restore backup*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceRestoreBackupCall.html), [*rotate server ca*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceRotateServerCaCall.html), [*start replica*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceStartReplicaCall.html), [*stop replica*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceStopReplicaCall.html), [*truncate log*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceTruncateLogCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.InstanceUpdateCall.html) -* [operations](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.Operation.html) - * [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.OperationListCall.html) -* [ssl certs](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SslCert.html) - * [*create ephemeral*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SslCertCreateEphemeralCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SslCertDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SslCertGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SslCertInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SslCertListCall.html) -* [tiers](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.Tier.html) - * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.TierListCall.html) -* [users](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.User.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.UserDeleteCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.UserInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.UserListCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.UserUpdateCall.html) + * [*add server ca*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceAddServerCaCall.html), [*clone*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceCloneCall.html), [*delete*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceDeleteCall.html), [*demote master*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceDemoteMasterCall.html), [*export*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceExportCall.html), [*failover*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceFailoverCall.html), [*get*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceGetCall.html), [*import*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceImportCall.html), [*insert*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceListCall.html), [*list server cas*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceListServerCaCall.html), [*patch*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstancePatchCall.html), [*promote replica*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstancePromoteReplicaCall.html), [*reset ssl config*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceResetSslConfigCall.html), [*restart*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceRestartCall.html), [*restore backup*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceRestoreBackupCall.html), [*rotate server ca*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceRotateServerCaCall.html), [*start replica*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceStartReplicaCall.html), [*stop replica*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceStopReplicaCall.html), [*truncate log*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceTruncateLogCall.html) and [*update*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.InstanceUpdateCall.html) +* [operations](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.Operation.html) + * [*get*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.OperationListCall.html) +* projects + * [*instances reschedule maintenance*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.ProjectInstanceRescheduleMaintenanceCall.html), [*instances start external sync*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.ProjectInstanceStartExternalSyncCall.html) and [*instances verify external sync settings*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.ProjectInstanceVerifyExternalSyncSettingCall.html) +* [ssl certs](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SslCert.html) + * [*create ephemeral*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SslCertCreateEphemeralCall.html), [*delete*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SslCertDeleteCall.html), [*get*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SslCertGetCall.html), [*insert*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SslCertInsertCall.html) and [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SslCertListCall.html) +* [tiers](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.Tier.html) + * [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.TierListCall.html) +* [users](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.User.html) + * [*delete*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.UserDeleteCall.html), [*insert*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.UserInsertCall.html), [*list*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.UserListCall.html) and [*update*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.UserUpdateCall.html) @@ -37,17 +39,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/struct.SQLAdmin.html)** +* **[Hub](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/struct.SQLAdmin.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -67,7 +69,9 @@ let r = hub.instances().demote_master(...).doit() let r = hub.users().delete(...).doit() let r = hub.databases().delete(...).doit() let r = hub.instances().failover(...).doit() +let r = hub.projects().instances_reschedule_maintenance(...).doit() let r = hub.databases().patch(...).doit() +let r = hub.projects().instances_start_external_sync(...).doit() let r = hub.instances().reset_ssl_config(...).doit() let r = hub.instances().promote_replica(...).doit() let r = hub.databases().update(...).doit() @@ -106,7 +110,7 @@ To use this library, you would put the following lines into your `Cargo.toml` fi ```toml [dependencies] -google-sqladmin1_beta4 = "*" +google-sql1_beta4 = "*" # This project intentionally uses an old version of Hyper. See # https://github.com/Byron/google-apis-rs/issues/173 for more # information. @@ -123,12 +127,12 @@ yup-oauth2 = "^1.0" extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; -extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -use sqladmin1_beta4::User; -use sqladmin1_beta4::{Result, Error}; +extern crate google_sql1_beta4 as sql1_beta4; +use sql1_beta4::User; +use sql1_beta4::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -use sqladmin1_beta4::SQLAdmin; +use sql1_beta4::SQLAdmin; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. @@ -150,7 +154,8 @@ let mut req = User::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.users().update(req, "project", "instance", "name") +let result = hub.users().update(req, "project", "instance") + .name("Stet") .host("sed") .doit(); @@ -174,17 +179,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -194,29 +199,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-sqladmin1_beta4/1.0.12+20190607/google_sqladmin1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-sql1_beta4/1.0.13+20200331/google_sql1_beta4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. @@ -225,7 +230,7 @@ Arguments will always be copied or cloned into the builder, to make them indepen [google-go-api]: https://github.com/google/google-api-go-client # License -The **sqladmin1_beta4** library was generated by Sebastian Thiel, and is placed +The **sql1_beta4** library was generated by Sebastian Thiel, and is placed under the *MIT* license. You can read the full text at the repository's [license file][repo-license]. diff --git a/gen/sqladmin1_beta4/src/lib.rs b/gen/sqladmin1_beta4/src/lib.rs index f3530a7709..63eec75c7c 100644 --- a/gen/sqladmin1_beta4/src/lib.rs +++ b/gen/sqladmin1_beta4/src/lib.rs @@ -2,11 +2,11 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *SQL Admin* crate version *1.0.12+20190607*, where *20190607* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *SQL Admin* crate version *1.0.13+20200331*, where *20200331* is the exact revision of the *sql:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *SQL Admin* *v1_beta4* API can be found at the -//! [official documentation site](https://cloud.google.com/sql/docs/reference/latest). -//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sqladmin1_beta4). +//! [official documentation site](https://developers.google.com/cloud-sql/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/sql1_beta4). //! # Features //! //! Handle the following *Resources* with ease from the central [hub](struct.SQLAdmin.html) ... @@ -21,6 +21,8 @@ //! * [*add server ca*](struct.InstanceAddServerCaCall.html), [*clone*](struct.InstanceCloneCall.html), [*delete*](struct.InstanceDeleteCall.html), [*demote master*](struct.InstanceDemoteMasterCall.html), [*export*](struct.InstanceExportCall.html), [*failover*](struct.InstanceFailoverCall.html), [*get*](struct.InstanceGetCall.html), [*import*](struct.InstanceImportCall.html), [*insert*](struct.InstanceInsertCall.html), [*list*](struct.InstanceListCall.html), [*list server cas*](struct.InstanceListServerCaCall.html), [*patch*](struct.InstancePatchCall.html), [*promote replica*](struct.InstancePromoteReplicaCall.html), [*reset ssl config*](struct.InstanceResetSslConfigCall.html), [*restart*](struct.InstanceRestartCall.html), [*restore backup*](struct.InstanceRestoreBackupCall.html), [*rotate server ca*](struct.InstanceRotateServerCaCall.html), [*start replica*](struct.InstanceStartReplicaCall.html), [*stop replica*](struct.InstanceStopReplicaCall.html), [*truncate log*](struct.InstanceTruncateLogCall.html) and [*update*](struct.InstanceUpdateCall.html) //! * [operations](struct.Operation.html) //! * [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) +//! * projects +//! * [*instances reschedule maintenance*](struct.ProjectInstanceRescheduleMaintenanceCall.html), [*instances start external sync*](struct.ProjectInstanceStartExternalSyncCall.html) and [*instances verify external sync settings*](struct.ProjectInstanceVerifyExternalSyncSettingCall.html) //! * [ssl certs](struct.SslCert.html) //! * [*create ephemeral*](struct.SslCertCreateEphemeralCall.html), [*delete*](struct.SslCertDeleteCall.html), [*get*](struct.SslCertGetCall.html), [*insert*](struct.SslCertInsertCall.html) and [*list*](struct.SslCertListCall.html) //! * [tiers](struct.Tier.html) @@ -67,7 +69,9 @@ //! let r = hub.users().delete(...).doit() //! let r = hub.databases().delete(...).doit() //! let r = hub.instances().failover(...).doit() +//! let r = hub.projects().instances_reschedule_maintenance(...).doit() //! let r = hub.databases().patch(...).doit() +//! let r = hub.projects().instances_start_external_sync(...).doit() //! let r = hub.instances().reset_ssl_config(...).doit() //! let r = hub.instances().promote_replica(...).doit() //! let r = hub.databases().update(...).doit() @@ -106,7 +110,7 @@ //! //! ```toml //! [dependencies] -//! google-sqladmin1_beta4 = "*" +//! google-sql1_beta4 = "*" //! # This project intentionally uses an old version of Hyper. See //! # https://github.com/Byron/google-apis-rs/issues/173 for more //! # information. @@ -123,13 +127,13 @@ //! extern crate hyper; //! extern crate hyper_rustls; //! extern crate yup_oauth2 as oauth2; -//! extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -//! use sqladmin1_beta4::User; -//! use sqladmin1_beta4::{Result, Error}; +//! extern crate google_sql1_beta4 as sql1_beta4; +//! use sql1_beta4::User; +//! use sql1_beta4::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -//! use sqladmin1_beta4::SQLAdmin; +//! use sql1_beta4::SQLAdmin; //! //! // Get an ApplicationSecret instance by some means. It contains the `client_id` and //! // `client_secret`, among other things. @@ -151,7 +155,8 @@ //! // 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.users().update(req, "project", "instance", "name") +//! let result = hub.users().update(req, "project", "instance") +//! .name("kasd") //! .host("accusam") //! .doit(); //! @@ -274,7 +279,7 @@ pub use cmn::*; #[derive(PartialEq, Eq, Hash)] pub enum Scope { /// Manage your Google SQL Service instances - SqlserviceAdmin, + ServiceAdmin, /// View and manage your data across Google Cloud Platform services CloudPlatform, @@ -283,7 +288,7 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::SqlserviceAdmin => "https://www.googleapis.com/auth/sqlservice.admin", + Scope::ServiceAdmin => "https://www.googleapis.com/auth/sqlservice.admin", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", } } @@ -311,13 +316,13 @@ impl Default for Scope { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::User; -/// use sqladmin1_beta4::{Result, Error}; +/// extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::User; +/// use sql1_beta4::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// // Get an ApplicationSecret instance by some means. It contains the `client_id` and /// // `client_secret`, among other things. @@ -339,7 +344,8 @@ impl Default for Scope { /// // 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.users().update(req, "project", "instance", "name") +/// let result = hub.users().update(req, "project", "instance") +/// .name("amet.") /// .host("erat") /// .doit(); /// @@ -378,9 +384,9 @@ impl<'a, C, A> SQLAdmin SQLAdmin { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), - _base_url: "https://www.googleapis.com/sql/v1beta4/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), + _base_url: "https://sqladmin.googleapis.com/".to_string(), + _root_url: "https://sqladmin.googleapis.com/".to_string(), } } @@ -399,6 +405,9 @@ impl<'a, C, A> SQLAdmin pub fn operations(&'a self) -> OperationMethods<'a, C, A> { OperationMethods { hub: &self } } + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { hub: &self } + } pub fn ssl_certs(&'a self) -> SslCertMethods<'a, C, A> { SslCertMethods { hub: &self } } @@ -410,7 +419,7 @@ impl<'a, C, A> SQLAdmin } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -418,7 +427,7 @@ impl<'a, C, A> SQLAdmin } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/sql/v1beta4/`. + /// It defaults to `https://sqladmin.googleapis.com/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -426,7 +435,7 @@ impl<'a, C, A> SQLAdmin } /// Set the root url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/`. + /// It defaults to `https://sqladmin.googleapis.com/`. /// /// Returns the previously set root url. pub fn root_url(&mut self, new_root_url: String) -> String { @@ -438,15 +447,15 @@ impl<'a, C, A> SQLAdmin // ############ // SCHEMAS ### // ########## -/// Disk encryption configuration. +/// Disk encryption configuration for an instance. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DiskEncryptionConfiguration { - /// This is always sql#diskEncryptionConfiguration. + /// This is always sql#diskEncryptionConfiguration. pub kind: Option, - /// KMS key resource name + /// Resource name of KMS key for disk encryption #[serde(rename="kmsKeyName")] pub kms_key_name: Option, } @@ -470,33 +479,51 @@ impl Part for DiskEncryptionConfiguration {} pub struct BackupRun { /// The status of this run. pub status: Option, - /// This is always sql#backupRun. + /// Encryption configuration specific to a backup. + /// Applies only to Second Generation instances. + #[serde(rename="diskEncryptionConfiguration")] + pub disk_encryption_configuration: Option, + /// This is always sql#backupRun. pub kind: Option, /// The description of this run, only applicable to on-demand backups. pub description: Option, - /// The start time of the backup window during which this the backup was attempted in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + /// The start time of the backup window during which this the backup was + /// attempted in RFC 3339 + /// format, for example 2012-11-15T16:19:00.094Z. #[serde(rename="windowStartTime")] pub window_start_time: Option, - /// The identifier for this backup run. Unique only for a specific Cloud SQL instance. - pub id: Option, + /// Encryption status specific to a backup. + /// Applies only to Second Generation instances. + #[serde(rename="diskEncryptionStatus")] + pub disk_encryption_status: Option, + /// The time the run was enqueued in UTC timezone in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. + #[serde(rename="enqueuedTime")] + pub enqueued_time: Option, /// Name of the database instance. pub instance: Option, - /// The location of the backup. + /// Location of the backups. pub location: Option, - /// The time the backup operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + /// The time the backup operation actually started in UTC timezone in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. #[serde(rename="startTime")] pub start_time: Option, - /// Information about why the backup operation failed. This is only present if the run has the FAILED status. + /// Information about why the backup operation failed. This is only present if + /// the run has the FAILED status. pub error: Option, - /// The time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + /// The time the backup operation completed in UTC timezone in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. #[serde(rename="endTime")] pub end_time: Option, /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND". #[serde(rename="type")] pub type_: Option, - /// The time the run was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. - #[serde(rename="enqueuedTime")] - pub enqueued_time: Option, + /// The identifier for this backup run. Unique only for a specific Cloud SQL + /// instance. + pub id: Option, /// The URI of this resource. #[serde(rename="selfLink")] pub self_link: Option, @@ -507,6 +534,26 @@ impl Resource for BackupRun {} impl ResponseResult for BackupRun {} +/// Any scheduled maintenancce for this instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SqlScheduledMaintenance { + /// no description provided + #[serde(rename="canDefer")] + pub can_defer: Option, + /// The start time of any upcoming scheduled maintenance for this instance. + #[serde(rename="startTime")] + pub start_time: Option, + /// If the scheduled maintenance can be rescheduled. + #[serde(rename="canReschedule")] + pub can_reschedule: Option, +} + +impl Part for SqlScheduledMaintenance {} + + /// SslCertDetail. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -516,7 +563,8 @@ pub struct SslCertDetail { /// The public information about the cert. #[serde(rename="certInfo")] pub cert_info: Option, - /// The private key for the client cert, in pem format. Keep private in order to protect your security. + /// The private key for the client cert, in pem format. Keep private in order + /// to protect your security. #[serde(rename="certPrivateKey")] pub cert_private_key: Option, } @@ -530,7 +578,7 @@ impl Part for SslCertDetail {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OperationErrors { - /// This is always sql#operationErrors. + /// This is always sql#operationErrors. pub kind: Option, /// The list of errors encountered while processing this operation. pub errors: Option>, @@ -540,6 +588,7 @@ impl Part for OperationErrors {} /// Database instance restore from backup context. +/// Backup context contains source instance id and project id. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -550,7 +599,7 @@ pub struct RestoreBackupContext { pub instance_id: Option, /// The full project ID of the source instance. pub project: Option, - /// This is always sql#restoreBackupContext. + /// This is always sql#restoreBackupContext. pub kind: Option, /// The ID of the backup run to restore from. #[serde(rename="backupRunId")] @@ -560,38 +609,34 @@ pub struct RestoreBackupContext { impl Part for RestoreBackupContext {} -/// Database instance demote master context. +/// Reschedule options for maintenance windows. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [instances reschedule maintenance projects](struct.ProjectInstanceRescheduleMaintenanceCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DemoteMasterContext { - /// This is always sql#demoteMasterContext. - pub kind: Option, - /// The name of the instance which will act as on-premises master in the replication setup. - #[serde(rename="masterInstanceName")] - pub master_instance_name: Option, - /// Verify GTID consistency for demote operation. Default value: True. Second Generation instances only. Setting this flag to false enables you to bypass GTID consistency check between on-premises master and Cloud SQL instance during the demotion operation but also exposes you to the risk of future replication failures. Change the value only if you know the reason for the GTID divergence and are confident that doing so will not cause any replication issues. - #[serde(rename="verifyGtidConsistency")] - pub verify_gtid_consistency: Option, - /// Configuration specific to read-replicas replicating from the on-premises master. - #[serde(rename="replicaConfiguration")] - pub replica_configuration: Option, +pub struct SqlInstancesRescheduleMaintenanceRequestBody { + /// Required. The type of the reschedule the user wants. + pub reschedule: Option, } -impl Part for DemoteMasterContext {} +impl RequestValue for SqlInstancesRescheduleMaintenanceRequestBody {} -/// Disk encryption status. +/// Disk encryption status for an instance. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DiskEncryptionStatus { - /// KMS key version used to encrypt the Cloud SQL instance disk + /// KMS key version used to encrypt the Cloud SQL instance resource #[serde(rename="kmsKeyVersionName")] pub kms_key_version_name: Option, - /// This is always sql#diskEncryptionStatus. + /// This is always sql#diskEncryptionStatus. pub kind: Option, } @@ -604,19 +649,24 @@ impl Part for DiskEncryptionStatus {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BackupConfiguration { - /// This is always sql#backupConfiguration. + /// This is always sql#backupConfiguration. pub kind: Option, - /// The location of the backup. + /// Location of the backup pub location: Option, - /// Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM. + /// Start time for the daily backup configuration in UTC timezone in the 24 + /// hour format - HH:MM. #[serde(rename="startTime")] pub start_time: Option, + /// Reserved for future use. + #[serde(rename="pointInTimeRecoveryEnabled")] + pub point_in_time_recovery_enabled: Option, /// Whether this configuration is enabled. pub enabled: Option, /// Reserved for future use. #[serde(rename="replicationLogArchivingEnabled")] pub replication_log_archiving_enabled: Option, - /// Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well. + /// (MySQL only) Whether binary log is enabled. If backup configuration is + /// disabled, binarylog must be disabled as well. #[serde(rename="binaryLogEnabled")] pub binary_log_enabled: Option, } @@ -630,9 +680,10 @@ impl Part for BackupConfiguration {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RotateServerCaContext { - /// This is always sql#rotateServerCaContext. + /// This is always sql#rotateServerCaContext. pub kind: Option, - /// The fingerprint of the next version to be rotated to. If left unspecified, will be rotated to the most recently added server CA version. + /// The fingerprint of the next version to be rotated to. If left unspecified, + /// will be rotated to the most recently added server CA version. #[serde(rename="nextVersion")] pub next_version: Option, } @@ -640,6 +691,36 @@ pub struct RotateServerCaContext { impl Part for RotateServerCaContext {} +/// Database instance demote master context. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DemoteMasterContext { + /// This is always sql#demoteMasterContext. + pub kind: Option, + /// The name of the instance which will act as on-premises master in the + /// replication setup. + #[serde(rename="masterInstanceName")] + pub master_instance_name: Option, + /// Verify GTID consistency for demote operation. Default value: + /// True. Second Generation instances only. Setting this flag to + /// false enables you to bypass GTID consistency check between on-premises + /// master and Cloud SQL instance during the demotion operation but also + /// exposes you to the risk of future replication failures. Change the value + /// only if you know the reason for the GTID divergence and are confident that + /// doing so will not cause any replication issues. + #[serde(rename="verifyGtidConsistency")] + pub verify_gtid_consistency: Option, + /// Configuration specific to read-replicas replicating from the on-premises + /// master. + #[serde(rename="replicaConfiguration")] + pub replica_configuration: Option, +} + +impl Part for DemoteMasterContext {} + + /// Database instance clone request. /// /// # Activities @@ -665,13 +746,22 @@ impl RequestValue for InstancesCloneRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReplicaConfiguration { - /// This is always sql#replicaConfiguration. + /// This is always sql#replicaConfiguration. pub kind: Option, - /// Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance. - /// Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance. + /// Specifies if the replica is the failover target. If the field is set to + /// true the replica will be designated as a failover replica. In + /// case the master instance fails, the replica instance will be promoted as + /// the new master instance.

          Only one replica can be specified as failover + /// target, and the replica has to be in different zone with the master + /// instance. #[serde(rename="failoverTarget")] pub failover_target: Option, - /// MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. + /// MySQL specific configuration when replicating from a MySQL on-premises + /// master. Replication configuration information such as the username, + /// password, certificates, and keys are not stored in the instance metadata. + /// The configuration information is used only to set up the replication + /// connection and is stored by MySQL in a file named master.info + /// in the data directory. #[serde(rename="mysqlReplicaConfiguration")] pub mysql_replica_configuration: Option, } @@ -690,14 +780,18 @@ impl Part for ReplicaConfiguration {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SslCertsInsertResponse { - /// This is always sql#sslCertsInsert. + /// This is always sql#sslCertsInsert. pub kind: Option, - /// The new client certificate and private key. For First Generation instances, the new certificate does not take effect until the instance is restarted. + /// The new client certificate and private key. For First Generation + /// instances, the new certificate does not take effect until the instance is + /// restarted. #[serde(rename="clientCert")] pub client_cert: Option, /// The operation to track the ssl certs insert request. pub operation: Option, - /// The server Certificate Authority's certificate. If this is missing you can force a new one to be generated by calling resetSslConfig method on instances resource. + /// The server Certificate Authority's certificate. If this is missing you can + /// force a new one to be generated by calling resetSslConfig method on + /// instances resource. #[serde(rename="serverCaCert")] pub server_ca_cert: Option, } @@ -716,12 +810,13 @@ impl ResponseResult for SslCertsInsertResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OperationsListResponse { - /// The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + /// The continuation token, used to page through large result sets. Provide + /// this value in a subsequent request to return the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// List of operation resources. pub items: Option>, - /// This is always sql#operationsList. + /// This is always sql#operationsList. pub kind: Option, } @@ -741,7 +836,7 @@ impl ResponseResult for OperationsListResponse {} pub struct TiersListResponse { /// List of tiers. pub items: Option>, - /// This is always sql#tiersList. + /// This is always sql#tiersList. pub kind: Option, } @@ -769,22 +864,32 @@ impl Part for ExportContextCsvExportOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ImportContext { - /// This is always sql#importContext. + /// Import parameters specific to SQL Server .BAK files + #[serde(rename="bakImportOptions")] + pub bak_import_options: Option, + /// This is always sql#importContext. pub kind: Option, /// The PostgreSQL user for this import operation. PostgreSQL instances only. #[serde(rename="importUser")] pub import_user: Option, - /// The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. + /// The target database for the import. If fileType is + /// SQL, this field is required only if the import file does not + /// specify a database, and is overridden by any database specification in the + /// import file. If fileType is CSV, one database + /// must be specified. pub database: Option, - /// The file type for the specified uri. - /// SQL: The file contains SQL statements. - /// CSV: The file contains CSV data. + /// The file type for the specified uri.
          SQL: The file + /// contains SQL statements.
          CSV: The file contains CSV data. #[serde(rename="fileType")] pub file_type: Option, /// Options for importing data as CSV. #[serde(rename="csvImportOptions")] pub csv_import_options: Option, - /// Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. + /// Path to the import file in Cloud Storage, in the form + /// gs: + /// //bucketName/fileName. Compressed gzip files (.gz) are supported + /// // when fileType is SQL. The instance must have + /// // write permissions to the bucket and read access to the file. pub uri: Option, } @@ -797,13 +902,20 @@ impl Part for ImportContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct IpMapping { - /// The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired. + /// The due time for this IP to be retired in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. This field is only available when + /// the IP is scheduled to be retired. #[serde(rename="timeToRetire")] pub time_to_retire: Option, /// The IP address assigned. #[serde(rename="ipAddress")] pub ip_address: Option, - /// The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported. + /// The type of this IP address. A PRIMARY address is a public + /// address that can accept incoming connections. A PRIVATE + /// address is a private address that can accept incoming connections. An + /// OUTGOING address is the source address of connections + /// originating from the instance, if supported. #[serde(rename="type")] pub type_: Option, } @@ -820,21 +932,32 @@ pub struct ExportContext { /// Options for exporting data as CSV. #[serde(rename="csvExportOptions")] pub csv_export_options: Option, - /// This is always sql#exportContext. + /// This is always sql#exportContext. pub kind: Option, - /// Databases to be exported. - /// MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. - /// PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. + /// Databases to be exported.
          MySQL instances: If + /// fileType is SQL and no database is specified, all + /// databases are exported, except for the mysql system database. + /// If fileType is CSV, you can specify one database, + /// either by using this property or by using the + /// csvExportOptions.selectQuery property, which takes precedence + /// over this property.
          PostgreSQL instances: You must specify + /// one database to be exported. If fileType is CSV, + /// this database must match the one specified in the + /// csvExportOptions.selectQuery property. pub databases: Option>, - /// The file type for the specified uri. - /// SQL: The file contains SQL statements. - /// CSV: The file contains CSV data. + /// The file type for the specified uri.
          SQL: The file + /// contains SQL statements.
          CSV: The file contains CSV data. #[serde(rename="fileType")] pub file_type: Option, /// Options for exporting data as SQL statements. #[serde(rename="sqlExportOptions")] pub sql_export_options: Option, - /// The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. + /// The path to the file in Google Cloud Storage where the export will be + /// stored. The URI is in the form gs: + /// //bucketName/fileName. If the file already exists, the requests + /// // succeeds, but the operation fails. If fileType is + /// // SQL and the filename ends with .gz, the contents are + /// // compressed. pub uri: Option, } @@ -852,56 +975,37 @@ impl Part for ExportContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BackupRunsListResponse { - /// The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + /// The continuation token, used to page through large result sets. Provide + /// this value in a subsequent request to return the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of backup runs in reverse chronological order of the enqueued time. pub items: Option>, - /// This is always sql#backupRunsList. + /// This is always sql#backupRunsList. pub kind: Option, } impl ResponseResult for BackupRunsListResponse {} -/// Represents a SQL database on the Cloud SQL instance. +/// Instance verify external sync settings response. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [get databases](struct.DatabaseGetCall.html) (response) -/// * [list databases](struct.DatabaseListCall.html) (none) -/// * [patch databases](struct.DatabasePatchCall.html) (request) -/// * [insert databases](struct.DatabaseInsertCall.html) (request) -/// * [delete databases](struct.DatabaseDeleteCall.html) (none) -/// * [update databases](struct.DatabaseUpdateCall.html) (request) +/// * [instances verify external sync settings projects](struct.ProjectInstanceVerifyExternalSyncSettingCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Database { - /// This is always sql#database. +pub struct SqlInstancesVerifyExternalSyncSettingsResponse { + /// This is always sql#migrationSettingErrorList. pub kind: Option, - /// The name of the database in the Cloud SQL instance. This does not include the project ID or instance name. - pub name: Option, - /// The MySQL charset value. - pub charset: Option, - /// The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. - pub project: Option, - /// The name of the Cloud SQL instance. This does not include the project ID. - pub instance: Option, - /// This field is deprecated and will be removed from a future version of the API. - pub etag: Option, - /// The MySQL collation value. - pub collation: Option, - /// The URI of this resource. - #[serde(rename="selfLink")] - pub self_link: Option, + /// List of migration violations. + pub errors: Option>, } -impl RequestValue for Database {} -impl Resource for Database {} -impl ResponseResult for Database {} +impl ResponseResult for SqlInstancesVerifyExternalSyncSettingsResponse {} /// Options for importing data as CSV. @@ -912,7 +1016,8 @@ impl ResponseResult for Database {} pub struct ImportContextCsvImportOptions { /// The table to which CSV data is imported. pub table: Option, - /// The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. + /// The columns to which CSV data is imported. If not specified, all columns + /// of the database table are loaded with CSV data. pub columns: Option>, } @@ -932,10 +1037,17 @@ pub struct IpConfiguration { /// Whether the instance should be assigned an IP address or not. #[serde(rename="ipv4Enabled")] pub ipv4_enabled: Option, - /// The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24). + /// The list of external networks that are allowed to connect to the instance + /// using the IP. In CIDR + /// notation, also known as 'slash' notation (e.g. + /// 192.168.100.0/24). #[serde(rename="authorizedNetworks")] pub authorized_networks: Option>, - /// The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set. + /// The resource link for the VPC network from which the Cloud SQL instance is + /// accessible for private IP. For example, + /// /projects/myProject/global/networks/default. This setting can + /// be updated, but it cannot be removed after it is set. #[serde(rename="privateNetwork")] pub private_network: Option, } @@ -943,21 +1055,22 @@ pub struct IpConfiguration { impl Part for IpConfiguration {} -/// Database instance operation error. +/// External master migration setting error. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct OperationError { - /// This is always sql#operationError. +pub struct SqlExternalSyncSettingError { + /// This is always sql#migrationSettingError. pub kind: Option, /// Identifies the specific error that occurred. - pub code: Option, + #[serde(rename="type")] + pub type_: Option, /// Additional information about the error encountered. - pub message: Option, + pub detail: Option, } -impl Part for OperationError {} +impl Part for SqlExternalSyncSettingError {} /// A flag resource. @@ -971,31 +1084,43 @@ impl Part for OperationError {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Flag { - /// True if the flag is only released in Beta. + /// Whether or not the flag is considered in beta. #[serde(rename="inBeta")] pub in_beta: Option, - /// This is always sql#flag. + /// This is always sql#flag. pub kind: Option, - /// This is the name of the flag. Flag names always use underscores, not hyphens, e.g. max_allowed_packet + /// This is the name of the flag. Flag names always use underscores, not + /// hyphens, e.g. max_allowed_packet pub name: Option, - /// For STRING flags, a list of strings that the value can be set to. + /// For STRING flags, a list of strings that the value can be set + /// to. #[serde(rename="allowedStringValues")] pub allowed_string_values: Option>, - /// The database version this flag applies to. Can be MYSQL_5_5, MYSQL_5_6, or MYSQL_5_7. MYSQL_5_7 is applicable only to Second Generation instances. + /// The database version this flag applies to. Can be MYSQL_5_5, + /// MYSQL_5_6, or MYSQL_5_7. MYSQL_5_7 + /// is applicable only to Second Generation instances. #[serde(rename="appliesTo")] pub applies_to: Option>, - /// Indicates whether changing this flag will trigger a database restart. Only applicable to Second Generation instances. + /// Indicates whether changing this flag will trigger a database restart. Only + /// applicable to Second Generation instances. #[serde(rename="requiresRestart")] pub requires_restart: Option, - /// For INTEGER flags, the maximum allowed value. + /// For INTEGER flags, the maximum allowed value. #[serde(rename="maxValue")] pub max_value: Option, - /// For INTEGER flags, the minimum allowed value. + /// For INTEGER flags, the minimum allowed value. #[serde(rename="minValue")] pub min_value: Option, - /// The type of the flag. Flags are typed to being BOOLEAN, STRING, INTEGER or NONE. NONE is used for flags which do not take a value, such as skip_grant_tables. + /// The type of the flag. Flags are typed to being BOOLEAN, + /// STRING, INTEGER or NONE. + /// NONE is used for flags which do not take a value, such as + /// skip_grant_tables. #[serde(rename="type")] pub type_: Option, + /// Use this field if only certain integers are accepted. Can be combined + /// with min_value and max_value to add additional values. + #[serde(rename="allowedIntValues")] + pub allowed_int_values: Option>, } impl Resource for Flag {} @@ -1007,10 +1132,11 @@ impl Resource for Flag {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TruncateLogContext { - /// The type of log to truncate. Valid values are MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE. + /// The type of log to truncate. Valid values are + /// MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE. #[serde(rename="logType")] pub log_type: Option, - /// This is always sql#truncateLogContext. + /// This is always sql#truncateLogContext. pub kind: Option, } @@ -1031,20 +1157,32 @@ impl Part for TruncateLogContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct User { - /// The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update since it is already specified on the URL. - pub project: Option, - /// The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update since it is already specified on the URL. - pub instance: Option, - /// This is always sql#user. + /// This is always sql#user. pub kind: Option, - /// This field is deprecated and will be removed from a future version of the API. - pub etag: Option, - /// The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified in the URL. + /// The name of the user in the Cloud SQL instance. Can be omitted for + /// update since it is already specified in the URL. pub name: Option, + /// The project ID of the project containing the Cloud SQL database. The Google + /// apps domain is prefixed if applicable. Can be omitted for + /// update since it is already specified on the URL. + pub project: Option, + /// The name of the Cloud SQL instance. This does not include the project ID. + /// Can be omitted for update since it is already specified on the + /// URL. + pub instance: Option, + /// The host name from which the user can connect. For insert + /// operations, host defaults to an empty string. For update + /// operations, host is specified as part of the request URL. The host name + /// cannot be updated after insertion. + pub host: Option, + /// This field is deprecated and will be removed from a future version of the + /// API. + pub etag: Option, + /// no description provided + #[serde(rename="sqlserverUserDetails")] + pub sqlserver_user_details: Option, /// The password for the user. pub password: Option, - /// The host name from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion. - pub host: Option, } impl RequestValue for User {} @@ -1065,9 +1203,10 @@ pub struct Tier { /// The maximum disk size of this tier in bytes. #[serde(rename="DiskQuota")] pub disk_quota: Option, - /// An identifier for the machine type, for example, db-n1-standard-1. For related information, see Pricing. + /// An identifier for the machine type, for example, db-n1-standard-1. For + /// related information, see Pricing. pub tier: Option, - /// This is always sql#tier. + /// This is always sql#tier. pub kind: Option, /// The maximum RAM usage of this tier in bytes. #[serde(rename="RAM")] @@ -1085,12 +1224,17 @@ impl Resource for Tier {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CloneContext { - /// Binary log coordinates, if specified, identify the position up to which the source instance should be cloned. If not specified, the source instance is cloned up to the most recent binary log coordinates. + /// Binary log coordinates, if specified, identify the position up to which the + /// source instance should be cloned. If not specified, the source instance is + /// cloned up to the most recent binary log coordinates. #[serde(rename="binLogCoordinates")] pub bin_log_coordinates: Option, - /// This is always sql#cloneContext. + /// This is always sql#cloneContext. pub kind: Option, /// Reserved for future use. + #[serde(rename="pointInTime")] + pub point_in_time: Option, + /// Reserved for future use. #[serde(rename="pitrTimestampMs")] pub pitr_timestamp_ms: Option, /// Name of the Cloud SQL instance to be created as a clone. @@ -1120,6 +1264,23 @@ pub struct InstancesRestoreBackupRequest { impl RequestValue for InstancesRestoreBackupRequest {} +/// Represents a Sql Server database on the Cloud SQL instance. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SqlServerDatabaseDetails { + /// The version of SQL Server with which the database is to be made compatible + #[serde(rename="compatibilityLevel")] + pub compatibility_level: Option, + /// The recovery model of a SQL Server database + #[serde(rename="recoveryModel")] + pub recovery_model: Option, +} + +impl Part for SqlServerDatabaseDetails {} + + /// Rotate Server CA request. /// /// # Activities @@ -1150,7 +1311,7 @@ impl RequestValue for InstancesRotateServerCaRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InstancesListServerCasResponse { - /// This is always sql#instancesListServerCas. + /// This is always sql#instancesListServerCas. pub kind: Option, /// List of server CA certificates for the instance. pub certs: Option>, @@ -1175,7 +1336,7 @@ impl ResponseResult for InstancesListServerCasResponse {} pub struct FlagsListResponse { /// List of flags. pub items: Option>, - /// This is always sql#flagsList. + /// This is always sql#flagsList. pub kind: Option, } @@ -1190,7 +1351,7 @@ impl ResponseResult for FlagsListResponse {} pub struct MySqlReplicaConfiguration { /// The username for the replication connection. pub username: Option, - /// This is always sql#mysqlReplicaConfiguration. + /// This is always sql#mysqlReplicaConfiguration. pub kind: Option, /// The password for the replication connection. pub password: Option, @@ -1206,16 +1367,23 @@ pub struct MySqlReplicaConfiguration { /// Interval in milliseconds between replication heartbeats. #[serde(rename="masterHeartbeatPeriod")] pub master_heartbeat_period: Option, - /// Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake. + /// Whether or not to check the master's Common Name value in the certificate + /// that it sends during the SSL handshake. #[serde(rename="verifyServerCertificate")] pub verify_server_certificate: Option, - /// Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump. + /// Path to a SQL dump file in Google Cloud Storage from which the slave + /// instance is to be created. The URI is in the form gs: + /// //bucketName/fileName. Compressed gzip files (.gz) are also supported. + /// // Dumps should have the binlog co-ordinates from which replication should + /// // begin. This can be accomplished by setting --master-data to 1 when using + /// // mysqldump. #[serde(rename="dumpFilePath")] pub dump_file_path: Option, /// Seconds to wait between connect retries. MySQL's default is 60 seconds. #[serde(rename="connectRetryInterval")] pub connect_retry_interval: Option, - /// PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. + /// PEM representation of the slave's private key. The corresponsing public key + /// is encoded in the client's certificate. #[serde(rename="clientKey")] pub client_key: Option, } @@ -1229,7 +1397,12 @@ impl Part for MySqlReplicaConfiguration {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ExportContextSqlExportOptionsMysqlExportOptions { - /// Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. + /// Option to include SQL statement required to set up replication. + /// If set to 1, the dump file includes + /// a CHANGE MASTER TO statement with the binary log coordinates. + /// If set to 2, the CHANGE MASTER TO statement is written as + /// a SQL comment, and has no effect. + /// All other values are ignored. #[serde(rename="masterData")] pub master_data: Option, } @@ -1238,79 +1411,65 @@ impl NestedType for ExportContextSqlExportOptionsMysqlExportOptions {} impl Part for ExportContextSqlExportOptionsMysqlExportOptions {} -/// Database instance settings. +/// Represents a SQL database on the Cloud SQL instance. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get databases](struct.DatabaseGetCall.html) (response) +/// * [list databases](struct.DatabaseListCall.html) (none) +/// * [patch databases](struct.DatabasePatchCall.html) (request) +/// * [insert databases](struct.DatabaseInsertCall.html) (request) +/// * [delete databases](struct.DatabaseDeleteCall.html) (none) +/// * [update databases](struct.DatabaseUpdateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Database { + /// no description provided + #[serde(rename="sqlserverDatabaseDetails")] + pub sqlserver_database_details: Option, + /// This is always sql#database. + pub kind: Option, + /// The name of the database in the Cloud SQL instance. This does not include + /// the project ID or instance name. + pub name: Option, + /// The MySQL charset value. + pub charset: Option, + /// The project ID of the project containing the Cloud SQL database. The Google + /// apps domain is prefixed if applicable. + pub project: Option, + /// The name of the Cloud SQL instance. This does not include the project ID. + pub instance: Option, + /// This field is deprecated and will be removed from a future version of the + /// API. + pub etag: Option, + /// The MySQL collation value. + pub collation: Option, + /// The URI of this resource. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Database {} +impl Resource for Database {} +impl ResponseResult for Database {} + + +/// Import parameters specific to SQL Server .BAK files /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Settings { - /// Availability type (PostgreSQL instances only). Potential values: - /// ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility. - /// REGIONAL: The instance can serve data from more than one zone in a region (it is highly available). - /// For more information, see Overview of the High Availability Configuration. - #[serde(rename="availabilityType")] - pub availability_type: Option, - /// The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: - /// ALWAYS: The instance is on, and remains so even in the absence of connection requests. - /// NEVER: The instance is off; it is not activated, even if a connection request arrives. - /// ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity. - #[serde(rename="activationPolicy")] - pub activation_policy: Option, - /// The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. - #[serde(rename="ipConfiguration")] - pub ip_configuration: Option, - /// User-provided labels, represented as a dictionary where each label is a single key value pair. - #[serde(rename="userLabels")] - pub user_labels: Option>, - /// Configuration specific to read replica instances. Indicates whether replication is enabled or not. - #[serde(rename="databaseReplicationEnabled")] - pub database_replication_enabled: Option, - /// The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances. - #[serde(rename="replicationType")] - pub replication_type: Option, - /// The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings. - pub tier: Option, - /// The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. - #[serde(rename="settingsVersion")] - pub settings_version: Option, - /// Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances. - #[serde(rename="storageAutoResize")] - pub storage_auto_resize: Option, - /// The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances. - #[serde(rename="locationPreference")] - pub location_preference: Option, - /// The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances. - #[serde(rename="dataDiskSizeGb")] - pub data_disk_size_gb: Option, - /// The database flags passed to the instance at startup. - #[serde(rename="databaseFlags")] - pub database_flags: Option>, - /// This is always sql#settings. - pub kind: Option, - /// The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances. - #[serde(rename="dataDiskType")] - pub data_disk_type: Option, - /// The App Engine app IDs that can access this instance. First Generation instances only. - #[serde(rename="authorizedGaeApplications")] - pub authorized_gae_applications: Option>, - /// The daily backup configuration for the instance. - #[serde(rename="backupConfiguration")] - pub backup_configuration: Option, - /// The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances. - #[serde(rename="storageAutoResizeLimit")] - pub storage_auto_resize_limit: Option, - /// Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances. - #[serde(rename="crashSafeReplicationEnabled")] - pub crash_safe_replication_enabled: Option, - /// The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances. - #[serde(rename="pricingPlan")] - pub pricing_plan: Option, - /// The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances. - #[serde(rename="maintenanceWindow")] - pub maintenance_window: Option, +pub struct ImportContextBakImportOptions { + /// no description provided + #[serde(rename="encryptionOptions")] + pub encryption_options: Option, } -impl Part for Settings {} +impl NestedType for ImportContextBakImportOptions {} +impl Part for ImportContextBakImportOptions {} /// Instance failover request. @@ -1343,7 +1502,8 @@ impl RequestValue for InstancesFailoverRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SslCertsInsertRequest { - /// User supplied name. Must be a distinct name from the other certificates for this instance. + /// User supplied name. Must be a distinct name from the other certificates + /// for this instance. #[serde(rename="commonName")] pub common_name: Option, } @@ -1364,7 +1524,7 @@ impl RequestValue for SslCertsInsertRequest {} pub struct SslCertsListResponse { /// List of client certificates for the instance. pub items: Option>, - /// This is always sql#sslCertsList. + /// This is always sql#sslCertsList. pub kind: Option, } @@ -1377,14 +1537,16 @@ impl ResponseResult for SslCertsListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AclEntry { - /// The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + /// The time when this access control entry expires in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. #[serde(rename="expirationTime")] pub expiration_time: Option, - /// This is always sql#aclEntry. + /// This is always sql#aclEntry. pub kind: Option, /// The whitelisted value for the access control list. pub value: Option, - /// An optional label to identify this entry. + /// Optional. A label to identify this entry. pub name: Option, } @@ -1428,22 +1590,26 @@ pub struct SslCert { /// Serial number, as extracted from the certificate. #[serde(rename="certSerialNumber")] pub cert_serial_number: Option, - /// This is always sql#sslCert. + /// This is always sql#sslCert. pub kind: Option, /// Sha1 Fingerprint. #[serde(rename="sha1Fingerprint")] pub sha1_fingerprint: Option, - /// User supplied name. Constrained to [a-zA-Z.-_ ]+. + /// User supplied name. Constrained to [a-zA-Z.-_ ]+. #[serde(rename="commonName")] pub common_name: Option, /// Name of the database instance. pub instance: Option, /// PEM representation. pub cert: Option, - /// The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + /// The time when the certificate expires in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. #[serde(rename="expirationTime")] pub expiration_time: Option, - /// The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z + /// The time when the certificate was created in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z #[serde(rename="createTime")] pub create_time: Option, /// The URI of this resource. @@ -1479,9 +1645,14 @@ impl RequestValue for SslCertsCreateEphemeralRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DemoteMasterConfiguration { - /// This is always sql#demoteMasterConfiguration. + /// This is always sql#demoteMasterConfiguration. pub kind: Option, - /// MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. + /// MySQL specific configuration when replicating from a MySQL on-premises + /// master. Replication configuration information such as the username, + /// password, certificates, and keys are not stored in the instance metadata. + /// The configuration information is used only to set up the replication + /// connection and is stored by MySQL in a file named master.info + /// in the data directory. #[serde(rename="mysqlReplicaConfiguration")] pub mysql_replica_configuration: Option, } @@ -1508,16 +1679,44 @@ pub struct InstancesTruncateLogRequest { impl RequestValue for InstancesTruncateLogRequest {} -/// Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ImportContextBakImportOptionsEncryptionOptions { + /// Path to the Certificate (.cer) in Cloud Storage, in the form + /// gs://bucketName/fileName. The instance must have + /// write permissions to the bucket and read access to the file. + #[serde(rename="certPath")] + pub cert_path: Option, + /// Path to the Certificate Private Key (.pvk) in Cloud Storage, in the + /// form gs://bucketName/fileName. The instance must have + /// write permissions to the bucket and read access to the file. + #[serde(rename="pvkPath")] + pub pvk_path: Option, + /// Password that encrypts the private key + #[serde(rename="pvkPassword")] + pub pvk_password: Option, +} + +impl NestedType for ImportContextBakImportOptionsEncryptionOptions {} +impl Part for ImportContextBakImportOptionsEncryptionOptions {} + + +/// Maintenance window. This specifies when a v2 Cloud SQL instance should +/// preferably be restarted for system maintenance purposes. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MaintenanceWindow { - /// This is always sql#maintenanceWindow. + /// This is always sql#maintenanceWindow. pub kind: Option, - /// Maintenance timing setting: canary (Earlier) or stable (Later). - /// Learn more. + /// Maintenance timing setting: canary (Earlier) or + /// stable (Later).
          + /// Learn more. #[serde(rename="updateTrack")] pub update_track: Option, /// day of week (1-7), starting on Monday. @@ -1529,15 +1728,127 @@ pub struct MaintenanceWindow { impl Part for MaintenanceWindow {} -/// The name and status of the failover replica. This property is applicable only to Second Generation instances. +/// An Operation resource. For successful operations that return an +/// Operation resource, only the fields relevant to the operation are populated +/// in the resource. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [delete ssl certs](struct.SslCertDeleteCall.html) (response) +/// * [truncate log instances](struct.InstanceTruncateLogCall.html) (response) +/// * [demote master instances](struct.InstanceDemoteMasterCall.html) (response) +/// * [delete users](struct.UserDeleteCall.html) (response) +/// * [delete databases](struct.DatabaseDeleteCall.html) (response) +/// * [failover instances](struct.InstanceFailoverCall.html) (response) +/// * [instances reschedule maintenance projects](struct.ProjectInstanceRescheduleMaintenanceCall.html) (response) +/// * [patch databases](struct.DatabasePatchCall.html) (response) +/// * [instances start external sync projects](struct.ProjectInstanceStartExternalSyncCall.html) (response) +/// * [reset ssl config instances](struct.InstanceResetSslConfigCall.html) (response) +/// * [promote replica instances](struct.InstancePromoteReplicaCall.html) (response) +/// * [update databases](struct.DatabaseUpdateCall.html) (response) +/// * [list operations](struct.OperationListCall.html) (none) +/// * [update users](struct.UserUpdateCall.html) (response) +/// * [insert databases](struct.DatabaseInsertCall.html) (response) +/// * [add server ca instances](struct.InstanceAddServerCaCall.html) (response) +/// * [delete backup runs](struct.BackupRunDeleteCall.html) (response) +/// * [patch instances](struct.InstancePatchCall.html) (response) +/// * [clone instances](struct.InstanceCloneCall.html) (response) +/// * [delete instances](struct.InstanceDeleteCall.html) (response) +/// * [get operations](struct.OperationGetCall.html) (response) +/// * [stop replica instances](struct.InstanceStopReplicaCall.html) (response) +/// * [start replica instances](struct.InstanceStartReplicaCall.html) (response) +/// * [insert users](struct.UserInsertCall.html) (response) +/// * [insert instances](struct.InstanceInsertCall.html) (response) +/// * [rotate server ca instances](struct.InstanceRotateServerCaCall.html) (response) +/// * [import instances](struct.InstanceImportCall.html) (response) +/// * [insert backup runs](struct.BackupRunInsertCall.html) (response) +/// * [update instances](struct.InstanceUpdateCall.html) (response) +/// * [restart instances](struct.InstanceRestartCall.html) (response) +/// * [export instances](struct.InstanceExportCall.html) (response) +/// * [restore backup instances](struct.InstanceRestoreBackupCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Operation { + /// The status of an operation. Valid values are PENDING, + /// RUNNING, DONE, + /// SQL_OPERATION_STATUS_UNSPECIFIED. + pub status: Option, + /// The context for import operation, if applicable. + #[serde(rename="importContext")] + pub import_context: Option, + /// This is always sql#operation. + pub kind: Option, + /// An identifier that uniquely identifies the operation. You can use this + /// identifier to retrieve the Operations resource that has information about + /// the operation. + pub name: Option, + /// The context for export operation, if applicable. + #[serde(rename="exportContext")] + pub export_context: Option, + /// The project ID of the target instance related to this operation. + #[serde(rename="targetProject")] + pub target_project: Option, + /// Name of the database instance related to this operation. + #[serde(rename="targetId")] + pub target_id: Option, + /// The type of the operation. Valid values are CREATE, + /// DELETE, UPDATE, RESTART, + /// IMPORT, EXPORT, BACKUP_VOLUME, + /// RESTORE_VOLUME, CREATE_USER, + /// DELETE_USER, CREATE_DATABASE, + /// DELETE_DATABASE . + #[serde(rename="operationType")] + pub operation_type: Option, + /// The time this operation was enqueued in UTC timezone in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. + #[serde(rename="insertTime")] + pub insert_time: Option, + /// no description provided + #[serde(rename="targetLink")] + pub target_link: Option, + /// The time this operation actually started in UTC timezone in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. + #[serde(rename="startTime")] + pub start_time: Option, + /// If errors occurred during processing of this operation, this field will be + /// populated. + pub error: Option, + /// The time this operation finished in UTC timezone in RFC 3339 format, for example + /// 2012-11-15T16:19:00.094Z. + #[serde(rename="endTime")] + pub end_time: Option, + /// The URI of this resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The email address of the user who initiated this operation. + pub user: Option, +} + +impl Resource for Operation {} +impl ResponseResult for Operation {} + + +/// The name and status of the failover replica. This property is applicable +/// only to Second Generation instances. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DatabaseInstanceFailoverReplica { - /// The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true. + /// The availability status of the failover replica. A false status indicates + /// that the failover replica is out of sync. The master can only failover to + /// the failover replica when the status is true. pub available: Option, - /// The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances. + /// The name of the failover replica. If specified at instance creation, a + /// failover replica is created for the instance. The name + /// doesn't include the project ID. This property is applicable only to + /// Second Generation instances. pub name: Option, } @@ -1560,6 +1871,23 @@ pub struct ApiWarning { impl Part for ApiWarning {} +/// Database instance operation error. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct OperationError { + /// This is always sql#operationError. + pub kind: Option, + /// Identifies the specific error that occurred. + pub code: Option, + /// Additional information about the error encountered. + pub message: Option, +} + +impl Part for OperationError {} + + /// Database instance export request. /// /// # Activities @@ -1590,14 +1918,15 @@ impl RequestValue for InstancesExportRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InstancesListResponse { - /// The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + /// The continuation token, used to page through large result sets. Provide + /// this value in a subsequent request to return the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// List of database instance resources. pub items: Option>, - /// This is always sql#instancesList. + /// This is always sql#instancesList. pub kind: Option, - /// List of warnings that ocurred while handling the request. + /// List of warnings that occurred while handling the request. pub warnings: Option>, } @@ -1610,9 +1939,15 @@ impl ResponseResult for InstancesListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DatabaseFlags { - /// The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation. + /// The name of the flag. These flags are passed at instance startup, so + /// include both server options and system variables for MySQL. Flags should be + /// specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud + /// SQL documentation. pub name: Option, - /// The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value. + /// The value of the flag. Booleans should be set to on for true + /// and off for false. This field must be omitted if the flag + /// doesn't take a value. pub value: Option, } @@ -1630,12 +1965,14 @@ impl Part for DatabaseFlags {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UsersListResponse { - /// An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. + /// An identifier that uniquely identifies the operation. You can use this + /// identifier to retrieve the Operations resource that has information about + /// the operation. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// List of user resources in the instance. pub items: Option>, - /// This is always sql#usersList. + /// This is always sql#usersList. pub kind: Option, } @@ -1656,22 +1993,33 @@ impl ResponseResult for UsersListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DatabaseInstance { - /// The name and status of the failover replica. This property is applicable only to Second Generation instances. + /// The name and status of the failover replica. This property is applicable + /// only to Second Generation instances. #[serde(rename="failoverReplica")] pub failover_replica: Option, /// The replicas of the instance. #[serde(rename="replicaNames")] pub replica_names: Option>, - /// FIRST_GEN: First Generation instance. MySQL only. - /// SECOND_GEN: Second Generation instance or PostgreSQL instance. - /// EXTERNAL: A database server that is not managed by Google. - /// This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation. + /// FIRST_GEN: First Generation instance. MySQL only.
          SECOND_GEN: Second Generation instance or PostgreSQL + /// instance.
          EXTERNAL: A database server that is not + /// managed by Google.
          This property is read-only; use the + /// tier property in the settings object to determine + /// the database type and Second or First Generation. #[serde(rename="backendType")] pub backend_type: Option, - /// The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. + /// This is always sql#instance. + pub kind: Option, + /// The current disk usage of the instance in bytes. This property has been + /// deprecated. Users should use the + /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud + /// Monitoring API instead. Please see this + /// announcement for details. #[serde(rename="currentDiskSize")] pub current_disk_size: Option, - /// The service account email address assigned to the instance. This property is applicable only to Second Generation instances. + /// The service account email address assigned to the instance. This property + /// is applicable only to Second Generation instances. #[serde(rename="serviceAccountEmailAddress")] pub service_account_email_address: Option, /// The assigned IP addresses for the instance. @@ -1683,32 +2031,48 @@ pub struct DatabaseInstance { /// Configuration specific to on-premises instances. #[serde(rename="onPremisesConfiguration")] pub on_premises_configuration: Option, - /// The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 + /// The database engine type and version. The databaseVersion + /// field can not be changed after instance creation. MySQL Second Generation + /// instances: MYSQL_5_7 (default) or MYSQL_5_6. + /// PostgreSQL instances: POSTGRES_9_6 (default) or + /// POSTGRES_11 Beta MySQL First Generation + /// instances: MYSQL_5_6 (default) or MYSQL_5_5 #[serde(rename="databaseVersion")] pub database_version: Option, /// The instance type. This can be one of the following. - /// CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master. - /// ON_PREMISES_INSTANCE: An instance running on the customer's premises. - /// READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. + ///
          CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not + /// replicating from a master.
          ON_PREMISES_INSTANCE: An + /// instance running on the + /// customer's premises.
          READ_REPLICA_INSTANCE: A Cloud SQL + /// instance configured as a read-replica. #[serde(rename="instanceType")] pub instance_type: Option, /// The maximum disk size of the instance in bytes. #[serde(rename="maxDiskSize")] pub max_disk_size: Option, - /// Disk encryption configuration specific to an instance. Applies only to Second Generation instances. + /// Disk encryption configuration specific to an instance. + /// Applies only to Second Generation instances. #[serde(rename="diskEncryptionConfiguration")] pub disk_encryption_configuration: Option, - /// This is always sql#instance. - pub kind: Option, + /// The start time of any upcoming scheduled maintenance for this instance. + #[serde(rename="scheduledMaintenance")] + pub scheduled_maintenance: Option, /// Name of the Cloud SQL instance. This does not include the project ID. pub name: Option, - /// The IPv6 address assigned to the instance. This property is applicable only to First Generation instances. + /// The IPv6 address assigned to the instance. This property is applicable only + /// to First Generation instances. #[serde(rename="ipv6Address")] pub ipv6_address: Option, /// If the instance state is SUSPENDED, the reason for the suspension. #[serde(rename="suspensionReason")] pub suspension_reason: Option>, - /// The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation. + /// The geographical region. Can be us-central + /// (FIRST_GEN instances only), us-central1 + /// (SECOND_GEN instances only), asia-east1 or + /// europe-west1. Defaults to us-central or + /// us-central1 depending on the instance type (First Generation + /// or Second Generation). The region can not be changed after instance + /// creation. pub region: Option, /// SSL configuration. #[serde(rename="serverCaCert")] @@ -1716,20 +2080,24 @@ pub struct DatabaseInstance { /// The name of the instance which will act as master in the replication setup. #[serde(rename="masterInstanceName")] pub master_instance_name: Option, - /// Disk encryption status specific to an instance. Applies only to Second Generation instances. + /// Disk encryption status specific to an instance. + /// Applies only to Second Generation instances. #[serde(rename="diskEncryptionStatus")] pub disk_encryption_status: Option, - /// The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. + /// The project ID of the project containing the Cloud SQL instance. The Google + /// apps domain is prefixed if applicable. pub project: Option, - /// The current serving state of the Cloud SQL instance. This can be one of the following. - /// RUNNABLE: The instance is running, or is ready to run when accessed. - /// SUSPENDED: The instance is not available, for example due to problems with billing. - /// PENDING_CREATE: The instance is being created. - /// MAINTENANCE: The instance is down for maintenance. - /// FAILED: The instance creation failed. - /// UNKNOWN_STATE: The state of the instance is unknown. + /// The current serving state of the Cloud SQL instance. This can be one of the + /// following.
          RUNNABLE: The instance is running, or is ready + /// to run when accessed.
          SUSPENDED: The instance is not + /// available, for example due to problems with billing. + ///
          PENDING_CREATE: The instance is being created. + ///
          MAINTENANCE: The instance is down for maintenance. + ///
          FAILED: The instance creation failed. + ///
          UNKNOWN_STATE: The state of the instance is unknown. pub state: Option, - /// This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. + /// This field is deprecated and will be removed from a future version of the + /// API. Use the settings.settingsVersion field instead. pub etag: Option, /// Configuration specific to failover replicas and read replicas. #[serde(rename="replicaConfiguration")] @@ -1737,7 +2105,9 @@ pub struct DatabaseInstance { /// Initial root password. Use only on creation. #[serde(rename="rootPassword")] pub root_password: Option, - /// The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. + /// The Compute Engine zone that the instance is currently serving from. This + /// value could be different from the zone that was specified when the instance + /// was created if the instance has failed over to its secondary zone. #[serde(rename="gceZone")] pub gce_zone: Option, /// The user settings. @@ -1759,7 +2129,7 @@ impl ResponseResult for DatabaseInstance {} pub struct DemoteMasterMySqlReplicaConfiguration { /// The username for the replication connection. pub username: Option, - /// This is always sql#demoteMasterMysqlReplicaConfiguration. + /// This is always sql#demoteMasterMysqlReplicaConfiguration. pub kind: Option, /// PEM representation of the slave's x509 certificate. #[serde(rename="clientCertificate")] @@ -1769,7 +2139,9 @@ pub struct DemoteMasterMySqlReplicaConfiguration { pub ca_certificate: Option, /// The password for the replication connection. pub password: Option, - /// PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. The format of the slave's private key can be either PKCS #1 or PKCS #8. + /// PEM representation of the slave's private key. The corresponsing public key + /// is encoded in the client's certificate. The format of the slave's private + /// key can be either PKCS #1 or PKCS #8. #[serde(rename="clientKey")] pub client_key: Option, } @@ -1796,15 +2168,36 @@ pub struct InstancesImportRequest { impl RequestValue for InstancesImportRequest {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Reschedule { + /// Optional. Timestamp when the maintenance shall be rescheduled to if + /// reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + /// example 2012-11-15T16:19:00.094Z. + #[serde(rename="scheduleTime")] + pub schedule_time: Option, + /// Required. The type of the reschedule. + #[serde(rename="rescheduleType")] + pub reschedule_type: Option, +} + +impl Part for Reschedule {} + + /// Database instance failover context. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FailoverContext { - /// This is always sql#failoverContext. + /// This is always sql#failoverContext. pub kind: Option, - /// The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version. + /// The current settings version of this instance. Request will be rejected if + /// this version doesn't match the current settings version. #[serde(rename="settingsVersion")] pub settings_version: Option, } @@ -1812,6 +2205,28 @@ pub struct FailoverContext { impl Part for FailoverContext {} +/// Options for exporting data as SQL statements. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ExportContextSqlExportOptions { + /// Tables to export, or that were exported, from the specified database. If + /// you specify tables, specify one and only one database. For PostgreSQL + /// instances, you can specify only one table. + pub tables: Option>, + /// Options for exporting from MySQL. + #[serde(rename="mysqlExportOptions")] + pub mysql_export_options: Option, + /// Export only schemas. + #[serde(rename="schemaOnly")] + pub schema_only: Option, +} + +impl NestedType for ExportContextSqlExportOptions {} +impl Part for ExportContextSqlExportOptions {} + + /// Database list response. /// /// # Activities @@ -1825,7 +2240,7 @@ impl Part for FailoverContext {} pub struct DatabasesListResponse { /// List of database resources in the instance. pub items: Option>, - /// This is always sql#databasesList. + /// This is always sql#databasesList. pub kind: Option, } @@ -1841,7 +2256,7 @@ pub struct BinLogCoordinates { /// Position (offset) within the binary log file. #[serde(rename="binLogPosition")] pub bin_log_position: Option, - /// This is always sql#binLogCoordinates. + /// This is always sql#binLogCoordinates. pub kind: Option, /// Name of the binary log file for a Cloud SQL instance. #[serde(rename="binLogFileName")] @@ -1851,128 +2266,157 @@ pub struct BinLogCoordinates { impl Part for BinLogCoordinates {} -/// An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. +/// Represents a Sql Server user on the Cloud SQL instance. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [delete ssl certs](struct.SslCertDeleteCall.html) (response) -/// * [truncate log instances](struct.InstanceTruncateLogCall.html) (response) -/// * [demote master instances](struct.InstanceDemoteMasterCall.html) (response) -/// * [delete users](struct.UserDeleteCall.html) (response) -/// * [delete databases](struct.DatabaseDeleteCall.html) (response) -/// * [failover instances](struct.InstanceFailoverCall.html) (response) -/// * [patch databases](struct.DatabasePatchCall.html) (response) -/// * [reset ssl config instances](struct.InstanceResetSslConfigCall.html) (response) -/// * [promote replica instances](struct.InstancePromoteReplicaCall.html) (response) -/// * [update databases](struct.DatabaseUpdateCall.html) (response) -/// * [list operations](struct.OperationListCall.html) (none) -/// * [update users](struct.UserUpdateCall.html) (response) -/// * [insert databases](struct.DatabaseInsertCall.html) (response) -/// * [add server ca instances](struct.InstanceAddServerCaCall.html) (response) -/// * [delete backup runs](struct.BackupRunDeleteCall.html) (response) -/// * [patch instances](struct.InstancePatchCall.html) (response) -/// * [clone instances](struct.InstanceCloneCall.html) (response) -/// * [delete instances](struct.InstanceDeleteCall.html) (response) -/// * [get operations](struct.OperationGetCall.html) (response) -/// * [stop replica instances](struct.InstanceStopReplicaCall.html) (response) -/// * [start replica instances](struct.InstanceStartReplicaCall.html) (response) -/// * [insert users](struct.UserInsertCall.html) (response) -/// * [insert instances](struct.InstanceInsertCall.html) (response) -/// * [rotate server ca instances](struct.InstanceRotateServerCaCall.html) (response) -/// * [import instances](struct.InstanceImportCall.html) (response) -/// * [insert backup runs](struct.BackupRunInsertCall.html) (response) -/// * [update instances](struct.InstanceUpdateCall.html) (response) -/// * [restart instances](struct.InstanceRestartCall.html) (response) -/// * [export instances](struct.InstanceExportCall.html) (response) -/// * [restore backup instances](struct.InstanceRestoreBackupCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Operation { - /// The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. - pub status: Option, - /// The context for import operation, if applicable. - #[serde(rename="importContext")] - pub import_context: Option, - /// This is always sql#operation. - pub kind: Option, - /// An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. - pub name: Option, - /// The context for export operation, if applicable. - #[serde(rename="exportContext")] - pub export_context: Option, - /// The project ID of the target instance related to this operation. - #[serde(rename="targetProject")] - pub target_project: Option, - /// Name of the database instance related to this operation. - #[serde(rename="targetId")] - pub target_id: Option, - /// The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . - #[serde(rename="operationType")] - pub operation_type: Option, - /// The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. - #[serde(rename="insertTime")] - pub insert_time: Option, - /// no description provided - #[serde(rename="targetLink")] - pub target_link: Option, - /// The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. - #[serde(rename="startTime")] - pub start_time: Option, - /// If errors occurred during processing of this operation, this field will be populated. - pub error: Option, - /// The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. - #[serde(rename="endTime")] - pub end_time: Option, - /// The URI of this resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The email address of the user who initiated this operation. - pub user: Option, +pub struct SqlServerUserDetails { + /// If the user has been disabled + pub disabled: Option, + /// The server roles for this user + #[serde(rename="serverRoles")] + pub server_roles: Option>, } -impl Resource for Operation {} -impl ResponseResult for Operation {} +impl Part for SqlServerUserDetails {} -/// Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. +/// Preferred location. This specifies where a Cloud SQL instance should +/// preferably be located, either in a specific Compute Engine zone, or +/// co-located with an App Engine application. Note that if the preferred +/// location is not available, the instance will be located as close as possible +/// within the region. Only one location may be specified. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LocationPreference { - /// This is always sql#locationPreference. + /// This is always sql#locationPreference. pub kind: Option, - /// The AppEngine application to follow, it must be in the same region as the Cloud SQL instance. + /// The AppEngine application to follow, it must be in the same region as the + /// Cloud SQL instance. #[serde(rename="followGaeApplication")] pub follow_gae_application: Option, - /// The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.). + /// The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, + /// etc.). pub zone: Option, } impl Part for LocationPreference {} -/// Options for exporting data as SQL statements. +/// Database instance settings. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ExportContextSqlExportOptions { - /// Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. - pub tables: Option>, - /// Options for exporting from MySQL. - #[serde(rename="mysqlExportOptions")] - pub mysql_export_options: Option, - /// Export only schemas. - #[serde(rename="schemaOnly")] - pub schema_only: Option, +pub struct Settings { + /// Availability type (PostgreSQL and MySQL instances only). Potential values: + ///
          ZONAL: The instance serves data from only one zone. + /// Outages in that zone affect data accessibility.
          REGIONAL: + /// The instance can serve data from more than one zone in a region (it is + /// highly available).
          For more information, see Overview + /// of the High Availability Configuration. + #[serde(rename="availabilityType")] + pub availability_type: Option, + /// The activation policy specifies when the instance is activated; it is + /// applicable only when the instance state is RUNNABLE. Valid + /// values:
          ALWAYS: The instance is on, and remains so even in + /// the absence of connection requests.
          NEVER: The instance is + /// off; it is not activated, even if a connection request arrives. + ///
          ON_DEMAND: First Generation instances only. The instance + /// responds to incoming requests, and turns itself off when not in use. + /// Instances with PER_USE pricing turn off after 15 minutes of + /// inactivity. Instances with PER_PACKAGE pricing turn off after + /// 12 hours of inactivity. + #[serde(rename="activationPolicy")] + pub activation_policy: Option, + /// The settings for IP Management. This allows to enable or disable the + /// instance IP and manage which external networks can connect to the instance. + /// The IPv4 address cannot be disabled for Second Generation instances. + #[serde(rename="ipConfiguration")] + pub ip_configuration: Option, + /// User-provided labels, represented as a dictionary where each label is a + /// single key value pair. + #[serde(rename="userLabels")] + pub user_labels: Option>, + /// Configuration specific to read replica instances. Indicates whether + /// replication is enabled or not. + #[serde(rename="databaseReplicationEnabled")] + pub database_replication_enabled: Option, + /// The type of replication this instance uses. This can be either + /// ASYNCHRONOUS or SYNCHRONOUS. This property is + /// only applicable to First Generation instances. + #[serde(rename="replicationType")] + pub replication_type: Option, + /// The tier (or machine type) for this instance, for example + /// db-n1-standard-1 (MySQL instances) or + /// db-custom-1-3840 (PostgreSQL instances). For MySQL instances, + /// this property determines whether the instance is First or Second + /// Generation. For more information, see Instance Settings. + pub tier: Option, + /// The version of instance settings. This is a required field for update + /// method to make sure concurrent updates are handled properly. During update, + /// use the most recent settingsVersion value for this instance and do not try + /// to update this value. + #[serde(rename="settingsVersion")] + pub settings_version: Option, + /// Configuration to increase storage size automatically. The default value is + /// true. Not used for First Generation instances. + #[serde(rename="storageAutoResize")] + pub storage_auto_resize: Option, + /// The location preference settings. This allows the instance to be located as + /// near as possible to either an App Engine app or Compute Engine zone for + /// better performance. App Engine co-location is only applicable to First + /// Generation instances. + #[serde(rename="locationPreference")] + pub location_preference: Option, + /// The size of data disk, in GB. The data disk size minimum is 10GB. Not used + /// for First Generation instances. + #[serde(rename="dataDiskSizeGb")] + pub data_disk_size_gb: Option, + /// The database flags passed to the instance at startup. + #[serde(rename="databaseFlags")] + pub database_flags: Option>, + /// This is always sql#settings. + pub kind: Option, + /// The type of data disk: PD_SSD (default) or + /// PD_HDD. Not used for First Generation instances. + #[serde(rename="dataDiskType")] + pub data_disk_type: Option, + /// The App Engine app IDs that can access this instance. First Generation + /// instances only. + #[serde(rename="authorizedGaeApplications")] + pub authorized_gae_applications: Option>, + /// The daily backup configuration for the instance. + #[serde(rename="backupConfiguration")] + pub backup_configuration: Option, + /// The maximum size to which storage capacity can be automatically increased. + /// The default value is 0, which specifies that there is no limit. Not used + /// for First Generation instances. + #[serde(rename="storageAutoResizeLimit")] + pub storage_auto_resize_limit: Option, + /// Configuration specific to read replica instances. Indicates whether + /// database flags for crash-safe replication are enabled. This property is + /// only applicable to First Generation instances. + #[serde(rename="crashSafeReplicationEnabled")] + pub crash_safe_replication_enabled: Option, + /// The pricing plan for this instance. This can be either PER_USE + /// or PACKAGE. Only PER_USE is supported for Second + /// Generation instances. + #[serde(rename="pricingPlan")] + pub pricing_plan: Option, + /// The maintenance window for this instance. This specifies when the instance + /// can be restarted for maintenance purposes. Not used for First Generation + /// instances. + #[serde(rename="maintenanceWindow")] + pub maintenance_window: Option, } -impl NestedType for ExportContextSqlExportOptions {} -impl Part for ExportContextSqlExportOptions {} +impl Part for Settings {} /// On-premises instance configuration. @@ -1981,11 +2425,28 @@ impl Part for ExportContextSqlExportOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct OnPremisesConfiguration { - /// This is always sql#onPremisesConfiguration. + /// The username for connecting to on-premises instance. + pub username: Option, + /// This is always sql#onPremisesConfiguration. pub kind: Option, + /// PEM representation of the slave's private key. The corresponsing public key + /// is encoded in the client's certificate. + #[serde(rename="clientKey")] + pub client_key: Option, + /// PEM representation of the trusted CA's x509 certificate. + #[serde(rename="caCertificate")] + pub ca_certificate: Option, + /// PEM representation of the slave's x509 certificate. + #[serde(rename="clientCertificate")] + pub client_certificate: Option, + /// The dump file to create the Cloud SQL replica. + #[serde(rename="dumpFilePath")] + pub dump_file_path: Option, /// The host and port of the on-premises instance in host:port format #[serde(rename="hostPort")] pub host_port: Option, + /// The password for connecting to on-premises instance. + pub password: Option, } impl Part for OnPremisesConfiguration {} @@ -2007,12 +2468,12 @@ impl Part for OnPremisesConfiguration {} /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -2037,19 +2498,19 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time. + /// Lists all instance operations that have been performed on the given Cloud + /// SQL instance in the reverse chronological order of the start time. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. - /// * `instance` - Cloud SQL instance ID. This does not include the project ID. - pub fn list(&self, project: &str, instance: &str) -> OperationListCall<'a, C, A> { + pub fn list(&self, project: &str) -> OperationListCall<'a, C, A> { OperationListCall { hub: self.hub, _project: project.to_string(), - _instance: instance.to_string(), _page_token: Default::default(), _max_results: Default::default(), + _instance: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2089,12 +2550,12 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -2119,7 +2580,9 @@ impl<'a, C, A> TierMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing. + /// Lists all available machine types (tiers) for Cloud SQL, for example, + /// db-n1-standard-1. For related information, see Pricing. /// /// # Arguments /// @@ -2148,12 +2611,12 @@ impl<'a, C, A> TierMethods<'a, C, A> { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -2203,15 +2666,13 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. - /// * `host` - Host of the user in the instance. - /// * `name` - Name of the user in the instance. - pub fn delete(&self, project: &str, instance: &str, host: &str, name: &str) -> UserDeleteCall<'a, C, A> { + pub fn delete(&self, project: &str, instance: &str) -> UserDeleteCall<'a, C, A> { UserDeleteCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), - _host: host.to_string(), - _name: name.to_string(), + _name: Default::default(), + _host: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2227,14 +2688,13 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. - /// * `name` - Name of the user in the instance. - pub fn update(&self, request: User, project: &str, instance: &str, name: &str) -> UserUpdateCall<'a, C, A> { + pub fn update(&self, request: User, project: &str, instance: &str) -> UserUpdateCall<'a, C, A> { UserUpdateCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), - _name: name.to_string(), + _name: Default::default(), _host: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2277,12 +2737,12 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -2328,7 +2788,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. + /// Demotes the stand-alone instance to be a Cloud SQL read replica for an + /// external database server. /// /// # Arguments /// @@ -2349,7 +2810,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Failover the instance to its failover replica instance. + /// Failover the instance to its failover replica instance. Using this + /// operation might cause your instance to restart. /// /// # Arguments /// @@ -2370,7 +2832,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. + /// Imports data into a Cloud SQL instance from a SQL dump or CSV file in + /// Cloud Storage. /// /// # Arguments /// @@ -2391,7 +2854,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes all client certificates and generates a new server SSL certificate for the instance. + /// Deletes all client certificates and generates a new server SSL certificate + /// for the instance. /// /// # Arguments /// @@ -2410,7 +2874,11 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. + /// Add a new trusted Certificate Authority (CA) version for the specified + /// instance. Required to prepare for a certificate rotation. If a CA version + /// was previously added but never used in a certificate rotation, this + /// operation replaces that version. There cannot be more than one CA version + /// waiting to be rotated in. /// /// # Arguments /// @@ -2430,6 +2898,7 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Promotes the read replica instance to be a stand-alone Cloud SQL instance. + /// Using this operation might cause your instance to restart. /// /// # Arguments /// @@ -2467,7 +2936,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics. + /// Updates settings of a Cloud SQL instance. + /// This method supports patch semantics. /// /// # Arguments /// @@ -2488,13 +2958,15 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a Cloud SQL instance as a clone of the source instance. + /// Creates a Cloud SQL instance as a clone of the source instance. Using this + /// operation might cause your instance to restart. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the source as well as the clone Cloud SQL instance. - /// * `instance` - The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. + /// * `instance` - The ID of the Cloud SQL instance to be cloned (source). This does not + /// include the project ID. pub fn clone(&self, request: InstancesCloneRequest, project: &str, instance: &str) -> InstanceCloneCall<'a, C, A> { InstanceCloneCall { hub: self.hub, @@ -2571,7 +3043,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `project` - Project ID of the project to which the newly created Cloud SQL instances should belong. + /// * `project` - Project ID of the project to which the newly created Cloud SQL instances + /// should belong. pub fn insert(&self, request: DatabaseInstance, project: &str) -> InstanceInsertCall<'a, C, A> { InstanceInsertCall { hub: self.hub, @@ -2585,7 +3058,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. + /// Rotates the server certificate to one signed by the Certificate Authority + /// (CA) version previously added with the addServerCA method. /// /// # Arguments /// @@ -2606,7 +3080,7 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists instances under a given project in the alphabetical order of the instance name. + /// Lists instances under a given project. /// /// # Arguments /// @@ -2626,7 +3100,11 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out. + /// Lists all of the trusted Certificate Authorities (CAs) for the specified + /// instance. There can be up to three CAs listed: the CA that was used to sign + /// the certificate that is currently in use, a CA that has been added but not + /// yet used to sign a certificate, and a CA used to sign a certificate that + /// has previously rotated out. /// /// # Arguments /// @@ -2645,7 +3123,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch. + /// Updates settings of a Cloud SQL instance. Using this operation might cause + /// your instance to restart. /// /// # Arguments /// @@ -2685,7 +3164,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. + /// Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL + /// dump or CSV file. /// /// # Arguments /// @@ -2706,7 +3186,8 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Restores a backup of a Cloud SQL instance. + /// Restores a backup of a Cloud SQL instance. Using this operation might cause + /// your instance to restart. /// /// # Arguments /// @@ -2739,12 +3220,12 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -2783,6 +3264,110 @@ impl<'a, C, A> FlagMethods<'a, C, A> { +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `SQLAdmin` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_sql1_beta4 as sql1_beta4; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use sql1_beta4::SQLAdmin; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = SQLAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `instances_reschedule_maintenance(...)`, `instances_start_external_sync(...)` and `instances_verify_external_sync_settings(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SQLAdmin, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Verify External master external sync settings. + /// + /// # Arguments + /// + /// * `project` - Project ID of the project that contains the instance. + /// * `instance` - Cloud SQL instance ID. This does not include the project ID. + pub fn instances_verify_external_sync_settings(&self, project: &str, instance: &str) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> { + ProjectInstanceVerifyExternalSyncSettingCall { + hub: self.hub, + _project: project.to_string(), + _instance: instance.to_string(), + _verify_connection_only: Default::default(), + _sync_mode: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Reschedules the maintenance on the given instance. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `project` - ID of the project that contains the instance. + /// * `instance` - Cloud SQL instance ID. This does not include the project ID. + pub fn instances_reschedule_maintenance(&self, request: SqlInstancesRescheduleMaintenanceRequestBody, project: &str, instance: &str) -> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> { + ProjectInstanceRescheduleMaintenanceCall { + hub: self.hub, + _request: request, + _project: project.to_string(), + _instance: instance.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Start External master migration. + /// + /// # Arguments + /// + /// * `project` - ID of the project that contains the first generation instance. + /// * `instance` - Cloud SQL instance ID. This does not include the project ID. + pub fn instances_start_external_sync(&self, project: &str, instance: &str) -> ProjectInstanceStartExternalSyncCall<'a, C, A> { + ProjectInstanceStartExternalSyncCall { + hub: self.hub, + _project: project.to_string(), + _instance: instance.to_string(), + _sync_mode: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *database* resources. /// It is not used directly, but through the `SQLAdmin` hub. /// @@ -2794,12 +3379,12 @@ impl<'a, C, A> FlagMethods<'a, C, A> { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -2845,7 +3430,8 @@ impl<'a, C, A> DatabaseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics. + /// Partially updates a resource containing information about a database inside + /// a Cloud SQL instance. This method supports patch semantics. /// /// # Arguments /// @@ -2887,7 +3473,8 @@ impl<'a, C, A> DatabaseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Inserts a resource containing information about a database inside a Cloud SQL instance. + /// Inserts a resource containing information about a database inside a Cloud + /// SQL instance. /// /// # Arguments /// @@ -2908,7 +3495,8 @@ impl<'a, C, A> DatabaseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a resource containing information about a database inside a Cloud SQL instance. + /// Retrieves a resource containing information about a database inside a Cloud + /// SQL instance. /// /// # Arguments /// @@ -2929,7 +3517,8 @@ impl<'a, C, A> DatabaseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a resource containing information about a database inside a Cloud SQL instance. + /// Updates a resource containing information about a database inside a Cloud + /// SQL instance. /// /// # Arguments /// @@ -2964,12 +3553,12 @@ impl<'a, C, A> DatabaseMethods<'a, C, A> { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -2994,7 +3583,9 @@ impl<'a, C, A> SslCertMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted. + /// Creates an SSL certificate and returns it along with the private key and + /// server certificate authority. The new certificate will not be usable until + /// the instance is restarted. /// /// # Arguments /// @@ -3015,7 +3606,8 @@ impl<'a, C, A> SslCertMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted. + /// Deletes the SSL certificate. For First Generation instances, the + /// certificate remains valid until the instance is restarted. /// /// # Arguments /// @@ -3036,7 +3628,9 @@ impl<'a, C, A> SslCertMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation. + /// Retrieves a particular SSL certificate. Does not include the private key + /// (required for usage). The private key must be saved from the response to + /// initial creation. /// /// # Arguments /// @@ -3057,7 +3651,10 @@ impl<'a, C, A> SslCertMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database. + /// Generates a short-lived X509 certificate containing the provided public key + /// and signed by a private key specific to the target instance. Users may use + /// the certificate to authenticate as themselves when connecting to the + /// database. /// /// # Arguments /// @@ -3109,12 +3706,12 @@ impl<'a, C, A> SslCertMethods<'a, C, A> { /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate yup_oauth2 as oauth2; -/// extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// extern crate google_sql1_beta4 as sql1_beta4; /// /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use sqladmin1_beta4::SQLAdmin; +/// use sql1_beta4::SQLAdmin; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -3139,7 +3736,8 @@ impl<'a, C, A> BackupRunMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time. + /// Lists all backup runs associated with a given instance and configuration in + /// the reverse chronological order of the backup initiation time. /// /// # Arguments /// @@ -3187,7 +3785,9 @@ impl<'a, C, A> BackupRunMethods<'a, C, A> { /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. - /// * `id` - The ID of the Backup Run to delete. To find a Backup Run ID, use the list method. + /// * `id` - The ID of the Backup Run to delete. To find a Backup Run ID, use the list + /// method. pub fn delete(&self, project: &str, instance: &str, id: &str) -> BackupRunDeleteCall<'a, C, A> { BackupRunDeleteCall { hub: self.hub, @@ -3202,7 +3802,8 @@ impl<'a, C, A> BackupRunMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new backup run on demand. This method is applicable only to Second Generation instances. + /// Creates a new backup run on demand. This method is applicable only to + /// Second Generation instances. /// /// # Arguments /// @@ -3230,7 +3831,8 @@ impl<'a, C, A> BackupRunMethods<'a, C, A> { // CallBuilders ### // ################# -/// Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time. +/// Lists all instance operations that have been performed on the given Cloud +/// SQL instance in the reverse chronological order of the start time. /// /// A builder for the *list* method supported by a *operation* resource. /// It is not used directly, but through a `OperationMethods` instance. @@ -3243,11 +3845,11 @@ impl<'a, C, A> BackupRunMethods<'a, C, A> { /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -3257,9 +3859,10 @@ impl<'a, C, A> BackupRunMethods<'a, C, A> { /// // 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.operations().list("project", "instance") -/// .page_token("nonumy") -/// .max_results(82) +/// let result = hub.operations().list("project") +/// .page_token("sea") +/// .max_results(11) +/// .instance("dolores") /// .doit(); /// # } /// ``` @@ -3268,9 +3871,9 @@ pub struct OperationListCall<'a, C, A> hub: &'a SQLAdmin, _project: String, - _instance: String, _page_token: Option, _max_results: Option, + _instance: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3294,14 +3897,16 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); params.push(("project", self._project.to_string())); - params.push(("instance", self._instance.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } - for &field in ["alt", "project", "instance", "pageToken", "maxResults"].iter() { + if let Some(value) = self._instance { + params.push(("instance", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "instance"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3313,7 +3918,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/operations"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/operations"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3423,17 +4028,8 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// Cloud SQL instance ID. This does not include the project ID. - /// - /// Sets the *instance* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn instance(mut self, new_value: &str) -> OperationListCall<'a, C, A> { - self._instance = new_value.to_string(); - self - } - /// A previously-returned page token representing part of the larger set of results to view. + /// A previously-returned page token representing part of the larger set of + /// results to view. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C, A> { @@ -3447,6 +4043,13 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } + /// Cloud SQL instance ID. This does not include the project ID. + /// + /// Sets the *instance* query property to the given value. + pub fn instance(mut self, new_value: &str) -> OperationListCall<'a, C, A> { + self._instance = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3467,13 +4070,17 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> OperationListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3519,11 +4126,11 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -3579,7 +4186,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/operations/{operation}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/operations/{operation}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3719,13 +4326,17 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> OperationGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3758,7 +4369,9 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: } -/// Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing. +/// Lists all available machine types (tiers) for Cloud SQL, for example, +/// db-n1-standard-1. For related information, see Pricing. /// /// A builder for the *list* method supported by a *tier* resource. /// It is not used directly, but through a `TierMethods` instance. @@ -3771,11 +4384,11 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -3829,7 +4442,7 @@ impl<'a, C, A> TierListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/tiers"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/tiers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3959,13 +4572,17 @@ impl<'a, C, A> TierListCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> TierListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4011,11 +4628,11 @@ impl<'a, C, A> TierListCall<'a, C, A> where C: BorrowMut, A: oaut /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -4071,7 +4688,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4211,13 +4828,17 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> UserListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4263,11 +4884,11 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -4277,7 +4898,9 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut /// // 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.users().delete("project", "instance", "host", "name") +/// let result = hub.users().delete("project", "instance") +/// .name("et") +/// .host("et") /// .doit(); /// # } /// ``` @@ -4287,8 +4910,8 @@ pub struct UserDeleteCall<'a, C, A> hub: &'a SQLAdmin, _project: String, _instance: String, - _host: String, - _name: String, + _name: Option, + _host: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4313,9 +4936,13 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("instance", self._instance.to_string())); - params.push(("host", self._host.to_string())); - params.push(("name", self._name.to_string())); - for &field in ["alt", "project", "instance", "host", "name"].iter() { + if let Some(value) = self._name { + params.push(("name", value.to_string())); + } + if let Some(value) = self._host { + params.push(("host", value.to_string())); + } + for &field in ["alt", "project", "instance", "name", "host"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4327,7 +4954,7 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4447,24 +5074,18 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa self._instance = new_value.to_string(); self } - /// Host of the user in the instance. - /// - /// Sets the *host* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn host(mut self, new_value: &str) -> UserDeleteCall<'a, C, A> { - self._host = new_value.to_string(); - self - } /// Name of the user in the instance. /// /// Sets the *name* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. pub fn name(mut self, new_value: &str) -> UserDeleteCall<'a, C, A> { - self._name = new_value.to_string(); + self._name = Some(new_value.to_string()); + self + } + /// Host of the user in the instance. + /// + /// Sets the *host* query property to the given value. + pub fn host(mut self, new_value: &str) -> UserDeleteCall<'a, C, A> { + self._host = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -4487,13 +5108,17 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> UserDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4539,12 +5164,12 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::User; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::User; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -4559,7 +5184,8 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// // 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.users().update(req, "project", "instance", "name") +/// let result = hub.users().update(req, "project", "instance") +/// .name("Lorem") /// .host("et") /// .doit(); /// # } @@ -4571,7 +5197,7 @@ pub struct UserUpdateCall<'a, C, A> _request: User, _project: String, _instance: String, - _name: String, + _name: Option, _host: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -4597,7 +5223,9 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len()); params.push(("project", self._project.to_string())); params.push(("instance", self._instance.to_string())); - params.push(("name", self._name.to_string())); + if let Some(value) = self._name { + params.push(("name", value.to_string())); + } if let Some(value) = self._host { params.push(("host", value.to_string())); } @@ -4613,7 +5241,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4760,14 +5388,11 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// Name of the user in the instance. /// /// Sets the *name* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. pub fn name(mut self, new_value: &str) -> UserUpdateCall<'a, C, A> { - self._name = new_value.to_string(); + self._name = Some(new_value.to_string()); self } - /// Host of the user in the instance. + /// Optional. Host of the user in the instance. /// /// Sets the *host* query property to the given value. pub fn host(mut self, new_value: &str) -> UserUpdateCall<'a, C, A> { @@ -4794,13 +5419,17 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> UserUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4846,12 +5475,12 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::User; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::User; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -4913,7 +5542,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/users"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5077,13 +5706,17 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> UserInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5129,12 +5762,12 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::InstancesTruncateLogRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::InstancesTruncateLogRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -5196,7 +5829,7 @@ impl<'a, C, A> InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceTruncateLogCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceTruncateLogCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5399,7 +6036,8 @@ impl<'a, C, A> InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceDemoteMasterCall<'a, C, A> where C: BorrowMut InstanceDemoteMasterCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceDemoteMasterCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5682,7 +6324,8 @@ impl<'a, C, A> InstanceDemoteMasterCall<'a, C, A> where C: BorrowMut InstanceDemoteMasterCall<'a, C, A> where C: BorrowMut InstanceFailoverCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/failover"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/failover"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5926,13 +6569,17 @@ impl<'a, C, A> InstanceFailoverCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceFailoverCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5965,7 +6612,8 @@ impl<'a, C, A> InstanceFailoverCall<'a, C, A> where C: BorrowMut, } -/// Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. +/// Imports data into a Cloud SQL instance from a SQL dump or CSV file in +/// Cloud Storage. /// /// A builder for the *import* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -5978,12 +6626,12 @@ impl<'a, C, A> InstanceFailoverCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::InstancesImportRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::InstancesImportRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -6045,7 +6693,7 @@ impl<'a, C, A> InstanceImportCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/import"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/import"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6209,13 +6857,17 @@ impl<'a, C, A> InstanceImportCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceImportCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6248,7 +6900,8 @@ impl<'a, C, A> InstanceImportCall<'a, C, A> where C: BorrowMut, A } -/// Deletes all client certificates and generates a new server SSL certificate for the instance. +/// Deletes all client certificates and generates a new server SSL certificate +/// for the instance. /// /// A builder for the *resetSslConfig* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -6261,11 +6914,11 @@ impl<'a, C, A> InstanceImportCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -6321,7 +6974,7 @@ impl<'a, C, A> InstanceResetSslConfigCall<'a, C, A> where C: BorrowMut InstanceResetSslConfigCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceResetSslConfigCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6500,7 +7157,11 @@ impl<'a, C, A> InstanceResetSslConfigCall<'a, C, A> where C: BorrowMut InstanceResetSslConfigCall<'a, C, A> where C: BorrowMut InstanceAddServerCaCall<'a, C, A> where C: BorrowMut InstanceAddServerCaCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceAddServerCaCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6753,6 +7418,7 @@ impl<'a, C, A> InstanceAddServerCaCall<'a, C, A> where C: BorrowMut InstanceAddServerCaCall<'a, C, A> where C: BorrowMut InstancePromoteReplicaCall<'a, C, A> where C: BorrowMut InstancePromoteReplicaCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstancePromoteReplicaCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7017,11 +7687,11 @@ impl<'a, C, A> InstancePromoteReplicaCall<'a, C, A> where C: BorrowMut InstanceGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7217,13 +7887,17 @@ impl<'a, C, A> InstanceGetCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7256,7 +7930,8 @@ impl<'a, C, A> InstanceGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics. +/// Updates settings of a Cloud SQL instance. +/// This method supports patch semantics. /// /// A builder for the *patch* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -7269,12 +7944,12 @@ impl<'a, C, A> InstanceGetCall<'a, C, A> where C: BorrowMut, A: o /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::DatabaseInstance; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::DatabaseInstance; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -7336,7 +8011,7 @@ impl<'a, C, A> InstancePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7500,13 +8175,17 @@ impl<'a, C, A> InstancePatchCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstancePatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7539,7 +8218,8 @@ impl<'a, C, A> InstancePatchCall<'a, C, A> where C: BorrowMut, A: } -/// Creates a Cloud SQL instance as a clone of the source instance. +/// Creates a Cloud SQL instance as a clone of the source instance. Using this +/// operation might cause your instance to restart. /// /// A builder for the *clone* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -7552,12 +8232,12 @@ impl<'a, C, A> InstancePatchCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::InstancesCloneRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::InstancesCloneRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -7619,7 +8299,7 @@ impl<'a, C, A> InstanceCloneCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/clone"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/clone"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7753,7 +8433,8 @@ impl<'a, C, A> InstanceCloneCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. + /// The ID of the Cloud SQL instance to be cloned (source). This does not + /// include the project ID. /// /// Sets the *instance* path property to the given value. /// @@ -7783,13 +8464,17 @@ impl<'a, C, A> InstanceCloneCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceCloneCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7835,11 +8520,11 @@ impl<'a, C, A> InstanceCloneCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -7895,7 +8580,7 @@ impl<'a, C, A> InstanceDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8035,13 +8720,17 @@ impl<'a, C, A> InstanceDeleteCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8087,11 +8776,11 @@ impl<'a, C, A> InstanceDeleteCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -8147,7 +8836,7 @@ impl<'a, C, A> InstanceStopReplicaCall<'a, C, A> where C: BorrowMut InstanceStopReplicaCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceStopReplicaCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8339,11 +9032,11 @@ impl<'a, C, A> InstanceStopReplicaCall<'a, C, A> where C: BorrowMut InstanceStartReplicaCall<'a, C, A> where C: BorrowMut InstanceStartReplicaCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceStartReplicaCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8591,12 +9288,12 @@ impl<'a, C, A> InstanceStartReplicaCall<'a, C, A> where C: BorrowMut InstanceInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8780,7 +9477,8 @@ impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A self._request = new_value; self } - /// Project ID of the project to which the newly created Cloud SQL instances should belong. + /// Project ID of the project to which the newly created Cloud SQL instances + /// should belong. /// /// Sets the *project* path property to the given value. /// @@ -8810,13 +9508,17 @@ impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8849,7 +9551,8 @@ impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A } -/// Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. +/// Rotates the server certificate to one signed by the Certificate Authority +/// (CA) version previously added with the addServerCA method. /// /// A builder for the *rotateServerCa* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -8862,12 +9565,12 @@ impl<'a, C, A> InstanceInsertCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::InstancesRotateServerCaRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::InstancesRotateServerCaRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -8929,7 +9632,7 @@ impl<'a, C, A> InstanceRotateServerCaCall<'a, C, A> where C: BorrowMut InstanceRotateServerCaCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceRotateServerCaCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9132,7 +9839,7 @@ impl<'a, C, A> InstanceRotateServerCaCall<'a, C, A> where C: BorrowMut InstanceRotateServerCaCall<'a, C, A> where C: BorrowMut InstanceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9328,7 +10035,8 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: self._project = new_value.to_string(); self } - /// A previously-returned page token representing part of the larger set of results to view. + /// A previously-returned page token representing part of the larger set of + /// results to view. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { @@ -9342,7 +10050,15 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } - /// An expression for filtering the results of the request, such as by name or label. + /// A filter expression that filters resources listed in the response. + /// The expression is in the form of field:value. For example, + /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per + /// their JSON representation, such as 'settings.userLabels.auto_start:true'. + /// + /// Multiple filter queries are space-separated. For example. + /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each + /// expression is an AND expression. However, you can include AND and OR + /// expressions explicitly. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> InstanceListCall<'a, C, A> { @@ -9369,13 +10085,17 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9408,7 +10128,11 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: } -/// Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out. +/// Lists all of the trusted Certificate Authorities (CAs) for the specified +/// instance. There can be up to three CAs listed: the CA that was used to sign +/// the certificate that is currently in use, a CA that has been added but not +/// yet used to sign a certificate, and a CA used to sign a certificate that +/// has previously rotated out. /// /// A builder for the *listServerCas* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -9421,11 +10145,11 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -9481,7 +10205,7 @@ impl<'a, C, A> InstanceListServerCaCall<'a, C, A> where C: BorrowMut InstanceListServerCaCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceListServerCaCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9660,7 +10388,8 @@ impl<'a, C, A> InstanceListServerCaCall<'a, C, A> where C: BorrowMut InstanceListServerCaCall<'a, C, A> where C: BorrowMut InstanceUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9904,13 +10633,17 @@ impl<'a, C, A> InstanceUpdateCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9956,11 +10689,11 @@ impl<'a, C, A> InstanceUpdateCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -10016,7 +10749,7 @@ impl<'a, C, A> InstanceRestartCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/restart"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/restart"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10156,13 +10889,17 @@ impl<'a, C, A> InstanceRestartCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceRestartCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10195,7 +10932,8 @@ impl<'a, C, A> InstanceRestartCall<'a, C, A> where C: BorrowMut, } -/// Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. +/// Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL +/// dump or CSV file. /// /// A builder for the *export* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -10208,12 +10946,12 @@ impl<'a, C, A> InstanceRestartCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::InstancesExportRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::InstancesExportRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -10275,7 +11013,7 @@ impl<'a, C, A> InstanceExportCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/export"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/export"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10439,13 +11177,17 @@ impl<'a, C, A> InstanceExportCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> InstanceExportCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10478,7 +11220,8 @@ impl<'a, C, A> InstanceExportCall<'a, C, A> where C: BorrowMut, A } -/// Restores a backup of a Cloud SQL instance. +/// Restores a backup of a Cloud SQL instance. Using this operation might cause +/// your instance to restart. /// /// A builder for the *restoreBackup* method supported by a *instance* resource. /// It is not used directly, but through a `InstanceMethods` instance. @@ -10491,12 +11234,12 @@ impl<'a, C, A> InstanceExportCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::InstancesRestoreBackupRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::InstancesRestoreBackupRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -10558,7 +11301,7 @@ impl<'a, C, A> InstanceRestoreBackupCall<'a, C, A> where C: BorrowMut InstanceRestoreBackupCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> InstanceRestoreBackupCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10774,11 +11521,11 @@ impl<'a, C, A> InstanceRestoreBackupCall<'a, C, A> where C: BorrowMut FlagListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "flags"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/flags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10914,7 +11661,8 @@ impl<'a, C, A> FlagListCall<'a, C, A> where C: BorrowMut, A: oaut } - /// Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions. + /// Database type and version you want to retrieve flags for. By default, this + /// method returns flags for all database types and versions. /// /// Sets the *database version* query property to the given value. pub fn database_version(mut self, new_value: &str) -> FlagListCall<'a, C, A> { @@ -10941,13 +11689,17 @@ impl<'a, C, A> FlagListCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> FlagListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10980,6 +11732,841 @@ impl<'a, C, A> FlagListCall<'a, C, A> where C: BorrowMut, A: oaut } +/// Verify External master external sync settings. +/// +/// A builder for the *instances.verifyExternalSyncSettings* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sql1_beta4::SQLAdmin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = SQLAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_verify_external_sync_settings("project", "instance") +/// .verify_connection_only(false) +/// .sync_mode("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SQLAdmin, + _project: String, + _instance: String, + _verify_connection_only: Option, + _sync_mode: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SqlInstancesVerifyExternalSyncSettingsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sql.projects.instances.verifyExternalSyncSettings", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._verify_connection_only { + params.push(("verifyConnectionOnly", value.to_string())); + } + if let Some(value) = self._sync_mode { + params.push(("syncMode", value.to_string())); + } + for &field in ["alt", "project", "instance", "verifyConnectionOnly", "syncMode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["instance", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID of the project that contains the instance. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Cloud SQL instance ID. This does not include the project ID. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// Flag to enable verifying connection only + /// + /// Sets the *verify connection only* query property to the given value. + pub fn verify_connection_only(mut self, new_value: bool) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> { + self._verify_connection_only = Some(new_value); + self + } + /// External sync mode + /// + /// Sets the *sync mode* query property to the given value. + pub fn sync_mode(mut self, new_value: &str) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> { + self._sync_mode = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Reschedules the maintenance on the given instance. +/// +/// A builder for the *instances.rescheduleMaintenance* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::SqlInstancesRescheduleMaintenanceRequestBody; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sql1_beta4::SQLAdmin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = SQLAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = SqlInstancesRescheduleMaintenanceRequestBody::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().instances_reschedule_maintenance(req, "project", "instance") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceRescheduleMaintenanceCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SQLAdmin, + _request: SqlInstancesRescheduleMaintenanceRequestBody, + _project: String, + _instance: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceRescheduleMaintenanceCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sql.projects.instances.rescheduleMaintenance", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("instance", self._instance.to_string())); + for &field in ["alt", "project", "instance"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["instance", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SqlInstancesRescheduleMaintenanceRequestBody) -> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> { + self._request = new_value; + self + } + /// ID of the project that contains the instance. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Cloud SQL instance ID. This does not include the project ID. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceRescheduleMaintenanceCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Start External master migration. +/// +/// A builder for the *instances.startExternalSync* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use sql1_beta4::SQLAdmin; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = SQLAdmin::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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().instances_start_external_sync("project", "instance") +/// .sync_mode("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectInstanceStartExternalSyncCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SQLAdmin, + _project: String, + _instance: String, + _sync_mode: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectInstanceStartExternalSyncCall<'a, C, A> {} + +impl<'a, C, A> ProjectInstanceStartExternalSyncCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "sql.projects.instances.startExternalSync", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("project", self._project.to_string())); + params.push(("instance", self._instance.to_string())); + if let Some(value) = self._sync_mode { + params.push(("syncMode", value.to_string())); + } + for &field in ["alt", "project", "instance", "syncMode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{project}", "project"), ("{instance}", "instance")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["instance", "project"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// ID of the project that contains the first generation instance. + /// + /// Sets the *project* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project(mut self, new_value: &str) -> ProjectInstanceStartExternalSyncCall<'a, C, A> { + self._project = new_value.to_string(); + self + } + /// Cloud SQL instance ID. This does not include the project ID. + /// + /// Sets the *instance* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn instance(mut self, new_value: &str) -> ProjectInstanceStartExternalSyncCall<'a, C, A> { + self._instance = new_value.to_string(); + self + } + /// External sync mode + /// + /// Sets the *sync mode* query property to the given value. + pub fn sync_mode(mut self, new_value: &str) -> ProjectInstanceStartExternalSyncCall<'a, C, A> { + self._sync_mode = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectInstanceStartExternalSyncCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectInstanceStartExternalSyncCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectInstanceStartExternalSyncCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a database from a Cloud SQL instance. /// /// A builder for the *delete* method supported by a *database* resource. @@ -10993,11 +12580,11 @@ impl<'a, C, A> FlagListCall<'a, C, A> where C: BorrowMut, A: oaut /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -11055,7 +12642,7 @@ impl<'a, C, A> DatabaseDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11205,13 +12792,17 @@ impl<'a, C, A> DatabaseDeleteCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> DatabaseDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11244,7 +12835,8 @@ impl<'a, C, A> DatabaseDeleteCall<'a, C, A> where C: BorrowMut, A } -/// Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics. +/// Partially updates a resource containing information about a database inside +/// a Cloud SQL instance. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *database* resource. /// It is not used directly, but through a `DatabaseMethods` instance. @@ -11257,12 +12849,12 @@ impl<'a, C, A> DatabaseDeleteCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::Database; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::Database; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -11326,7 +12918,7 @@ impl<'a, C, A> DatabasePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11500,13 +13092,17 @@ impl<'a, C, A> DatabasePatchCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> DatabasePatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11552,11 +13148,11 @@ impl<'a, C, A> DatabasePatchCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -11612,7 +13208,7 @@ impl<'a, C, A> DatabaseListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/databases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11752,13 +13348,17 @@ impl<'a, C, A> DatabaseListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> DatabaseListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11791,7 +13391,8 @@ impl<'a, C, A> DatabaseListCall<'a, C, A> where C: BorrowMut, A: } -/// Inserts a resource containing information about a database inside a Cloud SQL instance. +/// Inserts a resource containing information about a database inside a Cloud +/// SQL instance. /// /// A builder for the *insert* method supported by a *database* resource. /// It is not used directly, but through a `DatabaseMethods` instance. @@ -11804,12 +13405,12 @@ impl<'a, C, A> DatabaseListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::Database; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::Database; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -11871,7 +13472,7 @@ impl<'a, C, A> DatabaseInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/databases"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12035,13 +13636,17 @@ impl<'a, C, A> DatabaseInsertCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> DatabaseInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12074,7 +13679,8 @@ impl<'a, C, A> DatabaseInsertCall<'a, C, A> where C: BorrowMut, A } -/// Retrieves a resource containing information about a database inside a Cloud SQL instance. +/// Retrieves a resource containing information about a database inside a Cloud +/// SQL instance. /// /// A builder for the *get* method supported by a *database* resource. /// It is not used directly, but through a `DatabaseMethods` instance. @@ -12087,11 +13693,11 @@ impl<'a, C, A> DatabaseInsertCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -12149,7 +13755,7 @@ impl<'a, C, A> DatabaseGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12299,13 +13905,17 @@ impl<'a, C, A> DatabaseGetCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> DatabaseGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12338,7 +13948,8 @@ impl<'a, C, A> DatabaseGetCall<'a, C, A> where C: BorrowMut, A: o } -/// Updates a resource containing information about a database inside a Cloud SQL instance. +/// Updates a resource containing information about a database inside a Cloud +/// SQL instance. /// /// A builder for the *update* method supported by a *database* resource. /// It is not used directly, but through a `DatabaseMethods` instance. @@ -12351,12 +13962,12 @@ impl<'a, C, A> DatabaseGetCall<'a, C, A> where C: BorrowMut, A: o /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::Database; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::Database; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -12420,7 +14031,7 @@ impl<'a, C, A> DatabaseUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12594,13 +14205,17 @@ impl<'a, C, A> DatabaseUpdateCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> DatabaseUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12633,7 +14248,9 @@ impl<'a, C, A> DatabaseUpdateCall<'a, C, A> where C: BorrowMut, A } -/// Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted. +/// Creates an SSL certificate and returns it along with the private key and +/// server certificate authority. The new certificate will not be usable until +/// the instance is restarted. /// /// A builder for the *insert* method supported by a *sslCert* resource. /// It is not used directly, but through a `SslCertMethods` instance. @@ -12646,12 +14263,12 @@ impl<'a, C, A> DatabaseUpdateCall<'a, C, A> where C: BorrowMut, A /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::SslCertsInsertRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::SslCertsInsertRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -12713,7 +14330,7 @@ impl<'a, C, A> SslCertInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12877,13 +14494,17 @@ impl<'a, C, A> SslCertInsertCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> SslCertInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12916,7 +14537,8 @@ impl<'a, C, A> SslCertInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted. +/// Deletes the SSL certificate. For First Generation instances, the +/// certificate remains valid until the instance is restarted. /// /// A builder for the *delete* method supported by a *sslCert* resource. /// It is not used directly, but through a `SslCertMethods` instance. @@ -12929,11 +14551,11 @@ impl<'a, C, A> SslCertInsertCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -12991,7 +14613,7 @@ impl<'a, C, A> SslCertDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13141,13 +14763,17 @@ impl<'a, C, A> SslCertDeleteCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> SslCertDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13180,7 +14806,9 @@ impl<'a, C, A> SslCertDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation. +/// Retrieves a particular SSL certificate. Does not include the private key +/// (required for usage). The private key must be saved from the response to +/// initial creation. /// /// A builder for the *get* method supported by a *sslCert* resource. /// It is not used directly, but through a `SslCertMethods` instance. @@ -13193,11 +14821,11 @@ impl<'a, C, A> SslCertDeleteCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -13255,7 +14883,7 @@ impl<'a, C, A> SslCertGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13405,13 +15033,17 @@ impl<'a, C, A> SslCertGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> SslCertGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13444,7 +15076,10 @@ impl<'a, C, A> SslCertGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database. +/// Generates a short-lived X509 certificate containing the provided public key +/// and signed by a private key specific to the target instance. Users may use +/// the certificate to authenticate as themselves when connecting to the +/// database. /// /// A builder for the *createEphemeral* method supported by a *sslCert* resource. /// It is not used directly, but through a `SslCertMethods` instance. @@ -13457,12 +15092,12 @@ impl<'a, C, A> SslCertGetCall<'a, C, A> where C: BorrowMut, A: oa /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::SslCertsCreateEphemeralRequest; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::SslCertsCreateEphemeralRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -13524,7 +15159,7 @@ impl<'a, C, A> SslCertCreateEphemeralCall<'a, C, A> where C: BorrowMut SslCertCreateEphemeralCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> SslCertCreateEphemeralCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13740,11 +15379,11 @@ impl<'a, C, A> SslCertCreateEphemeralCall<'a, C, A> where C: BorrowMut SslCertListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13940,13 +15579,17 @@ impl<'a, C, A> SslCertListCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> SslCertListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13979,7 +15622,8 @@ impl<'a, C, A> SslCertListCall<'a, C, A> where C: BorrowMut, A: o } -/// Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time. +/// Lists all backup runs associated with a given instance and configuration in +/// the reverse chronological order of the backup initiation time. /// /// A builder for the *list* method supported by a *backupRun* resource. /// It is not used directly, but through a `BackupRunMethods` instance. @@ -13992,11 +15636,11 @@ impl<'a, C, A> SslCertListCall<'a, C, A> where C: BorrowMut, A: o /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -14007,8 +15651,8 @@ impl<'a, C, A> SslCertListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.backup_runs().list("project", "instance") -/// .page_token("consetetur") -/// .max_results(-85) +/// .page_token("labore") +/// .max_results(-54) /// .doit(); /// # } /// ``` @@ -14062,7 +15706,7 @@ impl<'a, C, A> BackupRunListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14182,7 +15826,8 @@ impl<'a, C, A> BackupRunListCall<'a, C, A> where C: BorrowMut, A: self._instance = new_value.to_string(); self } - /// A previously-returned page token representing part of the larger set of results to view. + /// A previously-returned page token representing part of the larger set of + /// results to view. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> BackupRunListCall<'a, C, A> { @@ -14216,13 +15861,17 @@ impl<'a, C, A> BackupRunListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> BackupRunListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14268,11 +15917,11 @@ impl<'a, C, A> BackupRunListCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -14330,7 +15979,7 @@ impl<'a, C, A> BackupRunGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns/{id}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14480,13 +16129,17 @@ impl<'a, C, A> BackupRunGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> BackupRunGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14532,11 +16185,11 @@ impl<'a, C, A> BackupRunGetCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// # extern crate google_sql1_beta4 as sql1_beta4; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -14594,7 +16247,7 @@ impl<'a, C, A> BackupRunDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns/{id}"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14714,7 +16367,9 @@ impl<'a, C, A> BackupRunDeleteCall<'a, C, A> where C: BorrowMut, self._instance = new_value.to_string(); self } - /// The ID of the Backup Run to delete. To find a Backup Run ID, use the list method. + /// The ID of the Backup Run to delete. To find a Backup Run ID, use the list + /// method. /// /// Sets the *id* path property to the given value. /// @@ -14744,13 +16399,17 @@ impl<'a, C, A> BackupRunDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> BackupRunDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14783,7 +16442,8 @@ impl<'a, C, A> BackupRunDeleteCall<'a, C, A> where C: BorrowMut, } -/// Creates a new backup run on demand. This method is applicable only to Second Generation instances. +/// Creates a new backup run on demand. This method is applicable only to +/// Second Generation instances. /// /// A builder for the *insert* method supported by a *backupRun* resource. /// It is not used directly, but through a `BackupRunMethods` instance. @@ -14796,12 +16456,12 @@ impl<'a, C, A> BackupRunDeleteCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper; /// # extern crate hyper_rustls; /// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; -/// use sqladmin1_beta4::BackupRun; +/// # extern crate google_sql1_beta4 as sql1_beta4; +/// use sql1_beta4::BackupRun; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use sqladmin1_beta4::SQLAdmin; +/// # use sql1_beta4::SQLAdmin; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, @@ -14863,7 +16523,7 @@ impl<'a, C, A> BackupRunInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns"; + let mut url = self.hub._base_url.clone() + "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns"; if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -15027,13 +16687,17 @@ impl<'a, C, A> BackupRunInsertCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> BackupRunInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); diff --git a/gen/storage1-cli/Cargo.toml b/gen/storage1-cli/Cargo.toml index b923661e5e..f02c8f0df7 100644 --- a/gen/storage1-cli/Cargo.toml +++ b/gen/storage1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-storage1-cli" -version = "1.0.12+20190624" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with storage (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storage1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-storage1] path = "../storage1" -version = "1.0.12+20190624" +version = "1.0.13+20200326" diff --git a/gen/storage1-cli/README.md b/gen/storage1-cli/README.md index ad3c371942..6122587d25 100644 --- a/gen/storage1-cli/README.md +++ b/gen/storage1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *storage* API at revision *20190624*. The CLI is at version *1.0.12*. +This documentation was generated from the *storage* API at revision *20200326*. The CLI is at version *1.0.13*. ```bash storage1 [options] diff --git a/gen/storage1-cli/mkdocs.yml b/gen/storage1-cli/mkdocs.yml index ba7c6d5ccd..3856dc009d 100644 --- a/gen/storage1-cli/mkdocs.yml +++ b/gen/storage1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storage v1.0.12+20190624 +site_name: storage v1.0.13+20200326 site_url: http://byron.github.io/google-apis-rs/google-storage1-cli site_description: A complete library to interact with storage (protocol v1) diff --git a/gen/storage1-cli/src/main.rs b/gen/storage1-cli/src/main.rs index 8eecac11e5..6115b54495 100644 --- a/gen/storage1-cli/src/main.rs +++ b/gen/storage1-cli/src/main.rs @@ -661,6 +661,9 @@ impl<'n> Engine<'n> { "provisional-user-project" => { call = call.provisional_user_project(value.unwrap_or("")); }, + "options-requested-policy-version" => { + call = call.options_requested_policy_version(arg_from_str(value.unwrap_or("-0"), err, "options-requested-policy-version", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -674,7 +677,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["user-project", "provisional-user-project"].iter().map(|v|*v)); + v.extend(["user-project", "provisional-user-project", "options-requested-policy-version"].iter().map(|v|*v)); v } )); } } @@ -731,7 +734,6 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -739,8 +741,10 @@ impl<'n> Engine<'n> { "default-event-based-hold" => Some(("defaultEventBasedHold", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "billing.requester-pays" => Some(("billing.requesterPays", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "encryption.default-kms-key-name" => Some(("encryption.defaultKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone-affinity" => Some(("zoneAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.not-found-page" => Some(("website.notFoundPage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.main-page-suffix" => Some(("website.mainPageSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -755,14 +759,15 @@ impl<'n> Engine<'n> { "retention-policy.effective-time" => Some(("retentionPolicy.effectiveTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "retention-policy.is-locked" => Some(("retentionPolicy.isLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "retention-policy.retention-period" => Some(("retentionPolicy.retentionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.uniform-bucket-level-access.enabled" => Some(("iamConfiguration.uniformBucketLevelAccess.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.uniform-bucket-level-access.locked-time" => Some(("iamConfiguration.uniformBucketLevelAccess.lockedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iam-configuration.bucket-policy-only.enabled" => Some(("iamConfiguration.bucketPolicyOnly.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.bucket-policy-only.locked-time" => Some(("iamConfiguration.bucketPolicyOnly.lockedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "zone-separation" => Some(("zoneSeparation", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "bucket-policy-only", "default-event-based-hold", "default-kms-key-name", "effective-time", "enabled", "encryption", "entity", "entity-id", "etag", "iam-configuration", "id", "is-locked", "kind", "labels", "location", "location-type", "locked-time", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "retention-period", "retention-policy", "self-link", "storage-class", "time-created", "uniform-bucket-level-access", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "bucket-policy-only", "default-event-based-hold", "default-kms-key-name", "effective-time", "enabled", "encryption", "entity", "entity-id", "etag", "iam-configuration", "id", "is-locked", "kind", "labels", "location", "location-type", "locked-time", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "retention-period", "retention-policy", "self-link", "storage-class", "time-created", "uniform-bucket-level-access", "updated", "versioning", "website", "zone-affinity", "zone-separation"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -991,7 +996,6 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -999,8 +1003,10 @@ impl<'n> Engine<'n> { "default-event-based-hold" => Some(("defaultEventBasedHold", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "billing.requester-pays" => Some(("billing.requesterPays", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "encryption.default-kms-key-name" => Some(("encryption.defaultKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone-affinity" => Some(("zoneAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.not-found-page" => Some(("website.notFoundPage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.main-page-suffix" => Some(("website.mainPageSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1015,14 +1021,15 @@ impl<'n> Engine<'n> { "retention-policy.effective-time" => Some(("retentionPolicy.effectiveTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "retention-policy.is-locked" => Some(("retentionPolicy.isLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "retention-policy.retention-period" => Some(("retentionPolicy.retentionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.uniform-bucket-level-access.enabled" => Some(("iamConfiguration.uniformBucketLevelAccess.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.uniform-bucket-level-access.locked-time" => Some(("iamConfiguration.uniformBucketLevelAccess.lockedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iam-configuration.bucket-policy-only.enabled" => Some(("iamConfiguration.bucketPolicyOnly.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.bucket-policy-only.locked-time" => Some(("iamConfiguration.bucketPolicyOnly.lockedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "zone-separation" => Some(("zoneSeparation", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "bucket-policy-only", "default-event-based-hold", "default-kms-key-name", "effective-time", "enabled", "encryption", "entity", "entity-id", "etag", "iam-configuration", "id", "is-locked", "kind", "labels", "location", "location-type", "locked-time", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "retention-period", "retention-policy", "self-link", "storage-class", "time-created", "uniform-bucket-level-access", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "bucket-policy-only", "default-event-based-hold", "default-kms-key-name", "effective-time", "enabled", "encryption", "entity", "entity-id", "etag", "iam-configuration", "id", "is-locked", "kind", "labels", "location", "location-type", "locked-time", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "retention-period", "retention-policy", "self-link", "storage-class", "time-created", "uniform-bucket-level-access", "updated", "versioning", "website", "zone-affinity", "zone-separation"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1130,8 +1137,9 @@ impl<'n> Engine<'n> { "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "kind", "resource-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "kind", "resource-id", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1280,7 +1288,6 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1288,8 +1295,10 @@ impl<'n> Engine<'n> { "default-event-based-hold" => Some(("defaultEventBasedHold", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "billing.requester-pays" => Some(("billing.requesterPays", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "encryption.default-kms-key-name" => Some(("encryption.defaultKmsKeyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "zone-affinity" => Some(("zoneAffinity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.not-found-page" => Some(("website.notFoundPage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.main-page-suffix" => Some(("website.mainPageSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1304,14 +1313,15 @@ impl<'n> Engine<'n> { "retention-policy.effective-time" => Some(("retentionPolicy.effectiveTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "retention-policy.is-locked" => Some(("retentionPolicy.isLocked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "retention-policy.retention-period" => Some(("retentionPolicy.retentionPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.uniform-bucket-level-access.enabled" => Some(("iamConfiguration.uniformBucketLevelAccess.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.uniform-bucket-level-access.locked-time" => Some(("iamConfiguration.uniformBucketLevelAccess.lockedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "iam-configuration.bucket-policy-only.enabled" => Some(("iamConfiguration.bucketPolicyOnly.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "iam-configuration.bucket-policy-only.locked-time" => Some(("iamConfiguration.bucketPolicyOnly.lockedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "zone-separation" => Some(("zoneSeparation", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "bucket-policy-only", "default-event-based-hold", "default-kms-key-name", "effective-time", "enabled", "encryption", "entity", "entity-id", "etag", "iam-configuration", "id", "is-locked", "kind", "labels", "location", "location-type", "locked-time", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "retention-period", "retention-policy", "self-link", "storage-class", "time-created", "uniform-bucket-level-access", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "bucket-policy-only", "default-event-based-hold", "default-kms-key-name", "effective-time", "enabled", "encryption", "entity", "entity-id", "etag", "iam-configuration", "id", "is-locked", "kind", "labels", "location", "location-type", "locked-time", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "retention-period", "retention-policy", "self-link", "storage-class", "time-created", "uniform-bucket-level-access", "updated", "versioning", "website", "zone-affinity", "zone-separation"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2985,6 +2995,9 @@ impl<'n> Engine<'n> { "destination-predefined-acl" => { call = call.destination_predefined_acl(value.unwrap_or("")); }, + "destination-kms-key-name" => { + call = call.destination_kms_key_name(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2998,7 +3011,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-source-generation-match", "projection", "if-source-metageneration-not-match", "if-metageneration-not-match", "user-project", "source-generation", "destination-predefined-acl", "if-source-generation-not-match", "if-source-metageneration-match", "if-generation-match", "provisional-user-project", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["if-source-generation-match", "projection", "if-source-metageneration-not-match", "destination-kms-key-name", "if-metageneration-not-match", "user-project", "source-generation", "destination-predefined-acl", "if-source-generation-not-match", "if-source-metageneration-match", "if-generation-match", "provisional-user-project", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); v } )); } } @@ -3412,6 +3425,9 @@ impl<'n> Engine<'n> { "user-project" => { call = call.user_project(value.unwrap_or("")); }, + "start-offset" => { + call = call.start_offset(value.unwrap_or("")); + }, "provisional-user-project" => { call = call.provisional_user_project(value.unwrap_or("")); }, @@ -3430,6 +3446,9 @@ impl<'n> Engine<'n> { "include-trailing-delimiter" => { call = call.include_trailing_delimiter(arg_from_str(value.unwrap_or("false"), err, "include-trailing-delimiter", "boolean")); }, + "end-offset" => { + call = call.end_offset(value.unwrap_or("")); + }, "delimiter" => { call = call.delimiter(value.unwrap_or("")); }, @@ -3446,7 +3465,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["projection", "versions", "user-project", "delimiter", "max-results", "page-token", "prefix", "include-trailing-delimiter", "provisional-user-project"].iter().map(|v|*v)); + v.extend(["projection", "versions", "user-project", "delimiter", "max-results", "end-offset", "page-token", "prefix", "include-trailing-delimiter", "start-offset", "provisional-user-project"].iter().map(|v|*v)); v } )); } } @@ -3815,8 +3834,9 @@ impl<'n> Engine<'n> { "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "kind", "resource-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "kind", "resource-id", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4146,6 +4166,9 @@ impl<'n> Engine<'n> { "user-project" => { call = call.user_project(value.unwrap_or("")); }, + "start-offset" => { + call = call.start_offset(value.unwrap_or("")); + }, "provisional-user-project" => { call = call.provisional_user_project(value.unwrap_or("")); }, @@ -4164,6 +4187,9 @@ impl<'n> Engine<'n> { "include-trailing-delimiter" => { call = call.include_trailing_delimiter(arg_from_str(value.unwrap_or("false"), err, "include-trailing-delimiter", "boolean")); }, + "end-offset" => { + call = call.end_offset(value.unwrap_or("")); + }, "delimiter" => { call = call.delimiter(value.unwrap_or("")); }, @@ -4180,7 +4206,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["projection", "versions", "user-project", "delimiter", "max-results", "page-token", "prefix", "include-trailing-delimiter", "provisional-user-project"].iter().map(|v|*v)); + v.extend(["projection", "versions", "user-project", "delimiter", "max-results", "end-offset", "page-token", "prefix", "include-trailing-delimiter", "start-offset", "provisional-user-project"].iter().map(|v|*v)); v } )); } } @@ -6421,7 +6447,7 @@ fn main() { let mut app = App::new("storage1") .author("Sebastian Thiel ") - .version("1.0.12+20190624") + .version("1.0.13+20200326") .about("Stores and retrieves potentially large, immutable data objects.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_storage1_cli") .arg(Arg::with_name("url") diff --git a/gen/storage1/Cargo.toml b/gen/storage1/Cargo.toml index 2637a113eb..86e564606d 100644 --- a/gen/storage1/Cargo.toml +++ b/gen/storage1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storage1" -version = "1.0.12+20190624" +version = "1.0.13+20200326" authors = ["Sebastian Thiel "] description = "A complete library to interact with storage (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storage1" homepage = "https://developers.google.com/storage/docs/json_api/" -documentation = "https://docs.rs/google-storage1/1.0.12+20190624" +documentation = "https://docs.rs/google-storage1/1.0.13+20200326" license = "MIT" keywords = ["storage", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/storage1/README.md b/gen/storage1/README.md index 7bf927418e..68d56ecb7a 100644 --- a/gen/storage1/README.md +++ b/gen/storage1/README.md @@ -5,44 +5,44 @@ DO NOT EDIT ! --> The `google-storage1` library allows access to all features of the *Google storage* service. -This documentation was generated from *storage* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *storage* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *storage* *v1* API can be found at the [official documentation site](https://developers.google.com/storage/docs/json_api/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.Storage.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.Storage.html) ... -* [bucket access controls](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketAccessControl.html) - * [*delete*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketAccessControlUpdateCall.html) -* [buckets](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.Bucket.html) - * [*delete*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketListCall.html), [*lock retention policy*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketLockRetentionPolicyCall.html), [*patch*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketPatchCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketTestIamPermissionCall.html) and [*update*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.BucketUpdateCall.html) -* [channels](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.Channel.html) - * [*stop*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ChannelStopCall.html) +* [bucket access controls](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketAccessControlUpdateCall.html) +* [buckets](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.Bucket.html) + * [*delete*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketListCall.html), [*lock retention policy*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketLockRetentionPolicyCall.html), [*patch*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketPatchCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketTestIamPermissionCall.html) and [*update*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.BucketUpdateCall.html) +* [channels](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.Channel.html) + * [*stop*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ChannelStopCall.html) * default object access controls - * [*delete*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.DefaultObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.DefaultObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.DefaultObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.DefaultObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.DefaultObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.DefaultObjectAccessControlUpdateCall.html) -* [notifications](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.Notification.html) - * [*delete*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.NotificationGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.NotificationInsertCall.html) and [*list*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.NotificationListCall.html) -* [object access controls](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectAccessControl.html) - * [*delete*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectAccessControlUpdateCall.html) -* [objects](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.Object.html) - * [*compose*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectComposeCall.html), [*copy*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectCopyCall.html), [*delete*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectPatchCall.html), [*rewrite*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectRewriteCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectTestIamPermissionCall.html), [*update*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectUpdateCall.html) and [*watch all*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectWatchAllCall.html) + * [*delete*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.DefaultObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.DefaultObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.DefaultObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.DefaultObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.DefaultObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.DefaultObjectAccessControlUpdateCall.html) +* [notifications](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.Notification.html) + * [*delete*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.NotificationGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.NotificationInsertCall.html) and [*list*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.NotificationListCall.html) +* [object access controls](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectAccessControlUpdateCall.html) +* [objects](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.Object.html) + * [*compose*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectComposeCall.html), [*copy*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectCopyCall.html), [*delete*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectPatchCall.html), [*rewrite*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectRewriteCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectTestIamPermissionCall.html), [*update*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectUpdateCall.html) and [*watch all*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectWatchAllCall.html) * projects - * [*hmac keys create*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ProjectHmacKeyCreateCall.html), [*hmac keys delete*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ProjectHmacKeyDeleteCall.html), [*hmac keys get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ProjectHmacKeyGetCall.html), [*hmac keys list*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ProjectHmacKeyListCall.html), [*hmac keys update*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ProjectHmacKeyUpdateCall.html) and [*service account get*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ProjectServiceAccountGetCall.html) + * [*hmac keys create*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ProjectHmacKeyCreateCall.html), [*hmac keys delete*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ProjectHmacKeyDeleteCall.html), [*hmac keys get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ProjectHmacKeyGetCall.html), [*hmac keys list*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ProjectHmacKeyListCall.html), [*hmac keys update*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ProjectHmacKeyUpdateCall.html) and [*service account get*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ProjectServiceAccountGetCall.html) Upload supported by ... -* [*insert objects*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectInsertCall.html) +* [*insert objects*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectInsertCall.html) Download supported by ... -* [*get objects*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectGetCall.html) +* [*get objects*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectGetCall.html) Subscription supported by ... -* [*watch all objects*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectWatchAllCall.html) -* [*list objects*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.ObjectListCall.html) +* [*watch all objects*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectWatchAllCall.html) +* [*list objects*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.ObjectListCall.html) @@ -50,17 +50,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/struct.Storage.html)** +* **[Hub](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/struct.Storage.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -185,17 +185,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -205,29 +205,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-storage1/1.0.12+20190624/google_storage1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storage1/1.0.13+20200326/google_storage1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/storage1/src/lib.rs b/gen/storage1/src/lib.rs index 5eb9d53ef1..44dedcd734 100644 --- a/gen/storage1/src/lib.rs +++ b/gen/storage1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *storage* crate version *1.0.12+20190624*, where *20190624* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *storage* crate version *1.0.13+20200326*, where *20200326* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *storage* *v1* API can be found at the //! [official documentation site](https://developers.google.com/storage/docs/json_api/). @@ -416,9 +416,9 @@ impl<'a, C, A> Storage Storage { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), - _base_url: "https://www.googleapis.com/storage/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), + _base_url: "https://storage.googleapis.com/storage/v1/".to_string(), + _root_url: "https://storage.googleapis.com/".to_string(), } } @@ -448,7 +448,7 @@ impl<'a, C, A> Storage } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -456,7 +456,7 @@ impl<'a, C, A> Storage } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/storage/v1/`. + /// It defaults to `https://storage.googleapis.com/storage/v1/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -464,7 +464,7 @@ impl<'a, C, A> Storage } /// Set the root url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/`. + /// It defaults to `https://storage.googleapis.com/`. /// /// Returns the previously set root url. pub fn root_url(&mut self, new_root_url: String) -> String { @@ -666,7 +666,7 @@ pub struct BucketLifecycleRuleCondition { /// Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects. #[serde(rename="isLive")] pub is_live: Option, - /// Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and DURABLE_REDUCED_AVAILABILITY. + /// Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY. #[serde(rename="matchesStorageClass")] pub matches_storage_class: Option>, /// Age of an object (in days). This condition is satisfied when an object reaches the specified age. @@ -784,6 +784,8 @@ pub struct Policy { pub etag: Option, /// The kind of item this is. For policies, this is always storage#policy. This field is ignored on input. pub kind: Option, + /// The IAM policy format version. + pub version: Option, } impl RequestValue for Policy {} @@ -1051,7 +1053,7 @@ pub struct BucketIamConfiguration { /// The bucket's uniform bucket-level access configuration. #[serde(rename="uniformBucketLevelAccess")] pub uniform_bucket_level_access: Option, - /// The bucket's Bucket Policy Only configuration. + /// The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature. #[serde(rename="bucketPolicyOnly")] pub bucket_policy_only: Option, } @@ -1180,6 +1182,9 @@ pub struct Bucket { pub billing: Option, /// Encryption configuration for a bucket. pub encryption: Option, + /// The zone or zones from which the bucket is intended to use zonal quota. Requests for data from outside the specified affinities are still allowed but won't be able to use zonal quota. The zone or zones need to be within the bucket location otherwise the requests will fail with a 400 Bad Request response. + #[serde(rename="zoneAffinity")] + pub zone_affinity: Option>, /// The bucket's lifecycle configuration. See lifecycle management for more information. pub lifecycle: Option, /// HTTP 1.1 Entity tag for the bucket. @@ -1189,9 +1194,12 @@ pub struct Bucket { /// The type of the bucket location. #[serde(rename="locationType")] pub location_type: Option, + /// If set, objects placed in this bucket are required to be separated by disaster domain. + #[serde(rename="zoneSeparation")] + pub zone_separation: Option, /// The bucket's versioning configuration. pub versioning: Option, - /// The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes. + /// The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes. #[serde(rename="storageClass")] pub storage_class: Option, } @@ -1201,7 +1209,7 @@ impl Resource for Bucket {} impl ResponseResult for Bucket {} -/// The bucket's Bucket Policy Only configuration. +/// The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -2297,12 +2305,14 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _bucket: bucket.to_string(), _versions: Default::default(), _user_project: Default::default(), + _start_offset: Default::default(), _provisional_user_project: Default::default(), _projection: Default::default(), _prefix: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _include_trailing_delimiter: Default::default(), + _end_offset: Default::default(), _delimiter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2482,12 +2492,14 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _bucket: bucket.to_string(), _versions: Default::default(), _user_project: Default::default(), + _start_offset: Default::default(), _provisional_user_project: Default::default(), _projection: Default::default(), _prefix: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _include_trailing_delimiter: Default::default(), + _end_offset: Default::default(), _delimiter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2551,6 +2563,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _if_generation_not_match: Default::default(), _if_generation_match: Default::default(), _destination_predefined_acl: Default::default(), + _destination_kms_key_name: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3012,6 +3025,7 @@ impl<'a, C, A> BucketMethods<'a, C, A> { _bucket: bucket.to_string(), _user_project: Default::default(), _provisional_user_project: Default::default(), + _options_requested_policy_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -8898,13 +8912,15 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau /// let result = hub.objects().watch_all(req, "bucket") /// .versions(false) /// .user_project("et") -/// .provisional_user_project("sed") -/// .projection("sit") -/// .prefix("takimata") -/// .page_token("elitr") -/// .max_results(10) +/// .start_offset("sed") +/// .provisional_user_project("sit") +/// .projection("takimata") +/// .prefix("elitr") +/// .page_token("nonumy") +/// .max_results(86) /// .include_trailing_delimiter(true) -/// .delimiter("Lorem") +/// .end_offset("Lorem") +/// .delimiter("diam") /// .doit(); /// # } /// ``` @@ -8916,12 +8932,14 @@ pub struct ObjectWatchAllCall<'a, C, A> _bucket: String, _versions: Option, _user_project: Option, + _start_offset: Option, _provisional_user_project: Option, _projection: Option, _prefix: Option, _page_token: Option, _max_results: Option, _include_trailing_delimiter: Option, + _end_offset: Option, _delimiter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -8944,7 +8962,7 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "storage.objects.watchAll", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(13 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(15 + self._additional_params.len()); params.push(("bucket", self._bucket.to_string())); if let Some(value) = self._versions { params.push(("versions", value.to_string())); @@ -8952,6 +8970,9 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A if let Some(value) = self._user_project { params.push(("userProject", value.to_string())); } + if let Some(value) = self._start_offset { + params.push(("startOffset", value.to_string())); + } if let Some(value) = self._provisional_user_project { params.push(("provisionalUserProject", value.to_string())); } @@ -8970,10 +8991,13 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A if let Some(value) = self._include_trailing_delimiter { params.push(("includeTrailingDelimiter", value.to_string())); } + if let Some(value) = self._end_offset { + params.push(("endOffset", value.to_string())); + } if let Some(value) = self._delimiter { params.push(("delimiter", value.to_string())); } - for &field in ["alt", "bucket", "versions", "userProject", "provisionalUserProject", "projection", "prefix", "pageToken", "maxResults", "includeTrailingDelimiter", "delimiter"].iter() { + for &field in ["alt", "bucket", "versions", "userProject", "startOffset", "provisionalUserProject", "projection", "prefix", "pageToken", "maxResults", "includeTrailingDelimiter", "endOffset", "delimiter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9133,6 +9157,13 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A self._user_project = Some(new_value.to_string()); self } + /// Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + /// + /// Sets the *start offset* query property to the given value. + pub fn start_offset(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._start_offset = Some(new_value.to_string()); + self + } /// The project to be billed for this request if the target bucket is requester-pays bucket. /// /// Sets the *provisional user project* query property to the given value. @@ -9175,6 +9206,13 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A self._include_trailing_delimiter = Some(new_value); self } + /// Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + /// + /// Sets the *end offset* query property to the given value. + pub fn end_offset(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._end_offset = Some(new_value.to_string()); + self + } /// Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. /// /// Sets the *delimiter* query property to the given value. @@ -9275,9 +9313,9 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().set_iam_policy(req, "bucket", "object") -/// .user_project("ut") -/// .provisional_user_project("ut") -/// .generation("amet.") +/// .user_project("amet.") +/// .provisional_user_project("ipsum") +/// .generation("ut") /// .doit(); /// # } /// ``` @@ -9588,9 +9626,9 @@ impl<'a, C, A> ObjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().insert(req, "bucket") -/// .user_project("dolore") -/// .provisional_user_project("vero") -/// .projection("dolor") -/// .predefined_acl("takimata") +/// .user_project("dolor") +/// .provisional_user_project("takimata") +/// .projection("et") +/// .predefined_acl("nonumy") /// .name("et") -/// .kms_key_name("nonumy") -/// .if_metageneration_not_match("et") -/// .if_metageneration_match("sed") -/// .if_generation_not_match("no") -/// .if_generation_match("invidunt") -/// .content_encoding("rebum.") +/// .kms_key_name("sed") +/// .if_metageneration_not_match("no") +/// .if_metageneration_match("invidunt") +/// .if_generation_not_match("rebum.") +/// .if_generation_match("labore") +/// .content_encoding("aliquyam") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -10786,12 +10824,12 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().compose(req, "destinationBucket", "destinationObject") -/// .user_project("elitr") -/// .provisional_user_project("consetetur") -/// .kms_key_name("sea") -/// .if_metageneration_match("elitr") -/// .if_generation_match("At") -/// .destination_predefined_acl("sea") +/// .user_project("sea") +/// .provisional_user_project("elitr") +/// .kms_key_name("At") +/// .if_metageneration_match("sea") +/// .if_generation_match("consetetur") +/// .destination_predefined_acl("diam") /// .doit(); /// # } /// ``` @@ -11135,13 +11173,13 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().delete("bucket", "object") -/// .user_project("accusam") -/// .provisional_user_project("dolores") -/// .if_metageneration_not_match("consetetur") -/// .if_metageneration_match("dolor") -/// .if_generation_not_match("aliquyam") -/// .if_generation_match("elitr") -/// .generation("ea") +/// .user_project("consetetur") +/// .provisional_user_project("dolor") +/// .if_metageneration_not_match("aliquyam") +/// .if_metageneration_match("elitr") +/// .if_generation_not_match("ea") +/// .if_generation_match("et") +/// .generation("Stet") /// .doit(); /// # } /// ``` @@ -11461,14 +11499,16 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().list("bucket") /// .versions(false) -/// .user_project("sed") -/// .provisional_user_project("dolor") -/// .projection("sanctus") -/// .prefix("dolore") -/// .page_token("Lorem") -/// .max_results(5) -/// .include_trailing_delimiter(true) -/// .delimiter("eirmod") +/// .user_project("sanctus") +/// .start_offset("dolore") +/// .provisional_user_project("Lorem") +/// .projection("consetetur") +/// .prefix("consetetur") +/// .page_token("eirmod") +/// .max_results(65) +/// .include_trailing_delimiter(false) +/// .end_offset("et") +/// .delimiter("sadipscing") /// .doit(); /// # } /// ``` @@ -11479,12 +11519,14 @@ pub struct ObjectListCall<'a, C, A> _bucket: String, _versions: Option, _user_project: Option, + _start_offset: Option, _provisional_user_project: Option, _projection: Option, _prefix: Option, _page_token: Option, _max_results: Option, _include_trailing_delimiter: Option, + _end_offset: Option, _delimiter: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, @@ -11507,7 +11549,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "storage.objects.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(12 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(14 + self._additional_params.len()); params.push(("bucket", self._bucket.to_string())); if let Some(value) = self._versions { params.push(("versions", value.to_string())); @@ -11515,6 +11557,9 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._user_project { params.push(("userProject", value.to_string())); } + if let Some(value) = self._start_offset { + params.push(("startOffset", value.to_string())); + } if let Some(value) = self._provisional_user_project { params.push(("provisionalUserProject", value.to_string())); } @@ -11533,10 +11578,13 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._include_trailing_delimiter { params.push(("includeTrailingDelimiter", value.to_string())); } + if let Some(value) = self._end_offset { + params.push(("endOffset", value.to_string())); + } if let Some(value) = self._delimiter { params.push(("delimiter", value.to_string())); } - for &field in ["alt", "bucket", "versions", "userProject", "provisionalUserProject", "projection", "prefix", "pageToken", "maxResults", "includeTrailingDelimiter", "delimiter"].iter() { + for &field in ["alt", "bucket", "versions", "userProject", "startOffset", "provisionalUserProject", "projection", "prefix", "pageToken", "maxResults", "includeTrailingDelimiter", "endOffset", "delimiter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11672,6 +11720,13 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa self._user_project = Some(new_value.to_string()); self } + /// Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + /// + /// Sets the *start offset* query property to the given value. + pub fn start_offset(mut self, new_value: &str) -> ObjectListCall<'a, C, A> { + self._start_offset = Some(new_value.to_string()); + self + } /// The project to be billed for this request if the target bucket is requester-pays bucket. /// /// Sets the *provisional user project* query property to the given value. @@ -11714,6 +11769,13 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa self._include_trailing_delimiter = Some(new_value); self } + /// Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + /// + /// Sets the *end offset* query property to the given value. + pub fn end_offset(mut self, new_value: &str) -> ObjectListCall<'a, C, A> { + self._end_offset = Some(new_value.to_string()); + self + } /// Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. /// /// Sets the *delimiter* query property to the given value. @@ -11808,9 +11870,9 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().test_iam_permissions("bucket", "object", "permissions") -/// .user_project("sadipscing") -/// .provisional_user_project("accusam") -/// .generation("magna") +/// .user_project("rebum.") +/// .provisional_user_project("et") +/// .generation("clita") /// .doit(); /// # } /// ``` @@ -12119,19 +12181,20 @@ impl<'a, C, A> ObjectTestIamPermissionCall<'a, C, A> where C: BorrowMut _if_generation_not_match: Option, _if_generation_match: Option, _destination_predefined_acl: Option, + _destination_kms_key_name: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -12178,7 +12242,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "storage.objects.copy", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(20 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(21 + self._additional_params.len()); params.push(("sourceBucket", self._source_bucket.to_string())); params.push(("sourceObject", self._source_object.to_string())); params.push(("destinationBucket", self._destination_bucket.to_string())); @@ -12222,7 +12286,10 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._destination_predefined_acl { params.push(("destinationPredefinedAcl", value.to_string())); } - for &field in ["alt", "sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "userProject", "sourceGeneration", "provisionalUserProject", "projection", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + if let Some(value) = self._destination_kms_key_name { + params.push(("destinationKmsKeyName", value.to_string())); + } + for &field in ["alt", "sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "userProject", "sourceGeneration", "provisionalUserProject", "projection", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl", "destinationKmsKeyName"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12489,6 +12556,13 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa self._destination_predefined_acl = Some(new_value.to_string()); self } + /// Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + /// + /// Sets the *destination kms key name* query property to the given value. + pub fn destination_kms_key_name(mut self, new_value: &str) -> ObjectCopyCall<'a, C, A> { + self._destination_kms_key_name = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -12582,15 +12656,15 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().patch(req, "bucket", "object") -/// .user_project("magna") -/// .provisional_user_project("ipsum") -/// .projection("invidunt") -/// .predefined_acl("accusam") -/// .if_metageneration_not_match("labore") -/// .if_metageneration_match("diam") -/// .if_generation_not_match("nonumy") -/// .if_generation_match("sed") -/// .generation("diam") +/// .user_project("diam") +/// .provisional_user_project("nonumy") +/// .projection("sed") +/// .predefined_acl("diam") +/// .if_metageneration_not_match("magna") +/// .if_metageneration_match("dolor") +/// .if_generation_not_match("Lorem") +/// .if_generation_match("dolor") +/// .generation("vero") /// .doit(); /// # } /// ``` @@ -12967,9 +13041,9 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.object_access_controls().get("bucket", "object", "entity") -/// .user_project("dolor") -/// .provisional_user_project("vero") -/// .generation("nonumy") +/// .user_project("consetetur") +/// .provisional_user_project("erat") +/// .generation("amet.") /// .doit(); /// # } /// ``` @@ -13273,9 +13347,9 @@ impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut ObjectAccessControlListCall<'a, C, A> where C: BorrowMut ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketPatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().update(req, "bucket") -/// .user_project("tempor") -/// .provisional_user_project("et") -/// .projection("erat") +/// .user_project("et") +/// .provisional_user_project("clita") +/// .projection("sed") /// .predefined_default_object_acl("dolores") -/// .predefined_acl("kasd") -/// .if_metageneration_not_match("et") -/// .if_metageneration_match("clita") +/// .predefined_acl("clita") +/// .if_metageneration_not_match("eos") +/// .if_metageneration_match("amet") /// .doit(); /// # } /// ``` @@ -15535,11 +15609,11 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().get("bucket") -/// .user_project("dolores") -/// .provisional_user_project("clita") -/// .projection("eos") -/// .if_metageneration_not_match("amet") -/// .if_metageneration_match("sed") +/// .user_project("takimata") +/// .provisional_user_project("sit") +/// .projection("labore") +/// .if_metageneration_not_match("nonumy") +/// .if_metageneration_match("erat") /// .doit(); /// # } /// ``` @@ -15835,10 +15909,10 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().delete("bucket") -/// .user_project("sit") -/// .provisional_user_project("labore") -/// .if_metageneration_not_match("nonumy") -/// .if_metageneration_match("erat") +/// .user_project("erat") +/// .provisional_user_project("et") +/// .if_metageneration_not_match("amet") +/// .if_metageneration_match("Lorem") /// .doit(); /// # } /// ``` @@ -16112,8 +16186,8 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().lock_retention_policy("bucket", "ifMetagenerationMatch") -/// .user_project("et") -/// .provisional_user_project("amet") +/// .user_project("justo") +/// .provisional_user_project("labore") /// .doit(); /// # } /// ``` @@ -16394,11 +16468,11 @@ impl<'a, C, A> BucketLockRetentionPolicyCall<'a, C, A> where C: BorrowMut BucketInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().test_iam_permissions("bucket", "permissions") -/// .user_project("takimata") -/// .provisional_user_project("voluptua.") +/// .user_project("et") +/// .provisional_user_project("sed") /// .doit(); /// # } /// ``` @@ -16985,8 +17059,8 @@ impl<'a, C, A> BucketTestIamPermissionCall<'a, C, A> where C: BorrowMut BucketSetIamPolicyCall<'a, C, A> where C: BorrowMut _bucket: String, _user_project: Option, _provisional_user_project: Option, + _options_requested_policy_version: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -17307,7 +17383,7 @@ impl<'a, C, A> BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(5 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len()); params.push(("bucket", self._bucket.to_string())); if let Some(value) = self._user_project { params.push(("userProject", value.to_string())); @@ -17315,7 +17391,10 @@ impl<'a, C, A> BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut BucketGetIamPolicyCall<'a, C, A> { + self._options_requested_policy_version = Some(new_value); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -17538,12 +17624,12 @@ impl<'a, C, A> BucketGetIamPolicyCall<'a, C, A> where C: BorrowMut BucketListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().hmac_keys_update(req, "projectId", "accessId") -/// .user_project("vero") +/// .user_project("sit") /// .doit(); /// # } /// ``` @@ -18124,7 +18210,7 @@ impl<'a, C, A> ProjectHmacKeyUpdateCall<'a, C, A> where C: BorrowMut ProjectHmacKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectHmacKeyGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().hmac_keys_list("projectId") -/// .user_project("dolores") -/// .show_deleted_keys(true) -/// .service_account_email("sanctus") -/// .page_token("takimata") -/// .max_results(89) +/// .user_project("sadipscing") +/// .show_deleted_keys(false) +/// .service_account_email("clita") +/// .page_token("ipsum") +/// .max_results(2) /// .doit(); /// # } /// ``` @@ -18941,7 +19027,7 @@ impl<'a, C, A> ProjectHmacKeyListCall<'a, C, A> where C: BorrowMut ProjectHmacKeyCreateCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with storagetransfer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storagetransfer1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-storagetransfer1] path = "../storagetransfer1" -version = "1.0.12+20190702" +version = "1.0.13+20200405" diff --git a/gen/storagetransfer1-cli/README.md b/gen/storagetransfer1-cli/README.md index 3452a58363..25279d8023 100644 --- a/gen/storagetransfer1-cli/README.md +++ b/gen/storagetransfer1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *storagetransfer* API at revision *20190702*. The CLI is at version *1.0.12*. +This documentation was generated from the *storagetransfer* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash storagetransfer1 [options] @@ -38,7 +38,6 @@ storagetransfer1 [options] patch (-r )... [-p ]... [-o ] transfer-operations cancel [-p ]... [-o ] - delete [-p ]... [-o ] get [-p ]... [-o ] list [-p ]... [-o ] pause (-r )... [-p ]... [-o ] diff --git a/gen/storagetransfer1-cli/mkdocs.yml b/gen/storagetransfer1-cli/mkdocs.yml index 814a2bde28..f5265d613e 100644 --- a/gen/storagetransfer1-cli/mkdocs.yml +++ b/gen/storagetransfer1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storagetransfer v1.0.12+20190702 +site_name: storagetransfer v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-storagetransfer1-cli site_description: A complete library to interact with storagetransfer (protocol v1) @@ -15,7 +15,6 @@ pages: - ['transfer-jobs_list.md', 'Transfer Jobs', 'List'] - ['transfer-jobs_patch.md', 'Transfer Jobs', 'Patch'] - ['transfer-operations_cancel.md', 'Transfer Operations', 'Cancel'] -- ['transfer-operations_delete.md', 'Transfer Operations', 'Delete'] - ['transfer-operations_get.md', 'Transfer Operations', 'Get'] - ['transfer-operations_list.md', 'Transfer Operations', 'List'] - ['transfer-operations_pause.md', 'Transfer Operations', 'Pause'] diff --git a/gen/storagetransfer1-cli/src/main.rs b/gen/storagetransfer1-cli/src/main.rs index 852d958580..c95e55dabb 100644 --- a/gen/storagetransfer1-cli/src/main.rs +++ b/gen/storagetransfer1-cli/src/main.rs @@ -124,8 +124,10 @@ impl<'n> Engine<'n> { "status" => Some(("status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-spec.object-conditions.max-time-elapsed-since-last-modification" => Some(("transferSpec.objectConditions.maxTimeElapsedSinceLastModification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-spec.object-conditions.include-prefixes" => Some(("transferSpec.objectConditions.includePrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "transfer-spec.object-conditions.exclude-prefixes" => Some(("transferSpec.objectConditions.excludePrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "transfer-spec.object-conditions.min-time-elapsed-since-last-modification" => Some(("transferSpec.objectConditions.minTimeElapsedSinceLastModification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-spec.object-conditions.last-modified-before" => Some(("transferSpec.objectConditions.lastModifiedBefore", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-spec.object-conditions.last-modified-since" => Some(("transferSpec.objectConditions.lastModifiedSince", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-spec.object-conditions.exclude-prefixes" => Some(("transferSpec.objectConditions.excludePrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "transfer-spec.gcs-data-source.bucket-name" => Some(("transferSpec.gcsDataSource.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-spec.http-data-source.list-url" => Some(("transferSpec.httpDataSource.listUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-spec.transfer-options.overwrite-objects-already-existing-in-sink" => Some(("transferSpec.transferOptions.overwriteObjectsAlreadyExistingInSink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -135,6 +137,9 @@ impl<'n> Engine<'n> { "transfer-spec.aws-s3-data-source.aws-access-key.secret-access-key" => Some(("transferSpec.awsS3DataSource.awsAccessKey.secretAccessKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-spec.aws-s3-data-source.aws-access-key.access-key-id" => Some(("transferSpec.awsS3DataSource.awsAccessKey.accessKeyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-spec.aws-s3-data-source.bucket-name" => Some(("transferSpec.awsS3DataSource.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-spec.azure-blob-storage-data-source.container" => Some(("transferSpec.azureBlobStorageDataSource.container", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-spec.azure-blob-storage-data-source.azure-credentials.sas-token" => Some(("transferSpec.azureBlobStorageDataSource.azureCredentials.sasToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-spec.azure-blob-storage-data-source.storage-account" => Some(("transferSpec.azureBlobStorageDataSource.storageAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "deletion-time" => Some(("deletionTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule.schedule-start-date.year" => Some(("schedule.scheduleStartDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "schedule.schedule-start-date.day" => Some(("schedule.scheduleStartDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -150,9 +155,12 @@ impl<'n> Engine<'n> { "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-modification-time" => Some(("lastModificationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification-config.event-types" => Some(("notificationConfig.eventTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "notification-config.payload-format" => Some(("notificationConfig.payloadFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification-config.pubsub-topic" => Some(("notificationConfig.pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["access-key-id", "aws-access-key", "aws-s3-data-source", "bucket-name", "creation-time", "day", "delete-objects-from-source-after-transfer", "delete-objects-unique-in-sink", "deletion-time", "description", "exclude-prefixes", "gcs-data-sink", "gcs-data-source", "hours", "http-data-source", "include-prefixes", "last-modification-time", "list-url", "max-time-elapsed-since-last-modification", "min-time-elapsed-since-last-modification", "minutes", "month", "name", "nanos", "object-conditions", "overwrite-objects-already-existing-in-sink", "project-id", "schedule", "schedule-end-date", "schedule-start-date", "seconds", "secret-access-key", "start-time-of-day", "status", "transfer-options", "transfer-spec", "year"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["access-key-id", "aws-access-key", "aws-s3-data-source", "azure-blob-storage-data-source", "azure-credentials", "bucket-name", "container", "creation-time", "day", "delete-objects-from-source-after-transfer", "delete-objects-unique-in-sink", "deletion-time", "description", "event-types", "exclude-prefixes", "gcs-data-sink", "gcs-data-source", "hours", "http-data-source", "include-prefixes", "last-modification-time", "last-modified-before", "last-modified-since", "list-url", "max-time-elapsed-since-last-modification", "min-time-elapsed-since-last-modification", "minutes", "month", "name", "nanos", "notification-config", "object-conditions", "overwrite-objects-already-existing-in-sink", "payload-format", "project-id", "pubsub-topic", "sas-token", "schedule", "schedule-end-date", "schedule-start-date", "seconds", "secret-access-key", "start-time-of-day", "status", "storage-account", "transfer-options", "transfer-spec", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -358,8 +366,10 @@ impl<'n> Engine<'n> { "transfer-job.status" => Some(("transferJob.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.transfer-spec.object-conditions.max-time-elapsed-since-last-modification" => Some(("transferJob.transferSpec.objectConditions.maxTimeElapsedSinceLastModification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.transfer-spec.object-conditions.include-prefixes" => Some(("transferJob.transferSpec.objectConditions.includePrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "transfer-job.transfer-spec.object-conditions.exclude-prefixes" => Some(("transferJob.transferSpec.objectConditions.excludePrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "transfer-job.transfer-spec.object-conditions.min-time-elapsed-since-last-modification" => Some(("transferJob.transferSpec.objectConditions.minTimeElapsedSinceLastModification", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.transfer-spec.object-conditions.last-modified-before" => Some(("transferJob.transferSpec.objectConditions.lastModifiedBefore", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.transfer-spec.object-conditions.last-modified-since" => Some(("transferJob.transferSpec.objectConditions.lastModifiedSince", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.transfer-spec.object-conditions.exclude-prefixes" => Some(("transferJob.transferSpec.objectConditions.excludePrefixes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "transfer-job.transfer-spec.gcs-data-source.bucket-name" => Some(("transferJob.transferSpec.gcsDataSource.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.transfer-spec.http-data-source.list-url" => Some(("transferJob.transferSpec.httpDataSource.listUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.transfer-spec.transfer-options.overwrite-objects-already-existing-in-sink" => Some(("transferJob.transferSpec.transferOptions.overwriteObjectsAlreadyExistingInSink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -369,6 +379,9 @@ impl<'n> Engine<'n> { "transfer-job.transfer-spec.aws-s3-data-source.aws-access-key.secret-access-key" => Some(("transferJob.transferSpec.awsS3DataSource.awsAccessKey.secretAccessKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.transfer-spec.aws-s3-data-source.aws-access-key.access-key-id" => Some(("transferJob.transferSpec.awsS3DataSource.awsAccessKey.accessKeyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.transfer-spec.aws-s3-data-source.bucket-name" => Some(("transferJob.transferSpec.awsS3DataSource.bucketName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.transfer-spec.azure-blob-storage-data-source.container" => Some(("transferJob.transferSpec.azureBlobStorageDataSource.container", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.transfer-spec.azure-blob-storage-data-source.azure-credentials.sas-token" => Some(("transferJob.transferSpec.azureBlobStorageDataSource.azureCredentials.sasToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.transfer-spec.azure-blob-storage-data-source.storage-account" => Some(("transferJob.transferSpec.azureBlobStorageDataSource.storageAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.deletion-time" => Some(("transferJob.deletionTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.schedule.schedule-start-date.year" => Some(("transferJob.schedule.scheduleStartDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.schedule-start-date.day" => Some(("transferJob.schedule.scheduleStartDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -384,9 +397,12 @@ impl<'n> Engine<'n> { "transfer-job.description" => Some(("transferJob.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.last-modification-time" => Some(("transferJob.lastModificationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.creation-time" => Some(("transferJob.creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.notification-config.event-types" => Some(("transferJob.notificationConfig.eventTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "transfer-job.notification-config.payload-format" => Some(("transferJob.notificationConfig.payloadFormat", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "transfer-job.notification-config.pubsub-topic" => Some(("transferJob.notificationConfig.pubsubTopic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "transfer-job.name" => Some(("transferJob.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["access-key-id", "aws-access-key", "aws-s3-data-source", "bucket-name", "creation-time", "day", "delete-objects-from-source-after-transfer", "delete-objects-unique-in-sink", "deletion-time", "description", "exclude-prefixes", "gcs-data-sink", "gcs-data-source", "hours", "http-data-source", "include-prefixes", "last-modification-time", "list-url", "max-time-elapsed-since-last-modification", "min-time-elapsed-since-last-modification", "minutes", "month", "name", "nanos", "object-conditions", "overwrite-objects-already-existing-in-sink", "project-id", "schedule", "schedule-end-date", "schedule-start-date", "seconds", "secret-access-key", "start-time-of-day", "status", "transfer-job", "transfer-options", "transfer-spec", "update-transfer-job-field-mask", "year"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["access-key-id", "aws-access-key", "aws-s3-data-source", "azure-blob-storage-data-source", "azure-credentials", "bucket-name", "container", "creation-time", "day", "delete-objects-from-source-after-transfer", "delete-objects-unique-in-sink", "deletion-time", "description", "event-types", "exclude-prefixes", "gcs-data-sink", "gcs-data-source", "hours", "http-data-source", "include-prefixes", "last-modification-time", "last-modified-before", "last-modified-since", "list-url", "max-time-elapsed-since-last-modification", "min-time-elapsed-since-last-modification", "minutes", "month", "name", "nanos", "notification-config", "object-conditions", "overwrite-objects-already-existing-in-sink", "payload-format", "project-id", "pubsub-topic", "sas-token", "schedule", "schedule-end-date", "schedule-start-date", "seconds", "secret-access-key", "start-time-of-day", "status", "storage-account", "transfer-job", "transfer-options", "transfer-spec", "update-transfer-job-field-mask", "year"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -498,58 +514,6 @@ impl<'n> Engine<'n> { } } - fn _transfer_operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.transfer_operations().delete(opt.value_of("name").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _transfer_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.transfer_operations().get(opt.value_of("name").unwrap_or("")); @@ -873,9 +837,6 @@ impl<'n> Engine<'n> { ("cancel", Some(opt)) => { call_result = self._transfer_operations_cancel(opt, dry_run, &mut err); }, - ("delete", Some(opt)) => { - call_result = self._transfer_operations_delete(opt, dry_run, &mut err); - }, ("get", Some(opt)) => { call_result = self._transfer_operations_get(opt, dry_run, &mut err); }, @@ -1075,8 +1036,14 @@ fn main() { ]), ("patch", Some(r##"Updates a transfer job. Updating a job's transfer spec does not affect - transfer operations that are running already. Updating the scheduling - of a job is not allowed."##), + transfer operations that are running already. Updating a job's schedule + is not allowed. + + **Note:** The job's status field can be modified + using this RPC (for example, to set a job's status to + DELETED, + DISABLED, or + ENABLED)."##), "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/transfer-jobs_patch", vec![ (Some(r##"job-name"##), @@ -1105,7 +1072,7 @@ fn main() { ]), ]), - ("transfer-operations", "methods: 'cancel', 'delete', 'get', 'list', 'pause' and 'resume'", vec![ + ("transfer-operations", "methods: 'cancel', 'get', 'list', 'pause' and 'resume'", vec![ ("cancel", Some(r##"Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation."##), "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/transfer-operations_cancel", @@ -1122,28 +1089,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("delete", - Some(r##"This method is not supported and the server returns `UNIMPLEMENTED`."##), - "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/transfer-operations_delete", - vec![ - (Some(r##"name"##), - None, - Some(r##"The name of the operation resource to be deleted."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1175,16 +1120,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists operations that match the specified filter in the request. If the - server doesn't support this method, it returns `UNIMPLEMENTED`. - - NOTE: the `name` binding allows API services to override the binding - to use different resource name schemes, such as `users/*/operations`. To - override the binding, API services can add a binding such as - `"/v1/{name=users/*}/operations"` to their service configuration. - For backwards compatibility, the default name includes the operations - collection id, however overriding users must ensure the name binding - is the parent resource, without the operations collection id."##), + Some(r##"Lists transfer operations."##), "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/transfer-operations_list", vec![ (Some(r##"name"##), @@ -1267,7 +1203,7 @@ fn main() { let mut app = App::new("storagetransfer1") .author("Sebastian Thiel ") - .version("1.0.12+20190702") + .version("1.0.13+20200405") .about("Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli") .arg(Arg::with_name("url") diff --git a/gen/storagetransfer1/Cargo.toml b/gen/storagetransfer1/Cargo.toml index ef5d239720..8013e1a504 100644 --- a/gen/storagetransfer1/Cargo.toml +++ b/gen/storagetransfer1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storagetransfer1" -version = "1.0.12+20190702" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with storagetransfer (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/storagetransfer1" homepage = "https://cloud.google.com/storage-transfer/docs" -documentation = "https://docs.rs/google-storagetransfer1/1.0.12+20190702" +documentation = "https://docs.rs/google-storagetransfer1/1.0.13+20200405" license = "MIT" keywords = ["storagetransfer", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/storagetransfer1/README.md b/gen/storagetransfer1/README.md index a86a0adf19..33881834ea 100644 --- a/gen/storagetransfer1/README.md +++ b/gen/storagetransfer1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-storagetransfer1` library allows access to all features of the *Google storagetransfer* service. -This documentation was generated from *storagetransfer* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *storagetransfer* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *storagetransfer* *v1* API can be found at the [official documentation site](https://cloud.google.com/storage-transfer/docs). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.Storagetransfer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.Storagetransfer.html) ... -* [google service accounts](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.GoogleServiceAccount.html) - * [*get*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.GoogleServiceAccountGetCall.html) -* [transfer jobs](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferJob.html) - * [*create*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferJobCreateCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferJobGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferJobListCall.html) and [*patch*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferJobPatchCall.html) -* [transfer operations](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferOperation.html) - * [*cancel*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferOperationCancelCall.html), [*delete*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferOperationDeleteCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferOperationGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferOperationListCall.html), [*pause*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferOperationPauseCall.html) and [*resume*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.TransferOperationResumeCall.html) +* [google service accounts](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.GoogleServiceAccount.html) + * [*get*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.GoogleServiceAccountGetCall.html) +* [transfer jobs](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferJob.html) + * [*create*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferJobCreateCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferJobGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferJobListCall.html) and [*patch*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferJobPatchCall.html) +* [transfer operations](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferOperation.html) + * [*cancel*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferOperationCancelCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferOperationGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferOperationListCall.html), [*pause*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferOperationPauseCall.html) and [*resume*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.TransferOperationResumeCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/struct.Storagetransfer.html)** +* **[Hub](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/struct.Storagetransfer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -51,12 +51,11 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.transfer_operations().pause(...).doit() -let r = hub.transfer_operations().resume(...).doit() -let r = hub.transfer_operations().delete(...).doit() -let r = hub.transfer_operations().get(...).doit() let r = hub.transfer_operations().list(...).doit() +let r = hub.transfer_operations().resume(...).doit() +let r = hub.transfer_operations().pause(...).doit() let r = hub.transfer_operations().cancel(...).doit() +let r = hub.transfer_operations().get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -136,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-storagetransfer1/1.0.12+20190702/google_storagetransfer1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storagetransfer1/1.0.13+20200405/google_storagetransfer1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/storagetransfer1/src/lib.rs b/gen/storagetransfer1/src/lib.rs index b82bffbd49..33754c04d4 100644 --- a/gen/storagetransfer1/src/lib.rs +++ b/gen/storagetransfer1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *storagetransfer* crate version *1.0.12+20190702*, where *20190702* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *storagetransfer* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *storagetransfer* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/storage-transfer/docs). @@ -16,7 +16,7 @@ //! * [transfer jobs](struct.TransferJob.html) //! * [*create*](struct.TransferJobCreateCall.html), [*get*](struct.TransferJobGetCall.html), [*list*](struct.TransferJobListCall.html) and [*patch*](struct.TransferJobPatchCall.html) //! * [transfer operations](struct.TransferOperation.html) -//! * [*cancel*](struct.TransferOperationCancelCall.html), [*delete*](struct.TransferOperationDeleteCall.html), [*get*](struct.TransferOperationGetCall.html), [*list*](struct.TransferOperationListCall.html), [*pause*](struct.TransferOperationPauseCall.html) and [*resume*](struct.TransferOperationResumeCall.html) +//! * [*cancel*](struct.TransferOperationCancelCall.html), [*get*](struct.TransferOperationGetCall.html), [*list*](struct.TransferOperationListCall.html), [*pause*](struct.TransferOperationPauseCall.html) and [*resume*](struct.TransferOperationResumeCall.html) //! //! //! @@ -51,12 +51,11 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.transfer_operations().pause(...).doit() -//! let r = hub.transfer_operations().resume(...).doit() -//! let r = hub.transfer_operations().delete(...).doit() -//! let r = hub.transfer_operations().get(...).doit() //! let r = hub.transfer_operations().list(...).doit() +//! let r = hub.transfer_operations().resume(...).doit() +//! let r = hub.transfer_operations().pause(...).doit() //! let r = hub.transfer_operations().cancel(...).doit() +//! let r = hub.transfer_operations().get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -332,7 +331,7 @@ impl<'a, C, A> Storagetransfer Storagetransfer { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://storagetransfer.googleapis.com/".to_string(), _root_url: "https://storagetransfer.googleapis.com/".to_string(), } @@ -349,7 +348,7 @@ impl<'a, C, A> Storagetransfer } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -401,25 +400,29 @@ pub struct TransferSpec { /// An HTTP URL data source. #[serde(rename="httpDataSource")] pub http_data_source: Option, - /// If the option `deleteObjectsUniqueInSink` is `true`, object conditions - /// based on objects' `lastModificationTime` are ignored and do not exclude - /// objects in a data source or a data sink. + /// If the option + /// delete_objects_unique_in_sink + /// is `true`, object conditions based on objects' "last modification time" are + /// ignored and do not exclude objects in a data source or a data sink. #[serde(rename="transferOptions")] pub transfer_options: Option, /// Only objects that satisfy these object conditions are included in the set /// of data source and data sink objects. Object conditions based on - /// objects' `lastModificationTime` do not exclude objects in a data sink. + /// objects' "last modification time" do not exclude objects in a data sink. #[serde(rename="objectConditions")] pub object_conditions: Option, - /// A Google Cloud Storage data source. + /// A Cloud Storage data source. #[serde(rename="gcsDataSource")] pub gcs_data_source: Option, - /// A Google Cloud Storage data sink. + /// A Cloud Storage data sink. #[serde(rename="gcsDataSink")] pub gcs_data_sink: Option, /// An AWS S3 data source. #[serde(rename="awsS3DataSource")] pub aws_s3_data_source: Option, + /// An Azure Blob Storage data source. + #[serde(rename="azureBlobStorageDataSource")] + pub azure_blob_storage_data_source: Option, } impl Part for TransferSpec {} @@ -427,7 +430,7 @@ impl Part for TransferSpec {} /// AWS access key (see /// [AWS Security -/// Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). +/// Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -446,35 +449,38 @@ impl Part for AwsAccessKey {} /// Conditions that determine which objects will be transferred. Applies only -/// to S3 and GCS objects. +/// to S3 and Cloud Storage objects. +/// +/// The "last modification time" refers to the time of the +/// last change to the object's content or metadata — specifically, this is +/// the `updated` property of Cloud Storage objects and the `LastModified` +/// field of S3 objects. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ObjectConditions { - /// If specified, only objects with a `lastModificationTime` on or after - /// `NOW` - `maxTimeElapsedSinceLastModification` and objects that don't have - /// a `lastModificationTime` are transferred. + /// If specified, only objects with a "last modification time" on or after + /// `NOW` - `max_time_elapsed_since_last_modification` and objects that don't + /// have a "last modification time" are transferred. /// - /// Note that, for each `TransferOperation` started by this `TransferJob`, - /// `NOW` refers to the `start_time` of the 'TransferOperation`. Also, - /// `lastModificationTime` refers to the time of the last change to the - /// object's content or metadata - specifically, this would be the `updated` - /// property of GCS objects and the `LastModified` field of S3 objects. + /// For each TransferOperation started by this TransferJob, + /// `NOW` refers to the start_time of the + /// `TransferOperation`. #[serde(rename="maxTimeElapsedSinceLastModification")] pub max_time_elapsed_since_last_modification: Option, - /// If `includePrefixes` is specified, objects that satisfy the object - /// conditions must have names that start with one of the `includePrefixes` - /// and that do not start with any of the `excludePrefixes`. If - /// `includePrefixes` is not specified, all objects except those that have - /// names starting with one of the `excludePrefixes` must satisfy the object + /// If `include_prefixes` is specified, objects that satisfy the object + /// conditions must have names that start with one of the `include_prefixes` + /// and that do not start with any of the exclude_prefixes. If + /// `include_prefixes` is not specified, all objects except those that have + /// names starting with one of the `exclude_prefixes` must satisfy the object /// conditions. /// /// Requirements: /// /// * Each include-prefix and exclude-prefix can contain any sequence of - /// Unicode characters, of max length 1024 bytes when UTF8-encoded, and - /// must not contain Carriage Return or Line Feed characters. Wildcard + /// Unicode characters, to a max length of 1024 bytes when UTF8-encoded, + /// and must not contain Carriage Return or Line Feed characters. Wildcard /// matching and regular expression matching are not supported. /// /// * Each include-prefix and exclude-prefix must omit the leading slash. @@ -486,36 +492,53 @@ pub struct ObjectConditions { /// if specified. /// /// * Each include-prefix must include a distinct portion of the object - /// namespace, i.e., no include-prefix may be a prefix of another + /// namespace. No include-prefix may be a prefix of another /// include-prefix. /// /// * Each exclude-prefix must exclude a distinct portion of the object - /// namespace, i.e., no exclude-prefix may be a prefix of another + /// namespace. No exclude-prefix may be a prefix of another /// exclude-prefix. /// - /// * If `includePrefixes` is specified, then each exclude-prefix must start - /// with the value of a path explicitly included by `includePrefixes`. + /// * If `include_prefixes` is specified, then each exclude-prefix must start + /// with the value of a path explicitly included by `include_prefixes`. /// - /// The max size of `includePrefixes` is 1000. + /// The max size of `include_prefixes` is 1000. #[serde(rename="includePrefixes")] pub include_prefixes: Option>, - /// `excludePrefixes` must follow the requirements described for - /// `includePrefixes`. + /// If specified, only objects with a "last modification time" before + /// `NOW` - `min_time_elapsed_since_last_modification` and objects that don't + /// have a "last modification time" are transferred. /// - /// The max size of `excludePrefixes` is 1000. - #[serde(rename="excludePrefixes")] - pub exclude_prefixes: Option>, - /// If specified, only objects with a `lastModificationTime` before - /// `NOW` - `minTimeElapsedSinceLastModification` and objects that don't have a - /// `lastModificationTime` are transferred. - /// - /// Note that, for each `TransferOperation` started by this `TransferJob`, - /// `NOW` refers to the `start_time` of the 'TransferOperation`. Also, - /// `lastModificationTime` refers to the time of the last change to the - /// object's content or metadata - specifically, this would be the `updated` - /// property of GCS objects and the `LastModified` field of S3 objects. + /// For each TransferOperation started by this TransferJob, `NOW` + /// refers to the start_time of the + /// `TransferOperation`. #[serde(rename="minTimeElapsedSinceLastModification")] pub min_time_elapsed_since_last_modification: Option, + /// If specified, only objects with a "last modification time" before this + /// timestamp and objects that don't have a "last modification time" will be + /// transferred. + #[serde(rename="lastModifiedBefore")] + pub last_modified_before: Option, + /// If specified, only objects with a "last modification time" on or after + /// this timestamp and objects that don't have a "last modification time" are + /// transferred. + /// + /// The `last_modified_since` and `last_modified_before` fields can be used + /// together for chunked data processing. For example, consider a script that + /// processes each day's worth of data at a time. For that you'd set each + /// of the fields as follows: + /// + /// * `last_modified_since` to the start of the day + /// + /// * `last_modified_before` to the end of the day + #[serde(rename="lastModifiedSince")] + pub last_modified_since: Option, + /// `exclude_prefixes` must follow the requirements described for + /// include_prefixes. + /// + /// The max size of `exclude_prefixes` is 1000. + #[serde(rename="excludePrefixes")] + pub exclude_prefixes: Option>, } impl Part for ObjectConditions {} @@ -595,12 +618,11 @@ impl Part for TransferCounters {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [pause transfer operations](struct.TransferOperationPauseCall.html) (none) -/// * [resume transfer operations](struct.TransferOperationResumeCall.html) (none) -/// * [delete transfer operations](struct.TransferOperationDeleteCall.html) (none) -/// * [get transfer operations](struct.TransferOperationGetCall.html) (none) /// * [list transfer operations](struct.TransferOperationListCall.html) (none) +/// * [resume transfer operations](struct.TransferOperationResumeCall.html) (none) +/// * [pause transfer operations](struct.TransferOperationPauseCall.html) (none) /// * [cancel transfer operations](struct.TransferOperationCancelCall.html) (none) +/// * [get transfer operations](struct.TransferOperationGetCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferOperation { @@ -617,6 +639,9 @@ pub struct TransferOperation { /// The ID of the Google Cloud Platform Project that owns the operation. #[serde(rename="projectId")] pub project_id: Option, + /// Notification configuration. + #[serde(rename="notificationConfig")] + pub notification_config: Option, /// Summarizes errors encountered with sample error log entries. #[serde(rename="errorBreakdowns")] pub error_breakdowns: Option>, @@ -647,7 +672,7 @@ pub struct AwsS3Data { pub aws_access_key: Option, /// Required. S3 Bucket name (see /// [Creating a - /// bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). + /// bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). #[serde(rename="bucketName")] pub bucket_name: Option, } @@ -672,15 +697,16 @@ pub struct ErrorLogEntry { impl Part for ErrorLogEntry {} -/// In a GcsData resource, an object's name is the Google Cloud Storage object's -/// name and its `lastModificationTime` refers to the object's updated time, -/// which changes when the content or the metadata of the object is updated. +/// In a GcsData resource, an object's name is the Cloud Storage object's +/// name and its "last modification time" refers to the object's `updated` +/// property of Cloud Storage objects, which changes when the content or the +/// metadata of the object is updated. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GcsData { - /// Required. Google Cloud Storage bucket name (see + /// Required. Cloud Storage bucket name (see /// [Bucket Name /// Requirements](https://cloud.google.com/storage/docs/naming#requirements)). #[serde(rename="bucketName")] @@ -690,22 +716,39 @@ pub struct GcsData { impl Part for GcsData {} +/// Azure credentials +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AzureCredentials { + /// Required. Azure shared access signature. (see + /// [Grant limited access to Azure Storage resources using shared access + /// signatures + /// (SAS)](https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview)). + #[serde(rename="sasToken")] + pub sas_token: Option, +} + +impl Part for AzureCredentials {} + + /// An HttpData resource specifies a list of objects on the web to be transferred /// over HTTP. The information of the objects to be transferred is contained in /// a file referenced by a URL. The first line in the file must be -/// "TsvHttpData-1.0", which specifies the format of the file. Subsequent lines -/// specify the information of the list of objects, one object per list entry. -/// Each entry has the following tab-delimited fields: +/// `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent +/// lines specify the information of the list of objects, one object per list +/// entry. Each entry has the following tab-delimited fields: /// -/// * HTTP URL - The location of the object. +/// * **HTTP URL** — The location of the object. /// -/// * Length - The size of the object in bytes. +/// * **Length** — The size of the object in bytes. /// -/// * MD5 - The base64-encoded MD5 hash of the object. +/// * **MD5** — The base64-encoded MD5 hash of the object. /// /// For an example of a valid TSV file, see /// [Transferring data from -/// URLs](https://cloud.google.com/storage/transfer/create-url-list). +/// URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). /// /// When transferring data based on a URL list, keep the following in mind: /// @@ -718,10 +761,11 @@ impl Part for GcsData {} /// /// * If the specified MD5 does not match the MD5 computed from the transferred /// bytes, the object transfer will fail. For more information, see -/// [Generating MD5 hashes](https://cloud.google.com/storage/transfer/#md5) +/// [Generating MD5 +/// hashes](https://cloud.google.com/storage-transfer/docs/create-url-list#md5) /// /// * Ensure that each URL you specify is publicly accessible. For -/// example, in Google Cloud Storage you can +/// example, in Cloud Storage you can /// [share an object publicly] /// (https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get /// a link to it. @@ -730,8 +774,7 @@ impl Part for GcsData {} /// HTTP server to support `Range` requests and to return a `Content-Length` /// header in each response. /// -/// * [ObjectConditions](#ObjectConditions) have no effect when filtering objects -/// to transfer. +/// * ObjectConditions have no effect when filtering objects to transfer. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -789,7 +832,6 @@ impl Part for TimeOfDay {} /// /// * [pause transfer operations](struct.TransferOperationPauseCall.html) (response) /// * [cancel transfer operations](struct.TransferOperationCancelCall.html) (response) -/// * [delete transfer operations](struct.TransferOperationDeleteCall.html) (response) /// * [resume transfer operations](struct.TransferOperationResumeCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -870,23 +912,44 @@ impl ResponseResult for ListOperationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Schedule { - /// Required. The first day the recurring transfer is scheduled to run. If - /// `scheduleStartDate` is in the past, the transfer will run for the first - /// time on the following day. + /// Required. The start date of a transfer. Date boundaries are determined + /// relative to UTC time. If `schedule_start_date` and start_time_of_day + /// are in the past relative to the job's creation time, the transfer starts + /// the day after you schedule the transfer request. + /// + /// **Note:** When starting jobs at or near midnight UTC it is possible that + /// a job will start later than expected. For example, if you send an outbound + /// request on June 1 one millisecond prior to midnight UTC and the Storage + /// Transfer Service server receives the request on June 2, then it will create + /// a TransferJob with `schedule_start_date` set to June 2 and a + /// `start_time_of_day` set to midnight UTC. The first scheduled + /// TransferOperation will take place on June 3 at midnight UTC. #[serde(rename="scheduleStartDate")] pub schedule_start_date: Option, - /// The time in UTC at which the transfer will be scheduled to start in a day. - /// Transfers may start later than this time. If not specified, recurring and - /// one-time transfers that are scheduled to run today will run immediately; - /// recurring transfers that are scheduled to run on a future date will start - /// at approximately midnight UTC on that date. Note that when configuring a - /// transfer with the Cloud Platform Console, the transfer's start time in a - /// day is specified in your local timezone. + /// The time in UTC that a transfer job is scheduled to run. Transfers may + /// start later than this time. + /// + /// If `start_time_of_day` is not specified: + /// + /// * One-time transfers run immediately. + /// * Recurring transfers run immediately, and each day at midnight UTC, + /// through schedule_end_date. + /// + /// If `start_time_of_day` is specified: + /// + /// * One-time transfers run at the specified time. + /// * Recurring transfers run at the specified time each day, through + /// `schedule_end_date`. #[serde(rename="startTimeOfDay")] pub start_time_of_day: Option, - /// The last day the recurring transfer will be run. If `scheduleEndDate` - /// is the same as `scheduleStartDate`, the transfer will be executed only - /// once. + /// The last day a transfer runs. Date boundaries are determined relative to + /// UTC time. A job will run once per 24 hours within the following guidelines: + /// + /// * If `schedule_end_date` and schedule_start_date are the same and in + /// the future relative to UTC, the transfer is executed only one time. + /// * If `schedule_end_date` is later than `schedule_start_date` and + /// `schedule_end_date` is in the future relative to UTC, the job will + /// run each day at start_time_of_day through `schedule_end_date`. #[serde(rename="scheduleEndDate")] pub schedule_end_date: Option, } @@ -906,8 +969,8 @@ pub struct ErrorSummary { pub error_code: Option, /// Error samples. /// - /// No more than 100 error log entries may be recorded for a given - /// error code for a single task. + /// At most 5 error log entries will be recorded for a given + /// error code for a single transfer operation. #[serde(rename="errorLogEntries")] pub error_log_entries: Option>, /// Required. Count of this type of error. @@ -933,6 +996,45 @@ pub struct ResumeTransferOperationRequest { _never_set: Option } impl RequestValue for ResumeTransferOperationRequest {} +/// Specification to configure notifications published to Cloud Pub/Sub. +/// Notifications will be published to the customer-provided topic using the +/// following `PubsubMessage.attributes`: +/// +/// * `"eventType"`: one of the EventType values +/// * `"payloadFormat"`: one of the PayloadFormat values +/// * `"projectId"`: the project_id of the +/// `TransferOperation` +/// * `"transferJobName"`: the +/// transfer_job_name of the +/// `TransferOperation` +/// * `"transferOperationName"`: the name of the +/// `TransferOperation` +/// +/// The `PubsubMessage.data` will contain a TransferOperation resource +/// formatted according to the specified `PayloadFormat`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NotificationConfig { + /// Event types for which a notification is desired. If empty, send + /// notifications for all event types. + #[serde(rename="eventTypes")] + pub event_types: Option>, + /// Required. The desired format of the notification message payloads. + #[serde(rename="payloadFormat")] + pub payload_format: Option, + /// Required. The `Topic.name` of the Cloud Pub/Sub topic to which to publish + /// notifications. Must be of the format: `projects/{project}/topics/{topic}`. + /// Not matching this format will result in an + /// INVALID_ARGUMENT error. + #[serde(rename="pubsubTopic")] + pub pubsub_topic: Option, +} + +impl Part for NotificationConfig {} + + /// Request passed to UpdateTransferJob. /// /// # Activities @@ -950,16 +1052,22 @@ pub struct UpdateTransferJobRequest { pub project_id: Option, /// The field mask of the fields in `transferJob` that are to be updated in /// this request. Fields in `transferJob` that can be updated are: - /// `description`, `transferSpec`, and `status`. To update the `transferSpec` - /// of the job, a complete transfer specification has to be provided. An - /// incomplete specification which misses any required fields will be rejected - /// with the error `INVALID_ARGUMENT`. + /// description, + /// transfer_spec, + /// notification_config, and + /// status. To update the `transfer_spec` of the job, a + /// complete transfer specification must be provided. An incomplete + /// specification missing any required fields will be rejected with the error + /// INVALID_ARGUMENT. #[serde(rename="updateTransferJobFieldMask")] pub update_transfer_job_field_mask: Option, /// Required. The job to update. `transferJob` is expected to specify only - /// three fields: `description`, `transferSpec`, and `status`. An - /// UpdateTransferJobRequest that specifies other fields will be rejected with - /// an error `INVALID_ARGUMENT`. + /// four fields: description, + /// transfer_spec, + /// notification_config, and + /// status. An `UpdateTransferJobRequest` that specifies + /// other fields will be rejected with the error + /// INVALID_ARGUMENT. #[serde(rename="transferJob")] pub transfer_job: Option, } @@ -1000,13 +1108,16 @@ pub struct TransferOptions { #[serde(rename="overwriteObjectsAlreadyExistingInSink")] pub overwrite_objects_already_existing_in_sink: Option, /// Whether objects should be deleted from the source after they are - /// transferred to the sink. Note that this option and - /// `deleteObjectsUniqueInSink` are mutually exclusive. + /// transferred to the sink. + /// + /// **Note:** This option and delete_objects_unique_in_sink are mutually + /// exclusive. #[serde(rename="deleteObjectsFromSourceAfterTransfer")] pub delete_objects_from_source_after_transfer: Option, - /// Whether objects that exist only in the sink should be deleted. Note that - /// this option and `deleteObjectsFromSourceAfterTransfer` are mutually - /// exclusive. + /// Whether objects that exist only in the sink should be deleted. + /// + /// **Note:** This option and delete_objects_from_source_after_transfer are + /// mutually exclusive. #[serde(rename="deleteObjectsUniqueInSink")] pub delete_objects_unique_in_sink: Option, } @@ -1032,10 +1143,11 @@ pub struct TransferJob { /// Status of the job. This value MUST be specified for /// `CreateTransferJobRequests`. /// - /// NOTE: The effect of the new job status takes place during a subsequent job - /// run. For example, if you change the job status from `ENABLED` to - /// `DISABLED`, and an operation spawned by the transfer is running, the status - /// change would not affect the current operation. + /// **Note:** The effect of the new job status takes place during a subsequent + /// job run. For example, if you change the job status from + /// ENABLED to DISABLED, and an operation + /// spawned by the transfer is running, the status change would not affect the + /// current operation. pub status: Option, /// Transfer specification. #[serde(rename="transferSpec")] @@ -1054,10 +1166,23 @@ pub struct TransferJob { /// Output only. The time that the transfer job was created. #[serde(rename="creationTime")] pub creation_time: Option, - /// A globally unique name assigned by Storage Transfer Service when the - /// job is created. This field should be left empty in requests to create a new - /// transfer job; otherwise, the requests result in an `INVALID_ARGUMENT` - /// error. + /// Notification configuration. + #[serde(rename="notificationConfig")] + pub notification_config: Option, + /// A unique name (within the transfer project) assigned when the job is + /// created. If this field is empty in a CreateTransferJobRequest, Storage + /// Transfer Service will assign a unique name. Otherwise, the specified name + /// is used as the unique name for this job. + /// + /// If the specified name is in use by a job, the creation request fails with + /// an ALREADY_EXISTS error. + /// + /// This name must start with `"transferJobs/"` prefix and end with a letter or + /// a number, and should be no more than 128 characters. + /// Example: `"transferJobs/[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + /// + /// Invalid job names will fail with an + /// INVALID_ARGUMENT error. pub name: Option, /// A description provided by the user for the job. Its max length is 1024 /// bytes when Unicode-encoded. @@ -1135,6 +1260,31 @@ pub struct Operation { impl ResponseResult for Operation {} +/// An AzureBlobStorageData resource can be a data source, but not a data sink. +/// An AzureBlobStorageData resource represents one Azure container. The storage +/// account determines the [Azure +/// endpoint](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints). +/// In an AzureBlobStorageData resource, a blobs's name is the [Azure Blob +/// Storage blob's key +/// name](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AzureBlobStorageData { + /// Required. The container to transfer from the Azure Storage account. + pub container: Option, + /// Required. Credentials used to authenticate API requests to Azure. + #[serde(rename="azureCredentials")] + pub azure_credentials: Option, + /// Required. The name of the Azure Storage account. + #[serde(rename="storageAccount")] + pub storage_account: Option, +} + +impl Part for AzureBlobStorageData {} + + // ################### // MethodBuilders ### @@ -1164,7 +1314,7 @@ impl ResponseResult for Operation {} /// ::default(), None); /// let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `cancel(...)`, `delete(...)`, `get(...)`, `list(...)`, `pause(...)` and `resume(...)` +/// // like `cancel(...)`, `get(...)`, `list(...)`, `pause(...)` and `resume(...)` /// // to build up your call. /// let rb = hub.transfer_operations(); /// # } @@ -1217,23 +1367,6 @@ impl<'a, C, A> TransferOperationMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// This method is not supported and the server returns `UNIMPLEMENTED`. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource to be deleted. - pub fn delete(&self, name: &str) -> TransferOperationDeleteCall<'a, C, A> { - TransferOperationDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Gets the latest state of a long-running operation. Clients can use this @@ -1255,16 +1388,7 @@ impl<'a, C, A> TransferOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists operations that match the specified filter in the request. If the - /// server doesn't support this method, it returns `UNIMPLEMENTED`. - /// - /// NOTE: the `name` binding allows API services to override the binding - /// to use different resource name schemes, such as `users/*/operations`. To - /// override the binding, API services can add a binding such as - /// `"/v1/{name=users/*}/operations"` to their service configuration. - /// For backwards compatibility, the default name includes the operations - /// collection id, however overriding users must ensure the name binding - /// is the parent resource, without the operations collection id. + /// Lists transfer operations. /// /// # Arguments /// @@ -1426,8 +1550,14 @@ impl<'a, C, A> TransferJobMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Updates a transfer job. Updating a job's transfer spec does not affect - /// transfer operations that are running already. Updating the scheduling - /// of a job is not allowed. + /// transfer operations that are running already. Updating a job's schedule + /// is not allowed. + /// + /// **Note:** The job's status field can be modified + /// using this RPC (for example, to set a job's status to + /// DELETED, + /// DISABLED, or + /// ENABLED). /// /// # Arguments /// @@ -1444,6 +1574,23 @@ impl<'a, C, A> TransferJobMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a transfer job that runs periodically. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: TransferJob) -> TransferJobCreateCall<'a, C, A> { + TransferJobCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets a transfer job. @@ -1461,23 +1608,6 @@ impl<'a, C, A> TransferJobMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Creates a transfer job that runs periodically. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn create(&self, request: TransferJob) -> TransferJobCreateCall<'a, C, A> { - TransferJobCreateCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -2046,254 +2176,6 @@ impl<'a, C, A> TransferOperationResumeCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.transfer_operations().delete("name") -/// .doit(); -/// # } -/// ``` -pub struct TransferOperationDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storagetransfer, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TransferOperationDeleteCall<'a, C, A> {} - -impl<'a, C, A> TransferOperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "storagetransfer.transferOperations.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation resource to be deleted. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> TransferOperationDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TransferOperationDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> TransferOperationDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TransferOperationDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Gets the latest state of a long-running operation. Clients can use this /// method to poll the operation result at intervals as recommended by the API /// service. @@ -2544,16 +2426,7 @@ impl<'a, C, A> TransferOperationGetCall<'a, C, A> where C: BorrowMut TransferOperationGetCall<'a, C, A> where C: BorrowMut TransferOperationListCall<'a, C, A> where C: BorrowMut_id":"my_project_id", /// "job_names":["jobid1","jobid2",...], /// "operation_names":["opid1","opid2",...], /// "transfer_statuses":["status1","status2",...]}. - /// Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `project_id` is required. `job_names`, `operation_names`, and `transfer_statuses` are optional. The valid values for `transfer_statuses` are case-insensitive: `IN_PROGRESS`, `PAUSED`, `SUCCESS`, `FAILED`, and `ABORTED`. + /// Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `project``_``id` is required. `job_names`, `operation_names`, and `transfer_statuses` are optional. The valid values for `transfer_statuses` are case-insensitive: IN_PROGRESS, PAUSED, SUCCESS, FAILED, and ABORTED. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TransferOperationListCall<'a, C, A> { @@ -3370,7 +3243,7 @@ impl<'a, C, A> GoogleServiceAccountGetCall<'a, C, A> where C: BorrowMut TransferJobListCall<'a, C, A> where C: BorrowMut, self } /// Required. A list of query parameters specified as JSON text in the form of: - /// {"project_id":"my_project_id", + /// {"project_id":"my_project_id", /// "job_names":["jobid1","jobid2",...], /// "job_statuses":["status1","status2",...]}. /// Since `job_names` and `job_statuses` support multiple values, their values - /// must be specified with array notation. `project_id` is required. - /// `job_names` and `job_statuses` are optional. The valid values for - /// `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`. + /// must be specified with array notation. `project``_``id` is + /// required. `job_names` and `job_statuses` are optional. The valid values + /// for `job_statuses` are case-insensitive: + /// ENABLED, + /// DISABLED, and + /// DELETED. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TransferJobListCall<'a, C, A> { @@ -3596,8 +3472,14 @@ impl<'a, C, A> TransferJobListCall<'a, C, A> where C: BorrowMut, /// Updates a transfer job. Updating a job's transfer spec does not affect -/// transfer operations that are running already. Updating the scheduling -/// of a job is not allowed. +/// transfer operations that are running already. Updating a job's schedule +/// is not allowed. +/// +/// **Note:** The job's status field can be modified +/// using this RPC (for example, to set a job's status to +/// DELETED, +/// DISABLED, or +/// ENABLED). /// /// A builder for the *patch* method supported by a *transferJob* resource. /// It is not used directly, but through a `TransferJobMethods` instance. @@ -3876,267 +3758,6 @@ impl<'a, C, A> TransferJobPatchCall<'a, C, A> where C: BorrowMut, } -/// Gets a transfer job. -/// -/// A builder for the *get* method supported by a *transferJob* resource. -/// It is not used directly, but through a `TransferJobMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_storagetransfer1 as storagetransfer1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use storagetransfer1::Storagetransfer; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.transfer_jobs().get("jobName") -/// .project_id("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct TransferJobGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storagetransfer, - _job_name: String, - _project_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TransferJobGetCall<'a, C, A> {} - -impl<'a, C, A> TransferJobGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, TransferJob)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "storagetransfer.transferJobs.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("jobName", self._job_name.to_string())); - if let Some(value) = self._project_id { - params.push(("projectId", value.to_string())); - } - for &field in ["alt", "jobName", "projectId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+jobName}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+jobName}", "jobName")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["jobName"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Required. The job to get. - /// - /// Sets the *job name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn job_name(mut self, new_value: &str) -> TransferJobGetCall<'a, C, A> { - self._job_name = new_value.to_string(); - self - } - /// Required. The ID of the Google Cloud Platform Console project that owns the - /// job. - /// - /// Sets the *project id* query property to the given value. - pub fn project_id(mut self, new_value: &str) -> TransferJobGetCall<'a, C, A> { - self._project_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TransferJobGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> TransferJobGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TransferJobGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Creates a transfer job that runs periodically. /// /// A builder for the *create* method supported by a *transferJob* resource. @@ -4379,3 +4000,264 @@ impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut } +/// Gets a transfer job. +/// +/// A builder for the *get* method supported by a *transferJob* resource. +/// It is not used directly, but through a `TransferJobMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storagetransfer1 as storagetransfer1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storagetransfer1::Storagetransfer; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Storagetransfer::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.transfer_jobs().get("jobName") +/// .project_id("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct TransferJobGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storagetransfer, + _job_name: String, + _project_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TransferJobGetCall<'a, C, A> {} + +impl<'a, C, A> TransferJobGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TransferJob)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storagetransfer.transferJobs.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("jobName", self._job_name.to_string())); + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + for &field in ["alt", "jobName", "projectId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+jobName}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+jobName}", "jobName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["jobName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The job to get. + /// + /// Sets the *job name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn job_name(mut self, new_value: &str) -> TransferJobGetCall<'a, C, A> { + self._job_name = new_value.to_string(); + self + } + /// Required. The ID of the Google Cloud Platform Console project that owns the + /// job. + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> TransferJobGetCall<'a, C, A> { + self._project_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> TransferJobGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> TransferJobGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TransferJobGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/surveys2-cli/Cargo.toml b/gen/surveys2-cli/Cargo.toml index e69e532ba0..118cfc90b5 100644 --- a/gen/surveys2-cli/Cargo.toml +++ b/gen/surveys2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-surveys2-cli" -version = "1.0.12+20180508" +version = "1.0.13+20180508" authors = ["Sebastian Thiel "] description = "A complete library to interact with Surveys (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/surveys2-cli" @@ -41,4 +41,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-surveys2] path = "../surveys2" -version = "1.0.12+20180508" +version = "1.0.13+20180508" diff --git a/gen/surveys2-cli/README.md b/gen/surveys2-cli/README.md index 463a84fd7b..39eb8f0a89 100644 --- a/gen/surveys2-cli/README.md +++ b/gen/surveys2-cli/README.md @@ -22,7 +22,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Surveys* API at revision *20180508*. The CLI is at version *1.0.12*. +This documentation was generated from the *Surveys* API at revision *20180508*. The CLI is at version *1.0.13*. ```bash surveys2 [options] diff --git a/gen/surveys2-cli/mkdocs.yml b/gen/surveys2-cli/mkdocs.yml index 64482b269e..6ffc5c58e4 100644 --- a/gen/surveys2-cli/mkdocs.yml +++ b/gen/surveys2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Surveys v1.0.12+20180508 +site_name: Surveys v1.0.13+20180508 site_url: http://byron.github.io/google-apis-rs/google-surveys2-cli site_description: A complete library to interact with Surveys (protocol v2) diff --git a/gen/surveys2-cli/src/main.rs b/gen/surveys2-cli/src/main.rs index d677de16ac..869a5341a0 100644 --- a/gen/surveys2-cli/src/main.rs +++ b/gen/surveys2-cli/src/main.rs @@ -974,7 +974,7 @@ fn main() { let mut app = App::new("surveys2") .author("Sebastian Thiel ") - .version("1.0.12+20180508") + .version("1.0.13+20180508") .about("Creates and conducts surveys, lists the surveys that an authenticated user owns, and retrieves survey results and information about specified surveys.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_surveys2_cli") .arg(Arg::with_name("url") diff --git a/gen/surveys2/Cargo.toml b/gen/surveys2/Cargo.toml index c86b1f70d2..dd53618252 100644 --- a/gen/surveys2/Cargo.toml +++ b/gen/surveys2/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-surveys2" -version = "1.0.12+20180508" +version = "1.0.13+20180508" authors = ["Sebastian Thiel "] description = "A complete library to interact with Surveys (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/surveys2" -documentation = "https://docs.rs/google-surveys2/1.0.12+20180508" +documentation = "https://docs.rs/google-surveys2/1.0.13+20180508" license = "MIT" keywords = ["surveys", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/surveys2/README.md b/gen/surveys2/README.md index b221a9997f..b1dea4e38e 100644 --- a/gen/surveys2/README.md +++ b/gen/surveys2/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-surveys2` library allows access to all features of the *Google Surveys* service. -This documentation was generated from *Surveys* crate version *1.0.12+20180508*, where *20180508* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Surveys* crate version *1.0.13+20180508*, where *20180508* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.Surveys.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.Surveys.html) ... * results - * [*get*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.ResultGetCall.html) -* [surveys](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.Survey.html) - * [*delete*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.SurveyDeleteCall.html), [*get*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.SurveyGetCall.html), [*insert*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.SurveyInsertCall.html), [*list*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.SurveyListCall.html), [*start*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.SurveyStartCall.html), [*stop*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.SurveyStopCall.html) and [*update*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.SurveyUpdateCall.html) + * [*get*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.ResultGetCall.html) +* [surveys](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.Survey.html) + * [*delete*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.SurveyDeleteCall.html), [*get*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.SurveyGetCall.html), [*insert*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.SurveyInsertCall.html), [*list*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.SurveyListCall.html), [*start*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.SurveyStartCall.html), [*stop*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.SurveyStopCall.html) and [*update*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.SurveyUpdateCall.html) Download supported by ... -* [*get results*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.ResultGetCall.html) +* [*get results*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.ResultGetCall.html) @@ -26,17 +26,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/struct.Surveys.html)** +* **[Hub](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/struct.Surveys.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.Part.html)** + * **[Parts](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-surveys2/1.0.12+20180508/google_surveys2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-surveys2/1.0.13+20180508/google_surveys2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/surveys2/src/lib.rs b/gen/surveys2/src/lib.rs index f2af7359d7..2a74ce95b6 100644 --- a/gen/surveys2/src/lib.rs +++ b/gen/surveys2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Surveys* crate version *1.0.12+20180508*, where *20180508* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Surveys* crate version *1.0.13+20180508*, where *20180508* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/surveys2). //! # Features //! @@ -340,7 +340,7 @@ impl<'a, C, A> Surveys Surveys { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/surveys/v2/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -354,7 +354,7 @@ impl<'a, C, A> Surveys } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/tagmanager1-cli/Cargo.toml b/gen/tagmanager1-cli/Cargo.toml index 83418b9add..3a9e55282b 100644 --- a/gen/tagmanager1-cli/Cargo.toml +++ b/gen/tagmanager1-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-tagmanager1-cli" -version = "1.0.12+20190516" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1-cli" -homepage = "https://developers.google.com/tag-manager/api/v1/" +homepage = "https://developers.google.com/tag-manager" documentation = "http://byron.github.io/google-apis-rs/google_tagmanager1_cli" license = "MIT" keywords = ["tagmanager", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-tagmanager1] path = "../tagmanager1" -version = "1.0.12+20190516" +version = "1.0.13+20200408" diff --git a/gen/tagmanager1-cli/README.md b/gen/tagmanager1-cli/README.md index 6af1b0e5bf..2bdc730c5e 100644 --- a/gen/tagmanager1-cli/README.md +++ b/gen/tagmanager1-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *Tag Manager* API can be found at the -[official documentation site](https://developers.google.com/tag-manager/api/v1/). +[official documentation site](https://developers.google.com/tag-manager). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Tag Manager* API at revision *20190516*. The CLI is at version *1.0.12*. +This documentation was generated from the *Tag Manager* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash tagmanager1 [options] diff --git a/gen/tagmanager1-cli/mkdocs.yml b/gen/tagmanager1-cli/mkdocs.yml index 3d31af1e51..7f21582b1a 100644 --- a/gen/tagmanager1-cli/mkdocs.yml +++ b/gen/tagmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Tag Manager v1.0.12+20190516 +site_name: Tag Manager v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-tagmanager1-cli site_description: A complete library to interact with Tag Manager (protocol v1) diff --git a/gen/tagmanager1-cli/src/main.rs b/gen/tagmanager1-cli/src/main.rs index 675822937c..125d6041da 100644 --- a/gen/tagmanager1-cli/src/main.rs +++ b/gen/tagmanager1-cli/src/main.rs @@ -3684,12 +3684,15 @@ impl<'n> Engine<'n> { let engine = Engine { opt: opt, hub: api::TagManager::new(client, auth), - gp: vec!["alt", "fields", "key", "oauth-token", "pretty-print", "quota-user", "user-ip"], + gp: vec!["$-xgafv", "access-token", "alt", "callback", "fields", "key", "oauth-token", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), ("oauth-token", "oauth_token"), ("pretty-print", "prettyPrint"), ("quota-user", "quotaUser"), - ("user-ip", "userIp"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), ] }; @@ -4854,7 +4857,8 @@ fn main() { (Some(r##"container-version-id"##), None, - Some(r##"The GTM Container Version ID. Specify published to retrieve the currently published version."##), + Some(r##"The GTM Container Version ID. Specify published to retrieve + the currently published version."##), Some(true), Some(false)), @@ -4933,7 +4937,10 @@ fn main() { Some(false)), ]), ("containers-versions-restore", - Some(r##"Restores a Container Version. This will overwrite the container's current configuration (including its variables, triggers and tags). The operation will not have any effect on the version that is being served (i.e. the published version)."##), + Some(r##"Restores a Container Version. This will overwrite the container's current + configuration (including its variables, triggers and tags). The operation + will not have any effect on the version that is being served (i.e. the + published version)."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager1_cli/accounts_containers-versions-restore", vec![ (Some(r##"account-id"##), @@ -5107,7 +5114,8 @@ fn main() { Some(false)), ]), ("permissions-delete", - Some(r##"Removes a user from the account, revoking access to it and all of its containers."##), + Some(r##"Removes a user from the account, revoking access to it and all of its + containers."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager1_cli/accounts_permissions-delete", vec![ (Some(r##"account-id"##), @@ -5157,12 +5165,13 @@ fn main() { Some(false)), ]), ("permissions-list", - Some(r##"List all users that have access to the account along with Account and Container Permissions granted to each of them."##), + Some(r##"List all users that have access to the account along with Account and + Container Permissions granted to each of them."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager1_cli/accounts_permissions-list", vec![ (Some(r##"account-id"##), None, - Some(r##"The GTM Account ID. @required tagmanager.accounts.permissions.list"##), + Some(r##"The GTM Account ID."##), Some(true), Some(false)), @@ -5246,8 +5255,9 @@ fn main() { let mut app = App::new("tagmanager1") .author("Sebastian Thiel ") - .version("1.0.12+20190516") - .about("Accesses Tag Manager accounts and containers.") + .version("1.0.13+20200408") + .about("This API allows clients to access and modify container and tag + configuration.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tagmanager1_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/tagmanager1/Cargo.toml b/gen/tagmanager1/Cargo.toml index 4159a10d17..c692327b19 100644 --- a/gen/tagmanager1/Cargo.toml +++ b/gen/tagmanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-tagmanager1" -version = "1.0.12+20190516" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1" -homepage = "https://developers.google.com/tag-manager/api/v1/" -documentation = "https://docs.rs/google-tagmanager1/1.0.12+20190516" +homepage = "https://developers.google.com/tag-manager" +documentation = "https://docs.rs/google-tagmanager1/1.0.13+20200408" license = "MIT" keywords = ["tagmanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/tagmanager1/README.md b/gen/tagmanager1/README.md index 23c2728c5c..5383da5c35 100644 --- a/gen/tagmanager1/README.md +++ b/gen/tagmanager1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-tagmanager1` library allows access to all features of the *Google Tag Manager* service. -This documentation was generated from *Tag Manager* crate version *1.0.12+20190516*, where *20190516* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Tag Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Tag Manager* *v1* API can be found at the -[official documentation site](https://developers.google.com/tag-manager/api/v1/). +[official documentation site](https://developers.google.com/tag-manager). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.TagManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.TagManager.html) ... -* [accounts](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.Account.html) - * [*containers create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerEnvironmentListCall.html), [*containers environments update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerEnvironmentUpdateCall.html), [*containers folders create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerFolderCreateCall.html), [*containers folders delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerFolderDeleteCall.html), [*containers folders entities list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerFolderEntityListCall.html), [*containers folders get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerFolderGetCall.html), [*containers folders list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerFolderListCall.html), [*containers folders update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerFolderUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerListCall.html), [*containers move_folders update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerMoveFolderUpdateCall.html), [*containers reauthorize_environments update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerReauthorizeEnvironmentUpdateCall.html), [*containers tags create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTagCreateCall.html), [*containers tags delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTagDeleteCall.html), [*containers tags get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTagGetCall.html), [*containers tags list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTagListCall.html), [*containers tags update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTagUpdateCall.html), [*containers triggers create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTriggerCreateCall.html), [*containers triggers delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTriggerDeleteCall.html), [*containers triggers get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTriggerGetCall.html), [*containers triggers list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTriggerListCall.html), [*containers triggers update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerTriggerUpdateCall.html), [*containers update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerUpdateCall.html), [*containers variables create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVariableCreateCall.html), [*containers variables delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVariableDeleteCall.html), [*containers variables get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVariableGetCall.html), [*containers variables list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVariableListCall.html), [*containers variables update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVariableUpdateCall.html), [*containers versions create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionCreateCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionGetCall.html), [*containers versions list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionListCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionPublishCall.html), [*containers versions restore*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionRestoreCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountContainerVersionUpdateCall.html), [*get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountListCall.html), [*permissions create*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountPermissionCreateCall.html), [*permissions delete*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountPermissionDeleteCall.html), [*permissions get*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountPermissionGetCall.html), [*permissions list*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountPermissionListCall.html), [*permissions update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountPermissionUpdateCall.html) and [*update*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.AccountUpdateCall.html) +* [accounts](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.Account.html) + * [*containers create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerEnvironmentListCall.html), [*containers environments update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerEnvironmentUpdateCall.html), [*containers folders create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerFolderCreateCall.html), [*containers folders delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerFolderDeleteCall.html), [*containers folders entities list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerFolderEntityListCall.html), [*containers folders get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerFolderGetCall.html), [*containers folders list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerFolderListCall.html), [*containers folders update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerFolderUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerListCall.html), [*containers move_folders update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerMoveFolderUpdateCall.html), [*containers reauthorize_environments update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerReauthorizeEnvironmentUpdateCall.html), [*containers tags create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTagCreateCall.html), [*containers tags delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTagDeleteCall.html), [*containers tags get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTagGetCall.html), [*containers tags list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTagListCall.html), [*containers tags update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTagUpdateCall.html), [*containers triggers create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTriggerCreateCall.html), [*containers triggers delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTriggerDeleteCall.html), [*containers triggers get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTriggerGetCall.html), [*containers triggers list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTriggerListCall.html), [*containers triggers update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerTriggerUpdateCall.html), [*containers update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerUpdateCall.html), [*containers variables create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVariableCreateCall.html), [*containers variables delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVariableDeleteCall.html), [*containers variables get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVariableGetCall.html), [*containers variables list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVariableListCall.html), [*containers variables update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVariableUpdateCall.html), [*containers versions create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionCreateCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionGetCall.html), [*containers versions list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionListCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionPublishCall.html), [*containers versions restore*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionRestoreCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountContainerVersionUpdateCall.html), [*get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountListCall.html), [*permissions create*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountPermissionCreateCall.html), [*permissions delete*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountPermissionDeleteCall.html), [*permissions get*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountPermissionGetCall.html), [*permissions list*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountPermissionListCall.html), [*permissions update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountPermissionUpdateCall.html) and [*update*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.AccountUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/struct.TagManager.html)** +* **[Hub](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/struct.TagManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -181,17 +181,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -201,29 +201,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-tagmanager1/1.0.12+20190516/google_tagmanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-tagmanager1/1.0.13+20200408/google_tagmanager1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/tagmanager1/src/lib.rs b/gen/tagmanager1/src/lib.rs index 7a0b27262e..efa18fc860 100644 --- a/gen/tagmanager1/src/lib.rs +++ b/gen/tagmanager1/src/lib.rs @@ -2,10 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Tag Manager* crate version *1.0.12+20190516*, where *20190516* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Tag Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *tagmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Tag Manager* *v1* API can be found at the -//! [official documentation site](https://developers.google.com/tag-manager/api/v1/). +//! [official documentation site](https://developers.google.com/tag-manager). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager1). //! # Features //! @@ -407,8 +407,8 @@ impl<'a, C, A> TagManager TagManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), - _base_url: "https://www.googleapis.com/tagmanager/v1/".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), + _base_url: "https://www.googleapis.com/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } } @@ -418,7 +418,7 @@ impl<'a, C, A> TagManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -426,7 +426,7 @@ impl<'a, C, A> TagManager } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/tagmanager/v1/`. + /// It defaults to `https://www.googleapis.com/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -452,7 +452,10 @@ impl<'a, C, A> TagManager /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccountAccess { - /// List of Account permissions. Valid account permissions are read and manage. + /// List of Account permissions. + /// Valid account permissions are read and manage. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update pub permission: Option>, } @@ -473,9 +476,13 @@ impl Part for AccountAccess {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Tag { /// The start timestamp in milliseconds to schedule a tag. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="scheduleStartMs")] pub schedule_start_ms: Option, /// The end timestamp in milliseconds to schedule a tag. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="scheduleEndMs")] pub schedule_end_ms: Option, /// GTM Container ID. @@ -488,19 +495,32 @@ pub struct Tag { #[serde(rename="tagId")] pub tag_id: Option, /// True if the tag is paused. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub paused: Option, /// The list of setup tags. Currently we only allow one. #[serde(rename="setupTag")] pub setup_tag: Option>, - /// Blocking rule IDs. If any of the listed rules evaluate to true, the tag will not fire. + /// Blocking rule IDs. If any of the listed rules evaluate to true, the tag + /// will not fire. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="blockingRuleId")] pub blocking_rule_id: Option>, - /// The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified. + /// The fingerprint of the GTM Tag as computed at storage time. + /// This value is recomputed whenever the tag is modified. pub fingerprint: Option, - /// Firing rule IDs. A tag will fire when any of the listed rules are true and all of its blockingRuleIds (if any specified) are false. + /// Firing rule IDs. A tag will fire when any of the listed rules are true and + /// all of its blockingRuleIds (if any specified) are false. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="firingRuleId")] pub firing_rule_id: Option>, - /// Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false. + /// Firing trigger IDs. A tag will fire when any of the listed triggers are + /// true and all of its blockingTriggerIds (if any specified) are + /// false. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="firingTriggerId")] pub firing_trigger_id: Option>, /// GTM Account ID. @@ -510,23 +530,42 @@ pub struct Tag { #[serde(rename="teardownTag")] pub teardown_tag: Option>, /// Tag display name. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub name: Option, /// The tag's parameters. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub parameter: Option>, /// User notes on how to apply this tag in the container. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub notes: Option, /// Parent folder id. #[serde(rename="parentFolderId")] pub parent_folder_id: Option, - /// User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag's priority can be a positive or negative value. The default value is 0. + /// User defined numeric priority of the tag. Tags are fired asynchronously in + /// order of priority. Tags with higher numeric value fire first. A tag's + /// priority can be a positive or negative value. The default value is 0. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub priority: Option, - /// If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode). + /// If set to true, this tag will only fire in the live environment (e.g. not + /// in preview or debug mode). + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="liveOnly")] pub live_only: Option, /// GTM Tag Type. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="type")] pub type_: Option, - /// Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire. + /// Blocking trigger IDs. If any of the listed triggers evaluate to true, the + /// tag + /// will not fire. + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="blockingTriggerId")] pub blocking_trigger_id: Option>, } @@ -549,12 +588,24 @@ impl ResponseResult for Tag {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Container { /// Container Time Zone ID. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update #[serde(rename="timeZoneId")] pub time_zone_id: Option, - /// List of enabled built-in variables. Valid values include: pageUrl, pageHostname, pagePath, referrer, event, clickElement, clickClasses, clickId, clickTarget, clickUrl, clickText, formElement, formClasses, formId, formTarget, formUrl, formText, errorMessage, errorUrl, errorLine, newHistoryFragment, oldHistoryFragment, newHistoryState, oldHistoryState, historySource, containerVersion, debugMode, randomNumber, containerId. + /// List of enabled built-in variables. Valid values include: pageUrl, + /// pageHostname, pagePath, referrer, event, clickElement, clickClasses, + /// clickId, clickTarget, clickUrl, clickText, formElement, formClasses, + /// formId, formTarget, formUrl, formText, errorMessage, errorUrl, errorLine, + /// newHistoryFragment, oldHistoryFragment, newHistoryState, oldHistoryState, + /// historySource, containerVersion, debugMode, randomNumber, + /// containerId. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update #[serde(rename="enabledBuiltInVariable")] pub enabled_built_in_variable: Option>, /// Container Country ID. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update #[serde(rename="timeZoneCountryId")] pub time_zone_country_id: Option, /// Container Public ID. @@ -564,16 +615,26 @@ pub struct Container { #[serde(rename="containerId")] pub container_id: Option, /// Optional list of domain names associated with the Container. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update #[serde(rename="domainName")] pub domain_name: Option>, /// Container Notes. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update pub notes: Option, /// Container display name. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update pub name: Option, - /// List of Usage Contexts for the Container. Valid values include: web, android, ios. + /// List of Usage Contexts for the Container. Valid values include: web, + /// android, ios. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update #[serde(rename="usageContext")] pub usage_context: Option>, - /// The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified. + /// The fingerprint of the GTM Container as computed at storage time. This + /// value is recomputed whenever the account is modified. pub fingerprint: Option, /// GTM Account ID. #[serde(rename="accountId")] @@ -631,9 +692,13 @@ impl ResponseResult for PublishContainerVersionResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Macro { /// The start timestamp in milliseconds to schedule a macro. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update #[serde(rename="scheduleStartMs")] pub schedule_start_ms: Option, /// The end timestamp in milliseconds to schedule a macro. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update #[serde(rename="scheduleEndMs")] pub schedule_end_ms: Option, /// The Macro ID uniquely identifies the GTM Macro. @@ -643,27 +708,44 @@ pub struct Macro { #[serde(rename="containerId")] pub container_id: Option, /// The macro's parameters. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update pub parameter: Option>, /// User notes on how to apply this macro in the container. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update pub notes: Option, - /// The fingerprint of the GTM Macro as computed at storage time. This value is recomputed whenever the macro is modified. + /// The fingerprint of the GTM Macro as computed at storage time. + /// This value is recomputed whenever the macro is modified. pub fingerprint: Option, - /// For mobile containers only: A list of rule IDs for disabling conditional macros; the macro is enabled if one of the enabling rules is true while all the disabling rules are false. Treated as an unordered set. + /// For mobile containers only: A list of rule IDs for disabling conditional + /// macros; the macro is enabled if one of the enabling rules is true while all + /// the disabling rules are false. Treated as an unordered set. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update #[serde(rename="disablingRuleId")] pub disabling_rule_id: Option>, - /// For mobile containers only: A list of rule IDs for enabling conditional macros; the macro is enabled if one of the enabling rules is true while all the disabling rules are false. Treated as an unordered set. + /// For mobile containers only: A list of rule IDs for enabling conditional + /// macros; the macro is enabled if one of the enabling rules is true while all + /// the disabling rules are false. Treated as an unordered set. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update #[serde(rename="enablingRuleId")] pub enabling_rule_id: Option>, /// GTM Account ID. #[serde(rename="accountId")] pub account_id: Option, /// GTM Macro Type. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update #[serde(rename="type")] pub type_: Option, /// Parent folder id. #[serde(rename="parentFolderId")] pub parent_folder_id: Option, /// Macro display name. + /// @mutable tagmanager.accounts.containers.macros.create + /// @mutable tagmanager.accounts.containers.macros.update pub name: Option, } @@ -748,14 +830,19 @@ impl ResponseResult for ListVariablesResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Account { /// Whether the account shares data anonymously with Google and others. + /// @mutable tagmanager.accounts.create + /// @mutable tagmanager.accounts.update #[serde(rename="shareData")] pub share_data: Option, /// The Account ID uniquely identifies the GTM Account. #[serde(rename="accountId")] pub account_id: Option, /// Account display name. + /// @mutable tagmanager.accounts.create + /// @mutable tagmanager.accounts.update pub name: Option, - /// The fingerprint of the GTM Account as computed at storage time. This value is recomputed whenever the account is modified. + /// The fingerprint of the GTM Account as computed at storage time. + /// This value is recomputed whenever the account is modified. pub fingerprint: Option, } @@ -774,15 +861,22 @@ pub struct Rule { #[serde(rename="containerId")] pub container_id: Option, /// Rule display name. + /// @mutable tagmanager.accounts.containers.rules.create + /// @mutable tagmanager.accounts.containers.rules.update pub name: Option, /// The Rule ID uniquely identifies the GTM Rule. #[serde(rename="ruleId")] pub rule_id: Option, /// User notes on how to apply this rule in the container. + /// @mutable tagmanager.accounts.containers.rules.create + /// @mutable tagmanager.accounts.containers.rules.update pub notes: Option, - /// The fingerprint of the GTM Rule as computed at storage time. This value is recomputed whenever the rule is modified. + /// The fingerprint of the GTM Rule as computed at storage time. + /// This value is recomputed whenever the rule is modified. pub fingerprint: Option, /// The list of conditions that make up this rule (implicit AND between them). + /// @mutable tagmanager.accounts.containers.rules.create + /// @mutable tagmanager.accounts.containers.rules.update pub condition: Option>, /// GTM Account ID. #[serde(rename="accountId")] @@ -810,7 +904,9 @@ pub struct ListAccountsResponse { impl ResponseResult for ListAccountsResponse {} -/// Represents a Google Tag Manager Environment. Note that a user can create, delete and update environments of type USER, but can only update the enable_debug and url fields of environments of other types. +/// Represents a Google Tag Manager Environment. Note that a user can create, +/// delete and update environments of type USER, but can only update the +/// enable_debug and url fields of environments of other types. /// /// # Activities /// @@ -827,14 +923,21 @@ pub struct Environment { /// The environment authorization code. #[serde(rename="authorizationCode")] pub authorization_code: Option, - /// The environment description. Can be set or changed only on USER type environments. + /// The environment description. Can be set or changed only on USER type + /// environments. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update pub description: Option, /// GTM Environment ID uniquely identifies the GTM Environment. #[serde(rename="environmentId")] pub environment_id: Option, /// Default preview page url for the environment. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update pub url: Option, /// Whether or not to enable debug by default on for the environment. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update #[serde(rename="enableDebug")] pub enable_debug: Option, /// GTM Container ID. @@ -843,10 +946,11 @@ pub struct Environment { /// The last update time-stamp for the authorization code. #[serde(rename="authorizationTimestampMs")] pub authorization_timestamp_ms: Option, - /// + /// no description provided #[serde(rename="containerVersionId")] pub container_version_id: Option, - /// The fingerprint of the GTM environment as computed at storage time. This value is recomputed whenever the environment is modified. + /// The fingerprint of the GTM environment as computed at storage time. + /// This value is recomputed whenever the environment is modified. pub fingerprint: Option, /// GTM Account ID. #[serde(rename="accountId")] @@ -854,7 +958,10 @@ pub struct Environment { /// The type of this environment. #[serde(rename="type")] pub type_: Option, - /// The environment display name. Can be set or changed only on USER type environments. + /// The environment display name. Can be set or changed only on USER type + /// environments. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update pub name: Option, } @@ -910,7 +1017,9 @@ pub struct ContainerVersion { /// The macros in the container that this version was taken from. #[serde(rename="macro")] pub macro_: Option>, - /// User notes on how to apply this container version in the container. + /// User notes on how to apply this container version in the + /// container. + /// @mutable tagmanager.accounts.containers.versions.update pub notes: Option, /// The rules in the container that this version was taken from. pub rule: Option>, @@ -919,7 +1028,9 @@ pub struct ContainerVersion { /// The Container Version ID uniquely identifies the GTM Container Version. #[serde(rename="containerVersionId")] pub container_version_id: Option, - /// The fingerprint of the GTM Container Version as computed at storage time. This value is recomputed whenever the container version is modified. + /// The fingerprint of the GTM Container Version as computed at + /// storage time. This value is recomputed whenever the container version is + /// modified. pub fingerprint: Option, /// The variables in the container that this version was taken from. pub variable: Option>, @@ -929,6 +1040,7 @@ pub struct ContainerVersion { #[serde(rename="accountId")] pub account_id: Option, /// Container version display name. + /// @mutable tagmanager.accounts.containers.versions.update pub name: Option, } @@ -965,9 +1077,14 @@ impl ResponseResult for CreateContainerVersionResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContainerAccess { /// GTM Container ID. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update #[serde(rename="containerId")] pub container_id: Option, - /// List of Container permissions. Valid container permissions are: read, edit, delete, publish. + /// List of Container permissions. + /// Valid container permissions are: read, edit, delete, publish. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update pub permission: Option>, } @@ -988,12 +1105,17 @@ impl Part for ContainerAccess {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UserAccess { /// GTM Container access permissions. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update #[serde(rename="containerAccess")] pub container_access: Option>, /// GTM Account access permissions. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update #[serde(rename="accountAccess")] pub account_access: Option, /// User's email address. + /// @mutable tagmanager.accounts.permissions.create #[serde(rename="emailAddress")] pub email_address: Option, /// Account Permission ID. @@ -1032,8 +1154,11 @@ pub struct Folder { #[serde(rename="containerId")] pub container_id: Option, /// Folder display name. + /// @mutable tagmanager.accounts.containers.folders.create + /// @mutable tagmanager.accounts.containers.folders.update pub name: Option, - /// The fingerprint of the GTM Folder as computed at storage time. This value is recomputed whenever the folder is modified. + /// The fingerprint of the GTM Folder as computed at storage time. + /// This value is recomputed whenever the folder is modified. pub fingerprint: Option, } @@ -1048,20 +1173,62 @@ impl ResponseResult for Folder {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Parameter { /// This map parameter's parameters (must have keys; keys must be unique). + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub map: Option>, /// This list parameter's parameters (keys will be ignored). + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub list: Option>, - /// The named key that uniquely identifies a parameter. Required for top-level parameters, as well as map values. Ignored for list values. + /// The named key that uniquely identifies a parameter. Required for top-level + /// parameters, as well as map values. Ignored for list values. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub key: Option, - /// A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. + /// A parameter's value (may contain variable references such as + /// "{{myVariable}}") + /// as appropriate to the specified type. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update pub value: Option, - /// The parameter type. Valid values are: - /// - boolean: The value represents a boolean, represented as 'true' or 'false' - /// - integer: The value represents a 64-bit signed integer value, in base 10 - /// - list: A list of parameters should be specified - /// - map: A map of parameters should be specified - /// - template: The value represents any text; this can include variable references (even variable references that might return non-string types) - /// - trigger_reference: The value represents a trigger, represented as the trigger id + /// The parameter type. Valid values are:

            + /// + ///
          • boolean: The value represents a boolean, represented as + /// 'true' or 'false'
          • + ///
          • integer: The value represents a 64-bit signed integer + /// value, in base 10
          • + ///
          • list: A list of parameters should be specified
          • + ///
          • map: A map of parameters should be specified
          • + ///
          • template: The value represents any text; this can include + /// variable references (even variable references that might return + /// non-string types)
          • + ///
          • trigger_reference: The value represents a trigger, + /// represented as the trigger id
          • + ///
          • tag_reference: The value represents a tag, represented as + /// the tag name
          • + ///
          + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update + /// @mutable tagmanager.accounts.containers.tags.create + /// @mutable tagmanager.accounts.containers.tags.update #[serde(rename="type")] pub type_: Option, } @@ -1100,81 +1267,156 @@ impl ResponseResult for ListTagsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Trigger { - /// Max time to fire Timer Events (in seconds). Only valid for AMP Timer trigger. + /// Max time to fire Timer Events (in seconds). Only valid for AMP Timer + /// trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="maxTimerLengthSeconds")] pub max_timer_length_seconds: Option, - /// A visibility trigger minimum continuous visible time (in milliseconds). Only valid for AMP Visibility trigger. + /// A visibility trigger minimum continuous visible time (in milliseconds). + /// Only valid for AMP Visibility trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="continuousTimeMinMilliseconds")] pub continuous_time_min_milliseconds: Option, - /// A visibility trigger minimum total visible time (in milliseconds). Only valid for AMP Visibility trigger. + /// A visibility trigger minimum total visible time (in milliseconds). + /// Only valid for AMP Visibility trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="totalTimeMinMilliseconds")] pub total_time_min_milliseconds: Option, - /// Globally unique id of the trigger that auto-generates this (a Form Submit, Link Click or Timer listener) if any. Used to make incompatible auto-events work together with trigger filtering based on trigger ids. This value is populated during output generation since the tags implied by triggers don't exist until then. Only valid for Form Submit, Link Click and Timer triggers. + /// Globally unique id of the trigger that auto-generates this (a Form Submit, + /// Link Click or Timer listener) if any. Used to make incompatible auto-events + /// work together with trigger filtering based on trigger ids. This value is + /// populated during output generation since the tags implied by triggers don't + /// exist until then. Only valid for Form Submit, Link Click and Timer + /// triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="uniqueTriggerId")] pub unique_trigger_id: Option, - /// List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled vertically. Only valid for AMP scroll triggers. + /// List of integer percentage values for scroll triggers. The trigger will + /// fire when each percentage is reached when the view is scrolled vertically. + /// Only valid for AMP scroll triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="verticalScrollPercentageList")] pub vertical_scroll_percentage_list: Option, - /// A click trigger CSS selector (i.e. "a", "button" etc.). Only valid for AMP Click trigger. + /// A click trigger CSS selector (i.e. "a", "button" etc.). Only valid for AMP + /// Click trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update pub selector: Option, /// The Trigger ID uniquely identifies the GTM Trigger. #[serde(rename="triggerId")] pub trigger_id: Option, - /// List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled horizontally. Only valid for AMP scroll triggers. + /// List of integer percentage values for scroll triggers. The trigger will + /// fire when each percentage is reached when the view is scrolled + /// horizontally. Only valid for AMP scroll triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="horizontalScrollPercentageList")] pub horizontal_scroll_percentage_list: Option, /// GTM Container ID. #[serde(rename="containerId")] pub container_id: Option, - /// The fingerprint of the GTM Trigger as computed at storage time. This value is recomputed whenever the trigger is modified. + /// The fingerprint of the GTM Trigger as computed at storage time. + /// This value is recomputed whenever the trigger is modified. pub fingerprint: Option, - /// A visibility trigger maximum percent visibility. Only valid for AMP Visibility trigger. + /// A visibility trigger maximum percent visibility. Only valid for AMP + /// Visibility trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="visiblePercentageMax")] pub visible_percentage_max: Option, /// GTM Account ID. #[serde(rename="accountId")] pub account_id: Option, /// The trigger will only fire iff all Conditions are true. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update pub filter: Option>, - /// Whether or not we should delay the form submissions or link opening until all of the tags have fired (by preventing the default action and later simulating the default action). Only valid for Form Submission and Link Click triggers. + /// Whether or not we should delay the form submissions or link opening + /// until all of the tags have fired (by preventing the default + /// action and later simulating the default action). Only valid for + /// Form Submission and Link Click triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="waitForTags")] pub wait_for_tags: Option, /// Trigger display name. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update pub name: Option, - /// A visibility trigger minimum percent visibility. Only valid for AMP Visibility trigger. + /// A visibility trigger minimum percent visibility. Only valid for AMP + /// Visibility trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="visiblePercentageMin")] pub visible_percentage_min: Option, /// Defines the data layer event that causes this trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="type")] pub type_: Option, - /// Time between triggering recurring Timer Events (in milliseconds). Only valid for Timer triggers. + /// Time between triggering recurring Timer Events (in milliseconds). Only + /// valid for Timer triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update pub interval: Option, - /// Time between Timer Events to fire (in seconds). Only valid for AMP Timer trigger. + /// Time between Timer Events to fire (in seconds). Only valid for AMP Timer + /// trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="intervalSeconds")] pub interval_seconds: Option, /// Name of the GTM event that is fired. Only valid for Timer triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="eventName")] pub event_name: Option, - /// A visibility trigger CSS selector (i.e. "#id"). Only valid for AMP Visibility trigger. + /// A visibility trigger CSS selector (i.e. "#id"). Only valid for AMP + /// Visibility trigger. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="visibilitySelector")] pub visibility_selector: Option, - /// How long to wait (in milliseconds) for tags to fire when 'waits_for_tags' above evaluates to true. Only valid for Form Submission and Link Click triggers. + /// How long to wait (in milliseconds) for tags to fire when 'waits_for_tags' + /// above evaluates to true. Only valid for Form Submission and + /// Link Click triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="waitForTagsTimeout")] pub wait_for_tags_timeout: Option, - /// Limit of the number of GTM events this Timer Trigger will fire. If no limit is set, we will continue to fire GTM events until the user leaves the page. Only valid for Timer triggers. + /// Limit of the number of GTM events this Timer Trigger will fire. If no limit + /// is set, we will continue to fire GTM events until the user leaves the page. + /// Only valid for Timer triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update pub limit: Option, - /// Whether or not we should only fire tags if the form submit or link click event is not cancelled by some other event handler (e.g. because of validation). Only valid for Form Submission and Link Click triggers. + /// Whether or not we should only fire tags if the form submit or link click + /// event is not cancelled by some other event handler (e.g. because of + /// validation). Only valid for Form Submission and Link Click triggers. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="checkValidation")] pub check_validation: Option, - /// Used in the case of custom event, which is fired iff all Conditions are true. + /// Used in the case of custom event, which is fired iff all Conditions are + /// true. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="customEventFilter")] pub custom_event_filter: Option>, /// Additional parameters. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update pub parameter: Option>, /// Parent folder id. #[serde(rename="parentFolderId")] pub parent_folder_id: Option, /// Used in the case of auto event tracking. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="autoEventFilter")] pub auto_event_filter: Option>, } @@ -1235,7 +1477,8 @@ pub struct CreateContainerVersionRequestVersionOptions { pub notes: Option, /// The name of the container version to be created. pub name: Option, - /// The creation of this version may be for quick preview and shouldn't be saved. + /// The creation of this version may be for quick preview and + /// shouldn't be saved. #[serde(rename="quickPreview")] pub quick_preview: Option, } @@ -1267,7 +1510,9 @@ impl ResponseResult for ListTriggersResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetupTag { - /// If true, fire the main tag if and only if the setup tag fires successfully. If false, fire the main tag regardless of setup tag firing status. + /// If true, fire the main tag if and only if the setup tag fires + /// successfully. + /// If false, fire the main tag regardless of setup tag firing status. #[serde(rename="stopOnSetupFailure")] pub stop_on_setup_failure: Option, /// The name of the setup tag. @@ -1371,35 +1616,56 @@ impl ResponseResult for ListContainerVersionsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Variable { /// The start timestamp in milliseconds to schedule a variable. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update #[serde(rename="scheduleStartMs")] pub schedule_start_ms: Option, /// The end timestamp in milliseconds to schedule a variable. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update #[serde(rename="scheduleEndMs")] pub schedule_end_ms: Option, /// Variable display name. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update pub name: Option, /// The variable's parameters. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update pub parameter: Option>, /// User notes on how to apply this variable in the container. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update pub notes: Option, /// GTM Container ID. #[serde(rename="containerId")] pub container_id: Option, - /// For mobile containers only: A list of trigger IDs for enabling conditional variables; the variable is enabled if one of the enabling triggers is true while all the disabling triggers are false. Treated as an unordered set. + /// For mobile containers only: A list of trigger IDs for enabling conditional + /// variables; the variable is enabled if one of the enabling triggers is true + /// while all the disabling triggers are false. Treated as an unordered set. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update #[serde(rename="enablingTriggerId")] pub enabling_trigger_id: Option>, - /// The fingerprint of the GTM Variable as computed at storage time. This value is recomputed whenever the variable is modified. + /// The fingerprint of the GTM Variable as computed at storage time. + /// This value is recomputed whenever the variable is modified. pub fingerprint: Option, /// GTM Account ID. #[serde(rename="accountId")] pub account_id: Option, /// GTM Variable Type. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update #[serde(rename="type")] pub type_: Option, /// Parent folder id. #[serde(rename="parentFolderId")] pub parent_folder_id: Option, - /// For mobile containers only: A list of trigger IDs for disabling conditional variables; the variable is enabled if one of the enabling trigger is true while all the disabling trigger are false. Treated as an unordered set. + /// For mobile containers only: A list of trigger IDs for disabling conditional + /// variables; the variable is enabled if one of the enabling trigger is true + /// while all the disabling trigger are false. Treated as an unordered set. + /// @mutable tagmanager.accounts.containers.variables.create + /// @mutable tagmanager.accounts.containers.variables.update #[serde(rename="disablingTriggerId")] pub disabling_trigger_id: Option>, /// The Variable ID uniquely identifies the GTM Variable. @@ -1417,7 +1683,9 @@ impl ResponseResult for Variable {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TeardownTag { - /// If true, fire the teardown tag if and only if the main tag fires successfully. If false, fire the teardown tag regardless of main tag firing status. + /// If true, fire the teardown tag if and only if the main tag fires + /// successfully. + /// If false, fire the teardown tag regardless of main tag firing status. #[serde(rename="stopTeardownOnFailure")] pub stop_teardown_on_failure: Option, /// The name of the teardown tag. @@ -1434,13 +1702,28 @@ impl Part for TeardownTag {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Condition { - /// A list of named parameters (key/value), depending on the condition's type. Notes: - /// - For binary operators, include parameters named arg0 and arg1 for specifying the left and right operands, respectively. - /// - At this time, the left operand (arg0) must be a reference to a variable. - /// - For case-insensitive Regex matching, include a boolean parameter named ignore_case that is set to true. If not specified or set to any other value, the matching will be case sensitive. - /// - To negate an operator, include a boolean parameter named negate boolean parameter that is set to true. + /// A list of named parameters (key/value), depending on the condition's type. + /// Notes:
            + /// + ///
          • For binary operators, include parameters named arg0 and + /// arg1 for specifying the left and right operands, + /// respectively.
          • + ///
          • At this time, the left operand (arg0) must be a reference + /// to a variable.
          • + ///
          • For case-insensitive Regex matching, include a boolean parameter named + /// ignore_case that is set to true. + /// If not specified or set to any other value, the matching will be case + /// sensitive.
          • + ///
          • To negate an operator, include a boolean parameter named + /// negate boolean parameter that is set to true. + ///
          • + ///
          + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update pub parameter: Option>, /// The type of operator for this condition. + /// @mutable tagmanager.accounts.containers.triggers.create + /// @mutable tagmanager.accounts.containers.triggers.update #[serde(rename="type")] pub type_: Option, } @@ -1511,11 +1794,12 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List all users that have access to the account along with Account and Container Permissions granted to each of them. + /// List all users that have access to the account along with Account and + /// Container Permissions granted to each of them. /// /// # Arguments /// - /// * `accountId` - The GTM Account ID. @required tagmanager.accounts.permissions.list + /// * `accountId` - The GTM Account ID. pub fn permissions_list(&self, account_id: &str) -> AccountPermissionListCall<'a, C, A> { AccountPermissionListCall { hub: self.hub, @@ -1589,7 +1873,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Removes a user from the account, revoking access to it and all of its containers. + /// Removes a user from the account, revoking access to it and all of its + /// containers. /// /// # Arguments /// @@ -2064,7 +2349,10 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Restores a Container Version. This will overwrite the container's current configuration (including its variables, triggers and tags). The operation will not have any effect on the version that is being served (i.e. the published version). + /// Restores a Container Version. This will overwrite the container's current + /// configuration (including its variables, triggers and tags). The operation + /// will not have any effect on the version that is being served (i.e. the + /// published version). /// /// # Arguments /// @@ -2491,7 +2779,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// * `accountId` - The GTM Account ID. /// * `containerId` - The GTM Container ID. - /// * `containerVersionId` - The GTM Container Version ID. Specify published to retrieve the currently published version. + /// * `containerVersionId` - The GTM Container Version ID. Specify published to retrieve + /// the currently published version. pub fn containers_versions_get(&self, account_id: &str, container_id: &str, container_version_id: &str) -> AccountContainerVersionGetCall<'a, C, A> { AccountContainerVersionGetCall { hub: self.hub, @@ -2584,7 +2873,7 @@ impl<'a, C, A> AccountContainerListCall<'a, C, A> where C: BorrowMut AccountContainerListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -2753,7 +3046,8 @@ impl<'a, C, A> AccountContainerListCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountPermissionListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3073,7 +3371,7 @@ impl<'a, C, A> AccountContainerEnvironmentCreateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -3237,13 +3535,17 @@ impl<'a, C, A> AccountContainerEnvironmentCreateCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3354,7 +3656,7 @@ impl<'a, C, A> AccountPermissionCreateCall<'a, C, A> where C: BorrowMut AccountPermissionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountPermissionCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3621,7 +3927,7 @@ impl<'a, C, A> AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu } - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -3761,13 +4067,17 @@ impl<'a, C, A> AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -3800,7 +4110,8 @@ impl<'a, C, A> AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu } -/// Removes a user from the account, revoking access to it and all of its containers. +/// Removes a user from the account, revoking access to it and all of its +/// containers. /// /// A builder for the *permissions.delete* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -3872,7 +4183,7 @@ impl<'a, C, A> AccountPermissionDeleteCall<'a, C, A> where C: BorrowMut AccountPermissionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountPermissionDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4114,7 +4429,7 @@ impl<'a, C, A> AccountContainerGetCall<'a, C, A> where C: BorrowMut AccountContainerGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4376,7 +4695,7 @@ impl<'a, C, A> AccountContainerVersionListCall<'a, C, A> where C: BorrowMut AccountContainerVersionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4656,7 +4979,7 @@ impl<'a, C, A> AccountContainerTriggerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTriggerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTriggerUpdateCall<'a, C, A> { @@ -4837,13 +5161,17 @@ impl<'a, C, A> AccountContainerTriggerUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTriggerUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4951,7 +5279,7 @@ impl<'a, C, A> AccountContainerTriggerGetCall<'a, C, A> where C: BorrowMut AccountContainerTriggerGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTriggerGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5212,7 +5544,7 @@ impl<'a, C, A> AccountContainerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5455,7 +5791,7 @@ impl<'a, C, A> AccountContainerFolderDeleteCall<'a, C, A> where C: BorrowMut AccountContainerFolderDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerFolderDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5712,7 +6052,7 @@ impl<'a, C, A> AccountContainerCreateCall<'a, C, A> where C: BorrowMut AccountContainerCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5979,7 +6323,7 @@ impl<'a, C, A> AccountContainerTagDeleteCall<'a, C, A> where C: BorrowMut AccountContainerTagDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTagDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6233,7 +6581,7 @@ impl<'a, C, A> AccountContainerFolderEntityListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6383,13 +6731,17 @@ impl<'a, C, A> AccountContainerFolderEntityListCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerFolderEntityListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6497,7 +6849,7 @@ impl<'a, C, A> AccountContainerVersionUndeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); } @@ -6647,13 +6999,17 @@ impl<'a, C, A> AccountContainerVersionUndeleteCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerVersionUndeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6759,7 +7115,7 @@ impl<'a, C, A> AccountContainerEnvironmentListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6899,13 +7255,17 @@ impl<'a, C, A> AccountContainerEnvironmentListCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7011,7 +7371,7 @@ impl<'a, C, A> AccountContainerTagListCall<'a, C, A> where C: BorrowMut AccountContainerTagListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTagListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7270,7 +7634,7 @@ impl<'a, C, A> AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut AccountContainerVersionPublishCall<'a, C, A> { @@ -7427,13 +7792,17 @@ impl<'a, C, A> AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionPublishCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7541,7 +7910,7 @@ impl<'a, C, A> AccountContainerFolderGetCall<'a, C, A> where C: BorrowMut AccountContainerFolderGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerFolderGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7805,7 +8178,7 @@ impl<'a, C, A> AccountContainerEnvironmentGetCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerEnvironmentGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8074,7 +8451,7 @@ impl<'a, C, A> AccountContainerTagCreateCall<'a, C, A> where C: BorrowMut AccountContainerTagCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTagCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8350,7 +8731,7 @@ impl<'a, C, A> AccountContainerTriggerListCall<'a, C, A> where C: BorrowMut AccountContainerTriggerListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTriggerListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8603,7 +8988,7 @@ impl<'a, C, A> AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8865,7 +9254,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageAccount.as_ref().to_string(), ()); } @@ -8999,7 +9388,8 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: self._account_id = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the account in storage. + /// When provided, this fingerprint must match the fingerprint of the account + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountUpdateCall<'a, C, A> { @@ -9026,13 +9416,17 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9145,7 +9539,7 @@ impl<'a, C, A> AccountContainerVersionCreateCall<'a, C, A> where C: BorrowMut AccountContainerVersionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9421,7 +9819,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountPermissionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9702,7 +10104,7 @@ impl<'a, C, A> AccountContainerMoveFolderUpdateCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/move_folders/{folderId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -9890,13 +10292,17 @@ impl<'a, C, A> AccountContainerMoveFolderUpdateCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerMoveFolderUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9929,7 +10335,10 @@ impl<'a, C, A> AccountContainerMoveFolderUpdateCall<'a, C, A> where C: BorrowMut } -/// Restores a Container Version. This will overwrite the container's current configuration (including its variables, triggers and tags). The operation will not have any effect on the version that is being served (i.e. the published version). +/// Restores a Container Version. This will overwrite the container's current +/// configuration (including its variables, triggers and tags). The operation +/// will not have any effect on the version that is being served (i.e. the +/// published version). /// /// A builder for the *containers.versions.restore* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -10004,7 +10413,7 @@ impl<'a, C, A> AccountContainerVersionRestoreCall<'a, C, A> where C: BorrowMut AccountContainerVersionRestoreCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionRestoreCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10273,7 +10686,7 @@ impl<'a, C, A> AccountContainerVariableCreateCall<'a, C, A> where C: BorrowMut AccountContainerVariableCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVariableCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10549,7 +10966,7 @@ impl<'a, C, A> AccountContainerVariableListCall<'a, C, A> where C: BorrowMut AccountContainerVariableListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVariableListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10803,7 +11224,7 @@ impl<'a, C, A> AccountContainerTagGetCall<'a, C, A> where C: BorrowMut AccountContainerTagGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTagGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11067,7 +11492,7 @@ impl<'a, C, A> AccountContainerVariableGetCall<'a, C, A> where C: BorrowMut AccountContainerVariableGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVariableGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11330,7 +11759,7 @@ impl<'a, C, A> AccountContainerTriggerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerTriggerDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTriggerDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11589,7 +12022,7 @@ impl<'a, C, A> AccountContainerTriggerCreateCall<'a, C, A> where C: BorrowMut AccountContainerTriggerCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTriggerCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11879,7 +12316,7 @@ impl<'a, C, A> AccountContainerFolderUpdateCall<'a, C, A> where C: BorrowMut AccountContainerFolderUpdateCall<'a, C, A> where C: BorrowMut AccountContainerFolderUpdateCall<'a, C, A> { @@ -12060,13 +12498,17 @@ impl<'a, C, A> AccountContainerFolderUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerFolderUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12168,7 +12610,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12267,13 +12709,17 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12386,7 +12832,7 @@ impl<'a, C, A> AccountPermissionUpdateCall<'a, C, A> where C: BorrowMut AccountPermissionUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountPermissionUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12663,7 +13113,7 @@ impl<'a, C, A> AccountContainerVariableDeleteCall<'a, C, A> where C: BorrowMut AccountContainerVariableDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVariableDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12924,7 +13378,7 @@ impl<'a, C, A> AccountContainerReauthorizeEnvironmentUpdateCall<'a, C, A> where params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Publish.as_ref().to_string(), ()); } @@ -13098,13 +13552,17 @@ impl<'a, C, A> AccountContainerReauthorizeEnvironmentUpdateCall<'a, C, A> where /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerReauthorizeEnvironmentUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13208,7 +13666,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13338,13 +13796,17 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13462,7 +13924,7 @@ impl<'a, C, A> AccountContainerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerUpdateCall<'a, C, A> { @@ -13633,13 +14096,17 @@ impl<'a, C, A> AccountContainerUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13759,7 +14226,7 @@ impl<'a, C, A> AccountContainerTagUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTagUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTagUpdateCall<'a, C, A> { @@ -13940,13 +14408,17 @@ impl<'a, C, A> AccountContainerTagUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerTagUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14066,7 +14538,7 @@ impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -14220,7 +14692,8 @@ impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu self._environment_id = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the environment in storage. + /// When provided, this fingerprint must match the fingerprint of the + /// environment in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerEnvironmentUpdateCall<'a, C, A> { @@ -14247,13 +14720,17 @@ impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14366,7 +14843,7 @@ impl<'a, C, A> AccountContainerFolderCreateCall<'a, C, A> where C: BorrowMut AccountContainerFolderCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerFolderCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14642,7 +15123,7 @@ impl<'a, C, A> AccountContainerFolderListCall<'a, C, A> where C: BorrowMut AccountContainerFolderListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerFolderListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14908,7 +15393,7 @@ impl<'a, C, A> AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVersionUpdateCall<'a, C, A> { @@ -15089,13 +15575,17 @@ impl<'a, C, A> AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -15215,7 +15705,7 @@ impl<'a, C, A> AccountContainerVariableUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVariableUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVariableUpdateCall<'a, C, A> { @@ -15396,13 +15887,17 @@ impl<'a, C, A> AccountContainerVariableUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVariableUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -15510,7 +16005,7 @@ impl<'a, C, A> AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut AccountContainerVersionGetCall<'a, C, A> where C: BorrowMutpublished to retrieve + /// the currently published version. /// /// Sets the *container version id* path property to the given value. /// @@ -15660,13 +16156,17 @@ impl<'a, C, A> AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); diff --git a/gen/tagmanager2-cli/Cargo.toml b/gen/tagmanager2-cli/Cargo.toml index 5f5d37dd40..b3ead06261 100644 --- a/gen/tagmanager2-cli/Cargo.toml +++ b/gen/tagmanager2-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-tagmanager2-cli" -version = "1.0.12+20190516" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2-cli" -homepage = "https://developers.google.com/tag-manager/api/v2/" +homepage = "https://developers.google.com/tag-manager" documentation = "http://byron.github.io/google-apis-rs/google_tagmanager2_cli" license = "MIT" keywords = ["tagmanager", "google", "cli"] @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-tagmanager2] path = "../tagmanager2" -version = "1.0.12+20190516" +version = "1.0.13+20200408" diff --git a/gen/tagmanager2-cli/README.md b/gen/tagmanager2-cli/README.md index d9a8acfa4d..779a6f89bb 100644 --- a/gen/tagmanager2-cli/README.md +++ b/gen/tagmanager2-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *Tag Manager* API can be found at the -[official documentation site](https://developers.google.com/tag-manager/api/v2/). +[official documentation site](https://developers.google.com/tag-manager). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Tag Manager* API at revision *20190516*. The CLI is at version *1.0.12*. +This documentation was generated from the *Tag Manager* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash tagmanager2 [options] diff --git a/gen/tagmanager2-cli/mkdocs.yml b/gen/tagmanager2-cli/mkdocs.yml index 0122d56c55..b5a86e0f33 100644 --- a/gen/tagmanager2-cli/mkdocs.yml +++ b/gen/tagmanager2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Tag Manager v1.0.12+20190516 +site_name: Tag Manager v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-tagmanager2-cli site_description: A complete library to interact with Tag Manager (protocol v2) diff --git a/gen/tagmanager2-cli/src/main.rs b/gen/tagmanager2-cli/src/main.rs index af83afca12..150d8c2bf6 100644 --- a/gen/tagmanager2-cli/src/main.rs +++ b/gen/tagmanager2-cli/src/main.rs @@ -211,8 +211,7 @@ impl<'n> Engine<'n> { "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "authorization-timestamp.nanos" => Some(("authorizationTimestamp.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "authorization-timestamp.seconds" => Some(("authorizationTimestamp.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authorization-timestamp" => Some(("authorizationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -224,7 +223,7 @@ impl<'n> Engine<'n> { "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "nanos", "path", "seconds", "tag-manager-url", "type", "url", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "path", "tag-manager-url", "type", "url", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -463,8 +462,7 @@ impl<'n> Engine<'n> { "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "authorization-timestamp.nanos" => Some(("authorizationTimestamp.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "authorization-timestamp.seconds" => Some(("authorizationTimestamp.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authorization-timestamp" => Some(("authorizationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -476,7 +474,7 @@ impl<'n> Engine<'n> { "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "nanos", "path", "seconds", "tag-manager-url", "type", "url", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "path", "tag-manager-url", "type", "url", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -563,8 +561,7 @@ impl<'n> Engine<'n> { "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "environment-id" => Some(("environmentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "authorization-timestamp.nanos" => Some(("authorizationTimestamp.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "authorization-timestamp.seconds" => Some(("authorizationTimestamp.seconds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "authorization-timestamp" => Some(("authorizationTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enable-debug" => Some(("enableDebug", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -576,7 +573,7 @@ impl<'n> Engine<'n> { "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "nanos", "path", "seconds", "tag-manager-url", "type", "url", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "authorization-code", "authorization-timestamp", "container-id", "container-version-id", "description", "enable-debug", "environment-id", "fingerprint", "name", "path", "tag-manager-url", "type", "url", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2689,29 +2686,33 @@ impl<'n> Engine<'n> { "trigger.check-validation.type" => Some(("trigger.checkValidation.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trigger.check-validation.value" => Some(("trigger.checkValidation.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "trigger.check-validation.key" => Some(("trigger.checkValidation.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.fingerprint" => Some(("tag.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.paused" => Some(("tag.paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag.firing-rule-id" => Some(("tag.firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag.account-id" => Some(("tag.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.priority.type" => Some(("tag.priority.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.priority.value" => Some(("tag.priority.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.priority.key" => Some(("tag.priority.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.workspace-id" => Some(("tag.workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.type" => Some(("tag.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.parent-folder-id" => Some(("tag.parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.schedule-start-ms" => Some(("tag.scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.schedule-end-ms" => Some(("tag.scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.container-id" => Some(("tag.containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.blocking-trigger-id" => Some(("tag.blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "tag.tag-firing-option" => Some(("tag.tagFiringOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.tag-id" => Some(("tag.tagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.parent-folder-id" => Some(("tag.parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.name" => Some(("tag.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.paused" => Some(("tag.paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "tag.blocking-rule-id" => Some(("tag.blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "tag.workspace-id" => Some(("tag.workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.live-only" => Some(("tag.liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "tag.tag-manager-url" => Some(("tag.tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.fingerprint" => Some(("tag.fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.firing-rule-id" => Some(("tag.firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "tag.monitoring-metadata.type" => Some(("tag.monitoringMetadata.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.monitoring-metadata.value" => Some(("tag.monitoringMetadata.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.monitoring-metadata.key" => Some(("tag.monitoringMetadata.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.path" => Some(("tag.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.firing-trigger-id" => Some(("tag.firingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "tag.type" => Some(("tag.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.monitoring-metadata-tag-name-key" => Some(("tag.monitoringMetadataTagNameKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.name" => Some(("tag.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag.notes" => Some(("tag.notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "tag.account-id" => Some(("tag.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "tag.live-only" => Some(("tag.liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "tag.blocking-trigger-id" => Some(("tag.blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "folder.container-id" => Some(("folder.containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "folder.notes" => Some(("folder.notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "folder.workspace-id" => Some(("folder.workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2722,7 +2723,7 @@ impl<'n> Engine<'n> { "folder.account-id" => Some(("folder.accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "folder.name" => Some(("folder.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "blocking-rule-id", "blocking-trigger-id", "case-conversion-type", "change-status", "check-validation", "container-id", "continuous-time-min-milliseconds", "convert-false-to-value", "convert-null-to-value", "convert-true-to-value", "convert-undefined-to-value", "disabling-trigger-id", "enabling-trigger-id", "event-name", "fingerprint", "firing-rule-id", "firing-trigger-id", "folder", "folder-id", "format-value", "horizontal-scroll-percentage-list", "interval", "interval-seconds", "key", "limit", "live-only", "max-timer-length-seconds", "name", "notes", "parent-folder-id", "path", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "selector", "tag", "tag-firing-option", "tag-id", "tag-manager-url", "total-time-min-milliseconds", "trigger", "trigger-id", "type", "unique-trigger-id", "value", "variable", "variable-id", "vertical-scroll-percentage-list", "visibility-selector", "visible-percentage-max", "visible-percentage-min", "wait-for-tags", "wait-for-tags-timeout", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "blocking-rule-id", "blocking-trigger-id", "case-conversion-type", "change-status", "check-validation", "container-id", "continuous-time-min-milliseconds", "convert-false-to-value", "convert-null-to-value", "convert-true-to-value", "convert-undefined-to-value", "disabling-trigger-id", "enabling-trigger-id", "event-name", "fingerprint", "firing-rule-id", "firing-trigger-id", "folder", "folder-id", "format-value", "horizontal-scroll-percentage-list", "interval", "interval-seconds", "key", "limit", "live-only", "max-timer-length-seconds", "monitoring-metadata", "monitoring-metadata-tag-name-key", "name", "notes", "parent-folder-id", "path", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "selector", "tag", "tag-firing-option", "tag-id", "tag-manager-url", "total-time-min-milliseconds", "trigger", "trigger-id", "type", "unique-trigger-id", "value", "variable", "variable-id", "vertical-scroll-percentage-list", "visibility-selector", "visible-percentage-max", "visible-percentage-min", "wait-for-tags", "wait-for-tags-timeout", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2853,31 +2854,35 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "firing-rule-id" => Some(("firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority.type" => Some(("priority.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority.value" => Some(("priority.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority.key" => Some(("priority.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-start-ms" => Some(("scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-end-ms" => Some(("scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "blocking-trigger-id" => Some(("blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "tag-firing-option" => Some(("tagFiringOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag-id" => Some(("tagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "blocking-rule-id" => Some(("blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "firing-rule-id" => Some(("firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "monitoring-metadata.type" => Some(("monitoringMetadata.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "monitoring-metadata.value" => Some(("monitoringMetadata.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "monitoring-metadata.key" => Some(("monitoringMetadata.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "firing-trigger-id" => Some(("firingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "monitoring-metadata-tag-name-key" => Some(("monitoringMetadataTagNameKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "blocking-trigger-id" => Some(("blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "blocking-rule-id", "blocking-trigger-id", "container-id", "fingerprint", "firing-rule-id", "firing-trigger-id", "key", "live-only", "name", "notes", "parent-folder-id", "path", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "tag-manager-url", "type", "value", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "blocking-rule-id", "blocking-trigger-id", "container-id", "fingerprint", "firing-rule-id", "firing-trigger-id", "key", "live-only", "monitoring-metadata", "monitoring-metadata-tag-name-key", "name", "notes", "parent-folder-id", "path", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "tag-manager-url", "type", "value", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3168,31 +3173,35 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "firing-rule-id" => Some(("firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority.type" => Some(("priority.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority.value" => Some(("priority.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "priority.key" => Some(("priority.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-start-ms" => Some(("scheduleStartMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "schedule-end-ms" => Some(("scheduleEndMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "blocking-trigger-id" => Some(("blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "tag-firing-option" => Some(("tagFiringOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag-id" => Some(("tagId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "parent-folder-id" => Some(("parentFolderId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "paused" => Some(("paused", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "blocking-rule-id" => Some(("blockingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "fingerprint" => Some(("fingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "firing-rule-id" => Some(("firingRuleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "monitoring-metadata.type" => Some(("monitoringMetadata.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "monitoring-metadata.value" => Some(("monitoringMetadata.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "monitoring-metadata.key" => Some(("monitoringMetadata.key", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "path" => Some(("path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "firing-trigger-id" => Some(("firingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "monitoring-metadata-tag-name-key" => Some(("monitoringMetadataTagNameKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "notes" => Some(("notes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "live-only" => Some(("liveOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "blocking-trigger-id" => Some(("blockingTriggerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "blocking-rule-id", "blocking-trigger-id", "container-id", "fingerprint", "firing-rule-id", "firing-trigger-id", "key", "live-only", "name", "notes", "parent-folder-id", "path", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "tag-manager-url", "type", "value", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "blocking-rule-id", "blocking-trigger-id", "container-id", "fingerprint", "firing-rule-id", "firing-trigger-id", "key", "live-only", "monitoring-metadata", "monitoring-metadata-tag-name-key", "name", "notes", "parent-folder-id", "path", "paused", "priority", "schedule-end-ms", "schedule-start-ms", "tag-firing-option", "tag-id", "tag-manager-url", "type", "value", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3281,6 +3290,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "template-data" => Some(("templateData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.repository" => Some(("galleryReference.repository", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.is-modified" => Some(("galleryReference.isModified", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "gallery-reference.host" => Some(("galleryReference.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.version" => Some(("galleryReference.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.signature" => Some(("galleryReference.signature", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.owner" => Some(("galleryReference.owner", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3289,7 +3304,7 @@ impl<'n> Engine<'n> { "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "fingerprint", "name", "path", "tag-manager-url", "template-data", "template-id", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "fingerprint", "gallery-reference", "host", "is-modified", "name", "owner", "path", "repository", "signature", "tag-manager-url", "template-data", "template-id", "version", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3582,6 +3597,12 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "template-data" => Some(("templateData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "container-id" => Some(("containerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.repository" => Some(("galleryReference.repository", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.is-modified" => Some(("galleryReference.isModified", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "gallery-reference.host" => Some(("galleryReference.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.version" => Some(("galleryReference.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.signature" => Some(("galleryReference.signature", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gallery-reference.owner" => Some(("galleryReference.owner", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "template-id" => Some(("templateId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "workspace-id" => Some(("workspaceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "tag-manager-url" => Some(("tagManagerUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3590,7 +3611,7 @@ impl<'n> Engine<'n> { "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "fingerprint", "name", "path", "tag-manager-url", "template-data", "template-id", "workspace-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["account-id", "container-id", "fingerprint", "gallery-reference", "host", "is-modified", "name", "owner", "path", "repository", "signature", "tag-manager-url", "template-data", "template-id", "version", "workspace-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5932,12 +5953,15 @@ impl<'n> Engine<'n> { let engine = Engine { opt: opt, hub: api::TagManager::new(client, auth), - gp: vec!["alt", "fields", "key", "oauth-token", "pretty-print", "quota-user", "user-ip"], + gp: vec!["$-xgafv", "access-token", "alt", "callback", "fields", "key", "oauth-token", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), ("oauth-token", "oauth_token"), ("pretty-print", "prettyPrint"), ("quota-user", "quotaUser"), - ("user-ip", "userIp"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), ] }; @@ -5966,7 +5990,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Account's API relative path. Example: accounts/{account_id}."##), + Some(r##"GTM Account's API relative path. + Example: accounts/{account_id}."##), Some(true), Some(false)), @@ -5994,7 +6019,8 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6010,7 +6036,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6038,7 +6065,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + Some(r##"GTM Environment's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), Some(true), Some(false)), @@ -6054,7 +6083,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + Some(r##"GTM Environment's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), Some(true), Some(false)), @@ -6076,7 +6107,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6098,7 +6130,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + Some(r##"GTM Environment's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), Some(true), Some(false)), @@ -6126,7 +6160,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), + Some(r##"GTM Environment's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/environments/{environment_id}"##), Some(true), Some(false)), @@ -6154,7 +6190,8 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6176,7 +6213,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}."##), + Some(r##"GTM Accounts's API relative path. + Example: accounts/{account_id}."##), Some(true), Some(false)), @@ -6198,7 +6236,8 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6226,7 +6265,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6248,7 +6288,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6270,7 +6311,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + Some(r##"GTM ContainerVersion's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), Some(true), Some(false)), @@ -6286,7 +6329,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + Some(r##"GTM ContainerVersion's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), Some(true), Some(false)), @@ -6308,7 +6353,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6330,7 +6376,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + Some(r##"GTM ContainerVersion's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), Some(true), Some(false)), @@ -6347,12 +6395,15 @@ fn main() { Some(false)), ]), ("containers-versions-set-latest", - Some(r##"Sets the latest version used for synchronization of workspaces when detecting conflicts and errors."##), + Some(r##"Sets the latest version used for synchronization of workspaces when + detecting conflicts and errors."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-versions-set-latest", vec![ (Some(r##"path"##), None, - Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + Some(r##"GTM ContainerVersion's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), Some(true), Some(false)), @@ -6374,7 +6425,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + Some(r##"GTM ContainerVersion's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), Some(true), Some(false)), @@ -6396,7 +6449,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), + Some(r##"GTM ContainerVersion's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/versions/{version_id}"##), Some(true), Some(false)), @@ -6424,7 +6479,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6446,7 +6503,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables"##), + Some(r##"GTM BuiltInVariable's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables"##), Some(true), Some(false)), @@ -6462,7 +6521,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6484,7 +6545,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables"##), + Some(r##"GTM BuiltInVariable's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables"##), Some(true), Some(false)), @@ -6506,7 +6569,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM parent Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6529,12 +6593,16 @@ fn main() { Some(false)), ]), ("containers-workspaces-create-version", - Some(r##"Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version."##), + Some(r##"Creates a Container Version from the entities present in the workspace, + deletes the workspace, and sets the base container version to the newly + created version."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-create-version", vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6562,7 +6630,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6578,7 +6648,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6606,7 +6678,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + Some(r##"GTM Folder's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), Some(true), Some(false)), @@ -6622,7 +6696,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + Some(r##"GTM Folder's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), Some(true), Some(false)), @@ -6644,7 +6720,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + Some(r##"GTM Folder's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), Some(true), Some(false)), @@ -6666,7 +6744,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6688,7 +6768,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + Some(r##"GTM Folder's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), Some(true), Some(false)), @@ -6710,7 +6792,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + Some(r##"GTM Folder's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), Some(true), Some(false)), @@ -6732,7 +6816,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), + Some(r##"GTM Folder's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}"##), Some(true), Some(false)), @@ -6760,7 +6846,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6782,7 +6870,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6804,7 +6894,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}"##), + Some(r##"GTM parent Container's API relative path. + Example: accounts/{account_id}/containers/{container_id}"##), Some(true), Some(false)), @@ -6821,12 +6912,15 @@ fn main() { Some(false)), ]), ("containers-workspaces-quick-preview", - Some(r##"Quick previews a workspace by creating a fake container version from all entities in the provided workspace."##), + Some(r##"Quick previews a workspace by creating a fake container version from all + entities in the provided workspace."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-quick-preview", vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6843,12 +6937,15 @@ fn main() { Some(false)), ]), ("containers-workspaces-resolve-conflict", - Some(r##"Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request."##), + Some(r##"Resolves a merge conflict for a workspace entity by updating it to the + resolved entity passed in the request."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-resolve-conflict", vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6865,12 +6962,16 @@ fn main() { Some(true)), ]), ("containers-workspaces-sync", - Some(r##"Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities."##), + Some(r##"Syncs a workspace to the latest container version by updating all + unmodified workspace entities and displaying conflicts for modified + entities."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_containers-workspaces-sync", vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6892,7 +6993,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6920,7 +7023,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + Some(r##"GTM Tag's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), Some(true), Some(false)), @@ -6936,7 +7041,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + Some(r##"GTM Tag's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), Some(true), Some(false)), @@ -6958,7 +7065,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -6980,7 +7089,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + Some(r##"GTM Tag's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), Some(true), Some(false)), @@ -7002,7 +7113,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), + Some(r##"GTM Tag's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}"##), Some(true), Some(false)), @@ -7030,7 +7143,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7058,7 +7173,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), + Some(r##"GTM Custom Template's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), Some(true), Some(false)), @@ -7074,7 +7191,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), + Some(r##"GTM Custom Template's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), Some(true), Some(false)), @@ -7096,7 +7215,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7118,7 +7239,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), + Some(r##"GTM Custom Template's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), Some(true), Some(false)), @@ -7140,7 +7263,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), + Some(r##"GTM Custom Template's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id}"##), Some(true), Some(false)), @@ -7168,7 +7293,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspaces's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7196,7 +7323,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + Some(r##"GTM Trigger's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), Some(true), Some(false)), @@ -7212,7 +7341,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + Some(r##"GTM Trigger's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), Some(true), Some(false)), @@ -7234,7 +7365,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspaces's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7256,7 +7389,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + Some(r##"GTM Trigger's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), Some(true), Some(false)), @@ -7278,7 +7413,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), + Some(r##"GTM Trigger's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}"##), Some(true), Some(false)), @@ -7306,7 +7443,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7334,7 +7473,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7362,7 +7503,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + Some(r##"GTM Variable's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), Some(true), Some(false)), @@ -7378,7 +7521,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + Some(r##"GTM Variable's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), Some(true), Some(false)), @@ -7400,7 +7545,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7422,7 +7569,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + Some(r##"GTM Variable's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), Some(true), Some(false)), @@ -7444,7 +7593,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), + Some(r##"GTM Variable's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}"##), Some(true), Some(false)), @@ -7472,7 +7623,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7500,7 +7653,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), + Some(r##"GTM Zone's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), Some(true), Some(false)), @@ -7516,7 +7671,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), + Some(r##"GTM Zone's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), Some(true), Some(false)), @@ -7538,7 +7695,9 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), + Some(r##"GTM Workspace's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}"##), Some(true), Some(false)), @@ -7560,7 +7719,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), + Some(r##"GTM Zone's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), Some(true), Some(false)), @@ -7582,7 +7743,9 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), + Some(r##"GTM Zone's API relative path. + Example: + accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}"##), Some(true), Some(false)), @@ -7610,7 +7773,8 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}"##), + Some(r##"GTM Accounts's API relative path. + Example: accounts/{account_id}"##), Some(true), Some(false)), @@ -7648,7 +7812,8 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}"##), + Some(r##"GTM Accounts's API relative path. + Example: accounts/{account_id}"##), Some(true), Some(false)), @@ -7676,7 +7841,8 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"GTM Account's API relative path. Example: accounts/{account_id}"##), + Some(r##"GTM Account's API relative path. + Example: accounts/{account_id}"##), Some(true), Some(false)), @@ -7699,12 +7865,14 @@ fn main() { Some(false)), ]), ("user-permissions-delete", - Some(r##"Removes a user from the account, revoking access to it and all of its containers."##), + Some(r##"Removes a user from the account, revoking access to it and all of its + containers."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_user-permissions-delete", vec![ (Some(r##"path"##), None, - Some(r##"GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), + Some(r##"GTM UserPermission's API relative path. + Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), Some(true), Some(false)), @@ -7720,7 +7888,8 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), + Some(r##"GTM UserPermission's API relative path. + Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), Some(true), Some(false)), @@ -7737,12 +7906,14 @@ fn main() { Some(false)), ]), ("user-permissions-list", - Some(r##"List all users that have access to the account along with Account and Container user access granted to each of them."##), + Some(r##"List all users that have access to the account along with Account and + Container user access granted to each of them."##), "Details at http://byron.github.io/google-apis-rs/google_tagmanager2_cli/accounts_user-permissions-list", vec![ (Some(r##"parent"##), None, - Some(r##"GTM Accounts's API relative path. Example: accounts/{account_id}"##), + Some(r##"GTM Accounts's API relative path. + Example: accounts/{account_id}"##), Some(true), Some(false)), @@ -7764,7 +7935,8 @@ fn main() { vec![ (Some(r##"path"##), None, - Some(r##"GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), + Some(r##"GTM UserPermission's API relative path. + Example: accounts/{account_id}/user_permissions/{user_permission_id}"##), Some(true), Some(false)), @@ -7792,8 +7964,9 @@ fn main() { let mut app = App::new("tagmanager2") .author("Sebastian Thiel ") - .version("1.0.12+20190516") - .about("Accesses Tag Manager accounts and containers.") + .version("1.0.13+20200408") + .about("This API allows clients to access and modify container and tag + configuration.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tagmanager2_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/tagmanager2/Cargo.toml b/gen/tagmanager2/Cargo.toml index 4ea93631c4..e4de8ca780 100644 --- a/gen/tagmanager2/Cargo.toml +++ b/gen/tagmanager2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-tagmanager2" -version = "1.0.12+20190516" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with Tag Manager (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2" -homepage = "https://developers.google.com/tag-manager/api/v2/" -documentation = "https://docs.rs/google-tagmanager2/1.0.12+20190516" +homepage = "https://developers.google.com/tag-manager" +documentation = "https://docs.rs/google-tagmanager2/1.0.13+20200408" license = "MIT" keywords = ["tagmanager", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/tagmanager2/README.md b/gen/tagmanager2/README.md index 19a9130d0d..2f9b25bd34 100644 --- a/gen/tagmanager2/README.md +++ b/gen/tagmanager2/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-tagmanager2` library allows access to all features of the *Google Tag Manager* service. -This documentation was generated from *Tag Manager* crate version *1.0.12+20190516*, where *20190516* is the exact revision of the *tagmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Tag Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *tagmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Tag Manager* *v2* API can be found at the -[official documentation site](https://developers.google.com/tag-manager/api/v2/). +[official documentation site](https://developers.google.com/tag-manager). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.TagManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.TagManager.html) ... -* [accounts](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.Account.html) - * [*containers create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerEnvironmentListCall.html), [*containers environments reauthorize*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerEnvironmentReauthorizeCall.html), [*containers environments update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerEnvironmentUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerListCall.html), [*containers update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerUpdateCall.html), [*containers version_headers latest*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionHeaderLatestCall.html), [*containers version_headers list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionHeaderListCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionGetCall.html), [*containers versions live*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionLiveCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionPublishCall.html), [*containers versions set_latest*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionSetLatestCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerVersionUpdateCall.html), [*containers workspaces built_in_variables create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableCreateCall.html), [*containers workspaces built_in_variables delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableDeleteCall.html), [*containers workspaces built_in_variables list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableListCall.html), [*containers workspaces built_in_variables revert*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html), [*containers workspaces create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceCreateCall.html), [*containers workspaces create_version*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceCreateVersionCall.html), [*containers workspaces delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceDeleteCall.html), [*containers workspaces folders create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderCreateCall.html), [*containers workspaces folders delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderDeleteCall.html), [*containers workspaces folders entities*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderEntityCall.html), [*containers workspaces folders get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderGetCall.html), [*containers workspaces folders list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderListCall.html), [*containers workspaces folders move_entities_to_folder*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderMoveEntitiesToFolderCall.html), [*containers workspaces folders revert*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderRevertCall.html), [*containers workspaces folders update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceFolderUpdateCall.html), [*containers workspaces get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceGetCall.html), [*containers workspaces get status*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceGetStatuCall.html), [*containers workspaces list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceListCall.html), [*containers workspaces quick_preview*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceQuickPreviewCall.html), [*containers workspaces resolve_conflict*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceResolveConflictCall.html), [*containers workspaces sync*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceSyncCall.html), [*containers workspaces tags create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTagCreateCall.html), [*containers workspaces tags delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTagDeleteCall.html), [*containers workspaces tags get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTagGetCall.html), [*containers workspaces tags list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTagListCall.html), [*containers workspaces tags revert*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTagRevertCall.html), [*containers workspaces tags update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTagUpdateCall.html), [*containers workspaces templates create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTemplateCreateCall.html), [*containers workspaces templates delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTemplateDeleteCall.html), [*containers workspaces templates get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTemplateGetCall.html), [*containers workspaces templates list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTemplateListCall.html), [*containers workspaces templates revert*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTemplateRevertCall.html), [*containers workspaces templates update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTemplateUpdateCall.html), [*containers workspaces triggers create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTriggerCreateCall.html), [*containers workspaces triggers delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTriggerDeleteCall.html), [*containers workspaces triggers get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTriggerGetCall.html), [*containers workspaces triggers list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTriggerListCall.html), [*containers workspaces triggers revert*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTriggerRevertCall.html), [*containers workspaces triggers update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceTriggerUpdateCall.html), [*containers workspaces update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceUpdateCall.html), [*containers workspaces variables create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceVariableCreateCall.html), [*containers workspaces variables delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceVariableDeleteCall.html), [*containers workspaces variables get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceVariableGetCall.html), [*containers workspaces variables list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceVariableListCall.html), [*containers workspaces variables revert*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceVariableRevertCall.html), [*containers workspaces variables update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceVariableUpdateCall.html), [*containers workspaces zones create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceZoneCreateCall.html), [*containers workspaces zones delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceZoneDeleteCall.html), [*containers workspaces zones get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceZoneGetCall.html), [*containers workspaces zones list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceZoneListCall.html), [*containers workspaces zones revert*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceZoneRevertCall.html), [*containers workspaces zones update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountContainerWorkspaceZoneUpdateCall.html), [*get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountListCall.html), [*update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountUpdateCall.html), [*user_permissions create*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountUserPermissionCreateCall.html), [*user_permissions delete*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountUserPermissionDeleteCall.html), [*user_permissions get*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountUserPermissionGetCall.html), [*user_permissions list*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountUserPermissionListCall.html) and [*user_permissions update*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.AccountUserPermissionUpdateCall.html) +* [accounts](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.Account.html) + * [*containers create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerCreateCall.html), [*containers delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerDeleteCall.html), [*containers environments create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerEnvironmentCreateCall.html), [*containers environments delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerEnvironmentDeleteCall.html), [*containers environments get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerEnvironmentGetCall.html), [*containers environments list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerEnvironmentListCall.html), [*containers environments reauthorize*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerEnvironmentReauthorizeCall.html), [*containers environments update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerEnvironmentUpdateCall.html), [*containers get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerGetCall.html), [*containers list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerListCall.html), [*containers update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerUpdateCall.html), [*containers version_headers latest*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionHeaderLatestCall.html), [*containers version_headers list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionHeaderListCall.html), [*containers versions delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionDeleteCall.html), [*containers versions get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionGetCall.html), [*containers versions live*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionLiveCall.html), [*containers versions publish*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionPublishCall.html), [*containers versions set_latest*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionSetLatestCall.html), [*containers versions undelete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionUndeleteCall.html), [*containers versions update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerVersionUpdateCall.html), [*containers workspaces built_in_variables create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableCreateCall.html), [*containers workspaces built_in_variables delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableDeleteCall.html), [*containers workspaces built_in_variables list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableListCall.html), [*containers workspaces built_in_variables revert*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html), [*containers workspaces create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceCreateCall.html), [*containers workspaces create_version*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceCreateVersionCall.html), [*containers workspaces delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceDeleteCall.html), [*containers workspaces folders create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderCreateCall.html), [*containers workspaces folders delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderDeleteCall.html), [*containers workspaces folders entities*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderEntityCall.html), [*containers workspaces folders get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderGetCall.html), [*containers workspaces folders list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderListCall.html), [*containers workspaces folders move_entities_to_folder*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderMoveEntitiesToFolderCall.html), [*containers workspaces folders revert*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderRevertCall.html), [*containers workspaces folders update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceFolderUpdateCall.html), [*containers workspaces get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceGetCall.html), [*containers workspaces get status*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceGetStatuCall.html), [*containers workspaces list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceListCall.html), [*containers workspaces quick_preview*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceQuickPreviewCall.html), [*containers workspaces resolve_conflict*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceResolveConflictCall.html), [*containers workspaces sync*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceSyncCall.html), [*containers workspaces tags create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTagCreateCall.html), [*containers workspaces tags delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTagDeleteCall.html), [*containers workspaces tags get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTagGetCall.html), [*containers workspaces tags list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTagListCall.html), [*containers workspaces tags revert*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTagRevertCall.html), [*containers workspaces tags update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTagUpdateCall.html), [*containers workspaces templates create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTemplateCreateCall.html), [*containers workspaces templates delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTemplateDeleteCall.html), [*containers workspaces templates get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTemplateGetCall.html), [*containers workspaces templates list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTemplateListCall.html), [*containers workspaces templates revert*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTemplateRevertCall.html), [*containers workspaces templates update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTemplateUpdateCall.html), [*containers workspaces triggers create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTriggerCreateCall.html), [*containers workspaces triggers delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTriggerDeleteCall.html), [*containers workspaces triggers get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTriggerGetCall.html), [*containers workspaces triggers list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTriggerListCall.html), [*containers workspaces triggers revert*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTriggerRevertCall.html), [*containers workspaces triggers update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceTriggerUpdateCall.html), [*containers workspaces update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceUpdateCall.html), [*containers workspaces variables create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceVariableCreateCall.html), [*containers workspaces variables delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceVariableDeleteCall.html), [*containers workspaces variables get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceVariableGetCall.html), [*containers workspaces variables list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceVariableListCall.html), [*containers workspaces variables revert*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceVariableRevertCall.html), [*containers workspaces variables update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceVariableUpdateCall.html), [*containers workspaces zones create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceZoneCreateCall.html), [*containers workspaces zones delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceZoneDeleteCall.html), [*containers workspaces zones get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceZoneGetCall.html), [*containers workspaces zones list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceZoneListCall.html), [*containers workspaces zones revert*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceZoneRevertCall.html), [*containers workspaces zones update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountContainerWorkspaceZoneUpdateCall.html), [*get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountGetCall.html), [*list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountListCall.html), [*update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountUpdateCall.html), [*user_permissions create*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountUserPermissionCreateCall.html), [*user_permissions delete*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountUserPermissionDeleteCall.html), [*user_permissions get*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountUserPermissionGetCall.html), [*user_permissions list*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountUserPermissionListCall.html) and [*user_permissions update*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.AccountUserPermissionUpdateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/struct.TagManager.html)** +* **[Hub](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/struct.TagManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.Part.html)** + * **[Parts](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -212,17 +212,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -232,29 +232,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-tagmanager2/1.0.12+20190516/google_tagmanager2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-tagmanager2/1.0.13+20200408/google_tagmanager2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/tagmanager2/src/lib.rs b/gen/tagmanager2/src/lib.rs index 8f672cf126..47669a9595 100644 --- a/gen/tagmanager2/src/lib.rs +++ b/gen/tagmanager2/src/lib.rs @@ -2,10 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Tag Manager* crate version *1.0.12+20190516*, where *20190516* is the exact revision of the *tagmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Tag Manager* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *tagmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Tag Manager* *v2* API can be found at the -//! [official documentation site](https://developers.google.com/tag-manager/api/v2/). +//! [official documentation site](https://developers.google.com/tag-manager). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/tagmanager2). //! # Features //! @@ -438,8 +438,8 @@ impl<'a, C, A> TagManager TagManager { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), - _base_url: "https://www.googleapis.com/tagmanager/v2/".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), + _base_url: "https://www.googleapis.com/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } } @@ -449,7 +449,7 @@ impl<'a, C, A> TagManager } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -457,7 +457,7 @@ impl<'a, C, A> TagManager } /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/tagmanager/v2/`. + /// It defaults to `https://www.googleapis.com/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { @@ -491,7 +491,9 @@ pub struct SyncWorkspaceResponse { /// Indicates whether synchronization caused a merge conflict or sync error. #[serde(rename="syncStatus")] pub sync_status: Option, - /// The merge conflict after sync. If this field is not empty, the sync is still treated as successful. But a version cannot be created until all conflicts are resolved. + /// The merge conflict after sync. + /// If this field is not empty, the sync is still treated as successful. + /// But a version cannot be created until all conflicts are resolved. #[serde(rename="mergeConflict")] pub merge_conflict: Option>, } @@ -525,6 +527,8 @@ impl ResponseResult for CreateBuiltInVariableResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AccountAccess { /// Whether the user has no access, user access, or admin access to an account. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update pub permission: Option, } @@ -542,14 +546,17 @@ impl Part for AccountAccess {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RevertTemplateResponse { - /// Template as it appears in the latest container version since the last workspace synchronization operation. If no template is present, that means the template was deleted in the latest container version. + /// Template as it appears in the latest container version since the last + /// workspace synchronization operation. If no template is present, that means + /// the template was deleted in the latest container version. pub template: Option, } impl ResponseResult for RevertTemplateResponse {} -/// Represents a Google Tag Manager Container, which specifies the platform tags will run on, manages workspaces, and retains container versions. +/// Represents a Google Tag Manager Container, which specifies the platform tags +/// will run on, manages workspaces, and retains container versions. /// /// # Activities /// @@ -569,19 +576,29 @@ pub struct Container { #[serde(rename="containerId")] pub container_id: Option, /// List of domain names associated with the Container. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update #[serde(rename="domainName")] pub domain_name: Option>, /// Container Notes. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update pub notes: Option, /// Container display name. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update pub name: Option, /// Auto generated link to the tag manager UI #[serde(rename="tagManagerUrl")] pub tag_manager_url: Option, - /// List of Usage Contexts for the Container. Valid values include: web, android, or ios. + /// List of Usage Contexts for the Container. Valid values include: web, + /// android, or ios. + /// @mutable tagmanager.accounts.containers.create + /// @mutable tagmanager.accounts.containers.update #[serde(rename="usageContext")] pub usage_context: Option>, - /// The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified. + /// The fingerprint of the GTM Container as computed at storage time. This + /// value is recomputed whenever the account is modified. pub fingerprint: Option, /// GTM Container's API relative path. pub path: Option, @@ -626,7 +643,8 @@ pub struct Zone { /// Auto generated link to the tag manager UI #[serde(rename="tagManagerUrl")] pub tag_manager_url: Option, - /// The fingerprint of the GTM Zone as computed at storage time. This value is recomputed whenever the zone is modified. + /// The fingerprint of the GTM Zone as computed at storage time. + /// This value is recomputed whenever the zone is modified. pub fingerprint: Option, /// GTM Zone's API relative path. pub path: Option, @@ -686,7 +704,9 @@ pub struct ListVariablesResponse { impl ResponseResult for ListVariablesResponse {} -/// Represents a Google Tag Manager Environment. Note that a user can create, delete and update environments of type USER, but can only update the enable_debug and url fields of environments of other types. +/// Represents a Google Tag Manager Environment. Note that a user can create, +/// delete and update environments of type USER, but can only update the +/// enable_debug and url fields of environments of other types. /// /// # Activities /// @@ -703,17 +723,24 @@ pub struct Environment { /// The environment authorization code. #[serde(rename="authorizationCode")] pub authorization_code: Option, - /// The environment description. Can be set or changed only on USER type environments. + /// The environment description. Can be set or changed only on USER type + /// environments. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update pub description: Option, /// GTM Environment ID uniquely identifies the GTM Environment. #[serde(rename="environmentId")] pub environment_id: Option, /// Default preview page url for the environment. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update pub url: Option, /// The last update time-stamp for the authorization code. #[serde(rename="authorizationTimestamp")] - pub authorization_timestamp: Option, + pub authorization_timestamp: Option, /// Whether or not to enable debug by default for the environment. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update #[serde(rename="enableDebug")] pub enable_debug: Option, /// GTM Container ID. @@ -728,7 +755,8 @@ pub struct Environment { /// Represents a link to a container version. #[serde(rename="containerVersionId")] pub container_version_id: Option, - /// The fingerprint of the GTM environment as computed at storage time. This value is recomputed whenever the environment is modified. + /// The fingerprint of the GTM environment as computed at storage time. + /// This value is recomputed whenever the environment is modified. pub fingerprint: Option, /// GTM Environment's API relative path. pub path: Option, @@ -738,7 +766,10 @@ pub struct Environment { /// The type of this environment. #[serde(rename="type")] pub type_: Option, - /// The environment display name. Can be set or changed only on USER type environments. + /// The environment display name. Can be set or changed only on USER type + /// environments. + /// @mutable tagmanager.accounts.containers.environments.create + /// @mutable tagmanager.accounts.containers.environments.update pub name: Option, } @@ -760,14 +791,19 @@ impl ResponseResult for Environment {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UserPermission { /// GTM Container access permissions. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update #[serde(rename="containerAccess")] pub container_access: Option>, /// GTM UserPermission's API relative path. pub path: Option, /// GTM Account access permissions. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update #[serde(rename="accountAccess")] pub account_access: Option, /// User's email address. + /// @mutable tagmanager.accounts.permissions.create #[serde(rename="emailAddress")] pub email_address: Option, /// The Account ID uniquely identifies the GTM Account. @@ -791,7 +827,8 @@ pub struct VariableFormatValue { /// The value to convert if a variable value is false. #[serde(rename="convertFalseToValue")] pub convert_false_to_value: Option, - /// The option to convert a string-type variable value to either lowercase or uppercase. + /// The option to convert a string-type variable value to either lowercase or + /// uppercase. #[serde(rename="caseConversionType")] pub case_conversion_type: Option, /// The value to convert if a variable value is null. @@ -812,9 +849,13 @@ impl Part for VariableFormatValue {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContainerAccess { /// GTM Container ID. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update #[serde(rename="containerId")] pub container_id: Option, /// List of Container permissions. + /// @mutable tagmanager.accounts.permissions.create + /// @mutable tagmanager.accounts.permissions.update pub permission: Option, } @@ -861,8 +902,12 @@ pub struct Folder { #[serde(rename="containerId")] pub container_id: Option, /// User notes on how to apply this folder in the container. + /// @mutable tagmanager.accounts.containers.workspaces.folders.create + /// @mutable tagmanager.accounts.containers.workspaces.folders.update pub notes: Option, /// Folder display name. + /// @mutable tagmanager.accounts.containers.workspaces.folders.create + /// @mutable tagmanager.accounts.containers.workspaces.folders.update pub name: Option, /// GTM Workspace ID. #[serde(rename="workspaceId")] @@ -870,7 +915,8 @@ pub struct Folder { /// Auto generated link to the tag manager UI #[serde(rename="tagManagerUrl")] pub tag_manager_url: Option, - /// The fingerprint of the GTM Folder as computed at storage time. This value is recomputed whenever the folder is modified. + /// The fingerprint of the GTM Folder as computed at storage time. + /// This value is recomputed whenever the folder is modified. pub fingerprint: Option, /// GTM Folder's API relative path. pub path: Option, @@ -893,20 +939,62 @@ impl ResponseResult for Folder {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Parameter { /// This map parameter's parameters (must have keys; keys must be unique). + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub map: Option>, /// This list parameter's parameters (keys will be ignored). + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub list: Option>, - /// The named key that uniquely identifies a parameter. Required for top-level parameters, as well as map values. Ignored for list values. + /// The named key that uniquely identifies a parameter. Required for top-level + /// parameters, as well as map values. Ignored for list values. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub key: Option, - /// A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. + /// A parameter's value (may contain variable references such as + /// "{{myVariable}}") + /// as appropriate to the specified type. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub value: Option, - /// The parameter type. Valid values are: - /// - boolean: The value represents a boolean, represented as 'true' or 'false' - /// - integer: The value represents a 64-bit signed integer value, in base 10 - /// - list: A list of parameters should be specified - /// - map: A map of parameters should be specified - /// - template: The value represents any text; this can include variable references (even variable references that might return non-string types) - /// - trigger_reference: The value represents a trigger, represented as the trigger id + /// The parameter type. Valid values are:
            + /// + ///
          • boolean: The value represents a boolean, represented as + /// 'true' or 'false'
          • + ///
          • integer: The value represents a 64-bit signed integer + /// value, in base 10
          • + ///
          • list: A list of parameters should be specified
          • + ///
          • map: A map of parameters should be specified
          • + ///
          • template: The value represents any text; this can include + /// variable references (even variable references that might return + /// non-string types)
          • + ///
          • trigger_reference: The value represents a trigger, + /// represented as the trigger id
          • + ///
          • tag_reference: The value represents a tag, represented as + /// the tag name
          • + ///
          + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="type")] pub type_: Option, } @@ -928,7 +1016,8 @@ pub struct QuickPreviewResponse { /// The quick previewed container version. #[serde(rename="containerVersion")] pub container_version: Option, - /// Whether quick previewing failed when syncing the workspace to the latest container version. + /// Whether quick previewing failed when syncing the workspace to the latest + /// container version. #[serde(rename="syncStatus")] pub sync_status: Option, /// Were there compiler errors or not. @@ -950,7 +1039,9 @@ impl ResponseResult for QuickPreviewResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RevertFolderResponse { - /// Folder as it appears in the latest container version since the last workspace synchronization operation. If no folder is present, that means the folder was deleted in the latest container version. + /// Folder as it appears in the latest container version since the last + /// workspace synchronization operation. If no folder is present, that means + /// the folder was deleted in the latest container version. pub folder: Option, } @@ -978,7 +1069,8 @@ pub struct ListFoldersResponse { impl ResponseResult for ListFoldersResponse {} -/// The changes that have occurred in the workspace since the base container version. +/// The changes that have occurred in the workspace since the base container +/// version. /// /// # Activities /// @@ -1021,63 +1113,6 @@ pub struct ListTemplatesResponse { impl ResponseResult for ListTemplatesResponse {} -/// A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. -/// -/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). -/// -/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. -/// -/// # Examples -/// -/// Example 1: Compute Timestamp from POSIX `time()`. -/// -/// Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); -/// -/// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -/// -/// struct timeval tv; gettimeofday(&tv, NULL); -/// -/// Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); -/// -/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -/// -/// FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -/// -/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -/// -/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -/// -/// long millis = System.currentTimeMillis(); -/// -/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); -/// -/// -/// -/// Example 5: Compute Timestamp from current time in Python. -/// -/// timestamp = Timestamp() timestamp.GetCurrentTime() -/// -/// # JSON Mapping -/// -/// In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). -/// -/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. -/// -/// In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D ) to obtain a formatter capable of generating timestamps in this format. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Timestamp { - /// Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. - pub nanos: Option, - /// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - pub seconds: Option, -} - -impl Part for Timestamp {} - - /// Represents a child container of a Zone. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1121,10 +1156,14 @@ impl ResponseResult for ListTriggersResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MergeConflict { - /// The base version entity (since the latest sync operation) that has conflicting changes compared to the workspace. If this field is missing, it means the workspace entity is deleted from the base version. + /// The base version entity (since the latest sync operation) that has + /// conflicting changes compared to the workspace. If this field is missing, + /// it means the workspace entity is deleted from the base version. #[serde(rename="entityInBaseVersion")] pub entity_in_base_version: Option, - /// The workspace entity that has conflicting changes compared to the base version. If an entity is deleted in a workspace, it will still appear with a deleted change status. + /// The workspace entity that has conflicting changes compared to the + /// base version. If an entity is deleted in a workspace, it will still + /// appear with a deleted change status. #[serde(rename="entityInWorkspace")] pub entity_in_workspace: Option, } @@ -1132,13 +1171,16 @@ pub struct MergeConflict { impl Part for MergeConflict {} -/// Represents a reference to atag that fires before another tag in order to set up dependencies. +/// Represents a reference to atag that fires before another tag in order to +/// set up dependencies. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetupTag { - /// If true, fire the main tag if and only if the setup tag fires successfully. If false, fire the main tag regardless of setup tag firing status. + /// If true, fire the main tag if and only if the setup tag fires + /// successfully. + /// If false, fire the main tag regardless of setup tag firing status. #[serde(rename="stopOnSetupFailure")] pub stop_on_setup_failure: Option, /// The name of the setup tag. @@ -1250,7 +1292,9 @@ pub struct ContainerVersion { /// The Container Version ID uniquely identifies the GTM Container Version. #[serde(rename="containerVersionId")] pub container_version_id: Option, - /// The fingerprint of the GTM Container Version as computed at storage time. This value is recomputed whenever the container version is modified. + /// The fingerprint of the GTM Container Version as computed at + /// storage time. This value is recomputed whenever the container version is + /// modified. pub fingerprint: Option, /// The variables in the container that this version was taken from. pub variable: Option>, @@ -1265,16 +1309,20 @@ pub struct ContainerVersion { /// The container that this version was taken from. pub container: Option, /// Container version display name. + /// @mutable tagmanager.accounts.containers.versions.update pub name: Option, /// The zones in the container that this version was taken from. pub zone: Option>, + /// The triggers in the container that this version was taken from. + pub trigger: Option>, /// Container version description. + /// @mutable tagmanager.accounts.containers.versions.update pub description: Option, /// The built-in variables in the container that this version was taken from. #[serde(rename="builtInVariable")] pub built_in_variable: Option>, - /// The triggers in the container that this version was taken from. - pub trigger: Option>, + /// The clients in the container that this version was taken from. + pub client: Option>, /// The folders in the container that this version was taken from. pub folder: Option>, } @@ -1311,7 +1359,9 @@ impl Part for SyncStatus {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RevertTriggerResponse { - /// Trigger as it appears in the latest container version since the last workspace synchronization operation. If no trigger is present, that means the trigger was deleted in the latest container version. + /// Trigger as it appears in the latest container version since the last + /// workspace synchronization operation. If no trigger is present, that means + /// the trigger was deleted in the latest container version. pub trigger: Option, } @@ -1332,21 +1382,30 @@ impl ResponseResult for RevertTriggerResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Variable { /// The start timestamp in milliseconds to schedule a variable. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update #[serde(rename="scheduleStartMs")] pub schedule_start_ms: Option, /// The end timestamp in milliseconds to schedule a variable. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update #[serde(rename="scheduleEndMs")] pub schedule_end_ms: Option, /// GTM Container ID. #[serde(rename="containerId")] pub container_id: Option, - /// For mobile containers only: A list of trigger IDs for enabling conditional variables; the variable is enabled if one of the enabling triggers is true while all the disabling triggers are false. Treated as an unordered set. + /// For mobile containers only: A list of trigger IDs for enabling conditional + /// variables; the variable is enabled if one of the enabling triggers is true + /// while all the disabling triggers are false. Treated as an unordered set. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update #[serde(rename="enablingTriggerId")] pub enabling_trigger_id: Option>, /// Auto generated link to the tag manager UI #[serde(rename="tagManagerUrl")] pub tag_manager_url: Option, - /// The fingerprint of the GTM Variable as computed at storage time. This value is recomputed whenever the variable is modified. + /// The fingerprint of the GTM Variable as computed at storage time. + /// This value is recomputed whenever the variable is modified. pub fingerprint: Option, /// GTM Variable's API relative path. pub path: Option, @@ -1354,13 +1413,19 @@ pub struct Variable { #[serde(rename="accountId")] pub account_id: Option, /// Variable display name. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update pub name: Option, /// The Variable ID uniquely identifies the GTM Variable. #[serde(rename="variableId")] pub variable_id: Option, /// The variable's parameters. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update pub parameter: Option>, /// User notes on how to apply this variable in the container. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update pub notes: Option, /// Option to convert a variable value to other value. #[serde(rename="formatValue")] @@ -1369,12 +1434,18 @@ pub struct Variable { #[serde(rename="workspaceId")] pub workspace_id: Option, /// GTM Variable Type. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update #[serde(rename="type")] pub type_: Option, /// Parent folder id. #[serde(rename="parentFolderId")] pub parent_folder_id: Option, - /// For mobile containers only: A list of trigger IDs for disabling conditional variables; the variable is enabled if one of the enabling trigger is true while all the disabling trigger are false. Treated as an unordered set. + /// For mobile containers only: A list of trigger IDs for disabling conditional + /// variables; the variable is enabled if one of the enabling trigger is true + /// while all the disabling trigger are false. Treated as an unordered set. + /// @mutable tagmanager.accounts.containers.workspaces.variables.create + /// @mutable tagmanager.accounts.containers.workspaces.variables.update #[serde(rename="disablingTriggerId")] pub disabling_trigger_id: Option>, } @@ -1394,7 +1465,9 @@ impl ResponseResult for Variable {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RevertVariableResponse { - /// Variable as it appears in the latest container version since the last workspace synchronization operation. If no variable is present, that means the variable was deleted in the latest container version. + /// Variable as it appears in the latest container version since the last + /// workspace synchronization operation. If no variable is present, that means + /// the variable was deleted in the latest container version. pub variable: Option, } @@ -1420,7 +1493,11 @@ pub struct CustomTemplate { /// GTM Container ID. #[serde(rename="containerId")] pub container_id: Option, - /// The fingerprint of the GTM Custom Template as computed at storage time. This value is recomputed whenever the template is modified. + /// A reference to the Community Template Gallery entry. + #[serde(rename="galleryReference")] + pub gallery_reference: Option, + /// The fingerprint of the GTM Custom Template as computed at storage time. + /// This value is recomputed whenever the template is modified. pub fingerprint: Option, /// Custom Template display name. pub name: Option, @@ -1450,13 +1527,28 @@ impl ResponseResult for CustomTemplate {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Condition { - /// A list of named parameters (key/value), depending on the condition's type. Notes: - /// - For binary operators, include parameters named arg0 and arg1 for specifying the left and right operands, respectively. - /// - At this time, the left operand (arg0) must be a reference to a variable. - /// - For case-insensitive Regex matching, include a boolean parameter named ignore_case that is set to true. If not specified or set to any other value, the matching will be case sensitive. - /// - To negate an operator, include a boolean parameter named negate boolean parameter that is set to true. + /// A list of named parameters (key/value), depending on the condition's type. + /// Notes:
            + /// + ///
          • For binary operators, include parameters named arg0 and + /// arg1 for specifying the left and right operands, + /// respectively.
          • + ///
          • At this time, the left operand (arg0) must be a reference + /// to a variable.
          • + ///
          • For case-insensitive Regex matching, include a boolean parameter named + /// ignore_case that is set to true. + /// If not specified or set to any other value, the matching will be case + /// sensitive.
          • + ///
          • To negate an operator, include a boolean parameter named + /// negate boolean parameter that is set to true. + ///
          • + ///
          + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update pub parameter: Option>, /// The type of operator for this condition. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update #[serde(rename="type")] pub type_: Option, } @@ -1464,6 +1556,24 @@ pub struct Condition { impl Part for Condition {} +/// The result of reverting a built-in variable in a workspace. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [containers workspaces built_in_variables revert accounts](struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevertBuiltInVariableResponse { + /// Whether the built-in variable is enabled after reversion. + pub enabled: Option, +} + +impl ResponseResult for RevertBuiltInVariableResponse {} + + /// Represents a Google Tag Manager Account. /// /// # Activities @@ -1555,10 +1665,19 @@ impl Part for Condition {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Account { /// Account display name. + /// @mutable tagmanager.accounts.create + /// @mutable tagmanager.accounts.update pub name: Option, - /// The fingerprint of the GTM Account as computed at storage time. This value is recomputed whenever the account is modified. + /// The fingerprint of the GTM Account as computed at storage time. + /// This value is recomputed whenever the account is modified. pub fingerprint: Option, - /// Whether the account shares data anonymously with Google and others. This flag enables benchmarking by sharing your data in an anonymous form. Google will remove all identifiable information about your website, combine the data with hundreds of other anonymous sites and report aggregate trends in the benchmarking service. + /// Whether the account shares data anonymously with Google and others. + /// This flag enables benchmarking by sharing your data in an anonymous form. + /// Google will remove all identifiable information about your website, combine + /// the data with hundreds of other anonymous sites and report aggregate trends + /// in the benchmarking service. + /// @mutable tagmanager.accounts.create + /// @mutable tagmanager.accounts.update #[serde(rename="shareData")] pub share_data: Option, /// GTM Account's API relative path. @@ -1603,7 +1722,9 @@ impl Part for ZoneTypeRestriction {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RevertTagResponse { - /// Tag as it appears in the latest container version since the last workspace synchronization operation. If no tag is present, that means the tag was deleted in the latest container version. + /// Tag as it appears in the latest container version since the last + /// workspace synchronization operation. If no tag is present, that means + /// the tag was deleted in the latest container version. pub tag: Option, } @@ -1631,7 +1752,10 @@ pub struct ListAccountsResponse { impl ResponseResult for ListAccountsResponse {} -/// Built-in variables are a special category of variables that are pre-created and non-customizable. They provide common functionality like accessing propeties of the gtm data layer, monitoring clicks, or accessing elements of a page URL. +/// Built-in variables are a special category of variables that are pre-created +/// and non-customizable. They provide common functionality like accessing +/// propeties of the gtm data layer, monitoring clicks, or accessing elements +/// of a page URL. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1649,6 +1773,8 @@ pub struct BuiltInVariable { #[serde(rename="accountId")] pub account_id: Option, /// Type of built-in variable. + /// @required.tagmanager.accounts.containers.workspaces.built_in_variable.update + /// @mutable tagmanager.accounts.containers.workspaces.built_in_variable.update #[serde(rename="type")] pub type_: Option, /// Name of the built-in variable to be used to refer to the built-in variable. @@ -1658,112 +1784,6 @@ pub struct BuiltInVariable { impl Part for BuiltInVariable {} -/// Represents a Google Tag Manager Trigger -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [containers workspaces triggers update accounts](struct.AccountContainerWorkspaceTriggerUpdateCall.html) (request|response) -/// * [containers workspaces triggers create accounts](struct.AccountContainerWorkspaceTriggerCreateCall.html) (request|response) -/// * [containers workspaces triggers get accounts](struct.AccountContainerWorkspaceTriggerGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Trigger { - /// Max time to fire Timer Events (in seconds). Only valid for AMP Timer trigger. - #[serde(rename="maxTimerLengthSeconds")] - pub max_timer_length_seconds: Option, - /// A visibility trigger minimum total visible time (in milliseconds). Only valid for AMP Visibility trigger. - #[serde(rename="totalTimeMinMilliseconds")] - pub total_time_min_milliseconds: Option, - /// Globally unique id of the trigger that auto-generates this (a Form Submit, Link Click or Timer listener) if any. Used to make incompatible auto-events work together with trigger filtering based on trigger ids. This value is populated during output generation since the tags implied by triggers don't exist until then. Only valid for Form Submit, Link Click and Timer triggers. - #[serde(rename="uniqueTriggerId")] - pub unique_trigger_id: Option, - /// List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled vertically. Only valid for AMP scroll triggers. - #[serde(rename="verticalScrollPercentageList")] - pub vertical_scroll_percentage_list: Option, - /// A visibility trigger minimum continuous visible time (in milliseconds). Only valid for AMP Visibility trigger. - #[serde(rename="continuousTimeMinMilliseconds")] - pub continuous_time_min_milliseconds: Option, - /// List of integer percentage values for scroll triggers. The trigger will fire when each percentage is reached when the view is scrolled horizontally. Only valid for AMP scroll triggers. - #[serde(rename="horizontalScrollPercentageList")] - pub horizontal_scroll_percentage_list: Option, - /// GTM Account ID. - #[serde(rename="accountId")] - pub account_id: Option, - /// Whether or not we should delay the form submissions or link opening until all of the tags have fired (by preventing the default action and later simulating the default action). Only valid for Form Submission and Link Click triggers. - #[serde(rename="waitForTags")] - pub wait_for_tags: Option, - /// Time between Timer Events to fire (in seconds). Only valid for AMP Timer trigger. - #[serde(rename="intervalSeconds")] - pub interval_seconds: Option, - /// Name of the GTM event that is fired. Only valid for Timer triggers. - #[serde(rename="eventName")] - pub event_name: Option, - /// A visibility trigger CSS selector (i.e. "#id"). Only valid for AMP Visibility trigger. - #[serde(rename="visibilitySelector")] - pub visibility_selector: Option, - /// GTM Workspace ID. - #[serde(rename="workspaceId")] - pub workspace_id: Option, - /// Used in the case of custom event, which is fired iff all Conditions are true. - #[serde(rename="customEventFilter")] - pub custom_event_filter: Option>, - /// Additional parameters. - pub parameter: Option>, - /// Parent folder id. - #[serde(rename="parentFolderId")] - pub parent_folder_id: Option, - /// GTM Container ID. - #[serde(rename="containerId")] - pub container_id: Option, - /// A click trigger CSS selector (i.e. "a", "button" etc.). Only valid for AMP Click trigger. - pub selector: Option, - /// The Trigger ID uniquely identifies the GTM Trigger. - #[serde(rename="triggerId")] - pub trigger_id: Option, - /// Auto generated link to the tag manager UI - #[serde(rename="tagManagerUrl")] - pub tag_manager_url: Option, - /// The fingerprint of the GTM Trigger as computed at storage time. This value is recomputed whenever the trigger is modified. - pub fingerprint: Option, - /// A visibility trigger maximum percent visibility. Only valid for AMP Visibility trigger. - #[serde(rename="visiblePercentageMax")] - pub visible_percentage_max: Option, - /// GTM Trigger's API relative path. - pub path: Option, - /// Trigger display name. - pub name: Option, - /// A visibility trigger minimum percent visibility. Only valid for AMP Visibility trigger. - #[serde(rename="visiblePercentageMin")] - pub visible_percentage_min: Option, - /// Defines the data layer event that causes this trigger. - #[serde(rename="type")] - pub type_: Option, - /// User notes on how to apply this trigger in the container. - pub notes: Option, - /// Time between triggering recurring Timer Events (in milliseconds). Only valid for Timer triggers. - pub interval: Option, - /// The trigger will only fire iff all Conditions are true. - pub filter: Option>, - /// How long to wait (in milliseconds) for tags to fire when 'waits_for_tags' above evaluates to true. Only valid for Form Submission and Link Click triggers. - #[serde(rename="waitForTagsTimeout")] - pub wait_for_tags_timeout: Option, - /// Limit of the number of GTM events this Timer Trigger will fire. If no limit is set, we will continue to fire GTM events until the user leaves the page. Only valid for Timer triggers. - pub limit: Option, - /// Whether or not we should only fire tags if the form submit or link click event is not cancelled by some other event handler (e.g. because of validation). Only valid for Form Submission and Link Click triggers. - #[serde(rename="checkValidation")] - pub check_validation: Option, - /// Used in the case of auto event tracking. - #[serde(rename="autoEventFilter")] - pub auto_event_filter: Option>, -} - -impl RequestValue for Trigger {} -impl ResponseResult for Trigger {} - - /// Publish container version response. /// /// # Activities @@ -1821,9 +1841,13 @@ impl ResponseResult for ListWorkspacesResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Tag { /// The start timestamp in milliseconds to schedule a tag. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="scheduleStartMs")] pub schedule_start_ms: Option, /// The end timestamp in milliseconds to schedule a tag. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="scheduleEndMs")] pub schedule_end_ms: Option, /// GTM Container ID. @@ -1835,20 +1859,46 @@ pub struct Tag { /// The Tag ID uniquely identifies the GTM Tag. #[serde(rename="tagId")] pub tag_id: Option, + /// The fingerprint of the GTM Tag as computed at storage time. + /// This value is recomputed whenever the tag is modified. + pub fingerprint: Option, /// Indicates whether the tag is paused, which prevents the tag from firing. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub paused: Option, /// The list of setup tags. Currently we only allow one. #[serde(rename="setupTag")] pub setup_tag: Option>, - /// Blocking rule IDs. If any of the listed rules evaluate to true, the tag will not fire. + /// Blocking rule IDs. If any of the listed rules evaluate to true, the tag + /// will not fire. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="blockingRuleId")] pub blocking_rule_id: Option>, + /// If non-empty, then the tag display name will be included in the monitoring + /// metadata map using the key specified. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update + #[serde(rename="monitoringMetadataTagNameKey")] + pub monitoring_metadata_tag_name_key: Option, /// Auto generated link to the tag manager UI #[serde(rename="tagManagerUrl")] pub tag_manager_url: Option, - /// The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified. - pub fingerprint: Option, - /// Firing rule IDs. A tag will fire when any of the listed rules are true and all of its blockingRuleIds (if any specified) are false. + /// A map of key-value pairs of tag metadata to be included in the event data + /// for tag monitoring. + /// Notes:
            + ///
          • This parameter must be type MAP.
          • + ///
          • Each parameter in the map are type TEMPLATE, however + /// cannot contain variable references.
          • + ///
          + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update + #[serde(rename="monitoringMetadata")] + pub monitoring_metadata: Option, + /// Firing rule IDs. A tag will fire when any of the listed rules are true and + /// all of its blockingRuleIds (if any specified) are false. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="firingRuleId")] pub firing_rule_id: Option>, /// GTM Tag's API relative path. @@ -1859,27 +1909,49 @@ pub struct Tag { /// GTM Account ID. #[serde(rename="accountId")] pub account_id: Option, - /// Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false. + /// Firing trigger IDs. A tag will fire when any of the listed triggers are + /// true and all of its blockingTriggerIds (if any specified) are + /// false. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="firingTriggerId")] pub firing_trigger_id: Option>, /// Tag display name. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub name: Option, /// The tag's parameters. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub parameter: Option>, /// User notes on how to apply this tag in the container. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub notes: Option, - /// Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire. + /// Blocking trigger IDs. If any of the listed triggers evaluate to true, the + /// tag will not fire. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="blockingTriggerId")] pub blocking_trigger_id: Option>, - /// User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag's priority can be a positive or negative value. The default value is 0. + /// User defined numeric priority of the tag. Tags are fired asynchronously in + /// order of priority. Tags with higher numeric value fire first. A tag's + /// priority can be a positive or negative value. The default value is 0. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update pub priority: Option, /// GTM Workspace ID. #[serde(rename="workspaceId")] pub workspace_id: Option, - /// If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode). + /// If set to true, this tag will only fire in the live environment (e.g. not + /// in preview or debug mode). + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="liveOnly")] pub live_only: Option, /// GTM Tag Type. + /// @mutable tagmanager.accounts.containers.workspaces.tags.create + /// @mutable tagmanager.accounts.containers.workspaces.tags.update #[serde(rename="type")] pub type_: Option, /// Parent folder id. @@ -1927,13 +1999,16 @@ impl ResponseResult for FolderEntities {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateContainerVersionResponse { - /// Auto generated workspace path created as a result of version creation. This field should only be populated if the created version was not a quick preview. + /// Auto generated workspace path created as a result of version creation. This + /// field should only be populated if the created version was not a quick + /// preview. #[serde(rename="newWorkspacePath")] pub new_workspace_path: Option, /// The container version created. #[serde(rename="containerVersion")] pub container_version: Option, - /// Whether version creation failed when syncing the workspace to the latest container version. + /// Whether version creation failed when syncing the workspace to the latest + /// container version. #[serde(rename="syncStatus")] pub sync_status: Option, /// Compiler errors or not. @@ -1958,6 +2033,8 @@ impl ResponseResult for CreateContainerVersionResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Workspace { /// Workspace description. + /// @mutable tagmanager.accounts.containers.workspaces.create + /// @mutable tagmanager.accounts.containers.workspaces.update pub description: Option, /// GTM Container ID. #[serde(rename="containerId")] @@ -1968,7 +2045,8 @@ pub struct Workspace { /// Auto generated link to the tag manager UI #[serde(rename="tagManagerUrl")] pub tag_manager_url: Option, - /// The fingerprint of the GTM Workspace as computed at storage time. This value is recomputed whenever the workspace is modified. + /// The fingerprint of the GTM Workspace as computed at storage time. This + /// value is recomputed whenever the workspace is modified. pub fingerprint: Option, /// GTM Workspace's API relative path. pub path: Option, @@ -1976,6 +2054,8 @@ pub struct Workspace { #[serde(rename="accountId")] pub account_id: Option, /// Workspace display name. + /// @mutable tagmanager.accounts.containers.workspaces.create + /// @mutable tagmanager.accounts.containers.workspaces.update pub name: Option, } @@ -1991,7 +2071,8 @@ impl ResponseResult for Workspace {} pub struct ZoneBoundary { /// The conditions that, when conjoined, make up the boundary. pub condition: Option>, - /// Custom evaluation trigger IDs. A zone will evaluate its boundary conditions when any of the listed triggers are true. + /// Custom evaluation trigger IDs. A zone will evaluate its boundary + /// conditions when any of the listed triggers are true. #[serde(rename="customEvaluationTriggerId")] pub custom_evaluation_trigger_id: Option>, } @@ -2063,6 +2144,32 @@ pub struct ListTagsResponse { impl ResponseResult for ListTagsResponse {} +/// Represents the link between a custom template and an entry on the Community +/// Template Gallery site. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GalleryReference { + /// The name of the host for the community gallery template. + pub host: Option, + /// The version of the community gallery template. + pub version: Option, + /// The name of the repository for the community gallery template. + pub repository: Option, + /// If a user has manually edited the community gallery template. + #[serde(rename="isModified")] + pub is_modified: Option, + /// The name of the owner for the community gallery template. + pub owner: Option, + /// The signature of the community gallery template as computed at import time. + /// This value is recomputed whenever the template is updated from the gallery. + pub signature: Option, +} + +impl Part for GalleryReference {} + + /// Options for new container versions. /// /// # Activities @@ -2083,7 +2190,8 @@ pub struct CreateContainerVersionRequestVersionOptions { impl RequestValue for CreateContainerVersionRequestVersionOptions {} -/// A workspace entity that may represent a tag, trigger, variable, or folder in addition to its status in the workspace. +/// A workspace entity that may represent a tag, trigger, variable, or folder in +/// addition to its status in the workspace. /// /// # Activities /// @@ -2110,22 +2218,235 @@ pub struct Entity { impl RequestValue for Entity {} -/// The result of reverting a built-in variable in a workspace. +/// Represents a Google Tag Manager Trigger /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [containers workspaces built_in_variables revert accounts](struct.AccountContainerWorkspaceBuiltInVariableRevertCall.html) (response) +/// * [containers workspaces triggers update accounts](struct.AccountContainerWorkspaceTriggerUpdateCall.html) (request|response) +/// * [containers workspaces triggers create accounts](struct.AccountContainerWorkspaceTriggerCreateCall.html) (request|response) +/// * [containers workspaces triggers get accounts](struct.AccountContainerWorkspaceTriggerGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RevertBuiltInVariableResponse { - /// Whether the built-in variable is enabled after reversion. - pub enabled: Option, +pub struct Trigger { + /// Max time to fire Timer Events (in seconds). Only valid for AMP Timer + /// trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="maxTimerLengthSeconds")] + pub max_timer_length_seconds: Option, + /// A visibility trigger minimum total visible time (in milliseconds). + /// Only valid for AMP Visibility trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="totalTimeMinMilliseconds")] + pub total_time_min_milliseconds: Option, + /// Globally unique id of the trigger that auto-generates this (a Form Submit, + /// Link Click or Timer listener) if any. Used to make incompatible auto-events + /// work together with trigger filtering based on trigger ids. This value is + /// populated during output generation since the tags implied by triggers don't + /// exist until then. Only valid for Form Submit, Link Click and Timer + /// triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="uniqueTriggerId")] + pub unique_trigger_id: Option, + /// List of integer percentage values for scroll triggers. The trigger will + /// fire when each percentage is reached when the view is scrolled vertically. + /// Only valid for AMP scroll triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="verticalScrollPercentageList")] + pub vertical_scroll_percentage_list: Option, + /// A visibility trigger minimum continuous visible time (in milliseconds). + /// Only valid for AMP Visibility trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="continuousTimeMinMilliseconds")] + pub continuous_time_min_milliseconds: Option, + /// List of integer percentage values for scroll triggers. The trigger will + /// fire when each percentage is reached when the view is scrolled + /// horizontally. Only valid for AMP scroll triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="horizontalScrollPercentageList")] + pub horizontal_scroll_percentage_list: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, + /// Whether or not we should delay the form submissions or link opening + /// until all of the tags have fired (by preventing the default + /// action and later simulating the default action). Only valid for + /// Form Submission and Link Click triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="waitForTags")] + pub wait_for_tags: Option, + /// Time between Timer Events to fire (in seconds). Only valid for AMP Timer + /// trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="intervalSeconds")] + pub interval_seconds: Option, + /// Name of the GTM event that is fired. Only valid for Timer triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="eventName")] + pub event_name: Option, + /// A visibility trigger CSS selector (i.e. "#id"). Only valid for AMP + /// Visibility trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="visibilitySelector")] + pub visibility_selector: Option, + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// Used in the case of custom event, which is fired iff all Conditions are + /// true. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="customEventFilter")] + pub custom_event_filter: Option>, + /// Additional parameters. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + pub parameter: Option>, + /// Parent folder id. + #[serde(rename="parentFolderId")] + pub parent_folder_id: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// A click trigger CSS selector (i.e. "a", "button" etc.). Only valid for AMP + /// Click trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + pub selector: Option, + /// The Trigger ID uniquely identifies the GTM Trigger. + #[serde(rename="triggerId")] + pub trigger_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Trigger as computed at storage time. + /// This value is recomputed whenever the trigger is modified. + pub fingerprint: Option, + /// A visibility trigger maximum percent visibility. Only valid for AMP + /// Visibility trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="visiblePercentageMax")] + pub visible_percentage_max: Option, + /// GTM Trigger's API relative path. + pub path: Option, + /// Trigger display name. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + pub name: Option, + /// A visibility trigger minimum percent visibility. Only valid for AMP + /// Visibility trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="visiblePercentageMin")] + pub visible_percentage_min: Option, + /// Defines the data layer event that causes this trigger. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="type")] + pub type_: Option, + /// User notes on how to apply this trigger in the container. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + pub notes: Option, + /// Time between triggering recurring Timer Events (in milliseconds). Only + /// valid for Timer triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + pub interval: Option, + /// The trigger will only fire iff all Conditions are true. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + pub filter: Option>, + /// How long to wait (in milliseconds) for tags to fire when 'waits_for_tags' + /// above evaluates to true. Only valid for Form Submission and + /// Link Click triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="waitForTagsTimeout")] + pub wait_for_tags_timeout: Option, + /// Limit of the number of GTM events this Timer Trigger will fire. If no limit + /// is set, we will continue to fire GTM events until the user leaves the page. + /// Only valid for Timer triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + pub limit: Option, + /// Whether or not we should only fire tags if the form submit or link click + /// event is not cancelled by some other event handler (e.g. because of + /// validation). Only valid for Form Submission and Link Click triggers. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="checkValidation")] + pub check_validation: Option, + /// Used in the case of auto event tracking. + /// @mutable tagmanager.accounts.containers.workspaces.triggers.create + /// @mutable tagmanager.accounts.containers.workspaces.triggers.update + #[serde(rename="autoEventFilter")] + pub auto_event_filter: Option>, } -impl ResponseResult for RevertBuiltInVariableResponse {} +impl RequestValue for Trigger {} +impl ResponseResult for Trigger {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Client { + /// Client display name. + /// @mutable tagmanager.accounts.containers.workspaces.clients.create + /// @mutable tagmanager.accounts.containers.workspaces.clients.update + pub name: Option, + /// The client's parameters. + /// @mutable tagmanager.accounts.containers.workspaces.clients.create + /// @mutable tagmanager.accounts.containers.workspaces.clients.update + pub parameter: Option>, + /// The Client ID uniquely identifies the GTM client. + #[serde(rename="clientId")] + pub client_id: Option, + /// Priority determines relative firing order. + /// @mutable tagmanager.accounts.containers.workspaces.clients.create + /// @mutable tagmanager.accounts.containers.workspaces.clients.update + pub priority: Option, + /// GTM Container ID. + #[serde(rename="containerId")] + pub container_id: Option, + /// GTM Workspace ID. + #[serde(rename="workspaceId")] + pub workspace_id: Option, + /// Auto generated link to the tag manager UI + #[serde(rename="tagManagerUrl")] + pub tag_manager_url: Option, + /// The fingerprint of the GTM Client as computed at storage time. + /// This value is recomputed whenever the client is modified. + pub fingerprint: Option, + /// GTM client's API relative path. + pub path: Option, + /// Client type. + /// @mutable tagmanager.accounts.containers.workspaces.clients.create + /// @mutable tagmanager.accounts.containers.workspaces.clients.update + #[serde(rename="type")] + pub type_: Option, + /// GTM Account ID. + #[serde(rename="accountId")] + pub account_id: Option, +} + +impl Part for Client {} /// The result of reverting a zone in a workspace. @@ -2139,20 +2460,25 @@ impl ResponseResult for RevertBuiltInVariableResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RevertZoneResponse { - /// Zone as it appears in the latest container version since the last workspace synchronization operation. If no zone is present, that means the zone was deleted in the latest container version. + /// Zone as it appears in the latest container version since the last + /// workspace synchronization operation. If no zone is present, that means + /// the zone was deleted in the latest container version. pub zone: Option, } impl ResponseResult for RevertZoneResponse {} -/// Represents a tag that fires after another tag in order to tear down dependencies. +/// Represents a tag that fires after another tag in order to tear down +/// dependencies. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TeardownTag { - /// If true, fire the teardown tag if and only if the main tag fires successfully. If false, fire the teardown tag regardless of main tag firing status. + /// If true, fire the teardown tag if and only if the main tag fires + /// successfully. + /// If false, fire the teardown tag regardless of main tag firing status. #[serde(rename="stopTeardownOnFailure")] pub stop_teardown_on_failure: Option, /// The name of the teardown tag. @@ -2236,7 +2562,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_zones_create(&self, request: Zone, parent: &str) -> AccountContainerWorkspaceZoneCreateCall<'a, C, A> { AccountContainerWorkspaceZoneCreateCall { hub: self.hub, @@ -2255,7 +2583,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// * `path` - GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} pub fn containers_workspaces_folders_move_entities_to_folder(&self, request: Folder, path: &str) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> { AccountContainerWorkspaceFolderMoveEntitiesToFolderCall { hub: self.hub, @@ -2276,7 +2606,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `parent` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_version_headers_latest(&self, parent: &str) -> AccountContainerVersionHeaderLatestCall<'a, C, A> { AccountContainerVersionHeaderLatestCall { hub: self.hub, @@ -2294,7 +2625,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspaces's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_triggers_create(&self, request: Trigger, parent: &str) -> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> { AccountContainerWorkspaceTriggerCreateCall { hub: self.hub, @@ -2312,7 +2645,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `parent` - GTM parent Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_workspaces_list(&self, parent: &str) -> AccountContainerWorkspaceListCall<'a, C, A> { AccountContainerWorkspaceListCall { hub: self.hub, @@ -2330,7 +2664,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + /// * `path` - GTM BuiltInVariable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables pub fn containers_workspaces_built_in_variables_revert(&self, path: &str) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> { AccountContainerWorkspaceBuiltInVariableRevertCall { hub: self.hub, @@ -2348,7 +2684,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + /// * `path` - GTM BuiltInVariable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables pub fn containers_workspaces_built_in_variables_delete(&self, path: &str) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> { AccountContainerWorkspaceBuiltInVariableDeleteCall { hub: self.hub, @@ -2367,7 +2705,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `parent` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_environments_create(&self, request: Environment, parent: &str) -> AccountContainerEnvironmentCreateCall<'a, C, A> { AccountContainerEnvironmentCreateCall { hub: self.hub, @@ -2385,7 +2724,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// * `path` - GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} pub fn containers_versions_publish(&self, path: &str) -> AccountContainerVersionPublishCall<'a, C, A> { AccountContainerVersionPublishCall { hub: self.hub, @@ -2403,7 +2744,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// * `path` - GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} pub fn containers_workspaces_templates_get(&self, path: &str) -> AccountContainerWorkspaceTemplateGetCall<'a, C, A> { AccountContainerWorkspaceTemplateGetCall { hub: self.hub, @@ -2420,7 +2763,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// * `path` - GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} pub fn containers_workspaces_zones_revert(&self, path: &str) -> AccountContainerWorkspaceZoneRevertCall<'a, C, A> { AccountContainerWorkspaceZoneRevertCall { hub: self.hub, @@ -2439,7 +2784,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_tags_create(&self, request: Tag, parent: &str) -> AccountContainerWorkspaceTagCreateCall<'a, C, A> { AccountContainerWorkspaceTagCreateCall { hub: self.hub, @@ -2457,7 +2804,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// * `path` - GTM Environment's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/environments/{environment_id} pub fn containers_environments_delete(&self, path: &str) -> AccountContainerEnvironmentDeleteCall<'a, C, A> { AccountContainerEnvironmentDeleteCall { hub: self.hub, @@ -2474,7 +2823,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_get(&self, path: &str) -> AccountContainerWorkspaceGetCall<'a, C, A> { AccountContainerWorkspaceGetCall { hub: self.hub, @@ -2491,7 +2842,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `path` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_get(&self, path: &str) -> AccountContainerGetCall<'a, C, A> { AccountContainerGetCall { hub: self.hub, @@ -2509,7 +2861,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Account's API relative path. Example: accounts/{account_id} + /// * `parent` - GTM Account's API relative path. + /// Example: accounts/{account_id} pub fn user_permissions_create(&self, request: UserPermission, parent: &str) -> AccountUserPermissionCreateCall<'a, C, A> { AccountUserPermissionCreateCall { hub: self.hub, @@ -2527,7 +2880,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_folders_list(&self, parent: &str) -> AccountContainerWorkspaceFolderListCall<'a, C, A> { AccountContainerWorkspaceFolderListCall { hub: self.hub, @@ -2546,7 +2901,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// * `path` - GTM Environment's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/environments/{environment_id} pub fn containers_environments_reauthorize(&self, request: Environment, path: &str) -> AccountContainerEnvironmentReauthorizeCall<'a, C, A> { AccountContainerEnvironmentReauthorizeCall { hub: self.hub, @@ -2564,7 +2921,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_delete(&self, path: &str) -> AccountContainerWorkspaceDeleteCall<'a, C, A> { AccountContainerWorkspaceDeleteCall { hub: self.hub, @@ -2582,7 +2941,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `parent` - GTM parent Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_workspaces_create(&self, request: Workspace, parent: &str) -> AccountContainerWorkspaceCreateCall<'a, C, A> { AccountContainerWorkspaceCreateCall { hub: self.hub, @@ -2596,11 +2956,13 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List all users that have access to the account along with Account and Container user access granted to each of them. + /// List all users that have access to the account along with Account and + /// Container user access granted to each of them. /// /// # Arguments /// - /// * `parent` - GTM Accounts's API relative path. Example: accounts/{account_id} + /// * `parent` - GTM Accounts's API relative path. + /// Example: accounts/{account_id} pub fn user_permissions_list(&self, parent: &str) -> AccountUserPermissionListCall<'a, C, A> { AccountUserPermissionListCall { hub: self.hub, @@ -2618,7 +2980,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// * `path` - GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} pub fn containers_workspaces_templates_delete(&self, path: &str) -> AccountContainerWorkspaceTemplateDeleteCall<'a, C, A> { AccountContainerWorkspaceTemplateDeleteCall { hub: self.hub, @@ -2631,11 +2995,14 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Quick previews a workspace by creating a fake container version from all entities in the provided workspace. + /// Quick previews a workspace by creating a fake container version from all + /// entities in the provided workspace. /// /// # Arguments /// - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_quick_preview(&self, path: &str) -> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> { AccountContainerWorkspaceQuickPreviewCall { hub: self.hub, @@ -2652,7 +3019,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// * `path` - GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} pub fn containers_workspaces_variables_get(&self, path: &str) -> AccountContainerWorkspaceVariableGetCall<'a, C, A> { AccountContainerWorkspaceVariableGetCall { hub: self.hub, @@ -2665,11 +3034,14 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the latest version used for synchronization of workspaces when detecting conflicts and errors. + /// Sets the latest version used for synchronization of workspaces when + /// detecting conflicts and errors. /// /// # Arguments /// - /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// * `path` - GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} pub fn containers_versions_set_latest(&self, path: &str) -> AccountContainerVersionSetLatestCall<'a, C, A> { AccountContainerVersionSetLatestCall { hub: self.hub, @@ -2687,7 +3059,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// * `path` - GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} pub fn containers_workspaces_variables_update(&self, request: Variable, path: &str) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> { AccountContainerWorkspaceVariableUpdateCall { hub: self.hub, @@ -2706,7 +3080,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `parent` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_environments_list(&self, parent: &str) -> AccountContainerEnvironmentListCall<'a, C, A> { AccountContainerEnvironmentListCall { hub: self.hub, @@ -2724,7 +3099,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_tags_list(&self, parent: &str) -> AccountContainerWorkspaceTagListCall<'a, C, A> { AccountContainerWorkspaceTagListCall { hub: self.hub, @@ -2742,7 +3119,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_templates_list(&self, parent: &str) -> AccountContainerWorkspaceTemplateListCall<'a, C, A> { AccountContainerWorkspaceTemplateListCall { hub: self.hub, @@ -2761,7 +3140,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// * `path` - GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} pub fn containers_workspaces_zones_update(&self, request: Zone, path: &str) -> AccountContainerWorkspaceZoneUpdateCall<'a, C, A> { AccountContainerWorkspaceZoneUpdateCall { hub: self.hub, @@ -2780,7 +3161,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// * `path` - GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} pub fn containers_workspaces_zones_get(&self, path: &str) -> AccountContainerWorkspaceZoneGetCall<'a, C, A> { AccountContainerWorkspaceZoneGetCall { hub: self.hub, @@ -2793,12 +3176,16 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version. + /// Creates a Container Version from the entities present in the workspace, + /// deletes the workspace, and sets the base container version to the newly + /// created version. /// /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_create_version(&self, request: CreateContainerVersionRequestVersionOptions, path: &str) -> AccountContainerWorkspaceCreateVersionCall<'a, C, A> { AccountContainerWorkspaceCreateVersionCall { hub: self.hub, @@ -2816,7 +3203,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `path` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_delete(&self, path: &str) -> AccountContainerDeleteCall<'a, C, A> { AccountContainerDeleteCall { hub: self.hub, @@ -2834,7 +3222,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_templates_create(&self, request: CustomTemplate, parent: &str) -> AccountContainerWorkspaceTemplateCreateCall<'a, C, A> { AccountContainerWorkspaceTemplateCreateCall { hub: self.hub, @@ -2852,7 +3242,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// * `path` - GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} pub fn containers_versions_delete(&self, path: &str) -> AccountContainerVersionDeleteCall<'a, C, A> { AccountContainerVersionDeleteCall { hub: self.hub, @@ -2870,7 +3262,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Accounts's API relative path. Example: accounts/{account_id} + /// * `path` - GTM Accounts's API relative path. + /// Example: accounts/{account_id} pub fn update(&self, request: Account, path: &str) -> AccountUpdateCall<'a, C, A> { AccountUpdateCall { hub: self.hub, @@ -2889,7 +3282,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `parent` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_version_headers_list(&self, parent: &str) -> AccountContainerVersionHeaderListCall<'a, C, A> { AccountContainerVersionHeaderListCall { hub: self.hub, @@ -2908,7 +3302,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_built_in_variables_list(&self, parent: &str) -> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> { AccountContainerWorkspaceBuiltInVariableListCall { hub: self.hub, @@ -2926,7 +3322,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspaces's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_triggers_list(&self, parent: &str) -> AccountContainerWorkspaceTriggerListCall<'a, C, A> { AccountContainerWorkspaceTriggerListCall { hub: self.hub, @@ -2945,7 +3343,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + /// * `path` - GTM UserPermission's API relative path. + /// Example: accounts/{account_id}/user_permissions/{user_permission_id} pub fn user_permissions_update(&self, request: UserPermission, path: &str) -> AccountUserPermissionUpdateCall<'a, C, A> { AccountUserPermissionUpdateCall { hub: self.hub, @@ -2963,7 +3362,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_zones_list(&self, parent: &str) -> AccountContainerWorkspaceZoneListCall<'a, C, A> { AccountContainerWorkspaceZoneListCall { hub: self.hub, @@ -2982,7 +3383,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// * `path` - GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} pub fn containers_workspaces_templates_update(&self, request: CustomTemplate, path: &str) -> AccountContainerWorkspaceTemplateUpdateCall<'a, C, A> { AccountContainerWorkspaceTemplateUpdateCall { hub: self.hub, @@ -3001,7 +3404,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Accounts's API relative path. Example: accounts/{account_id} + /// * `path` - GTM Accounts's API relative path. + /// Example: accounts/{account_id} pub fn get(&self, path: &str) -> AccountGetCall<'a, C, A> { AccountGetCall { hub: self.hub, @@ -3018,7 +3422,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `parent` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_versions_live(&self, parent: &str) -> AccountContainerVersionLiveCall<'a, C, A> { AccountContainerVersionLiveCall { hub: self.hub, @@ -3048,7 +3453,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_variables_list(&self, parent: &str) -> AccountContainerWorkspaceVariableListCall<'a, C, A> { AccountContainerWorkspaceVariableListCall { hub: self.hub, @@ -3066,7 +3473,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// * `path` - GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} pub fn containers_versions_undelete(&self, path: &str) -> AccountContainerVersionUndeleteCall<'a, C, A> { AccountContainerVersionUndeleteCall { hub: self.hub, @@ -3083,7 +3492,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// * `path` - GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} pub fn containers_workspaces_variables_revert(&self, path: &str) -> AccountContainerWorkspaceVariableRevertCall<'a, C, A> { AccountContainerWorkspaceVariableRevertCall { hub: self.hub, @@ -3101,7 +3512,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// * `path` - GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} pub fn containers_workspaces_zones_delete(&self, path: &str) -> AccountContainerWorkspaceZoneDeleteCall<'a, C, A> { AccountContainerWorkspaceZoneDeleteCall { hub: self.hub, @@ -3118,7 +3531,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// * `path` - GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} pub fn containers_workspaces_folders_get(&self, path: &str) -> AccountContainerWorkspaceFolderGetCall<'a, C, A> { AccountContainerWorkspaceFolderGetCall { hub: self.hub, @@ -3136,7 +3551,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_folders_create(&self, request: Folder, parent: &str) -> AccountContainerWorkspaceFolderCreateCall<'a, C, A> { AccountContainerWorkspaceFolderCreateCall { hub: self.hub, @@ -3154,7 +3571,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// * `path` - GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} pub fn containers_workspaces_tags_delete(&self, path: &str) -> AccountContainerWorkspaceTagDeleteCall<'a, C, A> { AccountContainerWorkspaceTagDeleteCall { hub: self.hub, @@ -3172,7 +3591,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// * `path` - GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} pub fn containers_update(&self, request: Container, path: &str) -> AccountContainerUpdateCall<'a, C, A> { AccountContainerUpdateCall { hub: self.hub, @@ -3191,7 +3611,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// * `path` - GTM Environment's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/environments/{environment_id} pub fn containers_environments_get(&self, path: &str) -> AccountContainerEnvironmentGetCall<'a, C, A> { AccountContainerEnvironmentGetCall { hub: self.hub, @@ -3209,7 +3631,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// * `path` - GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} pub fn containers_workspaces_folders_update(&self, request: Folder, path: &str) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> { AccountContainerWorkspaceFolderUpdateCall { hub: self.hub, @@ -3228,7 +3652,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_built_in_variables_create(&self, parent: &str) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> { AccountContainerWorkspaceBuiltInVariableCreateCall { hub: self.hub, @@ -3246,7 +3672,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - GTM Accounts's API relative path. Example: accounts/{account_id}. + /// * `parent` - GTM Accounts's API relative path. + /// Example: accounts/{account_id}. pub fn containers_list(&self, parent: &str) -> AccountContainerListCall<'a, C, A> { AccountContainerListCall { hub: self.hub, @@ -3264,7 +3691,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// * `path` - GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} pub fn containers_workspaces_folders_entities(&self, path: &str) -> AccountContainerWorkspaceFolderEntityCall<'a, C, A> { AccountContainerWorkspaceFolderEntityCall { hub: self.hub, @@ -3282,7 +3711,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// * `path` - GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} pub fn containers_workspaces_triggers_delete(&self, path: &str) -> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> { AccountContainerWorkspaceTriggerDeleteCall { hub: self.hub, @@ -3299,7 +3730,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// * `path` - GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} pub fn containers_workspaces_folders_delete(&self, path: &str) -> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> { AccountContainerWorkspaceFolderDeleteCall { hub: self.hub, @@ -3312,11 +3745,15 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities. + /// Syncs a workspace to the latest container version by updating all + /// unmodified workspace entities and displaying conflicts for modified + /// entities. /// /// # Arguments /// - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_sync(&self, path: &str) -> AccountContainerWorkspaceSyncCall<'a, C, A> { AccountContainerWorkspaceSyncCall { hub: self.hub, @@ -3333,7 +3770,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// * `path` - GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} pub fn containers_workspaces_tags_revert(&self, path: &str) -> AccountContainerWorkspaceTagRevertCall<'a, C, A> { AccountContainerWorkspaceTagRevertCall { hub: self.hub, @@ -3352,7 +3791,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// * `path` - GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} pub fn containers_workspaces_tags_update(&self, request: Tag, path: &str) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> { AccountContainerWorkspaceTagUpdateCall { hub: self.hub, @@ -3371,7 +3812,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// * `path` - GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} pub fn containers_workspaces_templates_revert(&self, path: &str) -> AccountContainerWorkspaceTemplateRevertCall<'a, C, A> { AccountContainerWorkspaceTemplateRevertCall { hub: self.hub, @@ -3390,7 +3833,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Account's API relative path. Example: accounts/{account_id}. + /// * `parent` - GTM Account's API relative path. + /// Example: accounts/{account_id}. pub fn containers_create(&self, request: Container, parent: &str) -> AccountContainerCreateCall<'a, C, A> { AccountContainerCreateCall { hub: self.hub, @@ -3409,7 +3853,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// * `path` - GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} pub fn containers_workspaces_triggers_update(&self, request: Trigger, path: &str) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> { AccountContainerWorkspaceTriggerUpdateCall { hub: self.hub, @@ -3429,7 +3875,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `parent` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_variables_create(&self, request: Variable, parent: &str) -> AccountContainerWorkspaceVariableCreateCall<'a, C, A> { AccountContainerWorkspaceVariableCreateCall { hub: self.hub, @@ -3447,7 +3895,8 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + /// * `path` - GTM UserPermission's API relative path. + /// Example: accounts/{account_id}/user_permissions/{user_permission_id} pub fn user_permissions_get(&self, path: &str) -> AccountUserPermissionGetCall<'a, C, A> { AccountUserPermissionGetCall { hub: self.hub, @@ -3464,7 +3913,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// * `path` - GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} pub fn containers_workspaces_triggers_revert(&self, path: &str) -> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> { AccountContainerWorkspaceTriggerRevertCall { hub: self.hub, @@ -3482,7 +3933,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// * `path` - GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} pub fn containers_workspaces_variables_delete(&self, path: &str) -> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> { AccountContainerWorkspaceVariableDeleteCall { hub: self.hub, @@ -3499,7 +3952,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// * `path` - GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} pub fn containers_workspaces_tags_get(&self, path: &str) -> AccountContainerWorkspaceTagGetCall<'a, C, A> { AccountContainerWorkspaceTagGetCall { hub: self.hub, @@ -3512,12 +3967,15 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request. + /// Resolves a merge conflict for a workspace entity by updating it to the + /// resolved entity passed in the request. /// /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_resolve_conflict(&self, request: Entity, path: &str) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> { AccountContainerWorkspaceResolveConflictCall { hub: self.hub, @@ -3537,7 +3995,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// * `path` - GTM Environment's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/environments/{environment_id} pub fn containers_environments_update(&self, request: Environment, path: &str) -> AccountContainerEnvironmentUpdateCall<'a, C, A> { AccountContainerEnvironmentUpdateCall { hub: self.hub, @@ -3556,7 +4016,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// * `path` - GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} pub fn containers_workspaces_triggers_get(&self, path: &str) -> AccountContainerWorkspaceTriggerGetCall<'a, C, A> { AccountContainerWorkspaceTriggerGetCall { hub: self.hub, @@ -3573,7 +4035,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// * `path` - GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} pub fn containers_workspaces_folders_revert(&self, path: &str) -> AccountContainerWorkspaceFolderRevertCall<'a, C, A> { AccountContainerWorkspaceFolderRevertCall { hub: self.hub, @@ -3591,7 +4055,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_get_status(&self, path: &str) -> AccountContainerWorkspaceGetStatuCall<'a, C, A> { AccountContainerWorkspaceGetStatuCall { hub: self.hub, @@ -3609,7 +4075,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// * `path` - GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} pub fn containers_versions_update(&self, request: ContainerVersion, path: &str) -> AccountContainerVersionUpdateCall<'a, C, A> { AccountContainerVersionUpdateCall { hub: self.hub, @@ -3628,7 +4096,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `path` - GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// * `path` - GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} pub fn containers_versions_get(&self, path: &str) -> AccountContainerVersionGetCall<'a, C, A> { AccountContainerVersionGetCall { hub: self.hub, @@ -3647,7 +4117,9 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `path` - GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// * `path` - GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} pub fn containers_workspaces_update(&self, request: Workspace, path: &str) -> AccountContainerWorkspaceUpdateCall<'a, C, A> { AccountContainerWorkspaceUpdateCall { hub: self.hub, @@ -3662,11 +4134,13 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Removes a user from the account, revoking access to it and all of its containers. + /// Removes a user from the account, revoking access to it and all of its + /// containers. /// /// # Arguments /// - /// * `path` - GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + /// * `path` - GTM UserPermission's API relative path. + /// Example: accounts/{account_id}/user_permissions/{user_permission_id} pub fn user_permissions_delete(&self, path: &str) -> AccountUserPermissionDeleteCall<'a, C, A> { AccountUserPermissionDeleteCall { hub: self.hub, @@ -3765,7 +4239,7 @@ impl<'a, C, A> AccountContainerWorkspaceZoneCreateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/zones"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/zones"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -3892,7 +4366,9 @@ impl<'a, C, A> AccountContainerWorkspaceZoneCreateCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -3922,13 +4398,17 @@ impl<'a, C, A> AccountContainerWorkspaceZoneCreateCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceZoneCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4060,7 +4540,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> } - let mut url = self.hub._base_url.clone() + "{+path}:move_entities_to_folder"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:move_entities_to_folder"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -4177,7 +4657,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> self._request = new_value; self } - /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} /// /// Sets the *path* path property to the given value. /// @@ -4231,13 +4713,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderMoveEntitiesToFolderCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4342,7 +4828,7 @@ impl<'a, C, A> AccountContainerVersionHeaderLatestCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/version_headers:latest"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/version_headers:latest"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4445,7 +4931,8 @@ impl<'a, C, A> AccountContainerVersionHeaderLatestCall<'a, C, A> where C: Borrow } - /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} /// /// Sets the *parent* path property to the given value. /// @@ -4475,13 +4962,17 @@ impl<'a, C, A> AccountContainerVersionHeaderLatestCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerVersionHeaderLatestCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4593,7 +5084,7 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/triggers"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/triggers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -4720,7 +5211,9 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> where C: Bor self._request = new_value; self } - /// GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspaces's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -4750,13 +5243,17 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTriggerCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -4866,7 +5363,7 @@ impl<'a, C, A> AccountContainerWorkspaceListCall<'a, C, A> where C: BorrowMut AccountContainerWorkspaceListCall<'a, C, A> where C: BorrowMut AccountContainerWorkspaceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerWorkspaceListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5122,7 +5624,7 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> wher params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}/built_in_variables:revert"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}/built_in_variables:revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -5225,7 +5727,9 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> wher } - /// GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + /// GTM BuiltInVariable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables /// /// Sets the *path* path property to the given value. /// @@ -5262,13 +5766,17 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> wher /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceBuiltInVariableRevertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5379,7 +5887,7 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> wher } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -5472,7 +5980,9 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> wher } - /// GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + /// GTM BuiltInVariable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables /// /// Sets the *path* path property to the given value. /// @@ -5510,13 +6020,17 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> wher /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceBuiltInVariableDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5628,7 +6142,7 @@ impl<'a, C, A> AccountContainerEnvironmentCreateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/environments"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/environments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -5755,7 +6269,8 @@ impl<'a, C, A> AccountContainerEnvironmentCreateCall<'a, C, A> where C: BorrowMu self._request = new_value; self } - /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} /// /// Sets the *parent* path property to the given value. /// @@ -5785,13 +6300,17 @@ impl<'a, C, A> AccountContainerEnvironmentCreateCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -5901,7 +6420,7 @@ impl<'a, C, A> AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut AccountContainerVersionPublishCall<'a, C, A> { @@ -6041,13 +6563,17 @@ impl<'a, C, A> AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionPublishCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6152,7 +6678,7 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateGetCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6255,7 +6781,9 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateGetCall<'a, C, A> where C: Borro } - /// GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} /// /// Sets the *path* path property to the given value. /// @@ -6285,13 +6813,17 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateGetCall<'a, C, A> where C: Borro /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTemplateGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6401,7 +6933,7 @@ impl<'a, C, A> AccountContainerWorkspaceZoneRevertCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:revert"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -6504,7 +7036,9 @@ impl<'a, C, A> AccountContainerWorkspaceZoneRevertCall<'a, C, A> where C: Borrow } - /// GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} /// /// Sets the *path* path property to the given value. /// @@ -6514,7 +7048,8 @@ impl<'a, C, A> AccountContainerWorkspaceZoneRevertCall<'a, C, A> where C: Borrow self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the zone in storage. + /// When provided, this fingerprint must match the fingerprint of the zone in + /// storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceZoneRevertCall<'a, C, A> { @@ -6541,13 +7076,17 @@ impl<'a, C, A> AccountContainerWorkspaceZoneRevertCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceZoneRevertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6659,7 +7198,7 @@ impl<'a, C, A> AccountContainerWorkspaceTagCreateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/tags"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/tags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -6786,7 +7325,9 @@ impl<'a, C, A> AccountContainerWorkspaceTagCreateCall<'a, C, A> where C: BorrowM self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -6816,13 +7357,17 @@ impl<'a, C, A> AccountContainerWorkspaceTagCreateCall<'a, C, A> where C: BorrowM /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTagCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -6926,7 +7471,7 @@ impl<'a, C, A> AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -7019,7 +7564,9 @@ impl<'a, C, A> AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu } - /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// GTM Environment's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/environments/{environment_id} /// /// Sets the *path* path property to the given value. /// @@ -7049,13 +7596,17 @@ impl<'a, C, A> AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7160,7 +7711,7 @@ impl<'a, C, A> AccountContainerWorkspaceGetCall<'a, C, A> where C: BorrowMut AccountContainerWorkspaceGetCall<'a, C, A> where C: BorrowMut AccountContainerWorkspaceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerWorkspaceGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7404,7 +7961,7 @@ impl<'a, C, A> AccountContainerGetCall<'a, C, A> where C: BorrowMut AccountContainerGetCall<'a, C, A> where C: BorrowMut AccountContainerGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7655,7 +8217,7 @@ impl<'a, C, A> AccountUserPermissionCreateCall<'a, C, A> where C: BorrowMut AccountUserPermissionCreateCall<'a, C, A> where C: BorrowMut AccountUserPermissionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountUserPermissionCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -7928,7 +8495,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderListCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/folders"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/folders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8031,7 +8598,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderListCall<'a, C, A> where C: Borrow } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -8068,13 +8637,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderListCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8186,7 +8759,7 @@ impl<'a, C, A> AccountContainerEnvironmentReauthorizeCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:reauthorize"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:reauthorize"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Publish.as_ref().to_string(), ()); } @@ -8313,7 +8886,9 @@ impl<'a, C, A> AccountContainerEnvironmentReauthorizeCall<'a, C, A> where C: Bor self._request = new_value; self } - /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// GTM Environment's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/environments/{environment_id} /// /// Sets the *path* path property to the given value. /// @@ -8343,13 +8918,17 @@ impl<'a, C, A> AccountContainerEnvironmentReauthorizeCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentReauthorizeCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8453,7 +9032,7 @@ impl<'a, C, A> AccountContainerWorkspaceDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::DeleteContainer.as_ref().to_string(), ()); } @@ -8546,7 +9125,9 @@ impl<'a, C, A> AccountContainerWorkspaceDeleteCall<'a, C, A> where C: BorrowMut< } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *path* path property to the given value. /// @@ -8576,13 +9157,17 @@ impl<'a, C, A> AccountContainerWorkspaceDeleteCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8694,7 +9279,7 @@ impl<'a, C, A> AccountContainerWorkspaceCreateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/workspaces"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/workspaces"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -8821,7 +9406,8 @@ impl<'a, C, A> AccountContainerWorkspaceCreateCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// GTM parent Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} /// /// Sets the *parent* path property to the given value. /// @@ -8851,13 +9437,17 @@ impl<'a, C, A> AccountContainerWorkspaceCreateCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -8890,7 +9480,8 @@ impl<'a, C, A> AccountContainerWorkspaceCreateCall<'a, C, A> where C: BorrowMut< } -/// List all users that have access to the account along with Account and Container user access granted to each of them. +/// List all users that have access to the account along with Account and +/// Container user access granted to each of them. /// /// A builder for the *user_permissions.list* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -8967,7 +9558,7 @@ impl<'a, C, A> AccountUserPermissionListCall<'a, C, A> where C: BorrowMut AccountUserPermissionListCall<'a, C, A> where C: BorrowMut AccountUserPermissionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountUserPermissionListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9217,7 +9813,7 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateDeleteCall<'a, C, A> where C: Bo } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -9310,7 +9906,9 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateDeleteCall<'a, C, A> where C: Bo } - /// GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} /// /// Sets the *path* path property to the given value. /// @@ -9340,13 +9938,17 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateDeleteCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTemplateDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9379,7 +9981,8 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateDeleteCall<'a, C, A> where C: Bo } -/// Quick previews a workspace by creating a fake container version from all entities in the provided workspace. +/// Quick previews a workspace by creating a fake container version from all +/// entities in the provided workspace. /// /// A builder for the *containers.workspaces.quick_preview* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -9451,7 +10054,7 @@ impl<'a, C, A> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:quick_preview"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:quick_preview"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); } @@ -9554,7 +10157,9 @@ impl<'a, C, A> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> where C: Borr } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *path* path property to the given value. /// @@ -9584,13 +10189,17 @@ impl<'a, C, A> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceQuickPreviewCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9695,7 +10304,7 @@ impl<'a, C, A> AccountContainerWorkspaceVariableGetCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9798,7 +10407,9 @@ impl<'a, C, A> AccountContainerWorkspaceVariableGetCall<'a, C, A> where C: Borro } - /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} /// /// Sets the *path* path property to the given value. /// @@ -9828,13 +10439,17 @@ impl<'a, C, A> AccountContainerWorkspaceVariableGetCall<'a, C, A> where C: Borro /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceVariableGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -9867,7 +10482,8 @@ impl<'a, C, A> AccountContainerWorkspaceVariableGetCall<'a, C, A> where C: Borro } -/// Sets the latest version used for synchronization of workspaces when detecting conflicts and errors. +/// Sets the latest version used for synchronization of workspaces when +/// detecting conflicts and errors. /// /// A builder for the *containers.versions.set_latest* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -9939,7 +10555,7 @@ impl<'a, C, A> AccountContainerVersionSetLatestCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:set_latest"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:set_latest"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -10042,7 +10658,9 @@ impl<'a, C, A> AccountContainerVersionSetLatestCall<'a, C, A> where C: BorrowMut } - /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} /// /// Sets the *path* path property to the given value. /// @@ -10072,13 +10690,17 @@ impl<'a, C, A> AccountContainerVersionSetLatestCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerVersionSetLatestCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10195,7 +10817,7 @@ impl<'a, C, A> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -10322,7 +10944,9 @@ impl<'a, C, A> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> where C: Bo self._request = new_value; self } - /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} /// /// Sets the *path* path property to the given value. /// @@ -10332,7 +10956,8 @@ impl<'a, C, A> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> where C: Bo self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the variable in storage. + /// When provided, this fingerprint must match the fingerprint of the variable + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> { @@ -10359,13 +10984,17 @@ impl<'a, C, A> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceVariableUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10475,7 +11104,7 @@ impl<'a, C, A> AccountContainerEnvironmentListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/environments"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/environments"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10578,7 +11207,8 @@ impl<'a, C, A> AccountContainerEnvironmentListCall<'a, C, A> where C: BorrowMut< } - /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} /// /// Sets the *parent* path property to the given value. /// @@ -10615,13 +11245,17 @@ impl<'a, C, A> AccountContainerEnvironmentListCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10731,7 +11365,7 @@ impl<'a, C, A> AccountContainerWorkspaceTagListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/tags"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/tags"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10834,7 +11468,9 @@ impl<'a, C, A> AccountContainerWorkspaceTagListCall<'a, C, A> where C: BorrowMut } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -10871,13 +11507,17 @@ impl<'a, C, A> AccountContainerWorkspaceTagListCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTagListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -10987,7 +11627,7 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateListCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/templates"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/templates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11090,7 +11730,9 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateListCall<'a, C, A> where C: Borr } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -11127,13 +11769,17 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateListCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTemplateListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11250,7 +11896,7 @@ impl<'a, C, A> AccountContainerWorkspaceZoneUpdateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -11377,7 +12023,9 @@ impl<'a, C, A> AccountContainerWorkspaceZoneUpdateCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} /// /// Sets the *path* path property to the given value. /// @@ -11387,7 +12035,8 @@ impl<'a, C, A> AccountContainerWorkspaceZoneUpdateCall<'a, C, A> where C: Borrow self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the zone in storage. + /// When provided, this fingerprint must match the fingerprint of the zone in + /// storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceZoneUpdateCall<'a, C, A> { @@ -11414,13 +12063,17 @@ impl<'a, C, A> AccountContainerWorkspaceZoneUpdateCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceZoneUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11525,7 +12178,7 @@ impl<'a, C, A> AccountContainerWorkspaceZoneGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11628,7 +12281,9 @@ impl<'a, C, A> AccountContainerWorkspaceZoneGetCall<'a, C, A> where C: BorrowMut } - /// GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} /// /// Sets the *path* path property to the given value. /// @@ -11658,13 +12313,17 @@ impl<'a, C, A> AccountContainerWorkspaceZoneGetCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceZoneGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -11697,7 +12356,9 @@ impl<'a, C, A> AccountContainerWorkspaceZoneGetCall<'a, C, A> where C: BorrowMut } -/// Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version. +/// Creates a Container Version from the entities present in the workspace, +/// deletes the workspace, and sets the base container version to the newly +/// created version. /// /// A builder for the *containers.workspaces.create_version* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -11776,7 +12437,7 @@ impl<'a, C, A> AccountContainerWorkspaceCreateVersionCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:create_version"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:create_version"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); } @@ -11903,7 +12564,9 @@ impl<'a, C, A> AccountContainerWorkspaceCreateVersionCall<'a, C, A> where C: Bor self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *path* path property to the given value. /// @@ -11933,13 +12596,17 @@ impl<'a, C, A> AccountContainerWorkspaceCreateVersionCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceCreateVersionCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12043,7 +12710,7 @@ impl<'a, C, A> AccountContainerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12284,7 +12956,7 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateCreateCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/templates"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/templates"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -12411,7 +13083,9 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateCreateCall<'a, C, A> where C: Bo self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -12441,13 +13115,17 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateCreateCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTemplateCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12551,7 +13229,7 @@ impl<'a, C, A> AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -12797,7 +13481,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageAccount.as_ref().to_string(), ()); } @@ -12924,7 +13608,8 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// GTM Accounts's API relative path. Example: accounts/{account_id} + /// GTM Accounts's API relative path. + /// Example: accounts/{account_id} /// /// Sets the *path* path property to the given value. /// @@ -12934,7 +13619,8 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the account in storage. + /// When provided, this fingerprint must match the fingerprint of the account + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountUpdateCall<'a, C, A> { @@ -12961,13 +13647,17 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13082,7 +13772,7 @@ impl<'a, C, A> AccountContainerVersionHeaderListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/version_headers"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/version_headers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13185,7 +13875,8 @@ impl<'a, C, A> AccountContainerVersionHeaderListCall<'a, C, A> where C: BorrowMu } - /// GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + /// GTM Container's API relative path. + /// Example: accounts/{account_id}/containers/{container_id} /// /// Sets the *parent* path property to the given value. /// @@ -13229,13 +13920,17 @@ impl<'a, C, A> AccountContainerVersionHeaderListCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerVersionHeaderListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13345,7 +14040,7 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> where params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/built_in_variables"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/built_in_variables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13448,7 +14143,9 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> where } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -13485,13 +14182,17 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> where /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceBuiltInVariableListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13601,7 +14302,7 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerListCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/triggers"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/triggers"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13704,7 +14405,9 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerListCall<'a, C, A> where C: Borro } - /// GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspaces's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -13741,13 +14444,17 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerListCall<'a, C, A> where C: Borro /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTriggerListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -13859,7 +14566,7 @@ impl<'a, C, A> AccountUserPermissionUpdateCall<'a, C, A> where C: BorrowMut AccountUserPermissionUpdateCall<'a, C, A> where C: BorrowMut AccountUserPermissionUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountUserPermissionUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14132,7 +14844,7 @@ impl<'a, C, A> AccountContainerWorkspaceZoneListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/zones"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/zones"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14235,7 +14947,9 @@ impl<'a, C, A> AccountContainerWorkspaceZoneListCall<'a, C, A> where C: BorrowMu } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -14272,13 +14986,17 @@ impl<'a, C, A> AccountContainerWorkspaceZoneListCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceZoneListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14395,7 +15113,7 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateUpdateCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -14522,7 +15240,9 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateUpdateCall<'a, C, A> where C: Bo self._request = new_value; self } - /// GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} /// /// Sets the *path* path property to the given value. /// @@ -14532,7 +15252,8 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateUpdateCall<'a, C, A> where C: Bo self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the templates in storage. + /// When provided, this fingerprint must match the fingerprint of the templates + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTemplateUpdateCall<'a, C, A> { @@ -14559,13 +15280,17 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateUpdateCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTemplateUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14670,7 +15395,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14773,7 +15498,8 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa } - /// GTM Accounts's API relative path. Example: accounts/{account_id} + /// GTM Accounts's API relative path. + /// Example: accounts/{account_id} /// /// Sets the *path* path property to the given value. /// @@ -14803,13 +15529,17 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -14914,7 +15644,7 @@ impl<'a, C, A> AccountContainerVersionLiveCall<'a, C, A> where C: BorrowMut AccountContainerVersionLiveCall<'a, C, A> where C: BorrowMut AccountContainerVersionLiveCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionLiveCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -15160,7 +15895,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/accounts"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15266,13 +16001,17 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -15382,7 +16121,7 @@ impl<'a, C, A> AccountContainerWorkspaceVariableListCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/variables"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/variables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15485,7 +16224,9 @@ impl<'a, C, A> AccountContainerWorkspaceVariableListCall<'a, C, A> where C: Borr } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -15522,13 +16263,17 @@ impl<'a, C, A> AccountContainerWorkspaceVariableListCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceVariableListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -15633,7 +16378,7 @@ impl<'a, C, A> AccountContainerVersionUndeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:undelete"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:undelete"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); } @@ -15736,7 +16481,9 @@ impl<'a, C, A> AccountContainerVersionUndeleteCall<'a, C, A> where C: BorrowMut< } - /// GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + /// GTM ContainerVersion's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/versions/{version_id} /// /// Sets the *path* path property to the given value. /// @@ -15766,13 +16513,17 @@ impl<'a, C, A> AccountContainerVersionUndeleteCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerVersionUndeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -15882,7 +16633,7 @@ impl<'a, C, A> AccountContainerWorkspaceVariableRevertCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:revert"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -15985,7 +16736,9 @@ impl<'a, C, A> AccountContainerWorkspaceVariableRevertCall<'a, C, A> where C: Bo } - /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} /// /// Sets the *path* path property to the given value. /// @@ -15995,7 +16748,8 @@ impl<'a, C, A> AccountContainerWorkspaceVariableRevertCall<'a, C, A> where C: Bo self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the variable in storage. + /// When provided, this fingerprint must match the fingerprint of the variable + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceVariableRevertCall<'a, C, A> { @@ -16022,13 +16776,17 @@ impl<'a, C, A> AccountContainerWorkspaceVariableRevertCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceVariableRevertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -16132,7 +16890,7 @@ impl<'a, C, A> AccountContainerWorkspaceZoneDeleteCall<'a, C, A> where C: Borrow } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -16225,7 +16983,9 @@ impl<'a, C, A> AccountContainerWorkspaceZoneDeleteCall<'a, C, A> where C: Borrow } - /// GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} + /// GTM Zone's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id} /// /// Sets the *path* path property to the given value. /// @@ -16255,13 +17015,17 @@ impl<'a, C, A> AccountContainerWorkspaceZoneDeleteCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceZoneDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -16366,7 +17130,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderGetCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -16469,7 +17233,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderGetCall<'a, C, A> where C: BorrowM } - /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} /// /// Sets the *path* path property to the given value. /// @@ -16499,13 +17265,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderGetCall<'a, C, A> where C: BorrowM /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -16617,7 +17387,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderCreateCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/folders"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/folders"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -16744,7 +17514,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderCreateCall<'a, C, A> where C: Borr self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -16774,13 +17546,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderCreateCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -16884,7 +17660,7 @@ impl<'a, C, A> AccountContainerWorkspaceTagDeleteCall<'a, C, A> where C: BorrowM } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -16977,7 +17753,9 @@ impl<'a, C, A> AccountContainerWorkspaceTagDeleteCall<'a, C, A> where C: BorrowM } - /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} /// /// Sets the *path* path property to the given value. /// @@ -17007,13 +17785,17 @@ impl<'a, C, A> AccountContainerWorkspaceTagDeleteCall<'a, C, A> where C: BorrowM /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTagDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -17130,7 +17912,7 @@ impl<'a, C, A> AccountContainerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerUpdateCall<'a, C, A> { @@ -17294,13 +18078,17 @@ impl<'a, C, A> AccountContainerUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -17405,7 +18193,7 @@ impl<'a, C, A> AccountContainerEnvironmentGetCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentGetCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerEnvironmentGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -17661,7 +18455,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -17788,7 +18582,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> where C: Borr self._request = new_value; self } - /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} /// /// Sets the *path* path property to the given value. /// @@ -17798,7 +18594,8 @@ impl<'a, C, A> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> where C: Borr self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the folder in storage. + /// When provided, this fingerprint must match the fingerprint of the folder in + /// storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> { @@ -17825,13 +18622,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -17943,7 +18744,7 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> wher params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/built_in_variables"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/built_in_variables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -18046,7 +18847,9 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> wher } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -18084,13 +18887,17 @@ impl<'a, C, A> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> wher /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceBuiltInVariableCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -18200,7 +19007,7 @@ impl<'a, C, A> AccountContainerListCall<'a, C, A> where C: BorrowMut AccountContainerListCall<'a, C, A> where C: BorrowMut AccountContainerListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -18456,7 +19268,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderEntityCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:entities"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:entities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -18559,7 +19371,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderEntityCall<'a, C, A> where C: Borr } - /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} /// /// Sets the *path* path property to the given value. /// @@ -18596,13 +19410,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderEntityCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderEntityCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -18706,7 +19524,7 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> where C: Bor } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -18799,7 +19617,9 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> where C: Bor } - /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} /// /// Sets the *path* path property to the given value. /// @@ -18829,13 +19649,17 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTriggerDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -18939,7 +19763,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> where C: Borr } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -19032,7 +19856,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> where C: Borr } - /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} /// /// Sets the *path* path property to the given value. /// @@ -19062,13 +19888,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -19101,7 +19931,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderDeleteCall<'a, C, A> where C: Borr } -/// Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities. +/// Syncs a workspace to the latest container version by updating all +/// unmodified workspace entities and displaying conflicts for modified +/// entities. /// /// A builder for the *containers.workspaces.sync* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -19173,7 +20005,7 @@ impl<'a, C, A> AccountContainerWorkspaceSyncCall<'a, C, A> where C: BorrowMut AccountContainerWorkspaceSyncCall<'a, C, A> where C: BorrowMut AccountContainerWorkspaceSyncCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerWorkspaceSyncCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -19422,7 +20260,7 @@ impl<'a, C, A> AccountContainerWorkspaceTagRevertCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:revert"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -19525,7 +20363,9 @@ impl<'a, C, A> AccountContainerWorkspaceTagRevertCall<'a, C, A> where C: BorrowM } - /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} /// /// Sets the *path* path property to the given value. /// @@ -19535,7 +20375,8 @@ impl<'a, C, A> AccountContainerWorkspaceTagRevertCall<'a, C, A> where C: BorrowM self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of thetag in storage. + /// When provided, this fingerprint must match the fingerprint of thetag + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTagRevertCall<'a, C, A> { @@ -19562,13 +20403,17 @@ impl<'a, C, A> AccountContainerWorkspaceTagRevertCall<'a, C, A> where C: BorrowM /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTagRevertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -19685,7 +20530,7 @@ impl<'a, C, A> AccountContainerWorkspaceTagUpdateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -19812,7 +20657,9 @@ impl<'a, C, A> AccountContainerWorkspaceTagUpdateCall<'a, C, A> where C: BorrowM self._request = new_value; self } - /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} /// /// Sets the *path* path property to the given value. /// @@ -19822,7 +20669,8 @@ impl<'a, C, A> AccountContainerWorkspaceTagUpdateCall<'a, C, A> where C: BorrowM self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the tag in storage. + /// When provided, this fingerprint must match the fingerprint of the tag in + /// storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> { @@ -19849,13 +20697,17 @@ impl<'a, C, A> AccountContainerWorkspaceTagUpdateCall<'a, C, A> where C: BorrowM /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTagUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -19965,7 +20817,7 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateRevertCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:revert"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -20068,7 +20920,9 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateRevertCall<'a, C, A> where C: Bo } - /// GTM Custom Template's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} + /// GTM Custom Template's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/templates/{template_id} /// /// Sets the *path* path property to the given value. /// @@ -20078,7 +20932,8 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateRevertCall<'a, C, A> where C: Bo self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the template in storage. + /// When provided, this fingerprint must match the fingerprint of the template + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTemplateRevertCall<'a, C, A> { @@ -20105,13 +20960,17 @@ impl<'a, C, A> AccountContainerWorkspaceTemplateRevertCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTemplateRevertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -20223,7 +21082,7 @@ impl<'a, C, A> AccountContainerCreateCall<'a, C, A> where C: BorrowMut AccountContainerCreateCall<'a, C, A> where C: BorrowMut AccountContainerCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -20503,7 +21367,7 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -20630,7 +21494,9 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> where C: Bor self._request = new_value; self } - /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} /// /// Sets the *path* path property to the given value. /// @@ -20640,7 +21506,8 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> where C: Bor self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the trigger in storage. + /// When provided, this fingerprint must match the fingerprint of the trigger + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> { @@ -20667,13 +21534,17 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTriggerUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -20785,7 +21656,7 @@ impl<'a, C, A> AccountContainerWorkspaceVariableCreateCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+parent}/variables"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+parent}/variables"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -20912,7 +21783,9 @@ impl<'a, C, A> AccountContainerWorkspaceVariableCreateCall<'a, C, A> where C: Bo self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *parent* path property to the given value. /// @@ -20942,13 +21815,17 @@ impl<'a, C, A> AccountContainerWorkspaceVariableCreateCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceVariableCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -21053,7 +21930,7 @@ impl<'a, C, A> AccountUserPermissionGetCall<'a, C, A> where C: BorrowMut AccountUserPermissionGetCall<'a, C, A> where C: BorrowMut AccountUserPermissionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountUserPermissionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -21302,7 +22184,7 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:revert"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -21405,7 +22287,9 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> where C: Bor } - /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} /// /// Sets the *path* path property to the given value. /// @@ -21415,7 +22299,8 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> where C: Bor self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the trigger in storage. + /// When provided, this fingerprint must match the fingerprint of the trigger + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> { @@ -21442,13 +22327,17 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> where C: Bor /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTriggerRevertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -21552,7 +22441,7 @@ impl<'a, C, A> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> where C: Bo } - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -21645,7 +22534,9 @@ impl<'a, C, A> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> where C: Bo } - /// GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + /// GTM Variable's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} /// /// Sets the *path* path property to the given value. /// @@ -21675,13 +22566,17 @@ impl<'a, C, A> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> where C: Bo /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceVariableDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -21786,7 +22681,7 @@ impl<'a, C, A> AccountContainerWorkspaceTagGetCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -21889,7 +22784,9 @@ impl<'a, C, A> AccountContainerWorkspaceTagGetCall<'a, C, A> where C: BorrowMut< } - /// GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + /// GTM Tag's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} /// /// Sets the *path* path property to the given value. /// @@ -21919,13 +22816,17 @@ impl<'a, C, A> AccountContainerWorkspaceTagGetCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTagGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -21958,7 +22859,8 @@ impl<'a, C, A> AccountContainerWorkspaceTagGetCall<'a, C, A> where C: BorrowMut< } -/// Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request. +/// Resolves a merge conflict for a workspace entity by updating it to the +/// resolved entity passed in the request. /// /// A builder for the *containers.workspaces.resolve_conflict* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -22041,7 +22943,7 @@ impl<'a, C, A> AccountContainerWorkspaceResolveConflictCall<'a, C, A> where C: B } - let mut url = self.hub._base_url.clone() + "{+path}:resolve_conflict"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:resolve_conflict"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -22158,7 +23060,9 @@ impl<'a, C, A> AccountContainerWorkspaceResolveConflictCall<'a, C, A> where C: B self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *path* path property to the given value. /// @@ -22168,7 +23072,8 @@ impl<'a, C, A> AccountContainerWorkspaceResolveConflictCall<'a, C, A> where C: B self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the entity_in_workspace in the merge conflict. + /// When provided, this fingerprint must match the fingerprint of the + /// entity_in_workspace in the merge conflict. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> { @@ -22195,13 +23100,17 @@ impl<'a, C, A> AccountContainerWorkspaceResolveConflictCall<'a, C, A> where C: B /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceResolveConflictCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -22318,7 +23227,7 @@ impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -22445,7 +23354,9 @@ impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu self._request = new_value; self } - /// GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + /// GTM Environment's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/environments/{environment_id} /// /// Sets the *path* path property to the given value. /// @@ -22455,7 +23366,8 @@ impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the environment in storage. + /// When provided, this fingerprint must match the fingerprint of the + /// environment in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerEnvironmentUpdateCall<'a, C, A> { @@ -22482,13 +23394,17 @@ impl<'a, C, A> AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerEnvironmentUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -22593,7 +23509,7 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerGetCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -22696,7 +23612,9 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerGetCall<'a, C, A> where C: Borrow } - /// GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + /// GTM Trigger's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} /// /// Sets the *path* path property to the given value. /// @@ -22726,13 +23644,17 @@ impl<'a, C, A> AccountContainerWorkspaceTriggerGetCall<'a, C, A> where C: Borrow /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceTriggerGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -22842,7 +23764,7 @@ impl<'a, C, A> AccountContainerWorkspaceFolderRevertCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}:revert"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}:revert"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -22945,7 +23867,9 @@ impl<'a, C, A> AccountContainerWorkspaceFolderRevertCall<'a, C, A> where C: Borr } - /// GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + /// GTM Folder's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} /// /// Sets the *path* path property to the given value. /// @@ -22955,7 +23879,8 @@ impl<'a, C, A> AccountContainerWorkspaceFolderRevertCall<'a, C, A> where C: Borr self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the tag in storage. + /// When provided, this fingerprint must match the fingerprint of the tag + /// in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceFolderRevertCall<'a, C, A> { @@ -22982,13 +23907,17 @@ impl<'a, C, A> AccountContainerWorkspaceFolderRevertCall<'a, C, A> where C: Borr /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceFolderRevertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -23093,7 +24022,7 @@ impl<'a, C, A> AccountContainerWorkspaceGetStatuCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}/status"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}/status"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -23196,7 +24125,9 @@ impl<'a, C, A> AccountContainerWorkspaceGetStatuCall<'a, C, A> where C: BorrowMu } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *path* path property to the given value. /// @@ -23226,13 +24157,17 @@ impl<'a, C, A> AccountContainerWorkspaceGetStatuCall<'a, C, A> where C: BorrowMu /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceGetStatuCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -23349,7 +24284,7 @@ impl<'a, C, A> AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVersionUpdateCall<'a, C, A> { @@ -23513,13 +24451,17 @@ impl<'a, C, A> AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -23629,7 +24571,7 @@ impl<'a, C, A> AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut AccountContainerVersionGetCall<'a, C, A> where C: BorrowMutpublished to retrieve + /// the currently published version. /// /// Sets the *container version id* query property to the given value. pub fn container_version_id(mut self, new_value: &str) -> AccountContainerVersionGetCall<'a, C, A> { @@ -23769,13 +24714,17 @@ impl<'a, C, A> AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountContainerVersionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -23892,7 +24841,7 @@ impl<'a, C, A> AccountContainerWorkspaceUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{+path}"; + let mut url = self.hub._base_url.clone() + "tagmanager/v2/{+path}"; if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -24019,7 +24968,9 @@ impl<'a, C, A> AccountContainerWorkspaceUpdateCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + /// GTM Workspace's API relative path. + /// Example: + /// accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} /// /// Sets the *path* path property to the given value. /// @@ -24029,7 +24980,8 @@ impl<'a, C, A> AccountContainerWorkspaceUpdateCall<'a, C, A> where C: BorrowMut< self._path = new_value.to_string(); self } - /// When provided, this fingerprint must match the fingerprint of the workspace in storage. + /// When provided, this fingerprint must match the fingerprint of the + /// workspace in storage. /// /// Sets the *fingerprint* query property to the given value. pub fn fingerprint(mut self, new_value: &str) -> AccountContainerWorkspaceUpdateCall<'a, C, A> { @@ -24056,13 +25008,17 @@ impl<'a, C, A> AccountContainerWorkspaceUpdateCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AccountContainerWorkspaceUpdateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); @@ -24095,7 +25051,8 @@ impl<'a, C, A> AccountContainerWorkspaceUpdateCall<'a, C, A> where C: BorrowMut< } -/// Removes a user from the account, revoking access to it and all of its containers. +/// Removes a user from the account, revoking access to it and all of its +/// containers. /// /// A builder for the *user_permissions.delete* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -24166,7 +25123,7 @@ impl<'a, C, A> AccountUserPermissionDeleteCall<'a, C, A> where C: BorrowMut AccountUserPermissionDeleteCall<'a, C, A> where C: BorrowMut AccountUserPermissionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountUserPermissionDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); diff --git a/gen/taskqueue1_beta2-cli/Cargo.toml b/gen/taskqueue1_beta2-cli/Cargo.toml index 9a3cd292f3..a0d14296d3 100644 --- a/gen/taskqueue1_beta2-cli/Cargo.toml +++ b/gen/taskqueue1_beta2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-taskqueue1_beta2-cli" -version = "1.0.12+20160428" +version = "1.0.13+20160428" authors = ["Sebastian Thiel "] description = "A complete library to interact with taskqueue (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/taskqueue1_beta2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-taskqueue1_beta2] path = "../taskqueue1_beta2" -version = "1.0.12+20160428" +version = "1.0.13+20160428" diff --git a/gen/taskqueue1_beta2-cli/README.md b/gen/taskqueue1_beta2-cli/README.md index bf0ba536ef..237b6cad23 100644 --- a/gen/taskqueue1_beta2-cli/README.md +++ b/gen/taskqueue1_beta2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *taskqueue* API at revision *20160428*. The CLI is at version *1.0.12*. +This documentation was generated from the *taskqueue* API at revision *20160428*. The CLI is at version *1.0.13*. ```bash taskqueue1-beta2 [options] diff --git a/gen/taskqueue1_beta2-cli/mkdocs.yml b/gen/taskqueue1_beta2-cli/mkdocs.yml index dd979d7436..a7cc1536f7 100644 --- a/gen/taskqueue1_beta2-cli/mkdocs.yml +++ b/gen/taskqueue1_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: taskqueue v1.0.12+20160428 +site_name: taskqueue v1.0.13+20160428 site_url: http://byron.github.io/google-apis-rs/google-taskqueue1_beta2-cli site_description: A complete library to interact with taskqueue (protocol v1beta2) diff --git a/gen/taskqueue1_beta2-cli/src/main.rs b/gen/taskqueue1_beta2-cli/src/main.rs index e6f4c612c5..b294d615f3 100644 --- a/gen/taskqueue1_beta2-cli/src/main.rs +++ b/gen/taskqueue1_beta2-cli/src/main.rs @@ -1010,7 +1010,7 @@ fn main() { let mut app = App::new("taskqueue1-beta2") .author("Sebastian Thiel ") - .version("1.0.12+20160428") + .version("1.0.13+20160428") .about("Accesses a Google App Engine Pull Task Queue over REST.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_taskqueue1_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/taskqueue1_beta2/Cargo.toml b/gen/taskqueue1_beta2/Cargo.toml index 2bcf33ee2b..99fb34cf16 100644 --- a/gen/taskqueue1_beta2/Cargo.toml +++ b/gen/taskqueue1_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-taskqueue1_beta2" -version = "1.0.12+20160428" +version = "1.0.13+20160428" authors = ["Sebastian Thiel "] description = "A complete library to interact with taskqueue (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/taskqueue1_beta2" homepage = "https://developers.google.com/appengine/docs/python/taskqueue/rest" -documentation = "https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428" +documentation = "https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428" license = "MIT" keywords = ["taskqueue", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/taskqueue1_beta2/README.md b/gen/taskqueue1_beta2/README.md index 85471b5a67..b6c8a2db79 100644 --- a/gen/taskqueue1_beta2/README.md +++ b/gen/taskqueue1_beta2/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-taskqueue1_beta2` library allows access to all features of the *Google taskqueue* service. -This documentation was generated from *taskqueue* crate version *1.0.12+20160428*, where *20160428* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *taskqueue* crate version *1.0.13+20160428*, where *20160428* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *taskqueue* *v1_beta2* API can be found at the [official documentation site](https://developers.google.com/appengine/docs/python/taskqueue/rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.Taskqueue.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.Taskqueue.html) ... * taskqueues - * [*get*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskqueueGetCall.html) -* [tasks](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.Task.html) - * [*delete*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskGetCall.html), [*insert*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskInsertCall.html), [*lease*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskLeaseCall.html), [*list*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskListCall.html), [*patch*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskPatchCall.html) and [*update*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.TaskUpdateCall.html) + * [*get*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskqueueGetCall.html) +* [tasks](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.Task.html) + * [*delete*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskGetCall.html), [*insert*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskInsertCall.html), [*lease*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskLeaseCall.html), [*list*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskListCall.html), [*patch*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskPatchCall.html) and [*update*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.TaskUpdateCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/struct.Taskqueue.html)** +* **[Hub](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/struct.Taskqueue.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -154,29 +154,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-taskqueue1_beta2/1.0.12+20160428/google_taskqueue1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-taskqueue1_beta2/1.0.13+20160428/google_taskqueue1_beta2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/taskqueue1_beta2/src/lib.rs b/gen/taskqueue1_beta2/src/lib.rs index 7c04820eb7..fefda7fc6f 100644 --- a/gen/taskqueue1_beta2/src/lib.rs +++ b/gen/taskqueue1_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *taskqueue* crate version *1.0.12+20160428*, where *20160428* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *taskqueue* crate version *1.0.13+20160428*, where *20160428* is the exact revision of the *taskqueue:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *taskqueue* *v1_beta2* API can be found at the //! [official documentation site](https://developers.google.com/appengine/docs/python/taskqueue/rest). @@ -333,7 +333,7 @@ impl<'a, C, A> Taskqueue Taskqueue { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/taskqueue/v1beta2/projects/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> Taskqueue } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/tasks1-cli/Cargo.toml b/gen/tasks1-cli/Cargo.toml index 8937f24eaf..5c6f44b3b6 100644 --- a/gen/tasks1-cli/Cargo.toml +++ b/gen/tasks1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tasks1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20190628" authors = ["Sebastian Thiel "] description = "A complete library to interact with tasks (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tasks1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-tasks1] path = "../tasks1" -version = "1.0.12+20190628" +version = "1.0.13+20190628" diff --git a/gen/tasks1-cli/README.md b/gen/tasks1-cli/README.md index ff4ea54716..eb68c251dd 100644 --- a/gen/tasks1-cli/README.md +++ b/gen/tasks1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *tasks* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *tasks* API at revision *20190628*. The CLI is at version *1.0.13*. ```bash tasks1 [options] diff --git a/gen/tasks1-cli/mkdocs.yml b/gen/tasks1-cli/mkdocs.yml index 7d26638b2c..8118f040d5 100644 --- a/gen/tasks1-cli/mkdocs.yml +++ b/gen/tasks1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: tasks v1.0.12+20190628 +site_name: tasks v1.0.13+20190628 site_url: http://byron.github.io/google-apis-rs/google-tasks1-cli site_description: A complete library to interact with tasks (protocol v1) diff --git a/gen/tasks1-cli/src/main.rs b/gen/tasks1-cli/src/main.rs index 77d6882d10..8d1b33b5aa 100644 --- a/gen/tasks1-cli/src/main.rs +++ b/gen/tasks1-cli/src/main.rs @@ -1553,7 +1553,7 @@ fn main() { let mut app = App::new("tasks1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20190628") .about("Manages your tasks and task lists.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tasks1_cli") .arg(Arg::with_name("url") diff --git a/gen/tasks1/Cargo.toml b/gen/tasks1/Cargo.toml index 4ff93c8f93..d2d404bba7 100644 --- a/gen/tasks1/Cargo.toml +++ b/gen/tasks1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-tasks1" -version = "1.0.12+20190628" +version = "1.0.13+20190628" authors = ["Sebastian Thiel "] description = "A complete library to interact with tasks (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tasks1" homepage = "https://developers.google.com/google-apps/tasks/firstapp" -documentation = "https://docs.rs/google-tasks1/1.0.12+20190628" +documentation = "https://docs.rs/google-tasks1/1.0.13+20190628" license = "MIT" keywords = ["tasks", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/tasks1/README.md b/gen/tasks1/README.md index e5d270c5ee..81950a167f 100644 --- a/gen/tasks1/README.md +++ b/gen/tasks1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-tasks1` library allows access to all features of the *Google tasks* service. -This documentation was generated from *tasks* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *tasks* crate version *1.0.13+20190628*, where *20190628* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *tasks* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/tasks/firstapp). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasksHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasksHub.html) ... * tasklists - * [*delete*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasklistDeleteCall.html), [*get*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasklistGetCall.html), [*insert*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasklistInsertCall.html), [*list*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasklistListCall.html), [*patch*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasklistPatchCall.html) and [*update*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasklistUpdateCall.html) -* [tasks](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.Task.html) - * [*clear*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskClearCall.html), [*delete*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskGetCall.html), [*insert*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskInsertCall.html), [*list*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskListCall.html), [*move*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskMoveCall.html), [*patch*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskPatchCall.html) and [*update*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TaskUpdateCall.html) + * [*delete*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasklistDeleteCall.html), [*get*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasklistGetCall.html), [*insert*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasklistInsertCall.html), [*list*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasklistListCall.html), [*patch*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasklistPatchCall.html) and [*update*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasklistUpdateCall.html) +* [tasks](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.Task.html) + * [*clear*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskClearCall.html), [*delete*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskGetCall.html), [*insert*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskInsertCall.html), [*list*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskListCall.html), [*move*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskMoveCall.html), [*patch*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskPatchCall.html) and [*update*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TaskUpdateCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/struct.TasksHub.html)** +* **[Hub](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/struct.TasksHub.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.Part.html)** + * **[Parts](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -143,17 +143,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -163,29 +163,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-tasks1/1.0.12+20190628/google_tasks1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-tasks1/1.0.13+20190628/google_tasks1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/tasks1/src/lib.rs b/gen/tasks1/src/lib.rs index e632deb37c..8edb97ac3c 100644 --- a/gen/tasks1/src/lib.rs +++ b/gen/tasks1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *tasks* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *tasks* crate version *1.0.13+20190628*, where *20190628* is the exact revision of the *tasks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *tasks* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/tasks/firstapp). @@ -350,7 +350,7 @@ impl<'a, C, A> TasksHub TasksHub { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/tasks/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -364,7 +364,7 @@ impl<'a, C, A> TasksHub } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/testing1-cli/Cargo.toml b/gen/testing1-cli/Cargo.toml index 3668caaefc..9ad60c3945 100644 --- a/gen/testing1-cli/Cargo.toml +++ b/gen/testing1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-testing1-cli" -version = "1.0.12+20190627" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with testing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/testing1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-testing1] path = "../testing1" -version = "1.0.12+20190627" +version = "1.0.13+20200408" diff --git a/gen/testing1-cli/README.md b/gen/testing1-cli/README.md index 32c08f9b9d..cef79e7789 100644 --- a/gen/testing1-cli/README.md +++ b/gen/testing1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *testing* API at revision *20190627*. The CLI is at version *1.0.12*. +This documentation was generated from the *testing* API at revision *20200408*. The CLI is at version *1.0.13*. ```bash testing1 [options] diff --git a/gen/testing1-cli/mkdocs.yml b/gen/testing1-cli/mkdocs.yml index b3d32a8b0b..d757e6ee6c 100644 --- a/gen/testing1-cli/mkdocs.yml +++ b/gen/testing1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: testing v1.0.12+20190627 +site_name: testing v1.0.13+20200408 site_url: http://byron.github.io/google-apis-rs/google-testing1-cli site_description: A complete library to interact with testing (protocol v1) diff --git a/gen/testing1-cli/src/main.rs b/gen/testing1-cli/src/main.rs index f343cd738f..8b47e1d884 100644 --- a/gen/testing1-cli/src/main.rs +++ b/gen/testing1-cli/src/main.rs @@ -221,7 +221,11 @@ impl<'n> Engine<'n> { "test-specification.ios-xc-test.xctestrun.gcs-path" => Some(("testSpecification.iosXcTest.xctestrun.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-specification.ios-xc-test.tests-zip.gcs-path" => Some(("testSpecification.iosXcTest.testsZip.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-specification.ios-xc-test.xcode-version" => Some(("testSpecification.iosXcTest.xcodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.ios-test-loop.scenarios" => Some(("testSpecification.iosTestLoop.scenarios", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Vec })), + "test-specification.ios-test-loop.app-bundle-id" => Some(("testSpecification.iosTestLoop.appBundleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.ios-test-loop.app-ipa.gcs-path" => Some(("testSpecification.iosTestLoop.appIpa.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-specification.test-timeout" => Some(("testSpecification.testTimeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.test-setup.systrace.duration-seconds" => Some(("testSpecification.testSetup.systrace.durationSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "test-specification.test-setup.directories-to-pull" => Some(("testSpecification.testSetup.directoriesToPull", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "test-specification.test-setup.network-profile" => Some(("testSpecification.testSetup.networkProfile", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-specification.disable-video-recording" => Some(("testSpecification.disableVideoRecording", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -245,6 +249,7 @@ impl<'n> Engine<'n> { "test-specification.android-instrumentation-test.app-apk.gcs-path" => Some(("testSpecification.androidInstrumentationTest.appApk.gcsPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-specification.android-instrumentation-test.app-package-id" => Some(("testSpecification.androidInstrumentationTest.appPackageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-specification.android-instrumentation-test.orchestrator-option" => Some(("testSpecification.androidInstrumentationTest.orchestratorOption", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "test-specification.android-instrumentation-test.sharding-option.uniform-sharding.num-shards" => Some(("testSpecification.androidInstrumentationTest.shardingOption.uniformSharding.numShards", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "test-specification.android-instrumentation-test.test-targets" => Some(("testSpecification.androidInstrumentationTest.testTargets", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "test-matrix-id" => Some(("testMatrixId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -256,7 +261,7 @@ impl<'n> Engine<'n> { "environment-matrix.android-matrix.orientations" => Some(("environmentMatrix.androidMatrix.orientations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "outcome-summary" => Some(("outcomeSummary", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["android-instrumentation-test", "android-matrix", "android-model-ids", "android-robo-test", "android-test-loop", "android-version-ids", "app-apk", "app-bundle", "app-bundle-id", "app-initial-activity", "app-package-id", "bundle-location", "client-info", "directories-to-pull", "disable-performance-metrics", "disable-video-recording", "environment-matrix", "execution-id", "flaky-test-attempts", "gcs-path", "google-cloud-storage", "history-id", "invalid-matrix-details", "ios-test-setup", "ios-xc-test", "locales", "max-depth", "max-steps", "name", "network-profile", "orchestrator-option", "orientations", "outcome-summary", "project-id", "result-storage", "results-url", "robo-script", "scenario-labels", "scenarios", "state", "test-apk", "test-matrix-id", "test-package-id", "test-runner-class", "test-setup", "test-specification", "test-targets", "test-timeout", "tests-zip", "timestamp", "tool-results-execution", "tool-results-history", "xcode-version", "xctestrun"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["android-instrumentation-test", "android-matrix", "android-model-ids", "android-robo-test", "android-test-loop", "android-version-ids", "app-apk", "app-bundle", "app-bundle-id", "app-initial-activity", "app-ipa", "app-package-id", "bundle-location", "client-info", "directories-to-pull", "disable-performance-metrics", "disable-video-recording", "duration-seconds", "environment-matrix", "execution-id", "flaky-test-attempts", "gcs-path", "google-cloud-storage", "history-id", "invalid-matrix-details", "ios-test-loop", "ios-test-setup", "ios-xc-test", "locales", "max-depth", "max-steps", "name", "network-profile", "num-shards", "orchestrator-option", "orientations", "outcome-summary", "project-id", "result-storage", "results-url", "robo-script", "scenario-labels", "scenarios", "sharding-option", "state", "systrace", "test-apk", "test-matrix-id", "test-package-id", "test-runner-class", "test-setup", "test-specification", "test-targets", "test-timeout", "tests-zip", "timestamp", "tool-results-execution", "tool-results-history", "uniform-sharding", "xcode-version", "xctestrun"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -726,7 +731,7 @@ fn main() { let mut app = App::new("testing1") .author("Sebastian Thiel ") - .version("1.0.12+20190627") + .version("1.0.13+20200408") .about("Allows developers to run automated tests for their mobile applications on Google infrastructure.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_testing1_cli") .arg(Arg::with_name("url") diff --git a/gen/testing1/Cargo.toml b/gen/testing1/Cargo.toml index 42977093be..a783aef3bd 100644 --- a/gen/testing1/Cargo.toml +++ b/gen/testing1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-testing1" -version = "1.0.12+20190627" +version = "1.0.13+20200408" authors = ["Sebastian Thiel "] description = "A complete library to interact with testing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/testing1" homepage = "https://developers.google.com/cloud-test-lab/" -documentation = "https://docs.rs/google-testing1/1.0.12+20190627" +documentation = "https://docs.rs/google-testing1/1.0.13+20200408" license = "MIT" keywords = ["testing", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/testing1/README.md b/gen/testing1/README.md index 85aee11d8c..d24311a20c 100644 --- a/gen/testing1/README.md +++ b/gen/testing1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-testing1` library allows access to all features of the *Google testing* service. -This documentation was generated from *testing* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *testing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *testing* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *testing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *testing* *v1* API can be found at the [official documentation site](https://developers.google.com/cloud-test-lab/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.Testing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.Testing.html) ... * application detail service - * [*get apk details*](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.ApplicationDetailServiceGetApkDetailCall.html) + * [*get apk details*](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.ApplicationDetailServiceGetApkDetailCall.html) * projects - * [*test matrices cancel*](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.ProjectTestMatriceCancelCall.html), [*test matrices create*](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.ProjectTestMatriceCreateCall.html) and [*test matrices get*](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.ProjectTestMatriceGetCall.html) -* [test environment catalog](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.TestEnvironmentCatalog.html) - * [*get*](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.TestEnvironmentCatalogGetCall.html) + * [*test matrices cancel*](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.ProjectTestMatriceCancelCall.html), [*test matrices create*](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.ProjectTestMatriceCreateCall.html) and [*test matrices get*](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.ProjectTestMatriceGetCall.html) +* [test environment catalog](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.TestEnvironmentCatalog.html) + * [*get*](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.TestEnvironmentCatalogGetCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/struct.Testing.html)** +* **[Hub](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/struct.Testing.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.Part.html)** + * **[Parts](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-testing1/1.0.12+20190627/google_testing1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-testing1/1.0.13+20200408/google_testing1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/testing1/src/lib.rs b/gen/testing1/src/lib.rs index c31d9c401a..105761a4b4 100644 --- a/gen/testing1/src/lib.rs +++ b/gen/testing1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *testing* crate version *1.0.12+20190627*, where *20190627* is the exact revision of the *testing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *testing* crate version *1.0.13+20200408*, where *20200408* is the exact revision of the *testing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *testing* *v1* API can be found at the //! [official documentation site](https://developers.google.com/cloud-test-lab/). @@ -340,7 +340,7 @@ impl<'a, C, A> Testing Testing { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://testing.googleapis.com/".to_string(), _root_url: "https://testing.googleapis.com/".to_string(), } @@ -357,7 +357,7 @@ impl<'a, C, A> Testing } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -385,102 +385,22 @@ impl<'a, C, A> Testing // ############ // SCHEMAS ### // ########## -/// A single Android device. +/// Test targets for a shard. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidDevice { - /// Required. The locale the test device used for testing. - /// Use the TestEnvironmentDiscoveryService to get supported options. - pub locale: Option, - /// Required. The id of the Android OS version to be used. - /// Use the TestEnvironmentDiscoveryService to get supported options. - #[serde(rename="androidVersionId")] - pub android_version_id: Option, - /// Required. The id of the Android device to be used. - /// Use the TestEnvironmentDiscoveryService to get supported options. - #[serde(rename="androidModelId")] - pub android_model_id: Option, - /// Required. How the device is oriented during the test. - /// Use the TestEnvironmentDiscoveryService to get supported options. - pub orientation: Option, -} - -impl Part for AndroidDevice {} - - -/// Locations where the results of running the test are stored. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ResultStorage { - /// The tool results history that contains the tool results execution that - /// results are written to. +pub struct TestTargetsForShard { + /// Group of packages, classes, and/or test methods to be run for each shard. + /// The targets need to be specified in AndroidJUnitRunner argument format. For + /// example, “package com.my.packages” “class com.my.package.MyClass”. /// - /// If not provided, the service will choose an appropriate value. - #[serde(rename="toolResultsHistory")] - pub tool_results_history: Option, - /// Required. - #[serde(rename="googleCloudStorage")] - pub google_cloud_storage: Option, - /// Output only. The tool results execution that results are written to. - #[serde(rename="toolResultsExecution")] - pub tool_results_execution: Option, - /// Output only. URL to the results in the Firebase Web Console. - #[serde(rename="resultsUrl")] - pub results_url: Option, + /// The number of shard_test_targets must be greater than 0. + #[serde(rename="testTargets")] + pub test_targets: Option>, } -impl Part for ResultStorage {} - - -/// Represents a tool results execution resource. -/// -/// This has the results of a TestMatrix. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ToolResultsExecution { - /// Output only. The cloud project that owns the tool results execution. - #[serde(rename="projectId")] - pub project_id: Option, - /// Output only. A tool results execution ID. - #[serde(rename="executionId")] - pub execution_id: Option, - /// Output only. A tool results history ID. - #[serde(rename="historyId")] - pub history_id: Option, -} - -impl Part for ToolResultsExecution {} - - -/// A single iOS device. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosDevice { - /// Required. The locale the test device used for testing. - /// Use the TestEnvironmentDiscoveryService to get supported options. - pub locale: Option, - /// Required. The id of the iOS major software version to be used. - /// Use the TestEnvironmentDiscoveryService to get supported options. - #[serde(rename="iosVersionId")] - pub ios_version_id: Option, - /// Required. How the device is oriented during the test. - /// Use the TestEnvironmentDiscoveryService to get supported options. - pub orientation: Option, - /// Required. The id of the iOS device to be used. - /// Use the TestEnvironmentDiscoveryService to get supported options. - #[serde(rename="iosModelId")] - pub ios_model_id: Option, -} - -impl Part for IosDevice {} +impl Part for TestTargetsForShard {} /// The section of an tag. @@ -521,73 +441,19 @@ pub struct Environment { impl Part for Environment {} -/// A set of Android device configuration permutations is defined by the -/// the cross-product of the given axes. Internally, the given AndroidMatrix -/// will be expanded into a set of AndroidDevices. -/// -/// Only supported permutations will be instantiated. Invalid permutations -/// (e.g., incompatible models/versions) are ignored. +/// Android application details based on application manifest and apk archive +/// contents. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidMatrix { - /// Required. The ids of the set of Android OS version to be used. - /// Use the TestEnvironmentDiscoveryService to get supported options. - #[serde(rename="androidVersionIds")] - pub android_version_ids: Option>, - /// Required. The ids of the set of Android device to be used. - /// Use the TestEnvironmentDiscoveryService to get supported options. - #[serde(rename="androidModelIds")] - pub android_model_ids: Option>, - /// Required. The set of locales the test device will enable for testing. - /// Use the TestEnvironmentDiscoveryService to get supported options. - pub locales: Option>, - /// Required. The set of orientations to test with. - /// Use the TestEnvironmentDiscoveryService to get supported options. - pub orientations: Option>, +pub struct ApkDetail { + /// no description provided + #[serde(rename="apkManifest")] + pub apk_manifest: Option, } -impl Part for AndroidMatrix {} - - -/// Response containing the current state of the specified test matrix. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [test matrices cancel projects](struct.ProjectTestMatriceCancelCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CancelTestMatrixResponse { - /// The current rolled-up state of the test matrix. - /// If this state is already final, then the cancelation request will - /// have no effect. - #[serde(rename="testState")] - pub test_state: Option, -} - -impl ResponseResult for CancelTestMatrixResponse {} - - -/// A starting intent specified by an action, uri, and categories. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StartActivityIntent { - /// Action name. - /// Required for START_ACTIVITY. - pub action: Option, - /// URI for the action. - pub uri: Option, - /// Intent categories to set on the intent. - pub categories: Option>, -} - -impl Part for StartActivityIntent {} +impl Part for ApkDetail {} /// An Xcode version that an iOS version is compatible with. @@ -607,50 +473,6 @@ pub struct XcodeVersion { impl Part for XcodeVersion {} -/// Represents a tool results step resource. -/// -/// This has the results of a TestExecution. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ToolResultsStep { - /// Output only. The cloud project that owns the tool results step. - #[serde(rename="projectId")] - pub project_id: Option, - /// Output only. A tool results execution ID. - #[serde(rename="executionId")] - pub execution_id: Option, - /// Output only. A tool results step ID. - #[serde(rename="stepId")] - pub step_id: Option, - /// Output only. A tool results history ID. - #[serde(rename="historyId")] - pub history_id: Option, -} - -impl Part for ToolResultsStep {} - - -/// Data about the relative number of devices running a -/// given configuration of the Android platform. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Distribution { - /// Output only. The time this distribution was measured. - #[serde(rename="measurementTime")] - pub measurement_time: Option, - /// Output only. The estimated fraction (0-1) of the total market with this - /// configuration. - #[serde(rename="marketShare")] - pub market_share: Option, -} - -impl Part for Distribution {} - - /// Network emulation parameters. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -674,66 +496,6 @@ pub struct TrafficRule { impl Part for TrafficRule {} -/// A description of an Android device tests may be run on. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidModel { - /// Whether this device is a phone, tablet, wearable, etc. - #[serde(rename="formFactor")] - pub form_factor: Option, - /// The human-readable marketing name for this device model. - /// Examples: "Nexus 5", "Galaxy S5". - pub name: Option, - /// Whether this device is virtual or physical. - pub form: Option, - /// Tags for this dimension. - /// Examples: "default", "preview", "deprecated". - pub tags: Option>, - /// True if and only if tests with this model are recorded by stitching - /// together screenshots. See use_low_spec_video_recording in device config. - #[serde(rename="lowFpsVideoRecording")] - pub low_fps_video_recording: Option, - /// The company that this device is branded with. - /// Example: "Google", "Samsung". - pub brand: Option, - /// The unique opaque id for this model. - /// Use this for invoking the TestExecutionService. - pub id: Option, - /// The set of Android versions this device supports. - #[serde(rename="supportedVersionIds")] - pub supported_version_ids: Option>, - /// Screen density in DPI. - /// This corresponds to ro.sf.lcd_density - #[serde(rename="screenDensity")] - pub screen_density: Option, - /// The list of supported ABIs for this device. - /// This corresponds to either android.os.Build.SUPPORTED_ABIS (for API level - /// 21 and above) or android.os.Build.CPU_ABI/CPU_ABI2. - /// The most preferred ABI is the first element in the list. - /// - /// Elements are optionally prefixed by "version_id:" (where version_id is - /// the id of an AndroidVersion), denoting an ABI that is supported only on - /// a particular version. - #[serde(rename="supportedAbis")] - pub supported_abis: Option>, - /// Screen size in the horizontal (X) dimension measured in pixels. - #[serde(rename="screenX")] - pub screen_x: Option, - /// Screen size in the vertical (Y) dimension measured in pixels. - #[serde(rename="screenY")] - pub screen_y: Option, - /// The manufacturer of this device. - pub manufacturer: Option, - /// The name of the industrial design. - /// This corresponds to android.os.Build.DEVICE. - pub codename: Option, -} - -impl Part for AndroidModel {} - - /// A list of Android device configurations in which the test is to be executed. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -748,37 +510,26 @@ pub struct AndroidDeviceList { impl Part for AndroidDeviceList {} -/// Information about the client which invoked the test. +/// Represents a tool results execution resource. +/// +/// This has the results of a TestMatrix. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ClientInfo { - /// The list of detailed information about client. - #[serde(rename="clientInfoDetails")] - pub client_info_details: Option>, - /// Required. Client name, such as gcloud. - pub name: Option, +pub struct ToolResultsExecution { + /// Output only. The cloud project that owns the tool results execution. + #[serde(rename="projectId")] + pub project_id: Option, + /// Output only. A tool results execution ID. + #[serde(rename="executionId")] + pub execution_id: Option, + /// Output only. A tool results history ID. + #[serde(rename="historyId")] + pub history_id: Option, } -impl Part for ClientInfo {} - - -/// A description of how to set up an iOS device prior to running the test. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosTestSetup { - /// The network traffic profile used for running the test. - /// Available network profiles can be queried by using the - /// NETWORK_CONFIGURATION environment type when calling - /// TestEnvironmentDiscoveryService.GetTestEnvironmentCatalog. - #[serde(rename="networkProfile")] - pub network_profile: Option, -} - -impl Part for IosTestSetup {} +impl Part for ToolResultsExecution {} /// Response containing the details of the specified Android application APK. @@ -800,56 +551,21 @@ pub struct GetApkDetailsResponse { impl ResponseResult for GetApkDetailsResponse {} -/// A test of an iOS application that uses the XCTest framework. -/// Xcode supports the option to "build for testing", which generates an -/// .xctestrun file that contains a test specification (arguments, test methods, -/// etc). This test type accepts a zip file containing the .xctestrun file and -/// the corresponding contents of the Build/Products directory that contains all -/// the binaries needed to run the tests. +/// An Android App Bundle file format, containing a BundleConfig.pb file, +/// a base module directory, zero or more dynamic feature module directories. +///

          See https://developer.android.com/guide/app-bundle/build for guidance on +/// building App Bundles. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosXcTest { - /// Output only. The bundle id for the application under test. - #[serde(rename="appBundleId")] - pub app_bundle_id: Option, - /// An .xctestrun file that will override the .xctestrun file in the - /// tests zip. Because the .xctestrun file contains environment variables along - /// with test methods to run and/or ignore, this can be useful for sharding - /// tests. Default is taken from the tests zip. - pub xctestrun: Option, - /// Required. The .zip containing the .xctestrun file and the contents of the - /// DerivedData/Build/Products directory. - /// The .xctestrun file in this zip is ignored if the xctestrun field is - /// specified. - #[serde(rename="testsZip")] - pub tests_zip: Option, - /// The Xcode version that should be used for the test. - /// Use the TestEnvironmentDiscoveryService to get supported options. - /// Defaults to the latest Xcode version Firebase Test Lab supports. - #[serde(rename="xcodeVersion")] - pub xcode_version: Option, +pub struct AppBundle { + /// .aab file representing the app bundle under test. + #[serde(rename="bundleLocation")] + pub bundle_location: Option, } -impl Part for IosXcTest {} - - -/// Represents a tool results history resource. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ToolResultsHistory { - /// Required. The cloud project that owns the tool results history. - #[serde(rename="projectId")] - pub project_id: Option, - /// Required. A tool results history ID. - #[serde(rename="historyId")] - pub history_id: Option, -} - -impl Part for ToolResultsHistory {} +impl Part for AppBundle {} /// A single test executed in a single environment. @@ -864,13 +580,15 @@ pub struct TestExecution { /// Output only. Id of the containing TestMatrix. #[serde(rename="matrixId")] pub matrix_id: Option, - /// Output only. Indicates the current progress of the test execution - /// (e.g., FINISHED). - pub state: Option, + /// Output only. Details about the shard. + pub shard: Option, /// Output only. Unique id set by the service. pub id: Option, /// Output only. How the host machine(s) are configured. pub environment: Option, + /// Output only. Indicates the current progress of the test execution + /// (e.g., FINISHED). + pub state: Option, /// Output only. How to run the test. #[serde(rename="testSpecification")] pub test_specification: Option, @@ -926,20 +644,6 @@ impl Part for ApkManifest {} pub struct TestSetup { /// The device will be logged in on this account for the duration of the test. pub account: Option, - /// Environment variables to set for the test (only applicable for - /// instrumentation tests). - #[serde(rename="environmentVariables")] - pub environment_variables: Option>, - /// The network traffic profile used for running the test. - /// Available network profiles can be queried by using the - /// NETWORK_CONFIGURATION environment type when calling - /// TestEnvironmentDiscoveryService.GetTestEnvironmentCatalog. - #[serde(rename="networkProfile")] - pub network_profile: Option, - /// APKs to install in addition to those being directly tested. - /// Currently capped at 100. - #[serde(rename="additionalApks")] - pub additional_apks: Option>, /// List of directories on the device to upload to GCS at the end of the test; /// they must be absolute paths under /sdcard or /data/local/tmp. /// Path names are restricted to characters a-z A-Z 0-9 _ - . + and / @@ -950,6 +654,25 @@ pub struct TestSetup { /// storage path prefix for that device. #[serde(rename="directoriesToPull")] pub directories_to_pull: Option>, + /// Systrace configuration for the run. + /// If set a systrace will be taken, starting on test start and lasting for the + /// configured duration. The systrace file thus obtained is put in the results + /// bucket together with the other artifacts from the run. + pub systrace: Option, + /// The network traffic profile used for running the test. + /// Available network profiles can be queried by using the + /// NETWORK_CONFIGURATION environment type when calling + /// TestEnvironmentDiscoveryService.GetTestEnvironmentCatalog. + #[serde(rename="networkProfile")] + pub network_profile: Option, + /// APKs to install in addition to those being directly tested. + /// Currently capped at 100. + #[serde(rename="additionalApks")] + pub additional_apks: Option>, + /// Environment variables to set for the test (only applicable for + /// instrumentation tests). + #[serde(rename="environmentVariables")] + pub environment_variables: Option>, /// List of files to push to the device before starting the test. #[serde(rename="filesToPush")] pub files_to_push: Option>, @@ -958,75 +681,6 @@ pub struct TestSetup { impl Part for TestSetup {} -/// The currently supported Android devices. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidDeviceCatalog { - /// The set of supported Android device models. - pub models: Option>, - /// The set of supported runtime configurations. - #[serde(rename="runtimeConfiguration")] - pub runtime_configuration: Option, - /// The set of supported Android OS versions. - pub versions: Option>, -} - -impl Part for AndroidDeviceCatalog {} - - -/// An opaque binary blob file to install on the device before the test starts. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ObbFile { - /// Required. OBB file name which must conform to the format as specified by - /// Android - /// e.g. [main|patch].0300110.com.example.android.obb - /// which will be installed into - /// \/Android/obb/\/ - /// on the device. - #[serde(rename="obbFileName")] - pub obb_file_name: Option, - /// Required. Opaque Binary Blob (OBB) file(s) to install on the device. - pub obb: Option, -} - -impl Part for ObbFile {} - - -/// Represents a whole or partial calendar date, e.g. a birthday. The time of day -/// and time zone are either specified elsewhere or are not significant. The date -/// is relative to the Proleptic Gregorian Calendar. This can represent: -/// -/// * A full date, with non-zero year, month and day values -/// * A month and day value, with a zero year, e.g. an anniversary -/// * A year on its own, with zero month and day values -/// * A year and month value, with a zero day, e.g. a credit card expiration date -/// -/// Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Date { - /// Month of year. Must be from 1 to 12, or 0 if specifying a year without a - /// month and day. - pub month: Option, - /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - /// if specifying a year by itself or a year and month where the day is not - /// significant. - pub day: Option, - /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without - /// a year. - pub year: Option, -} - -impl Part for Date {} - - /// A test of an Android Application with a Test Loop. /// The intent \ will be implicitly added, since Games is the only /// user of this api, for the time being. @@ -1063,83 +717,67 @@ pub struct AndroidTestLoop { impl Part for AndroidTestLoop {} -/// A test of an Android application that can control an Android component -/// independently of its normal lifecycle. -/// Android instrumentation tests run an application APK and test APK inside the -/// same process on a virtual or physical AndroidDevice. They also specify -/// a test runner class, such as com.google.GoogleTestRunner, which can vary -/// on the specific instrumentation framework chosen. -/// -/// See for -/// more information on types of Android tests. +/// iOS configuration that can be selected at the time a test is run. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidInstrumentationTest { - /// A multi-apk app bundle for the application under test. - #[serde(rename="appBundle")] - pub app_bundle: Option, - /// Required. The APK containing the test code to be executed. - #[serde(rename="testApk")] - pub test_apk: Option, - /// The InstrumentationTestRunner class. - /// The default value is determined by examining the application's manifest. - #[serde(rename="testRunnerClass")] - pub test_runner_class: Option, - /// The java package for the test to be executed. - /// The default value is determined by examining the application's manifest. - #[serde(rename="testPackageId")] - pub test_package_id: Option, - /// The APK for the application under test. - #[serde(rename="appApk")] - pub app_apk: Option, - /// The java package for the application under test. - /// The default value is determined by examining the application's manifest. - #[serde(rename="appPackageId")] - pub app_package_id: Option, - /// The option of whether running each test within its own invocation of - /// instrumentation with Android Test Orchestrator or not. - /// ** Orchestrator is only compatible with AndroidJUnitRunner version 1.0 or - /// higher! ** - /// Orchestrator offers the following benefits: - /// - No shared state - /// - Crashes are isolated - /// - Logs are scoped per test - /// - /// See - /// - /// for more information about Android Test Orchestrator. - /// - /// If not set, the test will be run without the orchestrator. - #[serde(rename="orchestratorOption")] - pub orchestrator_option: Option, - /// Each target must be fully qualified with the package name or class name, - /// in one of these formats: - /// - "package package_name" - /// - "class package_name.class_name" - /// - "class package_name.class_name#method_name" - /// - /// If empty, all targets in the module will be run. - #[serde(rename="testTargets")] - pub test_targets: Option>, +pub struct IosRuntimeConfiguration { + /// The set of available orientations. + pub orientations: Option>, + /// The set of available locales. + pub locales: Option>, } -impl Part for AndroidInstrumentationTest {} +impl Part for IosRuntimeConfiguration {} -/// A list of iOS device configurations in which the test is to be executed. +/// Represents a whole or partial calendar date, e.g. a birthday. The time of day +/// and time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. This can represent: +/// +/// * A full date, with non-zero year, month and day values +/// * A month and day value, with a zero year, e.g. an anniversary +/// * A year on its own, with zero month and day values +/// * A year and month value, with a zero day, e.g. a credit card expiration date +/// +/// Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosDeviceList { - /// Required. A list of iOS devices. - #[serde(rename="iosDevices")] - pub ios_devices: Option>, +pub struct Date { + /// Month of year. Must be from 1 to 12, or 0 if specifying a year without a + /// month and day. + pub month: Option, + /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + /// if specifying a year by itself or a year and month where the day is not + /// significant. + pub day: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, } -impl Part for IosDeviceList {} +impl Part for Date {} + + +/// The currently supported Android devices. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidDeviceCatalog { + /// The set of supported Android device models. + pub models: Option>, + /// The set of supported runtime configurations. + #[serde(rename="runtimeConfiguration")] + pub runtime_configuration: Option, + /// The set of supported Android OS versions. + pub versions: Option>, +} + +impl Part for AndroidDeviceCatalog {} /// Additional details about the progress of the running test. @@ -1164,54 +802,70 @@ pub struct TestDetails { impl Part for TestDetails {} -/// Key-value pair of detailed information about the client which invoked the -/// test. Examples: {'Version', '1.0'}, {'Release Track', 'BETA'}. +/// A description of an iOS device tests may be run on. +/// Next tag: 12 /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ClientInfoDetail { - /// Required. The key of detailed client information. - pub key: Option, - /// Required. The value of detailed client information. - pub value: Option, +pub struct IosModel { + /// Whether this device is a phone, tablet, wearable, etc. + #[serde(rename="formFactor")] + pub form_factor: Option, + /// The human-readable name for this device model. + /// Examples: "iPhone 4s", "iPad Mini 2". + pub name: Option, + /// Tags for this dimension. + /// Examples: "default", "preview", "deprecated". + pub tags: Option>, + /// Screen density in DPI. + #[serde(rename="screenDensity")] + pub screen_density: Option, + /// The set of iOS major software versions this device supports. + #[serde(rename="supportedVersionIds")] + pub supported_version_ids: Option>, + /// Screen size in the vertical (Y) dimension measured in pixels. + #[serde(rename="screenY")] + pub screen_y: Option, + /// Screen size in the horizontal (X) dimension measured in pixels. + #[serde(rename="screenX")] + pub screen_x: Option, + /// The unique opaque id for this model. + /// Use this for invoking the TestExecutionService. + pub id: Option, + /// Device capabilities. + /// Copied from + /// https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html + #[serde(rename="deviceCapabilities")] + pub device_capabilities: Option>, } -impl Part for ClientInfoDetail {} +impl Part for IosModel {} -/// A storage location within Google cloud storage (GCS). +/// A single iOS device. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudStorage { - /// Required. The path to a directory in GCS that will - /// eventually contain the results for this test. - /// The requesting user must have write access on the bucket in the supplied - /// path. - #[serde(rename="gcsPath")] - pub gcs_path: Option, +pub struct IosDevice { + /// Required. The locale the test device used for testing. + /// Use the TestEnvironmentDiscoveryService to get supported options. + pub locale: Option, + /// Required. The id of the iOS major software version to be used. + /// Use the TestEnvironmentDiscoveryService to get supported options. + #[serde(rename="iosVersionId")] + pub ios_version_id: Option, + /// Required. How the device is oriented during the test. + /// Use the TestEnvironmentDiscoveryService to get supported options. + pub orientation: Option, + /// Required. The id of the iOS device to be used. + /// Use the TestEnvironmentDiscoveryService to get supported options. + #[serde(rename="iosModelId")] + pub ios_model_id: Option, } -impl Part for GoogleCloudStorage {} - - -/// An Android App Bundle file format, containing a BundleConfig.pb file, -/// a base module directory, zero or more dynamic feature module directories. -///

          See https://developer.android.com/guide/app-bundle/build for guidance on -/// building App Bundles. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppBundle { - /// .aab file representing the app bundle under test. - #[serde(rename="bundleLocation")] - pub bundle_location: Option, -} - -impl Part for AppBundle {} +impl Part for IosDevice {} /// Identifies an account and how to log into it. @@ -1228,35 +882,26 @@ pub struct Account { impl Part for Account {} -/// A description of an iOS device tests may be run on. +/// A test of an iOS application that implements one or more game loop scenarios. +/// This test type accepts an archived application (.ipa file) and a list of +/// integer scenarios that will be executed on the app sequentially. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosModel { - /// Whether this device is a phone, tablet, wearable, etc. - #[serde(rename="formFactor")] - pub form_factor: Option, - /// The human-readable name for this device model. - /// Examples: "iPhone 4s", "iPad Mini 2". - pub name: Option, - /// Tags for this dimension. - /// Examples: "default", "preview", "deprecated". - pub tags: Option>, - /// The set of iOS major software versions this device supports. - #[serde(rename="supportedVersionIds")] - pub supported_version_ids: Option>, - /// The unique opaque id for this model. - /// Use this for invoking the TestExecutionService. - pub id: Option, - /// Device capabilities. - /// Copied from - /// https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html - #[serde(rename="deviceCapabilities")] - pub device_capabilities: Option>, +pub struct IosTestLoop { + /// The list of scenarios that should be run during the test. Defaults to the + /// single scenario 0 if unspecified. + pub scenarios: Option>, + /// Output only. The bundle id for the application under test. + #[serde(rename="appBundleId")] + pub app_bundle_id: Option, + /// Required. The .ipa of the application to test. + #[serde(rename="appIpa")] + pub app_ipa: Option, } -impl Part for IosModel {} +impl Part for IosTestLoop {} /// The currently provided software environment on the devices under test. @@ -1275,87 +920,6 @@ pub struct ProvidedSoftwareCatalog { impl Part for ProvidedSoftwareCatalog {} -/// A description of how to run the test. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestSpecification { - /// Test setup requirements for iOS. - #[serde(rename="iosTestSetup")] - pub ios_test_setup: Option, - /// An iOS XCTest, via an .xctestrun file. - #[serde(rename="iosXcTest")] - pub ios_xc_test: Option, - /// Max time a test execution is allowed to run before it is - /// automatically cancelled. - /// The default value is 5 min. - #[serde(rename="testTimeout")] - pub test_timeout: Option, - /// Test setup requirements for Android e.g. files to install, bootstrap - /// scripts. - #[serde(rename="testSetup")] - pub test_setup: Option, - /// Disables video recording. May reduce test latency. - #[serde(rename="disableVideoRecording")] - pub disable_video_recording: Option, - /// Disables performance metrics recording. May reduce test latency. - #[serde(rename="disablePerformanceMetrics")] - pub disable_performance_metrics: Option, - /// An Android Application with a Test Loop. - #[serde(rename="androidTestLoop")] - pub android_test_loop: Option, - /// An Android robo test. - #[serde(rename="androidRoboTest")] - pub android_robo_test: Option, - /// An Android instrumentation test. - #[serde(rename="androidInstrumentationTest")] - pub android_instrumentation_test: Option, -} - -impl Part for TestSpecification {} - - -/// The matrix of environments in which the test is to be executed. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EnvironmentMatrix { - /// A list of Android devices; the test will be run only on the specified - /// devices. - #[serde(rename="androidDeviceList")] - pub android_device_list: Option, - /// A matrix of Android devices. - #[serde(rename="androidMatrix")] - pub android_matrix: Option, - /// A list of iOS devices. - #[serde(rename="iosDeviceList")] - pub ios_device_list: Option, -} - -impl Part for EnvironmentMatrix {} - - -/// Message for specifying the start activities to crawl. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RoboStartingIntent { - /// An intent that starts an activity with specific details. - #[serde(rename="startActivity")] - pub start_activity: Option, - /// Timeout in seconds for each intent. - pub timeout: Option, - /// An intent that starts the main launcher activity. - #[serde(rename="launcherActivity")] - pub launcher_activity: Option, -} - -impl Part for RoboStartingIntent {} - - /// A test of an android application that explores the application on a virtual /// or physical Android Device, finding culprits and crashes as it goes. /// @@ -1425,38 +989,22 @@ pub struct FileReference { impl RequestValue for FileReference {} -/// A version of the Android OS. +/// Options for enabling sharding. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AndroidVersion { - /// The date this Android version became available in the market. - #[serde(rename="releaseDate")] - pub release_date: Option, - /// A string representing this version of the Android OS. - /// Examples: "4.3", "4.4". - #[serde(rename="versionString")] - pub version_string: Option, - /// Tags for this dimension. - /// Examples: "default", "preview", "deprecated". - pub tags: Option>, - /// Market share for this version. - pub distribution: Option, - /// The API level for this Android version. - /// Examples: 18, 19. - #[serde(rename="apiLevel")] - pub api_level: Option, - /// The code name for this Android version. - /// Examples: "JellyBean", "KitKat". - #[serde(rename="codeName")] - pub code_name: Option, - /// An opaque id for this Android version. - /// Use this id to invoke the TestExecutionService. - pub id: Option, +pub struct ShardingOption { + /// Shards test cases into the specified groups of packages, classes, and/or + /// methods. + #[serde(rename="manualSharding")] + pub manual_sharding: Option, + /// Uniformly shards test cases given a total number of shards. + #[serde(rename="uniformSharding")] + pub uniform_sharding: Option, } -impl Part for AndroidVersion {} +impl Part for ShardingOption {} /// Directs Robo to interact with a specific UI element if it is encountered @@ -1488,32 +1036,72 @@ pub struct RoboDirective { impl Part for RoboDirective {} -/// An iOS version. +/// A test of an Android application that can control an Android component +/// independently of its normal lifecycle. +/// Android instrumentation tests run an application APK and test APK inside the +/// same process on a virtual or physical AndroidDevice. They also specify +/// a test runner class, such as com.google.GoogleTestRunner, which can vary +/// on the specific instrumentation framework chosen. +/// +/// See for +/// more information on types of Android tests. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosVersion { - /// An integer representing the major iOS version. - /// Examples: "8", "9". - #[serde(rename="majorVersion")] - pub major_version: Option, - /// Tags for this dimension. - /// Examples: "default", "preview", "deprecated". - pub tags: Option>, - /// An integer representing the minor iOS version. - /// Examples: "1", "2". - #[serde(rename="minorVersion")] - pub minor_version: Option, - /// An opaque id for this iOS version. - /// Use this id to invoke the TestExecutionService. - pub id: Option, - /// The available Xcode versions for this version. - #[serde(rename="supportedXcodeVersionIds")] - pub supported_xcode_version_ids: Option>, +pub struct AndroidInstrumentationTest { + /// A multi-apk app bundle for the application under test. + #[serde(rename="appBundle")] + pub app_bundle: Option, + /// Required. The APK containing the test code to be executed. + #[serde(rename="testApk")] + pub test_apk: Option, + /// The InstrumentationTestRunner class. + /// The default value is determined by examining the application's manifest. + #[serde(rename="testRunnerClass")] + pub test_runner_class: Option, + /// The java package for the test to be executed. + /// The default value is determined by examining the application's manifest. + #[serde(rename="testPackageId")] + pub test_package_id: Option, + /// The APK for the application under test. + #[serde(rename="appApk")] + pub app_apk: Option, + /// The java package for the application under test. + /// The default value is determined by examining the application's manifest. + #[serde(rename="appPackageId")] + pub app_package_id: Option, + /// The option of whether running each test within its own invocation of + /// instrumentation with Android Test Orchestrator or not. + /// ** Orchestrator is only compatible with AndroidJUnitRunner version 1.0 or + /// higher! ** + /// Orchestrator offers the following benefits: + /// - No shared state + /// - Crashes are isolated + /// - Logs are scoped per test + /// + /// See + /// + /// for more information about Android Test Orchestrator. + /// + /// If not set, the test will be run without the orchestrator. + #[serde(rename="orchestratorOption")] + pub orchestrator_option: Option, + /// The option to run tests in multiple shards in parallel. + #[serde(rename="shardingOption")] + pub sharding_option: Option, + /// Each target must be fully qualified with the package name or class name, + /// in one of these formats: + /// - "package package_name" + /// - "class package_name.class_name" + /// - "class package_name.class_name#method_name" + /// + /// If empty, all targets in the module will be run. + #[serde(rename="testTargets")] + pub test_targets: Option>, } -impl Part for IosVersion {} +impl Part for AndroidInstrumentationTest {} /// There is no detailed description. @@ -1555,6 +1143,679 @@ pub struct Orientation { impl Part for Orientation {} +/// Output only. Details about the shard. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Shard { + /// Output only. The total number of shards. + #[serde(rename="numShards")] + pub num_shards: Option, + /// Output only. The index of the shard among all the shards. + #[serde(rename="shardIndex")] + pub shard_index: Option, + /// Output only. Test targets for each shard. + #[serde(rename="testTargetsForShard")] + pub test_targets_for_shard: Option, +} + +impl Part for Shard {} + + +/// A key-value pair passed as an environment variable to the test. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnvironmentVariable { + /// Key for the environment variable. + pub key: Option, + /// Value for the environment variable. + pub value: Option, +} + +impl Part for EnvironmentVariable {} + + +/// A storage location within Google cloud storage (GCS). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudStorage { + /// Required. The path to a directory in GCS that will + /// eventually contain the results for this test. + /// The requesting user must have write access on the bucket in the supplied + /// path. + #[serde(rename="gcsPath")] + pub gcs_path: Option, +} + +impl Part for GoogleCloudStorage {} + + +/// Response containing the current state of the specified test matrix. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [test matrices cancel projects](struct.ProjectTestMatriceCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CancelTestMatrixResponse { + /// The current rolled-up state of the test matrix. + /// If this state is already final, then the cancelation request will + /// have no effect. + #[serde(rename="testState")] + pub test_state: Option, +} + +impl ResponseResult for CancelTestMatrixResponse {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NetworkConfigurationCatalog { + /// no description provided + pub configurations: Option>, +} + +impl Part for NetworkConfigurationCatalog {} + + +/// A single Android device. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidDevice { + /// Required. The locale the test device used for testing. + /// Use the TestEnvironmentDiscoveryService to get supported options. + pub locale: Option, + /// Required. The id of the Android OS version to be used. + /// Use the TestEnvironmentDiscoveryService to get supported options. + #[serde(rename="androidVersionId")] + pub android_version_id: Option, + /// Required. The id of the Android device to be used. + /// Use the TestEnvironmentDiscoveryService to get supported options. + #[serde(rename="androidModelId")] + pub android_model_id: Option, + /// Required. How the device is oriented during the test. + /// Use the TestEnvironmentDiscoveryService to get supported options. + pub orientation: Option, +} + +impl Part for AndroidDevice {} + + +/// A description of how to set up an iOS device prior to running the test. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IosTestSetup { + /// The network traffic profile used for running the test. + /// Available network profiles can be queried by using the + /// NETWORK_CONFIGURATION environment type when calling + /// TestEnvironmentDiscoveryService.GetTestEnvironmentCatalog. + #[serde(rename="networkProfile")] + pub network_profile: Option, +} + +impl Part for IosTestSetup {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SystraceSetup { + /// Systrace duration in seconds. + /// Should be between 1 and 30 seconds. 0 disables systrace. + #[serde(rename="durationSeconds")] + pub duration_seconds: Option, +} + +impl Part for SystraceSetup {} + + +/// A set of Android device configuration permutations is defined by the +/// the cross-product of the given axes. Internally, the given AndroidMatrix +/// will be expanded into a set of AndroidDevices. +/// +/// Only supported permutations will be instantiated. Invalid permutations +/// (e.g., incompatible models/versions) are ignored. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidMatrix { + /// Required. The ids of the set of Android OS version to be used. + /// Use the TestEnvironmentDiscoveryService to get supported options. + #[serde(rename="androidVersionIds")] + pub android_version_ids: Option>, + /// Required. The ids of the set of Android device to be used. + /// Use the TestEnvironmentDiscoveryService to get supported options. + #[serde(rename="androidModelIds")] + pub android_model_ids: Option>, + /// Required. The set of locales the test device will enable for testing. + /// Use the TestEnvironmentDiscoveryService to get supported options. + pub locales: Option>, + /// Required. The set of orientations to test with. + /// Use the TestEnvironmentDiscoveryService to get supported options. + pub orientations: Option>, +} + +impl Part for AndroidMatrix {} + + +/// Shards test cases into the specified groups of packages, classes, and/or +/// methods. +/// +/// With manual sharding enabled, specifying test targets via +/// environment_variables or in InstrumentationTest is invalid. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ManualSharding { + /// Required. Group of packages, classes, and/or test methods to be run for + /// each shard. The number of shard_test_targets must be >= 1 and <= 50. + #[serde(rename="testTargetsForShard")] + pub test_targets_for_shard: Option>, +} + +impl Part for ManualSharding {} + + +/// A starting intent specified by an action, uri, and categories. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StartActivityIntent { + /// Action name. + /// Required for START_ACTIVITY. + pub action: Option, + /// URI for the action. + pub uri: Option, + /// Intent categories to set on the intent. + pub categories: Option>, +} + +impl Part for StartActivityIntent {} + + +/// Represents a tool results step resource. +/// +/// This has the results of a TestExecution. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ToolResultsStep { + /// Output only. The cloud project that owns the tool results step. + #[serde(rename="projectId")] + pub project_id: Option, + /// Output only. A tool results execution ID. + #[serde(rename="executionId")] + pub execution_id: Option, + /// Output only. A tool results step ID. + #[serde(rename="stepId")] + pub step_id: Option, + /// Output only. A tool results history ID. + #[serde(rename="historyId")] + pub history_id: Option, +} + +impl Part for ToolResultsStep {} + + +/// An opaque binary blob file to install on the device before the test starts. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObbFile { + /// Required. OBB file name which must conform to the format as specified by + /// Android + /// e.g. [main|patch].0300110.com.example.android.obb + /// which will be installed into + /// \/Android/obb/\/ + /// on the device. + #[serde(rename="obbFileName")] + pub obb_file_name: Option, + /// Required. Opaque Binary Blob (OBB) file(s) to install on the device. + pub obb: Option, +} + +impl Part for ObbFile {} + + +/// Information about the client which invoked the test. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClientInfo { + /// The list of detailed information about client. + #[serde(rename="clientInfoDetails")] + pub client_info_details: Option>, + /// Required. Client name, such as gcloud. + pub name: Option, +} + +impl Part for ClientInfo {} + + +/// A test of an iOS application that uses the XCTest framework. +/// Xcode supports the option to "build for testing", which generates an +/// .xctestrun file that contains a test specification (arguments, test methods, +/// etc). This test type accepts a zip file containing the .xctestrun file and +/// the corresponding contents of the Build/Products directory that contains all +/// the binaries needed to run the tests. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IosXcTest { + /// Output only. The bundle id for the application under test. + #[serde(rename="appBundleId")] + pub app_bundle_id: Option, + /// An .xctestrun file that will override the .xctestrun file in the + /// tests zip. Because the .xctestrun file contains environment variables along + /// with test methods to run and/or ignore, this can be useful for sharding + /// tests. Default is taken from the tests zip. + pub xctestrun: Option, + /// Required. The .zip containing the .xctestrun file and the contents of the + /// DerivedData/Build/Products directory. + /// The .xctestrun file in this zip is ignored if the xctestrun field is + /// specified. + #[serde(rename="testsZip")] + pub tests_zip: Option, + /// The Xcode version that should be used for the test. + /// Use the TestEnvironmentDiscoveryService to get supported options. + /// Defaults to the latest Xcode version Firebase Test Lab supports. + #[serde(rename="xcodeVersion")] + pub xcode_version: Option, +} + +impl Part for IosXcTest {} + + +/// Represents a tool results history resource. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ToolResultsHistory { + /// Required. The cloud project that owns the tool results history. + #[serde(rename="projectId")] + pub project_id: Option, + /// Required. A tool results history ID. + #[serde(rename="historyId")] + pub history_id: Option, +} + +impl Part for ToolResultsHistory {} + + +/// Locations where the results of running the test are stored. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResultStorage { + /// The tool results history that contains the tool results execution that + /// results are written to. + /// + /// If not provided, the service will choose an appropriate value. + #[serde(rename="toolResultsHistory")] + pub tool_results_history: Option, + /// Required. + #[serde(rename="googleCloudStorage")] + pub google_cloud_storage: Option, + /// Output only. The tool results execution that results are written to. + #[serde(rename="toolResultsExecution")] + pub tool_results_execution: Option, + /// Output only. URL to the results in the Firebase Web Console. + #[serde(rename="resultsUrl")] + pub results_url: Option, +} + +impl Part for ResultStorage {} + + +/// The matrix of environments in which the test is to be executed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EnvironmentMatrix { + /// A list of Android devices; the test will be run only on the specified + /// devices. + #[serde(rename="androidDeviceList")] + pub android_device_list: Option, + /// A matrix of Android devices. + #[serde(rename="androidMatrix")] + pub android_matrix: Option, + /// A list of iOS devices. + #[serde(rename="iosDeviceList")] + pub ios_device_list: Option, +} + +impl Part for EnvironmentMatrix {} + + +/// A list of iOS device configurations in which the test is to be executed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IosDeviceList { + /// Required. A list of iOS devices. + #[serde(rename="iosDevices")] + pub ios_devices: Option>, +} + +impl Part for IosDeviceList {} + + +/// Key-value pair of detailed information about the client which invoked the +/// test. Examples: {'Version', '1.0'}, {'Release Track', 'BETA'}. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ClientInfoDetail { + /// Required. The key of detailed client information. + pub key: Option, + /// Required. The value of detailed client information. + pub value: Option, +} + +impl Part for ClientInfoDetail {} + + +/// TestMatrix captures all details about a test. It contains the environment +/// configuration, test specification, test executions and overall state and +/// outcome. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [test matrices create projects](struct.ProjectTestMatriceCreateCall.html) (request|response) +/// * [test matrices get projects](struct.ProjectTestMatriceGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestMatrix { + /// Information about the client which invoked the test. + #[serde(rename="clientInfo")] + pub client_info: Option, + /// The cloud project that owns the test matrix. + #[serde(rename="projectId")] + pub project_id: Option, + /// Required. Where the results for the matrix are written. + #[serde(rename="resultStorage")] + pub result_storage: Option, + /// The number of times a TestExecution should be re-attempted if one or more + /// of its test cases fail for any reason. + /// The maximum number of reruns allowed is 10. + /// + /// Default is 0, which implies no reruns. + #[serde(rename="flakyTestAttempts")] + pub flaky_test_attempts: Option, + /// Output only. Indicates the current progress of the test matrix. + pub state: Option, + /// Output only. The list of test executions that the service creates for + /// this matrix. + #[serde(rename="testExecutions")] + pub test_executions: Option>, + /// Required. How to run the test. + #[serde(rename="testSpecification")] + pub test_specification: Option, + /// Output only. Unique id set by the service. + #[serde(rename="testMatrixId")] + pub test_matrix_id: Option, + /// Output only. The time this test matrix was initially created. + pub timestamp: Option, + /// Output only. Describes why the matrix is considered invalid. + /// Only useful for matrices in the INVALID state. + #[serde(rename="invalidMatrixDetails")] + pub invalid_matrix_details: Option, + /// Required. The devices the tests are being executed on. + #[serde(rename="environmentMatrix")] + pub environment_matrix: Option, + /// Output Only. The overall outcome of the test. + /// Only set when the test matrix state is FINISHED. + #[serde(rename="outcomeSummary")] + pub outcome_summary: Option, +} + +impl RequestValue for TestMatrix {} +impl ResponseResult for TestMatrix {} + + +/// A description of how to run the test. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestSpecification { + /// Test setup requirements for iOS. + #[serde(rename="iosTestSetup")] + pub ios_test_setup: Option, + /// An iOS XCTest, via an .xctestrun file. + #[serde(rename="iosXcTest")] + pub ios_xc_test: Option, + /// An iOS application with a test loop. + #[serde(rename="iosTestLoop")] + pub ios_test_loop: Option, + /// Max time a test execution is allowed to run before it is + /// automatically cancelled. + /// The default value is 5 min. + #[serde(rename="testTimeout")] + pub test_timeout: Option, + /// Test setup requirements for Android e.g. files to install, bootstrap + /// scripts. + #[serde(rename="testSetup")] + pub test_setup: Option, + /// Disables video recording. May reduce test latency. + #[serde(rename="disableVideoRecording")] + pub disable_video_recording: Option, + /// Disables performance metrics recording. May reduce test latency. + #[serde(rename="disablePerformanceMetrics")] + pub disable_performance_metrics: Option, + /// An Android Application with a Test Loop. + #[serde(rename="androidTestLoop")] + pub android_test_loop: Option, + /// An Android robo test. + #[serde(rename="androidRoboTest")] + pub android_robo_test: Option, + /// An Android instrumentation test. + #[serde(rename="androidInstrumentationTest")] + pub android_instrumentation_test: Option, +} + +impl Part for TestSpecification {} + + +/// Message for specifying the start activities to crawl. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RoboStartingIntent { + /// An intent that starts an activity with specific details. + #[serde(rename="startActivity")] + pub start_activity: Option, + /// Timeout in seconds for each intent. + pub timeout: Option, + /// An intent that starts the main launcher activity. + #[serde(rename="launcherActivity")] + pub launcher_activity: Option, +} + +impl Part for RoboStartingIntent {} + + +/// Data about the relative number of devices running a +/// given configuration of the Android platform. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Distribution { + /// Output only. The time this distribution was measured. + #[serde(rename="measurementTime")] + pub measurement_time: Option, + /// Output only. The estimated fraction (0-1) of the total market with this + /// configuration. + #[serde(rename="marketShare")] + pub market_share: Option, +} + +impl Part for Distribution {} + + +/// A version of the Android OS. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AndroidVersion { + /// The date this Android version became available in the market. + #[serde(rename="releaseDate")] + pub release_date: Option, + /// A string representing this version of the Android OS. + /// Examples: "4.3", "4.4". + #[serde(rename="versionString")] + pub version_string: Option, + /// Tags for this dimension. + /// Examples: "default", "preview", "deprecated". + pub tags: Option>, + /// Market share for this version. + pub distribution: Option, + /// The API level for this Android version. + /// Examples: 18, 19. + #[serde(rename="apiLevel")] + pub api_level: Option, + /// The code name for this Android version. + /// Examples: "JellyBean", "KitKat". + #[serde(rename="codeName")] + pub code_name: Option, + /// An opaque id for this Android version. + /// Use this id to invoke the TestExecutionService. + pub id: Option, +} + +impl Part for AndroidVersion {} + + +/// A single device file description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeviceFile { + /// A reference to a regular file. + #[serde(rename="regularFile")] + pub regular_file: Option, + /// A reference to an opaque binary blob file. + #[serde(rename="obbFile")] + pub obb_file: Option, +} + +impl Part for DeviceFile {} + + +/// An iOS version. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct IosVersion { + /// An integer representing the major iOS version. + /// Examples: "8", "9". + #[serde(rename="majorVersion")] + pub major_version: Option, + /// Tags for this dimension. + /// Examples: "default", "preview", "deprecated". + pub tags: Option>, + /// An integer representing the minor iOS version. + /// Examples: "1", "2". + #[serde(rename="minorVersion")] + pub minor_version: Option, + /// An opaque id for this iOS version. + /// Use this id to invoke the TestExecutionService. + pub id: Option, + /// The available Xcode versions for this version. + #[serde(rename="supportedXcodeVersionIds")] + pub supported_xcode_version_ids: Option>, +} + +impl Part for IosVersion {} + + +/// A file or directory to install on the device before the test starts. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RegularFile { + /// Required. The source file. + pub content: Option, + /// Required. Where to put the content on the device. Must be an absolute, + /// whitelisted path. If the file exists, it will be replaced. + /// The following device-side directories and any of their subdirectories are + /// whitelisted: + ///

          ${EXTERNAL_STORAGE}, or /sdcard

          + ///

          ${ANDROID_DATA}/local/tmp, or /data/local/tmp

          + ///

          Specifying a path outside of these directory trees is invalid. + /// + ///

          The paths /sdcard and /data will be made available and treated as + /// implicit path substitutions. E.g. if /sdcard on a particular device does + /// not map to external storage, the system will replace it with the external + /// storage path prefix for that device and copy the file there. + /// + ///

          It is strongly advised to use the + /// Environment API in app and test code to access files on the device in a + /// portable way. + #[serde(rename="devicePath")] + pub device_path: Option, +} + +impl Part for RegularFile {} + + +/// Uniformly shards test cases given a total number of shards. +/// +/// For Instrumentation test, it will be translated to “-e numShard” “-e +/// shardIndex” AndroidJUnitRunner arguments. With uniform sharding enabled, +/// specifying these sharding arguments via environment_variables is invalid. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UniformSharding { + /// Required. Total number of shards. The number must be >= 1 and <= 50. + #[serde(rename="numShards")] + pub num_shards: Option, +} + +impl Part for UniformSharding {} + + /// A location/region designation for language. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1621,19 +1882,67 @@ pub struct TestEnvironmentCatalog { impl ResponseResult for TestEnvironmentCatalog {} -/// A key-value pair passed as an environment variable to the test. +/// A description of an Android device tests may be run on. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EnvironmentVariable { - /// Key for the environment variable. - pub key: Option, - /// Value for the environment variable. - pub value: Option, +pub struct AndroidModel { + /// Whether this device is a phone, tablet, wearable, etc. + #[serde(rename="formFactor")] + pub form_factor: Option, + /// Screen size in the horizontal (X) dimension measured in pixels. + #[serde(rename="screenX")] + pub screen_x: Option, + /// The human-readable marketing name for this device model. + /// Examples: "Nexus 5", "Galaxy S5". + pub name: Option, + /// Whether this device is virtual or physical. + pub form: Option, + /// Tags for this dimension. + /// Examples: "default", "preview", "deprecated". + pub tags: Option>, + /// True if and only if tests with this model are recorded by stitching + /// together screenshots. See use_low_spec_video_recording in device config. + #[serde(rename="lowFpsVideoRecording")] + pub low_fps_video_recording: Option, + /// The company that this device is branded with. + /// Example: "Google", "Samsung". + pub brand: Option, + /// The unique opaque id for this model. + /// Use this for invoking the TestExecutionService. + pub id: Option, + /// The set of Android versions this device supports. + #[serde(rename="supportedVersionIds")] + pub supported_version_ids: Option>, + /// Screen density in DPI. + /// This corresponds to ro.sf.lcd_density + #[serde(rename="screenDensity")] + pub screen_density: Option, + /// Screen size in the vertical (Y) dimension measured in pixels. + #[serde(rename="screenY")] + pub screen_y: Option, + /// URL of a thumbnail image of the device. + #[serde(rename="thumbnailUrl")] + pub thumbnail_url: Option, + /// The list of supported ABIs for this device. + /// This corresponds to either android.os.Build.SUPPORTED_ABIS (for API level + /// 21 and above) or android.os.Build.CPU_ABI/CPU_ABI2. + /// The most preferred ABI is the first element in the list. + /// + /// Elements are optionally prefixed by "version_id:" (where version_id is + /// the id of an AndroidVersion), denoting an ABI that is supported only on + /// a particular version. + #[serde(rename="supportedAbis")] + pub supported_abis: Option>, + /// The manufacturer of this device. + pub manufacturer: Option, + /// The name of the industrial design. + /// This corresponds to android.os.Build.DEVICE. + pub codename: Option, } -impl Part for EnvironmentVariable {} +impl Part for AndroidModel {} /// An Android package file to install. @@ -1674,67 +1983,6 @@ pub struct IosDeviceCatalog { impl Part for IosDeviceCatalog {} -/// TestMatrix captures all details about a test. It contains the environment -/// configuration, test specification, test executions and overall state and -/// outcome. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [test matrices create projects](struct.ProjectTestMatriceCreateCall.html) (request|response) -/// * [test matrices get projects](struct.ProjectTestMatriceGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct TestMatrix { - /// Information about the client which invoked the test. - #[serde(rename="clientInfo")] - pub client_info: Option, - /// The cloud project that owns the test matrix. - #[serde(rename="projectId")] - pub project_id: Option, - /// Required. Where the results for the matrix are written. - #[serde(rename="resultStorage")] - pub result_storage: Option, - /// The number of times a TestExecution should be re-attempted if one or more - /// of its test cases fail for any reason. - /// The maximum number of reruns allowed is 10. - /// - /// Default is 0, which implies no reruns. - #[serde(rename="flakyTestAttempts")] - pub flaky_test_attempts: Option, - /// Output only. Indicates the current progress of the test matrix. - pub state: Option, - /// Output only. The list of test executions that the service creates for - /// this matrix. - #[serde(rename="testExecutions")] - pub test_executions: Option>, - /// Required. How to run the test. - #[serde(rename="testSpecification")] - pub test_specification: Option, - /// Output only. Unique id set by the service. - #[serde(rename="testMatrixId")] - pub test_matrix_id: Option, - /// Output only. The time this test matrix was initially created. - pub timestamp: Option, - /// Output only. Describes why the matrix is considered invalid. - /// Only useful for matrices in the INVALID state. - #[serde(rename="invalidMatrixDetails")] - pub invalid_matrix_details: Option, - /// Required. The devices the tests are being executed on. - #[serde(rename="environmentMatrix")] - pub environment_matrix: Option, - /// Output Only. The overall outcome of the test. - /// Only set when the test matrix state is FINISHED. - #[serde(rename="outcomeSummary")] - pub outcome_summary: Option, -} - -impl RequestValue for TestMatrix {} -impl ResponseResult for TestMatrix {} - - /// Specifies an intent that starts the main launcher activity. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1745,98 +1993,6 @@ pub struct LauncherActivityIntent { _never_set: Option } impl Part for LauncherActivityIntent {} -/// A single device file description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeviceFile { - /// A reference to a regular file. - #[serde(rename="regularFile")] - pub regular_file: Option, - /// A reference to an opaque binary blob file. - #[serde(rename="obbFile")] - pub obb_file: Option, -} - -impl Part for DeviceFile {} - - -/// Android application details based on application manifest and apk archive -/// contents. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ApkDetail { - /// no description provided - #[serde(rename="apkManifest")] - pub apk_manifest: Option, -} - -impl Part for ApkDetail {} - - -/// iOS configuration that can be selected at the time a test is run. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct IosRuntimeConfiguration { - /// The set of available orientations. - pub orientations: Option>, - /// The set of available locales. - pub locales: Option>, -} - -impl Part for IosRuntimeConfiguration {} - - -/// A file or directory to install on the device before the test starts. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RegularFile { - /// Required. The source file. - pub content: Option, - /// Required. Where to put the content on the device. Must be an absolute, - /// whitelisted path. If the file exists, it will be replaced. - /// The following device-side directories and any of their subdirectories are - /// whitelisted: - ///

          ${EXTERNAL_STORAGE}, or /sdcard

          - ///

          ${ANDROID_DATA}/local/tmp, or /data/local/tmp

          - ///

          Specifying a path outside of these directory trees is invalid. - /// - ///

          The paths /sdcard and /data will be made available and treated as - /// implicit path substitutions. E.g. if /sdcard on a particular device does - /// not map to external storage, the system will replace it with the external - /// storage path prefix for that device and copy the file there. - /// - ///

          It is strongly advised to use the - /// Environment API in app and test code to access files on the device in a - /// portable way. - #[serde(rename="devicePath")] - pub device_path: Option, -} - -impl Part for RegularFile {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NetworkConfigurationCatalog { - /// no description provided - pub configurations: Option>, -} - -impl Part for NetworkConfigurationCatalog {} - - /// Enables automatic Google account login. /// If set, the service automatically generates a Google test account and adds /// it to the device, before executing the test. Note that test accounts might be diff --git a/gen/texttospeech1-cli/Cargo.toml b/gen/texttospeech1-cli/Cargo.toml index 859a26d661..e5aab77e3c 100644 --- a/gen/texttospeech1-cli/Cargo.toml +++ b/gen/texttospeech1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-texttospeech1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Texttospeech (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/texttospeech1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-texttospeech1] path = "../texttospeech1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" diff --git a/gen/texttospeech1-cli/README.md b/gen/texttospeech1-cli/README.md index 9a52ac4623..7d67405efd 100644 --- a/gen/texttospeech1-cli/README.md +++ b/gen/texttospeech1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Texttospeech* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Texttospeech* API at revision *20200406*. The CLI is at version *1.0.13*. ```bash texttospeech1 [options] diff --git a/gen/texttospeech1-cli/mkdocs.yml b/gen/texttospeech1-cli/mkdocs.yml index 250c9d79d9..e6409fc594 100644 --- a/gen/texttospeech1-cli/mkdocs.yml +++ b/gen/texttospeech1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Texttospeech v1.0.12+20190628 +site_name: Texttospeech v1.0.13+20200406 site_url: http://byron.github.io/google-apis-rs/google-texttospeech1-cli site_description: A complete library to interact with Texttospeech (protocol v1) diff --git a/gen/texttospeech1-cli/src/main.rs b/gen/texttospeech1-cli/src/main.rs index 0680a72374..7598ebaad1 100644 --- a/gen/texttospeech1-cli/src/main.rs +++ b/gen/texttospeech1-cli/src/main.rs @@ -358,7 +358,7 @@ fn main() { let mut app = App::new("texttospeech1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200406") .about("Synthesizes natural-sounding speech by applying powerful neural network models.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_texttospeech1_cli") .arg(Arg::with_name("url") diff --git a/gen/texttospeech1/Cargo.toml b/gen/texttospeech1/Cargo.toml index c3bf88162f..9e829c3fff 100644 --- a/gen/texttospeech1/Cargo.toml +++ b/gen/texttospeech1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-texttospeech1" -version = "1.0.12+20190628" +version = "1.0.13+20200406" authors = ["Sebastian Thiel "] description = "A complete library to interact with Texttospeech (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/texttospeech1" homepage = "https://cloud.google.com/text-to-speech/" -documentation = "https://docs.rs/google-texttospeech1/1.0.12+20190628" +documentation = "https://docs.rs/google-texttospeech1/1.0.13+20200406" license = "MIT" keywords = ["texttospeech", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/texttospeech1/README.md b/gen/texttospeech1/README.md index 7db68ee95d..ad9003db24 100644 --- a/gen/texttospeech1/README.md +++ b/gen/texttospeech1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-texttospeech1` library allows access to all features of the *Google Texttospeech* service. -This documentation was generated from *Texttospeech* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *texttospeech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Texttospeech* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *texttospeech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Texttospeech* *v1* API can be found at the [official documentation site](https://cloud.google.com/text-to-speech/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/struct.Texttospeech.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/struct.Texttospeech.html) ... * text - * [*synthesize*](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/struct.TextSynthesizeCall.html) -* [voices](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/struct.Voice.html) - * [*list*](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/struct.VoiceListCall.html) + * [*synthesize*](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/struct.TextSynthesizeCall.html) +* [voices](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/struct.Voice.html) + * [*list*](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/struct.VoiceListCall.html) @@ -25,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/struct.Texttospeech.html)** +* **[Hub](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/struct.Texttospeech.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.Part.html)** + * **[Parts](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -127,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -147,29 +147,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-texttospeech1/1.0.12+20190628/google_texttospeech1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-texttospeech1/1.0.13+20200406/google_texttospeech1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/texttospeech1/src/lib.rs b/gen/texttospeech1/src/lib.rs index 477ffaec41..7172cc7ae7 100644 --- a/gen/texttospeech1/src/lib.rs +++ b/gen/texttospeech1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Texttospeech* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *texttospeech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Texttospeech* crate version *1.0.13+20200406*, where *20200406* is the exact revision of the *texttospeech:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Texttospeech* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/text-to-speech/). @@ -321,7 +321,7 @@ impl<'a, C, A> Texttospeech Texttospeech { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://texttospeech.googleapis.com/".to_string(), _root_url: "https://texttospeech.googleapis.com/".to_string(), } @@ -335,7 +335,7 @@ impl<'a, C, A> Texttospeech } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -448,7 +448,7 @@ pub struct AudioConfig { /// increase 20 semitones from the original pitch. -20 means decrease 20 /// semitones from the original pitch. pub pitch: Option, - /// The synthesis sample rate (in hertz) for this audio. Optional. When this is + /// Optional. The synthesis sample rate (in hertz) for this audio. When this is /// specified in SynthesizeSpeechRequest, if this is different from the voice's /// natural sample rate, then the synthesizer will honor this request by /// converting to the desired sample rate (which might result in worse audio @@ -484,16 +484,16 @@ impl Part for AudioConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VoiceSelectionParams { - /// The preferred gender of the voice. Optional; if not set, the service will + /// The preferred gender of the voice. If not set, the service will /// choose a voice based on the other parameters such as language_code and /// name. Note that this is only a preference, not requirement; if a /// voice of the appropriate gender is not available, the synthesizer should /// substitute a voice with a different gender rather than failing the request. #[serde(rename="ssmlGender")] pub ssml_gender: Option, - /// The language (and optionally also the region) of the voice expressed as a + /// Required. The language (and potentially also the region) of the voice expressed as a /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - /// "en-US". Required. This should not include a script tag (e.g. use + /// "en-US". This should not include a script tag (e.g. use /// "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred /// from the input provided in the SynthesisInput. The TTS service /// will use this parameter to help choose an appropriate voice. Note that @@ -504,7 +504,7 @@ pub struct VoiceSelectionParams { /// Bokmal) instead of "no" (Norwegian)". #[serde(rename="languageCode")] pub language_code: Option, - /// The name of the voice. Optional; if not set, the service will choose a + /// The name of the voice. If not set, the service will choose a /// voice based on the other parameters such as language_code and gender. pub name: Option, } @@ -1084,7 +1084,7 @@ impl<'a, C, A> VoiceListCall<'a, C, A> where C: BorrowMut, A: oau } - /// Optional (but recommended) + /// Optional. Recommended. /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If /// specified, the ListVoices call will only return voices that can be used to /// synthesize this language_code. E.g. when specifying "en-NZ", you will get diff --git a/gen/tpu1-cli/Cargo.toml b/gen/tpu1-cli/Cargo.toml index 76263e449c..47ae95bb24 100644 --- a/gen/tpu1-cli/Cargo.toml +++ b/gen/tpu1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tpu1-cli" -version = "1.0.12+20190619" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] description = "A complete library to interact with TPU (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-tpu1] path = "../tpu1" -version = "1.0.12+20190619" +version = "1.0.13+20200318" diff --git a/gen/tpu1-cli/README.md b/gen/tpu1-cli/README.md index 6a316b0dcc..90061fd775 100644 --- a/gen/tpu1-cli/README.md +++ b/gen/tpu1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *TPU* API at revision *20190619*. The CLI is at version *1.0.12*. +This documentation was generated from the *TPU* API at revision *20200318*. The CLI is at version *1.0.13*. ```bash tpu1 [options] diff --git a/gen/tpu1-cli/mkdocs.yml b/gen/tpu1-cli/mkdocs.yml index 24610f5867..1fd68f10ad 100644 --- a/gen/tpu1-cli/mkdocs.yml +++ b/gen/tpu1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: TPU v1.0.12+20190619 +site_name: TPU v1.0.13+20200318 site_url: http://byron.github.io/google-apis-rs/google-tpu1-cli site_description: A complete library to interact with TPU (protocol v1) diff --git a/gen/tpu1-cli/src/main.rs b/gen/tpu1-cli/src/main.rs index f79d79b33b..7f66bd85d6 100644 --- a/gen/tpu1-cli/src/main.rs +++ b/gen/tpu1-cli/src/main.rs @@ -1709,7 +1709,7 @@ fn main() { let mut app = App::new("tpu1") .author("Sebastian Thiel ") - .version("1.0.12+20190619") + .version("1.0.13+20200318") .about("TPU API provides customers with access to Google TPU technology.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tpu1_cli") .arg(Arg::with_name("url") diff --git a/gen/tpu1/Cargo.toml b/gen/tpu1/Cargo.toml index 15f5044644..b28864176b 100644 --- a/gen/tpu1/Cargo.toml +++ b/gen/tpu1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-tpu1" -version = "1.0.12+20190619" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] description = "A complete library to interact with TPU (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1" homepage = "https://cloud.google.com/tpu/" -documentation = "https://docs.rs/google-tpu1/1.0.12+20190619" +documentation = "https://docs.rs/google-tpu1/1.0.13+20200318" license = "MIT" keywords = ["tpu", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/tpu1/README.md b/gen/tpu1/README.md index b7cb32fa8d..42c67b98bf 100644 --- a/gen/tpu1/README.md +++ b/gen/tpu1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-tpu1` library allows access to all features of the *Google TPU* service. -This documentation was generated from *TPU* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *tpu:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *TPU* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *tpu:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *TPU* *v1* API can be found at the [official documentation site](https://cloud.google.com/tpu/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.TPU.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.TPU.html) ... * projects - * [*locations accelerator types get*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationAcceleratorTypeGetCall.html), [*locations accelerator types list*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationAcceleratorTypeListCall.html), [*locations get*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationListCall.html), [*locations nodes create*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationNodeCreateCall.html), [*locations nodes delete*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationNodeDeleteCall.html), [*locations nodes get*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationNodeGetCall.html), [*locations nodes list*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationNodeListCall.html), [*locations nodes reimage*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationNodeReimageCall.html), [*locations nodes start*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationNodeStartCall.html), [*locations nodes stop*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationNodeStopCall.html), [*locations operations cancel*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationOperationListCall.html), [*locations tensorflow versions get*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationTensorflowVersionGetCall.html) and [*locations tensorflow versions list*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.ProjectLocationTensorflowVersionListCall.html) + * [*locations accelerator types get*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationAcceleratorTypeGetCall.html), [*locations accelerator types list*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationAcceleratorTypeListCall.html), [*locations get*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationListCall.html), [*locations nodes create*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationNodeCreateCall.html), [*locations nodes delete*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationNodeDeleteCall.html), [*locations nodes get*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationNodeGetCall.html), [*locations nodes list*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationNodeListCall.html), [*locations nodes reimage*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationNodeReimageCall.html), [*locations nodes start*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationNodeStartCall.html), [*locations nodes stop*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationNodeStopCall.html), [*locations operations cancel*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationOperationListCall.html), [*locations tensorflow versions get*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationTensorflowVersionGetCall.html) and [*locations tensorflow versions list*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.ProjectLocationTensorflowVersionListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/struct.TPU.html)** +* **[Hub](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/struct.TPU.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.Part.html)** + * **[Parts](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-tpu1/1.0.12+20190619/google_tpu1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-tpu1/1.0.13+20200318/google_tpu1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/tpu1/src/lib.rs b/gen/tpu1/src/lib.rs index 8ac719e596..f4186f4e39 100644 --- a/gen/tpu1/src/lib.rs +++ b/gen/tpu1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *TPU* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *tpu:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *TPU* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *tpu:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *TPU* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/tpu/). @@ -336,7 +336,7 @@ impl<'a, C, A> TPU TPU { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://tpu.googleapis.com/".to_string(), _root_url: "https://tpu.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> TPU } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -457,7 +457,6 @@ pub struct Node { /// conflicts with any subnetworks in the user's provided network, or the /// provided network is peered with another network that is using that CIDR /// block. - /// Required. #[serde(rename="cidrBlock")] pub cidr_block: Option, /// Output only. The time when the node was created. @@ -684,6 +683,8 @@ pub struct ListTensorFlowVersionsResponse { /// The next page token or empty if none. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// Locations that could not be reached. + pub unreachable: Option>, /// The listed nodes. #[serde(rename="tensorflowVersions")] pub tensorflow_versions: Option>, @@ -727,6 +728,8 @@ pub struct ListAcceleratorTypesResponse { /// The next page token or empty if none. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// Locations that could not be reached. + pub unreachable: Option>, /// The listed nodes. #[serde(rename="acceleratorTypes")] pub accelerator_types: Option>, diff --git a/gen/tpu1_alpha1-cli/Cargo.toml b/gen/tpu1_alpha1-cli/Cargo.toml index ba4f644727..0683cbbe1c 100644 --- a/gen/tpu1_alpha1-cli/Cargo.toml +++ b/gen/tpu1_alpha1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-tpu1_alpha1-cli" -version = "1.0.12+20190619" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] description = "A complete library to interact with TPU (protocol v1alpha1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1_alpha1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-tpu1_alpha1] path = "../tpu1_alpha1" -version = "1.0.12+20190619" +version = "1.0.13+20200318" diff --git a/gen/tpu1_alpha1-cli/README.md b/gen/tpu1_alpha1-cli/README.md index 16234d6125..561c855c91 100644 --- a/gen/tpu1_alpha1-cli/README.md +++ b/gen/tpu1_alpha1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *TPU* API at revision *20190619*. The CLI is at version *1.0.12*. +This documentation was generated from the *TPU* API at revision *20200318*. The CLI is at version *1.0.13*. ```bash tpu1-alpha1 [options] diff --git a/gen/tpu1_alpha1-cli/mkdocs.yml b/gen/tpu1_alpha1-cli/mkdocs.yml index 0496f04f86..d4d4915efb 100644 --- a/gen/tpu1_alpha1-cli/mkdocs.yml +++ b/gen/tpu1_alpha1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: TPU v1.0.12+20190619 +site_name: TPU v1.0.13+20200318 site_url: http://byron.github.io/google-apis-rs/google-tpu1_alpha1-cli site_description: A complete library to interact with TPU (protocol v1alpha1) diff --git a/gen/tpu1_alpha1-cli/src/main.rs b/gen/tpu1_alpha1-cli/src/main.rs index 4fc933deeb..b2b1a294fb 100644 --- a/gen/tpu1_alpha1-cli/src/main.rs +++ b/gen/tpu1_alpha1-cli/src/main.rs @@ -1709,7 +1709,7 @@ fn main() { let mut app = App::new("tpu1-alpha1") .author("Sebastian Thiel ") - .version("1.0.12+20190619") + .version("1.0.13+20200318") .about("TPU API provides customers with access to Google TPU technology.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_tpu1_alpha1_cli") .arg(Arg::with_name("url") diff --git a/gen/tpu1_alpha1/Cargo.toml b/gen/tpu1_alpha1/Cargo.toml index 0d0ea1c91d..85b54051b0 100644 --- a/gen/tpu1_alpha1/Cargo.toml +++ b/gen/tpu1_alpha1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-tpu1_alpha1" -version = "1.0.12+20190619" +version = "1.0.13+20200318" authors = ["Sebastian Thiel "] description = "A complete library to interact with TPU (protocol v1alpha1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/tpu1_alpha1" homepage = "https://cloud.google.com/tpu/" -documentation = "https://docs.rs/google-tpu1_alpha1/1.0.12+20190619" +documentation = "https://docs.rs/google-tpu1_alpha1/1.0.13+20200318" license = "MIT" keywords = ["tpu", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/tpu1_alpha1/README.md b/gen/tpu1_alpha1/README.md index 673cb95340..ba9b282ba5 100644 --- a/gen/tpu1_alpha1/README.md +++ b/gen/tpu1_alpha1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-tpu1_alpha1` library allows access to all features of the *Google TPU* service. -This documentation was generated from *TPU* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *tpu:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *TPU* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *tpu:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *TPU* *v1_alpha1* API can be found at the [official documentation site](https://cloud.google.com/tpu/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.TPU.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.TPU.html) ... * projects - * [*locations accelerator types get*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationAcceleratorTypeGetCall.html), [*locations accelerator types list*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationAcceleratorTypeListCall.html), [*locations get*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationListCall.html), [*locations nodes create*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationNodeCreateCall.html), [*locations nodes delete*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationNodeDeleteCall.html), [*locations nodes get*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationNodeGetCall.html), [*locations nodes list*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationNodeListCall.html), [*locations nodes reimage*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationNodeReimageCall.html), [*locations nodes start*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationNodeStartCall.html), [*locations nodes stop*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationNodeStopCall.html), [*locations operations cancel*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationOperationListCall.html), [*locations tensorflow versions get*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationTensorflowVersionGetCall.html) and [*locations tensorflow versions list*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.ProjectLocationTensorflowVersionListCall.html) + * [*locations accelerator types get*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationAcceleratorTypeGetCall.html), [*locations accelerator types list*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationAcceleratorTypeListCall.html), [*locations get*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationGetCall.html), [*locations list*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationListCall.html), [*locations nodes create*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationNodeCreateCall.html), [*locations nodes delete*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationNodeDeleteCall.html), [*locations nodes get*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationNodeGetCall.html), [*locations nodes list*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationNodeListCall.html), [*locations nodes reimage*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationNodeReimageCall.html), [*locations nodes start*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationNodeStartCall.html), [*locations nodes stop*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationNodeStopCall.html), [*locations operations cancel*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationOperationGetCall.html), [*locations operations list*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationOperationListCall.html), [*locations tensorflow versions get*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationTensorflowVersionGetCall.html) and [*locations tensorflow versions list*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.ProjectLocationTensorflowVersionListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/struct.TPU.html)** +* **[Hub](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/struct.TPU.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.Part.html)** + * **[Parts](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -156,29 +156,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-tpu1_alpha1/1.0.12+20190619/google_tpu1_alpha1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-tpu1_alpha1/1.0.13+20200318/google_tpu1_alpha1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/tpu1_alpha1/src/lib.rs b/gen/tpu1_alpha1/src/lib.rs index 197877cb1b..d60b00e66f 100644 --- a/gen/tpu1_alpha1/src/lib.rs +++ b/gen/tpu1_alpha1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *TPU* crate version *1.0.12+20190619*, where *20190619* is the exact revision of the *tpu:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *TPU* crate version *1.0.13+20200318*, where *20200318* is the exact revision of the *tpu:v1alpha1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *TPU* *v1_alpha1* API can be found at the //! [official documentation site](https://cloud.google.com/tpu/). @@ -336,7 +336,7 @@ impl<'a, C, A> TPU TPU { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://tpu.googleapis.com/".to_string(), _root_url: "https://tpu.googleapis.com/".to_string(), } @@ -347,7 +347,7 @@ impl<'a, C, A> TPU } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -457,7 +457,6 @@ pub struct Node { /// conflicts with any subnetworks in the user's provided network, or the /// provided network is peered with another network that is using that CIDR /// block. - /// Required. #[serde(rename="cidrBlock")] pub cidr_block: Option, /// Output only. The time when the node was created. @@ -684,6 +683,8 @@ pub struct ListTensorFlowVersionsResponse { /// The next page token or empty if none. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// Locations that could not be reached. + pub unreachable: Option>, /// The listed nodes. #[serde(rename="tensorflowVersions")] pub tensorflow_versions: Option>, @@ -727,6 +728,8 @@ pub struct ListAcceleratorTypesResponse { /// The next page token or empty if none. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// Locations that could not be reached. + pub unreachable: Option>, /// The listed nodes. #[serde(rename="acceleratorTypes")] pub accelerator_types: Option>, diff --git a/gen/translate2-cli/Cargo.toml b/gen/translate2-cli/Cargo.toml index 026ab64825..7954fdd063 100644 --- a/gen/translate2-cli/Cargo.toml +++ b/gen/translate2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-translate2-cli" -version = "1.0.12+20170525" +version = "1.0.13+20170525" authors = ["Sebastian Thiel "] description = "A complete library to interact with Translate (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/translate2-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-translate2] path = "../translate2" -version = "1.0.12+20170525" +version = "1.0.13+20170525" diff --git a/gen/translate2-cli/README.md b/gen/translate2-cli/README.md index 50fd66d720..2bacfe01d9 100644 --- a/gen/translate2-cli/README.md +++ b/gen/translate2-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Translate* API at revision *20170525*. The CLI is at version *1.0.12*. +This documentation was generated from the *Translate* API at revision *20170525*. The CLI is at version *1.0.13*. ```bash translate2 [options] diff --git a/gen/translate2-cli/mkdocs.yml b/gen/translate2-cli/mkdocs.yml index 0c3cf2da99..d87540598e 100644 --- a/gen/translate2-cli/mkdocs.yml +++ b/gen/translate2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Translate v1.0.12+20170525 +site_name: Translate v1.0.13+20170525 site_url: http://byron.github.io/google-apis-rs/google-translate2-cli site_description: A complete library to interact with Translate (protocol v2) diff --git a/gen/translate2-cli/src/main.rs b/gen/translate2-cli/src/main.rs index 6d77ca3508..b81580e468 100644 --- a/gen/translate2-cli/src/main.rs +++ b/gen/translate2-cli/src/main.rs @@ -652,7 +652,7 @@ fn main() { let mut app = App::new("translate2") .author("Sebastian Thiel ") - .version("1.0.12+20170525") + .version("1.0.13+20170525") .about("The Google Cloud Translation API lets websites and programs integrate with Google Translate programmatically.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_translate2_cli") diff --git a/gen/translate2/Cargo.toml b/gen/translate2/Cargo.toml index b30a848fca..725948671e 100644 --- a/gen/translate2/Cargo.toml +++ b/gen/translate2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-translate2" -version = "1.0.12+20170525" +version = "1.0.13+20170525" authors = ["Sebastian Thiel "] description = "A complete library to interact with Translate (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/translate2" homepage = "https://code.google.com/apis/language/translate/v2/getting_started.html" -documentation = "https://docs.rs/google-translate2/1.0.12+20170525" +documentation = "https://docs.rs/google-translate2/1.0.13+20170525" license = "MIT" keywords = ["translate", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/translate2/README.md b/gen/translate2/README.md index 3aeabb83fd..386ebc8df2 100644 --- a/gen/translate2/README.md +++ b/gen/translate2/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-translate2` library allows access to all features of the *Google Translate* service. -This documentation was generated from *Translate* crate version *1.0.12+20170525*, where *20170525* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Translate* crate version *1.0.13+20170525*, where *20170525* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Translate* *v2* API can be found at the [official documentation site](https://code.google.com/apis/language/translate/v2/getting_started.html). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/struct.Translate.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/struct.Translate.html) ... * detections - * [*detect*](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/struct.DetectionDetectCall.html) and [*list*](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/struct.DetectionListCall.html) + * [*detect*](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/struct.DetectionDetectCall.html) and [*list*](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/struct.DetectionListCall.html) * languages - * [*list*](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/struct.LanguageListCall.html) + * [*list*](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/struct.LanguageListCall.html) * translations - * [*list*](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/struct.TranslationListCall.html) and [*translate*](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/struct.TranslationTranslateCall.html) + * [*list*](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/struct.TranslationListCall.html) and [*translate*](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/struct.TranslationTranslateCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/struct.Translate.html)** +* **[Hub](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/struct.Translate.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.Part.html)** + * **[Parts](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -135,17 +135,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -155,29 +155,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-translate2/1.0.12+20170525/google_translate2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-translate2/1.0.13+20170525/google_translate2/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/translate2/src/lib.rs b/gen/translate2/src/lib.rs index 766838e184..55b70fb288 100644 --- a/gen/translate2/src/lib.rs +++ b/gen/translate2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Translate* crate version *1.0.12+20170525*, where *20170525* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Translate* crate version *1.0.13+20170525*, where *20170525* is the exact revision of the *translate:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Translate* *v2* API can be found at the //! [official documentation site](https://code.google.com/apis/language/translate/v2/getting_started.html). @@ -338,7 +338,7 @@ impl<'a, C, A> Translate Translate { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://translation.googleapis.com/language/translate/".to_string(), _root_url: "https://translation.googleapis.com/".to_string(), } @@ -355,7 +355,7 @@ impl<'a, C, A> Translate } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/urlshortener1-cli/Cargo.toml b/gen/urlshortener1-cli/Cargo.toml index e9a6125308..b6cab940ee 100644 --- a/gen/urlshortener1-cli/Cargo.toml +++ b/gen/urlshortener1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-urlshortener1-cli" -version = "1.0.12+20150519" +version = "1.0.13+20150519" authors = ["Sebastian Thiel "] description = "A complete library to interact with urlshortener (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-urlshortener1] path = "../urlshortener1" -version = "1.0.12+20150519" +version = "1.0.13+20150519" diff --git a/gen/urlshortener1-cli/README.md b/gen/urlshortener1-cli/README.md index eb78561fc0..e1ae3f8f15 100644 --- a/gen/urlshortener1-cli/README.md +++ b/gen/urlshortener1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *urlshortener* API at revision *20150519*. The CLI is at version *1.0.12*. +This documentation was generated from the *urlshortener* API at revision *20150519*. The CLI is at version *1.0.13*. ```bash urlshortener1 [options] diff --git a/gen/urlshortener1-cli/mkdocs.yml b/gen/urlshortener1-cli/mkdocs.yml index 1ec9b0d561..f33084e8a6 100644 --- a/gen/urlshortener1-cli/mkdocs.yml +++ b/gen/urlshortener1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: urlshortener v1.0.12+20150519 +site_name: urlshortener v1.0.13+20150519 site_url: http://byron.github.io/google-apis-rs/google-urlshortener1-cli site_description: A complete library to interact with urlshortener (protocol v1) diff --git a/gen/urlshortener1-cli/src/main.rs b/gen/urlshortener1-cli/src/main.rs index 318587bd9a..c4bc14e154 100644 --- a/gen/urlshortener1-cli/src/main.rs +++ b/gen/urlshortener1-cli/src/main.rs @@ -431,7 +431,7 @@ fn main() { let mut app = App::new("urlshortener1") .author("Sebastian Thiel ") - .version("1.0.12+20150519") + .version("1.0.13+20150519") .about("Lets you create, inspect, and manage goo.gl short URLs") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_urlshortener1_cli") .arg(Arg::with_name("url") diff --git a/gen/urlshortener1/Cargo.toml b/gen/urlshortener1/Cargo.toml index 3a5916ff78..c57e2ba482 100644 --- a/gen/urlshortener1/Cargo.toml +++ b/gen/urlshortener1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-urlshortener1" -version = "1.0.12+20150519" +version = "1.0.13+20150519" authors = ["Sebastian Thiel "] description = "A complete library to interact with urlshortener (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/urlshortener1" homepage = "https://developers.google.com/url-shortener/v1/getting_started" -documentation = "https://docs.rs/google-urlshortener1/1.0.12+20150519" +documentation = "https://docs.rs/google-urlshortener1/1.0.13+20150519" license = "MIT" keywords = ["urlshortener", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/urlshortener1/README.md b/gen/urlshortener1/README.md index 8365efbef1..aa1db41c2c 100644 --- a/gen/urlshortener1/README.md +++ b/gen/urlshortener1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-urlshortener1` library allows access to all features of the *Google urlshortener* service. -This documentation was generated from *urlshortener* crate version *1.0.12+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *urlshortener* crate version *1.0.13+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *urlshortener* *v1* API can be found at the [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/struct.Urlshortener.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/struct.Urlshortener.html) ... -* [url](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/struct.Url.html) - * [*get*](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/struct.UrlGetCall.html), [*insert*](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/struct.UrlInsertCall.html) and [*list*](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/struct.UrlListCall.html) +* [url](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/struct.Url.html) + * [*get*](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/struct.UrlGetCall.html), [*insert*](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/struct.UrlInsertCall.html) and [*list*](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/struct.UrlListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/struct.Urlshortener.html)** +* **[Hub](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/struct.Urlshortener.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.Part.html)** + * **[Parts](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -126,17 +126,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -146,29 +146,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-urlshortener1/1.0.12+20150519/google_urlshortener1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-urlshortener1/1.0.13+20150519/google_urlshortener1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/urlshortener1/src/lib.rs b/gen/urlshortener1/src/lib.rs index 6135a4a22a..de6c57e70f 100644 --- a/gen/urlshortener1/src/lib.rs +++ b/gen/urlshortener1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *urlshortener* crate version *1.0.12+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *urlshortener* crate version *1.0.13+20150519*, where *20150519* is the exact revision of the *urlshortener:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *urlshortener* *v1* API can be found at the //! [official documentation site](https://developers.google.com/url-shortener/v1/getting_started). @@ -320,7 +320,7 @@ impl<'a, C, A> Urlshortener Urlshortener { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/urlshortener/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -331,7 +331,7 @@ impl<'a, C, A> Urlshortener } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/vault1-cli/Cargo.toml b/gen/vault1-cli/Cargo.toml index 77534199d5..aedfc1ce3a 100644 --- a/gen/vault1-cli/Cargo.toml +++ b/gen/vault1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-vault1-cli" -version = "1.0.12+20190614" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with Vault (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/vault1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-vault1] path = "../vault1" -version = "1.0.12+20190614" +version = "1.0.13+20200330" diff --git a/gen/vault1-cli/README.md b/gen/vault1-cli/README.md index 6a3f476171..89f8bc0f35 100644 --- a/gen/vault1-cli/README.md +++ b/gen/vault1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Vault* API at revision *20190614*. The CLI is at version *1.0.12*. +This documentation was generated from the *Vault* API at revision *20200330*. The CLI is at version *1.0.13*. ```bash vault1 [options] @@ -58,6 +58,8 @@ vault1 [options] saved-queries-list [-p ]... [-o ] undelete (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] + operations + delete [-p ]... [-o ] vault1 --help Configuration: diff --git a/gen/vault1-cli/mkdocs.yml b/gen/vault1-cli/mkdocs.yml index 395df1d9e8..735aa1f15e 100644 --- a/gen/vault1-cli/mkdocs.yml +++ b/gen/vault1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Vault v1.0.12+20190614 +site_name: Vault v1.0.13+20200330 site_url: http://byron.github.io/google-apis-rs/google-vault1-cli site_description: A complete library to interact with Vault (protocol v1) @@ -37,6 +37,7 @@ pages: - ['matters_saved-queries-list.md', 'Matters', 'Saved Queries List'] - ['matters_undelete.md', 'Matters', 'Undelete'] - ['matters_update.md', 'Matters', 'Update'] +- ['operations_delete.md', 'Operations', 'Delete'] theme: readthedocs diff --git a/gen/vault1-cli/src/main.rs b/gen/vault1-cli/src/main.rs index dfb57d92c4..9a30edcf8d 100644 --- a/gen/vault1-cli/src/main.rs +++ b/gen/vault1-cli/src/main.rs @@ -2102,6 +2102,55 @@ impl<'n> Engine<'n> { } } + fn _operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.operations().delete(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _doit(&self, dry_run: bool) -> Result, Option> { let mut err = InvalidOptionsError::new(); let mut call_result: Result<(), DoitError> = Ok(()); @@ -2199,6 +2248,17 @@ impl<'n> Engine<'n> { } } }, + ("operations", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._operations_delete(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("operations".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -3076,11 +3136,39 @@ fn main() { ]), ]), + ("operations", "methods: 'delete'", vec![ + ("delete", + Some(r##"Deletes a long-running operation. This method indicates that the client is + no longer interested in the operation result. It does not cancel the + operation. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`."##), + "Details at http://byron.github.io/google-apis-rs/google_vault1_cli/operations_delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the operation resource to be deleted."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ]; let mut app = App::new("vault1") .author("Sebastian Thiel ") - .version("1.0.12+20190614") + .version("1.0.13+20200330") .about("Archiving and eDiscovery for G Suite.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_vault1_cli") .arg(Arg::with_name("url") diff --git a/gen/vault1/Cargo.toml b/gen/vault1/Cargo.toml index d4fadb30db..edfa070bc6 100644 --- a/gen/vault1/Cargo.toml +++ b/gen/vault1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-vault1" -version = "1.0.12+20190614" +version = "1.0.13+20200330" authors = ["Sebastian Thiel "] description = "A complete library to interact with Vault (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/vault1" homepage = "https://developers.google.com/vault" -documentation = "https://docs.rs/google-vault1/1.0.12+20190614" +documentation = "https://docs.rs/google-vault1/1.0.13+20200330" license = "MIT" keywords = ["vault", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/vault1/README.md b/gen/vault1/README.md index 611394a8d8..acd25d8f33 100644 --- a/gen/vault1/README.md +++ b/gen/vault1/README.md @@ -5,16 +5,18 @@ DO NOT EDIT ! --> The `google-vault1` library allows access to all features of the *Google Vault* service. -This documentation was generated from *Vault* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *vault:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Vault* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *vault:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Vault* *v1* API can be found at the [official documentation site](https://developers.google.com/vault). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.Vault.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.Vault.html) ... -* [matters](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.Matter.html) - * [*add permissions*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterAddPermissionCall.html), [*close*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterCloseCall.html), [*create*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterCreateCall.html), [*delete*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterDeleteCall.html), [*exports create*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterExportCreateCall.html), [*exports delete*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterExportDeleteCall.html), [*exports get*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterExportGetCall.html), [*exports list*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterExportListCall.html), [*get*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterGetCall.html), [*holds accounts create*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldAccountCreateCall.html), [*holds accounts delete*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldAccountDeleteCall.html), [*holds accounts list*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldAccountListCall.html), [*holds add held accounts*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldAddHeldAccountCall.html), [*holds create*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldCreateCall.html), [*holds delete*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldDeleteCall.html), [*holds get*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldGetCall.html), [*holds list*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldListCall.html), [*holds remove held accounts*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldRemoveHeldAccountCall.html), [*holds update*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterHoldUpdateCall.html), [*list*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterListCall.html), [*remove permissions*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterRemovePermissionCall.html), [*reopen*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterReopenCall.html), [*saved queries create*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterSavedQueryCreateCall.html), [*saved queries delete*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterSavedQueryDeleteCall.html), [*saved queries get*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterSavedQueryGetCall.html), [*saved queries list*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterSavedQueryListCall.html), [*undelete*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterUndeleteCall.html) and [*update*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.MatterUpdateCall.html) +* [matters](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.Matter.html) + * [*add permissions*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterAddPermissionCall.html), [*close*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterCloseCall.html), [*create*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterCreateCall.html), [*delete*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterDeleteCall.html), [*exports create*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterExportCreateCall.html), [*exports delete*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterExportDeleteCall.html), [*exports get*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterExportGetCall.html), [*exports list*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterExportListCall.html), [*get*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterGetCall.html), [*holds accounts create*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldAccountCreateCall.html), [*holds accounts delete*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldAccountDeleteCall.html), [*holds accounts list*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldAccountListCall.html), [*holds add held accounts*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldAddHeldAccountCall.html), [*holds create*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldCreateCall.html), [*holds delete*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldDeleteCall.html), [*holds get*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldGetCall.html), [*holds list*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldListCall.html), [*holds remove held accounts*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldRemoveHeldAccountCall.html), [*holds update*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterHoldUpdateCall.html), [*list*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterListCall.html), [*remove permissions*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterRemovePermissionCall.html), [*reopen*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterReopenCall.html), [*saved queries create*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterSavedQueryCreateCall.html), [*saved queries delete*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterSavedQueryDeleteCall.html), [*saved queries get*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterSavedQueryGetCall.html), [*saved queries list*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterSavedQueryListCall.html), [*undelete*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterUndeleteCall.html) and [*update*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.MatterUpdateCall.html) +* operations + * [*delete*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.OperationDeleteCall.html) @@ -23,17 +25,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/struct.Vault.html)** +* **[Hub](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/struct.Vault.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.Part.html)** + * **[Parts](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -154,17 +156,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -174,29 +176,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-vault1/1.0.12+20190614/google_vault1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-vault1/1.0.13+20200330/google_vault1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/vault1/src/lib.rs b/gen/vault1/src/lib.rs index a28073013f..45c5e3ed33 100644 --- a/gen/vault1/src/lib.rs +++ b/gen/vault1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Vault* crate version *1.0.12+20190614*, where *20190614* is the exact revision of the *vault:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Vault* crate version *1.0.13+20200330*, where *20200330* is the exact revision of the *vault:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Vault* *v1* API can be found at the //! [official documentation site](https://developers.google.com/vault). @@ -13,6 +13,8 @@ //! //! * [matters](struct.Matter.html) //! * [*add permissions*](struct.MatterAddPermissionCall.html), [*close*](struct.MatterCloseCall.html), [*create*](struct.MatterCreateCall.html), [*delete*](struct.MatterDeleteCall.html), [*exports create*](struct.MatterExportCreateCall.html), [*exports delete*](struct.MatterExportDeleteCall.html), [*exports get*](struct.MatterExportGetCall.html), [*exports list*](struct.MatterExportListCall.html), [*get*](struct.MatterGetCall.html), [*holds accounts create*](struct.MatterHoldAccountCreateCall.html), [*holds accounts delete*](struct.MatterHoldAccountDeleteCall.html), [*holds accounts list*](struct.MatterHoldAccountListCall.html), [*holds add held accounts*](struct.MatterHoldAddHeldAccountCall.html), [*holds create*](struct.MatterHoldCreateCall.html), [*holds delete*](struct.MatterHoldDeleteCall.html), [*holds get*](struct.MatterHoldGetCall.html), [*holds list*](struct.MatterHoldListCall.html), [*holds remove held accounts*](struct.MatterHoldRemoveHeldAccountCall.html), [*holds update*](struct.MatterHoldUpdateCall.html), [*list*](struct.MatterListCall.html), [*remove permissions*](struct.MatterRemovePermissionCall.html), [*reopen*](struct.MatterReopenCall.html), [*saved queries create*](struct.MatterSavedQueryCreateCall.html), [*saved queries delete*](struct.MatterSavedQueryDeleteCall.html), [*saved queries get*](struct.MatterSavedQueryGetCall.html), [*saved queries list*](struct.MatterSavedQueryListCall.html), [*undelete*](struct.MatterUndeleteCall.html) and [*update*](struct.MatterUpdateCall.html) +//! * operations +//! * [*delete*](struct.OperationDeleteCall.html) //! //! //! @@ -354,7 +356,7 @@ impl<'a, C, A> Vault Vault { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://vault.googleapis.com/".to_string(), _root_url: "https://vault.googleapis.com/".to_string(), } @@ -363,9 +365,12 @@ impl<'a, C, A> Vault pub fn matters(&'a self) -> MatterMethods<'a, C, A> { MatterMethods { hub: &self } } + pub fn operations(&'a self) -> OperationMethods<'a, C, A> { + OperationMethods { hub: &self } + } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -690,10 +695,11 @@ impl Part for CloudStorageFile {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [holds delete matters](struct.MatterHoldDeleteCall.html) (response) +/// * [exports delete matters](struct.MatterExportDeleteCall.html) (response) +/// * [delete operations](struct.OperationDeleteCall.html) (response) +/// * [remove permissions matters](struct.MatterRemovePermissionCall.html) (response) /// * [holds accounts delete matters](struct.MatterHoldAccountDeleteCall.html) (response) /// * [saved queries delete matters](struct.MatterSavedQueryDeleteCall.html) (response) -/// * [exports delete matters](struct.MatterExportDeleteCall.html) (response) -/// * [remove permissions matters](struct.MatterRemovePermissionCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -1490,6 +1496,67 @@ impl Part for HeldDriveQuery {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *operation* resources. +/// It is not used directly, but through the `Vault` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_vault1 as vault1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use vault1::Vault; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)` +/// // to build up your call. +/// let rb = hub.operations(); +/// # } +/// ``` +pub struct OperationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, +} + +impl<'a, C, A> MethodsBuilder for OperationMethods<'a, C, A> {} + +impl<'a, C, A> OperationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource to be deleted. + pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { + OperationDeleteCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *matter* resources. /// It is not used directly, but through the `Vault` hub. /// @@ -2097,6 +2164,228 @@ impl<'a, C, A> MatterMethods<'a, C, A> { // CallBuilders ### // ################# +/// Deletes a long-running operation. This method indicates that the client is +/// no longer interested in the operation result. It does not cancel the +/// operation. If the server doesn't support this method, it returns +/// `google.rpc.Code.UNIMPLEMENTED`. +/// +/// A builder for the *delete* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vault1 as vault1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vault1::Vault; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vault::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.operations().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vault, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for OperationDeleteCall<'a, C, A> {} + +impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vault.operations.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource to be deleted. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + /// Removes a hold by ID. This will release any HeldAccounts on this Hold. /// /// A builder for the *holds.delete* method supported by a *matter* resource. @@ -2382,9 +2671,9 @@ impl<'a, C, A> MatterHoldDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.matters().holds_list("matterId") -/// .view("dolores") -/// .page_token("gubergren") -/// .page_size(-95) +/// .view("gubergren") +/// .page_token("sadipscing") +/// .page_size(-31) /// .doit(); /// # } /// ``` @@ -3474,7 +3763,7 @@ impl<'a, C, A> MatterUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.matters().holds_get("matterId", "holdId") -/// .view("et") +/// .view("diam") /// .doit(); /// # } /// ``` @@ -4001,8 +4290,8 @@ impl<'a, C, A> MatterHoldAccountListCall<'a, C, A> where C: BorrowMut MatterRemovePermissionCall<'a, C, A> where C: BorrowMut MatterCloseCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.matters().get("matterId") -/// .view("invidunt") +/// .view("aliquyam") /// .doit(); /// # } /// ``` @@ -7538,10 +7827,10 @@ impl<'a, C, A> MatterCreateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.matters().list() -/// .view("sea") -/// .state("et") -/// .page_token("duo") -/// .page_size(-21) +/// .view("et") +/// .state("duo") +/// .page_token("et") +/// .page_size(-40) /// .doit(); /// # } /// ``` diff --git a/gen/videointelligence1-cli/Cargo.toml b/gen/videointelligence1-cli/Cargo.toml index 5c6856dc25..7d072b0724 100644 --- a/gen/videointelligence1-cli/Cargo.toml +++ b/gen/videointelligence1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-videointelligence1-cli" -version = "1.0.12+20190626" +version = "1.0.13+20200325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Video Intelligence (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-videointelligence1] path = "../videointelligence1" -version = "1.0.12+20190626" +version = "1.0.13+20200325" diff --git a/gen/videointelligence1-cli/README.md b/gen/videointelligence1-cli/README.md index 30435554f1..6876bf674d 100644 --- a/gen/videointelligence1-cli/README.md +++ b/gen/videointelligence1-cli/README.md @@ -25,14 +25,11 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Video Intelligence* API at revision *20190626*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Video Intelligence* API at revision *20200325*. The CLI is at version *1.0.13*. ```bash videointelligence1 [options] operations - cancel [-p ]... [-o ] - delete [-p ]... [-o ] - get [-p ]... [-o ] projects-locations-operations-cancel [-p ]... [-o ] projects-locations-operations-delete [-p ]... [-o ] projects-locations-operations-get [-p ]... [-o ] diff --git a/gen/videointelligence1-cli/mkdocs.yml b/gen/videointelligence1-cli/mkdocs.yml index 765063a510..4031a3233a 100644 --- a/gen/videointelligence1-cli/mkdocs.yml +++ b/gen/videointelligence1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Video Intelligence v1.0.12+20190626 +site_name: Cloud Video Intelligence v1.0.13+20200325 site_url: http://byron.github.io/google-apis-rs/google-videointelligence1-cli site_description: A complete library to interact with Cloud Video Intelligence (protocol v1) @@ -9,9 +9,6 @@ site_dir: build_html pages: - ['index.md', 'Home'] -- ['operations_cancel.md', 'Operations', 'Cancel'] -- ['operations_delete.md', 'Operations', 'Delete'] -- ['operations_get.md', 'Operations', 'Get'] - ['operations_projects-locations-operations-cancel.md', 'Operations', 'Projects Locations Operations Cancel'] - ['operations_projects-locations-operations-delete.md', 'Operations', 'Projects Locations Operations Delete'] - ['operations_projects-locations-operations-get.md', 'Operations', 'Projects Locations Operations Get'] diff --git a/gen/videointelligence1-cli/src/main.rs b/gen/videointelligence1-cli/src/main.rs index b953c15644..06259d6bf8 100644 --- a/gen/videointelligence1-cli/src/main.rs +++ b/gen/videointelligence1-cli/src/main.rs @@ -46,162 +46,6 @@ struct Engine<'n> { impl<'n> Engine<'n> { - fn _operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.operations().cancel(opt.value_of("name").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _operations_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.operations().delete(opt.value_of("name").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.operations().get(opt.value_of("name").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _operations_projects_locations_operations_cancel(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.operations().projects_locations_operations_cancel(opt.value_of("name").unwrap_or("")); @@ -722,15 +566,6 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("operations", Some(opt)) => { match opt.subcommand() { - ("cancel", Some(opt)) => { - call_result = self._operations_cancel(opt, dry_run, &mut err); - }, - ("delete", Some(opt)) => { - call_result = self._operations_delete(opt, dry_run, &mut err); - }, - ("get", Some(opt)) => { - call_result = self._operations_get(opt, dry_run, &mut err); - }, ("projects-locations-operations-cancel", Some(opt)) => { call_result = self._operations_projects_locations_operations_cancel(opt, dry_run, &mut err); }, @@ -862,87 +697,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("operations", "methods: 'cancel', 'delete', 'get', 'projects-locations-operations-cancel', 'projects-locations-operations-delete' and 'projects-locations-operations-get'", vec![ - ("cancel", - Some(r##"Starts asynchronous cancellation on a long-running operation. The server - makes a best effort to cancel the operation, but success is not - guaranteed. If the server doesn't support this method, it returns - `google.rpc.Code.UNIMPLEMENTED`. Clients can use - Operations.GetOperation or - other methods to check whether the cancellation succeeded or whether the - operation completed despite cancellation. On successful cancellation, - the operation is not deleted; instead, it becomes an operation with - an Operation.error value with a google.rpc.Status.code of 1, - corresponding to `Code.CANCELLED`."##), - "Details at http://byron.github.io/google-apis-rs/google_videointelligence1_cli/operations_cancel", - vec![ - (Some(r##"name"##), - None, - Some(r##"The name of the operation resource to be cancelled."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("delete", - Some(r##"Deletes a long-running operation. This method indicates that the client is - no longer interested in the operation result. It does not cancel the - operation. If the server doesn't support this method, it returns - `google.rpc.Code.UNIMPLEMENTED`."##), - "Details at http://byron.github.io/google-apis-rs/google_videointelligence1_cli/operations_delete", - vec![ - (Some(r##"name"##), - None, - Some(r##"The name of the operation resource to be deleted."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("get", - Some(r##"Gets the latest state of a long-running operation. Clients can use this - method to poll the operation result at intervals as recommended by the API - service."##), - "Details at http://byron.github.io/google-apis-rs/google_videointelligence1_cli/operations_get", - vec![ - (Some(r##"name"##), - None, - Some(r##"The name of the operation resource."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), + ("operations", "methods: 'projects-locations-operations-cancel', 'projects-locations-operations-delete' and 'projects-locations-operations-get'", vec![ ("projects-locations-operations-cancel", Some(r##"Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not @@ -1177,7 +932,7 @@ fn main() { let mut app = App::new("videointelligence1") .author("Sebastian Thiel ") - .version("1.0.12+20190626") + .version("1.0.13+20200325") .about("Detects objects, explicit content, and scene changes in videos. It also specifies the region for annotation and transcribes speech to text. Supports both asynchronous API and streaming API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_videointelligence1_cli") .arg(Arg::with_name("url") diff --git a/gen/videointelligence1/Cargo.toml b/gen/videointelligence1/Cargo.toml index 1509f3c6dd..ee36eeab17 100644 --- a/gen/videointelligence1/Cargo.toml +++ b/gen/videointelligence1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-videointelligence1" -version = "1.0.12+20190626" +version = "1.0.13+20200325" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Video Intelligence (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1" homepage = "https://cloud.google.com/video-intelligence/docs/" -documentation = "https://docs.rs/google-videointelligence1/1.0.12+20190626" +documentation = "https://docs.rs/google-videointelligence1/1.0.13+20200325" license = "MIT" keywords = ["videointelligence", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/videointelligence1/README.md b/gen/videointelligence1/README.md index 1eda1a8ffb..4eca01c0b0 100644 --- a/gen/videointelligence1/README.md +++ b/gen/videointelligence1/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-videointelligence1` library allows access to all features of the *Google Cloud Video Intelligence* service. -This documentation was generated from *Cloud Video Intelligence* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *videointelligence:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Video Intelligence* crate version *1.0.13+20200325*, where *20200325* is the exact revision of the *videointelligence:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Video Intelligence* *v1* API can be found at the [official documentation site](https://cloud.google.com/video-intelligence/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.CloudVideoIntelligence.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.CloudVideoIntelligence.html) ... * operations - * [*cancel*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.OperationGetCall.html), [*projects locations operations cancel*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.OperationProjectLocationOperationCancelCall.html), [*projects locations operations delete*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.OperationProjectLocationOperationDeleteCall.html) and [*projects locations operations get*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.OperationProjectLocationOperationGetCall.html) + * [*projects locations operations cancel*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.OperationProjectLocationOperationCancelCall.html), [*projects locations operations delete*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.OperationProjectLocationOperationDeleteCall.html) and [*projects locations operations get*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.OperationProjectLocationOperationGetCall.html) * projects - * [*locations operations cancel*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.ProjectLocationOperationListCall.html) + * [*locations operations cancel*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.ProjectLocationOperationListCall.html) * videos - * [*annotate*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.VideoAnnotateCall.html) + * [*annotate*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.VideoAnnotateCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/struct.CloudVideoIntelligence.html)** +* **[Hub](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/struct.CloudVideoIntelligence.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.Part.html)** + * **[Parts](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -52,11 +52,9 @@ Or specifically ... ```ignore let r = hub.projects().locations_operations_cancel(...).doit() -let r = hub.operations().delete(...).doit() -let r = hub.projects().locations_operations_delete(...).doit() let r = hub.operations().projects_locations_operations_cancel(...).doit() let r = hub.operations().projects_locations_operations_delete(...).doit() -let r = hub.operations().cancel(...).doit() +let r = hub.projects().locations_operations_delete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -139,17 +137,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -159,29 +157,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-videointelligence1/1.0.12+20190626/google_videointelligence1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-videointelligence1/1.0.13+20200325/google_videointelligence1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/videointelligence1/src/lib.rs b/gen/videointelligence1/src/lib.rs index 08097b24ee..880f890ddc 100644 --- a/gen/videointelligence1/src/lib.rs +++ b/gen/videointelligence1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Video Intelligence* crate version *1.0.12+20190626*, where *20190626* is the exact revision of the *videointelligence:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Video Intelligence* crate version *1.0.13+20200325*, where *20200325* is the exact revision of the *videointelligence:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Video Intelligence* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/video-intelligence/docs/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.CloudVideoIntelligence.html) ... //! //! * operations -//! * [*cancel*](struct.OperationCancelCall.html), [*delete*](struct.OperationDeleteCall.html), [*get*](struct.OperationGetCall.html), [*projects locations operations cancel*](struct.OperationProjectLocationOperationCancelCall.html), [*projects locations operations delete*](struct.OperationProjectLocationOperationDeleteCall.html) and [*projects locations operations get*](struct.OperationProjectLocationOperationGetCall.html) +//! * [*projects locations operations cancel*](struct.OperationProjectLocationOperationCancelCall.html), [*projects locations operations delete*](struct.OperationProjectLocationOperationDeleteCall.html) and [*projects locations operations get*](struct.OperationProjectLocationOperationGetCall.html) //! * projects //! * [*locations operations cancel*](struct.ProjectLocationOperationCancelCall.html), [*locations operations delete*](struct.ProjectLocationOperationDeleteCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html) and [*locations operations list*](struct.ProjectLocationOperationListCall.html) //! * videos @@ -52,11 +52,9 @@ //! //! ```ignore //! let r = hub.projects().locations_operations_cancel(...).doit() -//! let r = hub.operations().delete(...).doit() -//! let r = hub.projects().locations_operations_delete(...).doit() //! let r = hub.operations().projects_locations_operations_cancel(...).doit() //! let r = hub.operations().projects_locations_operations_delete(...).doit() -//! let r = hub.operations().cancel(...).doit() +//! let r = hub.projects().locations_operations_delete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -338,7 +336,7 @@ impl<'a, C, A> CloudVideoIntelligence CloudVideoIntelligence { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://videointelligence.googleapis.com/".to_string(), _root_url: "https://videointelligence.googleapis.com/".to_string(), } @@ -355,7 +353,7 @@ impl<'a, C, A> CloudVideoIntelligence } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -401,11 +399,9 @@ impl<'a, C, A> CloudVideoIntelligence /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [locations operations cancel projects](struct.ProjectLocationOperationCancelCall.html) (response) -/// * [delete operations](struct.OperationDeleteCall.html) (response) -/// * [locations operations delete projects](struct.ProjectLocationOperationDeleteCall.html) (response) /// * [projects locations operations cancel operations](struct.OperationProjectLocationOperationCancelCall.html) (response) /// * [projects locations operations delete operations](struct.OperationProjectLocationOperationDeleteCall.html) (response) -/// * [cancel operations](struct.OperationCancelCall.html) (response) +/// * [locations operations delete projects](struct.ProjectLocationOperationDeleteCall.html) (response) #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleProtobuf_Empty { _never_set: Option } @@ -459,12 +455,12 @@ pub struct GoogleCloudVideointelligenceV1_AnnotateVideoRequest { /// Additional video context and/or feature-specific parameters. #[serde(rename="videoContext")] pub video_context: Option, - /// Optional cloud region where annotation should take place. Supported cloud + /// Optional. Cloud region where annotation should take place. Supported cloud /// regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region /// is specified, a region will be determined based on video file location. #[serde(rename="locationId")] pub location_id: Option, - /// Requested video annotation features. + /// Required. Requested video annotation features. pub features: Option>, /// The video data bytes. /// If unset, the input video(s) should be specified via `input_uri`. @@ -472,23 +468,23 @@ pub struct GoogleCloudVideointelligenceV1_AnnotateVideoRequest { #[serde(rename="inputContent")] pub input_content: Option, /// Input video location. Currently, only - /// [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + /// [Cloud Storage](https://cloud.google.com/storage/) URIs are /// supported, which must be specified in the following format: /// `gs://bucket-id/object-id` (other URI formats return /// google.rpc.Code.INVALID_ARGUMENT). For more information, see - /// [Request URIs](/storage/docs/reference-uris). + /// [Request URIs](https://cloud.google.com/storage/docs/request-endpoints). /// A video URI may include wildcards in `object-id`, and thus identify /// multiple videos. Supported wildcards: '*' to match 0 or more characters; /// '?' to match 1 character. If unset, the input video should be embedded /// in the request as `input_content`. If set, `input_content` should be unset. #[serde(rename="inputUri")] pub input_uri: Option, - /// Optional location where the output (in JSON format) should be stored. - /// Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + /// Optional. Location where the output (in JSON format) should be stored. + /// Currently, only [Cloud Storage](https://cloud.google.com/storage/) /// URIs are supported, which must be specified in the following format: /// `gs://bucket-id/object-id` (other URI formats return /// google.rpc.Code.INVALID_ARGUMENT). For more information, see - /// [Request URIs](/storage/docs/reference-uris). + /// [Request URIs](https://cloud.google.com/storage/docs/request-endpoints). #[serde(rename="outputUri")] pub output_uri: Option, } @@ -502,20 +498,20 @@ impl RequestValue for GoogleCloudVideointelligenceV1_AnnotateVideoRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudVideointelligenceV1_SpeechTranscriptionConfig { - /// *Required* The language of the supplied audio as a + /// Required. *Required* The language of the supplied audio as a /// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. /// Example: "en-US". /// See [Language Support](https://cloud.google.com/speech/docs/languages) /// for a list of the currently supported language codes. #[serde(rename="languageCode")] pub language_code: Option, - /// *Optional* If set to `true`, the server will attempt to filter out + /// Optional. If set to `true`, the server will attempt to filter out /// profanities, replacing all but the initial character in each filtered word /// with asterisks, e.g. "f***". If set to `false` or omitted, profanities /// won't be filtered out. #[serde(rename="filterProfanity")] pub filter_profanity: Option, - /// *Optional* If 'true', adds punctuation to recognition result hypotheses. + /// Optional. If 'true', adds punctuation to recognition result hypotheses. /// This feature is only available in select languages. Setting this for /// requests in other languages has no effect at all. The default 'false' value /// does not add punctuation to result hypotheses. NOTE: "This is currently @@ -523,7 +519,7 @@ pub struct GoogleCloudVideointelligenceV1_SpeechTranscriptionConfig { /// future this may be exclusively available as a premium feature." #[serde(rename="enableAutomaticPunctuation")] pub enable_automatic_punctuation: Option, - /// *Optional* If 'true', enables speaker detection for each recognized word in + /// Optional. If 'true', enables speaker detection for each recognized word in /// the top alternative of the recognition result using a speaker_tag provided /// in the WordInfo. /// Note: When this is true, we send all the words from the beginning of the @@ -532,29 +528,28 @@ pub struct GoogleCloudVideointelligenceV1_SpeechTranscriptionConfig { /// identify the speakers in the conversation over time. #[serde(rename="enableSpeakerDiarization")] pub enable_speaker_diarization: Option, - /// *Optional* Maximum number of recognition hypotheses to be returned. + /// Optional. Maximum number of recognition hypotheses to be returned. /// Specifically, the maximum number of `SpeechRecognitionAlternative` messages /// within each `SpeechTranscription`. The server may return fewer than /// `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will /// return a maximum of one. If omitted, will return a maximum of one. #[serde(rename="maxAlternatives")] pub max_alternatives: Option, - /// *Optional* For file formats, such as MXF or MKV, supporting multiple audio + /// Optional. For file formats, such as MXF or MKV, supporting multiple audio /// tracks, specify up to two tracks. Default: track 0. #[serde(rename="audioTracks")] pub audio_tracks: Option>, - /// *Optional* - /// If set, specifies the estimated number of speakers in the conversation. + /// Optional. If set, specifies the estimated number of speakers in the conversation. /// If not set, defaults to '2'. /// Ignored unless enable_speaker_diarization is set to true. #[serde(rename="diarizationSpeakerCount")] pub diarization_speaker_count: Option, - /// *Optional* If `true`, the top result includes a list of words and the + /// Optional. If `true`, the top result includes a list of words and the /// confidence for those words. If `false`, no word-level confidence /// information is returned. The default is `false`. #[serde(rename="enableWordConfidence")] pub enable_word_confidence: Option, - /// *Optional* A means to provide context to assist the speech recognition. + /// Optional. A means to provide context to assist the speech recognition. #[serde(rename="speechContexts")] pub speech_contexts: Option>, } @@ -606,7 +601,7 @@ impl Part for GoogleCloudVideointelligenceV1_TextDetectionConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudVideointelligenceV1_SpeechContext { - /// *Optional* A list of strings containing words and phrases "hints" so that + /// Optional. A list of strings containing words and phrases "hints" so that /// the speech recognition is more likely to recognize them. This can be used /// to improve the accuracy for specific words and phrases, for example, if /// specific commands are typically spoken by the user. This can also be used @@ -667,7 +662,6 @@ impl Part for GoogleCloudVideointelligenceV1_VideoSegment {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [annotate videos](struct.VideoAnnotateCall.html) (response) -/// * [get operations](struct.OperationGetCall.html) (response) /// * [projects locations operations get operations](struct.OperationProjectLocationOperationGetCall.html) (response) /// * [locations operations get projects](struct.ProjectLocationOperationGetCall.html) (response) /// @@ -843,7 +837,7 @@ impl Part for GoogleCloudVideointelligenceV1_LabelDetectionConfig {} /// ::default(), None); /// let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `cancel(...)`, `delete(...)`, `get(...)`, `projects_locations_operations_cancel(...)`, `projects_locations_operations_delete(...)` and `projects_locations_operations_get(...)` +/// // like `projects_locations_operations_cancel(...)`, `projects_locations_operations_delete(...)` and `projects_locations_operations_get(...)` /// // to build up your call. /// let rb = hub.operations(); /// # } @@ -877,26 +871,6 @@ impl<'a, C, A> OperationMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes a long-running operation. This method indicates that the client is - /// no longer interested in the operation result. It does not cancel the - /// operation. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource to be deleted. - pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { - OperationDeleteCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Starts asynchronous cancellation on a long-running operation. The server @@ -942,51 +916,6 @@ impl<'a, C, A> OperationMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Gets the latest state of a long-running operation. Clients can use this - /// method to poll the operation result at intervals as recommended by the API - /// service. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource. - pub fn get(&self, name: &str) -> OperationGetCall<'a, C, A> { - OperationGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Starts asynchronous cancellation on a long-running operation. The server - /// makes a best effort to cancel the operation, but success is not - /// guaranteed. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use - /// Operations.GetOperation or - /// other methods to check whether the cancellation succeeded or whether the - /// operation completed despite cancellation. On successful cancellation, - /// the operation is not deleted; instead, it becomes an operation with - /// an Operation.error value with a google.rpc.Status.code of 1, - /// corresponding to `Code.CANCELLED`. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource to be cancelled. - pub fn cancel(&self, name: &str) -> OperationCancelCall<'a, C, A> { - OperationCancelCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -1120,25 +1049,6 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Gets the latest state of a long-running operation. Clients can use this - /// method to poll the operation result at intervals as recommended by the API - /// service. - /// - /// # Arguments - /// - /// * `name` - The name of the operation resource. - pub fn locations_operations_get(&self, name: &str) -> ProjectLocationOperationGetCall<'a, C, A> { - ProjectLocationOperationGetCall { - hub: self.hub, - _name: name.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists operations that match the specified filter in the request. If the @@ -1187,6 +1097,25 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// # Arguments + /// + /// * `name` - The name of the operation resource. + pub fn locations_operations_get(&self, name: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + ProjectLocationOperationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -1447,257 +1376,6 @@ impl<'a, C, A> OperationProjectLocationOperationGetCall<'a, C, A> where C: Borro } -/// Deletes a long-running operation. This method indicates that the client is -/// no longer interested in the operation result. It does not cancel the -/// operation. If the server doesn't support this method, it returns -/// `google.rpc.Code.UNIMPLEMENTED`. -/// -/// A builder for the *delete* method supported by a *operation* resource. -/// It is not used directly, but through a `OperationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_videointelligence1 as videointelligence1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use videointelligence1::CloudVideoIntelligence; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.operations().delete("name") -/// .doit(); -/// # } -/// ``` -pub struct OperationDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudVideoIntelligence, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OperationDeleteCall<'a, C, A> {} - -impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobuf_Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "videointelligence.operations.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/operations/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation resource to be deleted. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OperationDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OperationDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Starts asynchronous cancellation on a long-running operation. The server /// makes a best effort to cancel the operation, but success is not /// guaranteed. If the server doesn't support this method, it returns @@ -2206,513 +1884,6 @@ impl<'a, C, A> OperationProjectLocationOperationDeleteCall<'a, C, A> where C: Bo } -/// Gets the latest state of a long-running operation. Clients can use this -/// method to poll the operation result at intervals as recommended by the API -/// service. -/// -/// A builder for the *get* method supported by a *operation* resource. -/// It is not used directly, but through a `OperationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_videointelligence1 as videointelligence1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use videointelligence1::CloudVideoIntelligence; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.operations().get("name") -/// .doit(); -/// # } -/// ``` -pub struct OperationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudVideoIntelligence, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OperationGetCall<'a, C, A> {} - -impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunning_Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "videointelligence.operations.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/operations/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation resource. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OperationGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OperationGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Starts asynchronous cancellation on a long-running operation. The server -/// makes a best effort to cancel the operation, but success is not -/// guaranteed. If the server doesn't support this method, it returns -/// `google.rpc.Code.UNIMPLEMENTED`. Clients can use -/// Operations.GetOperation or -/// other methods to check whether the cancellation succeeded or whether the -/// operation completed despite cancellation. On successful cancellation, -/// the operation is not deleted; instead, it becomes an operation with -/// an Operation.error value with a google.rpc.Status.code of 1, -/// corresponding to `Code.CANCELLED`. -/// -/// A builder for the *cancel* method supported by a *operation* resource. -/// It is not used directly, but through a `OperationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_videointelligence1 as videointelligence1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use videointelligence1::CloudVideoIntelligence; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.operations().cancel("name") -/// .doit(); -/// # } -/// ``` -pub struct OperationCancelCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudVideoIntelligence, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OperationCancelCall<'a, C, A> {} - -impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleProtobuf_Empty)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "videointelligence.operations.cancel", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/operations/{+name}:cancel"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation resource to be cancelled. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OperationCancelCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationCancelCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OperationCancelCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OperationCancelCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Performs asynchronous video annotation. Progress and results can be /// retrieved through the `google.longrunning.Operations` interface. /// `Operation.metadata` contains `AnnotateVideoProgress` (progress). @@ -3246,256 +2417,6 @@ impl<'a, C, A> ProjectLocationOperationCancelCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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_operations_get("name") -/// .doit(); -/// # } -/// ``` -pub struct ProjectLocationOperationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudVideoIntelligence, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectLocationOperationGetCall<'a, C, A> {} - -impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunning_Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "videointelligence.projects.locations.operations.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation resource. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> ProjectLocationOperationGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Lists operations that match the specified filter in the request. If the /// server doesn't support this method, it returns `UNIMPLEMENTED`. /// @@ -3533,9 +2454,9 @@ impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut ProjectLocationOperationDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudVideoIntelligence::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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_operations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudVideoIntelligence, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationOperationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunning_Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "videointelligence.projects.locations.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationOperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationOperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + diff --git a/gen/videointelligence1_beta1-cli/Cargo.toml b/gen/videointelligence1_beta1-cli/Cargo.toml index 197ae91f3f..167b9becc3 100644 --- a/gen/videointelligence1_beta1-cli/Cargo.toml +++ b/gen/videointelligence1_beta1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-videointelligence1_beta1-cli" -version = "1.0.12+20171122" +version = "1.0.13+20171122" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Video Intelligence (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1_beta1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-videointelligence1_beta1] path = "../videointelligence1_beta1" -version = "1.0.12+20171122" +version = "1.0.13+20171122" diff --git a/gen/videointelligence1_beta1-cli/README.md b/gen/videointelligence1_beta1-cli/README.md index bfe4f3aa33..b16533fe04 100644 --- a/gen/videointelligence1_beta1-cli/README.md +++ b/gen/videointelligence1_beta1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Cloud Video Intelligence* API at revision *20171122*. The CLI is at version *1.0.12*. +This documentation was generated from the *Cloud Video Intelligence* API at revision *20171122*. The CLI is at version *1.0.13*. ```bash videointelligence1-beta1 [options] diff --git a/gen/videointelligence1_beta1-cli/mkdocs.yml b/gen/videointelligence1_beta1-cli/mkdocs.yml index 266fefe60a..e18eca385e 100644 --- a/gen/videointelligence1_beta1-cli/mkdocs.yml +++ b/gen/videointelligence1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Video Intelligence v1.0.12+20171122 +site_name: Cloud Video Intelligence v1.0.13+20171122 site_url: http://byron.github.io/google-apis-rs/google-videointelligence1_beta1-cli site_description: A complete library to interact with Cloud Video Intelligence (protocol v1beta1) diff --git a/gen/videointelligence1_beta1-cli/src/main.rs b/gen/videointelligence1_beta1-cli/src/main.rs index ee4a397442..dff5099d76 100644 --- a/gen/videointelligence1_beta1-cli/src/main.rs +++ b/gen/videointelligence1_beta1-cli/src/main.rs @@ -274,7 +274,7 @@ fn main() { let mut app = App::new("videointelligence1-beta1") .author("Sebastian Thiel ") - .version("1.0.12+20171122") + .version("1.0.13+20171122") .about("Cloud Video Intelligence API.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_videointelligence1_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/videointelligence1_beta1/Cargo.toml b/gen/videointelligence1_beta1/Cargo.toml index 0944bf35a9..c8136e06cb 100644 --- a/gen/videointelligence1_beta1/Cargo.toml +++ b/gen/videointelligence1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-videointelligence1_beta1" -version = "1.0.12+20171122" +version = "1.0.13+20171122" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Video Intelligence (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/videointelligence1_beta1" homepage = "https://cloud.google.com/video-intelligence/docs/" -documentation = "https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122" +documentation = "https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122" license = "MIT" keywords = ["videointelligence", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/videointelligence1_beta1/README.md b/gen/videointelligence1_beta1/README.md index d190442f12..dd96ba24f8 100644 --- a/gen/videointelligence1_beta1/README.md +++ b/gen/videointelligence1_beta1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-videointelligence1_beta1` library allows access to all features of the *Google Cloud Video Intelligence* service. -This documentation was generated from *Cloud Video Intelligence* crate version *1.0.12+20171122*, where *20171122* is the exact revision of the *videointelligence:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Cloud Video Intelligence* crate version *1.0.13+20171122*, where *20171122* is the exact revision of the *videointelligence:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Cloud Video Intelligence* *v1_beta1* API can be found at the [official documentation site](https://cloud.google.com/video-intelligence/docs/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html) ... * videos - * [*annotate*](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/struct.VideoAnnotateCall.html) + * [*annotate*](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/struct.VideoAnnotateCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html)** +* **[Hub](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/struct.CloudVideoIntelligence.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -150,29 +150,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-videointelligence1_beta1/1.0.12+20171122/google_videointelligence1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-videointelligence1_beta1/1.0.13+20171122/google_videointelligence1_beta1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/videointelligence1_beta1/src/lib.rs b/gen/videointelligence1_beta1/src/lib.rs index be09a6e790..ad1903b063 100644 --- a/gen/videointelligence1_beta1/src/lib.rs +++ b/gen/videointelligence1_beta1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Video Intelligence* crate version *1.0.12+20171122*, where *20171122* is the exact revision of the *videointelligence:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Cloud Video Intelligence* crate version *1.0.13+20171122*, where *20171122* is the exact revision of the *videointelligence:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Cloud Video Intelligence* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/video-intelligence/docs/). @@ -329,7 +329,7 @@ impl<'a, C, A> CloudVideoIntelligence CloudVideoIntelligence { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://videointelligence.googleapis.com/".to_string(), _root_url: "https://videointelligence.googleapis.com/".to_string(), } @@ -340,7 +340,7 @@ impl<'a, C, A> CloudVideoIntelligence } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/vision1-cli/Cargo.toml b/gen/vision1-cli/Cargo.toml index 5d9b7df3d8..da306fb350 100644 --- a/gen/vision1-cli/Cargo.toml +++ b/gen/vision1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-vision1-cli" -version = "1.0.12+20190628" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Vision (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/vision1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-vision1] path = "../vision1" -version = "1.0.12+20190628" +version = "1.0.13+20200329" diff --git a/gen/vision1-cli/README.md b/gen/vision1-cli/README.md index e1ad5b2a2a..14b74d97f7 100644 --- a/gen/vision1-cli/README.md +++ b/gen/vision1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Vision* API at revision *20190628*. The CLI is at version *1.0.12*. +This documentation was generated from the *Vision* API at revision *20200329*. The CLI is at version *1.0.13*. ```bash vision1 [options] @@ -43,6 +43,14 @@ vision1 [options] get [-p ]... [-o ] list [-p ]... [-o ] projects + files-annotate (-r )... [-p ]... [-o ] + files-async-batch-annotate (-r )... [-p ]... [-o ] + images-annotate (-r )... [-p ]... [-o ] + images-async-batch-annotate (-r )... [-p ]... [-o ] + locations-files-annotate (-r )... [-p ]... [-o ] + locations-files-async-batch-annotate (-r )... [-p ]... [-o ] + locations-images-annotate (-r )... [-p ]... [-o ] + locations-images-async-batch-annotate (-r )... [-p ]... [-o ] locations-operations-get [-p ]... [-o ] locations-product-sets-add-product (-r )... [-p ]... [-o ] locations-product-sets-create (-r )... [-p ]... [-o ] @@ -58,6 +66,7 @@ vision1 [options] locations-products-get [-p ]... [-o ] locations-products-list [-p ]... [-o ] locations-products-patch (-r )... [-p ]... [-o ] + locations-products-purge (-r )... [-p ]... [-o ] locations-products-reference-images-create (-r )... [-p ]... [-o ] locations-products-reference-images-delete [-p ]... [-o ] locations-products-reference-images-get [-p ]... [-o ] diff --git a/gen/vision1-cli/mkdocs.yml b/gen/vision1-cli/mkdocs.yml index 89c5e1c722..edc4da6775 100644 --- a/gen/vision1-cli/mkdocs.yml +++ b/gen/vision1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Vision v1.0.12+20190628 +site_name: Vision v1.0.13+20200329 site_url: http://byron.github.io/google-apis-rs/google-vision1-cli site_description: A complete library to interact with Vision (protocol v1) @@ -18,6 +18,14 @@ pages: - ['operations_delete.md', 'Operations', 'Delete'] - ['operations_get.md', 'Operations', 'Get'] - ['operations_list.md', 'Operations', 'List'] +- ['projects_files-annotate.md', 'Projects', 'Files Annotate'] +- ['projects_files-async-batch-annotate.md', 'Projects', 'Files Async Batch Annotate'] +- ['projects_images-annotate.md', 'Projects', 'Images Annotate'] +- ['projects_images-async-batch-annotate.md', 'Projects', 'Images Async Batch Annotate'] +- ['projects_locations-files-annotate.md', 'Projects', 'Locations Files Annotate'] +- ['projects_locations-files-async-batch-annotate.md', 'Projects', 'Locations Files Async Batch Annotate'] +- ['projects_locations-images-annotate.md', 'Projects', 'Locations Images Annotate'] +- ['projects_locations-images-async-batch-annotate.md', 'Projects', 'Locations Images Async Batch Annotate'] - ['projects_locations-operations-get.md', 'Projects', 'Locations Operations Get'] - ['projects_locations-product-sets-add-product.md', 'Projects', 'Locations Product Sets Add Product'] - ['projects_locations-product-sets-create.md', 'Projects', 'Locations Product Sets Create'] @@ -33,6 +41,7 @@ pages: - ['projects_locations-products-get.md', 'Projects', 'Locations Products Get'] - ['projects_locations-products-list.md', 'Projects', 'Locations Products List'] - ['projects_locations-products-patch.md', 'Projects', 'Locations Products Patch'] +- ['projects_locations-products-purge.md', 'Projects', 'Locations Products Purge'] - ['projects_locations-products-reference-images-create.md', 'Projects', 'Locations Products Reference Images Create'] - ['projects_locations-products-reference-images-delete.md', 'Projects', 'Locations Products Reference Images Delete'] - ['projects_locations-products-reference-images-get.md', 'Projects', 'Locations Products Reference Images Get'] diff --git a/gen/vision1-cli/src/main.rs b/gen/vision1-cli/src/main.rs index 53f909fa80..501f55d7f5 100644 --- a/gen/vision1-cli/src/main.rs +++ b/gen/vision1-cli/src/main.rs @@ -69,8 +69,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -153,8 +154,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -237,8 +239,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec![]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -323,8 +326,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "output-config.batch-size" => Some(("outputConfig.batchSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "output-config.gcs-destination.uri" => Some(("outputConfig.gcsDestination.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["batch-size", "gcs-destination", "output-config", "uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["batch-size", "gcs-destination", "output-config", "parent", "uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -686,6 +690,690 @@ impl<'n> Engine<'n> { } } + fn _projects_files_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchAnnotateFilesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().files_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_files_async_batch_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AsyncBatchAnnotateFilesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().files_async_batch_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_images_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchAnnotateImagesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().images_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_images_async_batch_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "output-config.batch-size" => Some(("outputConfig.batchSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "output-config.gcs-destination.uri" => Some(("outputConfig.gcsDestination.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["batch-size", "gcs-destination", "output-config", "parent", "uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AsyncBatchAnnotateImagesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().images_async_batch_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_files_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchAnnotateFilesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_files_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_files_async_batch_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AsyncBatchAnnotateFilesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_files_async_batch_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_images_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["parent"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::BatchAnnotateImagesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_images_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_images_async_batch_annotate(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "output-config.batch-size" => Some(("outputConfig.batchSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "output-config.gcs-destination.uri" => Some(("outputConfig.gcsDestination.uri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["batch-size", "gcs-destination", "output-config", "parent", "uri"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::AsyncBatchAnnotateImagesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_images_async_batch_annotate(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().locations_operations_get(opt.value_of("name").unwrap_or("")); @@ -1748,6 +2436,93 @@ impl<'n> Engine<'n> { } } + fn _projects_locations_products_purge(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "delete-orphan-products" => Some(("deleteOrphanProducts", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "force" => Some(("force", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "product-set-purge-config.product-set-id" => Some(("productSetPurgeConfig.productSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["delete-orphan-products", "force", "product-set-id", "product-set-purge-config"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::PurgeProductsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_products_purge(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_locations_products_reference_images_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2119,6 +2894,30 @@ impl<'n> Engine<'n> { }, ("projects", Some(opt)) => { match opt.subcommand() { + ("files-annotate", Some(opt)) => { + call_result = self._projects_files_annotate(opt, dry_run, &mut err); + }, + ("files-async-batch-annotate", Some(opt)) => { + call_result = self._projects_files_async_batch_annotate(opt, dry_run, &mut err); + }, + ("images-annotate", Some(opt)) => { + call_result = self._projects_images_annotate(opt, dry_run, &mut err); + }, + ("images-async-batch-annotate", Some(opt)) => { + call_result = self._projects_images_async_batch_annotate(opt, dry_run, &mut err); + }, + ("locations-files-annotate", Some(opt)) => { + call_result = self._projects_locations_files_annotate(opt, dry_run, &mut err); + }, + ("locations-files-async-batch-annotate", Some(opt)) => { + call_result = self._projects_locations_files_async_batch_annotate(opt, dry_run, &mut err); + }, + ("locations-images-annotate", Some(opt)) => { + call_result = self._projects_locations_images_annotate(opt, dry_run, &mut err); + }, + ("locations-images-async-batch-annotate", Some(opt)) => { + call_result = self._projects_locations_images_async_batch_annotate(opt, dry_run, &mut err); + }, ("locations-operations-get", Some(opt)) => { call_result = self._projects_locations_operations_get(opt, dry_run, &mut err); }, @@ -2164,6 +2963,9 @@ impl<'n> Engine<'n> { ("locations-products-patch", Some(opt)) => { call_result = self._projects_locations_products_patch(opt, dry_run, &mut err); }, + ("locations-products-purge", Some(opt)) => { + call_result = self._projects_locations_products_purge(opt, dry_run, &mut err); + }, ("locations-products-reference-images-create", Some(opt)) => { call_result = self._projects_locations_products_reference_images_create(opt, dry_run, &mut err); }, @@ -2530,7 +3332,357 @@ fn main() { ]), ]), - ("projects", "methods: 'locations-operations-get', 'locations-product-sets-add-product', 'locations-product-sets-create', 'locations-product-sets-delete', 'locations-product-sets-get', 'locations-product-sets-import', 'locations-product-sets-list', 'locations-product-sets-patch', 'locations-product-sets-products-list', 'locations-product-sets-remove-product', 'locations-products-create', 'locations-products-delete', 'locations-products-get', 'locations-products-list', 'locations-products-patch', 'locations-products-reference-images-create', 'locations-products-reference-images-delete', 'locations-products-reference-images-get', 'locations-products-reference-images-list' and 'operations-get'", vec![ + ("projects", "methods: 'files-annotate', 'files-async-batch-annotate', 'images-annotate', 'images-async-batch-annotate', 'locations-files-annotate', 'locations-files-async-batch-annotate', 'locations-images-annotate', 'locations-images-async-batch-annotate', 'locations-operations-get', 'locations-product-sets-add-product', 'locations-product-sets-create', 'locations-product-sets-delete', 'locations-product-sets-get', 'locations-product-sets-import', 'locations-product-sets-list', 'locations-product-sets-patch', 'locations-product-sets-products-list', 'locations-product-sets-remove-product', 'locations-products-create', 'locations-products-delete', 'locations-products-get', 'locations-products-list', 'locations-products-patch', 'locations-products-purge', 'locations-products-reference-images-create', 'locations-products-reference-images-delete', 'locations-products-reference-images-get', 'locations-products-reference-images-list' and 'operations-get'", vec![ + ("files-annotate", + Some(r##"Service that performs image detection and annotation for a batch of files. + Now only "application/pdf", "image/tiff" and "image/gif" are supported. + + This service will extract at most 5 (customers can specify which 5 in + AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each + file provided and perform detection and annotation for each image + extracted."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_files-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("files-async-batch-annotate", + Some(r##"Run asynchronous image detection and annotation for a list of generic + files, such as PDF files, which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through the + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results)."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_files-async-batch-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("images-annotate", + Some(r##"Run image detection and annotation for a batch of images."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_images-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("images-async-batch-annotate", + Some(r##"Run asynchronous image detection and annotation for a list of images. + + Progress and results can be retrieved through the + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + + This service will write image annotation outputs to json files in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_images-async-batch-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-files-annotate", + Some(r##"Service that performs image detection and annotation for a batch of files. + Now only "application/pdf", "image/tiff" and "image/gif" are supported. + + This service will extract at most 5 (customers can specify which 5 in + AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each + file provided and perform detection and annotation for each image + extracted."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_locations-files-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-files-async-batch-annotate", + Some(r##"Run asynchronous image detection and annotation for a list of generic + files, such as PDF files, which may contain multiple pages and multiple + images per page. Progress and results can be retrieved through the + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results)."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_locations-files-async-batch-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-images-annotate", + Some(r##"Run image detection and annotation for a batch of images."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_locations-images-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-images-async-batch-annotate", + Some(r##"Run asynchronous image detection and annotation for a list of images. + + Progress and results can be retrieved through the + `google.longrunning.Operations` interface. + `Operation.metadata` contains `OperationMetadata` (metadata). + `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + + This service will write image annotation outputs to json files in customer + GCS bucket, each json file containing BatchAnnotateImagesResponse proto."##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_locations-images-async-batch-annotate", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Optional. Target project and location to make a call. + + Format: `projects/{project-id}/locations/{location-id}`. + + If no parent is specified, a region will be chosen automatically. + + Supported location-ids: + `us`: USA country only, + `asia`: East asia areas, like Japan, Taiwan, + `eu`: The European Union. + + Example: `projects/project-A/locations/eu`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("locations-operations-get", Some(r##"Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API @@ -2568,7 +3720,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name for the ProductSet to modify. + Some(r##"Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`"##), @@ -2604,7 +3756,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The project in which the ProductSet should be created. + Some(r##"Required. The project in which the ProductSet should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`."##), Some(true), @@ -2637,7 +3789,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the ProductSet to delete. + Some(r##"Required. Resource name of the ProductSet to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`"##), @@ -2666,10 +3818,10 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the ProductSet to get. + Some(r##"Required. Resource name of the ProductSet to get. Format is: - `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`"##), + `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`"##), Some(true), Some(false)), @@ -2701,7 +3853,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The project in which the ProductSets should be imported. + Some(r##"Required. The project in which the ProductSets should be imported. Format is `projects/PROJECT_ID/locations/LOC_ID`."##), Some(true), @@ -2736,7 +3888,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The project from which ProductSets should be listed. + Some(r##"Required. The project from which ProductSets should be listed. Format is `projects/PROJECT_ID/locations/LOC_ID`."##), Some(true), @@ -2806,7 +3958,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The ProductSet resource for which to retrieve Products. + Some(r##"Required. The ProductSet resource for which to retrieve Products. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`"##), @@ -2831,7 +3983,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name for the ProductSet to modify. + Some(r##"Required. The resource name for the ProductSet to modify. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`"##), @@ -2869,7 +4021,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The project in which the Product should be created. + Some(r##"Required. The project in which the Product should be created. Format is `projects/PROJECT_ID/locations/LOC_ID`."##), @@ -2904,7 +4056,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of product to delete. + Some(r##"Required. Resource name of product to delete. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`"##), @@ -2933,7 +4085,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Resource name of the Product to get. + Some(r##"Required. Resource name of the Product to get. Format is: `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`"##), @@ -2962,7 +4114,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"The project OR ProductSet from which Products should be listed. + Some(r##"Required. The project OR ProductSet from which Products should be listed. Format: `projects/PROJECT_ID/locations/LOC_ID`"##), @@ -3022,6 +4174,59 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-products-purge", + Some(r##"Asynchronous API to delete all Products in a ProductSet or all Products + that are in no ProductSet. + + If a Product is a member of the specified ProductSet in addition to other + ProductSets, the Product will still be deleted. + + It is recommended to not delete the specified ProductSet until after this + operation has completed. It is also recommended to not add any of the + Products involved in the batch delete to a new ProductSet while this + operation is running because those Products may still end up deleted. + + It's not possible to undo the PurgeProducts operation. Therefore, it is + recommended to keep the csv files used in ImportProductSets (if that was + how you originally built the Product Set) before starting PurgeProducts, in + case you need to re-import the data after deletion. + + If the plan is to purge all of the Products from a ProductSet and then + re-use the empty ProductSet to re-import new Products into the empty + ProductSet, you must wait until the PurgeProducts operation has finished + for that ProductSet. + + The google.longrunning.Operation API can be used to keep track of the + progress and results of the request. + `Operation.metadata` contains `BatchOperationMetadata`. (progress)"##), + "Details at http://byron.github.io/google-apis-rs/google_vision1_cli/projects_locations-products-purge", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The project and location in which the Products should be deleted. + + Format is `projects/PROJECT_ID/locations/LOC_ID`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3052,7 +4257,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Resource name of the product in which to create the reference image. + Some(r##"Required. Resource name of the product in which to create the reference image. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`."##), @@ -3089,7 +4294,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the reference image to delete. + Some(r##"Required. The resource name of the reference image to delete. Format is: @@ -3119,7 +4324,7 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the ReferenceImage to get. + Some(r##"Required. The resource name of the ReferenceImage to get. Format is: @@ -3151,7 +4356,7 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Resource name of the product containing the reference images. + Some(r##"Required. Resource name of the product containing the reference images. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`."##), @@ -3200,7 +4405,7 @@ fn main() { let mut app = App::new("vision1") .author("Sebastian Thiel ") - .version("1.0.12+20190628") + .version("1.0.13+20200329") .about("Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_vision1_cli") .arg(Arg::with_name("url") diff --git a/gen/vision1/Cargo.toml b/gen/vision1/Cargo.toml index 2737f649a9..84b3ca2ba9 100644 --- a/gen/vision1/Cargo.toml +++ b/gen/vision1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-vision1" -version = "1.0.12+20190628" +version = "1.0.13+20200329" authors = ["Sebastian Thiel "] description = "A complete library to interact with Vision (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/vision1" homepage = "https://cloud.google.com/vision/" -documentation = "https://docs.rs/google-vision1/1.0.12+20190628" +documentation = "https://docs.rs/google-vision1/1.0.13+20200329" license = "MIT" keywords = ["vision", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/vision1/README.md b/gen/vision1/README.md index 5b1dc3660b..b387847987 100644 --- a/gen/vision1/README.md +++ b/gen/vision1/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-vision1` library allows access to all features of the *Google Vision* service. -This documentation was generated from *Vision* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *vision:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *Vision* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *vision:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *Vision* *v1* API can be found at the [official documentation site](https://cloud.google.com/vision/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.Vision.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.Vision.html) ... * files - * [*annotate*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.FileAnnotateCall.html) and [*async batch annotate*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.FileAsyncBatchAnnotateCall.html) -* [images](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.Image.html) - * [*annotate*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ImageAnnotateCall.html) and [*async batch annotate*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ImageAsyncBatchAnnotateCall.html) + * [*annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.FileAnnotateCall.html) and [*async batch annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.FileAsyncBatchAnnotateCall.html) +* [images](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.Image.html) + * [*annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ImageAnnotateCall.html) and [*async batch annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ImageAsyncBatchAnnotateCall.html) * locations - * [*operations get*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.LocationOperationGetCall.html) -* [operations](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.OperationListCall.html) + * [*operations get*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.LocationOperationGetCall.html) +* [operations](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.OperationCancelCall.html), [*delete*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.OperationDeleteCall.html), [*get*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.OperationListCall.html) * projects - * [*locations operations get*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationOperationGetCall.html), [*locations product sets add product*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetAddProductCall.html), [*locations product sets create*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetCreateCall.html), [*locations product sets delete*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetDeleteCall.html), [*locations product sets get*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetGetCall.html), [*locations product sets import*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetImportCall.html), [*locations product sets list*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetListCall.html), [*locations product sets patch*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetPatchCall.html), [*locations product sets products list*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetProductListCall.html), [*locations product sets remove product*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductSetRemoveProductCall.html), [*locations products create*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductCreateCall.html), [*locations products delete*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductDeleteCall.html), [*locations products get*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductGetCall.html), [*locations products list*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductListCall.html), [*locations products patch*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductPatchCall.html), [*locations products reference images create*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductReferenceImageCreateCall.html), [*locations products reference images delete*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductReferenceImageDeleteCall.html), [*locations products reference images get*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductReferenceImageGetCall.html), [*locations products reference images list*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectLocationProductReferenceImageListCall.html) and [*operations get*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.ProjectOperationGetCall.html) + * [*files annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectFileAnnotateCall.html), [*files async batch annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectFileAsyncBatchAnnotateCall.html), [*images annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectImageAnnotateCall.html), [*images async batch annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectImageAsyncBatchAnnotateCall.html), [*locations files annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationFileAnnotateCall.html), [*locations files async batch annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationFileAsyncBatchAnnotateCall.html), [*locations images annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationImageAnnotateCall.html), [*locations images async batch annotate*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationImageAsyncBatchAnnotateCall.html), [*locations operations get*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationOperationGetCall.html), [*locations product sets add product*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetAddProductCall.html), [*locations product sets create*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetCreateCall.html), [*locations product sets delete*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetDeleteCall.html), [*locations product sets get*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetGetCall.html), [*locations product sets import*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetImportCall.html), [*locations product sets list*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetListCall.html), [*locations product sets patch*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetPatchCall.html), [*locations product sets products list*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetProductListCall.html), [*locations product sets remove product*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductSetRemoveProductCall.html), [*locations products create*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductCreateCall.html), [*locations products delete*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductDeleteCall.html), [*locations products get*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductGetCall.html), [*locations products list*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductListCall.html), [*locations products patch*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductPatchCall.html), [*locations products purge*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductPurgeCall.html), [*locations products reference images create*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductReferenceImageCreateCall.html), [*locations products reference images delete*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductReferenceImageDeleteCall.html), [*locations products reference images get*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductReferenceImageGetCall.html), [*locations products reference images list*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectLocationProductReferenceImageListCall.html) and [*operations get*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.ProjectOperationGetCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/struct.Vision.html)** +* **[Hub](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/struct.Vision.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.Part.html)** + * **[Parts](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -57,11 +57,16 @@ Or specifically ... ```ignore let r = hub.projects().operations_get(...).doit() let r = hub.operations().list(...).doit() -let r = hub.locations().operations_get(...).doit() +let r = hub.projects().files_async_batch_annotate(...).doit() let r = hub.images().async_batch_annotate(...).doit() +let r = hub.projects().images_async_batch_annotate(...).doit() +let r = hub.projects().locations_files_async_batch_annotate(...).doit() let r = hub.operations().cancel(...).doit() -let r = hub.operations().delete(...).doit() +let r = hub.locations().operations_get(...).doit() let r = hub.files().async_batch_annotate(...).doit() +let r = hub.operations().delete(...).doit() +let r = hub.projects().locations_images_async_batch_annotate(...).doit() +let r = hub.projects().locations_products_purge(...).doit() let r = hub.operations().get(...).doit() let r = hub.projects().locations_operations_get(...).doit() let r = hub.projects().locations_product_sets_import(...).doit() @@ -144,17 +149,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -164,29 +169,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-vision1/1.0.12+20190628/google_vision1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-vision1/1.0.13+20200329/google_vision1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/vision1/src/lib.rs b/gen/vision1/src/lib.rs index 207d0f77a1..3a09d6634d 100644 --- a/gen/vision1/src/lib.rs +++ b/gen/vision1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Vision* crate version *1.0.12+20190628*, where *20190628* is the exact revision of the *vision:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *Vision* crate version *1.0.13+20200329*, where *20200329* is the exact revision of the *vision:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *Vision* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/vision/). @@ -20,7 +20,7 @@ //! * [operations](struct.Operation.html) //! * [*cancel*](struct.OperationCancelCall.html), [*delete*](struct.OperationDeleteCall.html), [*get*](struct.OperationGetCall.html) and [*list*](struct.OperationListCall.html) //! * projects -//! * [*locations operations get*](struct.ProjectLocationOperationGetCall.html), [*locations product sets add product*](struct.ProjectLocationProductSetAddProductCall.html), [*locations product sets create*](struct.ProjectLocationProductSetCreateCall.html), [*locations product sets delete*](struct.ProjectLocationProductSetDeleteCall.html), [*locations product sets get*](struct.ProjectLocationProductSetGetCall.html), [*locations product sets import*](struct.ProjectLocationProductSetImportCall.html), [*locations product sets list*](struct.ProjectLocationProductSetListCall.html), [*locations product sets patch*](struct.ProjectLocationProductSetPatchCall.html), [*locations product sets products list*](struct.ProjectLocationProductSetProductListCall.html), [*locations product sets remove product*](struct.ProjectLocationProductSetRemoveProductCall.html), [*locations products create*](struct.ProjectLocationProductCreateCall.html), [*locations products delete*](struct.ProjectLocationProductDeleteCall.html), [*locations products get*](struct.ProjectLocationProductGetCall.html), [*locations products list*](struct.ProjectLocationProductListCall.html), [*locations products patch*](struct.ProjectLocationProductPatchCall.html), [*locations products reference images create*](struct.ProjectLocationProductReferenceImageCreateCall.html), [*locations products reference images delete*](struct.ProjectLocationProductReferenceImageDeleteCall.html), [*locations products reference images get*](struct.ProjectLocationProductReferenceImageGetCall.html), [*locations products reference images list*](struct.ProjectLocationProductReferenceImageListCall.html) and [*operations get*](struct.ProjectOperationGetCall.html) +//! * [*files annotate*](struct.ProjectFileAnnotateCall.html), [*files async batch annotate*](struct.ProjectFileAsyncBatchAnnotateCall.html), [*images annotate*](struct.ProjectImageAnnotateCall.html), [*images async batch annotate*](struct.ProjectImageAsyncBatchAnnotateCall.html), [*locations files annotate*](struct.ProjectLocationFileAnnotateCall.html), [*locations files async batch annotate*](struct.ProjectLocationFileAsyncBatchAnnotateCall.html), [*locations images annotate*](struct.ProjectLocationImageAnnotateCall.html), [*locations images async batch annotate*](struct.ProjectLocationImageAsyncBatchAnnotateCall.html), [*locations operations get*](struct.ProjectLocationOperationGetCall.html), [*locations product sets add product*](struct.ProjectLocationProductSetAddProductCall.html), [*locations product sets create*](struct.ProjectLocationProductSetCreateCall.html), [*locations product sets delete*](struct.ProjectLocationProductSetDeleteCall.html), [*locations product sets get*](struct.ProjectLocationProductSetGetCall.html), [*locations product sets import*](struct.ProjectLocationProductSetImportCall.html), [*locations product sets list*](struct.ProjectLocationProductSetListCall.html), [*locations product sets patch*](struct.ProjectLocationProductSetPatchCall.html), [*locations product sets products list*](struct.ProjectLocationProductSetProductListCall.html), [*locations product sets remove product*](struct.ProjectLocationProductSetRemoveProductCall.html), [*locations products create*](struct.ProjectLocationProductCreateCall.html), [*locations products delete*](struct.ProjectLocationProductDeleteCall.html), [*locations products get*](struct.ProjectLocationProductGetCall.html), [*locations products list*](struct.ProjectLocationProductListCall.html), [*locations products patch*](struct.ProjectLocationProductPatchCall.html), [*locations products purge*](struct.ProjectLocationProductPurgeCall.html), [*locations products reference images create*](struct.ProjectLocationProductReferenceImageCreateCall.html), [*locations products reference images delete*](struct.ProjectLocationProductReferenceImageDeleteCall.html), [*locations products reference images get*](struct.ProjectLocationProductReferenceImageGetCall.html), [*locations products reference images list*](struct.ProjectLocationProductReferenceImageListCall.html) and [*operations get*](struct.ProjectOperationGetCall.html) //! //! //! @@ -57,11 +57,16 @@ //! ```ignore //! let r = hub.projects().operations_get(...).doit() //! let r = hub.operations().list(...).doit() -//! let r = hub.locations().operations_get(...).doit() +//! let r = hub.projects().files_async_batch_annotate(...).doit() //! let r = hub.images().async_batch_annotate(...).doit() +//! let r = hub.projects().images_async_batch_annotate(...).doit() +//! let r = hub.projects().locations_files_async_batch_annotate(...).doit() //! let r = hub.operations().cancel(...).doit() -//! let r = hub.operations().delete(...).doit() +//! let r = hub.locations().operations_get(...).doit() //! let r = hub.files().async_batch_annotate(...).doit() +//! let r = hub.operations().delete(...).doit() +//! let r = hub.projects().locations_images_async_batch_annotate(...).doit() +//! let r = hub.projects().locations_products_purge(...).doit() //! let r = hub.operations().get(...).doit() //! let r = hub.projects().locations_operations_get(...).doit() //! let r = hub.projects().locations_product_sets_import(...).doit() @@ -344,7 +349,7 @@ impl<'a, C, A> Vision Vision { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://vision.googleapis.com/".to_string(), _root_url: "https://vision.googleapis.com/".to_string(), } @@ -367,7 +372,7 @@ impl<'a, C, A> Vision } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -402,15 +407,30 @@ impl<'a, C, A> Vision /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [locations images async batch annotate projects](struct.ProjectLocationImageAsyncBatchAnnotateCall.html) (request) /// * [async batch annotate images](struct.ImageAsyncBatchAnnotateCall.html) (request) +/// * [images async batch annotate projects](struct.ProjectImageAsyncBatchAnnotateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AsyncBatchAnnotateImagesRequest { /// Required. The desired output location and metadata (e.g. format). #[serde(rename="outputConfig")] pub output_config: Option, - /// Individual image annotation requests for this batch. + /// Required. Individual image annotation requests for this batch. pub requests: Option>, + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + pub parent: Option, } impl RequestValue for AsyncBatchAnnotateImagesRequest {} @@ -427,7 +447,7 @@ impl RequestValue for AsyncBatchAnnotateImagesRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AddProductToProductSetRequest { - /// The resource name for the Product to be added to this ProductSet. + /// Required. The resource name for the Product to be added to this ProductSet. /// /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` @@ -525,7 +545,7 @@ pub struct Paragraph { pub confidence: Option, /// Additional information detected for the paragraph. pub property: Option, - /// List of words in this paragraph. + /// List of all words in this paragraph. pub words: Option>, } @@ -540,11 +560,26 @@ impl Part for Paragraph {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [annotate images](struct.ImageAnnotateCall.html) (request) +/// * [images annotate projects](struct.ProjectImageAnnotateCall.html) (request) +/// * [locations images annotate projects](struct.ProjectLocationImageAnnotateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchAnnotateImagesRequest { - /// Individual image annotation requests for this batch. + /// Required. Individual image annotation requests for this batch. pub requests: Option>, + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + pub parent: Option, } impl RequestValue for BatchAnnotateImagesRequest {} @@ -588,6 +623,28 @@ pub struct TextAnnotation { impl Part for TextAnnotation {} +/// Prediction for what the object in the bounding box is. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObjectAnnotation { + /// The BCP-47 language code, such as "en-US" or "sr-Latn". For more + /// information, see + /// http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + #[serde(rename="languageCode")] + pub language_code: Option, + /// Score of the result. Range [0, 1]. + pub score: Option, + /// Object ID that should align with EntityAnnotation mid. + pub mid: Option, + /// Object name, expressed in its `language_code` language. + pub name: Option, +} + +impl Part for ObjectAnnotation {} + + /// Stores image properties, such as dominant colors. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -609,13 +666,28 @@ impl Part for ImageProperties {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [files annotate projects](struct.ProjectFileAnnotateCall.html) (request) /// * [annotate files](struct.FileAnnotateCall.html) (request) +/// * [locations files annotate projects](struct.ProjectLocationFileAnnotateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchAnnotateFilesRequest { - /// The list of file annotation requests. Right now we support only one + /// Required. The list of file annotation requests. Right now we support only one /// AnnotateFileRequest in BatchAnnotateFilesRequest. pub requests: Option>, + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + pub parent: Option, } impl RequestValue for BatchAnnotateFilesRequest {} @@ -628,6 +700,9 @@ impl RequestValue for BatchAnnotateFilesRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GroupedResult { + /// List of generic predictions for the object in the bounding box. + #[serde(rename="objectAnnotations")] + pub object_annotations: Option>, /// List of results, one for each product match. pub results: Option>, /// The bounding polygon around the product detected in the query image. @@ -676,21 +751,6 @@ pub struct ResultType { impl Part for ResultType {} -/// The request message for Operations.CancelOperation. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [cancel operations](struct.OperationCancelCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CancelOperationRequest { _never_set: Option } - -impl RequestValue for CancelOperationRequest {} - - /// A request to annotate one single file, e.g. a PDF, TIFF or GIF file. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -741,12 +801,12 @@ pub struct ProductSearchParams { /// "color: red" is not acceptable because it uses a ':' instead of an '='. pub filter: Option, /// The list of product categories to search in. Currently, we only consider - /// the first category, and either "homegoods-v2", "apparel-v2", or "toys-v2" - /// should be specified. The legacy categories "homegoods", "apparel", and - /// "toys" are still supported but will be deprecated. For new products, please - /// use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search - /// accuracy. It is recommended to migrate existing products to these - /// categories as well. + /// the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", + /// "packagedgoods-v1", or "general-v1" should be specified. The legacy + /// categories "homegoods", "apparel", and "toys" are still supported but will + /// be deprecated. For new products, please use "homegoods-v2", "apparel-v2", + /// or "toys-v2" for better product search accuracy. It is recommended to + /// migrate existing products to these categories as well. #[serde(rename="productCategories")] pub product_categories: Option>, /// The resource name of a ProductSet to be searched for similar images. @@ -756,7 +816,7 @@ pub struct ProductSearchParams { #[serde(rename="productSet")] pub product_set: Option, /// The bounding polygon around the area of interest in the image. - /// Optional. If it is not specified, system discretion will be applied. + /// If it is not specified, system discretion will be applied. #[serde(rename="boundingPoly")] pub bounding_poly: Option, } @@ -790,25 +850,6 @@ pub struct Status { impl Part for Status {} -/// A 3D position in the image, used primarily for Face detection landmarks. -/// A valid Position must have both x and y coordinates. -/// The position coordinates are in the same scale as the original image. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Position { - /// Y coordinate. - pub y: Option, - /// X coordinate. - pub x: Option, - /// Z coordinate (or depth). - pub z: Option, -} - -impl Part for Position {} - - /// Additional information detected on the structural component. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -872,6 +913,30 @@ pub struct Block { impl Part for Block {} +/// The type of Google Cloud Vision API detection to perform, and the maximum +/// number of results to return for that type. Multiple `Feature` objects can +/// be specified in the `features` list. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Feature { + /// Model to use for the feature. + /// Supported values: "builtin/stable" (the default if unset) and + /// "builtin/latest". + pub model: Option, + /// The feature type. + #[serde(rename="type")] + pub type_: Option, + /// Maximum number of results of this type. Does not apply to + /// `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + #[serde(rename="maxResults")] + pub max_results: Option, +} + +impl Part for Feature {} + + /// Response message for the `ListReferenceImages` method. /// /// # Activities @@ -951,28 +1016,23 @@ pub struct NormalizedVertex { impl Part for NormalizedVertex {} -/// The type of Google Cloud Vision API detection to perform, and the maximum -/// number of results to return for that type. Multiple `Feature` objects can -/// be specified in the `features` list. +/// Request for performing Google Cloud Vision API tasks over a user-provided +/// image, with user-requested features, and with context information. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Feature { - /// Model to use for the feature. - /// Supported values: "builtin/stable" (the default if unset) and - /// "builtin/latest". - pub model: Option, - /// The feature type. - #[serde(rename="type")] - pub type_: Option, - /// Maximum number of results of this type. Does not apply to - /// `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - #[serde(rename="maxResults")] - pub max_results: Option, +pub struct AnnotateImageRequest { + /// Additional context that may accompany the image. + #[serde(rename="imageContext")] + pub image_context: Option, + /// The image to be processed. + pub image: Option, + /// Requested features. + pub features: Option>, } -impl Part for Feature {} +impl Part for AnnotateImageRequest {} /// Set of crop hints that are used to generate new crops when serving images. @@ -1050,36 +1110,6 @@ pub struct WebDetectionParams { impl Part for WebDetectionParams {} -/// Set of features pertaining to the image, computed by computer vision -/// methods over safe-search verticals (for example, adult, spoof, medical, -/// violence). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SafeSearchAnnotation { - /// Likelihood that this is a medical image. - pub medical: Option, - /// Likelihood that this image contains violent content. - pub violence: Option, - /// Spoof likelihood. The likelihood that an modification - /// was made to the image's canonical version to make it appear - /// funny or offensive. - pub spoof: Option, - /// Likelihood that the request image contains racy content. Racy content may - /// include (but is not limited to) skimpy or sheer clothing, strategically - /// covered nudity, lewd or provocative poses, or close-ups of sensitive - /// body areas. - pub racy: Option, - /// Represents the adult content likelihood for the image. Adult content may - /// contain elements such as nudity, pornographic images or cartoons, or - /// sexual activities. - pub adult: Option, -} - -impl Part for SafeSearchAnnotation {} - - /// Metadata for online images. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1116,7 +1146,11 @@ pub struct Product { /// to be supported soon. /// /// Multiple values can be assigned to the same key. One product may have up to - /// 100 product_labels. + /// 500 product_labels. + /// + /// Notice that the total number of distinct product_labels over all products + /// in one ProductSet cannot exceed 1M, otherwise the product search pipeline + /// will refuse to work for that ProductSet. #[serde(rename="productLabels")] pub product_labels: Option>, /// The user-provided name for this Product. Must not be empty. Must be at most @@ -1126,12 +1160,10 @@ pub struct Product { /// User-provided metadata to be stored with this product. Must be at most 4096 /// characters long. pub description: Option, - /// The category for the product identified by the reference image. This should + /// Immutable. The category for the product identified by the reference image. This should /// be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories /// "homegoods", "apparel", and "toys" are still supported, but these should /// not be used for new products. - /// - /// This field is immutable. #[serde(rename="productCategory")] pub product_category: Option, /// The resource name of the product. @@ -1147,6 +1179,67 @@ impl RequestValue for Product {} impl ResponseResult for Product {} +/// Set of features pertaining to the image, computed by computer vision +/// methods over safe-search verticals (for example, adult, spoof, medical, +/// violence). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SafeSearchAnnotation { + /// Likelihood that this is a medical image. + pub medical: Option, + /// Likelihood that this image contains violent content. + pub violence: Option, + /// Spoof likelihood. The likelihood that an modification + /// was made to the image's canonical version to make it appear + /// funny or offensive. + pub spoof: Option, + /// Likelihood that the request image contains racy content. Racy content may + /// include (but is not limited to) skimpy or sheer clothing, strategically + /// covered nudity, lewd or provocative poses, or close-ups of sensitive + /// body areas. + pub racy: Option, + /// Represents the adult content likelihood for the image. Adult content may + /// contain elements such as nudity, pornographic images or cartoons, or + /// sexual activities. + pub adult: Option, +} + +impl Part for SafeSearchAnnotation {} + + +/// The request message for Operations.CancelOperation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [cancel operations](struct.OperationCancelCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CancelOperationRequest { _never_set: Option } + +impl RequestValue for CancelOperationRequest {} + + +/// Config to control which ProductSet contains the Products to be deleted. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProductSetPurgeConfig { + /// The ProductSet that contains the Products to delete. If a Product is a + /// member of product_set_id in addition to other ProductSets, the Product will + /// still be deleted. + #[serde(rename="productSetId")] + pub product_set_id: Option, +} + +impl Part for ProductSetPurgeConfig {} + + /// Color information consists of RGB channels, score, and the fraction of /// the image that the color occupies in the image. /// @@ -1374,6 +1467,25 @@ pub struct Landmark { impl Part for Landmark {} +/// A 3D position in the image, used primarily for Face detection landmarks. +/// A valid Position must have both x and y coordinates. +/// The position coordinates are in the same scale as the original image. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Position { + /// Y coordinate. + pub y: Option, + /// X coordinate. + pub x: Option, + /// Z coordinate (or depth). + pub z: Option, +} + +impl Part for Position {} + + /// Request message for the `ImportProductSets` method. /// /// # Activities @@ -1385,7 +1497,7 @@ impl Part for Landmark {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ImportProductSetsRequest { - /// The input content for the list of requests. + /// Required. The input content for the list of requests. #[serde(rename="inputConfig")] pub input_config: Option, } @@ -1418,11 +1530,16 @@ impl Part for ImportProductSetsInputConfig {} /// /// * [operations get projects](struct.ProjectOperationGetCall.html) (response) /// * [list operations](struct.OperationListCall.html) (none) -/// * [operations get locations](struct.LocationOperationGetCall.html) (response) +/// * [files async batch annotate projects](struct.ProjectFileAsyncBatchAnnotateCall.html) (response) /// * [async batch annotate images](struct.ImageAsyncBatchAnnotateCall.html) (response) +/// * [images async batch annotate projects](struct.ProjectImageAsyncBatchAnnotateCall.html) (response) +/// * [locations files async batch annotate projects](struct.ProjectLocationFileAsyncBatchAnnotateCall.html) (response) /// * [cancel operations](struct.OperationCancelCall.html) (none) -/// * [delete operations](struct.OperationDeleteCall.html) (none) +/// * [operations get locations](struct.LocationOperationGetCall.html) (response) /// * [async batch annotate files](struct.FileAsyncBatchAnnotateCall.html) (response) +/// * [delete operations](struct.OperationDeleteCall.html) (none) +/// * [locations images async batch annotate projects](struct.ProjectLocationImageAsyncBatchAnnotateCall.html) (response) +/// * [locations products purge projects](struct.ProjectLocationProductPurgeCall.html) (response) /// * [get operations](struct.OperationGetCall.html) (response) /// * [locations operations get projects](struct.ProjectLocationOperationGetCall.html) (response) /// * [locations product sets import projects](struct.ProjectLocationProductSetImportCall.html) (response) @@ -1544,6 +1661,8 @@ impl Part for ImportProductSetsGcsSource {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [annotate images](struct.ImageAnnotateCall.html) (response) +/// * [images annotate projects](struct.ProjectImageAnnotateCall.html) (response) +/// * [locations images annotate projects](struct.ProjectLocationImageAnnotateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchAnnotateImagesResponse { @@ -1607,7 +1726,7 @@ impl Part for LatLongRect {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RemoveProductFromProductSetRequest { - /// The resource name for the Product to be removed from this ProductSet. + /// Required. The resource name for the Product to be removed from this ProductSet. /// /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` @@ -1683,7 +1802,9 @@ impl Part for GcsDestination {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [files annotate projects](struct.ProjectFileAnnotateCall.html) (response) /// * [annotate files](struct.FileAnnotateCall.html) (response) +/// * [locations files annotate projects](struct.ProjectLocationFileAnnotateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BatchAnnotateFilesResponse { @@ -1739,12 +1860,27 @@ impl Part for LocationInfo {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// +/// * [files async batch annotate projects](struct.ProjectFileAsyncBatchAnnotateCall.html) (request) /// * [async batch annotate files](struct.FileAsyncBatchAnnotateCall.html) (request) +/// * [locations files async batch annotate projects](struct.ProjectLocationFileAsyncBatchAnnotateCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AsyncBatchAnnotateFilesRequest { - /// Individual async file annotation requests for this batch. + /// Required. Individual async file annotation requests for this batch. pub requests: Option>, + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + pub parent: Option, } impl RequestValue for AsyncBatchAnnotateFilesRequest {} @@ -1952,7 +2088,7 @@ pub struct Symbol { /// 2----3 /// | | /// 1----0 - /// and the vertice order will still be (0, 1, 2, 3). + /// and the vertex order will still be (0, 1, 2, 3). #[serde(rename="boundingBox")] pub bounding_box: Option, /// The actual UTF-8 representation of the symbol. @@ -2058,25 +2194,6 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// Request for performing Google Cloud Vision API tasks over a user-provided -/// image, with user-requested features, and with context information. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AnnotateImageRequest { - /// Additional context that may accompany the image. - #[serde(rename="imageContext")] - pub image_context: Option, - /// The image to be processed. - pub image: Option, - /// Requested features. - pub features: Option>, -} - -impl Part for AnnotateImageRequest {} - - /// Results for a product search request. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2122,47 +2239,30 @@ pub struct CropHint { impl Part for CropHint {} -/// A `ReferenceImage` represents a product image and its associated metadata, -/// such as bounding boxes. +/// Request message for the `PurgeProducts` method. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [locations products reference images get projects](struct.ProjectLocationProductReferenceImageGetCall.html) (response) -/// * [locations products reference images create projects](struct.ProjectLocationProductReferenceImageCreateCall.html) (request|response) +/// * [locations products purge projects](struct.ProjectLocationProductPurgeCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReferenceImage { - /// Bounding polygons around the areas of interest in the reference image. - /// Optional. If this field is empty, the system will try to detect regions of - /// interest. At most 10 bounding polygons will be used. - /// - /// The provided shape is converted into a non-rotated rectangle. Once - /// converted, the small edge of the rectangle must be greater than or equal - /// to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 - /// is not). - #[serde(rename="boundingPolys")] - pub bounding_polys: Option>, - /// The resource name of the reference image. - /// - /// Format is: - /// - /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - /// - /// This field is ignored when creating a reference image. - pub name: Option, - /// The Google Cloud Storage URI of the reference image. - /// - /// The URI must start with `gs://`. - /// - /// Required. - pub uri: Option, +pub struct PurgeProductsRequest { + /// If delete_orphan_products is true, all Products that are not in any + /// ProductSet will be deleted. + #[serde(rename="deleteOrphanProducts")] + pub delete_orphan_products: Option, + /// The default value is false. Override this value to true to actually perform + /// the purge. + pub force: Option, + /// Specify which ProductSet contains the Products to be deleted. + #[serde(rename="productSetPurgeConfig")] + pub product_set_purge_config: Option, } -impl RequestValue for ReferenceImage {} -impl ResponseResult for ReferenceImage {} +impl RequestValue for PurgeProductsRequest {} /// Image context and/or feature-specific parameters. @@ -2198,6 +2298,47 @@ pub struct ImageContext { impl Part for ImageContext {} +/// A `ReferenceImage` represents a product image and its associated metadata, +/// such as bounding boxes. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations products reference images get projects](struct.ProjectLocationProductReferenceImageGetCall.html) (response) +/// * [locations products reference images create projects](struct.ProjectLocationProductReferenceImageCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReferenceImage { + /// Optional. Bounding polygons around the areas of interest in the reference image. + /// If this field is empty, the system will try to detect regions of + /// interest. At most 10 bounding polygons will be used. + /// + /// The provided shape is converted into a non-rotated rectangle. Once + /// converted, the small edge of the rectangle must be greater than or equal + /// to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 + /// is not). + #[serde(rename="boundingPolys")] + pub bounding_polys: Option>, + /// The resource name of the reference image. + /// + /// Format is: + /// + /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + /// + /// This field is ignored when creating a reference image. + pub name: Option, + /// Required. The Google Cloud Storage URI of the reference image. + /// + /// The URI must start with `gs://`. + pub uri: Option, +} + +impl RequestValue for ReferenceImage {} +impl ResponseResult for ReferenceImage {} + + /// Detected page from OCR. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2487,10 +2628,14 @@ pub struct AnnotateFileResponse { /// This field gives the total number of pages in the file. #[serde(rename="totalPages")] pub total_pages: Option, + /// If set, represents the error message for the failed request. The + /// `responses` field will not be set in this case. + pub error: Option, /// Information about the file for which this response is generated. #[serde(rename="inputConfig")] pub input_config: Option, - /// Individual responses to images found within the file. + /// Individual responses to images found within the file. This field will be + /// empty if the `error` field is set. pub responses: Option>, } @@ -2572,16 +2717,15 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a long-running operation. This method indicates that the client is - /// no longer interested in the operation result. It does not cancel the - /// operation. If the server doesn't support this method, it returns - /// `google.rpc.Code.UNIMPLEMENTED`. + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. /// /// # Arguments /// - /// * `name` - The name of the operation resource to be deleted. - pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { - OperationDeleteCall { + /// * `name` - The name of the operation resource. + pub fn get(&self, name: &str) -> OperationGetCall<'a, C, A> { + OperationGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -2592,15 +2736,16 @@ impl<'a, C, A> OperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the latest state of a long-running operation. Clients can use this - /// method to poll the operation result at intervals as recommended by the API - /// service. + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. /// /// # Arguments /// - /// * `name` - The name of the operation resource. - pub fn get(&self, name: &str) -> OperationGetCall<'a, C, A> { - OperationGetCall { + /// * `name` - The name of the operation resource to be deleted. + pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C, A> { + OperationDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -2896,7 +3041,7 @@ impl<'a, C, A> LocationMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `locations_operations_get(...)`, `locations_product_sets_add_product(...)`, `locations_product_sets_create(...)`, `locations_product_sets_delete(...)`, `locations_product_sets_get(...)`, `locations_product_sets_import(...)`, `locations_product_sets_list(...)`, `locations_product_sets_patch(...)`, `locations_product_sets_products_list(...)`, `locations_product_sets_remove_product(...)`, `locations_products_create(...)`, `locations_products_delete(...)`, `locations_products_get(...)`, `locations_products_list(...)`, `locations_products_patch(...)`, `locations_products_reference_images_create(...)`, `locations_products_reference_images_delete(...)`, `locations_products_reference_images_get(...)`, `locations_products_reference_images_list(...)` and `operations_get(...)` +/// // like `files_annotate(...)`, `files_async_batch_annotate(...)`, `images_annotate(...)`, `images_async_batch_annotate(...)`, `locations_files_annotate(...)`, `locations_files_async_batch_annotate(...)`, `locations_images_annotate(...)`, `locations_images_async_batch_annotate(...)`, `locations_operations_get(...)`, `locations_product_sets_add_product(...)`, `locations_product_sets_create(...)`, `locations_product_sets_delete(...)`, `locations_product_sets_get(...)`, `locations_product_sets_import(...)`, `locations_product_sets_list(...)`, `locations_product_sets_patch(...)`, `locations_product_sets_products_list(...)`, `locations_product_sets_remove_product(...)`, `locations_products_create(...)`, `locations_products_delete(...)`, `locations_products_get(...)`, `locations_products_list(...)`, `locations_products_patch(...)`, `locations_products_purge(...)`, `locations_products_reference_images_create(...)`, `locations_products_reference_images_delete(...)`, `locations_products_reference_images_get(...)`, `locations_products_reference_images_list(...)` and `operations_get(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -2911,6 +3056,66 @@ impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} impl<'a, C, A> ProjectMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Run image detection and annotation for a batch of images. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn locations_images_annotate(&self, request: BatchAnnotateImagesRequest, parent: &str) -> ProjectLocationImageAnnotateCall<'a, C, A> { + ProjectLocationImageAnnotateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Run asynchronous image detection and annotation for a list of images. + /// + /// Progress and results can be retrieved through the + /// `google.longrunning.Operations` interface. + /// `Operation.metadata` contains `OperationMetadata` (metadata). + /// `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + /// + /// This service will write image annotation outputs to json files in customer + /// GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn images_async_batch_annotate(&self, request: AsyncBatchAnnotateImagesRequest, parent: &str) -> ProjectImageAsyncBatchAnnotateCall<'a, C, A> { + ProjectImageAsyncBatchAnnotateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets information associated with a Product. @@ -2921,7 +3126,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the Product to get. + /// * `name` - Required. Resource name of the Product to get. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` pub fn locations_products_get(&self, name: &str) -> ProjectLocationProductGetCall<'a, C, A> { @@ -2944,7 +3149,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of product to delete. + /// * `name` - Required. Resource name of product to delete. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` pub fn locations_products_delete(&self, name: &str) -> ProjectLocationProductDeleteCall<'a, C, A> { @@ -2957,6 +3162,32 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Run image detection and annotation for a batch of images. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn images_annotate(&self, request: BatchAnnotateImagesRequest, parent: &str) -> ProjectImageAnnotateCall<'a, C, A> { + ProjectImageAnnotateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists the Products in a ProductSet, in an unspecified order. If the @@ -2969,7 +3200,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The ProductSet resource for which to retrieve Products. + /// * `name` - Required. The ProductSet resource for which to retrieve Products. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` pub fn locations_product_sets_products_list(&self, name: &str) -> ProjectLocationProductSetProductListCall<'a, C, A> { @@ -3003,6 +3234,49 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Asynchronous API to delete all Products in a ProductSet or all Products + /// that are in no ProductSet. + /// + /// If a Product is a member of the specified ProductSet in addition to other + /// ProductSets, the Product will still be deleted. + /// + /// It is recommended to not delete the specified ProductSet until after this + /// operation has completed. It is also recommended to not add any of the + /// Products involved in the batch delete to a new ProductSet while this + /// operation is running because those Products may still end up deleted. + /// + /// It's not possible to undo the PurgeProducts operation. Therefore, it is + /// recommended to keep the csv files used in ImportProductSets (if that was + /// how you originally built the Product Set) before starting PurgeProducts, in + /// case you need to re-import the data after deletion. + /// + /// If the plan is to purge all of the Products from a ProductSet and then + /// re-use the empty ProductSet to re-import new Products into the empty + /// ProductSet, you must wait until the PurgeProducts operation has finished + /// for that ProductSet. + /// + /// The google.longrunning.Operation API can be used to keep track of the + /// progress and results of the request. + /// `Operation.metadata` contains `BatchOperationMetadata`. (progress) + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The project and location in which the Products should be deleted. + /// Format is `projects/PROJECT_ID/locations/LOC_ID`. + pub fn locations_products_purge(&self, request: PurgeProductsRequest, parent: &str) -> ProjectLocationProductPurgeCall<'a, C, A> { + ProjectLocationProductPurgeCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Permanently deletes a ProductSet. Products and ReferenceImages in the @@ -3012,7 +3286,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Resource name of the ProductSet to delete. + /// * `name` - Required. Resource name of the ProductSet to delete. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` pub fn locations_product_sets_delete(&self, name: &str) -> ProjectLocationProductSetDeleteCall<'a, C, A> { @@ -3032,7 +3306,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name for the ProductSet to modify. + /// * `name` - Required. The resource name for the ProductSet to modify. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` pub fn locations_product_sets_remove_product(&self, request: RemoveProductFromProductSetRequest, name: &str) -> ProjectLocationProductSetRemoveProductCall<'a, C, A> { @@ -3048,23 +3322,52 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists products in an unspecified order. - /// - /// Possible errors: - /// - /// * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + /// Run asynchronous image detection and annotation for a list of generic + /// files, such as PDF files, which may contain multiple pages and multiple + /// images per page. Progress and results can be retrieved through the + /// `google.longrunning.Operations` interface. + /// `Operation.metadata` contains `OperationMetadata` (metadata). + /// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). /// /// # Arguments /// - /// * `parent` - The project OR ProductSet from which Products should be listed. - /// Format: - /// `projects/PROJECT_ID/locations/LOC_ID` - pub fn locations_products_list(&self, parent: &str) -> ProjectLocationProductListCall<'a, C, A> { - ProjectLocationProductListCall { + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn files_async_batch_annotate(&self, request: AsyncBatchAnnotateFilesRequest, parent: &str) -> ProjectFileAsyncBatchAnnotateCall<'a, C, A> { + ProjectFileAsyncBatchAnnotateCall { hub: self.hub, + _request: request, _parent: parent.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets information associated with a ProductSet. + /// + /// Possible errors: + /// + /// * Returns NOT_FOUND if the ProductSet does not exist. + /// + /// # Arguments + /// + /// * `name` - Required. Resource name of the ProductSet to get. + /// Format is: + /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + pub fn locations_product_sets_get(&self, name: &str) -> ProjectLocationProductSetGetCall<'a, C, A> { + ProjectLocationProductSetGetCall { + hub: self.hub, + _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3104,7 +3407,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The project in which the Product should be created. + /// * `parent` - Required. The project in which the Product should be created. /// Format is /// `projects/PROJECT_ID/locations/LOC_ID`. pub fn locations_products_create(&self, request: Product, parent: &str) -> ProjectLocationProductCreateCall<'a, C, A> { @@ -3121,21 +3424,54 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets information associated with a ProductSet. + /// Lists products in an unspecified order. /// /// Possible errors: /// - /// * Returns NOT_FOUND if the ProductSet does not exist. + /// * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. /// /// # Arguments /// - /// * `name` - Resource name of the ProductSet to get. - /// Format is: - /// `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - pub fn locations_product_sets_get(&self, name: &str) -> ProjectLocationProductSetGetCall<'a, C, A> { - ProjectLocationProductSetGetCall { + /// * `parent` - Required. The project OR ProductSet from which Products should be listed. + /// Format: + /// `projects/PROJECT_ID/locations/LOC_ID` + pub fn locations_products_list(&self, parent: &str) -> ProjectLocationProductListCall<'a, C, A> { + ProjectLocationProductListCall { hub: self.hub, - _name: name.to_string(), + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Run asynchronous image detection and annotation for a list of generic + /// files, such as PDF files, which may contain multiple pages and multiple + /// images per page. Progress and results can be retrieved through the + /// `google.longrunning.Operations` interface. + /// `Operation.metadata` contains `OperationMetadata` (metadata). + /// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn locations_files_async_batch_annotate(&self, request: AsyncBatchAnnotateFilesRequest, parent: &str) -> ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> { + ProjectLocationFileAsyncBatchAnnotateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3154,7 +3490,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The project in which the ProductSet should be created. + /// * `parent` - Required. The project in which the ProductSet should be created. /// Format is `projects/PROJECT_ID/locations/LOC_ID`. pub fn locations_product_sets_create(&self, request: ProductSet, parent: &str) -> ProjectLocationProductSetCreateCall<'a, C, A> { ProjectLocationProductSetCreateCall { @@ -3168,6 +3504,38 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Service that performs image detection and annotation for a batch of files. + /// Now only "application/pdf", "image/tiff" and "image/gif" are supported. + /// + /// This service will extract at most 5 (customers can specify which 5 in + /// AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each + /// file provided and perform detection and annotation for each image + /// extracted. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn locations_files_annotate(&self, request: BatchAnnotateFilesRequest, parent: &str) -> ProjectLocationFileAnnotateCall<'a, C, A> { + ProjectLocationFileAnnotateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Adds a Product to the specified ProductSet. If the Product is already @@ -3182,7 +3550,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name for the ProductSet to modify. + /// * `name` - Required. The resource name for the ProductSet to modify. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` pub fn locations_product_sets_add_product(&self, request: AddProductToProductSetRequest, name: &str) -> ProjectLocationProductSetAddProductCall<'a, C, A> { @@ -3213,7 +3581,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - The project in which the ProductSets should be imported. + /// * `parent` - Required. The project in which the ProductSets should be imported. /// Format is `projects/PROJECT_ID/locations/LOC_ID`. pub fn locations_product_sets_import(&self, request: ImportProductSetsRequest, parent: &str) -> ProjectLocationProductSetImportCall<'a, C, A> { ProjectLocationProductSetImportCall { @@ -3226,6 +3594,38 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Service that performs image detection and annotation for a batch of files. + /// Now only "application/pdf", "image/tiff" and "image/gif" are supported. + /// + /// This service will extract at most 5 (customers can specify which 5 in + /// AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each + /// file provided and perform detection and annotation for each image + /// extracted. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn files_annotate(&self, request: BatchAnnotateFilesRequest, parent: &str) -> ProjectFileAnnotateCall<'a, C, A> { + ProjectFileAnnotateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Makes changes to a Product resource. @@ -3304,7 +3704,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - The project from which ProductSets should be listed. + /// * `parent` - Required. The project from which ProductSets should be listed. /// Format is `projects/PROJECT_ID/locations/LOC_ID`. pub fn locations_product_sets_list(&self, parent: &str) -> ProjectLocationProductSetListCall<'a, C, A> { ProjectLocationProductSetListCall { @@ -3318,6 +3718,40 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Run asynchronous image detection and annotation for a list of images. + /// + /// Progress and results can be retrieved through the + /// `google.longrunning.Operations` interface. + /// `Operation.metadata` contains `OperationMetadata` (metadata). + /// `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + /// + /// This service will write image annotation outputs to json files in customer + /// GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Optional. Target project and location to make a call. + /// Format: `projects/{project-id}/locations/{location-id}`. + /// If no parent is specified, a region will be chosen automatically. + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// Example: `projects/project-A/locations/eu`. + pub fn locations_images_async_batch_annotate(&self, request: AsyncBatchAnnotateImagesRequest, parent: &str) -> ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> { + ProjectLocationImageAsyncBatchAnnotateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates and returns a new ReferenceImage resource. @@ -3343,7 +3777,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `parent` - Resource name of the product in which to create the reference image. + /// * `parent` - Required. Resource name of the product in which to create the reference image. /// Format is /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. pub fn locations_products_reference_images_create(&self, request: ReferenceImage, parent: &str) -> ProjectLocationProductReferenceImageCreateCall<'a, C, A> { @@ -3370,7 +3804,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the reference image to delete. + /// * `name` - Required. The resource name of the reference image to delete. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` pub fn locations_products_reference_images_delete(&self, name: &str) -> ProjectLocationProductReferenceImageDeleteCall<'a, C, A> { @@ -3393,7 +3827,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the ReferenceImage to get. + /// * `name` - Required. The resource name of the ReferenceImage to get. /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. pub fn locations_products_reference_images_get(&self, name: &str) -> ProjectLocationProductReferenceImageGetCall<'a, C, A> { @@ -3418,7 +3852,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Resource name of the product containing the reference images. + /// * `parent` - Required. Resource name of the product containing the reference images. /// Format is /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. pub fn locations_products_reference_images_list(&self, parent: &str) -> ProjectLocationProductReferenceImageListCall<'a, C, A> { @@ -3735,6 +4169,256 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: } +/// Gets the latest state of a long-running operation. Clients can use this +/// method to poll the operation result at intervals as recommended by the API +/// service. +/// +/// A builder for the *get* method supported by a *operation* resource. +/// It is not used directly, but through a `OperationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vision1 as vision1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vision1::Vision; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.operations().get("name") +/// .doit(); +/// # } +/// ``` +pub struct OperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _name: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OperationGetCall<'a, C, A> {} + +impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.operations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+name}"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the operation resource. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OperationGetCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Deletes a long-running operation. This method indicates that the client is /// no longer interested in the operation result. It does not cancel the /// operation. If the server doesn't support this method, it returns @@ -3986,256 +4670,6 @@ impl<'a, C, A> OperationDeleteCall<'a, C, A> where C: BorrowMut, } -/// Gets the latest state of a long-running operation. Clients can use this -/// method to poll the operation result at intervals as recommended by the API -/// service. -/// -/// A builder for the *get* method supported by a *operation* resource. -/// It is not used directly, but through a `OperationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_vision1 as vision1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use vision1::Vision; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.operations().get("name") -/// .doit(); -/// # } -/// ``` -pub struct OperationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Vision, - _name: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OperationGetCall<'a, C, A> {} - -impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "vision.operations.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/{+name}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{+name}", "name")].iter() { - let mut replace_with = String::new(); - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = value.to_string(); - break; - } - } - if find_this.as_bytes()[1] == '+' as u8 { - replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); - } - url = url.replace(find_this, &replace_with); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The name of the operation resource. - /// - /// Sets the *name* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { - self._name = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> OperationGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> OperationGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OperationGetCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Starts asynchronous cancellation on a long-running operation. The server /// makes a best effort to cancel the operation, but success is not /// guaranteed. If the server doesn't support this method, it returns @@ -5761,6 +6195,594 @@ impl<'a, C, A> LocationOperationGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BatchAnnotateImagesRequest::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_images_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationImageAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: BatchAnnotateImagesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationImageAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationImageAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchAnnotateImagesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.locations.images.annotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/images:annotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BatchAnnotateImagesRequest) -> ProjectLocationImageAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationImageAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationImageAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationImageAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationImageAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Run asynchronous image detection and annotation for a list of images. +/// +/// Progress and results can be retrieved through the +/// `google.longrunning.Operations` interface. +/// `Operation.metadata` contains `OperationMetadata` (metadata). +/// `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). +/// +/// This service will write image annotation outputs to json files in customer +/// GCS bucket, each json file containing BatchAnnotateImagesResponse proto. +/// +/// A builder for the *images.asyncBatchAnnotate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vision1 as vision1; +/// use vision1::AsyncBatchAnnotateImagesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vision1::Vision; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AsyncBatchAnnotateImagesRequest::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().images_async_batch_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectImageAsyncBatchAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: AsyncBatchAnnotateImagesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectImageAsyncBatchAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectImageAsyncBatchAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.images.asyncBatchAnnotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/images:asyncBatchAnnotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AsyncBatchAnnotateImagesRequest) -> ProjectImageAsyncBatchAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectImageAsyncBatchAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectImageAsyncBatchAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectImageAsyncBatchAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectImageAsyncBatchAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Gets information associated with a Product. /// /// Possible errors: @@ -5940,7 +6962,7 @@ impl<'a, C, A> ProjectLocationProductGetCall<'a, C, A> where C: BorrowMut ProjectLocationProductDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationProductDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BatchAnnotateImagesRequest::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().images_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectImageAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: BatchAnnotateImagesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectImageAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectImageAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchAnnotateImagesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.images.annotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/images:annotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BatchAnnotateImagesRequest) -> ProjectImageAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectImageAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectImageAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectImageAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectImageAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Lists the Products in a ProductSet, in an unspecified order. If the /// ProductSet does not exist, the products field of the response will be /// empty. @@ -6305,8 +7617,8 @@ impl<'a, C, A> ProjectLocationProductDeleteCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetProductListCall<'a, C, A> where C: Borro } - /// The ProductSet resource for which to retrieve Products. + /// Required. The ProductSet resource for which to retrieve Products. /// /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` @@ -6802,6 +8114,310 @@ impl<'a, C, A> ProjectLocationOperationGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = PurgeProductsRequest::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_products_purge(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationProductPurgeCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: PurgeProductsRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationProductPurgeCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationProductPurgeCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.locations.products.purge", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/products:purge"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: PurgeProductsRequest) -> ProjectLocationProductPurgeCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The project and location in which the Products should be deleted. + /// + /// Format is `projects/PROJECT_ID/locations/LOC_ID`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationProductPurgeCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationProductPurgeCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationProductPurgeCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationProductPurgeCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Permanently deletes a ProductSet. Products and ReferenceImages in the /// ProductSet are not deleted. /// @@ -6980,7 +8596,7 @@ impl<'a, C, A> ProjectLocationProductSetDeleteCall<'a, C, A> where C: BorrowMut< } - /// Resource name of the ProductSet to delete. + /// Required. Resource name of the ProductSet to delete. /// /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` @@ -7262,7 +8878,7 @@ impl<'a, C, A> ProjectLocationProductSetRemoveProductCall<'a, C, A> where C: Bor self._request = new_value; self } - /// The resource name for the ProductSet to modify. + /// Required. The resource name for the ProductSet to modify. /// /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` @@ -7338,13 +8954,308 @@ impl<'a, C, A> ProjectLocationProductSetRemoveProductCall<'a, C, A> where C: Bor } -/// Lists products in an unspecified order. +/// Run asynchronous image detection and annotation for a list of generic +/// files, such as PDF files, which may contain multiple pages and multiple +/// images per page. Progress and results can be retrieved through the +/// `google.longrunning.Operations` interface. +/// `Operation.metadata` contains `OperationMetadata` (metadata). +/// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). +/// +/// A builder for the *files.asyncBatchAnnotate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vision1 as vision1; +/// use vision1::AsyncBatchAnnotateFilesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vision1::Vision; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AsyncBatchAnnotateFilesRequest::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().files_async_batch_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectFileAsyncBatchAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: AsyncBatchAnnotateFilesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectFileAsyncBatchAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectFileAsyncBatchAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.files.asyncBatchAnnotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/files:asyncBatchAnnotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AsyncBatchAnnotateFilesRequest) -> ProjectFileAsyncBatchAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectFileAsyncBatchAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectFileAsyncBatchAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectFileAsyncBatchAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectFileAsyncBatchAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Gets information associated with a ProductSet. /// /// Possible errors: /// -/// * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. +/// * Returns NOT_FOUND if the ProductSet does not exist. /// -/// A builder for the *locations.products.list* method supported by a *project* resource. +/// A builder for the *locations.productSets.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -7369,31 +9280,27 @@ impl<'a, C, A> ProjectLocationProductSetRemoveProductCall<'a, C, A> where C: Bor /// // 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_products_list("parent") -/// .page_token("duo") -/// .page_size(-32) +/// let result = hub.projects().locations_product_sets_get("name") /// .doit(); /// # } /// ``` -pub struct ProjectLocationProductListCall<'a, C, A> +pub struct ProjectLocationProductSetGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Vision, - _parent: String, - _page_token: Option, - _page_size: Option, + _name: String, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationProductListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationProductSetGetCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListProductsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ProductSet)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -7402,17 +9309,11 @@ impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "vision.projects.locations.products.list", + dlg.begin(MethodInfo { id: "vision.projects.locations.productSets.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); - params.push(("parent", self._parent.to_string())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7424,12 +9325,12 @@ impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut ProjectLocationProductListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -7527,31 +9428,17 @@ impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut ProjectLocationProductListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// The next_page_token returned from a previous List request, if any. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectLocationProductListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of items to return. Default 10, maximum 100. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectLocationProductListCall<'a, C, A> { - self._page_size = Some(new_value); + pub fn name(mut self, new_value: &str) -> ProjectLocationProductSetGetCall<'a, C, A> { + self._name = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -7560,7 +9447,7 @@ impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut ProjectLocationProductListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationProductSetGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7585,7 +9472,7 @@ impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationProductListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationProductSetGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -7605,7 +9492,7 @@ impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationProductListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationProductSetGetCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -7908,7 +9795,7 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut ProjectLocationProductCreateCall<'a, C, A> where C: BorrowMut ProjectLocationProductCreateCall<'a, C, A> where C: BorrowMut ProjectLocationProductCreateCall<'a, C, A> where C: BorrowMut +pub struct ProjectLocationProductListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Vision, - _name: String, + _parent: String, + _page_token: Option, + _page_size: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectLocationProductSetGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectLocationProductListCall<'a, C, A> {} -impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectLocationProductListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ProductSet)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListProductsResponse)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -8231,11 +10122,17 @@ impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "vision.projects.locations.productSets.get", + dlg.begin(MethodInfo { id: "vision.projects.locations.products.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); - params.push(("name", self._name.to_string())); - for &field in ["alt", "name"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8247,12 +10144,12 @@ impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["parent"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -8350,17 +10247,31 @@ impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetGetCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn parent(mut self, new_value: &str) -> ProjectLocationProductListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The next_page_token returned from a previous List request, if any. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationProductListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of items to return. Default 10, maximum 100. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationProductListCall<'a, C, A> { + self._page_size = Some(new_value); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -8369,7 +10280,7 @@ impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationProductListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8394,7 +10305,7 @@ impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectLocationProductSetGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectLocationProductListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8414,7 +10325,302 @@ impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectLocationProductSetGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectLocationProductListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Run asynchronous image detection and annotation for a list of generic +/// files, such as PDF files, which may contain multiple pages and multiple +/// images per page. Progress and results can be retrieved through the +/// `google.longrunning.Operations` interface. +/// `Operation.metadata` contains `OperationMetadata` (metadata). +/// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). +/// +/// A builder for the *locations.files.asyncBatchAnnotate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vision1 as vision1; +/// use vision1::AsyncBatchAnnotateFilesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vision1::Vision; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AsyncBatchAnnotateFilesRequest::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_files_async_batch_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: AsyncBatchAnnotateFilesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.locations.files.asyncBatchAnnotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/files:asyncBatchAnnotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AsyncBatchAnnotateFilesRequest) -> ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFileAsyncBatchAnnotateCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -8465,7 +10671,7 @@ impl<'a, C, A> ProjectLocationProductSetGetCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetCreateCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The project in which the ProductSet should be created. + /// Required. The project in which the ProductSet should be created. /// /// Format is `projects/PROJECT_ID/locations/LOC_ID`. /// @@ -8727,6 +10933,302 @@ impl<'a, C, A> ProjectLocationProductSetCreateCall<'a, C, A> where C: BorrowMut< } +/// Service that performs image detection and annotation for a batch of files. +/// Now only "application/pdf", "image/tiff" and "image/gif" are supported. +/// +/// This service will extract at most 5 (customers can specify which 5 in +/// AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each +/// file provided and perform detection and annotation for each image +/// extracted. +/// +/// A builder for the *locations.files.annotate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vision1 as vision1; +/// use vision1::BatchAnnotateFilesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vision1::Vision; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BatchAnnotateFilesRequest::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_files_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationFileAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: BatchAnnotateFilesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationFileAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationFileAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchAnnotateFilesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.locations.files.annotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/files:annotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BatchAnnotateFilesRequest) -> ProjectLocationFileAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationFileAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationFileAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationFileAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationFileAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Adds a Product to the specified ProductSet. If the Product is already /// present, no change is made. /// @@ -8940,7 +11442,7 @@ impl<'a, C, A> ProjectLocationProductSetAddProductCall<'a, C, A> where C: Borrow self._request = new_value; self } - /// The resource name for the ProductSet to modify. + /// Required. The resource name for the ProductSet to modify. /// /// Format is: /// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` @@ -9232,7 +11734,7 @@ impl<'a, C, A> ProjectLocationProductSetImportCall<'a, C, A> where C: BorrowMut< self._request = new_value; self } - /// The project in which the ProductSets should be imported. + /// Required. The project in which the ProductSets should be imported. /// /// Format is `projects/PROJECT_ID/locations/LOC_ID`. /// @@ -9307,6 +11809,302 @@ impl<'a, C, A> ProjectLocationProductSetImportCall<'a, C, A> where C: BorrowMut< } +/// Service that performs image detection and annotation for a batch of files. +/// Now only "application/pdf", "image/tiff" and "image/gif" are supported. +/// +/// This service will extract at most 5 (customers can specify which 5 in +/// AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each +/// file provided and perform detection and annotation for each image +/// extracted. +/// +/// A builder for the *files.annotate* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_vision1 as vision1; +/// use vision1::BatchAnnotateFilesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use vision1::Vision; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = BatchAnnotateFilesRequest::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().files_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectFileAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: BatchAnnotateFilesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectFileAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectFileAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, BatchAnnotateFilesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.files.annotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/files:annotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: BatchAnnotateFilesRequest) -> ProjectFileAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectFileAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectFileAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectFileAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectFileAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Makes changes to a Product resource. /// Only the `display_name`, `description`, and `labels` fields can be updated /// right now. @@ -9355,7 +12153,7 @@ impl<'a, C, A> ProjectLocationProductSetImportCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_products_patch(req, "name") -/// .update_mask("no") +/// .update_mask("sea") /// .doit(); /// # } /// ``` @@ -9662,7 +12460,7 @@ impl<'a, C, A> ProjectLocationProductPatchCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetPatchCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetListCall<'a, C, A> where C: BorrowMut ProjectLocationProductSetListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Vision::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = AsyncBatchAnnotateImagesRequest::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_images_async_batch_annotate(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Vision, + _request: AsyncBatchAnnotateImagesRequest, + _parent: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "vision.projects.locations.images.asyncBatchAnnotate", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "v1/{+parent}/images:asyncBatchAnnotate"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET).to_string(); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: AsyncBatchAnnotateImagesRequest) -> ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> { + self._request = new_value; + self + } + /// Optional. Target project and location to make a call. + /// + /// Format: `projects/{project-id}/locations/{location-id}`. + /// + /// If no parent is specified, a region will be chosen automatically. + /// + /// Supported location-ids: + /// `us`: USA country only, + /// `asia`: East asia areas, like Japan, Taiwan, + /// `eu`: The European Union. + /// + /// Example: `projects/project-A/locations/eu`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationImageAsyncBatchAnnotateCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates and returns a new ReferenceImage resource. /// /// The `bounding_poly` field is optional. If `bounding_poly` is not specified, @@ -10258,7 +13354,7 @@ impl<'a, C, A> ProjectLocationProductSetListCall<'a, C, A> where C: BorrowMut ProjectLocationProductReferenceImageCreateCall<'a, C, A> where C: self._request = new_value; self } - /// Resource name of the product in which to create the reference image. + /// Required. Resource name of the product in which to create the reference image. /// /// Format is /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. @@ -10702,7 +13798,7 @@ impl<'a, C, A> ProjectLocationProductReferenceImageDeleteCall<'a, C, A> where C: } - /// The resource name of the reference image to delete. + /// Required. The resource name of the reference image to delete. /// /// Format is: /// @@ -10958,7 +14054,7 @@ impl<'a, C, A> ProjectLocationProductReferenceImageGetCall<'a, C, A> where C: Bo } - /// The resource name of the ReferenceImage to get. + /// Required. The resource name of the ReferenceImage to get. /// /// Format is: /// @@ -11069,8 +14165,8 @@ impl<'a, C, A> ProjectLocationProductReferenceImageGetCall<'a, C, A> where C: Bo /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_products_reference_images_list("parent") -/// .page_token("et") -/// .page_size(-40) +/// .page_token("sed") +/// .page_size(-3) /// .doit(); /// # } /// ``` @@ -11226,7 +14322,7 @@ impl<'a, C, A> ProjectLocationProductReferenceImageListCall<'a, C, A> where C: B } - /// Resource name of the product containing the reference images. + /// Required. Resource name of the product containing the reference images. /// /// Format is /// `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. diff --git a/gen/webfonts1-cli/Cargo.toml b/gen/webfonts1-cli/Cargo.toml index 08123c3c05..6f3943aa55 100644 --- a/gen/webfonts1-cli/Cargo.toml +++ b/gen/webfonts1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webfonts1-cli" -version = "1.0.12+20160302" +version = "1.0.13+20200302" authors = ["Sebastian Thiel "] description = "A complete library to interact with webfonts (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webfonts1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-webfonts1] path = "../webfonts1" -version = "1.0.12+20160302" +version = "1.0.13+20200302" diff --git a/gen/webfonts1-cli/README.md b/gen/webfonts1-cli/README.md index 8b31b4136a..fe59c8d007 100644 --- a/gen/webfonts1-cli/README.md +++ b/gen/webfonts1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *webfonts* API at revision *20160302*. The CLI is at version *1.0.12*. +This documentation was generated from the *webfonts* API at revision *20200302*. The CLI is at version *1.0.13*. ```bash webfonts1 [options] diff --git a/gen/webfonts1-cli/mkdocs.yml b/gen/webfonts1-cli/mkdocs.yml index f34dad7fa1..75a4b0c41e 100644 --- a/gen/webfonts1-cli/mkdocs.yml +++ b/gen/webfonts1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: webfonts v1.0.12+20160302 +site_name: webfonts v1.0.13+20200302 site_url: http://byron.github.io/google-apis-rs/google-webfonts1-cli site_description: A complete library to interact with webfonts (protocol v1) diff --git a/gen/webfonts1-cli/src/main.rs b/gen/webfonts1-cli/src/main.rs index 938cbb25ec..032d3dbc29 100644 --- a/gen/webfonts1-cli/src/main.rs +++ b/gen/webfonts1-cli/src/main.rs @@ -220,7 +220,7 @@ fn main() { let mut app = App::new("webfonts1") .author("Sebastian Thiel ") - .version("1.0.12+20160302") + .version("1.0.13+20200302") .about("Accesses the metadata for all families served by Google Fonts, providing a list of families currently available (including available styles and a list of supported script subsets).") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_webfonts1_cli") .arg(Arg::with_name("folder") diff --git a/gen/webfonts1/Cargo.toml b/gen/webfonts1/Cargo.toml index fa61cecae5..054839e6f7 100644 --- a/gen/webfonts1/Cargo.toml +++ b/gen/webfonts1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-webfonts1" -version = "1.0.12+20160302" +version = "1.0.13+20200302" authors = ["Sebastian Thiel "] description = "A complete library to interact with webfonts (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webfonts1" homepage = "https://developers.google.com/fonts/docs/developer_api" -documentation = "https://docs.rs/google-webfonts1/1.0.12+20160302" +documentation = "https://docs.rs/google-webfonts1/1.0.13+20200302" license = "MIT" keywords = ["webfonts", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/webfonts1/README.md b/gen/webfonts1/README.md index f35c6322d9..129db9565b 100644 --- a/gen/webfonts1/README.md +++ b/gen/webfonts1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-webfonts1` library allows access to all features of the *Google webfonts* service. -This documentation was generated from *webfonts* crate version *1.0.12+20160302*, where *20160302* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *webfonts* crate version *1.0.13+20200302*, where *20200302* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *webfonts* *v1* API can be found at the [official documentation site](https://developers.google.com/fonts/docs/developer_api). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/struct.Webfonts.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/struct.Webfonts.html) ... -* [webfonts](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/struct.Webfont.html) - * [*list*](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/struct.WebfontListCall.html) +* [webfonts](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/struct.Webfont.html) + * [*list*](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/struct.WebfontListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/struct.Webfonts.html)** +* **[Hub](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/struct.Webfonts.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.Part.html)** + * **[Parts](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -125,17 +125,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -145,29 +145,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-webfonts1/1.0.12+20160302/google_webfonts1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-webfonts1/1.0.13+20200302/google_webfonts1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/webfonts1/src/lib.rs b/gen/webfonts1/src/lib.rs index 989b2dca64..3695f79a01 100644 --- a/gen/webfonts1/src/lib.rs +++ b/gen/webfonts1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *webfonts* crate version *1.0.12+20160302*, where *20160302* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *webfonts* crate version *1.0.13+20200302*, where *20200302* is the exact revision of the *webfonts:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *webfonts* *v1* API can be found at the //! [official documentation site](https://developers.google.com/fonts/docs/developer_api). @@ -297,7 +297,7 @@ impl<'a, C, A> Webfonts Webfonts { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/webfonts/v1/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -308,7 +308,7 @@ impl<'a, C, A> Webfonts } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/webmasters3-cli/Cargo.toml b/gen/webmasters3-cli/Cargo.toml index 431bf283ec..0014e90ae1 100644 --- a/gen/webmasters3-cli/Cargo.toml +++ b/gen/webmasters3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webmasters3-cli" -version = "1.0.12+20190428" +version = "1.0.13+20190428" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-webmasters3] path = "../webmasters3" -version = "1.0.12+20190428" +version = "1.0.13+20190428" diff --git a/gen/webmasters3-cli/README.md b/gen/webmasters3-cli/README.md index 24f7dc1a41..2e0752ec94 100644 --- a/gen/webmasters3-cli/README.md +++ b/gen/webmasters3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *webmasters* API at revision *20190428*. The CLI is at version *1.0.12*. +This documentation was generated from the *webmasters* API at revision *20190428*. The CLI is at version *1.0.13*. ```bash webmasters3 [options] diff --git a/gen/webmasters3-cli/mkdocs.yml b/gen/webmasters3-cli/mkdocs.yml index 6b1597de23..14f9a4b675 100644 --- a/gen/webmasters3-cli/mkdocs.yml +++ b/gen/webmasters3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: webmasters v1.0.12+20190428 +site_name: webmasters v1.0.13+20190428 site_url: http://byron.github.io/google-apis-rs/google-webmasters3-cli site_description: A complete library to interact with webmasters (protocol v3) diff --git a/gen/webmasters3-cli/src/main.rs b/gen/webmasters3-cli/src/main.rs index 6fb15c7d24..58690d8529 100644 --- a/gen/webmasters3-cli/src/main.rs +++ b/gen/webmasters3-cli/src/main.rs @@ -870,7 +870,7 @@ fn main() { let mut app = App::new("webmasters3") .author("Sebastian Thiel ") - .version("1.0.12+20190428") + .version("1.0.13+20190428") .about("View Google Search Console data for your verified sites.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_webmasters3_cli") .arg(Arg::with_name("url") diff --git a/gen/webmasters3/Cargo.toml b/gen/webmasters3/Cargo.toml index 3b2c1a036e..6143592052 100644 --- a/gen/webmasters3/Cargo.toml +++ b/gen/webmasters3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-webmasters3" -version = "1.0.12+20190428" +version = "1.0.13+20190428" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3" homepage = "https://developers.google.com/webmaster-tools/" -documentation = "https://docs.rs/google-webmasters3/1.0.12+20190428" +documentation = "https://docs.rs/google-webmasters3/1.0.13+20190428" license = "MIT" keywords = ["webmasters", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/webmasters3/README.md b/gen/webmasters3/README.md index a46b649674..66314591c0 100644 --- a/gen/webmasters3/README.md +++ b/gen/webmasters3/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-webmasters3` library allows access to all features of the *Google webmasters* service. -This documentation was generated from *webmasters* crate version *1.0.12+20190428*, where *20190428* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *webmasters* crate version *1.0.13+20190428*, where *20190428* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *webmasters* *v3* API can be found at the [official documentation site](https://developers.google.com/webmaster-tools/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.Webmasters.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.Webmasters.html) ... * searchanalytics - * [*query*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SearchanalyticQueryCall.html) + * [*query*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SearchanalyticQueryCall.html) * sitemaps - * [*delete*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SitemapDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SitemapGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SitemapListCall.html) and [*submit*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SitemapSubmitCall.html) + * [*delete*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SitemapDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SitemapGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SitemapListCall.html) and [*submit*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SitemapSubmitCall.html) * sites - * [*add*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SiteAddCall.html), [*delete*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SiteDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SiteGetCall.html) and [*list*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.SiteListCall.html) + * [*add*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SiteAddCall.html), [*delete*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SiteDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SiteGetCall.html) and [*list*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.SiteListCall.html) @@ -27,17 +27,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/struct.Webmasters.html)** +* **[Hub](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/struct.Webmasters.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.Part.html)** + * **[Parts](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -128,17 +128,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -148,29 +148,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-webmasters3/1.0.12+20190428/google_webmasters3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-webmasters3/1.0.13+20190428/google_webmasters3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/webmasters3/src/lib.rs b/gen/webmasters3/src/lib.rs index d3f4af507b..51d312fef5 100644 --- a/gen/webmasters3/src/lib.rs +++ b/gen/webmasters3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *webmasters* crate version *1.0.12+20190428*, where *20190428* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *webmasters* crate version *1.0.13+20190428*, where *20190428* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *webmasters* *v3* API can be found at the //! [official documentation site](https://developers.google.com/webmaster-tools/). @@ -325,7 +325,7 @@ impl<'a, C, A> Webmasters Webmasters { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/webmasters/v3/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -342,7 +342,7 @@ impl<'a, C, A> Webmasters } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { diff --git a/gen/youtube3-cli/Cargo.toml b/gen/youtube3-cli/Cargo.toml index 712b569888..ebd227570e 100644 --- a/gen/youtube3-cli/Cargo.toml +++ b/gen/youtube3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-youtube3-cli" -version = "1.0.12+20190513" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-youtube3] path = "../youtube3" -version = "1.0.12+20190513" +version = "1.0.13+20200402" diff --git a/gen/youtube3-cli/README.md b/gen/youtube3-cli/README.md index 485162e2f4..3ffcaa746d 100644 --- a/gen/youtube3-cli/README.md +++ b/gen/youtube3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *YouTube* API at revision *20190513*. The CLI is at version *1.0.12*. +This documentation was generated from the *YouTube* API at revision *20200402*. The CLI is at version *1.0.13*. ```bash youtube3 [options] @@ -89,6 +89,10 @@ youtube3 [options] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] update (-r )... [-p ]... [-o ] + members + list [-p ]... [-o ] + memberships-levels + list [-p ]... [-o ] playlist-items delete [-p ]... insert (-r )... [-p ]... [-o ] diff --git a/gen/youtube3-cli/mkdocs.yml b/gen/youtube3-cli/mkdocs.yml index bce59352c3..6fa1effd9e 100644 --- a/gen/youtube3-cli/mkdocs.yml +++ b/gen/youtube3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube v1.0.12+20190513 +site_name: YouTube v1.0.13+20200402 site_url: http://byron.github.io/google-apis-rs/google-youtube3-cli site_description: A complete library to interact with YouTube (protocol v3) @@ -54,6 +54,8 @@ pages: - ['live-streams_insert.md', 'Live Streams', 'Insert'] - ['live-streams_list.md', 'Live Streams', 'List'] - ['live-streams_update.md', 'Live Streams', 'Update'] +- ['members_list.md', 'Members', 'List'] +- ['memberships-levels_list.md', 'Memberships Levels', 'List'] - ['playlist-items_delete.md', 'Playlist Items', 'Delete'] - ['playlist-items_insert.md', 'Playlist Items', 'Insert'] - ['playlist-items_list.md', 'Playlist Items', 'List'] diff --git a/gen/youtube3-cli/src/main.rs b/gen/youtube3-cli/src/main.rs index 0e0cd46d72..4367922fe2 100644 --- a/gen/youtube3-cli/src/main.rs +++ b/gen/youtube3-cli/src/main.rs @@ -1230,7 +1230,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "status.self-declared-made-for-kids" => Some(("status.selfDeclaredMadeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.made-for-kids" => Some(("status.madeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.is-linked" => Some(("status.isLinked", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.long-uploads-status" => Some(("status.longUploadsStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "invideo-promotion.default-timing.offset-ms" => Some(("invideoPromotion.defaultTiming.offsetMs", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1327,7 +1329,7 @@ impl<'n> Engine<'n> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["audit-details", "background-color", "background-image-url", "banner-external-url", "banner-image-url", "banner-mobile-extra-hd-image-url", "banner-mobile-hd-image-url", "banner-mobile-image-url", "banner-mobile-low-image-url", "banner-mobile-medium-hd-image-url", "banner-tablet-extra-hd-image-url", "banner-tablet-hd-image-url", "banner-tablet-image-url", "banner-tablet-low-image-url", "banner-tv-high-image-url", "banner-tv-image-url", "banner-tv-low-image-url", "banner-tv-medium-image-url", "branding-settings", "channel", "comment-count", "community-guidelines-good-standing", "content-details", "content-id-claims-good-standing", "content-owner", "content-owner-details", "copyright-strikes-good-standing", "corner-position", "country", "custom-url", "default", "default-language", "default-tab", "default-timing", "description", "duration-ms", "etag", "favorites", "featured-channels-title", "featured-channels-urls", "featured-playlist-id", "height", "hidden-subscriber-count", "high", "id", "image", "invideo-promotion", "is-linked", "keywords", "kind", "large-branded-banner-image-imap-script", "large-branded-banner-image-url", "likes", "localized", "long-uploads-status", "maxres", "medium", "moderate-comments", "offset-ms", "position", "privacy-status", "profile-color", "published-at", "related-playlists", "show-browse-view", "show-related-channels", "small-branded-banner-image-imap-script", "small-branded-banner-image-url", "snippet", "standard", "statistics", "status", "subscriber-count", "text-color", "thumbnails", "time-linked", "title", "topic-categories", "topic-details", "topic-ids", "tracking-analytics-account-id", "tracking-image-url", "type", "unsubscribed-trailer", "uploads", "url", "use-smart-timing", "value", "video-count", "view-count", "watch", "watch-history", "watch-icon-image-url", "watch-later", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["audit-details", "background-color", "background-image-url", "banner-external-url", "banner-image-url", "banner-mobile-extra-hd-image-url", "banner-mobile-hd-image-url", "banner-mobile-image-url", "banner-mobile-low-image-url", "banner-mobile-medium-hd-image-url", "banner-tablet-extra-hd-image-url", "banner-tablet-hd-image-url", "banner-tablet-image-url", "banner-tablet-low-image-url", "banner-tv-high-image-url", "banner-tv-image-url", "banner-tv-low-image-url", "banner-tv-medium-image-url", "branding-settings", "channel", "comment-count", "community-guidelines-good-standing", "content-details", "content-id-claims-good-standing", "content-owner", "content-owner-details", "copyright-strikes-good-standing", "corner-position", "country", "custom-url", "default", "default-language", "default-tab", "default-timing", "description", "duration-ms", "etag", "favorites", "featured-channels-title", "featured-channels-urls", "featured-playlist-id", "height", "hidden-subscriber-count", "high", "id", "image", "invideo-promotion", "is-linked", "keywords", "kind", "large-branded-banner-image-imap-script", "large-branded-banner-image-url", "likes", "localized", "long-uploads-status", "made-for-kids", "maxres", "medium", "moderate-comments", "offset-ms", "position", "privacy-status", "profile-color", "published-at", "related-playlists", "self-declared-made-for-kids", "show-browse-view", "show-related-channels", "small-branded-banner-image-imap-script", "small-branded-banner-image-url", "snippet", "standard", "statistics", "status", "subscriber-count", "text-color", "thumbnails", "time-linked", "title", "topic-categories", "topic-details", "topic-ids", "tracking-analytics-account-id", "tracking-image-url", "type", "unsubscribed-trailer", "uploads", "url", "use-smart-timing", "value", "video-count", "view-count", "watch", "watch-history", "watch-icon-image-url", "watch-later", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2477,9 +2479,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.recording-status" => Some(("status.recordingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.life-cycle-status" => Some(("status.lifeCycleStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.live-broadcast-priority" => Some(("status.liveBroadcastPriority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.self-declared-made-for-kids" => Some(("status.selfDeclaredMadeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.made-for-kids" => Some(("status.madeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.life-cycle-status" => Some(("status.lifeCycleStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.concurrent-viewers" => Some(("statistics.concurrentViewers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.total-chat-count" => Some(("statistics.totalChatCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2490,6 +2494,7 @@ impl<'n> Engine<'n> { "content-details.enable-auto-start" => Some(("contentDetails.enableAutoStart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.mesh" => Some(("contentDetails.mesh", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.latency-preference" => Some(("contentDetails.latencyPreference", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-auto-stop" => Some(("contentDetails.enableAutoStop", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-closed-captions" => Some(("contentDetails.enableClosedCaptions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2510,6 +2515,7 @@ impl<'n> Engine<'n> { "snippet.scheduled-start-time" => Some(("snippet.scheduledStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.actual-start-time" => Some(("snippet.actualStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.scheduled-end-time" => Some(("snippet.scheduledEndTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.broadcast-type" => Some(("snippet.broadcastType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.is-default-broadcast" => Some(("snippet.isDefaultBroadcast", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.thumbnails.default.url" => Some(("snippet.thumbnails.default.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.thumbnails.default.width" => Some(("snippet.thumbnails.default.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2529,7 +2535,7 @@ impl<'n> Engine<'n> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "channel-id", "closed-captions-type", "concurrent-viewers", "content-details", "default", "description", "embed-html", "enable-auto-start", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-low-latency", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "latency-preference", "life-cycle-status", "live-broadcast-priority", "live-chat-id", "maxres", "medium", "mesh", "monitor-stream", "privacy-status", "projection", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "snippet", "standard", "start-with-slate", "statistics", "status", "stereo-layout", "thumbnails", "title", "total-chat-count", "url", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "broadcast-type", "channel-id", "closed-captions-type", "concurrent-viewers", "content-details", "default", "description", "embed-html", "enable-auto-start", "enable-auto-stop", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-low-latency", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "latency-preference", "life-cycle-status", "live-broadcast-priority", "live-chat-id", "made-for-kids", "maxres", "medium", "mesh", "monitor-stream", "privacy-status", "projection", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "self-declared-made-for-kids", "snippet", "standard", "start-with-slate", "statistics", "status", "stereo-layout", "thumbnails", "title", "total-chat-count", "url", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2756,9 +2762,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "status.recording-status" => Some(("status.recordingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "status.life-cycle-status" => Some(("status.lifeCycleStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.live-broadcast-priority" => Some(("status.liveBroadcastPriority", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.self-declared-made-for-kids" => Some(("status.selfDeclaredMadeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.made-for-kids" => Some(("status.madeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.life-cycle-status" => Some(("status.lifeCycleStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.concurrent-viewers" => Some(("statistics.concurrentViewers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.total-chat-count" => Some(("statistics.totalChatCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2769,6 +2777,7 @@ impl<'n> Engine<'n> { "content-details.enable-auto-start" => Some(("contentDetails.enableAutoStart", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.mesh" => Some(("contentDetails.mesh", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.latency-preference" => Some(("contentDetails.latencyPreference", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.enable-auto-stop" => Some(("contentDetails.enableAutoStop", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-embed" => Some(("contentDetails.enableEmbed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-closed-captions" => Some(("contentDetails.enableClosedCaptions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-details.enable-low-latency" => Some(("contentDetails.enableLowLatency", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2789,6 +2798,7 @@ impl<'n> Engine<'n> { "snippet.scheduled-start-time" => Some(("snippet.scheduledStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.actual-start-time" => Some(("snippet.actualStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.scheduled-end-time" => Some(("snippet.scheduledEndTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.broadcast-type" => Some(("snippet.broadcastType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.is-default-broadcast" => Some(("snippet.isDefaultBroadcast", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "snippet.thumbnails.default.url" => Some(("snippet.thumbnails.default.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.thumbnails.default.width" => Some(("snippet.thumbnails.default.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2808,7 +2818,7 @@ impl<'n> Engine<'n> { "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "channel-id", "closed-captions-type", "concurrent-viewers", "content-details", "default", "description", "embed-html", "enable-auto-start", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-low-latency", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "latency-preference", "life-cycle-status", "live-broadcast-priority", "live-chat-id", "maxres", "medium", "mesh", "monitor-stream", "privacy-status", "projection", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "snippet", "standard", "start-with-slate", "statistics", "status", "stereo-layout", "thumbnails", "title", "total-chat-count", "url", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["actual-end-time", "actual-start-time", "bound-stream-id", "bound-stream-last-update-time-ms", "broadcast-stream-delay-ms", "broadcast-type", "channel-id", "closed-captions-type", "concurrent-viewers", "content-details", "default", "description", "embed-html", "enable-auto-start", "enable-auto-stop", "enable-closed-captions", "enable-content-encryption", "enable-dvr", "enable-embed", "enable-low-latency", "enable-monitor-stream", "etag", "height", "high", "id", "is-default-broadcast", "kind", "latency-preference", "life-cycle-status", "live-broadcast-priority", "live-chat-id", "made-for-kids", "maxres", "medium", "mesh", "monitor-stream", "privacy-status", "projection", "published-at", "record-from-start", "recording-status", "scheduled-end-time", "scheduled-start-time", "self-declared-made-for-kids", "snippet", "standard", "start-with-slate", "statistics", "status", "stereo-layout", "thumbnails", "title", "total-chat-count", "url", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3794,6 +3804,126 @@ impl<'n> Engine<'n> { } } + fn _members_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.members().list(opt.value_of("part").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "mode" => { + call = call.mode(value.unwrap_or("")); + }, + "max-results" => { + call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); + }, + "has-access-to-level" => { + call = call.has_access_to_level(value.unwrap_or("")); + }, + "filter-by-member-channel-id" => { + call = call.filter_by_member_channel_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter-by-member-channel-id", "page-token", "mode", "max-results", "has-access-to-level"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _memberships_levels_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.memberships_levels().list(opt.value_of("part").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _playlist_items_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.playlist_items().delete(opt.value_of("id").unwrap_or("")); @@ -5360,8 +5490,10 @@ impl<'n> Engine<'n> { "status.license" => Some(("status.license", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.embeddable" => Some(("status.embeddable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.self-declared-made-for-kids" => Some(("status.selfDeclaredMadeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.publish-at" => Some(("status.publishAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.public-stats-viewable" => Some(("status.publicStatsViewable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.made-for-kids" => Some(("status.madeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.upload-status" => Some(("status.uploadStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.rejection-reason" => Some(("status.rejectionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.failure-reason" => Some(("status.failureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5432,6 +5564,7 @@ impl<'n> Engine<'n> { "content-details.content-rating.ilfilm-rating" => Some(("contentDetails.contentRating.ilfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.mcst-rating" => Some(("contentDetails.contentRating.mcstRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.smais-rating" => Some(("contentDetails.contentRating.smaisRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.nmc-rating" => Some(("contentDetails.contentRating.nmcRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.russia-rating" => Some(("contentDetails.contentRating.russiaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.mpaa-rating" => Some(("contentDetails.contentRating.mpaaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.kfcb-rating" => Some(("contentDetails.contentRating.kfcbRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5526,7 +5659,7 @@ impl<'n> Engine<'n> { "recording-details.location.longitude" => Some(("recordingDetails.location.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mena-mpaa-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mpaat-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-categories", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "made-for-kids", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mena-mpaa-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mpaat-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "nmc-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "self-declared-made-for-kids", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-categories", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5850,8 +5983,10 @@ impl<'n> Engine<'n> { "status.license" => Some(("status.license", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.embeddable" => Some(("status.embeddable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.privacy-status" => Some(("status.privacyStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.self-declared-made-for-kids" => Some(("status.selfDeclaredMadeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.publish-at" => Some(("status.publishAt", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.public-stats-viewable" => Some(("status.publicStatsViewable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "status.made-for-kids" => Some(("status.madeForKids", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "status.upload-status" => Some(("status.uploadStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.rejection-reason" => Some(("status.rejectionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.failure-reason" => Some(("status.failureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5922,6 +6057,7 @@ impl<'n> Engine<'n> { "content-details.content-rating.ilfilm-rating" => Some(("contentDetails.contentRating.ilfilmRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.mcst-rating" => Some(("contentDetails.contentRating.mcstRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.smais-rating" => Some(("contentDetails.contentRating.smaisRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "content-details.content-rating.nmc-rating" => Some(("contentDetails.contentRating.nmcRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.russia-rating" => Some(("contentDetails.contentRating.russiaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.mpaa-rating" => Some(("contentDetails.contentRating.mpaaRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.content-rating.kfcb-rating" => Some(("contentDetails.contentRating.kfcbRating", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -6016,7 +6152,7 @@ impl<'n> Engine<'n> { "recording-details.location.longitude" => Some(("recordingDetails.location.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mena-mpaa-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mpaat-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-categories", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "made-for-kids", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mena-mpaa-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mpaat-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "nmc-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "self-declared-made-for-kids", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-categories", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6480,6 +6616,28 @@ impl<'n> Engine<'n> { } } }, + ("members", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._members_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("members".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("memberships-levels", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._memberships_levels_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("memberships-levels".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("playlist-items", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -7796,6 +7954,56 @@ fn main() { ]), ]), + ("members", "methods: 'list'", vec![ + ("list", + Some(r##"Lists members for a channel."##), + "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/members_list", + vec![ + (Some(r##"part"##), + None, + Some(r##"The part parameter specifies the member resource parts that the API response will include. Set the parameter value to snippet."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("memberships-levels", "methods: 'list'", vec![ + ("list", + Some(r##"Lists pricing levels for a channel."##), + "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/memberships-levels_list", + vec![ + (Some(r##"part"##), + None, + Some(r##"The part parameter specifies the membershipsLevel resource parts that the API response will include. Supported values are id and snippet."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("playlist-items", "methods: 'delete', 'insert', 'list' and 'update'", vec![ ("delete", Some(r##"Deletes a playlist item."##), @@ -8395,7 +8603,7 @@ fn main() { let mut app = App::new("youtube3") .author("Sebastian Thiel ") - .version("1.0.12+20190513") + .version("1.0.13+20200402") .about("Supports core YouTube features, such as uploading videos, creating and managing playlists, searching for content, and much more.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_youtube3_cli") .arg(Arg::with_name("url") diff --git a/gen/youtube3/Cargo.toml b/gen/youtube3/Cargo.toml index 3c741f58af..c6dc502e39 100644 --- a/gen/youtube3/Cargo.toml +++ b/gen/youtube3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtube3" -version = "1.0.12+20190513" +version = "1.0.13+20200402" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtube3" homepage = "https://developers.google.com/youtube/v3" -documentation = "https://docs.rs/google-youtube3/1.0.12+20190513" +documentation = "https://docs.rs/google-youtube3/1.0.13+20200402" license = "MIT" keywords = ["youtube", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index aa42f88232..6d09e0fa37 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -5,84 +5,88 @@ DO NOT EDIT ! --> The `google-youtube3` library allows access to all features of the *Google YouTube* service. -This documentation was generated from *YouTube* crate version *1.0.12+20190513*, where *20190513* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *YouTube* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *YouTube* *v3* API can be found at the [official documentation site](https://developers.google.com/youtube/v3). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.YouTube.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.YouTube.html) ... -* [activities](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Activity.html) - * [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ActivityListCall.html) -* [captions](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Caption.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionDeleteCall.html), [*download*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionDownloadCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionUpdateCall.html) +* [activities](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Activity.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ActivityListCall.html) +* [captions](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Caption.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionDeleteCall.html), [*download*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionDownloadCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionUpdateCall.html) * channel banners - * [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelBannerInsertCall.html) -* [channel sections](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelSection.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelSectionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelSectionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelSectionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelSectionUpdateCall.html) -* [channels](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Channel.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelUpdateCall.html) -* [comment threads](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentThread.html) - * [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentThreadInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentThreadListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentThreadUpdateCall.html) -* [comments](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Comment.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentListCall.html), [*mark as spam*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentMarkAsSpamCall.html), [*set moderation status*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentSetModerationStatuCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CommentUpdateCall.html) -* [guide categories](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.GuideCategory.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.GuideCategoryListCall.html) -* [i18n languages](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.I18nLanguage.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.I18nLanguageListCall.html) -* [i18n regions](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.I18nRegion.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.I18nRegionListCall.html) -* [live broadcasts](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcast.html) - * [*bind*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveBroadcastUpdateCall.html) -* [live chat bans](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatBan.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatBanDeleteCall.html) and [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatBanInsertCall.html) -* [live chat messages](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatMessage.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatMessageDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatMessageInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatMessageListCall.html) -* [live chat moderators](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatModerator.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatModeratorDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatModeratorInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveChatModeratorListCall.html) -* [live streams](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveStream.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveStreamListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.LiveStreamUpdateCall.html) -* [playlist items](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistItem.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistItemDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistItemInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistItemListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistItemUpdateCall.html) -* [playlists](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Playlist.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistUpdateCall.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelBannerInsertCall.html) +* [channel sections](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelSection.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelSectionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelSectionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelSectionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelSectionUpdateCall.html) +* [channels](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Channel.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelUpdateCall.html) +* [comment threads](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentThread.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentThreadInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentThreadListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentThreadUpdateCall.html) +* [comments](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Comment.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentListCall.html), [*mark as spam*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentMarkAsSpamCall.html), [*set moderation status*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentSetModerationStatuCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CommentUpdateCall.html) +* [guide categories](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.GuideCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.GuideCategoryListCall.html) +* [i18n languages](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.I18nLanguage.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.I18nLanguageListCall.html) +* [i18n regions](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.I18nRegion.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.I18nRegionListCall.html) +* [live broadcasts](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcast.html) + * [*bind*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveBroadcastUpdateCall.html) +* [live chat bans](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatBan.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatBanDeleteCall.html) and [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatBanInsertCall.html) +* [live chat messages](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatMessage.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatMessageDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatMessageInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatMessageListCall.html) +* [live chat moderators](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatModerator.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatModeratorDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatModeratorInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveChatModeratorListCall.html) +* [live streams](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveStream.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveStreamListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.LiveStreamUpdateCall.html) +* [members](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Member.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.MemberListCall.html) +* [memberships levels](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.MembershipsLevel.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.MembershipsLevelListCall.html) +* [playlist items](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistItem.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistItemDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistItemInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistItemListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistItemUpdateCall.html) +* [playlists](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Playlist.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistUpdateCall.html) * search - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.SearchListCall.html) -* [sponsors](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Sponsor.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.SponsorListCall.html) -* [subscriptions](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Subscription.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.SubscriptionInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.SubscriptionListCall.html) -* [super chat events](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.SuperChatEvent.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.SuperChatEventListCall.html) -* [thumbnails](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Thumbnail.html) - * [*set*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ThumbnailSetCall.html) -* [video abuse report reasons](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoAbuseReportReason.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoAbuseReportReasonListCall.html) -* [video categories](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoCategory.html) - * [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoCategoryListCall.html) -* [videos](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.Video.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoDeleteCall.html), [*get rating*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoGetRatingCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoListCall.html), [*rate*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoRateCall.html), [*report abuse*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoReportAbuseCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoUpdateCall.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.SearchListCall.html) +* [sponsors](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Sponsor.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.SponsorListCall.html) +* [subscriptions](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Subscription.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.SubscriptionInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.SubscriptionListCall.html) +* [super chat events](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.SuperChatEvent.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.SuperChatEventListCall.html) +* [thumbnails](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Thumbnail.html) + * [*set*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ThumbnailSetCall.html) +* [video abuse report reasons](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoAbuseReportReason.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoAbuseReportReasonListCall.html) +* [video categories](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoCategoryListCall.html) +* [videos](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.Video.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoDeleteCall.html), [*get rating*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoGetRatingCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoListCall.html), [*rate*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoRateCall.html), [*report abuse*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoReportAbuseCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoUpdateCall.html) * watermarks - * [*set*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.WatermarkSetCall.html) and [*unset*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.WatermarkUnsetCall.html) + * [*set*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.WatermarkSetCall.html) and [*unset*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.WatermarkUnsetCall.html) Upload supported by ... -* [*set thumbnails*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ThumbnailSetCall.html) -* [*insert captions*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionInsertCall.html) -* [*insert videos*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.VideoInsertCall.html) -* [*set watermarks*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.WatermarkSetCall.html) -* [*insert channel banners*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.ChannelBannerInsertCall.html) -* [*update captions*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionUpdateCall.html) +* [*set thumbnails*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ThumbnailSetCall.html) +* [*insert captions*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionInsertCall.html) +* [*insert videos*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.VideoInsertCall.html) +* [*set watermarks*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.WatermarkSetCall.html) +* [*insert channel banners*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.ChannelBannerInsertCall.html) +* [*update captions*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionUpdateCall.html) Download supported by ... -* [*download captions*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.CaptionDownloadCall.html) +* [*download captions*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.CaptionDownloadCall.html) Subscription supported by ... -* [*list playlist items*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.PlaylistItemListCall.html) +* [*list playlist items*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.PlaylistItemListCall.html) @@ -90,17 +94,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/struct.YouTube.html)** +* **[Hub](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/struct.YouTube.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -209,17 +213,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -229,29 +233,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-youtube3/1.0.12+20190513/google_youtube3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtube3/1.0.13+20200402/google_youtube3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/youtube3/src/lib.rs b/gen/youtube3/src/lib.rs index fa7ad522c7..df4aa624d4 100644 --- a/gen/youtube3/src/lib.rs +++ b/gen/youtube3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *YouTube* crate version *1.0.12+20190513*, where *20190513* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *YouTube* crate version *1.0.13+20200402*, where *20200402* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *YouTube* *v3* API can be found at the //! [official documentation site](https://developers.google.com/youtube/v3). @@ -41,6 +41,10 @@ //! * [*delete*](struct.LiveChatModeratorDeleteCall.html), [*insert*](struct.LiveChatModeratorInsertCall.html) and [*list*](struct.LiveChatModeratorListCall.html) //! * [live streams](struct.LiveStream.html) //! * [*delete*](struct.LiveStreamDeleteCall.html), [*insert*](struct.LiveStreamInsertCall.html), [*list*](struct.LiveStreamListCall.html) and [*update*](struct.LiveStreamUpdateCall.html) +//! * [members](struct.Member.html) +//! * [*list*](struct.MemberListCall.html) +//! * [memberships levels](struct.MembershipsLevel.html) +//! * [*list*](struct.MembershipsLevelListCall.html) //! * [playlist items](struct.PlaylistItem.html) //! * [*delete*](struct.PlaylistItemDeleteCall.html), [*insert*](struct.PlaylistItemInsertCall.html), [*list*](struct.PlaylistItemListCall.html) and [*update*](struct.PlaylistItemUpdateCall.html) //! * [playlists](struct.Playlist.html) @@ -317,6 +321,9 @@ pub enum Scope { /// Manage your YouTube account Full, + /// See a list of your current active channel members, their current level, and when they became a member + ChannelMembershipCreator, + /// See, edit, and permanently delete your YouTube videos, ratings, comments and captions ForceSsl, @@ -333,6 +340,7 @@ impl AsRef for Scope { Scope::PartnerChannelAudit => "https://www.googleapis.com/auth/youtubepartner-channel-audit", Scope::Readonly => "https://www.googleapis.com/auth/youtube.readonly", Scope::Full => "https://www.googleapis.com/auth/youtube", + Scope::ChannelMembershipCreator => "https://www.googleapis.com/auth/youtube.channel-memberships.creator", Scope::ForceSsl => "https://www.googleapis.com/auth/youtube.force-ssl", Scope::Partner => "https://www.googleapis.com/auth/youtubepartner", Scope::Upload => "https://www.googleapis.com/auth/youtube.upload", @@ -434,7 +442,7 @@ impl<'a, C, A> YouTube YouTube { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://www.googleapis.com/youtube/v3/".to_string(), _root_url: "https://www.googleapis.com/".to_string(), } @@ -485,6 +493,12 @@ impl<'a, C, A> YouTube pub fn live_streams(&'a self) -> LiveStreamMethods<'a, C, A> { LiveStreamMethods { hub: &self } } + pub fn members(&'a self) -> MemberMethods<'a, C, A> { + MemberMethods { hub: &self } + } + pub fn memberships_levels(&'a self) -> MembershipsLevelMethods<'a, C, A> { + MembershipsLevelMethods { hub: &self } + } pub fn playlist_items(&'a self) -> PlaylistItemMethods<'a, C, A> { PlaylistItemMethods { hub: &self } } @@ -520,7 +534,7 @@ impl<'a, C, A> YouTube } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { @@ -1379,6 +1393,49 @@ impl NestedType for ChannelContentDetailsRelatedPlaylists {} impl Part for ChannelContentDetailsRelatedPlaylists {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list memberships levels](struct.MembershipsLevelListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MembershipsLevelListResponse { + /// Serialized EventId of the request which produced this response. + #[serde(rename="eventId")] + pub event_id: Option, + /// A list of pricing levels offered by a creator to the fans. + pub items: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#membershipsLevelListResponse". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, + /// The visitorId identifies the visitor. + #[serde(rename="visitorId")] + pub visitor_id: Option, +} + +impl ResponseResult for MembershipsLevelListResponse {} + +impl ToParts for MembershipsLevelListResponse { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.event_id.is_some() { r = r + "eventId,"; } + if self.items.is_some() { r = r + "items,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.etag.is_some() { r = r + "etag,"; } + if self.visitor_id.is_some() { r = r + "visitorId,"; } + r.pop(); + r + } +} + /// Basic details about a video category, such as its localized title. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2470,9 +2527,15 @@ impl Part for LiveStreamSnippet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChannelStatus { + /// no description provided + #[serde(rename="selfDeclaredMadeForKids")] + pub self_declared_made_for_kids: Option, /// Privacy status of the channel. #[serde(rename="privacyStatus")] pub privacy_status: Option, + /// no description provided + #[serde(rename="madeForKids")] + pub made_for_kids: Option, /// If true, then the user is linked to either a YouTube username or G+ account. Otherwise, the user doesn't have a public YouTube identity. #[serde(rename="isLinked")] pub is_linked: Option, @@ -2737,7 +2800,7 @@ pub struct LiveStreamStatus { impl Part for LiveStreamStatus {} -/// Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 71 +/// Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 72 /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -2833,6 +2896,9 @@ pub struct ContentRating { /// The video's rating in Iceland. #[serde(rename="smaisRating")] pub smais_rating: Option, + /// no description provided + #[serde(rename="nmcRating")] + pub nmc_rating: Option, /// The video's Canadian Home Video Rating System (CHVRS) rating. #[serde(rename="chvrsRating")] pub chvrs_rating: Option, @@ -2958,21 +3024,60 @@ pub struct ContentRating { impl Part for ContentRating {} -/// ChannelSection targeting setting. +/// Basic details about a comment, such as its author and text. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChannelSectionTargeting { - /// The language the channel section is targeting. - pub languages: Option>, - /// The region the channel section is targeting. - pub regions: Option>, - /// The country the channel section is targeting. - pub countries: Option>, +pub struct CommentSnippet { + /// Link to the author's YouTube channel, if any. + #[serde(rename="authorChannelUrl")] + pub author_channel_url: Option, + /// The URL for the avatar of the user who posted the comment. + #[serde(rename="authorProfileImageUrl")] + pub author_profile_image_url: Option, + /// The name of the user who posted the comment. + #[serde(rename="authorDisplayName")] + pub author_display_name: Option, + /// The id of the corresponding YouTube channel. In case of a channel comment this is the channel the comment refers to. In case of a video comment it's the video's channel. + #[serde(rename="channelId")] + pub channel_id: Option, + /// The rating the viewer has given to this comment. For the time being this will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. This may change in the future. + #[serde(rename="viewerRating")] + pub viewer_rating: Option, + /// The comment's moderation status. Will not be set if the comments were requested through the id filter. + #[serde(rename="moderationStatus")] + pub moderation_status: Option, + /// The ID of the video the comment refers to, if any. + #[serde(rename="videoId")] + pub video_id: Option, + /// The id of the author's YouTube channel, if any. + #[serde(rename="authorChannelId")] + pub author_channel_id: Option, + /// The unique id of the parent comment, only set for replies. + #[serde(rename="parentId")] + pub parent_id: Option, + /// The date and time when the comment was orignally published. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(rename="publishedAt")] + pub published_at: Option, + /// Whether the current viewer can rate this comment. + #[serde(rename="canRate")] + pub can_rate: Option, + /// The comment's original raw text as initially posted or last updated. The original text will only be returned if it is accessible to the viewer, which is only guaranteed if the viewer is the comment's author. + #[serde(rename="textOriginal")] + pub text_original: Option, + /// The date and time when was last updated . The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(rename="updatedAt")] + pub updated_at: Option, + /// The total number of likes this comment has received. + #[serde(rename="likeCount")] + pub like_count: Option, + /// The comment's text. The format is either plain text or HTML dependent on what has been requested. Even the plain text representation may differ from the text originally posted in that it may replace video links with video titles etc. + #[serde(rename="textDisplay")] + pub text_display: Option, } -impl Part for ChannelSectionTargeting {} +impl Part for CommentSnippet {} /// Nonprofit information. @@ -3228,25 +3333,21 @@ pub struct LocalizedString { impl Part for LocalizedString {} -/// Information about an audio stream. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VideoFileDetailsAudioStream { - /// The audio stream's bitrate, in bits per second. - #[serde(rename="bitrateBps")] - pub bitrate_bps: Option, - /// The audio codec that the stream uses. - pub codec: Option, - /// A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code. - pub vendor: Option, - /// The number of audio channels that the stream contains. - #[serde(rename="channelCount")] - pub channel_count: Option, +pub struct MembershipsDuration { + /// The cumulative time the user has been a member across all levels in complete months (the time is rounded down to the nearest integer). + #[serde(rename="memberTotalDurationMonths")] + pub member_total_duration_months: Option, + /// The date and time when the user became a continuous member across all levels. + #[serde(rename="memberSince")] + pub member_since: Option, } -impl Part for VideoFileDetailsAudioStream {} +impl Part for MembershipsDuration {} /// Describes information necessary for ingesting an RTMP or an HTTP stream. @@ -3441,6 +3542,61 @@ pub struct ActivityContentDetailsLike { impl Part for ActivityContentDetailsLike {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list members](struct.MemberListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MemberListResponse { + /// Serialized EventId of the request which produced this response. + #[serde(rename="eventId")] + pub event_id: Option, + /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#memberListResponse". + pub kind: Option, + /// The visitorId identifies the visitor. + #[serde(rename="visitorId")] + pub visitor_id: Option, + /// A list of members that match the request criteria. + pub items: Option>, + /// no description provided + #[serde(rename="tokenPagination")] + pub token_pagination: Option, + /// Etag of this resource. + pub etag: Option, + /// no description provided + #[serde(rename="pageInfo")] + pub page_info: Option, +} + +impl ResponseResult for MemberListResponse {} + +impl ToParts for MemberListResponse { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.event_id.is_some() { r = r + "eventId,"; } + if self.next_page_token.is_some() { r = r + "nextPageToken,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.visitor_id.is_some() { r = r + "visitorId,"; } + if self.items.is_some() { r = r + "items,"; } + if self.token_pagination.is_some() { r = r + "tokenPagination,"; } + if self.etag.is_some() { r = r + "etag,"; } + if self.page_info.is_some() { r = r + "pageInfo,"; } + r.pop(); + r + } +} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3600,6 +3756,41 @@ pub struct PropertyValue { impl Part for PropertyValue {} +/// A member resource represents a member for a YouTube channel. A member provides recurring monetary support to a creator and receives special benefits. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list members](struct.MemberListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Member { + /// The snippet object contains basic details about the member. + pub snippet: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#member". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, +} + +impl Resource for Member {} + +impl ToParts for Member { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.snippet.is_some() { r = r + "snippet,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.etag.is_some() { r = r + "etag,"; } + r.pop(); + r + } +} + /// Describes a temporal position of a visual widget inside a video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3773,60 +3964,21 @@ pub struct VideoProcessingDetails { impl Part for VideoProcessingDetails {} -/// Basic details about a comment, such as its author and text. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommentSnippet { - /// Link to the author's YouTube channel, if any. - #[serde(rename="authorChannelUrl")] - pub author_channel_url: Option, - /// The URL for the avatar of the user who posted the comment. - #[serde(rename="authorProfileImageUrl")] - pub author_profile_image_url: Option, - /// The name of the user who posted the comment. - #[serde(rename="authorDisplayName")] - pub author_display_name: Option, - /// The id of the corresponding YouTube channel. In case of a channel comment this is the channel the comment refers to. In case of a video comment it's the video's channel. - #[serde(rename="channelId")] - pub channel_id: Option, - /// The rating the viewer has given to this comment. For the time being this will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. This may change in the future. - #[serde(rename="viewerRating")] - pub viewer_rating: Option, - /// The comment's moderation status. Will not be set if the comments were requested through the id filter. - #[serde(rename="moderationStatus")] - pub moderation_status: Option, - /// The ID of the video the comment refers to, if any. - #[serde(rename="videoId")] - pub video_id: Option, - /// The id of the author's YouTube channel, if any. - #[serde(rename="authorChannelId")] - pub author_channel_id: Option, - /// The unique id of the parent comment, only set for replies. - #[serde(rename="parentId")] - pub parent_id: Option, - /// The date and time when the comment was orignally published. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - #[serde(rename="publishedAt")] - pub published_at: Option, - /// Whether the current viewer can rate this comment. - #[serde(rename="canRate")] - pub can_rate: Option, - /// The comment's original raw text as initially posted or last updated. The original text will only be returned if it is accessible to the viewer, which is only guaranteed if the viewer is the comment's author. - #[serde(rename="textOriginal")] - pub text_original: Option, - /// The date and time when was last updated . The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - #[serde(rename="updatedAt")] - pub updated_at: Option, - /// The total number of likes this comment has received. - #[serde(rename="likeCount")] - pub like_count: Option, - /// The comment's text. The format is either plain text or HTML dependent on what has been requested. Even the plain text representation may differ from the text originally posted in that it may replace video links with video titles etc. - #[serde(rename="textDisplay")] - pub text_display: Option, +pub struct LiveChatModeratorSnippet { + /// The ID of the live chat this moderator can act on. + #[serde(rename="liveChatId")] + pub live_chat_id: Option, + /// Details about the moderator. + #[serde(rename="moderatorDetails")] + pub moderator_details: Option, } -impl Part for CommentSnippet {} +impl Part for LiveChatModeratorSnippet {} /// Statistics about the video, such as the number of times the video was viewed or liked. @@ -3905,6 +4057,44 @@ pub struct ChannelSectionContentDetails { impl Part for ChannelSectionContentDetails {} +/// A membershipsLevel resource represents an offer made by YouTube creators for their fans. Users can become members of the channel by joining one of the available levels. They will provide recurring monetary support and receives special benefits. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list memberships levels](struct.MembershipsLevelListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MembershipsLevel { + /// The snippet object contains basic details about the level. + pub snippet: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#membershipsLevel". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, + /// The ID that YouTube assigns to uniquely identify the memberships level. + pub id: Option, +} + +impl Resource for MembershipsLevel {} + +impl ToParts for MembershipsLevel { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.snippet.is_some() { r = r + "snippet,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.etag.is_some() { r = r + "etag,"; } + if self.id.is_some() { r = r + "id,"; } + r.pop(); + r + } +} + /// Describes a single promoted item. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4266,19 +4456,30 @@ impl Part for ActivityContentDetailsRecommendation {} /// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get rating videos](struct.VideoGetRatingCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LiveChatModeratorSnippet { - /// The ID of the live chat this moderator can act on. - #[serde(rename="liveChatId")] - pub live_chat_id: Option, - /// Details about the moderator. - #[serde(rename="moderatorDetails")] - pub moderator_details: Option, +pub struct VideoGetRatingResponse { + /// Serialized EventId of the request which produced this response. + #[serde(rename="eventId")] + pub event_id: Option, + /// A list of ratings that match the request criteria. + pub items: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, + /// The visitorId identifies the visitor. + #[serde(rename="visitorId")] + pub visitor_id: Option, } -impl Part for LiveChatModeratorSnippet {} +impl ResponseResult for VideoGetRatingResponse {} /// A superChatEvent resource represents a Super Chat purchase on a YouTube channel. @@ -4428,15 +4629,21 @@ pub struct LiveBroadcastStatus { /// The broadcast's recording status. #[serde(rename="recordingStatus")] pub recording_status: Option, - /// The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource. - #[serde(rename="privacyStatus")] - pub privacy_status: Option, - /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. - #[serde(rename="lifeCycleStatus")] - pub life_cycle_status: Option, /// Priority of the live broadcast event (internal state). #[serde(rename="liveBroadcastPriority")] pub live_broadcast_priority: Option, + /// no description provided + #[serde(rename="selfDeclaredMadeForKids")] + pub self_declared_made_for_kids: Option, + /// The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource. + #[serde(rename="privacyStatus")] + pub privacy_status: Option, + /// no description provided + #[serde(rename="madeForKids")] + pub made_for_kids: Option, + /// The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method. + #[serde(rename="lifeCycleStatus")] + pub life_cycle_status: Option, } impl Part for LiveBroadcastStatus {} @@ -4552,32 +4759,25 @@ pub struct WatchSettings { impl Part for WatchSettings {} -/// There is no detailed description. +/// Information about an audio stream. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get rating videos](struct.VideoGetRatingCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VideoGetRatingResponse { - /// Serialized EventId of the request which produced this response. - #[serde(rename="eventId")] - pub event_id: Option, - /// A list of ratings that match the request criteria. - pub items: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "youtube#videoGetRatingResponse". - pub kind: Option, - /// Etag of this resource. - pub etag: Option, - /// The visitorId identifies the visitor. - #[serde(rename="visitorId")] - pub visitor_id: Option, +pub struct VideoFileDetailsAudioStream { + /// The audio stream's bitrate, in bits per second. + #[serde(rename="bitrateBps")] + pub bitrate_bps: Option, + /// The audio codec that the stream uses. + pub codec: Option, + /// A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code. + pub vendor: Option, + /// The number of audio channels that the stream contains. + #[serde(rename="channelCount")] + pub channel_count: Option, } -impl ResponseResult for VideoGetRatingResponse {} +impl Part for VideoFileDetailsAudioStream {} /// A video resource represents a YouTube video. @@ -4760,6 +4960,23 @@ impl ToParts for CommentThread { } } +/// ChannelSection targeting setting. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChannelSectionTargeting { + /// The language the channel section is targeting. + pub languages: Option>, + /// The region the channel section is targeting. + pub regions: Option>, + /// The country the channel section is targeting. + pub countries: Option>, +} + +impl Part for ChannelSectionTargeting {} + + /// Describes a single promoted item id. It is a union of various possible types. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4840,6 +5057,32 @@ pub struct InvideoPosition { impl Part for InvideoPosition {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MembershipsDetails { + /// Data about memberships duration without taking into consideration pricing levels. + #[serde(rename="membershipsDuration")] + pub memberships_duration: Option, + /// Data about memberships duration on particular pricing levels. + #[serde(rename="membershipsDurationAtLevels")] + pub memberships_duration_at_levels: Option>, + /// Id of the highest level that the user has access to at the moment. + #[serde(rename="highestAccessibleLevel")] + pub highest_accessible_level: Option, + /// Display name of the highest level that the user has access to at the moment. + #[serde(rename="highestAccessibleLevelDisplayName")] + pub highest_accessible_level_display_name: Option, + /// Ids of all levels that the user has access to. This includes the currently active level and all other levels that are included because of a higher purchase. + #[serde(rename="accessibleLevels")] + pub accessible_levels: Option>, +} + +impl Part for MembershipsDetails {} + + /// There is no detailed description. /// /// # Activities @@ -4941,12 +5184,18 @@ pub struct VideoStatus { /// The video's privacy status. #[serde(rename="privacyStatus")] pub privacy_status: Option, - /// The date and time when the video is scheduled to publish. It can be set only if the privacy status of the video is private. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - #[serde(rename="publishAt")] - pub publish_at: Option, /// This value indicates if the extended video statistics on the watch page can be viewed by everyone. Note that the view count, likes, etc will still be visible if this is disabled. #[serde(rename="publicStatsViewable")] pub public_stats_viewable: Option, + /// The date and time when the video is scheduled to publish. It can be set only if the privacy status of the video is private. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(rename="publishAt")] + pub publish_at: Option, + /// no description provided + #[serde(rename="selfDeclaredMadeForKids")] + pub self_declared_made_for_kids: Option, + /// no description provided + #[serde(rename="madeForKids")] + pub made_for_kids: Option, /// The status of the uploaded video. #[serde(rename="uploadStatus")] pub upload_status: Option, @@ -4994,6 +5243,20 @@ pub struct LocalizedProperty { impl Part for LocalizedProperty {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LevelDetails { + /// no description provided + #[serde(rename="displayName")] + pub display_name: Option, +} + +impl Part for LevelDetails {} + + /// A liveBroadcast resource represents an event that will be streamed, via live video, on YouTube. /// /// # Activities @@ -5070,30 +5333,21 @@ pub struct LiveStreamConfigurationIssue { impl Part for LiveStreamConfigurationIssue {} -/// Statistics about a channel: number of subscribers, number of videos in the channel, etc. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChannelStatistics { - /// The number of comments for the channel. - #[serde(rename="commentCount")] - pub comment_count: Option, - /// The number of subscribers that the channel has. - #[serde(rename="subscriberCount")] - pub subscriber_count: Option, - /// The number of videos uploaded to the channel. - #[serde(rename="videoCount")] - pub video_count: Option, - /// Whether or not the number of subscribers is shown for this user. - #[serde(rename="hiddenSubscriberCount")] - pub hidden_subscriber_count: Option, - /// The number of times the channel has been viewed. - #[serde(rename="viewCount")] - pub view_count: Option, +pub struct MembershipsLevelSnippet { + /// no description provided + #[serde(rename="levelDetails")] + pub level_details: Option, + /// The id of the channel that's offering channel memberships. + #[serde(rename="creatorChannelId")] + pub creator_channel_id: Option, } -impl Part for ChannelStatistics {} +impl Part for MembershipsLevelSnippet {} /// A resource id is a generic reference that points to another YouTube resource. @@ -5205,6 +5459,26 @@ pub struct PlaylistPlayer { impl Part for PlaylistPlayer {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MemberSnippet { + /// Details about the user's membership. + #[serde(rename="membershipsDetails")] + pub memberships_details: Option, + /// The id of the channel that's offering memberships. + #[serde(rename="creatorChannelId")] + pub creator_channel_id: Option, + /// Details about the member. + #[serde(rename="memberDetails")] + pub member_details: Option, +} + +impl Part for MemberSnippet {} + + /// A sponsor resource represents a sponsor for a YouTube channel. A sponsor provides recurring monetary support to a creator and receives special benefits. /// /// # Activities @@ -5580,6 +5854,25 @@ impl ToParts for CommentThreadListResponse { } } +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MembershipsDurationAtLevel { + /// The cumulative time the user has been a member for the given level in complete months (the time is rounded down to the nearest integer). + #[serde(rename="memberTotalDurationMonths")] + pub member_total_duration_months: Option, + /// Pricing level id. + pub level: Option, + /// The date and time when the user became a continuous member for the given level. + #[serde(rename="memberSince")] + pub member_since: Option, +} + +impl Part for MembershipsDurationAtLevel {} + + /// Playlist localization setting /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -5679,6 +5972,9 @@ pub struct LiveBroadcastSnippet { #[serde(rename="scheduledEndTime")] pub scheduled_end_time: Option, /// no description provided + #[serde(rename="broadcastType")] + pub broadcast_type: Option, + /// no description provided #[serde(rename="isDefaultBroadcast")] pub is_default_broadcast: Option, /// A map of thumbnail images associated with the broadcast. For each nested object in this object, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail. @@ -5799,6 +6095,9 @@ pub struct LiveBroadcastContentDetails { #[serde(rename="boundStreamId")] pub bound_stream_id: Option, /// no description provided + #[serde(rename="enableAutoStop")] + pub enable_auto_stop: Option, + /// The mesh for projecting the video if projection is mesh. The mesh value must be a UTF-8 string containing the base-64 encoding of 3D mesh data that follows the Spherical Video V2 RFC specification for an mshp box, excluding the box size and type but including the following four reserved zero bytes for the version and flags. pub mesh: Option, /// no description provided #[serde(rename="closedCaptionsType")] @@ -5836,6 +6135,32 @@ pub struct VideoCategorySnippet { impl Part for VideoCategorySnippet {} +/// Statistics about a channel: number of subscribers, number of videos in the channel, etc. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChannelStatistics { + /// The number of comments for the channel. + #[serde(rename="commentCount")] + pub comment_count: Option, + /// The number of subscribers that the channel has. + #[serde(rename="subscriberCount")] + pub subscriber_count: Option, + /// The number of videos uploaded to the channel. + #[serde(rename="videoCount")] + pub video_count: Option, + /// Whether or not the number of subscribers is shown for this user. + #[serde(rename="hiddenSubscriberCount")] + pub hidden_subscriber_count: Option, + /// The number of times the channel has been viewed. + #[serde(rename="viewCount")] + pub view_count: Option, +} + +impl Part for ChannelStatistics {} + + /// There is no detailed description. /// /// # Activities @@ -6141,6 +6466,65 @@ impl<'a, C, A> ChannelSectionMethods<'a, C, A> { +/// A builder providing access to all methods supported on *membershipsLevel* resources. +/// It is not used directly, but through the `YouTube` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_youtube3 as youtube3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use youtube3::YouTube; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.memberships_levels(); +/// # } +/// ``` +pub struct MembershipsLevelMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, +} + +impl<'a, C, A> MethodsBuilder for MembershipsLevelMethods<'a, C, A> {} + +impl<'a, C, A> MembershipsLevelMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists pricing levels for a channel. + /// + /// # Arguments + /// + /// * `part` - The part parameter specifies the membershipsLevel resource parts that the API response will include. Supported values are id and snippet. + pub fn list(&self, part: &str) -> MembershipsLevelListCall<'a, C, A> { + MembershipsLevelListCall { + hub: self.hub, + _part: part.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *playlist* resources. /// It is not used directly, but through the `YouTube` hub. /// @@ -6457,95 +6841,6 @@ impl<'a, C, A> VideoMethods<'a, C, A> { -/// A builder providing access to all methods supported on *activity* resources. -/// It is not used directly, but through the `YouTube` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate hyper_rustls; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_youtube3 as youtube3; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use youtube3::YouTube; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// ::default(), None); -/// let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `insert(...)` and `list(...)` -/// // to build up your call. -/// let rb = hub.activities(); -/// # } -/// ``` -pub struct ActivityMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a YouTube, -} - -impl<'a, C, A> MethodsBuilder for ActivityMethods<'a, C, A> {} - -impl<'a, C, A> ActivityMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user. - /// - /// # Arguments - /// - /// * `part` - The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. - pub fn list(&self, part: &str) -> ActivityListCall<'a, C, A> { - ActivityListCall { - hub: self.hub, - _part: part.to_string(), - _region_code: Default::default(), - _published_before: Default::default(), - _published_after: Default::default(), - _page_token: Default::default(), - _mine: Default::default(), - _max_results: Default::default(), - _home: Default::default(), - _channel_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.) - /// - /// Note: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn insert(&self, request: Activity) -> ActivityInsertCall<'a, C, A> { - let parts = request.to_parts(); - ActivityInsertCall { - hub: self.hub, - _request: request, - _part: parts, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *liveStream* resources. /// It is not used directly, but through the `YouTube` hub. /// @@ -7211,6 +7506,66 @@ impl<'a, C, A> GuideCategoryMethods<'a, C, A> { +/// A builder providing access to all methods supported on *i18nRegion* resources. +/// It is not used directly, but through the `YouTube` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_youtube3 as youtube3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use youtube3::YouTube; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.i18n_regions(); +/// # } +/// ``` +pub struct I18nRegionMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, +} + +impl<'a, C, A> MethodsBuilder for I18nRegionMethods<'a, C, A> {} + +impl<'a, C, A> I18nRegionMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Returns a list of content regions that the YouTube website supports. + /// + /// # Arguments + /// + /// * `part` - The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. + pub fn list(&self, part: &str) -> I18nRegionListCall<'a, C, A> { + I18nRegionListCall { + hub: self.hub, + _part: part.to_string(), + _hl: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *commentThread* resources. /// It is not used directly, but through the `YouTube` hub. /// @@ -7761,7 +8116,7 @@ impl<'a, C, A> VideoCategoryMethods<'a, C, A> { -/// A builder providing access to all methods supported on *i18nRegion* resources. +/// A builder providing access to all methods supported on *activity* resources. /// It is not used directly, but through the `YouTube` hub. /// /// # Example @@ -7785,33 +8140,62 @@ impl<'a, C, A> VideoCategoryMethods<'a, C, A> { /// ::default(), None); /// let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `list(...)` +/// // like `insert(...)` and `list(...)` /// // to build up your call. -/// let rb = hub.i18n_regions(); +/// let rb = hub.activities(); /// # } /// ``` -pub struct I18nRegionMethods<'a, C, A> +pub struct ActivityMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a YouTube, } -impl<'a, C, A> MethodsBuilder for I18nRegionMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for ActivityMethods<'a, C, A> {} -impl<'a, C, A> I18nRegionMethods<'a, C, A> { +impl<'a, C, A> ActivityMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of content regions that the YouTube website supports. + /// Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user. /// /// # Arguments /// - /// * `part` - The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. - pub fn list(&self, part: &str) -> I18nRegionListCall<'a, C, A> { - I18nRegionListCall { + /// * `part` - The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. + /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. + pub fn list(&self, part: &str) -> ActivityListCall<'a, C, A> { + ActivityListCall { hub: self.hub, _part: part.to_string(), - _hl: Default::default(), + _region_code: Default::default(), + _published_before: Default::default(), + _published_after: Default::default(), + _page_token: Default::default(), + _mine: Default::default(), + _max_results: Default::default(), + _home: Default::default(), + _channel_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.) + /// + /// Note: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn insert(&self, request: Activity) -> ActivityInsertCall<'a, C, A> { + let parts = request.to_parts(); + ActivityInsertCall { + hub: self.hub, + _request: request, + _part: parts, _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -7879,23 +8263,6 @@ impl<'a, C, A> SubscriptionMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes a subscription. - /// - /// # Arguments - /// - /// * `id` - The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. - pub fn delete(&self, id: &str) -> SubscriptionDeleteCall<'a, C, A> { - SubscriptionDeleteCall { - hub: self.hub, - _id: id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns subscription resources that match the API request criteria. @@ -7924,6 +8291,23 @@ impl<'a, C, A> SubscriptionMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a subscription. + /// + /// # Arguments + /// + /// * `id` - The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. + pub fn delete(&self, id: &str) -> SubscriptionDeleteCall<'a, C, A> { + SubscriptionDeleteCall { + hub: self.hub, + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -8128,6 +8512,70 @@ impl<'a, C, A> VideoAbuseReportReasonMethods<'a, C, A> { +/// A builder providing access to all methods supported on *member* resources. +/// It is not used directly, but through the `YouTube` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate hyper_rustls; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_youtube3 as youtube3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use youtube3::YouTube; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// ::default(), None); +/// let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.members(); +/// # } +/// ``` +pub struct MemberMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, +} + +impl<'a, C, A> MethodsBuilder for MemberMethods<'a, C, A> {} + +impl<'a, C, A> MemberMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists members for a channel. + /// + /// # Arguments + /// + /// * `part` - The part parameter specifies the member resource parts that the API response will include. Set the parameter value to snippet. + pub fn list(&self, part: &str) -> MemberListCall<'a, C, A> { + MemberListCall { + hub: self.hub, + _part: part.to_string(), + _page_token: Default::default(), + _mode: Default::default(), + _max_results: Default::default(), + _has_access_to_level: Default::default(), + _filter_by_member_channel_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *liveBroadcast* resources. /// It is not used directly, but through the `YouTube` hub. /// @@ -8256,25 +8704,6 @@ impl<'a, C, A> LiveBroadcastMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes a broadcast. - /// - /// # Arguments - /// - /// * `id` - The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. - pub fn delete(&self, id: &str) -> LiveBroadcastDeleteCall<'a, C, A> { - LiveBroadcastDeleteCall { - hub: self.hub, - _id: id.to_string(), - _on_behalf_of_content_owner_channel: Default::default(), - _on_behalf_of_content_owner: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns a list of YouTube broadcasts that match the API request parameters. @@ -8300,6 +8729,25 @@ impl<'a, C, A> LiveBroadcastMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a broadcast. + /// + /// # Arguments + /// + /// * `id` - The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. + pub fn delete(&self, id: &str) -> LiveBroadcastDeleteCall<'a, C, A> { + LiveBroadcastDeleteCall { + hub: self.hub, + _id: id.to_string(), + _on_behalf_of_content_owner_channel: Default::default(), + _on_behalf_of_content_owner: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast. @@ -9749,6 +10197,247 @@ impl<'a, C, A> ChannelSectionUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.memberships_levels().list("part") +/// .doit(); +/// # } +/// ``` +pub struct MembershipsLevelListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _part: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MembershipsLevelListCall<'a, C, A> {} + +impl<'a, C, A> MembershipsLevelListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, MembershipsLevelListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.membershipsLevels.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len()); + params.push(("part", self._part.to_string())); + for &field in ["alt", "part"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "membershipsLevels"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The part parameter specifies the membershipsLevel resource parts that the API response will include. Supported values are id and snippet. + /// + /// Sets the *part* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + /// **Settable Parts** + /// + /// * *id* + /// * *snippet* + pub fn part(mut self, new_value: &str) -> MembershipsLevelListCall<'a, C, A> { + self._part = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MembershipsLevelListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> MembershipsLevelListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MembershipsLevelListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Creates a playlist. /// /// A builder for the *insert* method supported by a *playlist* resource. @@ -9783,8 +10472,8 @@ impl<'a, C, A> ChannelSectionUpdateCall<'a, C, A> where C: BorrowMut PlaylistInsertCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().list("part") -/// .page_token("sanctus") -/// .on_behalf_of_content_owner_channel("et") -/// .on_behalf_of_content_owner("amet") +/// .page_token("et") +/// .on_behalf_of_content_owner_channel("amet") +/// .on_behalf_of_content_owner("et") /// .mine(true) -/// .max_results(56) -/// .id("ut") -/// .hl("ea") -/// .channel_id("sed") +/// .max_results(65) +/// .id("ea") +/// .hl("sed") +/// .channel_id("dolor") /// .doit(); /// # } /// ``` @@ -10614,7 +11303,7 @@ impl<'a, C, A> PlaylistDeleteCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlists().update(req) -/// .on_behalf_of_content_owner("dolor") +/// .on_behalf_of_content_owner("et") /// .doit(); /// # } /// ``` @@ -10886,7 +11575,7 @@ impl<'a, C, A> PlaylistUpdateCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().report_abuse(req) -/// .on_behalf_of_content_owner("et") +/// .on_behalf_of_content_owner("consetetur") /// .doit(); /// # } /// ``` @@ -11121,18 +11810,18 @@ impl<'a, C, A> VideoReportAbuseCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().list("part") -/// .video_category_id("amet.") -/// .region_code("voluptua.") -/// .page_token("Lorem") -/// .on_behalf_of_content_owner("gubergren") -/// .my_rating("justo") -/// .max_width(49) -/// .max_results(75) -/// .max_height(73) -/// .locale("rebum.") -/// .id("consetetur") -/// .hl("sadipscing") -/// .chart("vero") +/// .video_category_id("voluptua.") +/// .region_code("Lorem") +/// .page_token("gubergren") +/// .on_behalf_of_content_owner("justo") +/// .my_rating("sit") +/// .max_width(75) +/// .max_results(73) +/// .max_height(35) +/// .locale("consetetur") +/// .id("sadipscing") +/// .hl("vero") +/// .chart("sadipscing") /// .doit(); /// # } /// ``` @@ -11714,7 +12403,7 @@ impl<'a, C, A> VideoRateCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().get_rating("id") -/// .on_behalf_of_content_owner("dolore") +/// .on_behalf_of_content_owner("duo") /// .doit(); /// # } /// ``` @@ -11947,7 +12636,7 @@ impl<'a, C, A> VideoGetRatingCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().delete("id") -/// .on_behalf_of_content_owner("aliquyam") +/// .on_behalf_of_content_owner("Lorem") /// .doit(); /// # } /// ``` @@ -12175,7 +12864,7 @@ impl<'a, C, A> VideoDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().update(req) -/// .on_behalf_of_content_owner("Lorem") +/// .on_behalf_of_content_owner("et") /// .doit(); /// # } /// ``` @@ -12451,9 +13140,9 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o /// // Values shown here are possibly random and not representative ! /// let result = hub.videos().insert(req) /// .stabilize(true) -/// .on_behalf_of_content_owner_channel("clita") -/// .on_behalf_of_content_owner("consetetur") -/// .notify_subscribers(false) +/// .on_behalf_of_content_owner_channel("consetetur") +/// .on_behalf_of_content_owner("takimata") +/// .notify_subscribers(true) /// .auto_levels(true) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } @@ -12587,8 +13276,8 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 68719476736 { - return Err(Error::UploadSizeLimitExceeded(size, 68719476736)) + if size > 137438953472 { + return Err(Error::UploadSizeLimitExceeded(size, 137438953472)) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -12641,8 +13330,8 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 68719476736 { - return Err(Error::UploadSizeLimitExceeded(size, 68719476736)) + if size > 137438953472 { + return Err(Error::UploadSizeLimitExceeded(size, 137438953472)) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -12705,7 +13394,7 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o /// Upload media all at once. /// If the upload fails for whichever reason, all progress is lost. /// - /// * *max size*: 64GB + /// * *max size*: 128GB /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream' and 'video/*' pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, Video)> @@ -12721,7 +13410,7 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using /// `cancel_chunk_upload(...)`. /// - /// * *max size*: 64GB + /// * *max size*: 128GB /// * *multipart*: yes /// * *valid mime types*: 'application/octet-stream' and 'video/*' pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, Video)> @@ -12853,581 +13542,6 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o } -/// Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user. -/// -/// A builder for the *list* method supported by a *activity* resource. -/// It is not used directly, but through a `ActivityMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_youtube3 as youtube3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use youtube3::YouTube; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.activities().list("part") -/// .region_code("sanctus") -/// .published_before("takimata") -/// .published_after("At") -/// .page_token("labore") -/// .mine(true) -/// .max_results(35) -/// .home(false) -/// .channel_id("rebum.") -/// .doit(); -/// # } -/// ``` -pub struct ActivityListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a YouTube, - _part: String, - _region_code: Option, - _published_before: Option, - _published_after: Option, - _page_token: Option, - _mine: Option, - _max_results: Option, - _home: Option, - _channel_id: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ActivityListCall<'a, C, A> {} - -impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ActivityListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "youtube.activities.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(11 + self._additional_params.len()); - params.push(("part", self._part.to_string())); - if let Some(value) = self._region_code { - params.push(("regionCode", value.to_string())); - } - if let Some(value) = self._published_before { - params.push(("publishedBefore", value.to_string())); - } - if let Some(value) = self._published_after { - params.push(("publishedAfter", value.to_string())); - } - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._mine { - params.push(("mine", value.to_string())); - } - if let Some(value) = self._max_results { - params.push(("maxResults", value.to_string())); - } - if let Some(value) = self._home { - params.push(("home", value.to_string())); - } - if let Some(value) = self._channel_id { - params.push(("channelId", value.to_string())); - } - for &field in ["alt", "part", "regionCode", "publishedBefore", "publishedAfter", "pageToken", "mine", "maxResults", "home", "channelId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "activities"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. - /// - /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. - /// - /// Sets the *part* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn part(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._part = new_value.to_string(); - self - } - /// The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed. - /// - /// Sets the *region code* query property to the given value. - pub fn region_code(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._region_code = Some(new_value.to_string()); - self - } - /// The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - /// - /// Sets the *published before* query property to the given value. - pub fn published_before(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._published_before = Some(new_value.to_string()); - self - } - /// The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - /// - /// Sets the *published after* query property to the given value. - pub fn published_after(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._published_after = Some(new_value.to_string()); - self - } - /// The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Set this parameter's value to true to retrieve a feed of the authenticated user's activities. - /// - /// Sets the *mine* query property to the given value. - pub fn mine(mut self, new_value: bool) -> ActivityListCall<'a, C, A> { - self._mine = Some(new_value); - self - } - /// The maxResults parameter specifies the maximum number of items that should be returned in the result set. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ActivityListCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user. - /// - /// Sets the *home* query property to the given value. - pub fn home(mut self, new_value: bool) -> ActivityListCall<'a, C, A> { - self._home = Some(new_value); - self - } - /// The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities. - /// - /// Sets the *channel id* query property to the given value. - pub fn channel_id(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { - self._channel_id = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ActivityListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ActivityListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ActivityListCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - -/// Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.) -/// -/// Note: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite. -/// -/// A builder for the *insert* method supported by a *activity* resource. -/// It is not used directly, but through a `ActivityMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate hyper_rustls; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_youtube3 as youtube3; -/// use youtube3::Activity; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use youtube3::YouTube; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), -/// # ::default(), None); -/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Activity::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.activities().insert(req) -/// .doit(); -/// # } -/// ``` -pub struct ActivityInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a YouTube, - _request: Activity, - _part: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ActivityInsertCall<'a, C, A> {} - -impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Activity)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "youtube.activities.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - if self._part.len() == 0 { - self._part = self._request.to_parts(); - } - params.push(("part", self._part.to_string())); - for &field in ["alt", "part"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "activities"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: Activity) -> ActivityInsertCall<'a, C, A> { - self._request = new_value; - self - } - /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - /// - /// Sets the *part* query property to the given value. - /// - /// Even though the *parts* list is automatically derived from *Resource* passed in - /// during instantiation and indicates which values you are passing, the response would contain the very same parts. - /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, - /// like statistics that are generated server side. Therefore you should use this method to specify - /// the parts you provide in addition to the ones you want in the response. - pub fn part(mut self, new_value: &str) -> ActivityInsertCall<'a, C, A> { - self._part = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ActivityInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ActivityInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ActivityInsertCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings. /// /// A builder for the *update* method supported by a *liveStream* resource. @@ -13476,14 +13590,14 @@ impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A /// req.status = Default::default(); // is LiveStreamStatus /// req.snippet = Default::default(); // is LiveStreamSnippet /// req.cdn = Default::default(); // is CdnSettings -/// req.id = Some("dolore".to_string()); +/// req.id = Some("sanctus".to_string()); /// /// // 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.live_streams().update(req) -/// .on_behalf_of_content_owner_channel("nonumy") -/// .on_behalf_of_content_owner("sed") +/// .on_behalf_of_content_owner_channel("takimata") +/// .on_behalf_of_content_owner("At") /// .doit(); /// # } /// ``` @@ -13780,8 +13894,8 @@ impl<'a, C, A> LiveStreamUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_streams().delete("id") -/// .on_behalf_of_content_owner_channel("sit") -/// .on_behalf_of_content_owner("eirmod") +/// .on_behalf_of_content_owner_channel("invidunt") +/// .on_behalf_of_content_owner("ea") /// .doit(); /// # } /// ``` @@ -14035,12 +14149,12 @@ impl<'a, C, A> LiveStreamDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_streams().list("part") -/// .page_token("labore") -/// .on_behalf_of_content_owner_channel("sed") -/// .on_behalf_of_content_owner("ea") -/// .mine(false) +/// .page_token("rebum.") +/// .on_behalf_of_content_owner_channel("dolore") +/// .on_behalf_of_content_owner("nonumy") +/// .mine(true) /// .max_results(19) -/// .id("eos") +/// .id("sit") /// .doit(); /// # } /// ``` @@ -14359,13 +14473,13 @@ impl<'a, C, A> LiveStreamListCall<'a, C, A> where C: BorrowMut, A /// req.status = Default::default(); // is LiveStreamStatus /// req.snippet = Default::default(); // is LiveStreamSnippet /// req.cdn = Default::default(); // is CdnSettings -/// req.id = Some("tempor".to_string()); +/// req.id = Some("eirmod".to_string()); /// /// // 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.live_streams().insert(req) -/// .on_behalf_of_content_owner_channel("sea") +/// .on_behalf_of_content_owner_channel("consetetur") /// .on_behalf_of_content_owner("labore") /// .doit(); /// # } @@ -14667,7 +14781,7 @@ impl<'a, C, A> LiveStreamInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channels().update(req) -/// .on_behalf_of_content_owner("ipsum") +/// .on_behalf_of_content_owner("sed") /// .doit(); /// # } /// ``` @@ -14933,16 +15047,16 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channels().list("part") -/// .page_token("dolores") -/// .on_behalf_of_content_owner("sit") +/// .page_token("gubergren") +/// .on_behalf_of_content_owner("aliquyam") /// .my_subscribers(true) /// .mine(true) -/// .max_results(31) -/// .managed_by_me(true) -/// .id("amet") -/// .hl("accusam") -/// .for_username("clita") -/// .category_id("diam") +/// .max_results(42) +/// .managed_by_me(false) +/// .id("ipsum") +/// .hl("aliquyam") +/// .for_username("dolores") +/// .category_id("sit") /// .doit(); /// # } /// ``` @@ -15285,7 +15399,7 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.watermarks().set(req, "channelId") -/// .on_behalf_of_content_owner("est") +/// .on_behalf_of_content_owner("ut") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -15645,7 +15759,7 @@ impl<'a, C, A> WatermarkSetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.watermarks().unset("channelId") -/// .on_behalf_of_content_owner("invidunt") +/// .on_behalf_of_content_owner("est") /// .doit(); /// # } /// ``` @@ -16138,8 +16252,8 @@ impl<'a, C, A> LiveChatModeratorInsertCall<'a, C, A> where C: BorrowMut LiveChatModeratorDeleteCall<'a, C, A> where C: BorrowMut CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().insert(req) -/// .sync(true) -/// .on_behalf_of_content_owner("et") -/// .on_behalf_of("dolor") +/// .sync(false) +/// .on_behalf_of_content_owner("dolores") +/// .on_behalf_of("eos") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -17253,10 +17367,10 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().download("id") -/// .tlang("kasd") -/// .tfmt("invidunt") -/// .on_behalf_of_content_owner("rebum.") -/// .on_behalf_of("Lorem") +/// .tlang("duo") +/// .tfmt("sed") +/// .on_behalf_of_content_owner("aliquyam") +/// .on_behalf_of("ea") /// .doit(); /// # } /// ``` @@ -17546,9 +17660,9 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().list("part", "videoId") -/// .on_behalf_of_content_owner("eirmod") -/// .on_behalf_of("At") -/// .id("consetetur") +/// .on_behalf_of_content_owner("dolor") +/// .on_behalf_of("diam") +/// .id("kasd") /// .doit(); /// # } /// ``` @@ -17827,9 +17941,9 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `upload_resumable(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.captions().update(req) -/// .sync(true) -/// .on_behalf_of_content_owner("sed") -/// .on_behalf_of("sit") +/// .sync(false) +/// .on_behalf_of_content_owner("rebum.") +/// .on_behalf_of("Lorem") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -18230,7 +18344,7 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.i18n_languages().list("part") -/// .hl("elitr") +/// .hl("invidunt") /// .doit(); /// # } /// ``` @@ -18461,9 +18575,9 @@ impl<'a, C, A> I18nLanguageListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.guide_categories().list("part") -/// .region_code("rebum.") -/// .id("Lorem") -/// .hl("Lorem") +/// .region_code("At") +/// .id("consetetur") +/// .hl("et") /// .doit(); /// # } /// ``` @@ -18688,6 +18802,237 @@ impl<'a, C, A> GuideCategoryListCall<'a, C, A> where C: BorrowMut } +/// Returns a list of content regions that the YouTube website supports. +/// +/// A builder for the *list* method supported by a *i18nRegion* resource. +/// It is not used directly, but through a `I18nRegionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_youtube3 as youtube3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use youtube3::YouTube; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.i18n_regions().list("part") +/// .hl("sit") +/// .doit(); +/// # } +/// ``` +pub struct I18nRegionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _part: String, + _hl: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for I18nRegionListCall<'a, C, A> {} + +impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, I18nRegionListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.i18nRegions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("part", self._part.to_string())); + if let Some(value) = self._hl { + params.push(("hl", value.to_string())); + } + for &field in ["alt", "part", "hl"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "i18nRegions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. + /// + /// Sets the *part* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn part(mut self, new_value: &str) -> I18nRegionListCall<'a, C, A> { + self._part = new_value.to_string(); + self + } + /// The hl parameter specifies the language that should be used for text values in the API response. + /// + /// Sets the *hl* query property to the given value. + pub fn hl(mut self, new_value: &str) -> I18nRegionListCall<'a, C, A> { + self._hl = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> I18nRegionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> I18nRegionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> I18nRegionListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Returns a list of comment threads that match the API request parameters. /// /// A builder for the *list* method supported by a *commentThread* resource. @@ -18716,16 +19061,16 @@ impl<'a, C, A> GuideCategoryListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comment_threads().list("part") -/// .video_id("ut") -/// .text_format("ut") -/// .search_terms("amet.") -/// .page_token("ipsum") -/// .order("ut") -/// .moderation_status("dolor") -/// .max_results(92) +/// .video_id("elitr") +/// .text_format("nonumy") +/// .search_terms("rebum.") +/// .page_token("Lorem") +/// .order("Lorem") +/// .moderation_status("diam") +/// .max_results(65) /// .id("ut") -/// .channel_id("eirmod") -/// .all_threads_related_to_channel_id("sanctus") +/// .channel_id("amet.") +/// .all_threads_related_to_channel_id("ipsum") /// .doit(); /// # } /// ``` @@ -20041,11 +20386,11 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("part") -/// .text_format("et") -/// .parent_id("et") -/// .page_token("vero") -/// .max_results(65) -/// .id("sed") +/// .text_format("sea") +/// .parent_id("ut") +/// .page_token("eirmod") +/// .max_results(93) +/// .id("voluptua.") /// .doit(); /// # } /// ``` @@ -20326,7 +20671,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().set_moderation_status("id", "moderationStatus") -/// .ban_author(true) +/// .ban_author(false) /// .doit(); /// # } /// ``` @@ -21030,7 +21375,7 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlist_items().insert(req) -/// .on_behalf_of_content_owner("vero") +/// .on_behalf_of_content_owner("ut") /// .doit(); /// # } /// ``` @@ -21294,7 +21639,7 @@ impl<'a, C, A> PlaylistItemInsertCall<'a, C, A> where C: BorrowMut PlaylistItemDeleteCall<'a, C, A> where C: BorrowMut PlaylistItemListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.playlist_items().update(req) -/// .on_behalf_of_content_owner("labore") +/// .on_behalf_of_content_owner("nonumy") /// .doit(); /// # } /// ``` @@ -22098,10 +22443,10 @@ impl<'a, C, A> PlaylistItemUpdateCall<'a, C, A> where C: BorrowMut LiveChatMessageInsertCall<'a, C, A> where C: BorrowMut VideoCategoryListCall<'a, C, A> where C: BorrowMut } -/// Returns a list of content regions that the YouTube website supports. +/// Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user. /// -/// A builder for the *list* method supported by a *i18nRegion* resource. -/// It is not used directly, but through a `I18nRegionMethods` instance. +/// A builder for the *list* method supported by a *activity* resource. +/// It is not used directly, but through a `ActivityMethods` instance. /// /// # Example /// @@ -23102,29 +23447,43 @@ impl<'a, C, A> VideoCategoryListCall<'a, C, A> where C: BorrowMut /// // 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.i18n_regions().list("part") -/// .hl("dolor") +/// let result = hub.activities().list("part") +/// .region_code("sea") +/// .published_before("consetetur") +/// .published_after("diam") +/// .page_token("accusam") +/// .mine(false) +/// .max_results(55) +/// .home(false) +/// .channel_id("aliquyam") /// .doit(); /// # } /// ``` -pub struct I18nRegionListCall<'a, C, A> +pub struct ActivityListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a YouTube, _part: String, - _hl: Option, + _region_code: Option, + _published_before: Option, + _published_after: Option, + _page_token: Option, + _mine: Option, + _max_results: Option, + _home: Option, + _channel_id: Option, _delegate: Option<&'a mut dyn Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for I18nRegionListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ActivityListCall<'a, C, A> {} -impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, I18nRegionListResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ActivityListResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -23132,14 +23491,35 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "youtube.i18nRegions.list", + dlg.begin(MethodInfo { id: "youtube.activities.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + let mut params: Vec<(&str, String)> = Vec::with_capacity(11 + self._additional_params.len()); params.push(("part", self._part.to_string())); - if let Some(value) = self._hl { - params.push(("hl", value.to_string())); + if let Some(value) = self._region_code { + params.push(("regionCode", value.to_string())); } - for &field in ["alt", "part", "hl"].iter() { + if let Some(value) = self._published_before { + params.push(("publishedBefore", value.to_string())); + } + if let Some(value) = self._published_after { + params.push(("publishedAfter", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._mine { + params.push(("mine", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._home { + params.push(("home", value.to_string())); + } + if let Some(value) = self._channel_id { + params.push(("channelId", value.to_string())); + } + for &field in ["alt", "part", "regionCode", "publishedBefore", "publishedAfter", "pageToken", "mine", "maxResults", "home", "channelId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -23151,7 +23531,7 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "i18nRegions"; + let mut url = self.hub._base_url.clone() + "activities"; if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -23230,21 +23610,72 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A } - /// The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. + /// The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. + /// + /// If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. /// /// Sets the *part* query property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn part(mut self, new_value: &str) -> I18nRegionListCall<'a, C, A> { + pub fn part(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { self._part = new_value.to_string(); self } - /// The hl parameter specifies the language that should be used for text values in the API response. + /// The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed. /// - /// Sets the *hl* query property to the given value. - pub fn hl(mut self, new_value: &str) -> I18nRegionListCall<'a, C, A> { - self._hl = Some(new_value.to_string()); + /// Sets the *region code* query property to the given value. + pub fn region_code(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._region_code = Some(new_value.to_string()); + self + } + /// The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + /// + /// Sets the *published before* query property to the given value. + pub fn published_before(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._published_before = Some(new_value.to_string()); + self + } + /// The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + /// + /// Sets the *published after* query property to the given value. + pub fn published_after(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._published_after = Some(new_value.to_string()); + self + } + /// The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Set this parameter's value to true to retrieve a feed of the authenticated user's activities. + /// + /// Sets the *mine* query property to the given value. + pub fn mine(mut self, new_value: bool) -> ActivityListCall<'a, C, A> { + self._mine = Some(new_value); + self + } + /// The maxResults parameter specifies the maximum number of items that should be returned in the result set. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ActivityListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user. + /// + /// Sets the *home* query property to the given value. + pub fn home(mut self, new_value: bool) -> ActivityListCall<'a, C, A> { + self._home = Some(new_value); + self + } + /// The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities. + /// + /// Sets the *channel id* query property to the given value. + pub fn channel_id(mut self, new_value: &str) -> ActivityListCall<'a, C, A> { + self._channel_id = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -23253,7 +23684,7 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> I18nRegionListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ActivityListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -23274,7 +23705,7 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> I18nRegionListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ActivityListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -23294,7 +23725,265 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> I18nRegionListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ActivityListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + +/// Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.) +/// +/// Note: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite. +/// +/// A builder for the *insert* method supported by a *activity* resource. +/// It is not used directly, but through a `ActivityMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_youtube3 as youtube3; +/// use youtube3::Activity; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use youtube3::YouTube; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 = Activity::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.activities().insert(req) +/// .doit(); +/// # } +/// ``` +pub struct ActivityInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _request: Activity, + _part: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ActivityInsertCall<'a, C, A> {} + +impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Activity)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.activities.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + if self._part.len() == 0 { + self._part = self._request.to_parts(); + } + params.push(("part", self._part.to_string())); + for &field in ["alt", "part"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "activities"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Activity) -> ActivityInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + /// + /// Sets the *part* query property to the given value. + /// + /// Even though the *parts* list is automatically derived from *Resource* passed in + /// during instantiation and indicates which values you are passing, the response would contain the very same parts. + /// This may not always be desirable, as you can obtain (newly generated) parts you cannot pass in, + /// like statistics that are generated server side. Therefore you should use this method to specify + /// the parts you provide in addition to the ones you want in the response. + pub fn part(mut self, new_value: &str) -> ActivityInsertCall<'a, C, A> { + self._part = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> ActivityInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ActivityInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ActivityInsertCall<'a, C, A> where T: Into>, S: AsRef { match scope.into() { @@ -23562,214 +24251,6 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.subscriptions().delete("id") -/// .doit(); -/// # } -/// ``` -pub struct SubscriptionDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a YouTube, - _id: String, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for SubscriptionDeleteCall<'a, C, A> {} - -impl<'a, C, A> SubscriptionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "youtube.subscriptions.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); - params.push(("id", self._id.to_string())); - for &field in ["id"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "subscriptions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. - /// - /// Sets the *id* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn id(mut self, new_value: &str) -> SubscriptionDeleteCall<'a, C, A> { - self._id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SubscriptionDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> SubscriptionDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> SubscriptionDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns subscription resources that match the API request criteria. /// /// A builder for the *list* method supported by a *subscription* resource. @@ -24129,6 +24610,214 @@ impl<'a, C, A> SubscriptionListCall<'a, C, A> where C: BorrowMut, } +/// Deletes a subscription. +/// +/// A builder for the *delete* method supported by a *subscription* resource. +/// It is not used directly, but through a `SubscriptionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_youtube3 as youtube3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use youtube3::YouTube; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.subscriptions().delete("id") +/// .doit(); +/// # } +/// ``` +pub struct SubscriptionDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _id: String, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SubscriptionDeleteCall<'a, C, A> {} + +impl<'a, C, A> SubscriptionDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.subscriptions.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(2 + self._additional_params.len()); + params.push(("id", self._id.to_string())); + for &field in ["id"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "subscriptions"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. + /// + /// Sets the *id* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn id(mut self, new_value: &str) -> SubscriptionDeleteCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> SubscriptionDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SubscriptionDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SubscriptionDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Adds a new ban to the chat. /// /// A builder for the *insert* method supported by a *liveChatBan* resource. @@ -24636,9 +25325,9 @@ impl<'a, C, A> LiveChatBanDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.sponsors().list("part") -/// .page_token("et") -/// .max_results(56) -/// .filter("accusam") +/// .page_token("sadipscing") +/// .max_results(28) +/// .filter("magna") /// .doit(); /// # } /// ``` @@ -24911,7 +25600,7 @@ impl<'a, C, A> SponsorListCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.video_abuse_report_reasons().list("part") -/// .hl("Lorem") +/// .hl("rebum.") /// .doit(); /// # } /// ``` @@ -25119,6 +25808,285 @@ impl<'a, C, A> VideoAbuseReportReasonListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.members().list("part") +/// .page_token("clita") +/// .mode("eos") +/// .max_results(32) +/// .has_access_to_level("vero") +/// .filter_by_member_channel_id("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct MemberListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _part: String, + _page_token: Option, + _mode: Option, + _max_results: Option, + _has_access_to_level: Option, + _filter_by_member_channel_id: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for MemberListCall<'a, C, A> {} + +impl<'a, C, A> MemberListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, MemberListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.members.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(8 + self._additional_params.len()); + params.push(("part", self._part.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._mode { + params.push(("mode", value.to_string())); + } + if let Some(value) = self._max_results { + params.push(("maxResults", value.to_string())); + } + if let Some(value) = self._has_access_to_level { + params.push(("hasAccessToLevel", value.to_string())); + } + if let Some(value) = self._filter_by_member_channel_id { + params.push(("filterByMemberChannelId", value.to_string())); + } + for &field in ["alt", "part", "pageToken", "mode", "maxResults", "hasAccessToLevel", "filterByMemberChannelId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = self.hub._base_url.clone() + "members"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The part parameter specifies the member resource parts that the API response will include. Set the parameter value to snippet. + /// + /// Sets the *part* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn part(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._part = new_value.to_string(); + self + } + /// The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The mode parameter specifies which channel members to return. + /// + /// Sets the *mode* query property to the given value. + pub fn mode(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._mode = Some(new_value.to_string()); + self + } + /// The maxResults parameter specifies the maximum number of items that should be returned in the result set. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> MemberListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// The hasAccessToLevel parameter specifies, when set, the ID of a pricing level that members from the results set should have access to. When not set, all members will be considered, regardless of their active pricing level. + /// + /// Sets the *has access to level* query property to the given value. + pub fn has_access_to_level(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._has_access_to_level = Some(new_value.to_string()); + self + } + /// The filterByMemberChannelId parameter represents a comma separated list of channel IDs. Only data about members that are part of this list will be included in the response. It can be used to efficiently check whether specific users are entitled to perks offered via third parties. + /// + /// Sets the *filter by member channel id* query property to the given value. + pub fn filter_by_member_channel_id(mut self, new_value: &str) -> MemberListCall<'a, C, A> { + self._filter_by_member_channel_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> MemberListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> MemberListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> MemberListCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Controls the settings for a slate that can be displayed in the broadcast stream. /// /// A builder for the *control* method supported by a *liveBroadcast* resource. @@ -25163,10 +26131,10 @@ impl<'a, C, A> VideoAbuseReportReasonListCall<'a, C, A> where C: BorrowMut LiveBroadcastControlCall<'a, C, A> where C: BorrowMut LiveBroadcastUpdateCall<'a, C, A> where C: BorrowMut LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut LiveBroadcastInsertCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); -/// // 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.live_broadcasts().delete("id") -/// .on_behalf_of_content_owner_channel("ipsum") -/// .on_behalf_of_content_owner("invidunt") -/// .doit(); -/// # } -/// ``` -pub struct LiveBroadcastDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a YouTube, - _id: String, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _delegate: Option<&'a mut dyn Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for LiveBroadcastDeleteCall<'a, C, A> {} - -impl<'a, C, A> LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut dyn Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "youtube.liveBroadcasts.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); - params.push(("id", self._id.to_string())); - if let Some(value) = self._on_behalf_of_content_owner_channel { - params.push(("onBehalfOfContentOwnerChannel", value.to_string())); - } - if let Some(value) = self._on_behalf_of_content_owner { - params.push(("onBehalfOfContentOwner", value.to_string())); - } - for &field in ["id", "onBehalfOfContentOwnerChannel", "onBehalfOfContentOwner"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "liveBroadcasts"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - let url = hyper::Url::parse_with_params(&url, params).unwrap(); - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. - /// - /// Sets the *id* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn id(mut self, new_value: &str) -> LiveBroadcastDeleteCall<'a, C, A> { - self._id = new_value.to_string(); - self - } - /// This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. - /// - /// The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. - /// - /// This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - /// - /// Sets the *on behalf of content owner channel* query property to the given value. - pub fn on_behalf_of_content_owner_channel(mut self, new_value: &str) -> LiveBroadcastDeleteCall<'a, C, A> { - self._on_behalf_of_content_owner_channel = Some(new_value.to_string()); - self - } - /// Note: This parameter is intended exclusively for YouTube content partners. - /// - /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - /// - /// Sets the *on behalf of content owner* query property to the given value. - pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> LiveBroadcastDeleteCall<'a, C, A> { - self._on_behalf_of_content_owner = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LiveBroadcastDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known parameters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> LiveBroadcastDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// If `None` is specified, then all scopes will be removed and no default scope will be used either. - /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` - /// function for details). - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LiveBroadcastDeleteCall<'a, C, A> - where T: Into>, - S: AsRef { - match scope.into() { - Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), - None => None, - }; - self - } -} - - /// Returns a list of YouTube broadcasts that match the API request parameters. /// /// A builder for the *list* method supported by a *liveBroadcast* resource. @@ -26668,14 +27398,14 @@ impl<'a, C, A> LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut LiveBroadcastListCall<'a, C, A> where C: BorrowMut } +/// Deletes a broadcast. +/// +/// A builder for the *delete* method supported by a *liveBroadcast* resource. +/// It is not used directly, but through a `LiveBroadcastMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate hyper_rustls; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_youtube3 as youtube3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use youtube3::YouTube; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), +/// # ::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); +/// // 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.live_broadcasts().delete("id") +/// .on_behalf_of_content_owner_channel("consetetur") +/// .on_behalf_of_content_owner("erat") +/// .doit(); +/// # } +/// ``` +pub struct LiveBroadcastDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _id: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _delegate: Option<&'a mut dyn Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LiveBroadcastDeleteCall<'a, C, A> {} + +impl<'a, C, A> LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut dyn Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.liveBroadcasts.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len()); + params.push(("id", self._id.to_string())); + if let Some(value) = self._on_behalf_of_content_owner_channel { + params.push(("onBehalfOfContentOwnerChannel", value.to_string())); + } + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } + for &field in ["id", "onBehalfOfContentOwnerChannel", "onBehalfOfContentOwner"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = self.hub._base_url.clone() + "liveBroadcasts"; + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + let url = hyper::Url::parse_with_params(&url, params).unwrap(); + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, url.clone()) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. + /// + /// Sets the *id* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn id(mut self, new_value: &str) -> LiveBroadcastDeleteCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + /// + /// This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + /// + /// Sets the *on behalf of content owner channel* query property to the given value. + pub fn on_behalf_of_content_owner_channel(mut self, new_value: &str) -> LiveBroadcastDeleteCall<'a, C, A> { + self._on_behalf_of_content_owner_channel = Some(new_value.to_string()); + self + } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> LiveBroadcastDeleteCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut dyn Delegate) -> LiveBroadcastDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known parameters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> LiveBroadcastDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// If `None` is specified, then all scopes will be removed and no default scope will be used either. + /// In that case, you have to specify your API-key using the `key` parameter (see the `param()` + /// function for details). + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LiveBroadcastDeleteCall<'a, C, A> + where T: Into>, + S: AsRef { + match scope.into() { + Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()), + None => None, + }; + self + } +} + + /// Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast. /// /// A builder for the *bind* method supported by a *liveBroadcast* resource. @@ -27012,9 +27980,9 @@ impl<'a, C, A> LiveBroadcastListCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_broadcasts().bind("id", "part") -/// .stream_id("nonumy") -/// .on_behalf_of_content_owner_channel("takimata") -/// .on_behalf_of_content_owner("dolores") +/// .stream_id("dolores") +/// .on_behalf_of_content_owner_channel("et") +/// .on_behalf_of_content_owner("sed") /// .doit(); /// # } /// ``` @@ -27303,8 +28271,8 @@ impl<'a, C, A> LiveBroadcastBindCall<'a, C, A> where C: BorrowMut /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.channel_banners().insert(req) -/// .on_behalf_of_content_owner("consetetur") -/// .channel_id("erat") +/// .on_behalf_of_content_owner("et") +/// .channel_id("aliquyam") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -27674,36 +28642,36 @@ impl<'a, C, A> ChannelBannerInsertCall<'a, C, A> where C: BorrowMut SearchListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.super_chat_events().list("part") -/// .page_token("diam") -/// .max_results(62) -/// .hl("et") +/// .page_token("clita") +/// .max_results(21) +/// .hl("dolores") /// .doit(); /// # } /// ``` @@ -28545,7 +29513,7 @@ impl<'a, C, A> SuperChatEventListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with YouTube Reporting (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubereporting1-cli" @@ -42,4 +42,4 @@ rustls = ["yup-oauth2/no-openssl"] [dependencies.google-youtubereporting1] path = "../youtubereporting1" -version = "1.0.12+20190703" +version = "1.0.13+20200405" diff --git a/gen/youtubereporting1-cli/README.md b/gen/youtubereporting1-cli/README.md index 17e190bb49..1420844179 100644 --- a/gen/youtubereporting1-cli/README.md +++ b/gen/youtubereporting1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *YouTube Reporting* API at revision *20190703*. The CLI is at version *1.0.12*. +This documentation was generated from the *YouTube Reporting* API at revision *20200405*. The CLI is at version *1.0.13*. ```bash youtubereporting1 [options] diff --git a/gen/youtubereporting1-cli/mkdocs.yml b/gen/youtubereporting1-cli/mkdocs.yml index d6572d48cd..0caeebc1e6 100644 --- a/gen/youtubereporting1-cli/mkdocs.yml +++ b/gen/youtubereporting1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Reporting v1.0.12+20190703 +site_name: YouTube Reporting v1.0.13+20200405 site_url: http://byron.github.io/google-apis-rs/google-youtubereporting1-cli site_description: A complete library to interact with YouTube Reporting (protocol v1) diff --git a/gen/youtubereporting1-cli/src/main.rs b/gen/youtubereporting1-cli/src/main.rs index 5af5595b93..7a85c5968a 100644 --- a/gen/youtubereporting1-cli/src/main.rs +++ b/gen/youtubereporting1-cli/src/main.rs @@ -893,7 +893,7 @@ fn main() { let mut app = App::new("youtubereporting1") .author("Sebastian Thiel ") - .version("1.0.12+20190703") + .version("1.0.13+20200405") .about("Schedules reporting jobs containing your YouTube Analytics data and downloads the resulting bulk data reports in the form of CSV files.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_youtubereporting1_cli") .arg(Arg::with_name("url") diff --git a/gen/youtubereporting1/Cargo.toml b/gen/youtubereporting1/Cargo.toml index 04b7a9d67d..95742707be 100644 --- a/gen/youtubereporting1/Cargo.toml +++ b/gen/youtubereporting1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtubereporting1" -version = "1.0.12+20190703" +version = "1.0.13+20200405" authors = ["Sebastian Thiel "] description = "A complete library to interact with YouTube Reporting (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubereporting1" homepage = "https://developers.google.com/youtube/reporting/v1/reports/" -documentation = "https://docs.rs/google-youtubereporting1/1.0.12+20190703" +documentation = "https://docs.rs/google-youtubereporting1/1.0.13+20200405" license = "MIT" keywords = ["youtubereporting", "google", "protocol", "web", "api"] autobins = false diff --git a/gen/youtubereporting1/README.md b/gen/youtubereporting1/README.md index 2ab6162dc8..faccc5db43 100644 --- a/gen/youtubereporting1/README.md +++ b/gen/youtubereporting1/README.md @@ -5,25 +5,25 @@ DO NOT EDIT ! --> The `google-youtubereporting1` library allows access to all features of the *Google YouTube Reporting* service. -This documentation was generated from *YouTube Reporting* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +This documentation was generated from *YouTube Reporting* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. Everything else about the *YouTube Reporting* *v1* API can be found at the [official documentation site](https://developers.google.com/youtube/reporting/v1/reports/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.YouTubeReporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.YouTubeReporting.html) ... -* [jobs](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.Job.html) - * [*create*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.JobCreateCall.html), [*delete*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.JobDeleteCall.html), [*get*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.JobGetCall.html), [*list*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.JobListCall.html), [*reports get*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.JobReportGetCall.html) and [*reports list*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.JobReportListCall.html) +* [jobs](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.Job.html) + * [*create*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.JobCreateCall.html), [*delete*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.JobDeleteCall.html), [*get*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.JobGetCall.html), [*list*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.JobListCall.html), [*reports get*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.JobReportGetCall.html) and [*reports list*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.JobReportListCall.html) * media - * [*download*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.MediaDownloadCall.html) -* [report types](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.ReportType.html) - * [*list*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.ReportTypeListCall.html) + * [*download*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.MediaDownloadCall.html) +* [report types](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.ReportType.html) + * [*list*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.ReportTypeListCall.html) Download supported by ... -* [*download media*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.MediaDownloadCall.html) +* [*download media*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.MediaDownloadCall.html) @@ -31,17 +31,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/struct.YouTubeReporting.html)** +* **[Hub](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/struct.YouTubeReporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -143,17 +143,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.ResponseResult.html), it will return that by default. 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 this call: `.param("alt", "media")`. @@ -163,29 +163,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-youtubereporting1/1.0.12+20190703/google_youtubereporting1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtubereporting1/1.0.13+20200405/google_youtubereporting1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/youtubereporting1/src/lib.rs b/gen/youtubereporting1/src/lib.rs index 05b845eac8..7c5818fc66 100644 --- a/gen/youtubereporting1/src/lib.rs +++ b/gen/youtubereporting1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *YouTube Reporting* crate version *1.0.12+20190703*, where *20190703* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.12*. +//! This documentation was generated from *YouTube Reporting* crate version *1.0.13+20200405*, where *20200405* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.13*. //! //! Everything else about the *YouTube Reporting* *v1* API can be found at the //! [official documentation site](https://developers.google.com/youtube/reporting/v1/reports/). @@ -346,7 +346,7 @@ impl<'a, C, A> YouTubeReporting YouTubeReporting { client: RefCell::new(client), auth: RefCell::new(authenticator), - _user_agent: "google-api-rust-client/1.0.12".to_string(), + _user_agent: "google-api-rust-client/1.0.13".to_string(), _base_url: "https://youtubereporting.googleapis.com/".to_string(), _root_url: "https://youtubereporting.googleapis.com/".to_string(), } @@ -363,7 +363,7 @@ impl<'a, C, A> YouTubeReporting } /// Set the user-agent header field to use in all requests to the server. - /// It defaults to `google-api-rust-client/1.0.12`. + /// It defaults to `google-api-rust-client/1.0.13`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String {